@refrakt-md/editor 0.20.0 → 0.20.1
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/app/dist/assets/{index--THaxCLQ.js → index-5kiRRRrE.js} +1 -1
- package/app/dist/assets/{index-Dn1ol6U9.js → index-B24RQWJ9.js} +1 -1
- package/app/dist/assets/{index-OQlUIbEu.js → index-BJRvKrEo.js} +1 -1
- package/app/dist/assets/{index-Be3uH7Ic.js → index-BZoTikGe.js} +1 -1
- package/app/dist/assets/{index-CZfwRYIp.js → index-BbOIDH7O.js} +1 -1
- package/app/dist/assets/{index-B-h36weV.js → index-BkxyjB51.js} +1 -1
- package/app/dist/assets/{index-CNMIVdix.js → index-CHalG4dO.js} +1 -1
- package/app/dist/assets/{index-DuqiAylO.js → index-CJ-cmio3.js} +1 -1
- package/app/dist/assets/{index-eycSM0Ky.js → index-CaEK_xqh.js} +1 -1
- package/app/dist/assets/{index-BoovIh28.js → index-Cv0P6B1J.js} +1 -1
- package/app/dist/assets/{index-D67MmYM0.js → index-CwwphQI9.js} +19 -19
- package/app/dist/assets/{index-tigqumKr.js → index-D43YRW88.js} +1 -1
- package/app/dist/assets/{index-NZ_PL5ce.js → index-D87tBoCu.js} +1 -1
- package/app/dist/assets/{index-DHDXB_PN.js → index-DYv6EJCx.js} +1 -1
- package/app/dist/assets/{index-ChlNQT-L.js → index-DngmtYeQ.js} +1 -1
- package/app/dist/assets/{index-Dva5AxSS.js → index-DtoSl7Q7.js} +1 -1
- package/app/dist/assets/{index-_YLMqFUv.js → index-IhvOXVhc.js} +1 -1
- package/app/dist/assets/{index-CdBec525.js → index-OcTVp32J.js} +1 -1
- package/app/dist/assets/{index-CSu1hJPI.js → index-f2otjTL4.js} +1 -1
- package/app/dist/index.html +1 -1
- package/package.json +6 -6
|
@@ -292,7 +292,7 @@ ${t}
|
|
|
292
292
|
`);const y=new e("!xml");let S=y,A="",x="";for(let k=0;k<w.length;k++)if(w[k]==="<")if(w[k+1]==="/"){const T=v(w,">",k,"Closing Tag is not closed.");let $=w.substring(k+2,T).trim();if(this.options.removeNSPrefix){const q=$.indexOf(":");q!==-1&&($=$.substr(q+1))}this.options.transformTagName&&($=this.options.transformTagName($)),S&&(A=this.saveTextToParentTag(A,S,x));const L=x.substring(x.lastIndexOf(".")+1);if($&&this.options.unpairedTags.indexOf($)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${$}>`);let P=0;L&&this.options.unpairedTags.indexOf(L)!==-1?(P=x.lastIndexOf(".",x.lastIndexOf(".")-1),this.tagsNodeStack.pop()):P=x.lastIndexOf("."),x=x.substring(0,P),S=this.tagsNodeStack.pop(),A="",k=T}else if(w[k+1]==="?"){let T=b(w,k,!1,"?>");if(!T)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,S,x),!(this.options.ignoreDeclaration&&T.tagName==="?xml"||this.options.ignorePiTags)){const $=new e(T.tagName);$.add(this.options.textNodeName,""),T.tagName!==T.tagExp&&T.attrExpPresent&&($[":@"]=this.buildAttributesMap(T.tagExp,x,T.tagName)),this.addChild(S,$,x)}k=T.closeIndex+1}else if(w.substr(k+1,3)==="!--"){const T=v(w,"-->",k+4,"Comment is not closed.");if(this.options.commentPropName){const $=w.substring(k+4,T-2);A=this.saveTextToParentTag(A,S,x),S.add(this.options.commentPropName,[{[this.options.textNodeName]:$}])}k=T}else if(w.substr(k+1,2)==="!D"){const T=t(w,k);this.docTypeEntities=T.entities,k=T.i}else if(w.substr(k+1,2)==="!["){const T=v(w,"]]>",k,"CDATA is not closed.")-2,$=w.substring(k+9,T);A=this.saveTextToParentTag(A,S,x);let L=this.parseTextData($,S.tagname,x,!0,!1,!0,!0);L==null&&(L=""),this.options.cdataPropName?S.add(this.options.cdataPropName,[{[this.options.textNodeName]:$}]):S.add(this.options.textNodeName,L),k=T+2}else{let T=b(w,k,this.options.removeNSPrefix),$=T.tagName;const L=T.rawTagName;let P=T.tagExp,q=T.attrExpPresent,R=T.closeIndex;this.options.transformTagName&&($=this.options.transformTagName($)),S&&A&&S.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,S,x,!1));const W=S;if(W&&this.options.unpairedTags.indexOf(W.tagname)!==-1&&(S=this.tagsNodeStack.pop(),x=x.substring(0,x.lastIndexOf("."))),$!==y.tagname&&(x+=x?"."+$:$),this.isItStopNode(this.options.stopNodes,x,$)){let U="";if(P.length>0&&P.lastIndexOf("/")===P.length-1)$[$.length-1]==="/"?($=$.substr(0,$.length-1),x=x.substr(0,x.length-1),P=$):P=P.substr(0,P.length-1),k=T.closeIndex;else if(this.options.unpairedTags.indexOf($)!==-1)k=T.closeIndex;else{const ce=this.readStopNodeData(w,L,R+1);if(!ce)throw new Error(`Unexpected end of ${L}`);k=ce.i,U=ce.tagContent}const ie=new e($);$!==P&&q&&(ie[":@"]=this.buildAttributesMap(P,x,$)),U&&(U=this.parseTextData(U,$,x,!0,q,!0,!0)),x=x.substr(0,x.lastIndexOf(".")),ie.add(this.options.textNodeName,U),this.addChild(S,ie,x)}else{if(P.length>0&&P.lastIndexOf("/")===P.length-1){$[$.length-1]==="/"?($=$.substr(0,$.length-1),x=x.substr(0,x.length-1),P=$):P=P.substr(0,P.length-1),this.options.transformTagName&&($=this.options.transformTagName($));const U=new e($);$!==P&&q&&(U[":@"]=this.buildAttributesMap(P,x,$)),this.addChild(S,U,x),x=x.substr(0,x.lastIndexOf("."))}else{const U=new e($);this.tagsNodeStack.push(S),$!==P&&q&&(U[":@"]=this.buildAttributesMap(P,x,$)),this.addChild(S,U,x),S=U}A="",k=R}}else A+=w[k];return y.child};function d(w,y,S){const A=this.options.updateTag(y.tagname,S,y[":@"]);A===!1||(typeof A=="string"&&(y.tagname=A),w.addChild(y))}const h=function(w){if(this.options.processEntities){for(let y in this.docTypeEntities){const S=this.docTypeEntities[y];w=w.replace(S.regx,S.val)}for(let y in this.lastEntities){const S=this.lastEntities[y];w=w.replace(S.regex,S.val)}if(this.options.htmlEntities)for(let y in this.htmlEntities){const S=this.htmlEntities[y];w=w.replace(S.regex,S.val)}w=w.replace(this.ampEntity.regex,this.ampEntity.val)}return w};function m(w,y,S,A){return w&&(A===void 0&&(A=Object.keys(y.child).length===0),w=this.parseTextData(w,y.tagname,S,!1,y[":@"]?Object.keys(y[":@"]).length!==0:!1,A),w!==void 0&&w!==""&&y.add(this.options.textNodeName,w),w=""),w}function p(w,y,S){const A="*."+S;for(const x in w){const k=w[x];if(A===k||y===k)return!0}return!1}function O(w,y,S=">"){let A,x="";for(let k=y;k<w.length;k++){let E=w[k];if(A)E===A&&(A="");else if(E==='"'||E==="'")A=E;else if(E===S[0])if(S[1]){if(w[k+1]===S[1])return{data:x,index:k}}else return{data:x,index:k};else E===" "&&(E=" ");x+=E}}function v(w,y,S,A){const x=w.indexOf(y,S);if(x===-1)throw new Error(A);return x+y.length-1}function b(w,y,S,A=">"){const x=O(w,y+1,A);if(!x)return;let k=x.data;const E=x.index,T=k.search(/\s/);let $=k,L=!0;T!==-1&&($=k.substring(0,T),k=k.substring(T+1).trimStart());const P=$;if(S){const q=$.indexOf(":");q!==-1&&($=$.substr(q+1),L=$!==x.data.substr(q+1))}return{tagName:$,tagExp:k,closeIndex:E,attrExpPresent:L,rawTagName:P}}function _(w,y,S){const A=S;let x=1;for(;S<w.length;S++)if(w[S]==="<")if(w[S+1]==="/"){const k=v(w,">",S,`${y} is not closed`);if(w.substring(S+2,k).trim()===y&&(x--,x===0))return{tagContent:w.substring(A,S),i:k};S=k}else if(w[S+1]==="?")S=v(w,"?>",S+1,"StopNode is not closed.");else if(w.substr(S+1,3)==="!--")S=v(w,"-->",S+3,"StopNode is not closed.");else if(w.substr(S+1,2)==="![")S=v(w,"]]>",S,"StopNode is not closed.")-2;else{const k=b(w,S,">");k&&((k&&k.tagName)===y&&k.tagExp[k.tagExp.length-1]!=="/"&&x++,S=k.closeIndex)}}function C(w,y,S){if(y&&typeof w=="string"){const A=w.trim();return A==="true"?!0:A==="false"?!1:r(w,S)}else return n.isExist(w)?w:""}return pp=s,pp}var mp={},f0;function mj(){if(f0)return mp;f0=1;function n(s,o){return e(s,o)}function e(s,o,a){let l;const c={};for(let u=0;u<s.length;u++){const f=s[u],d=t(f);let h="";if(a===void 0?h=d:h=a+"."+d,d===o.textNodeName)l===void 0?l=f[d]:l+=""+f[d];else{if(d===void 0)continue;if(f[d]){let m=e(f[d],o,h);const p=i(m,o);f[":@"]?r(m,f[":@"],h,o):Object.keys(m).length===1&&m[o.textNodeName]!==void 0&&!o.alwaysCreateTextNode?m=m[o.textNodeName]:Object.keys(m).length===0&&(o.alwaysCreateTextNode?m[o.textNodeName]="":m=""),c[d]!==void 0&&c.hasOwnProperty(d)?(Array.isArray(c[d])||(c[d]=[c[d]]),c[d].push(m)):o.isArray(d,h,p)?c[d]=[m]:c[d]=m}}}return typeof l=="string"?l.length>0&&(c[o.textNodeName]=l):l!==void 0&&(c[o.textNodeName]=l),c}function t(s){const o=Object.keys(s);for(let a=0;a<o.length;a++){const l=o[a];if(l!==":@")return l}}function r(s,o,a,l){if(o){const c=Object.keys(o),u=c.length;for(let f=0;f<u;f++){const d=c[f];l.isArray(d,a+"."+d,!0,!0)?s[d]=[o[d]]:s[d]=o[d]}}}function i(s,o){const{textNodeName:a}=o,l=Object.keys(s).length;return!!(l===0||l===1&&(s[a]||typeof s[a]=="boolean"||s[a]===0))}return mp.prettify=n,mp}var gp,d0;function gj(){if(d0)return gp;d0=1;const{buildOptions:n}=uj(),e=pj(),{prettify:t}=mj(),r=eC();class i{constructor(o){this.externalEntities={},this.options=n(o)}parse(o,a){if(typeof o!="string")if(o.toString)o=o.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(a){a===!0&&(a={});const u=r.validate(o,a);if(u!==!0)throw Error(`${u.err.msg}:${u.err.line}:${u.err.col}`)}const l=new e(this.options);l.addExternalEntities(this.externalEntities);const c=l.parseXml(o);return this.options.preserveOrder||c===void 0?c:t(c,this.options)}addEntity(o,a){if(a.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(o.indexOf("&")!==-1||o.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(a==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[o]=a}}return gp=i,gp}var Op,h0;function Oj(){if(h0)return Op;h0=1;const n=`
|
|
293
293
|
`;function e(a,l){let c="";return l.format&&l.indentBy.length>0&&(c=n),t(a,l,"",c)}function t(a,l,c,u){let f="",d=!1;for(let h=0;h<a.length;h++){const m=a[h],p=r(m);if(p===void 0)continue;let O="";if(c.length===0?O=p:O=`${c}.${p}`,p===l.textNodeName){let w=m[p];s(O,l)||(w=l.tagValueProcessor(p,w),w=o(w,l)),d&&(f+=u),f+=w,d=!1;continue}else if(p===l.cdataPropName){d&&(f+=u),f+=`<![CDATA[${m[p][0][l.textNodeName]}]]>`,d=!1;continue}else if(p===l.commentPropName){f+=u+`<!--${m[p][0][l.textNodeName]}-->`,d=!0;continue}else if(p[0]==="?"){const w=i(m[":@"],l),y=p==="?xml"?"":u;let S=m[p][0][l.textNodeName];S=S.length!==0?" "+S:"",f+=y+`<${p}${S}${w}?>`,d=!0;continue}let v=u;v!==""&&(v+=l.indentBy);const b=i(m[":@"],l),_=u+`<${p}${b}`,C=t(m[p],l,O,v);l.unpairedTags.indexOf(p)!==-1?l.suppressUnpairedNode?f+=_+">":f+=_+"/>":(!C||C.length===0)&&l.suppressEmptyNode?f+=_+"/>":C&&C.endsWith(">")?f+=_+`>${C}${u}</${p}>`:(f+=_+">",C&&u!==""&&(C.includes("/>")||C.includes("</"))?f+=u+l.indentBy+C+u:f+=C,f+=`</${p}>`),d=!0}return f}function r(a){const l=Object.keys(a);for(let c=0;c<l.length;c++){const u=l[c];if(a.hasOwnProperty(u)&&u!==":@")return u}}function i(a,l){let c="";if(a&&!l.ignoreAttributes)for(let u in a){if(!a.hasOwnProperty(u))continue;let f=l.attributeValueProcessor(u,a[u]);f=o(f,l),f===!0&&l.suppressBooleanAttributes?c+=` ${u.substr(l.attributeNamePrefix.length)}`:c+=` ${u.substr(l.attributeNamePrefix.length)}="${f}"`}return c}function s(a,l){a=a.substr(0,a.length-l.textNodeName.length-1);let c=a.substr(a.lastIndexOf(".")+1);for(let u in l.stopNodes)if(l.stopNodes[u]===a||l.stopNodes[u]==="*."+c)return!0;return!1}function o(a,l){if(a&&a.length>0&&l.processEntities)for(let c=0;c<l.entities.length;c++){const u=l.entities[c];a=a.replace(u.regex,u.val)}return a}return Op=e,Op}var vp,p0;function vj(){if(p0)return vp;p0=1;const n=Oj(),e=tC(),t={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(a,l){return l},attributeValueProcessor:function(a,l){return l},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function r(a){this.options=Object.assign({},t,a),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=e(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=o),this.processTextOrObjNode=i,this.options.format?(this.indentate=s,this.tagEndChar=`>
|
|
294
294
|
`,this.newLine=`
|
|
295
|
-
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}r.prototype.build=function(a){return this.options.preserveOrder?n(a,this.options):(Array.isArray(a)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(a={[this.options.arrayNodeName]:a}),this.j2x(a,0,[]).val)},r.prototype.j2x=function(a,l,c){let u="",f="";const d=c.join(".");for(let h in a)if(Object.prototype.hasOwnProperty.call(a,h))if(typeof a[h]>"u")this.isAttribute(h)&&(f+="");else if(a[h]===null)this.isAttribute(h)?f+="":h[0]==="?"?f+=this.indentate(l)+"<"+h+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+h+"/"+this.tagEndChar;else if(a[h]instanceof Date)f+=this.buildTextValNode(a[h],h,"",l);else if(typeof a[h]!="object"){const m=this.isAttribute(h);if(m&&!this.ignoreAttributesFn(m,d))u+=this.buildAttrPairStr(m,""+a[h]);else if(!m)if(h===this.options.textNodeName){let p=this.options.tagValueProcessor(h,""+a[h]);f+=this.replaceEntitiesValue(p)}else f+=this.buildTextValNode(a[h],h,"",l)}else if(Array.isArray(a[h])){const m=a[h].length;let p="",O="";for(let v=0;v<m;v++){const b=a[h][v];if(!(typeof b>"u"))if(b===null)h[0]==="?"?f+=this.indentate(l)+"<"+h+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+h+"/"+this.tagEndChar;else if(typeof b=="object")if(this.options.oneListGroup){const _=this.j2x(b,l+1,c.concat(h));p+=_.val,this.options.attributesGroupName&&b.hasOwnProperty(this.options.attributesGroupName)&&(O+=_.attrStr)}else p+=this.processTextOrObjNode(b,h,l,c);else if(this.options.oneListGroup){let _=this.options.tagValueProcessor(h,b);_=this.replaceEntitiesValue(_),p+=_}else p+=this.buildTextValNode(b,h,"",l)}this.options.oneListGroup&&(p=this.buildObjectNode(p,h,O,l)),f+=p}else if(this.options.attributesGroupName&&h===this.options.attributesGroupName){const m=Object.keys(a[h]),p=m.length;for(let O=0;O<p;O++)u+=this.buildAttrPairStr(m[O],""+a[h][m[O]])}else f+=this.processTextOrObjNode(a[h],h,l,c);return{attrStr:u,val:f}},r.prototype.buildAttrPairStr=function(a,l){return l=this.options.attributeValueProcessor(a,""+l),l=this.replaceEntitiesValue(l),this.options.suppressBooleanAttributes&&l==="true"?" "+a:" "+a+'="'+l+'"'};function i(a,l,c,u){const f=this.j2x(a,c+1,u.concat(l));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],l,f.attrStr,c):this.buildObjectNode(f.val,l,f.attrStr,c)}r.prototype.buildObjectNode=function(a,l,c,u){if(a==="")return l[0]==="?"?this.indentate(u)+"<"+l+c+"?"+this.tagEndChar:this.indentate(u)+"<"+l+c+this.closeTag(l)+this.tagEndChar;{let f="</"+l+this.tagEndChar,d="";return l[0]==="?"&&(d="?",f=""),(c||c==="")&&a.indexOf("<")===-1?this.indentate(u)+"<"+l+c+d+">"+a+f:this.options.commentPropName!==!1&&l===this.options.commentPropName&&d.length===0?this.indentate(u)+`<!--${a}-->`+this.newLine:this.indentate(u)+"<"+l+c+d+this.tagEndChar+a+this.indentate(u)+f}},r.prototype.closeTag=function(a){let l="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(l="/"):this.options.suppressEmptyNode?l="/":l=`></${a}`,l},r.prototype.buildTextValNode=function(a,l,c,u){if(this.options.cdataPropName!==!1&&l===this.options.cdataPropName)return this.indentate(u)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&l===this.options.commentPropName)return this.indentate(u)+`<!--${a}-->`+this.newLine;if(l[0]==="?")return this.indentate(u)+"<"+l+c+"?"+this.tagEndChar;{let f=this.options.tagValueProcessor(l,a);return f=this.replaceEntitiesValue(f),f===""?this.indentate(u)+"<"+l+c+this.closeTag(l)+this.tagEndChar:this.indentate(u)+"<"+l+c+">"+f+"</"+l+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let l=0;l<this.options.entities.length;l++){const c=this.options.entities[l];a=a.replace(c.regex,c.val)}return a};function s(a){return this.options.indentBy.repeat(a)}function o(a){return a.startsWith(this.options.attributeNamePrefix)&&a!==this.options.textNodeName?a.substr(this.attrPrefixLen):!1}return vp=r,vp}var bp,m0;function bj(){if(m0)return bp;m0=1;const n=eC(),e=gj(),t=vj();return bp={XMLParser:e,XMLValidator:n,XMLBuilder:t},bp}var yj=bj();const wj="RFTO",_j="RFTC";function kj(n){return n.includes("")?n.replaceAll(wj,"{%").replaceAll(_j,"%}"):n}const{dirname:nC,join:rC,isAbsolute:xj}=cj,{Tag:wi}=B,Sj={children:["inline"],attributes:{level:{type:"Number",required:!0,render:!1},property:{type:String,required:!1}},transform(n,e){const t=n.transformAttributes(e),r=n.transformChildren(e);return(!t.id||typeof t.id!="string")&&(t.id=r.filter(i=>typeof i=="string").join(" ").replace(/[?{}%]/g,"").replace(/\s+/g,"-").toLowerCase()),new wi(`h${n.attributes.level}`,t,r)}},Aj={children:["inline"],attributes:{property:{type:String,required:!1}},render:"p"},Cj={render:"fence",attributes:{content:{type:String,render:!1},process:{type:Boolean,render:!1,default:!1},language:{type:String,render:!1,default:"shell"},source:{type:String,render:!1},lines:{type:String,render:!1},linenumbers:{type:Boolean,render:!1,default:!1},highlight:{type:String,render:!1},label:{type:String,render:!1}},transform(n,e){const t=n.attributes.language||"shell",r={"data-language":t},i={"data-language":t},s=n.attributes.source;typeof s=="string"&&s.length>0&&(r["data-source"]=s,i["data-source"]=s);const o=n.attributes.lines;if(typeof o=="string"&&o.length>0){r["data-lines"]=o,i["data-lines"]=o;const c=/^(\d+)/.exec(o.trim());if(c){const u=Number(c[1]);if(Number.isFinite(u)&&u>0){const f=typeof r.style=="string"?`${r.style}; `:"";r.style=`${f}--rf-start-line: ${u-1}`}}}n.attributes.linenumbers===!0&&(r["data-linenumbers"]="true",i["data-linenumbers"]="true");const a=n.attributes.highlight;typeof a=="string"&&a.length>0&&(r["data-highlight-lines"]=a,i["data-highlight-lines"]=a);for(const[c,u]of Object.entries(n.attributes))c.startsWith("data-")&&(r[c]=u,i[c]=u);const l=new wi("pre",r,[new wi("code",i,[kj(n.attributes.content)])]);return new wi("div",{class:"rf-codeblock"},[l])}},Tj={children:["item"],attributes:{ordered:{type:Boolean,render:!1,required:!0},start:{type:Number},marker:{type:String,render:!1}},transform(n,e){return new wi(n.attributes.ordered?"ol":"ul",n.transformAttributes(e),n.transformChildren(e))}},Pj={render:"li",children:["inline","heading","paragraph","image","table","tag","fence","blockquote","list","hr"],attributes:{property:{type:String,required:!1},typeof:{type:String,required:!1}}},Ej={render:"em",children:["strong","s","link","code","text","tag"],attributes:{marker:{type:String,render:!0}}},$j={render:"strong",children:["em","s","link","code","text","tag"],attributes:{marker:{type:String,render:!0}}},Qj={attributes:{content:{type:String,required:!0},property:{type:String,required:!1}},transform(n,e){const t=n.transformAttributes(e);return t.property?new wi("span",{"data-field":t.property},[n.attributes.content]):n.attributes.content}},iC={children:["strong","em","s","code","text","tag"],attributes:{href:{type:String,required:!0},title:{type:String}},render:"a",transform(n,e){const{urls:t,path:r}=e.variables||{},i=r?nC(r):"/";let s=n.attributes;const o=i!=="/"?rC(i,n.attributes.href):n.attributes.href;if(o in(t||{})){const a=t[o];s={...s,href:a}}return new wi(this.render,s,n.transformChildren(e))}},Lj=B.nodes.hardbreak,Mj={render:"img",attributes:{src:{type:String,required:!0},alt:{type:String},title:{type:String},property:{type:String}},transform(n,e){const t=n.transformAttributes(e),r=e.variables?.svg||[];let i=n.attributes.src;!xj(i)&&e.variables?.path&&(i=rC("/",nC(e.variables.path),i));const s=r.find(o=>o._id===i);if(s){let a=new yj.XMLParser({ignoreAttributes:!1}).parse(s.content);const l=ig("svg",a.svg);return t.property&&(l.attributes["data-field"]=t.property),l.attributes.xmlns=void 0,l}return new wi(this.render,t,n.transformChildren(e))}},qj={children:["thead","tbody","tr"],attributes:{},transform(n,e){const t=new wi("table",n.transformAttributes(e),n.transformChildren(e));return new wi("div",{class:"rf-table-wrapper"},[t])}};function ig(n,e){if(Array.isArray(e))return e.map(i=>ig(n,i));let t=[],r={};for(const[i,s]of Object.entries(e))i.startsWith("@_")?r[i.slice(2)]=s:i==="#text"?t.push(s):t.push(ig(i,s));return new wi(n,r,t)}const{Tag:yU}=B,{Ast:pf}=B;function Dj(n){let e,t;return{filtered:n.filter(i=>i.type==="tag"&&i.tag==="tint"?(e=i,!1):i.type==="tag"&&i.tag==="bg"?(t=i,!1):!0),tintNode:e,bgNode:t}}function Ec(n,e){if(e==="any")return!0;if(e.includes("|"))return e.split("|").some(t=>Ec(n,t));if(e.startsWith("heading:")){const t=parseInt(e.slice(8),10);return n.type==="heading"&&n.attributes?.level===t}if(e==="list:ordered")return n.type==="list"&&n.attributes?.ordered===!0;if(e==="list:unordered")return n.type==="list"&&n.attributes?.ordered!==!0;if(e.startsWith("tag:")){const t=e.slice(4);return n.type==="tag"&&n.tag===t}return n.type===e}function _a(n,e){const t={};let r=0;for(const i of e){if(r>=n.length)continue;const s=n[r];if(Ec(s,i.match)){if(i.greedy){const o=[];for(;r<n.length&&Ec(n[r],i.match);)o.push(n[r]),r++;t[i.name]=o}else t[i.name]=s,r++;if(i.itemModel)if(i.emitTag){const o=i.greedy?t[i.name]:[t[i.name]],a=[];for(const l of o){if(!l||l.type!=="list")continue;const c=sg(l,i.itemModel),u=l.children??[];for(let f=0;f<c.length;f++){const d={},h=i.emitAttributes;if(h)for(const[p,O]of Object.entries(h))if(O.startsWith("$")){const v=O.slice(1).split("|");d[p]=v.map(b=>c[f][b.trim()]).find(b=>b!=null&&b!=="")??""}else d[p]=O;const m=u[f]?.children?.slice(1)??[];a.push(new pf.Node("tag",d,m,i.emitTag))}}t[i.name]=a}else{const o=t[i.name];o&&typeof o=="object"&&"type"in o&&(t[`${i.name}Data`]=sg(o,i.itemModel))}}else i.optional||r++}return t}function Rj(n,e){const t=[[]];for(const i of n)Ec(i,e.delimiter)?t.push([]):t[t.length-1].push(i);if(e.dynamicZones&&e.zoneModel)return{zones:t.map(i=>$c(i,e.zoneModel))};const r={};if(e.zones){const i=t.length===1?e.zones.findIndex(s=>s.primary):-1;for(let s=0;s<e.zones.length;s++){const o=e.zones[s];let a;i>=0?a=s===i?t[0]:[]:a=s<t.length?t[s]:[],r[o.name]=_a(a,o.fields)}}return r}function g0(n){const e=[];for(const t of n.walk())t.type==="text"&&t.attributes?.content&&e.push(t.attributes.content);return e.join(" ")}function O0(n,e){const t={};let r=n;for(const i of e.fields)if(i.pattern==="remainder")t[i.name]=r.trim(),r="";else{const s=r.match(i.pattern);s?(t[i.name]=(s[1]||s[0]).trim(),r=r.slice(s[0].length)):i.optional||(t[i.name]=r.trim())}return t}function Ij(n,e){const t=n.toLowerCase().trim();for(const[r,i]of Object.entries(e)){if(r.toLowerCase()===t)return{canonicalName:r,definition:i};if(i.alias){for(const s of i.alias)if(s.toLowerCase()===t)return{canonicalName:r,definition:i}}}}function Nj(n,e){const t=e.sectionHeading;let r;if(t.includes(":"))r=parseInt(t.split(":")[1],10);else{const c=n.filter(u=>u.type==="heading");if(c.length>=2){const u=c[0].attributes?.level,f=c[1].attributes?.level;u!==void 0&&f!==void 0&&f>u?r=c.filter(h=>h.attributes?.level===f).length>=2?f:u:r=u}else r=c[0]?.attributes?.level}if(r===void 0){if(e.implicitSection&&e.emitTag){const u=e.fields?_a([],e.fields):{},f=new pf.Node("tag",{...e.implicitSection.attributes??{}},n,e.emitTag);return{...u,sections:[f]}}return{...e.fields?_a(n,e.fields):{},sections:[]}}const i=[],s=[];let o=null;for(const c of n)c.type==="heading"&&c.attributes?.level===r?(o&&s.push(o),o={headingNode:c,body:[]}):o?o.body.push(c):i.push(c);if(o&&s.push(o),s.length===0&&e.implicitSection&&e.emitTag){const c=e.fields?_a([],e.fields):{},u=new pf.Node("tag",{...e.implicitSection.attributes??{}},n,e.emitTag);return{...c,sections:[u]}}const a=e.fields?_a(i,e.fields):{};if(e.emitTag){const c=s.map(u=>{const f=g0(u.headingNode),d=e.headingExtract?O0(f,e.headingExtract):{},h={};if(e.emitAttributes)for(const[m,p]of Object.entries(e.emitAttributes))p==="$heading"?h[m]=f:p.startsWith("$")?h[m]=d[p.slice(1)]??"":h[m]=p;return new pf.Node("tag",h,u.body,e.emitTag)});return{...a,sections:c}}const l=s.map(c=>{const u=g0(c.headingNode),f=e.headingExtract?O0(u,e.headingExtract):{},d=e.knownSections?Ij(u,e.knownSections):void 0,h=d?.definition.model??e.sectionModel,m=$c(c.body,h);return{$heading:u,$headingNode:c.headingNode,...d?{$canonicalName:d.canonicalName}:{},...Object.fromEntries(Object.entries(f).map(([p,O])=>[`$${p}`,O])),...m}});return{...a,sections:l}}function Bj(n,e,t){if("hasChild"in n)return e.some(r=>Ec(r,n.hasChild));if("in"in n){const r=String(t[n.attribute]??"");return n.in.includes(r)}return"exists"in n?t[n.attribute]!=null&&t[n.attribute]!=="":!1}function jj(n){return"when"in n&&Array.isArray(n.when)}function zj(n){if(n.type==="text")return n.attributes?.content??"";const e=[];for(const t of n.walk())t.type==="text"&&t.attributes?.content&&e.push(t.attributes.content);return e.join("")}function Zj(n,e){if(n.type===e)return n;if(n.type==="link"&&e!=="link"){for(const t of n.children??[])if(t.type===e)return t}if((n.type==="strong"||n.type==="em")&&e!==n.type){for(const t of n.children??[])if(t.type===e)return t}return null}function sg(n,e){return(n.children??[]).map(r=>{const i={},s=[];for(const c of r.children??[])c.type==="inline"?s.push(...c.children??[]):s.push(c);const o=new Set,a=new Set;for(const c of e.fields)if(c.match!=="text"){if(c.match==="list"){const u=s.findIndex((f,d)=>!o.has(d)&&f.type==="list");u>=0&&(o.add(u),i[c.name]=c.itemModel?sg(s[u],c.itemModel):s[u]);continue}if(c.match==="paragraph"&&c.greedy){const u=[];s.forEach((f,d)=>{!o.has(d)&&f.type==="paragraph"&&(o.add(d),u.push(f))}),u.length>0&&(i[c.name]=u);continue}for(let u=0;u<s.length;u++){if(o.has(u)||a.has(u)&&c.match!==s[u].type)continue;const f=s[u],d=Zj(f,c.match);if(d){if(d===f?o.add(u):a.add(u),c.extract){const h=f.attributes?.[c.extract]!=null?f:d;i[c.name]=h.attributes?.[c.extract]}else i[c.name]=zj(d);break}}}for(const c of a)o.add(c);const l=e.fields.filter(c=>c.match==="text");if(l.length>0){let u=s.filter((f,d)=>!o.has(d)).filter(f=>f.type==="text"||f.type==="softbreak").map(f=>f.attributes?.content??"").join("").trim();for(const f of l)if(f.pattern==="remainder"){const d=u.trim();(d||!f.optional)&&(i[f.name]=d)}else if(f.pattern instanceof RegExp){const d=u.match(f.pattern);d&&(i[f.name]=d[1]??d[0],u=u.replace(f.pattern,""))}}return i})}function $c(n,e,t){if(jj(e)){for(const r of e.when)if(Bj(r.condition,n,t??{}))return $c(n,r.model,t);return $c(n,e.default,t)}switch(e.type){case"sequence":return _a(n,e.fields);case"sections":return Nj(n,e);case"delimited":return Rj(n,e);case"custom":return{children:e.processChildren(n,t??{})};default:return{}}}function Fj(n,e,t){const{filtered:r,tintNode:i,bgNode:s}=Dj(n);return{content:$c(r,e,t),tintNode:i,bgNode:s}}const Xj=new Map;function Vj(n,e){Xj.set(n,e)}const Wj=new WeakMap;function ys(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function gn(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&n.$$mdtype==="Tag"}function $t(n,e={},t=[]){return{$$mdtype:"Tag",name:n,attributes:e,children:t}}function Yj(n,e){const t=ys(e);return n.children.find(r=>gn(r)&&r.name==="meta"&&r.attributes["data-field"]===t)}function Zt(n,e,t){return Yj(n,e)?.attributes.content??t}function Uj(n){const e=n.attributes?.["data-rune-fields"];if(typeof e!="string"||e.length===0)return{};try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Co(n,e,t){const i=Uj(n)[e];if(i!=null&&typeof i!="object")return typeof i=="string"?i:String(i);const s=ys(e),o=(n.children??[]).find(a=>!!a&&typeof a=="object"&&a.$$mdtype==="Tag"&&a.name==="meta"&&a.attributes?.["data-field"]===s);return o?o.attributes.content:void 0}const Gj={none:"0",tight:"var(--rf-spacing-sm)",default:"var(--rf-spacing-md)",loose:"var(--rf-spacing-xl)"};function Hj(n){return Gj[n]??n}function Kj(n){return n.split(/\s+/).map(e=>`${e}fr`).join(" ")}const yp={none:"0",sm:"var(--rf-spacing-sm)",md:"var(--rf-spacing-md)",lg:"var(--rf-spacing-lg)",xl:"var(--rf-spacing-xl)"};function Jj(n){const e=yp[n];return e===void 0?(console.warn(`[refrakt] Unknown offset "${n}" — expected one of ${Object.keys(yp).join(", ")}. Falling back to "none".`),yp.none):e}const ez={top:"start",center:"center",bottom:"end",stretch:"stretch",baseline:"baseline"};function v0(n){return ez[n]??n}const tz={left:{x:"start",y:"center"},center:{x:"center",y:"center"},right:{x:"end",y:"center"},top:{x:"center",y:"start"},bottom:{x:"center",y:"end"},"top left":{x:"start",y:"start"},"top center":{x:"center",y:"start"},"top right":{x:"end",y:"start"},"bottom left":{x:"start",y:"end"},"bottom center":{x:"center",y:"end"},"bottom right":{x:"end",y:"end"}};function nz(n){return tz[n]??{x:"center",y:"center"}}function rz(n,e){if(!n)return e;const t={...n,...e};if((n.metaFields||e.metaFields)&&(t.metaFields={...n.metaFields,...e.metaFields}),n.blocks||e.blocks){const r={...n.blocks};if(e.blocks)for(const[i,s]of Object.entries(e.blocks))r[i]=s;t.blocks=r}if((n.layout||e.layout)&&(t.layout={...n.layout,...e.layout}),n.variants||e.variants){const r={...n.variants};if(e.variants)for(const[i,s]of Object.entries(e.variants))r[i]={...r[i],...s};t.variants=r}return t}const iz=["bg","surface","text","muted","primary","border"],hd={duration(n){const e=n.match(/PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?/);if(!e)return n;const t=[];return e[1]&&t.push(`${e[1]}h`),e[2]&&t.push(`${e[2]}m`),e[3]&&t.push(`${e[3]}s`),t.join(" ")||n},uppercase:n=>n.toUpperCase(),capitalize:n=>n.charAt(0).toUpperCase()+n.slice(1)};function sz(n){const{prefix:e,runes:t,icons:r={},tints:i={},backgrounds:s={},frames:o={}}=n,a=new Map(Object.keys(t).map(c=>[ys(c),c]));function l(c,u){if(c==null||typeof c=="string"||typeof c=="number")return c;if(Array.isArray(c))return c.map(h=>l(h,u));if(!gn(c))return c;const f=c.attributes?.["data-rune"],d=f?a.get(f):void 0;if(d)return Oz(c,t[d],e,r,i,s,o,t,a,l,u);if(c.name==="li"){const h=vz(c);if(h)return{...h,children:h.children.map(m=>l(m,u))}}return{...c,children:c.children.map(h=>l(h,u))}}return c=>l(c)}function oz(n){if(typeof n!="string"||n.length===0)return{};try{const e=JSON.parse(n);return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}catch{return{}}}function sC(n,e,t,r){const i=e[t];return i!=null&&typeof i!="object"?i:Zt(n,t,r)}function az(n,e,t){if(!n.variants)return n;let r=n;for(const[i,s]of Object.entries(n.variants)){const o=n.modifiers?.[i];if(!o)continue;const a=o.source==="attribute"?e.attributes[i]??o.default:sC(e,t,i,o.default);a&&s[a]&&(r=rz(r,s[a]))}return r}function lz(n,e){const t=new Set,r=c=>{const u=Zt(n,c);return u!=null&&t.add(c),u??void 0},i=r("frame");let s={};if(i&&e[i]){let c=e[i];c.extends&&e[c.extends]&&(c={...e[c.extends],...c}),s={...c},delete s.extends}const o={aspect:r("frame-aspect"),displace:r("frame-displace"),offset:r("frame-offset"),oversize:r("frame-oversize"),place:r("frame-place"),anchor:r("frame-anchor"),shadow:r("frame-shadow")};for(const[c,u]of Object.entries(o))u!==void 0&&(s[c]=u);if(t.size===0)return null;const a={},l=[];if(i&&(a["data-frame"]=i),s.displace&&(a["data-displace"]=s.displace),s.shadow&&(a["data-frame-shadow"]=s.shadow),s.aspect&&l.push(`--frame-aspect: ${s.aspect}`),s.offset&&l.push(`--frame-offset: ${Jj(s.offset)}`),s.oversize&&l.push(`--frame-oversize: ${s.oversize}`),s.anchor&&l.push(`--frame-anchor: ${s.anchor}`),s.place){const{x:c,y:u}=nz(s.place);l.push(`--frame-place-x: ${c}`,`--frame-place-y: ${u}`)}return{dataAttrs:a,styleParts:l,metaProps:t}}function b0(n,e,t){if(n.attributes={...n.attributes,...e},t.length){const r=n.attributes.style?String(n.attributes.style):"";n.attributes.style=r?`${r}; ${t.join("; ")}`:t.join("; ")}}function mf(n){for(const e of n){if(!gn(e))continue;if(e.attributes?.["data-section"]==="media")return e;const t=e.children?mf(e.children):void 0;if(t)return t}}function og(n,e){for(const t of n){if(!gn(t))continue;if(t.attributes?.["data-name"]===e)return t;const r=t.children?og(t.children,e):void 0;if(r)return r}}function cz(n,e,t){const r=i=>{if(!gn(i))return;const s=i.attributes?.["data-rune"];if(s){const o=t.get(s);if(o&&e[o]?.interactive)return s}for(const o of i.children??[]){const a=r(o);if(a)return a}};for(const i of n.children??[]){const s=r(i);if(s)return s}}const y0=new Set;function uz(n,e){const t=`${n}:${e}`;y0.has(t)||(y0.add(t),console.warn(`[refrakt] interactive guest \`${e}\` in a linked \`${n}\` — its controls are inert under the whole-tile link. Drop \`href\` or the interactivity.`))}const w0=new Set;function _0(n){w0.has(n)||(w0.add(n),console.warn(`[refrakt] \`frame\` on \`${n}\` has no frame target — set \`frameTarget\` or give the rune a media section. Frame chrome ignored.`))}const k0={sm:"12px",md:"16px",lg:"24px"},x0={sm:"0.25",md:"0.5",lg:"0.85"};function fz(n){const e=new Set,t=u=>{const f=Zt(n,u);return f!=null&&e.add(u),f??void 0},r=t("substrate"),i=t("substrate-size"),s=t("substrate-opacity"),o=t("substrate-fill"),a=t("substrate-target");if(!r)return null;const l={"data-substrate":r};o&&(l["data-substrate-fill"]=o);const c=[];return i&&k0[i]&&c.push(`--substrate-cell: ${k0[i]}`),s&&x0[s]&&c.push(`--substrate-opacity: ${x0[s]}`),{dataAttrs:l,styleParts:c,metaProps:e,targetOverride:a}}const S0=new Set;function A0(n){S0.has(n)||(S0.add(n),console.warn(`[refrakt] \`substrate-target="media"\` on \`${n}\` has no media section — substrate ignored.`))}const dz={"to-t":"to top","to-b":"to bottom","to-l":"to left","to-r":"to right","to-tr":"to top right","to-br":"to bottom right","to-bl":"to bottom left","to-tl":"to top left"};function C0(n){const e=n.stops.filter(i=>!!i).map(i=>`var(--rf-color-${i})`);if(e.length<2)return null;const t=n.type??"linear";return t==="radial"?`radial-gradient(${e.join(", ")})`:t==="conic"?`conic-gradient(${e.join(", ")})`:`linear-gradient(${dz[n.direction??"to-b"]??"to bottom"}, ${e.join(", ")})`}const T0={sm:"0.3",md:"0.55",lg:"0.8"},hz=/^[a-z][a-z0-9-]*$/,pz={top:"to top",bottom:"to bottom",left:"to left",right:"to right"},P0=new Set;function mz(n){P0.has(n)||(P0.add(n),console.warn(`[refrakt] \`content-place\` on \`${n}\` is only active in \`media-position="cover"\` — it anchors the overlay, and there's no overlay outside cover. Ignored.`))}const E0=new Set;function gz(n){E0.has(n)||(E0.add(n),console.warn(`[refrakt] raw-CSS \`overlay\` on \`${n}\` is deprecated (SPEC-088) — use \`overlay="dark|light|<token>"\` for a flat wash or \`scrim\` for a legibility gradient. The raw passthrough will be removed in a future minor.`))}function Oz(n,e,t,r,i,s,o,a,l,c,u){const f=`${t}-${e.block}`,d=n.attributes?.["data-rune"];if(e.requiresParent&&e.requiresParent!=="*"){const Oe=ys(e.requiresParent);u!==Oe&&$z(d??e.block,e.requiresParent,u)}const h=oz(n.attributes["data-rune-fields"]);e=az(e,n,h);const m=[],p={},O={},v=[];if(e.modifiers)for(const[Oe,_e]of Object.entries(e.modifiers)){_e.source==="attribute"&&v.push(Oe);const Be=_e.source==="meta"?sC(n,h,Oe,_e.default):n.attributes[Oe]??_e.default;if(Be){if(p[Oe]=Be,_e.noBemClass||m.push(`${f}--${Be}`),_e.valueMap){const tt=_e.valueMap[Be]??Be;_e.mapTarget?O[_e.mapTarget]=tt:p[Oe]=tt}}else Be===""&&(p[Oe]="")}e.contextModifiers&&u&&e.contextModifiers[u]&&m.push(`${f}--${e.contextModifiers[u]}`);const b=p["media-position"]==="cover";if(e.staticModifiers)for(const Oe of e.staticModifiers)m.push(`${f}--${Oe}`);const _=new Set,C={},w=[],y=Zt(n,"tint"),S=Zt(n,"tint-mode");if(y||S){let Oe={},_e={},Be=S;if(y&&y!=="custom"&&i[y]){const Ve=i[y];if(Ve.light)for(const[jt,en]of Object.entries(Ve.light))en&&(Oe[jt]=en);if(Ve.dark)for(const[jt,en]of Object.entries(Ve.dark))en&&(_e[jt]=en);!Be&&Ve.lockMode&&(Be=Ve.lockMode)}for(const Ve of iz){const jt=Zt(n,`tint-${Ve}`);jt&&(Oe[Ve]=jt,_.add(`tint-${Ve}`));const en=Zt(n,`tint-dark-${Ve}`);en&&(_e[Ve]=en,_.add(`tint-dark-${Ve}`))}const tt=Object.keys(Oe).length>0;(y||tt)&&(C["data-tint"]=y||"custom"),Be&&Be!=="auto"&&(C["data-color-scheme"]=Be),Object.keys(_e).length>0&&(C["data-tint-dark"]="");for(const[Ve,jt]of Object.entries(Oe))w.push(`--tint-${Ve}: ${jt}`);for(const[Ve,jt]of Object.entries(_e))w.push(`--tint-dark-${Ve}: ${jt}`);(tt||y&&y!=="custom"&&i[y])&&m.push(`${f}--tinted`),_.add("tint"),_.add("tint-mode")}const A=n.attributes?.density,x=u?l.get(u):void 0,E=x?a[x]?.childDensity:void 0,T=A??E??e.defaultDensity??"full",$=n.attributes?.width??e.defaultWidth;$&&$!=="content"&&(p.width=$,m.push(`${f}--${$}`));const L=n.attributes?.spacing;L&&L!=="default"&&(p.spacing=L,m.push(`${f}--spacing-${L}`));const P=n.attributes?.inset;P&&P!=="default"&&(p.inset=P,m.push(`${f}--inset-${P}`));const q=n.attributes?.elevation;q&&(p.elevation=q);const R=new Set,W={};let U=null;const ie=Zt(n,"bg-preset"),ce=Zt(n,"bg-src"),re=Zt(n,"bg-video"),H=Zt(n,"bg-gradient"),ae=Zt(n,"bg-from"),oe=Zt(n,"bg-via"),z=Zt(n,"bg-to"),ne=Zt(n,"bg-gradient-type");let Se;if(ie&&s[ie]){let Oe=s[ie];Oe.extends&&s[Oe.extends]&&(Oe={...s[Oe.extends],...Oe}),Se=Oe.gradient}let Te=null;if(H||ae||oe||z||ne){const Oe=[ae,oe,z].filter(_e=>!!_e);Te=C0({type:ne??Se?.type,direction:H??Se?.direction,stops:Oe.length>=2?Oe:Se?.stops??Oe})}else Se&&(Te=C0(Se));const Le=Zt(n,"scrim"),he=Zt(n,"bg-overlay"),Ee=Le&&Le!=="none"&&!b;if(ie||ce||re||Te||Ee||he){let Oe={};if(ie&&s[ie]){let j=s[ie];if(j.extends&&s[j.extends]){const Pe=s[j.extends];j={...Pe,params:{...Pe.params,...j.params},style:{...Pe.style,...j.style}}}j.style&&(Oe={...j.style})}const _e=Zt(n,"bg-blur"),Be=Zt(n,"bg-position"),tt=Zt(n,"bg-fit"),Ve=Zt(n,"bg-opacity"),jt=Zt(n,"bg-fixed"),en={sm:"4px",md:"8px",lg:"16px"},cn=[];for(const[j,Pe]of Object.entries(Oe))cn.push(`${j}: ${Pe}`);ce?cn.push(`--bg-image: url(${ce})`):Te&&cn.push(`--bg-image: ${Te}`),Be&&cn.push(`--bg-position: ${Be}`),_e&&cn.push(`--bg-blur: ${en[_e]??_e}`),tt&&cn.push(`--bg-fit: ${tt}`),Ve&&cn.push(`--bg-opacity: ${Ve}`);const tn={"data-name":"bg"};ie&&(tn["data-bg-preset"]=ie),cn.length&&(tn.style=cn.join("; ")),jt&&(tn["data-bg-fixed"]="");const _t=[];if(re&&_t.push($t("video",{"data-name":"bg-video",autoplay:"",muted:"",loop:"",playsinline:"",src:re,...cn.length?{style:cn.filter(j=>!j.startsWith("--bg-image")).join("; ")}:{}})),he){const j=Zt(n,"bg-overlay-opacity"),Pe={"data-name":"bg-overlay"};if(he==="dark"||he==="light")Pe["data-bg-overlay"]=he,j&&(Pe.style=`opacity: ${j}`);else if(hz.test(he)){const Yt=[`background: var(--rf-color-${he})`];j&&Yt.push(`opacity: ${j}`),Pe.style=Yt.join("; ")}else gz(d??e.block),Pe.style=`background: ${he}`;_t.push($t("div",Pe))}if(Ee){const j=Zt(n,"scrim-type")??"gradient",Pe=Zt(n,"scrim-tone")??"dark",Yt={"data-name":"scrim","data-scrim":j,"data-scrim-tone":Pe,"data-scrim-dir":Le},dn=[];if(j==="frost"){const Ge=Zt(n,"scrim-blur")??"md";dn.push(`--scrim-blur: ${en[Ge]??en.md}`)}else{const Ge=Zt(n,"scrim-strength")??"md";dn.push(`--scrim-strength: ${T0[Ge]??T0.md}`)}Yt.style=dn.join("; "),_t.push($t("div",Yt)),C["data-color-scheme"]||(W["data-color-scheme"]=Pe)}U=$t("div",tn,_t),m.push(`${f}--has-bg`),W["data-bg"]="",R.add("bg-preset"),R.add("bg-src"),R.add("bg-video"),R.add("bg-overlay"),R.add("bg-blur"),R.add("bg-position"),R.add("bg-fit"),R.add("bg-opacity"),R.add("bg-fixed"),R.add("bg-gradient"),R.add("bg-from"),R.add("bg-via"),R.add("bg-to"),R.add("bg-gradient-type"),R.add("bg-overlay-opacity"),R.add("scrim"),R.add("scrim-type"),R.add("scrim-strength"),R.add("scrim-blur"),R.add("scrim-tone")}b&&(R.add("scrim"),R.add("scrim-type"),R.add("scrim-blur"),R.add("scrim-tone"));const Ye=lz(n,o),rt=new Set(Ye?.metaProps??[]);let Ue=null;if(Ye){const Oe=e.sections?Object.values(e.sections).includes("media"):!1;Ue=e.frameTarget??(Oe?"media":null),Ue||_0(d??e.block)}const Ke=Ye&&Ue==="self"?Ye.dataAttrs:{},Me=fz(n),xt=new Set(Me?.metaProps??[]);let Vt=null;if(Me){const Oe=e.sections?Object.values(e.sections).includes("media"):!1,_e=Me.targetOverride;Vt=_e==="self"||_e==="media"?_e:e.substrateTarget??"self",Vt==="media"&&!Oe&&(A0(d??e.block),Vt=null)}const En=Me&&Vt==="self"?Me.dataAttrs:{},St={};for(const[Oe,_e]of Object.entries(p)){const Be=Oe.replace(/([A-Z])/g,"-$1").toLowerCase();St[`data-${Be}`]=_e}for(const[Oe,_e]of Object.entries(O)){const Be=Oe.startsWith("data-")?Oe:`data-${Oe}`;St[Be]=_e}const on=n.attributes.class||"",Cn=[f,...m,on].filter(Boolean).join(" ");let Wt=n.children;if(e.autoLabel&&(Wt=oC(Wt,e.autoLabel)),e.blocks||e.layout)Wt=Tz(e,f,Wt,p);else if(e.structure){const Oe=[],_e=[];for(const[Be,tt]of Object.entries(e.structure)){const Ve=gf(tt,Be,p);Ve&&(tt.before?Oe.push(Ve):_e.push(Ve))}if(e.contentWrapper){const Be=$t(e.contentWrapper.tag,{"data-name":e.contentWrapper.ref},Wt);Wt=[...Oe,Be,..._e]}else(Oe.length||_e.length)&&(Wt=[...Oe,...Wt,..._e])}else e.contentWrapper&&(Wt=[$t(e.contentWrapper.tag,{"data-name":e.contentWrapper.ref},Wt)]);U&&(Wt=[U,...Wt]);let ke=Wt.map(Oe=>gn(Oe)?c(Tv(Oe,f,e.sections,e.mediaSlots),d):c(Oe,d));if(e.projection&&(ke=bz(ke,e.projection,f,e.sections,e.mediaSlots)),Ye&&Ue==="media"){const Oe=mf(ke);Oe?b0(Oe,Ye.dataAttrs,Ye.styleParts):_0(d??e.block)}if(Me&&Vt==="media"){const Oe=mf(ke);Oe?b0(Oe,Me.dataAttrs,Me.styleParts):A0(d??e.block)}const Tn=!!og(ke,"link");if(Tn||b){const Oe=mf(ke);if(Oe&&(Oe.attributes={...Oe.attributes,"data-guest-posture":"presentational"},Tn)){const _e=cz(Oe,a,l);_e&&uz(d??e.block,_e)}}const Lt=e.modifiers?new Set(Object.keys(e.modifiers).map(Oe=>ys(Oe))):void 0,Jt=ke.filter(Oe=>{if(!gn(Oe))return!0;const _e=Oe;if(_e.name!=="meta"||!_e.attributes["data-field"])return!0;const Be=_e.attributes["data-field"];return!(Lt?.has(Be)||_.has(Be)||R.has(Be)||rt.has(Be)||xt.has(Be))});if(e.sequence){const Oe=e.sequenceDirection?p[e.sequenceDirection.fromModifier]??e.sequenceDirection.default:void 0;aC(Jt,e.sequence,Oe)}let On=n.attributes.style||"";const te=[];if(e.styles)for(const[Oe,_e]of Object.entries(e.styles)){const Be=p[Oe];Be&&(typeof _e=="string"?te.push(`${_e}: ${Be}`):_e.transform?te.push(`${_e.prop}: ${_e.transform(Be)}`):_e.template?te.push(`${_e.prop}: ${_e.template.replace("{}",Be)}`):te.push(`${_e.prop}: ${Be}`))}te.push(...w);const ve=p["content-place"];if(ve){if(!b)mz(d??e.block);else if(ve!=="auto"){const[Oe,_e]=ve.trim().split(/\s+/);Oe&&te.push(`--cover-place-block: ${Oe}`),_e&&te.push(`--cover-place-inline: ${_e}`),Oe==="start"?te.push("--cover-scrim-dir: to bottom"):Oe==="center"&&(te.push("--cover-scrim-image: radial-gradient(ellipse farthest-side at center, rgb(0 0 0 / 0.55) 40%, transparent 100%)"),te.push("--cover-scrim-mask: radial-gradient(ellipse farthest-side at center, #000 50%, transparent 100%)"))}}if(b){const Oe=Zt(n,"scrim");Oe==="none"&&(W["data-scrim"]="none");const _e=Zt(n,"scrim-type");if(_e&&Oe!=="none"&&(W["data-scrim-type"]=_e,_e==="frost")){const Ve=Zt(n,"scrim-blur");Ve&&(W["data-scrim-blur"]=Ve)}const Be=e.rootAttributes?.["data-cover-scope"];if(Oe!=="none"&&Be!=="header"&&!W["data-color-scheme"]&&!C["data-color-scheme"]){const Ve=og(Jt,"content");Ve&&(Ve.attributes={...Ve.attributes,"data-color-scheme":Zt(n,"scrim-tone")??"dark"})}const tt=pz[Oe??""];tt&&te.push(`--cover-scrim-dir: ${tt}`)}Ye&&Ue==="self"&&te.push(...Ye.styleParts),Me&&Vt==="self"&&te.push(...Me.styleParts),te.length&&(On=On?`${On}; ${te.join("; ")}`:te.join("; "));const{width:xe,spacing:Ce,inset:qe,elevation:At,density:ht,"data-rune":Je,"data-rune-fields":Ct,...mt}=n.attributes,lt=v.length>0?Object.fromEntries(Object.entries(mt).filter(([Oe])=>!v.includes(Oe))):mt,yt={...n,attributes:{...lt,...St,...C,...W,...Ke,...En,class:Cn,"data-rune":d,"data-density":T,...e.rootAttributes||{},...On?{style:On}:{}},children:Jt};return e.postTransform?e.postTransform(yt,{modifiers:p,parentType:u,fields:h}):yt}function oC(n,e){return n.map(t=>{if(!gn(t))return t;const r=e[t.name]??e[t.attributes?.["data-field"]],i=r&&!t.attributes["data-name"]?{...t,attributes:{...t.attributes,"data-name":r}}:t;return i.children.length===0?i:{...i,children:oC(i.children,e)}})}function Tv(n,e,t,r){const i=n.attributes["data-name"];if(i){const s=`${e}__${i}`,o=n.attributes.class||"",a=n.children.map(u=>gn(u)?Tv(u,e,t,r):u),l=t?.[i],c=r?.[i];return{...n,attributes:{...n.attributes,class:[s,o].filter(Boolean).join(" "),...l?{"data-section":l}:{},...c?{"data-media":c}:{}},children:a}}return n}const $0=/^\[(x|X|>|\s|-)\]\s*/,Q0={x:"checked",X:"checked"," ":"unchecked",">":"active","-":"skipped"};function vz(n){const e=n.children;if(e.length===0)return null;const t=e[0];if(typeof t=="string"){const r=t.match($0);if(!r)return null;const i=Q0[r[1]]??"unchecked",s=t.slice(r[0].length);return{...n,attributes:{...n.attributes,"data-checked":i},children:[s,...e.slice(1)]}}if(gn(t)&&t.name==="p"&&t.children.length>0){const r=t.children[0];if(typeof r=="string"){const i=r.match($0);if(!i)return null;const s=Q0[i[1]]??"unchecked",o=r.slice(i[0].length),a={...t,children:[o,...t.children.slice(1)]};return{...n,attributes:{...n.attributes,"data-checked":s},children:[a,...e.slice(1)]}}}return null}function aC(n,e,t){for(let r=0;r<n.length;r++){const i=n[r];if(gn(i))if(i.name==="ol"){const s={...i.attributes,"data-sequence":e};t&&(s["data-sequence-direction"]=t),n[r]={...i,attributes:s}}else i.children.length>0&&aC(i.children,e,t)}}function lC(n,e){const t=n.findIndex(r=>gn(r)&&r.attributes?.["data-name"]===e);if(t!==-1){const r=n[t],i=[...n.slice(0,t),...n.slice(t+1)];return{element:r,rest:i}}for(let r=0;r<n.length;r++){const i=n[r];if(!gn(i))continue;const s=i;if(s.attributes?.["data-name"]!=="preamble")continue;const o=lC(s.children,e);if(!o)continue;const a=[...n];return o.rest.length===0?a.splice(r,1):a[r]={...s,children:o.rest},{element:o.element,rest:a}}return null}function cC(n,e){for(const t of n){if(!gn(t))continue;const r=t;if(r.attributes?.["data-name"]===e)return r;const i=cC(r.children,e);if(i)return i}return null}function uC(n,e,t,r){return n.map(i=>{if(!gn(i))return i;const s=i;if(s.attributes?.["data-name"]===e){const a=r==="prepend"?[t,...s.children]:[...s.children,t];return{...s,children:a}}const o=uC(s.children,e,t,r);return o!==s.children?{...s,children:o}:i})}function bz(n,e,t,r,i){let s=[...n];if(e.hide){const o=new Set(e.hide);s=s.filter(a=>{if(!gn(a))return!0;const l=a.attributes?.["data-name"];return!l||!o.has(l)})}if(e.group)for(const[o,a]of Object.entries(e.group)){const l=new Set(a.members),c=[];let u=-1;for(let f=s.length-1;f>=0;f--){const d=s[f];if(!gn(d))continue;const h=d.attributes?.["data-name"];h&&l.has(h)&&(c.unshift(d),(u===-1||f<u)&&(u=f),s.splice(f,1))}if(c.length>0){let f=$t(a.tag,{"data-name":o},c);f=Tv(f,t,r,i),s.splice(u,0,f)}}if(e.relocate)for(const[o,a]of Object.entries(e.relocate)){const l=lC(s,o);if(!l)continue;s=l.rest,cC(s,a.into)&&(s=uC(s,a.into,l.element,a.position??"append"))}return s}function gf(n,e,t,r){if(n.condition&&!t[n.condition]||n.conditionAny&&!n.conditionAny.some(l=>t[l]))return null;const i=n.ref??e;if(n.repeat){const l=parseInt(t[n.repeat.count]??"",10);if(!l||l<0||isNaN(l))return $t(n.tag,{"data-name":i},[]);const c=n.repeat.max??10,u=Math.min(l,c),f=n.repeat.filled?parseInt(t[n.repeat.filled]??"0",10):0,d=Math.max(0,Math.min(f,u)),h=[];for(let m=0;m<u;m++){const p=m<d;if(p&&n.repeat.filledElement){const O=gf(n.repeat.filledElement,n.repeat.filledElement.ref??"",t);O&&h.push(O)}else{const O=gf(n.repeat.element,n.repeat.element.ref??"",t);O&&(n.repeat.filled?h.push({...O,attributes:{...O.attributes,"data-filled":p?"true":"false"}}):h.push(O))}}return $t(n.tag,{"data-name":i},h)}const s={};if(n.attrs)for(const[l,c]of Object.entries(n.attrs))typeof c=="string"?s[l]=c:"fromModifier"in c&&(s[l]=t[c.fromModifier]??"");const o={"data-name":i,...s};if(n.metaType&&(o["data-meta-type"]=n.metaType),n.sentimentMap&&n.metaText){const l=t[n.metaText];if(l){const c=n.sentimentMap[l];c&&(o["data-meta-sentiment"]=c)}}if(n.icon)return $t(n.tag,o,[]);if(n.metaText){let l=t[n.metaText]??"";if(n.transform&&hd[n.transform]&&(l=hd[n.transform](l)),n.label){const c={"data-meta-label":""};n.labelHidden&&(c["data-meta-label-hidden"]="");const u=$t("span",c,[n.label]);let f=l;n.textPrefix&&(f=n.textPrefix+f),n.textSuffix&&(f=f+n.textSuffix);const d=$t("span",{"data-meta-value":""},[f]);return $t(n.tag,o,[u,d])}return n.textPrefix&&(l=n.textPrefix+l),n.textSuffix&&(l=l+n.textSuffix),$t(n.tag,o,[l])}const a=[];if(n.children)for(const l of n.children)if(typeof l=="string")a.push(l);else{const c=gf(l,l.ref??"",t);c&&a.push(c)}return $t(n.tag,o,a)}function yz(n,e,t){const r=e[n];if(!r)return null;if(r.condition){const a=t[r.condition];if(!(r.renderWhenEmpty?a!==void 0:!!a))return null}let i=t[n]??"";if(!i&&r.condition&&!r.renderWhenEmpty)return null;r.transform&&hd[r.transform]&&(i=hd[r.transform](i));const s=r.href?t[r.href]??"":void 0;if(r.href&&!s)return null;const o=r.rating?t[r.rating.total??""]||"5":void 0;return{name:n,value:i,field:r,href:s,ratingTotal:o}}function fC(n,e={includeLabel:!0}){const{field:t,value:r}=n,i={class:"rf-badge"};if(t.metaType&&(i["data-meta-type"]=t.metaType),t.sentimentMap){const a=t.sentimentMap[r];a&&(i["data-meta-sentiment"]=a)}const s=t.tag??"span",o={...i};return s==="time"&&r&&(o.datetime=r),e.includeLabel&&t.label?$t(s,o,[$t("span",{"data-meta-label":""},[t.label]),$t("span",{"data-meta-value":""},[r])]):$t(s,o,[r])}function wz(n){const{field:e,value:t}=n,r={};e.metaType&&(r["data-meta-type"]=e.metaType);const i=e.tag??"span";return i==="time"&&t&&(r.datetime=t),$t(i,r,[t])}function dC(n){const e=n.field.splitOn;return!e||!n.value?[n.value].filter(Boolean):n.value.split(e).map(t=>t.trim()).filter(Boolean)}const _z=new Set(["status","category","tag"]);function hC(n){return n.metaType!==void 0&&_z.has(n.metaType)}function kz(n){return $t("a",{href:n.href??"","data-meta-type":"link"},[n.field.label??n.value])}function xz(n){const e=Math.max(0,parseInt(n.value,10)||0),t=Math.max(0,parseInt(n.ratingTotal??"5",10)||5),r=[];for(let i=0;i<t;i++)r.push($t("span",{"data-filled":i<e?"true":"false"},[]));return $t("span",{"data-meta-type":"rating"},r)}function Sz(n){const e=n.field.icon.group,t={};return n.field.metaType&&(t["data-meta-type"]=n.field.metaType),$t(n.field.tag??"span",t,[$t("span",{"data-icon-group":e,"data-icon":n.value},[]),$t("span",{"data-meta-value":""},[n.field.label??n.value])])}function ag(n,e=!1){return n.field.href?kz(n):n.field.rating?xz(n):n.field.icon?Sz(n):hC(n.field)?fC(n,{includeLabel:e}):wz(n)}function Az(n,e,t){if(e.length===0)return null;const r=[];for(const{resolved:s,align:o}of e){const a=s.field.splitOn&&s.value?dC(s).map(l=>ag({...s,value:l})):[ag(s)];o==="end"&&a.length>0&&(a[0]={...a[0],attributes:{...a[0].attributes,"data-align":"end"}}),r.push(...a)}const i={"data-name":n,"data-zone":n,"data-zone-layout":"bar"};return t===!1&&(i["data-wrap"]="false"),$t("div",i,r)}function Cz(n,e){if(e.length===0)return null;const t=e.map(r=>{const i=$t("dt",{"data-meta-label":""},[r.field.label??r.name]);let s;if(r.field.splitOn&&r.value){const o=dC(r).map(a=>ag({...r,value:a}));s=$t("dd",{"data-multi-value":""},o)}else if(hC(r.field))s=$t("dd",{},[fC(r,{includeLabel:!1})]);else{const o={};r.field.metaType&&(o["data-meta-type"]=r.field.metaType);const a=r.field.tag==="time"&&r.value?$t("time",{datetime:r.value},[r.value]):r.value;s=$t("dd",o,[a])}return $t("div",{"data-name":"row","data-field":r.name},[i,s])});return $t("dl",{"data-name":n,"data-zone":n,"data-zone-layout":"definition-list"},t)}function Tz(n,e,t,r){const i=n.blocks??{},s=n.layout??{},o=n.metaFields??{},a=f=>{const d=i[f];if(!d)return null;const h=[];for(const m of d.fields){const p=typeof m=="string"?m:m.field,O=typeof m=="string"?void 0:m.align,v=yz(p,o,r);v&&h.push({resolved:v,align:O})}return h.length===0?null:d.layout==="bar"?Az(f,h,d.wrap??!0):Cz(f,h.map(m=>m.resolved))};if(Object.keys(s).length===0)return t;const l={layout:s,renderBlock:a},c=s.root;if(c){const f=Array.isArray(c)?c:c.children,d=lg(t),h=new Set,m=pd(f,d,h,l,["root"]),p=t.filter(O=>!(gn(O)&&O.attributes["data-name"]&&h.has(O.attributes["data-name"])));return[...m,...p]}let u=t;for(const[f,d]of Object.entries(s)){const h=Array.isArray(d)?d:d.children;u=Qz(u,f,m=>{const p=lg(m),O=new Set,v=pd(h,p,O,l,[f]),b=m.filter(_=>!(gn(_)&&_.attributes["data-name"]&&O.has(_.attributes["data-name"])));return[...v,...b]})}return u}const L0=new Set;function Pz(n){L0.has(n)||(L0.add(n),console.warn(`[refrakt] layout reference cycle at "${n}" — skipping to break the loop.`))}const Ez=new Set(["accordion-item","tab","tab-panel","breadcrumb-item","juxtapose-panel","bento-cell","definition","step","tier","map-pin","itinerary-day","itinerary-stop"]),M0=new Set;function $z(n,e,t){const r=`${n}<${t??""}`;if(M0.has(r))return;M0.add(r);const i=t?`nested directly in \`${t}\``:"at the top level",s=`[refrakt] \`${n}\` requires parent \`${ys(e)}\` — found ${i}.`;Ez.has(n)?console.error(s):console.warn(s)}function lg(n){const e=new Map;for(const t of n)gn(t)&&t.attributes["data-name"]&&e.set(t.attributes["data-name"],t);return e}function pd(n,e,t,r,i){const s=[];for(const o of n){if(t.has(o))continue;if(i.includes(o)){Pz(o);continue}const a=r.layout[o];if(a&&!Array.isArray(a)&&a.tag){t.add(o);const u=pd(a.children,e,t,r,[...i,o]);s.push($t(a.tag,{"data-name":o,...a.attrs??{}},u));continue}if(a){const u=e.get(o);if(u){t.add(o);const f=Array.isArray(a)?a:a.children,d=lg(u.children),h=new Set,m=pd(f,d,h,r,[...i,o]),p=u.children.filter(O=>!(gn(O)&&O.attributes["data-name"]&&h.has(O.attributes["data-name"])));s.push({...u,children:[...m,...p]});continue}}const l=r.renderBlock(o);if(l){t.add(o),s.push(l);continue}const c=e.get(o);if(c){t.add(o),s.push(c);continue}}return s}function Qz(n,e,t){let r=!1;const i=s=>s.map(o=>r||!gn(o)?o:o.attributes["data-name"]===e?(r=!0,{...o,children:t(o.children)}):{...o,children:i(o.children)});return i(n)}const Lz=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mz=new Set(["$$mdtype"]);function pC(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function qz(n){const e=[];for(const[t,r]of Object.entries(n))if(!Mz.has(t)&&!(r==null||r===!1)){if(r===!0){e.push(t);continue}e.push(`${t}="${pC(String(r))}"`)}return e.length?" "+e.join(" "):""}function Dz(n,e){return zl(n)}function zl(n){if(n==null)return"";if(typeof n=="string")return pC(n);if(typeof n=="number")return String(n);if(Array.isArray(n))return n.map(zl).join("");if(!gn(n))return"";const e=n.name;if(!e)return n.children.map(zl).join("");const t=qz(n.attributes);if(Lz.has(e))return`<${e}${t} />`;const i=n.attributes?.["data-codeblock"]||n.attributes?.["data-raw-html"]?n.children.map(s=>typeof s=="string"?s:zl(s)).join(""):n.children.map(zl).join("");return`<${e}${t}>${i}</${e}>`}function Rz(n,e,t,r){if(!n)return null;const i=n.endsWith("/")?n.slice(0,-1):n,s=e&&e.length>0?e:"main",o=t.split("/").map(l=>encodeURIComponent(l)).join("/"),a=r?`#${Iz(r)}`:"";return`${i}/blob/${s}/${o}${a}`}function Iz(n){const e=n.trim(),t=e.indexOf("-");if(t<0)return`L${e}`;const r=e.slice(0,t).trim(),i=e.slice(t+1).trim();return i?`L${r}-L${i}`:`L${r}`}const{Tag:wU}=B;function Nz(n,e){if(typeof e=="function")return e(n);const t=typeof e=="string"?{node:e}:e;return!(t.node&&n.type!==t.node||t.descendant&&!Array.from(n.walk()).some(r=>r.type===t.descendant)||t.descendantTag&&!Array.from(n.walk()).some(r=>r.type==="tag"&&r.tag===t.descendantTag))}const{Ast:q0}=B;function*mC(n){yield n;for(const e of n.children)B.Tag.isTag(e)?yield*mC(e):yield e}function Pv(n){const e=n?.level,t=n?.include;return r=>{const i=e??r.find(c=>c.type==="heading")?.attributes.level;if(!i)return r;let s;const o=new q0.Node("list"),a=[];let l=[];for(let c=0;c<r.length;c++){const u=r[c];if(u.type==="heading"&&u.attributes.level===i)o.children.push(new q0.Node("item",{},[u])),s=c;else if(s===void 0)a.push(u);else if(!t||t.some(f=>Nz(u,f))){const f=o.children.at(-1);f&&f.children.push(u)}else{l=r.slice(c);break}}return o.children.length===0?r:[...a,o,...l]}}class Fe{constructor(e){this.nodes=e,this.offset=0}static fromData(e,t){return new Fe([new B.Tag(t,{},[e])])}wrap(e,t={}){return new Fe([new B.Tag(e,t,this.nodes)])}tag(e){const t=this.nodes.filter(r=>B.Tag.isTag(r)&&r.name===e);return new Fe(t)}tags(...e){const t=this.nodes.filter(r=>B.Tag.isTag(r)&&e.includes(r.name));return new Fe(t)}headings(){return this.tags("h1","h2","h3","h4","h5","h6")}typeof(e){return new Fe(this.nodes.filter(t=>B.Tag.isTag(t)&&t.attributes["data-rune"]===ys(e)))}concat(...e){const t=e.map(r=>r instanceof Fe?r.nodes:r).flat();return new Fe([...this.nodes,...t])}flatten(){const e=this.nodes.map(t=>B.Tag.isTag(t)?Array.from(mC(t)):t).flat();return new Fe(e)}limit(e){return new Fe(this.nodes.slice(0,e))}slice(e,t){return new Fe(this.nodes.slice(e,t))}toArray(){return this.nodes}count(){return this.nodes.length}next(){return this.nodes[this.offset++]}}function Ne(n){const e=n.rune,t=n.typeof??n.schemaOrgType;if(n.properties&&n.refs){const c=new Set(Object.keys(n.properties)),u=Object.keys(n.refs).filter(f=>c.has(f));if(u.length>0)throw new Error(`Rune "${e}" has naming collisions between properties and refs: ${u.join(", ")}. Properties and refs share a flat namespace (ADR-008) and must have unique names.`)}const r=new Set;for(const c of Object.values(n.schema??{})){if(c===void 0)continue;const u=c instanceof Fe?c.nodes:Array.isArray(c)?c:[c];for(const f of u)r.add(f)}const i={},s=new Set;for(const[c,u]of Object.entries(n.properties??{})){if(u===void 0)continue;const f=u instanceof Fe?u.nodes:Array.isArray(u)?u:[u],d=[];f.forEach(h=>{if(B.Tag.isTag(h)){const m=h.name==="meta"&&r.has(h);m||(h.attributes["data-field"]=ys(c)),h.name==="meta"&&h.attributes.content!==void 0&&(d.push(h.attributes.content),m||s.add(h))}}),d.length===1?i[c]=d[0]:d.length>1&&(i[c]=d)}for(const[c,u]of Object.entries(n.refs||{})){if(u===void 0)continue;(u instanceof Fe?u.nodes:Array.isArray(u)?u:[u]).forEach(d=>{B.Tag.isTag(d)&&(d.attributes["data-name"]=c)})}const o=new Set;for(const[c,u]of Object.entries(n.schema??{})){if(u===void 0)continue;(u instanceof Fe?u.nodes:Array.isArray(u)?u:[u]).forEach(d=>{if(B.Tag.isTag(d)){if(d.name==="meta"&&(d.attributes.content===void 0||d.attributes.content==="")){o.add(d);return}d.attributes.property=c}})}const a=(Array.isArray(n.children)?n.children:[n.children]).filter(c=>!o.has(c)&&!s.has(c));return new B.Tag(n.tag,{id:n.id,"data-field":n.property?ys(n.property):n.property,"data-rune":e,typeof:t,class:n.class,...Object.keys(i).length>0?{"data-rune-fields":JSON.stringify(i)}:{}},a)}function Bz(n){return n.replace(/<script\b[^>]*>[\s\S]*?<\/script\s*>/gi,"")}function jz(n){let e=n.replace(/\s+on[a-z]+\s*=\s*"[^"]*"/gi,"");return e=e.replace(/\s+on[a-z]+\s*=\s*'[^']*'/gi,""),e=e.replace(/\s+on[a-z]+\s*=\s*[^\s>]+/gi,""),e}function zz(n){return n.replace(/(\s(?:href|src|action|formaction|xlink:href)\s*=\s*)(["'])\s*javascript:[^"']*\2/gi,"$1$2$2")}function Zz(n){let e=n.replace(/<iframe\b[^>]*>[\s\S]*?<\/iframe\s*>/gi,"");return e=e.replace(/<object\b[^>]*>[\s\S]*?<\/object\s*>/gi,""),e=e.replace(/<embed\b[^>]*\/?>/gi,""),e=e.replace(/<iframe\b[^>]*\/>/gi,""),e=e.replace(/<object\b[^>]*\/>/gi,""),e}function Fz(n,e){if(e.trust==="trusted"||e.allowJs)return n;let t=Bz(n);return t=jz(t),t=zz(t),t=Zz(t),t}const Xz=new WeakMap;function ct(n){return Array.isArray(n)?n:n!=null?[n]:[]}const Vz={tint:{type:String,required:!1,description:"Color tint preset applied to this block"},"tint-mode":{type:String,required:!1,matches:["auto","dark","light"],description:"Whether the tint adapts to auto, dark, or light mode"},bg:{type:String,required:!1,description:"Background preset applied to this block"},width:{type:String,required:!1,matches:["compact","narrow","content","wide","full"],description:"Maximum width constraint for this block"},spacing:{type:String,required:!1,matches:["flush","tight","default","loose","breathe"],description:"Vertical spacing above and below this block"},inset:{type:String,required:!1,matches:["flush","tight","default","loose","breathe"],description:"Inner padding of this block"},elevation:{type:String,required:!1,matches:["none","sm","md","lg"],description:"Drop shadow (box-shadow) elevation for this block"},frame:{type:String,required:!1,description:"Named frame preset presenting this block's media surface"},"frame-aspect":{type:String,required:!1,description:'Aspect ratio of the framed media, e.g. "16/9"'},"frame-displace":{type:String,required:!1,matches:["top","bottom","end","bottom-end","top-end"],description:"Edge/corner the framed guest moves toward"},"frame-offset":{type:String,required:!1,matches:["none","sm","md","lg","xl"],description:"Displacement distance (named scale)"},"frame-oversize":{type:String,required:!1,description:"How far the guest exceeds its slot (scale factor)"},"frame-place":{type:String,required:!1,description:'Guest-box alignment in the slot (e.g. "left top")'},"frame-anchor":{type:String,required:!1,description:"Crop focal point when the guest is cut (object-position)"},"frame-shadow":{type:String,required:!1,matches:["none","sm","md","lg"],description:"Silhouette drop-shadow strength for the framed media"},substrate:{type:String,required:!1,matches:["dots","grid","lines","cross","checker","none"],description:"Generated surface pattern"},"substrate-size":{type:String,required:!1,matches:["sm","md","lg"],description:"Pattern cell size"},"substrate-opacity":{type:String,required:!1,matches:["sm","md","lg"],description:"Pattern ink strength"},"substrate-fill":{type:String,required:!1,matches:["inherit","inset"],description:"Surface fill the pattern sits on (full colour stays with tint)"},"substrate-target":{type:String,required:!1,matches:["self","media"],description:"Which surface the pattern fills (overrides the rune/theme default)"},"bg-gradient":{type:String,required:!1,matches:["to-t","to-b","to-l","to-r","to-tr","to-br","to-bl","to-tl"],description:"Gradient direction (bounded named set)"},"bg-from":{type:String,required:!1,description:"Gradient start colour — a semantic token name (→ var(--rf-color-*))"},"bg-to":{type:String,required:!1,description:"Gradient end colour — a semantic token name"},"bg-via":{type:String,required:!1,description:"Optional middle gradient stop — a semantic token name"},"bg-gradient-type":{type:String,required:!1,matches:["linear","radial","conic"],description:"Gradient type"},scrim:{type:String,required:!1,matches:["top","bottom","left","right","none"],description:'Scrim direction (heaviest edge); presence turns the scrim on, "none" opts out of the default cover scrim'},"scrim-type":{type:String,required:!1,matches:["gradient","frost"],description:"Scrim treatment: gradient (default) or frost (backdrop blur)"},"scrim-strength":{type:String,required:!1,matches:["sm","md","lg"],description:"Gradient scrim strength"},"scrim-blur":{type:String,required:!1,matches:["none","sm","md","lg"],description:"Frost scrim blur amount"},"scrim-tone":{type:String,required:!1,matches:["dark","light"],description:"Whether the scrim darkens (for light text) or lightens (for dark text)"}},Wz=["bg-gradient","bg-from","bg-to","bg-via","bg-gradient-type","scrim","scrim-type","scrim-strength","scrim-blur","scrim-tone"],Yz=["frame-aspect","frame-displace","frame-offset","frame-oversize","frame-place","frame-anchor","frame-shadow"],Uz=["substrate-size","substrate-opacity","substrate-fill","substrate-target"];function Gz(n,e){if(!B.Tag.isTag(n))return n;const t=[];if(e.tintNode){const i=B.transform(e.tintNode,e.config);if(B.Tag.isTag(i))for(const s of i.children)B.Tag.isTag(s)&&s.name==="meta"&&t.push(s)}const r=i=>t.some(s=>B.Tag.isTag(s)&&s.attributes["data-field"]===i);return e.tint&&!r("tint")&&t.push(new B.Tag("meta",{"data-field":"tint",content:e.tint})),e["tint-mode"]&&e["tint-mode"]!=="auto"&&!r("tint-mode")&&t.push(new B.Tag("meta",{"data-field":"tint-mode",content:e["tint-mode"]})),t.length===0||(n.children=[...n.children,...t]),n}function Hz(n,e){if(!B.Tag.isTag(n))return n;const t=[];if(e.bgNode){const i=B.transform(e.bgNode,e.config);if(B.Tag.isTag(i))for(const s of i.children)B.Tag.isTag(s)&&s.name==="meta"&&t.push(s)}const r=t.some(i=>B.Tag.isTag(i)&&i.attributes["data-field"]==="bg-preset");return e.bg&&!r&&t.push(new B.Tag("meta",{"data-field":"bg-preset",content:e.bg})),t.length===0||(n.children=[...n.children,...t]),n}function Kz(n,e){if(!B.Tag.isTag(n))return n;const t=i=>n.children.some(s=>B.Tag.isTag(s)&&s.name==="meta"&&s.attributes["data-field"]===i),r=[];e.frame&&!t("frame")&&r.push(new B.Tag("meta",{"data-field":"frame",content:String(e.frame)}));for(const i of Yz){const s=e[i];s!=null&&s!==""&&!t(i)&&r.push(new B.Tag("meta",{"data-field":i,content:String(s)}))}return r.length===0||(n.children=[...n.children,...r]),n}function Jz(n,e){if(!B.Tag.isTag(n))return n;const t=i=>n.children.some(s=>B.Tag.isTag(s)&&s.name==="meta"&&s.attributes["data-field"]===i),r=[];for(const i of Wz){const s=e[i];s!=null&&s!==""&&!t(i)&&r.push(new B.Tag("meta",{"data-field":i,content:String(s)}))}return r.length===0||(n.children=[...n.children,...r]),n}function e6(n,e){if(!B.Tag.isTag(n))return n;const t=i=>n.children.some(s=>B.Tag.isTag(s)&&s.name==="meta"&&s.attributes["data-field"]===i),r=[];e.substrate&&!t("substrate")&&r.push(new B.Tag("meta",{"data-field":"substrate",content:String(e.substrate)}));for(const i of Uz){const s=e[i];s!=null&&s!==""&&!t(i)&&r.push(new B.Tag("meta",{"data-field":i,content:String(s)}))}return r.length===0||(n.children=[...n.children,...r]),n}function et(n){const e={};n.base&&Object.assign(e,n.base),n.attributes&&Object.assign(e,n.attributes),Object.assign(e,Vz),n.deferBody&&(e["__deferred-body"]={type:String,required:!1});const t=n.deprecations;if(t){for(const[i,s]of Object.entries(t))if(!e[i]){const o=e[s.newName];e[i]={type:o?.type??String,required:!1,deprecated:!0}}}const r={attributes:e,...n.selfClosing!=null&&{selfClosing:n.selfClosing},transform:(i,s)=>{if(t){for(const[m,p]of Object.entries(t))if(i.attributes[m]!==void 0&&i.attributes[p.newName]===void 0){const O=p.transform?p.transform(i.attributes[m],i.attributes):i.attributes[m];O!==void 0&&(i.attributes[p.newName]=O)}}const o=i.transformAttributes(s),a=typeof n.contentModel=="function"?n.contentModel(o):n.contentModel,{content:l,tintNode:c,bgNode:u}=Fj(i.children,a,o),f=n.transform(l,o,s,i),d={tintNode:c,bgNode:u,tint:o.tint,"tint-mode":o["tint-mode"],bg:o.bg,config:s},h=Hz(Gz(f,d),d);return B.Tag.isTag(h)&&(o.width&&(h.attributes.width=o.width),o.spacing&&(h.attributes.spacing=o.spacing),o.inset&&(h.attributes.inset=o.inset),o.elevation&&(h.attributes.elevation=o.elevation)),Jz(e6(Kz(h,o),o),o)}};return t&&(r.validate=i=>{const s=[];for(const[o,a]of Object.entries(t))i.attributes[o]!==void 0&&s.push({id:"deprecated-attribute",level:"warning",message:`Attribute "${o}" is deprecated. Use "${a.newName}" instead.`});return s}),n.deferBody&&(r.deferBody=!0),Xz.set(r,n.contentModel),n.base&&Wj.set(r,n.base),r}const{Tag:Du}=B,t6=et({attributes:{type:{type:String},tag:{type:String},lines:{type:Array},error:{type:Object}},contentModel:{type:"sequence",fields:[]},transform(n,e){const t=e.error,r=new Du("td",{},[t.id]),i=new Du("td",{},[e.tag]),s=new Du("td",{},[t.level]),o=new Du("td",{},[t.message]);return Ne({rune:"error",tag:"tr",property:"error",properties:{code:r,tag:i,level:s,message:o},children:[i,r,s,o]})}});class n6{validate(e,t,r){return typeof e!="string"?[{id:"attribute-type-invalid",level:"critical",message:`Attribute '${r}' is not a string`}]:[]}}class r6 extends n6{transform(e){return e?e.split(" ").map(t=>t.trim()):[]}}const{Tag:i6}=B,s6=["row","column","dense","row dense","column dense"];function o6(n,e){return!n||n.length===0?e.map(t=>({colspan:1,rowspan:void 0,children:t})):n.map((t,r)=>{const[i,s]=t.split(":");return{colspan:parseInt(i),rowspan:s?parseInt(s):void 0,children:e[r]}}).filter(t=>t.children!==void 0)}function a6(n){const e=n.items.map(({children:r,colspan:i,rowspan:s})=>r.wrap("div",{"data-colspan":i,"data-rowspan":s}).toArray()).flat(),t={"data-layout":"grid","data-columns":n.columns,"data-rows":n.rows,"data-flow":n.flow};return new i6("div",t,e)}const{Tag:Ps}=B,l6=["columns","auto","masonry"],c6=et({attributes:{columns:{type:Number,required:!1,description:"Number of grid columns"},rows:{type:Number,required:!1,description:"Number of grid rows"},flow:{type:String,required:!1,matches:s6.slice(),description:"Direction items fill the grid"},spans:{type:r6,required:!1,description:"Column span widths for each cell (space-separated)"},ratio:{type:String,required:!1,description:'Column width ratio (e.g. "2 1 1")'},gap:{type:String,required:!1,matches:["none","tight","default","loose"],description:"Space between grid cells"},valign:{type:String,required:!1,matches:["top","center","bottom","stretch","baseline"],description:"Vertical alignment of cell content"},collapse:{type:String,required:!1,matches:["sm","md","lg","never"],description:"Breakpoint at which grid collapses to a single column"},mode:{type:String,required:!1,matches:["columns","auto","masonry"],default:"columns",description:"Grid sizing: fixed columns, auto-fit, or masonry"},min:{type:String,required:!1,description:"Minimum cell width for auto-fit mode"},aspect:{type:String,required:!1,description:"Aspect ratio for grid cells"},stack:{type:String,required:!1,matches:["natural","reverse"],description:"Stacking order when collapsed"}},contentModel:{type:"delimited",delimiter:"hr",dynamicZones:!0,zoneModel:{type:"sequence",fields:[{name:"content",match:"any",greedy:!0,optional:!0}]}},deprecations:{layout:{newName:"spans",transform:(n,e)=>{if(typeof n=="string"&&l6.includes(n)){e.mode=n;return}return n}}},transform(n,e,t){const i=(n.zones??[]).map(p=>new Fe(B.transform(ct(p.content),t))),s=a6({items:o6(e.spans,i),rows:e.rows,columns:e.columns,flow:e.flow}),o=e.ratio?new Ps("meta",{content:e.ratio}):void 0,a=e.gap&&e.gap!=="default"?new Ps("meta",{content:e.gap}):void 0,l=e.valign?new Ps("meta",{content:e.valign}):void 0,c=e.collapse?new Ps("meta",{content:e.collapse}):void 0,u=e.mode&&e.mode!=="columns"?new Ps("meta",{content:e.mode}):void 0,f=e.min?new Ps("meta",{content:e.min}):void 0,d=e.aspect?new Ps("meta",{content:e.aspect}):void 0,h=e.stack?new Ps("meta",{content:e.stack}):void 0,m=[o,a,l,c,u,f,d,h].filter(Boolean);return Ne({rune:"grid",tag:"section",children:[...m,s],properties:{...u?{mode:u}:{},ratio:o,gap:a,valign:l,collapse:c,...f?{min:f}:{},...d?{aspect:d}:{},...h?{stack:h}:{}},refs:{cell:new Fe(s.children).tag("div")}})}}),{Tag:Cl}=B,u6={js:"JavaScript",ts:"TypeScript",py:"Python",rb:"Ruby",rs:"Rust",go:"Go",sh:"Shell",bash:"Bash",zsh:"Zsh",shell:"Shell",html:"HTML",css:"CSS",json:"JSON",yaml:"YAML",sql:"SQL",swift:"Swift",kt:"Kotlin",java:"Java",cpp:"C++",c:"C",cs:"C#",php:"PHP"};function f6(n){return u6[n]||n.charAt(0).toUpperCase()+n.slice(1)}function d6(n){if(!n)return"";const e=n.endsWith("/")?n.slice(0,-1):n,t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function h6(n,e){if(!n)return"";const t=d6(n);return t?e?`${t}:${e}`:t:""}const p6=["scroll","wrap","hide"],m6=et({attributes:{title:{type:String,required:!1,description:"Title displayed above the code group"},labels:{type:String,required:!1,description:"Comma-separated custom tab labels"},overflow:{type:String,required:!1,matches:p6.slice(),description:"How overflowing code is handled"}},contentModel:{type:"sequence",fields:[{name:"panels",match:"fence",greedy:!0}]},transform(n,e,t){const r=e.labels?.split(",").map(p=>p.trim())??[],i={},s=[];if(e.title!==void 0){const p=new Cl("meta",{content:e.title});i.title=p,s.push(p)}const o=e.overflow;if(o&&o!=="scroll"){const p=new Cl("meta",{content:o});i.overflow=p,s.push(p)}const a=ct(n.panels);if(a.length===1&&r.length===0){const p=B.transform(a[0],t);return s.push(p),Ne({rune:"code-group",tag:"section",properties:i,refs:{},children:s})}const c=[],u=[];for(const p of a){const O=p.attributes.language||"shell",v=typeof p.attributes.label=="string"?p.attributes.label:"",b=h6(typeof p.attributes.source=="string"?p.attributes.source:void 0,typeof p.attributes.lines=="string"?p.attributes.lines:void 0),_=r[c.length]||v||b||f6(O),C=new Cl("span",{},[_]);c.push(new Cl("button",{"data-name":"tab",role:"tab"},[C]));const w=B.transform(p,t);u.push(new Cl("div",{role:"tabpanel"},[w]))}const f=new Fe(c),d=new Fe(u),h=f.wrap("div",{role:"tablist"}),m=d.wrap("div");return s.push(h.next(),m.next()),Ne({rune:"code-group",tag:"section",properties:i,refs:{tabs:h,panels:m,panel:d},children:s})}}),g6=et({attributes:{path:{type:String,required:!0,description:"Path to the source file, relative to the project root. Rejected if it escapes the root."},lines:{type:String,required:!1,description:'Line range. Formats: "10-25", "10-" (to EOF), "-20" (from start), "10" (single line). 1-indexed, inclusive.'},lang:{type:String,required:!1,description:"Syntax-highlighting language hint. Overrides the extension-based inference."},linenumbers:{type:Boolean,required:!1,description:'Show line numbers in the gutter. Starting number derives from the `lines` range start (e.g. lines="74-125" → first line is 74), so numbers reflect the file\'s real offsets. WORK-304.'},highlight:{type:String,required:!1,description:'Range(s) to emphasize without cropping — Shiki-style format: "74-78", "74-78,82,90-92". Indices are file coordinates (same frame as `lines=`). Use this when you want full context visible but want to draw the eye to specific lines. WORK-304.'}},contentModel:{type:"sequence",fields:[]},transform(n,e){throw new Error("snippet rune reached the transform phase — its preprocess hook was not wired through. Ensure the content pipeline runs registered `preprocess` hooks before `Markdoc.transform` (snippet pre-resolves to a Markdoc `fence` node; see SPEC-062 § Composition).")}}),{Tag:O6}=B,v6=["caution","check","note","warning"],b6=et({attributes:{type:{type:String,matches:v6.slice(),errorLevel:"critical",description:"Visual style: caution, check, note, or warning"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new O6("meta",{content:e.type??"note"}),s=new Fe(B.transform(ct(n.body),t)).wrap("div");return Ne({rune:"hint",tag:"section",property:"contentSection",properties:{hintType:r},refs:{body:s.tag("div")},children:[r,s.next()]})}}),gC={"media-position":{type:String,required:!1,matches:["top","bottom","start","end","cover"],description:"Where the media zone sits relative to the content: above (top), below (bottom), or beside (start/end)"},"media-ratio":{type:String,required:!1,matches:["1/3","2/5","1/2","3/5","2/3"],description:"Media zone’s share of the row width when media is beside content (start/end)"},valign:{type:String,required:!1,matches:["top","center","bottom","stretch"],description:"Cross-axis alignment when media is beside content (start/end); applies to the shorter zone"},collapse:{type:String,required:!1,matches:["sm","md","lg","never"],description:"Breakpoint at which side-by-side layouts collapse to a single stacked column"}};Vj(gC,{name:"split layout",description:"Layout controls shared by media+content runes — `media-position`, `media-ratio`, `valign`, `collapse`."});const y6=gC;et({contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=n.body?Array.isArray(n.body)?n.body:[n.body]:[],i=new Fe(B.transform(r,{...t,nodes:{...t.nodes,text:{transform(s){return new B.Tag("span",{},[s.attributes.content])}}}}));return new B.Tag("li",{},i.toArray())}});function w6(n){const e=n["media-position"]||"top",t=n["media-ratio"],r=n.valign,i=n.collapse,s=e==="start"||e==="end",o=new B.Tag("meta",{content:e}),a=s&&t?new B.Tag("meta",{content:t}):void 0,l=s&&r?new B.Tag("meta",{content:r}):void 0,c=i?new B.Tag("meta",{content:i}):void 0,u=[o];return a&&u.push(a),l&&u.push(l),c&&u.push(c),{metas:{mediaPosition:o,mediaRatio:a,valign:l,collapse:c},children:u}}function _6(n){const e=[[]];for(const t of n)t.type==="hr"?e.push([]):e[e.length-1].push(t);return e.length===1?{media:[],body:e[0],footer:[]}:e.length===2?{media:e[0],body:e[1],footer:[]}:{media:e[0],body:e.slice(1,-1).flat(),footer:e[e.length-1]}}function k6(n){for(const e of n.toArray()){if(B.Tag.isTag(e)&&e.name==="img")return e;if(B.Tag.isTag(e)&&e.name==="p"){const t=e.children.find(r=>B.Tag.isTag(r)&&r.name==="img");if(t)return t}}}function x6(n){return n.map(e=>B.Tag.isTag(e)&&e.name==="p"&&e.children.length===1&&B.Tag.isTag(e.children[0])&&(e.children[0].name==="img"||e.children[0].attributes?.["data-rune"])?e.children[0]:e)}function eu(n){const e=n.nodes,t=c=>B.Tag.isTag(c)&&/^h[1-6]$/.test(c.name),r=c=>B.Tag.isTag(c)&&c.name==="p",i=e.findIndex(t);if(i===-1)return{eyebrow:void 0,headline:void 0,image:n.tag("img").limit(1),blurb:e.find(r)};const s=e.slice(0,i).findIndex(r);let o,a;if(s!==-1)o=e[s],a=i;else{const c=e.findIndex((u,f)=>f>i&&t(u));c!==-1?(o=e[i],a=c):(o=void 0,a=i)}const l=e.findIndex((c,u)=>u>a&&r(c));return{eyebrow:o,headline:e[a],image:n.tag("img").limit(1),blurb:l!==-1?e[l]:void 0}}const{Ast:OC,Tag:S6}=B,A6=et({attributes:{name:{type:String,required:!0},image:{type:String,required:!1}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){let r=new Fe([]);e.image&&(r=r.concat(B.transform(new OC.Node("image",{src:e.image}),t))),r=r.concat(new S6("span",{},[e.name??""]));const i=new Fe(B.transform(ct(n.body),t)),s=r.tag("span"),o=r.tag("svg");return[Ne({rune:"tab",tag:"button",properties:{image:o},refs:{name:s},children:r.toArray()}),Ne({rune:"tab-panel",tag:"div",properties:{},children:i.toArray()})]}});function C6(n){const e=Pv()(n),t=e.length-1;if(!e[t]||e[t].type!=="list")return n;const r=e[t].children.map(i=>{const s=i.children[0],o=Array.from(s.walk()).find(l=>l.type==="image"),a=Array.from(s.walk()).filter(l=>l.type==="text").map(l=>l.attributes.content);return new OC.Node("tag",{name:a,image:o?o.attributes.src:void 0},i.children.slice(1),"tab")});return e.splice(t,1,...r),e}const T6=et({attributes:{},contentModel:()=>({type:"custom",processChildren:n=>C6(n),description:"Converts headings at the specified level to tab tags, extracting tab name and optional image from heading content."}),transform(n,e,t){const r=ct(n.children),i=[],s=[];for(const h of r)h.type==="tag"&&h.tag==="tab"?s.push(h):(h.type==="heading"||h.type==="paragraph")&&i.push(h);const o=new Fe(B.transform(i,t)),a=new Fe(B.transform(s,t)),l=a.tag("button").typeof("Tab"),c=a.tag("div").typeof("TabPanel"),u=l.wrap("div",{role:"tablist"}),f=c.wrap("div"),d=o.count()>0?[o.wrap("header").next(),u.next(),f.next()]:[u.next(),f.next()];return Ne({rune:"tab-group",tag:"section",class:e.class,property:"contentSection",properties:{},refs:{...eu(o),tabs:u,panels:f},children:d})}}),vC="__nav-auto",bC="auto";function Ev(n){return B.Tag.isTag(n)&&(n.name==="ul"||n.name==="ol")}const P6=et({contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),{...t,nodes:{...t.nodes,text:{transform(O){return new B.Tag("span",{"data-field":"slug"},[O.attributes.content])}}}})),i=r.tag("a").toArray(),s=r.tag("span"),o=r.tag("ul"),a=r.toArray().filter(O=>B.Tag.isTag(O)&&O.attributes?.["data-rune"]==="badge"),l=r.tag("p").toArray(),c=[],u=[];for(const O of l)O.children.some(b=>B.Tag.isTag(b)&&b.name==="a")?c.push(O):u.push(O);const f=c.flatMap(O=>O.children.filter(v=>B.Tag.isTag(v)&&v.name==="a")),d=[...i,...f],h=u.flatMap(O=>O.children),m=h.length>0?new B.Tag("span",{"data-name":"description",class:"rf-nav-item__description"},h):void 0;if(d.length>0){const O=m?d.map(b=>({...b,children:[...b.children??[],m]})):d,v=[];if(a.length>0){for(const b of a)b.attributes["data-name"]="badge";v.push(...a)}return Ne({rune:"nav-item",tag:"li",properties:m?{description:m}:{},children:[...O,...v]})}const p=[];if(s.count()>0&&p.push(...s.toArray()),m&&p.push(m),a.length>0){for(const O of a)O.attributes["data-name"]="badge";p.push(...a)}return o.count()>0&&p.push(...o.toArray()),Ne({rune:"nav-item",tag:"li",properties:{slug:s,...m?{description:m}:{},children:o.count()>0?o.flatten().tag("li"):void 0},children:p})}});function E6(n){const e=[],t=[];let r=null;const i=()=>{r&&(t.push(r),r=null)};for(const s of n){if(B.Tag.isTag(s)&&/^h[1-6]$/.test(s.name)){i(),r={kind:"group",heading:s,children:[]};continue}if(B.Tag.isTag(s)&&s.name==="hr"){r&&i(),t.push({kind:"column-break"});continue}if(!r){B.Tag.isTag(s)&&Ev(s)&&e.push(...s.children.filter(o=>B.Tag.isTag(o)&&o.name==="li"));continue}r.children.push(s)}return i(),{topLevel:e,sequence:t}}function $6(n){const e=u=>B.Tag.isTag(u)?u.name==="ul"||u.name==="ol"?!0:!!u.attributes?.["data-rune"]:!1,t=u=>B.Tag.isTag(u)&&!e(u);let r=-1,i=-1;n.forEach((u,f)=>{e(u)&&(r===-1&&(r=f),i=f)});let s,o;if(r!==-1){for(let u=0;u<r;u++)if(t(n[u])){s=u;break}for(let u=n.length-1;u>i;u--)if(t(n[u])){o=u;break}}else{const u=[];n.forEach((f,d)=>{t(f)&&u.push(d)}),u.length===1?s=u[0]:u.length>=2&&(s=u[0],o=u[u.length-1])}const a=s!==void 0?n[s]:void 0,l=o!==void 0?n[o]:void 0,c=[];return n.forEach((u,f)=>{f===s||f===o||c.push(u)}),{intro:a,body:c,footer:l}}function Q6(n){const{intro:e,body:t,footer:r}=$6(n.children),i=[];for(const a of t)B.Tag.isTag(a)&&Ev(a)&&i.push(...a.children.filter(l=>B.Tag.isTag(l)&&l.name==="li"));const s=[];e&&s.push(new B.Tag("div",{"data-name":"intro"},[e])),s.push(...t),r&&s.push(new B.Tag("div",{"data-name":"footer"},[r]));const o=[n.heading];return s.length>0&&o.push(new B.Tag("div",{"data-name":"panel"},s)),Ne({rune:"nav-group",tag:"section",properties:{title:n.heading,item:i},children:o})}function L6(n){const e=[];let t=[];for(const r of n)r.kind==="column-break"?(t.length>0&&e.push(t),t=[]):t.push(r);return t.length>0&&e.push(t),e}const M6=et({attributes:{ordered:{type:Boolean,required:!1,description:"Use numbered list for navigation items"},auto:{type:Boolean,required:!1,description:"Automatically generate from child pages"},layout:{type:String,required:!1,matches:["vertical","menubar","columns","cards","strip"],description:"Presentation layout: sidebar (vertical), horizontal menubar (header), column grid (footer), cards (section landing), or strip (compact secondary nav). Defaults to vertical."},collapsible:{type:Boolean,required:!1,description:"Make each group collapsible. The group containing the current page auto-expands; others start collapsed. Only meaningful for vertical layout."},defaultOpen:{type:String,required:!1,description:"Comma-separated group titles to expand by default, overriding the URL-driven auto-open behaviour."}},contentModel:{type:"custom",processChildren:n=>Pv({level:1})(n),description:"Top-level (#) headings become nav groups; the list directly under each heading becomes the group's items. Items are page slugs — wrap in markdown links to set custom labels, or use plain text to resolve the page title. Without headings, a single list becomes a flat nav."},transform(n,e,t){const r=!!e.collapsible,i=t.variables?.__sourcePath,s=O=>{if(e.layout&&(O.attributes.layout=e.layout),i&&(O.attributes["data-source-path"]=i),e.auto&&(O.attributes["data-auto"]="true"),r){O.attributes["data-collapsible"]="true";const v=O.attributes.class??"";O.attributes.class=[v,"rf-nav--collapsible"].filter(Boolean).join(" "),typeof e.defaultOpen=="string"&&e.defaultOpen.trim()&&(O.attributes["data-default-open"]=e.defaultOpen.trim())}return O},o=O=>e.layout==="menubar"?[new B.Tag("button",{"data-name":"trigger",type:"button","aria-label":"Toggle navigation","aria-expanded":"false"},[]),...O]:O;if(e.auto){const O=new B.Tag("meta",{"data-field":vC,content:"true"});return s(Ne({rune:"nav",tag:"nav",properties:{group:[],item:[]},children:o([O])}))}const a=new Fe(B.transform(ct(n.children),{...t,nodes:{...t.nodes,item:P6,list:{transform(O,v){return new B.Tag("ul",{},O.transformChildren(v))}}}}));if(e.layout==="strip"){const O=a.flatten().tag("li");return s(Ne({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:[],item:O},children:a.toArray()}))}const{topLevel:l,sequence:c}=E6(a.toArray()),u=c.filter(O=>O.kind==="group"),f=u.length>0,d=c.some(O=>O.kind==="column-break");if(!f){if(e.layout==="columns"&&d){const v=[];let b=[];const _=()=>{b.length>0&&(v.push([new B.Tag("ul",{},b)]),b=[])};for(const y of a.toArray()){if(B.Tag.isTag(y)&&y.name==="hr"){_();continue}B.Tag.isTag(y)&&Ev(y)&&b.push(...y.children.filter(S=>B.Tag.isTag(S)&&S.name==="li"))}_();const C=v.map(y=>new B.Tag("div",{"data-name":"column"},y)),w=a.flatten().tag("li");return s(Ne({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:[],item:w},children:o(C)}))}const O=a.flatten().tag("li");return s(Ne({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:[],item:O},children:o(a.toArray())}))}const h=u.map(Q6);if(r)for(const O of h)O.attributes["data-collapsed"]=bC;const m=l.length>0?new B.Tag("div",{"data-name":"top-level"},[new B.Tag("ul",{},l)]):null,p=h.flatMap(O=>{const v=[],b=_=>{if(B.Tag.isTag(_)){if(_.name==="li"){v.push(_);return}for(const C of _.children)b(C)}};for(const _ of O.children)b(_);return v});if(e.layout==="columns"&&d){const O=L6(c),v=new Map(u.map((_,C)=>[_,h[C]])),b=O.map(_=>new B.Tag("div",{"data-name":"column"},_.map(C=>v.get(C)).filter(Boolean)));return s(Ne({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:h,item:[...l,...p]},children:o(m?[m,...b]:b)}))}return s(Ne({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:h,item:[...l,...p]},children:o(m?[m,...h]:h)}))}}),{Tag:q6}=B,D6=["replace","prepend","append"],R6=et({attributes:{name:{type:String,required:!0,description:"Name of the layout region to fill"},mode:{type:String,required:!1,matches:D6.slice(),errorLevel:"critical",default:"replace",description:"How content is placed: replace, prepend, or append"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",greedy:!0,optional:!0}]},transform(n,e,t){const r=B.transform(ct(n.body),t);return new q6("div",{"data-region":e.name,"data-mode":e.mode},r)}}),{Tag:I6}=B,N6=et({attributes:{extends:{type:String,required:!1,default:"parent",description:"Layout inheritance: parent or none"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",greedy:!0,optional:!0}]},transform(n,e,t){const r=B.transform(ct(n.body),t);return new I6("div",{"data-layout-def":!0,"data-extends":e.extends},r)}}),{Tag:B6}=B,j6=et({attributes:{summary:{type:String,required:!1,description:"Clickable summary text shown when collapsed"},open:{type:Boolean,required:!1,description:"Expand the details section by default"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.summary||"Details",s=new B6("summary",{},[i]),o=r.wrap("div"),a=Ne({rune:"details",tag:"details",properties:{summary:s},refs:{body:o.tag("div")},children:[s,o.next()]});return e.open&&(a.attributes.open=!0),a}}),{Tag:ao}=B,cg="data-drawer-title-auto",z6=["right","left","top","bottom"],Z6=["sm","md","lg"];function F6(n){const e=n.findIndex(t=>t.type==="hr");return e<0?{body:n,footer:null}:{body:n.slice(0,e),footer:n.slice(e+1)}}const X6=et({attributes:{id:{type:String,required:!0,description:'Stable id for the drawer. Used in entity registration and as the `id="drawer-{value}"` on the rendered element so xref triggers can target it via fragment.'},title:{type:String,required:!1,description:"Panel heading text. Rendered in the drawer header (or as a heading in the no-JS in-flow rendering)."},headingLevel:{type:Number,required:!1,description:"Heading level (1-6) for the title. When omitted, the level is auto-detected from outline position (one deeper than the nearest preceding heading). Out-of-range values are clamped to the 1-6 range."},shortcut:{type:String,required:!1,description:'Keyboard shortcut that opens the drawer when behaviors are loaded (e.g. ".", "cmd+k"). Surfaces as `data-shortcut`; the progressive-enhancement layer wires the listener.'},side:{type:String,required:!1,matches:z6.slice(),description:'Edge the panel slides from when enhanced. Defaults to "right".'},size:{type:String,required:!1,matches:Z6.slice(),description:'Panel size. "sm" / "md" (default) / "lg" — width for left/right sides, height for top/bottom.'}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=e.id,i=e.title,s=e.side??"right",o=e.size??"md",a=typeof e.headingLevel=="number"?Math.min(6,Math.max(1,Math.trunc(e.headingLevel))):void 0,l=i?a?new ao(`h${a}`,{},[i]):new ao("h3",{[cg]:"true"},[i]):void 0,c=new ao("button",{type:"button","aria-label":"Close",hidden:!0},["×"]),u=[];l&&u.push(l),u.push(c);const f=new ao("header",{},u),d=F6(ct(n.body)),h=new Fe(B.transform(d.body,t)).wrap("div"),m=d.footer!==null?new Fe(B.transform(d.footer,t)).wrap("footer"):null,p={side:new ao("meta",{content:s}),size:new ao("meta",{content:o})};e.shortcut&&(p.shortcut=new ao("meta",{content:e.shortcut}));const O=Ne({rune:"drawer",tag:"section",id:`drawer-${r}`,properties:p,refs:{header:f,...l?{title:l}:{},close:c,body:h.tag("div"),...m?{footer:m.tag("footer")}:{}},children:[...Object.values(p),f,h.next(),...m?[m.next()]:[]]});return O.attributes["data-drawer-id"]=r,O}}),{Tag:Ru}=B,V6=["small","medium","large","full"],W6=["left","center","right"],Y6=et({attributes:{size:{type:String,required:!1,matches:V6.slice(),description:"Display width of the figure"},align:{type:String,required:!1,matches:W6.slice(),description:"Horizontal alignment of the figure"},caption:{type:String,required:!1,description:"Caption text displayed below the figure"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=r.flatten().tag("img").toArray(),s=r.tag("p").toArray().filter(f=>{const d=(f.children||[]).filter(h=>B.Tag.isTag(h));return!(d.length===1&&d[0].name==="img")}),o=e.caption||void 0,a=o?new Ru("figcaption",{},[o]):s.length>0?new Ru("figcaption",{},[s[0]]):void 0,l=e.size?new Ru("meta",{content:e.size}):void 0,c=e.align?new Ru("meta",{content:e.align}):void 0,u=[...i];return a&&u.push(a),l&&u.push(l),c&&u.push(c),Ne({rune:"figure",schemaOrgType:"ImageObject",tag:"figure",properties:{...l?{size:l}:{},...c?{align:c}:{}},refs:{...a?{caption:a}:{}},schema:{...i.length>0?{contentUrl:i[0]}:{},...a?{caption:a}:{}},children:u})}}),{Tag:lo}=B,U6=["grid","carousel","masonry"],G6=et({attributes:{layout:{type:String,required:!1,matches:U6.slice(),description:"Arrangement of images in the gallery"},columns:{type:Number,required:!1,description:"Number of columns in grid layout"},lightbox:{type:Boolean,required:!1,description:"Allow clicking images to view full-size"},caption:{type:String,required:!1,description:"Caption text displayed below the gallery"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.layout??"grid",s=e.columns??3,o=e.lightbox??!0,a=e.caption??"",c=r.flatten().tag("img").toArray().map(v=>{const b=v.attributes?.alt||"",_=[v];return b&&_.push(new lo("figcaption",{},[b])),new lo("figure",{"data-name":"item"},_)}),u=new lo("meta",{content:i}),f=new lo("meta",{content:String(o)}),d=s!==3?new lo("meta",{content:String(s)}):void 0,h=a?new lo("figcaption",{},[a]):void 0,m=new lo("div",{"data-name":"items"},c),O=[...[u,f,d].filter(Boolean),m];return h&&O.push(h),Ne({rune:"gallery",schemaOrgType:"ImageGallery",tag:"figure",properties:{layout:u,lightbox:f,...d?{columns:d}:{},...h?{caption:h}:{}},children:O})}}),{Tag:wp}=B,H6=et({attributes:{name:{type:String,required:!0}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new wp("summary",{},[e.name??""]),i=new Fe(B.transform(ct(n.body),t)).wrap("div"),s=i.tag("div");for(const o of s.nodes)wp.isTag(o)&&(o.attributes.typeof="Answer",o.children=[new wp("div",{property:"text"},o.children)]);return Ne({rune:"accordion-item",schemaOrgType:"Question",tag:"details",properties:{name:r},refs:{body:s},schema:{name:r,acceptedAnswer:s},children:[r,i.next()]})}}),K6=et({attributes:{multiple:{type:Boolean,required:!1,description:"Allow multiple panels to be open at once"}},contentModel:()=>({type:"sections",sectionHeading:"heading",emitTag:"accordion-item",emitAttributes:{name:"$heading"},fields:[{name:"header",match:"heading|paragraph",optional:!0,greedy:!0},{name:"items",match:"tag",optional:!0,greedy:!0}],sectionModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]}}),transform(n,e,t){const r=new Fe(B.transform(ct(n.header),t)),i=[...ct(n.items),...ct(n.sections)],o=new Fe(B.transform(i,t)).tag("details").typeof("AccordionItem"),a=o.wrap("div"),l=r.count()>0?[r.wrap("header").next(),a.next()]:[a.next()];return Ne({rune:"accordion",schemaOrgType:"FAQPage",tag:"section",property:"contentSection",properties:{item:o},refs:{...eu(r),items:a},schema:{mainEntity:o},children:l})}}),{Tag:Tl}=B,J6=et({attributes:{depth:{type:Number,required:!1,default:3,description:"Maximum heading depth to include"},ordered:{type:Boolean,required:!1,default:!1,description:"Use numbered list instead of bullets"}},contentModel:{type:"sequence",fields:[]},transform(n,e,t){const r=t.variables?.headings||[],i=e.depth+1,o=r.filter(u=>u.level>=2&&u.level<=i).map(u=>new Tl("li",{"data-level":u.level},[new Tl("a",{href:`#${u.id}`},[u.text])])),a=new Tl("ul",{},o),l=new Tl("meta",{content:e.depth}),c=new Tl("meta",{content:e.ordered});return Ne({rune:"table-of-contents",tag:"nav",properties:{depth:l,ordered:c},refs:{list:a},children:[l,c,a]})}}),{Tag:ra}=B,e8=["16:9","4:3","1:1","auto"];function t8(n){try{const e=new URL(n),t=e.hostname.replace("www.","");if(t==="youtube.com"||t==="youtu.be"){let r="";return t==="youtu.be"?r=e.pathname.slice(1):r=e.searchParams.get("v")||"",{provider:"youtube",embedUrl:r?`https://www.youtube-nocookie.com/embed/${r}`:n,type:"video"}}if(t==="vimeo.com")return{provider:"vimeo",embedUrl:`https://player.vimeo.com/video/${e.pathname.slice(1)}`,type:"video"};if(t==="twitter.com"||t==="x.com")return{provider:"twitter",embedUrl:n,type:"tweet"};if(t==="codepen.io")return{provider:"codepen",embedUrl:n.replace("/pen/","/embed/"),type:"codepen"};if(t==="open.spotify.com")return{provider:"spotify",embedUrl:n.replace("open.spotify.com/","open.spotify.com/embed/"),type:"spotify"}}catch{}return{provider:"generic",embedUrl:n,type:"generic"}}const n8=et({attributes:{url:{type:String,required:!0,description:"URL of the content to embed"},type:{type:String,required:!1,description:"Override auto-detected embed type"},aspect:{type:String,required:!1,matches:e8.slice(),description:"Aspect ratio of the embed frame"},title:{type:String,required:!1,description:"Accessible title for the embed iframe"}},contentModel:{type:"sequence",fields:[{name:"fallback",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=e.url??"",i=t8(r),s=e.aspect??"16:9",o=e.title||"Embedded content",[a,l]=s.split(":").map(Number),c=l&&a?l/a*100:56.25,u=new ra("meta",{content:r}),f=new ra("meta",{content:e.title??""}),d=new ra("meta",{content:i.embedUrl}),h=new ra("meta",{content:i.provider}),m=new Fe(B.transform(ct(n.fallback),t)).wrap("div"),p=m.tag("div"),O=[u,f,d];let v;if(i.embedUrl){const b=new ra("iframe",{src:i.embedUrl,title:o,frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"",loading:"lazy"},[]);v=new ra("div",{style:`padding-bottom: ${c}%`},[b]),O.push(v)}return O.push(m.next()),Ne({rune:"embed",schemaOrgType:"VideoObject",tag:"figure",properties:{provider:h},refs:{...v?{wrapper:v}:{},fallback:p},schema:{name:f,contentUrl:u,embedUrl:d},children:O})}}),{Tag:fi}=B,yC="__breadcrumb-auto",r8=et({attributes:{separator:{type:String,required:!1,default:"/",description:"Character between breadcrumb items"},auto:{type:Boolean,required:!1,default:!1,description:"Automatically generate from page hierarchy"}},contentModel:n=>n.auto?{type:"sequence",fields:[]}:{type:"sequence",fields:[{name:"list",match:"list",optional:!0,greedy:!0}]},transform(n,e,t){const r=new fi("meta",{content:e.separator});if(e.auto){const l=new fi("meta",{"data-field":yC,content:"true"}),c=new fi("ol",{},[]);return Ne({rune:"breadcrumb",schemaOrgType:"BreadcrumbList",tag:"nav",properties:{separator:r},refs:{items:c},children:[r,l,c]})}const i=new Fe(B.transform(ct(n.list),t)),s=[];let o=0;for(const l of i.toArray())if(fi.isTag(l)&&(l.name==="ul"||l.name==="ol")){for(const c of l.children)if(fi.isTag(c)&&c.name==="li"){o++;const u=new fi("meta",{content:o}),f=c.children.find(d=>fi.isTag(d)&&d.name==="a");if(f){const d=new fi("span",{hidden:!0},f.children),h=new fi("a",{href:f.attributes.href},f.children);s.push(Ne({rune:"breadcrumb-item",schemaOrgType:"ListItem",tag:"li",properties:{name:d,url:h},schema:{name:d,item:h,position:u},children:[d,h,u]}))}else{const d=c.children.filter(m=>typeof m=="string").join("").trim(),h=new fi("span",{},d?[d]:c.children);s.push(Ne({rune:"breadcrumb-item",schemaOrgType:"ListItem",tag:"li",properties:{name:h},schema:{name:h,position:u},children:[h,u]}))}}}const a=new fi("ol",{},s);return Ne({rune:"breadcrumb",schemaOrgType:"BreadcrumbList",tag:"nav",properties:{separator:r},refs:{items:a},schema:{itemListElement:s},children:[r,a]})}}),{Tag:Mi}=B,ug="__pagination-auto",i8=et({attributes:{auto:{type:Boolean,required:!1,default:!1,description:"Derive prev/next from sibling page order"},prev:{type:String,required:!1,description:"Explicit previous page (slug or URL)"},next:{type:String,required:!1,description:"Explicit next page (slug or URL)"},scope:{type:String,required:!1,matches:["siblings","section"],default:"siblings",description:"Auto-mode scope: direct siblings, or all pages in the current top-level section"},"prev-label":{type:String,required:!1,description:"Override label for the previous link"},"next-label":{type:String,required:!1,description:"Override label for the next link"}},contentModel:{type:"sequence",fields:[]},selfClosing:!0,transform(n,e,t){if(e.auto){const i=new Mi("meta",{"data-field":ug,content:"true"}),s=e.scope?new Mi("meta",{"data-field":"scope",content:String(e.scope)}):null,o=e["prev-label"]?new Mi("meta",{"data-field":"prev-label",content:String(e["prev-label"])}):null,a=e["next-label"]?new Mi("meta",{"data-field":"next-label",content:String(e["next-label"])}):null,l=[i,s,o,a].filter(Boolean);return Ne({rune:"pagination",tag:"nav",children:l})}const r=[];if(e.prev){const s=String(e.prev).startsWith("/")||/^[a-z]+:\/\//i.test(String(e.prev))?String(e.prev):`__slug:${e.prev}`,o=e["prev-label"]??String(e.prev);r.push(new Mi("a",{href:s,"data-direction":"prev","data-name":"prev"},[new Mi("span",{"data-name":"marker"},["←"]),new Mi("span",{"data-name":"label"},[o])]))}if(e.next){const s=String(e.next).startsWith("/")||/^[a-z]+:\/\//i.test(String(e.next))?String(e.next):`__slug:${e.next}`,o=e["next-label"]??String(e.next);r.push(new Mi("a",{href:s,"data-direction":"next","data-name":"next"},[new Mi("span",{"data-name":"label"},[o]),new Mi("span",{"data-name":"marker"},["→"])]))}return Ne({rune:"pagination",tag:"nav",children:r})}}),{Ast:fg,Tag:wn}=B,s8=/^(.+)\s*:\s*([€$£¥]?\s*[\d].*)$/;function o8(n){const e=n.replace(/[€$£¥\s]/g,"").replace(/,/g,""),t=e.match(/^([\d.]+)\s*[-–]\s*([\d.]+)/);if(t)return(parseFloat(t[1])+parseFloat(t[2]))/2;const r=parseFloat(e);return isNaN(r)?0:r}const a8={USD:"$",EUR:"€",GBP:"£",JPY:"¥",CNY:"¥",AUD:"A$",CAD:"C$",CHF:"CHF ",SEK:"kr",NOK:"kr",DKK:"kr",INR:"₹",KRW:"₩",BRL:"R$",MXN:"MX$",ZAR:"R"};function _p(n,e){const t=(n%1===0?String(n):n.toFixed(2)).split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e+t.join(".")}function l8(n){let e=0;const t=n.match(/(\d+)\s*day/i),r=n.match(/(\d+)\s*week/i),i=n.match(/(\d+)\s*month/i);if(t&&(e+=parseInt(t[1])),r&&(e+=parseInt(r[1])*7),i&&(e+=parseInt(i[1])*30),e===0){const s=parseInt(n);isNaN(s)||(e=s)}return e}function D0(n,e){for(const t of n.children)if(B.Tag.isTag(t)&&t.attributes["data-field"]===e)return String(t.attributes.content??"");return""}const c8=/^(.+?)\s*\((?:estimate|est\.?)\)\s*$/i,u8=/^~(.+?)~$/;function f8(n){const e=[];let t=!1;for(const o of n.walk())o.type==="text"&&o.attributes.content&&e.push(o.attributes.content),o.type==="s"&&(t=!0);const r=e.join(" ").trim(),i=r.match(c8);if(i)return{label:i[1].trim(),estimate:!0};const s=r.match(u8);return s?{label:s[1].trim(),estimate:!0}:t?{label:r,estimate:!0}:{label:r,estimate:!1}}const d8=et({attributes:{description:{type:String,required:!1,description:"Line item description"},amount:{type:String,required:!1,description:"Line item amount"}},contentModel:{type:"sequence",fields:[]},transform(n,e){const t=new wn("span",{},[e.description??""]),r=new wn("span",{},[e.amount??""]);return Ne({rune:"budget-line-item",tag:"li",properties:{description:t,amount:r},children:[t,r]})}});function h8(n){const e=[];for(const t of n)if(t.type==="list")for(const r of t.children){const i=[];for(const a of r.walk())a.type==="text"&&a.attributes.content&&i.push(a.attributes.content);const s=i.join(" ").trim(),o=s.match(s8);o?e.push(new fg.Node("tag",{description:o[1].trim(),amount:o[2].trim()},[],"budget-line-item")):e.push(new fg.Node("tag",{description:s,amount:""},[],"budget-line-item"))}else e.push(t);return e}function p8(n){let e=0;for(const t of n)t.type==="tag"&&t.tag==="budget-line-item"&&t.attributes.amount&&(e+=o8(t.attributes.amount));return e}const m8=et({attributes:{label:{type:String,required:!0},estimate:{type:Boolean,required:!1}},contentModel:{type:"custom",processChildren:h8,description:'Converts list items into budget-line-item tags with "Description: $Amount" pattern.'},transform(n,e,t){const r=ct(n.children),i=p8(r),s=new Fe(B.transform(r,t)),o=new wn("meta",{content:e.label??""}),a=new wn("meta",{content:e.estimate?"estimate":"false"}),l=new wn("meta",{content:String(i)}),c=s.tag("li").typeof("BudgetLineItem"),u=new wn("ul",{},c.toArray());return Ne({rune:"budget-category",tag:"div",properties:{label:o,estimate:a,lineItem:c,subtotal:l},refs:{"line-items":u},children:[o,a,l,u]})}}),g8=["detailed","summary"];function O8(n){const e=n,t=e.reduce((l,c,u)=>(c.type==="heading"&&l.push({idx:u,level:c.attributes.level}),l),[]);let r=[],i=e;t.length>=2&&t[0].level<t[1].level&&(r=e.slice(0,t[1].idx),i=e.slice(t[1].idx));const s=Pv()(i),o=s.length-1;if(!s[o]||s[o].type!=="list")return n;const a=s[o].children.map(l=>{const c=l.children[0],{label:u,estimate:f}=f8(c);return new fg.Node("tag",{label:u,estimate:f},l.children.slice(1),"budget-category")});return s.splice(o,1,...a),[...r,...s]}const v8=et({attributes:{currency:{type:String,required:!1,description:"Currency symbol or code (e.g. USD, EUR)"},duration:{type:String,required:!1,description:'Budget duration for per-day calculations (e.g. "5 days", "1 month")'},showPerDay:{type:Boolean,required:!1,description:"Show per-day cost breakdown"},variant:{type:String,required:!1,matches:g8.slice(),description:"Display style: detailed line items or summary"}},contentModel:{type:"custom",processChildren:O8,description:'Converts headings into budget-category tags with estimate parsing, where list items become budget-line-items with "Description: $Amount" pattern.'},transform(n,e,t){const r=ct(n.children),i=[],s=[];for(const L of r)L.type==="tag"?s.push(L):(L.type==="paragraph"||L.type==="heading")&&i.push(L);const o=new Fe(B.transform(i,t)),a=new Fe(B.transform(s,t)),l=eu(o),c=e.currency??"USD",u=e.duration??"",f=e.showPerDay??!0,d=e.variant??"detailed",h=a8[c.toUpperCase()]||c+" ",m=new wn("meta",{content:c}),p=new wn("meta",{content:u}),O=new wn("meta",{content:String(f)}),v=new wn("meta",{content:d}),b=a.tag("div").typeof("BudgetCategory"),_=b.toArray();let C=0;for(const L of _){if(!B.Tag.isTag(L))continue;const P=D0(L,"label"),q=parseFloat(D0(L,"subtotal"))||0;C+=q;const R=new wn("div",{class:"rf-budget-category__header"},[new wn("span",{class:"rf-budget-category__label"},[P]),new wn("span",{class:"rf-budget-category__subtotal"},[_p(q,h)])]);L.children=[R,...L.children]}const w=new wn("div",{},_),y=u?l8(u):0,S=!!u&&f&&y>0,A=S?C/y:0,x=[new wn("div",{class:"rf-budget__total"},[new wn("span",{class:"rf-budget__total-label"},["Total"]),new wn("span",{class:"rf-budget__total-amount"},[_p(C,h)])])];S&&x.push(new wn("div",{class:"rf-budget__per-day"},[new wn("span",{class:"rf-budget__per-day-label"},["Per day"]),new wn("span",{class:"rf-budget__per-day-amount"},[_p(A,h)])]));const k=new wn("div",{class:"rf-budget__footer"},x),E=new wn("meta",{content:String(C)}),T=new wn("meta",{content:String(A)}),$=[m,p,O,v,...o.toArray(),w,k];return Ne({rune:"budget",schemaOrgType:"ItemList",tag:"section",property:"contentSection",properties:{currency:m,duration:p,showPerDay:O,variant:v,category:b,total:E,...S?{perDay:T}:{}},refs:{...l,categories:w},children:$})}}),{Tag:ns}=B,b8=["side-by-side","stacked"],y8=et({attributes:{layout:{type:String,required:!1,matches:b8.slice(),description:"Display panels side-by-side or stacked"},labels:{type:String,required:!1,description:"Comma-separated custom labels for each panel"},title:{type:String,required:!1,description:"Optional title displayed above the panels"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.layout??"side-by-side",s=e.labels??"",o=e.title??"",a=new ns("meta",{content:i}),l=[],c=s?s.split(",").map(m=>m.trim()):[];let u=0;for(const m of r.toArray()){let p;if(ns.isTag(m)&&m.name==="pre")p=m;else if(ns.isTag(m)&&m.name==="div"&&m.attributes.class==="rf-codeblock"){const O=m.children.find(v=>ns.isTag(v)&&v.name==="pre");O&&(p=O)}if(p&&ns.isTag(p)){const O=c[u]||p.attributes["data-language"]||`Panel ${u+1}`,v=new ns("span",{"data-label":!0},[O]);l.push(new ns("div",{"data-panel":!0},[v,m])),u++}}const f=new ns("div",{"data-panels":!0},l),d=o?[new ns("div",{"data-name":"header"},[o])]:[],h=Ne({rune:"compare",tag:"div",properties:{layout:a},refs:{panels:f},children:[a,...d,f]});return h.attributes["data-code-host"]=!0,h}}),{Tag:rs}=B,w8=et({attributes:{sortable:{type:String,required:!1,description:'Column names to enable sorting, or "all"'},searchable:{type:Boolean,required:!1,description:"Show a search input to filter rows"},pageSize:{type:Number,required:!1,description:"Rows per page; 0 disables pagination"},defaultSort:{type:String,required:!1,description:"Column to sort by initially"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=new rs("meta",{content:e.sortable??""}),s=new rs("meta",{content:String(e.searchable??!1)}),o=new rs("meta",{content:String(e.pageSize??0)}),a=new rs("meta",{content:e.defaultSort??""});let l;const c=r.tag("table");if(c.count()>0)l=c.next();else{const u=r.toArray().find(d=>rs.isTag(d)&&d.name==="div"&&d.attributes.class==="rf-table-wrapper"),f=u&&rs.isTag(u)?u.children.find(d=>rs.isTag(d)&&d.name==="table"):void 0;l=f&&rs.isTag(f)?f:new rs("table",{},[])}return Ne({rune:"data-table",schemaOrgType:"Dataset",tag:"div",properties:{sortable:i,searchable:s,pageSize:o,defaultSort:a},refs:{table:l},children:[i,s,o,a,l]})}}),{Tag:Pn}=B,_8=["unified","split","inline"];function k8(n,e){const t=n.split(`
|
|
295
|
+
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}r.prototype.build=function(a){return this.options.preserveOrder?n(a,this.options):(Array.isArray(a)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(a={[this.options.arrayNodeName]:a}),this.j2x(a,0,[]).val)},r.prototype.j2x=function(a,l,c){let u="",f="";const d=c.join(".");for(let h in a)if(Object.prototype.hasOwnProperty.call(a,h))if(typeof a[h]>"u")this.isAttribute(h)&&(f+="");else if(a[h]===null)this.isAttribute(h)?f+="":h[0]==="?"?f+=this.indentate(l)+"<"+h+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+h+"/"+this.tagEndChar;else if(a[h]instanceof Date)f+=this.buildTextValNode(a[h],h,"",l);else if(typeof a[h]!="object"){const m=this.isAttribute(h);if(m&&!this.ignoreAttributesFn(m,d))u+=this.buildAttrPairStr(m,""+a[h]);else if(!m)if(h===this.options.textNodeName){let p=this.options.tagValueProcessor(h,""+a[h]);f+=this.replaceEntitiesValue(p)}else f+=this.buildTextValNode(a[h],h,"",l)}else if(Array.isArray(a[h])){const m=a[h].length;let p="",O="";for(let v=0;v<m;v++){const b=a[h][v];if(!(typeof b>"u"))if(b===null)h[0]==="?"?f+=this.indentate(l)+"<"+h+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+h+"/"+this.tagEndChar;else if(typeof b=="object")if(this.options.oneListGroup){const _=this.j2x(b,l+1,c.concat(h));p+=_.val,this.options.attributesGroupName&&b.hasOwnProperty(this.options.attributesGroupName)&&(O+=_.attrStr)}else p+=this.processTextOrObjNode(b,h,l,c);else if(this.options.oneListGroup){let _=this.options.tagValueProcessor(h,b);_=this.replaceEntitiesValue(_),p+=_}else p+=this.buildTextValNode(b,h,"",l)}this.options.oneListGroup&&(p=this.buildObjectNode(p,h,O,l)),f+=p}else if(this.options.attributesGroupName&&h===this.options.attributesGroupName){const m=Object.keys(a[h]),p=m.length;for(let O=0;O<p;O++)u+=this.buildAttrPairStr(m[O],""+a[h][m[O]])}else f+=this.processTextOrObjNode(a[h],h,l,c);return{attrStr:u,val:f}},r.prototype.buildAttrPairStr=function(a,l){return l=this.options.attributeValueProcessor(a,""+l),l=this.replaceEntitiesValue(l),this.options.suppressBooleanAttributes&&l==="true"?" "+a:" "+a+'="'+l+'"'};function i(a,l,c,u){const f=this.j2x(a,c+1,u.concat(l));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],l,f.attrStr,c):this.buildObjectNode(f.val,l,f.attrStr,c)}r.prototype.buildObjectNode=function(a,l,c,u){if(a==="")return l[0]==="?"?this.indentate(u)+"<"+l+c+"?"+this.tagEndChar:this.indentate(u)+"<"+l+c+this.closeTag(l)+this.tagEndChar;{let f="</"+l+this.tagEndChar,d="";return l[0]==="?"&&(d="?",f=""),(c||c==="")&&a.indexOf("<")===-1?this.indentate(u)+"<"+l+c+d+">"+a+f:this.options.commentPropName!==!1&&l===this.options.commentPropName&&d.length===0?this.indentate(u)+`<!--${a}-->`+this.newLine:this.indentate(u)+"<"+l+c+d+this.tagEndChar+a+this.indentate(u)+f}},r.prototype.closeTag=function(a){let l="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(l="/"):this.options.suppressEmptyNode?l="/":l=`></${a}`,l},r.prototype.buildTextValNode=function(a,l,c,u){if(this.options.cdataPropName!==!1&&l===this.options.cdataPropName)return this.indentate(u)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&l===this.options.commentPropName)return this.indentate(u)+`<!--${a}-->`+this.newLine;if(l[0]==="?")return this.indentate(u)+"<"+l+c+"?"+this.tagEndChar;{let f=this.options.tagValueProcessor(l,a);return f=this.replaceEntitiesValue(f),f===""?this.indentate(u)+"<"+l+c+this.closeTag(l)+this.tagEndChar:this.indentate(u)+"<"+l+c+">"+f+"</"+l+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let l=0;l<this.options.entities.length;l++){const c=this.options.entities[l];a=a.replace(c.regex,c.val)}return a};function s(a){return this.options.indentBy.repeat(a)}function o(a){return a.startsWith(this.options.attributeNamePrefix)&&a!==this.options.textNodeName?a.substr(this.attrPrefixLen):!1}return vp=r,vp}var bp,m0;function bj(){if(m0)return bp;m0=1;const n=eC(),e=gj(),t=vj();return bp={XMLParser:e,XMLValidator:n,XMLBuilder:t},bp}var yj=bj();const wj="RFTO",_j="RFTC";function kj(n){return n.includes("")?n.replaceAll(wj,"{%").replaceAll(_j,"%}"):n}const{dirname:nC,join:rC,isAbsolute:xj}=cj,{Tag:wi}=B,Sj={children:["inline"],attributes:{level:{type:"Number",required:!0,render:!1},property:{type:String,required:!1}},transform(n,e){const t=n.transformAttributes(e),r=n.transformChildren(e);return(!t.id||typeof t.id!="string")&&(t.id=r.filter(i=>typeof i=="string").join(" ").replace(/[?{}%]/g,"").replace(/\s+/g,"-").toLowerCase()),new wi(`h${n.attributes.level}`,t,r)}},Aj={children:["inline"],attributes:{property:{type:String,required:!1}},render:"p"},Cj={render:"fence",attributes:{content:{type:String,render:!1},process:{type:Boolean,render:!1,default:!1},language:{type:String,render:!1,default:"shell"},source:{type:String,render:!1},lines:{type:String,render:!1},linenumbers:{type:Boolean,render:!1,default:!1},highlight:{type:String,render:!1},label:{type:String,render:!1}},transform(n,e){const t=n.attributes.language||"shell",r={"data-language":t},i={"data-language":t},s=n.attributes.source;typeof s=="string"&&s.length>0&&(r["data-source"]=s,i["data-source"]=s);const o=n.attributes.lines;if(typeof o=="string"&&o.length>0){r["data-lines"]=o,i["data-lines"]=o;const c=/^(\d+)/.exec(o.trim());if(c){const u=Number(c[1]);if(Number.isFinite(u)&&u>0){const f=typeof r.style=="string"?`${r.style}; `:"";r.style=`${f}--rf-start-line: ${u-1}`}}}n.attributes.linenumbers===!0&&(r["data-linenumbers"]="true",i["data-linenumbers"]="true");const a=n.attributes.highlight;typeof a=="string"&&a.length>0&&(r["data-highlight-lines"]=a,i["data-highlight-lines"]=a);for(const[c,u]of Object.entries(n.attributes))c.startsWith("data-")&&(r[c]=u,i[c]=u);const l=new wi("pre",r,[new wi("code",i,[kj(n.attributes.content)])]);return new wi("div",{class:"rf-codeblock"},[l])}},Tj={children:["item"],attributes:{ordered:{type:Boolean,render:!1,required:!0},start:{type:Number},marker:{type:String,render:!1}},transform(n,e){return new wi(n.attributes.ordered?"ol":"ul",n.transformAttributes(e),n.transformChildren(e))}},Pj={render:"li",children:["inline","heading","paragraph","image","table","tag","fence","blockquote","list","hr"],attributes:{property:{type:String,required:!1},typeof:{type:String,required:!1}}},Ej={render:"em",children:["strong","s","link","code","text","tag"],attributes:{marker:{type:String,render:!0}}},$j={render:"strong",children:["em","s","link","code","text","tag"],attributes:{marker:{type:String,render:!0}}},Qj={attributes:{content:{type:String,required:!0},property:{type:String,required:!1}},transform(n,e){const t=n.transformAttributes(e);return t.property?new wi("span",{"data-field":t.property},[n.attributes.content]):n.attributes.content}},iC={children:["strong","em","s","code","text","tag"],attributes:{href:{type:String,required:!0},title:{type:String}},render:"a",transform(n,e){const{urls:t,path:r}=e.variables||{},i=r?nC(r):"/";let s=n.attributes;const o=i!=="/"?rC(i,n.attributes.href):n.attributes.href;if(o in(t||{})){const a=t[o];s={...s,href:a}}return new wi(this.render,s,n.transformChildren(e))}},Lj=B.nodes.hardbreak,Mj={render:"img",attributes:{src:{type:String,required:!0},alt:{type:String},title:{type:String},property:{type:String}},transform(n,e){const t=n.transformAttributes(e),r=e.variables?.svg||[];let i=n.attributes.src;!xj(i)&&e.variables?.path&&(i=rC("/",nC(e.variables.path),i));const s=r.find(o=>o._id===i);if(s){let a=new yj.XMLParser({ignoreAttributes:!1}).parse(s.content);const l=ig("svg",a.svg);return t.property&&(l.attributes["data-field"]=t.property),l.attributes.xmlns=void 0,l}return new wi(this.render,t,n.transformChildren(e))}},qj={children:["thead","tbody","tr"],attributes:{},transform(n,e){const t=new wi("table",n.transformAttributes(e),n.transformChildren(e));return new wi("div",{class:"rf-table-wrapper"},[t])}};function ig(n,e){if(Array.isArray(e))return e.map(i=>ig(n,i));let t=[],r={};for(const[i,s]of Object.entries(e))i.startsWith("@_")?r[i.slice(2)]=s:i==="#text"?t.push(s):t.push(ig(i,s));return new wi(n,r,t)}const{Tag:wU}=B,{Ast:pf}=B;function Dj(n){let e,t;return{filtered:n.filter(i=>i.type==="tag"&&i.tag==="tint"?(e=i,!1):i.type==="tag"&&i.tag==="bg"?(t=i,!1):!0),tintNode:e,bgNode:t}}function Ec(n,e){if(e==="any")return!0;if(e.includes("|"))return e.split("|").some(t=>Ec(n,t));if(e.startsWith("heading:")){const t=parseInt(e.slice(8),10);return n.type==="heading"&&n.attributes?.level===t}if(e==="list:ordered")return n.type==="list"&&n.attributes?.ordered===!0;if(e==="list:unordered")return n.type==="list"&&n.attributes?.ordered!==!0;if(e.startsWith("tag:")){const t=e.slice(4);return n.type==="tag"&&n.tag===t}return n.type===e}function _a(n,e){const t={};let r=0;for(const i of e){if(r>=n.length)continue;const s=n[r];if(Ec(s,i.match)){if(i.greedy){const o=[];for(;r<n.length&&Ec(n[r],i.match);)o.push(n[r]),r++;t[i.name]=o}else t[i.name]=s,r++;if(i.itemModel)if(i.emitTag){const o=i.greedy?t[i.name]:[t[i.name]],a=[];for(const l of o){if(!l||l.type!=="list")continue;const c=sg(l,i.itemModel),u=l.children??[];for(let f=0;f<c.length;f++){const d={},h=i.emitAttributes;if(h)for(const[p,O]of Object.entries(h))if(O.startsWith("$")){const v=O.slice(1).split("|");d[p]=v.map(b=>c[f][b.trim()]).find(b=>b!=null&&b!=="")??""}else d[p]=O;const m=u[f]?.children?.slice(1)??[];a.push(new pf.Node("tag",d,m,i.emitTag))}}t[i.name]=a}else{const o=t[i.name];o&&typeof o=="object"&&"type"in o&&(t[`${i.name}Data`]=sg(o,i.itemModel))}}else i.optional||r++}return t}function Rj(n,e){const t=[[]];for(const i of n)Ec(i,e.delimiter)?t.push([]):t[t.length-1].push(i);if(e.dynamicZones&&e.zoneModel)return{zones:t.map(i=>$c(i,e.zoneModel))};const r={};if(e.zones){const i=t.length===1?e.zones.findIndex(s=>s.primary):-1;for(let s=0;s<e.zones.length;s++){const o=e.zones[s];let a;i>=0?a=s===i?t[0]:[]:a=s<t.length?t[s]:[],r[o.name]=_a(a,o.fields)}}return r}function g0(n){const e=[];for(const t of n.walk())t.type==="text"&&t.attributes?.content&&e.push(t.attributes.content);return e.join(" ")}function O0(n,e){const t={};let r=n;for(const i of e.fields)if(i.pattern==="remainder")t[i.name]=r.trim(),r="";else{const s=r.match(i.pattern);s?(t[i.name]=(s[1]||s[0]).trim(),r=r.slice(s[0].length)):i.optional||(t[i.name]=r.trim())}return t}function Ij(n,e){const t=n.toLowerCase().trim();for(const[r,i]of Object.entries(e)){if(r.toLowerCase()===t)return{canonicalName:r,definition:i};if(i.alias){for(const s of i.alias)if(s.toLowerCase()===t)return{canonicalName:r,definition:i}}}}function Nj(n,e){const t=e.sectionHeading;let r;if(t.includes(":"))r=parseInt(t.split(":")[1],10);else{const c=n.filter(u=>u.type==="heading");if(c.length>=2){const u=c[0].attributes?.level,f=c[1].attributes?.level;u!==void 0&&f!==void 0&&f>u?r=c.filter(h=>h.attributes?.level===f).length>=2?f:u:r=u}else r=c[0]?.attributes?.level}if(r===void 0){if(e.implicitSection&&e.emitTag){const u=e.fields?_a([],e.fields):{},f=new pf.Node("tag",{...e.implicitSection.attributes??{}},n,e.emitTag);return{...u,sections:[f]}}return{...e.fields?_a(n,e.fields):{},sections:[]}}const i=[],s=[];let o=null;for(const c of n)c.type==="heading"&&c.attributes?.level===r?(o&&s.push(o),o={headingNode:c,body:[]}):o?o.body.push(c):i.push(c);if(o&&s.push(o),s.length===0&&e.implicitSection&&e.emitTag){const c=e.fields?_a([],e.fields):{},u=new pf.Node("tag",{...e.implicitSection.attributes??{}},n,e.emitTag);return{...c,sections:[u]}}const a=e.fields?_a(i,e.fields):{};if(e.emitTag){const c=s.map(u=>{const f=g0(u.headingNode),d=e.headingExtract?O0(f,e.headingExtract):{},h={};if(e.emitAttributes)for(const[m,p]of Object.entries(e.emitAttributes))p==="$heading"?h[m]=f:p.startsWith("$")?h[m]=d[p.slice(1)]??"":h[m]=p;return new pf.Node("tag",h,u.body,e.emitTag)});return{...a,sections:c}}const l=s.map(c=>{const u=g0(c.headingNode),f=e.headingExtract?O0(u,e.headingExtract):{},d=e.knownSections?Ij(u,e.knownSections):void 0,h=d?.definition.model??e.sectionModel,m=$c(c.body,h);return{$heading:u,$headingNode:c.headingNode,...d?{$canonicalName:d.canonicalName}:{},...Object.fromEntries(Object.entries(f).map(([p,O])=>[`$${p}`,O])),...m}});return{...a,sections:l}}function Bj(n,e,t){if("hasChild"in n)return e.some(r=>Ec(r,n.hasChild));if("in"in n){const r=String(t[n.attribute]??"");return n.in.includes(r)}return"exists"in n?t[n.attribute]!=null&&t[n.attribute]!=="":!1}function jj(n){return"when"in n&&Array.isArray(n.when)}function zj(n){if(n.type==="text")return n.attributes?.content??"";const e=[];for(const t of n.walk())t.type==="text"&&t.attributes?.content&&e.push(t.attributes.content);return e.join("")}function Zj(n,e){if(n.type===e)return n;if(n.type==="link"&&e!=="link"){for(const t of n.children??[])if(t.type===e)return t}if((n.type==="strong"||n.type==="em")&&e!==n.type){for(const t of n.children??[])if(t.type===e)return t}return null}function sg(n,e){return(n.children??[]).map(r=>{const i={},s=[];for(const c of r.children??[])c.type==="inline"?s.push(...c.children??[]):s.push(c);const o=new Set,a=new Set;for(const c of e.fields)if(c.match!=="text"){if(c.match==="list"){const u=s.findIndex((f,d)=>!o.has(d)&&f.type==="list");u>=0&&(o.add(u),i[c.name]=c.itemModel?sg(s[u],c.itemModel):s[u]);continue}if(c.match==="paragraph"&&c.greedy){const u=[];s.forEach((f,d)=>{!o.has(d)&&f.type==="paragraph"&&(o.add(d),u.push(f))}),u.length>0&&(i[c.name]=u);continue}for(let u=0;u<s.length;u++){if(o.has(u)||a.has(u)&&c.match!==s[u].type)continue;const f=s[u],d=Zj(f,c.match);if(d){if(d===f?o.add(u):a.add(u),c.extract){const h=f.attributes?.[c.extract]!=null?f:d;i[c.name]=h.attributes?.[c.extract]}else i[c.name]=zj(d);break}}}for(const c of a)o.add(c);const l=e.fields.filter(c=>c.match==="text");if(l.length>0){let u=s.filter((f,d)=>!o.has(d)).filter(f=>f.type==="text"||f.type==="softbreak").map(f=>f.attributes?.content??"").join("").trim();for(const f of l)if(f.pattern==="remainder"){const d=u.trim();(d||!f.optional)&&(i[f.name]=d)}else if(f.pattern instanceof RegExp){const d=u.match(f.pattern);d&&(i[f.name]=d[1]??d[0],u=u.replace(f.pattern,""))}}return i})}function $c(n,e,t){if(jj(e)){for(const r of e.when)if(Bj(r.condition,n,t??{}))return $c(n,r.model,t);return $c(n,e.default,t)}switch(e.type){case"sequence":return _a(n,e.fields);case"sections":return Nj(n,e);case"delimited":return Rj(n,e);case"custom":return{children:e.processChildren(n,t??{})};default:return{}}}function Fj(n,e,t){const{filtered:r,tintNode:i,bgNode:s}=Dj(n);return{content:$c(r,e,t),tintNode:i,bgNode:s}}const Xj=new Map;function Vj(n,e){Xj.set(n,e)}const Wj=new WeakMap;function ys(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function gn(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&n.$$mdtype==="Tag"}function $t(n,e={},t=[]){return{$$mdtype:"Tag",name:n,attributes:e,children:t}}function Yj(n,e){const t=ys(e);return n.children.find(r=>gn(r)&&r.name==="meta"&&r.attributes["data-field"]===t)}function Zt(n,e,t){return Yj(n,e)?.attributes.content??t}function Uj(n){const e=n.attributes?.["data-rune-fields"];if(typeof e!="string"||e.length===0)return{};try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Co(n,e,t){const i=Uj(n)[e];if(i!=null&&typeof i!="object")return typeof i=="string"?i:String(i);const s=ys(e),o=(n.children??[]).find(a=>!!a&&typeof a=="object"&&a.$$mdtype==="Tag"&&a.name==="meta"&&a.attributes?.["data-field"]===s);return o?o.attributes.content:void 0}const Gj={none:"0",tight:"var(--rf-spacing-sm)",default:"var(--rf-spacing-md)",loose:"var(--rf-spacing-xl)"};function Hj(n){return Gj[n]??n}function Kj(n){return n.split(/\s+/).map(e=>`${e}fr`).join(" ")}const yp={none:"0",sm:"var(--rf-spacing-sm)",md:"var(--rf-spacing-md)",lg:"var(--rf-spacing-lg)",xl:"var(--rf-spacing-xl)"};function Jj(n){const e=yp[n];return e===void 0?(console.warn(`[refrakt] Unknown offset "${n}" — expected one of ${Object.keys(yp).join(", ")}. Falling back to "none".`),yp.none):e}const ez={top:"start",center:"center",bottom:"end",stretch:"stretch",baseline:"baseline"};function v0(n){return ez[n]??n}const tz={left:{x:"start",y:"center"},center:{x:"center",y:"center"},right:{x:"end",y:"center"},top:{x:"center",y:"start"},bottom:{x:"center",y:"end"},"top left":{x:"start",y:"start"},"top center":{x:"center",y:"start"},"top right":{x:"end",y:"start"},"bottom left":{x:"start",y:"end"},"bottom center":{x:"center",y:"end"},"bottom right":{x:"end",y:"end"}};function nz(n){return tz[n]??{x:"center",y:"center"}}function rz(n,e){if(!n)return e;const t={...n,...e};if((n.metaFields||e.metaFields)&&(t.metaFields={...n.metaFields,...e.metaFields}),n.blocks||e.blocks){const r={...n.blocks};if(e.blocks)for(const[i,s]of Object.entries(e.blocks))r[i]=s;t.blocks=r}if((n.layout||e.layout)&&(t.layout={...n.layout,...e.layout}),n.variants||e.variants){const r={...n.variants};if(e.variants)for(const[i,s]of Object.entries(e.variants))r[i]={...r[i],...s};t.variants=r}return t}const iz=["bg","surface","text","muted","primary","border"],hd={duration(n){const e=n.match(/PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?/);if(!e)return n;const t=[];return e[1]&&t.push(`${e[1]}h`),e[2]&&t.push(`${e[2]}m`),e[3]&&t.push(`${e[3]}s`),t.join(" ")||n},uppercase:n=>n.toUpperCase(),capitalize:n=>n.charAt(0).toUpperCase()+n.slice(1)};function sz(n){const{prefix:e,runes:t,icons:r={},tints:i={},backgrounds:s={},frames:o={}}=n,a=new Map(Object.keys(t).map(c=>[ys(c),c]));function l(c,u){if(c==null||typeof c=="string"||typeof c=="number")return c;if(Array.isArray(c))return c.map(h=>l(h,u));if(!gn(c))return c;const f=c.attributes?.["data-rune"],d=f?a.get(f):void 0;if(d)return Oz(c,t[d],e,r,i,s,o,t,a,l,u);if(c.name==="li"){const h=vz(c);if(h)return{...h,children:h.children.map(m=>l(m,u))}}return{...c,children:c.children.map(h=>l(h,u))}}return c=>l(c)}function oz(n){if(typeof n!="string"||n.length===0)return{};try{const e=JSON.parse(n);return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}catch{return{}}}function sC(n,e,t,r){const i=e[t];return i!=null&&typeof i!="object"?i:Zt(n,t,r)}function az(n,e,t){if(!n.variants)return n;let r=n;for(const[i,s]of Object.entries(n.variants)){const o=n.modifiers?.[i];if(!o)continue;const a=o.source==="attribute"?e.attributes[i]??o.default:sC(e,t,i,o.default);a&&s[a]&&(r=rz(r,s[a]))}return r}function lz(n,e){const t=new Set,r=c=>{const u=Zt(n,c);return u!=null&&t.add(c),u??void 0},i=r("frame");let s={};if(i&&e[i]){let c=e[i];c.extends&&e[c.extends]&&(c={...e[c.extends],...c}),s={...c},delete s.extends}const o={aspect:r("frame-aspect"),displace:r("frame-displace"),offset:r("frame-offset"),oversize:r("frame-oversize"),place:r("frame-place"),anchor:r("frame-anchor"),shadow:r("frame-shadow")};for(const[c,u]of Object.entries(o))u!==void 0&&(s[c]=u);if(t.size===0)return null;const a={},l=[];if(i&&(a["data-frame"]=i),s.displace&&(a["data-displace"]=s.displace),s.shadow&&(a["data-frame-shadow"]=s.shadow),s.aspect&&l.push(`--frame-aspect: ${s.aspect}`),s.offset&&l.push(`--frame-offset: ${Jj(s.offset)}`),s.oversize&&l.push(`--frame-oversize: ${s.oversize}`),s.anchor&&l.push(`--frame-anchor: ${s.anchor}`),s.place){const{x:c,y:u}=nz(s.place);l.push(`--frame-place-x: ${c}`,`--frame-place-y: ${u}`)}return{dataAttrs:a,styleParts:l,metaProps:t}}function b0(n,e,t){if(n.attributes={...n.attributes,...e},t.length){const r=n.attributes.style?String(n.attributes.style):"";n.attributes.style=r?`${r}; ${t.join("; ")}`:t.join("; ")}}function mf(n){for(const e of n){if(!gn(e))continue;if(e.attributes?.["data-section"]==="media")return e;const t=e.children?mf(e.children):void 0;if(t)return t}}function og(n,e){for(const t of n){if(!gn(t))continue;if(t.attributes?.["data-name"]===e)return t;const r=t.children?og(t.children,e):void 0;if(r)return r}}function cz(n,e,t){const r=i=>{if(!gn(i))return;const s=i.attributes?.["data-rune"];if(s){const o=t.get(s);if(o&&e[o]?.interactive)return s}for(const o of i.children??[]){const a=r(o);if(a)return a}};for(const i of n.children??[]){const s=r(i);if(s)return s}}const y0=new Set;function uz(n,e){const t=`${n}:${e}`;y0.has(t)||(y0.add(t),console.warn(`[refrakt] interactive guest \`${e}\` in a linked \`${n}\` — its controls are inert under the whole-tile link. Drop \`href\` or the interactivity.`))}const w0=new Set;function _0(n){w0.has(n)||(w0.add(n),console.warn(`[refrakt] \`frame\` on \`${n}\` has no frame target — set \`frameTarget\` or give the rune a media section. Frame chrome ignored.`))}const k0={sm:"12px",md:"16px",lg:"24px"},x0={sm:"0.25",md:"0.5",lg:"0.85"};function fz(n){const e=new Set,t=u=>{const f=Zt(n,u);return f!=null&&e.add(u),f??void 0},r=t("substrate"),i=t("substrate-size"),s=t("substrate-opacity"),o=t("substrate-fill"),a=t("substrate-target");if(!r)return null;const l={"data-substrate":r};o&&(l["data-substrate-fill"]=o);const c=[];return i&&k0[i]&&c.push(`--substrate-cell: ${k0[i]}`),s&&x0[s]&&c.push(`--substrate-opacity: ${x0[s]}`),{dataAttrs:l,styleParts:c,metaProps:e,targetOverride:a}}const S0=new Set;function A0(n){S0.has(n)||(S0.add(n),console.warn(`[refrakt] \`substrate-target="media"\` on \`${n}\` has no media section — substrate ignored.`))}const dz={"to-t":"to top","to-b":"to bottom","to-l":"to left","to-r":"to right","to-tr":"to top right","to-br":"to bottom right","to-bl":"to bottom left","to-tl":"to top left"};function C0(n){const e=n.stops.filter(i=>!!i).map(i=>`var(--rf-color-${i})`);if(e.length<2)return null;const t=n.type??"linear";return t==="radial"?`radial-gradient(${e.join(", ")})`:t==="conic"?`conic-gradient(${e.join(", ")})`:`linear-gradient(${dz[n.direction??"to-b"]??"to bottom"}, ${e.join(", ")})`}const T0={sm:"0.3",md:"0.55",lg:"0.8"},hz=/^[a-z][a-z0-9-]*$/,pz={top:"to top",bottom:"to bottom",left:"to left",right:"to right"},P0=new Set;function mz(n){P0.has(n)||(P0.add(n),console.warn(`[refrakt] \`content-place\` on \`${n}\` is only active in \`media-position="cover"\` — it anchors the overlay, and there's no overlay outside cover. Ignored.`))}const E0=new Set;function gz(n){E0.has(n)||(E0.add(n),console.warn(`[refrakt] raw-CSS \`overlay\` on \`${n}\` is deprecated (SPEC-088) — use \`overlay="dark|light|<token>"\` for a flat wash or \`scrim\` for a legibility gradient. The raw passthrough will be removed in a future minor.`))}function Oz(n,e,t,r,i,s,o,a,l,c,u){const f=`${t}-${e.block}`,d=n.attributes?.["data-rune"];if(e.requiresParent&&e.requiresParent!=="*"){const Oe=ys(e.requiresParent);u!==Oe&&$z(d??e.block,e.requiresParent,u)}const h=oz(n.attributes["data-rune-fields"]);e=az(e,n,h);const m=[],p={},O={},v=[];if(e.modifiers)for(const[Oe,_e]of Object.entries(e.modifiers)){_e.source==="attribute"&&v.push(Oe);const Be=_e.source==="meta"?sC(n,h,Oe,_e.default):n.attributes[Oe]??_e.default;if(Be){if(p[Oe]=Be,_e.noBemClass||m.push(`${f}--${Be}`),_e.valueMap){const tt=_e.valueMap[Be]??Be;_e.mapTarget?O[_e.mapTarget]=tt:p[Oe]=tt}}else Be===""&&(p[Oe]="")}e.contextModifiers&&u&&e.contextModifiers[u]&&m.push(`${f}--${e.contextModifiers[u]}`);const b=p["media-position"]==="cover";if(e.staticModifiers)for(const Oe of e.staticModifiers)m.push(`${f}--${Oe}`);const _=new Set,C={},w=[],y=Zt(n,"tint"),S=Zt(n,"tint-mode");if(y||S){let Oe={},_e={},Be=S;if(y&&y!=="custom"&&i[y]){const Ve=i[y];if(Ve.light)for(const[jt,en]of Object.entries(Ve.light))en&&(Oe[jt]=en);if(Ve.dark)for(const[jt,en]of Object.entries(Ve.dark))en&&(_e[jt]=en);!Be&&Ve.lockMode&&(Be=Ve.lockMode)}for(const Ve of iz){const jt=Zt(n,`tint-${Ve}`);jt&&(Oe[Ve]=jt,_.add(`tint-${Ve}`));const en=Zt(n,`tint-dark-${Ve}`);en&&(_e[Ve]=en,_.add(`tint-dark-${Ve}`))}const tt=Object.keys(Oe).length>0;(y||tt)&&(C["data-tint"]=y||"custom"),Be&&Be!=="auto"&&(C["data-color-scheme"]=Be),Object.keys(_e).length>0&&(C["data-tint-dark"]="");for(const[Ve,jt]of Object.entries(Oe))w.push(`--tint-${Ve}: ${jt}`);for(const[Ve,jt]of Object.entries(_e))w.push(`--tint-dark-${Ve}: ${jt}`);(tt||y&&y!=="custom"&&i[y])&&m.push(`${f}--tinted`),_.add("tint"),_.add("tint-mode")}const A=n.attributes?.density,x=u?l.get(u):void 0,E=x?a[x]?.childDensity:void 0,T=A??E??e.defaultDensity??"full",$=n.attributes?.width??e.defaultWidth;$&&$!=="content"&&(p.width=$,m.push(`${f}--${$}`));const L=n.attributes?.spacing;L&&L!=="default"&&(p.spacing=L,m.push(`${f}--spacing-${L}`));const P=n.attributes?.inset;P&&P!=="default"&&(p.inset=P,m.push(`${f}--inset-${P}`));const q=n.attributes?.elevation;q&&(p.elevation=q);const R=new Set,W={};let U=null;const ie=Zt(n,"bg-preset"),ce=Zt(n,"bg-src"),re=Zt(n,"bg-video"),H=Zt(n,"bg-gradient"),ae=Zt(n,"bg-from"),oe=Zt(n,"bg-via"),z=Zt(n,"bg-to"),ne=Zt(n,"bg-gradient-type");let Se;if(ie&&s[ie]){let Oe=s[ie];Oe.extends&&s[Oe.extends]&&(Oe={...s[Oe.extends],...Oe}),Se=Oe.gradient}let Te=null;if(H||ae||oe||z||ne){const Oe=[ae,oe,z].filter(_e=>!!_e);Te=C0({type:ne??Se?.type,direction:H??Se?.direction,stops:Oe.length>=2?Oe:Se?.stops??Oe})}else Se&&(Te=C0(Se));const Le=Zt(n,"scrim"),he=Zt(n,"bg-overlay"),Ee=Le&&Le!=="none"&&!b;if(ie||ce||re||Te||Ee||he){let Oe={};if(ie&&s[ie]){let j=s[ie];if(j.extends&&s[j.extends]){const Pe=s[j.extends];j={...Pe,params:{...Pe.params,...j.params},style:{...Pe.style,...j.style}}}j.style&&(Oe={...j.style})}const _e=Zt(n,"bg-blur"),Be=Zt(n,"bg-position"),tt=Zt(n,"bg-fit"),Ve=Zt(n,"bg-opacity"),jt=Zt(n,"bg-fixed"),en={sm:"4px",md:"8px",lg:"16px"},cn=[];for(const[j,Pe]of Object.entries(Oe))cn.push(`${j}: ${Pe}`);ce?cn.push(`--bg-image: url(${ce})`):Te&&cn.push(`--bg-image: ${Te}`),Be&&cn.push(`--bg-position: ${Be}`),_e&&cn.push(`--bg-blur: ${en[_e]??_e}`),tt&&cn.push(`--bg-fit: ${tt}`),Ve&&cn.push(`--bg-opacity: ${Ve}`);const tn={"data-name":"bg"};ie&&(tn["data-bg-preset"]=ie),cn.length&&(tn.style=cn.join("; ")),jt&&(tn["data-bg-fixed"]="");const _t=[];if(re&&_t.push($t("video",{"data-name":"bg-video",autoplay:"",muted:"",loop:"",playsinline:"",src:re,...cn.length?{style:cn.filter(j=>!j.startsWith("--bg-image")).join("; ")}:{}})),he){const j=Zt(n,"bg-overlay-opacity"),Pe={"data-name":"bg-overlay"};if(he==="dark"||he==="light")Pe["data-bg-overlay"]=he,j&&(Pe.style=`opacity: ${j}`);else if(hz.test(he)){const Yt=[`background: var(--rf-color-${he})`];j&&Yt.push(`opacity: ${j}`),Pe.style=Yt.join("; ")}else gz(d??e.block),Pe.style=`background: ${he}`;_t.push($t("div",Pe))}if(Ee){const j=Zt(n,"scrim-type")??"gradient",Pe=Zt(n,"scrim-tone")??"dark",Yt={"data-name":"scrim","data-scrim":j,"data-scrim-tone":Pe,"data-scrim-dir":Le},dn=[];if(j==="frost"){const Ge=Zt(n,"scrim-blur")??"md";dn.push(`--scrim-blur: ${en[Ge]??en.md}`)}else{const Ge=Zt(n,"scrim-strength")??"md";dn.push(`--scrim-strength: ${T0[Ge]??T0.md}`)}Yt.style=dn.join("; "),_t.push($t("div",Yt)),C["data-color-scheme"]||(W["data-color-scheme"]=Pe)}U=$t("div",tn,_t),m.push(`${f}--has-bg`),W["data-bg"]="",R.add("bg-preset"),R.add("bg-src"),R.add("bg-video"),R.add("bg-overlay"),R.add("bg-blur"),R.add("bg-position"),R.add("bg-fit"),R.add("bg-opacity"),R.add("bg-fixed"),R.add("bg-gradient"),R.add("bg-from"),R.add("bg-via"),R.add("bg-to"),R.add("bg-gradient-type"),R.add("bg-overlay-opacity"),R.add("scrim"),R.add("scrim-type"),R.add("scrim-strength"),R.add("scrim-blur"),R.add("scrim-tone")}b&&(R.add("scrim"),R.add("scrim-type"),R.add("scrim-blur"),R.add("scrim-tone"));const Ye=lz(n,o),rt=new Set(Ye?.metaProps??[]);let Ue=null;if(Ye){const Oe=e.sections?Object.values(e.sections).includes("media"):!1;Ue=e.frameTarget??(Oe?"media":null),Ue||_0(d??e.block)}const Ke=Ye&&Ue==="self"?Ye.dataAttrs:{},Me=fz(n),xt=new Set(Me?.metaProps??[]);let Vt=null;if(Me){const Oe=e.sections?Object.values(e.sections).includes("media"):!1,_e=Me.targetOverride;Vt=_e==="self"||_e==="media"?_e:e.substrateTarget??"self",Vt==="media"&&!Oe&&(A0(d??e.block),Vt=null)}const En=Me&&Vt==="self"?Me.dataAttrs:{},St={};for(const[Oe,_e]of Object.entries(p)){const Be=Oe.replace(/([A-Z])/g,"-$1").toLowerCase();St[`data-${Be}`]=_e}for(const[Oe,_e]of Object.entries(O)){const Be=Oe.startsWith("data-")?Oe:`data-${Oe}`;St[Be]=_e}const on=n.attributes.class||"",Cn=[f,...m,on].filter(Boolean).join(" ");let Wt=n.children;if(e.autoLabel&&(Wt=oC(Wt,e.autoLabel)),e.blocks||e.layout)Wt=Tz(e,f,Wt,p);else if(e.structure){const Oe=[],_e=[];for(const[Be,tt]of Object.entries(e.structure)){const Ve=gf(tt,Be,p);Ve&&(tt.before?Oe.push(Ve):_e.push(Ve))}if(e.contentWrapper){const Be=$t(e.contentWrapper.tag,{"data-name":e.contentWrapper.ref},Wt);Wt=[...Oe,Be,..._e]}else(Oe.length||_e.length)&&(Wt=[...Oe,...Wt,..._e])}else e.contentWrapper&&(Wt=[$t(e.contentWrapper.tag,{"data-name":e.contentWrapper.ref},Wt)]);U&&(Wt=[U,...Wt]);let ke=Wt.map(Oe=>gn(Oe)?c(Tv(Oe,f,e.sections,e.mediaSlots),d):c(Oe,d));if(e.projection&&(ke=bz(ke,e.projection,f,e.sections,e.mediaSlots)),Ye&&Ue==="media"){const Oe=mf(ke);Oe?b0(Oe,Ye.dataAttrs,Ye.styleParts):_0(d??e.block)}if(Me&&Vt==="media"){const Oe=mf(ke);Oe?b0(Oe,Me.dataAttrs,Me.styleParts):A0(d??e.block)}const Tn=!!og(ke,"link");if(Tn||b){const Oe=mf(ke);if(Oe&&(Oe.attributes={...Oe.attributes,"data-guest-posture":"presentational"},Tn)){const _e=cz(Oe,a,l);_e&&uz(d??e.block,_e)}}const Lt=e.modifiers?new Set(Object.keys(e.modifiers).map(Oe=>ys(Oe))):void 0,Jt=ke.filter(Oe=>{if(!gn(Oe))return!0;const _e=Oe;if(_e.name!=="meta"||!_e.attributes["data-field"])return!0;const Be=_e.attributes["data-field"];return!(Lt?.has(Be)||_.has(Be)||R.has(Be)||rt.has(Be)||xt.has(Be))});if(e.sequence){const Oe=e.sequenceDirection?p[e.sequenceDirection.fromModifier]??e.sequenceDirection.default:void 0;aC(Jt,e.sequence,Oe)}let On=n.attributes.style||"";const te=[];if(e.styles)for(const[Oe,_e]of Object.entries(e.styles)){const Be=p[Oe];Be&&(typeof _e=="string"?te.push(`${_e}: ${Be}`):_e.transform?te.push(`${_e.prop}: ${_e.transform(Be)}`):_e.template?te.push(`${_e.prop}: ${_e.template.replace("{}",Be)}`):te.push(`${_e.prop}: ${Be}`))}te.push(...w);const ve=p["content-place"];if(ve){if(!b)mz(d??e.block);else if(ve!=="auto"){const[Oe,_e]=ve.trim().split(/\s+/);Oe&&te.push(`--cover-place-block: ${Oe}`),_e&&te.push(`--cover-place-inline: ${_e}`),Oe==="start"?te.push("--cover-scrim-dir: to bottom"):Oe==="center"&&(te.push("--cover-scrim-image: radial-gradient(ellipse farthest-side at center, rgb(0 0 0 / 0.55) 40%, transparent 100%)"),te.push("--cover-scrim-mask: radial-gradient(ellipse farthest-side at center, #000 50%, transparent 100%)"))}}if(b){const Oe=Zt(n,"scrim");Oe==="none"&&(W["data-scrim"]="none");const _e=Zt(n,"scrim-type");if(_e&&Oe!=="none"&&(W["data-scrim-type"]=_e,_e==="frost")){const Ve=Zt(n,"scrim-blur");Ve&&(W["data-scrim-blur"]=Ve)}const Be=e.rootAttributes?.["data-cover-scope"];if(Oe!=="none"&&Be!=="header"&&!W["data-color-scheme"]&&!C["data-color-scheme"]){const Ve=og(Jt,"content");Ve&&(Ve.attributes={...Ve.attributes,"data-color-scheme":Zt(n,"scrim-tone")??"dark"})}const tt=pz[Oe??""];tt&&te.push(`--cover-scrim-dir: ${tt}`)}Ye&&Ue==="self"&&te.push(...Ye.styleParts),Me&&Vt==="self"&&te.push(...Me.styleParts),te.length&&(On=On?`${On}; ${te.join("; ")}`:te.join("; "));const{width:xe,spacing:Ce,inset:qe,elevation:At,density:ht,"data-rune":Je,"data-rune-fields":Ct,...mt}=n.attributes,lt=v.length>0?Object.fromEntries(Object.entries(mt).filter(([Oe])=>!v.includes(Oe))):mt,yt={...n,attributes:{...lt,...St,...C,...W,...Ke,...En,class:Cn,"data-rune":d,"data-density":T,...e.rootAttributes||{},...On?{style:On}:{}},children:Jt};return e.postTransform?e.postTransform(yt,{modifiers:p,parentType:u,fields:h}):yt}function oC(n,e){return n.map(t=>{if(!gn(t))return t;const r=e[t.name]??e[t.attributes?.["data-field"]],i=r&&!t.attributes["data-name"]?{...t,attributes:{...t.attributes,"data-name":r}}:t;return i.children.length===0?i:{...i,children:oC(i.children,e)}})}function Tv(n,e,t,r){const i=n.attributes["data-name"];if(i){const s=`${e}__${i}`,o=n.attributes.class||"",a=n.children.map(u=>gn(u)?Tv(u,e,t,r):u),l=t?.[i],c=r?.[i];return{...n,attributes:{...n.attributes,class:[s,o].filter(Boolean).join(" "),...l?{"data-section":l}:{},...c?{"data-media":c}:{}},children:a}}return n}const $0=/^\[(x|X|>|\s|-)\]\s*/,Q0={x:"checked",X:"checked"," ":"unchecked",">":"active","-":"skipped"};function vz(n){const e=n.children;if(e.length===0)return null;const t=e[0];if(typeof t=="string"){const r=t.match($0);if(!r)return null;const i=Q0[r[1]]??"unchecked",s=t.slice(r[0].length);return{...n,attributes:{...n.attributes,"data-checked":i},children:[s,...e.slice(1)]}}if(gn(t)&&t.name==="p"&&t.children.length>0){const r=t.children[0];if(typeof r=="string"){const i=r.match($0);if(!i)return null;const s=Q0[i[1]]??"unchecked",o=r.slice(i[0].length),a={...t,children:[o,...t.children.slice(1)]};return{...n,attributes:{...n.attributes,"data-checked":s},children:[a,...e.slice(1)]}}}return null}function aC(n,e,t){for(let r=0;r<n.length;r++){const i=n[r];if(gn(i))if(i.name==="ol"){const s={...i.attributes,"data-sequence":e};t&&(s["data-sequence-direction"]=t),n[r]={...i,attributes:s}}else i.children.length>0&&aC(i.children,e,t)}}function lC(n,e){const t=n.findIndex(r=>gn(r)&&r.attributes?.["data-name"]===e);if(t!==-1){const r=n[t],i=[...n.slice(0,t),...n.slice(t+1)];return{element:r,rest:i}}for(let r=0;r<n.length;r++){const i=n[r];if(!gn(i))continue;const s=i;if(s.attributes?.["data-name"]!=="preamble")continue;const o=lC(s.children,e);if(!o)continue;const a=[...n];return o.rest.length===0?a.splice(r,1):a[r]={...s,children:o.rest},{element:o.element,rest:a}}return null}function cC(n,e){for(const t of n){if(!gn(t))continue;const r=t;if(r.attributes?.["data-name"]===e)return r;const i=cC(r.children,e);if(i)return i}return null}function uC(n,e,t,r){return n.map(i=>{if(!gn(i))return i;const s=i;if(s.attributes?.["data-name"]===e){const a=r==="prepend"?[t,...s.children]:[...s.children,t];return{...s,children:a}}const o=uC(s.children,e,t,r);return o!==s.children?{...s,children:o}:i})}function bz(n,e,t,r,i){let s=[...n];if(e.hide){const o=new Set(e.hide);s=s.filter(a=>{if(!gn(a))return!0;const l=a.attributes?.["data-name"];return!l||!o.has(l)})}if(e.group)for(const[o,a]of Object.entries(e.group)){const l=new Set(a.members),c=[];let u=-1;for(let f=s.length-1;f>=0;f--){const d=s[f];if(!gn(d))continue;const h=d.attributes?.["data-name"];h&&l.has(h)&&(c.unshift(d),(u===-1||f<u)&&(u=f),s.splice(f,1))}if(c.length>0){let f=$t(a.tag,{"data-name":o},c);f=Tv(f,t,r,i),s.splice(u,0,f)}}if(e.relocate)for(const[o,a]of Object.entries(e.relocate)){const l=lC(s,o);if(!l)continue;s=l.rest,cC(s,a.into)&&(s=uC(s,a.into,l.element,a.position??"append"))}return s}function gf(n,e,t,r){if(n.condition&&!t[n.condition]||n.conditionAny&&!n.conditionAny.some(l=>t[l]))return null;const i=n.ref??e;if(n.repeat){const l=parseInt(t[n.repeat.count]??"",10);if(!l||l<0||isNaN(l))return $t(n.tag,{"data-name":i},[]);const c=n.repeat.max??10,u=Math.min(l,c),f=n.repeat.filled?parseInt(t[n.repeat.filled]??"0",10):0,d=Math.max(0,Math.min(f,u)),h=[];for(let m=0;m<u;m++){const p=m<d;if(p&&n.repeat.filledElement){const O=gf(n.repeat.filledElement,n.repeat.filledElement.ref??"",t);O&&h.push(O)}else{const O=gf(n.repeat.element,n.repeat.element.ref??"",t);O&&(n.repeat.filled?h.push({...O,attributes:{...O.attributes,"data-filled":p?"true":"false"}}):h.push(O))}}return $t(n.tag,{"data-name":i},h)}const s={};if(n.attrs)for(const[l,c]of Object.entries(n.attrs))typeof c=="string"?s[l]=c:"fromModifier"in c&&(s[l]=t[c.fromModifier]??"");const o={"data-name":i,...s};if(n.metaType&&(o["data-meta-type"]=n.metaType),n.sentimentMap&&n.metaText){const l=t[n.metaText];if(l){const c=n.sentimentMap[l];c&&(o["data-meta-sentiment"]=c)}}if(n.icon)return $t(n.tag,o,[]);if(n.metaText){let l=t[n.metaText]??"";if(n.transform&&hd[n.transform]&&(l=hd[n.transform](l)),n.label){const c={"data-meta-label":""};n.labelHidden&&(c["data-meta-label-hidden"]="");const u=$t("span",c,[n.label]);let f=l;n.textPrefix&&(f=n.textPrefix+f),n.textSuffix&&(f=f+n.textSuffix);const d=$t("span",{"data-meta-value":""},[f]);return $t(n.tag,o,[u,d])}return n.textPrefix&&(l=n.textPrefix+l),n.textSuffix&&(l=l+n.textSuffix),$t(n.tag,o,[l])}const a=[];if(n.children)for(const l of n.children)if(typeof l=="string")a.push(l);else{const c=gf(l,l.ref??"",t);c&&a.push(c)}return $t(n.tag,o,a)}function yz(n,e,t){const r=e[n];if(!r)return null;if(r.condition){const a=t[r.condition];if(!(r.renderWhenEmpty?a!==void 0:!!a))return null}let i=t[n]??"";if(!i&&r.condition&&!r.renderWhenEmpty)return null;r.transform&&hd[r.transform]&&(i=hd[r.transform](i));const s=r.href?t[r.href]??"":void 0;if(r.href&&!s)return null;const o=r.rating?t[r.rating.total??""]||"5":void 0;return{name:n,value:i,field:r,href:s,ratingTotal:o}}function fC(n,e={includeLabel:!0}){const{field:t,value:r}=n,i={class:"rf-badge"};if(t.metaType&&(i["data-meta-type"]=t.metaType),t.sentimentMap){const a=t.sentimentMap[r];a&&(i["data-meta-sentiment"]=a)}const s=t.tag??"span",o={...i};return s==="time"&&r&&(o.datetime=r),e.includeLabel&&t.label?$t(s,o,[$t("span",{"data-meta-label":""},[t.label]),$t("span",{"data-meta-value":""},[r])]):$t(s,o,[r])}function wz(n){const{field:e,value:t}=n,r={};e.metaType&&(r["data-meta-type"]=e.metaType);const i=e.tag??"span";return i==="time"&&t&&(r.datetime=t),$t(i,r,[t])}function dC(n){const e=n.field.splitOn;return!e||!n.value?[n.value].filter(Boolean):n.value.split(e).map(t=>t.trim()).filter(Boolean)}const _z=new Set(["status","category","tag"]);function hC(n){return n.metaType!==void 0&&_z.has(n.metaType)}function kz(n){return $t("a",{href:n.href??"","data-meta-type":"link"},[n.field.label??n.value])}function xz(n){const e=Math.max(0,parseInt(n.value,10)||0),t=Math.max(0,parseInt(n.ratingTotal??"5",10)||5),r=[];for(let i=0;i<t;i++)r.push($t("span",{"data-filled":i<e?"true":"false"},[]));return $t("span",{"data-meta-type":"rating"},r)}function Sz(n){const e=n.field.icon.group,t={};return n.field.metaType&&(t["data-meta-type"]=n.field.metaType),$t(n.field.tag??"span",t,[$t("span",{"data-icon-group":e,"data-icon":n.value},[]),$t("span",{"data-meta-value":""},[n.field.label??n.value])])}function ag(n,e=!1){return n.field.href?kz(n):n.field.rating?xz(n):n.field.icon?Sz(n):hC(n.field)?fC(n,{includeLabel:e}):wz(n)}function Az(n,e,t){if(e.length===0)return null;const r=[];for(const{resolved:s,align:o}of e){const a=s.field.splitOn&&s.value?dC(s).map(l=>ag({...s,value:l})):[ag(s)];o==="end"&&a.length>0&&(a[0]={...a[0],attributes:{...a[0].attributes,"data-align":"end"}}),r.push(...a)}const i={"data-name":n,"data-zone":n,"data-zone-layout":"bar"};return t===!1&&(i["data-wrap"]="false"),$t("div",i,r)}function Cz(n,e){if(e.length===0)return null;const t=e.map(r=>{const i=$t("dt",{"data-meta-label":""},[r.field.label??r.name]);let s;if(r.field.splitOn&&r.value){const o=dC(r).map(a=>ag({...r,value:a}));s=$t("dd",{"data-multi-value":""},o)}else if(hC(r.field))s=$t("dd",{},[fC(r,{includeLabel:!1})]);else{const o={};r.field.metaType&&(o["data-meta-type"]=r.field.metaType);const a=r.field.tag==="time"&&r.value?$t("time",{datetime:r.value},[r.value]):r.value;s=$t("dd",o,[a])}return $t("div",{"data-name":"row","data-field":r.name},[i,s])});return $t("dl",{"data-name":n,"data-zone":n,"data-zone-layout":"definition-list"},t)}function Tz(n,e,t,r){const i=n.blocks??{},s=n.layout??{},o=n.metaFields??{},a=f=>{const d=i[f];if(!d)return null;const h=[];for(const m of d.fields){const p=typeof m=="string"?m:m.field,O=typeof m=="string"?void 0:m.align,v=yz(p,o,r);v&&h.push({resolved:v,align:O})}return h.length===0?null:d.layout==="bar"?Az(f,h,d.wrap??!0):Cz(f,h.map(m=>m.resolved))};if(Object.keys(s).length===0)return t;const l={layout:s,renderBlock:a},c=s.root;if(c){const f=Array.isArray(c)?c:c.children,d=lg(t),h=new Set,m=pd(f,d,h,l,["root"]),p=t.filter(O=>!(gn(O)&&O.attributes["data-name"]&&h.has(O.attributes["data-name"])));return[...m,...p]}let u=t;for(const[f,d]of Object.entries(s)){const h=Array.isArray(d)?d:d.children;u=Qz(u,f,m=>{const p=lg(m),O=new Set,v=pd(h,p,O,l,[f]),b=m.filter(_=>!(gn(_)&&_.attributes["data-name"]&&O.has(_.attributes["data-name"])));return[...v,...b]})}return u}const L0=new Set;function Pz(n){L0.has(n)||(L0.add(n),console.warn(`[refrakt] layout reference cycle at "${n}" — skipping to break the loop.`))}const Ez=new Set(["accordion-item","tab","tab-panel","breadcrumb-item","juxtapose-panel","bento-cell","definition","step","tier","map-pin","itinerary-day","itinerary-stop"]),M0=new Set;function $z(n,e,t){const r=`${n}<${t??""}`;if(M0.has(r))return;M0.add(r);const i=t?`nested directly in \`${t}\``:"at the top level",s=`[refrakt] \`${n}\` requires parent \`${ys(e)}\` — found ${i}.`;Ez.has(n)?console.error(s):console.warn(s)}function lg(n){const e=new Map;for(const t of n)gn(t)&&t.attributes["data-name"]&&e.set(t.attributes["data-name"],t);return e}function pd(n,e,t,r,i){const s=[];for(const o of n){if(t.has(o))continue;if(i.includes(o)){Pz(o);continue}const a=r.layout[o];if(a&&!Array.isArray(a)&&a.tag){t.add(o);const u=pd(a.children,e,t,r,[...i,o]);s.push($t(a.tag,{"data-name":o,...a.attrs??{}},u));continue}if(a){const u=e.get(o);if(u){t.add(o);const f=Array.isArray(a)?a:a.children,d=lg(u.children),h=new Set,m=pd(f,d,h,r,[...i,o]),p=u.children.filter(O=>!(gn(O)&&O.attributes["data-name"]&&h.has(O.attributes["data-name"])));s.push({...u,children:[...m,...p]});continue}}const l=r.renderBlock(o);if(l){t.add(o),s.push(l);continue}const c=e.get(o);if(c){t.add(o),s.push(c);continue}}return s}function Qz(n,e,t){let r=!1;const i=s=>s.map(o=>r||!gn(o)?o:o.attributes["data-name"]===e?(r=!0,{...o,children:t(o.children)}):{...o,children:i(o.children)});return i(n)}const Lz=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mz=new Set(["$$mdtype"]);function pC(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function qz(n){const e=[];for(const[t,r]of Object.entries(n))if(!Mz.has(t)&&!(r==null||r===!1)){if(r===!0){e.push(t);continue}e.push(`${t}="${pC(String(r))}"`)}return e.length?" "+e.join(" "):""}function Dz(n,e){return zl(n)}function zl(n){if(n==null)return"";if(typeof n=="string")return pC(n);if(typeof n=="number")return String(n);if(Array.isArray(n))return n.map(zl).join("");if(!gn(n))return"";const e=n.name;if(!e)return n.children.map(zl).join("");const t=qz(n.attributes);if(Lz.has(e))return`<${e}${t} />`;const i=n.attributes?.["data-codeblock"]||n.attributes?.["data-raw-html"]?n.children.map(s=>typeof s=="string"?s:zl(s)).join(""):n.children.map(zl).join("");return`<${e}${t}>${i}</${e}>`}function Rz(n,e,t,r){if(!n)return null;const i=n.endsWith("/")?n.slice(0,-1):n,s=e&&e.length>0?e:"main",o=t.split("/").map(l=>encodeURIComponent(l)).join("/"),a=r?`#${Iz(r)}`:"";return`${i}/blob/${s}/${o}${a}`}function Iz(n){const e=n.trim(),t=e.indexOf("-");if(t<0)return`L${e}`;const r=e.slice(0,t).trim(),i=e.slice(t+1).trim();return i?`L${r}-L${i}`:`L${r}`}const{Tag:_U}=B;function Nz(n,e){if(typeof e=="function")return e(n);const t=typeof e=="string"?{node:e}:e;return!(t.node&&n.type!==t.node||t.descendant&&!Array.from(n.walk()).some(r=>r.type===t.descendant)||t.descendantTag&&!Array.from(n.walk()).some(r=>r.type==="tag"&&r.tag===t.descendantTag))}const{Ast:q0}=B;function*mC(n){yield n;for(const e of n.children)B.Tag.isTag(e)?yield*mC(e):yield e}function Pv(n){const e=n?.level,t=n?.include;return r=>{const i=e??r.find(c=>c.type==="heading")?.attributes.level;if(!i)return r;let s;const o=new q0.Node("list"),a=[];let l=[];for(let c=0;c<r.length;c++){const u=r[c];if(u.type==="heading"&&u.attributes.level===i)o.children.push(new q0.Node("item",{},[u])),s=c;else if(s===void 0)a.push(u);else if(!t||t.some(f=>Nz(u,f))){const f=o.children.at(-1);f&&f.children.push(u)}else{l=r.slice(c);break}}return o.children.length===0?r:[...a,o,...l]}}class Fe{constructor(e){this.nodes=e,this.offset=0}static fromData(e,t){return new Fe([new B.Tag(t,{},[e])])}wrap(e,t={}){return new Fe([new B.Tag(e,t,this.nodes)])}tag(e){const t=this.nodes.filter(r=>B.Tag.isTag(r)&&r.name===e);return new Fe(t)}tags(...e){const t=this.nodes.filter(r=>B.Tag.isTag(r)&&e.includes(r.name));return new Fe(t)}headings(){return this.tags("h1","h2","h3","h4","h5","h6")}typeof(e){return new Fe(this.nodes.filter(t=>B.Tag.isTag(t)&&t.attributes["data-rune"]===ys(e)))}concat(...e){const t=e.map(r=>r instanceof Fe?r.nodes:r).flat();return new Fe([...this.nodes,...t])}flatten(){const e=this.nodes.map(t=>B.Tag.isTag(t)?Array.from(mC(t)):t).flat();return new Fe(e)}limit(e){return new Fe(this.nodes.slice(0,e))}slice(e,t){return new Fe(this.nodes.slice(e,t))}toArray(){return this.nodes}count(){return this.nodes.length}next(){return this.nodes[this.offset++]}}function Ne(n){const e=n.rune,t=n.typeof??n.schemaOrgType;if(n.properties&&n.refs){const c=new Set(Object.keys(n.properties)),u=Object.keys(n.refs).filter(f=>c.has(f));if(u.length>0)throw new Error(`Rune "${e}" has naming collisions between properties and refs: ${u.join(", ")}. Properties and refs share a flat namespace (ADR-008) and must have unique names.`)}const r=new Set;for(const c of Object.values(n.schema??{})){if(c===void 0)continue;const u=c instanceof Fe?c.nodes:Array.isArray(c)?c:[c];for(const f of u)r.add(f)}const i={},s=new Set;for(const[c,u]of Object.entries(n.properties??{})){if(u===void 0)continue;const f=u instanceof Fe?u.nodes:Array.isArray(u)?u:[u],d=[];f.forEach(h=>{if(B.Tag.isTag(h)){const m=h.name==="meta"&&r.has(h);m||(h.attributes["data-field"]=ys(c)),h.name==="meta"&&h.attributes.content!==void 0&&(d.push(h.attributes.content),m||s.add(h))}}),d.length===1?i[c]=d[0]:d.length>1&&(i[c]=d)}for(const[c,u]of Object.entries(n.refs||{})){if(u===void 0)continue;(u instanceof Fe?u.nodes:Array.isArray(u)?u:[u]).forEach(d=>{B.Tag.isTag(d)&&(d.attributes["data-name"]=c)})}const o=new Set;for(const[c,u]of Object.entries(n.schema??{})){if(u===void 0)continue;(u instanceof Fe?u.nodes:Array.isArray(u)?u:[u]).forEach(d=>{if(B.Tag.isTag(d)){if(d.name==="meta"&&(d.attributes.content===void 0||d.attributes.content==="")){o.add(d);return}d.attributes.property=c}})}const a=(Array.isArray(n.children)?n.children:[n.children]).filter(c=>!o.has(c)&&!s.has(c));return new B.Tag(n.tag,{id:n.id,"data-field":n.property?ys(n.property):n.property,"data-rune":e,typeof:t,class:n.class,...Object.keys(i).length>0?{"data-rune-fields":JSON.stringify(i)}:{}},a)}function Bz(n){return n.replace(/<script\b[^>]*>[\s\S]*?<\/script\s*>/gi,"")}function jz(n){let e=n.replace(/\s+on[a-z]+\s*=\s*"[^"]*"/gi,"");return e=e.replace(/\s+on[a-z]+\s*=\s*'[^']*'/gi,""),e=e.replace(/\s+on[a-z]+\s*=\s*[^\s>]+/gi,""),e}function zz(n){return n.replace(/(\s(?:href|src|action|formaction|xlink:href)\s*=\s*)(["'])\s*javascript:[^"']*\2/gi,"$1$2$2")}function Zz(n){let e=n.replace(/<iframe\b[^>]*>[\s\S]*?<\/iframe\s*>/gi,"");return e=e.replace(/<object\b[^>]*>[\s\S]*?<\/object\s*>/gi,""),e=e.replace(/<embed\b[^>]*\/?>/gi,""),e=e.replace(/<iframe\b[^>]*\/>/gi,""),e=e.replace(/<object\b[^>]*\/>/gi,""),e}function Fz(n,e){if(e.trust==="trusted"||e.allowJs)return n;let t=Bz(n);return t=jz(t),t=zz(t),t=Zz(t),t}const Xz=new WeakMap;function ct(n){return Array.isArray(n)?n:n!=null?[n]:[]}const Vz={tint:{type:String,required:!1,description:"Color tint preset applied to this block"},"tint-mode":{type:String,required:!1,matches:["auto","dark","light"],description:"Whether the tint adapts to auto, dark, or light mode"},bg:{type:String,required:!1,description:"Background preset applied to this block"},width:{type:String,required:!1,matches:["compact","narrow","content","wide","full"],description:"Maximum width constraint for this block"},spacing:{type:String,required:!1,matches:["flush","tight","default","loose","breathe"],description:"Vertical spacing above and below this block"},inset:{type:String,required:!1,matches:["flush","tight","default","loose","breathe"],description:"Inner padding of this block"},elevation:{type:String,required:!1,matches:["none","sm","md","lg"],description:"Drop shadow (box-shadow) elevation for this block"},frame:{type:String,required:!1,description:"Named frame preset presenting this block's media surface"},"frame-aspect":{type:String,required:!1,description:'Aspect ratio of the framed media, e.g. "16/9"'},"frame-displace":{type:String,required:!1,matches:["top","bottom","end","bottom-end","top-end"],description:"Edge/corner the framed guest moves toward"},"frame-offset":{type:String,required:!1,matches:["none","sm","md","lg","xl"],description:"Displacement distance (named scale)"},"frame-oversize":{type:String,required:!1,description:"How far the guest exceeds its slot (scale factor)"},"frame-place":{type:String,required:!1,description:'Guest-box alignment in the slot (e.g. "left top")'},"frame-anchor":{type:String,required:!1,description:"Crop focal point when the guest is cut (object-position)"},"frame-shadow":{type:String,required:!1,matches:["none","sm","md","lg"],description:"Silhouette drop-shadow strength for the framed media"},substrate:{type:String,required:!1,matches:["dots","grid","lines","cross","checker","none"],description:"Generated surface pattern"},"substrate-size":{type:String,required:!1,matches:["sm","md","lg"],description:"Pattern cell size"},"substrate-opacity":{type:String,required:!1,matches:["sm","md","lg"],description:"Pattern ink strength"},"substrate-fill":{type:String,required:!1,matches:["inherit","inset"],description:"Surface fill the pattern sits on (full colour stays with tint)"},"substrate-target":{type:String,required:!1,matches:["self","media"],description:"Which surface the pattern fills (overrides the rune/theme default)"},"bg-gradient":{type:String,required:!1,matches:["to-t","to-b","to-l","to-r","to-tr","to-br","to-bl","to-tl"],description:"Gradient direction (bounded named set)"},"bg-from":{type:String,required:!1,description:"Gradient start colour — a semantic token name (→ var(--rf-color-*))"},"bg-to":{type:String,required:!1,description:"Gradient end colour — a semantic token name"},"bg-via":{type:String,required:!1,description:"Optional middle gradient stop — a semantic token name"},"bg-gradient-type":{type:String,required:!1,matches:["linear","radial","conic"],description:"Gradient type"},scrim:{type:String,required:!1,matches:["top","bottom","left","right","none"],description:'Scrim direction (heaviest edge); presence turns the scrim on, "none" opts out of the default cover scrim'},"scrim-type":{type:String,required:!1,matches:["gradient","frost"],description:"Scrim treatment: gradient (default) or frost (backdrop blur)"},"scrim-strength":{type:String,required:!1,matches:["sm","md","lg"],description:"Gradient scrim strength"},"scrim-blur":{type:String,required:!1,matches:["none","sm","md","lg"],description:"Frost scrim blur amount"},"scrim-tone":{type:String,required:!1,matches:["dark","light"],description:"Whether the scrim darkens (for light text) or lightens (for dark text)"}},Wz=["bg-gradient","bg-from","bg-to","bg-via","bg-gradient-type","scrim","scrim-type","scrim-strength","scrim-blur","scrim-tone"],Yz=["frame-aspect","frame-displace","frame-offset","frame-oversize","frame-place","frame-anchor","frame-shadow"],Uz=["substrate-size","substrate-opacity","substrate-fill","substrate-target"];function Gz(n,e){if(!B.Tag.isTag(n))return n;const t=[];if(e.tintNode){const i=B.transform(e.tintNode,e.config);if(B.Tag.isTag(i))for(const s of i.children)B.Tag.isTag(s)&&s.name==="meta"&&t.push(s)}const r=i=>t.some(s=>B.Tag.isTag(s)&&s.attributes["data-field"]===i);return e.tint&&!r("tint")&&t.push(new B.Tag("meta",{"data-field":"tint",content:e.tint})),e["tint-mode"]&&e["tint-mode"]!=="auto"&&!r("tint-mode")&&t.push(new B.Tag("meta",{"data-field":"tint-mode",content:e["tint-mode"]})),t.length===0||(n.children=[...n.children,...t]),n}function Hz(n,e){if(!B.Tag.isTag(n))return n;const t=[];if(e.bgNode){const i=B.transform(e.bgNode,e.config);if(B.Tag.isTag(i))for(const s of i.children)B.Tag.isTag(s)&&s.name==="meta"&&t.push(s)}const r=t.some(i=>B.Tag.isTag(i)&&i.attributes["data-field"]==="bg-preset");return e.bg&&!r&&t.push(new B.Tag("meta",{"data-field":"bg-preset",content:e.bg})),t.length===0||(n.children=[...n.children,...t]),n}function Kz(n,e){if(!B.Tag.isTag(n))return n;const t=i=>n.children.some(s=>B.Tag.isTag(s)&&s.name==="meta"&&s.attributes["data-field"]===i),r=[];e.frame&&!t("frame")&&r.push(new B.Tag("meta",{"data-field":"frame",content:String(e.frame)}));for(const i of Yz){const s=e[i];s!=null&&s!==""&&!t(i)&&r.push(new B.Tag("meta",{"data-field":i,content:String(s)}))}return r.length===0||(n.children=[...n.children,...r]),n}function Jz(n,e){if(!B.Tag.isTag(n))return n;const t=i=>n.children.some(s=>B.Tag.isTag(s)&&s.name==="meta"&&s.attributes["data-field"]===i),r=[];for(const i of Wz){const s=e[i];s!=null&&s!==""&&!t(i)&&r.push(new B.Tag("meta",{"data-field":i,content:String(s)}))}return r.length===0||(n.children=[...n.children,...r]),n}function e6(n,e){if(!B.Tag.isTag(n))return n;const t=i=>n.children.some(s=>B.Tag.isTag(s)&&s.name==="meta"&&s.attributes["data-field"]===i),r=[];e.substrate&&!t("substrate")&&r.push(new B.Tag("meta",{"data-field":"substrate",content:String(e.substrate)}));for(const i of Uz){const s=e[i];s!=null&&s!==""&&!t(i)&&r.push(new B.Tag("meta",{"data-field":i,content:String(s)}))}return r.length===0||(n.children=[...n.children,...r]),n}function et(n){const e={};n.base&&Object.assign(e,n.base),n.attributes&&Object.assign(e,n.attributes),Object.assign(e,Vz),n.deferBody&&(e["__deferred-body"]={type:String,required:!1});const t=n.deprecations;if(t){for(const[i,s]of Object.entries(t))if(!e[i]){const o=e[s.newName];e[i]={type:o?.type??String,required:!1,deprecated:!0}}}const r={attributes:e,...n.selfClosing!=null&&{selfClosing:n.selfClosing},transform:(i,s)=>{if(t){for(const[m,p]of Object.entries(t))if(i.attributes[m]!==void 0&&i.attributes[p.newName]===void 0){const O=p.transform?p.transform(i.attributes[m],i.attributes):i.attributes[m];O!==void 0&&(i.attributes[p.newName]=O)}}const o=i.transformAttributes(s),a=typeof n.contentModel=="function"?n.contentModel(o):n.contentModel,{content:l,tintNode:c,bgNode:u}=Fj(i.children,a,o),f=n.transform(l,o,s,i),d={tintNode:c,bgNode:u,tint:o.tint,"tint-mode":o["tint-mode"],bg:o.bg,config:s},h=Hz(Gz(f,d),d);return B.Tag.isTag(h)&&(o.width&&(h.attributes.width=o.width),o.spacing&&(h.attributes.spacing=o.spacing),o.inset&&(h.attributes.inset=o.inset),o.elevation&&(h.attributes.elevation=o.elevation)),Jz(e6(Kz(h,o),o),o)}};return t&&(r.validate=i=>{const s=[];for(const[o,a]of Object.entries(t))i.attributes[o]!==void 0&&s.push({id:"deprecated-attribute",level:"warning",message:`Attribute "${o}" is deprecated. Use "${a.newName}" instead.`});return s}),n.deferBody&&(r.deferBody=!0),Xz.set(r,n.contentModel),n.base&&Wj.set(r,n.base),r}const{Tag:Du}=B,t6=et({attributes:{type:{type:String},tag:{type:String},lines:{type:Array},error:{type:Object}},contentModel:{type:"sequence",fields:[]},transform(n,e){const t=e.error,r=new Du("td",{},[t.id]),i=new Du("td",{},[e.tag]),s=new Du("td",{},[t.level]),o=new Du("td",{},[t.message]);return Ne({rune:"error",tag:"tr",property:"error",properties:{code:r,tag:i,level:s,message:o},children:[i,r,s,o]})}});class n6{validate(e,t,r){return typeof e!="string"?[{id:"attribute-type-invalid",level:"critical",message:`Attribute '${r}' is not a string`}]:[]}}class r6 extends n6{transform(e){return e?e.split(" ").map(t=>t.trim()):[]}}const{Tag:i6}=B,s6=["row","column","dense","row dense","column dense"];function o6(n,e){return!n||n.length===0?e.map(t=>({colspan:1,rowspan:void 0,children:t})):n.map((t,r)=>{const[i,s]=t.split(":");return{colspan:parseInt(i),rowspan:s?parseInt(s):void 0,children:e[r]}}).filter(t=>t.children!==void 0)}function a6(n){const e=n.items.map(({children:r,colspan:i,rowspan:s})=>r.wrap("div",{"data-colspan":i,"data-rowspan":s}).toArray()).flat(),t={"data-layout":"grid","data-columns":n.columns,"data-rows":n.rows,"data-flow":n.flow};return new i6("div",t,e)}const{Tag:Ps}=B,l6=["columns","auto","masonry"],c6=et({attributes:{columns:{type:Number,required:!1,description:"Number of grid columns"},rows:{type:Number,required:!1,description:"Number of grid rows"},flow:{type:String,required:!1,matches:s6.slice(),description:"Direction items fill the grid"},spans:{type:r6,required:!1,description:"Column span widths for each cell (space-separated)"},ratio:{type:String,required:!1,description:'Column width ratio (e.g. "2 1 1")'},gap:{type:String,required:!1,matches:["none","tight","default","loose"],description:"Space between grid cells"},valign:{type:String,required:!1,matches:["top","center","bottom","stretch","baseline"],description:"Vertical alignment of cell content"},collapse:{type:String,required:!1,matches:["sm","md","lg","never"],description:"Breakpoint at which grid collapses to a single column"},mode:{type:String,required:!1,matches:["columns","auto","masonry"],default:"columns",description:"Grid sizing: fixed columns, auto-fit, or masonry"},min:{type:String,required:!1,description:"Minimum cell width for auto-fit mode"},aspect:{type:String,required:!1,description:"Aspect ratio for grid cells"},stack:{type:String,required:!1,matches:["natural","reverse"],description:"Stacking order when collapsed"}},contentModel:{type:"delimited",delimiter:"hr",dynamicZones:!0,zoneModel:{type:"sequence",fields:[{name:"content",match:"any",greedy:!0,optional:!0}]}},deprecations:{layout:{newName:"spans",transform:(n,e)=>{if(typeof n=="string"&&l6.includes(n)){e.mode=n;return}return n}}},transform(n,e,t){const i=(n.zones??[]).map(p=>new Fe(B.transform(ct(p.content),t))),s=a6({items:o6(e.spans,i),rows:e.rows,columns:e.columns,flow:e.flow}),o=e.ratio?new Ps("meta",{content:e.ratio}):void 0,a=e.gap&&e.gap!=="default"?new Ps("meta",{content:e.gap}):void 0,l=e.valign?new Ps("meta",{content:e.valign}):void 0,c=e.collapse?new Ps("meta",{content:e.collapse}):void 0,u=e.mode&&e.mode!=="columns"?new Ps("meta",{content:e.mode}):void 0,f=e.min?new Ps("meta",{content:e.min}):void 0,d=e.aspect?new Ps("meta",{content:e.aspect}):void 0,h=e.stack?new Ps("meta",{content:e.stack}):void 0,m=[o,a,l,c,u,f,d,h].filter(Boolean);return Ne({rune:"grid",tag:"section",children:[...m,s],properties:{...u?{mode:u}:{},ratio:o,gap:a,valign:l,collapse:c,...f?{min:f}:{},...d?{aspect:d}:{},...h?{stack:h}:{}},refs:{cell:new Fe(s.children).tag("div")}})}}),{Tag:Cl}=B,u6={js:"JavaScript",ts:"TypeScript",py:"Python",rb:"Ruby",rs:"Rust",go:"Go",sh:"Shell",bash:"Bash",zsh:"Zsh",shell:"Shell",html:"HTML",css:"CSS",json:"JSON",yaml:"YAML",sql:"SQL",swift:"Swift",kt:"Kotlin",java:"Java",cpp:"C++",c:"C",cs:"C#",php:"PHP"};function f6(n){return u6[n]||n.charAt(0).toUpperCase()+n.slice(1)}function d6(n){if(!n)return"";const e=n.endsWith("/")?n.slice(0,-1):n,t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function h6(n,e){if(!n)return"";const t=d6(n);return t?e?`${t}:${e}`:t:""}const p6=["scroll","wrap","hide"],m6=et({attributes:{title:{type:String,required:!1,description:"Title displayed above the code group"},labels:{type:String,required:!1,description:"Comma-separated custom tab labels"},overflow:{type:String,required:!1,matches:p6.slice(),description:"How overflowing code is handled"}},contentModel:{type:"sequence",fields:[{name:"panels",match:"fence",greedy:!0}]},transform(n,e,t){const r=e.labels?.split(",").map(p=>p.trim())??[],i={},s=[];if(e.title!==void 0){const p=new Cl("meta",{content:e.title});i.title=p,s.push(p)}const o=e.overflow;if(o&&o!=="scroll"){const p=new Cl("meta",{content:o});i.overflow=p,s.push(p)}const a=ct(n.panels);if(a.length===1&&r.length===0){const p=B.transform(a[0],t);return s.push(p),Ne({rune:"code-group",tag:"section",properties:i,refs:{},children:s})}const c=[],u=[];for(const p of a){const O=p.attributes.language||"shell",v=typeof p.attributes.label=="string"?p.attributes.label:"",b=h6(typeof p.attributes.source=="string"?p.attributes.source:void 0,typeof p.attributes.lines=="string"?p.attributes.lines:void 0),_=r[c.length]||v||b||f6(O),C=new Cl("span",{},[_]);c.push(new Cl("button",{"data-name":"tab",role:"tab"},[C]));const w=B.transform(p,t);u.push(new Cl("div",{role:"tabpanel"},[w]))}const f=new Fe(c),d=new Fe(u),h=f.wrap("div",{role:"tablist"}),m=d.wrap("div");return s.push(h.next(),m.next()),Ne({rune:"code-group",tag:"section",properties:i,refs:{tabs:h,panels:m,panel:d},children:s})}}),g6=et({attributes:{path:{type:String,required:!0,description:"Path to the source file, relative to the project root. Rejected if it escapes the root."},lines:{type:String,required:!1,description:'Line range. Formats: "10-25", "10-" (to EOF), "-20" (from start), "10" (single line). 1-indexed, inclusive.'},lang:{type:String,required:!1,description:"Syntax-highlighting language hint. Overrides the extension-based inference."},linenumbers:{type:Boolean,required:!1,description:'Show line numbers in the gutter. Starting number derives from the `lines` range start (e.g. lines="74-125" → first line is 74), so numbers reflect the file\'s real offsets. WORK-304.'},highlight:{type:String,required:!1,description:'Range(s) to emphasize without cropping — Shiki-style format: "74-78", "74-78,82,90-92". Indices are file coordinates (same frame as `lines=`). Use this when you want full context visible but want to draw the eye to specific lines. WORK-304.'}},contentModel:{type:"sequence",fields:[]},transform(n,e){throw new Error("snippet rune reached the transform phase — its preprocess hook was not wired through. Ensure the content pipeline runs registered `preprocess` hooks before `Markdoc.transform` (snippet pre-resolves to a Markdoc `fence` node; see SPEC-062 § Composition).")}}),{Tag:O6}=B,v6=["caution","check","note","warning"],b6=et({attributes:{type:{type:String,matches:v6.slice(),errorLevel:"critical",description:"Visual style: caution, check, note, or warning"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new O6("meta",{content:e.type??"note"}),s=new Fe(B.transform(ct(n.body),t)).wrap("div");return Ne({rune:"hint",tag:"section",property:"contentSection",properties:{hintType:r},refs:{body:s.tag("div")},children:[r,s.next()]})}}),gC={"media-position":{type:String,required:!1,matches:["top","bottom","start","end","cover"],description:"Where the media zone sits relative to the content: above (top), below (bottom), or beside (start/end)"},"media-ratio":{type:String,required:!1,matches:["1/3","2/5","1/2","3/5","2/3"],description:"Media zone’s share of the row width when media is beside content (start/end)"},valign:{type:String,required:!1,matches:["top","center","bottom","stretch"],description:"Cross-axis alignment when media is beside content (start/end); applies to the shorter zone"},collapse:{type:String,required:!1,matches:["sm","md","lg","never"],description:"Breakpoint at which side-by-side layouts collapse to a single stacked column"}};Vj(gC,{name:"split layout",description:"Layout controls shared by media+content runes — `media-position`, `media-ratio`, `valign`, `collapse`."});const y6=gC;et({contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=n.body?Array.isArray(n.body)?n.body:[n.body]:[],i=new Fe(B.transform(r,{...t,nodes:{...t.nodes,text:{transform(s){return new B.Tag("span",{},[s.attributes.content])}}}}));return new B.Tag("li",{},i.toArray())}});function w6(n){const e=n["media-position"]||"top",t=n["media-ratio"],r=n.valign,i=n.collapse,s=e==="start"||e==="end",o=new B.Tag("meta",{content:e}),a=s&&t?new B.Tag("meta",{content:t}):void 0,l=s&&r?new B.Tag("meta",{content:r}):void 0,c=i?new B.Tag("meta",{content:i}):void 0,u=[o];return a&&u.push(a),l&&u.push(l),c&&u.push(c),{metas:{mediaPosition:o,mediaRatio:a,valign:l,collapse:c},children:u}}function _6(n){const e=[[]];for(const t of n)t.type==="hr"?e.push([]):e[e.length-1].push(t);return e.length===1?{media:[],body:e[0],footer:[]}:e.length===2?{media:e[0],body:e[1],footer:[]}:{media:e[0],body:e.slice(1,-1).flat(),footer:e[e.length-1]}}function k6(n){for(const e of n.toArray()){if(B.Tag.isTag(e)&&e.name==="img")return e;if(B.Tag.isTag(e)&&e.name==="p"){const t=e.children.find(r=>B.Tag.isTag(r)&&r.name==="img");if(t)return t}}}function x6(n){return n.map(e=>B.Tag.isTag(e)&&e.name==="p"&&e.children.length===1&&B.Tag.isTag(e.children[0])&&(e.children[0].name==="img"||e.children[0].attributes?.["data-rune"])?e.children[0]:e)}function eu(n){const e=n.nodes,t=c=>B.Tag.isTag(c)&&/^h[1-6]$/.test(c.name),r=c=>B.Tag.isTag(c)&&c.name==="p",i=e.findIndex(t);if(i===-1)return{eyebrow:void 0,headline:void 0,image:n.tag("img").limit(1),blurb:e.find(r)};const s=e.slice(0,i).findIndex(r);let o,a;if(s!==-1)o=e[s],a=i;else{const c=e.findIndex((u,f)=>f>i&&t(u));c!==-1?(o=e[i],a=c):(o=void 0,a=i)}const l=e.findIndex((c,u)=>u>a&&r(c));return{eyebrow:o,headline:e[a],image:n.tag("img").limit(1),blurb:l!==-1?e[l]:void 0}}const{Ast:OC,Tag:S6}=B,A6=et({attributes:{name:{type:String,required:!0},image:{type:String,required:!1}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){let r=new Fe([]);e.image&&(r=r.concat(B.transform(new OC.Node("image",{src:e.image}),t))),r=r.concat(new S6("span",{},[e.name??""]));const i=new Fe(B.transform(ct(n.body),t)),s=r.tag("span"),o=r.tag("svg");return[Ne({rune:"tab",tag:"button",properties:{image:o},refs:{name:s},children:r.toArray()}),Ne({rune:"tab-panel",tag:"div",properties:{},children:i.toArray()})]}});function C6(n){const e=Pv()(n),t=e.length-1;if(!e[t]||e[t].type!=="list")return n;const r=e[t].children.map(i=>{const s=i.children[0],o=Array.from(s.walk()).find(l=>l.type==="image"),a=Array.from(s.walk()).filter(l=>l.type==="text").map(l=>l.attributes.content);return new OC.Node("tag",{name:a,image:o?o.attributes.src:void 0},i.children.slice(1),"tab")});return e.splice(t,1,...r),e}const T6=et({attributes:{},contentModel:()=>({type:"custom",processChildren:n=>C6(n),description:"Converts headings at the specified level to tab tags, extracting tab name and optional image from heading content."}),transform(n,e,t){const r=ct(n.children),i=[],s=[];for(const h of r)h.type==="tag"&&h.tag==="tab"?s.push(h):(h.type==="heading"||h.type==="paragraph")&&i.push(h);const o=new Fe(B.transform(i,t)),a=new Fe(B.transform(s,t)),l=a.tag("button").typeof("Tab"),c=a.tag("div").typeof("TabPanel"),u=l.wrap("div",{role:"tablist"}),f=c.wrap("div"),d=o.count()>0?[o.wrap("header").next(),u.next(),f.next()]:[u.next(),f.next()];return Ne({rune:"tab-group",tag:"section",class:e.class,property:"contentSection",properties:{},refs:{...eu(o),tabs:u,panels:f},children:d})}}),vC="__nav-auto",bC="auto";function Ev(n){return B.Tag.isTag(n)&&(n.name==="ul"||n.name==="ol")}const P6=et({contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),{...t,nodes:{...t.nodes,text:{transform(O){return new B.Tag("span",{"data-field":"slug"},[O.attributes.content])}}}})),i=r.tag("a").toArray(),s=r.tag("span"),o=r.tag("ul"),a=r.toArray().filter(O=>B.Tag.isTag(O)&&O.attributes?.["data-rune"]==="badge"),l=r.tag("p").toArray(),c=[],u=[];for(const O of l)O.children.some(b=>B.Tag.isTag(b)&&b.name==="a")?c.push(O):u.push(O);const f=c.flatMap(O=>O.children.filter(v=>B.Tag.isTag(v)&&v.name==="a")),d=[...i,...f],h=u.flatMap(O=>O.children),m=h.length>0?new B.Tag("span",{"data-name":"description",class:"rf-nav-item__description"},h):void 0;if(d.length>0){const O=m?d.map(b=>({...b,children:[...b.children??[],m]})):d,v=[];if(a.length>0){for(const b of a)b.attributes["data-name"]="badge";v.push(...a)}return Ne({rune:"nav-item",tag:"li",properties:m?{description:m}:{},children:[...O,...v]})}const p=[];if(s.count()>0&&p.push(...s.toArray()),m&&p.push(m),a.length>0){for(const O of a)O.attributes["data-name"]="badge";p.push(...a)}return o.count()>0&&p.push(...o.toArray()),Ne({rune:"nav-item",tag:"li",properties:{slug:s,...m?{description:m}:{},children:o.count()>0?o.flatten().tag("li"):void 0},children:p})}});function E6(n){const e=[],t=[];let r=null;const i=()=>{r&&(t.push(r),r=null)};for(const s of n){if(B.Tag.isTag(s)&&/^h[1-6]$/.test(s.name)){i(),r={kind:"group",heading:s,children:[]};continue}if(B.Tag.isTag(s)&&s.name==="hr"){r&&i(),t.push({kind:"column-break"});continue}if(!r){B.Tag.isTag(s)&&Ev(s)&&e.push(...s.children.filter(o=>B.Tag.isTag(o)&&o.name==="li"));continue}r.children.push(s)}return i(),{topLevel:e,sequence:t}}function $6(n){const e=u=>B.Tag.isTag(u)?u.name==="ul"||u.name==="ol"?!0:!!u.attributes?.["data-rune"]:!1,t=u=>B.Tag.isTag(u)&&!e(u);let r=-1,i=-1;n.forEach((u,f)=>{e(u)&&(r===-1&&(r=f),i=f)});let s,o;if(r!==-1){for(let u=0;u<r;u++)if(t(n[u])){s=u;break}for(let u=n.length-1;u>i;u--)if(t(n[u])){o=u;break}}else{const u=[];n.forEach((f,d)=>{t(f)&&u.push(d)}),u.length===1?s=u[0]:u.length>=2&&(s=u[0],o=u[u.length-1])}const a=s!==void 0?n[s]:void 0,l=o!==void 0?n[o]:void 0,c=[];return n.forEach((u,f)=>{f===s||f===o||c.push(u)}),{intro:a,body:c,footer:l}}function Q6(n){const{intro:e,body:t,footer:r}=$6(n.children),i=[];for(const a of t)B.Tag.isTag(a)&&Ev(a)&&i.push(...a.children.filter(l=>B.Tag.isTag(l)&&l.name==="li"));const s=[];e&&s.push(new B.Tag("div",{"data-name":"intro"},[e])),s.push(...t),r&&s.push(new B.Tag("div",{"data-name":"footer"},[r]));const o=[n.heading];return s.length>0&&o.push(new B.Tag("div",{"data-name":"panel"},s)),Ne({rune:"nav-group",tag:"section",properties:{title:n.heading,item:i},children:o})}function L6(n){const e=[];let t=[];for(const r of n)r.kind==="column-break"?(t.length>0&&e.push(t),t=[]):t.push(r);return t.length>0&&e.push(t),e}const M6=et({attributes:{ordered:{type:Boolean,required:!1,description:"Use numbered list for navigation items"},auto:{type:Boolean,required:!1,description:"Automatically generate from child pages"},layout:{type:String,required:!1,matches:["vertical","menubar","columns","cards","strip"],description:"Presentation layout: sidebar (vertical), horizontal menubar (header), column grid (footer), cards (section landing), or strip (compact secondary nav). Defaults to vertical."},collapsible:{type:Boolean,required:!1,description:"Make each group collapsible. The group containing the current page auto-expands; others start collapsed. Only meaningful for vertical layout."},defaultOpen:{type:String,required:!1,description:"Comma-separated group titles to expand by default, overriding the URL-driven auto-open behaviour."}},contentModel:{type:"custom",processChildren:n=>Pv({level:1})(n),description:"Top-level (#) headings become nav groups; the list directly under each heading becomes the group's items. Items are page slugs — wrap in markdown links to set custom labels, or use plain text to resolve the page title. Without headings, a single list becomes a flat nav."},transform(n,e,t){const r=!!e.collapsible,i=t.variables?.__sourcePath,s=O=>{if(e.layout&&(O.attributes.layout=e.layout),i&&(O.attributes["data-source-path"]=i),e.auto&&(O.attributes["data-auto"]="true"),r){O.attributes["data-collapsible"]="true";const v=O.attributes.class??"";O.attributes.class=[v,"rf-nav--collapsible"].filter(Boolean).join(" "),typeof e.defaultOpen=="string"&&e.defaultOpen.trim()&&(O.attributes["data-default-open"]=e.defaultOpen.trim())}return O},o=O=>e.layout==="menubar"?[new B.Tag("button",{"data-name":"trigger",type:"button","aria-label":"Toggle navigation","aria-expanded":"false"},[]),...O]:O;if(e.auto){const O=new B.Tag("meta",{"data-field":vC,content:"true"});return s(Ne({rune:"nav",tag:"nav",properties:{group:[],item:[]},children:o([O])}))}const a=new Fe(B.transform(ct(n.children),{...t,nodes:{...t.nodes,item:P6,list:{transform(O,v){return new B.Tag("ul",{},O.transformChildren(v))}}}}));if(e.layout==="strip"){const O=a.flatten().tag("li");return s(Ne({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:[],item:O},children:a.toArray()}))}const{topLevel:l,sequence:c}=E6(a.toArray()),u=c.filter(O=>O.kind==="group"),f=u.length>0,d=c.some(O=>O.kind==="column-break");if(!f){if(e.layout==="columns"&&d){const v=[];let b=[];const _=()=>{b.length>0&&(v.push([new B.Tag("ul",{},b)]),b=[])};for(const y of a.toArray()){if(B.Tag.isTag(y)&&y.name==="hr"){_();continue}B.Tag.isTag(y)&&Ev(y)&&b.push(...y.children.filter(S=>B.Tag.isTag(S)&&S.name==="li"))}_();const C=v.map(y=>new B.Tag("div",{"data-name":"column"},y)),w=a.flatten().tag("li");return s(Ne({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:[],item:w},children:o(C)}))}const O=a.flatten().tag("li");return s(Ne({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:[],item:O},children:o(a.toArray())}))}const h=u.map(Q6);if(r)for(const O of h)O.attributes["data-collapsed"]=bC;const m=l.length>0?new B.Tag("div",{"data-name":"top-level"},[new B.Tag("ul",{},l)]):null,p=h.flatMap(O=>{const v=[],b=_=>{if(B.Tag.isTag(_)){if(_.name==="li"){v.push(_);return}for(const C of _.children)b(C)}};for(const _ of O.children)b(_);return v});if(e.layout==="columns"&&d){const O=L6(c),v=new Map(u.map((_,C)=>[_,h[C]])),b=O.map(_=>new B.Tag("div",{"data-name":"column"},_.map(C=>v.get(C)).filter(Boolean)));return s(Ne({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:h,item:[...l,...p]},children:o(m?[m,...b]:b)}))}return s(Ne({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:h,item:[...l,...p]},children:o(m?[m,...h]:h)}))}}),{Tag:q6}=B,D6=["replace","prepend","append"],R6=et({attributes:{name:{type:String,required:!0,description:"Name of the layout region to fill"},mode:{type:String,required:!1,matches:D6.slice(),errorLevel:"critical",default:"replace",description:"How content is placed: replace, prepend, or append"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",greedy:!0,optional:!0}]},transform(n,e,t){const r=B.transform(ct(n.body),t);return new q6("div",{"data-region":e.name,"data-mode":e.mode},r)}}),{Tag:I6}=B,N6=et({attributes:{extends:{type:String,required:!1,default:"parent",description:"Layout inheritance: parent or none"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",greedy:!0,optional:!0}]},transform(n,e,t){const r=B.transform(ct(n.body),t);return new I6("div",{"data-layout-def":!0,"data-extends":e.extends},r)}}),{Tag:B6}=B,j6=et({attributes:{summary:{type:String,required:!1,description:"Clickable summary text shown when collapsed"},open:{type:Boolean,required:!1,description:"Expand the details section by default"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.summary||"Details",s=new B6("summary",{},[i]),o=r.wrap("div"),a=Ne({rune:"details",tag:"details",properties:{summary:s},refs:{body:o.tag("div")},children:[s,o.next()]});return e.open&&(a.attributes.open=!0),a}}),{Tag:ao}=B,cg="data-drawer-title-auto",z6=["right","left","top","bottom"],Z6=["sm","md","lg"];function F6(n){const e=n.findIndex(t=>t.type==="hr");return e<0?{body:n,footer:null}:{body:n.slice(0,e),footer:n.slice(e+1)}}const X6=et({attributes:{id:{type:String,required:!0,description:'Stable id for the drawer. Used in entity registration and as the `id="drawer-{value}"` on the rendered element so xref triggers can target it via fragment.'},title:{type:String,required:!1,description:"Panel heading text. Rendered in the drawer header (or as a heading in the no-JS in-flow rendering)."},headingLevel:{type:Number,required:!1,description:"Heading level (1-6) for the title. When omitted, the level is auto-detected from outline position (one deeper than the nearest preceding heading). Out-of-range values are clamped to the 1-6 range."},shortcut:{type:String,required:!1,description:'Keyboard shortcut that opens the drawer when behaviors are loaded (e.g. ".", "cmd+k"). Surfaces as `data-shortcut`; the progressive-enhancement layer wires the listener.'},side:{type:String,required:!1,matches:z6.slice(),description:'Edge the panel slides from when enhanced. Defaults to "right".'},size:{type:String,required:!1,matches:Z6.slice(),description:'Panel size. "sm" / "md" (default) / "lg" — width for left/right sides, height for top/bottom.'}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=e.id,i=e.title,s=e.side??"right",o=e.size??"md",a=typeof e.headingLevel=="number"?Math.min(6,Math.max(1,Math.trunc(e.headingLevel))):void 0,l=i?a?new ao(`h${a}`,{},[i]):new ao("h3",{[cg]:"true"},[i]):void 0,c=new ao("button",{type:"button","aria-label":"Close",hidden:!0},["×"]),u=[];l&&u.push(l),u.push(c);const f=new ao("header",{},u),d=F6(ct(n.body)),h=new Fe(B.transform(d.body,t)).wrap("div"),m=d.footer!==null?new Fe(B.transform(d.footer,t)).wrap("footer"):null,p={side:new ao("meta",{content:s}),size:new ao("meta",{content:o})};e.shortcut&&(p.shortcut=new ao("meta",{content:e.shortcut}));const O=Ne({rune:"drawer",tag:"section",id:`drawer-${r}`,properties:p,refs:{header:f,...l?{title:l}:{},close:c,body:h.tag("div"),...m?{footer:m.tag("footer")}:{}},children:[...Object.values(p),f,h.next(),...m?[m.next()]:[]]});return O.attributes["data-drawer-id"]=r,O}}),{Tag:Ru}=B,V6=["small","medium","large","full"],W6=["left","center","right"],Y6=et({attributes:{size:{type:String,required:!1,matches:V6.slice(),description:"Display width of the figure"},align:{type:String,required:!1,matches:W6.slice(),description:"Horizontal alignment of the figure"},caption:{type:String,required:!1,description:"Caption text displayed below the figure"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=r.flatten().tag("img").toArray(),s=r.tag("p").toArray().filter(f=>{const d=(f.children||[]).filter(h=>B.Tag.isTag(h));return!(d.length===1&&d[0].name==="img")}),o=e.caption||void 0,a=o?new Ru("figcaption",{},[o]):s.length>0?new Ru("figcaption",{},[s[0]]):void 0,l=e.size?new Ru("meta",{content:e.size}):void 0,c=e.align?new Ru("meta",{content:e.align}):void 0,u=[...i];return a&&u.push(a),l&&u.push(l),c&&u.push(c),Ne({rune:"figure",schemaOrgType:"ImageObject",tag:"figure",properties:{...l?{size:l}:{},...c?{align:c}:{}},refs:{...a?{caption:a}:{}},schema:{...i.length>0?{contentUrl:i[0]}:{},...a?{caption:a}:{}},children:u})}}),{Tag:lo}=B,U6=["grid","carousel","masonry"],G6=et({attributes:{layout:{type:String,required:!1,matches:U6.slice(),description:"Arrangement of images in the gallery"},columns:{type:Number,required:!1,description:"Number of columns in grid layout"},lightbox:{type:Boolean,required:!1,description:"Allow clicking images to view full-size"},caption:{type:String,required:!1,description:"Caption text displayed below the gallery"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.layout??"grid",s=e.columns??3,o=e.lightbox??!0,a=e.caption??"",c=r.flatten().tag("img").toArray().map(v=>{const b=v.attributes?.alt||"",_=[v];return b&&_.push(new lo("figcaption",{},[b])),new lo("figure",{"data-name":"item"},_)}),u=new lo("meta",{content:i}),f=new lo("meta",{content:String(o)}),d=s!==3?new lo("meta",{content:String(s)}):void 0,h=a?new lo("figcaption",{},[a]):void 0,m=new lo("div",{"data-name":"items"},c),O=[...[u,f,d].filter(Boolean),m];return h&&O.push(h),Ne({rune:"gallery",schemaOrgType:"ImageGallery",tag:"figure",properties:{layout:u,lightbox:f,...d?{columns:d}:{},...h?{caption:h}:{}},children:O})}}),{Tag:wp}=B,H6=et({attributes:{name:{type:String,required:!0}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new wp("summary",{},[e.name??""]),i=new Fe(B.transform(ct(n.body),t)).wrap("div"),s=i.tag("div");for(const o of s.nodes)wp.isTag(o)&&(o.attributes.typeof="Answer",o.children=[new wp("div",{property:"text"},o.children)]);return Ne({rune:"accordion-item",schemaOrgType:"Question",tag:"details",properties:{name:r},refs:{body:s},schema:{name:r,acceptedAnswer:s},children:[r,i.next()]})}}),K6=et({attributes:{multiple:{type:Boolean,required:!1,description:"Allow multiple panels to be open at once"}},contentModel:()=>({type:"sections",sectionHeading:"heading",emitTag:"accordion-item",emitAttributes:{name:"$heading"},fields:[{name:"header",match:"heading|paragraph",optional:!0,greedy:!0},{name:"items",match:"tag",optional:!0,greedy:!0}],sectionModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]}}),transform(n,e,t){const r=new Fe(B.transform(ct(n.header),t)),i=[...ct(n.items),...ct(n.sections)],o=new Fe(B.transform(i,t)).tag("details").typeof("AccordionItem"),a=o.wrap("div"),l=r.count()>0?[r.wrap("header").next(),a.next()]:[a.next()];return Ne({rune:"accordion",schemaOrgType:"FAQPage",tag:"section",property:"contentSection",properties:{item:o},refs:{...eu(r),items:a},schema:{mainEntity:o},children:l})}}),{Tag:Tl}=B,J6=et({attributes:{depth:{type:Number,required:!1,default:3,description:"Maximum heading depth to include"},ordered:{type:Boolean,required:!1,default:!1,description:"Use numbered list instead of bullets"}},contentModel:{type:"sequence",fields:[]},transform(n,e,t){const r=t.variables?.headings||[],i=e.depth+1,o=r.filter(u=>u.level>=2&&u.level<=i).map(u=>new Tl("li",{"data-level":u.level},[new Tl("a",{href:`#${u.id}`},[u.text])])),a=new Tl("ul",{},o),l=new Tl("meta",{content:e.depth}),c=new Tl("meta",{content:e.ordered});return Ne({rune:"table-of-contents",tag:"nav",properties:{depth:l,ordered:c},refs:{list:a},children:[l,c,a]})}}),{Tag:ra}=B,e8=["16:9","4:3","1:1","auto"];function t8(n){try{const e=new URL(n),t=e.hostname.replace("www.","");if(t==="youtube.com"||t==="youtu.be"){let r="";return t==="youtu.be"?r=e.pathname.slice(1):r=e.searchParams.get("v")||"",{provider:"youtube",embedUrl:r?`https://www.youtube-nocookie.com/embed/${r}`:n,type:"video"}}if(t==="vimeo.com")return{provider:"vimeo",embedUrl:`https://player.vimeo.com/video/${e.pathname.slice(1)}`,type:"video"};if(t==="twitter.com"||t==="x.com")return{provider:"twitter",embedUrl:n,type:"tweet"};if(t==="codepen.io")return{provider:"codepen",embedUrl:n.replace("/pen/","/embed/"),type:"codepen"};if(t==="open.spotify.com")return{provider:"spotify",embedUrl:n.replace("open.spotify.com/","open.spotify.com/embed/"),type:"spotify"}}catch{}return{provider:"generic",embedUrl:n,type:"generic"}}const n8=et({attributes:{url:{type:String,required:!0,description:"URL of the content to embed"},type:{type:String,required:!1,description:"Override auto-detected embed type"},aspect:{type:String,required:!1,matches:e8.slice(),description:"Aspect ratio of the embed frame"},title:{type:String,required:!1,description:"Accessible title for the embed iframe"}},contentModel:{type:"sequence",fields:[{name:"fallback",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=e.url??"",i=t8(r),s=e.aspect??"16:9",o=e.title||"Embedded content",[a,l]=s.split(":").map(Number),c=l&&a?l/a*100:56.25,u=new ra("meta",{content:r}),f=new ra("meta",{content:e.title??""}),d=new ra("meta",{content:i.embedUrl}),h=new ra("meta",{content:i.provider}),m=new Fe(B.transform(ct(n.fallback),t)).wrap("div"),p=m.tag("div"),O=[u,f,d];let v;if(i.embedUrl){const b=new ra("iframe",{src:i.embedUrl,title:o,frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"",loading:"lazy"},[]);v=new ra("div",{style:`padding-bottom: ${c}%`},[b]),O.push(v)}return O.push(m.next()),Ne({rune:"embed",schemaOrgType:"VideoObject",tag:"figure",properties:{provider:h},refs:{...v?{wrapper:v}:{},fallback:p},schema:{name:f,contentUrl:u,embedUrl:d},children:O})}}),{Tag:fi}=B,yC="__breadcrumb-auto",r8=et({attributes:{separator:{type:String,required:!1,default:"/",description:"Character between breadcrumb items"},auto:{type:Boolean,required:!1,default:!1,description:"Automatically generate from page hierarchy"}},contentModel:n=>n.auto?{type:"sequence",fields:[]}:{type:"sequence",fields:[{name:"list",match:"list",optional:!0,greedy:!0}]},transform(n,e,t){const r=new fi("meta",{content:e.separator});if(e.auto){const l=new fi("meta",{"data-field":yC,content:"true"}),c=new fi("ol",{},[]);return Ne({rune:"breadcrumb",schemaOrgType:"BreadcrumbList",tag:"nav",properties:{separator:r},refs:{items:c},children:[r,l,c]})}const i=new Fe(B.transform(ct(n.list),t)),s=[];let o=0;for(const l of i.toArray())if(fi.isTag(l)&&(l.name==="ul"||l.name==="ol")){for(const c of l.children)if(fi.isTag(c)&&c.name==="li"){o++;const u=new fi("meta",{content:o}),f=c.children.find(d=>fi.isTag(d)&&d.name==="a");if(f){const d=new fi("span",{hidden:!0},f.children),h=new fi("a",{href:f.attributes.href},f.children);s.push(Ne({rune:"breadcrumb-item",schemaOrgType:"ListItem",tag:"li",properties:{name:d,url:h},schema:{name:d,item:h,position:u},children:[d,h,u]}))}else{const d=c.children.filter(m=>typeof m=="string").join("").trim(),h=new fi("span",{},d?[d]:c.children);s.push(Ne({rune:"breadcrumb-item",schemaOrgType:"ListItem",tag:"li",properties:{name:h},schema:{name:h,position:u},children:[h,u]}))}}}const a=new fi("ol",{},s);return Ne({rune:"breadcrumb",schemaOrgType:"BreadcrumbList",tag:"nav",properties:{separator:r},refs:{items:a},schema:{itemListElement:s},children:[r,a]})}}),{Tag:Mi}=B,ug="__pagination-auto",i8=et({attributes:{auto:{type:Boolean,required:!1,default:!1,description:"Derive prev/next from sibling page order"},prev:{type:String,required:!1,description:"Explicit previous page (slug or URL)"},next:{type:String,required:!1,description:"Explicit next page (slug or URL)"},scope:{type:String,required:!1,matches:["siblings","section"],default:"siblings",description:"Auto-mode scope: direct siblings, or all pages in the current top-level section"},"prev-label":{type:String,required:!1,description:"Override label for the previous link"},"next-label":{type:String,required:!1,description:"Override label for the next link"}},contentModel:{type:"sequence",fields:[]},selfClosing:!0,transform(n,e,t){if(e.auto){const i=new Mi("meta",{"data-field":ug,content:"true"}),s=e.scope?new Mi("meta",{"data-field":"scope",content:String(e.scope)}):null,o=e["prev-label"]?new Mi("meta",{"data-field":"prev-label",content:String(e["prev-label"])}):null,a=e["next-label"]?new Mi("meta",{"data-field":"next-label",content:String(e["next-label"])}):null,l=[i,s,o,a].filter(Boolean);return Ne({rune:"pagination",tag:"nav",children:l})}const r=[];if(e.prev){const s=String(e.prev).startsWith("/")||/^[a-z]+:\/\//i.test(String(e.prev))?String(e.prev):`__slug:${e.prev}`,o=e["prev-label"]??String(e.prev);r.push(new Mi("a",{href:s,"data-direction":"prev","data-name":"prev"},[new Mi("span",{"data-name":"marker"},["←"]),new Mi("span",{"data-name":"label"},[o])]))}if(e.next){const s=String(e.next).startsWith("/")||/^[a-z]+:\/\//i.test(String(e.next))?String(e.next):`__slug:${e.next}`,o=e["next-label"]??String(e.next);r.push(new Mi("a",{href:s,"data-direction":"next","data-name":"next"},[new Mi("span",{"data-name":"label"},[o]),new Mi("span",{"data-name":"marker"},["→"])]))}return Ne({rune:"pagination",tag:"nav",children:r})}}),{Ast:fg,Tag:wn}=B,s8=/^(.+)\s*:\s*([€$£¥]?\s*[\d].*)$/;function o8(n){const e=n.replace(/[€$£¥\s]/g,"").replace(/,/g,""),t=e.match(/^([\d.]+)\s*[-–]\s*([\d.]+)/);if(t)return(parseFloat(t[1])+parseFloat(t[2]))/2;const r=parseFloat(e);return isNaN(r)?0:r}const a8={USD:"$",EUR:"€",GBP:"£",JPY:"¥",CNY:"¥",AUD:"A$",CAD:"C$",CHF:"CHF ",SEK:"kr",NOK:"kr",DKK:"kr",INR:"₹",KRW:"₩",BRL:"R$",MXN:"MX$",ZAR:"R"};function _p(n,e){const t=(n%1===0?String(n):n.toFixed(2)).split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e+t.join(".")}function l8(n){let e=0;const t=n.match(/(\d+)\s*day/i),r=n.match(/(\d+)\s*week/i),i=n.match(/(\d+)\s*month/i);if(t&&(e+=parseInt(t[1])),r&&(e+=parseInt(r[1])*7),i&&(e+=parseInt(i[1])*30),e===0){const s=parseInt(n);isNaN(s)||(e=s)}return e}function D0(n,e){for(const t of n.children)if(B.Tag.isTag(t)&&t.attributes["data-field"]===e)return String(t.attributes.content??"");return""}const c8=/^(.+?)\s*\((?:estimate|est\.?)\)\s*$/i,u8=/^~(.+?)~$/;function f8(n){const e=[];let t=!1;for(const o of n.walk())o.type==="text"&&o.attributes.content&&e.push(o.attributes.content),o.type==="s"&&(t=!0);const r=e.join(" ").trim(),i=r.match(c8);if(i)return{label:i[1].trim(),estimate:!0};const s=r.match(u8);return s?{label:s[1].trim(),estimate:!0}:t?{label:r,estimate:!0}:{label:r,estimate:!1}}const d8=et({attributes:{description:{type:String,required:!1,description:"Line item description"},amount:{type:String,required:!1,description:"Line item amount"}},contentModel:{type:"sequence",fields:[]},transform(n,e){const t=new wn("span",{},[e.description??""]),r=new wn("span",{},[e.amount??""]);return Ne({rune:"budget-line-item",tag:"li",properties:{description:t,amount:r},children:[t,r]})}});function h8(n){const e=[];for(const t of n)if(t.type==="list")for(const r of t.children){const i=[];for(const a of r.walk())a.type==="text"&&a.attributes.content&&i.push(a.attributes.content);const s=i.join(" ").trim(),o=s.match(s8);o?e.push(new fg.Node("tag",{description:o[1].trim(),amount:o[2].trim()},[],"budget-line-item")):e.push(new fg.Node("tag",{description:s,amount:""},[],"budget-line-item"))}else e.push(t);return e}function p8(n){let e=0;for(const t of n)t.type==="tag"&&t.tag==="budget-line-item"&&t.attributes.amount&&(e+=o8(t.attributes.amount));return e}const m8=et({attributes:{label:{type:String,required:!0},estimate:{type:Boolean,required:!1}},contentModel:{type:"custom",processChildren:h8,description:'Converts list items into budget-line-item tags with "Description: $Amount" pattern.'},transform(n,e,t){const r=ct(n.children),i=p8(r),s=new Fe(B.transform(r,t)),o=new wn("meta",{content:e.label??""}),a=new wn("meta",{content:e.estimate?"estimate":"false"}),l=new wn("meta",{content:String(i)}),c=s.tag("li").typeof("BudgetLineItem"),u=new wn("ul",{},c.toArray());return Ne({rune:"budget-category",tag:"div",properties:{label:o,estimate:a,lineItem:c,subtotal:l},refs:{"line-items":u},children:[o,a,l,u]})}}),g8=["detailed","summary"];function O8(n){const e=n,t=e.reduce((l,c,u)=>(c.type==="heading"&&l.push({idx:u,level:c.attributes.level}),l),[]);let r=[],i=e;t.length>=2&&t[0].level<t[1].level&&(r=e.slice(0,t[1].idx),i=e.slice(t[1].idx));const s=Pv()(i),o=s.length-1;if(!s[o]||s[o].type!=="list")return n;const a=s[o].children.map(l=>{const c=l.children[0],{label:u,estimate:f}=f8(c);return new fg.Node("tag",{label:u,estimate:f},l.children.slice(1),"budget-category")});return s.splice(o,1,...a),[...r,...s]}const v8=et({attributes:{currency:{type:String,required:!1,description:"Currency symbol or code (e.g. USD, EUR)"},duration:{type:String,required:!1,description:'Budget duration for per-day calculations (e.g. "5 days", "1 month")'},showPerDay:{type:Boolean,required:!1,description:"Show per-day cost breakdown"},variant:{type:String,required:!1,matches:g8.slice(),description:"Display style: detailed line items or summary"}},contentModel:{type:"custom",processChildren:O8,description:'Converts headings into budget-category tags with estimate parsing, where list items become budget-line-items with "Description: $Amount" pattern.'},transform(n,e,t){const r=ct(n.children),i=[],s=[];for(const L of r)L.type==="tag"?s.push(L):(L.type==="paragraph"||L.type==="heading")&&i.push(L);const o=new Fe(B.transform(i,t)),a=new Fe(B.transform(s,t)),l=eu(o),c=e.currency??"USD",u=e.duration??"",f=e.showPerDay??!0,d=e.variant??"detailed",h=a8[c.toUpperCase()]||c+" ",m=new wn("meta",{content:c}),p=new wn("meta",{content:u}),O=new wn("meta",{content:String(f)}),v=new wn("meta",{content:d}),b=a.tag("div").typeof("BudgetCategory"),_=b.toArray();let C=0;for(const L of _){if(!B.Tag.isTag(L))continue;const P=D0(L,"label"),q=parseFloat(D0(L,"subtotal"))||0;C+=q;const R=new wn("div",{class:"rf-budget-category__header"},[new wn("span",{class:"rf-budget-category__label"},[P]),new wn("span",{class:"rf-budget-category__subtotal"},[_p(q,h)])]);L.children=[R,...L.children]}const w=new wn("div",{},_),y=u?l8(u):0,S=!!u&&f&&y>0,A=S?C/y:0,x=[new wn("div",{class:"rf-budget__total"},[new wn("span",{class:"rf-budget__total-label"},["Total"]),new wn("span",{class:"rf-budget__total-amount"},[_p(C,h)])])];S&&x.push(new wn("div",{class:"rf-budget__per-day"},[new wn("span",{class:"rf-budget__per-day-label"},["Per day"]),new wn("span",{class:"rf-budget__per-day-amount"},[_p(A,h)])]));const k=new wn("div",{class:"rf-budget__footer"},x),E=new wn("meta",{content:String(C)}),T=new wn("meta",{content:String(A)}),$=[m,p,O,v,...o.toArray(),w,k];return Ne({rune:"budget",schemaOrgType:"ItemList",tag:"section",property:"contentSection",properties:{currency:m,duration:p,showPerDay:O,variant:v,category:b,total:E,...S?{perDay:T}:{}},refs:{...l,categories:w},children:$})}}),{Tag:ns}=B,b8=["side-by-side","stacked"],y8=et({attributes:{layout:{type:String,required:!1,matches:b8.slice(),description:"Display panels side-by-side or stacked"},labels:{type:String,required:!1,description:"Comma-separated custom labels for each panel"},title:{type:String,required:!1,description:"Optional title displayed above the panels"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.layout??"side-by-side",s=e.labels??"",o=e.title??"",a=new ns("meta",{content:i}),l=[],c=s?s.split(",").map(m=>m.trim()):[];let u=0;for(const m of r.toArray()){let p;if(ns.isTag(m)&&m.name==="pre")p=m;else if(ns.isTag(m)&&m.name==="div"&&m.attributes.class==="rf-codeblock"){const O=m.children.find(v=>ns.isTag(v)&&v.name==="pre");O&&(p=O)}if(p&&ns.isTag(p)){const O=c[u]||p.attributes["data-language"]||`Panel ${u+1}`,v=new ns("span",{"data-label":!0},[O]);l.push(new ns("div",{"data-panel":!0},[v,m])),u++}}const f=new ns("div",{"data-panels":!0},l),d=o?[new ns("div",{"data-name":"header"},[o])]:[],h=Ne({rune:"compare",tag:"div",properties:{layout:a},refs:{panels:f},children:[a,...d,f]});return h.attributes["data-code-host"]=!0,h}}),{Tag:rs}=B,w8=et({attributes:{sortable:{type:String,required:!1,description:'Column names to enable sorting, or "all"'},searchable:{type:Boolean,required:!1,description:"Show a search input to filter rows"},pageSize:{type:Number,required:!1,description:"Rows per page; 0 disables pagination"},defaultSort:{type:String,required:!1,description:"Column to sort by initially"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=new rs("meta",{content:e.sortable??""}),s=new rs("meta",{content:String(e.searchable??!1)}),o=new rs("meta",{content:String(e.pageSize??0)}),a=new rs("meta",{content:e.defaultSort??""});let l;const c=r.tag("table");if(c.count()>0)l=c.next();else{const u=r.toArray().find(d=>rs.isTag(d)&&d.name==="div"&&d.attributes.class==="rf-table-wrapper"),f=u&&rs.isTag(u)?u.children.find(d=>rs.isTag(d)&&d.name==="table"):void 0;l=f&&rs.isTag(f)?f:new rs("table",{},[])}return Ne({rune:"data-table",schemaOrgType:"Dataset",tag:"div",properties:{sortable:i,searchable:s,pageSize:o,defaultSort:a},refs:{table:l},children:[i,s,o,a,l]})}}),{Tag:Pn}=B,_8=["unified","split","inline"];function k8(n,e){const t=n.split(`
|
|
296
296
|
`),r=e.split(`
|
|
297
297
|
`),i=t.length,s=r.length,o=Array.from({length:i+1},()=>new Array(s+1).fill(0));for(let u=1;u<=i;u++)for(let f=1;f<=s;f++)o[u][f]=t[u-1]===r[f-1]?o[u-1][f-1]+1:Math.max(o[u-1][f],o[u][f-1]);let a=i,l=s;const c=[];for(;a>0||l>0;)a>0&&l>0&&t[a-1]===r[l-1]?(c.push({type:"equal",text:t[a-1]}),a--,l--):l>0&&(a===0||o[a][l-1]>=o[a-1][l])?(c.push({type:"add",text:r[l-1]}),l--):(c.push({type:"remove",text:t[a-1]}),a--);return c.reverse(),c}function x8(n){const e=[],t=[];let r=1,i=1,s=0;for(;s<n.length;)if(n[s].type==="equal")e.push({hunk:n[s],num:r++}),t.push({hunk:n[s],num:i++}),s++;else{const o=[],a=[];for(;s<n.length&&n[s].type==="remove";)o.push(n[s]),s++;for(;s<n.length&&n[s].type==="add";)a.push(n[s]),s++;const l=Math.max(o.length,a.length);for(let c=0;c<l;c++)e.push(c<o.length?{hunk:o[c],num:r++}:null),t.push(c<a.length?{hunk:a[c],num:i++}:null)}return{before:e,after:t}}function S8(n){const e=[];let t=1,r=1;for(const i of n)i.type==="equal"?(e.push({hunk:i,beforeNum:t,afterNum:r}),t++,r++):i.type==="remove"?(e.push({hunk:i,beforeNum:t,afterNum:null}),t++):i.type==="add"&&(e.push({hunk:i,beforeNum:null,afterNum:r}),r++);return e}function A8(n,e,t=0,r=0){const s=S8(n).map(({hunk:o,beforeNum:a,afterNum:l})=>new Pn("span",{"data-name":"line","data-line-status":o.type},[new Pn("span",{"data-name":"gutter-num","data-side":"before"},[a!=null?String(a+t):""]),new Pn("span",{"data-name":"gutter-num","data-side":"after"},[l!=null?String(l+r):""]),new Pn("span",{"data-name":"line-content",...e?{"data-language":e}:{}},[o.text])]));return[new Pn("pre",{"data-name":"code","data-copy-selector":'[data-name="line-content"]'},[new Pn("div",{"data-name":"rows"},s)])]}function C8(n,e,t=0,r=0){const{before:i,after:s}=x8(n);function o(a,l,c){return a.map(u=>{const f=u?u.hunk.type:"empty";return new Pn("span",{"data-name":"line","data-line-status":f},[new Pn("span",{"data-name":"gutter-num","data-side":l},[u?String(u.num+c):""]),new Pn("span",{"data-name":"line-content",...u&&e?{"data-language":e}:{}},[u?u.hunk.text:""])])})}return[new Pn("div",{"data-name":"split-container"},[new Pn("div",{"data-name":"panel"},[new Pn("pre",{"data-name":"code","data-copy-selector":'[data-name="line-content"]'},[new Pn("div",{"data-name":"rows"},o(i,"before",t))])]),new Pn("div",{"data-name":"panel"},[new Pn("pre",{"data-name":"code","data-copy-selector":'[data-name="line-content"]'},[new Pn("div",{"data-name":"rows"},o(s,"after",r))])])])]}function R0(n){if(typeof n!="string"||n.length===0)return 0;const e=/^(\d+)/.exec(n.trim());if(!e)return 0;const t=Number(e[1]);return Number.isFinite(t)&&t>0?t-1:0}function T8(n,e,t){if(n)return[new Pn("div",{"data-name":"header"},[n])];if(e&&t)return e===t?[new Pn("div",{"data-name":"header"},[e])]:[new Pn("div",{"data-name":"header"},[`${e} → ${t}`])];const r=e||t;return r?[new Pn("div",{"data-name":"header"},[r])]:[]}const P8=et({attributes:{mode:{type:String,required:!1,matches:_8.slice(),description:"Diff display style: unified, split, or inline"},language:{type:String,required:!1,description:"Programming language for syntax highlighting"},title:{type:String,required:!1,description:"Optional title or filename displayed above the diff"}},contentModel:{type:"sequence",fields:[{name:"fences",match:"fence",greedy:!0}]},transform(n,e){const t=e.mode??"unified",r=e.language??"",i=e.title??"",s=new Pn("meta",{content:t}),o=new Pn("meta",{content:r}),a=ct(n.fences),l=a.length>0?(a[0].attributes.content||"").replace(/\n$/,""):"",c=a.length>1?(a[1].attributes.content||"").replace(/\n$/,""):"",u=r||a.length>0&&a[0].attributes.language||"",f=a.length>0&&typeof a[0].attributes.source=="string"?a[0].attributes.source:void 0,d=a.length>1&&typeof a[1].attributes.source=="string"?a[1].attributes.source:void 0,h=a.length>0?R0(a[0].attributes.lines):0,m=a.length>1?R0(a[1].attributes.lines):0,p=k8(l,c),O=t==="split"?C8(p,u,h,m):A8(p,u,h,m),v=T8(i,f,d),b=Ne({rune:"diff",tag:"div",properties:{mode:s,language:o},children:[s,o,...v,...O]});return b.attributes["data-code-host"]=!0,b}}),{Tag:kp}=B,E8=["bar","line","pie","area"];function $8(n){for(const e of n)if(B.Tag.isTag(e)){if(e.name==="table")return e;if(e.name==="div"){const t=e.children.find(r=>B.Tag.isTag(r)&&r.name==="table");if(t&&B.Tag.isTag(t))return t}}}const Q8=et({attributes:{type:{type:String,required:!1,matches:E8.slice(),description:"Chart visualization type"},title:{type:String,required:!1,description:"Title displayed above the chart"},stacked:{type:Boolean,required:!1,description:"Stack data series instead of grouping"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=B.transform(ct(n.body),t),i=e.type??"bar",s=e.title??"",o=e.stacked??!1,a=$8(r),l=a?[a]:r;a&&(a.attributes["data-name"]="data",s&&(a.children=[new kp("caption",{},[s]),...a.children]));const c=new kp("meta",{content:i}),u=new kp("meta",{content:String(o)}),f=Ne({rune:"chart",tag:"figure",properties:{type:c,stacked:u},children:l});return f.name="rf-chart",f}}),{Tag:ia}=B,L8=["mermaid","plantuml","ascii"],M8=et({attributes:{language:{type:String,required:!1,matches:L8.slice(),description:"Diagram language: mermaid, plantuml, or ascii"},title:{type:String,required:!1,description:"Title displayed above the diagram"}},contentModel:{type:"sequence",fields:[{name:"source",match:"fence"}]},transform(n,e){const t=e.language??"mermaid",r=e.title??"",s=ct(n.source)[0]?.attributes?.content||"",o=new ia("meta",{content:t}),a=[];let l;r&&(l=new ia("figcaption",{},[r]),a.push(l));let c;const u=[];s&&(c=new ia("pre",{},[new ia("code",{},[s])]),u.push(c));const f=new ia("div",{},u);a.push(f),s&&a.push(new ia("template",{"data-content":"source"},[s]));const d=Ne({rune:"diagram",tag:"figure",properties:{language:o},refs:{...l?{title:l}:{},container:f,...c?{source:c}:{}},children:a});return d.name="rf-diagram",d}}),{Tag:q8}=B,D8=["sidenote","footnote","tooltip"],R8=et({attributes:{variant:{type:String,required:!1,matches:D8.slice(),description:"Display style: sidenote, footnote, or tooltip"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new q8("meta",{content:e.variant??"sidenote"}),s=new Fe(B.transform(ct(n.body),t)).wrap("div");return Ne({rune:"sidenote",tag:"aside",properties:{variant:r},refs:{body:s},children:[r,s.next()]})}}),{Ast:Iu,Tag:I0}=B,I8=et({attributes:{speaker:{type:String,required:!1},align:{type:String,required:!1,matches:["left","right"]}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new I0("span",{},[e.speaker??""]),i=new I0("meta",{content:e.align??"left"}),s=new Fe(B.transform(ct(n.body),t)).wrap("div");return Ne({rune:"conversation-message",tag:"div",properties:{speaker:r,align:i},refs:{body:s.tag("div")},children:[r,i,s.next()]})}});function N8(n,e){const t=e.speakers?String(e.speakers).split(",").map(s=>s.trim()):[],r=[];let i=0;for(const s of n)if(s.type==="blockquote"){let o="";const a=[...s.children],l=a.length>0&&a[0].type==="paragraph"?a[0]:null,c=l&&l.children[0]?.type==="inline"?l.children[0]:l;if(c){const f=c.children[0];f&&f.type==="strong"&&(o=Array.from(f.walk()).filter(h=>h.type==="text").map(h=>h.attributes.content).join("").replace(/:\s*$/,""))}if(!o&&t.length>0&&(o=t[i%t.length],c)){const f=new Iu.Node("strong",{},[new Iu.Node("text",{content:`${o}:`},[])]),d=new Iu.Node("text",{content:" "},[]);c.children=[f,d,...c.children]}const u=i%2===0?"left":"right";r.push(new Iu.Node("tag",{speaker:o,align:u},s.children,"conversation-message")),i++}else r.push(s);return r}const B8=et({attributes:{speakers:{type:String,required:!1,description:"Comma-separated speaker names for alternating messages"}},contentModel:{type:"custom",processChildren:(n,e)=>N8(n,e),description:"Converts blockquotes to conversation messages with alternating left/right alignment. Extracts speaker name from bold text in first paragraph, falls back to speakers list."},transform(n,e,t){const i=new Fe(B.transform(ct(n.children),t)).tag("div").typeof("ConversationMessage"),s=i.wrap("div");return Ne({rune:"conversation",tag:"div",properties:{message:i},refs:{messages:s},children:[s.next()]})}}),{Tag:wC}=B,j8=["click","scroll","auto"],z8=et({attributes:{name:{type:String,required:!0}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new wC("span",{},[e.name??""]),i=new Fe(B.transform(ct(n.body),t)).wrap("div");return Ne({rune:"reveal-step",tag:"div",properties:{name:r},refs:{body:i.tag("div")},children:[r,i.next()]})}}),Z8=et({attributes:{mode:{type:String,required:!1,matches:j8.slice(),description:"Step progression: click, scroll, or auto"}},contentModel:()=>({type:"sections",sectionHeading:"heading",emitTag:"reveal-step",emitAttributes:{name:"$heading"},fields:[{name:"header",match:"heading|paragraph",optional:!0,greedy:!0},{name:"items",match:"tag",optional:!0,greedy:!0}],sectionModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]}}),transform(n,e,t){const r=new Fe(B.transform(ct(n.header),t)),i=[...ct(n.items),...ct(n.sections)],s=new Fe(B.transform(i,t)),o=new wC("meta",{content:e.mode??"click"}),a=s.tag("div").typeof("RevealStep"),l=a.wrap("div"),c=r.count()>0?[r.wrap("header").next(),o,l.next()]:[o,l.next()];return Ne({rune:"reveal",tag:"section",property:"contentSection",properties:{step:a},refs:{...eu(r),steps:l},children:c})}}),{Tag:Pl}=B,F8=["slider","toggle","fade","auto"],X8=["horizontal","vertical"],V8=et({attributes:{variant:{type:String,required:!1,matches:F8.slice(),description:"Interaction mode: slider, toggle, fade, or auto"},orientation:{type:String,required:!1,matches:X8.slice(),description:"Divider axis for slider/auto variants (horizontal or vertical)"},position:{type:Number,required:!1,description:"Initial slider position as a percentage (0-100)"},duration:{type:Number,required:!1,description:"Animation duration in milliseconds (fade/auto variants)"},labels:{type:String,required:!1,description:"Comma-separated custom labels for the two panels"}},contentModel:{type:"delimited",delimiter:"hr",dynamicZones:!0,zoneModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]}},transform(n,e,t){const r=n.zones??[],i=e.labels?e.labels.split(",").map(d=>d.trim()):[],s=r.map((d,h)=>{const p=new Fe(x6(B.transform(ct(d.body),t))).wrap("div"),O=i[h],v=O?new Pl("span",{},[O]):void 0;return Ne({rune:"juxtapose-panel",tag:"div",properties:{},refs:{...v?{name:v}:{},body:p.tag("div")},children:[...v?[v]:[],p.next()]})}),o=new Fe(s).tag("div").typeof("JuxtaposePanel"),a=o.wrap("div"),l=new Pl("meta",{content:e.variant??"slider"}),c=new Pl("meta",{content:e.orientation??"vertical"}),u=new Pl("meta",{content:String(e.position??50)}),f=new Pl("meta",{content:String(e.duration??1e3)});return Ne({rune:"juxtapose",tag:"section",properties:{panel:o,variant:l,orientation:c,position:u,duration:f},refs:{panels:a},children:[l,c,u,f,a.next()]})}}),{Tag:W8}=B,Y8=et({contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)).wrap("div");return Ne({rune:"annotate-note",tag:"aside",properties:{},refs:{body:r.tag("div")},children:[r.next()]})}}),U8=["margin","tooltip","inline"],G8=et({attributes:{variant:{type:String,required:!1,matches:U8.slice(),description:"Annotation display style: margin, tooltip, or inline"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=new W8("meta",{content:e.variant??"margin"}),s=r.tag("aside").typeof("AnnotateNote"),o=r.wrap("div");return Ne({rune:"annotate",tag:"div",properties:{note:s,variant:i},refs:{body:o.tag("div")},children:[i,o.next()]})}}),{Ast:co,Tag:rn}=B,H8=["stacked","inline","compact"],K8=["GET","POST"],J8=[[["email","e-mail"],"email"],[["phone","telephone","mobile","cell"],"tel"],[["website","url","homepage","link"],"url"],[["date","birthday","dob"],"date"],[["number","amount","quantity","age","count"],"number"],[["password","pin","passcode"],"password"],[["message","comments","description","feedback","notes","bio","about"],"textarea"],[["file","upload","attachment","resume","document","cv"],"file"]];function e9(n){const e=n.toLowerCase();for(const[t,r]of J8)if(t.some(i=>e.includes(i)))return r;return"text"}function t9(n){const e=n.match(/^(.+?)\s*\(([^)]+)\)\s*$/);if(!e)return{name:n.trim(),optional:!1,placeholder:""};const t=e[1].trim(),r=e[2],i=/\boptional\b/i.test(r),s=r.match(/placeholder:\s*["']?([^"',]+)["']?/i),o=s?s[1].trim():"";return{name:t,optional:i,placeholder:o}}function uo(n){return Array.from(n.walk()).filter(e=>e.type==="text").map(e=>e.attributes.content).join("")}function n9(n){if(n.type!=="paragraph")return!1;const e=Array.from(n.walk());if(!e.some(s=>s.type==="strong"))return!1;const r=e.filter(s=>s.type==="text").map(s=>s.attributes.content).join(""),i=e.filter(s=>s.type==="strong").flatMap(s=>Array.from(s.walk()).filter(o=>o.type==="text")).map(s=>s.attributes.content).join("");return r.trim()===i.trim()&&r.trim().length>0}function r9(n){const e=/\(multiple\)/i.test(n)||/select all/i.test(n),t=/\(radio\)/i.test(n),r=/\(optional\)/i.test(n);return{label:n.replace(/\s*\(multiple\)/gi,"").replace(/\s*\(radio\)/gi,"").replace(/\s*\(optional\)/gi,"").trim(),multiple:e,radio:t,optional:r}}const i9=et({attributes:{name:{type:String,required:!1},fieldType:{type:String,required:!1},required:{type:Boolean,required:!1},placeholder:{type:String,required:!1},options:{type:String,required:!1}},contentModel:{type:"sequence",fields:[]},transform(n,e){const t=e.name??"",r=e.fieldType??"text",i=e.required??!0,s=e.placeholder??"",o=e.options??"",a=`field-${t.toLowerCase().replace(/\s+/g,"-")}`,l=o?o.split(",").map(m=>m.trim()).filter(Boolean):[];if(r==="submit")return new rn("button",{type:"submit","data-name":"submit"},[t]);if(r==="separator")return new rn("hr",{"data-name":"separator"},[]);if(r==="help")return new rn("p",{"data-name":"help"},[t]);if(r==="description")return new rn("p",{"data-name":"text"},[t]);if(r==="group")return new rn("fieldset",{class:"rf-form-fieldset"},[new rn("legend",{},[t])]);if(r==="radio"||r==="checkbox"){const m=[t];i&&m.push(new rn("span",{"data-name":"required","aria-hidden":"true"},["*"]));const p=l.map((v,b)=>new rn("label",{class:"rf-form-choice"},[new rn("input",{type:r,name:a,value:v,...i&&r==="radio"&&b===0?{required:""}:{}},[]),new rn("span",{},[v])])),O=new rn("meta",{"data-field":"field-type",content:r});return new rn("fieldset",{"data-rune":"form-field",class:"rf-form-choice-group"},[O,new rn("legend",{},m),...p])}const c=[t];i&&c.push(new rn("span",{"data-name":"required","aria-hidden":"true"},["*"]));const u=new rn("label",{for:a},c);let f;r==="textarea"?f=new rn("textarea",{id:a,name:a,...s?{placeholder:s}:{},...i?{required:""}:{},rows:"4"},[]):r==="select"?f=new rn("select",{id:a,name:a,...i?{required:""}:{}},[new rn("option",{value:"",disabled:"",selected:""},["Select an option"]),...l.map(m=>new rn("option",{value:m},[m]))]):f=new rn("input",{type:r,id:a,name:a,...s?{placeholder:s}:{},...i?{required:""}:{}},[]);const d=new rn("div",{},[u,f]),h=new rn("meta",{content:r});return Ne({rune:"form-field",tag:"div",properties:{fieldType:h},refs:{body:d},children:[h,d]})}});function s9(n){const e=[];let t=null,r=-1;for(let s=n.length-1;s>=0;s--)if(n9(n[s])){r=s;break}const i=()=>{if(t){const s=uo(t);e.push(new co.Node("tag",{name:s,fieldType:"help",required:!1,placeholder:"",options:""},[],"form-field")),t=null}};for(let s=0;s<n.length;s++){const o=n[s];if(o.type==="heading"){i();const a=uo(o);e.push(new co.Node("tag",{name:a,fieldType:"group",required:!1,placeholder:"",options:""},[],"form-field"))}else if(o.type==="list"&&t){const a=uo(t),l=r9(a),c=[];for(const f of o.children)f.type==="item"&&c.push(uo(f));let u;l.multiple?u="checkbox":l.radio||c.length<=4?u="radio":u="select",e.push(new co.Node("tag",{name:l.label,fieldType:u,required:!l.optional,placeholder:"",options:c.join(",")},[],"form-field")),t=null}else if(o.type==="list"){i();for(const a of o.children)if(a.type==="item"){const l=uo(a),c=t9(l),u=e9(c.name);e.push(new co.Node("tag",{name:c.name,fieldType:u,required:!c.optional,placeholder:c.placeholder,options:""},[],"form-field"))}}else if(o.type==="blockquote")i(),t=o;else if(s===r){i();const a=uo(o);e.push(new co.Node("tag",{name:a,fieldType:"submit",required:!1,placeholder:"",options:""},[],"form-field"))}else if(o.type==="hr")i(),e.push(new co.Node("tag",{name:"",fieldType:"separator",required:!1,placeholder:"",options:""},[],"form-field"));else if(o.type==="paragraph"){i();const a=uo(o);e.push(new co.Node("tag",{name:a,fieldType:"description",required:!1,placeholder:"",options:""},[],"form-field"))}else i(),e.push(o)}return i(),e}const o9=et({attributes:{action:{type:String,required:!0,description:"URL the form submits to"},method:{type:String,required:!1,matches:K8.slice(),description:"HTTP method for form submission"},success:{type:String,required:!1,description:"Message shown after successful submission"},error:{type:String,required:!1,description:"Message shown when submission fails"},variant:{type:String,required:!1,matches:H8.slice(),description:"Form layout style"},name:{type:String,required:!1,description:"Form name for identification"},honeypot:{type:Boolean,required:!1,description:"Include a hidden field to prevent spam"}},contentModel:{type:"custom",processChildren:n=>s9(n),description:"Multi-pass form field parser with type inference and selection detection. Converts lists to text inputs, blockquote + list to selection fields, headings to fieldsets, bold paragraphs to submit buttons, and blockquotes to help text."},transform(n,e,t){const r=new Fe(B.transform(ct(n.children),t)),i=new rn("meta",{content:e.action??""}),s=new rn("meta",{content:e.method??"POST"}),o=new rn("meta",{content:e.success??""}),a=new rn("meta",{content:e.error??""}),l=new rn("meta",{content:e.variant??"stacked"}),c=new rn("meta",{content:String(e.honeypot??!0)}),u=r.tag("div").typeof("FormField"),f=r.wrap("div");return Ne({rune:"form",tag:"form",properties:{action:i,method:s,success:o,error:a,variant:l,honeypot:c,field:u},refs:{body:f},children:[i,s,o,a,l,c,f.next()]})}}),a9={".html":"html",".css":"css",".js":"js",".svg":"svg",".glsl-vert":"glsl-vert",".glsl-frag":"glsl-frag"};function l9(n,e){return n.endsWith("/")?n+e:n+"/"+e}function c9(n){if(n.endsWith(".glsl-vert"))return"glsl-vert";if(n.endsWith(".glsl-frag"))return"glsl-frag";const e=n.lastIndexOf(".");if(e===-1)return null;const t=n.slice(e);return a9[t]??null}function u9(n,e,t,r,i){const s=[],o=[];if(i&&!i(n))return{content:"",panels:[],errors:[`Sandbox src directory not found: "${e}"`],warnings:[]};const a=r(n);if(a.length===0)return{content:"",panels:[],errors:[],warnings:[`Sandbox src directory "${e}" contains no .html, .css, or .js files`]};const l=[];for(const x of a.sort()){const k=c9(x);if(!k)continue;const E=t(l9(n,x));E!=null&&l.push({name:x,role:k,content:E})}if(l.length===0)return{content:"",panels:[],errors:[],warnings:[`Sandbox src directory "${e}" contains no .html, .css, or .js files`]};const c=new Map;for(const x of l){const k=c.get(x.role)??[];k.push(x),c.set(x.role,k)}const u=c.get("html")??[];let f;u.length>1?(f=u.find(x=>x.name==="index.html")??u[0],o.push(`Sandbox src "${e}" has multiple .html files — using ${f.name}`)):u.length===1?f=u[0]:o.push(`Sandbox src "${e}" has no .html file — body will be empty`);const d=c.get("css")??[],h=d.map(x=>x.content).join(`
|
|
298
298
|
`),m=c.get("js")??[];let p=m.map(x=>x.content).join(`
|
|
@@ -323,19 +323,19 @@ ${u}
|
|
|
323
323
|
`),i=n.lines[0]+1,s=n.lines[n.lines.length-1]-1;return r.slice(i,s).join(`
|
|
324
324
|
`).trim()}return""}const d9=et({attributes:{src:{type:String,required:!1,description:"Directory containing external source files"},framework:{type:String,required:!1,description:"JavaScript framework for the sandbox"},dependencies:{type:String,required:!1,description:"Comma-separated npm packages to include"},label:{type:String,required:!1,description:"Label displayed above the sandbox"},height:{type:Number,required:!1,description:"Height of the sandbox iframe in pixels"},context:{type:String,required:!1,description:"Shared context scope for multiple sandboxes"}},contentModel:{type:"sequence",fields:[]},transform(n,e,t,r){const i=e.src??"",s=e.framework??"",o=e.dependencies??"",a=e.label??"",l=e.height;let c="",u=[];const f=t.variables?.__sandboxReadFile,d=t.variables?.__sandboxListDir,h=t.variables?.__sandboxDirExists,m=t.variables?.__sandboxExamplesDir;if(i&&f&&d&&m){const w=m.endsWith("/")?m+i:m+"/"+i,y=u9(w,i,f,d,h);y.errors.length>0?(c=`<div data-source="HTML"><pre style="color:red;padding:1rem">${y.errors.join(`
|
|
325
325
|
`)}</pre></div>`,u=[]):(c=y.content,u=y.panels.map(A=>({label:A.label,language:A.language,content:A.content,origin:A.origin})));const S=z0(r,t);S&&(c=f9(c,S),u=j0(c))}else c=z0(r,t),u=j0(c);const p=t.variables?.__securityPolicy??{trust:"trusted",allowJs:!0,sandboxOrigin:void 0},O=Fz(c,p),v=O?new Nu("pre",{"data-language":"html"},[new Nu("code",{"data-language":"html"},[O])]):void 0,b=u.filter(w=>w.origin).map(w=>`${w.label} ${w.origin}`),_=[];v&&_.push(new Nu("template",{"data-content":"fallback"},[v])),_.push(new Nu("template",{"data-content":"source"},[O]));const C=Ne({rune:"sandbox",tag:"div",children:_});return C.name="rf-sandbox",Object.assign(C.attributes,{"data-source-content":O,...s?{"data-framework":s}:{},...o?{"data-dependencies":o}:{},...a?{"data-label":a}:{},"data-height":l!=null?String(l):"auto",...b.length>0?{"data-source-origins":b.join(`
|
|
326
|
-
`)}:{},"data-security-mode":p.trust,"data-allow-js":p.allowJs?"true":"false",...p.sandboxOrigin?{"data-sandbox-origin":p.sandboxOrigin}:{}}),C}}),{Tag:Sp}=B;function h9(n,e){const t=n.match(/^<svg\s([^>]*)>/);if(!t)return new Sp("span",{class:"rf-icon","data-icon":e});const i={...Z0(t[1]),class:"rf-icon","data-icon":e},s=[],o=["path","circle","line","polyline","rect","polygon","ellipse"],a=new RegExp(`<(${o.join("|")})\\s([^>]*?)\\s*/?>`,"g");let l;for(;(l=a.exec(n))!==null;){const c=l[1],u=Z0(l[2]);s.push(new Sp(c,u))}return new Sp("svg",i,s)}function Z0(n){const e={},t=/([\w-]+)="([^"]*)"/g;let r;for(;(r=t.exec(n))!==null;)e[r[1]]=r[2];return e}const{Tag:p9}=B,m9={selfClosing:!0,attributes:{name:{type:String,required:!0,description:'Icon name, optionally prefixed with group (e.g., "rocket" or "hint/warning")'},size:{type:String,required:!1,description:"CSS size override for the icon"}},transform(n,e){const t=n.attributes.name,r=n.attributes.size;let i="global",s=t;const o=t.indexOf("/");o!==-1&&(i=t.substring(0,o),s=t.substring(o+1));const l=e.variables?.__icons?.[i]?.[s];if(l){const u=h9(l,t);return r&&(u.attributes.width=r,u.attributes.height=r),u}const c={class:"rf-icon","data-icon":t};return r&&(c.style=`width:${r};height:${r}`),new p9("span",c)}},{Tag:F0}=B,g9=["left","center","right"],O9=["default","accent","editorial"],v9=et({attributes:{align:{type:String,required:!1,matches:g9.slice(),description:"Text alignment of the quote"},variant:{type:String,required:!1,matches:O9.slice(),description:"Visual style of the quote block"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=new F0("meta",{content:e.align??"center"}),s=new F0("meta",{content:e.variant??"default"}),o=r.tag("blockquote"),l=[...o.count()>0?o.limit(1).toArray():r.tag("p").toArray(),i,s];return Ne({rune:"pull-quote",tag:"blockquote",properties:{align:i,variant:s},children:l})}}),{Tag:Bu}=B,b9=["left","center","right","justify"],y9=et({attributes:{dropcap:{type:Boolean,required:!1,description:"Style the first letter as a large drop cap"},columns:{type:Number,required:!1,description:"Number of text columns"},lead:{type:Boolean,required:!1,description:"Style the first paragraph as a lead"},align:{type:String,required:!1,matches:b9.slice(),description:"Text alignment"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.dropcap??!1,s=e.columns??1,o=e.lead??!1,a=e.align??"left",l=i?new Bu("meta",{content:"dropcap"}):void 0,c=s>1?new Bu("meta",{content:String(s)}):void 0,u=o?new Bu("meta",{content:"lead"}):void 0,f=a!=="left"?new Bu("meta",{content:a}):void 0,d=r.wrap("div"),h=[];return l&&h.push(l),c&&h.push(c),u&&h.push(u),f&&h.push(f),h.push(d.next()),Ne({rune:"text-block",tag:"div",properties:{...l?{dropcap:l}:{},...c?{columns:c}:{},...u?{lead:u}:{},...f?{align:f}:{}},refs:{body:d.tag("div")},children:h})}}),{Tag:El}=B,w9=["left","right"],_9=["1:2","1:1","2:1"],k9=et({attributes:{align:{type:String,required:!1,matches:w9.slice(),description:"Side the media appears on"},ratio:{type:String,required:!1,matches:_9.slice(),description:"Width ratio between media and text"},wrap:{type:Boolean,required:!1,description:"Wrap text around the media"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.align??"left",s=e.ratio??"1:1",o=e.wrap??!1,a=new El("meta",{content:i}),l=new El("meta",{content:s}),c=o?new El("meta",{content:"true"}):void 0,u=[],f=[];for(const p of r.toArray())B.Tag.isTag(p)&&p.name==="p"&&p.children.length===1&&B.Tag.isTag(p.children[0])&&p.children[0].name==="img"?u.push(p.children[0]):B.Tag.isTag(p)&&p.name==="img"?u.push(p):f.push(p);const d=new El("div",{},u),h=new El("div",{},f),m=[a,l];return c&&m.push(c),m.push(d,h),Ne({rune:"media-text",tag:"div",properties:{align:a,ratio:l,...c?{wrap:c}:{}},refs:{media:d,body:h},children:m})}}),{Tag:oa}=B,x9=["background","surface","primary","secondary","accent","border"],S9=/^\s*(\w+)\s*:\s*(.+)\s*$/;function X0(n){const e=[];for(const t of n.walk())t.type==="text"&&t.attributes.content&&e.push(t.attributes.content);return e.join(" ").trim()}function A9(n){const e={},t={};let r="light";for(const i of n){if(i.type==="heading"){const s=X0(i).toLowerCase();s==="dark"?r="dark":s==="light"&&(r="light");continue}if(i.type==="list")for(const s of i.children){const a=X0(s).match(S9);if(a){const l=a[1].toLowerCase(),c=a[2].trim();x9.includes(l)&&(r==="dark"?t[l]=c:e[l]=c)}}}return{light:e,dark:t}}const C9={attributes:{preset:{type:String,required:!1,description:"Named tint preset from the theme"},mode:{type:String,required:!1,matches:["auto","dark","light"],description:"Whether the tint adapts to auto, dark, or light mode"}},transform(n,e){const t=n.transformAttributes(e).preset,r=n.transformAttributes(e).mode,{light:i,dark:s}=A9(n.children),o=[];t?o.push(new oa("meta",{"data-field":"tint",content:t})):(Object.keys(i).length>0||Object.keys(s).length>0)&&o.push(new oa("meta",{"data-field":"tint",content:"custom"})),r&&r!=="auto"&&o.push(new oa("meta",{"data-field":"tint-mode",content:r}));for(const[a,l]of Object.entries(i))o.push(new oa("meta",{"data-field":`tint-${a}`,content:l}));for(const[a,l]of Object.entries(s))o.push(new oa("meta",{"data-field":`tint-dark-${a}`,content:l}));return new oa("div",{"data-tint-source":!0},o)}},{Tag:V0}=B,T9=["none","soft","hard","elevated"],P9=["none","top","bottom","both","end","bottom-end","top-end"],E9={soft:"sm",hard:"md",elevated:"lg"},W0=new Set;function $l(n,e){W0.has(n)||(W0.add(n),console.warn(`[refrakt] showcase \`${n}\` is deprecated (SPEC-086) — use \`${e}\`. The alias will be removed in a future minor.`))}const $9=et({attributes:{shadow:{type:String,required:!1,matches:T9.slice(),description:"Shadow style around the showcase content"},bleed:{type:String,required:!1,matches:P9.slice(),description:"Direction content extends beyond its container"},offset:{type:String,required:!1,description:"CSS offset from the container edge"},aspect:{type:String,required:!1,description:"Aspect ratio of the showcase area"},place:{type:String,required:!1,matches:["left","center","right","top","bottom","top left","top center","top right","bottom left","bottom center","bottom right"],description:"Position of content within the showcase area"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.shadow??"none",s=e.bleed??"none",o=e.offset??"",a=e.aspect??"",l=e.place??"",c={},u=[],f=(h,m)=>{const p=new V0("meta",{content:m});c[h]=p,u.push(p)};i&&i!=="none"&&($l("shadow","frame-shadow"),f("frame-shadow",E9[i]??i)),s&&s!=="none"&&($l("bleed","frame-displace"),f("frame-displace",s)),o&&($l("offset","frame-offset"),f("frame-offset",o)),a&&($l("aspect","frame-aspect"),f("frame-aspect",a)),l&&($l("place","frame-place"),f("frame-place",l));const d=new V0("div",{},r.toArray());return u.push(d),Ne({rune:"showcase",tag:"div",properties:c,refs:{viewport:d},children:u})}}),{Tag:er}=B,Q9={attributes:{preset:{type:String,required:!1,description:"Named background preset from the theme"},src:{type:String,required:!1,description:"URL of the background image"},video:{type:String,required:!1,description:"URL of a background video"},overlay:{type:String,required:!1,description:"Flat wash over the background: none | dark | light | a token name (raw CSS is deprecated)"},"overlay-opacity":{type:String,required:!1,description:"Opacity of a token-coloured overlay wash (0 to 1)"},gradient:{type:String,required:!1,matches:["to-t","to-b","to-l","to-r","to-tr","to-br","to-bl","to-tl"],description:"Gradient direction (token-driven fill)"},from:{type:String,required:!1,description:"Gradient start colour — semantic token name"},to:{type:String,required:!1,description:"Gradient end colour — semantic token name"},via:{type:String,required:!1,description:"Optional middle gradient stop — semantic token name"},"gradient-type":{type:String,required:!1,matches:["linear","radial","conic"],description:"Gradient type: linear (default), radial, conic"},blur:{type:String,required:!1,matches:["none","sm","md","lg"],description:"Blur intensity applied to the background"},position:{type:String,required:!1,description:"CSS background-position value"},fit:{type:String,required:!1,matches:["cover","contain"],description:"How the background image fills its container"},opacity:{type:String,required:!1,description:"Opacity of the background layer (0 to 1)"},fixed:{type:Boolean,required:!1,description:"Fix the background so it stays in place while scrolling"}},transform(n,e){const t=n.transformAttributes(e),r=[];return t.preset&&r.push(new er("meta",{"data-field":"bg-preset",content:t.preset})),t.src&&r.push(new er("meta",{"data-field":"bg-src",content:t.src})),t.video&&r.push(new er("meta",{"data-field":"bg-video",content:t.video})),t.overlay&&t.overlay!=="none"&&r.push(new er("meta",{"data-field":"bg-overlay",content:t.overlay})),t["overlay-opacity"]&&r.push(new er("meta",{"data-field":"bg-overlay-opacity",content:t["overlay-opacity"]})),t.gradient&&r.push(new er("meta",{"data-field":"bg-gradient",content:t.gradient})),t.from&&r.push(new er("meta",{"data-field":"bg-from",content:t.from})),t.to&&r.push(new er("meta",{"data-field":"bg-to",content:t.to})),t.via&&r.push(new er("meta",{"data-field":"bg-via",content:t.via})),t["gradient-type"]&&r.push(new er("meta",{"data-field":"bg-gradient-type",content:t["gradient-type"]})),t.blur&&t.blur!=="none"&&r.push(new er("meta",{"data-field":"bg-blur",content:t.blur})),t.position&&t.position!=="center"&&r.push(new er("meta",{"data-field":"bg-position",content:t.position})),t.fit&&t.fit!=="cover"&&r.push(new er("meta",{"data-field":"bg-fit",content:t.fit})),t.opacity&&t.opacity!=="1"&&r.push(new er("meta",{"data-field":"bg-opacity",content:t.opacity})),t.fixed&&r.push(new er("meta",{"data-field":"bg-fixed",content:"true"})),new er("div",{"data-bg-source":!0},r)}},{Tag:aa}=B,L9=["date-desc","date-asc","title-asc","title-desc"],M9=["list","grid","compact"],q9=et({attributes:{folder:{type:String,required:!0,description:'Content folder path to list blog posts from (e.g. "/blog")'},sort:{type:String,required:!1,default:"date-desc",matches:L9.slice(),description:"Sort order: date-desc, date-asc, title-asc, title-desc"},filter:{type:String,required:!1,default:"",description:'Filter expression to match against frontmatter fields (e.g. "tag:javascript" or "draft:false")'},limit:{type:Number,required:!1,description:"Maximum number of posts to display"},layout:{type:String,required:!1,default:"list",matches:M9.slice(),description:"Display layout: list, grid, or compact"}},contentModel:{type:"sequence",fields:[{name:"headline",match:"heading",optional:!0},{name:"blurb",match:"paragraph",optional:!0}]},transform(n,e,t){const r=[n.headline,n.blurb].filter(Boolean),i=new Fe(B.transform(r,t)),s=new aa("meta",{content:e.folder}),o=new aa("meta",{content:e.sort||"date-desc"}),a=new aa("meta",{content:e.filter||""}),l=new aa("meta",{content:e.limit!=null?String(e.limit):""}),c=new aa("meta",{content:e.layout||"list"}),u=new aa("div",{},[]),f=eu(i),d=i.count()>0?[i.wrap("header").next()]:[],h=[s,o,a,l,c,...d,u];return Ne({rune:"blog",schemaOrgType:"Blog",tag:"section",property:"contentSection",properties:{folder:s,sort:o,filter:a,limit:l,layout:c},refs:{...f,posts:u},children:h})}}),{Tag:D9}=B,$v="xref",R9={selfClosing:!0,inline:!0,attributes:{primary:{type:String,required:!0,description:"Entity ID or name to resolve"},label:{type:String,required:!1,description:"Custom link text (defaults to entity title)"},type:{type:String,required:!1,description:"Entity type hint for disambiguation"},preview:{type:String,required:!1,matches:["drawer"],description:"Preview target. `\"drawer\"` hoists a drawer containing the entity's expanded content + a link to its resolved page URL in the chrome footer, leaving an inline link at the call site that opens it. Absent → today's behaviour (just the inline link). SPEC-078."}},transform(n,e){const t=n.attributes.primary,r=n.attributes.label,i=n.attributes.type,s=n.attributes.preview,o={"data-rune":$v,"data-xref-id":t};return r&&(o["data-xref-label"]=r),i&&(o["data-xref-type"]=i),s&&(o["data-xref-preview"]=s),new D9("span",o,[r||t])}},{Tag:I9}=B,Qv="expand-pending",N9={selfClosing:!0,attributes:{primary:{type:String,required:!0,description:"Entity ID or name to substitute inline. Same lookup chain as xref."},level:{type:Number,required:!1,description:"Optional heading-demotion opt-in. When set, embedded headings shift by `N - 1` and the embed joins the host outline instead of staying TOC-isolated."},type:{type:String,required:!1,description:"Entity type hint for disambiguation when the same ID/name lives in multiple registries."},canonical:{type:Boolean,required:!1,description:`When true, append a visible "View canonical" link pointing at the entity's canonical URL.`},label:{type:String,required:!1,description:"Custom label for the canonical link (only meaningful when `canonical=true`)."}},transform(n,e){const t=n.attributes.primary,r=n.attributes.level,i=n.attributes.type,s=n.attributes.canonical===!0,o=n.attributes.label,a={"data-rune":Qv,"data-expand-id":t};return typeof r=="number"&&(a["data-expand-level"]=String(r)),i&&(a["data-expand-type"]=i),s&&(a["data-expand-canonical"]="true"),o&&(a["data-expand-label"]=o),new I9("div",a,[])}},{Ast:_U}=B,B9="__deferred-body";function Lv(n){const e=n[B9];return typeof e=="string"&&e.length>0?e:void 0}function Mv(n,e,t){const r=B.parse(n),i={...e??{},variables:{...e?.variables??{},...t}},s=B.transform(r,i);return B.Tag.isTag(s)&&s.name==="article"&&!s.attributes?.class&&!s.attributes?.["data-rune"]?s.children:s}const{Tag:Y0}=B,_C="__collection-sentinel",j9=et({attributes:{type:{type:String,required:!1,default:"",description:"Entity type(s), comma-separated."},filter:{type:String,required:!1,default:"",description:"field:value clauses (SPEC-070 grammar)."},sort:{type:String,required:!1,default:"",description:"Sort field (prefix - for descending)."},group:{type:String,required:!1,default:"",description:"Group-by field."},limit:{type:String,required:!1,default:"",description:"Max items."},show:{type:String,required:!1,default:"",description:"Alias for type (entity types to include)."},fields:{type:String,required:!1,default:"",description:"Comma-separated data fields to project."},layout:{type:String,required:!1,default:"list",description:"Arrangement: list (stacked) | grid (multi-column) | table (aligned columns). Item chrome comes from the item — the no-body built-in, or a rune like {% card %} in the body template."},"group-display":{type:String,required:!1,default:"headings",matches:["headings","accordion"],description:"How groups are presented when `group` is set: headings (default) or accordion (collapsible native <details> panels, styled like the accordion rune, with a per-group count)."},empty:{type:String,required:!1,default:"",description:"Fallback text shown when the query yields nothing (no-body form; body-template form uses a fallback zone). Absent → render nothing."}},deferBody:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=(o,a)=>new Y0("meta",{"data-field":o,content:a}),r=Lv(e)??"",i=[t("collection-type",String(e.type??e.show??"")),t("collection-filter",String(e.filter??"")),t("collection-sort",String(e.sort??"")),t("collection-group",String(e.group??"")),t("collection-limit",String(e.limit??"")),t("collection-fields",String(e.fields??"")),t("collection-layout",String(e.layout??"list")),t("collection-group-display",String(e["group-display"]??"headings")),t("collection-empty",String(e.empty??"")),t(_C,"true")];r&&i.push(t("collection-body",r));const s=new Y0("div",{"data-name":"items"},[]);return Ne({rune:"collection",tag:"section",properties:{},refs:{items:s},children:[...i,s]})}}),{Tag:U0}=B,kC="__relationships-sentinel",z9=et({attributes:{of:{type:String,required:!1,default:"",description:"Entity to describe — an id (e.g. `of=$item.id`) or a bound entity."},kind:{type:String,required:!1,default:"",description:'Edge kinds to include, comma-separated (e.g. "blocks,blocked-by").'},type:{type:String,required:!1,default:"",description:"Restrict related entity types, comma-separated."},group:{type:String,required:!1,default:"kind",description:"Group-by: kind (default) | type | none."},"group-display":{type:String,required:!1,default:"headings",matches:["headings","accordion"],description:"How groups are presented: headings (default) or accordion (collapsible native <details> panels, styled like the accordion rune, with a per-group count)."},sort:{type:String,required:!1,default:"",description:"Sort related entities by a field (prefix - for descending)."},limit:{type:String,required:!1,default:"",description:"Max edges."},fields:{type:String,required:!1,default:"",description:"Comma-separated data fields to project in the no-body built-in."},layout:{type:String,required:!1,default:"list",description:"Arrangement: list (stacked) | grid (multi-column). Item chrome comes from the item — the no-body built-in, or a rune like {% card %} in the body template."},empty:{type:String,required:!1,default:"",description:"Fallback text shown when there are no edges (no-body form; body form uses a fallback zone). Absent → render nothing."}},deferBody:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=(l,c)=>new U0("meta",{"data-field":l,content:c}),r=Lv(e)??"",i=e.of,s=String(i&&typeof i=="object"?i.id??"":i??""),o=[t("relationships-of",s),t("relationships-kind",String(e.kind??"")),t("relationships-type",String(e.type??"")),t("relationships-group",String(e.group??"kind")),t("relationships-group-display",String(e["group-display"]??"headings")),t("relationships-sort",String(e.sort??"")),t("relationships-limit",String(e.limit??"")),t("relationships-fields",String(e.fields??"")),t("relationships-layout",String(e.layout??"list")),t("relationships-empty",String(e.empty??"")),t(kC,"true")];r&&o.push(t("relationships-body",r));const a=new U0("div",{"data-name":"items"},[]);return Ne({rune:"relationships",tag:"section",properties:{},refs:{items:a},children:[...o,a]})}}),{Tag:Z9}=B,xC="__aggregate-sentinel",F9=et({attributes:{type:{type:String,required:!1,default:"",description:"Entity type(s), comma-separated."},filter:{type:String,required:!1,default:"",description:"field:value clauses defining the primary set being measured (SPEC-070 grammar)."},value:{type:String,required:!1,default:"",description:'Optional secondary field:value clause defining the achieved subset within `filter` (e.g. value="status:done"). When set, $item.value is the count matching both; $item.percent is the ratio. Without it, the rune is a pure count + breakdown — no progress-bar semantics.'},group:{type:String,required:!1,default:"",description:"Group-by field; omit to render the body once with totals."},sort:{type:String,required:!1,default:"",description:"Sort groups by `key`, `count`, `value`, or `percent` (prefix `-` for descending). Honors SPEC-072 domain-aware ordering when the group field has one."},limit:{type:String,required:!1,default:"",description:"Cap the number of groups (after sort)."},empty:{type:String,required:!1,default:"",description:"Fallback text shown when the query matches no entities (self-closing form; body form uses a fallback zone). Absent → render nothing."},layout:{type:String,required:!1,default:"",matches:["chart"],description:"Render mode. Default: inline integer (no body) or body-zoned template. `chart` draws the grouped counts as an SVG via the `chart` rune's pipeline instead of a body."},"chart-type":{type:String,required:!1,default:"bar",matches:["bar","line","area","pie"],description:'Chart visualization type when layout="chart" (default bar).'},"chart-title":{type:String,required:!1,default:"",description:'Title for the chart (rendered as the data table caption) when layout="chart".'}},deferBody:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=(a,l)=>new Z9("meta",{"data-field":a,content:l}),r=Lv(e)??"",i=r.length>0,s=String(e.layout??""),o=[t("aggregate-type",String(e.type??"")),t("aggregate-filter",String(e.filter??"")),t("aggregate-value",String(e.value??"")),t("aggregate-group",String(e.group??"")),t("aggregate-sort",String(e.sort??"")),t("aggregate-limit",String(e.limit??"")),t("aggregate-empty",String(e.empty??"")),t("aggregate-layout",s),t("aggregate-chart-type",String(e["chart-type"]??"bar")),t("aggregate-chart-title",String(e["chart-title"]??"")),t(xC,"true")];return r&&o.push(t("aggregate-body",r)),Ne({rune:"aggregate",tag:i||s==="chart"?"section":"span",properties:{},children:o})}}),{Tag:G0}=B,SC="__file-ref-sentinel",X9=et({attributes:{path:{type:String,required:!0,description:"Project-root-relative file path. Same sandbox as snippet — absolute paths, traversal escapes, and out-of-root symlinks are rejected."},lines:{type:String,required:!1,description:'Line range. `"42-58"` (range), `"42"` (single line). Drives both the GitHub anchor (#L42-L58) and the drawer-body snippet slice when `preview="drawer"`.'},label:{type:String,required:!1,description:"Display text for the inline link. Defaults to the filename (e.g. `token-contract.ts`). Pass an explicit label when the file-ref refers to a symbol within the file rather than the file itself."},preview:{type:String,required:!1,matches:["drawer"],description:'Preview target. `"drawer"` hoists a drawer with the file\'s snippet + a GitHub footer link, leaving an inline link at the call site that opens it. Absent → no preview, just the inline link.'}},selfClosing:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=String(e.path??""),r=e.lines!==void 0?String(e.lines):"",i=e.label!==void 0?String(e.label):"",s=e.preview!==void 0?String(e.preview):"",o=V9(t),a=(u,f)=>new G0("meta",{"data-field":u,content:f}),l=[a("file-ref-path",t),a("file-ref-lines",r),a("file-ref-label",i),a("file-ref-preview",s),a(SC,"true")],c=new G0("a",{},[i||o]);return Ne({rune:"file-ref",tag:"span",properties:{},refs:{link:c},children:[...l,c]})}});function V9(n){if(!n)return"";const e=n.endsWith("/")?n.slice(0,-1):n,t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}const{Tag:_i}=B,W9=/^h([1-6])$/;function Y9(n,e){const t=n.attributes?.[e];return typeof t=="string"?t:void 0}function U9(n,e,t){for(const r of n){const i=[],s=new Set;dg(r.renderable,o=>{const a=Y9(o,"data-drawer-id");if(!a){t.error("drawer rune is missing required `id` attribute",r.url);return}s.has(a)&&t.warn(`drawer id="${a}" is declared more than once on this page — last declaration wins`,r.url),s.add(a),i.push({id:a,title:G9(o),side:Co(o,"side")??"right",size:Co(o,"size")??"md",shortcut:Co(o,"shortcut")})});for(const o of i)e.register({type:"drawer",id:o.id,scope:"page",sourceUrl:`${r.url}#drawer-${o.id}`,data:{title:o.title,side:o.side,size:o.size,shortcut:o.shortcut}})}}function dg(n,e){if(Array.isArray(n)){for(const r of n)dg(r,e);return}if(!_i.isTag(n))return;const t=n;if(t.attributes?.["data-rune"]==="drawer"){e(t);return}if(t.children)for(const r of t.children)dg(r,e)}function G9(n){const e=AC(n,"title");if(!e)return;const t=hg(e);return t.length>0?t:void 0}function AC(n,e){if(n.attributes?.["data-name"]===e)return n;for(const t of n.children??[])if(_i.isTag(t)){const r=AC(t,e);if(r)return r}}function hg(n){return typeof n=="string"?n:Array.isArray(n)?n.map(hg).join(""):_i.isTag(n)?(n.children??[]).map(hg).join(""):""}function H9(n){const e={lastHeadingLevel:0,mutated:!1},t=pg(n,e);return e.mutated?t:n}function pg(n,e){if(typeof n=="string"||typeof n=="number"||n==null)return n;if(Array.isArray(n)){let a=!1;const l=n.map(c=>{const u=pg(c,e);return u!==c&&(a=!0),u});return a?l:n}if(!_i.isTag(n))return n;const t=n,r=W9.exec(t.name);if(t.attributes?.[cg]==="true"){const a=e.lastHeadingLevel===0?1:e.lastHeadingLevel,l=Math.min(6,Math.max(1,a+1));e.mutated=!0;const c={...t.attributes};return delete c[cg],new _i(`h${l}`,c,t.children)}if(r&&(e.lastHeadingLevel=Number(r[1])),!t.children||t.children.length===0)return t;let s=!1;const o=t.children.map(a=>{const l=pg(a,e);return l!==a&&(s=!0),l});return s?new _i(t.name,t.attributes,o):t}const qv="hoist-drawer",CC=new Map;function TC(n,e){CC.set(n,e)}function K9(n){const e={},t=n.attributes;if(!t)return e;for(const[r,i]of Object.entries(t))r.startsWith("data-")&&typeof i=="string"&&(e[r.slice(5)]=i);return e}function J9(n,e,t,r,i){const s=eZ(n),o=new Map,l={payloads:o,seenIds:new Set,authorIds:s,drawerDepth:0,pageUrl:e,ctx:i,mutated:!1},c=mg(n,l);if(o.size===0)return l.mutated?c:n;const u={pageUrl:e,registry:t,projectRoot:r,ctx:i},f=[];for(const d of o.values()){const h=d.source;if(!h){i.warn(`hoist drawer payload is missing required \`source\` attribute (target-id=${d["target-id"]??"?"})`,e);continue}const m=CC.get(h);if(!m){i.warn(`hoist drawer source "${h}" has no registered builder — skipping target-id=${d["target-id"]??"?"}`,e);continue}const p=m(d,u);p&&f.push(p)}if(f.length===0)return c;if(Array.isArray(c))return[...c,...f];if(_i.isTag(c)){const d=c;return new _i(d.name,d.attributes,[...d.children??[],...f])}return[c,...f]}function eZ(n){const e=new Set,t=r=>{if(Array.isArray(r)){for(const s of r)t(s);return}if(!_i.isTag(r))return;const i=r;if(i.attributes?.["data-rune"]==="drawer"){const s=i.attributes?.["data-drawer-id"];typeof s=="string"&&e.add(s);return}for(const s of i.children??[])t(s)};return t(n),e}function mg(n,e){if(Array.isArray(n)){let o=!1;const a=[];for(const l of n){const c=mg(l,e);c!==l&&(o=!0),c!==Ql&&a.push(c)}return o?(e.mutated=!0,a):n}if(!_i.isTag(n))return n;const t=n;if(t.name==="meta"&&t.attributes?.["data-field"]===qv){const o=K9(t),a=o["target-id"];return a?e.authorIds.has(a)?(e.ctx.info(`Hoist preview "${a}" (source=${o.source??"?"}) collides with an author-declared {% drawer id="${a}" %} on this page — author drawer wins, hoist defers.`,e.pageUrl),Ql):(e.drawerDepth>0&&e.ctx.info(`Hoist preview "${a}" (source=${o.source??"?"}) appears inside another drawer's body — nested previews stack on modern browsers, consider not nesting.`,e.pageUrl),e.seenIds.has(a)||(e.payloads.set(a,o),e.seenIds.add(a)),Ql):(e.ctx.warn("hoist drawer sentinel is missing required `data-target-id` attribute",e.pageUrl),Ql)}const r=t.attributes?.["data-rune"]==="drawer";if(r&&e.drawerDepth++,!t.children||t.children.length===0)return r&&e.drawerDepth--,t;let i=!1;const s=[];for(const o of t.children){const a=mg(o,e);a!==o&&(i=!0),a!==Ql&&s.push(a)}return r&&e.drawerDepth--,i?(e.mutated=!0,new _i(t.name,t.attributes,s)):t}const Ql=Symbol("hoist-strip");function tZ(n,e){const t=n.toLowerCase().replace(/[^a-z0-9.]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");if(!e)return t;const r=e.trim(),i=r.indexOf("-");if(i<0)return`${t}-L${r}`;const s=r.slice(0,i).trim(),o=r.slice(i+1).trim();return o?`${t}-L${s}-L${o}`:`${t}-L${s}`}function nZ(n){return n.split(void 0).join("/")}function PC(n,e){if(typeof n!="string"||n.length===0)throw new rr("snippet `path` attribute is required");(void 0)(n);const r=(void 0)((void 0)(e,n)),i=e.endsWith(void 0)?e:e+void 0;if(!r.startsWith(i)&&r!==e)throw new rr(`snippet path "${n}" escapes the project root after normalization`);try{const s=(void 0)(r);if(!s.startsWith(i)&&s!==e)throw new rr(`snippet path "${n}" resolves through a symlink that escapes the project root`)}catch(s){if(s.code!=="ENOENT")throw s}return r}function rZ(n){if(n==null||n==="")return null;if(typeof n!="string")throw new rr(`snippet \`lines\` attribute must be a string, got ${typeof n}`);const e=n.trim();if(e.length===0)return null;if(/^\d+$/.test(e)){const a=Number(e);if(!Number.isFinite(a)||a<1)throw new rr(`snippet \`lines\` value "${n}" is not a positive integer`);return{start:a,end:a}}const t=/^(\d*)-(\d*)$/.exec(e);if(!t)throw new rr(`snippet \`lines\` value "${n}" is malformed; expected "N", "N-M", "N-", or "-M"`);const r=t[1],i=t[2],s=r.length>0?Number(r):void 0,o=i.length>0?Number(i):void 0;if(s!==void 0&&(!Number.isFinite(s)||s<1))throw new rr(`snippet \`lines\` start "${r}" is not a positive integer`);if(o!==void 0&&(!Number.isFinite(o)||o<1))throw new rr(`snippet \`lines\` end "${i}" is not a positive integer`);if(s!==void 0&&o!==void 0&&o<s)throw new rr(`snippet \`lines\` value "${n}" is inverted (end before start)`);return{start:s,end:o}}function iZ(n,e){if(e===null)return{sliced:n,warnings:[]};const t=n.split(`
|
|
326
|
+
`)}:{},"data-security-mode":p.trust,"data-allow-js":p.allowJs?"true":"false",...p.sandboxOrigin?{"data-sandbox-origin":p.sandboxOrigin}:{}}),C}}),{Tag:Sp}=B;function h9(n,e){const t=n.match(/^<svg\s([^>]*)>/);if(!t)return new Sp("span",{class:"rf-icon","data-icon":e});const i={...Z0(t[1]),class:"rf-icon","data-icon":e},s=[],o=["path","circle","line","polyline","rect","polygon","ellipse"],a=new RegExp(`<(${o.join("|")})\\s([^>]*?)\\s*/?>`,"g");let l;for(;(l=a.exec(n))!==null;){const c=l[1],u=Z0(l[2]);s.push(new Sp(c,u))}return new Sp("svg",i,s)}function Z0(n){const e={},t=/([\w-]+)="([^"]*)"/g;let r;for(;(r=t.exec(n))!==null;)e[r[1]]=r[2];return e}const{Tag:p9}=B,m9={selfClosing:!0,attributes:{name:{type:String,required:!0,description:'Icon name, optionally prefixed with group (e.g., "rocket" or "hint/warning")'},size:{type:String,required:!1,description:"CSS size override for the icon"}},transform(n,e){const t=n.attributes.name,r=n.attributes.size;let i="global",s=t;const o=t.indexOf("/");o!==-1&&(i=t.substring(0,o),s=t.substring(o+1));const l=e.variables?.__icons?.[i]?.[s];if(l){const u=h9(l,t);return r&&(u.attributes.width=r,u.attributes.height=r),u}const c={class:"rf-icon","data-icon":t};return r&&(c.style=`width:${r};height:${r}`),new p9("span",c)}},{Tag:F0}=B,g9=["left","center","right"],O9=["default","accent","editorial"],v9=et({attributes:{align:{type:String,required:!1,matches:g9.slice(),description:"Text alignment of the quote"},variant:{type:String,required:!1,matches:O9.slice(),description:"Visual style of the quote block"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=new F0("meta",{content:e.align??"center"}),s=new F0("meta",{content:e.variant??"default"}),o=r.tag("blockquote"),l=[...o.count()>0?o.limit(1).toArray():r.tag("p").toArray(),i,s];return Ne({rune:"pull-quote",tag:"blockquote",properties:{align:i,variant:s},children:l})}}),{Tag:Bu}=B,b9=["left","center","right","justify"],y9=et({attributes:{dropcap:{type:Boolean,required:!1,description:"Style the first letter as a large drop cap"},columns:{type:Number,required:!1,description:"Number of text columns"},lead:{type:Boolean,required:!1,description:"Style the first paragraph as a lead"},align:{type:String,required:!1,matches:b9.slice(),description:"Text alignment"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.dropcap??!1,s=e.columns??1,o=e.lead??!1,a=e.align??"left",l=i?new Bu("meta",{content:"dropcap"}):void 0,c=s>1?new Bu("meta",{content:String(s)}):void 0,u=o?new Bu("meta",{content:"lead"}):void 0,f=a!=="left"?new Bu("meta",{content:a}):void 0,d=r.wrap("div"),h=[];return l&&h.push(l),c&&h.push(c),u&&h.push(u),f&&h.push(f),h.push(d.next()),Ne({rune:"text-block",tag:"div",properties:{...l?{dropcap:l}:{},...c?{columns:c}:{},...u?{lead:u}:{},...f?{align:f}:{}},refs:{body:d.tag("div")},children:h})}}),{Tag:El}=B,w9=["left","right"],_9=["1:2","1:1","2:1"],k9=et({attributes:{align:{type:String,required:!1,matches:w9.slice(),description:"Side the media appears on"},ratio:{type:String,required:!1,matches:_9.slice(),description:"Width ratio between media and text"},wrap:{type:Boolean,required:!1,description:"Wrap text around the media"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.align??"left",s=e.ratio??"1:1",o=e.wrap??!1,a=new El("meta",{content:i}),l=new El("meta",{content:s}),c=o?new El("meta",{content:"true"}):void 0,u=[],f=[];for(const p of r.toArray())B.Tag.isTag(p)&&p.name==="p"&&p.children.length===1&&B.Tag.isTag(p.children[0])&&p.children[0].name==="img"?u.push(p.children[0]):B.Tag.isTag(p)&&p.name==="img"?u.push(p):f.push(p);const d=new El("div",{},u),h=new El("div",{},f),m=[a,l];return c&&m.push(c),m.push(d,h),Ne({rune:"media-text",tag:"div",properties:{align:a,ratio:l,...c?{wrap:c}:{}},refs:{media:d,body:h},children:m})}}),{Tag:oa}=B,x9=["background","surface","primary","secondary","accent","border"],S9=/^\s*(\w+)\s*:\s*(.+)\s*$/;function X0(n){const e=[];for(const t of n.walk())t.type==="text"&&t.attributes.content&&e.push(t.attributes.content);return e.join(" ").trim()}function A9(n){const e={},t={};let r="light";for(const i of n){if(i.type==="heading"){const s=X0(i).toLowerCase();s==="dark"?r="dark":s==="light"&&(r="light");continue}if(i.type==="list")for(const s of i.children){const a=X0(s).match(S9);if(a){const l=a[1].toLowerCase(),c=a[2].trim();x9.includes(l)&&(r==="dark"?t[l]=c:e[l]=c)}}}return{light:e,dark:t}}const C9={attributes:{preset:{type:String,required:!1,description:"Named tint preset from the theme"},mode:{type:String,required:!1,matches:["auto","dark","light"],description:"Whether the tint adapts to auto, dark, or light mode"}},transform(n,e){const t=n.transformAttributes(e).preset,r=n.transformAttributes(e).mode,{light:i,dark:s}=A9(n.children),o=[];t?o.push(new oa("meta",{"data-field":"tint",content:t})):(Object.keys(i).length>0||Object.keys(s).length>0)&&o.push(new oa("meta",{"data-field":"tint",content:"custom"})),r&&r!=="auto"&&o.push(new oa("meta",{"data-field":"tint-mode",content:r}));for(const[a,l]of Object.entries(i))o.push(new oa("meta",{"data-field":`tint-${a}`,content:l}));for(const[a,l]of Object.entries(s))o.push(new oa("meta",{"data-field":`tint-dark-${a}`,content:l}));return new oa("div",{"data-tint-source":!0},o)}},{Tag:V0}=B,T9=["none","soft","hard","elevated"],P9=["none","top","bottom","both","end","bottom-end","top-end"],E9={soft:"sm",hard:"md",elevated:"lg"},W0=new Set;function $l(n,e){W0.has(n)||(W0.add(n),console.warn(`[refrakt] showcase \`${n}\` is deprecated (SPEC-086) — use \`${e}\`. The alias will be removed in a future minor.`))}const $9=et({attributes:{shadow:{type:String,required:!1,matches:T9.slice(),description:"Shadow style around the showcase content"},bleed:{type:String,required:!1,matches:P9.slice(),description:"Direction content extends beyond its container"},offset:{type:String,required:!1,description:"CSS offset from the container edge"},aspect:{type:String,required:!1,description:"Aspect ratio of the showcase area"},place:{type:String,required:!1,matches:["left","center","right","top","bottom","top left","top center","top right","bottom left","bottom center","bottom right"],description:"Position of content within the showcase area"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Fe(B.transform(ct(n.body),t)),i=e.shadow??"none",s=e.bleed??"none",o=e.offset??"",a=e.aspect??"",l=e.place??"",c={},u=[],f=(h,m)=>{const p=new V0("meta",{content:m});c[h]=p,u.push(p)};i&&i!=="none"&&($l("shadow","frame-shadow"),f("frame-shadow",E9[i]??i)),s&&s!=="none"&&($l("bleed","frame-displace"),f("frame-displace",s)),o&&($l("offset","frame-offset"),f("frame-offset",o)),a&&($l("aspect","frame-aspect"),f("frame-aspect",a)),l&&($l("place","frame-place"),f("frame-place",l));const d=new V0("div",{},r.toArray());return u.push(d),Ne({rune:"showcase",tag:"div",properties:c,refs:{viewport:d},children:u})}}),{Tag:er}=B,Q9={attributes:{preset:{type:String,required:!1,description:"Named background preset from the theme"},src:{type:String,required:!1,description:"URL of the background image"},video:{type:String,required:!1,description:"URL of a background video"},overlay:{type:String,required:!1,description:"Flat wash over the background: none | dark | light | a token name (raw CSS is deprecated)"},"overlay-opacity":{type:String,required:!1,description:"Opacity of a token-coloured overlay wash (0 to 1)"},gradient:{type:String,required:!1,matches:["to-t","to-b","to-l","to-r","to-tr","to-br","to-bl","to-tl"],description:"Gradient direction (token-driven fill)"},from:{type:String,required:!1,description:"Gradient start colour — semantic token name"},to:{type:String,required:!1,description:"Gradient end colour — semantic token name"},via:{type:String,required:!1,description:"Optional middle gradient stop — semantic token name"},"gradient-type":{type:String,required:!1,matches:["linear","radial","conic"],description:"Gradient type: linear (default), radial, conic"},blur:{type:String,required:!1,matches:["none","sm","md","lg"],description:"Blur intensity applied to the background"},position:{type:String,required:!1,description:"CSS background-position value"},fit:{type:String,required:!1,matches:["cover","contain"],description:"How the background image fills its container"},opacity:{type:String,required:!1,description:"Opacity of the background layer (0 to 1)"},fixed:{type:Boolean,required:!1,description:"Fix the background so it stays in place while scrolling"}},transform(n,e){const t=n.transformAttributes(e),r=[];return t.preset&&r.push(new er("meta",{"data-field":"bg-preset",content:t.preset})),t.src&&r.push(new er("meta",{"data-field":"bg-src",content:t.src})),t.video&&r.push(new er("meta",{"data-field":"bg-video",content:t.video})),t.overlay&&t.overlay!=="none"&&r.push(new er("meta",{"data-field":"bg-overlay",content:t.overlay})),t["overlay-opacity"]&&r.push(new er("meta",{"data-field":"bg-overlay-opacity",content:t["overlay-opacity"]})),t.gradient&&r.push(new er("meta",{"data-field":"bg-gradient",content:t.gradient})),t.from&&r.push(new er("meta",{"data-field":"bg-from",content:t.from})),t.to&&r.push(new er("meta",{"data-field":"bg-to",content:t.to})),t.via&&r.push(new er("meta",{"data-field":"bg-via",content:t.via})),t["gradient-type"]&&r.push(new er("meta",{"data-field":"bg-gradient-type",content:t["gradient-type"]})),t.blur&&t.blur!=="none"&&r.push(new er("meta",{"data-field":"bg-blur",content:t.blur})),t.position&&t.position!=="center"&&r.push(new er("meta",{"data-field":"bg-position",content:t.position})),t.fit&&t.fit!=="cover"&&r.push(new er("meta",{"data-field":"bg-fit",content:t.fit})),t.opacity&&t.opacity!=="1"&&r.push(new er("meta",{"data-field":"bg-opacity",content:t.opacity})),t.fixed&&r.push(new er("meta",{"data-field":"bg-fixed",content:"true"})),new er("div",{"data-bg-source":!0},r)}},{Tag:aa}=B,L9=["date-desc","date-asc","title-asc","title-desc"],M9=["list","grid","compact"],q9=et({attributes:{folder:{type:String,required:!0,description:'Content folder path to list blog posts from (e.g. "/blog")'},sort:{type:String,required:!1,default:"date-desc",matches:L9.slice(),description:"Sort order: date-desc, date-asc, title-asc, title-desc"},filter:{type:String,required:!1,default:"",description:'Filter expression to match against frontmatter fields (e.g. "tag:javascript" or "draft:false")'},limit:{type:Number,required:!1,description:"Maximum number of posts to display"},layout:{type:String,required:!1,default:"list",matches:M9.slice(),description:"Display layout: list, grid, or compact"}},contentModel:{type:"sequence",fields:[{name:"headline",match:"heading",optional:!0},{name:"blurb",match:"paragraph",optional:!0}]},transform(n,e,t){const r=[n.headline,n.blurb].filter(Boolean),i=new Fe(B.transform(r,t)),s=new aa("meta",{content:e.folder}),o=new aa("meta",{content:e.sort||"date-desc"}),a=new aa("meta",{content:e.filter||""}),l=new aa("meta",{content:e.limit!=null?String(e.limit):""}),c=new aa("meta",{content:e.layout||"list"}),u=new aa("div",{},[]),f=eu(i),d=i.count()>0?[i.wrap("header").next()]:[],h=[s,o,a,l,c,...d,u];return Ne({rune:"blog",schemaOrgType:"Blog",tag:"section",property:"contentSection",properties:{folder:s,sort:o,filter:a,limit:l,layout:c},refs:{...f,posts:u},children:h})}}),{Tag:D9}=B,$v="xref",R9={selfClosing:!0,inline:!0,attributes:{primary:{type:String,required:!0,description:"Entity ID or name to resolve"},label:{type:String,required:!1,description:"Custom link text (defaults to entity title)"},type:{type:String,required:!1,description:"Entity type hint for disambiguation"},preview:{type:String,required:!1,matches:["drawer"],description:"Preview target. `\"drawer\"` hoists a drawer containing the entity's expanded content + a link to its resolved page URL in the chrome footer, leaving an inline link at the call site that opens it. Absent → today's behaviour (just the inline link). SPEC-078."}},transform(n,e){const t=n.attributes.primary,r=n.attributes.label,i=n.attributes.type,s=n.attributes.preview,o={"data-rune":$v,"data-xref-id":t};return r&&(o["data-xref-label"]=r),i&&(o["data-xref-type"]=i),s&&(o["data-xref-preview"]=s),new D9("span",o,[r||t])}},{Tag:I9}=B,Qv="expand-pending",N9={selfClosing:!0,attributes:{primary:{type:String,required:!0,description:"Entity ID or name to substitute inline. Same lookup chain as xref."},level:{type:Number,required:!1,description:"Optional heading-demotion opt-in. When set, embedded headings shift by `N - 1` and the embed joins the host outline instead of staying TOC-isolated."},type:{type:String,required:!1,description:"Entity type hint for disambiguation when the same ID/name lives in multiple registries."},canonical:{type:Boolean,required:!1,description:`When true, append a visible "View canonical" link pointing at the entity's canonical URL.`},label:{type:String,required:!1,description:"Custom label for the canonical link (only meaningful when `canonical=true`)."}},transform(n,e){const t=n.attributes.primary,r=n.attributes.level,i=n.attributes.type,s=n.attributes.canonical===!0,o=n.attributes.label,a={"data-rune":Qv,"data-expand-id":t};return typeof r=="number"&&(a["data-expand-level"]=String(r)),i&&(a["data-expand-type"]=i),s&&(a["data-expand-canonical"]="true"),o&&(a["data-expand-label"]=o),new I9("div",a,[])}},{Ast:kU}=B,B9="__deferred-body";function Lv(n){const e=n[B9];return typeof e=="string"&&e.length>0?e:void 0}function Mv(n,e,t){const r=B.parse(n),i={...e??{},variables:{...e?.variables??{},...t}},s=B.transform(r,i);return B.Tag.isTag(s)&&s.name==="article"&&!s.attributes?.class&&!s.attributes?.["data-rune"]?s.children:s}const{Tag:Y0}=B,_C="__collection-sentinel",j9=et({attributes:{type:{type:String,required:!1,default:"",description:"Entity type(s), comma-separated."},filter:{type:String,required:!1,default:"",description:"field:value clauses (SPEC-070 grammar)."},sort:{type:String,required:!1,default:"",description:"Sort field (prefix - for descending)."},group:{type:String,required:!1,default:"",description:"Group-by field."},limit:{type:String,required:!1,default:"",description:"Max items."},show:{type:String,required:!1,default:"",description:"Alias for type (entity types to include)."},fields:{type:String,required:!1,default:"",description:"Comma-separated data fields to project."},layout:{type:String,required:!1,default:"list",description:"Arrangement: list (stacked) | grid (multi-column) | table (aligned columns). Item chrome comes from the item — the no-body built-in, or a rune like {% card %} in the body template."},"group-display":{type:String,required:!1,default:"headings",matches:["headings","accordion"],description:"How groups are presented when `group` is set: headings (default) or accordion (collapsible native <details> panels, styled like the accordion rune, with a per-group count)."},empty:{type:String,required:!1,default:"",description:"Fallback text shown when the query yields nothing (no-body form; body-template form uses a fallback zone). Absent → render nothing."}},deferBody:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=(o,a)=>new Y0("meta",{"data-field":o,content:a}),r=Lv(e)??"",i=[t("collection-type",String(e.type??e.show??"")),t("collection-filter",String(e.filter??"")),t("collection-sort",String(e.sort??"")),t("collection-group",String(e.group??"")),t("collection-limit",String(e.limit??"")),t("collection-fields",String(e.fields??"")),t("collection-layout",String(e.layout??"list")),t("collection-group-display",String(e["group-display"]??"headings")),t("collection-empty",String(e.empty??"")),t(_C,"true")];r&&i.push(t("collection-body",r));const s=new Y0("div",{"data-name":"items"},[]);return Ne({rune:"collection",tag:"section",properties:{},refs:{items:s},children:[...i,s]})}}),{Tag:U0}=B,kC="__relationships-sentinel",z9=et({attributes:{of:{type:String,required:!1,default:"",description:"Entity to describe — an id (e.g. `of=$item.id`) or a bound entity."},kind:{type:String,required:!1,default:"",description:'Edge kinds to include, comma-separated (e.g. "blocks,blocked-by").'},type:{type:String,required:!1,default:"",description:"Restrict related entity types, comma-separated."},group:{type:String,required:!1,default:"kind",description:"Group-by: kind (default) | type | none."},"group-display":{type:String,required:!1,default:"headings",matches:["headings","accordion"],description:"How groups are presented: headings (default) or accordion (collapsible native <details> panels, styled like the accordion rune, with a per-group count)."},sort:{type:String,required:!1,default:"",description:"Sort related entities by a field (prefix - for descending)."},limit:{type:String,required:!1,default:"",description:"Max edges."},fields:{type:String,required:!1,default:"",description:"Comma-separated data fields to project in the no-body built-in."},layout:{type:String,required:!1,default:"list",description:"Arrangement: list (stacked) | grid (multi-column). Item chrome comes from the item — the no-body built-in, or a rune like {% card %} in the body template."},empty:{type:String,required:!1,default:"",description:"Fallback text shown when there are no edges (no-body form; body form uses a fallback zone). Absent → render nothing."}},deferBody:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=(l,c)=>new U0("meta",{"data-field":l,content:c}),r=Lv(e)??"",i=e.of,s=String(i&&typeof i=="object"?i.id??"":i??""),o=[t("relationships-of",s),t("relationships-kind",String(e.kind??"")),t("relationships-type",String(e.type??"")),t("relationships-group",String(e.group??"kind")),t("relationships-group-display",String(e["group-display"]??"headings")),t("relationships-sort",String(e.sort??"")),t("relationships-limit",String(e.limit??"")),t("relationships-fields",String(e.fields??"")),t("relationships-layout",String(e.layout??"list")),t("relationships-empty",String(e.empty??"")),t(kC,"true")];r&&o.push(t("relationships-body",r));const a=new U0("div",{"data-name":"items"},[]);return Ne({rune:"relationships",tag:"section",properties:{},refs:{items:a},children:[...o,a]})}}),{Tag:Z9}=B,xC="__aggregate-sentinel",F9=et({attributes:{type:{type:String,required:!1,default:"",description:"Entity type(s), comma-separated."},filter:{type:String,required:!1,default:"",description:"field:value clauses defining the primary set being measured (SPEC-070 grammar)."},value:{type:String,required:!1,default:"",description:'Optional secondary field:value clause defining the achieved subset within `filter` (e.g. value="status:done"). When set, $item.value is the count matching both; $item.percent is the ratio. Without it, the rune is a pure count + breakdown — no progress-bar semantics.'},group:{type:String,required:!1,default:"",description:"Group-by field; omit to render the body once with totals."},sort:{type:String,required:!1,default:"",description:"Sort groups by `key`, `count`, `value`, or `percent` (prefix `-` for descending). Honors SPEC-072 domain-aware ordering when the group field has one."},limit:{type:String,required:!1,default:"",description:"Cap the number of groups (after sort)."},empty:{type:String,required:!1,default:"",description:"Fallback text shown when the query matches no entities (self-closing form; body form uses a fallback zone). Absent → render nothing."},layout:{type:String,required:!1,default:"",matches:["chart"],description:"Render mode. Default: inline integer (no body) or body-zoned template. `chart` draws the grouped counts as an SVG via the `chart` rune's pipeline instead of a body."},"chart-type":{type:String,required:!1,default:"bar",matches:["bar","line","area","pie"],description:'Chart visualization type when layout="chart" (default bar).'},"chart-title":{type:String,required:!1,default:"",description:'Title for the chart (rendered as the data table caption) when layout="chart".'}},deferBody:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=(a,l)=>new Z9("meta",{"data-field":a,content:l}),r=Lv(e)??"",i=r.length>0,s=String(e.layout??""),o=[t("aggregate-type",String(e.type??"")),t("aggregate-filter",String(e.filter??"")),t("aggregate-value",String(e.value??"")),t("aggregate-group",String(e.group??"")),t("aggregate-sort",String(e.sort??"")),t("aggregate-limit",String(e.limit??"")),t("aggregate-empty",String(e.empty??"")),t("aggregate-layout",s),t("aggregate-chart-type",String(e["chart-type"]??"bar")),t("aggregate-chart-title",String(e["chart-title"]??"")),t(xC,"true")];return r&&o.push(t("aggregate-body",r)),Ne({rune:"aggregate",tag:i||s==="chart"?"section":"span",properties:{},children:o})}}),{Tag:G0}=B,SC="__file-ref-sentinel",X9=et({attributes:{path:{type:String,required:!0,description:"Project-root-relative file path. Same sandbox as snippet — absolute paths, traversal escapes, and out-of-root symlinks are rejected."},lines:{type:String,required:!1,description:'Line range. `"42-58"` (range), `"42"` (single line). Drives both the GitHub anchor (#L42-L58) and the drawer-body snippet slice when `preview="drawer"`.'},label:{type:String,required:!1,description:"Display text for the inline link. Defaults to the filename (e.g. `token-contract.ts`). Pass an explicit label when the file-ref refers to a symbol within the file rather than the file itself."},preview:{type:String,required:!1,matches:["drawer"],description:'Preview target. `"drawer"` hoists a drawer with the file\'s snippet + a GitHub footer link, leaving an inline link at the call site that opens it. Absent → no preview, just the inline link.'}},selfClosing:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=String(e.path??""),r=e.lines!==void 0?String(e.lines):"",i=e.label!==void 0?String(e.label):"",s=e.preview!==void 0?String(e.preview):"",o=V9(t),a=(u,f)=>new G0("meta",{"data-field":u,content:f}),l=[a("file-ref-path",t),a("file-ref-lines",r),a("file-ref-label",i),a("file-ref-preview",s),a(SC,"true")],c=new G0("a",{},[i||o]);return Ne({rune:"file-ref",tag:"span",properties:{},refs:{link:c},children:[...l,c]})}});function V9(n){if(!n)return"";const e=n.endsWith("/")?n.slice(0,-1):n,t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}const{Tag:_i}=B,W9=/^h([1-6])$/;function Y9(n,e){const t=n.attributes?.[e];return typeof t=="string"?t:void 0}function U9(n,e,t){for(const r of n){const i=[],s=new Set;dg(r.renderable,o=>{const a=Y9(o,"data-drawer-id");if(!a){t.error("drawer rune is missing required `id` attribute",r.url);return}s.has(a)&&t.warn(`drawer id="${a}" is declared more than once on this page — last declaration wins`,r.url),s.add(a),i.push({id:a,title:G9(o),side:Co(o,"side")??"right",size:Co(o,"size")??"md",shortcut:Co(o,"shortcut")})});for(const o of i)e.register({type:"drawer",id:o.id,scope:"page",sourceUrl:`${r.url}#drawer-${o.id}`,data:{title:o.title,side:o.side,size:o.size,shortcut:o.shortcut}})}}function dg(n,e){if(Array.isArray(n)){for(const r of n)dg(r,e);return}if(!_i.isTag(n))return;const t=n;if(t.attributes?.["data-rune"]==="drawer"){e(t);return}if(t.children)for(const r of t.children)dg(r,e)}function G9(n){const e=AC(n,"title");if(!e)return;const t=hg(e);return t.length>0?t:void 0}function AC(n,e){if(n.attributes?.["data-name"]===e)return n;for(const t of n.children??[])if(_i.isTag(t)){const r=AC(t,e);if(r)return r}}function hg(n){return typeof n=="string"?n:Array.isArray(n)?n.map(hg).join(""):_i.isTag(n)?(n.children??[]).map(hg).join(""):""}function H9(n){const e={lastHeadingLevel:0,mutated:!1},t=pg(n,e);return e.mutated?t:n}function pg(n,e){if(typeof n=="string"||typeof n=="number"||n==null)return n;if(Array.isArray(n)){let a=!1;const l=n.map(c=>{const u=pg(c,e);return u!==c&&(a=!0),u});return a?l:n}if(!_i.isTag(n))return n;const t=n,r=W9.exec(t.name);if(t.attributes?.[cg]==="true"){const a=e.lastHeadingLevel===0?1:e.lastHeadingLevel,l=Math.min(6,Math.max(1,a+1));e.mutated=!0;const c={...t.attributes};return delete c[cg],new _i(`h${l}`,c,t.children)}if(r&&(e.lastHeadingLevel=Number(r[1])),!t.children||t.children.length===0)return t;let s=!1;const o=t.children.map(a=>{const l=pg(a,e);return l!==a&&(s=!0),l});return s?new _i(t.name,t.attributes,o):t}const qv="hoist-drawer",CC=new Map;function TC(n,e){CC.set(n,e)}function K9(n){const e={},t=n.attributes;if(!t)return e;for(const[r,i]of Object.entries(t))r.startsWith("data-")&&typeof i=="string"&&(e[r.slice(5)]=i);return e}function J9(n,e,t,r,i){const s=eZ(n),o=new Map,l={payloads:o,seenIds:new Set,authorIds:s,drawerDepth:0,pageUrl:e,ctx:i,mutated:!1},c=mg(n,l);if(o.size===0)return l.mutated?c:n;const u={pageUrl:e,registry:t,projectRoot:r,ctx:i},f=[];for(const d of o.values()){const h=d.source;if(!h){i.warn(`hoist drawer payload is missing required \`source\` attribute (target-id=${d["target-id"]??"?"})`,e);continue}const m=CC.get(h);if(!m){i.warn(`hoist drawer source "${h}" has no registered builder — skipping target-id=${d["target-id"]??"?"}`,e);continue}const p=m(d,u);p&&f.push(p)}if(f.length===0)return c;if(Array.isArray(c))return[...c,...f];if(_i.isTag(c)){const d=c;return new _i(d.name,d.attributes,[...d.children??[],...f])}return[c,...f]}function eZ(n){const e=new Set,t=r=>{if(Array.isArray(r)){for(const s of r)t(s);return}if(!_i.isTag(r))return;const i=r;if(i.attributes?.["data-rune"]==="drawer"){const s=i.attributes?.["data-drawer-id"];typeof s=="string"&&e.add(s);return}for(const s of i.children??[])t(s)};return t(n),e}function mg(n,e){if(Array.isArray(n)){let o=!1;const a=[];for(const l of n){const c=mg(l,e);c!==l&&(o=!0),c!==Ql&&a.push(c)}return o?(e.mutated=!0,a):n}if(!_i.isTag(n))return n;const t=n;if(t.name==="meta"&&t.attributes?.["data-field"]===qv){const o=K9(t),a=o["target-id"];return a?e.authorIds.has(a)?(e.ctx.info(`Hoist preview "${a}" (source=${o.source??"?"}) collides with an author-declared {% drawer id="${a}" %} on this page — author drawer wins, hoist defers.`,e.pageUrl),Ql):(e.drawerDepth>0&&e.ctx.info(`Hoist preview "${a}" (source=${o.source??"?"}) appears inside another drawer's body — nested previews stack on modern browsers, consider not nesting.`,e.pageUrl),e.seenIds.has(a)||(e.payloads.set(a,o),e.seenIds.add(a)),Ql):(e.ctx.warn("hoist drawer sentinel is missing required `data-target-id` attribute",e.pageUrl),Ql)}const r=t.attributes?.["data-rune"]==="drawer";if(r&&e.drawerDepth++,!t.children||t.children.length===0)return r&&e.drawerDepth--,t;let i=!1;const s=[];for(const o of t.children){const a=mg(o,e);a!==o&&(i=!0),a!==Ql&&s.push(a)}return r&&e.drawerDepth--,i?(e.mutated=!0,new _i(t.name,t.attributes,s)):t}const Ql=Symbol("hoist-strip");function tZ(n,e){const t=n.toLowerCase().replace(/[^a-z0-9.]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");if(!e)return t;const r=e.trim(),i=r.indexOf("-");if(i<0)return`${t}-L${r}`;const s=r.slice(0,i).trim(),o=r.slice(i+1).trim();return o?`${t}-L${s}-L${o}`:`${t}-L${s}`}function nZ(n){return n.split(void 0).join("/")}function PC(n,e){if(typeof n!="string"||n.length===0)throw new rr("snippet `path` attribute is required");(void 0)(n);const r=(void 0)((void 0)(e,n)),i=e.endsWith(void 0)?e:e+void 0;if(!r.startsWith(i)&&r!==e)throw new rr(`snippet path "${n}" escapes the project root after normalization`);try{const s=(void 0)(r);if(!s.startsWith(i)&&s!==e)throw new rr(`snippet path "${n}" resolves through a symlink that escapes the project root`)}catch(s){if(s.code!=="ENOENT")throw s}return r}function rZ(n){if(n==null||n==="")return null;if(typeof n!="string")throw new rr(`snippet \`lines\` attribute must be a string, got ${typeof n}`);const e=n.trim();if(e.length===0)return null;if(/^\d+$/.test(e)){const a=Number(e);if(!Number.isFinite(a)||a<1)throw new rr(`snippet \`lines\` value "${n}" is not a positive integer`);return{start:a,end:a}}const t=/^(\d*)-(\d*)$/.exec(e);if(!t)throw new rr(`snippet \`lines\` value "${n}" is malformed; expected "N", "N-M", "N-", or "-M"`);const r=t[1],i=t[2],s=r.length>0?Number(r):void 0,o=i.length>0?Number(i):void 0;if(s!==void 0&&(!Number.isFinite(s)||s<1))throw new rr(`snippet \`lines\` start "${r}" is not a positive integer`);if(o!==void 0&&(!Number.isFinite(o)||o<1))throw new rr(`snippet \`lines\` end "${i}" is not a positive integer`);if(s!==void 0&&o!==void 0&&o<s)throw new rr(`snippet \`lines\` value "${n}" is inverted (end before start)`);return{start:s,end:o}}function iZ(n,e){if(e===null)return{sliced:n,warnings:[]};const t=n.split(`
|
|
327
327
|
`),r=t.length,i=e.start??1;let s=e.end??r;const o=[];if(i>r)throw new rr(`snippet \`lines\` start ${i} is past end of file (${r} lines)`);return s>r&&(o.push(`snippet \`lines\` end ${s} exceeds file length; clamped to ${r}`),s=r),{sliced:t.slice(i-1,s).join(`
|
|
328
328
|
`),warnings:o}}function EC(n){const e=PC(n.pathAttr,n.projectRoot);let t;try{t=(void 0)(e)}catch{const l=n.referencingPage?`
|
|
329
329
|
|
|
330
330
|
Referenced from: ${n.referencingPage}`:"";throw new rr(`snippet path "${n.pathAttr}" cannot be resolved.
|
|
331
331
|
|
|
332
332
|
Resolved to: ${e}
|
|
333
|
-
Reason: file not found${l}`)}if(!t.isFile())throw new rr(`snippet path "${n.pathAttr}" must be a file (got ${t.isDirectory()?"directory":"other"})`);const r=(void 0)(e,"utf-8"),i=rZ(n.lines),{sliced:s,warnings:o}=iZ(r,i),a=nZ((void 0)(n.projectRoot,e));return{content:s,absolutePath:e,relativePath:a,warnings:o}}function sZ(n){if(!(void 0)(PC(n.relativePath,n.projectRoot)))throw new rr(`source file "${n.relativePath}" does not exist`)}class rr extends Error{constructor(e){super(e),this.name="SnippetSandboxError"}}const oZ=Object.freeze({".ts":"typescript",".tsx":"typescript",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".svelte":"svelte",".vue":"vue",".md":"markdoc",".markdoc":"markdoc",".json":"json",".jsonc":"jsonc",".html":"html",".css":"css",".yml":"yaml",".yaml":"yaml",".toml":"toml",".sh":"bash",".bash":"bash"}),H0="text";function $C(n){if(typeof n!="string"||n.length===0)return H0;let e;const t=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\")),r=t>=0?n.slice(t+1):n,i=r.lastIndexOf(".");return i===-1?e="."+r.toLowerCase():i===0?e=r.toLowerCase():e=r.slice(i).toLowerCase(),oZ[e]??H0}const{Tag:ar}=B;function Dv(n){return ar.isTag(n)}function ju(n,e){for(const t of n.children??[])if(Dv(t)&&t.name==="meta"&&t.attributes["data-field"]===e)return String(t.attributes.content??"");return""}function aZ(n){return(n.children??[]).some(e=>Dv(e)&&e.name==="meta"&&e.attributes["data-field"]===SC)}function lZ(n){return{path:ju(n,"file-ref-path"),lines:ju(n,"file-ref-lines"),label:ju(n,"file-ref-label"),preview:ju(n,"file-ref-preview")}}function QC(n){if(!n)return"";const e=n.endsWith("/")?n.slice(0,-1):n,t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function cZ(n,e,t,r,i){const s={value:!1},o=a=>{if(Array.isArray(a)){let f=!1;const d=a.map(h=>{const m=o(h);return m!==h&&(f=!0),m});return f?d:a}if(!Dv(a))return a;const l=a;if(l.attributes?.["data-rune"]==="file-ref"&&aZ(l))return uZ(l,e,t,r,i,s);if(!l.children||l.children.length===0)return l;let c=!1;const u=l.children.map(f=>{const d=o(f);return d!==f&&(c=!0),d});return c?new ar(l.name,l.attributes,u):l};return o(n)}function uZ(n,e,t,r,i,s){const o=lZ(n),a=o.label||QC(o.path)||o.path,l=tZ(o.path,o.lines),c=o.preview==="drawer",u=Rz(t,r,o.path,o.lines);!u&&!s.value&&(i.warn(`file-ref on this page has no GitHub URL — site config is missing \`repoUrl\` (path="${o.path}"). Configure \`SiteConfig.repoUrl\` to render canonical "View source" links.`,e),s.value=!0);const f={};c?(f.href=`#drawer-${l}`,f["aria-controls"]=`drawer-${l}`,f["aria-expanded"]="false",f["data-target-type"]="drawer"):u&&(f.href=u);const h=[new ar("a",f,[a])];if(c){const m=new ar("meta",{"data-field":qv,"data-source":"file-ref","data-target-id":l,"data-title":a,"data-path":o.path,"data-lines":o.lines,"data-github-url":u??""});h.push(m)}return new ar(n.name,n.attributes,h)}function fZ(n,e){const t=n.path,r=n.lines,i=n.title||QC(t),s=n["target-id"],o=n["github-url"];if(!t||!s)return e.ctx.warn("file-ref hoist payload missing required path or target-id",e.pageUrl),null;if(!e.projectRoot)return e.ctx.error(`file-ref hoist for "${t}" requires a project root in the pipeline; none was threaded through. Drawer body will be empty.`,e.pageUrl),null;let a="",l="text";try{const _=EC({pathAttr:t,projectRoot:e.projectRoot,lines:r||void 0,referencingPage:e.pageUrl});a=_.content,l=$C(_.relativePath);for(const C of _.warnings)e.ctx.warn(`file-ref ${t}: ${C}`,e.pageUrl)}catch(_){const C=_ instanceof rr?_.message:`file-ref ${t}: ${_ instanceof Error?_.message:String(_)}`;return e.ctx.error(C,e.pageUrl),null}const c=new ar("pre",{"data-language":l,"data-codeblock":"true"},[new ar("code",{"data-language":l,"data-codeblock":"true"},[a])]),u=new ar("figure",{class:"rf-snippet","data-rune":"snippet","data-source-path":t,...r?{"data-lines":r}:{}},[c]),f=new ar("div",{"data-name":"body",class:"rf-drawer__body"},[u]),d=new ar("h3",{"data-name":"title",class:"rf-drawer__title"},[i]),h=new ar("button",{type:"button","aria-label":"Close",hidden:!0,"data-name":"close",class:"rf-drawer__close"},["×"]),m=new ar("header",{"data-name":"header",class:"rf-drawer__header"},[d,h]),p=[];o&&p.push(new ar("a",{href:o,rel:"external noopener",target:"_blank"},["View source on GitHub →"]));const O=p.length>0?new ar("footer",{"data-name":"footer",class:"rf-drawer__footer"},p):null,v=[m,f];return O&&v.push(O),new ar("section",{id:`drawer-${s}`,class:"rf-drawer","data-rune":"drawer","data-drawer-id":s,"data-side":"right","data-size":"md"},v)}TC("file-ref",fZ);const{Tag:Yr}=B;function dZ(n){return Yr.isTag(n)}function hZ(n,e,t,r){const i=s=>{if(Array.isArray(s)){let c=!1;const u=[];for(const f of s){const d=i(f);d!==f&&(c=!0),Array.isArray(d)?u.push(...d):u.push(d)}return c?u:s}if(!dZ(s))return s;const o=s;if(o.attributes?.["data-rune"]===$v&&o.attributes?.["data-xref-preview"]==="drawer")return pZ(o,t,r,e);if(!o.children||o.children.length===0)return o;let a=!1;const l=[];for(const c of o.children){const u=i(c);u!==c&&(a=!0),Array.isArray(u)?l.push(...u):l.push(u)}return a?new Yr(o.name,o.attributes,l):o};return i(n)}function pZ(n,e,t,r){const i=n.attributes,s=String(i["data-xref-id"]??""),o=i["data-xref-label"];if(!s)return t.warn(`xref preview placeholder on ${r} has no entity id`,r),[n];const a=e?LC(e,s):void 0,l=o||(a?K0(a):s),c=a?K0(a):s,u=s,f=new Yr("a",{class:"rf-xref",href:`#drawer-${u}`,"aria-controls":`drawer-${u}`,"aria-expanded":"false","data-target-type":"drawer","data-xref-id":s},[l]),d=new Yr("meta",{"data-field":qv,"data-source":"xref","data-target-id":u,"data-title":c,"data-entity-id":s});return[f,d]}function LC(n,e){const t=n.getTypes?.()??[];for(const r of t){const i=n.getById(r,e);if(i)return i}}function K0(n){const e=n.data;return String(e.title??e.name??n.id)}function mZ(n,e){const t=n["entity-id"]||n["target-id"],r=n["target-id"],i=n.title||t;if(!t||!r)return e.ctx.warn("xref hoist payload missing required entity-id or target-id",e.pageUrl),null;const s=e.registry?LC(e.registry,t):void 0,o=new Yr("h3",{"data-name":"title",class:"rf-drawer__title"},[i]),a=new Yr("button",{type:"button","aria-label":"Close",hidden:!0,"data-name":"close",class:"rf-drawer__close"},["×"]),l=new Yr("header",{"data-name":"header",class:"rf-drawer__header"},[o,a]),u=[new Yr("div",{"data-rune":Qv,"data-expand-id":t},[])],f=new Yr("div",{"data-name":"body",class:"rf-drawer__body"},u),d=s?.sourceUrl??"",h=d?new Yr("footer",{"data-name":"footer",class:"rf-drawer__footer"},[new Yr("a",{href:d},["View full page →"])]):null,m=[l,f];return h&&m.push(h),new Yr("section",{id:`drawer-${r}`,class:"rf-drawer","data-rune":"drawer","data-drawer-id":r,"data-side":"right","data-size":"md"},m)}TC("xref",mZ);const{Tag:Ll}=B,gZ=["fraction","percent","none"],OZ=["positive","caution","negative"];function gg(n){return typeof n=="string"?n:Array.isArray(n)?n.map(gg).join(""):B.Tag.isTag(n)?gg(n.children??[]):""}const vZ=et({attributes:{value:{type:Number,required:!1,description:"Completed amount (paired with `max`)."},max:{type:Number,required:!1,description:"Total amount (paired with `value`)."},percent:{type:Number,required:!1,description:"Direct percentage 0–100, when there is no count."},display:{type:String,required:!1,matches:gZ.slice(),description:"Readout: fraction (default with value/max), percent, or none."},sentiment:{type:String,required:!1,matches:OZ.slice(),description:"Tone cue: positive / caution / negative. Absent → the neutral primary fill."}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=e.value!=null?Number(e.value):void 0,i=e.max!=null?Number(e.max):void 0,s=e.percent!=null?Number(e.percent):void 0,o=w=>Math.max(0,Math.min(100,w)),a=r!=null&&i!=null&&Number.isFinite(r)&&Number.isFinite(i)&&i>0,l=a?o(Math.round(r/i*100)):s!=null&&Number.isFinite(s)?o(s):0,c=e.display||(a?"fraction":"percent");let u="";c==="fraction"&&a?u=`${r}/${i}`:c==="percent"&&(u=`${l}%`);const d=new Fe(B.transform(ct(n.body),t)).toArray(),h=gg(d).trim(),m=e.sentiment,p=m?new Ll("meta",{content:m}):void 0,O=new Ll("span",{},[]),v=new Ll("span",{},[O]),b={track:v,fill:O},_=p?[p]:[];if(d.length>0){const w=new Ll("span",{},d);b.label=w,_.push(w)}if(u){const w=new Ll("span",{},[u]);b.value=w,_.push(w)}_.push(v);const C=Ne({rune:"progress",tag:"div",properties:p?{sentiment:p}:{},refs:b,children:_});return C.attributes.role="progressbar",C.attributes["aria-valuemin"]="0",a?(C.attributes["aria-valuenow"]=String(r),C.attributes["aria-valuemax"]=String(i)):(C.attributes["aria-valuenow"]=String(l),C.attributes["aria-valuemax"]="100"),h&&(C.attributes["aria-label"]=h),C.attributes.style=`--rf-progress: ${l}%`,C}}),{Tag:fo}=B,bZ=et({base:y6,attributes:{href:{type:String,required:!1,default:"",description:"Optional link target; makes the whole card clickable."},"content-place":{type:String,required:!1,description:'Cover overlay anchor: "<block> <inline>" (e.g. "end start") or "auto"'},height:{type:String,required:!1,matches:["sm","md","lg","xl"],description:"Intrinsic card height (named scale) for cover / bg-only cards"},aspect:{type:String,required:!1,description:'Intrinsic card aspect ratio (e.g. "16/9", "3/4") for cover / bg-only cards'}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const{media:r,body:i,footer:s}=_6(ct(n.body)),{metas:o,children:a}=w6(e),l=e["content-place"],c=e.height,u=e.aspect,f=l?new fo("meta",{content:l}):void 0,d=c?new fo("meta",{content:c}):void 0,h=u?new fo("meta",{content:u}):void 0,m=[...a];if(f&&m.push(f),d&&m.push(d),h&&m.push(h),r.length>0){const k=new Fe(B.transform(r,t)),E=k6(k),T=E?[E]:k.toArray();m.push(new fo("div",{"data-section":"media","data-name":"media"},T))}let p,O=i;i.length>=2&&i[0].type==="paragraph"&&i[1].type==="heading"&&(p=i[0],O=i.slice(1));let v;if(p){const E=new Fe(B.transform([p],t)).toArray()[0];B.Tag.isTag(E)&&(v=E)}const _=new Fe(B.transform(O,t)).toArray(),C=_.find(k=>B.Tag.isTag(k)&&/^h[1-6]$/.test(k.name)),w=new fo("div",{"data-name":"body"},_);let y;if(s.length>0){const k=new Fe(B.transform(s,t));y=new fo("footer",{"data-name":"footer"},k.toArray())}v&&m.push(v),m.push(w),y&&m.push(y);let S;const A=String(e.href??"");A&&(S=new fo("a",{"data-name":"link",href:A,"aria-hidden":"true",tabindex:"-1"},[]),m.push(S));const x={body:w};return C&&(x.title=C),v&&(x.eyebrow=v),y&&(x.footer=y),S&&(x.link=S),Ne({rune:"card",tag:"div",properties:{"media-position":o.mediaPosition,"content-place":f,height:d,aspect:h},refs:x,children:m})}}),{Tag:yZ}=B,wZ=["positive","negative","caution","neutral"],_Z=["status","category","quantity","temporal","tag","id"],kZ={inline:!0,attributes:{sentiment:{type:String,required:!1,matches:wZ.slice(),description:"Sentiment dimension: positive, negative, caution, neutral. Default: neutral."},type:{type:String,required:!1,matches:_Z.slice(),description:"Meta-type dimension: status, category, quantity, temporal, tag, id. Default: tag."}},transform(n,e){const t=n.attributes.sentiment??"neutral",r=n.attributes.type??"tag",i={class:"rf-badge","data-rune":"badge","data-meta-sentiment":t,"data-meta-type":r},s=n.transformChildren(e);return new yZ("span",i,s)}},{Tag:Ap}=B;function xZ(n){const e=n.findIndex(t=>t.type==="hr");return e<0?{left:n,right:[]}:{left:n.slice(0,e),right:n.slice(e+1)}}const SZ=et({attributes:{},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=xZ(ct(n.body)),i=B.transform(r.left,t),s=B.transform(r.right,t),o=new Ap("div",{},i),a=r.right.length>0?new Ap("div",{"data-align":"end"},s):null,l=a?[o,a]:[o];return new Ap("div",{"data-rune":"bar","data-zone-layout":"bar"},l)}}),{Ast:zu,Tag:ho}=B;function AZ(n){const e=n.children??[];if(e.length===0)return null;let t,r;const i=e[0];if(i?.type==="inline")t=i,r=e.slice(1);else if(i?.type==="paragraph")t=i.children?.[0],r=e.slice(1);else return null;if(!t||t.type!=="inline")return null;const s=t.children??[];if(s.length===0)return null;const o=s[0];if(!o||o.type!=="strong")return null;const a=o.children??[];let l="";for(const p of a)p.type==="text"&&typeof p.attributes?.content=="string"&&(l+=p.attributes.content);if(!l.endsWith(":"))return null;const c=l.slice(0,-1),u=[new zu.Node("text",{content:c})],f=s.slice(1),d=(()=>{const p=f[0];if(p?.type==="text"&&typeof p.attributes?.content=="string"){const O=p.attributes.content.replace(/^\s+/,"");return O===""?f.slice(1):[new zu.Node("text",{content:O}),...f.slice(1)]}return f})(),h=d.length>0?[new zu.Node("inline",{},d)]:[],m=h.length>0?[new zu.Node("paragraph",{},h)]:[];return{term:u,rest:h,restBlocks:[...m,...r]}}const CZ=et({attributes:{},contentModel:{type:"sequence",fields:[{name:"list",match:"list",optional:!1}]},transform(n,e,t){const i=ct(n.list).find(a=>a.type==="list");if(!i)return new ho("dl",{"data-rune":"deflist","data-zone-layout":"definition-list"},[]);const s=(i.children??[]).filter(a=>a.type==="item"),o=[];for(const a of s){const l=AZ(a);let c,u;if(l){const f=B.transform(l.term,t),d=B.transform(l.restBlocks,t);c=new ho("dt",{"data-meta-label":""},f),u=new ho("dd",{},J0(d))}else{const f=B.transform(a.children??[],t);c=new ho("dt",{"data-meta-label":""},[]),u=new ho("dd",{},J0(f)),TZ(a)}o.push(new ho("div",{"data-name":"row"},[c,u]))}return new ho("dl",{"data-rune":"deflist","data-zone-layout":"definition-list"},o)}});function J0(n){if(n.length!==1)return n;const e=n[0];return!B.Tag.isTag(e)||e.name!=="p"?n:e.children}const ew=new Set;function TZ(n){const e=n.location??null,t=e?`${e.start?.line??"?"}:${e.start?.character??"?"}`:"unknown";ew.has(t)||(ew.add(t),console.warn(`[refrakt] {% deflist %} item at line ${e?.start?.line??"?"} lacks a \`**Term:**\` prefix — rendered with empty <dt>. Prefix the item with bold term text ending in \`:\` to label it.`))}class PZ{constructor(e){this.name=e.name,this.aliases=e.aliases??[],this.schema=e.schema,this.description=e.description??"",this.seoType=e.seoType,this.typeName=e.typeName,this.schemaOrgType=e.schemaOrgType,this.authoringHints=e.authoringHints,this.category=e.category,this.snippet=e.snippet}get names(){return[this.name,...this.aliases]}}function He(n){return new PZ(n)}function EZ(n){const e={};for(const t of Object.values(n))for(const r of t.names)e[r]=t.schema;return e}const{Ast:$Z}=B;class kU extends $Z.Node{constructor(e,t,r,i){super(e,t,r,i)}transform(e){return super.transform(e)}}const QZ=new Set(["id","type","sourceFile","sourceUrl"]);function LZ(n){const e=[];let t="",r=!1;for(const i of n){if(i==='"'){r=!r;continue}if(!r&&/\s/.test(i)){t&&(e.push(t),t="");continue}t+=i}return t&&e.push(t),e}function Og(n){const e=[],t=new Map;if(!n||!n.trim())return{clauses:[],warnings:e};for(const r of LZ(n)){const i=r.indexOf(":");if(i===-1){e.push(`Ignored filter clause "${r}": expected field:value`);continue}const s=r.slice(0,i);if(!s){e.push(`Ignored filter clause "${r}": empty field name`);continue}const o=r.slice(i+1),a=t.get(s);a?a.push(o):t.set(s,[o])}return{clauses:[...t.entries()].map(([r,i])=>({field:r,values:i})),warnings:e}}function MC(n,e){return e==="url"?n.sourceUrl??n.data.url??"":QZ.has(e)?n[e]:n.data[e]}function MZ(n){const e=n.split("*").map(t=>t.replace(/[.+?^${}()|[\]\\]/g,"\\$&"));return new RegExp("^"+e.join(".*")+"$")}const qZ=/^\/(.+)\/([gimsuy]*)$/,DZ=/[\\^$.+?()[\]{}|]/;function RZ(n,e){const t=e.match(qZ);if(t&&(t[2].length>0||DZ.test(t[1])))try{return new RegExp(t[1],t[2]).test(n)}catch{return n===e}return e.includes("*")?MZ(e).test(n):n===e}function IZ(n){if(Array.isArray(n))return n.map(t=>String(t??""));const e=String(n??"");return e.includes(",")?e.split(",").map(t=>t.trim()):[e]}function Rv(n,e){for(const t of e.clauses){const r=IZ(MC(n,t.field));if(!t.values.some(s=>r.some(o=>RZ(o,s))))return!1}return!0}function Ma(n){return String(n??"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}const{Tag:Ds,Ast:NZ}=B;function Iv(n){if(!n)return{template:""};const e=B.parse(`
|
|
333
|
+
Reason: file not found${l}`)}if(!t.isFile())throw new rr(`snippet path "${n.pathAttr}" must be a file (got ${t.isDirectory()?"directory":"other"})`);const r=(void 0)(e,"utf-8"),i=rZ(n.lines),{sliced:s,warnings:o}=iZ(r,i),a=nZ((void 0)(n.projectRoot,e));return{content:s,absolutePath:e,relativePath:a,warnings:o}}function sZ(n){if(!(void 0)(PC(n.relativePath,n.projectRoot)))throw new rr(`source file "${n.relativePath}" does not exist`)}class rr extends Error{constructor(e){super(e),this.name="SnippetSandboxError"}}const oZ=Object.freeze({".ts":"typescript",".tsx":"typescript",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".svelte":"svelte",".vue":"vue",".md":"markdoc",".markdoc":"markdoc",".json":"json",".jsonc":"jsonc",".html":"html",".css":"css",".yml":"yaml",".yaml":"yaml",".toml":"toml",".sh":"bash",".bash":"bash"}),H0="text";function $C(n){if(typeof n!="string"||n.length===0)return H0;let e;const t=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\")),r=t>=0?n.slice(t+1):n,i=r.lastIndexOf(".");return i===-1?e="."+r.toLowerCase():i===0?e=r.toLowerCase():e=r.slice(i).toLowerCase(),oZ[e]??H0}const{Tag:ar}=B;function Dv(n){return ar.isTag(n)}function ju(n,e){for(const t of n.children??[])if(Dv(t)&&t.name==="meta"&&t.attributes["data-field"]===e)return String(t.attributes.content??"");return""}function aZ(n){return(n.children??[]).some(e=>Dv(e)&&e.name==="meta"&&e.attributes["data-field"]===SC)}function lZ(n){return{path:ju(n,"file-ref-path"),lines:ju(n,"file-ref-lines"),label:ju(n,"file-ref-label"),preview:ju(n,"file-ref-preview")}}function QC(n){if(!n)return"";const e=n.endsWith("/")?n.slice(0,-1):n,t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function cZ(n,e,t,r,i){const s={value:!1},o=a=>{if(Array.isArray(a)){let f=!1;const d=a.map(h=>{const m=o(h);return m!==h&&(f=!0),m});return f?d:a}if(!Dv(a))return a;const l=a;if(l.attributes?.["data-rune"]==="file-ref"&&aZ(l))return uZ(l,e,t,r,i,s);if(!l.children||l.children.length===0)return l;let c=!1;const u=l.children.map(f=>{const d=o(f);return d!==f&&(c=!0),d});return c?new ar(l.name,l.attributes,u):l};return o(n)}function uZ(n,e,t,r,i,s){const o=lZ(n),a=o.label||QC(o.path)||o.path,l=tZ(o.path,o.lines),c=o.preview==="drawer",u=Rz(t,r,o.path,o.lines);!u&&!s.value&&(i.warn(`file-ref on this page has no GitHub URL — site config is missing \`repoUrl\` (path="${o.path}"). Configure \`SiteConfig.repoUrl\` to render canonical "View source" links.`,e),s.value=!0);const f={};c?(f.href=`#drawer-${l}`,f["aria-controls"]=`drawer-${l}`,f["aria-expanded"]="false",f["data-target-type"]="drawer"):u&&(f.href=u);const h=[new ar("a",f,[a])];if(c){const m=new ar("meta",{"data-field":qv,"data-source":"file-ref","data-target-id":l,"data-title":a,"data-path":o.path,"data-lines":o.lines,"data-github-url":u??""});h.push(m)}return new ar(n.name,n.attributes,h)}function fZ(n,e){const t=n.path,r=n.lines,i=n.title||QC(t),s=n["target-id"],o=n["github-url"];if(!t||!s)return e.ctx.warn("file-ref hoist payload missing required path or target-id",e.pageUrl),null;if(!e.projectRoot)return e.ctx.error(`file-ref hoist for "${t}" requires a project root in the pipeline; none was threaded through. Drawer body will be empty.`,e.pageUrl),null;let a="",l="text";try{const _=EC({pathAttr:t,projectRoot:e.projectRoot,lines:r||void 0,referencingPage:e.pageUrl});a=_.content,l=$C(_.relativePath);for(const C of _.warnings)e.ctx.warn(`file-ref ${t}: ${C}`,e.pageUrl)}catch(_){const C=_ instanceof rr?_.message:`file-ref ${t}: ${_ instanceof Error?_.message:String(_)}`;return e.ctx.error(C,e.pageUrl),null}const c=new ar("pre",{"data-language":l,"data-codeblock":"true"},[new ar("code",{"data-language":l,"data-codeblock":"true"},[a])]),u=new ar("figure",{class:"rf-snippet","data-rune":"snippet","data-source-path":t,...r?{"data-lines":r}:{}},[c]),f=new ar("div",{"data-name":"body",class:"rf-drawer__body"},[u]),d=new ar("h3",{"data-name":"title",class:"rf-drawer__title"},[i]),h=new ar("button",{type:"button","aria-label":"Close",hidden:!0,"data-name":"close",class:"rf-drawer__close"},["×"]),m=new ar("header",{"data-name":"header",class:"rf-drawer__header"},[d,h]),p=[];o&&p.push(new ar("a",{href:o,rel:"external noopener",target:"_blank"},["View source on GitHub →"]));const O=p.length>0?new ar("footer",{"data-name":"footer",class:"rf-drawer__footer"},p):null,v=[m,f];return O&&v.push(O),new ar("section",{id:`drawer-${s}`,class:"rf-drawer","data-rune":"drawer","data-drawer-id":s,"data-side":"right","data-size":"md"},v)}TC("file-ref",fZ);const{Tag:Yr}=B;function dZ(n){return Yr.isTag(n)}function hZ(n,e,t,r){const i=s=>{if(Array.isArray(s)){let c=!1;const u=[];for(const f of s){const d=i(f);d!==f&&(c=!0),Array.isArray(d)?u.push(...d):u.push(d)}return c?u:s}if(!dZ(s))return s;const o=s;if(o.attributes?.["data-rune"]===$v&&o.attributes?.["data-xref-preview"]==="drawer")return pZ(o,t,r,e);if(!o.children||o.children.length===0)return o;let a=!1;const l=[];for(const c of o.children){const u=i(c);u!==c&&(a=!0),Array.isArray(u)?l.push(...u):l.push(u)}return a?new Yr(o.name,o.attributes,l):o};return i(n)}function pZ(n,e,t,r){const i=n.attributes,s=String(i["data-xref-id"]??""),o=i["data-xref-label"];if(!s)return t.warn(`xref preview placeholder on ${r} has no entity id`,r),[n];const a=e?LC(e,s):void 0,l=o||(a?K0(a):s),c=a?K0(a):s,u=s,f=new Yr("a",{class:"rf-xref",href:`#drawer-${u}`,"aria-controls":`drawer-${u}`,"aria-expanded":"false","data-target-type":"drawer","data-xref-id":s},[l]),d=new Yr("meta",{"data-field":qv,"data-source":"xref","data-target-id":u,"data-title":c,"data-entity-id":s});return[f,d]}function LC(n,e){const t=n.getTypes?.()??[];for(const r of t){const i=n.getById(r,e);if(i)return i}}function K0(n){const e=n.data;return String(e.title??e.name??n.id)}function mZ(n,e){const t=n["entity-id"]||n["target-id"],r=n["target-id"],i=n.title||t;if(!t||!r)return e.ctx.warn("xref hoist payload missing required entity-id or target-id",e.pageUrl),null;const s=e.registry?LC(e.registry,t):void 0,o=new Yr("h3",{"data-name":"title",class:"rf-drawer__title"},[i]),a=new Yr("button",{type:"button","aria-label":"Close",hidden:!0,"data-name":"close",class:"rf-drawer__close"},["×"]),l=new Yr("header",{"data-name":"header",class:"rf-drawer__header"},[o,a]),u=[new Yr("div",{"data-rune":Qv,"data-expand-id":t},[])],f=new Yr("div",{"data-name":"body",class:"rf-drawer__body"},u),d=s?.sourceUrl??"",h=d?new Yr("footer",{"data-name":"footer",class:"rf-drawer__footer"},[new Yr("a",{href:d},["View full page →"])]):null,m=[l,f];return h&&m.push(h),new Yr("section",{id:`drawer-${r}`,class:"rf-drawer","data-rune":"drawer","data-drawer-id":r,"data-side":"right","data-size":"md"},m)}TC("xref",mZ);const{Tag:Ll}=B,gZ=["fraction","percent","none"],OZ=["positive","caution","negative"];function gg(n){return typeof n=="string"?n:Array.isArray(n)?n.map(gg).join(""):B.Tag.isTag(n)?gg(n.children??[]):""}const vZ=et({attributes:{value:{type:Number,required:!1,description:"Completed amount (paired with `max`)."},max:{type:Number,required:!1,description:"Total amount (paired with `value`)."},percent:{type:Number,required:!1,description:"Direct percentage 0–100, when there is no count."},display:{type:String,required:!1,matches:gZ.slice(),description:"Readout: fraction (default with value/max), percent, or none."},sentiment:{type:String,required:!1,matches:OZ.slice(),description:"Tone cue: positive / caution / negative. Absent → the neutral primary fill."}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=e.value!=null?Number(e.value):void 0,i=e.max!=null?Number(e.max):void 0,s=e.percent!=null?Number(e.percent):void 0,o=w=>Math.max(0,Math.min(100,w)),a=r!=null&&i!=null&&Number.isFinite(r)&&Number.isFinite(i)&&i>0,l=a?o(Math.round(r/i*100)):s!=null&&Number.isFinite(s)?o(s):0,c=e.display||(a?"fraction":"percent");let u="";c==="fraction"&&a?u=`${r}/${i}`:c==="percent"&&(u=`${l}%`);const d=new Fe(B.transform(ct(n.body),t)).toArray(),h=gg(d).trim(),m=e.sentiment,p=m?new Ll("meta",{content:m}):void 0,O=new Ll("span",{},[]),v=new Ll("span",{},[O]),b={track:v,fill:O},_=p?[p]:[];if(d.length>0){const w=new Ll("span",{},d);b.label=w,_.push(w)}if(u){const w=new Ll("span",{},[u]);b.value=w,_.push(w)}_.push(v);const C=Ne({rune:"progress",tag:"div",properties:p?{sentiment:p}:{},refs:b,children:_});return C.attributes.role="progressbar",C.attributes["aria-valuemin"]="0",a?(C.attributes["aria-valuenow"]=String(r),C.attributes["aria-valuemax"]=String(i)):(C.attributes["aria-valuenow"]=String(l),C.attributes["aria-valuemax"]="100"),h&&(C.attributes["aria-label"]=h),C.attributes.style=`--rf-progress: ${l}%`,C}}),{Tag:fo}=B,bZ=et({base:y6,attributes:{href:{type:String,required:!1,default:"",description:"Optional link target; makes the whole card clickable."},"content-place":{type:String,required:!1,description:'Cover overlay anchor: "<block> <inline>" (e.g. "end start") or "auto"'},height:{type:String,required:!1,matches:["sm","md","lg","xl"],description:"Intrinsic card height (named scale) for cover / bg-only cards"},aspect:{type:String,required:!1,description:'Intrinsic card aspect ratio (e.g. "16/9", "3/4") for cover / bg-only cards'}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const{media:r,body:i,footer:s}=_6(ct(n.body)),{metas:o,children:a}=w6(e),l=e["content-place"],c=e.height,u=e.aspect,f=l?new fo("meta",{content:l}):void 0,d=c?new fo("meta",{content:c}):void 0,h=u?new fo("meta",{content:u}):void 0,m=[...a];if(f&&m.push(f),d&&m.push(d),h&&m.push(h),r.length>0){const k=new Fe(B.transform(r,t)),E=k6(k),T=E?[E]:k.toArray();m.push(new fo("div",{"data-section":"media","data-name":"media"},T))}let p,O=i;i.length>=2&&i[0].type==="paragraph"&&i[1].type==="heading"&&(p=i[0],O=i.slice(1));let v;if(p){const E=new Fe(B.transform([p],t)).toArray()[0];B.Tag.isTag(E)&&(v=E)}const _=new Fe(B.transform(O,t)).toArray(),C=_.find(k=>B.Tag.isTag(k)&&/^h[1-6]$/.test(k.name)),w=new fo("div",{"data-name":"body"},_);let y;if(s.length>0){const k=new Fe(B.transform(s,t));y=new fo("footer",{"data-name":"footer"},k.toArray())}v&&m.push(v),m.push(w),y&&m.push(y);let S;const A=String(e.href??"");A&&(S=new fo("a",{"data-name":"link",href:A,"aria-hidden":"true",tabindex:"-1"},[]),m.push(S));const x={body:w};return C&&(x.title=C),v&&(x.eyebrow=v),y&&(x.footer=y),S&&(x.link=S),Ne({rune:"card",tag:"div",properties:{"media-position":o.mediaPosition,"content-place":f,height:d,aspect:h},refs:x,children:m})}}),{Tag:yZ}=B,wZ=["positive","negative","caution","neutral"],_Z=["status","category","quantity","temporal","tag","id"],kZ={inline:!0,attributes:{sentiment:{type:String,required:!1,matches:wZ.slice(),description:"Sentiment dimension: positive, negative, caution, neutral. Default: neutral."},type:{type:String,required:!1,matches:_Z.slice(),description:"Meta-type dimension: status, category, quantity, temporal, tag, id. Default: tag."}},transform(n,e){const t=n.attributes.sentiment??"neutral",r=n.attributes.type??"tag",i={class:"rf-badge","data-rune":"badge","data-meta-sentiment":t,"data-meta-type":r},s=n.transformChildren(e);return new yZ("span",i,s)}},{Tag:Ap}=B;function xZ(n){const e=n.findIndex(t=>t.type==="hr");return e<0?{left:n,right:[]}:{left:n.slice(0,e),right:n.slice(e+1)}}const SZ=et({attributes:{},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=xZ(ct(n.body)),i=B.transform(r.left,t),s=B.transform(r.right,t),o=new Ap("div",{},i),a=r.right.length>0?new Ap("div",{"data-align":"end"},s):null,l=a?[o,a]:[o];return new Ap("div",{"data-rune":"bar","data-zone-layout":"bar"},l)}}),{Ast:zu,Tag:ho}=B;function AZ(n){const e=n.children??[];if(e.length===0)return null;let t,r;const i=e[0];if(i?.type==="inline")t=i,r=e.slice(1);else if(i?.type==="paragraph")t=i.children?.[0],r=e.slice(1);else return null;if(!t||t.type!=="inline")return null;const s=t.children??[];if(s.length===0)return null;const o=s[0];if(!o||o.type!=="strong")return null;const a=o.children??[];let l="";for(const p of a)p.type==="text"&&typeof p.attributes?.content=="string"&&(l+=p.attributes.content);if(!l.endsWith(":"))return null;const c=l.slice(0,-1),u=[new zu.Node("text",{content:c})],f=s.slice(1),d=(()=>{const p=f[0];if(p?.type==="text"&&typeof p.attributes?.content=="string"){const O=p.attributes.content.replace(/^\s+/,"");return O===""?f.slice(1):[new zu.Node("text",{content:O}),...f.slice(1)]}return f})(),h=d.length>0?[new zu.Node("inline",{},d)]:[],m=h.length>0?[new zu.Node("paragraph",{},h)]:[];return{term:u,rest:h,restBlocks:[...m,...r]}}const CZ=et({attributes:{},contentModel:{type:"sequence",fields:[{name:"list",match:"list",optional:!1}]},transform(n,e,t){const i=ct(n.list).find(a=>a.type==="list");if(!i)return new ho("dl",{"data-rune":"deflist","data-zone-layout":"definition-list"},[]);const s=(i.children??[]).filter(a=>a.type==="item"),o=[];for(const a of s){const l=AZ(a);let c,u;if(l){const f=B.transform(l.term,t),d=B.transform(l.restBlocks,t);c=new ho("dt",{"data-meta-label":""},f),u=new ho("dd",{},J0(d))}else{const f=B.transform(a.children??[],t);c=new ho("dt",{"data-meta-label":""},[]),u=new ho("dd",{},J0(f)),TZ(a)}o.push(new ho("div",{"data-name":"row"},[c,u]))}return new ho("dl",{"data-rune":"deflist","data-zone-layout":"definition-list"},o)}});function J0(n){if(n.length!==1)return n;const e=n[0];return!B.Tag.isTag(e)||e.name!=="p"?n:e.children}const ew=new Set;function TZ(n){const e=n.location??null,t=e?`${e.start?.line??"?"}:${e.start?.character??"?"}`:"unknown";ew.has(t)||(ew.add(t),console.warn(`[refrakt] {% deflist %} item at line ${e?.start?.line??"?"} lacks a \`**Term:**\` prefix — rendered with empty <dt>. Prefix the item with bold term text ending in \`:\` to label it.`))}class PZ{constructor(e){this.name=e.name,this.aliases=e.aliases??[],this.schema=e.schema,this.description=e.description??"",this.seoType=e.seoType,this.typeName=e.typeName,this.schemaOrgType=e.schemaOrgType,this.authoringHints=e.authoringHints,this.category=e.category,this.snippet=e.snippet}get names(){return[this.name,...this.aliases]}}function He(n){return new PZ(n)}function EZ(n){const e={};for(const t of Object.values(n))for(const r of t.names)e[r]=t.schema;return e}const{Ast:$Z}=B;class xU extends $Z.Node{constructor(e,t,r,i){super(e,t,r,i)}transform(e){return super.transform(e)}}const QZ=new Set(["id","type","sourceFile","sourceUrl"]);function LZ(n){const e=[];let t="",r=!1;for(const i of n){if(i==='"'){r=!r;continue}if(!r&&/\s/.test(i)){t&&(e.push(t),t="");continue}t+=i}return t&&e.push(t),e}function Og(n){const e=[],t=new Map;if(!n||!n.trim())return{clauses:[],warnings:e};for(const r of LZ(n)){const i=r.indexOf(":");if(i===-1){e.push(`Ignored filter clause "${r}": expected field:value`);continue}const s=r.slice(0,i);if(!s){e.push(`Ignored filter clause "${r}": empty field name`);continue}const o=r.slice(i+1),a=t.get(s);a?a.push(o):t.set(s,[o])}return{clauses:[...t.entries()].map(([r,i])=>({field:r,values:i})),warnings:e}}function MC(n,e){return e==="url"?n.sourceUrl??n.data.url??"":QZ.has(e)?n[e]:n.data[e]}function MZ(n){const e=n.split("*").map(t=>t.replace(/[.+?^${}()|[\]\\]/g,"\\$&"));return new RegExp("^"+e.join(".*")+"$")}const qZ=/^\/(.+)\/([gimsuy]*)$/,DZ=/[\\^$.+?()[\]{}|]/;function RZ(n,e){const t=e.match(qZ);if(t&&(t[2].length>0||DZ.test(t[1])))try{return new RegExp(t[1],t[2]).test(n)}catch{return n===e}return e.includes("*")?MZ(e).test(n):n===e}function IZ(n){if(Array.isArray(n))return n.map(t=>String(t??""));const e=String(n??"");return e.includes(",")?e.split(",").map(t=>t.trim()):[e]}function Rv(n,e){for(const t of e.clauses){const r=IZ(MC(n,t.field));if(!t.values.some(s=>r.some(o=>RZ(o,s))))return!1}return!0}function Ma(n){return String(n??"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}const{Tag:Ds,Ast:NZ}=B;function Iv(n){if(!n)return{template:""};const e=B.parse(`
|
|
334
334
|
`+n),t=[[]];for(const s of e.children)s.type==="hr"?t.push([]):t[t.length-1].push(s);if(t.length===1)return{template:n};const r=s=>s.length?B.format(new NZ.Node("document",{},s)):"",i=t.map(r);return i.length===2?{preamble:i[0]||void 0,template:i[1]}:{preamble:i[0]||void 0,template:i[1],fallback:i[2]||void 0}}class BZ{constructor(e,t={}){this.matches=e,this.overrides=t}order(e,t){return this.overrides[e]?.[t]??this.matches[e]?.[t]}rank(e,t,r){const i=this.order(e,t);return i?i.indexOf(r):-1}}function Nv(n){const e={},t=n?.tags??{};for(const[r,i]of Object.entries(t)){const s=i?.attributes;if(s)for(const[o,a]of Object.entries(s)){const l=a?.matches;Array.isArray(l)&&l.every(c=>typeof c=="string")&&((e[r]??={})[o]=l)}}return new BZ(e,n?.orderings??{})}function qC(n){return n.sourceUrl||String(n.data.url??"")}function jZ(n){const e=n.data;return String(e.title??e.name??n.id)}function zr(n,e){const t=MC(n,e);return Array.isArray(t)?t.join(", "):String(t??"")}function DC(n,e){const t=qC(n),r=jZ(n),i=`${e}__title`;return t?new Ds("a",{class:i,href:t},[r]):new Ds("span",{class:i},[r])}function zZ(n){return n.id||String(n.data?.name??"")}function Bv(n,e){const t=n.data?.status,r=t?e?.sentiments?.[n.type]?.status?.[t]??"":"";return{id:n.id,identifier:zZ(n),type:n.type,url:qC(n),data:n.data,sentiment:r,mixed:e?.mixed??!1,group:e?.group??"",groupCount:e?.groupCount??0}}function ZZ(n,e,t){if(!e)return n;let r=e.trim(),i=1;r.startsWith("-")?(i=-1,r=r.slice(1)):r.endsWith("-desc")?(i=-1,r=r.slice(0,-5)):r.endsWith("-asc")&&(r=r.slice(0,-4));const s=t&&n.some(o=>t.order(o.type,r));return[...n].sort((o,a)=>{if(s){const d=t.rank(o.type,r,zr(o,r)),h=t.rank(a.type,r,zr(a,r)),m=d>=0,p=h>=0;if(m&&p){if(d!==h)return(d-h)*i}else if(m!==p)return m?-1:1}const l=zr(o,r),c=zr(a,r),u=Number(l),f=Number(c);return l!==""&&c!==""&&Number.isFinite(u)&&Number.isFinite(f)?(u-f)*i:l.localeCompare(c)*i})}function RC(n,e){const t=new Map;for(const r of n){const i=e(r),s=t.get(i);s?s.push(r):t.set(i,[r])}return t}function vg(n,e,t){const r=RC(n,o=>zr(o,e)||"(none)");if(!t||![...n].some(o=>t.order(o.type,e)))return r;const i=o=>{let a=1/0;for(const l of o){const c=t.rank(l.type,e,zr(l,e));c>=0&&c<a&&(a=c)}return a},s=[...r.entries()].sort((o,a)=>i(o[1])-i(a[1]));return new Map(s)}function IC(n){const e=n.map(t=>new Ds("details",{class:"rf-accordion-item","data-group":t.key},[new Ds("summary",{class:"rf-accordion-item__header"},[new Ds("span",{class:"rf-accordion-item__title"},[t.label]),new Ds("span",{class:"rf-accordion-item__count"},[String(t.count)])]),new Ds("div",{class:"rf-accordion-item__body"},t.nodes)]));return[new Ds("div",{class:"rf-accordion"},e)]}function fs(n,e,t){const r=Mv(n,e,t);return Array.isArray(r)?r:[r]}const{Tag:Ft,Ast:FZ}=B;function bg(n){return DC(n,"rf-collection")}function jv(n){return Ft.isTag(n)}function qi(n,e){for(const t of n.children??[])if(jv(t)&&t.name==="meta"&&t.attributes["data-field"]===e)return String(t.attributes.content??"");return""}function XZ(n){return(n.children??[]).some(e=>jv(e)&&e.name==="meta"&&e.attributes["data-field"]===_C)}function VZ(n){const e=qi(n,"collection-limit"),t=Number(e);return{types:qi(n,"collection-type").split(",").map(r=>r.trim()).filter(Boolean),filter:qi(n,"collection-filter"),sort:qi(n,"collection-sort"),group:qi(n,"collection-group"),groupDisplay:qi(n,"collection-group-display")||"headings",limit:e&&Number.isFinite(t)&&t>0?Math.floor(t):void 0,fields:qi(n,"collection-fields").split(",").map(r=>r.trim()).filter(Boolean),layout:qi(n,"collection-layout")||"list",bodySource:qi(n,"collection-body"),empty:qi(n,"collection-empty")}}function WZ(n,e){const t=e.fields.map(r=>new Ft("span",{class:"rf-collection__field","data-field":r},[zr(n,r)]));return e.layout==="list"?new Ft("div",{class:"rf-collection__item","data-entity-id":n.id},[bg(n)]):new Ft("article",{class:"rf-collection__card","data-entity-id":n.id},[bg(n),...t])}function YZ(n,e,t){const r=B.parse(n),i=[];let s=null;for(const o of r.children)if(o.type==="heading"){const a=B.format(o).replace(/^#+\s*/,"").trim();a.includes("$item")&&e.warn(`collection: $item in a table column heading ("${a}") is not per-row; use a static label`,t),s={label:a,cellNodes:[]},i.push({label:a,cellSource:""})}else s&&(s.cellNodes.push(o),i[i.length-1].cellSource=B.format(new FZ.Node("document",{},s.cellNodes)));return i}function UZ(n,e,t,r,i,s){const o=YZ(e,r,i);if(!t)return r.error("collection — table column templates present but no embedConfig threaded through the pipeline",i),new Ft("table",{class:"rf-collection__table"},[]);const a=new Ft("thead",{},[new Ft("tr",{},o.map(c=>new Ft("th",{},[c.label])))]),l=n.map(c=>{const u=Bv(c,s),f=o.map(d=>{const h=Mv(d.cellSource,t,{item:u}),m=Array.isArray(h)?h:[h];return new Ft("td",{},m)});return new Ft("tr",{"data-entity-id":c.id},f)});return new Ft("table",{class:"rf-collection__table"},[a,new Ft("tbody",{},l)])}function GZ(n,e){const t=[new Ft("th",{},["Title"]),...e.fields.map(s=>new Ft("th",{},[Ma(s)]))],r=new Ft("thead",{},[new Ft("tr",{},t)]),i=n.map(s=>{const o=[new Ft("td",{},[bg(s)]),...e.fields.map(a=>new Ft("td",{"data-field":a},[zr(s,a)]))];return new Ft("tr",{"data-entity-id":s.id},o)});return new Ft("table",{class:"rf-collection__table"},[r,new Ft("tbody",{},i)])}function HZ(n,e,t,r,i,s){return t?n.map(o=>{const a=Bv(o,s),l=Mv(e,t,{item:a}),c=Array.isArray(l)?l:[l];return new Ft("div",{class:"rf-collection__item","data-entity-id":o.id,"data-block":""},c)}):(r.error("collection — body template present but no embedConfig threaded through the pipeline",i),[])}function Zu(n,e,t,r){if(!e.group)return r(n);const i=vg(n,e.group,t);if(e.groupDisplay==="accordion")return IC([...i].map(([o,a])=>({key:o,label:o,count:a.length,nodes:r(a,{group:o,groupCount:a.length})})));const s=[];for(const[o,a]of i)s.push(new Ft("div",{class:"rf-collection__group","data-group":o},[new Ft("h3",{class:"rf-collection__group-title"},[o]),...r(a,{group:o,groupCount:a.length})]));return s}function KZ(n,e,t,r,i,s){const o=VZ(n);let a=[];for(const b of o.types)a.push(...e.getAll(b));if(o.filter){const b=Og(o.filter);for(const _ of b.warnings)i.warn(`collection filter: ${_}`,s);a=a.filter(_=>Rv(_,b))}a=ZZ(a,o.sort,r);const l=a.length;o.limit!==void 0&&a.length>o.limit&&(a=a.slice(0,o.limit));const c={count:l,shown:a.length},u=Iv(o.bodySource),f=u.template,d={...n.attributes,"data-type":o.types.join(","),"data-layout":o.layout},m={mixed:new Set(a.map(b=>b.type)).size>1&&o.group!=="type",sentiments:t?.sentiments};if(a.length===0){const b=[];return u.fallback&&t?b.push(new Ft("div",{"data-name":"empty",class:"rf-collection__empty"},fs(u.fallback,t,c))):o.empty&&b.push(new Ft("div",{"data-name":"empty",class:"rf-collection__empty"},[o.empty])),new Ft(n.name,d,b)}let p;o.layout==="table"&&f?p=Zu(a,o,r,(b,_)=>[UZ(b,f,t,i,s,{...m,..._})]):f?p=Zu(a,o,r,(b,_)=>HZ(b,f,t,i,s,{...m,..._})):o.layout==="table"?p=Zu(a,o,r,b=>[GZ(b,o)]):p=Zu(a,o,r,b=>b.map(_=>WZ(_,o)));const O=new Ft("div",{"data-name":"items",class:"rf-collection__items"},p),v=[];return u.preamble&&t&&v.push(new Ft("div",{"data-name":"preamble",class:"rf-collection__preamble"},fs(u.preamble,t,c))),new Ft(n.name,d,[...v,O])}function JZ(n,e,t,r,i){const s=Nv(r),o=a=>{if(Array.isArray(a))return a.map(o);if(!jv(a))return a;const l=a;return l.attributes?.["data-rune"]==="collection"&&XZ(l)?KZ(l,t,r,s,i,e):!l.children||l.children.length===0?l:new Ft(l.name,l.attributes,l.children.map(o))};return o(n)}const{Tag:wr}=B;function zv(n){return wr.isTag(n)}function di(n,e){for(const t of n.children??[])if(zv(t)&&t.name==="meta"&&t.attributes["data-field"]===e)return String(t.attributes.content??"");return""}function e7(n){return(n.children??[]).some(e=>zv(e)&&e.name==="meta"&&e.attributes["data-field"]===kC)}function Cp(n){return n.split(",").map(e=>e.trim()).filter(Boolean)}function t7(n){const e=di(n,"relationships-limit"),t=Number(e);return{of:di(n,"relationships-of"),kinds:Cp(di(n,"relationships-kind")),types:Cp(di(n,"relationships-type")),group:di(n,"relationships-group")||"kind",groupDisplay:di(n,"relationships-group-display")||"headings",sort:di(n,"relationships-sort"),limit:e&&Number.isFinite(t)&&t>0?Math.floor(t):void 0,fields:Cp(di(n,"relationships-fields")),layout:di(n,"relationships-layout")||"list",bodySource:di(n,"relationships-body"),empty:di(n,"relationships-empty")}}function n7(n,e,t){if(!e)return n;let r=e.trim(),i=1;r.startsWith("-")?(i=-1,r=r.slice(1)):r.endsWith("-desc")?(i=-1,r=r.slice(0,-5)):r.endsWith("-asc")&&(r=r.slice(0,-4));const s=n.some(o=>t.order(o.target.type,r));return[...n].sort((o,a)=>{if(s){const u=t.rank(o.target.type,r,zr(o.target,r)),f=t.rank(a.target.type,r,zr(a.target,r)),d=u>=0,h=f>=0;if(d&&h){if(u!==f)return(u-f)*i}else if(d!==h)return d?-1:1}const l=zr(o.target,r),c=zr(a.target,r);return l.localeCompare(c)*i})}function tw(n){return DC(n,"rf-relationships")}function r7(n,e){const t=e.fields.map(i=>new wr("span",{class:"rf-relationships__field","data-field":i},[zr(n.target,i)])),r={"data-entity-id":n.target.id,"data-kind":n.kind};return e.layout==="grid"?new wr("article",{class:"rf-relationships__card",...r},[tw(n.target),...t]):new wr("div",{class:"rf-relationships__item",...r},[tw(n.target),...t])}function Tp(n,e,t,r){return n.map(i=>{if(t&&r){const s=fs(t,r,{item:Bv(i.target),kind:i.kind});return new wr("div",{class:"rf-relationships__item","data-entity-id":i.target.id,"data-kind":i.kind,"data-block":""},s)}return r7(i,e)})}function i7(n,e,t,r,i,s){const o=t7(n);o.of||i.warn("relationships — no `of` entity given (pass of=$item.id on an entity page)",s);let a=o.of&&e.getRelated?e.getRelated(o.of,{kind:o.kinds.length?o.kinds:void 0,type:o.types.length?o.types:void 0}):[];a=n7(a,o.sort,r);const l=a.length;o.limit!==void 0&&a.length>o.limit&&(a=a.slice(0,o.limit));const c={count:l,shown:a.length},u=Iv(o.bodySource),f=u.template,d={...n.attributes,"data-of":o.of,"data-layout":o.layout};if(a.length===0){const O=[];return u.fallback&&t?O.push(new wr("div",{"data-name":"empty",class:"rf-relationships__empty"},fs(u.fallback,t,c))):o.empty&&O.push(new wr("div",{"data-name":"empty",class:"rf-relationships__empty"},[o.empty])),new wr(n.name,d,O)}let h;if(o.group==="none")h=Tp(a,o,f,t);else{const O=o.group==="type"?b=>b.target.type:b=>b.kind,v=RC(a,O);if(o.groupDisplay==="accordion")h=IC([...v].map(([b,_])=>({key:b,label:Ma(b),count:_.length,nodes:Tp(_,o,f,t)})));else{h=[];for(const[b,_]of v)h.push(new wr("div",{class:"rf-relationships__group","data-group":b},[new wr("h3",{class:"rf-relationships__group-title"},[Ma(b)]),...Tp(_,o,f,t)]))}}const m=new wr("div",{"data-name":"items",class:"rf-relationships__items"},h),p=[];return u.preamble&&t&&p.push(new wr("div",{"data-name":"preamble",class:"rf-relationships__preamble"},fs(u.preamble,t,c))),new wr(n.name,d,[...p,m])}function s7(n,e,t,r,i){const s=Nv(r),o=a=>{if(Array.isArray(a))return a.map(o);if(!zv(a))return a;const l=a;return l.attributes?.["data-rune"]==="relationships"&&e7(l)?i7(l,t,r,s,i,e):!l.children||l.children.length===0?l:new wr(l.name,l.attributes,l.children.map(o))};return o(n)}const{Tag:_n}=B;function Zv(n){return _n.isTag(n)}function hi(n,e){for(const t of n.children??[])if(Zv(t)&&t.name==="meta"&&t.attributes["data-field"]===e)return String(t.attributes.content??"");return""}function o7(n){return(n.children??[]).some(e=>Zv(e)&&e.name==="meta"&&e.attributes["data-field"]===xC)}function a7(n){const e=hi(n,"aggregate-limit"),t=Number(e);return{types:hi(n,"aggregate-type").split(",").map(r=>r.trim()).filter(Boolean),filter:hi(n,"aggregate-filter"),value:hi(n,"aggregate-value"),group:hi(n,"aggregate-group"),sort:hi(n,"aggregate-sort"),limit:e&&Number.isFinite(t)&&t>0?Math.floor(t):void 0,bodySource:hi(n,"aggregate-body"),empty:hi(n,"aggregate-empty"),layout:hi(n,"aggregate-layout"),chartType:hi(n,"aggregate-chart-type")||"bar",chartTitle:hi(n,"aggregate-chart-title")}}function l7(n,e,t,r){const i=f=>new _n("td",{},[f]),s=f=>new _n("th",{},[f]),o=[Ma(e.group||"group"),"Count"];t&&o.push("Value");const a=new _n("tr",{},o.map(s)),l=n.map(([f,d])=>{const h=NC(r,d,e.group,f),p=[h?new _n("td",{"data-meta-sentiment":h},[Ma(f)]):i(Ma(f)),i(String(d.length))];return t&&p.push(i(String(To(d,t)))),new _n("tr",{},p)}),c=[];e.chartTitle&&c.push(new _n("caption",{},[e.chartTitle])),c.push(new _n("thead",{},[a])),c.push(new _n("tbody",{},l));const u=new _n("table",{"data-name":"data"},c);return new _n("rf-chart",{"data-rune":"chart","data-rune-fields":JSON.stringify({type:e.chartType,stacked:"false"}),"data-type":e.chartType,"data-stacked":"false"},[u])}function md(n,e){return e<=0?0:Math.round(n/e*100)}function To(n,e){return e?n.filter(t=>Rv(t,e)).length:n.length}function NC(n,e,t,r){const i=e[0]?.type??"";return n?.[i]?.[t]?.[r]??""}function nw(n,e,t,r,i){if(!e)return n;let s=e.trim(),o=1;return s.startsWith("-")?(o=-1,s=s.slice(1)):s.endsWith("-desc")?(o=-1,s=s.slice(0,-5)):s.endsWith("-asc")&&(s=s.slice(0,-4)),s==="count"?[...n].sort(([,a],[,l])=>(a.length-l.length)*o):s==="value"?[...n].sort(([,a],[,l])=>(To(a,i)-To(l,i))*o):s==="percent"?[...n].sort(([,a],[,l])=>{const c=md(To(a,i),a.length),u=md(To(l,i),l.length);return(c-u)*o}):[...n].sort(([a,l],[c,u])=>{const f=l[0]?.type??"",d=u[0]?.type??"",h=r.rank(f,t,a),m=r.rank(d,t,c),p=h>=0,O=m>=0;if(p&&O){if(h!==m)return(h-m)*o}else if(p!==O)return p?-1:1;return a.localeCompare(c)*o})}function c7(n,e,t,r,i,s){const o=a7(n);let a=[];for(const C of o.types)a.push(...e.getAll(C));if(o.filter){const C=Og(o.filter);for(const w of C.warnings)i.warn(`aggregate filter: ${w}`,s);a=a.filter(w=>Rv(w,C))}const l=o.value?Og(o.value):null;if(l)for(const C of l.warnings)i.warn(`aggregate value: ${C}`,s);const c=a.length,u=To(a,l),f=o.value?md(u,c):100;if(o.layout==="chart"){if(c===0)return new _n("div",{"data-name":"empty",class:"rf-aggregate__empty"},o.empty?[o.empty]:[]);let C=[...vg(a,o.group,r).entries()];return C=nw(C,o.sort,o.group,r,l),o.limit!==void 0&&C.length>o.limit&&(C=C.slice(0,o.limit)),l7(C,o,l,t?.sentiments)}if(!o.bodySource)return new _n(n.name,{...n.attributes,"data-aggregate":"count","data-count":String(c)},[String(c)]);const d=Iv(o.bodySource),h=d.template,m={...n.attributes,"data-aggregate":"breakdown"};if(c===0){const C=[];if(d.fallback&&t){const w={item:{key:"",count:0,value:0,percent:0,total:0,shown:0}};C.push(new _n("div",{"data-name":"empty",class:"rf-aggregate__empty"},fs(d.fallback,t,w)))}else o.empty&&C.push(new _n("div",{"data-name":"empty",class:"rf-aggregate__empty"},[o.empty]));return new _n(n.name,m,C)}const p=[];if(d.preamble&&t){const C={item:{count:c,value:u,percent:f,total:c}};p.push(new _n("div",{"data-name":"preamble",class:"rf-aggregate__preamble"},fs(d.preamble,t,C)))}if(!o.group){const C=[...p];if(h&&t){const w={item:{key:"",count:c,value:u,percent:f,total:c,shown:1}};C.push(new _n("div",{"data-name":"items",class:"rf-aggregate__items"},fs(h,t,w)))}return new _n(n.name,m,C)}let O=[...vg(a,o.group,r).entries()];O=nw(O,o.sort,o.group,r,l),o.limit!==void 0&&O.length>o.limit&&(O=O.slice(0,o.limit));const v=O.length,b=[];if(h&&t)for(const[C,w]of O){const y=w.length,S=To(w,l),A=o.value?md(S,y):100,x={item:{key:C,count:y,value:S,percent:A,total:c,shown:v,sentiment:NC(t?.sentiments,w,o.group,C)}},k=fs(h,t,x);b.push(new _n("div",{class:"rf-aggregate__group","data-group":C,"data-block":""},k))}const _=new _n("div",{"data-name":"items",class:"rf-aggregate__items"},b);return new _n(n.name,m,[...p,_])}function u7(n,e,t,r,i){const s=Nv(r),o=a=>{if(Array.isArray(a))return a.map(o);if(!Zv(a))return a;const l=a;return l.attributes?.["data-rune"]==="aggregate"&&o7(l)?c7(l,t,r,s,i,e):!l.children||l.children.length===0?l:new _n(l.name,l.attributes,l.children.map(o))};return o(n)}const{Tag:f7}=B;function yg(n){return n==null||typeof n=="string"||typeof n=="number"?n:f7.isTag(n)?{$$mdtype:"Tag",name:n.name,attributes:n.attributes,children:n.children.map(yg)}:n}function d7(n){return Array.isArray(n)?n.map(yg):yg(n)}const{Tag:gd}=B;function h7(n,e,t,r){const i=r?[r]:n.getTypes();for(const s of i){const o=n.getById(s,e,t);if(o)return o}}function p7(n,e,t){const r=e.toLowerCase(),i=t?[t]:n.getTypes(),s=[];for(const o of i)for(const a of n.getAll(o)){const l=a.data.name??"",c=a.data.title??"";(l.toLowerCase()===r||c.toLowerCase()===r)&&s.push(a)}return s}function m7(n){const e=n.data.url||n.sourceUrl;if(!e)return;const t=n.data.headingId;return t?`${e}#${t}`:e}function rw(n,e,t){if(e)return e;if(t){const r=t.data.title,i=t.data.name,s=t.data.text;return r||i||s||n}return n}const BC=/\{([a-zA-Z_$][a-zA-Z0-9_$]*)\}/g;function g7(n){return n.split("/").map(encodeURIComponent).join("/")}function O7(n,e,t){return n.replace(BC,(r,i)=>{const s=i==="id"?e:t[i]??"";return g7(s)})}function v7(n,e,t){return n.replace(BC,(r,i)=>i==="id"?e:t[i]??"")}function b7(n,e){for(const t of e){const r=t.match.exec(n);if(!r)continue;const i=r.groups??{};return{url:O7(t.template,n,i),label:v7(t.label,n,i),type:t.type}}}function y7(n,e){const t=n.indexOf("#");if(t<0)return n;const r=n.slice(0,t),i=n.slice(t),s=o=>o.endsWith("/")?o.slice(0,-1):o;return s(r)===s(e)?i:n}function w7(n,e,t,r){let i=h7(r.registry,n,r.pageUrl,t);if(!i){const c=p7(r.registry,n,t);if(c.length===1)i=c[0];else if(c.length>1){const u=c.map(f=>`${f.type} "${f.data.title||f.data.name||f.id}" on ${f.sourceUrl??"(no URL)"}`).join(", ");r.ctx.warn(`xref "${n}" on ${r.pageUrl} — matches ${c.length} entities (${u}). Add type hint to disambiguate.`,r.pageUrl),i=c[0]}}const s=i?m7(i):void 0;let o;if(i&&s)o={href:s,label:rw(n,e,i),type:i.type,source:"registry",targetType:i.type,entityId:i.id};else{const c=b7(n,r.patterns);c&&(o={href:c.url,label:rw(n,e,i)||c.label,type:i?.type??c.type,source:"pattern",targetType:i?.type,entityId:i?.id},!i&&!e&&(o.label=c.label))}if(!o)return r.ctx.warn(`xref "${n}" on ${r.pageUrl} — entity not found`,r.pageUrl),{tag:new gd("span",{class:"rf-xref rf-xref--unresolved","data-xref-id":n},[e||n])};o.href===r.pageUrl&&r.ctx.info(`xref "${n}" on ${r.pageUrl} — references itself`,r.pageUrl);const a=y7(o.href,r.pageUrl),l={class:`rf-xref rf-xref--${o.type}`,href:a,"data-xref-id":o.entityId??n,"data-xref-source":o.source};return o.targetType&&(l["data-target-type"]=o.targetType),{tag:new gd("a",l,[o.label])}}function _7(n,e,t,r,i){return wg(n,{pageUrl:e,registry:t,patterns:r,ctx:i})}function wg(n,e){if(!gd.isTag(n)){if(Array.isArray(n)){const i=n,s=i.map(o=>wg(o,e));return s.every((o,a)=>o===i[a])?n:s}return n}const t=n;if(t.attributes?.["data-rune"]===$v){const i=t.attributes["data-xref-id"],s=t.attributes["data-xref-label"],o=t.attributes["data-xref-type"];return i?w7(i,s,o,e).tag:new gd("span",{class:"rf-xref rf-xref--unresolved"},[s||"?"])}const r=(t.children??[]).map(i=>wg(i,e));return r.every((i,s)=>i===t.children[s])?t:{...t,children:r}}const{Ast:jC,Tag:_g}=B;function Fu(n,e){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);if(typeof n=="object"&&"$$mdtype"in n){const t=n;if(t.$$mdtype==="Variable"&&Array.isArray(t.path)){let r=e;for(const i of t.path){if(r==null)return"";r=r[i]}return r==null?"":String(r)}}return""}const k7=new Set(["code-group","diff"]);function x7(n,e,t){if(!t.projectRoot)return;let r=!1;return zC(n,e,t,t.projectRoot,i=>{i&&(r=!0)}),r?n:void 0}function zC(n,e,t,r,i){if(n.children)for(let s=0;s<n.children.length;s++){const o=n.children[s];if(o.type==="tag"&&o.tag==="snippet"){n.children[s]=S7(o,e,t,r),i(!0);continue}zC(o,e,t,r,i)}}function Pp(n,e){return new jC.Node("fence",{content:`snippet error: ${e}
|
|
335
335
|
`,language:"text",source:n||"(unresolved)","data-snippet-error":e})}function S7(n,e,t,r){const i=Fu(n.attributes.path,t.variables),s=n.attributes.lines!==void 0?Fu(n.attributes.lines,t.variables):void 0,o=n.attributes.lang!==void 0?Fu(n.attributes.lang,t.variables):void 0,a=n.attributes.linenumbers===!0,l=n.attributes.highlight!==void 0?Fu(n.attributes.highlight,t.variables):void 0;if(!i){const d="snippet `path` attribute is required (and an unresolvable variable reference resolves to empty)";return t.error(d,e.url),Pp("",d)}let c;try{c=EC({pathAttr:i,projectRoot:r,lines:s||void 0,referencingPage:e.relativePath})}catch(d){if(d instanceof rr)return t.error(d.message,e.url),Pp(i,d.message);const h=d.message??String(d);return t.error(`snippet "${i}" failed unexpectedly: ${h}`,e.url),Pp(i,h)}for(const d of c.warnings)t.warn(d,e.url);const u=o&&o.length>0?o:$C(c.relativePath),f={content:c.content,language:u,source:c.relativePath};return s&&(f.lines=s),a&&(f.linenumbers=!0),l&&l.length>0&&(f.highlight=l),new jC.Node("fence",f)}function A7(n,e,t){const r=kg(n.renderable,!1);return r===n.renderable?n:{...n,renderable:r}}function kg(n,e){if(Array.isArray(n)){let l=!1;const c=n.map(u=>{const f=kg(u,e);return f!==u&&(l=!0),f});return l?c:n}if(!_g.isTag(n))return n;const t=n,r=t.attributes?.["data-rune"],i=typeof r=="string"&&k7.has(r),s=e||i;if(t.name==="pre"&&t.attributes?.["data-source"]!==void 0&&!e)return C7(t);if(!t.children||t.children.length===0)return t;let o=!1;const a=t.children.map(l=>{const c=kg(l,s);return c!==l&&(o=!0),c});return o?new _g(t.name,t.attributes,a):t}function C7(n){const e=n.attributes,t=String(e["data-source"]??""),r=e["data-lines"]!==void 0?String(e["data-lines"]):void 0,i={class:"rf-snippet","data-rune":"snippet","data-source-path":t};return r&&(i["data-lines"]=r),new _g("figure",i,[n])}const{Tag:Vo}=B,ZC=/^h[1-6]$/,xg="data-outline-scope";function T7(n){const e=new Set;return Cg(n,[],e),e.size>0&&Tg(n,e),n}function P7(n){const e=[];return Sg(n,!1,e),e}function Sg(n,e,t){if(Array.isArray(n)){for(const o of n)Sg(o,e,t);return}if(!Vo.isTag(n))return;const r=n,i=r.attributes;if(ZC.test(r.name)){if(e)return;const o=Number(r.name.slice(1)),a=typeof i?.id=="string"?i.id:"",l=Ag(r);a&&l&&t.push({level:o,text:l,id:a});return}const s=e||i&&typeof i[xg]=="string";if(!(!r.children||r.children.length===0))for(const o of r.children)Sg(o,!!s,t)}function Ag(n){return typeof n=="string"?n:typeof n=="number"?String(n):Array.isArray(n)?n.map(Ag).join(""):Vo.isTag(n)?(n.children??[]).map(Ag).join(""):""}function Cg(n,e,t){if(Array.isArray(n)){for(const a of n)Cg(a,e,t);return}if(!Vo.isTag(n))return;const r=n,i=r.attributes,s=i&&typeof i[xg]=="string"?i[xg]:void 0;if(ZC.test(r.name)&&e.length>0){const a=e[e.length-1],l=typeof i?.id=="string"?i.id:void 0;l&&!l.startsWith(`${a}--`)&&(t.add(l),r.attributes.id=`${a}--${l}`);return}const o=s!==void 0?[...e,s]:e;if(!(!r.children||r.children.length===0))for(const a of r.children)Cg(a,o,t)}function Tg(n,e){if(Array.isArray(n)){for(const i of n)Tg(i,e);return}if(!Vo.isTag(n))return;const t=n;if(t.attributes?.["data-rune"]==="table-of-contents"){E7(t,e);return}if(t.children)for(const i of t.children)Tg(i,e)}function E7(n,e){for(const t of n.children??[])Pg(t,e)}function Pg(n,e){if(Array.isArray(n)){for(const r of n)Pg(r,e);return}if(!Vo.isTag(n))return;const t=n;(t.name==="ul"||t.name==="ol")&&(t.children=(t.children??[]).filter(r=>{if(!Vo.isTag(r))return!0;const i=r;return i.name!=="li"?!0:!FC(i,e)}));for(const r of t.children??[])Pg(r,e)}function FC(n,e){for(const t of n.children??[]){if(!Vo.isTag(t))continue;const r=t;if(r.name==="a"){const i=r.attributes?.href;if(typeof i=="string"&&i.startsWith("#")&&e.has(i.slice(1)))return!0}if(FC(r,e))return!0}return!1}const{Tag:Qc}=B,$7=new Map;function Q7(n,e,t,r,i,s){return Od(n,{pageUrl:e,registry:t,patterns:r,embedConfig:i,ctx:s,parseCache:$7},[])}function Od(n,e,t){if(Array.isArray(n)){let a=!1;const l=n.map(c=>{const u=Od(c,e,t);return u!==c&&(a=!0),u});return a?l:n}if(!Qc.isTag(n))return n;const r=n;if(r.attributes?.["data-rune"]===Qv)return L7(r,e,t);if(!r.children||r.children.length===0)return r;let s=!1;const o=r.children.map(a=>{const l=Od(a,e,t);return l!==a&&(s=!0),l});return s?new Qc(r.name,r.attributes,o):r}function L7(n,e,t){const r=n.attributes,i=String(r["data-expand-id"]??""),s=r["data-expand-type"],o=r["data-expand-level"],a=r["data-expand-canonical"]==="true",l=r["data-expand-label"];if(!i)return e.ctx.error(`expand placeholder is missing \`primary\`/id attribute on ${e.pageUrl}`,e.pageUrl),Es(i,"missing id attribute");const c=o!==void 0?Number(o):void 0,u=M7(e.registry,i,e.pageUrl,s);if(!u)return e.ctx.error(`expand "${i}" on ${e.pageUrl} — entity not found`,e.pageUrl),Es(i,"entity not found");if(!u.embed&&!(u.sourceFile&&u.extract))return e.ctx.error(`expand "${i}" on ${e.pageUrl} — entity type "${u.type}" does not support embedding (no embed() or sourceFile/extract)`,e.pageUrl),Es(i,`entity type "${u.type}" does not support embedding`);if(t.some(_=>_.type===u.type&&_.id===u.id)){const _=[...t,{type:u.type,id:u.id}].map(C=>`${C.id} (${C.type})`).join(" → ");return e.ctx.error(`expand cycle detected on ${e.pageUrl}. Cycle: ${_}`,e.pageUrl),Es(i,"cycle detected")}let f;if(u.embed)f=u.embed();else{const _=e.embedConfig?.projectRoot;if(!_)return e.ctx.error(`expand "${i}" — no project root configured (embedConfig.projectRoot is unset)`,e.pageUrl),Es(i,"no project root configured");let C;try{C=R7(u.sourceFile,_,e.parseCache)}catch(w){const y=(w instanceof rr,w.message);return e.ctx.error(`expand "${i}" — failed to read source file "${u.sourceFile}": ${y}`,e.pageUrl),Es(i,y)}f=u.extract(C)}if(!f)return e.ctx.error(`expand "${i}" — extractor returned no content; the entity may be out-of-sync with the registry`,e.pageUrl),Es(i,"extractor returned no content");let d=f;if(c!==void 0&&c!==1){const _=c-1,C=[];d=XC(f,_,C),C.length>0&&e.ctx.warn(`expand "${i}" at ${e.pageUrl} — heading demotion (level=${c}) would push ${C.length} heading(s) past H6. Clamped to H6: ${C.map(w=>`"${w}"`).join(", ")}`,e.pageUrl)}if(!e.embedConfig)return e.ctx.error(`expand "${i}" — no embedConfig threaded through the pipeline`,e.pageUrl),Es(i,"no embed transform config");const h=[...t,{type:u.type,id:u.id}],m=B.transform(d,e.embedConfig),p=Od(m,e,h),O=q7(u,e.patterns),v={"data-rune":"expand","data-entity-id":u.id,"data-entity-type":u.type,"data-source":"registry"};c===void 0&&(v["data-outline-scope"]=u.id),O&&(v["data-canonical-href"]=O);const b=[];if(Array.isArray(p)?b.push(...p):b.push(p),a){const _=l||D7(u),C={class:O?"rf-expand__canonical-link":"rf-expand__canonical-link rf-xref--unresolved"};O&&(C.href=O),b.push(new Qc("a",C,[_]))}return new Qc("section",v,b)}function M7(n,e,t,r){const i=r?[r]:n.getTypes();for(const o of i){const a=n.getById(o,e,t);if(a)return a}const s=e.toLowerCase();for(const o of i)for(const a of n.getAll(o)){const l=a.data.name??"",c=a.data.title??"";if(l.toLowerCase()===s||c.toLowerCase()===s)return a}}function q7(n,e){const t=n.sourceUrl,i=n.data.url||t;if(i){const s=n.data.headingId;return s?`${i}#${s}`:i}for(const s of e){const o=s.match.exec(n.id);if(!o)continue;const a=o.groups??{},l=/\{([a-zA-Z_$][a-zA-Z0-9_$]*)\}/g;return s.template.replace(l,(c,u)=>(u==="id"?n.id:a[u]??"").split("/").map(encodeURIComponent).join("/"))}}function D7(n){const e=n.data.title,t=n.data.name;return e?`View ${n.type}: ${e}`:t?`View ${n.type}: ${t}`:`View ${n.type} ${n.id}`}function R7(n,e,t){const r=t.get(n);if(r)return r;const i=sZ({relativePath:n,projectRoot:e}),s=B.parse(i);return t.set(n,s),s}function XC(n,e,t){if(n.type==="heading"){const i=n.attributes.level+e;if(i>6){const s=I7(n);t.push(s),n.attributes.level=6}else n.attributes.level=i}for(const r of n.children??[])XC(r,e,t);return n}function I7(n){const e=[];for(const t of n.walk())t.type==="text"&&typeof t.attributes.content=="string"&&e.push(t.attributes.content);return e.join("")}function Es(n,e){return new Qc("section",{"data-rune":"expand","data-entity-id":n,"data-expand-error":e},[`expand "${n}" — ${e}`])}const{Tag:je}=B,Xu={header:"preamble",eyebrow:"eyebrow",headline:"headline",blurb:"blurb",image:"image"},N7={runes:{Accordion:{block:"accordion",defaultDensity:"full",sections:{preamble:"preamble",headline:"title",blurb:"description"},autoLabel:Xu,editHints:{headline:"inline",eyebrow:"inline",blurb:"inline"}},AccordionItem:{block:"accordion-item",parent:"Accordion",requiresParent:"Accordion",rootAttributes:{"data-state":"closed"},autoLabel:{name:"header"},editHints:{header:"inline",body:"none"}},Details:{block:"details",autoLabel:{summary:"summary"},editHints:{summary:"inline",body:"none"}},Grid:{block:"grid",defaultDensity:"full",childDensity:"compact",modifiers:{mode:{source:"meta",default:"columns"},collapse:{source:"meta",noBemClass:!0},aspect:{source:"meta",noBemClass:!0},stack:{source:"meta",noBemClass:!0},ratio:{source:"meta",noBemClass:!0},valign:{source:"meta",noBemClass:!0},gap:{source:"meta",noBemClass:!0},min:{source:"meta",noBemClass:!0}},styles:{ratio:{prop:"--grid-ratio",transform:Kj},valign:{prop:"--grid-valign",transform:v0},gap:{prop:"--grid-gap",transform:Hj},min:"--grid-min",aspect:"--grid-aspect"},editHints:{cell:"none"}},CodeGroup:{block:"codegroup",interactive:!0,defaultDensity:"compact",modifiers:{title:{source:"meta",noBemClass:!0},overflow:{source:"meta",default:"scroll"}},metaFields:{title:{metaType:"code",condition:"title",renderWhenEmpty:!0}},blocks:{topbar:{fields:["title"],layout:"bar"}},layout:{root:["topbar"]},sections:{topbar:"header"},rootAttributes:{"data-code-host":"true"},editHints:{panel:"code"}},PageSection:{block:"page-section"},TableOfContents:{block:"toc"},Snippet:{block:"snippet"},Expand:{block:"expand"},Badge:{block:"badge"},Bar:{block:"bar"},Deflist:{block:"deflist"},Collection:{block:"collection"},Relationships:{block:"relationships"},FileRef:{block:"file-ref"},Aggregate:{block:"aggregate"},Progress:{block:"progress",modifiers:{sentiment:{source:"meta"}}},Card:{block:"card",modifiers:{"media-position":{source:"meta",default:"top",noBemClass:!0},"media-ratio":{source:"meta",noBemClass:!0},valign:{source:"meta",noBemClass:!0},collapse:{source:"meta",noBemClass:!0},"content-place":{source:"meta",noBemClass:!0},height:{source:"meta",noBemClass:!0},aspect:{source:"meta",noBemClass:!0}},sections:{media:"media"},layout:{root:["media","content"],content:{tag:"div",children:["eyebrow","body","footer"]}},variants:{"media-position":{cover:{staticModifiers:["cover"],rootAttributes:{"data-cover-scope":"full"}}}},styles:{valign:{prop:"--split-valign",transform:v0},aspect:"aspect-ratio"}},Embed:{block:"embed",defaultDensity:"compact",modifiers:{provider:{source:"meta",default:"generic",noBemClass:!0}},editHints:{fallback:"none"}},Breadcrumb:{block:"breadcrumb",defaultDensity:"minimal",editHints:{items:"none"},modifiers:{separator:{source:"meta",default:"/",noBemClass:!0}},styles:{separator:{prop:"--separator",template:'"{}"'}}},BreadcrumbItem:{block:"breadcrumb-item",parent:"Breadcrumb",requiresParent:"Breadcrumb"},Blog:{block:"blog",defaultDensity:"full",sections:{preamble:"preamble",headline:"title",blurb:"description",content:"body"},contentWrapper:{tag:"div",ref:"content"},modifiers:{layout:{source:"meta",default:"list"},sort:{source:"meta",default:"date-desc",noBemClass:!0},filter:{source:"meta",noBemClass:!0},limit:{source:"meta",noBemClass:!0},folder:{source:"meta",noBemClass:!0}},autoLabel:Xu,editHints:{headline:"inline",blurb:"inline"}},Budget:{block:"budget",defaultDensity:"full",sections:{preamble:"preamble",headline:"title",footer:"footer"},editHints:{headline:"inline"},modifiers:{currency:{source:"meta",default:"USD"},duration:{source:"meta"},showPerDay:{source:"meta",default:"true"},variant:{source:"meta",default:"detailed"}},metaFields:{duration:{metaType:"category",condition:"duration"},currency:{metaType:"category",condition:"currency"}},blocks:{meta:{fields:["duration",{field:"currency",align:"end"}],layout:"bar"}},layout:{root:["meta","preamble"],preamble:{tag:"header",children:["headline","blurb","image"]}}},BudgetCategory:{block:"budget-category",parent:"Budget",modifiers:{estimate:{source:"meta",default:"false"},label:{source:"meta",noBemClass:!0},subtotal:{source:"meta",noBemClass:!0}},editHints:{label:"none",subtotal:"none"}},BudgetLineItem:{block:"budget-line-item",parent:"Budget"},Hint:{block:"hint",defaultDensity:"compact",modifiers:{hintType:{source:"meta",default:"note"}},contextModifiers:{hero:"in-hero",feature:"in-feature"},sections:{header:"header"},metaFields:{hintType:{icon:{group:"hint"}}},blocks:{header:{fields:["hintType"],layout:"bar"}},layout:{root:["header"]}},Drawer:{block:"drawer",defaultDensity:"compact",modifiers:{side:{source:"meta",default:"right"},size:{source:"meta",default:"md"},shortcut:{source:"meta",noBemClass:!0}},sections:{header:"header",body:"body",footer:"footer"},editHints:{title:"inline",body:"none",close:"none",footer:"none"}},Figure:{block:"figure",defaultDensity:"compact",frameTarget:"self",modifiers:{size:{source:"meta",default:"default"},align:{source:"meta",default:"center"}},sections:{caption:"description"},editHints:{caption:"inline"}},Gallery:{block:"gallery",defaultDensity:"full",childDensity:"compact",modifiers:{layout:{source:"meta",default:"grid"},lightbox:{source:"meta",default:"true",noBemClass:!0},columns:{source:"meta",noBemClass:!0}},styles:{columns:"--gallery-columns"},editHints:{items:"none"}},Sidenote:{block:"sidenote",defaultDensity:"full",modifiers:{variant:{source:"meta",default:"sidenote"}},sections:{body:"body"},editHints:{body:"inline"}},Compare:{block:"compare",defaultDensity:"full",modifiers:{layout:{source:"meta",default:"side-by-side"}},editHints:{panels:"none"}},Conversation:{block:"conversation",defaultDensity:"compact",editHints:{messages:"none"}},ConversationMessage:{block:"conversation-message",parent:"Conversation",modifiers:{align:{source:"meta",default:"left"}},editHints:{body:"inline"}},Annotate:{block:"annotate",defaultDensity:"full",modifiers:{variant:{source:"meta",default:"margin"}},sections:{body:"body"},editHints:{body:"none",notes:"none"}},AnnotateNote:{block:"annotate-note",parent:"Annotate",editHints:{body:"inline"}},Nav:{block:"nav",defaultDensity:"compact",modifiers:{layout:{source:"attribute"}},postTransform(n){return{...n,name:"rf-nav"}}},NavGroup:{block:"nav-group",parent:"Nav"},Pagination:{block:"pagination",defaultDensity:"compact",modifiers:{scope:{source:"meta",default:"siblings",noBemClass:!0}}},NavItem:{block:"nav-item",parent:"Nav",postTransform(n){let e="";const t=n.children.filter(i=>gn(i)&&i.name==="span"&&i.attributes["data-field"]==="slug"?(e=i.children.filter(s=>typeof s=="string").join(""),!1):!0);if(e)return t.unshift(e),{...n,attributes:{...n.attributes,"data-slug":e},children:t};const r=t.map(i=>{if(gn(i)&&i.name==="a"){const s=i.attributes.class||"";return{...i,attributes:{...i.attributes,class:["rf-nav-item__link",s].filter(Boolean).join(" ")}}}return i});return{...n,children:r}}},Diff:{block:"diff",modifiers:{mode:{source:"meta",default:"unified"}},editHints:{line:"none","gutter-num":"none","gutter-prefix":"none","line-content":"none"}},Chart:{block:"chart",defaultDensity:"compact",modifiers:{type:{source:"meta",default:"bar",noBemClass:!0},stacked:{source:"meta",noBemClass:!0}},editHints:{data:"none"}},PullQuote:{block:"pullquote",defaultDensity:"compact",modifiers:{align:{source:"meta",default:"center"},variant:{source:"meta",default:"default"}},sections:{body:"body"},editHints:{body:"inline"}},TextBlock:{block:"textblock",defaultDensity:"full",modifiers:{dropcap:{source:"meta"},columns:{source:"meta"},lead:{source:"meta"},align:{source:"meta",default:"left"}},sections:{body:"body"},editHints:{body:"none"}},MediaText:{block:"mediatext",defaultDensity:"full",modifiers:{align:{source:"meta",default:"left"},ratio:{source:"meta",default:"1:1"},wrap:{source:"meta"}},sections:{body:"body",media:"media"},mediaSlots:{media:"cover"},editHints:{media:"image",body:"none"}},Showcase:{block:"showcase",defaultDensity:"compact",childDensity:"compact",sections:{viewport:"body"},frameTarget:"self",contextModifiers:{"bento-cell":"in-bento-cell"},editHints:{viewport:"none"}},TabGroup:{block:"tabs",interactive:!0,defaultDensity:"full",sections:{preamble:"preamble",headline:"title",blurb:"description"},autoLabel:Xu,editHints:{headline:"inline",eyebrow:"inline",blurb:"inline"}},Tab:{block:"tab",parent:"TabGroup",requiresParent:"TabGroup",rootAttributes:{"data-state":"inactive"},editHints:{name:"inline"}},TabPanel:{block:"tab-panel",parent:"TabGroup",requiresParent:"TabGroup",rootAttributes:{"data-state":"inactive"}},DataTable:{block:"datatable",interactive:!0,defaultDensity:"compact",sections:{table:"body"},modifiers:{searchable:{source:"meta",default:"false"},sortable:{source:"meta"},pageSize:{source:"meta",default:"0"},defaultSort:{source:"meta"}},editHints:{table:"none"}},Form:{block:"form",interactive:!0,defaultDensity:"full",sections:{body:"body"},modifiers:{variant:{source:"meta",default:"stacked"},action:{source:"meta"},method:{source:"meta",default:"POST"},success:{source:"meta"},error:{source:"meta"},honeypot:{source:"meta",default:"true"}},editHints:{body:"none"}},FormField:{block:"form-field",parent:"Form",modifiers:{fieldType:{source:"meta"}}},Reveal:{block:"reveal",defaultDensity:"full",modifiers:{mode:{source:"meta",default:"click"}},sections:{preamble:"preamble",headline:"title",blurb:"description"},autoLabel:Xu,editHints:{headline:"inline",eyebrow:"inline",blurb:"inline",steps:"none"}},RevealStep:{block:"reveal-step",parent:"Reveal",rootAttributes:{"data-state":"closed"},editHints:{body:"none"}},Juxtapose:{block:"juxtapose",interactive:!0,defaultDensity:"compact",modifiers:{variant:{source:"meta",default:"slider"},orientation:{source:"meta",default:"vertical",noBemClass:!0},position:{source:"meta",default:"50",noBemClass:!0},duration:{source:"meta",default:"1000",noBemClass:!0}},styles:{position:"--jx-position",duration:"--jx-duration"},editHints:{panels:"none"}},JuxtaposePanel:{block:"juxtapose-panel",parent:"Juxtapose",requiresParent:"Juxtapose",rootAttributes:{"data-state":"inactive"},editHints:{body:"none"}},Diagram:{block:"diagram",defaultDensity:"compact",editHints:{source:"code"},modifiers:{language:{source:"meta",default:"mermaid",noBemClass:!0}}},Tint:{block:"tint",parent:"*"},Bg:{block:"bg",parent:"*"},Region:{block:"region",parent:"Layout"},Sandbox:{block:"sandbox",interactive:!0,defaultDensity:"compact",editHints:{source:"code"}}}},B7=N7;function j7(n){const e=new Map;for(const r of n)e.set(r.url,{url:r.url,title:r.title,children:[]});const t={url:"/",title:"Root",children:[]};for(const r of n){const i=e.get(r.url);r.url==="/"?(t.title=r.title,t.children=i.children,e.set("/",t)):(e.get(r.parentUrl)??t).children.push(i)}return t}function z7(n){const e=new Map;for(const r of n)r.url!=="/"&&e.set(r.url,r.parentUrl);const t=new Map;for(const r of n){const i=[];let s=e.get(r.url);for(;s!==void 0;)i.unshift(s),s=e.get(s);t.set(r.url,i)}return t}function Z7(n){if(n==="/"||!n.includes("/"))return"/";const e=n.endsWith("/")?n.slice(0,-1):n,t=e.lastIndexOf("/");return t<=0?"/":e.slice(0,t+1)}function Eg(n,e,t,r,i){if(!je.isTag(n)){if(Array.isArray(n)){const a=n.map(l=>Eg(l,e,t,r,i));return a.every((l,c)=>l===n[c])?n:a}return n}const s=n;if(s.attributes?.["data-rune"]==="breadcrumb"&&s.children?.some(l=>je.isTag(l)&&l.attributes?.["data-field"]===yC))return F7(s,e,t,r,i);const o=(s.children??[]).map(a=>Eg(a,e,t,r,i));return o.every((a,l)=>a===s.children[l])?s:{...s,children:o}}function F7(n,e,t,r,i){const s=t.get(e);if(s===void 0)return i.warn(`Breadcrumb auto: page URL "${e}" not found in page registry`,e),n;const a=n.children?.find(m=>je.isTag(m)&&m.name==="meta"&&!m.attributes?.["data-field"])?.attributes?.content??"/",l=[];for(const m of s){const p=r.get(m);if(!p)continue;const O=new je("span",{hidden:!0},[p.title]),v=new je("a",{href:m},[p.title]);l.push(Ne({rune:"breadcrumb-item",schemaOrgType:"ListItem",tag:"li",properties:{name:O,url:v},children:[O,v]}))}const u=r.get(e)?.title??e,f=new je("span",{},[u]);l.push(Ne({rune:"breadcrumb-item",schemaOrgType:"ListItem",tag:"li",properties:{name:f},children:[f]}));const d=new je("meta",{content:a}),h=new je("ol",{},l);return Ne({rune:"breadcrumb",schemaOrgType:"BreadcrumbList",tag:"nav",properties:{separator:d},refs:{items:h},children:[d,h]})}function $g(n,e,t,r){if(!je.isTag(n)){if(Array.isArray(n)){const o=n.map(a=>$g(a,e,t,r));return o.every((a,l)=>a===n[l])?n:o}return n}const i=n;if(i.attributes?.["data-rune"]==="nav"&&i.children?.some(a=>je.isTag(a)&&a.attributes?.["data-field"]===vC))return X7(e,t,r,i);const s=(i.children??[]).map(o=>$g(o,e,t,r));return s.every((o,a)=>o===i.children[a])?i:{...i,children:s}}function X7(n,e,t,r){const i=Array.from(e.values()).filter(c=>c.parentUrl===n&&c.url!==n);i.length===0&&t.warn(`Nav auto: page '${n}' has no registered child pages`,n);const s=i.map(c=>{const u=new je("span",{"data-field":"slug"},[c.title]),f=new je("a",{href:c.url},[u]);return Ne({rune:"nav-item",tag:"li",properties:{slug:u},children:[f]})}),o=new je("ul",{},s),a=Ne({rune:"nav",tag:"nav",properties:{group:[],item:s},children:[o]}),l=["layout","data-layout","data-auto","data-source-path","data-collapsible","data-default-open"];for(const c of l){const u=r?.attributes?.[c];u!==void 0&&(a.attributes[c]=u)}return a}function nc(n){let e=n.trim();return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e.endsWith("/index")&&(e=e.slice(0,-6)||"/"),e.toLowerCase()}function V7(n){const e=n.split("/").filter(Boolean);return e.pop(),e.length===0?"/":"/"+e.join("/")+"/"}function W7(n,e){if(n===e)return 0;if(n.length===0)return e.length;if(e.length===0)return n.length;const t=new Array(e.length+1),r=new Array(e.length+1);for(let i=0;i<=e.length;i++)t[i]=i;for(let i=1;i<=n.length;i++){r[0]=i;for(let s=1;s<=e.length;s++){const o=n[i-1]===e[s-1]?0:1;r[s]=Math.min(r[s-1]+1,t[s]+1,t[s-1]+o)}for(let s=0;s<=e.length;s++)t[s]=r[s]}return t[e.length]}function Y7(n,e,t){const r=e.endsWith("/")?e:e+"/",i=n.toLowerCase(),s=[],o=[],a=(r+n).replace(/\/+/g,"/").toLowerCase();for(const c of t.values()){const u=c.url,f=u.toLowerCase(),h=(u.split("/").filter(Boolean).pop()??"").toLowerCase();if(h===i&&f!==a){s.push(u);continue}if(f.startsWith(r.toLowerCase())){const m=W7(i,h);m>0&&m<=2&&o.push({url:u,distance:m})}}return s.sort(),o.sort((c,u)=>c.distance-u.distance||c.url.localeCompare(u.url)),[...s,...o.map(c=>c.url)].slice(0,3)}function U7(n,e,t){if(n.startsWith("/"))return{ok:!0,url:n};const r=e.endsWith("/")?e:e+"/",i=(r+n).replace(/\/+/g,"/"),s=nc(i);for(const a of t.values())if(nc(a.url)===s)return{ok:!0,url:a.url};const o=Y7(n.includes("/")?n.split("/").pop():n,r,t);return{ok:!1,reason:"not-found",attemptedUrl:i,suggestions:o}}function iw(n,e){let t=0;for(;t<n.length&&t<e.length&&n[t]===e[t];)t++;return t}function Lc(n,e,t){const r=Array.from(e.values()).filter(i=>i.url.endsWith("/"+n)||i.url==="/"+n);return r.length===0?null:r.length===1?r[0].url:r.slice().sort((i,s)=>iw(s.url,t)-iw(i.url,t))[0].url}function Mc(n){const e=n.attributes?.["data-slug"];if(e)return String(e);const t=r=>{if(!je.isTag(r)){if(Array.isArray(r))for(const s of r){const o=t(s);if(o)return o}return null}const i=r;if(i.name==="span"&&i.attributes?.["data-field"]==="slug"){const s=[];for(const o of i.children??[])typeof o=="string"&&s.push(o);return s.join("").trim()||null}for(const s of i.children??[]){const o=t(s);if(o)return o}return null};return t(n)}function G7(n,e,t){const r=[],i=s=>{if(!je.isTag(s)){Array.isArray(s)&&s.forEach(i);return}const o=s;if(o.attributes?.["data-rune"]==="nav-item"){const a=qc(o);if(a)r.push(a);else{const l=Mc(o);if(l){const c=Lc(l,e,t);c&&r.push(c)}}}(o.children??[]).forEach(i)};return(n.children??[]).forEach(i),r}function H7(n){const e=t=>{if(typeof t=="string")return t;if(!je.isTag(t)){if(Array.isArray(t))for(const i of t){const s=e(i);if(s)return s}return null}const r=t;if(r.attributes?.["data-field"]==="title"){const i=[];for(const s of r.children??[])typeof s=="string"&&i.push(s);if(i.length>0)return i.join("").trim()}for(const i of r.children??[]){const s=e(i);if(s)return s}return null};return e(n)??""}function K7(n,e){for(const t of e){if(!t)continue;if(n===t)return!0;const r=t.endsWith("/")?t:t+"/";if(n.startsWith(r))return!0}return!1}function Of(n,e,t){if(!je.isTag(n)){if(Array.isArray(n)){const s=n.map(o=>Of(o,e,t));return s.every((o,a)=>o===n[a])?n:s}return n}const r=n;if(r.attributes?.["data-rune"]==="nav"&&r.attributes?.["data-collapsible"]==="true"){const s=String(r.attributes?.["data-default-open"]??""),o=s?s.split(",").map(u=>u.trim()).filter(Boolean):[],a=[],l=u=>{if(!je.isTag(u))return;const f=u;f.attributes?.["data-rune"]==="nav-group"&&a.push(f),(f.children??[]).forEach(l)};(r.children??[]).forEach(l);for(const u of a){if(u.attributes?.["data-collapsed"]!==bC)continue;const f=H7(u),d=f&&o.includes(f),h=G7(u,t,e),m=K7(e,h);u.attributes["data-collapsed"]=d||m?"false":"true"}const c=(r.children??[]).map(u=>Of(u,e,t));return c.every((u,f)=>u===r.children[f])?r:{...r,children:c}}const i=(r.children??[]).map(s=>Of(s,e,t));return i.every((s,o)=>s===r.children[o])?r:{...r,children:i}}function sw(n,e,t){const r=e?.title??t??"",i=e?.description,s=e?.icon,o=e?.url??t??"",a=[];s&&a.push(new je("rf-icon",{name:s,"data-name":"icon",class:"rf-nav-item__icon"},[])),a.push(new je("span",{"data-name":"title",class:"rf-nav-item__title"},[r])),i&&a.push(new je("span",{"data-name":"description",class:"rf-nav-item__description"},[i]));const l=o?new je("a",{href:o,class:"rf-nav-item__link"},a):new je("span",{class:"rf-nav-item__link"},a);return{...n,children:[l]}}function qc(n){const e=t=>{if(!je.isTag(t)){if(Array.isArray(t))for(const i of t){const s=e(i);if(s)return s}return null}const r=t;if(r.name==="a"&&r.attributes?.href)return String(r.attributes.href);for(const i of r.children??[]){const s=e(i);if(s)return s}return null};return e(n)}function J7(n,e,t){const r=qc(n);if(r){const s=/^[a-z]+:\/\//i.test(r);return{url:r,isExternal:s}}const i=Mc(n);if(i){const s=Lc(i,e,t);return s?{url:s,isExternal:!1}:null}return null}function eF(n,e){const t=(n.children??[]).map(r=>{if(!je.isTag(r))return r;const i=r;if(i.name!=="a")return r;const s=(i.children??[]).some(l=>je.isTag(l)&&l.attributes?.["data-name"]==="icon"),o=(i.children??[]).some(l=>je.isTag(l)&&l.attributes?.["data-name"]==="description"),a=[...i.children??[]];return e.icon&&!s&&a.unshift(new je("rf-icon",{name:e.icon,"data-name":"icon",class:"rf-nav-item__icon"},[])),e.description&&!o&&a.push(new je("span",{"data-name":"description",class:"rf-nav-item__description"},[e.description])),{...i,children:a}});return{...n,children:t}}function Qg(n,e,t){if(!je.isTag(n)){if(Array.isArray(n)){const s=n.map(o=>Qg(o,e,t));return s.every((o,a)=>o===n[a])?n:s}return n}const r=n;if(r.attributes?.["data-rune"]==="nav"){const o=(r.attributes?.["data-layout"]??r.attributes?.layout)==="cards",a=r.attributes?.["data-auto"]==="true";if(o||a){const l=u=>{if(!je.isTag(u))return Array.isArray(u)?u.map(l):u;const f=u;if(f.attributes?.["data-rune"]==="nav-item"){const h=J7(f,t,e);if(!h)return f;if(o){if(h.isExternal)return sw(f,null,h.url);const O=t.get(h.url),v=O?{url:O.url,title:O.title,description:O.description,icon:O.icon}:null;return sw(f,v,h.url)}if(h.isExternal)return f;const m=t.get(h.url);if(!m)return f;const p={url:m.url,title:m.title,description:m.description,icon:m.icon};return eF(f,p)}const d=(f.children??[]).map(l);return d.every((h,m)=>h===f.children[m])?f:{...f,children:d}},c=(r.children??[]).map(l);return{...r,children:c}}}const i=(r.children??[]).map(s=>Qg(s,e,t));return i.every((s,o)=>s===r.children[o])?r:{...r,children:i}}function tF(n){return/^[a-z]+:\/\//i.test(n)||n.startsWith("mailto:")||n.startsWith("//")}function nF(n,e,t,r){const i=e?` in ${e}`:"",s=`Nav item \`${n}\`${i} cannot be resolved (no page at \`${t}\`).`;if(r.length===0)return s;const o=["","Did you mean one of:",...r.map(a=>` - ${a}`),"","Use a multi-segment slug (e.g. `section/page`) or an explicit `[Label](/path)` link."];return s+`
|
|
336
336
|
`+o.join(`
|
|
337
337
|
`)}function rF(n,e,t,r){const i=n.attributes?.["data-source-path"],s=V7(i??""),o=a=>{if(!je.isTag(a)){if(Array.isArray(a)){const u=a.map(o);return u.every((f,d)=>f===a[d])?a:u}return a}const l=a;if(l.attributes?.["data-rune"]==="nav-item"){if(qc(l))return l;const f=Mc(l);if(!f)return l;const d=U7(f,s,e);if(!d.ok)return t.error(nF(f,i,d.attemptedUrl,d.suggestions),r),l;const m=e.get(d.url)?.title??f,p=new je("a",{href:d.url},[m]),O=(l.children??[]).filter(v=>{if(typeof v=="string")return!1;if(je.isTag(v)){const b=v;if(b.name==="span"&&b.attributes?.["data-field"]==="slug")return!1}return!0});return{...l,children:[p,...O]}}const c=(l.children??[]).map(o);return c.every((u,f)=>u===l.children[f])?l:{...l,children:c}};return o(n)}function Lg(n,e,t,r){if(!je.isTag(n)){if(Array.isArray(n)){const o=n.map(a=>Lg(a,e,t,r));return o.every((a,l)=>a===n[l])?n:o}return n}const i=n;if(i.attributes?.["data-rune"]==="nav")return rF(i,e,t,r);const s=(i.children??[]).map(o=>Lg(o,e,t,r));return s.every((o,a)=>o===i.children[a])?i:{...i,children:s}}function iF(n,e){const t=nc(e),r=s=>{const o=[],a=f=>{if(!je.isTag(f)){Array.isArray(f)&&f.forEach(a);return}const d=f;if(d.name==="a"&&typeof d.attributes?.href=="string"){const h=String(d.attributes.href);tF(h)||o.push({tag:d,href:h})}(d.children??[]).forEach(a)};(s.children??[]).forEach(a);let l=null;for(const{tag:f,href:d}of o)if(nc(d)===t){l=f;break}let c=null,u=0;for(const{tag:f,href:d}of o){if(f===l)continue;const h=nc(d);if(h==="/"&&t==="/")continue;h!==t&&(t.startsWith(h+"/")||h==="/"&&t.startsWith("/"))&&h.length>u&&(c=f,u=h.length)}return l&&(l.attributes["aria-current"]="page"),c&&(c.attributes["data-active"]="ancestor"),s},i=s=>{if(!je.isTag(s))return Array.isArray(s)&&s.forEach(i),s;const o=s;return o.attributes?.["data-rune"]==="nav"?(r(o),o):((o.children??[]).forEach(i),o)};return i(n),n}function sF(n,e,t){const r=[],i=s=>{if(!je.isTag(s)){Array.isArray(s)&&s.forEach(i);return}const o=s;if(o.attributes?.["data-rune"]==="nav"){const a=o.attributes?.layout??o.attributes?.["data-layout"];if(a&&a!=="vertical"){(o.children??[]).forEach(i);return}const l=[],c=u=>{if(!je.isTag(u)){Array.isArray(u)&&u.forEach(c);return}const f=u;f.attributes?.["data-rune"]==="nav-group"&&l.push(f),(f.children??[]).forEach(c)};if((o.children??[]).forEach(c),l.length===0){const u=[],f=d=>{if(!je.isTag(d)){Array.isArray(d)&&d.forEach(f);return}const h=d;if(h.attributes?.["data-rune"]==="nav-item"){const m=qc(h);if(m)/^[a-z]+:\/\//i.test(m)||u.push(m);else{const p=Mc(h);if(p){const O=Lc(p,e,t);O&&u.push(O)}}}(h.children??[]).forEach(f)};(o.children??[]).forEach(f),u.length>0&&r.push(u)}else for(const u of l){const f=[],d=h=>{if(!je.isTag(h)){Array.isArray(h)&&h.forEach(d);return}const m=h;if(m.attributes?.["data-rune"]==="nav-item"){const p=qc(m);if(p)/^[a-z]+:\/\//i.test(p)||f.push(p);else{const O=Mc(m);if(O){const v=Lc(O,e,t);v&&f.push(v)}}}(m.children??[]).forEach(d)};(u.children??[]).forEach(d),f.length>0&&r.push(f)}}(o.children??[]).forEach(i)};return i(n),r}function oF(n,e,t){const r=e.get(n);if(!r)return[];const i=Array.from(e.values());let s;if(t==="section"){let o=n,a=r;for(;a&&a.parentUrl&&a.parentUrl!=="/";){const c=e.get(a.parentUrl);if(!c)break;o=c.url,a=c}const l=o.endsWith("/")?o:o+"/";s=i.filter(c=>c.url===o||c.url.startsWith(l))}else s=i.filter(o=>o.parentUrl===r.parentUrl);return s.sort((o,a)=>{const l=o.order??Number.POSITIVE_INFINITY,c=a.order??Number.POSITIVE_INFINITY;return l!==c?l-c:o.url.localeCompare(a.url)}),s.map(o=>({url:o.url,title:o.title}))}function aF(n,e,t){const r=n.indexOf(e);if(r===-1)return{prev:null,next:null};const i=r>0?n[r-1]:null,s=r<n.length-1?n[r+1]:null,o=a=>{if(!a)return null;const l=t.get(a);return l?{url:l.url,title:l.title}:{url:a,title:a}};return{prev:o(i),next:o(s)}}function ow(n,e,t){const r=e==="prev"?"←":"→",i=t??n.title,s=e==="prev"?[new je("span",{"data-name":"marker"},[r]),new je("span",{"data-name":"label"},[i])]:[new je("span",{"data-name":"label"},[i]),new je("span",{"data-name":"marker"},[r])];return new je("a",{href:n.url,"data-direction":e,"data-name":e},s)}function Mg(n,e,t,r){if(!je.isTag(n)){if(Array.isArray(n)){const o=n.map(a=>Mg(a,e,t,r));return o.every((a,l)=>a===n[l])?n:o}return n}const i=n;if(i.attributes?.["data-rune"]==="pagination"){if((i.children??[]).some(l=>je.isTag(l)&&l.attributes?.["data-field"]===ug)){const l=(i.children??[]).find(S=>je.isTag(S)&&S.attributes?.["data-field"]==="scope"),u=String(l?l.attributes?.content??"":i.attributes?.["data-scope"]??"")==="section"?"section":"siblings",f=(i.children??[]).find(S=>je.isTag(S)&&S.attributes?.["data-field"]==="prev-label"),d=(i.children??[]).find(S=>je.isTag(S)&&S.attributes?.["data-field"]==="next-label"),h=f?String(f.attributes.content??""):void 0,m=d?String(d.attributes.content??""):void 0;if(Array.from(t.values()).some(S=>S.parentUrl===e&&S.url!==e))return{...i,children:[]};let O=null;const v=sF(r,t,e);for(const S of v)if(S.includes(e)){O=S;break}let b=null,_=null;if(O)({prev:b,next:_}=aF(O,e,t));else{const S=oF(e,t,u),A=S.findIndex(x=>x.url===e);A!==-1&&(b=A>0?S[A-1]:null,_=A<S.length-1?S[A+1]:null)}const C=[];b&&C.push(ow(b,"prev",h)),_&&C.push(ow(_,"next",m));const w=new Set([ug,"prev-label","next-label","scope"]),y=(i.children??[]).filter(S=>{if(!je.isTag(S)||S.name!=="meta")return!0;const A=S.attributes?.["data-field"];return!w.has(A)});return{...i,children:[...y,...C]}}const a=(i.children??[]).map(l=>{if(!je.isTag(l))return l;if(l.name==="a"&&typeof l.attributes?.href=="string"&&l.attributes.href.startsWith("__slug:")){const c=l.attributes.href.slice(7),u=Lc(c,t,e);if(u){const d=t.get(u)?.title??c,h=(l.children??[]).map(m=>je.isTag(m)&&m.attributes?.["data-name"]==="label"&&(m.children??[]).filter(O=>typeof O=="string").join("")===c?{...m,children:[d]}:m);return{...l,attributes:{...l.attributes,href:u},children:h}}}return l});return{...i,children:a}}const s=(i.children??[]).map(o=>Mg(o,e,t,r));return s.every((o,a)=>o===i.children[a])?i:{...i,children:s}}function qg(n,e){if(je.isTag(n)){const t=e(n);if(t!==n)return t;const r=n.children.map(s=>qg(s,e));return r.some((s,o)=>s!==n.children[o])?new je(n.name,n.attributes,r):n}return Array.isArray(n)?n.map(t=>qg(t,e)):n}function lF(n){let e=n.trim();return e.startsWith("/")||(e="/"+e),e.endsWith("/")||(e+="/"),e}function cF(n,e){return n.startsWith(e)?n.slice(e.length).replace(/\/$/,"").split("/").filter(Boolean).length===1:!1}function uF(n){return!n||!n.trim()?[]:n.split(",").map(e=>{const t=e.indexOf(":");return t===-1?{field:e.trim(),value:""}:{field:e.slice(0,t).trim(),value:e.slice(t+1).trim()}})}function fF(n,e){for(const{field:t,value:r}of e){const i=n.frontmatter[t];if(r===""){if(i==null)return!1}else if(Array.isArray(i)){if(!i.some(s=>String(s).toLowerCase()===r.toLowerCase()))return!1}else if(String(i??"").toLowerCase()!==r.toLowerCase())return!1}return!0}function dF(n,e){const t=[...n];switch(e){case"date-asc":t.sort((r,i)=>(r.date||"").localeCompare(i.date||""));break;case"title-asc":t.sort((r,i)=>r.title.localeCompare(i.title));break;case"title-desc":t.sort((r,i)=>i.title.localeCompare(r.title));break;default:t.sort((r,i)=>(i.date||"").localeCompare(r.date||""));break}return t}function hF(n){const t=[new je("h3",{},[new je("a",{href:n.url},[n.title])])];return n.date&&t.push(new je("time",{datetime:n.date},[n.date])),n.description&&t.push(new je("p",{},[n.description])),new je("article",{"data-name":"post"},t)}function pF(n,e,t,r){let i=!1;const s=qg(n,o=>{if(o.attributes["data-rune"]!=="blog")return o;const a=Co(o,"folder")??"",l=Co(o,"sort")||"date-desc",c=Co(o,"filter")??"",u=Co(o,"limit")??"",f=u?parseInt(u,10):void 0;if(!a)return t.warn("Blog rune missing folder attribute",r),o;const d=lF(a),h=uF(c);let m=e.filter(_=>!(_.draft||!cF(_.url,d)||h.length>0&&!fF(_,h)));m=dF(m,l),f&&f>0&&(m=m.slice(0,f));const p=o.children.find(_=>je.isTag(_)&&_.attributes["data-name"]==="posts");if(!je.isTag(p))return o;const O=m.map(hF);i=!0;const v=new je(p.name,p.attributes,O),b=o.children.map(_=>_===p?v:_);return new je(o.name,o.attributes,b)});return i?s:n}function mF(n={}){const e=n.xrefPatterns??[],t=n.embedConfig,r=n.repoUrl,i=n.repoBranch;return{preprocess:x7,register(s,o,a){for(const l of s){const c=Z7(l.url),u=o.getById("page",l.url);u&&u.sourceUrl!==l.url&&a.warn(`Page '${l.url}' already registered from '${u.sourceUrl}'`,l.url),o.register({type:"page",id:l.url,sourceUrl:l.url,data:{title:l.title,url:l.url,parentUrl:c,draft:l.frontmatter.draft??!1,description:l.frontmatter.description,date:l.frontmatter.date,order:l.frontmatter.order,icon:l.frontmatter.icon}});for(const f of l.headings){const d=`${l.url}#${f.id}`,h=o.getById("heading",d);h&&h.sourceUrl!==l.url&&a.warn(`Heading '${d}' already registered from '${h.sourceUrl}'`,l.url),o.register({type:"heading",id:d,sourceUrl:l.url,data:{level:f.level,text:f.text,headingId:f.id,url:l.url}})}}U9(s,o,a)},aggregate(s,o){const a=s.getAll("page"),l=a.map(m=>({url:m.data.url,title:m.data.title,parentUrl:m.data.parentUrl,description:m.data.description,icon:m.data.icon,order:m.data.order})),c=j7(l),u=z7(l),f=new Map(l.map(m=>[m.url,m])),d=new Map;for(const m of s.getAll("heading"))d.set(m.id,m.data);const h=a.map(m=>({title:m.data.title||"",url:m.data.url||m.id,date:m.data.date||"",description:m.data.description||"",draft:m.data.draft||!1,frontmatter:m.data}));return{pageTree:c,breadcrumbPaths:u,pagesByUrl:f,headingIndex:d,allPosts:h,registry:s,xrefPatterns:e,embedConfig:t,repoUrl:r,repoBranch:i}},postProcess(s,o,a){const l=o.__core__;if(!l)return s;let c=Eg(s.renderable,s.url,l.breadcrumbPaths,l.pagesByUrl,a);c=$g(c,s.url,l.pagesByUrl,a),c=Lg(c,l.pagesByUrl,a,s.url),c=Of(c,s.url,l.pagesByUrl),c=Qg(c,s.url,l.pagesByUrl),c=Mg(c,s.url,l.pagesByUrl,c),c=iF(c,s.url),c=pF(c,l.allPosts,a,s.url),c=H9(c),c=cZ(c,s.url,l.repoUrl,l.repoBranch,a),c=hZ(c,s.url,l.registry,a),c=J9(c,s.url,l.registry,l.embedConfig?.projectRoot,a),c=Q7(c,s.url,l.registry,l.xrefPatterns??[],l.embedConfig,a),c=JZ(c,s.url,l.registry,l.embedConfig,a),c=s7(c,s.url,l.registry,l.embedConfig,a),c=u7(c,s.url,l.registry,l.embedConfig,a),c=_7(c,s.url,l.registry,l.xrefPatterns??[],a);const u=A7(c===s.renderable?s:{...s,renderable:c});T7(u.renderable);const f=P7(u.renderable);return f.length>0||u.headings.length>0?{...u,headings:f}:u}}}mF();const gF={nav:He({name:"nav",schema:M6,description:"Navigation structure with page slug references and optional grouping",typeName:"Nav",category:"Site",snippet:["{% nav %}","## ${1:Section}","","- ${2:page-slug}","- ${3:another-page}","{% /nav %}"]}),region:He({name:"region",schema:R6,description:"Named content block within a layout definition",snippet:['{% region name="${1:header}" %}',"$0","{% /region %}"]}),layout:He({name:"layout",schema:N6,description:"Layout definition containing named regions",category:"Site",snippet:["{% layout %}",'{% region name="${1:header}" %}',"$0","{% /region %}","{% /layout %}"]}),codegroup:He({name:"codegroup",schema:m6,description:"Tabbed code block with language tabs",typeName:"CodeGroup",category:"Code & Data",snippet:["{% codegroup %}","```${1:js}","$0","```","","```${2:ts}","","```","{% /codegroup %}"]}),error:He({name:"error",schema:t6,description:"Error reporting table",typeName:"Error",category:"Semantic"}),grid:He({name:"grid",aliases:["columns"],schema:c6,description:"Grid layout container with configurable columns and rows",typeName:"Grid",category:"Layout",snippet:["{% grid columns=${1:2} %}","${2:First column content}","","---","","${3:Second column content}","{% /grid %}"]}),hint:He({name:"hint",aliases:["callout","alert"],schema:b6,description:"Callout/admonition block with type variants (note, warning, caution, check)",typeName:"Hint",category:"Content",snippet:['{% hint type="${1|note,warning,caution,check|}" %}',"$0","{% /hint %}"]}),tab:He({name:"tab",schema:A6,description:"Individual tab within a tab group",typeName:"Tab"}),tabs:He({name:"tabs",schema:T6,description:"Tabbed interface with tab panels",typeName:"TabGroup",category:"Layout",snippet:["{% tabs %}","## ${1:Tab One}","","${2:Content for tab one.}","","## ${3:Tab Two}","","${4:Content for tab two.}","{% /tabs %}"]}),details:He({name:"details",schema:j6,description:"Collapsible disclosure block for supplementary content",typeName:"Details",category:"Content",snippet:['{% details summary="${1:Click to expand}" %}',"$0","{% /details %}"]}),drawer:He({name:"drawer",schema:X6,description:"Modal side panel addressed by id. Triggered by xrefs anywhere on the page; falls back to in-flow rendering without JS.",typeName:"Drawer",category:"Layout",snippet:['{% drawer id="${1:auth-explainer}" title="${2:Auth system}" %}',"$0","{% /drawer %}"]}),figure:He({name:"figure",schema:Y6,description:"Enhanced image with caption, attribution, and sizing",seoType:"ImageObject",typeName:"Figure",schemaOrgType:"ImageObject",category:"Content",snippet:['{% figure size="${1|medium,small,large,full|}" %}',"","","${4:Caption text}","{% /figure %}"]}),gallery:He({name:"gallery",schema:G6,description:"Multi-image container with grid, carousel, or masonry layout and optional lightbox",seoType:"ImageGallery",typeName:"Gallery",schemaOrgType:"ImageGallery",category:"Content",snippet:['{% gallery layout="${1|grid,carousel,masonry|}" %}',"","","","{% /gallery %}"]}),accordion:He({name:"accordion",aliases:["faq"],schema:K6,description:"Collapsible accordion sections where headings become toggleable headers",seoType:"FAQPage",typeName:"Accordion",schemaOrgType:"FAQPage",category:"Layout",snippet:["{% accordion %}","## ${1:First Question}","","${2:Answer to the first question.}","","## ${3:Second Question}","","${4:Answer to the second question.}","{% /accordion %}"]}),"accordion-item":He({name:"accordion-item",schema:H6,description:"Individual accordion section",typeName:"AccordionItem",schemaOrgType:"Question"}),toc:He({name:"toc",aliases:["table-of-contents"],schema:J6,description:"Auto-generated table of contents from document headings",typeName:"TableOfContents",category:"Site",snippet:["{% toc /%}"]}),embed:He({name:"embed",schema:n8,description:"Embedded content from external services (YouTube, Twitter, CodePen, Spotify)",seoType:"VideoObject",typeName:"Embed",schemaOrgType:"VideoObject",category:"Content",snippet:['{% embed url="${1:https://}" /%}']}),breadcrumb:He({name:"breadcrumb",schema:r8,description:"Navigation breadcrumb trail showing page hierarchy",seoType:"BreadcrumbList",typeName:"Breadcrumb",schemaOrgType:"BreadcrumbList",category:"Site",snippet:["{% breadcrumb /%}"]}),pagination:He({name:"pagination",schema:i8,description:"Sequential prev/next links for ordered docs and tutorials",typeName:"Pagination",category:"Site",snippet:["{% pagination auto /%}"]}),budget:He({name:"budget",schema:v8,description:"Structured cost breakdown with categories, line items, and auto-calculated totals",seoType:"ItemList",typeName:"Budget",schemaOrgType:"ItemList",category:"Semantic",snippet:["{% budget %}","## ${1:Category}","","- ${2:Item description}: \\$${3:100}","- ${4:Another item}: \\$${5:200}","{% /budget %}"]}),"budget-category":He({name:"budget-category",schema:m8,description:"Cost category within a budget containing line items",typeName:"BudgetCategory"}),"budget-line-item":He({name:"budget-line-item",schema:d8,description:"Individual budget line item with description and amount",typeName:"BudgetLineItem"}),compare:He({name:"compare",schema:y8,description:"Side-by-side code comparison with labeled panels",typeName:"Compare",category:"Code & Data",snippet:["{% compare %}","```${1:js}","${2:// Before}","```","","```${3:js}","${4:// After}","```","{% /compare %}"]}),datatable:He({name:"datatable",aliases:["data-table"],schema:w8,description:"Interactive data table with sorting, filtering, and pagination from a Markdown table",seoType:"Dataset",typeName:"DataTable",schemaOrgType:"Dataset",category:"Code & Data",snippet:["{% datatable %}","| ${1:Column A} | ${2:Column B} | ${3:Column C} |","|---|---|---|","| ${4:Data} | ${5:Data} | ${6:Data} |","{% /datatable %}"]}),diff:He({name:"diff",schema:P8,description:"Side-by-side or unified diff view between two code blocks",typeName:"Diff",category:"Code & Data",snippet:["{% diff %}","```${1:js}","${2:// Before}","```","","```${3:js}","${4:// After}","```","{% /diff %}"]}),snippet:He({name:"snippet",schema:g6,description:"Embed a project file as a syntax-highlighted code block. Composes inside codegroup, diff, and any future fence-consuming rune via pre-resolve (SPEC-062).",typeName:"Snippet",category:"Code & Data",snippet:['{% snippet path="${1:src/lib/foo.ts}" /%}']}),chart:He({name:"chart",schema:Q8,description:"Chart visualization from a Markdown table. First column becomes axis labels, header row becomes series names.",typeName:"Chart",category:"Code & Data",snippet:['{% chart type="${1|bar,line,pie,area|}" %}',"| ${2:Label} | ${3:Series A} | ${4:Series B} |","|---|---|---|","| ${5:Item 1} | ${6:10} | ${7:20} |","| ${8:Item 2} | ${9:30} | ${10:15} |","{% /chart %}"]}),diagram:He({name:"diagram",schema:M8,description:"Diagram rendering from Mermaid, PlantUML, or ASCII art code blocks",typeName:"Diagram",category:"Code & Data",snippet:['{% diagram language="${1|mermaid,plantuml,ascii|}" %}',"```${1:mermaid}","$0","```","{% /diagram %}"]}),sidenote:He({name:"sidenote",aliases:["footnote","marginnote"],schema:R8,description:"Margin note or footnote displayed alongside the main content",typeName:"Sidenote",category:"Content",snippet:["{% sidenote %}","$0","{% /sidenote %}"]}),conversation:He({name:"conversation",aliases:["dialogue","chat"],schema:B8,description:"Chat/dialogue display where blockquotes become alternating speaker messages",typeName:"Conversation",category:"Semantic",snippet:["{% conversation %}","> **${1:Alice}**: ${2:Hello!}","","> **${3:Bob}**: ${4:Hi there!}","{% /conversation %}"]}),"conversation-message":He({name:"conversation-message",schema:I8,description:"Individual message within a conversation",typeName:"ConversationMessage"}),reveal:He({name:"reveal",schema:Z8,description:"Progressive disclosure where headings become reveal steps shown one at a time",typeName:"Reveal",category:"Layout",snippet:["{% reveal %}","## ${1:Step One}","","${2:Content revealed first.}","","## ${3:Step Two}","","${4:Content revealed next.}","{% /reveal %}"]}),"reveal-step":He({name:"reveal-step",schema:z8,description:"Individual step within a reveal sequence",typeName:"RevealStep"}),juxtapose:He({name:"juxtapose",schema:V8,description:"Side-by-side comparison with interactive reveal (slider, toggle, fade, or auto)",typeName:"Juxtapose",category:"Layout"}),annotate:He({name:"annotate",schema:G8,description:"Content with margin annotations. Nested note tags appear as margin notes alongside the main text.",typeName:"Annotate",category:"Layout",snippet:["{% annotate %}","${1:Main content here.}","","{% note %}","${2:Margin note content.}","{% /note %}","","${3:More main content.}","{% /annotate %}"]}),note:He({name:"note",schema:Y8,description:"Annotation note within an annotate block",typeName:"AnnotateNote"}),form:He({name:"form",aliases:["contact-form"],schema:o9,description:"Accessible HTML form from Markdown. Lists become input fields with smart type inference, blockquotes followed by lists become select/radio/checkbox groups.",typeName:"Form",category:"Content",snippet:['{% form action="${1:/api/contact}" %}',"- Name","- Email","- Message","","**${2:Submit}**","{% /form %}"]}),"form-field":He({name:"form-field",schema:i9,description:"Individual form field with inferred type",typeName:"FormField"}),sandbox:He({name:"sandbox",schema:d9,description:"Isolated HTML/CSS/JS rendering in an iframe with optional framework loading",typeName:"Sandbox",category:"Code & Data",snippet:['{% sandbox framework="${1|,tailwind,bootstrap,bulma,pico|}" %}',"$0","{% /sandbox %}"]}),pullquote:He({name:"pullquote",aliases:["pull-quote"],schema:v9,description:"Decorative pull quote for magazine-style emphasis with float and block modes",typeName:"PullQuote",category:"Content",snippet:['{% pullquote variant="${1|default,accent,editorial|}" %}',"> ${2:Quote text to emphasize.}","{% /pullquote %}"]}),textblock:He({name:"textblock",aliases:["text-block","prose"],schema:y9,description:"Text formatting block with drop caps, multi-column layout, lead paragraphs, and alignment control",typeName:"TextBlock",category:"Content",snippet:["{% textblock dropcap %}","${1:Formatted text content with drop cap styling.}","{% /textblock %}"]}),mediatext:He({name:"mediatext",aliases:["media-text"],schema:k9,description:"Image and text side by side with configurable ratio and optional text wrapping",typeName:"MediaText",category:"Layout",snippet:['{% mediatext align="${1|left,right|}" ratio="${2|1:1,1:2,2:1|}" %}',"","","${5:Text content displayed alongside the image.}","{% /mediatext %}"]}),icon:He({name:"icon",schema:m9,description:"Inline icon resolved by name from the theme icon registry. Self-closing.",category:"Content",snippet:['{% icon name="${1:icon-name}" /%}']}),tint:He({name:"tint",schema:C9,description:"Section-level colour override via CSS custom properties. Declared as first child of a block rune.",typeName:"Tint",snippet:["{% tint %}","- background: ${1:#1a1a2e}","- primary: ${2:#e94560}","- accent: ${3:#0f3460}","{% /tint %}"]}),showcase:He({name:"showcase",schema:$9,description:"Media presentation wrapper with shadow, bleed displacement, and aspect ratio enforcement",typeName:"Showcase",category:"Layout",snippet:['{% showcase shadow="${1|none,soft,hard,elevated|}" %}',"$0","{% /showcase %}"]}),bg:He({name:"bg",schema:Q9,description:"Background image/video directive — modifies parent section backdrop",typeName:"Bg",snippet:['{% bg src="${1:/path/to/image.jpg}" overlay="${2:rgba(0,0,0,0.5)}" /%}']}),blog:He({name:"blog",schema:q9,description:"Blog post listing with filtering, sorting, and multiple layouts. Displays pages from a content folder as a navigable blog index.",seoType:"Blog",typeName:"Blog",schemaOrgType:"Blog",category:"Semantic"}),xref:He({name:"xref",aliases:["ref"],schema:R9,description:"Inline cross-reference that resolves an entity by ID or name from the registry. Self-closing."}),expand:He({name:"expand",schema:N9,description:"Substitute a registered entity's source content inline. Reads the entity's sourceFile via the plan plugin (or any plugin that registers extractable entities) and inlines it. Symmetric with `xref`: same lookup chain, different output (content rather than a link).",typeName:"Expand",category:"Content",snippet:['{% expand "${1:SPEC-001}" /%}']}),badge:He({name:"badge",schema:kZ,description:"Inline pill that flags a piece of content (status, category, recency, tag). Visual variant from the universal metadata-system dimensions (sentiment, rank, type).",typeName:"Badge",category:"Content",snippet:['{% badge sentiment="${1|positive,negative,caution,neutral|}" %}',"${2:Label}","{% /badge %}"]}),bar:He({name:"bar",schema:SZ,description:'Block-level wrapper that renders the SPEC-080 `bar` layout primitive (a horizontal flex row) over author-written content. Body splits on a top-level `---` into a left group and a right group; the right group is pushed to the end via `data-align="end"`. Position-agnostic.',typeName:"Bar",category:"Content",snippet:["{% bar %}","${1:Left side}","---","${2:Right side}","{% /bar %}"]}),deflist:He({name:"deflist",aliases:["definitions","terms"],schema:CZ,description:"Block-level wrapper that renders the SPEC-079 definition-list layout primitive over a markdown list. Each `- **Term:** value` item becomes a <dt>/<dd> pair. Inline runes compose naturally inside <dd>.",typeName:"Deflist",category:"Content",snippet:["{% deflist %}","- **${1:Term}:** ${2:Value}","- **${3:Term}:** ${4:Value}","{% /deflist %}"]}),collection:He({name:"collection",schema:j9,description:"Render a list, grid, or table of registry entities — the plural counterpart to ref/expand. Queries the registry by type with a field:value filter, sort, group, and limit; projects fields into a built-in layout or a per-item body template ($item bound).",typeName:"Collection",category:"Content",snippet:['{% collection type="${1:work}" filter="${2:status:ready}" sort="${3:priority}" /%}']}),relationships:He({name:"relationships",schema:z9,description:"Render an entity's relationship edges, grouped by kind — the plural-graph counterpart to ref/expand. Reads the registry relationship graph for `of` (an id, e.g. of=$item.id); each item is a related entity with its edge $kind bound. Generic over kind, so it serves any domain (plan, storytelling, …).",typeName:"Relationships",category:"Content",snippet:['{% relationships of="${1:WORK-1}" /%}']}),aggregate:He({name:"aggregate",schema:F9,description:'Project numbers — counts (and per-group breakdowns) over the registry — beside collection (items) and relationships (edges). Two modes: a no-body inline integer (`{% aggregate type="work" filter="status:done" /%}`) or a body-zoned form whose preamble / template / fallback zones bind `$item` to a totals / per-group / zeros projection. Use the optional `value` sub-filter (e.g. `value="status:done"`) to drive a progress-bar ratio without a second query.',typeName:"Aggregate",category:"Content",snippet:['{% aggregate type="${1:work}" filter="${2:status:done}" /%}']}),"file-ref":He({name:"file-ref",schema:X9,description:'Path-based inline reference to a project file — third member of the Registry family beside `xref` (id → link) and `expand` (id → inlined content). Resolves to a deep-link `<a>` pointing at `{repoUrl}/blob/{repoBranch}/{path}#L{start}-L{end}` on GitHub. With `preview="drawer"`, hoists a drawer containing the file\'s snippet and a "View source on GitHub →" footer link, leaving an inline link at the call site that opens it.',typeName:"FileRef",category:"Content",snippet:['{% file-ref path="${1:packages/types/src/token-contract.ts}" lines="${2:42-58}" label="${3:ThemeTokensConfig}" /%}']}),progress:He({name:"progress",schema:vZ,description:"A generic completion bar. Renders a ratio from supplied numbers — value+max (or percent) — with an optional body label; computes nothing itself. Feed it an aggregate (e.g. value=$item.data.progressDone max=$item.data.progressTotal).",typeName:"Progress",category:"Content",snippet:['{% progress value="${1:3}" max="${2:10}" /%}']}),card:He({name:"card",schema:bZ,description:"A generic, self-contained content card. The body splits on `---` into [media] / body / [footer]: the media zone holds any content (image, codegroup, sandbox, …) and lays out beside the body on wide screens / as a full-bleed header on mobile; the footer is a muted meta row. Optional `href` makes the whole card a link. Knows nothing about the registry — usable standalone or inside a collection body template.",typeName:"Card",category:"Content",snippet:['{% card href="${1:/posts/slug/}" %}',"### ${2:Title}","${3:A short summary.}","{% /card %}"]})},aw={...EZ(gF),link:iC,...B.tags},OF={heading:Sj,paragraph:Aj,fence:Cj,list:Tj,item:Pj,em:Ej,strong:$j,text:Qj,link:iC,hardbreak:Lj,image:Mj,table:qj,thead:B.nodes.thead,tbody:B.nodes.tbody,th:B.nodes.th,tr:B.nodes.tr,error:B.nodes.error},vF=new Set(["nav","nav-group","nav-item"]);function bF(n,e,t){const r={...n.runes};for(const[i,s]of Object.entries(B7.runes)){if(!r[i])continue;const o={};s.postTransform&&(o.postTransform=s.postTransform),s.styles&&(o.styles=s.styles),Object.keys(o).length&&(r[i]={...r[i],...o})}if(e)for(const[i,s]of Object.entries(e))r[i]&&(r[i]={...r[i],postTransform:s});if(t)for(const[i,s]of Object.entries(t))r[i]&&(r[i]={...r[i],styles:s});return{...n,runes:r}}function VC(n,e,t,r,i,s,o){const a=B.parse(n),l=bF(e,i,o),c=r?{...aw,...r}:aw,u=B.transform(a,{tags:c,nodes:OF,variables:{__source:n,__icons:l.icons}});let f=d7(u);s&&(f=Dg(f,s));const d=WC(f);let m=sz(l)(f);return t&&(m=t(m)),{html:Dz(m),isComponent:d}}function WC(n){return n==null||typeof n=="string"||typeof n=="number"?!1:Array.isArray(n)?n.some(WC):"attributes"in n&&n.attributes?.["data-rune"]?vF.has(n.attributes["data-rune"]):!1}function Dg(n,e){if(n==null||typeof n=="string"||typeof n=="number")return n;if(Array.isArray(n))return n.map(r=>Dg(r,e));const t=n;if(t.attributes?.["data-rune"]==="sandbox"){const i=e.design?.contexts??{},o=t.children?.find(l=>l?.attributes?.["data-field"]==="context")?.attributes?.content??"default",a=i[o];if(a){const l={$$mdtype:"Tag",name:"meta",attributes:{"data-field":"design-tokens",content:JSON.stringify(a)},children:[]};return{...t,children:[...t.children??[],l]}}}if(t.children?.length){const r=t.children.map(i=>Dg(i,e));return{...t,children:r}}return t}function yF(n){return n.hasAttribute("x-data")||n.hasAttribute("data-controller")}let wF=0;function eo(n){return`${n}-${++wF}`}const _F="http://www.w3.org/2000/svg",lw='<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>',kF='<polyline points="20 6 9 17 4 12"/>';function Ep(n){const e=document.createElementNS(_F,"svg");return e.setAttribute("width","16"),e.setAttribute("height","16"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.innerHTML=n,e}function xF(n){const e=n.getAttribute("data-copy-selector");if(e){const t=n.querySelectorAll(e);return Array.from(t).map(r=>r.textContent??"").join(`
|
|
338
|
-
`)}return n.textContent??""}function SF(n){const e=n.querySelectorAll("pre"),t=[];for(const r of e){const i=r.parentElement;if(i?.classList.contains("rf-codeblock")&&i.querySelector(":scope > .rf-codeblock__copy"))continue;const s=document.createElement("button");s.className="rf-codeblock__copy",s.type="button",s.setAttribute("aria-label","Copy code"),s.appendChild(Ep(lw));let o;const a=()=>{const c=xF(r);navigator.clipboard.writeText(c).then(()=>{s.innerHTML="",s.appendChild(Ep(kF)),s.setAttribute("aria-label","Copied"),s.classList.add("rf-codeblock__copy--copied"),o&&clearTimeout(o),o=setTimeout(()=>{s.innerHTML="",s.appendChild(Ep(lw)),s.setAttribute("aria-label","Copy code"),s.classList.remove("rf-codeblock__copy--copied")},2e3)})};s.addEventListener("click",a);const l=r.parentElement?.classList.contains("rf-codeblock")?r.parentElement:null;if(l)l.appendChild(s),t.push(()=>{s.removeEventListener("click",a),o&&clearTimeout(o),s.remove()});else{const c=document.createElement("div");c.className="rf-codeblock",r.parentNode?.insertBefore(c,r),c.appendChild(r),c.appendChild(s),t.push(()=>{s.removeEventListener("click",a),o&&clearTimeout(o),c.parentNode?.insertBefore(r,c),c.remove()})}}return()=>t.forEach(r=>r())}function cw(n){const e=Array.from(n.querySelectorAll("details"));if(e.length===0)return()=>{};const t=n.hasAttribute("data-multiple"),r=[];for(const o of e){const a=o.querySelector("summary");if(!a)continue;const l=eo("rf-accordion-panel"),c=eo("rf-accordion-trigger");a.id=c,a.setAttribute("aria-expanded",String(o.open)),o.setAttribute("data-state",o.open?"open":"closed"),a.setAttribute("data-state",o.open?"active":"inactive");const u=Array.from(o.children).find(d=>d instanceof HTMLElement&&d.tagName!=="SUMMARY");u&&(u.id=l,u.setAttribute("role","region"),u.setAttribute("aria-labelledby",c),a.setAttribute("aria-controls",l));const f=()=>{if(a.setAttribute("aria-expanded",String(o.open)),o.setAttribute("data-state",o.open?"open":"closed"),a.setAttribute("data-state",o.open?"active":"inactive"),!t&&o.open){for(const d of e)if(d!==o&&d.open){d.open=!1;const h=d.querySelector("summary");h?.setAttribute("aria-expanded","false"),d.setAttribute("data-state","closed"),h?.setAttribute("data-state","inactive")}}};o.addEventListener("toggle",f),r.push(()=>o.removeEventListener("toggle",f))}const i=e.map(o=>o.querySelector("summary")).filter(o=>o!==null),s=o=>{const a=o.target,l=i.indexOf(a);if(l===-1)return;let c=null;switch(o.key){case"ArrowDown":c=(l+1)%i.length;break;case"ArrowUp":c=(l-1+i.length)%i.length;break;case"Home":c=0;break;case"End":c=i.length-1;break;default:return}c!==null&&(o.preventDefault(),i[c].focus())};return n.addEventListener("keydown",s),r.push(()=>n.removeEventListener("keydown",s)),()=>r.forEach(o=>o())}const tl=new Map,uw=new WeakSet;function AF(n){let e=tl.get(n);return e||(e=new Map,tl.set(n,e)),e}function CF(n){const e=n.split("+").map(i=>i.trim().toLowerCase()).filter(Boolean);if(e.length===0)return null;const t=e[e.length-1];if(!t)return null;const r=new Set(e.slice(0,-1));return{key:t,cmd:r.has("cmd")||r.has("meta"),ctrl:r.has("ctrl")||r.has("control"),alt:r.has("alt")||r.has("option"),shift:r.has("shift")}}function TF(n,e){if(e.key.toLowerCase()!==n.key)return!1;const t=e.metaKey||e.ctrlKey,r=n.cmd||n.ctrl;return!(r&&!t||!r&&t||n.alt!==e.altKey||n.shift!==e.shiftKey)}function PF(n){const e=n.activeElement;if(!e)return!1;const t=e.tagName;return!!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable)}function EF(n){const e=n.ownerDocument;if(!e||!e.defaultView)return()=>{};const t=e.defaultView,r=n instanceof t.HTMLDialogElement?n:$F(n);if(!r)return()=>{};const i=r.id;if(!i)return()=>{};const s=r.querySelector(".rf-drawer__close");s&&(s.hidden=!1);const o=r.getAttribute("data-shortcut")??void 0,a=o?CF(o)??void 0:void 0,l=AF(e);if(l.has(i))return()=>{};if(a)for(const O of l.values())O.shortcut&&dw(O.shortcut)===dw(a)&&console.warn(`[refrakt drawer] shortcut "${o}" is registered by drawers "${O.id}" and "${i}"; the later one wins.`);l.set(i,{dialog:r,id:i,shortcut:a});const c=[],u=`#${i}`,f=O=>{O.preventDefault(),Rg(r)},d=[];if(e.querySelectorAll('a[data-target-type="drawer"]').forEach(O=>{const v=O.getAttribute("href")??"";(v===u||v.endsWith(u))&&(O.addEventListener("click",f),d.push(O))}),c.push(()=>{for(const O of d)O.removeEventListener("click",f)}),s){const O=()=>vf(r);s.addEventListener("click",O),c.push(()=>s.removeEventListener("click",O))}const h=O=>{O.target===r&&vf(r)};r.addEventListener("click",h),c.push(()=>r.removeEventListener("click",h));const m=O=>{O.preventDefault(),vf(r)};r.addEventListener("cancel",m),c.push(()=>r.removeEventListener("cancel",m));const p=()=>{r.setAttribute("data-state","closed"),t.location.hash===u&&t.history.replaceState(null,"",t.location.pathname+t.location.search),fw(e)};return r.addEventListener("close",p),c.push(()=>r.removeEventListener("close",p)),t.location.hash===u&&t.queueMicrotask(()=>{r.open||Rg(r)}),uw.has(e)||(uw.add(e),MF(e)),()=>{for(const O of c)O();l.delete(i),fw(e)}}function $F(n){const e=n.ownerDocument;if(!e)return null;const t=e.createElement("dialog");for(const r of Array.from(n.attributes))t.setAttribute(r.name,r.value);for(;n.firstChild;)t.appendChild(n.firstChild);return n.parentNode&&n.parentNode.replaceChild(t,n),t.setAttribute("data-state","closed"),t}function Rg(n){const e=n.ownerDocument;if(!e||!e.defaultView)return;const t=e.defaultView,r=tl.get(e);if(r)for(const i of r.values())i.dialog!==n&&i.dialog.open&&i.dialog.close();if(!n.open)try{n.showModal()}catch{n.setAttribute("open","")}if(n.setAttribute("data-state","open"),LF(e),n.id){const i=`#${n.id}`;t.location.hash!==i&&t.history.replaceState(null,"",t.location.pathname+t.location.search+i)}}const QF=280;function vf(n){if(!n.open||n.getAttribute("data-state")==="closing")return;n.setAttribute("data-state","closing");let e=!1;const t=()=>{if(!e){e=!0,n.removeEventListener("animationend",r),i!==void 0&&clearTimeout(i);try{n.close()}catch{n.removeAttribute("open")}}},r=s=>{s.target===n&&(s.animationName&&!s.animationName.startsWith("rf-drawer-slide-out")||t())};n.addEventListener("animationend",r);const i=setTimeout(t,QF)}function LF(n){n.documentElement.classList.add("rf-drawer-open")}function fw(n){const e=tl.get(n);if(!e){n.documentElement.classList.remove("rf-drawer-open");return}for(const t of e.values())if(t.dialog.open)return;n.documentElement.classList.remove("rf-drawer-open")}function dw(n){const e=[];return(n.cmd||n.ctrl)&&e.push("mod"),n.alt&&e.push("alt"),n.shift&&e.push("shift"),e.push(n.key),e.join("+")}function MF(n){const e=n.defaultView;if(!e)return;const t=i=>{if(PF(n))return;const s=tl.get(n);if(!s)return;let o;for(const a of s.values())a.shortcut&&TF(a.shortcut,i)&&(o=a);o&&(i.preventDefault(),Rg(o.dialog))};n.addEventListener("keydown",t);const r=()=>{const i=tl.get(n);if(i)for(const s of i.values())s.dialog.open&&e.location.hash!==`#${s.id}`&&vf(s.dialog)};e.addEventListener("popstate",r)}function hw(n){const e=n.querySelector('[data-name="tabs"]'),t=n.querySelector('[data-name="panels"]');if(!e||!t)return()=>{};const r=Array.from(e.children).filter(d=>d instanceof HTMLElement&&d.tagName==="BUTTON"),i=Array.from(t.children).filter(d=>d instanceof HTMLElement);if(r.length===0||i.length===0)return()=>{};const s=r.map(()=>eo("rf-tab")),o=i.map(()=>eo("rf-tabpanel"));for(let d=0;d<r.length;d++)r[d].id=s[d],o[d]&&r[d].setAttribute("aria-controls",o[d]);for(let d=0;d<i.length;d++)o[d]&&(i[d].id=o[d]),s[d]&&i[d].setAttribute("aria-labelledby",s[d]);const a=r[0].className.split(" ")[0]||"";let l=0;function c(d){l=d;for(let h=0;h<r.length;h++){const m=h===l;r[h].setAttribute("aria-selected",String(m)),r[h].setAttribute("data-state",m?"active":"inactive"),a&&r[h].classList.toggle(`${a}--active`,m)}for(let h=0;h<i.length;h++){const m=h===l;i[h].hidden=!m,i[h].setAttribute("data-state",m?"active":"inactive")}}c(0);const u=[];for(let d=0;d<r.length;d++){const h=()=>c(d);r[d].addEventListener("click",h),u.push(()=>r[d].removeEventListener("click",h))}const f=d=>{const h=d.target,m=r.indexOf(h);if(m===-1)return;let p=null;switch(d.key){case"ArrowRight":p=(m+1)%r.length;break;case"ArrowLeft":p=(m-1+r.length)%r.length;break;case"Home":p=0;break;case"End":p=r.length-1;break;default:return}p!==null&&(d.preventDefault(),r[p].focus(),c(p))};return e.addEventListener("keydown",f),u.push(()=>e.removeEventListener("keydown",f)),()=>{u.forEach(d=>d());for(const d of r)d.removeAttribute("id"),d.removeAttribute("aria-controls"),d.removeAttribute("aria-selected"),d.removeAttribute("data-state"),a&&d.classList.remove(`${a}--active`);for(const d of i)d.hidden=!1,d.removeAttribute("id"),d.removeAttribute("aria-labelledby"),d.removeAttribute("data-state")}}function qF(n){const e=n.querySelector('[data-name="steps"]')||n,t=Array.from(e.querySelectorAll('[data-rune="reveal-step"]'));if(t.length===0)return()=>{};let r=1;const i=document.createElement("button");i.className="rf-reveal__next",i.textContent="Continue";const s=document.createElement("button");s.className="rf-reveal__reset",s.textContent="Start over";function o(){for(let c=0;c<t.length;c++){const u=c<r;t[c].classList.toggle("rf-reveal-step--visible",u),t[c].classList.toggle("rf-reveal-step--hidden",!u),t[c].setAttribute("data-state",u?"open":"closed")}r<t.length?(i.parentNode||n.appendChild(i),s.remove()):t.length>1?(i.remove(),s.parentNode||n.appendChild(s)):(i.remove(),s.remove())}const a=()=>{r<t.length&&(r++,o())},l=()=>{r=1,o()};return i.addEventListener("click",a),s.addEventListener("click",l),o(),()=>{i.removeEventListener("click",a),s.removeEventListener("click",l),i.remove(),s.remove();for(const c of t)c.classList.remove("rf-reveal-step--visible","rf-reveal-step--hidden"),c.removeAttribute("data-state")}}function DF(n){const e=n.querySelector("table");if(!e)return()=>{};const t=n.getAttribute("data-searchable")==="true",i=(n.getAttribute("data-sortable")||"").split(",").map(A=>A.trim()).filter(Boolean),s=parseInt(n.getAttribute("data-pagesize")||"0",10),o=n.getAttribute("data-defaultsort")||"",a=Array.from(e.querySelectorAll("th")),l=a.map(A=>A.textContent?.trim()||""),c=e.querySelectorAll("tbody tr"),u=Array.from(c.length>0?c:e.querySelectorAll("tr:not(:first-child)")).map(A=>({el:A,cells:Array.from(A.querySelectorAll("td")).map(x=>x.textContent?.trim()||"")})),f=u.map(A=>A.el);let d="",h=o,m="asc",p=0;const O=[];let v=null,b=null;if(t){v=document.createElement("div"),v.className="rf-datatable__toolbar",b=document.createElement("input"),b.type="search",b.placeholder="Filter rows...",b.className="rf-datatable__input",v.appendChild(b),e.before(v);const A=()=>{d=b.value,p=0,S()};b.addEventListener("input",A),O.push(()=>b.removeEventListener("input",A))}for(const A of a){const x=A.textContent?.trim()||"";if(!i.includes(x))continue;A.style.cursor="pointer",A.style.userSelect="none";const k=()=>{h===x?m=m==="asc"?"desc":"asc":(h=x,m="asc"),p=0,S()};A.addEventListener("click",k),O.push(()=>{A.removeEventListener("click",k),A.style.cursor="",A.style.userSelect=""})}let _=null,C=null,w=null,y=null;if(s>0){_=document.createElement("div"),_.className="rf-datatable__pagination",C=document.createElement("button"),C.className="rf-datatable__page-btn",C.innerHTML="← Prev",y=document.createElement("span"),y.className="rf-datatable__page-info",w=document.createElement("button"),w.className="rf-datatable__page-btn",w.innerHTML="Next →",_.appendChild(C),_.appendChild(y),_.appendChild(w),e.after(_);const A=()=>{p>0&&(p--,S())},x=()=>{p++,S()};C.addEventListener("click",A),w.addEventListener("click",x),O.push(()=>{C.removeEventListener("click",A),w.removeEventListener("click",x)})}function S(){let A=[...u];if(d){const $=d.toLowerCase();A=A.filter(L=>L.cells.some(P=>P.toLowerCase().includes($)))}if(h){const $=l.indexOf(h);$>=0&&A.sort((L,P)=>{const q=L.cells[$].localeCompare(P.cells[$],void 0,{numeric:!0});return m==="asc"?q:-q})}const x=A.length,k=s>0?Math.ceil(x/s):1;p>=k&&(p=Math.max(0,k-1));const E=s>0?A.slice(p*s,(p+1)*s):A,T=e.querySelector("tbody")||e;for(const $ of u)$.el.style.display="none";for(const $ of E)$.el.style.display="",T.appendChild($.el);for(const $ of a){const L=$.textContent?.replace(/[▲▼]/g,"").trim()||"",P=$.querySelector(".rf-datatable__sort-indicator");if(i.includes(L))if(h===L)if(P)P.textContent=m==="asc"?" ▲":" ▼";else{const q=document.createElement("span");q.className="rf-datatable__sort-indicator",q.textContent=m==="asc"?" ▲":" ▼",$.appendChild(q)}else P?.remove()}_&&C&&w&&y&&(C.disabled=p===0,w.disabled=p>=k-1,y.textContent=`${p+1} / ${k}`,k<=1?_.hidden=!0:_.hidden=!1)}return S(),()=>{O.forEach(x=>x()),v?.remove(),_?.remove();for(const x of a)x.querySelector(".rf-datatable__sort-indicator")?.remove();const A=e.querySelector("tbody")||e;for(const x of f)x.style.display="",A.appendChild(x)}}function RF(n){const e=n.tagName==="FORM"?n:n.querySelector("form");if(!e)return()=>{};const t=n.getAttribute("data-action")||e.getAttribute("action")||"",r=n.getAttribute("data-method")||e.getAttribute("method")||"POST",i=n.getAttribute("data-success")||"Form submitted successfully.",s=n.getAttribute("data-error")||"Something went wrong. Please try again.",o=n.getAttribute("data-honeypot")!=="false";let a=null;if(o){a=document.createElement("div"),a.className="rf-form__hp",a.setAttribute("aria-hidden","true"),a.style.display="none";const f=document.createElement("input");f.type="text",f.name="_gotcha",f.setAttribute("autocomplete","off"),f.tabIndex=-1,a.appendChild(f),e.prepend(a)}const l=document.createElement("div");l.className="rf-form__status",l.hidden=!0,e.appendChild(l);function c(f,d){l.hidden=!1,l.className=`rf-form__status rf-form__status--${f}`,l.setAttribute("role",f==="submitting"?"status":"alert"),l.setAttribute("data-state",f),l.textContent=d}const u=async f=>{if(f.preventDefault(),!!t){c("submitting","Submitting...");try{const d=new FormData(e);(await fetch(t,{method:r,body:d,headers:{Accept:"application/json"}})).ok?(c("success",i),e.reset()):c("error",s)}catch{c("error",s)}}};return e.addEventListener("submit",u),()=>{e.removeEventListener("submit",u),a?.remove(),l.remove()}}const IF="http://www.w3.org/2000/svg";function Vu(n){const e=document.createElementNS(IF,"svg");return e.setAttribute("width","14"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.innerHTML=n,e}const as={eye:'<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>',code:'<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',mobile:'<rect x="5" y="2" width="14" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/>',tablet:'<rect x="4" y="2" width="16" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/>',desktop:'<rect x="2" y="3" width="20" height="14" rx="2" ry="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>',sun:'<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>',moon:'<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>'},NF={mobile:as.mobile,tablet:as.tablet,desktop:as.desktop},la={mobile:{width:375,label:"375px"},tablet:{width:768,label:"768px"},desktop:{width:null,label:"Full"}};function BF(n){const e=n.getAttribute("data-theme")||"auto",r=(n.getAttribute("data-responsive")||"").split(",").map(P=>P.trim()).filter(P=>P in la),i=r.length>0,s=n.querySelector('[data-name="source"]'),o=n.querySelector('[data-name="html-source"]'),a=n.querySelector('[data-name="themed-source"]'),l=Array.from(n.children).filter(P=>P!==s&&P!==o&&P!==a&&!P.matches?.("meta[data-field]")),c=s!==null||o!==null;let u="preview",f=e,d=i?r[r.length-1]:null;const h=[],m=document.createElement("div");m.className="rf-preview__toolbar";const p=document.createElement("span");p.className="rf-preview__title",m.appendChild(p);const O=document.createElement("div");O.className="rf-preview__controls",m.appendChild(O);let v=null,b=null;if(c){const P=document.createElement("div");P.className="rf-preview__view-toggle",v=document.createElement("button"),v.className="rf-preview__toggle-btn rf-preview__toggle-btn--active",v.setAttribute("aria-label","Preview"),v.setAttribute("title","Preview"),v.appendChild(Vu(as.eye)),b=document.createElement("button"),b.className="rf-preview__toggle-btn",b.setAttribute("aria-label","View source"),b.setAttribute("title","View source"),b.appendChild(Vu(as.code)),P.appendChild(v),P.appendChild(b),O.appendChild(P);const q=()=>{u="preview",L()},R=()=>{u="code",L()};v.addEventListener("click",q),b.addEventListener("click",R),h.push(()=>{v.removeEventListener("click",q),b.removeEventListener("click",R)})}const _=new Map;if(i){const P=document.createElement("div");P.className="rf-preview__viewport-toggle";for(const q of r){const R=document.createElement("button");R.className="rf-preview__toggle-btn",R.setAttribute("aria-label",`${la[q].label} viewport`),R.setAttribute("title",la[q].label),R.appendChild(Vu(NF[q]||as.desktop));const W=()=>{d=q,L()};R.addEventListener("click",W),h.push(()=>R.removeEventListener("click",W)),P.appendChild(R),_.set(q,R)}O.appendChild(P)}const C=document.createElement("div");C.className="rf-preview__toggle";const w=[{mode:"auto",label:"Auto",title:"System preference",icon:as.desktop},{mode:"light",label:"Light",title:"Light mode",icon:as.sun},{mode:"dark",label:"Dark",title:"Dark mode",icon:as.moon}],y=new Map;for(const P of w){const q=document.createElement("button");q.className="rf-preview__toggle-btn",q.setAttribute("aria-label",`${P.label} theme`),q.setAttribute("title",P.title),q.appendChild(Vu(P.icon));const R=()=>{f=P.mode,L()};q.addEventListener("click",R),h.push(()=>q.removeEventListener("click",R)),C.appendChild(q),y.set(P.mode,q)}O.appendChild(C);const S=document.createElement("div");S.className="rf-preview__canvas";let A=null,x=null;if(i){A=document.createElement("div"),A.className="rf-preview__viewport-frame",x=document.createElement("span"),x.className="rf-preview__viewport-label",x.hidden=!0,A.appendChild(x);for(const P of l)A.appendChild(P);S.appendChild(A)}else for(const P of l)S.appendChild(P);const k=[];let E=null,T=null,$="";if(c){if(E=document.createElement("div"),E.className="rf-preview__source",s){const P=document.createElement("div");P.appendChild(s),k.push({key:"markdoc",label:"Markdoc",panel:P})}if(o){const P=document.createElement("div");P.appendChild(o),k.push({key:"rune",label:"Rune",panel:P})}if(a){const P=document.createElement("div");P.appendChild(a),k.push({key:"html",label:"HTML",panel:P})}if($=k[0]?.key??"",k.length>1){const P=document.createElement("div");P.className="rf-preview__source-tabs",T=new Map;for(const q of k){const R=document.createElement("button");R.className="rf-preview__source-tab",q.key===$&&R.classList.add("rf-preview__source-tab--active"),R.textContent=q.label;const W=()=>{$=q.key,L()};R.addEventListener("click",W),h.push(()=>R.removeEventListener("click",W)),P.appendChild(R),T.set(q.key,R)}E.appendChild(P)}for(const P of k)P.panel.hidden=P.key!==$,E.appendChild(P.panel)}n.appendChild(m),E&&n.appendChild(E),n.appendChild(S);function L(){if(v&&b&&(v.classList.toggle("rf-preview__toggle-btn--active",u==="preview"),b.classList.toggle("rf-preview__toggle-btn--active",u==="code")),E&&(E.hidden=u!=="code"),S.hidden=u==="code"&&c,T)for(const[q,R]of T)R.classList.toggle("rf-preview__source-tab--active",$===q);for(const q of k)q.panel.hidden=q.key!==$;for(const[q,R]of _)R.classList.toggle("rf-preview__toggle-btn--active",d===q);if(A){const q=d&&la[d]?la[d].width:null;A.classList.toggle("rf-preview__viewport-frame--constrained",!!q),A.style.maxWidth=q?`${q}px`:"",x&&(q&&d?(x.textContent=la[d].label,x.hidden=!1):x.hidden=!0)}for(const[q,R]of y)R.classList.toggle("rf-preview__toggle-btn--active",f===q);const P=f==="auto"?void 0:f;P?S.setAttribute("data-color-scheme",P):S.removeAttribute("data-color-scheme");for(const q of S.querySelectorAll("rf-sandbox"))typeof q.setTheme=="function"&&q.setTheme(P||"auto")}return L(),()=>{h.forEach(P=>P()),s&&n.appendChild(s),o&&n.appendChild(o),a&&n.appendChild(a);for(const P of Array.from(A?.children??S.children))P!==x&&n.appendChild(P);m.remove(),S.remove(),E?.remove()}}function jF(n){const e=n.querySelectorAll("[data-scrollspy]"),t=[];for(const r of e){const i=r.querySelectorAll('a[href^="#"]');if(i.length===0)continue;const s=new Map,o=[];for(const c of i){const u=c.getAttribute("href").slice(1),f=document.getElementById(u);if(!f)continue;const d=c.closest("li");d&&(s.set(f,d),o.push(f))}if(o.length===0)continue;let a=null;const l=new IntersectionObserver(c=>{for(const u of c)if(u.isIntersecting){const f=s.get(u.target);f&&f!==a&&(a?.removeAttribute("data-active"),f.setAttribute("data-active",""),a=f);break}},{rootMargin:"0px 0px -80% 0px"});for(const c of o)l.observe(c);t.push(()=>{l.disconnect(),a?.removeAttribute("data-active")})}return()=>t.forEach(r=>r())}function zF(n){const e=n.querySelectorAll("[data-version-switcher]"),t=[];for(const r of e){const i=r.querySelector("select");if(!i)continue;const s=()=>{const o=i.value;o&&o!==window.location.pathname&&(window.location.href=o)};i.addEventListener("change",s),t.push(()=>i.removeEventListener("change",s))}return()=>t.forEach(r=>r())}function ZF(n){const e=[];if(n.getAttribute("data-layout")==="carousel"){const t=FF(n);t&&e.push(t)}if(n.getAttribute("data-lightbox")==="true"){const t=XF(n);t&&e.push(t)}return()=>e.forEach(t=>t())}function FF(n){const e=n.querySelector('[data-name="items"]');if(!e)return;const t=Array.from(e.querySelectorAll('[data-name="item"]'));if(t.length===0)return;const r=document.createElement("button");r.className="rf-gallery__nav rf-gallery__nav--prev",r.setAttribute("aria-label","Previous"),r.textContent="‹";const i=document.createElement("button");i.className="rf-gallery__nav rf-gallery__nav--next",i.setAttribute("aria-label","Next"),i.textContent="›",n.appendChild(r),n.appendChild(i);function s(c){const u=t[0];if(!u||!e)return;const f=u.offsetWidth+parseFloat(getComputedStyle(e).gap||"0");e.scrollBy({left:c*f,behavior:"smooth"})}const o=()=>s(-1),a=()=>s(1);r.addEventListener("click",o),i.addEventListener("click",a);const l=c=>{c.key==="ArrowLeft"&&(c.preventDefault(),s(-1)),c.key==="ArrowRight"&&(c.preventDefault(),s(1))};return n.setAttribute("tabindex","0"),n.addEventListener("keydown",l),()=>{r.removeEventListener("click",o),i.removeEventListener("click",a),n.removeEventListener("keydown",l),r.remove(),i.remove(),n.removeAttribute("tabindex")}}function XF(n){const e=Array.from(n.querySelectorAll('[data-name="item"]'));if(e.length===0)return;let t=null,r=0;function i(d){return d.querySelector("img")?.getAttribute("src")||""}function s(d){return d.querySelector("img")?.getAttribute("alt")||""}function o(d){r=d,e[r]?.setAttribute("data-state","selected"),t=document.createElement("div"),t.className="rf-gallery__lightbox",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label","Image lightbox");const h=document.createElement("img");h.src=i(e[r]),h.alt=s(e[r]);const m=document.createElement("button");m.className="rf-gallery__lightbox-close",m.setAttribute("aria-label","Close lightbox"),m.textContent="×";const p=document.createElement("button");p.className="rf-gallery__lightbox-nav rf-gallery__lightbox-nav--prev",p.setAttribute("aria-label","Previous image"),p.textContent="‹";const O=document.createElement("button");O.className="rf-gallery__lightbox-nav rf-gallery__lightbox-nav--next",O.setAttribute("aria-label","Next image"),O.textContent="›",t.appendChild(h),t.appendChild(m),e.length>1&&(t.appendChild(p),t.appendChild(O)),m.addEventListener("click",l),p.addEventListener("click",()=>a(-1)),O.addEventListener("click",()=>a(1)),t.addEventListener("click",v=>{v.target===t&&l()}),document.body.appendChild(t),document.addEventListener("keydown",c),m.focus()}function a(d){if(!t)return;e[r]?.removeAttribute("data-state"),r=(r+d+e.length)%e.length,e[r]?.setAttribute("data-state","selected");const h=t.querySelector("img");h&&(h.src=i(e[r]),h.alt=s(e[r]))}function l(){t&&(e[r]?.removeAttribute("data-state"),document.removeEventListener("keydown",c),t.remove(),t=null,e[r]?.focus())}function c(d){d.key==="Escape"&&(d.preventDefault(),l()),d.key==="ArrowLeft"&&(d.preventDefault(),a(-1)),d.key==="ArrowRight"&&(d.preventDefault(),a(1))}const u=[];e.forEach((d,h)=>{const m=()=>o(h);d.addEventListener("click",m),d.setAttribute("tabindex","0"),d.setAttribute("role","button"),d.setAttribute("aria-label",s(d)||`View image ${h+1}`),u.push([d,m])});const f=d=>{if(d.key==="Enter"||d.key===" "){d.preventDefault();const h=d.currentTarget,m=e.indexOf(h);m>=0&&o(m)}};return e.forEach(d=>d.addEventListener("keydown",f)),()=>{l();for(const[d,h]of u)d.removeEventListener("click",h),d.removeAttribute("tabindex"),d.removeAttribute("role"),d.removeAttribute("aria-label");e.forEach(d=>d.removeEventListener("keydown",f))}}function VF(n){switch(n.getAttribute("data-variant")||"slider"){case"toggle":return UF(n);case"fade":return GF(n);case"auto":return HF(n);default:return YF(n)}}function sh(n){const e=n.querySelector('[data-name="panels"]')||n;return Array.from(e.querySelectorAll(':scope > [data-rune="juxtapose-panel"]'))}function WF(n){return n.querySelector('[data-name="name"]')?.textContent?.trim()||""}function YF(n){const e=sh(n);if(e.length<2)return()=>{};const r=(n.getAttribute("data-orientation")||"vertical")==="horizontal",i=n.querySelector('[data-name="panels"]');if(!i)return()=>{};i.style.position="relative",i.style.overflow="hidden",e[0].style.position="absolute",e[0].style.inset="0",e[0].style.zIndex="2",e[0].style.willChange="clip-path",e[1].style.position="relative",e[1].style.zIndex="1";for(const O of e)for(const v of O.querySelectorAll('iframe[loading="lazy"]'))v.loading="eager";const s=document.createElement("div");s.className="rf-juxtapose__divider",s.setAttribute("role","slider"),s.setAttribute("aria-label","Comparison slider"),s.setAttribute("aria-valuemin","0"),s.setAttribute("aria-valuemax","100"),s.setAttribute("tabindex","0");const o=document.createElement("div");o.className="rf-juxtapose__divider-handle",s.appendChild(o),i.appendChild(s);function a(O){const v=Math.max(0,Math.min(100,O));n.style.setProperty("--jx-position",String(v)),s.setAttribute("aria-valuenow",String(Math.round(v))),r?(e[0].style.clipPath=`inset(0 0 ${100-v}% 0)`,s.style.top=`${v}%`,s.style.left=""):(e[0].style.clipPath=`inset(0 ${100-v}% 0 0)`,s.style.left=`${v}%`,s.style.top="")}const l=parseFloat(n.style.getPropertyValue("--jx-position"))||50;a(l);let c=!1;function u(O){const v=i.getBoundingClientRect();return r?(O.clientY-v.top)/v.height*100:(O.clientX-v.left)/v.width*100}const f=O=>{c=!0,s.setPointerCapture(O.pointerId),a(u(O)),O.preventDefault()},d=O=>{c&&a(u(O))},h=O=>{c&&(c=!1,s.releasePointerCapture(O.pointerId))},m=O=>{O.target===s||s.contains(O.target)||(c=!0,s.setPointerCapture(O.pointerId),a(u(O)))};s.addEventListener("pointerdown",f),s.addEventListener("pointermove",d),s.addEventListener("pointerup",h),i.addEventListener("pointerdown",m),i.addEventListener("pointermove",d),i.addEventListener("pointerup",h);const p=O=>{const v=parseFloat(n.style.getPropertyValue("--jx-position"))||50,b=O.shiftKey?10:2,_=r?["ArrowUp"]:["ArrowLeft"],C=r?["ArrowDown"]:["ArrowRight"];_.includes(O.key)?(a(v-b),O.preventDefault()):C.includes(O.key)?(a(v+b),O.preventDefault()):O.key==="Home"?(a(0),O.preventDefault()):O.key==="End"&&(a(100),O.preventDefault())};return s.addEventListener("keydown",p),()=>{s.removeEventListener("pointerdown",f),s.removeEventListener("pointermove",d),s.removeEventListener("pointerup",h),i.removeEventListener("pointerdown",m),i.removeEventListener("pointermove",d),i.removeEventListener("pointerup",h),s.removeEventListener("keydown",p),s.remove(),i.style.position="",i.style.overflow="";for(const O of e)O.style.position="",O.style.inset="",O.style.zIndex="",O.style.clipPath="",O.style.willChange=""}}function UF(n){const e=sh(n);if(e.length<2)return()=>{};let t=0;const r=document.createElement("div");r.className="rf-juxtapose__toggle-bar",r.setAttribute("role","radiogroup"),r.setAttribute("aria-label","Comparison toggle");const i=e.map((l,c)=>{const u=document.createElement("button");return u.className="rf-juxtapose__toggle-btn",u.setAttribute("role","radio"),u.textContent=WF(l)||`Panel ${c+1}`,r.appendChild(u),u}),s=n.querySelector('[data-name="panels"]');s?s.parentNode.insertBefore(r,s):n.insertBefore(r,n.firstChild);function o(){e.forEach((l,c)=>{const u=c===t;l.hidden=!u,l.setAttribute("data-state",u?"active":"inactive")}),i.forEach((l,c)=>{const u=c===t;l.setAttribute("aria-checked",String(u)),l.setAttribute("data-state",u?"active":"inactive"),l.classList.toggle("rf-juxtapose__toggle-btn--active",u)})}const a=l=>{const c=l.target.closest(".rf-juxtapose__toggle-btn");if(!c)return;const u=i.indexOf(c);u>=0&&(t=u,o())};return r.addEventListener("click",a),o(),()=>{r.removeEventListener("click",a),r.remove();for(const l of e)l.hidden=!1,l.removeAttribute("data-state")}}function GF(n){const e=sh(n);if(e.length<2)return()=>{};const t=n.querySelector('[data-name="panels"]');if(!t)return()=>{};const r=parseInt(n.style.getPropertyValue("--jx-duration")||"1000",10);t.style.position="relative",e[0].style.position="relative",e[0].style.zIndex="1",e[1].style.position="absolute",e[1].style.inset="0",e[1].style.zIndex="2",e[1].style.opacity="0",e[1].style.transition=`opacity ${r}ms ease`;for(const l of e)for(const c of l.querySelectorAll('iframe[loading="lazy"]'))c.loading="eager";let i=!1;const s=()=>{i||(e[1].style.opacity="1")},o=()=>{i||(e[1].style.opacity="0")},a=()=>{i=!i,e[1].style.opacity=i?"1":"0"};return t.addEventListener("mouseenter",s),t.addEventListener("mouseleave",o),t.addEventListener("click",a),t.setAttribute("aria-live","polite"),()=>{t.removeEventListener("mouseenter",s),t.removeEventListener("mouseleave",o),t.removeEventListener("click",a),t.removeAttribute("aria-live"),t.style.position="";for(const l of e)l.style.position="",l.style.inset="",l.style.zIndex="",l.style.opacity="",l.style.transition=""}}function HF(n){const e=sh(n);if(e.length<2)return()=>{};const r=(n.getAttribute("data-orientation")||"vertical")==="horizontal",i=n.querySelector('[data-name="panels"]');if(!i)return()=>{};const s=parseFloat(n.style.getPropertyValue("--jx-position"))||50,o=parseInt(n.style.getPropertyValue("--jx-duration")||"1000",10);i.style.position="relative",i.style.overflow="hidden",e[0].style.position="absolute",e[0].style.inset="0",e[0].style.zIndex="2",e[0].style.willChange="clip-path",e[1].style.position="relative",e[1].style.zIndex="1";for(const d of e)for(const h of d.querySelectorAll('iframe[loading="lazy"]'))h.loading="eager";function a(d){n.style.setProperty("--jx-position",String(d)),r?e[0].style.clipPath=`inset(0 0 ${100-d}% 0)`:e[0].style.clipPath=`inset(0 ${100-d}% 0 0)`}a(0);let l=null,c=!1;function u(){if(c)return;c=!0;const d=performance.now(),h=0;function m(p){const O=p-d,v=Math.min(O/o,1),b=1-Math.pow(1-v,3);a(h+(s-h)*b),v<1&&(l=requestAnimationFrame(m))}l=requestAnimationFrame(m)}const f=new IntersectionObserver(d=>{for(const h of d)h.isIntersecting&&u()},{threshold:.3});return f.observe(n),()=>{f.disconnect(),l!==null&&cancelAnimationFrame(l),i.style.position="",i.style.overflow="";for(const d of e)d.style.position="",d.style.inset="",d.style.zIndex="",d.style.clipPath="",d.style.willChange=""}}function KF(n){if(n.getAttribute("data-collapsible")!=="true")return()=>{};const e=Array.from(n.querySelectorAll('[data-rune="nav-group"]'));if(e.length===0)return()=>{};const t=[];for(const r of e){const i=r.querySelector('[data-field="title"], h1, h2, h3, h4, h5, h6');if(!i)continue;const s=r.querySelector(':scope > [data-name="panel"], :scope > ul, :scope > ol');if(!s)continue;const o=i.id||eo("rf-nav-trigger"),a=s.id||eo("rf-nav-panel");i.id=o,s.id=a,(r.getAttribute("data-collapsed")??"true")!=="false"&&r.setAttribute("data-collapsed","true"),i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("aria-controls",a),i.setAttribute("aria-expanded",r.getAttribute("data-collapsed")==="false"?"true":"false"),s.setAttribute("aria-labelledby",o);const c=()=>{const d=r.getAttribute("data-collapsed")==="false",h=s.getBoundingClientRect().height,m=d?0:s.scrollHeight;s.style.height=h+"px",s.offsetHeight,r.setAttribute("data-collapsed",d?"true":"false"),i.setAttribute("aria-expanded",d?"false":"true"),s.style.height=m+"px";const p=()=>{s.style.height="",s.removeEventListener("transitionend",O),clearTimeout(v)},O=b=>{b.target!==s||b.propertyName!=="height"||p()};s.addEventListener("transitionend",O);const v=setTimeout(p,260)},u=d=>{d.preventDefault(),c()},f=d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),c())};i.addEventListener("click",u),i.addEventListener("keydown",f),t.push(()=>{i.removeEventListener("click",u),i.removeEventListener("keydown",f)})}return()=>t.forEach(r=>r())}function JF(n){if(n.getAttribute("data-layout")!=="menubar")return()=>{};const e=[],t=Array.from(n.querySelectorAll('[data-rune="nav-group"]')),r=new Map,i=new Map;for(const f of t){const d=f.querySelector('[data-field="title"], h1, h2, h3, h4, h5, h6'),h=f.querySelector(":scope > ul, :scope > ol");if(!d||!h)continue;const m=d.id||eo("rf-nav-trigger"),p=h.id||eo("rf-nav-panel");d.id=m,h.id=p,d.setAttribute("role","button"),d.setAttribute("tabindex","0"),d.setAttribute("aria-haspopup","true"),d.setAttribute("aria-expanded","false"),d.setAttribute("aria-controls",p),h.setAttribute("role","menu"),h.setAttribute("aria-labelledby",m),f.setAttribute("data-open","false"),r.set(f,d),i.set(f,h)}const s=f=>{for(const[d,h]of r)d!==f&&(d.setAttribute("data-open","false"),h.setAttribute("aria-expanded","false"))},o=f=>{const d=r.get(f);d&&(s(f),f.setAttribute("data-open","true"),d.setAttribute("aria-expanded","true"))},a=f=>{f.getAttribute("data-open")==="true"?s():o(f)};for(const[f,d]of r){const h=i.get(f),m=v=>{v.preventDefault(),a(f)},p=v=>{switch(v.key){case"Enter":case" ":v.preventDefault(),a(f);break;case"ArrowDown":{v.preventDefault(),o(f),h.querySelector("a, button, [tabindex]")?.focus();break}case"ArrowRight":case"ArrowLeft":{v.preventDefault();const b=Array.from(r.keys()),_=b.indexOf(f);if(_===-1)break;const C=v.key==="ArrowRight"?b[(_+1)%b.length]:b[(_-1+b.length)%b.length];r.get(C)?.focus(),f.getAttribute("data-open")==="true"&&o(C);break}case"Escape":s(),d.focus();break}};d.addEventListener("click",m),d.addEventListener("keydown",p),e.push(()=>{d.removeEventListener("click",m),d.removeEventListener("keydown",p)});const O=v=>{const b=Array.from(h.querySelectorAll("a, button")),_=document.activeElement,C=_?b.indexOf(_):-1;switch(v.key){case"ArrowDown":v.preventDefault(),b[Math.min(C+1,b.length-1)]?.focus();break;case"ArrowUp":v.preventDefault(),C<=0?d.focus():b[C-1]?.focus();break;case"Escape":v.preventDefault(),s(),d.focus();break}};h.addEventListener("keydown",O),e.push(()=>h.removeEventListener("keydown",O))}const l=f=>{n.contains(f.target)||s()},c=f=>{const d=f.relatedTarget;(!d||!n.contains(d))&&s()};document.addEventListener("click",l),n.addEventListener("focusout",c),e.push(()=>document.removeEventListener("click",l)),e.push(()=>n.removeEventListener("focusout",c));const u=n.querySelector(':scope > [data-name="trigger"]');if(u){const f=d=>{d.preventDefault();const h=n.getAttribute("data-open")==="true";n.setAttribute("data-open",h?"false":"true"),u.setAttribute("aria-expanded",h?"false":"true")};u.addEventListener("click",f),e.push(()=>u.removeEventListener("click",f))}return()=>e.forEach(f=>f())}const Fv=typeof HTMLElement<"u"?HTMLElement:class{};function YC(n,e){const t=n.querySelector(`[data-content="${e}"]`);return t?t instanceof HTMLTemplateElement?t.content.textContent||"":t.textContent||"":""}class eX extends Fv{connectedCallback(){const e=this.dataset.language||"mermaid",t=YC(this,"source"),r=this.querySelector(".rf-diagram__container");!r||!t||(e==="mermaid"?this.renderMermaid(t,r):e==="ascii"&&(r.textContent=t,r.style.fontFamily="var(--rf-font-mono)",r.style.whiteSpace="pre"))}async renderMermaid(e,t){try{const i=(await import("https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs")).default,s=getComputedStyle(t);i.initialize({startOnLoad:!1,theme:"base",themeVariables:{primaryColor:s.getPropertyValue("--rf-color-surface").trim()||"#fbfaf7",primaryTextColor:s.getPropertyValue("--rf-color-text").trim()||"#1c1a17",primaryBorderColor:s.getPropertyValue("--rf-color-border").trim()||"#e2e0dd",secondaryColor:s.getPropertyValue("--rf-color-surface-hover").trim()||"#ecebe8",secondaryTextColor:s.getPropertyValue("--rf-color-text").trim()||"#1c1a17",secondaryBorderColor:s.getPropertyValue("--rf-color-border").trim()||"#e2e0dd",tertiaryColor:s.getPropertyValue("--rf-color-info-bg").trim()||"#e8edf4",tertiaryTextColor:s.getPropertyValue("--rf-color-text").trim()||"#1c1a17",tertiaryBorderColor:s.getPropertyValue("--rf-color-info-border").trim()||"#c5d2e0",lineColor:s.getPropertyValue("--rf-color-muted").trim()||"#6b6661",textColor:s.getPropertyValue("--rf-color-text").trim()||"#1c1a17",mainBkg:s.getPropertyValue("--rf-color-surface").trim()||"#fbfaf7",nodeBorder:s.getPropertyValue("--rf-color-border").trim()||"#e2e0dd",clusterBkg:s.getPropertyValue("--rf-color-surface").trim()||"#fbfaf7",clusterBorder:s.getPropertyValue("--rf-color-border").trim()||"#e2e0dd",edgeLabelBackground:s.getPropertyValue("--rf-color-surface").trim()||"#fbfaf7",fontSize:"14px",fontFamily:s.getPropertyValue("--rf-font-sans").trim()||"system-ui, sans-serif"}});const o="mermaid-"+Math.random().toString(36).slice(2),{svg:a}=await i.render(o,e);t.innerHTML=a}catch{}}}const Wu={openstreetmap:{street:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",terrain:"https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",dark:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",minimal:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png"},mapbox:{street:"streets-v12",satellite:"satellite-streets-v12",terrain:"outdoors-v12",dark:"dark-v11",minimal:"light-v11"}},pw={openstreetmap:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',mapbox:'© <a href="https://www.mapbox.com/">Mapbox</a>'},$p=new Map;async function Qp(n){if($p.has(n))return $p.get(n);try{const e=`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(n)}&format=json&limit=1`,r=await(await fetch(e,{headers:{"User-Agent":"refrakt-md-map-rune/1.0"}})).json();if(r.length>0){const i=[parseFloat(r[0].lat),parseFloat(r[0].lon)];return $p.set(n,i),i}}catch{}return null}class tX extends Fv{mapInstance=null;initializing=!1;connectedCallback(){const e=this.extractPins();e.length>0&&this.initLeaflet(e)}disconnectedCallback(){this.mapInstance&&(this.mapInstance.remove(),this.mapInstance=null)}extractPins(){const e=[],t=this.querySelector("ol");if(!t)return e;for(const r of t.querySelectorAll('li[data-rune="map-pin"]')){const i=s=>r.querySelector(`[data-name="${s}"]`)?.textContent||"";e.push({name:i("name"),description:i("description"),lat:parseFloat(r.dataset.lat||"")||0,lng:parseFloat(r.dataset.lng||"")||0,address:r.dataset.address||"",url:r.dataset.url||"",group:r.dataset.group||""})}return e}async initLeaflet(e){if(!(this.initializing||this.mapInstance)){this.initializing=!0;try{const t=this.getRootNode(),r=t instanceof ShadowRoot?t:document.head;if(!t.querySelector('link[href*="leaflet@1.9.4"]')){const A=document.createElement("link");A.rel="stylesheet",A.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",r.appendChild(A)}const s=await import("https://unpkg.com/leaflet@1.9.4/dist/leaflet-src.esm.js"),o=this.dataset.center||"",a=this.dataset.zoom||"",l=this.dataset.style||"street",c=this.dataset.provider||"openstreetmap",u=this.dataset.interactive!=="false",f=this.dataset.route==="true",d=this.dataset.cluster==="true",h=this.dataset.apiKey||"",p=(await Promise.all(e.map(async A=>{if(A.lat&&A.lng)return{...A};if(A.address){const x=await Qp(A.address);if(x)return{...A,lat:x[0],lng:x[1]}}if(A.name){const x=await Qp(A.name);if(x)return{...A,lat:x[0],lng:x[1]}}return null}))).filter(A=>A!==null&&A.lat!==0&&A.lng!==0);if(p.length===0)return;let O=this.querySelector(".rf-map__container");O||(O=document.createElement("div"),O.className="rf-map__container",this.prepend(O));const v=O.querySelector(".rf-map__fallback");v&&v.remove();let b;if(o){const A=o.match(/(-?\d+\.?\d*)\s*,\s*(-?\d+\.?\d*)/);A?b=[parseFloat(A[1]),parseFloat(A[2])]:b=await Qp(o)||[p[0].lat,p[0].lng]}else{const A=p.map(k=>k.lat),x=p.map(k=>k.lng);b=[(Math.min(...A)+Math.max(...A))/2,(Math.min(...x)+Math.max(...x))/2]}const _=a?parseInt(a):13,C=s.map(O,{zoomControl:u,dragging:u,scrollWheelZoom:u,doubleClickZoom:u,touchZoom:u}).setView(b,_);if(c==="mapbox"){const A=Wu.mapbox[l]||Wu.mapbox.street;s.tileLayer(`https://api.mapbox.com/styles/v1/mapbox/${A}/tiles/256/{z}/{x}/{y}@2x?access_token=${h}`,{attribution:pw.mapbox,tileSize:512,zoomOffset:-1}).addTo(C)}else{const A=Wu.openstreetmap[l]||Wu.openstreetmap.street;s.tileLayer(A,{attribution:pw.openstreetmap}).addTo(C)}const w=new Map;for(const A of p){const x=A.group||"";w.has(x)||w.set(x,[]),w.get(x).push(A)}const y=[],S={};for(const[A,x]of w){const k=x.map(E=>{const T=s.marker([E.lat,E.lng]);let $="";return E.name&&($+=`<strong>${E.name}</strong>`),E.description&&($+=`<br><em>${E.description}</em>`),E.address&&($+=`<br><small>${E.address}</small>`),E.url&&($+=`<br><a href="${E.url}" target="_blank" rel="noopener">More info</a>`),$&&T.bindPopup($),T});if(A){const E=s.layerGroup(k).addTo(C);S[A]=E}else k.forEach(E=>E.addTo(C));y.push(...k)}if(Object.keys(S).length>0&&s.control.layers(null,S).addTo(C),f&&p.length>1){const A=p.map(x=>[x.lat,x.lng]);s.polyline(A,{color:"var(--rf-color-primary, #3b82f6)",weight:3,opacity:.7,dashArray:"8, 8"}).addTo(C)}if(d&&y.length>0)try{const A="https://unpkg.com/leaflet.markercluster@1.5.3/dist/leaflet.markercluster-src.js",x="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.css",k="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.Default.css";for(const T of[x,k])if(!t.querySelector(`link[href="${T}"]`)){const $=document.createElement("link");$.rel="stylesheet",$.href=T,r.appendChild($)}await new Promise((T,$)=>{const L=document.createElement("script");L.src=A,L.onload=()=>T(),L.onerror=$,document.head.appendChild(L)});const E=s.markerClusterGroup();y.forEach(T=>{T.remove(),E.addLayer(T)}),C.addLayer(E)}catch{}if(!o&&!a&&p.length>1){const A=s.latLngBounds(p.map(x=>[x.lat,x.lng]));C.fitBounds(A,{padding:[30,30]})}this.mapInstance=C}catch(t){console.warn("Map rune: Leaflet failed to load",t)}finally{this.initializing=!1}}}}class gi{static pages=[];static currentUrl="";static designTokens=null;static theme="auto";static themeListeners=[];static onThemeChange(e){return gi.themeListeners.push(e),()=>{gi.themeListeners=gi.themeListeners.filter(t=>t!==e)}}static setTheme(e){gi.theme=e;for(const t of gi.themeListeners)t(e)}}const Yu={tailwind:['<script src="https://cdn.tailwindcss.com"><\/script>','<script>tailwind.config = { darkMode: "class" }<\/script>'],bootstrap:['<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5/dist/css/bootstrap.min.css">'],bulma:['<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1/css/bulma.min.css">'],pico:['<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">']},mw={heading:"sans-serif",body:"sans-serif",mono:"monospace",display:"sans-serif",caption:"sans-serif"};class nX extends Fv{iframe=null;messageHandler=null;themeCleanup=null;ancestorObserver=null;_content="";_framework="";_dependencies="";_label="Sandbox";_heightAttr="auto";_tokens=null;_localScheme=null;_untrusted=!1;_allowJs=!0;_sandboxOrigin="";connectedCallback(){this._content=this.dataset.sourceContent||YC(this,"source"),this._framework=this.dataset.framework||"",this._dependencies=this.dataset.dependencies||"",this._label=this.dataset.label||"Sandbox",this._heightAttr=this.dataset.height||"auto",this._untrusted=this.dataset.securityMode==="untrusted",this._allowJs=this.dataset.allowJs!=="false",this._sandboxOrigin=this.dataset.sandboxOrigin||"",this._localScheme=this.getAttribute("data-color-scheme");const e=this._localScheme?null:this.closest("[data-color-scheme]")?.getAttribute("data-color-scheme"),t=this._localScheme||e||gi.theme,r=this.dataset.designTokens;if(this._tokens=r?JSON.parse(r):gi.designTokens,this.buildIframe(t),!this._localScheme){this.themeCleanup=gi.onThemeChange(s=>{this.closest("[data-color-scheme]")||this.setTheme(s)}),this.ancestorObserver=new MutationObserver(()=>{const o=this.closest("[data-color-scheme]")?.getAttribute("data-color-scheme");this.setTheme(o||gi.theme)});let i=this.parentElement;for(;i;)this.ancestorObserver.observe(i,{attributes:!0,attributeFilter:["data-color-scheme"]}),i=i.parentElement}}disconnectedCallback(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.themeCleanup&&(this.themeCleanup(),this.themeCleanup=null),this.ancestorObserver&&(this.ancestorObserver.disconnect(),this.ancestorObserver=null),this.iframe=null}buildIframe(e){const t=this.iframe?.style.height;this.iframe=document.createElement("iframe");const r=this._untrusted?"allow-scripts":"allow-scripts allow-same-origin";if(this.iframe.setAttribute("sandbox",r),this._untrusted&&this._sandboxOrigin){const s=new URLSearchParams({framework:this._framework,dependencies:this._dependencies,theme:e||"auto",height:this._heightAttr});this.iframe.src=`${this._sandboxOrigin.replace(/\/$/,"")}/render?${s.toString()}`;const o=a=>{a.data?.type==="rf-sandbox-ready"&&a.source===this.iframe?.contentWindow&&(this.iframe.contentWindow.postMessage({type:"rf-sandbox-content",content:this._content,tokens:this._tokens},this._sandboxOrigin),window.removeEventListener("message",o))};window.addEventListener("message",o)}else this.iframe.srcdoc=this.buildSrcdoc(this._content,this._framework,this._dependencies,this._tokens,e);this.iframe.title=this._label,this.iframe.setAttribute("frameborder","0"),this.iframe.loading="lazy",this.iframe.style.cssText=`width: 100%; border: none; height: ${t||(this._heightAttr!=="auto"?parseInt(this._heightAttr)+"px":"150px")};`;const i=this._untrusted?this.buildUntrustedBanner():null;this.messageHandler&&window.removeEventListener("message",this.messageHandler),this._heightAttr==="auto"&&(this.messageHandler=s=>{s.data?.type==="rf-sandbox-resize"&&s.source===this.iframe?.contentWindow&&(this.iframe.style.height=s.data.height+"px")},window.addEventListener("message",this.messageHandler)),i?this.replaceChildren(i,this.iframe):this.replaceChildren(this.iframe)}buildUntrustedBanner(){const e=document.createElement("div");return e.className="rf-sandbox__untrusted-banner",e.setAttribute("role","note"),e.setAttribute("aria-label","Sandboxed user content"),e.textContent="Sandboxed user content — do not enter sensitive information.",e}setTheme(e){this._localScheme||this.buildIframe(e)}buildSrcdoc(e,t,r,i,s){const o=this.buildDependencyTags(t,r,i);s=s||gi.theme;const a=s==="dark"?' class="dark" data-theme="dark" style="color-scheme:dark"':s==="light"?' data-theme="light" style="color-scheme:light"':"",l=s==="dark"?' class="dark"':"",c=s==="dark"||s==="light"?` data-theme="${s}"`:"",u=e.replace(/\s*data-source(?:="[^"]*")?/g,""),f=this.buildCspMetaTag();return`<!DOCTYPE html>
|
|
338
|
+
`)}return n.textContent??""}function SF(n){const e=n.querySelectorAll("pre"),t=[];for(const r of e){const i=r.parentElement;if(i?.classList.contains("rf-codeblock")&&i.querySelector(":scope > .rf-codeblock__copy"))continue;const s=document.createElement("button");s.className="rf-codeblock__copy",s.type="button",s.setAttribute("aria-label","Copy code"),s.appendChild(Ep(lw));let o;const a=()=>{const c=xF(r);navigator.clipboard.writeText(c).then(()=>{s.innerHTML="",s.appendChild(Ep(kF)),s.setAttribute("aria-label","Copied"),s.classList.add("rf-codeblock__copy--copied"),o&&clearTimeout(o),o=setTimeout(()=>{s.innerHTML="",s.appendChild(Ep(lw)),s.setAttribute("aria-label","Copy code"),s.classList.remove("rf-codeblock__copy--copied")},2e3)})};s.addEventListener("click",a);const l=r.parentElement?.classList.contains("rf-codeblock")?r.parentElement:null;if(l)l.appendChild(s),t.push(()=>{s.removeEventListener("click",a),o&&clearTimeout(o),s.remove()});else{const c=document.createElement("div");c.className="rf-codeblock",r.parentNode?.insertBefore(c,r),c.appendChild(r),c.appendChild(s),t.push(()=>{s.removeEventListener("click",a),o&&clearTimeout(o),c.parentNode?.insertBefore(r,c),c.remove()})}}return()=>t.forEach(r=>r())}function cw(n){const e=Array.from(n.querySelectorAll("details"));if(e.length===0)return()=>{};const t=n.hasAttribute("data-multiple"),r=[];for(const o of e){const a=o.querySelector("summary");if(!a)continue;const l=eo("rf-accordion-panel"),c=eo("rf-accordion-trigger");a.id=c,a.setAttribute("aria-expanded",String(o.open)),o.setAttribute("data-state",o.open?"open":"closed"),a.setAttribute("data-state",o.open?"active":"inactive");const u=Array.from(o.children).find(d=>d instanceof HTMLElement&&d.tagName!=="SUMMARY");u&&(u.id=l,u.setAttribute("role","region"),u.setAttribute("aria-labelledby",c),a.setAttribute("aria-controls",l));const f=()=>{if(a.setAttribute("aria-expanded",String(o.open)),o.setAttribute("data-state",o.open?"open":"closed"),a.setAttribute("data-state",o.open?"active":"inactive"),!t&&o.open){for(const d of e)if(d!==o&&d.open){d.open=!1;const h=d.querySelector("summary");h?.setAttribute("aria-expanded","false"),d.setAttribute("data-state","closed"),h?.setAttribute("data-state","inactive")}}};o.addEventListener("toggle",f),r.push(()=>o.removeEventListener("toggle",f))}const i=e.map(o=>o.querySelector("summary")).filter(o=>o!==null),s=o=>{const a=o.target,l=i.indexOf(a);if(l===-1)return;let c=null;switch(o.key){case"ArrowDown":c=(l+1)%i.length;break;case"ArrowUp":c=(l-1+i.length)%i.length;break;case"Home":c=0;break;case"End":c=i.length-1;break;default:return}c!==null&&(o.preventDefault(),i[c].focus())};return n.addEventListener("keydown",s),r.push(()=>n.removeEventListener("keydown",s)),()=>r.forEach(o=>o())}const tl=new Map,uw=new WeakSet;function AF(n){let e=tl.get(n);return e||(e=new Map,tl.set(n,e)),e}function CF(n){const e=n.split("+").map(i=>i.trim().toLowerCase()).filter(Boolean);if(e.length===0)return null;const t=e[e.length-1];if(!t)return null;const r=new Set(e.slice(0,-1));return{key:t,cmd:r.has("cmd")||r.has("meta"),ctrl:r.has("ctrl")||r.has("control"),alt:r.has("alt")||r.has("option"),shift:r.has("shift")}}function TF(n,e){if(e.key.toLowerCase()!==n.key)return!1;const t=e.metaKey||e.ctrlKey,r=n.cmd||n.ctrl;return!(r&&!t||!r&&t||n.alt!==e.altKey||n.shift!==e.shiftKey)}function PF(n){const e=n.activeElement;if(!e)return!1;const t=e.tagName;return!!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable)}function EF(n){const e=n.ownerDocument;if(!e||!e.defaultView)return()=>{};const t=e.defaultView,r=n instanceof t.HTMLDialogElement?n:$F(n);if(!r)return()=>{};const i=r.id;if(!i)return()=>{};const s=r.querySelector(".rf-drawer__close");s&&(s.hidden=!1);const o=r.getAttribute("data-shortcut")??void 0,a=o?CF(o)??void 0:void 0,l=AF(e);if(l.has(i))return()=>{};if(a)for(const O of l.values())O.shortcut&&dw(O.shortcut)===dw(a)&&console.warn(`[refrakt drawer] shortcut "${o}" is registered by drawers "${O.id}" and "${i}"; the later one wins.`);l.set(i,{dialog:r,id:i,shortcut:a});const c=[],u=`#${i}`,f=O=>{O.preventDefault(),Rg(r)},d=[];if(e.querySelectorAll('a[data-target-type="drawer"]').forEach(O=>{const v=O.getAttribute("href")??"";(v===u||v.endsWith(u))&&(O.addEventListener("click",f),d.push(O))}),c.push(()=>{for(const O of d)O.removeEventListener("click",f)}),s){const O=()=>vf(r);s.addEventListener("click",O),c.push(()=>s.removeEventListener("click",O))}const h=O=>{O.target===r&&vf(r)};r.addEventListener("click",h),c.push(()=>r.removeEventListener("click",h));const m=O=>{O.preventDefault(),vf(r)};r.addEventListener("cancel",m),c.push(()=>r.removeEventListener("cancel",m));const p=()=>{r.setAttribute("data-state","closed"),t.location.hash===u&&t.history.replaceState(null,"",t.location.pathname+t.location.search),fw(e)};return r.addEventListener("close",p),c.push(()=>r.removeEventListener("close",p)),t.location.hash===u&&t.queueMicrotask(()=>{r.open||Rg(r)}),uw.has(e)||(uw.add(e),MF(e)),()=>{for(const O of c)O();l.delete(i),fw(e)}}function $F(n){const e=n.ownerDocument;if(!e)return null;const t=e.createElement("dialog");for(const r of Array.from(n.attributes))t.setAttribute(r.name,r.value);for(;n.firstChild;)t.appendChild(n.firstChild);return n.parentNode&&n.parentNode.replaceChild(t,n),t.setAttribute("data-state","closed"),t}function Rg(n){const e=n.ownerDocument;if(!e||!e.defaultView)return;const t=e.defaultView,r=tl.get(e);if(r)for(const i of r.values())i.dialog!==n&&i.dialog.open&&i.dialog.close();if(!n.open)try{n.showModal()}catch{n.setAttribute("open","")}if(n.setAttribute("data-state","open"),LF(e),n.id){const i=`#${n.id}`;t.location.hash!==i&&t.history.replaceState(null,"",t.location.pathname+t.location.search+i)}}const QF=280;function vf(n){if(!n.open||n.getAttribute("data-state")==="closing")return;n.setAttribute("data-state","closing");let e=!1;const t=()=>{if(!e){e=!0,n.removeEventListener("animationend",r),i!==void 0&&clearTimeout(i);try{n.close()}catch{n.removeAttribute("open")}}},r=s=>{s.target===n&&(s.animationName&&!s.animationName.startsWith("rf-drawer-slide-out")||t())};n.addEventListener("animationend",r);const i=setTimeout(t,QF)}function LF(n){n.documentElement.classList.add("rf-drawer-open")}function fw(n){const e=tl.get(n);if(!e){n.documentElement.classList.remove("rf-drawer-open");return}for(const t of e.values())if(t.dialog.open)return;n.documentElement.classList.remove("rf-drawer-open")}function dw(n){const e=[];return(n.cmd||n.ctrl)&&e.push("mod"),n.alt&&e.push("alt"),n.shift&&e.push("shift"),e.push(n.key),e.join("+")}function MF(n){const e=n.defaultView;if(!e)return;const t=i=>{if(PF(n))return;const s=tl.get(n);if(!s)return;let o;for(const a of s.values())a.shortcut&&TF(a.shortcut,i)&&(o=a);o&&(i.preventDefault(),Rg(o.dialog))};n.addEventListener("keydown",t);const r=()=>{const i=tl.get(n);if(i)for(const s of i.values())s.dialog.open&&e.location.hash!==`#${s.id}`&&vf(s.dialog)};e.addEventListener("popstate",r)}function hw(n){const e=n.querySelector('[data-name="tabs"]'),t=n.querySelector('[data-name="panels"]');if(!e||!t)return()=>{};const r=Array.from(e.children).filter(d=>d instanceof HTMLElement&&d.tagName==="BUTTON"),i=Array.from(t.children).filter(d=>d instanceof HTMLElement);if(r.length===0||i.length===0)return()=>{};const s=r.map(()=>eo("rf-tab")),o=i.map(()=>eo("rf-tabpanel"));for(let d=0;d<r.length;d++)r[d].id=s[d],o[d]&&r[d].setAttribute("aria-controls",o[d]);for(let d=0;d<i.length;d++)o[d]&&(i[d].id=o[d]),s[d]&&i[d].setAttribute("aria-labelledby",s[d]);const a=r[0].className.split(" ")[0]||"";let l=0;function c(d){l=d;for(let h=0;h<r.length;h++){const m=h===l;r[h].setAttribute("aria-selected",String(m)),r[h].setAttribute("data-state",m?"active":"inactive"),a&&r[h].classList.toggle(`${a}--active`,m)}for(let h=0;h<i.length;h++){const m=h===l;i[h].hidden=!m,i[h].setAttribute("data-state",m?"active":"inactive")}}c(0);const u=[];for(let d=0;d<r.length;d++){const h=()=>c(d);r[d].addEventListener("click",h),u.push(()=>r[d].removeEventListener("click",h))}const f=d=>{const h=d.target,m=r.indexOf(h);if(m===-1)return;let p=null;switch(d.key){case"ArrowRight":p=(m+1)%r.length;break;case"ArrowLeft":p=(m-1+r.length)%r.length;break;case"Home":p=0;break;case"End":p=r.length-1;break;default:return}p!==null&&(d.preventDefault(),r[p].focus(),c(p))};return e.addEventListener("keydown",f),u.push(()=>e.removeEventListener("keydown",f)),()=>{u.forEach(d=>d());for(const d of r)d.removeAttribute("id"),d.removeAttribute("aria-controls"),d.removeAttribute("aria-selected"),d.removeAttribute("data-state"),a&&d.classList.remove(`${a}--active`);for(const d of i)d.hidden=!1,d.removeAttribute("id"),d.removeAttribute("aria-labelledby"),d.removeAttribute("data-state")}}function qF(n){const e=n.querySelector('[data-name="steps"]')||n,t=Array.from(e.querySelectorAll('[data-rune="reveal-step"]'));if(t.length===0)return()=>{};let r=1;const i=document.createElement("button");i.className="rf-reveal__next",i.textContent="Continue";const s=document.createElement("button");s.className="rf-reveal__reset",s.textContent="Start over";function o(){for(let c=0;c<t.length;c++){const u=c<r;t[c].classList.toggle("rf-reveal-step--visible",u),t[c].classList.toggle("rf-reveal-step--hidden",!u),t[c].setAttribute("data-state",u?"open":"closed")}r<t.length?(i.parentNode||n.appendChild(i),s.remove()):t.length>1?(i.remove(),s.parentNode||n.appendChild(s)):(i.remove(),s.remove())}const a=()=>{r<t.length&&(r++,o())},l=()=>{r=1,o()};return i.addEventListener("click",a),s.addEventListener("click",l),o(),()=>{i.removeEventListener("click",a),s.removeEventListener("click",l),i.remove(),s.remove();for(const c of t)c.classList.remove("rf-reveal-step--visible","rf-reveal-step--hidden"),c.removeAttribute("data-state")}}function DF(n){const e=n.querySelector("table");if(!e)return()=>{};const t=n.getAttribute("data-searchable")==="true",i=(n.getAttribute("data-sortable")||"").split(",").map(A=>A.trim()).filter(Boolean),s=parseInt(n.getAttribute("data-pagesize")||"0",10),o=n.getAttribute("data-defaultsort")||"",a=Array.from(e.querySelectorAll("th")),l=a.map(A=>A.textContent?.trim()||""),c=e.querySelectorAll("tbody tr"),u=Array.from(c.length>0?c:e.querySelectorAll("tr:not(:first-child)")).map(A=>({el:A,cells:Array.from(A.querySelectorAll("td")).map(x=>x.textContent?.trim()||"")})),f=u.map(A=>A.el);let d="",h=o,m="asc",p=0;const O=[];let v=null,b=null;if(t){v=document.createElement("div"),v.className="rf-datatable__toolbar",b=document.createElement("input"),b.type="search",b.placeholder="Filter rows...",b.className="rf-datatable__input",v.appendChild(b),e.before(v);const A=()=>{d=b.value,p=0,S()};b.addEventListener("input",A),O.push(()=>b.removeEventListener("input",A))}for(const A of a){const x=A.textContent?.trim()||"";if(!i.includes(x))continue;A.style.cursor="pointer",A.style.userSelect="none";const k=()=>{h===x?m=m==="asc"?"desc":"asc":(h=x,m="asc"),p=0,S()};A.addEventListener("click",k),O.push(()=>{A.removeEventListener("click",k),A.style.cursor="",A.style.userSelect=""})}let _=null,C=null,w=null,y=null;if(s>0){_=document.createElement("div"),_.className="rf-datatable__pagination",C=document.createElement("button"),C.className="rf-datatable__page-btn",C.innerHTML="← Prev",y=document.createElement("span"),y.className="rf-datatable__page-info",w=document.createElement("button"),w.className="rf-datatable__page-btn",w.innerHTML="Next →",_.appendChild(C),_.appendChild(y),_.appendChild(w),e.after(_);const A=()=>{p>0&&(p--,S())},x=()=>{p++,S()};C.addEventListener("click",A),w.addEventListener("click",x),O.push(()=>{C.removeEventListener("click",A),w.removeEventListener("click",x)})}function S(){let A=[...u];if(d){const $=d.toLowerCase();A=A.filter(L=>L.cells.some(P=>P.toLowerCase().includes($)))}if(h){const $=l.indexOf(h);$>=0&&A.sort((L,P)=>{const q=L.cells[$].localeCompare(P.cells[$],void 0,{numeric:!0});return m==="asc"?q:-q})}const x=A.length,k=s>0?Math.ceil(x/s):1;p>=k&&(p=Math.max(0,k-1));const E=s>0?A.slice(p*s,(p+1)*s):A,T=e.querySelector("tbody")||e;for(const $ of u)$.el.style.display="none";for(const $ of E)$.el.style.display="",T.appendChild($.el);for(const $ of a){const L=$.textContent?.replace(/[▲▼]/g,"").trim()||"",P=$.querySelector(".rf-datatable__sort-indicator");if(i.includes(L))if(h===L)if(P)P.textContent=m==="asc"?" ▲":" ▼";else{const q=document.createElement("span");q.className="rf-datatable__sort-indicator",q.textContent=m==="asc"?" ▲":" ▼",$.appendChild(q)}else P?.remove()}_&&C&&w&&y&&(C.disabled=p===0,w.disabled=p>=k-1,y.textContent=`${p+1} / ${k}`,k<=1?_.hidden=!0:_.hidden=!1)}return S(),()=>{O.forEach(x=>x()),v?.remove(),_?.remove();for(const x of a)x.querySelector(".rf-datatable__sort-indicator")?.remove();const A=e.querySelector("tbody")||e;for(const x of f)x.style.display="",A.appendChild(x)}}function RF(n){const e=n.tagName==="FORM"?n:n.querySelector("form");if(!e)return()=>{};const t=n.getAttribute("data-action")||e.getAttribute("action")||"",r=n.getAttribute("data-method")||e.getAttribute("method")||"POST",i=n.getAttribute("data-success")||"Form submitted successfully.",s=n.getAttribute("data-error")||"Something went wrong. Please try again.",o=n.getAttribute("data-honeypot")!=="false";let a=null;if(o){a=document.createElement("div"),a.className="rf-form__hp",a.setAttribute("aria-hidden","true"),a.style.display="none";const f=document.createElement("input");f.type="text",f.name="_gotcha",f.setAttribute("autocomplete","off"),f.tabIndex=-1,a.appendChild(f),e.prepend(a)}const l=document.createElement("div");l.className="rf-form__status",l.hidden=!0,e.appendChild(l);function c(f,d){l.hidden=!1,l.className=`rf-form__status rf-form__status--${f}`,l.setAttribute("role",f==="submitting"?"status":"alert"),l.setAttribute("data-state",f),l.textContent=d}const u=async f=>{if(f.preventDefault(),!!t){c("submitting","Submitting...");try{const d=new FormData(e);(await fetch(t,{method:r,body:d,headers:{Accept:"application/json"}})).ok?(c("success",i),e.reset()):c("error",s)}catch{c("error",s)}}};return e.addEventListener("submit",u),()=>{e.removeEventListener("submit",u),a?.remove(),l.remove()}}const IF="http://www.w3.org/2000/svg";function Vu(n){const e=document.createElementNS(IF,"svg");return e.setAttribute("width","14"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.innerHTML=n,e}const as={eye:'<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>',code:'<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',mobile:'<rect x="5" y="2" width="14" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/>',tablet:'<rect x="4" y="2" width="16" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/>',desktop:'<rect x="2" y="3" width="20" height="14" rx="2" ry="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>',sun:'<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>',moon:'<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>'},NF={mobile:as.mobile,tablet:as.tablet,desktop:as.desktop},la={mobile:{width:375,label:"375px"},tablet:{width:768,label:"768px"},desktop:{width:null,label:"Full"}};function BF(n){const e=n.getAttribute("data-theme")||"auto",r=(n.getAttribute("data-responsive")||"").split(",").map(P=>P.trim()).filter(P=>P in la),i=r.length>0,s=n.querySelector('[data-name="source"]'),o=n.querySelector('[data-name="html-source"]'),a=n.querySelector('[data-name="themed-source"]'),l=Array.from(n.children).filter(P=>P!==s&&P!==o&&P!==a&&!P.matches?.("meta[data-field]")),c=s!==null||o!==null;let u="preview",f=e,d=i?r[r.length-1]:null;const h=[],m=document.createElement("div");m.className="rf-preview__toolbar";const p=document.createElement("span");p.className="rf-preview__title",m.appendChild(p);const O=document.createElement("div");O.className="rf-preview__controls",m.appendChild(O);let v=null,b=null;if(c){const P=document.createElement("div");P.className="rf-preview__view-toggle",v=document.createElement("button"),v.className="rf-preview__toggle-btn rf-preview__toggle-btn--active",v.setAttribute("aria-label","Preview"),v.setAttribute("title","Preview"),v.appendChild(Vu(as.eye)),b=document.createElement("button"),b.className="rf-preview__toggle-btn",b.setAttribute("aria-label","View source"),b.setAttribute("title","View source"),b.appendChild(Vu(as.code)),P.appendChild(v),P.appendChild(b),O.appendChild(P);const q=()=>{u="preview",L()},R=()=>{u="code",L()};v.addEventListener("click",q),b.addEventListener("click",R),h.push(()=>{v.removeEventListener("click",q),b.removeEventListener("click",R)})}const _=new Map;if(i){const P=document.createElement("div");P.className="rf-preview__viewport-toggle";for(const q of r){const R=document.createElement("button");R.className="rf-preview__toggle-btn",R.setAttribute("aria-label",`${la[q].label} viewport`),R.setAttribute("title",la[q].label),R.appendChild(Vu(NF[q]||as.desktop));const W=()=>{d=q,L()};R.addEventListener("click",W),h.push(()=>R.removeEventListener("click",W)),P.appendChild(R),_.set(q,R)}O.appendChild(P)}const C=document.createElement("div");C.className="rf-preview__toggle";const w=[{mode:"auto",label:"Auto",title:"System preference",icon:as.desktop},{mode:"light",label:"Light",title:"Light mode",icon:as.sun},{mode:"dark",label:"Dark",title:"Dark mode",icon:as.moon}],y=new Map;for(const P of w){const q=document.createElement("button");q.className="rf-preview__toggle-btn",q.setAttribute("aria-label",`${P.label} theme`),q.setAttribute("title",P.title),q.appendChild(Vu(P.icon));const R=()=>{f=P.mode,L()};q.addEventListener("click",R),h.push(()=>q.removeEventListener("click",R)),C.appendChild(q),y.set(P.mode,q)}O.appendChild(C);const S=document.createElement("div");S.className="rf-preview__canvas";let A=null,x=null;if(i){A=document.createElement("div"),A.className="rf-preview__viewport-frame",x=document.createElement("span"),x.className="rf-preview__viewport-label",x.hidden=!0,A.appendChild(x);for(const P of l)A.appendChild(P);S.appendChild(A)}else for(const P of l)S.appendChild(P);const k=[];let E=null,T=null,$="";if(c){if(E=document.createElement("div"),E.className="rf-preview__source",s){const P=document.createElement("div");P.appendChild(s),k.push({key:"markdoc",label:"Markdoc",panel:P})}if(o){const P=document.createElement("div");P.appendChild(o),k.push({key:"rune",label:"Rune",panel:P})}if(a){const P=document.createElement("div");P.appendChild(a),k.push({key:"html",label:"HTML",panel:P})}if($=k[0]?.key??"",k.length>1){const P=document.createElement("div");P.className="rf-preview__source-tabs",T=new Map;for(const q of k){const R=document.createElement("button");R.className="rf-preview__source-tab",q.key===$&&R.classList.add("rf-preview__source-tab--active"),R.textContent=q.label;const W=()=>{$=q.key,L()};R.addEventListener("click",W),h.push(()=>R.removeEventListener("click",W)),P.appendChild(R),T.set(q.key,R)}E.appendChild(P)}for(const P of k)P.panel.hidden=P.key!==$,E.appendChild(P.panel)}n.appendChild(m),E&&n.appendChild(E),n.appendChild(S);function L(){if(v&&b&&(v.classList.toggle("rf-preview__toggle-btn--active",u==="preview"),b.classList.toggle("rf-preview__toggle-btn--active",u==="code")),E&&(E.hidden=u!=="code"),S.hidden=u==="code"&&c,T)for(const[q,R]of T)R.classList.toggle("rf-preview__source-tab--active",$===q);for(const q of k)q.panel.hidden=q.key!==$;for(const[q,R]of _)R.classList.toggle("rf-preview__toggle-btn--active",d===q);if(A){const q=d&&la[d]?la[d].width:null;A.classList.toggle("rf-preview__viewport-frame--constrained",!!q),A.style.maxWidth=q?`${q}px`:"",x&&(q&&d?(x.textContent=la[d].label,x.hidden=!1):x.hidden=!0)}for(const[q,R]of y)R.classList.toggle("rf-preview__toggle-btn--active",f===q);const P=f==="auto"?void 0:f;P?S.setAttribute("data-color-scheme",P):S.removeAttribute("data-color-scheme");for(const q of S.querySelectorAll("rf-sandbox"))typeof q.setTheme=="function"&&q.setTheme(P||"auto")}return L(),()=>{h.forEach(P=>P()),s&&n.appendChild(s),o&&n.appendChild(o),a&&n.appendChild(a);for(const P of Array.from(A?.children??S.children))P!==x&&n.appendChild(P);m.remove(),S.remove(),E?.remove()}}function jF(n){const e=n.querySelectorAll("[data-scrollspy]"),t=[];for(const r of e){const i=r.querySelectorAll('a[href^="#"]');if(i.length===0)continue;const s=new Map,o=[];for(const c of i){const u=c.getAttribute("href").slice(1),f=document.getElementById(u);if(!f)continue;const d=c.closest("li");d&&(s.set(f,d),o.push(f))}if(o.length===0)continue;let a=null;const l=new IntersectionObserver(c=>{for(const u of c)if(u.isIntersecting){const f=s.get(u.target);f&&f!==a&&(a?.removeAttribute("data-active"),f.setAttribute("data-active",""),a=f);break}},{rootMargin:"0px 0px -80% 0px"});for(const c of o)l.observe(c);t.push(()=>{l.disconnect(),a?.removeAttribute("data-active")})}return()=>t.forEach(r=>r())}function zF(n){const e=n.querySelectorAll("[data-version-switcher]"),t=[];for(const r of e){const i=r.querySelector("select");if(!i)continue;const s=()=>{const o=i.value;o&&o!==window.location.pathname&&(window.location.href=o)};i.addEventListener("change",s),t.push(()=>i.removeEventListener("change",s))}return()=>t.forEach(r=>r())}function ZF(n){const e=[];if(n.getAttribute("data-layout")==="carousel"){const t=FF(n);t&&e.push(t)}if(n.getAttribute("data-lightbox")==="true"){const t=XF(n);t&&e.push(t)}return()=>e.forEach(t=>t())}function FF(n){const e=n.querySelector('[data-name="items"]');if(!e)return;const t=Array.from(e.querySelectorAll('[data-name="item"]'));if(t.length===0)return;const r=document.createElement("button");r.className="rf-gallery__nav rf-gallery__nav--prev",r.setAttribute("aria-label","Previous"),r.textContent="‹";const i=document.createElement("button");i.className="rf-gallery__nav rf-gallery__nav--next",i.setAttribute("aria-label","Next"),i.textContent="›",n.appendChild(r),n.appendChild(i);function s(c){const u=t[0];if(!u||!e)return;const f=u.offsetWidth+parseFloat(getComputedStyle(e).gap||"0");e.scrollBy({left:c*f,behavior:"smooth"})}const o=()=>s(-1),a=()=>s(1);r.addEventListener("click",o),i.addEventListener("click",a);const l=c=>{c.key==="ArrowLeft"&&(c.preventDefault(),s(-1)),c.key==="ArrowRight"&&(c.preventDefault(),s(1))};return n.setAttribute("tabindex","0"),n.addEventListener("keydown",l),()=>{r.removeEventListener("click",o),i.removeEventListener("click",a),n.removeEventListener("keydown",l),r.remove(),i.remove(),n.removeAttribute("tabindex")}}function XF(n){const e=Array.from(n.querySelectorAll('[data-name="item"]'));if(e.length===0)return;let t=null,r=0;function i(d){return d.querySelector("img")?.getAttribute("src")||""}function s(d){return d.querySelector("img")?.getAttribute("alt")||""}function o(d){r=d,e[r]?.setAttribute("data-state","selected"),t=document.createElement("div"),t.className="rf-gallery__lightbox",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label","Image lightbox");const h=document.createElement("img");h.src=i(e[r]),h.alt=s(e[r]);const m=document.createElement("button");m.className="rf-gallery__lightbox-close",m.setAttribute("aria-label","Close lightbox"),m.textContent="×";const p=document.createElement("button");p.className="rf-gallery__lightbox-nav rf-gallery__lightbox-nav--prev",p.setAttribute("aria-label","Previous image"),p.textContent="‹";const O=document.createElement("button");O.className="rf-gallery__lightbox-nav rf-gallery__lightbox-nav--next",O.setAttribute("aria-label","Next image"),O.textContent="›",t.appendChild(h),t.appendChild(m),e.length>1&&(t.appendChild(p),t.appendChild(O)),m.addEventListener("click",l),p.addEventListener("click",()=>a(-1)),O.addEventListener("click",()=>a(1)),t.addEventListener("click",v=>{v.target===t&&l()}),document.body.appendChild(t),document.addEventListener("keydown",c),m.focus()}function a(d){if(!t)return;e[r]?.removeAttribute("data-state"),r=(r+d+e.length)%e.length,e[r]?.setAttribute("data-state","selected");const h=t.querySelector("img");h&&(h.src=i(e[r]),h.alt=s(e[r]))}function l(){t&&(e[r]?.removeAttribute("data-state"),document.removeEventListener("keydown",c),t.remove(),t=null,e[r]?.focus())}function c(d){d.key==="Escape"&&(d.preventDefault(),l()),d.key==="ArrowLeft"&&(d.preventDefault(),a(-1)),d.key==="ArrowRight"&&(d.preventDefault(),a(1))}const u=[];e.forEach((d,h)=>{const m=()=>o(h);d.addEventListener("click",m),d.setAttribute("tabindex","0"),d.setAttribute("role","button"),d.setAttribute("aria-label",s(d)||`View image ${h+1}`),u.push([d,m])});const f=d=>{if(d.key==="Enter"||d.key===" "){d.preventDefault();const h=d.currentTarget,m=e.indexOf(h);m>=0&&o(m)}};return e.forEach(d=>d.addEventListener("keydown",f)),()=>{l();for(const[d,h]of u)d.removeEventListener("click",h),d.removeAttribute("tabindex"),d.removeAttribute("role"),d.removeAttribute("aria-label");e.forEach(d=>d.removeEventListener("keydown",f))}}function VF(n){switch(n.getAttribute("data-variant")||"slider"){case"toggle":return UF(n);case"fade":return GF(n);case"auto":return HF(n);default:return YF(n)}}function sh(n){const e=n.querySelector('[data-name="panels"]')||n;return Array.from(e.querySelectorAll(':scope > [data-rune="juxtapose-panel"]'))}function WF(n){return n.querySelector('[data-name="name"]')?.textContent?.trim()||""}function YF(n){const e=sh(n);if(e.length<2)return()=>{};const r=(n.getAttribute("data-orientation")||"vertical")==="horizontal",i=n.querySelector('[data-name="panels"]');if(!i)return()=>{};i.style.position="relative",i.style.overflow="hidden",e[0].style.position="absolute",e[0].style.inset="0",e[0].style.zIndex="2",e[0].style.willChange="clip-path",e[1].style.position="relative",e[1].style.zIndex="1";for(const O of e)for(const v of O.querySelectorAll('iframe[loading="lazy"]'))v.loading="eager";const s=document.createElement("div");s.className="rf-juxtapose__divider",s.setAttribute("role","slider"),s.setAttribute("aria-label","Comparison slider"),s.setAttribute("aria-valuemin","0"),s.setAttribute("aria-valuemax","100"),s.setAttribute("tabindex","0");const o=document.createElement("div");o.className="rf-juxtapose__divider-handle",s.appendChild(o),i.appendChild(s);function a(O){const v=Math.max(0,Math.min(100,O));n.style.setProperty("--jx-position",String(v)),s.setAttribute("aria-valuenow",String(Math.round(v))),r?(e[0].style.clipPath=`inset(0 0 ${100-v}% 0)`,s.style.top=`${v}%`,s.style.left=""):(e[0].style.clipPath=`inset(0 ${100-v}% 0 0)`,s.style.left=`${v}%`,s.style.top="")}const l=parseFloat(n.style.getPropertyValue("--jx-position"))||50;a(l);let c=!1;function u(O){const v=i.getBoundingClientRect();return r?(O.clientY-v.top)/v.height*100:(O.clientX-v.left)/v.width*100}const f=O=>{c=!0,s.setPointerCapture(O.pointerId),a(u(O)),O.preventDefault()},d=O=>{c&&a(u(O))},h=O=>{c&&(c=!1,s.releasePointerCapture(O.pointerId))},m=O=>{O.target===s||s.contains(O.target)||(c=!0,s.setPointerCapture(O.pointerId),a(u(O)))};s.addEventListener("pointerdown",f),s.addEventListener("pointermove",d),s.addEventListener("pointerup",h),i.addEventListener("pointerdown",m),i.addEventListener("pointermove",d),i.addEventListener("pointerup",h);const p=O=>{const v=parseFloat(n.style.getPropertyValue("--jx-position"))||50,b=O.shiftKey?10:2,_=r?["ArrowUp"]:["ArrowLeft"],C=r?["ArrowDown"]:["ArrowRight"];_.includes(O.key)?(a(v-b),O.preventDefault()):C.includes(O.key)?(a(v+b),O.preventDefault()):O.key==="Home"?(a(0),O.preventDefault()):O.key==="End"&&(a(100),O.preventDefault())};return s.addEventListener("keydown",p),()=>{s.removeEventListener("pointerdown",f),s.removeEventListener("pointermove",d),s.removeEventListener("pointerup",h),i.removeEventListener("pointerdown",m),i.removeEventListener("pointermove",d),i.removeEventListener("pointerup",h),s.removeEventListener("keydown",p),s.remove(),i.style.position="",i.style.overflow="";for(const O of e)O.style.position="",O.style.inset="",O.style.zIndex="",O.style.clipPath="",O.style.willChange=""}}function UF(n){const e=sh(n);if(e.length<2)return()=>{};let t=0;const r=document.createElement("div");r.className="rf-juxtapose__toggle-bar",r.setAttribute("role","radiogroup"),r.setAttribute("aria-label","Comparison toggle");const i=e.map((l,c)=>{const u=document.createElement("button");return u.className="rf-juxtapose__toggle-btn",u.setAttribute("role","radio"),u.textContent=WF(l)||`Panel ${c+1}`,r.appendChild(u),u}),s=n.querySelector('[data-name="panels"]');s?s.parentNode.insertBefore(r,s):n.insertBefore(r,n.firstChild);function o(){e.forEach((l,c)=>{const u=c===t;l.hidden=!u,l.setAttribute("data-state",u?"active":"inactive")}),i.forEach((l,c)=>{const u=c===t;l.setAttribute("aria-checked",String(u)),l.setAttribute("data-state",u?"active":"inactive"),l.classList.toggle("rf-juxtapose__toggle-btn--active",u)})}const a=l=>{const c=l.target.closest(".rf-juxtapose__toggle-btn");if(!c)return;const u=i.indexOf(c);u>=0&&(t=u,o())};return r.addEventListener("click",a),o(),()=>{r.removeEventListener("click",a),r.remove();for(const l of e)l.hidden=!1,l.removeAttribute("data-state")}}function GF(n){const e=sh(n);if(e.length<2)return()=>{};const t=n.querySelector('[data-name="panels"]');if(!t)return()=>{};const r=parseInt(n.style.getPropertyValue("--jx-duration")||"1000",10);t.style.position="relative",e[0].style.position="relative",e[0].style.zIndex="1",e[1].style.position="absolute",e[1].style.inset="0",e[1].style.zIndex="2",e[1].style.opacity="0",e[1].style.transition=`opacity ${r}ms ease`;for(const l of e)for(const c of l.querySelectorAll('iframe[loading="lazy"]'))c.loading="eager";let i=!1;const s=()=>{i||(e[1].style.opacity="1")},o=()=>{i||(e[1].style.opacity="0")},a=()=>{i=!i,e[1].style.opacity=i?"1":"0"};return t.addEventListener("mouseenter",s),t.addEventListener("mouseleave",o),t.addEventListener("click",a),t.setAttribute("aria-live","polite"),()=>{t.removeEventListener("mouseenter",s),t.removeEventListener("mouseleave",o),t.removeEventListener("click",a),t.removeAttribute("aria-live"),t.style.position="";for(const l of e)l.style.position="",l.style.inset="",l.style.zIndex="",l.style.opacity="",l.style.transition=""}}function HF(n){const e=sh(n);if(e.length<2)return()=>{};const r=(n.getAttribute("data-orientation")||"vertical")==="horizontal",i=n.querySelector('[data-name="panels"]');if(!i)return()=>{};const s=parseFloat(n.style.getPropertyValue("--jx-position"))||50,o=parseInt(n.style.getPropertyValue("--jx-duration")||"1000",10);i.style.position="relative",i.style.overflow="hidden",e[0].style.position="absolute",e[0].style.inset="0",e[0].style.zIndex="2",e[0].style.willChange="clip-path",e[1].style.position="relative",e[1].style.zIndex="1";for(const d of e)for(const h of d.querySelectorAll('iframe[loading="lazy"]'))h.loading="eager";function a(d){n.style.setProperty("--jx-position",String(d)),r?e[0].style.clipPath=`inset(0 0 ${100-d}% 0)`:e[0].style.clipPath=`inset(0 ${100-d}% 0 0)`}a(0);let l=null,c=!1;function u(){if(c)return;c=!0;const d=performance.now(),h=0;function m(p){const O=p-d,v=Math.min(O/o,1),b=1-Math.pow(1-v,3);a(h+(s-h)*b),v<1&&(l=requestAnimationFrame(m))}l=requestAnimationFrame(m)}const f=new IntersectionObserver(d=>{for(const h of d)h.isIntersecting&&u()},{threshold:.3});return f.observe(n),()=>{f.disconnect(),l!==null&&cancelAnimationFrame(l),i.style.position="",i.style.overflow="";for(const d of e)d.style.position="",d.style.inset="",d.style.zIndex="",d.style.clipPath="",d.style.willChange=""}}function KF(n){if(n.getAttribute("data-collapsible")!=="true")return()=>{};const e=Array.from(n.querySelectorAll('[data-rune="nav-group"]'));if(e.length===0)return()=>{};const t=[];for(const r of e){const i=r.querySelector('[data-field="title"], h1, h2, h3, h4, h5, h6');if(!i)continue;const s=r.querySelector(':scope > [data-name="panel"], :scope > ul, :scope > ol');if(!s)continue;const o=i.id||eo("rf-nav-trigger"),a=s.id||eo("rf-nav-panel");i.id=o,s.id=a,(r.getAttribute("data-collapsed")??"true")!=="false"&&r.setAttribute("data-collapsed","true"),i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("aria-controls",a),i.setAttribute("aria-expanded",r.getAttribute("data-collapsed")==="false"?"true":"false"),s.setAttribute("aria-labelledby",o);const c=()=>{const d=r.getAttribute("data-collapsed")==="false",h=s.getBoundingClientRect().height,m=d?0:s.scrollHeight;s.style.height=h+"px",s.offsetHeight,r.setAttribute("data-collapsed",d?"true":"false"),i.setAttribute("aria-expanded",d?"false":"true"),s.style.height=m+"px";const p=()=>{s.style.height="",s.removeEventListener("transitionend",O),clearTimeout(v)},O=b=>{b.target!==s||b.propertyName!=="height"||p()};s.addEventListener("transitionend",O);const v=setTimeout(p,260)},u=d=>{d.preventDefault(),c()},f=d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),c())};i.addEventListener("click",u),i.addEventListener("keydown",f),t.push(()=>{i.removeEventListener("click",u),i.removeEventListener("keydown",f)})}return()=>t.forEach(r=>r())}function JF(n){if(n.getAttribute("data-layout")!=="menubar")return()=>{};const e=[],t=Array.from(n.querySelectorAll('[data-rune="nav-group"]')),r=new Map,i=new Map;for(const f of t){const d=f.querySelector('[data-field="title"], h1, h2, h3, h4, h5, h6'),h=f.querySelector(":scope > ul, :scope > ol");if(!d||!h)continue;const m=d.id||eo("rf-nav-trigger"),p=h.id||eo("rf-nav-panel");d.id=m,h.id=p,d.setAttribute("role","button"),d.setAttribute("tabindex","0"),d.setAttribute("aria-haspopup","true"),d.setAttribute("aria-expanded","false"),d.setAttribute("aria-controls",p),h.setAttribute("role","menu"),h.setAttribute("aria-labelledby",m),f.setAttribute("data-open","false"),r.set(f,d),i.set(f,h)}const s=f=>{for(const[d,h]of r)d!==f&&(d.setAttribute("data-open","false"),h.setAttribute("aria-expanded","false"))},o=f=>{const d=r.get(f);d&&(s(f),f.setAttribute("data-open","true"),d.setAttribute("aria-expanded","true"))},a=f=>{f.getAttribute("data-open")==="true"?s():o(f)};for(const[f,d]of r){const h=i.get(f),m=v=>{v.preventDefault(),a(f)},p=v=>{switch(v.key){case"Enter":case" ":v.preventDefault(),a(f);break;case"ArrowDown":{v.preventDefault(),o(f),h.querySelector("a, button, [tabindex]")?.focus();break}case"ArrowRight":case"ArrowLeft":{v.preventDefault();const b=Array.from(r.keys()),_=b.indexOf(f);if(_===-1)break;const C=v.key==="ArrowRight"?b[(_+1)%b.length]:b[(_-1+b.length)%b.length];r.get(C)?.focus(),f.getAttribute("data-open")==="true"&&o(C);break}case"Escape":s(),d.focus();break}};d.addEventListener("click",m),d.addEventListener("keydown",p),e.push(()=>{d.removeEventListener("click",m),d.removeEventListener("keydown",p)});const O=v=>{const b=Array.from(h.querySelectorAll("a, button")),_=document.activeElement,C=_?b.indexOf(_):-1;switch(v.key){case"ArrowDown":v.preventDefault(),b[Math.min(C+1,b.length-1)]?.focus();break;case"ArrowUp":v.preventDefault(),C<=0?d.focus():b[C-1]?.focus();break;case"Escape":v.preventDefault(),s(),d.focus();break}};h.addEventListener("keydown",O),e.push(()=>h.removeEventListener("keydown",O))}const l=f=>{n.contains(f.target)||s()},c=f=>{const d=f.relatedTarget;(!d||!n.contains(d))&&s()};document.addEventListener("click",l),n.addEventListener("focusout",c),e.push(()=>document.removeEventListener("click",l)),e.push(()=>n.removeEventListener("focusout",c));const u=n.querySelector(':scope > [data-name="trigger"]');if(u){const f=d=>{d.preventDefault();const h=n.getAttribute("data-open")==="true";n.setAttribute("data-open",h?"false":"true"),u.setAttribute("aria-expanded",h?"false":"true")};u.addEventListener("click",f),e.push(()=>u.removeEventListener("click",f))}return()=>e.forEach(f=>f())}const Fv=typeof HTMLElement<"u"?HTMLElement:class{};function YC(n,e){const t=n.querySelector(`[data-content="${e}"]`);return t?t instanceof HTMLTemplateElement?t.content.textContent||t.textContent||"":t.textContent||"":""}function eX(){const n=document.documentElement.dataset.theme;return n==="dark"?!0:n==="light"?!1:matchMedia("(prefers-color-scheme: dark)").matches}class tX extends Fv{themeObserver;mediaQuery;mediaListener;source="";container=null;language="mermaid";connectedCallback(){requestAnimationFrame(()=>this.tryRender())}disconnectedCallback(){this.themeObserver?.disconnect(),this.mediaQuery&&this.mediaListener&&this.mediaQuery.removeEventListener("change",this.mediaListener)}tryRender(e=0){if(this.language=this.dataset.language||"mermaid",this.source=YC(this,"source"),this.container=this.querySelector(".rf-diagram__container"),!!this.container){if(!this.source){e<3&&requestAnimationFrame(()=>this.tryRender(e+1));return}this.language==="mermaid"?(this.renderMermaid(),this.watchThemeChanges()):this.language==="ascii"&&(this.container.textContent=this.source,this.container.style.fontFamily="var(--rf-font-mono)",this.container.style.whiteSpace="pre")}}watchThemeChanges(){this.themeObserver?.disconnect(),this.themeObserver=new MutationObserver(()=>this.renderMermaid()),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-color-scheme"],subtree:!0}),this.mediaQuery||(this.mediaQuery=matchMedia("(prefers-color-scheme: dark)"),this.mediaListener=()=>{document.documentElement.dataset.theme||this.renderMermaid()},this.mediaQuery.addEventListener("change",this.mediaListener))}async renderMermaid(){if(!(!this.container||!this.source))try{const t=(await import("https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs")).default,r=getComputedStyle(this.container),i=eX();t.initialize({startOnLoad:!1,theme:i?"dark":"base",themeVariables:{darkMode:i,primaryColor:r.getPropertyValue("--rf-color-surface").trim()||"#fbfaf7",primaryTextColor:r.getPropertyValue("--rf-color-text").trim()||"#1c1a17",primaryBorderColor:r.getPropertyValue("--rf-color-border").trim()||"#e2e0dd",secondaryColor:r.getPropertyValue("--rf-color-surface-hover").trim()||"#ecebe8",secondaryTextColor:r.getPropertyValue("--rf-color-text").trim()||"#1c1a17",secondaryBorderColor:r.getPropertyValue("--rf-color-border").trim()||"#e2e0dd",tertiaryColor:r.getPropertyValue("--rf-color-info-bg").trim()||"#e8edf4",tertiaryTextColor:r.getPropertyValue("--rf-color-text").trim()||"#1c1a17",tertiaryBorderColor:r.getPropertyValue("--rf-color-info-border").trim()||"#c5d2e0",lineColor:r.getPropertyValue("--rf-color-muted").trim()||"#6b6661",textColor:r.getPropertyValue("--rf-color-text").trim()||"#1c1a17",mainBkg:r.getPropertyValue("--rf-color-surface").trim()||"#fbfaf7",nodeBorder:r.getPropertyValue("--rf-color-border").trim()||"#e2e0dd",clusterBkg:r.getPropertyValue("--rf-color-surface").trim()||"#fbfaf7",clusterBorder:r.getPropertyValue("--rf-color-border").trim()||"#e2e0dd",edgeLabelBackground:r.getPropertyValue("--rf-color-surface").trim()||"#fbfaf7",fontSize:"14px",fontFamily:r.getPropertyValue("--rf-font-sans").trim()||"system-ui, sans-serif"}});const s="mermaid-"+Math.random().toString(36).slice(2),{svg:o}=await t.render(s,this.source);this.container.innerHTML=o,this.dataset.rendered=""}catch{}}}const Wu={openstreetmap:{street:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",terrain:"https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",dark:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",minimal:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png"},mapbox:{street:"streets-v12",satellite:"satellite-streets-v12",terrain:"outdoors-v12",dark:"dark-v11",minimal:"light-v11"}},pw={openstreetmap:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',mapbox:'© <a href="https://www.mapbox.com/">Mapbox</a>'},$p=new Map;async function Qp(n){if($p.has(n))return $p.get(n);try{const e=`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(n)}&format=json&limit=1`,r=await(await fetch(e,{headers:{"User-Agent":"refrakt-md-map-rune/1.0"}})).json();if(r.length>0){const i=[parseFloat(r[0].lat),parseFloat(r[0].lon)];return $p.set(n,i),i}}catch{}return null}class nX extends Fv{mapInstance=null;initializing=!1;connectedCallback(){const e=this.extractPins();e.length>0&&this.initLeaflet(e)}disconnectedCallback(){this.mapInstance&&(this.mapInstance.remove(),this.mapInstance=null)}extractPins(){const e=[],t=this.querySelector("ol");if(!t)return e;for(const r of t.querySelectorAll('li[data-rune="map-pin"]')){const i=s=>r.querySelector(`[data-name="${s}"]`)?.textContent||"";e.push({name:i("name"),description:i("description"),lat:parseFloat(r.dataset.lat||"")||0,lng:parseFloat(r.dataset.lng||"")||0,address:r.dataset.address||"",url:r.dataset.url||"",group:r.dataset.group||""})}return e}async initLeaflet(e){if(!(this.initializing||this.mapInstance)){this.initializing=!0;try{const t=this.getRootNode(),r=t instanceof ShadowRoot?t:document.head;if(!t.querySelector('link[href*="leaflet@1.9.4"]')){const A=document.createElement("link");A.rel="stylesheet",A.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",r.appendChild(A)}const s=await import("https://unpkg.com/leaflet@1.9.4/dist/leaflet-src.esm.js"),o=this.dataset.center||"",a=this.dataset.zoom||"",l=this.dataset.style||"street",c=this.dataset.provider||"openstreetmap",u=this.dataset.interactive!=="false",f=this.dataset.route==="true",d=this.dataset.cluster==="true",h=this.dataset.apiKey||"",p=(await Promise.all(e.map(async A=>{if(A.lat&&A.lng)return{...A};if(A.address){const x=await Qp(A.address);if(x)return{...A,lat:x[0],lng:x[1]}}if(A.name){const x=await Qp(A.name);if(x)return{...A,lat:x[0],lng:x[1]}}return null}))).filter(A=>A!==null&&A.lat!==0&&A.lng!==0);if(p.length===0)return;let O=this.querySelector(".rf-map__container");O||(O=document.createElement("div"),O.className="rf-map__container",this.prepend(O));const v=O.querySelector(".rf-map__fallback");v&&v.remove();let b;if(o){const A=o.match(/(-?\d+\.?\d*)\s*,\s*(-?\d+\.?\d*)/);A?b=[parseFloat(A[1]),parseFloat(A[2])]:b=await Qp(o)||[p[0].lat,p[0].lng]}else{const A=p.map(k=>k.lat),x=p.map(k=>k.lng);b=[(Math.min(...A)+Math.max(...A))/2,(Math.min(...x)+Math.max(...x))/2]}const _=a?parseInt(a):13,C=s.map(O,{zoomControl:u,dragging:u,scrollWheelZoom:u,doubleClickZoom:u,touchZoom:u}).setView(b,_);if(c==="mapbox"){const A=Wu.mapbox[l]||Wu.mapbox.street;s.tileLayer(`https://api.mapbox.com/styles/v1/mapbox/${A}/tiles/256/{z}/{x}/{y}@2x?access_token=${h}`,{attribution:pw.mapbox,tileSize:512,zoomOffset:-1}).addTo(C)}else{const A=Wu.openstreetmap[l]||Wu.openstreetmap.street;s.tileLayer(A,{attribution:pw.openstreetmap}).addTo(C)}const w=new Map;for(const A of p){const x=A.group||"";w.has(x)||w.set(x,[]),w.get(x).push(A)}const y=[],S={};for(const[A,x]of w){const k=x.map(E=>{const T=s.marker([E.lat,E.lng]);let $="";return E.name&&($+=`<strong>${E.name}</strong>`),E.description&&($+=`<br><em>${E.description}</em>`),E.address&&($+=`<br><small>${E.address}</small>`),E.url&&($+=`<br><a href="${E.url}" target="_blank" rel="noopener">More info</a>`),$&&T.bindPopup($),T});if(A){const E=s.layerGroup(k).addTo(C);S[A]=E}else k.forEach(E=>E.addTo(C));y.push(...k)}if(Object.keys(S).length>0&&s.control.layers(null,S).addTo(C),f&&p.length>1){const A=p.map(x=>[x.lat,x.lng]);s.polyline(A,{color:"var(--rf-color-primary, #3b82f6)",weight:3,opacity:.7,dashArray:"8, 8"}).addTo(C)}if(d&&y.length>0)try{const A="https://unpkg.com/leaflet.markercluster@1.5.3/dist/leaflet.markercluster-src.js",x="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.css",k="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.Default.css";for(const T of[x,k])if(!t.querySelector(`link[href="${T}"]`)){const $=document.createElement("link");$.rel="stylesheet",$.href=T,r.appendChild($)}await new Promise((T,$)=>{const L=document.createElement("script");L.src=A,L.onload=()=>T(),L.onerror=$,document.head.appendChild(L)});const E=s.markerClusterGroup();y.forEach(T=>{T.remove(),E.addLayer(T)}),C.addLayer(E)}catch{}if(!o&&!a&&p.length>1){const A=s.latLngBounds(p.map(x=>[x.lat,x.lng]));C.fitBounds(A,{padding:[30,30]})}this.mapInstance=C}catch(t){console.warn("Map rune: Leaflet failed to load",t)}finally{this.initializing=!1}}}}class gi{static pages=[];static currentUrl="";static designTokens=null;static theme="auto";static themeListeners=[];static onThemeChange(e){return gi.themeListeners.push(e),()=>{gi.themeListeners=gi.themeListeners.filter(t=>t!==e)}}static setTheme(e){gi.theme=e;for(const t of gi.themeListeners)t(e)}}const Yu={tailwind:['<script src="https://cdn.tailwindcss.com"><\/script>','<script>tailwind.config = { darkMode: "class" }<\/script>'],bootstrap:['<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5/dist/css/bootstrap.min.css">'],bulma:['<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1/css/bulma.min.css">'],pico:['<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">']},mw={heading:"sans-serif",body:"sans-serif",mono:"monospace",display:"sans-serif",caption:"sans-serif"};class rX extends Fv{iframe=null;messageHandler=null;themeCleanup=null;ancestorObserver=null;_content="";_framework="";_dependencies="";_label="Sandbox";_heightAttr="auto";_tokens=null;_localScheme=null;_untrusted=!1;_allowJs=!0;_sandboxOrigin="";connectedCallback(){this._content=this.dataset.sourceContent||YC(this,"source"),this._framework=this.dataset.framework||"",this._dependencies=this.dataset.dependencies||"",this._label=this.dataset.label||"Sandbox",this._heightAttr=this.dataset.height||"auto",this._untrusted=this.dataset.securityMode==="untrusted",this._allowJs=this.dataset.allowJs!=="false",this._sandboxOrigin=this.dataset.sandboxOrigin||"",this._localScheme=this.getAttribute("data-color-scheme");const e=this._localScheme?null:this.closest("[data-color-scheme]")?.getAttribute("data-color-scheme"),t=this._localScheme||e||gi.theme,r=this.dataset.designTokens;if(this._tokens=r?JSON.parse(r):gi.designTokens,this.buildIframe(t),!this._localScheme){this.themeCleanup=gi.onThemeChange(s=>{this.closest("[data-color-scheme]")||this.setTheme(s)}),this.ancestorObserver=new MutationObserver(()=>{const o=this.closest("[data-color-scheme]")?.getAttribute("data-color-scheme");this.setTheme(o||gi.theme)});let i=this.parentElement;for(;i;)this.ancestorObserver.observe(i,{attributes:!0,attributeFilter:["data-color-scheme"]}),i=i.parentElement}}disconnectedCallback(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.themeCleanup&&(this.themeCleanup(),this.themeCleanup=null),this.ancestorObserver&&(this.ancestorObserver.disconnect(),this.ancestorObserver=null),this.iframe=null}buildIframe(e){const t=this.iframe?.style.height;this.iframe=document.createElement("iframe");const r=this._untrusted?"allow-scripts":"allow-scripts allow-same-origin";if(this.iframe.setAttribute("sandbox",r),this._untrusted&&this._sandboxOrigin){const s=new URLSearchParams({framework:this._framework,dependencies:this._dependencies,theme:e||"auto",height:this._heightAttr});this.iframe.src=`${this._sandboxOrigin.replace(/\/$/,"")}/render?${s.toString()}`;const o=a=>{a.data?.type==="rf-sandbox-ready"&&a.source===this.iframe?.contentWindow&&(this.iframe.contentWindow.postMessage({type:"rf-sandbox-content",content:this._content,tokens:this._tokens},this._sandboxOrigin),window.removeEventListener("message",o))};window.addEventListener("message",o)}else this.iframe.srcdoc=this.buildSrcdoc(this._content,this._framework,this._dependencies,this._tokens,e);this.iframe.title=this._label,this.iframe.setAttribute("frameborder","0"),this.iframe.loading="lazy",this.iframe.style.cssText=`width: 100%; border: none; height: ${t||(this._heightAttr!=="auto"?parseInt(this._heightAttr)+"px":"150px")};`;const i=this._untrusted?this.buildUntrustedBanner():null;this.messageHandler&&window.removeEventListener("message",this.messageHandler),this._heightAttr==="auto"&&(this.messageHandler=s=>{s.data?.type==="rf-sandbox-resize"&&s.source===this.iframe?.contentWindow&&(this.iframe.style.height=s.data.height+"px")},window.addEventListener("message",this.messageHandler)),i?this.replaceChildren(i,this.iframe):this.replaceChildren(this.iframe)}buildUntrustedBanner(){const e=document.createElement("div");return e.className="rf-sandbox__untrusted-banner",e.setAttribute("role","note"),e.setAttribute("aria-label","Sandboxed user content"),e.textContent="Sandboxed user content — do not enter sensitive information.",e}setTheme(e){this._localScheme||this.buildIframe(e)}buildSrcdoc(e,t,r,i,s){const o=this.buildDependencyTags(t,r,i);s=s||gi.theme;const a=s==="dark"?' class="dark" data-theme="dark" style="color-scheme:dark"':s==="light"?' data-theme="light" style="color-scheme:light"':"",l=s==="dark"?' class="dark"':"",c=s==="dark"||s==="light"?` data-theme="${s}"`:"",u=e.replace(/\s*data-source(?:="[^"]*")?/g,""),f=this.buildCspMetaTag();return`<!DOCTYPE html>
|
|
339
339
|
<html${a}>
|
|
340
340
|
<head>${f?`
|
|
341
341
|
${f}`:""}
|
|
@@ -415,7 +415,7 @@ ${r.join(`
|
|
|
415
415
|
${i.join(`
|
|
416
416
|
`)}
|
|
417
417
|
</style>`)}return t.join(`
|
|
418
|
-
`)}buildTailwindTokenConfig(e){const t={};if(e.fonts){t.fontFamily={};for(const r of e.fonts){const i=mw[r.role]||"sans-serif";t.fontFamily[r.role]=[`'${r.family}'`,i]}}if(e.colors){t.colors={};for(const r of e.colors){const i=r.name.toLowerCase().replace(/\s+/g,"-");t.colors[i]=r.value}}if(e.radii){t.borderRadius={};for(const r of e.radii){const i=r.name.toLowerCase().replace(/\s+/g,"-");t.borderRadius[i]=r.value}}return Object.keys(t).length===0?"":`<script>tailwind.config = { darkMode: "class", theme: { extend: ${JSON.stringify(t)} } }<\/script>`}}function
|
|
418
|
+
`)}buildTailwindTokenConfig(e){const t={};if(e.fonts){t.fontFamily={};for(const r of e.fonts){const i=mw[r.role]||"sans-serif";t.fontFamily[r.role]=[`'${r.family}'`,i]}}if(e.colors){t.colors={};for(const r of e.colors){const i=r.name.toLowerCase().replace(/\s+/g,"-");t.colors[i]=r.value}}if(e.radii){t.borderRadius={};for(const r of e.radii){const i=r.name.toLowerCase().replace(/\s+/g,"-");t.borderRadius[i]=r.value}}return Object.keys(t).length===0?"":`<script>tailwind.config = { darkMode: "class", theme: { extend: ${JSON.stringify(t)} } }<\/script>`}}function iX(n){const e=[],t=KF(n);t&&e.push(t);const r=JF(n);return r&&e.push(r),()=>e.forEach(i=>i?.())}const sX={accordion:cw,"accordion-item":cw,"tab-group":hw,"code-group":hw,reveal:qF,"data-table":DF,form:RF,preview:BF,gallery:ZF,juxtapose:VF,nav:iX,drawer:EF};function UC(n=document,e){const t=[];n.querySelectorAll("[data-rune]").forEach(o=>{const a=o.getAttribute("data-rune");if(yF(o)||o.closest('[data-guest-posture="presentational"]'))return;const l=sX[a];if(l){const c=l(o);c&&t.push(c)}});const r=SF(n);t.push(r);const i=jF(n);t.push(i);const s=zF(n);return t.push(s),()=>t.forEach(o=>o())}var oX=V('<span class="block-card__drag svelte-15i1bgj" title="Drag to reorder"><svg width="8" height="14" viewBox="0 0 8 14" fill="currentColor"><circle cx="2" cy="2" r="1.2"></circle><circle cx="6" cy="2" r="1.2"></circle><circle cx="2" cy="7" r="1.2"></circle><circle cx="6" cy="7" r="1.2"></circle><circle cx="2" cy="12" r="1.2"></circle><circle cx="6" cy="12" r="1.2"></circle></svg></span>'),aX=V('<div class="block-card__inline-preview svelte-15i1bgj"></div>'),lX=V('<div class="block-card svelte-15i1bgj"><!> <!></div>');function cX(n,e){vt(e,!0);let t=Pt(e,"highlightCss",3,""),r=Pt(e,"highlightTransform",3,null),i=Pt(e,"communityTags",3,null),s=Pt(e,"communityPostTransforms",3,null),o=Pt(e,"communityStyles",3,null),a=Pt(e,"aggregated",19,()=>({})),l=Pt(e,"dragHandle",3,!0),c=Pt(e,"readOnly",3,!1),u=K(void 0),f=null,d,h=null;function m(S){return S.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function p(S){const A=new Map;for(const[x,k]of Object.entries(S.runes))A.set(m(x),k);return A}function O(S,A,x){let k=S,E=null,T=null;for(;k&&k!==A;)k.hasAttribute("data-name")&&!E&&(E=k),k.hasAttribute("data-rune")&&!T&&(T=k),k=k.parentElement;if(E){const $=E.getAttribute("data-name");let L=E.parentElement,P;for(;L&&L!==A;){const R=L.getAttribute("data-rune");if(R){P=x.get(R);break}L=L.parentElement}const q=P?.editHints?.[$];if(q&&q!=="none")return{type:"section",el:E,dataName:$,editType:q}}return T?{type:"rune",el:T}:null}function v(S,A){let x=null,k=null;const E=75,T=document.createElement("div");T.className="rf-edit-tooltip",S.appendChild(T);function $(P,q){T.textContent=P,T.style.left=`${q.clientX+12}px`,T.style.top=`${q.clientY+12}px`,T.classList.add("rf-tooltip-visible")}function L(){T.classList.remove("rf-tooltip-visible")}S.addEventListener("mouseover",P=>{const q=O(P.target,S,A),R=q?.el??null;if(k!==null&&(clearTimeout(k),k=null),R!==x)if(R&&x&&x.contains(R))x.classList.remove("rf-editable-hover"),x=R,x.classList.add("rf-editable-hover");else if(x&&R&&R.contains(x)){const W=x;k=setTimeout(()=>{x===W&&(W.classList.remove("rf-editable-hover"),x=R,x.classList.add("rf-editable-hover")),k=null},E);return}else x?.classList.remove("rf-editable-hover"),x=R,x?.classList.add("rf-editable-hover");if(q){const W=q.type==="section"?q.dataName:q.el.getAttribute("data-rune")??"";$(W,P)}else L()}),S.addEventListener("mousemove",P=>{T.classList.contains("rf-tooltip-visible")&&(T.style.left=`${P.clientX+12}px`,T.style.top=`${P.clientY+12}px`)}),S.addEventListener("mouseout",P=>{const q=P.relatedTarget;if(x&&(!q||!x.contains(q))){k!==null&&clearTimeout(k);const R=x;k=setTimeout(()=>{R.classList.remove("rf-editable-hover"),x===R&&(x=null),k=null},E),L()}}),S.addEventListener("click",P=>{L();const q=O(P.target,S,A);if(q)if(P.preventDefault(),P.stopPropagation(),q.type==="section"){const{el:R,dataName:W,editType:U}=q,ie=R.getBoundingClientRect(),ce=U==="link"?R.querySelector("a"):null,re=U==="image"?R.querySelector("img"):null,H=U==="code"?R.querySelector("code"):null,ae=U==="icon"?R.hasAttribute("data-icon")?R:R.querySelector("[data-icon]"):null;e.onsectionclick?.({dataName:W,text:(H??R).textContent?.trim()??"",rect:ie,editType:U,href:ce?.getAttribute("href")??re?.getAttribute("src")??void 0,iconName:ae?.getAttribute("data-icon")??void 0})}else{const R=P,W=Array.from(S.querySelectorAll("[data-rune]"));let U;W.length>1&&q.el!==W[0]&&(U=W.indexOf(q.el)-1),e.onruneclick?.({x:R.clientX,y:R.clientY,nestedRuneIndex:U})}})}bn(()=>{if(!g(u)||!e.themeConfig)return;f||(f=g(u).attachShadow({mode:"open"}));const S=e.block.source,A=e.themeConfig,x=e.themeCss,k=t()||"",E=r();return clearTimeout(d),d=setTimeout(()=>{if(f){h&&(h(),h=null);try{const{html:T,isComponent:$}=VC(S,A,E,i()??void 0,s()??void 0,a(),o()??void 0);if($)f.innerHTML=`<style>
|
|
419
419
|
:host { display: block; padding: 0.75rem 1.5rem; }
|
|
420
420
|
.placeholder { display: flex; align-items: center; gap: 0.5rem; color: #888; font-family: system-ui, sans-serif; font-size: 13px; }
|
|
421
421
|
.placeholder svg { opacity: 0.5; }
|
|
@@ -503,7 +503,7 @@ ${k}
|
|
|
503
503
|
opacity: 1;
|
|
504
504
|
}
|
|
505
505
|
</style>
|
|
506
|
-
<div class="rf-preview-wrapper">${T}</div>`;const P=f.querySelector(".rf-preview-wrapper");P&&(h=UC(P),P.addEventListener("click",q=>{q.target.closest("a")&&q.preventDefault()},!0),!c()&&(e.onsectionclick||e.onruneclick)&&e.block.type==="rune"&&v(P,p(A)))}}catch{f&&(f.innerHTML="<style>:host { display: block; padding: 0.75rem 1.5rem; color: #999; font-family: system-ui; font-size: 12px; }</style><em>Preview unavailable</em>")}}},50),()=>{clearTimeout(d),h&&(h(),h=null)}});var b=
|
|
506
|
+
<div class="rf-preview-wrapper">${T}</div>`;const P=f.querySelector(".rf-preview-wrapper");P&&(h=UC(P),P.addEventListener("click",q=>{q.target.closest("a")&&q.preventDefault()},!0),!c()&&(e.onsectionclick||e.onruneclick)&&e.block.type==="rune"&&v(P,p(A)))}}catch{f&&(f.innerHTML="<style>:host { display: block; padding: 0.75rem 1.5rem; color: #999; font-family: system-ui; font-size: 12px; }</style><em>Preview unavailable</em>")}}},50),()=>{clearTimeout(d),h&&(h(),h=null)}});var b=lX(),_=D(b);{var C=S=>{var A=oX();Z(S,A)};ue(_,S=>{l()&&S(C)})}var w=I(_,2);{var y=S=>{var A=aX();mn(A,x=>M(u,x),()=>g(u)),Z(S,A)};ue(w,S=>{e.themeConfig&&S(y)})}fe(()=>Et(b,"draggable",l()?"true":"false")),ft("dragstart",b,function(...S){e.ondragstart?.apply(this,S)}),ft("dragover",b,function(...S){e.ondragover?.apply(this,S)}),ft("drop",b,function(...S){e.ondrop?.apply(this,S)}),Z(n,b),bt()}var uX=V('<span class="prose-card__drag svelte-1oewfd6" title="Drag to reorder"><svg width="8" height="14" viewBox="0 0 8 14" fill="currentColor"><circle cx="2" cy="2" r="1.2"></circle><circle cx="6" cy="2" r="1.2"></circle><circle cx="2" cy="7" r="1.2"></circle><circle cx="6" cy="7" r="1.2"></circle><circle cx="2" cy="12" r="1.2"></circle><circle cx="6" cy="12" r="1.2"></circle></svg></span>'),fX=V('<div class="prose-card__preview svelte-1oewfd6"></div>'),dX=V('<div class="prose-card svelte-1oewfd6"><!> <!></div>');function hX(n,e){vt(e,!0);let t=Pt(e,"highlightCss",3,""),r=Pt(e,"highlightTransform",3,null),i=Pt(e,"communityTags",3,null),s=Pt(e,"communityPostTransforms",3,null),o=Pt(e,"communityStyles",3,null),a=Pt(e,"aggregated",19,()=>({})),l=Pt(e,"dragHandle",3,!0),c=Pt(e,"readOnly",3,!1),u=K(void 0),f=null,d,h=null;const m=new Set(["H1","H2","H3","H4","H5","H6","P","PRE","UL","OL","BLOCKQUOTE","HR","TABLE"]);function p(x){return x.startsWith("H")&&x.length===2?`h${x[1]}`:{P:"paragraph",PRE:"code",UL:"list",OL:"list",BLOCKQUOTE:"quote",HR:"divider",TABLE:"table"}[x]??x.toLowerCase()}function O(x,k){let E=x;for(;E&&E!==k;){if(m.has(E.tagName))return E;E=E.parentElement}return null}function v(x){const k=(x.textContent??"").trim(),E=x.tagName;for(let T=0;T<e.block.children.length;T++){const $=e.block.children[T];if(E.startsWith("H")&&E.length===2&&$.type==="heading"){const L=yi($.text??"").trim();if(k===L)return T}else if(E==="P"&&$.type==="paragraph"){const L=yi($.source).trim();if(k===L)return T}else if(E==="PRE"&&$.type==="fence"){const P=(x.querySelector("code")??x).textContent?.trim()??"",q=($.code??"").trim();if(P===q)return T}else if((E==="UL"||E==="OL")&&$.type==="list"){const L=$.source.replace(/^[-*+\d.]+\s*/gm,"").trim();if(k.includes(L.slice(0,30))||L.includes(k.slice(0,30)))return T}else if(E==="BLOCKQUOTE"&&$.type==="quote"){const L=$.source.replace(/^>\s*/gm,"").trim();if(k===L)return T}else if(E==="HR"&&$.type==="hr")return T}return-1}function b(x){let k=null,E=null;const T=75,$=document.createElement("div");$.className="rf-edit-tooltip",x.appendChild($);function L(q,R){$.textContent=q,$.style.left=`${R.clientX+12}px`,$.style.top=`${R.clientY+12}px`,$.classList.add("rf-tooltip-visible")}function P(){$.classList.remove("rf-tooltip-visible")}x.addEventListener("mouseover",q=>{const R=O(q.target,x);E!==null&&(clearTimeout(E),E=null),R===k||(k?.classList.remove("rf-editable-hover"),k=R,k?.classList.add("rf-editable-hover")),R?(x.classList.remove("rf-block-hover"),L(p(R.tagName),q)):e.onblockclick?(x.classList.add("rf-block-hover"),L("prose",q)):P()}),x.addEventListener("mousemove",q=>{$.classList.contains("rf-tooltip-visible")&&($.style.left=`${q.clientX+12}px`,$.style.top=`${q.clientY+12}px`)}),x.addEventListener("mouseout",q=>{const R=q.relatedTarget;if(x.classList.remove("rf-block-hover"),k&&(!R||!k.contains(R))){E!==null&&clearTimeout(E);const W=k;E=setTimeout(()=>{W.classList.remove("rf-editable-hover"),k===W&&(k=null),E=null},T),P()}}),x.addEventListener("click",q=>{P();const R=O(q.target,x);if(!R){e.onblockclick?.({x:q.clientX,y:q.clientY});return}q.preventDefault(),q.stopPropagation();const W=v(R);if(W===-1)return;const U=e.block.children[W],ie=R.getBoundingClientRect();R.tagName;const ce={elementType:U.type,text:(R.textContent??"").trim(),rect:ie,childIndex:W};U.type==="heading"?ce.headingLevel=U.level:U.type==="fence"&&(ce.fenceLanguage=U.language??"",ce.fenceCode=U.code??""),e.onsectionclick?.(ce)})}const _=`
|
|
507
507
|
/* Wrapper: inset border on dead-space hover */
|
|
508
508
|
.rf-preview-wrapper {
|
|
509
509
|
transition: box-shadow 150ms ease;
|
|
@@ -570,9 +570,9 @@ ${T}
|
|
|
570
570
|
.rf-preview-wrapper > article > * { grid-column: content; }
|
|
571
571
|
${!c()&&e.onsectionclick?_:""}
|
|
572
572
|
</style>
|
|
573
|
-
<div class="rf-preview-wrapper">${L}</div>`;const q=f.querySelector(".rf-preview-wrapper");q&&(h=UC(q),q.addEventListener("click",R=>{R.target.closest("a")&&R.preventDefault()},!0),!c()&&e.onsectionclick&&b(q))}catch{f&&(f.innerHTML="<style>:host { display: block; padding: 0.75rem 1.5rem; color: #999; font-family: system-ui; font-size: 12px; }</style><em>Preview unavailable</em>")}}},50),()=>{clearTimeout(d),h&&(h(),h=null)}});var C=fX(),w=D(C);{var y=x=>{var k=cX();Z(x,k)};ue(w,x=>{l()&&x(y)})}var S=I(w,2);{var A=x=>{var k=uX();mn(k,E=>M(u,E),()=>g(u)),Z(x,k)};ue(S,x=>{e.themeConfig&&x(A)})}fe(()=>Et(C,"draggable",l()?"true":"false")),ft("dragstart",C,function(...x){e.ondragstart?.apply(this,x)}),ft("dragover",C,function(...x){e.ondragover?.apply(this,x)}),ft("drop",C,function(...x){e.ondrop?.apply(this,x)}),Z(n,C),bt()}function Ig(n,e){if(e==="any")return!0;if(e.includes("|"))return e.split("|").some(t=>Ig(n,t));if(e.startsWith("heading:")){const t=parseInt(e.slice(8),10);return n.type==="heading"&&n.headingLevel===t}if(e==="list:ordered")return n.type==="list"&&n.listOrdered===!0;if(e==="list:unordered")return n.type==="list"&&n.listOrdered!==!0;if(e.startsWith("tag:")){const t=e.slice(4);return n.type==="rune"&&n.runeName===t}return e==="blockquote"?n.type==="quote":n.type===e}function Lp(n,e){const t=[];let r=0;for(const i of e){const s={name:i.name,match:i.match,optional:i.optional??!1,greedy:i.greedy??!1,filled:!1,nodes:[],description:i.description,template:i.template,emitTag:i.emitTag};if(i.greedy){for(;r<n.length&&Ig(n[r],i.match);)s.nodes.push(n[r]),r++;s.filled=s.nodes.length>0}else r<n.length&&Ig(n[r],i.match)&&(s.nodes.push(n[r]),s.filled=!0,r++);t.push(s)}return t}function hX(n,e){switch(e.type){case"sequence":return{type:"sequence",fields:Lp(n,e.fields)};case"delimited":{const t=[],r=[[]];for(const i of n)i.type==="hr"?r.push([]):r[r.length-1].push(i);if(e.zones)for(let i=0;i<e.zones.length;i++){const s=e.zones[i],o=r[i]??[];t.push({name:s.name,fields:Lp(o,s.fields)})}else if(e.dynamicZones&&e.zoneModel)for(let i=0;i<r.length;i++)t.push({name:`zone-${i+1}`,fields:Lp(r[i],e.zoneModel.fields)});return{type:"delimited",delimiter:e.delimiter,zones:t}}case"sections":return{type:"sections",description:`Sections split by ${e.sectionHeading}${e.emitTag?`, each emits ${e.emitTag}`:""}`};case"custom":return{type:"custom",description:e.description}}}var pX=V('<span class="rune-attrs__required svelte-ong743">*</span>'),mX=V('<span class="rune-attrs__info svelte-ong743"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="7"></circle><line x1="8" y1="7" x2="8" y2="11"></line><circle cx="8" cy="4.5" r="0.5" fill="currentColor" stroke="none"></circle></svg></span>'),gX=V('<button type="button"> </button>'),OX=ks('<svg class="rune-attrs__check svelte-ong743" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8l3.5 3.5L13 5"></path></svg>'),vX=ks('<svg class="rune-attrs__check svelte-ong743" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8l3.5 3.5L13 5"></path></svg>'),bX=V('<button type="button"><span class="rune-attrs__option-label svelte-ong743"> </span> <!></button>'),yX=V('<div class="rune-attrs__dropdown svelte-ong743"><button type="button"><span class="rune-attrs__option-label rune-attrs__option-label--default svelte-ong743">default</span> <!></button> <!></div>'),wX=V('<div class="rune-attrs__enum svelte-ong743"><button type="button"> </button> <!></div>'),_X=V('<input class="rune-attrs__inline-input svelte-ong743"/>'),kX=V('<button type="button"> </button>'),xX=V('<div class="rune-attrs__row svelte-ong743"><span class="rune-attrs__label svelte-ong743"> <!> <!></span> <!></div>'),SX=V('<span class="rune-attrs__empty svelte-ong743">No attributes</span>'),AX=V('<div class="rune-attrs svelte-ong743"><!> <!></div>');function gw(n,e){vt(e,!0);const t=new Set(["ratio","align","gap","collapse"]);function r(y,S){const A={...e.attributes};S===""||S===void 0?delete A[y]:A[y]=S,e.onchange(A)}function i(y){return y.replace(/-/g," ").replace(/\b\w/g,S=>S.toUpperCase())}function s(y){if(!t.has(y)||!("layout"in e.runeInfo.attributes))return!1;const S=e.attributes.layout??"";return S!=="split"&&S!=="split-reverse"}let o=ge(()=>Object.entries(e.runeInfo.attributes).filter(([y])=>!s(y)).sort(([,y],[,S])=>y.required===S.required?0:y.required?-1:1)),a=K(null),l;function c(y){M(a,g(a)===y?null:y,!0)}function u(y,S){r(y,S),M(a,null)}function f(y){g(a)&&l&&!l.contains(y.target)&&M(a,null)}function d(y){y.key==="Escape"&&g(a)&&(M(a,null),y.stopPropagation())}let h=K(null),m=K("");function p(y,S){M(h,y,!0),M(m,S,!0)}function O(y){r(y,g(m)),M(h,null)}function v(y,S){y.key==="Enter"?O(S):y.key==="Escape"&&(M(h,null),y.stopPropagation())}var b=AX();ft("mousedown",Ro,f),ft("keydown",Ro,d);var _=D(b);Qt(_,17,()=>g(o),([y,S])=>y,(y,S)=>{var A=ge(()=>Dc(g(S),2));let x=()=>g(A)[0],k=()=>g(A)[1];const E=ge(()=>e.attributes[x()]??"");var T=xX(),$=D(T),L=D($),P=I(L);{var q=ae=>{var oe=pX();Z(ae,oe)};ue(P,ae=>{k().required&&ae(q)})}var R=I(P,2);{var W=ae=>{var oe=mX();fe(()=>Et(oe,"data-tooltip",k().description)),Z(ae,oe)};ue(R,ae=>{k().description&&ae(W)})}var U=I($,2);{var ie=ae=>{var oe=gX();let z;oe.__click=()=>r(x(),g(E)==="true"?"":"true");var ne=D(oe);fe(()=>{z=Xe(oe,1,"rune-attrs__value svelte-ong743",null,z,{active:g(E)==="true"}),$e(ne,g(E)==="true"?"Yes":"No")}),Z(ae,oe)},ce=ae=>{var oe=wX(),z=D(oe);let ne;z.__click=()=>c(x());var Se=D(z),Te=I(z,2);{var Le=he=>{var Ee=yX(),Ye=D(Ee);let rt;Ye.__click=()=>u(x(),"");var Ue=I(D(Ye),2);{var Ke=xt=>{var Vt=OX();Z(xt,Vt)};ue(Ue,xt=>{g(E)||xt(Ke)})}var Me=I(Ye,2);Qt(Me,17,()=>k().values,nn,(xt,Vt)=>{var En=bX();let St;En.__click=()=>u(x(),g(Vt));var on=D(En),Cn=D(on),Wt=I(on,2);{var ke=Tn=>{var Lt=vX();Z(Tn,Lt)};ue(Wt,Tn=>{g(E)===g(Vt)&&Tn(ke)})}fe(()=>{St=Xe(En,1,"rune-attrs__option svelte-ong743",null,St,{selected:g(E)===g(Vt)}),$e(Cn,g(Vt))}),Z(xt,En)}),fe(()=>rt=Xe(Ye,1,"rune-attrs__option svelte-ong743",null,rt,{selected:!g(E)})),Z(he,Ee)};ue(Te,he=>{g(a)===x()&&he(Le)})}fe(()=>{ne=Xe(z,1,"rune-attrs__value svelte-ong743",null,ne,{active:!!g(E),open:g(a)===x()}),$e(Se,g(E)||"default")}),Z(ae,oe)},re=ae=>{var oe=_X();oe.__keydown=z=>v(z,x()),Os(oe),fe(()=>Et(oe,"type",k().type==="Number"?"number":"text")),ft("blur",oe,()=>O(x())),Rn(oe,()=>g(m),z=>M(m,z)),Z(ae,oe)},H=ae=>{var oe=kX();let z;oe.__click=()=>p(x(),g(E));var ne=D(oe);fe(()=>{z=Xe(oe,1,"rune-attrs__value svelte-ong743",null,z,{active:!!g(E)}),$e(ne,g(E)||(k().required?"required":"default"))}),Z(ae,oe)};ue(U,ae=>{k().type==="Boolean"?ae(ie):k().values&&k().values.length>0?ae(ce,1):g(h)===x()?ae(re,2):ae(H,!1)})}fe(ae=>$e(L,`${ae??""} `),[()=>i(x())]),Z(y,T)});var C=I(_,2);{var w=y=>{var S=SX();Z(y,S)};ue(C,y=>{g(o).length===0&&y(w)})}mn(b,y=>l=y,()=>l),Z(n,b),bt()}Kt(["click","keydown"]);var CX=V('<div class="tree-node svelte-16z33d"><button type="button"><span class="tree-node__indicator svelte-16z33d">▾</span> <span class="tree-node__rune-dot svelte-16z33d"></span> <span class="tree-node__label tree-node__label--rune svelte-16z33d"> </span></button></div>'),TX=V('<button type="button"><span class="tree-node__indicator svelte-16z33d"> </span> <span class="tree-node__rune-dot svelte-16z33d"></span> <span class="tree-node__label tree-node__label--rune svelte-16z33d"> </span></button>'),PX=V('<button type="button"><svg class="tree-node__icon svelte-16z33d" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="tree-node__label tree-node__label--content svelte-16z33d"> </span></button>'),EX=V('<div class="tree-node svelte-16z33d"><!></div> <!>',1),$X=V("<!> <!>",1);function GC(n,e){vt(e,!0);let t=Pt(e,"isRootActive",3,!1),r=Pt(e,"depth",3,0),i=Pt(e,"pathPrefix",19,()=>[]);function s(d){return d.length!==e.activePath.length?!1:d.every((h,m)=>h===e.activePath[m])}function o(d){return d.length>e.activePath.length?!1:d.every((h,m)=>h===e.activePath[m])}const a={heading:"M3 3v10M13 3v10M3 8h10",paragraph:"M2 4h12M2 8h12M2 12h8",fence:"M5 4L2 8l3 4M11 4l3 4-3 4",list:"M4 4h10M4 8h10M4 12h10M2 4h0M2 8h0M2 12h0",quote:"M4 4h8M4 7h6M1 3v8",hr:"M2 8h12",image:"M2 2h12v12H2zM5 5l-3 7h12l-4-5-2 2.5"};var l=$X(),c=at(l);{var u=d=>{var h=CX(),m=D(h);let p;m.__click=function(...b){e.onrootclick?.apply(this,b)};var O=I(D(m),4),v=D(O);fe(()=>{p=Xe(m,1,"tree-node__btn tree-node__btn--rune svelte-16z33d",null,p,{active:t()}),$e(v,e.rootLabel)}),Z(d,h)};ue(c,d=>{e.rootLabel&&e.onrootclick&&d(u)})}var f=I(c,2);Qt(f,17,()=>e.nodes,nn,(d,h,m)=>{const p=ge(()=>[...i(),m]),O=ge(()=>g(h).type==="rune"),v=ge(()=>s(g(p))),b=ge(()=>o(g(p))&&!g(v)),_=ge(()=>g(O)&&!g(h).selfClosing&&g(h).children&&g(h).children.length>0);var C=EX(),w=at(C),y=D(w);{var S=E=>{var T=TX();let $;T.__click=()=>e.onselect(g(p));var L=D(T),P=D(L),q=I(L,4),R=D(q);fe(()=>{$=Xe(T,1,"tree-node__btn tree-node__btn--rune svelte-16z33d",null,$,{active:g(v),ancestor:g(b)}),$e(P,g(_)?"▾":"▸"),$e(R,g(h).label)}),Z(E,T)},A=E=>{var T=PX();let $;T.__click=()=>e.onselect(g(p));var L=D(T),P=D(L),q=I(L,2),R=D(q);fe(()=>{$=Xe(T,1,"tree-node__btn tree-node__btn--content svelte-16z33d",null,$,{active:g(v)}),Et(P,"d",a[g(h).type]??"M2 4h12M2 8h12M2 12h8"),$e(R,g(h).label)}),Z(E,T)};ue(y,E=>{g(O)?E(S):E(A,!1)})}var x=I(w,2);{var k=E=>{var T=pn(),$=at(T);{let L=ge(()=>r()+1);GC($,{get nodes(){return g(h).children},get activePath(){return e.activePath},get onselect(){return e.onselect},get depth(){return g(L)},get pathPrefix(){return g(p)}})}Z(E,T)};ue(x,E=>{g(_)&&g(h).children&&E(k)})}fe(()=>Tr(w,`padding-left: ${(r()+(e.rootLabel?1:0))*16}px`)),Z(d,C)}),Z(n,l),bt()}Kt(["click"]);var QX=V('<button type="button" class="cm-tree__preview-line cm-tree__preview-line--rune svelte-1d9gzqq"><span class="cm-tree__rune-dot svelte-1d9gzqq"></span> </button>'),LX=V('<button type="button" class="cm-tree__preview-line cm-tree__preview-line--clickable svelte-1d9gzqq"> </button>'),MX=V('<div draggable="true"><span class="cm-tree__preview-grip svelte-1d9gzqq" title="Drag to reorder"><svg width="6" height="10" viewBox="0 0 6 10" fill="none"><circle cx="1.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="8.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="8.5" r="1" fill="currentColor"></circle></svg></span> <button type="button" class="cm-tree__preview-text cm-tree__preview-text--clickable svelte-1d9gzqq"> </button> <button type="button" class="cm-tree__preview-remove svelte-1d9gzqq" title="Remove item"><svg width="10" height="10" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"></line><line x1="12" y1="4" x2="4" y2="12"></line></svg></button></div>'),qX=V('<div draggable="true"><span class="cm-tree__preview-grip svelte-1d9gzqq" title="Drag to reorder"><svg width="6" height="10" viewBox="0 0 6 10" fill="none"><circle cx="1.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="8.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="8.5" r="1" fill="currentColor"></circle></svg></span> <button type="button" class="cm-tree__preview-text cm-tree__preview-text--clickable svelte-1d9gzqq"> </button> <button type="button" class="cm-tree__preview-remove svelte-1d9gzqq" title="Remove item"><svg width="10" height="10" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"></line><line x1="12" y1="4" x2="4" y2="12"></line></svg></button></div>'),DX=V('<span class="cm-tree__required-badge svelte-1d9gzqq">required</span>'),RX=V('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),IX=V('<!> <button type="button" class="cm-tree__action cm-tree__action--remove svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 3 14 13 14 13 6"></polyline><line x1="1" y1="4" x2="15" y2="4"></line><line x1="6" y1="8" x2="6" y2="12"></line><line x1="10" y1="8" x2="10" y2="12"></line></svg></button>',1),NX=V('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),BX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),jX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),zX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),ZX=V('<button type="button"><svg class="cm-tree__field-icon svelte-1d9gzqq" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="cm-tree__field-name svelte-1d9gzqq"> </span> <!> <span class="cm-tree__field-spacer svelte-1d9gzqq"></span> <!></button> <!>',1),FX=V('<div class="cm-tree__fields svelte-1d9gzqq"></div>'),XX=V('<div class="cm-tree__delimiter svelte-1d9gzqq"><span class="cm-tree__delimiter-line svelte-1d9gzqq"></span></div>'),VX=V('<span class="cm-tree__required-badge svelte-1d9gzqq">required</span>'),WX=V('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),YX=V('<!> <button type="button" class="cm-tree__action cm-tree__action--remove svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 3 14 13 14 13 6"></polyline><line x1="1" y1="4" x2="15" y2="4"></line><line x1="6" y1="8" x2="6" y2="12"></line><line x1="10" y1="8" x2="10" y2="12"></line></svg></button>',1),UX=V('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),GX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),HX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),KX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),JX=V('<button type="button"><svg class="cm-tree__field-icon svelte-1d9gzqq" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="cm-tree__field-name svelte-1d9gzqq"> </span> <!> <span class="cm-tree__field-spacer svelte-1d9gzqq"></span> <!></button> <!>',1),eV=V('<!> <div class="cm-tree__zone svelte-1d9gzqq"><div class="cm-tree__zone-label svelte-1d9gzqq"> </div> <div class="cm-tree__fields svelte-1d9gzqq"></div></div>',1),tV=V('<div class="cm-tree__description svelte-1d9gzqq"> </div>'),nV=V('<div class="cm-tree svelte-1d9gzqq"><div class="cm-tree__root svelte-1d9gzqq"><span class="cm-tree__rune-dot svelte-1d9gzqq"></span> <span class="cm-tree__root-label svelte-1d9gzqq"> </span></div> <!></div>');function rV(n,e){vt(e,!0);const t=(T,$=Ji,L=Ji,P=Ji)=>{var q=pn(),R=at(q);Qt(R,17,$,nn,(W,U)=>{var ie=pn(),ce=at(ie);{var re=ae=>{var oe=QX();oe.__click=()=>e.onnavigaterune(L(),g(U).nodeIndex,P());var z=I(D(oe));fe(()=>$e(z,` ${g(U).text??""}`)),Z(ae,oe)},H=ae=>{var oe=LX();oe.__click=ne=>e.oneditfield(L(),ne.currentTarget.getBoundingClientRect(),P(),g(U).nodeIndex);var z=D(oe);fe(()=>$e(z,g(U).text)),Z(ae,oe)};ue(ce,ae=>{g(U).type==="rune"&&g(U).nodeIndex!==void 0?ae(re):ae(H,!1)})}Z(W,ie)}),Z(T,q)},r=(T,$=Ji,L=Ji,P=Ji)=>{var q=pn(),R=at(q);Qt(R,17,$,nn,(W,U)=>{var ie=MX();let ce;var re=I(D(ie),2);re.__click=oe=>{oe.stopPropagation(),e.oneditlistitem(L(),g(U).index,oe.currentTarget.getBoundingClientRect(),P())};var H=D(re),ae=I(re,2);ae.__click=()=>e.onremovelistitem(L(),g(U).index,P()),fe(()=>{ce=Xe(ie,1,"cm-tree__preview-item svelte-1d9gzqq",null,ce,{"cm-tree__preview-item--drag-over":g(o)===L()&&g(a)===P()&&g(c)===g(U).index&&g(l)!==g(U).index,"cm-tree__preview-item--dragging":g(o)===L()&&g(a)===P()&&g(l)===g(U).index}),$e(H,g(U).text)}),ft("dragstart",ie,oe=>u(oe,L(),g(U).index,P())),ft("dragover",ie,oe=>f(oe,g(U).index)),ft("drop",ie,oe=>d(oe,g(U).index)),ft("dragend",ie,h),Z(W,ie)}),Z(T,q)},i=(T,$=Ji,L=Ji,P=Ji)=>{var q=pn(),R=at(q);Qt(R,17,$,nn,(W,U)=>{var ie=qX();let ce;var re=I(D(ie),2);re.__click=oe=>{oe.stopPropagation(),e.oneditfield(L(),oe.currentTarget.getBoundingClientRect(),P(),g(U).index)};var H=D(re),ae=I(re,2);ae.__click=()=>e.onremovelistitem(L(),g(U).index,P()),fe(()=>{ce=Xe(ie,1,"cm-tree__preview-item svelte-1d9gzqq",null,ce,{"cm-tree__preview-item--drag-over":g(o)===L()&&g(a)===P()&&g(c)===g(U).index&&g(l)!==g(U).index,"cm-tree__preview-item--dragging":g(o)===L()&&g(a)===P()&&g(l)===g(U).index}),$e(H,g(U).text)}),ft("dragstart",ie,oe=>u(oe,L(),g(U).index,P())),ft("dragover",ie,oe=>f(oe,g(U).index)),ft("drop",ie,oe=>d(oe,g(U).index)),ft("dragend",ie,h),Z(W,ie)}),Z(T,q)};let s=Pt(e,"selectedField",3,null),o=K(null),a=K(void 0),l=K(null),c=K(null);function u(T,$,L,P){M(o,$,!0),M(a,P,!0),M(l,L,!0),M(c,L,!0),T.dataTransfer&&(T.dataTransfer.effectAllowed="move",T.dataTransfer.setData("text/plain",String(L)))}function f(T,$){g(l)!==null&&(T.preventDefault(),T.dataTransfer&&(T.dataTransfer.dropEffect="move"),M(c,$,!0))}function d(T,$){T.preventDefault(),g(l)!==null&&g(l)!==$&&g(o)!==null&&e.onreorderlistitem(g(o),g(l),$,g(a)),M(o,null),M(a,void 0),M(l,null),M(c,null)}function h(){M(o,null),M(a,void 0),M(l,null),M(c,null)}function m(T){return T==="list"||T.startsWith("list:")}function p(T){return T.greedy&&T.filled&&T.match!=="any"}function O(T){return T.nodes.map(($,L)=>{let P;if($.type==="fence")P=$.fenceLanguage?`[${$.fenceLanguage}]`:"[code]";else if($.type==="heading"&&$.headingText)P=$.headingText;else if($.type==="rune"&&$.runeName)P=$.runeName;else if($.type==="image")P="[image]";else{const q=$.source.replace(/\n/g," ").trim();P=q.length>50?q.slice(0,47)+"...":q}return{text:P.length>50?P.slice(0,47)+"...":P,index:L}})}function v(T){switch(T.includes("|")?T.split("|")[0]:T){case"heading":case"heading:1":case"heading:2":case"heading:3":case"heading:4":case"heading:5":case"heading:6":return"M3 3v10M13 3v10M3 8h10";case"paragraph":return"M2 4h12M2 8h12M2 12h8";case"fence":return"M5 4L2 8l3 4M11 4l3 4-3 4";case"list":case"list:ordered":case"list:unordered":return"M4 4h10M4 8h10M4 12h10M2 4h0M2 8h0M2 12h0";case"blockquote":case"quote":return"M4 4h8M4 7h6M1 3v8";case"image":return"M2 2h12v12H2zM5 5l-3 7h12l-4-5-2 2.5";case"any":return"M2 8h12M8 2v12";default:return"M2 4h12M2 8h12M2 12h8"}}function b(T){const $=[];for(const L of T){if(L.type!=="list")continue;const P=Kd(L.source);for(let q=0;q<P.length;q++){const W=P[q].split(`
|
|
573
|
+
<div class="rf-preview-wrapper">${L}</div>`;const q=f.querySelector(".rf-preview-wrapper");q&&(h=UC(q),q.addEventListener("click",R=>{R.target.closest("a")&&R.preventDefault()},!0),!c()&&e.onsectionclick&&b(q))}catch{f&&(f.innerHTML="<style>:host { display: block; padding: 0.75rem 1.5rem; color: #999; font-family: system-ui; font-size: 12px; }</style><em>Preview unavailable</em>")}}},50),()=>{clearTimeout(d),h&&(h(),h=null)}});var C=dX(),w=D(C);{var y=x=>{var k=uX();Z(x,k)};ue(w,x=>{l()&&x(y)})}var S=I(w,2);{var A=x=>{var k=fX();mn(k,E=>M(u,E),()=>g(u)),Z(x,k)};ue(S,x=>{e.themeConfig&&x(A)})}fe(()=>Et(C,"draggable",l()?"true":"false")),ft("dragstart",C,function(...x){e.ondragstart?.apply(this,x)}),ft("dragover",C,function(...x){e.ondragover?.apply(this,x)}),ft("drop",C,function(...x){e.ondrop?.apply(this,x)}),Z(n,C),bt()}function Ig(n,e){if(e==="any")return!0;if(e.includes("|"))return e.split("|").some(t=>Ig(n,t));if(e.startsWith("heading:")){const t=parseInt(e.slice(8),10);return n.type==="heading"&&n.headingLevel===t}if(e==="list:ordered")return n.type==="list"&&n.listOrdered===!0;if(e==="list:unordered")return n.type==="list"&&n.listOrdered!==!0;if(e.startsWith("tag:")){const t=e.slice(4);return n.type==="rune"&&n.runeName===t}return e==="blockquote"?n.type==="quote":n.type===e}function Lp(n,e){const t=[];let r=0;for(const i of e){const s={name:i.name,match:i.match,optional:i.optional??!1,greedy:i.greedy??!1,filled:!1,nodes:[],description:i.description,template:i.template,emitTag:i.emitTag};if(i.greedy){for(;r<n.length&&Ig(n[r],i.match);)s.nodes.push(n[r]),r++;s.filled=s.nodes.length>0}else r<n.length&&Ig(n[r],i.match)&&(s.nodes.push(n[r]),s.filled=!0,r++);t.push(s)}return t}function pX(n,e){switch(e.type){case"sequence":return{type:"sequence",fields:Lp(n,e.fields)};case"delimited":{const t=[],r=[[]];for(const i of n)i.type==="hr"?r.push([]):r[r.length-1].push(i);if(e.zones)for(let i=0;i<e.zones.length;i++){const s=e.zones[i],o=r[i]??[];t.push({name:s.name,fields:Lp(o,s.fields)})}else if(e.dynamicZones&&e.zoneModel)for(let i=0;i<r.length;i++)t.push({name:`zone-${i+1}`,fields:Lp(r[i],e.zoneModel.fields)});return{type:"delimited",delimiter:e.delimiter,zones:t}}case"sections":return{type:"sections",description:`Sections split by ${e.sectionHeading}${e.emitTag?`, each emits ${e.emitTag}`:""}`};case"custom":return{type:"custom",description:e.description}}}var mX=V('<span class="rune-attrs__required svelte-ong743">*</span>'),gX=V('<span class="rune-attrs__info svelte-ong743"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="7"></circle><line x1="8" y1="7" x2="8" y2="11"></line><circle cx="8" cy="4.5" r="0.5" fill="currentColor" stroke="none"></circle></svg></span>'),OX=V('<button type="button"> </button>'),vX=ks('<svg class="rune-attrs__check svelte-ong743" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8l3.5 3.5L13 5"></path></svg>'),bX=ks('<svg class="rune-attrs__check svelte-ong743" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8l3.5 3.5L13 5"></path></svg>'),yX=V('<button type="button"><span class="rune-attrs__option-label svelte-ong743"> </span> <!></button>'),wX=V('<div class="rune-attrs__dropdown svelte-ong743"><button type="button"><span class="rune-attrs__option-label rune-attrs__option-label--default svelte-ong743">default</span> <!></button> <!></div>'),_X=V('<div class="rune-attrs__enum svelte-ong743"><button type="button"> </button> <!></div>'),kX=V('<input class="rune-attrs__inline-input svelte-ong743"/>'),xX=V('<button type="button"> </button>'),SX=V('<div class="rune-attrs__row svelte-ong743"><span class="rune-attrs__label svelte-ong743"> <!> <!></span> <!></div>'),AX=V('<span class="rune-attrs__empty svelte-ong743">No attributes</span>'),CX=V('<div class="rune-attrs svelte-ong743"><!> <!></div>');function gw(n,e){vt(e,!0);const t=new Set(["ratio","align","gap","collapse"]);function r(y,S){const A={...e.attributes};S===""||S===void 0?delete A[y]:A[y]=S,e.onchange(A)}function i(y){return y.replace(/-/g," ").replace(/\b\w/g,S=>S.toUpperCase())}function s(y){if(!t.has(y)||!("layout"in e.runeInfo.attributes))return!1;const S=e.attributes.layout??"";return S!=="split"&&S!=="split-reverse"}let o=ge(()=>Object.entries(e.runeInfo.attributes).filter(([y])=>!s(y)).sort(([,y],[,S])=>y.required===S.required?0:y.required?-1:1)),a=K(null),l;function c(y){M(a,g(a)===y?null:y,!0)}function u(y,S){r(y,S),M(a,null)}function f(y){g(a)&&l&&!l.contains(y.target)&&M(a,null)}function d(y){y.key==="Escape"&&g(a)&&(M(a,null),y.stopPropagation())}let h=K(null),m=K("");function p(y,S){M(h,y,!0),M(m,S,!0)}function O(y){r(y,g(m)),M(h,null)}function v(y,S){y.key==="Enter"?O(S):y.key==="Escape"&&(M(h,null),y.stopPropagation())}var b=CX();ft("mousedown",Ro,f),ft("keydown",Ro,d);var _=D(b);Qt(_,17,()=>g(o),([y,S])=>y,(y,S)=>{var A=ge(()=>Dc(g(S),2));let x=()=>g(A)[0],k=()=>g(A)[1];const E=ge(()=>e.attributes[x()]??"");var T=SX(),$=D(T),L=D($),P=I(L);{var q=ae=>{var oe=mX();Z(ae,oe)};ue(P,ae=>{k().required&&ae(q)})}var R=I(P,2);{var W=ae=>{var oe=gX();fe(()=>Et(oe,"data-tooltip",k().description)),Z(ae,oe)};ue(R,ae=>{k().description&&ae(W)})}var U=I($,2);{var ie=ae=>{var oe=OX();let z;oe.__click=()=>r(x(),g(E)==="true"?"":"true");var ne=D(oe);fe(()=>{z=Xe(oe,1,"rune-attrs__value svelte-ong743",null,z,{active:g(E)==="true"}),$e(ne,g(E)==="true"?"Yes":"No")}),Z(ae,oe)},ce=ae=>{var oe=_X(),z=D(oe);let ne;z.__click=()=>c(x());var Se=D(z),Te=I(z,2);{var Le=he=>{var Ee=wX(),Ye=D(Ee);let rt;Ye.__click=()=>u(x(),"");var Ue=I(D(Ye),2);{var Ke=xt=>{var Vt=vX();Z(xt,Vt)};ue(Ue,xt=>{g(E)||xt(Ke)})}var Me=I(Ye,2);Qt(Me,17,()=>k().values,nn,(xt,Vt)=>{var En=yX();let St;En.__click=()=>u(x(),g(Vt));var on=D(En),Cn=D(on),Wt=I(on,2);{var ke=Tn=>{var Lt=bX();Z(Tn,Lt)};ue(Wt,Tn=>{g(E)===g(Vt)&&Tn(ke)})}fe(()=>{St=Xe(En,1,"rune-attrs__option svelte-ong743",null,St,{selected:g(E)===g(Vt)}),$e(Cn,g(Vt))}),Z(xt,En)}),fe(()=>rt=Xe(Ye,1,"rune-attrs__option svelte-ong743",null,rt,{selected:!g(E)})),Z(he,Ee)};ue(Te,he=>{g(a)===x()&&he(Le)})}fe(()=>{ne=Xe(z,1,"rune-attrs__value svelte-ong743",null,ne,{active:!!g(E),open:g(a)===x()}),$e(Se,g(E)||"default")}),Z(ae,oe)},re=ae=>{var oe=kX();oe.__keydown=z=>v(z,x()),Os(oe),fe(()=>Et(oe,"type",k().type==="Number"?"number":"text")),ft("blur",oe,()=>O(x())),Rn(oe,()=>g(m),z=>M(m,z)),Z(ae,oe)},H=ae=>{var oe=xX();let z;oe.__click=()=>p(x(),g(E));var ne=D(oe);fe(()=>{z=Xe(oe,1,"rune-attrs__value svelte-ong743",null,z,{active:!!g(E)}),$e(ne,g(E)||(k().required?"required":"default"))}),Z(ae,oe)};ue(U,ae=>{k().type==="Boolean"?ae(ie):k().values&&k().values.length>0?ae(ce,1):g(h)===x()?ae(re,2):ae(H,!1)})}fe(ae=>$e(L,`${ae??""} `),[()=>i(x())]),Z(y,T)});var C=I(_,2);{var w=y=>{var S=AX();Z(y,S)};ue(C,y=>{g(o).length===0&&y(w)})}mn(b,y=>l=y,()=>l),Z(n,b),bt()}Kt(["click","keydown"]);var TX=V('<div class="tree-node svelte-16z33d"><button type="button"><span class="tree-node__indicator svelte-16z33d">▾</span> <span class="tree-node__rune-dot svelte-16z33d"></span> <span class="tree-node__label tree-node__label--rune svelte-16z33d"> </span></button></div>'),PX=V('<button type="button"><span class="tree-node__indicator svelte-16z33d"> </span> <span class="tree-node__rune-dot svelte-16z33d"></span> <span class="tree-node__label tree-node__label--rune svelte-16z33d"> </span></button>'),EX=V('<button type="button"><svg class="tree-node__icon svelte-16z33d" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="tree-node__label tree-node__label--content svelte-16z33d"> </span></button>'),$X=V('<div class="tree-node svelte-16z33d"><!></div> <!>',1),QX=V("<!> <!>",1);function GC(n,e){vt(e,!0);let t=Pt(e,"isRootActive",3,!1),r=Pt(e,"depth",3,0),i=Pt(e,"pathPrefix",19,()=>[]);function s(d){return d.length!==e.activePath.length?!1:d.every((h,m)=>h===e.activePath[m])}function o(d){return d.length>e.activePath.length?!1:d.every((h,m)=>h===e.activePath[m])}const a={heading:"M3 3v10M13 3v10M3 8h10",paragraph:"M2 4h12M2 8h12M2 12h8",fence:"M5 4L2 8l3 4M11 4l3 4-3 4",list:"M4 4h10M4 8h10M4 12h10M2 4h0M2 8h0M2 12h0",quote:"M4 4h8M4 7h6M1 3v8",hr:"M2 8h12",image:"M2 2h12v12H2zM5 5l-3 7h12l-4-5-2 2.5"};var l=QX(),c=at(l);{var u=d=>{var h=TX(),m=D(h);let p;m.__click=function(...b){e.onrootclick?.apply(this,b)};var O=I(D(m),4),v=D(O);fe(()=>{p=Xe(m,1,"tree-node__btn tree-node__btn--rune svelte-16z33d",null,p,{active:t()}),$e(v,e.rootLabel)}),Z(d,h)};ue(c,d=>{e.rootLabel&&e.onrootclick&&d(u)})}var f=I(c,2);Qt(f,17,()=>e.nodes,nn,(d,h,m)=>{const p=ge(()=>[...i(),m]),O=ge(()=>g(h).type==="rune"),v=ge(()=>s(g(p))),b=ge(()=>o(g(p))&&!g(v)),_=ge(()=>g(O)&&!g(h).selfClosing&&g(h).children&&g(h).children.length>0);var C=$X(),w=at(C),y=D(w);{var S=E=>{var T=PX();let $;T.__click=()=>e.onselect(g(p));var L=D(T),P=D(L),q=I(L,4),R=D(q);fe(()=>{$=Xe(T,1,"tree-node__btn tree-node__btn--rune svelte-16z33d",null,$,{active:g(v),ancestor:g(b)}),$e(P,g(_)?"▾":"▸"),$e(R,g(h).label)}),Z(E,T)},A=E=>{var T=EX();let $;T.__click=()=>e.onselect(g(p));var L=D(T),P=D(L),q=I(L,2),R=D(q);fe(()=>{$=Xe(T,1,"tree-node__btn tree-node__btn--content svelte-16z33d",null,$,{active:g(v)}),Et(P,"d",a[g(h).type]??"M2 4h12M2 8h12M2 12h8"),$e(R,g(h).label)}),Z(E,T)};ue(y,E=>{g(O)?E(S):E(A,!1)})}var x=I(w,2);{var k=E=>{var T=pn(),$=at(T);{let L=ge(()=>r()+1);GC($,{get nodes(){return g(h).children},get activePath(){return e.activePath},get onselect(){return e.onselect},get depth(){return g(L)},get pathPrefix(){return g(p)}})}Z(E,T)};ue(x,E=>{g(_)&&g(h).children&&E(k)})}fe(()=>Tr(w,`padding-left: ${(r()+(e.rootLabel?1:0))*16}px`)),Z(d,C)}),Z(n,l),bt()}Kt(["click"]);var LX=V('<button type="button" class="cm-tree__preview-line cm-tree__preview-line--rune svelte-1d9gzqq"><span class="cm-tree__rune-dot svelte-1d9gzqq"></span> </button>'),MX=V('<button type="button" class="cm-tree__preview-line cm-tree__preview-line--clickable svelte-1d9gzqq"> </button>'),qX=V('<div draggable="true"><span class="cm-tree__preview-grip svelte-1d9gzqq" title="Drag to reorder"><svg width="6" height="10" viewBox="0 0 6 10" fill="none"><circle cx="1.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="8.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="8.5" r="1" fill="currentColor"></circle></svg></span> <button type="button" class="cm-tree__preview-text cm-tree__preview-text--clickable svelte-1d9gzqq"> </button> <button type="button" class="cm-tree__preview-remove svelte-1d9gzqq" title="Remove item"><svg width="10" height="10" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"></line><line x1="12" y1="4" x2="4" y2="12"></line></svg></button></div>'),DX=V('<div draggable="true"><span class="cm-tree__preview-grip svelte-1d9gzqq" title="Drag to reorder"><svg width="6" height="10" viewBox="0 0 6 10" fill="none"><circle cx="1.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="8.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="8.5" r="1" fill="currentColor"></circle></svg></span> <button type="button" class="cm-tree__preview-text cm-tree__preview-text--clickable svelte-1d9gzqq"> </button> <button type="button" class="cm-tree__preview-remove svelte-1d9gzqq" title="Remove item"><svg width="10" height="10" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"></line><line x1="12" y1="4" x2="4" y2="12"></line></svg></button></div>'),RX=V('<span class="cm-tree__required-badge svelte-1d9gzqq">required</span>'),IX=V('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),NX=V('<!> <button type="button" class="cm-tree__action cm-tree__action--remove svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 3 14 13 14 13 6"></polyline><line x1="1" y1="4" x2="15" y2="4"></line><line x1="6" y1="8" x2="6" y2="12"></line><line x1="10" y1="8" x2="10" y2="12"></line></svg></button>',1),BX=V('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),jX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),zX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),ZX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),FX=V('<button type="button"><svg class="cm-tree__field-icon svelte-1d9gzqq" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="cm-tree__field-name svelte-1d9gzqq"> </span> <!> <span class="cm-tree__field-spacer svelte-1d9gzqq"></span> <!></button> <!>',1),XX=V('<div class="cm-tree__fields svelte-1d9gzqq"></div>'),VX=V('<div class="cm-tree__delimiter svelte-1d9gzqq"><span class="cm-tree__delimiter-line svelte-1d9gzqq"></span></div>'),WX=V('<span class="cm-tree__required-badge svelte-1d9gzqq">required</span>'),YX=V('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),UX=V('<!> <button type="button" class="cm-tree__action cm-tree__action--remove svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 3 14 13 14 13 6"></polyline><line x1="1" y1="4" x2="15" y2="4"></line><line x1="6" y1="8" x2="6" y2="12"></line><line x1="10" y1="8" x2="10" y2="12"></line></svg></button>',1),GX=V('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),HX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),KX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),JX=V('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),eV=V('<button type="button"><svg class="cm-tree__field-icon svelte-1d9gzqq" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="cm-tree__field-name svelte-1d9gzqq"> </span> <!> <span class="cm-tree__field-spacer svelte-1d9gzqq"></span> <!></button> <!>',1),tV=V('<!> <div class="cm-tree__zone svelte-1d9gzqq"><div class="cm-tree__zone-label svelte-1d9gzqq"> </div> <div class="cm-tree__fields svelte-1d9gzqq"></div></div>',1),nV=V('<div class="cm-tree__description svelte-1d9gzqq"> </div>'),rV=V('<div class="cm-tree svelte-1d9gzqq"><div class="cm-tree__root svelte-1d9gzqq"><span class="cm-tree__rune-dot svelte-1d9gzqq"></span> <span class="cm-tree__root-label svelte-1d9gzqq"> </span></div> <!></div>');function iV(n,e){vt(e,!0);const t=(T,$=Ji,L=Ji,P=Ji)=>{var q=pn(),R=at(q);Qt(R,17,$,nn,(W,U)=>{var ie=pn(),ce=at(ie);{var re=ae=>{var oe=LX();oe.__click=()=>e.onnavigaterune(L(),g(U).nodeIndex,P());var z=I(D(oe));fe(()=>$e(z,` ${g(U).text??""}`)),Z(ae,oe)},H=ae=>{var oe=MX();oe.__click=ne=>e.oneditfield(L(),ne.currentTarget.getBoundingClientRect(),P(),g(U).nodeIndex);var z=D(oe);fe(()=>$e(z,g(U).text)),Z(ae,oe)};ue(ce,ae=>{g(U).type==="rune"&&g(U).nodeIndex!==void 0?ae(re):ae(H,!1)})}Z(W,ie)}),Z(T,q)},r=(T,$=Ji,L=Ji,P=Ji)=>{var q=pn(),R=at(q);Qt(R,17,$,nn,(W,U)=>{var ie=qX();let ce;var re=I(D(ie),2);re.__click=oe=>{oe.stopPropagation(),e.oneditlistitem(L(),g(U).index,oe.currentTarget.getBoundingClientRect(),P())};var H=D(re),ae=I(re,2);ae.__click=()=>e.onremovelistitem(L(),g(U).index,P()),fe(()=>{ce=Xe(ie,1,"cm-tree__preview-item svelte-1d9gzqq",null,ce,{"cm-tree__preview-item--drag-over":g(o)===L()&&g(a)===P()&&g(c)===g(U).index&&g(l)!==g(U).index,"cm-tree__preview-item--dragging":g(o)===L()&&g(a)===P()&&g(l)===g(U).index}),$e(H,g(U).text)}),ft("dragstart",ie,oe=>u(oe,L(),g(U).index,P())),ft("dragover",ie,oe=>f(oe,g(U).index)),ft("drop",ie,oe=>d(oe,g(U).index)),ft("dragend",ie,h),Z(W,ie)}),Z(T,q)},i=(T,$=Ji,L=Ji,P=Ji)=>{var q=pn(),R=at(q);Qt(R,17,$,nn,(W,U)=>{var ie=DX();let ce;var re=I(D(ie),2);re.__click=oe=>{oe.stopPropagation(),e.oneditfield(L(),oe.currentTarget.getBoundingClientRect(),P(),g(U).index)};var H=D(re),ae=I(re,2);ae.__click=()=>e.onremovelistitem(L(),g(U).index,P()),fe(()=>{ce=Xe(ie,1,"cm-tree__preview-item svelte-1d9gzqq",null,ce,{"cm-tree__preview-item--drag-over":g(o)===L()&&g(a)===P()&&g(c)===g(U).index&&g(l)!==g(U).index,"cm-tree__preview-item--dragging":g(o)===L()&&g(a)===P()&&g(l)===g(U).index}),$e(H,g(U).text)}),ft("dragstart",ie,oe=>u(oe,L(),g(U).index,P())),ft("dragover",ie,oe=>f(oe,g(U).index)),ft("drop",ie,oe=>d(oe,g(U).index)),ft("dragend",ie,h),Z(W,ie)}),Z(T,q)};let s=Pt(e,"selectedField",3,null),o=K(null),a=K(void 0),l=K(null),c=K(null);function u(T,$,L,P){M(o,$,!0),M(a,P,!0),M(l,L,!0),M(c,L,!0),T.dataTransfer&&(T.dataTransfer.effectAllowed="move",T.dataTransfer.setData("text/plain",String(L)))}function f(T,$){g(l)!==null&&(T.preventDefault(),T.dataTransfer&&(T.dataTransfer.dropEffect="move"),M(c,$,!0))}function d(T,$){T.preventDefault(),g(l)!==null&&g(l)!==$&&g(o)!==null&&e.onreorderlistitem(g(o),g(l),$,g(a)),M(o,null),M(a,void 0),M(l,null),M(c,null)}function h(){M(o,null),M(a,void 0),M(l,null),M(c,null)}function m(T){return T==="list"||T.startsWith("list:")}function p(T){return T.greedy&&T.filled&&T.match!=="any"}function O(T){return T.nodes.map(($,L)=>{let P;if($.type==="fence")P=$.fenceLanguage?`[${$.fenceLanguage}]`:"[code]";else if($.type==="heading"&&$.headingText)P=$.headingText;else if($.type==="rune"&&$.runeName)P=$.runeName;else if($.type==="image")P="[image]";else{const q=$.source.replace(/\n/g," ").trim();P=q.length>50?q.slice(0,47)+"...":q}return{text:P.length>50?P.slice(0,47)+"...":P,index:L}})}function v(T){switch(T.includes("|")?T.split("|")[0]:T){case"heading":case"heading:1":case"heading:2":case"heading:3":case"heading:4":case"heading:5":case"heading:6":return"M3 3v10M13 3v10M3 8h10";case"paragraph":return"M2 4h12M2 8h12M2 12h8";case"fence":return"M5 4L2 8l3 4M11 4l3 4-3 4";case"list":case"list:ordered":case"list:unordered":return"M4 4h10M4 8h10M4 12h10M2 4h0M2 8h0M2 12h0";case"blockquote":case"quote":return"M4 4h8M4 7h6M1 3v8";case"image":return"M2 2h12v12H2zM5 5l-3 7h12l-4-5-2 2.5";case"any":return"M2 8h12M8 2v12";default:return"M2 4h12M2 8h12M2 12h8"}}function b(T){const $=[];for(const L of T){if(L.type!=="list")continue;const P=Kd(L.source);for(let q=0;q<P.length;q++){const W=P[q].split(`
|
|
574
574
|
`)[0].replace(/^[-*+]\s+|^\d+\.\s+/,"").trim();W&&$.push({text:W.length>50?W.slice(0,47)+"...":W,index:q})}}return $}function _(T){const $=[];for(let L=0;L<T.length;L++){const P=T[L];if(P.type==="heading"&&P.headingText)$.push({text:P.headingText,type:"text",nodeIndex:L});else if(P.type==="paragraph"){const q=P.source.replace(/\n/g," ").trim();$.push({text:q.length>60?q.slice(0,57)+"...":q,type:"text",nodeIndex:L})}else if(P.type==="rune"&&P.runeName)$.push({text:P.runeName,type:"rune",nodeIndex:L});else if(P.type==="fence"){const q=P.fenceLanguage?`[${P.fenceLanguage}]`:"[code]";$.push({text:q,type:"text",nodeIndex:L})}else if(P.type==="list"){const q=P.source.split(`
|
|
575
|
-
`).filter(R=>R.match(/^[-*\d.]\s/)).map(R=>R.replace(/^[-*\d.]+\s+/,"").trim()).filter(Boolean);for(const R of q.slice(0,3))$.push({text:R.length>50?R.slice(0,47)+"...":R,type:"text"});q.length>3&&$.push({text:`... +${q.length-3} more`,type:"text"})}else if(P.type==="image")$.push({text:"[image]",type:"text",nodeIndex:L});else{const q=P.source.replace(/\n/g," ").trim();q&&$.push({text:q.length>50?q.slice(0,47)+"...":q,type:"text",nodeIndex:L})}}return $}var C=nV(),w=D(C),y=I(D(w),2),S=D(y),A=I(w,2);{var x=T=>{var $=FX();Qt($,21,()=>e.structure.fields,nn,(L,P)=>{const q=ge(()=>_(g(P).nodes)),R=ge(()=>m(g(P).match)?b(g(P).nodes):[]),W=ge(()=>p(g(P))?O(g(P)):[]);var U=ZX(),ie=at(U);let ce;ie.__click=()=>e.onfieldselect(g(P).name);var re=D(ie),H=D(re),ae=I(re,2),oe=D(ae),z=I(ae,2);{var ne=Ke=>{var Me=DX();Z(Ke,Me)};ue(z,Ke=>{!g(P).optional&&!g(P).filled&&Ke(ne)})}var Se=I(z,4);{var Te=Ke=>{var Me=IX(),xt=at(Me);{var Vt=on=>{var Cn=RX();Cn.__click=Wt=>{Wt.stopPropagation(),e.onappenditem(g(P).name)},fe(()=>Et(Cn,"title",`Add item to ${g(P).name??""}`)),Z(on,Cn)},En=ge(()=>m(g(P).match)||p(g(P)));ue(xt,on=>{g(En)&&on(Vt)})}var St=I(xt,2);St.__click=on=>{on.stopPropagation(),e.onremovefield(g(P).name)},fe(()=>Et(St,"title",`Remove ${g(P).name??""}`)),Z(Ke,Me)},Le=Ke=>{var Me=NX();Me.__click=xt=>{xt.stopPropagation(),e.onaddfield(g(P).name)},fe(()=>Et(Me,"title",`Add ${g(P).name??""}`)),Z(Ke,Me)};ue(Se,Ke=>{g(P).filled?Ke(Te):Ke(Le,!1)})}var he=I(ie,2);{var Ee=Ke=>{var Me=BX(),xt=D(Me);r(xt,()=>g(R),()=>g(P).name),Z(Ke,Me)},Ye=ge(()=>g(P).filled&&m(g(P).match)&&g(R).length>0),rt=Ke=>{var Me=jX(),xt=D(Me);i(xt,()=>g(W),()=>g(P).name),Z(Ke,Me)},Ue=Ke=>{var Me=zX(),xt=D(Me);t(xt,()=>g(q),()=>g(P).name),Z(Ke,Me)};ue(he,Ke=>{g(Ye)?Ke(Ee):g(P).filled&&g(W).length>0?Ke(rt,1):g(P).filled&&g(q).length>0&&Ke(Ue,2)})}fe(Ke=>{ce=Xe(ie,1,"cm-tree__field svelte-1d9gzqq",null,ce,{"cm-tree__field--filled":g(P).filled,"cm-tree__field--empty":!g(P).filled,"cm-tree__field--required":!g(P).optional&&!g(P).filled,"cm-tree__field--selected":s()===g(P).name}),Et(H,"d",Ke),$e(oe,g(P).name)},[()=>v(g(P).match)]),Z(L,U)}),Z(T,$)},k=T=>{var $=pn(),L=at($);Qt(L,17,()=>e.structure.zones,nn,(P,q,R)=>{var W=eV(),U=at(W);{var ie=oe=>{var z=XX();Z(oe,z)};ue(U,oe=>{R>0&&oe(ie)})}var ce=I(U,2),re=D(ce),H=D(re),ae=I(re,2);Qt(ae,21,()=>g(q).fields,nn,(oe,z)=>{const ne=ge(()=>_(g(z).nodes)),Se=ge(()=>m(g(z).match)?b(g(z).nodes):[]),Te=ge(()=>p(g(z))?O(g(z)):[]);var Le=JX(),he=at(Le);let Ee;he.__click=()=>e.onfieldselect(g(z).name,g(q).name);var Ye=D(he),rt=D(Ye),Ue=I(Ye,2),Ke=D(Ue),Me=I(Ue,2);{var xt=Lt=>{var Jt=VX();Z(Lt,Jt)};ue(Me,Lt=>{!g(z).optional&&!g(z).filled&&Lt(xt)})}var Vt=I(Me,4);{var En=Lt=>{var Jt=YX(),On=at(Jt);{var te=Ce=>{var qe=WX();qe.__click=At=>{At.stopPropagation(),e.onappenditem(g(z).name,g(q).name)},fe(()=>Et(qe,"title",`Add item to ${g(z).name??""}`)),Z(Ce,qe)},ve=ge(()=>m(g(z).match)||p(g(z)));ue(On,Ce=>{g(ve)&&Ce(te)})}var xe=I(On,2);xe.__click=Ce=>{Ce.stopPropagation(),e.onremovefield(g(z).name,g(q).name)},fe(()=>Et(xe,"title",`Remove ${g(z).name??""}`)),Z(Lt,Jt)},St=Lt=>{var Jt=UX();Jt.__click=On=>{On.stopPropagation(),e.onaddfield(g(z).name,g(q).name)},fe(()=>Et(Jt,"title",`Add ${g(z).name??""}`)),Z(Lt,Jt)};ue(Vt,Lt=>{g(z).filled?Lt(En):Lt(St,!1)})}var on=I(he,2);{var Cn=Lt=>{var Jt=GX(),On=D(Jt);r(On,()=>g(Se),()=>g(z).name,()=>g(q).name),Z(Lt,Jt)},Wt=ge(()=>g(z).filled&&m(g(z).match)&&g(Se).length>0),ke=Lt=>{var Jt=HX(),On=D(Jt);i(On,()=>g(Te),()=>g(z).name,()=>g(q).name),Z(Lt,Jt)},Tn=Lt=>{var Jt=KX(),On=D(Jt);t(On,()=>g(ne),()=>g(z).name,()=>g(q).name),Z(Lt,Jt)};ue(on,Lt=>{g(Wt)?Lt(Cn):g(z).filled&&g(Te).length>0?Lt(ke,1):g(z).filled&&g(ne).length>0&&Lt(Tn,2)})}fe(Lt=>{Ee=Xe(he,1,"cm-tree__field svelte-1d9gzqq",null,Ee,{"cm-tree__field--filled":g(z).filled,"cm-tree__field--empty":!g(z).filled,"cm-tree__field--required":!g(z).optional&&!g(z).filled,"cm-tree__field--selected":s()===`${g(q).name}.${g(z).name}`}),Et(rt,"d",Lt),$e(Ke,g(z).name)},[()=>v(g(z).match)]),Z(oe,Le)}),fe(()=>$e(H,g(q).name)),Z(P,W)}),Z(T,$)},E=T=>{var $=tV(),L=D($);fe(()=>$e(L,e.structure.description)),Z(T,$)};ue(A,T=>{e.structure.type==="sequence"?T(x):e.structure.type==="delimited"?T(k,1):(e.structure.type==="sections"||e.structure.type==="custom")&&T(E,2)})}fe(()=>$e(S,e.rootLabel)),Z(n,C),bt()}Kt(["click"]);function pe(n){return new Ya(LO.define(n))}function $s(n){return se(()=>import("./index-CdBec525.js"),[]).then(e=>e.sql({dialect:e[n]}))}const HC=[J.of({name:"C",extensions:["c","h","ino"],load(){return se(()=>import("./index-CNMIVdix.js"),[]).then(n=>n.cpp())}}),J.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return se(()=>import("./index-CNMIVdix.js"),[]).then(n=>n.cpp())}}),J.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return $s("Cassandra")}}),J.of({name:"CSS",extensions:["css"],load(){return se(()=>Promise.resolve().then(()=>sR),void 0).then(n=>n.css())}}),J.of({name:"Go",extensions:["go"],load(){return se(()=>import("./index-ChlNQT-L.js"),[]).then(n=>n.go())}}),J.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return se(()=>Promise.resolve().then(()=>HR),void 0).then(n=>n.html())}}),J.of({name:"Java",extensions:["java"],load(){return se(()=>import("./index-B-h36weV.js"),[]).then(n=>n.java())}}),J.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return se(()=>Promise.resolve().then(()=>Pu),void 0).then(n=>n.javascript())}}),J.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return se(()=>import("./index-Be3uH7Ic.js"),[]).then(n=>n.jinja())}}),J.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return se(()=>import("./index-eycSM0Ky.js"),[]).then(n=>n.json())}}),J.of({name:"JSX",extensions:["jsx"],load(){return se(()=>Promise.resolve().then(()=>Pu),void 0).then(n=>n.javascript({jsx:!0}))}}),J.of({name:"LESS",extensions:["less"],load(){return se(()=>import("./index-CSu1hJPI.js"),[]).then(n=>n.less())}}),J.of({name:"Liquid",extensions:["liquid"],load(){return se(()=>import("./index-NZ_PL5ce.js"),[]).then(n=>n.liquid())}}),J.of({name:"MariaDB SQL",load(){return $s("MariaSQL")}}),J.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return se(()=>Promise.resolve().then(()=>lI),void 0).then(n=>n.markdown())}}),J.of({name:"MS SQL",load(){return $s("MSSQL")}}),J.of({name:"MySQL",load(){return $s("MySQL")}}),J.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return se(()=>import("./index-OQlUIbEu.js"),[]).then(n=>n.php())}}),J.of({name:"PLSQL",extensions:["pls"],load(){return $s("PLSQL")}}),J.of({name:"PostgreSQL",load(){return $s("PostgreSQL")}}),J.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return se(()=>import("./index-CZfwRYIp.js"),[]).then(n=>n.python())}}),J.of({name:"Rust",extensions:["rs"],load(){return se(()=>import("./index-DHDXB_PN.js"),[]).then(n=>n.rust())}}),J.of({name:"Sass",extensions:["sass"],load(){return se(()=>import("./index-DuqiAylO.js"),[]).then(n=>n.sass({indented:!0}))}}),J.of({name:"SCSS",extensions:["scss"],load(){return se(()=>import("./index-DuqiAylO.js"),[]).then(n=>n.sass())}}),J.of({name:"SQL",extensions:["sql"],load(){return $s("StandardSQL")}}),J.of({name:"SQLite",load(){return $s("SQLite")}}),J.of({name:"TSX",extensions:["tsx"],load(){return se(()=>Promise.resolve().then(()=>Pu),void 0).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),J.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return se(()=>Promise.resolve().then(()=>Pu),void 0).then(n=>n.javascript({typescript:!0}))}}),J.of({name:"WebAssembly",extensions:["wat","wast"],load(){return se(()=>import("./index-tigqumKr.js"),[]).then(n=>n.wast())}}),J.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return se(()=>import("./index-BoovIh28.js"),[]).then(n=>n.xml())}}),J.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return se(()=>import("./index--THaxCLQ.js"),[]).then(n=>n.yaml())}}),J.of({name:"APL",extensions:["dyalog","apl"],load(){return se(()=>import("./apl-B4CMkyY2.js"),[]).then(n=>pe(n.apl))}}),J.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return se(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(n=>pe(n.asciiArmor))}}),J.of({name:"ASN.1",extensions:["asn","asn1"],load(){return se(()=>import("./asn1-EdZsLKOL.js"),[]).then(n=>pe(n.asn1({})))}}),J.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return se(()=>import("./asterisk-B-8jnY81.js"),[]).then(n=>pe(n.asterisk))}}),J.of({name:"Brainfuck",extensions:["b","bf"],load(){return se(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(n=>pe(n.brainfuck))}}),J.of({name:"Cobol",extensions:["cob","cpy"],load(){return se(()=>import("./cobol-CWcv1MsR.js"),[]).then(n=>pe(n.cobol))}}),J.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.csharp))}}),J.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return se(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>pe(n.clojure))}}),J.of({name:"ClojureScript",extensions:["cljs"],load(){return se(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>pe(n.clojure))}}),J.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return se(()=>import("./css-BnMrqG3P.js"),[]).then(n=>pe(n.gss))}}),J.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return se(()=>import("./cmake-BQqOBYOt.js"),[]).then(n=>pe(n.cmake))}}),J.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return se(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(n=>pe(n.coffeeScript))}}),J.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return se(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(n=>pe(n.commonLisp))}}),J.of({name:"Cypher",extensions:["cyp","cypher"],load(){return se(()=>import("./cypher-C_CwsFkJ.js"),[]).then(n=>pe(n.cypher))}}),J.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return se(()=>import("./python-BuPzkPfP.js"),[]).then(n=>pe(n.cython))}}),J.of({name:"Crystal",extensions:["cr"],load(){return se(()=>import("./crystal-SjHAIU92.js"),[]).then(n=>pe(n.crystal))}}),J.of({name:"D",extensions:["d"],load(){return se(()=>import("./d-pRatUO7H.js"),[]).then(n=>pe(n.d))}}),J.of({name:"Dart",extensions:["dart"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.dart))}}),J.of({name:"diff",extensions:["diff","patch"],load(){return se(()=>import("./diff-DbItnlRl.js"),[]).then(n=>pe(n.diff))}}),J.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return se(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([0,1])).then(n=>pe(n.dockerFile))}}),J.of({name:"DTD",extensions:["dtd"],load(){return se(()=>import("./dtd-DF_7sFjM.js"),[]).then(n=>pe(n.dtd))}}),J.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return se(()=>import("./dylan-DwRh75JA.js"),[]).then(n=>pe(n.dylan))}}),J.of({name:"EBNF",load(){return se(()=>import("./ebnf-CDyGwa7X.js"),[]).then(n=>pe(n.ebnf))}}),J.of({name:"ECL",extensions:["ecl"],load(){return se(()=>import("./ecl-Cabwm37j.js"),[]).then(n=>pe(n.ecl))}}),J.of({name:"edn",extensions:["edn"],load(){return se(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>pe(n.clojure))}}),J.of({name:"Eiffel",extensions:["e"],load(){return se(()=>import("./eiffel-CnydiIhH.js"),[]).then(n=>pe(n.eiffel))}}),J.of({name:"Elm",extensions:["elm"],load(){return se(()=>import("./elm-vLlmbW-K.js"),[]).then(n=>pe(n.elm))}}),J.of({name:"Erlang",extensions:["erl"],load(){return se(()=>import("./erlang-BNw1qcRV.js"),[]).then(n=>pe(n.erlang))}}),J.of({name:"Esper",load(){return se(()=>import("./sql-D0XecflT.js"),[]).then(n=>pe(n.esper))}}),J.of({name:"Factor",extensions:["factor"],load(){return se(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([2,1])).then(n=>pe(n.factor))}}),J.of({name:"FCL",load(){return se(()=>import("./fcl-Kvtd6kyn.js"),[]).then(n=>pe(n.fcl))}}),J.of({name:"Forth",extensions:["forth","fth","4th"],load(){return se(()=>import("./forth-Ffai-XNe.js"),[]).then(n=>pe(n.forth))}}),J.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return se(()=>import("./fortran-DYz_wnZ1.js"),[]).then(n=>pe(n.fortran))}}),J.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return se(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>pe(n.fSharp))}}),J.of({name:"Gas",extensions:["s"],load(){return se(()=>import("./gas-Bneqetm1.js"),[]).then(n=>pe(n.gas))}}),J.of({name:"Gherkin",extensions:["feature"],load(){return se(()=>import("./gherkin-heZmZLOM.js"),[]).then(n=>pe(n.gherkin))}}),J.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return se(()=>import("./groovy-D9Dt4D0W.js"),[]).then(n=>pe(n.groovy))}}),J.of({name:"Haskell",extensions:["hs"],load(){return se(()=>import("./haskell-Cw1EW3IL.js"),[]).then(n=>pe(n.haskell))}}),J.of({name:"Haxe",extensions:["hx"],load(){return se(()=>import("./haxe-H-WmDvRZ.js"),[]).then(n=>pe(n.haxe))}}),J.of({name:"HXML",extensions:["hxml"],load(){return se(()=>import("./haxe-H-WmDvRZ.js"),[]).then(n=>pe(n.hxml))}}),J.of({name:"HTTP",load(){return se(()=>import("./http-DBlCnlav.js"),[]).then(n=>pe(n.http))}}),J.of({name:"IDL",extensions:["pro"],load(){return se(()=>import("./idl-BEugSyMb.js"),[]).then(n=>pe(n.idl))}}),J.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return se(()=>import("./javascript-iXu5QeM3.js"),[]).then(n=>pe(n.jsonld))}}),J.of({name:"Julia",extensions:["jl"],load(){return se(()=>import("./julia-DuME0IfC.js"),[]).then(n=>pe(n.julia))}}),J.of({name:"Kotlin",extensions:["kt","kts"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.kotlin))}}),J.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return se(()=>import("./livescript-BwQOo05w.js"),[]).then(n=>pe(n.liveScript))}}),J.of({name:"Lua",extensions:["lua"],load(){return se(()=>import("./lua-BgMRiT3U.js"),[]).then(n=>pe(n.lua))}}),J.of({name:"mIRC",extensions:["mrc"],load(){return se(()=>import("./mirc-CjQqDB4T.js"),[]).then(n=>pe(n.mirc))}}),J.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return se(()=>import("./mathematica-DTrFuWx2.js"),[]).then(n=>pe(n.mathematica))}}),J.of({name:"Modelica",extensions:["mo"],load(){return se(()=>import("./modelica-Dc1JOy9r.js"),[]).then(n=>pe(n.modelica))}}),J.of({name:"MUMPS",extensions:["mps"],load(){return se(()=>import("./mumps-BT43cFF4.js"),[]).then(n=>pe(n.mumps))}}),J.of({name:"Mbox",extensions:["mbox"],load(){return se(()=>import("./mbox-CNhZ1qSd.js"),[]).then(n=>pe(n.mbox))}}),J.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return se(()=>import("./nginx-DdIZxoE0.js"),[]).then(n=>pe(n.nginx))}}),J.of({name:"NSIS",extensions:["nsh","nsi"],load(){return se(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([3,1])).then(n=>pe(n.nsis))}}),J.of({name:"NTriples",extensions:["nt","nq"],load(){return se(()=>import("./ntriples-BfvgReVJ.js"),[]).then(n=>pe(n.ntriples))}}),J.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.objectiveC))}}),J.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.objectiveCpp))}}),J.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return se(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>pe(n.oCaml))}}),J.of({name:"Octave",extensions:["m"],load(){return se(()=>import("./octave-Ck1zUtKM.js"),[]).then(n=>pe(n.octave))}}),J.of({name:"Oz",extensions:["oz"],load(){return se(()=>import("./oz-BzwKVEFT.js"),[]).then(n=>pe(n.oz))}}),J.of({name:"Pascal",extensions:["p","pas"],load(){return se(()=>import("./pascal--L3eBynH.js"),[]).then(n=>pe(n.pascal))}}),J.of({name:"Perl",extensions:["pl","pm"],load(){return se(()=>import("./perl-CdXCOZ3F.js"),[]).then(n=>pe(n.perl))}}),J.of({name:"Pig",extensions:["pig"],load(){return se(()=>import("./pig-CevX1Tat.js"),[]).then(n=>pe(n.pig))}}),J.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return se(()=>import("./powershell-CFHJl5sT.js"),[]).then(n=>pe(n.powerShell))}}),J.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return se(()=>import("./properties-C78fOPTZ.js"),[]).then(n=>pe(n.properties))}}),J.of({name:"ProtoBuf",extensions:["proto"],load(){return se(()=>import("./protobuf-ChK-085T.js"),[]).then(n=>pe(n.protobuf))}}),J.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return se(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([4,5])).then(n=>pe(n.pug))}}),J.of({name:"Puppet",extensions:["pp"],load(){return se(()=>import("./puppet-DMA9R1ak.js"),[]).then(n=>pe(n.puppet))}}),J.of({name:"Q",extensions:["q"],load(){return se(()=>import("./q-pXgVlZs6.js"),[]).then(n=>pe(n.q))}}),J.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return se(()=>import("./r-B6wPVr8A.js"),[]).then(n=>pe(n.r))}}),J.of({name:"RPM Changes",load(){return se(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>pe(n.rpmChanges))}}),J.of({name:"RPM Spec",extensions:["spec"],load(){return se(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>pe(n.rpmSpec))}}),J.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return se(()=>import("./ruby-B2Rjki9n.js"),[]).then(n=>pe(n.ruby))}}),J.of({name:"SAS",extensions:["sas"],load(){return se(()=>import("./sas-B4kiWyti.js"),[]).then(n=>pe(n.sas))}}),J.of({name:"Scala",extensions:["scala"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.scala))}}),J.of({name:"Scheme",extensions:["scm","ss"],load(){return se(()=>import("./scheme-C41bIUwD.js"),[]).then(n=>pe(n.scheme))}}),J.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return se(()=>import("./shell-CjFT_Tl9.js"),[]).then(n=>pe(n.shell))}}),J.of({name:"Sieve",extensions:["siv","sieve"],load(){return se(()=>import("./sieve-C3Gn_uJK.js"),[]).then(n=>pe(n.sieve))}}),J.of({name:"Smalltalk",extensions:["st"],load(){return se(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(n=>pe(n.smalltalk))}}),J.of({name:"Solr",load(){return se(()=>import("./solr-DehyRSwq.js"),[]).then(n=>pe(n.solr))}}),J.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return se(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>pe(n.sml))}}),J.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return se(()=>import("./sparql-DkYu6x3z.js"),[]).then(n=>pe(n.sparql))}}),J.of({name:"Spreadsheet",alias:["excel","formula"],load(){return se(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(n=>pe(n.spreadsheet))}}),J.of({name:"Squirrel",extensions:["nut"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.squirrel))}}),J.of({name:"Stylus",extensions:["styl"],load(){return se(()=>import("./stylus-B533Al4x.js"),[]).then(n=>pe(n.stylus))}}),J.of({name:"Swift",extensions:["swift"],load(){return se(()=>import("./swift-BzpIVaGY.js"),[]).then(n=>pe(n.swift))}}),J.of({name:"sTeX",load(){return se(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>pe(n.stex))}}),J.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return se(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>pe(n.stex))}}),J.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return se(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>pe(n.verilog))}}),J.of({name:"Tcl",extensions:["tcl"],load(){return se(()=>import("./tcl-DVfN8rqt.js"),[]).then(n=>pe(n.tcl))}}),J.of({name:"Textile",extensions:["textile"],load(){return se(()=>import("./textile-CnDTJFAw.js"),[]).then(n=>pe(n.textile))}}),J.of({name:"TiddlyWiki",load(){return se(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(n=>pe(n.tiddlyWiki))}}),J.of({name:"Tiki wiki",load(){return se(()=>import("./tiki-DGYXhP31.js"),[]).then(n=>pe(n.tiki))}}),J.of({name:"TOML",extensions:["toml"],load(){return se(()=>import("./toml-Bm5Em-hy.js"),[]).then(n=>pe(n.toml))}}),J.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return se(()=>import("./troff-wAsdV37c.js"),[]).then(n=>pe(n.troff))}}),J.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return se(()=>import("./ttcn-CfJYG6tj.js"),[]).then(n=>pe(n.ttcn))}}),J.of({name:"TTCN_CFG",extensions:["cfg"],load(){return se(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(n=>pe(n.ttcnCfg))}}),J.of({name:"Turtle",extensions:["ttl"],load(){return se(()=>import("./turtle-B1tBg_DP.js"),[]).then(n=>pe(n.turtle))}}),J.of({name:"Web IDL",extensions:["webidl"],load(){return se(()=>import("./webidl-ZXfAyPTL.js"),[]).then(n=>pe(n.webIDL))}}),J.of({name:"VB.NET",extensions:["vb"],load(){return se(()=>import("./vb-CmGdzxic.js"),[]).then(n=>pe(n.vb))}}),J.of({name:"VBScript",extensions:["vbs"],load(){return se(()=>import("./vbscript-BuJXcnF6.js"),[]).then(n=>pe(n.vbScript))}}),J.of({name:"Velocity",extensions:["vtl"],load(){return se(()=>import("./velocity-D8B20fx6.js"),[]).then(n=>pe(n.velocity))}}),J.of({name:"Verilog",extensions:["v"],load(){return se(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>pe(n.verilog))}}),J.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return se(()=>import("./vhdl-lSbBsy5d.js"),[]).then(n=>pe(n.vhdl))}}),J.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return se(()=>import("./xquery-DzFWVndE.js"),[]).then(n=>pe(n.xQuery))}}),J.of({name:"Yacas",extensions:["ys"],load(){return se(()=>import("./yacas-BJ4BC0dw.js"),[]).then(n=>pe(n.yacas))}}),J.of({name:"Z80",extensions:["z80"],load(){return se(()=>import("./z80-Hz9HOZM7.js"),[]).then(n=>pe(n.z80))}}),J.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return se(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>pe(n.mscgen))}}),J.of({name:"Xù",extensions:["xu"],load(){return se(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>pe(n.xu))}}),J.of({name:"MsGenny",extensions:["msgenny"],load(){return se(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>pe(n.msgenny))}}),J.of({name:"Vue",extensions:["vue"],load(){return se(()=>import("./index-Dn1ol6U9.js"),[]).then(n=>n.vue())}}),J.of({name:"Angular Template",load(){return se(()=>import("./index-_YLMqFUv.js"),[]).then(n=>n.angular())}})];var iV=V('<div class="inline-editor svelte-1ewoogg"></div>');function go(n,e){vt(e,!0);let t,r=K(void 0),i="";const s=new ms,o=new ms,a=new ms,l=Qe.theme({"&":{color:"#1a1a2e",fontSize:"13px",height:"auto"},".cm-scroller":{overflow:"visible",fontFamily:"'SF Mono', 'Fira Code', ui-monospace, monospace",lineHeight:"1.6"},".cm-content":{padding:"0.75rem",caretColor:"#1e293b",minHeight:"3rem"},".cm-cursor":{borderLeftColor:"#1e293b"},"&.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"rgba(14, 165, 233, 0.2)"},".cm-selectionBackground":{backgroundColor:"rgba(14, 165, 233, 0.12)"},"&.cm-focused":{outline:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-tooltip.cm-tooltip-autocomplete":{border:"1px solid #e2e8f0",borderRadius:"6px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.12)",backgroundColor:"#ffffff",overflow:"hidden"},".cm-tooltip.cm-tooltip-autocomplete ul":{fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"12px",maxHeight:"280px"},".cm-tooltip.cm-tooltip-autocomplete ul li":{padding:"4px 8px",borderBottom:"1px solid #f1f5f9"},".cm-tooltip.cm-tooltip-autocomplete ul li[aria-selected]":{backgroundColor:"#f0f9ff",color:"#0369a1"},".cm-tooltip.cm-completionInfo":{border:"1px solid #e2e8f0",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",backgroundColor:"#ffffff",padding:"6px 10px",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"12px",color:"#475569",maxWidth:"300px"},".cm-completionDetail":{color:"#94a3b8",fontStyle:"normal",marginLeft:"0.5em"},".cm-markdoc-tag":{backgroundColor:"rgba(217, 119, 6, 0.06)",borderRadius:"2px"},".cm-markdoc-bracket":{color:"#94a3b8"},".cm-markdoc-name":{color:"#d97706",fontWeight:"600"}},{dark:!1});bn(()=>{if(!t)return;const u=!!Cr(()=>e.language)?.trim(),f=qt.create({doc:Cr(()=>e.content),extensions:[s.of(Ja()),o.of(u?[]:Cc()),a.of(u?[]:Im({override:[Um(e.runes),Gm(e.runes,e.aggregated)],icons:!1})),IO(),l,gc(bA),gc(X2),fA(),Go.of([...jO,...NO,...vA,{key:"Mod-/",run:h=>(Kl(h),!0)}]),Qe.updateListener.of(h=>{h.docChanged&&(i=h.state.doc.toString(),e.onchange(i))}),Qe.lineWrapping]}),d=new Qe({state:f,parent:t});return M(r,d,!0),()=>{M(r,void 0),d.destroy()}}),bn(()=>{const u=g(r);if(!u)return;const f=e.language?.trim();if(!f){u.dispatch({effects:[s.reconfigure(Ja()),o.reconfigure(Cc()),a.reconfigure(Im({override:[Um(e.runes),Gm(e.runes,e.aggregated)],icons:!1}))]});return}u.dispatch({effects:[o.reconfigure([]),a.reconfigure([])]});const d=J.matchLanguageName(HC,f,!0);d&&d.load().then(h=>{g(r)===u&&u.dispatch({effects:s.reconfigure(h)})})}),bn(()=>{const u=e.content,f=g(r);if(!f)return;const d=f.state.doc.toString();if(u!==d){if(i&&d===i){i="";return}i="",f.dispatch({changes:{from:0,to:f.state.doc.length,insert:u}})}});var c=iV();mn(c,u=>t=u,()=>t),Z(n,c),bt()}var sV=V('<span class="edit-panel__category svelte-1t8cclf"> </span>'),oV=ks('<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="2"></circle><path d="M6.7 1.6h2.6l.4 1.8.8.4 1.7-.7 1.8 1.8-.7 1.7.4.8 1.8.4v2.6l-1.8.4-.4.8.7 1.7-1.8 1.8-1.7-.7-.8.4-.4 1.8H6.7l-.4-1.8-.8-.4-1.7.7-1.8-1.8.7-1.7-.4-.8-1.8-.4V6.7l1.8-.4.4-.8-.7-1.7 1.8-1.8 1.7.7.8-.4z"></path></svg> Settings',1),aV=ks('<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h4M2 7h4M6 11h4M6 15h4M4 3v8M8 11v4"></path></svg> Structure',1),lV=ks('<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 4h12M2 8h12M2 12h8"></path></svg> Content',1),cV=V('<button type="button"><!></button>'),uV=V('<div class="edit-panel__tabs svelte-1t8cclf"></div>'),fV=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Level</span> <select class="edit-panel__select svelte-1t8cclf"><option>H1</option><option>H2</option><option>H3</option><option>H4</option><option>H5</option><option>H6</option></select></label> <label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Text</span> <input class="edit-panel__input svelte-1t8cclf" type="text"/></label></div>'),dV=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Language</span> <input class="edit-panel__input svelte-1t8cclf" type="text" placeholder="e.g. js, python, html"/></label></div>'),hV=V('<div class="edit-panel__empty-tab svelte-1t8cclf"><span class="edit-panel__empty-tab-text svelte-1t8cclf">No settings for this element</span></div>'),pV=V('<label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf"> </span> <input class="edit-panel__input svelte-1t8cclf" type="text"/></label>'),mV=V('<div class="edit-panel__unknown svelte-1t8cclf"><span class="edit-panel__unknown-label svelte-1t8cclf"> </span> <!></div>'),gV=V('<div class="edit-panel__tab-panel svelte-1t8cclf"><!></div>'),OV=V('<div class="edit-panel__tab-panel svelte-1t8cclf"><!></div>'),vV=V('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),bV=V('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),yV=V('<div class="edit-panel__empty-tab svelte-1t8cclf"><span class="edit-panel__empty-tab-text svelte-1t8cclf">Edit heading text in Settings</span></div>'),wV=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Source</span> <textarea class="edit-panel__textarea svelte-1t8cclf"></textarea></label></div>'),_V=V('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),kV=V('<div class="edit-panel__empty-tab svelte-1t8cclf"><span class="edit-panel__empty-tab-text svelte-1t8cclf">This rune has no inner content</span></div>'),xV=V('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),SV=V('<div class="edit-panel__tab-panel svelte-1t8cclf"><!></div>'),AV=V("<!> <!> <!>",1),CV=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Level</span> <select class="edit-panel__select svelte-1t8cclf"><option>H1</option><option>H2</option><option>H3</option><option>H4</option><option>H5</option><option>H6</option></select></label> <label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Text</span> <input class="edit-panel__input svelte-1t8cclf" type="text"/></label></div>'),TV=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Language</span> <input class="edit-panel__input svelte-1t8cclf" type="text" placeholder="e.g. js, python, html"/></label></div> <div class="edit-panel__content-editor svelte-1t8cclf"><!></div>',1),PV=V('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),EV=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Source</span> <textarea class="edit-panel__textarea svelte-1t8cclf"></textarea></label></div>'),$V=V('<div class="edit-panel__body svelte-1t8cclf"><!></div>'),QV=V('<div class="edit-panel svelte-1t8cclf"><div class="edit-panel__top svelte-1t8cclf"><div class="edit-panel__header svelte-1t8cclf"><span class="edit-panel__type svelte-1t8cclf"> </span> <!> <div class="edit-panel__spacer svelte-1t8cclf"></div> <button class="edit-panel__btn edit-panel__btn--danger svelte-1t8cclf" title="Remove block"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 3 14 13 14 13 6"></polyline><line x1="1" y1="4" x2="15" y2="4"></line><line x1="6" y1="2" x2="10" y2="2"></line><line x1="6" y1="8" x2="6" y2="12"></line><line x1="10" y1="8" x2="10" y2="12"></line></svg></button> <button class="edit-panel__btn svelte-1t8cclf" title="Close panel">×</button></div> <!></div> <!></div>');function LV(n,e){vt(e,!0);let t=Pt(e,"aggregated",19,()=>({})),r=Pt(e,"initialRuneIndex",3,null),i=ge(()=>Ov(e.block)),s=ge(()=>e.block.type==="rune"?e.runeMap.get(e.block.runeName)??null:null),o=ge(()=>g(s)?.category??null),a=K(sn([])),l=ge(()=>{if(e.block.type!=="rune")return[];const te=e.block;return te.selfClosing||!te.innerContent.trim()?[]:mv(te.innerContent)}),c=ge(()=>g(l).some(te=>te.type==="rune")),u=ge(()=>g(v)?.type==="rune"&&g(b)?g(b):g(s)),f=ge(()=>g(v)?.type==="rune"&&g(v).children?g(v).children:g(l)),d=ge(()=>g(u)?.contentModel!=null),h=ge(()=>g(u)?.contentModel?hX(g(f),g(u).contentModel):null),m=K(null);function p(te,ve){let xe=0;function Ce(qe,At){for(let ht=0;ht<qe.length;ht++)if(qe[ht].type==="rune"){if(xe===ve)return[...At,ht];xe++;const Je=Ce(qe[ht].children??[],[...At,ht]);if(Je)return Je}return null}return Ce(te,[])}bn(()=>{if(r()!=null&&g(l).length>0){const te=p(g(l),r());te&&M(a,te,!0)}});function O(te,ve){if(ve.length===0)return null;const[xe,...Ce]=ve,qe=te[xe];return qe?Ce.length===0?qe:O(qe.children??[],Ce):null}let v=ge(()=>O(g(l),g(a))),b=ge(()=>g(v)?.runeName?e.runeMap.get(g(v).runeName)??null:null),_=ge(()=>g(v)!=null&&g(v).type!=="rune"),C=ge(()=>g(v)?g(v).type==="rune"?g(v).runeName??g(i):g(v).type:g(i)),w=K("settings"),y=ge(()=>{if(e.block.type!=="rune")return[];const te=e.block,ve=["settings"];return(g(d)||!g(v)&&g(c))&&ve.push("structure"),te.selfClosing||ve.push("content"),ve});bn(()=>{g(w)==="structure"&&!g(y).includes("structure")&&M(w,"settings")});function S(te){M(a,te,!0);const ve=O(g(l),te);ve&&ve.type!=="rune"&&M(w,"content")}function A(){M(a,[],!0)}function x(te,ve){M(m,ve?`${ve}.${te}`:te,!0)}function k(te){const ve=e.block;if(g(v)?.type==="rune"&&g(v).innerContent!==void 0){const xe=te(g(v).innerContent);if(xe===g(v).innerContent)return;const Ce=df(g(v).attributes??{}),qe=xe.trim(),At=qe?`{% ${g(v).runeName}${Ce} %}
|
|
575
|
+
`).filter(R=>R.match(/^[-*\d.]\s/)).map(R=>R.replace(/^[-*\d.]+\s+/,"").trim()).filter(Boolean);for(const R of q.slice(0,3))$.push({text:R.length>50?R.slice(0,47)+"...":R,type:"text"});q.length>3&&$.push({text:`... +${q.length-3} more`,type:"text"})}else if(P.type==="image")$.push({text:"[image]",type:"text",nodeIndex:L});else{const q=P.source.replace(/\n/g," ").trim();q&&$.push({text:q.length>50?q.slice(0,47)+"...":q,type:"text",nodeIndex:L})}}return $}var C=rV(),w=D(C),y=I(D(w),2),S=D(y),A=I(w,2);{var x=T=>{var $=XX();Qt($,21,()=>e.structure.fields,nn,(L,P)=>{const q=ge(()=>_(g(P).nodes)),R=ge(()=>m(g(P).match)?b(g(P).nodes):[]),W=ge(()=>p(g(P))?O(g(P)):[]);var U=FX(),ie=at(U);let ce;ie.__click=()=>e.onfieldselect(g(P).name);var re=D(ie),H=D(re),ae=I(re,2),oe=D(ae),z=I(ae,2);{var ne=Ke=>{var Me=RX();Z(Ke,Me)};ue(z,Ke=>{!g(P).optional&&!g(P).filled&&Ke(ne)})}var Se=I(z,4);{var Te=Ke=>{var Me=NX(),xt=at(Me);{var Vt=on=>{var Cn=IX();Cn.__click=Wt=>{Wt.stopPropagation(),e.onappenditem(g(P).name)},fe(()=>Et(Cn,"title",`Add item to ${g(P).name??""}`)),Z(on,Cn)},En=ge(()=>m(g(P).match)||p(g(P)));ue(xt,on=>{g(En)&&on(Vt)})}var St=I(xt,2);St.__click=on=>{on.stopPropagation(),e.onremovefield(g(P).name)},fe(()=>Et(St,"title",`Remove ${g(P).name??""}`)),Z(Ke,Me)},Le=Ke=>{var Me=BX();Me.__click=xt=>{xt.stopPropagation(),e.onaddfield(g(P).name)},fe(()=>Et(Me,"title",`Add ${g(P).name??""}`)),Z(Ke,Me)};ue(Se,Ke=>{g(P).filled?Ke(Te):Ke(Le,!1)})}var he=I(ie,2);{var Ee=Ke=>{var Me=jX(),xt=D(Me);r(xt,()=>g(R),()=>g(P).name),Z(Ke,Me)},Ye=ge(()=>g(P).filled&&m(g(P).match)&&g(R).length>0),rt=Ke=>{var Me=zX(),xt=D(Me);i(xt,()=>g(W),()=>g(P).name),Z(Ke,Me)},Ue=Ke=>{var Me=ZX(),xt=D(Me);t(xt,()=>g(q),()=>g(P).name),Z(Ke,Me)};ue(he,Ke=>{g(Ye)?Ke(Ee):g(P).filled&&g(W).length>0?Ke(rt,1):g(P).filled&&g(q).length>0&&Ke(Ue,2)})}fe(Ke=>{ce=Xe(ie,1,"cm-tree__field svelte-1d9gzqq",null,ce,{"cm-tree__field--filled":g(P).filled,"cm-tree__field--empty":!g(P).filled,"cm-tree__field--required":!g(P).optional&&!g(P).filled,"cm-tree__field--selected":s()===g(P).name}),Et(H,"d",Ke),$e(oe,g(P).name)},[()=>v(g(P).match)]),Z(L,U)}),Z(T,$)},k=T=>{var $=pn(),L=at($);Qt(L,17,()=>e.structure.zones,nn,(P,q,R)=>{var W=tV(),U=at(W);{var ie=oe=>{var z=VX();Z(oe,z)};ue(U,oe=>{R>0&&oe(ie)})}var ce=I(U,2),re=D(ce),H=D(re),ae=I(re,2);Qt(ae,21,()=>g(q).fields,nn,(oe,z)=>{const ne=ge(()=>_(g(z).nodes)),Se=ge(()=>m(g(z).match)?b(g(z).nodes):[]),Te=ge(()=>p(g(z))?O(g(z)):[]);var Le=eV(),he=at(Le);let Ee;he.__click=()=>e.onfieldselect(g(z).name,g(q).name);var Ye=D(he),rt=D(Ye),Ue=I(Ye,2),Ke=D(Ue),Me=I(Ue,2);{var xt=Lt=>{var Jt=WX();Z(Lt,Jt)};ue(Me,Lt=>{!g(z).optional&&!g(z).filled&&Lt(xt)})}var Vt=I(Me,4);{var En=Lt=>{var Jt=UX(),On=at(Jt);{var te=Ce=>{var qe=YX();qe.__click=At=>{At.stopPropagation(),e.onappenditem(g(z).name,g(q).name)},fe(()=>Et(qe,"title",`Add item to ${g(z).name??""}`)),Z(Ce,qe)},ve=ge(()=>m(g(z).match)||p(g(z)));ue(On,Ce=>{g(ve)&&Ce(te)})}var xe=I(On,2);xe.__click=Ce=>{Ce.stopPropagation(),e.onremovefield(g(z).name,g(q).name)},fe(()=>Et(xe,"title",`Remove ${g(z).name??""}`)),Z(Lt,Jt)},St=Lt=>{var Jt=GX();Jt.__click=On=>{On.stopPropagation(),e.onaddfield(g(z).name,g(q).name)},fe(()=>Et(Jt,"title",`Add ${g(z).name??""}`)),Z(Lt,Jt)};ue(Vt,Lt=>{g(z).filled?Lt(En):Lt(St,!1)})}var on=I(he,2);{var Cn=Lt=>{var Jt=HX(),On=D(Jt);r(On,()=>g(Se),()=>g(z).name,()=>g(q).name),Z(Lt,Jt)},Wt=ge(()=>g(z).filled&&m(g(z).match)&&g(Se).length>0),ke=Lt=>{var Jt=KX(),On=D(Jt);i(On,()=>g(Te),()=>g(z).name,()=>g(q).name),Z(Lt,Jt)},Tn=Lt=>{var Jt=JX(),On=D(Jt);t(On,()=>g(ne),()=>g(z).name,()=>g(q).name),Z(Lt,Jt)};ue(on,Lt=>{g(Wt)?Lt(Cn):g(z).filled&&g(Te).length>0?Lt(ke,1):g(z).filled&&g(ne).length>0&&Lt(Tn,2)})}fe(Lt=>{Ee=Xe(he,1,"cm-tree__field svelte-1d9gzqq",null,Ee,{"cm-tree__field--filled":g(z).filled,"cm-tree__field--empty":!g(z).filled,"cm-tree__field--required":!g(z).optional&&!g(z).filled,"cm-tree__field--selected":s()===`${g(q).name}.${g(z).name}`}),Et(rt,"d",Lt),$e(Ke,g(z).name)},[()=>v(g(z).match)]),Z(oe,Le)}),fe(()=>$e(H,g(q).name)),Z(P,W)}),Z(T,$)},E=T=>{var $=nV(),L=D($);fe(()=>$e(L,e.structure.description)),Z(T,$)};ue(A,T=>{e.structure.type==="sequence"?T(x):e.structure.type==="delimited"?T(k,1):(e.structure.type==="sections"||e.structure.type==="custom")&&T(E,2)})}fe(()=>$e(S,e.rootLabel)),Z(n,C),bt()}Kt(["click"]);function pe(n){return new Ya(LO.define(n))}function $s(n){return se(()=>import("./index-OcTVp32J.js"),[]).then(e=>e.sql({dialect:e[n]}))}const HC=[J.of({name:"C",extensions:["c","h","ino"],load(){return se(()=>import("./index-CHalG4dO.js"),[]).then(n=>n.cpp())}}),J.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return se(()=>import("./index-CHalG4dO.js"),[]).then(n=>n.cpp())}}),J.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return $s("Cassandra")}}),J.of({name:"CSS",extensions:["css"],load(){return se(()=>Promise.resolve().then(()=>sR),void 0).then(n=>n.css())}}),J.of({name:"Go",extensions:["go"],load(){return se(()=>import("./index-DngmtYeQ.js"),[]).then(n=>n.go())}}),J.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return se(()=>Promise.resolve().then(()=>HR),void 0).then(n=>n.html())}}),J.of({name:"Java",extensions:["java"],load(){return se(()=>import("./index-BkxyjB51.js"),[]).then(n=>n.java())}}),J.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return se(()=>Promise.resolve().then(()=>Pu),void 0).then(n=>n.javascript())}}),J.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return se(()=>import("./index-BZoTikGe.js"),[]).then(n=>n.jinja())}}),J.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return se(()=>import("./index-CaEK_xqh.js"),[]).then(n=>n.json())}}),J.of({name:"JSX",extensions:["jsx"],load(){return se(()=>Promise.resolve().then(()=>Pu),void 0).then(n=>n.javascript({jsx:!0}))}}),J.of({name:"LESS",extensions:["less"],load(){return se(()=>import("./index-f2otjTL4.js"),[]).then(n=>n.less())}}),J.of({name:"Liquid",extensions:["liquid"],load(){return se(()=>import("./index-D87tBoCu.js"),[]).then(n=>n.liquid())}}),J.of({name:"MariaDB SQL",load(){return $s("MariaSQL")}}),J.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return se(()=>Promise.resolve().then(()=>lI),void 0).then(n=>n.markdown())}}),J.of({name:"MS SQL",load(){return $s("MSSQL")}}),J.of({name:"MySQL",load(){return $s("MySQL")}}),J.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return se(()=>import("./index-BJRvKrEo.js"),[]).then(n=>n.php())}}),J.of({name:"PLSQL",extensions:["pls"],load(){return $s("PLSQL")}}),J.of({name:"PostgreSQL",load(){return $s("PostgreSQL")}}),J.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return se(()=>import("./index-BbOIDH7O.js"),[]).then(n=>n.python())}}),J.of({name:"Rust",extensions:["rs"],load(){return se(()=>import("./index-DYv6EJCx.js"),[]).then(n=>n.rust())}}),J.of({name:"Sass",extensions:["sass"],load(){return se(()=>import("./index-CJ-cmio3.js"),[]).then(n=>n.sass({indented:!0}))}}),J.of({name:"SCSS",extensions:["scss"],load(){return se(()=>import("./index-CJ-cmio3.js"),[]).then(n=>n.sass())}}),J.of({name:"SQL",extensions:["sql"],load(){return $s("StandardSQL")}}),J.of({name:"SQLite",load(){return $s("SQLite")}}),J.of({name:"TSX",extensions:["tsx"],load(){return se(()=>Promise.resolve().then(()=>Pu),void 0).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),J.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return se(()=>Promise.resolve().then(()=>Pu),void 0).then(n=>n.javascript({typescript:!0}))}}),J.of({name:"WebAssembly",extensions:["wat","wast"],load(){return se(()=>import("./index-D43YRW88.js"),[]).then(n=>n.wast())}}),J.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return se(()=>import("./index-Cv0P6B1J.js"),[]).then(n=>n.xml())}}),J.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return se(()=>import("./index-5kiRRRrE.js"),[]).then(n=>n.yaml())}}),J.of({name:"APL",extensions:["dyalog","apl"],load(){return se(()=>import("./apl-B4CMkyY2.js"),[]).then(n=>pe(n.apl))}}),J.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return se(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(n=>pe(n.asciiArmor))}}),J.of({name:"ASN.1",extensions:["asn","asn1"],load(){return se(()=>import("./asn1-EdZsLKOL.js"),[]).then(n=>pe(n.asn1({})))}}),J.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return se(()=>import("./asterisk-B-8jnY81.js"),[]).then(n=>pe(n.asterisk))}}),J.of({name:"Brainfuck",extensions:["b","bf"],load(){return se(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(n=>pe(n.brainfuck))}}),J.of({name:"Cobol",extensions:["cob","cpy"],load(){return se(()=>import("./cobol-CWcv1MsR.js"),[]).then(n=>pe(n.cobol))}}),J.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.csharp))}}),J.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return se(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>pe(n.clojure))}}),J.of({name:"ClojureScript",extensions:["cljs"],load(){return se(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>pe(n.clojure))}}),J.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return se(()=>import("./css-BnMrqG3P.js"),[]).then(n=>pe(n.gss))}}),J.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return se(()=>import("./cmake-BQqOBYOt.js"),[]).then(n=>pe(n.cmake))}}),J.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return se(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(n=>pe(n.coffeeScript))}}),J.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return se(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(n=>pe(n.commonLisp))}}),J.of({name:"Cypher",extensions:["cyp","cypher"],load(){return se(()=>import("./cypher-C_CwsFkJ.js"),[]).then(n=>pe(n.cypher))}}),J.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return se(()=>import("./python-BuPzkPfP.js"),[]).then(n=>pe(n.cython))}}),J.of({name:"Crystal",extensions:["cr"],load(){return se(()=>import("./crystal-SjHAIU92.js"),[]).then(n=>pe(n.crystal))}}),J.of({name:"D",extensions:["d"],load(){return se(()=>import("./d-pRatUO7H.js"),[]).then(n=>pe(n.d))}}),J.of({name:"Dart",extensions:["dart"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.dart))}}),J.of({name:"diff",extensions:["diff","patch"],load(){return se(()=>import("./diff-DbItnlRl.js"),[]).then(n=>pe(n.diff))}}),J.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return se(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([0,1])).then(n=>pe(n.dockerFile))}}),J.of({name:"DTD",extensions:["dtd"],load(){return se(()=>import("./dtd-DF_7sFjM.js"),[]).then(n=>pe(n.dtd))}}),J.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return se(()=>import("./dylan-DwRh75JA.js"),[]).then(n=>pe(n.dylan))}}),J.of({name:"EBNF",load(){return se(()=>import("./ebnf-CDyGwa7X.js"),[]).then(n=>pe(n.ebnf))}}),J.of({name:"ECL",extensions:["ecl"],load(){return se(()=>import("./ecl-Cabwm37j.js"),[]).then(n=>pe(n.ecl))}}),J.of({name:"edn",extensions:["edn"],load(){return se(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>pe(n.clojure))}}),J.of({name:"Eiffel",extensions:["e"],load(){return se(()=>import("./eiffel-CnydiIhH.js"),[]).then(n=>pe(n.eiffel))}}),J.of({name:"Elm",extensions:["elm"],load(){return se(()=>import("./elm-vLlmbW-K.js"),[]).then(n=>pe(n.elm))}}),J.of({name:"Erlang",extensions:["erl"],load(){return se(()=>import("./erlang-BNw1qcRV.js"),[]).then(n=>pe(n.erlang))}}),J.of({name:"Esper",load(){return se(()=>import("./sql-D0XecflT.js"),[]).then(n=>pe(n.esper))}}),J.of({name:"Factor",extensions:["factor"],load(){return se(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([2,1])).then(n=>pe(n.factor))}}),J.of({name:"FCL",load(){return se(()=>import("./fcl-Kvtd6kyn.js"),[]).then(n=>pe(n.fcl))}}),J.of({name:"Forth",extensions:["forth","fth","4th"],load(){return se(()=>import("./forth-Ffai-XNe.js"),[]).then(n=>pe(n.forth))}}),J.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return se(()=>import("./fortran-DYz_wnZ1.js"),[]).then(n=>pe(n.fortran))}}),J.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return se(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>pe(n.fSharp))}}),J.of({name:"Gas",extensions:["s"],load(){return se(()=>import("./gas-Bneqetm1.js"),[]).then(n=>pe(n.gas))}}),J.of({name:"Gherkin",extensions:["feature"],load(){return se(()=>import("./gherkin-heZmZLOM.js"),[]).then(n=>pe(n.gherkin))}}),J.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return se(()=>import("./groovy-D9Dt4D0W.js"),[]).then(n=>pe(n.groovy))}}),J.of({name:"Haskell",extensions:["hs"],load(){return se(()=>import("./haskell-Cw1EW3IL.js"),[]).then(n=>pe(n.haskell))}}),J.of({name:"Haxe",extensions:["hx"],load(){return se(()=>import("./haxe-H-WmDvRZ.js"),[]).then(n=>pe(n.haxe))}}),J.of({name:"HXML",extensions:["hxml"],load(){return se(()=>import("./haxe-H-WmDvRZ.js"),[]).then(n=>pe(n.hxml))}}),J.of({name:"HTTP",load(){return se(()=>import("./http-DBlCnlav.js"),[]).then(n=>pe(n.http))}}),J.of({name:"IDL",extensions:["pro"],load(){return se(()=>import("./idl-BEugSyMb.js"),[]).then(n=>pe(n.idl))}}),J.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return se(()=>import("./javascript-iXu5QeM3.js"),[]).then(n=>pe(n.jsonld))}}),J.of({name:"Julia",extensions:["jl"],load(){return se(()=>import("./julia-DuME0IfC.js"),[]).then(n=>pe(n.julia))}}),J.of({name:"Kotlin",extensions:["kt","kts"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.kotlin))}}),J.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return se(()=>import("./livescript-BwQOo05w.js"),[]).then(n=>pe(n.liveScript))}}),J.of({name:"Lua",extensions:["lua"],load(){return se(()=>import("./lua-BgMRiT3U.js"),[]).then(n=>pe(n.lua))}}),J.of({name:"mIRC",extensions:["mrc"],load(){return se(()=>import("./mirc-CjQqDB4T.js"),[]).then(n=>pe(n.mirc))}}),J.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return se(()=>import("./mathematica-DTrFuWx2.js"),[]).then(n=>pe(n.mathematica))}}),J.of({name:"Modelica",extensions:["mo"],load(){return se(()=>import("./modelica-Dc1JOy9r.js"),[]).then(n=>pe(n.modelica))}}),J.of({name:"MUMPS",extensions:["mps"],load(){return se(()=>import("./mumps-BT43cFF4.js"),[]).then(n=>pe(n.mumps))}}),J.of({name:"Mbox",extensions:["mbox"],load(){return se(()=>import("./mbox-CNhZ1qSd.js"),[]).then(n=>pe(n.mbox))}}),J.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return se(()=>import("./nginx-DdIZxoE0.js"),[]).then(n=>pe(n.nginx))}}),J.of({name:"NSIS",extensions:["nsh","nsi"],load(){return se(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([3,1])).then(n=>pe(n.nsis))}}),J.of({name:"NTriples",extensions:["nt","nq"],load(){return se(()=>import("./ntriples-BfvgReVJ.js"),[]).then(n=>pe(n.ntriples))}}),J.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.objectiveC))}}),J.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.objectiveCpp))}}),J.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return se(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>pe(n.oCaml))}}),J.of({name:"Octave",extensions:["m"],load(){return se(()=>import("./octave-Ck1zUtKM.js"),[]).then(n=>pe(n.octave))}}),J.of({name:"Oz",extensions:["oz"],load(){return se(()=>import("./oz-BzwKVEFT.js"),[]).then(n=>pe(n.oz))}}),J.of({name:"Pascal",extensions:["p","pas"],load(){return se(()=>import("./pascal--L3eBynH.js"),[]).then(n=>pe(n.pascal))}}),J.of({name:"Perl",extensions:["pl","pm"],load(){return se(()=>import("./perl-CdXCOZ3F.js"),[]).then(n=>pe(n.perl))}}),J.of({name:"Pig",extensions:["pig"],load(){return se(()=>import("./pig-CevX1Tat.js"),[]).then(n=>pe(n.pig))}}),J.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return se(()=>import("./powershell-CFHJl5sT.js"),[]).then(n=>pe(n.powerShell))}}),J.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return se(()=>import("./properties-C78fOPTZ.js"),[]).then(n=>pe(n.properties))}}),J.of({name:"ProtoBuf",extensions:["proto"],load(){return se(()=>import("./protobuf-ChK-085T.js"),[]).then(n=>pe(n.protobuf))}}),J.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return se(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([4,5])).then(n=>pe(n.pug))}}),J.of({name:"Puppet",extensions:["pp"],load(){return se(()=>import("./puppet-DMA9R1ak.js"),[]).then(n=>pe(n.puppet))}}),J.of({name:"Q",extensions:["q"],load(){return se(()=>import("./q-pXgVlZs6.js"),[]).then(n=>pe(n.q))}}),J.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return se(()=>import("./r-B6wPVr8A.js"),[]).then(n=>pe(n.r))}}),J.of({name:"RPM Changes",load(){return se(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>pe(n.rpmChanges))}}),J.of({name:"RPM Spec",extensions:["spec"],load(){return se(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>pe(n.rpmSpec))}}),J.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return se(()=>import("./ruby-B2Rjki9n.js"),[]).then(n=>pe(n.ruby))}}),J.of({name:"SAS",extensions:["sas"],load(){return se(()=>import("./sas-B4kiWyti.js"),[]).then(n=>pe(n.sas))}}),J.of({name:"Scala",extensions:["scala"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.scala))}}),J.of({name:"Scheme",extensions:["scm","ss"],load(){return se(()=>import("./scheme-C41bIUwD.js"),[]).then(n=>pe(n.scheme))}}),J.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return se(()=>import("./shell-CjFT_Tl9.js"),[]).then(n=>pe(n.shell))}}),J.of({name:"Sieve",extensions:["siv","sieve"],load(){return se(()=>import("./sieve-C3Gn_uJK.js"),[]).then(n=>pe(n.sieve))}}),J.of({name:"Smalltalk",extensions:["st"],load(){return se(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(n=>pe(n.smalltalk))}}),J.of({name:"Solr",load(){return se(()=>import("./solr-DehyRSwq.js"),[]).then(n=>pe(n.solr))}}),J.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return se(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>pe(n.sml))}}),J.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return se(()=>import("./sparql-DkYu6x3z.js"),[]).then(n=>pe(n.sparql))}}),J.of({name:"Spreadsheet",alias:["excel","formula"],load(){return se(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(n=>pe(n.spreadsheet))}}),J.of({name:"Squirrel",extensions:["nut"],load(){return se(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.squirrel))}}),J.of({name:"Stylus",extensions:["styl"],load(){return se(()=>import("./stylus-B533Al4x.js"),[]).then(n=>pe(n.stylus))}}),J.of({name:"Swift",extensions:["swift"],load(){return se(()=>import("./swift-BzpIVaGY.js"),[]).then(n=>pe(n.swift))}}),J.of({name:"sTeX",load(){return se(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>pe(n.stex))}}),J.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return se(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>pe(n.stex))}}),J.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return se(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>pe(n.verilog))}}),J.of({name:"Tcl",extensions:["tcl"],load(){return se(()=>import("./tcl-DVfN8rqt.js"),[]).then(n=>pe(n.tcl))}}),J.of({name:"Textile",extensions:["textile"],load(){return se(()=>import("./textile-CnDTJFAw.js"),[]).then(n=>pe(n.textile))}}),J.of({name:"TiddlyWiki",load(){return se(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(n=>pe(n.tiddlyWiki))}}),J.of({name:"Tiki wiki",load(){return se(()=>import("./tiki-DGYXhP31.js"),[]).then(n=>pe(n.tiki))}}),J.of({name:"TOML",extensions:["toml"],load(){return se(()=>import("./toml-Bm5Em-hy.js"),[]).then(n=>pe(n.toml))}}),J.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return se(()=>import("./troff-wAsdV37c.js"),[]).then(n=>pe(n.troff))}}),J.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return se(()=>import("./ttcn-CfJYG6tj.js"),[]).then(n=>pe(n.ttcn))}}),J.of({name:"TTCN_CFG",extensions:["cfg"],load(){return se(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(n=>pe(n.ttcnCfg))}}),J.of({name:"Turtle",extensions:["ttl"],load(){return se(()=>import("./turtle-B1tBg_DP.js"),[]).then(n=>pe(n.turtle))}}),J.of({name:"Web IDL",extensions:["webidl"],load(){return se(()=>import("./webidl-ZXfAyPTL.js"),[]).then(n=>pe(n.webIDL))}}),J.of({name:"VB.NET",extensions:["vb"],load(){return se(()=>import("./vb-CmGdzxic.js"),[]).then(n=>pe(n.vb))}}),J.of({name:"VBScript",extensions:["vbs"],load(){return se(()=>import("./vbscript-BuJXcnF6.js"),[]).then(n=>pe(n.vbScript))}}),J.of({name:"Velocity",extensions:["vtl"],load(){return se(()=>import("./velocity-D8B20fx6.js"),[]).then(n=>pe(n.velocity))}}),J.of({name:"Verilog",extensions:["v"],load(){return se(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>pe(n.verilog))}}),J.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return se(()=>import("./vhdl-lSbBsy5d.js"),[]).then(n=>pe(n.vhdl))}}),J.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return se(()=>import("./xquery-DzFWVndE.js"),[]).then(n=>pe(n.xQuery))}}),J.of({name:"Yacas",extensions:["ys"],load(){return se(()=>import("./yacas-BJ4BC0dw.js"),[]).then(n=>pe(n.yacas))}}),J.of({name:"Z80",extensions:["z80"],load(){return se(()=>import("./z80-Hz9HOZM7.js"),[]).then(n=>pe(n.z80))}}),J.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return se(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>pe(n.mscgen))}}),J.of({name:"Xù",extensions:["xu"],load(){return se(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>pe(n.xu))}}),J.of({name:"MsGenny",extensions:["msgenny"],load(){return se(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>pe(n.msgenny))}}),J.of({name:"Vue",extensions:["vue"],load(){return se(()=>import("./index-B24RQWJ9.js"),[]).then(n=>n.vue())}}),J.of({name:"Angular Template",load(){return se(()=>import("./index-IhvOXVhc.js"),[]).then(n=>n.angular())}})];var sV=V('<div class="inline-editor svelte-1ewoogg"></div>');function go(n,e){vt(e,!0);let t,r=K(void 0),i="";const s=new ms,o=new ms,a=new ms,l=Qe.theme({"&":{color:"#1a1a2e",fontSize:"13px",height:"auto"},".cm-scroller":{overflow:"visible",fontFamily:"'SF Mono', 'Fira Code', ui-monospace, monospace",lineHeight:"1.6"},".cm-content":{padding:"0.75rem",caretColor:"#1e293b",minHeight:"3rem"},".cm-cursor":{borderLeftColor:"#1e293b"},"&.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"rgba(14, 165, 233, 0.2)"},".cm-selectionBackground":{backgroundColor:"rgba(14, 165, 233, 0.12)"},"&.cm-focused":{outline:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-tooltip.cm-tooltip-autocomplete":{border:"1px solid #e2e8f0",borderRadius:"6px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.12)",backgroundColor:"#ffffff",overflow:"hidden"},".cm-tooltip.cm-tooltip-autocomplete ul":{fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"12px",maxHeight:"280px"},".cm-tooltip.cm-tooltip-autocomplete ul li":{padding:"4px 8px",borderBottom:"1px solid #f1f5f9"},".cm-tooltip.cm-tooltip-autocomplete ul li[aria-selected]":{backgroundColor:"#f0f9ff",color:"#0369a1"},".cm-tooltip.cm-completionInfo":{border:"1px solid #e2e8f0",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",backgroundColor:"#ffffff",padding:"6px 10px",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"12px",color:"#475569",maxWidth:"300px"},".cm-completionDetail":{color:"#94a3b8",fontStyle:"normal",marginLeft:"0.5em"},".cm-markdoc-tag":{backgroundColor:"rgba(217, 119, 6, 0.06)",borderRadius:"2px"},".cm-markdoc-bracket":{color:"#94a3b8"},".cm-markdoc-name":{color:"#d97706",fontWeight:"600"}},{dark:!1});bn(()=>{if(!t)return;const u=!!Cr(()=>e.language)?.trim(),f=qt.create({doc:Cr(()=>e.content),extensions:[s.of(Ja()),o.of(u?[]:Cc()),a.of(u?[]:Im({override:[Um(e.runes),Gm(e.runes,e.aggregated)],icons:!1})),IO(),l,gc(bA),gc(X2),fA(),Go.of([...jO,...NO,...vA,{key:"Mod-/",run:h=>(Kl(h),!0)}]),Qe.updateListener.of(h=>{h.docChanged&&(i=h.state.doc.toString(),e.onchange(i))}),Qe.lineWrapping]}),d=new Qe({state:f,parent:t});return M(r,d,!0),()=>{M(r,void 0),d.destroy()}}),bn(()=>{const u=g(r);if(!u)return;const f=e.language?.trim();if(!f){u.dispatch({effects:[s.reconfigure(Ja()),o.reconfigure(Cc()),a.reconfigure(Im({override:[Um(e.runes),Gm(e.runes,e.aggregated)],icons:!1}))]});return}u.dispatch({effects:[o.reconfigure([]),a.reconfigure([])]});const d=J.matchLanguageName(HC,f,!0);d&&d.load().then(h=>{g(r)===u&&u.dispatch({effects:s.reconfigure(h)})})}),bn(()=>{const u=e.content,f=g(r);if(!f)return;const d=f.state.doc.toString();if(u!==d){if(i&&d===i){i="";return}i="",f.dispatch({changes:{from:0,to:f.state.doc.length,insert:u}})}});var c=sV();mn(c,u=>t=u,()=>t),Z(n,c),bt()}var oV=V('<span class="edit-panel__category svelte-1t8cclf"> </span>'),aV=ks('<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="2"></circle><path d="M6.7 1.6h2.6l.4 1.8.8.4 1.7-.7 1.8 1.8-.7 1.7.4.8 1.8.4v2.6l-1.8.4-.4.8.7 1.7-1.8 1.8-1.7-.7-.8.4-.4 1.8H6.7l-.4-1.8-.8-.4-1.7.7-1.8-1.8.7-1.7-.4-.8-1.8-.4V6.7l1.8-.4.4-.8-.7-1.7 1.8-1.8 1.7.7.8-.4z"></path></svg> Settings',1),lV=ks('<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h4M2 7h4M6 11h4M6 15h4M4 3v8M8 11v4"></path></svg> Structure',1),cV=ks('<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 4h12M2 8h12M2 12h8"></path></svg> Content',1),uV=V('<button type="button"><!></button>'),fV=V('<div class="edit-panel__tabs svelte-1t8cclf"></div>'),dV=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Level</span> <select class="edit-panel__select svelte-1t8cclf"><option>H1</option><option>H2</option><option>H3</option><option>H4</option><option>H5</option><option>H6</option></select></label> <label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Text</span> <input class="edit-panel__input svelte-1t8cclf" type="text"/></label></div>'),hV=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Language</span> <input class="edit-panel__input svelte-1t8cclf" type="text" placeholder="e.g. js, python, html"/></label></div>'),pV=V('<div class="edit-panel__empty-tab svelte-1t8cclf"><span class="edit-panel__empty-tab-text svelte-1t8cclf">No settings for this element</span></div>'),mV=V('<label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf"> </span> <input class="edit-panel__input svelte-1t8cclf" type="text"/></label>'),gV=V('<div class="edit-panel__unknown svelte-1t8cclf"><span class="edit-panel__unknown-label svelte-1t8cclf"> </span> <!></div>'),OV=V('<div class="edit-panel__tab-panel svelte-1t8cclf"><!></div>'),vV=V('<div class="edit-panel__tab-panel svelte-1t8cclf"><!></div>'),bV=V('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),yV=V('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),wV=V('<div class="edit-panel__empty-tab svelte-1t8cclf"><span class="edit-panel__empty-tab-text svelte-1t8cclf">Edit heading text in Settings</span></div>'),_V=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Source</span> <textarea class="edit-panel__textarea svelte-1t8cclf"></textarea></label></div>'),kV=V('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),xV=V('<div class="edit-panel__empty-tab svelte-1t8cclf"><span class="edit-panel__empty-tab-text svelte-1t8cclf">This rune has no inner content</span></div>'),SV=V('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),AV=V('<div class="edit-panel__tab-panel svelte-1t8cclf"><!></div>'),CV=V("<!> <!> <!>",1),TV=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Level</span> <select class="edit-panel__select svelte-1t8cclf"><option>H1</option><option>H2</option><option>H3</option><option>H4</option><option>H5</option><option>H6</option></select></label> <label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Text</span> <input class="edit-panel__input svelte-1t8cclf" type="text"/></label></div>'),PV=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Language</span> <input class="edit-panel__input svelte-1t8cclf" type="text" placeholder="e.g. js, python, html"/></label></div> <div class="edit-panel__content-editor svelte-1t8cclf"><!></div>',1),EV=V('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),$V=V('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Source</span> <textarea class="edit-panel__textarea svelte-1t8cclf"></textarea></label></div>'),QV=V('<div class="edit-panel__body svelte-1t8cclf"><!></div>'),LV=V('<div class="edit-panel svelte-1t8cclf"><div class="edit-panel__top svelte-1t8cclf"><div class="edit-panel__header svelte-1t8cclf"><span class="edit-panel__type svelte-1t8cclf"> </span> <!> <div class="edit-panel__spacer svelte-1t8cclf"></div> <button class="edit-panel__btn edit-panel__btn--danger svelte-1t8cclf" title="Remove block"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 3 14 13 14 13 6"></polyline><line x1="1" y1="4" x2="15" y2="4"></line><line x1="6" y1="2" x2="10" y2="2"></line><line x1="6" y1="8" x2="6" y2="12"></line><line x1="10" y1="8" x2="10" y2="12"></line></svg></button> <button class="edit-panel__btn svelte-1t8cclf" title="Close panel">×</button></div> <!></div> <!></div>');function MV(n,e){vt(e,!0);let t=Pt(e,"aggregated",19,()=>({})),r=Pt(e,"initialRuneIndex",3,null),i=ge(()=>Ov(e.block)),s=ge(()=>e.block.type==="rune"?e.runeMap.get(e.block.runeName)??null:null),o=ge(()=>g(s)?.category??null),a=K(sn([])),l=ge(()=>{if(e.block.type!=="rune")return[];const te=e.block;return te.selfClosing||!te.innerContent.trim()?[]:mv(te.innerContent)}),c=ge(()=>g(l).some(te=>te.type==="rune")),u=ge(()=>g(v)?.type==="rune"&&g(b)?g(b):g(s)),f=ge(()=>g(v)?.type==="rune"&&g(v).children?g(v).children:g(l)),d=ge(()=>g(u)?.contentModel!=null),h=ge(()=>g(u)?.contentModel?pX(g(f),g(u).contentModel):null),m=K(null);function p(te,ve){let xe=0;function Ce(qe,At){for(let ht=0;ht<qe.length;ht++)if(qe[ht].type==="rune"){if(xe===ve)return[...At,ht];xe++;const Je=Ce(qe[ht].children??[],[...At,ht]);if(Je)return Je}return null}return Ce(te,[])}bn(()=>{if(r()!=null&&g(l).length>0){const te=p(g(l),r());te&&M(a,te,!0)}});function O(te,ve){if(ve.length===0)return null;const[xe,...Ce]=ve,qe=te[xe];return qe?Ce.length===0?qe:O(qe.children??[],Ce):null}let v=ge(()=>O(g(l),g(a))),b=ge(()=>g(v)?.runeName?e.runeMap.get(g(v).runeName)??null:null),_=ge(()=>g(v)!=null&&g(v).type!=="rune"),C=ge(()=>g(v)?g(v).type==="rune"?g(v).runeName??g(i):g(v).type:g(i)),w=K("settings"),y=ge(()=>{if(e.block.type!=="rune")return[];const te=e.block,ve=["settings"];return(g(d)||!g(v)&&g(c))&&ve.push("structure"),te.selfClosing||ve.push("content"),ve});bn(()=>{g(w)==="structure"&&!g(y).includes("structure")&&M(w,"settings")});function S(te){M(a,te,!0);const ve=O(g(l),te);ve&&ve.type!=="rune"&&M(w,"content")}function A(){M(a,[],!0)}function x(te,ve){M(m,ve?`${ve}.${te}`:te,!0)}function k(te){const ve=e.block;if(g(v)?.type==="rune"&&g(v).innerContent!==void 0){const xe=te(g(v).innerContent);if(xe===g(v).innerContent)return;const Ce=df(g(v).attributes??{}),qe=xe.trim(),At=qe?`{% ${g(v).runeName}${Ce} %}
|
|
576
576
|
${qe}
|
|
577
577
|
{% /${g(v).runeName} %}`:`{% ${g(v).runeName}${Ce} %}
|
|
578
578
|
|
|
@@ -589,13 +589,13 @@ ${Ce}
|
|
|
589
589
|
${ve}
|
|
590
590
|
\`\`\``)}function rt(te){if(!g(v))return;const ve=g(v).fenceLanguage??"";Le(`\`\`\`${ve}
|
|
591
591
|
${te}
|
|
592
|
-
\`\`\``)}function Ue(te){Le(te)}var Ke=
|
|
593
|
-
`).length)]),Z(j,Pe)};ue(jt,j=>{g(v).type==="fence"?j(en):g(v).type==="paragraph"?j(cn,1):g(v).type==="heading"?j(tn,2):j(_t,!1)})}Z(tt,Ve)},_e=tt=>{var Ve=pn(),jt=at(Ve);{var en=tn=>{var _t=
|
|
594
|
-
`).length)]),Z(Je,Ct)};ue(xe,Je=>{e.block.type==="heading"?Je(Ce):e.block.type==="fence"?Je(qe,1):e.block.type==="paragraph"?Je(At,2):Je(ht,!1)})}Z(te,ve)};ue(Lt,te=>{e.block.type==="rune"?te(Jt):te(On,!1)})}fe(()=>$e(En,g(C))),Z(n,Ke),bt()}Kt(["click","change","input"]);var
|
|
592
|
+
\`\`\``)}function Ue(te){Le(te)}var Ke=LV(),Me=D(Ke),xt=D(Me),Vt=D(xt),En=D(Vt),St=I(Vt,2);{var on=te=>{var ve=oV(),xe=D(ve);fe(()=>$e(xe,g(o))),Z(te,ve)};ue(St,te=>{!g(_)&&g(o)&&te(on)})}var Cn=I(St,4);Cn.__click=function(...te){e.onremove?.apply(this,te)};var Wt=I(Cn,2);Wt.__click=function(...te){e.onclose?.apply(this,te)};var ke=I(xt,2);{var Tn=te=>{var ve=fV();Qt(ve,21,()=>g(y),nn,(xe,Ce)=>{var qe=uV();let At;qe.__click=()=>M(w,g(Ce),!0);var ht=D(qe);{var Je=lt=>{var yt=aV();Z(lt,yt)},Ct=lt=>{var yt=lV();Z(lt,yt)},mt=lt=>{var yt=cV();Z(lt,yt)};ue(ht,lt=>{g(Ce)==="settings"?lt(Je):g(Ce)==="structure"?lt(Ct,1):g(Ce)==="content"&<(mt,2)})}fe(()=>At=Xe(qe,1,"edit-panel__tab svelte-1t8cclf",null,At,{active:g(w)===g(Ce)})),Z(xe,qe)}),Z(te,ve)};ue(ke,te=>{e.block.type==="rune"&&g(y).length>1&&te(Tn)})}var Lt=I(Me,2);{var Jt=te=>{const ve=ge(()=>e.block);var xe=CV(),Ce=at(xe);{var qe=mt=>{var lt=OV(),yt=D(lt);{var Oe=tt=>{var Ve=pn(),jt=at(Ve);{var en=_t=>{var j=dV(),Pe=D(j),Yt=I(D(Pe),2);Yt.__change=mr=>he(Number(mr.target.value));var dn=D(Yt);dn.value=dn.__value="1";var Ge=I(dn);Ge.value=Ge.__value="2";var pr=I(Ge);pr.value=pr.__value="3";var Ei=I(pr);Ei.value=Ei.__value="4";var Nn=I(Ei);Nn.value=Nn.__value="5";var Gi=I(Nn);Gi.value=Gi.__value="6";var Bn;_f(Yt);var Ss=I(Pe,2),Hi=I(D(Ss),2);Hi.__input=mr=>Ee(mr.target.value),fe(mr=>{Bn!==(Bn=mr)&&(Yt.value=(Yt.__value=mr)??"",ic(Yt,mr)),fn(Hi,g(v).headingText??"")},[()=>String(g(v).headingLevel??1)]),Z(_t,j)},cn=_t=>{var j=hV(),Pe=D(j),Yt=I(D(Pe),2);Yt.__input=dn=>Ye(dn.target.value),fe(()=>fn(Yt,g(v).fenceLanguage??"")),Z(_t,j)},tn=_t=>{var j=pV();Z(_t,j)};ue(jt,_t=>{g(v).type==="heading"?_t(en):g(v).type==="fence"?_t(cn,1):_t(tn,!1)})}Z(tt,Ve)},_e=tt=>{{let Ve=ge(()=>g(v).attributes??{});gw(tt,{get runeInfo(){return g(b)},get attributes(){return g(Ve)},onchange:oe})}},Be=tt=>{var Ve=pn(),jt=at(Ve);{var en=tn=>{gw(tn,{get runeInfo(){return g(s)},get attributes(){return g(ve).attributes},onchange:H})},cn=tn=>{var _t=gV(),j=D(_t),Pe=D(j),Yt=I(j,2);Qt(Yt,17,()=>Object.entries(g(ve).attributes),nn,(dn,Ge)=>{var pr=ge(()=>Dc(g(Ge),2));let Ei=()=>g(pr)[0],Nn=()=>g(pr)[1];var Gi=mV(),Bn=D(Gi),Ss=D(Bn),Hi=I(Bn,2);Hi.__input=mr=>{const G={...g(ve).attributes,[Ei()]:mr.target.value};H(G)},fe(()=>{$e(Ss,Ei()),fn(Hi,Nn())}),Z(dn,Gi)}),fe(()=>$e(Pe,`Unknown rune: ${g(ve).runeName??""}`)),Z(tn,_t)};ue(jt,tn=>{g(s)?tn(en):tn(cn,!1)})}Z(tt,Ve)};ue(yt,tt=>{g(_)&&g(v)?tt(Oe):g(v)&&g(b)?tt(_e,1):g(v)||tt(Be,2)})}Z(mt,lt)};ue(Ce,mt=>{g(w)==="settings"&&mt(qe)})}var At=I(Ce,2);{var ht=mt=>{var lt=vV(),yt=D(lt);{var Oe=Be=>{{let tt=ge(()=>g(v)?.runeName??g(ve).runeName);iV(Be,{get structure(){return g(h)},get rootLabel(){return g(tt)},onaddfield:E,onremovefield:T,onappenditem:P,onremovelistitem:q,onreorderlistitem:R,oneditfield:W,oneditlistitem:U,onnavigaterune:ie,onfieldselect:x,get selectedField(){return g(m)}})}},_e=Be=>{{let tt=ge(()=>g(a).length===0);GC(Be,{get nodes(){return g(l)},get activePath(){return g(a)},onselect:S,get rootLabel(){return g(ve).runeName},onrootclick:A,get isRootActive(){return g(tt)}})}};ue(yt,Be=>{g(d)&&g(h)?Be(Oe):!g(v)&&g(c)&&Be(_e,1)})}Z(mt,lt)};ue(At,mt=>{g(w)==="structure"&&mt(ht)})}var Je=I(At,2);{var Ct=mt=>{var lt=AV(),yt=D(lt);{var Oe=tt=>{var Ve=pn(),jt=at(Ve);{var en=j=>{var Pe=bV(),Yt=D(Pe);{let dn=ge(()=>g(v).fenceCode??"");go(Yt,{get content(){return g(dn)},onchange:rt,get language(){return g(v).fenceLanguage},get runes(){return e.runes},aggregated:()=>t()})}Z(j,Pe)},cn=j=>{var Pe=yV(),Yt=D(Pe);go(Yt,{get content(){return g(v).source},onchange:Ue,get runes(){return e.runes},aggregated:()=>t()}),Z(j,Pe)},tn=j=>{var Pe=wV();Z(j,Pe)},_t=j=>{var Pe=_V(),Yt=D(Pe),dn=I(D(Yt),2);dn.__input=Ge=>Ue(Ge.target.value),fe(Ge=>{fn(dn,g(v).source),Et(dn,"rows",Ge)},[()=>Math.max(4,g(v).source.split(`
|
|
593
|
+
`).length)]),Z(j,Pe)};ue(jt,j=>{g(v).type==="fence"?j(en):g(v).type==="paragraph"?j(cn,1):g(v).type==="heading"?j(tn,2):j(_t,!1)})}Z(tt,Ve)},_e=tt=>{var Ve=pn(),jt=at(Ve);{var en=tn=>{var _t=kV(),j=D(_t);go(j,{get content(){return g(v).innerContent},onchange:z,get runes(){return e.runes},aggregated:()=>t()}),Z(tn,_t)},cn=tn=>{var _t=xV();Z(tn,_t)};ue(jt,tn=>{!g(v).selfClosing&&g(v).innerContent!==void 0?tn(en):tn(cn,!1)})}Z(tt,Ve)},Be=tt=>{var Ve=SV(),jt=D(Ve);go(jt,{get content(){return g(ve).innerContent},onchange:ae,get runes(){return e.runes},aggregated:()=>t()}),Z(tt,Ve)};ue(yt,tt=>{g(_)&&g(v)?tt(Oe):g(v)&&g(b)?tt(_e,1):g(v)||tt(Be,2)})}Z(mt,lt)};ue(Je,mt=>{g(w)==="content"&&!g(ve).selfClosing&&mt(Ct)})}Z(te,xe)},On=te=>{var ve=QV(),xe=D(ve);{var Ce=Je=>{const Ct=ge(()=>e.block);var mt=TV(),lt=D(mt),yt=I(D(lt),2);yt.__change=_t=>re(Number(_t.target.value));var Oe=D(yt);Oe.value=Oe.__value="1";var _e=I(Oe);_e.value=_e.__value="2";var Be=I(_e);Be.value=Be.__value="3";var tt=I(Be);tt.value=tt.__value="4";var Ve=I(tt);Ve.value=Ve.__value="5";var jt=I(Ve);jt.value=jt.__value="6";var en;_f(yt);var cn=I(lt,2),tn=I(D(cn),2);tn.__input=_t=>ce(_t.target.value),fe(_t=>{en!==(en=_t)&&(yt.value=(yt.__value=_t)??"",ic(yt,_t)),fn(tn,g(Ct).text)},[()=>String(g(Ct).level)]),Z(Je,mt)},qe=Je=>{const Ct=ge(()=>e.block);var mt=PV(),lt=at(mt),yt=D(lt),Oe=I(D(yt),2);Oe.__input=tt=>Se(tt.target.value);var _e=I(lt,2),Be=D(_e);go(Be,{get content(){return g(Ct).code},onchange:ne,get language(){return g(Ct).language},get runes(){return e.runes},aggregated:()=>t()}),fe(()=>fn(Oe,g(Ct).language)),Z(Je,mt)},At=Je=>{var Ct=EV(),mt=D(Ct);go(mt,{get content(){return e.block.source},onchange:Te,get runes(){return e.runes},aggregated:()=>t()}),Z(Je,Ct)},ht=Je=>{var Ct=$V(),mt=D(Ct),lt=I(D(mt),2);lt.__input=yt=>Te(yt.target.value),fe(yt=>{fn(lt,e.block.source),Et(lt,"rows",yt)},[()=>Math.max(4,e.block.source.split(`
|
|
594
|
+
`).length)]),Z(Je,Ct)};ue(xe,Je=>{e.block.type==="heading"?Je(Ce):e.block.type==="fence"?Je(qe,1):e.block.type==="paragraph"?Je(At,2):Je(ht,!1)})}Z(te,ve)};ue(Lt,te=>{e.block.type==="rune"?te(Jt):te(On,!1)})}fe(()=>$e(En,g(C))),Z(n,Ke),bt()}Kt(["click","change","input"]);var qV=V('<div draggable="true"><span class="structure-item__drag svelte-1lv3l5p" title="Drag to reorder"><svg width="8" height="12" viewBox="0 0 8 12" fill="currentColor"><circle cx="2" cy="2" r="1"></circle><circle cx="6" cy="2" r="1"></circle><circle cx="2" cy="6" r="1"></circle><circle cx="6" cy="6" r="1"></circle><circle cx="2" cy="10" r="1"></circle><circle cx="6" cy="10" r="1"></circle></svg></span> <span class="structure-item__icon svelte-1lv3l5p"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><!></svg></span> <span class="structure-item__info svelte-1lv3l5p"><span class="structure-item__type svelte-1lv3l5p"> </span> <span class="structure-item__preview svelte-1lv3l5p"> </span></span> <button class="structure-item__remove svelte-1lv3l5p" title="Remove"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="4" x2="12" y2="12"></line><line x1="12" y1="4" x2="4" y2="12"></line></svg></button></div>'),DV=V('<div class="edit-panel__tab-panel svelte-1lv3l5p"><div class="structure-list svelte-1lv3l5p"></div></div>'),RV=V('<div class="edit-panel__tab-panel svelte-1lv3l5p"><div class="edit-panel__content-editor svelte-1lv3l5p"><!></div></div>'),IV=V('<div class="edit-panel svelte-1lv3l5p"><div class="edit-panel__top svelte-1lv3l5p"><div class="edit-panel__header svelte-1lv3l5p"><span class="edit-panel__type svelte-1lv3l5p">prose</span> <span class="edit-panel__count svelte-1lv3l5p"> </span> <div class="edit-panel__spacer svelte-1lv3l5p"></div> <button class="edit-panel__btn edit-panel__btn--danger svelte-1lv3l5p" title="Remove block"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 3 14 13 14 13 6"></polyline><line x1="1" y1="4" x2="15" y2="4"></line><line x1="6" y1="2" x2="10" y2="2"></line><line x1="6" y1="8" x2="6" y2="12"></line><line x1="10" y1="8" x2="10" y2="12"></line></svg></button> <button class="edit-panel__btn svelte-1lv3l5p" title="Close panel">×</button></div> <div class="edit-panel__tabs svelte-1lv3l5p"><button type="button"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h4M2 7h4M6 11h4M6 15h4M4 3v8M8 11v4"></path></svg> Structure</button> <button type="button"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 4h12M2 8h12M2 12h8"></path></svg> Content</button></div></div> <!> <!></div>');function NV(n,e){vt(e,!0);let t=Pt(e,"aggregated",19,()=>({})),r=K("structure");function i(P){switch(P.type){case"heading":return P.text;case"paragraph":return P.source.length>60?P.source.slice(0,60)+"...":P.source;case"fence":{const q=P,R=q.language?`${q.language}: `:"",W=q.code.split(`
|
|
595
595
|
`)[0]??"";return R+(W.length>50?W.slice(0,50)+"...":W)}case"list":return P.source.split(`
|
|
596
596
|
`)[0]??"";case"quote":return P.source.replace(/^>\s*/gm,"").split(`
|
|
597
597
|
`)[0]??"";case"hr":return"---";case"image":return P.source;default:return P.source.split(`
|
|
598
|
-
`)[0]??""}}function s(P){switch(P.type){case"heading":return'<path d="M3 3v10M13 3v10M3 8h10" />';case"paragraph":return'<path d="M2 4h12M2 8h12M2 12h8" />';case"fence":return'<polyline points="4 6 1 9 4 12" /><polyline points="12 6 15 9 12 12" />';case"list":return'<circle cx="3" cy="4" r="1" fill="currentColor" /><line x1="6" y1="4" x2="14" y2="4" /><circle cx="3" cy="8" r="1" fill="currentColor" /><line x1="6" y1="8" x2="14" y2="8" /><circle cx="3" cy="12" r="1" fill="currentColor" /><line x1="6" y1="12" x2="14" y2="12" />';case"quote":return'<path d="M3 5h10M5 5v8M5 9h6" />';case"hr":return'<line x1="2" y1="8" x2="14" y2="8" />';case"image":return'<rect x="2" y="2" width="12" height="12" rx="1" /><circle cx="5.5" cy="5.5" r="1.5" /><path d="M14 10l-3-3-5 5" />';default:return'<path d="M2 4h12M2 8h12M2 12h8" />'}}let o=K(null),a=K(null);function l(P,q){M(o,q,!0),P.dataTransfer&&(P.dataTransfer.effectAllowed="move",P.dataTransfer.setData("text/plain",String(q)))}function c(P,q){P.preventDefault(),P.dataTransfer&&(P.dataTransfer.dropEffect="move"),M(a,q,!0)}function u(P,q){P.preventDefault(),g(o)!==null&&g(o)!==q&&d(g(o),q),M(o,null),M(a,null)}function f(){M(o,null),M(a,null)}function d(P,q){const R=[...e.block.children],[W]=R.splice(P,1);R.splice(q,0,W);const U=Hm(R);e.onupdate({...e.block,children:R,source:U})}function h(P){const q=e.block.children.filter((W,U)=>U!==P);if(q.length===0){e.onremove();return}const R=Hm(q);e.onupdate({...e.block,children:q,source:R})}function m(P){if(!P.trim()){e.onremove();return}const q=_A(P);e.onupdate({...e.block,children:q,source:P})}var p=RV(),O=D(p),v=D(O),b=I(D(v),2),_=D(b),C=I(b,4);C.__click=function(...P){e.onremove?.apply(this,P)};var w=I(C,2);w.__click=function(...P){e.onclose?.apply(this,P)};var y=I(v,2),S=D(y);let A;S.__click=()=>M(r,"structure");var x=I(S,2);let k;x.__click=()=>M(r,"content");var E=I(O,2);{var T=P=>{var q=qV(),R=D(q);Qt(R,23,()=>e.block.children,W=>W.id,(W,U,ie)=>{var ce=MV();let re;var H=I(D(ce),2),ae=D(H),oe=D(ae);u_(oe,()=>s(g(U)),!0);var z=I(H,2),ne=D(z),Se=D(ne),Te=I(ne,2),Le=D(Te),he=I(z,2);he.__click=()=>h(g(ie)),fe((Ee,Ye)=>{re=Xe(ce,1,"structure-item svelte-1lv3l5p",null,re,{"drag-source":g(o)===g(ie),"drag-over":g(a)===g(ie)&&g(o)!==g(ie)}),$e(Se,Ee),$e(Le,Ye)},[()=>Ov(g(U)),()=>i(g(U))]),ft("dragstart",ce,Ee=>l(Ee,g(ie))),ft("dragover",ce,Ee=>c(Ee,g(ie))),ft("drop",ce,Ee=>u(Ee,g(ie))),ft("dragend",ce,f),Z(W,ce)}),Z(P,q)};ue(E,P=>{g(r)==="structure"&&P(T)})}var $=I(E,2);{var L=P=>{var q=DV(),R=D(q),W=D(R);go(W,{get content(){return e.block.source},onchange:m,get runes(){return e.runes},aggregated:()=>t()}),Z(P,q)};ue($,P=>{g(r)==="content"&&P(L)})}fe(()=>{$e(_,`${e.block.children.length??""} block${e.block.children.length!==1?"s":""}`),A=Xe(S,1,"edit-panel__tab svelte-1lv3l5p",null,A,{active:g(r)==="structure"}),k=Xe(x,1,"edit-panel__tab svelte-1lv3l5p",null,k,{active:g(r)==="content"})}),Z(n,p),bt()}Kt(["click"]);var NV=V('<div class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w"> </span> <div class="edit-panel__custom-row svelte-1wxsk8w"><input class="edit-panel__input svelte-1wxsk8w" type="text"/> <button class="edit-panel__remove-btn svelte-1wxsk8w">×</button></div></div>'),BV=V('<div class="edit-panel__custom-section svelte-1wxsk8w"><span class="edit-panel__section-label svelte-1wxsk8w">Custom fields</span> <!></div>'),jV=V('<div class="edit-panel svelte-1wxsk8w"><div class="edit-panel__header svelte-1wxsk8w"><span class="edit-panel__type svelte-1wxsk8w">Frontmatter</span> <div class="edit-panel__spacer svelte-1wxsk8w"></div> <button class="edit-panel__btn svelte-1wxsk8w" title="Close panel">×</button></div> <div class="edit-panel__body svelte-1wxsk8w"><div class="edit-panel__field-group svelte-1wxsk8w"><label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Title</span> <input class="edit-panel__input svelte-1wxsk8w" type="text"/></label> <label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Description</span> <textarea class="edit-panel__textarea svelte-1wxsk8w"></textarea></label> <label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Slug</span> <input class="edit-panel__input svelte-1wxsk8w" type="text" placeholder="auto-derived from filename"/></label> <div class="edit-panel__row svelte-1wxsk8w"><label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Author</span> <input class="edit-panel__input svelte-1wxsk8w" type="text"/></label> <label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Date</span> <input class="edit-panel__input svelte-1wxsk8w" type="date"/></label></div> <div class="edit-panel__row svelte-1wxsk8w"><label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Order</span> <input class="edit-panel__input svelte-1wxsk8w" type="number"/></label> <div class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Draft</span> <div role="switch" tabindex="0"><div class="fm-toggle__track svelte-1wxsk8w"><div class="fm-toggle__thumb svelte-1wxsk8w"></div></div> <span class="fm-toggle__label svelte-1wxsk8w"> </span></div></div></div> <div class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Tags</span> <!></div> <!> <div class="edit-panel__add-field svelte-1wxsk8w"><input class="edit-panel__input svelte-1wxsk8w" type="text" placeholder="Field name"/> <button class="edit-panel__add-btn svelte-1wxsk8w">+ Add field</button></div></div></div></div>');function zV(n,e){vt(e,!0);const t=new Set(["title","description","tags","draft","order","date","author","slug"]);let r=K(""),i=ge(()=>Object.entries(F.frontmatter).filter(([H])=>!t.has(H)));function s(H,ae){F.updateFrontmatterField(H,ae)}function o(){const H=g(r).trim();!H||H in F.frontmatter||(F.updateFrontmatterField(H,""),M(r,""))}function a(H){F.updateFrontmatterField(H,void 0)}var l=jV(),c=D(l),u=I(D(c),4);u.__click=function(...H){e.onclose?.apply(this,H)};var f=I(c,2),d=D(f),h=D(d),m=I(D(h),2);m.__input=H=>s("title",H.target.value);var p=I(h,2),O=I(D(p),2);O.__input=H=>s("description",H.target.value),Et(O,"rows",2);var v=I(p,2),b=I(D(v),2);b.__input=H=>s("slug",H.target.value);var _=I(v,2),C=D(_),w=I(D(C),2);w.__input=H=>s("author",H.target.value);var y=I(C,2),S=I(D(y),2);S.__input=H=>s("date",H.target.value);var A=I(_,2),x=D(A),k=I(D(x),2);k.__input=H=>{const ae=H.target.value;s("order",ae===""?void 0:Number(ae))};var E=I(x,2),T=I(D(E),2);let $;T.__click=()=>s("draft",F.frontmatter.draft===!0?void 0:!0),T.__keydown=H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),s("draft",F.frontmatter.draft===!0?void 0:!0))};var L=I(D(T),2),P=D(L),q=I(A,2),R=I(D(q),2);{let H=ge(()=>F.frontmatter.tags??[]);ck(R,{get tags(){return g(H)},onchange:ae=>s("tags",ae)})}var W=I(q,2);{var U=H=>{var ae=BV(),oe=I(D(ae),2);Qt(oe,17,()=>g(i),nn,(z,ne)=>{var Se=ge(()=>Dc(g(ne),2));let Te=()=>g(Se)[0],Le=()=>g(Se)[1];var he=NV(),Ee=D(he),Ye=D(Ee),rt=I(Ee,2),Ue=D(rt);Ue.__input=Me=>s(Te(),Me.target.value);var Ke=I(Ue,2);Ke.__click=()=>a(Te()),fe(Me=>{$e(Ye,Te()),fn(Ue,Me),Et(Ke,"aria-label",`Remove ${Te()??""}`)},[()=>String(Le()??"")]),Z(z,he)}),Z(H,ae)};ue(W,H=>{g(i).length>0&&H(U)})}var ie=I(W,2),ce=D(ie);ce.__keydown=H=>{H.key==="Enter"&&(H.preventDefault(),o())};var re=I(ce,2);re.__click=o,fe(H=>{fn(m,F.frontmatter.title??""),fn(O,F.frontmatter.description??""),fn(b,F.frontmatter.slug??""),fn(w,F.frontmatter.author??""),fn(S,F.frontmatter.date??""),fn(k,F.frontmatter.order??""),$=Xe(T,1,"fm-toggle svelte-1wxsk8w",null,$,{active:F.frontmatter.draft===!0}),Et(T,"aria-checked",F.frontmatter.draft===!0),$e(P,F.frontmatter.draft===!0?"Draft":"Published"),re.disabled=H},[()=>!g(r).trim()]),Rn(ce,()=>g(r),H=>M(r,H)),Z(n,l),bt()}Kt(["click","input","keydown"]);var ZV=V('<button type="button"> </button>'),FV=V('<div class="insert-dialog__tabs svelte-gvk8wi"></div>'),XV=V('<div class="insert-dialog__empty svelte-gvk8wi"> </div>'),VV=V('<span class="insert-dialog__rune-desc svelte-gvk8wi"> </span>'),WV=V('<button class="insert-dialog__btn insert-dialog__btn--rune svelte-gvk8wi"><span class="insert-dialog__rune-dot svelte-gvk8wi"></span> <span class="insert-dialog__rune-info svelte-gvk8wi"><span class="insert-dialog__rune-name svelte-gvk8wi"> </span> <!></span></button>'),YV=V('<div class="insert-dialog__grid svelte-gvk8wi"></div>'),UV=V('<button class="insert-dialog__btn svelte-gvk8wi"><svg class="insert-dialog__btn-icon svelte-gvk8wi" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="insert-dialog__btn-info svelte-gvk8wi"><span class="insert-dialog__btn-name svelte-gvk8wi"> </span> <span class="insert-dialog__btn-desc svelte-gvk8wi"> </span></span></button>'),GV=V('<span class="insert-dialog__rune-desc svelte-gvk8wi"> </span>'),HV=V('<button class="insert-dialog__btn insert-dialog__btn--rune svelte-gvk8wi"><span class="insert-dialog__rune-dot svelte-gvk8wi"></span> <span class="insert-dialog__rune-info svelte-gvk8wi"><span class="insert-dialog__rune-name svelte-gvk8wi"> </span> <!></span></button>'),KV=V('<div class="insert-dialog__grid svelte-gvk8wi"><!> <!></div>'),JV=V('<dialog class="insert-dialog svelte-gvk8wi"><div class="insert-dialog__inner svelte-gvk8wi"><div class="insert-dialog__header svelte-gvk8wi"><h2 class="insert-dialog__title svelte-gvk8wi">Insert Block</h2> <div class="insert-dialog__search-wrap svelte-gvk8wi"><svg class="insert-dialog__search-icon svelte-gvk8wi" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="7" cy="7" r="4.5"></circle><path d="M10.5 10.5L14 14"></path></svg> <input class="insert-dialog__search svelte-gvk8wi" type="text" placeholder="Search blocks..."/></div> <button class="insert-dialog__close svelte-gvk8wi"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M4 4l8 8M12 4l-8 8"></path></svg></button></div> <!> <div class="insert-dialog__body svelte-gvk8wi"><!></div></div></dialog>');function eW(n,e){vt(e,!0);const t=["Content","Section","Layout","Code & Data","Semantic","Design","Site"];let r=K("Content"),i=K(""),s,o,a=ge(()=>{const x=new Set(e.runesByCategory.keys()),k=t.filter(E=>x.has(E));for(const E of x)k.includes(E)||k.push(E);return k}),l=ge(()=>{if(!g(i).trim())return null;const x=g(i).toLowerCase();return e.runes.filter(k=>k.name.toLowerCase().includes(x)||k.description&&k.description.toLowerCase().includes(x))});const c=[{type:"heading",name:"Heading",description:"Section heading",icon:"M3 3v10M13 3v10M3 8h10"},{type:"paragraph",name:"Paragraph",description:"Body text",icon:"M2 4h12M2 8h12M2 12h8"},{type:"fence",name:"Code Block",description:"Fenced code",icon:"M5 4L2 8l3 4M11 4l3 4-3 4"},{type:"hr",name:"Divider",description:"Horizontal rule",icon:"M2 8h12"}];bn(()=>{s?.showModal(),o?.focus()});function u(x){x.target===s&&e.onclose()}function f(x){e.oninsert(x)}function d(x){e.oninsert("rune",x)}var h=JV();h.__click=u,h.__keydown=x=>{x.key==="Escape"&&(x.preventDefault(),e.onclose())};var m=D(h),p=D(m),O=I(D(p),2),v=I(D(O),2);mn(v,x=>o=x,()=>o);var b=I(O,2);b.__click=function(...x){e.onclose?.apply(this,x)};var _=I(p,2);{var C=x=>{var k=FV();Qt(k,21,()=>g(a),nn,(E,T)=>{var $=ZV();let L;$.__click=()=>M(r,g(T),!0);var P=D($);fe(()=>{L=Xe($,1,"insert-dialog__tab svelte-gvk8wi",null,L,{active:g(r)===g(T)}),$e(P,g(T))}),Z(E,$)}),Z(x,k)};ue(_,x=>{g(l)||x(C)})}var w=I(_,2),y=D(w);{var S=x=>{var k=pn(),E=at(k);{var T=L=>{var P=XV(),q=D(P);fe(()=>$e(q,`No blocks match "${g(i)??""}"`)),Z(L,P)},$=L=>{var P=YV();Qt(P,21,()=>g(l),nn,(q,R)=>{var W=WV();W.__click=()=>d(g(R).name);var U=I(D(W),2),ie=D(U),ce=D(ie),re=I(ie,2);{var H=ae=>{var oe=VV(),z=D(oe);fe(()=>$e(z,g(R).description)),Z(ae,oe)};ue(re,ae=>{g(R).description&&ae(H)})}fe(()=>$e(ce,g(R).name)),Z(q,W)}),Z(L,P)};ue(E,L=>{g(l).length===0?L(T):L($,!1)})}Z(x,k)},A=x=>{var k=KV(),E=D(k);{var T=L=>{var P=pn(),q=at(P);Qt(q,17,()=>c,nn,(R,W)=>{var U=UV();U.__click=()=>f(g(W).type);var ie=D(U),ce=D(ie),re=I(ie,2),H=D(re),ae=D(H),oe=I(H,2),z=D(oe);fe(()=>{Et(ce,"d",g(W).icon),$e(ae,g(W).name),$e(z,g(W).description)}),Z(R,U)}),Z(L,P)};ue(E,L=>{g(r)==="Content"&&L(T)})}var $=I(E,2);Qt($,17,()=>e.runesByCategory.get(g(r))??[],nn,(L,P)=>{var q=HV();q.__click=()=>d(g(P).name);var R=I(D(q),2),W=D(R),U=D(W),ie=I(W,2);{var ce=re=>{var H=GV(),ae=D(H);fe(()=>$e(ae,g(P).description)),Z(re,H)};ue(ie,re=>{g(P).description&&re(ce)})}fe(()=>$e(U,g(P).name)),Z(L,q)}),Z(x,k)};ue(y,x=>{g(l)?x(S):x(A,!1)})}mn(h,x=>s=x,()=>s),ft("close",h,function(...x){e.onclose?.apply(this,x)}),Rn(v,()=>g(i),x=>M(i,x)),Z(n,h),bt()}Kt(["click","keydown"]);var tW=V('<div class="inline-edit-popover__link-editor svelte-1c50n5q"><div class="inline-edit-popover__link-row svelte-1c50n5q"><label class="inline-edit-popover__link-label svelte-1c50n5q">Text</label> <input class="inline-edit-popover__link-input svelte-1c50n5q" type="text"/></div> <div class="inline-edit-popover__link-row svelte-1c50n5q"><label class="inline-edit-popover__link-label svelte-1c50n5q">URL</label> <input class="inline-edit-popover__link-input svelte-1c50n5q" type="text" placeholder="https://..."/></div> <div class="inline-edit-popover__link-actions svelte-1c50n5q"><button class="inline-edit-popover__link-btn inline-edit-popover__link-btn--apply svelte-1c50n5q">Apply</button> <button class="inline-edit-popover__link-btn inline-edit-popover__link-btn--remove svelte-1c50n5q">Remove link</button></div></div>'),nW=V('<div><div class="inline-edit-popover__header svelte-1c50n5q"><span class="inline-edit-popover__label svelte-1c50n5q"> </span> <button class="inline-edit-popover__close svelte-1c50n5q" aria-label="Close">×</button></div> <div class="inline-edit-popover__toolbar svelte-1c50n5q"><button title="Bold (Ctrl+B)"><strong>B</strong></button> <button title="Italic (Ctrl+I)"><em>I</em></button> <button title="Inline code"></></button> <button class="inline-edit-popover__tool-btn svelte-1c50n5q" title="Link (Ctrl+K)"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 9.5a3 3 0 0 0 4.2.3l2-2a3 3 0 0 0-4.2-4.3l-1.1 1.1"></path><path d="M9.5 6.5a3 3 0 0 0-4.2-.3l-2 2a3 3 0 0 0 4.2 4.3l1.1-1.1"></path></svg></button></div> <div class="inline-edit-popover__editable svelte-1c50n5q" contenteditable="true"></div> <!></div>');function Ow(n,e){vt(e,!0);let t,r,i=K(0),s=K(0),o=K(!0),a=K(null),l=K(void 0),c;to(()=>{r.innerHTML=BB(e.inlineSource);const z=t.getBoundingClientRect(),ne=z.width,Se=z.height,Te=8;let Le=e.anchorRect.left+e.anchorRect.width/2-ne/2;Le<Te&&(Le=Te),Le+ne>window.innerWidth-Te&&(Le=window.innerWidth-ne-Te),M(i,Le,!0);const he=e.anchorRect.top-Se-Te;he>=Te?(M(s,he),M(o,!0)):(M(s,e.anchorRect.bottom+Te),M(o,!1)),r.focus();const Ee=window.getSelection();if(Ee&&r.childNodes.length>0){const Ue=document.createRange();Ue.selectNodeContents(r),Ue.collapse(!1),Ee.removeAllRanges(),Ee.addRange(Ue)}function Ye(Ue){t&&!t.contains(Ue.target)&&e.onclose()}function rt(Ue){Ue.key==="Escape"&&(g(a)?M(a,null):e.onclose())}return requestAnimationFrame(()=>{document.addEventListener("mousedown",Ye)}),document.addEventListener("keydown",rt),()=>{document.removeEventListener("mousedown",Ye),document.removeEventListener("keydown",rt),clearTimeout(c)}});function u(){clearTimeout(c),c=setTimeout(()=>{t0(r);const z=zB(r);e.onchange(z)},100)}function f(z){if(z.key==="Enter"){z.preventDefault();return}(z.metaKey||z.ctrlKey)&&(z.key==="b"?(z.preventDefault(),m("bold")):z.key==="i"?(z.preventDefault(),m("italic")):z.key==="k"&&(z.preventDefault(),p()))}function d(z){z.preventDefault();const ne=z.clipboardData?.getData("text/plain")??"";document.execCommand("insertText",!1,ne)}function h(z){const Se=z.target.closest("a");Se&&r.contains(Se)&&(z.preventDefault(),O(Se))}function m(z){r.focus();const ne=window.getSelection();if(!(!ne||ne.rangeCount===0)){if(z==="code"){const Se=ne.getRangeAt(0);if(Se.collapsed)return;const Te=A(Se.commonAncestorContainer,"CODE",r);if(Te){const Le=document.createTextNode(Te.textContent??"");Te.replaceWith(Le);const he=document.createRange();he.selectNode(Le),ne.removeAllRanges(),ne.addRange(he)}else{const Le=document.createElement("code");Le.textContent=Se.toString(),Se.deleteContents(),Se.insertNode(Le);const he=document.createRange();he.selectNodeContents(Le),ne.removeAllRanges(),ne.addRange(he)}}else{const Se=z==="bold"?"bold":"italic";document.execCommand(Se,!1)}t0(r),u()}}function p(){const z=window.getSelection();if(!z||z.rangeCount===0)return;const ne=z.getRangeAt(0),Se=A(ne.commonAncestorContainer,"A",r);if(Se){O(Se);return}if(ne.collapsed)return;const Te=ne.toString(),Le=document.createElement("a");Le.href="",Le.textContent=Te,ne.deleteContents(),ne.insertNode(Le),O(Le)}function O(z){M(a,{anchorEl:z,href:z.getAttribute("href")??"",text:z.textContent??"",rect:z.getBoundingClientRect()},!0),requestAnimationFrame(()=>{g(l)?.focus(),g(l)?.select()})}function v(){g(a)&&(g(a).anchorEl.href=g(a).href,g(a).anchorEl.textContent=g(a).text,M(a,null),r.focus(),u())}function b(){if(!g(a))return;const z=document.createTextNode(g(a).anchorEl.textContent??"");g(a).anchorEl.replaceWith(z),M(a,null),r.focus(),u()}function _(z){z.key==="Enter"&&(z.preventDefault(),v())}let C=K(!1),w=K(!1),y=K(!1);function S(){M(C,document.queryCommandState("bold"),!0),M(w,document.queryCommandState("italic"),!0);const z=window.getSelection();z&&z.rangeCount>0?M(y,!!A(z.getRangeAt(0).commonAncestorContainer,"CODE",r)):M(y,!1)}function A(z,ne,Se){let Te=z;for(;Te&&Te!==Se;){if(Te.nodeType===globalThis.Node.ELEMENT_NODE&&Te.tagName===ne)return Te;Te=Te.parentNode}return null}var x=nW();let k;var E=D(x),T=D(E),$=D(T),L=I(T,2);L.__click=function(...z){e.onclose?.apply(this,z)};var P=I(E,2),q=D(P);let R;q.__click=()=>m("bold");var W=I(q,2);let U;W.__click=()=>m("italic");var ie=I(W,2);let ce;ie.__click=()=>m("code");var re=I(ie,2);re.__click=p;var H=I(P,2);H.__input=u,H.__keydown=f,H.__keyup=S,H.__mouseup=S,H.__click=h,mn(H,z=>r=z,()=>r);var ae=I(H,2);{var oe=z=>{var ne=tW(),Se=D(ne),Te=I(D(Se),2);Te.__keydown=_;var Le=I(Se,2),he=I(D(Le),2);he.__keydown=_,mn(he,Ue=>M(l,Ue),()=>g(l));var Ee=I(Le,2),Ye=D(Ee);Ye.__click=v;var rt=I(Ye,2);rt.__click=b,Rn(Te,()=>g(a).text,Ue=>g(a).text=Ue),Rn(he,()=>g(a).href,Ue=>g(a).href=Ue),Z(z,ne)};ue(ae,z=>{g(a)&&z(oe)})}mn(x,z=>t=z,()=>t),fe(()=>{k=Xe(x,1,"inline-edit-popover svelte-1c50n5q",null,k,{above:g(o),below:!g(o)}),Tr(x,`left: ${g(i)??""}px; top: ${g(s)??""}px`),$e($,e.dataName),R=Xe(q,1,"inline-edit-popover__tool-btn svelte-1c50n5q",null,R,{active:g(C)}),U=Xe(W,1,"inline-edit-popover__tool-btn svelte-1c50n5q",null,U,{active:g(w)}),ce=Xe(ie,1,"inline-edit-popover__tool-btn inline-edit-popover__tool-btn--code svelte-1c50n5q",null,ce,{active:g(y)})}),ft("paste",H,d),Z(n,x),bt()}Kt(["click","input","keydown","keyup","mouseup"]);var rW=V('<div><div class="action-edit-popover__header svelte-15w9shn"><span class="action-edit-popover__label svelte-15w9shn">action</span> <button class="action-edit-popover__close svelte-15w9shn" aria-label="Close">×</button></div> <div class="action-edit-popover__row svelte-15w9shn"><label class="action-edit-popover__field-label svelte-15w9shn">Text</label> <input class="action-edit-popover__input svelte-15w9shn" type="text"/></div> <div class="action-edit-popover__row svelte-15w9shn"><label class="action-edit-popover__field-label svelte-15w9shn">URL</label> <input class="action-edit-popover__input svelte-15w9shn" type="text" placeholder="https://..."/></div> <div class="action-edit-popover__actions svelte-15w9shn"><button class="action-edit-popover__btn action-edit-popover__btn--apply svelte-15w9shn">Apply</button> <button class="action-edit-popover__btn action-edit-popover__btn--remove svelte-15w9shn">Remove</button></div></div>');function iW(n,e){vt(e,!0);let t,r,i=K(0),s=K(0),o=K(!0),a=K(sn(e.text)),l=K(sn(e.href));to(()=>{const y=t.getBoundingClientRect(),S=y.width,A=y.height,x=8;let k=e.anchorRect.left+e.anchorRect.width/2-S/2;k<x&&(k=x),k+S>window.innerWidth-x&&(k=window.innerWidth-S-x),M(i,k,!0);const E=e.anchorRect.top-A-x;E>=x?(M(s,E),M(o,!0)):(M(s,e.anchorRect.bottom+x),M(o,!1)),r?.focus(),r?.select();function T(L){t&&!t.contains(L.target)&&c()}function $(L){L.key==="Escape"&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("mousedown",T)}),document.addEventListener("keydown",$),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",$)}});function c(){(g(a)!==e.text||g(l)!==e.href)&&e.onchange(g(a),g(l)),e.onclose()}function u(y){y.key==="Enter"&&(y.preventDefault(),c())}var f=rW();let d;var h=D(f),m=I(D(h),2);m.__click=function(...y){e.onclose?.apply(this,y)};var p=I(h,2),O=I(D(p),2);O.__keydown=u,mn(O,y=>r=y,()=>r);var v=I(p,2),b=I(D(v),2);b.__keydown=u;var _=I(v,2),C=D(_);C.__click=c;var w=I(C,2);w.__click=function(...y){e.onremove?.apply(this,y)},mn(f,y=>t=y,()=>t),fe(()=>{d=Xe(f,1,"action-edit-popover svelte-15w9shn",null,d,{above:g(o),below:!g(o)}),Tr(f,`left: ${g(i)??""}px; top: ${g(s)??""}px`)}),Rn(O,()=>g(a),y=>M(a,y)),Rn(b,()=>g(l),y=>M(l,y)),Z(n,f),bt()}Kt(["click","keydown"]);var sW=V("<option> </option>"),oW=V('<div><div class="code-edit-popover__header svelte-rmoejq"><span class="code-edit-popover__label svelte-rmoejq">code</span> <button class="code-edit-popover__close svelte-rmoejq" aria-label="Close">×</button></div> <div class="code-edit-popover__toolbar svelte-rmoejq"><select class="code-edit-popover__lang-select svelte-rmoejq"><option>No language</option><!></select></div> <div class="code-edit-popover__editor svelte-rmoejq"></div> <div class="code-edit-popover__actions svelte-rmoejq"><button class="code-edit-popover__btn code-edit-popover__btn--apply svelte-rmoejq">Apply</button> <button class="code-edit-popover__btn code-edit-popover__btn--remove svelte-rmoejq">Remove</button></div></div>');function aW(n,e){vt(e,!0);const t=["bash","sh","shell","javascript","typescript","python","html","css","json","yaml","markdown","markdoc","go","rust","java","c","cpp","ruby","php","sql","swift","kotlin","dart","lua","r","perl","scala","haskell","elixir","toml","xml","graphql","dockerfile","diff","plaintext"];let r,i,s=K(void 0),o=K(0),a=K(0),l=K(!0),c=K(sn(e.code)),u=K(sn(e.language));const f=new ms,d=new ms,h=dl.define([{tag:N.keyword,color:"#8839ef"},{tag:[N.atom,N.bool],color:"#fe640b"},{tag:N.number,color:"#fe640b"},{tag:[N.string,N.special(N.string)],color:"#40a02b"},{tag:[N.regexp,N.escape],color:"#ea76cb"},{tag:N.definition(N.variableName),color:"#1e66f5"},{tag:N.local(N.variableName),color:"#1e66f5"},{tag:N.variableName,color:"#4c4f69"},{tag:N.definition(N.propertyName),color:"#1e66f5"},{tag:N.propertyName,color:"#1e66f5"},{tag:[N.typeName,N.className,N.namespace],color:"#df8e1d"},{tag:[N.macroName,N.labelName],color:"#d20f39"},{tag:N.function(N.variableName),color:"#1e66f5"},{tag:N.operator,color:"#04a5e5"},{tag:N.punctuation,color:"#7c7f93"},{tag:N.comment,color:"#9ca0b0",fontStyle:"italic"},{tag:N.lineComment,color:"#9ca0b0",fontStyle:"italic"},{tag:N.blockComment,color:"#9ca0b0",fontStyle:"italic"},{tag:N.meta,color:"#7c7f93"},{tag:N.link,color:"#1e66f5",textDecoration:"underline"},{tag:N.url,color:"#1e66f5"},{tag:N.invalid,color:"#d20f39"}]),m=Qe.theme({"&":{fontSize:"13px",height:"auto",backgroundColor:"var(--ed-surface-1, #f8fafc)",border:"1px solid var(--ed-border-default, #e2e8f0)",borderRadius:"var(--ed-radius-sm, 4px)"},"&.cm-focused":{outline:"none",borderColor:"var(--ed-accent, #3b82f6)",boxShadow:"0 0 0 2px var(--ed-accent-ring, rgba(59, 130, 246, 0.2))"},".cm-scroller":{overflow:"auto",maxHeight:"12rem",fontFamily:"var(--ed-font-mono, 'SF Mono', 'Fira Code', monospace)",lineHeight:"1.5"},".cm-content":{padding:"var(--ed-space-2, 0.5rem)",caretColor:"#1e293b",minHeight:"3rem"},".cm-cursor":{borderLeftColor:"#1e293b"},"&.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"rgba(14, 165, 233, 0.2)"},".cm-selectionBackground":{backgroundColor:"rgba(14, 165, 233, 0.12)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-markdoc-tag":{backgroundColor:"rgba(217, 119, 6, 0.06)",borderRadius:"2px"},".cm-markdoc-bracket":{color:"#94a3b8"},".cm-markdoc-name":{color:"#d97706",fontWeight:"600"}},{dark:!1}),p=ge(()=>t.includes(g(u))||!g(u)?t:[g(u),...t]);function O(){if(!r)return;const R=r.getBoundingClientRect(),W=R.width,U=R.height,ie=8;let ce=e.anchorRect.left+e.anchorRect.width/2-W/2;ce<ie&&(ce=ie),ce+W>window.innerWidth-ie&&(ce=window.innerWidth-W-ie),M(o,ce,!0);const re=e.anchorRect.top-U-ie;re>=ie?(M(a,re),M(l,!0)):(M(a,e.anchorRect.bottom+ie),M(l,!1))}to(()=>{O();function R(U){r&&!r.contains(U.target)&&b()}function W(U){U.key==="Escape"&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("mousedown",R)}),document.addEventListener("keydown",W),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",W)}}),bn(()=>{if(!i)return;const R=qt.create({doc:Cr(()=>g(c)),extensions:[f.of(Ja()),d.of(Cr(()=>g(u))==="markdoc"?Cc():[]),IO(),m,gc(h),gc(X2,{fallback:!0}),Go.of([...jO,...NO,_q,{key:"Mod-Enter",run:()=>(b(),!0)},{key:"Escape",run:()=>(e.onclose(),!0)}]),Qe.updateListener.of(U=>{U.docChanged&&M(c,U.state.doc.toString(),!0)}),Qe.lineWrapping]}),W=new Qe({state:R,parent:i});return M(s,W,!0),W.focus(),v(W,Cr(()=>g(u))),requestAnimationFrame(()=>O()),()=>{M(s,void 0),W.destroy()}});function v(R,W){const U=W?.trim();if(!U)return;if(U==="markdoc"){R.dispatch({effects:[f.reconfigure(Ja()),d.reconfigure(Cc())]});return}R.dispatch({effects:d.reconfigure([])});const ie=J.matchLanguageName(HC,U,!0);ie&&ie.load().then(ce=>{R.dispatch({effects:f.reconfigure(ce)})}).catch(console.error)}function b(){g(c)!==e.code&&e.onchange(g(c)),e.onclose()}function _(R){const W=R.target;M(u,W.value,!0),e.onlanguagechange(g(u)),g(s)&&v(g(s),g(u))}var C=oW();let w;var y=D(C),S=I(D(y),2);S.__click=function(...R){e.onclose?.apply(this,R)};var A=I(y,2),x=D(A);x.__change=_;var k=D(x);k.value=k.__value="";var E=I(k);Qt(E,17,()=>g(p),nn,(R,W)=>{var U=sW(),ie=D(U),ce={};fe(()=>{$e(ie,g(W)),ce!==(ce=g(W))&&(U.value=(U.__value=g(W))??"")}),Z(R,U)});var T;_f(x);var $=I(A,2);mn($,R=>i=R,()=>i);var L=I($,2),P=D(L);P.__click=b;var q=I(P,2);q.__click=function(...R){e.onremove?.apply(this,R)},mn(C,R=>r=R,()=>r),fe(()=>{w=Xe(C,1,"code-edit-popover svelte-rmoejq",null,w,{above:g(l),below:!g(l)}),Tr(C,`left: ${g(o)??""}px; top: ${g(a)??""}px`),T!==(T=g(u))&&(x.value=(x.__value=g(u))??"",ic(x,g(u)))}),Z(n,C),bt()}Kt(["click","change"]);const Zn="";async function vw(){const n=await fetch(`${Zn}/api/tree`);if(!n.ok)throw new Error(`Failed to load tree: ${n.status}`);return n.json()}async function Mp(n){const e=await fetch(`${Zn}/api/files/${encodeURIComponent(n)}`);if(!e.ok)throw new Error(`Failed to load file: ${e.status}`);return e.json()}async function lW(n,e){const t=await fetch(`${Zn}/api/files/${encodeURIComponent(n)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})});if(!t.ok)throw new Error(`Failed to save file: ${t.status}`)}async function cW(n,e){const t=await fetch(`${Zn}/api/preview`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:e})});if(!t.ok)throw new Error(`Preview failed: ${t.status}`);return t.text()}async function uW(n,e){const t=await fetch(`${Zn}/api/preview-data`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:e})});if(!t.ok)throw new Error(`Preview data failed: ${t.status}`);return t.json()}async function fW(){const n=await fetch(`${Zn}/api/config`);if(!n.ok)throw new Error(`Config failed: ${n.status}`);return n.json()}async function dW(){const n=await fetch(`${Zn}/api/route-rules`);if(!n.ok)throw new Error(`Failed to load route rules: ${n.status}`);return(await n.json()).routeRules}async function hW(n){const e=await fetch(`${Zn}/api/route-rules`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({routeRules:n})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to update route rules: ${e.status}`)}}async function pW(n){const e=await fetch(`${Zn}/api/pages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to create page: ${e.status}`)}return e.json()}async function bw(n){const e=await fetch(`${Zn}/api/directories`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to create directory: ${e.status}`)}return e.json()}async function mW(n,e){const t=await fetch(`${Zn}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPath:n,newName:e})});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(r.error??`Failed to rename: ${t.status}`)}return t.json()}async function gW(n){const e=await fetch(`${Zn}/api/duplicate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to duplicate: ${e.status}`)}return e.json()}async function OW(n){const e=await fetch(`${Zn}/api/files/${encodeURIComponent(n)}`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to delete: ${e.status}`)}}async function vW(n){const e=await fetch(`${Zn}/api/toggle-draft`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to toggle draft: ${e.status}`)}return e.json()}async function bW(){const n=await fetch(`${Zn}/api/assets`);if(!n.ok)throw new Error(`Failed to load assets: ${n.status}`);return(await n.json()).images}async function yW(n){const e=new FormData;e.append("file",n);const t=await fetch(`${Zn}/api/assets/upload`,{method:"POST",body:e});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(r.error??`Upload failed: ${t.status}`)}return t.json()}async function wW(){const n=await fetch(`${Zn}/api/runes`);if(!n.ok)throw new Error(`Failed to load runes: ${n.status}`);return(await n.json()).runes}async function _W(){const n=await fetch(`${Zn}/api/aggregated`);return n.ok?n.json():{}}function kW(n){const e=new EventSource(`${Zn}/api/events`);return e.addEventListener("file-changed",t=>n("file-changed",JSON.parse(t.data))),e.addEventListener("file-created",t=>n("file-created",JSON.parse(t.data))),e.addEventListener("file-deleted",t=>n("file-deleted",JSON.parse(t.data))),()=>e.close()}var xW=V('<div class="image-edit-modal__empty svelte-1yd8alm">Loading images...</div>'),SW=V('<div class="image-edit-modal__empty svelte-1yd8alm">No images found. Upload one to get started.</div>'),AW=V('<div class="image-edit-modal__empty svelte-1yd8alm"> </div>'),CW=V('<button><img loading="lazy" class="svelte-1yd8alm"/></button>'),TW=V('<div class="image-edit-modal__grid svelte-1yd8alm"></div>'),PW=V('<div class="image-edit-backdrop svelte-1yd8alm" role="dialog" aria-modal="true" aria-label="Select image"><div><div class="image-edit-modal__header svelte-1yd8alm"><span class="image-edit-modal__label svelte-1yd8alm">image</span> <button class="image-edit-modal__close svelte-1yd8alm" aria-label="Close">×</button></div> <div class="image-edit-modal__search svelte-1yd8alm"><input class="image-edit-modal__search-input svelte-1yd8alm" type="text" placeholder="Search images..."/></div> <div class="image-edit-modal__grid-area svelte-1yd8alm"><!></div> <div class="image-edit-modal__upload-bar svelte-1yd8alm"><button class="image-edit-modal__upload-btn svelte-1yd8alm"> </button> <span class="image-edit-modal__upload-hint svelte-1yd8alm">or drag & drop</span> <input type="file" accept="image/*" style="display: none"/></div> <div class="image-edit-modal__footer svelte-1yd8alm"><div class="image-edit-modal__row svelte-1yd8alm"><label class="image-edit-modal__field-label svelte-1yd8alm" for="image-alt">Alt</label> <input id="image-alt" class="image-edit-modal__input svelte-1yd8alm" type="text" placeholder="Describe this image..."/></div> <div class="image-edit-modal__actions svelte-1yd8alm"><button class="image-edit-modal__btn image-edit-modal__btn--apply svelte-1yd8alm">Apply</button> <button class="image-edit-modal__btn image-edit-modal__btn--remove svelte-1yd8alm">Remove</button></div></div></div></div>');function EW(n,e){vt(e,!0);let t,r,i,s=K(sn([])),o=K(!0),a=K(!1),l=K(""),c=K(sn(e.currentSrc)),u=K(sn(e.currentAlt)),f=K(!1);const d=ge(()=>g(l)?g(s).filter(he=>he.name.toLowerCase().includes(g(l).toLowerCase())):g(s));to(()=>{h();function he(Ee){Ee.key==="Escape"&&e.onclose()}return document.addEventListener("keydown",he),()=>document.removeEventListener("keydown",he)});async function h(){M(o,!0);try{M(s,await bW(),!0)}catch{M(s,[],!0)}M(o,!1)}function m(he){he.target===he.currentTarget&&e.onclose()}function p(he){if(M(c,he.path,!0),!g(u)){const Ee=he.name.replace(/\.[^.]+$/,"").replace(/[-_]/g," ");M(u,Ee,!0)}}function O(){g(c)&&e.onchange(g(c),g(u))}function v(){r?.click()}async function b(he){const Ee=he.target,Ye=Ee.files?.[0];Ye&&(await _(Ye),Ee.value="")}async function _(he){if(he.type.startsWith("image/")){M(a,!0);try{const Ee=await yW(he);if(await h(),M(c,Ee.path,!0),!g(u)){const Ye=Ee.name.replace(/\.[^.]+$/,"").replace(/[-_]/g," ");M(u,Ye,!0)}}catch(Ee){console.error("Upload failed:",Ee)}M(a,!1)}}function C(he){he.preventDefault(),M(f,!0)}function w(){M(f,!1)}async function y(he){he.preventDefault(),M(f,!1);const Ee=he.dataTransfer?.files[0];Ee&&await _(Ee)}function S(he){he.key==="Enter"&&(he.preventDefault(),O())}var A=PW();A.__click=m,A.__keydown=()=>{};var x=D(A);let k;var E=D(x),T=I(D(E),2);T.__click=function(...he){e.onclose?.apply(this,he)};var $=I(E,2),L=D($),P=I($,2),q=D(P);{var R=he=>{var Ee=xW();Z(he,Ee)},W=he=>{var Ee=SW();Z(he,Ee)},U=he=>{var Ee=AW(),Ye=D(Ee);fe(()=>$e(Ye,`No images match "${g(l)??""}"`)),Z(he,Ee)},ie=he=>{var Ee=TW();Qt(Ee,21,()=>g(d),Ye=>Ye.path,(Ye,rt)=>{var Ue=CW();let Ke;Ue.__click=()=>p(g(rt));var Me=D(Ue);fe(()=>{Ke=Xe(Ue,1,"image-edit-modal__thumb svelte-1yd8alm",null,Ke,{selected:g(c)===g(rt).path}),Et(Ue,"title",g(rt).name),Et(Me,"src",g(rt).path),Et(Me,"alt",g(rt).name)}),Z(Ye,Ue)}),Z(he,Ee)};ue(q,he=>{g(o)?he(R):g(d).length===0&&!g(l)?he(W,1):g(d).length===0?he(U,2):he(ie,!1)})}var ce=I(P,2),re=D(ce);re.__click=v;var H=D(re),ae=I(re,4);ae.__change=b,mn(ae,he=>r=he,()=>r);var oe=I(ce,2),z=D(oe),ne=I(D(z),2);ne.__keydown=S,mn(ne,he=>i=he,()=>i);var Se=I(z,2),Te=D(Se);Te.__click=O;var Le=I(Te,2);Le.__click=function(...he){e.onremove?.apply(this,he)},mn(x,he=>t=he,()=>t),fe(()=>{k=Xe(x,1,"image-edit-modal svelte-1yd8alm",null,k,{"drag-over":g(f)}),re.disabled=g(a),$e(H,g(a)?"Uploading...":"Upload image"),Te.disabled=!g(c)}),ft("dragover",x,C),ft("dragleave",x,w),ft("drop",x,y),Rn(L,()=>g(l),he=>M(l,he)),Rn(ne,()=>g(u),he=>M(u,he)),Z(n,A),bt()}Kt(["click","keydown","change"]);var $W=V('<div class="icon-picker-modal__empty svelte-1rc2pkk">No icons available.</div>'),QW=V('<div class="icon-picker-modal__empty svelte-1rc2pkk"> </div>'),LW=V('<button><span class="icon-picker-modal__icon-svg svelte-1rc2pkk"><!></span> <span class="icon-picker-modal__icon-name svelte-1rc2pkk"> </span></button>'),MW=V('<div class="icon-picker-modal__group svelte-1rc2pkk"><div class="icon-picker-modal__group-label svelte-1rc2pkk"> </div> <div class="icon-picker-modal__grid svelte-1rc2pkk"></div></div>'),qW=V('<div class="icon-picker-backdrop svelte-1rc2pkk" role="dialog" aria-modal="true" aria-label="Select icon"><div class="icon-picker-modal svelte-1rc2pkk"><div class="icon-picker-modal__header svelte-1rc2pkk"><span class="icon-picker-modal__label svelte-1rc2pkk">icon</span> <button class="icon-picker-modal__close svelte-1rc2pkk" aria-label="Close">×</button></div> <div class="icon-picker-modal__search svelte-1rc2pkk"><input class="icon-picker-modal__search-input svelte-1rc2pkk" type="text" placeholder="Search icons..."/></div> <div class="icon-picker-modal__grid-area svelte-1rc2pkk"><!></div> <div class="icon-picker-modal__footer svelte-1rc2pkk"><button class="icon-picker-modal__btn icon-picker-modal__btn--apply svelte-1rc2pkk">Apply</button> <button class="icon-picker-modal__btn icon-picker-modal__btn--cancel svelte-1rc2pkk">Cancel</button></div></div></div>');function DW(n,e){vt(e,!0);let t,r=K(sn(e.currentIcon)),i=K("");const s=ge(()=>{const x=[];for(const[k,E]of Object.entries(e.icons))for(const[T,$]of Object.entries(E)){const L=k==="global"?T:`${k}/${T}`;x.push({name:T,qualifiedName:L,group:k,svg:$})}return x}),o=ge(()=>g(i)?g(s).filter(x=>x.name.toLowerCase().includes(g(i).toLowerCase())||x.qualifiedName.toLowerCase().includes(g(i).toLowerCase())):g(s)),a=ge(()=>{const x=new Map;for(const k of g(o)){const E=x.get(k.group)??[];E.push(k),x.set(k.group,E)}return x});to(()=>{t?.focus();function x(k){k.key==="Escape"&&e.onclose()}return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)});function l(x){x.target===x.currentTarget&&e.onclose()}function c(x){M(r,x.qualifiedName,!0)}function u(){g(r)&&e.onchange(g(r))}var f=qW();f.__click=l,f.__keydown=()=>{};var d=D(f),h=D(d),m=I(D(h),2);m.__click=function(...x){e.onclose?.apply(this,x)};var p=I(h,2),O=D(p);mn(O,x=>t=x,()=>t);var v=I(p,2),b=D(v);{var _=x=>{var k=$W();Z(x,k)},C=x=>{var k=QW(),E=D(k);fe(()=>$e(E,`No icons match "${g(i)??""}"`)),Z(x,k)},w=x=>{var k=pn(),E=at(k);Qt(E,17,()=>[...g(a)],([T,$])=>T,(T,$)=>{var L=ge(()=>Dc(g($),2));let P=()=>g(L)[0],q=()=>g(L)[1];var R=MW(),W=D(R),U=D(W),ie=I(W,2);Qt(ie,21,q,ce=>ce.qualifiedName,(ce,re)=>{var H=LW();let ae;H.__click=()=>c(g(re));var oe=D(H),z=D(oe);u_(z,()=>g(re).svg);var ne=I(oe,2),Se=D(ne);fe(()=>{ae=Xe(H,1,"icon-picker-modal__icon svelte-1rc2pkk",null,ae,{selected:g(r)===g(re).qualifiedName}),Et(H,"title",g(re).qualifiedName),$e(Se,g(re).name)}),Z(ce,H)}),fe(()=>$e(U,P())),Z(T,R)}),Z(x,k)};ue(b,x=>{g(s).length===0?x(_):g(o).length===0?x(C,1):x(w,!1)})}var y=I(v,2),S=D(y);S.__click=u;var A=I(S,2);A.__click=function(...x){e.onclose?.apply(this,x)},fe(()=>S.disabled=!g(r)),Rn(O,()=>g(i),x=>M(i,x)),Z(n,f),bt()}Kt(["click","keydown"]);var RW=V('<div class="block-editor__empty svelte-10brcoc"><svg class="block-editor__empty-icon svelte-10brcoc" width="40" height="40" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="6" y="8" width="36" height="32" rx="3"></rect><line x1="14" y1="18" x2="34" y2="18"></line><line x1="14" y1="24" x2="28" y2="24"></line><line x1="14" y1="30" x2="22" y2="30"></line></svg> <span class="block-editor__empty-text svelte-10brcoc">No content blocks yet</span> <span class="block-editor__empty-hint svelte-10brcoc">Use the + button to add your first block</span></div>'),IW=V('<span class="block-editor__fm-desc svelte-10brcoc"> </span>'),NW=V('<div class="block-editor__fm-header svelte-10brcoc"><div class="block-editor__fm-info svelte-10brcoc"><span class="block-editor__fm-title svelte-10brcoc"> </span> <!></div> <button title="Edit frontmatter"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11.5 1.5l3 3L5 14H2v-3L11.5 1.5z"></path></svg> Edit</button></div>'),BW=V('<button class="block-editor__insert-marker block-editor__insert-marker--top svelte-10brcoc" title="Insert block above"><svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="5" y1="2" x2="5" y2="8"></line><line x1="2" y1="5" x2="8" y2="5"></line></svg></button> <button class="block-editor__insert-marker block-editor__insert-marker--bottom svelte-10brcoc" title="Insert block below"><svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="5" y1="2" x2="5" y2="8"></line><line x1="2" y1="5" x2="8" y2="5"></line></svg></button>',1),jW=V('<button class="block-editor__hover-label svelte-10brcoc"> </button>'),zW=V('<div><div class="block-editor__block-cell svelte-10brcoc"><!></div> <!> <!></div>'),ZW=V('<div class="block-editor__popover-backdrop svelte-10brcoc"></div> <div class="block-editor__popover svelte-10brcoc"><!></div>',1),FW=V('<div class="block-editor svelte-10brcoc"><!> <div class="block-editor__stage svelte-10brcoc"><div class="block-editor__scroll svelte-10brcoc"><div class="block-editor__list-wrap svelte-10brcoc"><!> <!></div></div></div> <!> <!> <!> <!> <!> <!> <!> <!></div>');function XW(n,e){vt(e,!0);let t=Pt(e,"highlightCss",3,""),r=Pt(e,"highlightTransform",3,null),i=Pt(e,"showInsertMenu",3,!0),s=Pt(e,"frontmatter",19,()=>({})),o=Pt(e,"readOnly",3,!1),a=Pt(e,"communityTags",3,null),l=Pt(e,"communityPostTransforms",3,null),c=Pt(e,"communityStyles",3,null),u=Pt(e,"aggregated",19,()=>({})),f=K(sn([])),d=ge(()=>rN(e.runes)),h="";function m(G,ee){if(G.length===0)return;const de=new Set(G.map(it=>it.id)),ye=new Set(ee.map(it=>it.id)),De=G.filter(it=>!ye.has(it.id)),st=ee.filter(it=>!de.has(it.id));if(De.length===0||st.length===0)return;const nt=[...De];for(const it of st){let ut=-1,Nt=1/0;for(let pt=0;pt<nt.length;pt++){const Mn=nt[pt],vn=Mn.type===it.type?0:1e3,gt=Math.abs(Mn.startLine-it.startLine)+vn;gt<Nt&&(Nt=gt,ut=pt)}ut>=0&&(it.id=nt[ut].id,nt.splice(ut,1))}}bn(()=>{const G=e.bodyContent;if(G!==h){const ee=_A(G);m(g(f),ee),M(f,ee,!0),h=G,M(k,null),M(S,!1),M(T,null),M(Me,null),M(C,null)}});function p(){const G=Hm(g(f));h=G,e.onchange(G)}let O=ge(()=>Z1(g(f)));function v(G){const ee=g(O)[G];if(!ee)return[0,0];if(ee.type==="prose"){const ye=ee.children[0],De=ee.children[ee.children.length-1],st=g(f).indexOf(ye),nt=g(f).indexOf(De);return[st,nt]}const de=g(f).indexOf(ee);return[de,de]}function b(G,ee){const[de,ye]=v(G),De=g(f).slice(de,ye+1);m(De,ee.children),M(f,[...g(f).slice(0,de),...ee.children,...g(f).slice(ye+1)],!0),p()}function _(G,ee){const de=g(O)[G];if(!de||de.type!=="prose")return;const ye=de.children[ee.childIndex];if(!ye)return;const[De]=v(G),st=De+ee.childIndex;if(ye.type==="fence"){const pt=ye,Mn=pt.code,vn=pt.language,gt=ye.source.split(`
|
|
598
|
+
`)[0]??""}}function s(P){switch(P.type){case"heading":return'<path d="M3 3v10M13 3v10M3 8h10" />';case"paragraph":return'<path d="M2 4h12M2 8h12M2 12h8" />';case"fence":return'<polyline points="4 6 1 9 4 12" /><polyline points="12 6 15 9 12 12" />';case"list":return'<circle cx="3" cy="4" r="1" fill="currentColor" /><line x1="6" y1="4" x2="14" y2="4" /><circle cx="3" cy="8" r="1" fill="currentColor" /><line x1="6" y1="8" x2="14" y2="8" /><circle cx="3" cy="12" r="1" fill="currentColor" /><line x1="6" y1="12" x2="14" y2="12" />';case"quote":return'<path d="M3 5h10M5 5v8M5 9h6" />';case"hr":return'<line x1="2" y1="8" x2="14" y2="8" />';case"image":return'<rect x="2" y="2" width="12" height="12" rx="1" /><circle cx="5.5" cy="5.5" r="1.5" /><path d="M14 10l-3-3-5 5" />';default:return'<path d="M2 4h12M2 8h12M2 12h8" />'}}let o=K(null),a=K(null);function l(P,q){M(o,q,!0),P.dataTransfer&&(P.dataTransfer.effectAllowed="move",P.dataTransfer.setData("text/plain",String(q)))}function c(P,q){P.preventDefault(),P.dataTransfer&&(P.dataTransfer.dropEffect="move"),M(a,q,!0)}function u(P,q){P.preventDefault(),g(o)!==null&&g(o)!==q&&d(g(o),q),M(o,null),M(a,null)}function f(){M(o,null),M(a,null)}function d(P,q){const R=[...e.block.children],[W]=R.splice(P,1);R.splice(q,0,W);const U=Hm(R);e.onupdate({...e.block,children:R,source:U})}function h(P){const q=e.block.children.filter((W,U)=>U!==P);if(q.length===0){e.onremove();return}const R=Hm(q);e.onupdate({...e.block,children:q,source:R})}function m(P){if(!P.trim()){e.onremove();return}const q=_A(P);e.onupdate({...e.block,children:q,source:P})}var p=IV(),O=D(p),v=D(O),b=I(D(v),2),_=D(b),C=I(b,4);C.__click=function(...P){e.onremove?.apply(this,P)};var w=I(C,2);w.__click=function(...P){e.onclose?.apply(this,P)};var y=I(v,2),S=D(y);let A;S.__click=()=>M(r,"structure");var x=I(S,2);let k;x.__click=()=>M(r,"content");var E=I(O,2);{var T=P=>{var q=DV(),R=D(q);Qt(R,23,()=>e.block.children,W=>W.id,(W,U,ie)=>{var ce=qV();let re;var H=I(D(ce),2),ae=D(H),oe=D(ae);u_(oe,()=>s(g(U)),!0);var z=I(H,2),ne=D(z),Se=D(ne),Te=I(ne,2),Le=D(Te),he=I(z,2);he.__click=()=>h(g(ie)),fe((Ee,Ye)=>{re=Xe(ce,1,"structure-item svelte-1lv3l5p",null,re,{"drag-source":g(o)===g(ie),"drag-over":g(a)===g(ie)&&g(o)!==g(ie)}),$e(Se,Ee),$e(Le,Ye)},[()=>Ov(g(U)),()=>i(g(U))]),ft("dragstart",ce,Ee=>l(Ee,g(ie))),ft("dragover",ce,Ee=>c(Ee,g(ie))),ft("drop",ce,Ee=>u(Ee,g(ie))),ft("dragend",ce,f),Z(W,ce)}),Z(P,q)};ue(E,P=>{g(r)==="structure"&&P(T)})}var $=I(E,2);{var L=P=>{var q=RV(),R=D(q),W=D(R);go(W,{get content(){return e.block.source},onchange:m,get runes(){return e.runes},aggregated:()=>t()}),Z(P,q)};ue($,P=>{g(r)==="content"&&P(L)})}fe(()=>{$e(_,`${e.block.children.length??""} block${e.block.children.length!==1?"s":""}`),A=Xe(S,1,"edit-panel__tab svelte-1lv3l5p",null,A,{active:g(r)==="structure"}),k=Xe(x,1,"edit-panel__tab svelte-1lv3l5p",null,k,{active:g(r)==="content"})}),Z(n,p),bt()}Kt(["click"]);var BV=V('<div class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w"> </span> <div class="edit-panel__custom-row svelte-1wxsk8w"><input class="edit-panel__input svelte-1wxsk8w" type="text"/> <button class="edit-panel__remove-btn svelte-1wxsk8w">×</button></div></div>'),jV=V('<div class="edit-panel__custom-section svelte-1wxsk8w"><span class="edit-panel__section-label svelte-1wxsk8w">Custom fields</span> <!></div>'),zV=V('<div class="edit-panel svelte-1wxsk8w"><div class="edit-panel__header svelte-1wxsk8w"><span class="edit-panel__type svelte-1wxsk8w">Frontmatter</span> <div class="edit-panel__spacer svelte-1wxsk8w"></div> <button class="edit-panel__btn svelte-1wxsk8w" title="Close panel">×</button></div> <div class="edit-panel__body svelte-1wxsk8w"><div class="edit-panel__field-group svelte-1wxsk8w"><label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Title</span> <input class="edit-panel__input svelte-1wxsk8w" type="text"/></label> <label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Description</span> <textarea class="edit-panel__textarea svelte-1wxsk8w"></textarea></label> <label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Slug</span> <input class="edit-panel__input svelte-1wxsk8w" type="text" placeholder="auto-derived from filename"/></label> <div class="edit-panel__row svelte-1wxsk8w"><label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Author</span> <input class="edit-panel__input svelte-1wxsk8w" type="text"/></label> <label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Date</span> <input class="edit-panel__input svelte-1wxsk8w" type="date"/></label></div> <div class="edit-panel__row svelte-1wxsk8w"><label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Order</span> <input class="edit-panel__input svelte-1wxsk8w" type="number"/></label> <div class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Draft</span> <div role="switch" tabindex="0"><div class="fm-toggle__track svelte-1wxsk8w"><div class="fm-toggle__thumb svelte-1wxsk8w"></div></div> <span class="fm-toggle__label svelte-1wxsk8w"> </span></div></div></div> <div class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Tags</span> <!></div> <!> <div class="edit-panel__add-field svelte-1wxsk8w"><input class="edit-panel__input svelte-1wxsk8w" type="text" placeholder="Field name"/> <button class="edit-panel__add-btn svelte-1wxsk8w">+ Add field</button></div></div></div></div>');function ZV(n,e){vt(e,!0);const t=new Set(["title","description","tags","draft","order","date","author","slug"]);let r=K(""),i=ge(()=>Object.entries(F.frontmatter).filter(([H])=>!t.has(H)));function s(H,ae){F.updateFrontmatterField(H,ae)}function o(){const H=g(r).trim();!H||H in F.frontmatter||(F.updateFrontmatterField(H,""),M(r,""))}function a(H){F.updateFrontmatterField(H,void 0)}var l=zV(),c=D(l),u=I(D(c),4);u.__click=function(...H){e.onclose?.apply(this,H)};var f=I(c,2),d=D(f),h=D(d),m=I(D(h),2);m.__input=H=>s("title",H.target.value);var p=I(h,2),O=I(D(p),2);O.__input=H=>s("description",H.target.value),Et(O,"rows",2);var v=I(p,2),b=I(D(v),2);b.__input=H=>s("slug",H.target.value);var _=I(v,2),C=D(_),w=I(D(C),2);w.__input=H=>s("author",H.target.value);var y=I(C,2),S=I(D(y),2);S.__input=H=>s("date",H.target.value);var A=I(_,2),x=D(A),k=I(D(x),2);k.__input=H=>{const ae=H.target.value;s("order",ae===""?void 0:Number(ae))};var E=I(x,2),T=I(D(E),2);let $;T.__click=()=>s("draft",F.frontmatter.draft===!0?void 0:!0),T.__keydown=H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),s("draft",F.frontmatter.draft===!0?void 0:!0))};var L=I(D(T),2),P=D(L),q=I(A,2),R=I(D(q),2);{let H=ge(()=>F.frontmatter.tags??[]);ck(R,{get tags(){return g(H)},onchange:ae=>s("tags",ae)})}var W=I(q,2);{var U=H=>{var ae=jV(),oe=I(D(ae),2);Qt(oe,17,()=>g(i),nn,(z,ne)=>{var Se=ge(()=>Dc(g(ne),2));let Te=()=>g(Se)[0],Le=()=>g(Se)[1];var he=BV(),Ee=D(he),Ye=D(Ee),rt=I(Ee,2),Ue=D(rt);Ue.__input=Me=>s(Te(),Me.target.value);var Ke=I(Ue,2);Ke.__click=()=>a(Te()),fe(Me=>{$e(Ye,Te()),fn(Ue,Me),Et(Ke,"aria-label",`Remove ${Te()??""}`)},[()=>String(Le()??"")]),Z(z,he)}),Z(H,ae)};ue(W,H=>{g(i).length>0&&H(U)})}var ie=I(W,2),ce=D(ie);ce.__keydown=H=>{H.key==="Enter"&&(H.preventDefault(),o())};var re=I(ce,2);re.__click=o,fe(H=>{fn(m,F.frontmatter.title??""),fn(O,F.frontmatter.description??""),fn(b,F.frontmatter.slug??""),fn(w,F.frontmatter.author??""),fn(S,F.frontmatter.date??""),fn(k,F.frontmatter.order??""),$=Xe(T,1,"fm-toggle svelte-1wxsk8w",null,$,{active:F.frontmatter.draft===!0}),Et(T,"aria-checked",F.frontmatter.draft===!0),$e(P,F.frontmatter.draft===!0?"Draft":"Published"),re.disabled=H},[()=>!g(r).trim()]),Rn(ce,()=>g(r),H=>M(r,H)),Z(n,l),bt()}Kt(["click","input","keydown"]);var FV=V('<button type="button"> </button>'),XV=V('<div class="insert-dialog__tabs svelte-gvk8wi"></div>'),VV=V('<div class="insert-dialog__empty svelte-gvk8wi"> </div>'),WV=V('<span class="insert-dialog__rune-desc svelte-gvk8wi"> </span>'),YV=V('<button class="insert-dialog__btn insert-dialog__btn--rune svelte-gvk8wi"><span class="insert-dialog__rune-dot svelte-gvk8wi"></span> <span class="insert-dialog__rune-info svelte-gvk8wi"><span class="insert-dialog__rune-name svelte-gvk8wi"> </span> <!></span></button>'),UV=V('<div class="insert-dialog__grid svelte-gvk8wi"></div>'),GV=V('<button class="insert-dialog__btn svelte-gvk8wi"><svg class="insert-dialog__btn-icon svelte-gvk8wi" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="insert-dialog__btn-info svelte-gvk8wi"><span class="insert-dialog__btn-name svelte-gvk8wi"> </span> <span class="insert-dialog__btn-desc svelte-gvk8wi"> </span></span></button>'),HV=V('<span class="insert-dialog__rune-desc svelte-gvk8wi"> </span>'),KV=V('<button class="insert-dialog__btn insert-dialog__btn--rune svelte-gvk8wi"><span class="insert-dialog__rune-dot svelte-gvk8wi"></span> <span class="insert-dialog__rune-info svelte-gvk8wi"><span class="insert-dialog__rune-name svelte-gvk8wi"> </span> <!></span></button>'),JV=V('<div class="insert-dialog__grid svelte-gvk8wi"><!> <!></div>'),eW=V('<dialog class="insert-dialog svelte-gvk8wi"><div class="insert-dialog__inner svelte-gvk8wi"><div class="insert-dialog__header svelte-gvk8wi"><h2 class="insert-dialog__title svelte-gvk8wi">Insert Block</h2> <div class="insert-dialog__search-wrap svelte-gvk8wi"><svg class="insert-dialog__search-icon svelte-gvk8wi" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="7" cy="7" r="4.5"></circle><path d="M10.5 10.5L14 14"></path></svg> <input class="insert-dialog__search svelte-gvk8wi" type="text" placeholder="Search blocks..."/></div> <button class="insert-dialog__close svelte-gvk8wi"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M4 4l8 8M12 4l-8 8"></path></svg></button></div> <!> <div class="insert-dialog__body svelte-gvk8wi"><!></div></div></dialog>');function tW(n,e){vt(e,!0);const t=["Content","Section","Layout","Code & Data","Semantic","Design","Site"];let r=K("Content"),i=K(""),s,o,a=ge(()=>{const x=new Set(e.runesByCategory.keys()),k=t.filter(E=>x.has(E));for(const E of x)k.includes(E)||k.push(E);return k}),l=ge(()=>{if(!g(i).trim())return null;const x=g(i).toLowerCase();return e.runes.filter(k=>k.name.toLowerCase().includes(x)||k.description&&k.description.toLowerCase().includes(x))});const c=[{type:"heading",name:"Heading",description:"Section heading",icon:"M3 3v10M13 3v10M3 8h10"},{type:"paragraph",name:"Paragraph",description:"Body text",icon:"M2 4h12M2 8h12M2 12h8"},{type:"fence",name:"Code Block",description:"Fenced code",icon:"M5 4L2 8l3 4M11 4l3 4-3 4"},{type:"hr",name:"Divider",description:"Horizontal rule",icon:"M2 8h12"}];bn(()=>{s?.showModal(),o?.focus()});function u(x){x.target===s&&e.onclose()}function f(x){e.oninsert(x)}function d(x){e.oninsert("rune",x)}var h=eW();h.__click=u,h.__keydown=x=>{x.key==="Escape"&&(x.preventDefault(),e.onclose())};var m=D(h),p=D(m),O=I(D(p),2),v=I(D(O),2);mn(v,x=>o=x,()=>o);var b=I(O,2);b.__click=function(...x){e.onclose?.apply(this,x)};var _=I(p,2);{var C=x=>{var k=XV();Qt(k,21,()=>g(a),nn,(E,T)=>{var $=FV();let L;$.__click=()=>M(r,g(T),!0);var P=D($);fe(()=>{L=Xe($,1,"insert-dialog__tab svelte-gvk8wi",null,L,{active:g(r)===g(T)}),$e(P,g(T))}),Z(E,$)}),Z(x,k)};ue(_,x=>{g(l)||x(C)})}var w=I(_,2),y=D(w);{var S=x=>{var k=pn(),E=at(k);{var T=L=>{var P=VV(),q=D(P);fe(()=>$e(q,`No blocks match "${g(i)??""}"`)),Z(L,P)},$=L=>{var P=UV();Qt(P,21,()=>g(l),nn,(q,R)=>{var W=YV();W.__click=()=>d(g(R).name);var U=I(D(W),2),ie=D(U),ce=D(ie),re=I(ie,2);{var H=ae=>{var oe=WV(),z=D(oe);fe(()=>$e(z,g(R).description)),Z(ae,oe)};ue(re,ae=>{g(R).description&&ae(H)})}fe(()=>$e(ce,g(R).name)),Z(q,W)}),Z(L,P)};ue(E,L=>{g(l).length===0?L(T):L($,!1)})}Z(x,k)},A=x=>{var k=JV(),E=D(k);{var T=L=>{var P=pn(),q=at(P);Qt(q,17,()=>c,nn,(R,W)=>{var U=GV();U.__click=()=>f(g(W).type);var ie=D(U),ce=D(ie),re=I(ie,2),H=D(re),ae=D(H),oe=I(H,2),z=D(oe);fe(()=>{Et(ce,"d",g(W).icon),$e(ae,g(W).name),$e(z,g(W).description)}),Z(R,U)}),Z(L,P)};ue(E,L=>{g(r)==="Content"&&L(T)})}var $=I(E,2);Qt($,17,()=>e.runesByCategory.get(g(r))??[],nn,(L,P)=>{var q=KV();q.__click=()=>d(g(P).name);var R=I(D(q),2),W=D(R),U=D(W),ie=I(W,2);{var ce=re=>{var H=HV(),ae=D(H);fe(()=>$e(ae,g(P).description)),Z(re,H)};ue(ie,re=>{g(P).description&&re(ce)})}fe(()=>$e(U,g(P).name)),Z(L,q)}),Z(x,k)};ue(y,x=>{g(l)?x(S):x(A,!1)})}mn(h,x=>s=x,()=>s),ft("close",h,function(...x){e.onclose?.apply(this,x)}),Rn(v,()=>g(i),x=>M(i,x)),Z(n,h),bt()}Kt(["click","keydown"]);var nW=V('<div class="inline-edit-popover__link-editor svelte-1c50n5q"><div class="inline-edit-popover__link-row svelte-1c50n5q"><label class="inline-edit-popover__link-label svelte-1c50n5q">Text</label> <input class="inline-edit-popover__link-input svelte-1c50n5q" type="text"/></div> <div class="inline-edit-popover__link-row svelte-1c50n5q"><label class="inline-edit-popover__link-label svelte-1c50n5q">URL</label> <input class="inline-edit-popover__link-input svelte-1c50n5q" type="text" placeholder="https://..."/></div> <div class="inline-edit-popover__link-actions svelte-1c50n5q"><button class="inline-edit-popover__link-btn inline-edit-popover__link-btn--apply svelte-1c50n5q">Apply</button> <button class="inline-edit-popover__link-btn inline-edit-popover__link-btn--remove svelte-1c50n5q">Remove link</button></div></div>'),rW=V('<div><div class="inline-edit-popover__header svelte-1c50n5q"><span class="inline-edit-popover__label svelte-1c50n5q"> </span> <button class="inline-edit-popover__close svelte-1c50n5q" aria-label="Close">×</button></div> <div class="inline-edit-popover__toolbar svelte-1c50n5q"><button title="Bold (Ctrl+B)"><strong>B</strong></button> <button title="Italic (Ctrl+I)"><em>I</em></button> <button title="Inline code"></></button> <button class="inline-edit-popover__tool-btn svelte-1c50n5q" title="Link (Ctrl+K)"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 9.5a3 3 0 0 0 4.2.3l2-2a3 3 0 0 0-4.2-4.3l-1.1 1.1"></path><path d="M9.5 6.5a3 3 0 0 0-4.2-.3l-2 2a3 3 0 0 0 4.2 4.3l1.1-1.1"></path></svg></button></div> <div class="inline-edit-popover__editable svelte-1c50n5q" contenteditable="true"></div> <!></div>');function Ow(n,e){vt(e,!0);let t,r,i=K(0),s=K(0),o=K(!0),a=K(null),l=K(void 0),c;to(()=>{r.innerHTML=BB(e.inlineSource);const z=t.getBoundingClientRect(),ne=z.width,Se=z.height,Te=8;let Le=e.anchorRect.left+e.anchorRect.width/2-ne/2;Le<Te&&(Le=Te),Le+ne>window.innerWidth-Te&&(Le=window.innerWidth-ne-Te),M(i,Le,!0);const he=e.anchorRect.top-Se-Te;he>=Te?(M(s,he),M(o,!0)):(M(s,e.anchorRect.bottom+Te),M(o,!1)),r.focus();const Ee=window.getSelection();if(Ee&&r.childNodes.length>0){const Ue=document.createRange();Ue.selectNodeContents(r),Ue.collapse(!1),Ee.removeAllRanges(),Ee.addRange(Ue)}function Ye(Ue){t&&!t.contains(Ue.target)&&e.onclose()}function rt(Ue){Ue.key==="Escape"&&(g(a)?M(a,null):e.onclose())}return requestAnimationFrame(()=>{document.addEventListener("mousedown",Ye)}),document.addEventListener("keydown",rt),()=>{document.removeEventListener("mousedown",Ye),document.removeEventListener("keydown",rt),clearTimeout(c)}});function u(){clearTimeout(c),c=setTimeout(()=>{t0(r);const z=zB(r);e.onchange(z)},100)}function f(z){if(z.key==="Enter"){z.preventDefault();return}(z.metaKey||z.ctrlKey)&&(z.key==="b"?(z.preventDefault(),m("bold")):z.key==="i"?(z.preventDefault(),m("italic")):z.key==="k"&&(z.preventDefault(),p()))}function d(z){z.preventDefault();const ne=z.clipboardData?.getData("text/plain")??"";document.execCommand("insertText",!1,ne)}function h(z){const Se=z.target.closest("a");Se&&r.contains(Se)&&(z.preventDefault(),O(Se))}function m(z){r.focus();const ne=window.getSelection();if(!(!ne||ne.rangeCount===0)){if(z==="code"){const Se=ne.getRangeAt(0);if(Se.collapsed)return;const Te=A(Se.commonAncestorContainer,"CODE",r);if(Te){const Le=document.createTextNode(Te.textContent??"");Te.replaceWith(Le);const he=document.createRange();he.selectNode(Le),ne.removeAllRanges(),ne.addRange(he)}else{const Le=document.createElement("code");Le.textContent=Se.toString(),Se.deleteContents(),Se.insertNode(Le);const he=document.createRange();he.selectNodeContents(Le),ne.removeAllRanges(),ne.addRange(he)}}else{const Se=z==="bold"?"bold":"italic";document.execCommand(Se,!1)}t0(r),u()}}function p(){const z=window.getSelection();if(!z||z.rangeCount===0)return;const ne=z.getRangeAt(0),Se=A(ne.commonAncestorContainer,"A",r);if(Se){O(Se);return}if(ne.collapsed)return;const Te=ne.toString(),Le=document.createElement("a");Le.href="",Le.textContent=Te,ne.deleteContents(),ne.insertNode(Le),O(Le)}function O(z){M(a,{anchorEl:z,href:z.getAttribute("href")??"",text:z.textContent??"",rect:z.getBoundingClientRect()},!0),requestAnimationFrame(()=>{g(l)?.focus(),g(l)?.select()})}function v(){g(a)&&(g(a).anchorEl.href=g(a).href,g(a).anchorEl.textContent=g(a).text,M(a,null),r.focus(),u())}function b(){if(!g(a))return;const z=document.createTextNode(g(a).anchorEl.textContent??"");g(a).anchorEl.replaceWith(z),M(a,null),r.focus(),u()}function _(z){z.key==="Enter"&&(z.preventDefault(),v())}let C=K(!1),w=K(!1),y=K(!1);function S(){M(C,document.queryCommandState("bold"),!0),M(w,document.queryCommandState("italic"),!0);const z=window.getSelection();z&&z.rangeCount>0?M(y,!!A(z.getRangeAt(0).commonAncestorContainer,"CODE",r)):M(y,!1)}function A(z,ne,Se){let Te=z;for(;Te&&Te!==Se;){if(Te.nodeType===globalThis.Node.ELEMENT_NODE&&Te.tagName===ne)return Te;Te=Te.parentNode}return null}var x=rW();let k;var E=D(x),T=D(E),$=D(T),L=I(T,2);L.__click=function(...z){e.onclose?.apply(this,z)};var P=I(E,2),q=D(P);let R;q.__click=()=>m("bold");var W=I(q,2);let U;W.__click=()=>m("italic");var ie=I(W,2);let ce;ie.__click=()=>m("code");var re=I(ie,2);re.__click=p;var H=I(P,2);H.__input=u,H.__keydown=f,H.__keyup=S,H.__mouseup=S,H.__click=h,mn(H,z=>r=z,()=>r);var ae=I(H,2);{var oe=z=>{var ne=nW(),Se=D(ne),Te=I(D(Se),2);Te.__keydown=_;var Le=I(Se,2),he=I(D(Le),2);he.__keydown=_,mn(he,Ue=>M(l,Ue),()=>g(l));var Ee=I(Le,2),Ye=D(Ee);Ye.__click=v;var rt=I(Ye,2);rt.__click=b,Rn(Te,()=>g(a).text,Ue=>g(a).text=Ue),Rn(he,()=>g(a).href,Ue=>g(a).href=Ue),Z(z,ne)};ue(ae,z=>{g(a)&&z(oe)})}mn(x,z=>t=z,()=>t),fe(()=>{k=Xe(x,1,"inline-edit-popover svelte-1c50n5q",null,k,{above:g(o),below:!g(o)}),Tr(x,`left: ${g(i)??""}px; top: ${g(s)??""}px`),$e($,e.dataName),R=Xe(q,1,"inline-edit-popover__tool-btn svelte-1c50n5q",null,R,{active:g(C)}),U=Xe(W,1,"inline-edit-popover__tool-btn svelte-1c50n5q",null,U,{active:g(w)}),ce=Xe(ie,1,"inline-edit-popover__tool-btn inline-edit-popover__tool-btn--code svelte-1c50n5q",null,ce,{active:g(y)})}),ft("paste",H,d),Z(n,x),bt()}Kt(["click","input","keydown","keyup","mouseup"]);var iW=V('<div><div class="action-edit-popover__header svelte-15w9shn"><span class="action-edit-popover__label svelte-15w9shn">action</span> <button class="action-edit-popover__close svelte-15w9shn" aria-label="Close">×</button></div> <div class="action-edit-popover__row svelte-15w9shn"><label class="action-edit-popover__field-label svelte-15w9shn">Text</label> <input class="action-edit-popover__input svelte-15w9shn" type="text"/></div> <div class="action-edit-popover__row svelte-15w9shn"><label class="action-edit-popover__field-label svelte-15w9shn">URL</label> <input class="action-edit-popover__input svelte-15w9shn" type="text" placeholder="https://..."/></div> <div class="action-edit-popover__actions svelte-15w9shn"><button class="action-edit-popover__btn action-edit-popover__btn--apply svelte-15w9shn">Apply</button> <button class="action-edit-popover__btn action-edit-popover__btn--remove svelte-15w9shn">Remove</button></div></div>');function sW(n,e){vt(e,!0);let t,r,i=K(0),s=K(0),o=K(!0),a=K(sn(e.text)),l=K(sn(e.href));to(()=>{const y=t.getBoundingClientRect(),S=y.width,A=y.height,x=8;let k=e.anchorRect.left+e.anchorRect.width/2-S/2;k<x&&(k=x),k+S>window.innerWidth-x&&(k=window.innerWidth-S-x),M(i,k,!0);const E=e.anchorRect.top-A-x;E>=x?(M(s,E),M(o,!0)):(M(s,e.anchorRect.bottom+x),M(o,!1)),r?.focus(),r?.select();function T(L){t&&!t.contains(L.target)&&c()}function $(L){L.key==="Escape"&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("mousedown",T)}),document.addEventListener("keydown",$),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",$)}});function c(){(g(a)!==e.text||g(l)!==e.href)&&e.onchange(g(a),g(l)),e.onclose()}function u(y){y.key==="Enter"&&(y.preventDefault(),c())}var f=iW();let d;var h=D(f),m=I(D(h),2);m.__click=function(...y){e.onclose?.apply(this,y)};var p=I(h,2),O=I(D(p),2);O.__keydown=u,mn(O,y=>r=y,()=>r);var v=I(p,2),b=I(D(v),2);b.__keydown=u;var _=I(v,2),C=D(_);C.__click=c;var w=I(C,2);w.__click=function(...y){e.onremove?.apply(this,y)},mn(f,y=>t=y,()=>t),fe(()=>{d=Xe(f,1,"action-edit-popover svelte-15w9shn",null,d,{above:g(o),below:!g(o)}),Tr(f,`left: ${g(i)??""}px; top: ${g(s)??""}px`)}),Rn(O,()=>g(a),y=>M(a,y)),Rn(b,()=>g(l),y=>M(l,y)),Z(n,f),bt()}Kt(["click","keydown"]);var oW=V("<option> </option>"),aW=V('<div><div class="code-edit-popover__header svelte-rmoejq"><span class="code-edit-popover__label svelte-rmoejq">code</span> <button class="code-edit-popover__close svelte-rmoejq" aria-label="Close">×</button></div> <div class="code-edit-popover__toolbar svelte-rmoejq"><select class="code-edit-popover__lang-select svelte-rmoejq"><option>No language</option><!></select></div> <div class="code-edit-popover__editor svelte-rmoejq"></div> <div class="code-edit-popover__actions svelte-rmoejq"><button class="code-edit-popover__btn code-edit-popover__btn--apply svelte-rmoejq">Apply</button> <button class="code-edit-popover__btn code-edit-popover__btn--remove svelte-rmoejq">Remove</button></div></div>');function lW(n,e){vt(e,!0);const t=["bash","sh","shell","javascript","typescript","python","html","css","json","yaml","markdown","markdoc","go","rust","java","c","cpp","ruby","php","sql","swift","kotlin","dart","lua","r","perl","scala","haskell","elixir","toml","xml","graphql","dockerfile","diff","plaintext"];let r,i,s=K(void 0),o=K(0),a=K(0),l=K(!0),c=K(sn(e.code)),u=K(sn(e.language));const f=new ms,d=new ms,h=dl.define([{tag:N.keyword,color:"#8839ef"},{tag:[N.atom,N.bool],color:"#fe640b"},{tag:N.number,color:"#fe640b"},{tag:[N.string,N.special(N.string)],color:"#40a02b"},{tag:[N.regexp,N.escape],color:"#ea76cb"},{tag:N.definition(N.variableName),color:"#1e66f5"},{tag:N.local(N.variableName),color:"#1e66f5"},{tag:N.variableName,color:"#4c4f69"},{tag:N.definition(N.propertyName),color:"#1e66f5"},{tag:N.propertyName,color:"#1e66f5"},{tag:[N.typeName,N.className,N.namespace],color:"#df8e1d"},{tag:[N.macroName,N.labelName],color:"#d20f39"},{tag:N.function(N.variableName),color:"#1e66f5"},{tag:N.operator,color:"#04a5e5"},{tag:N.punctuation,color:"#7c7f93"},{tag:N.comment,color:"#9ca0b0",fontStyle:"italic"},{tag:N.lineComment,color:"#9ca0b0",fontStyle:"italic"},{tag:N.blockComment,color:"#9ca0b0",fontStyle:"italic"},{tag:N.meta,color:"#7c7f93"},{tag:N.link,color:"#1e66f5",textDecoration:"underline"},{tag:N.url,color:"#1e66f5"},{tag:N.invalid,color:"#d20f39"}]),m=Qe.theme({"&":{fontSize:"13px",height:"auto",backgroundColor:"var(--ed-surface-1, #f8fafc)",border:"1px solid var(--ed-border-default, #e2e8f0)",borderRadius:"var(--ed-radius-sm, 4px)"},"&.cm-focused":{outline:"none",borderColor:"var(--ed-accent, #3b82f6)",boxShadow:"0 0 0 2px var(--ed-accent-ring, rgba(59, 130, 246, 0.2))"},".cm-scroller":{overflow:"auto",maxHeight:"12rem",fontFamily:"var(--ed-font-mono, 'SF Mono', 'Fira Code', monospace)",lineHeight:"1.5"},".cm-content":{padding:"var(--ed-space-2, 0.5rem)",caretColor:"#1e293b",minHeight:"3rem"},".cm-cursor":{borderLeftColor:"#1e293b"},"&.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"rgba(14, 165, 233, 0.2)"},".cm-selectionBackground":{backgroundColor:"rgba(14, 165, 233, 0.12)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-markdoc-tag":{backgroundColor:"rgba(217, 119, 6, 0.06)",borderRadius:"2px"},".cm-markdoc-bracket":{color:"#94a3b8"},".cm-markdoc-name":{color:"#d97706",fontWeight:"600"}},{dark:!1}),p=ge(()=>t.includes(g(u))||!g(u)?t:[g(u),...t]);function O(){if(!r)return;const R=r.getBoundingClientRect(),W=R.width,U=R.height,ie=8;let ce=e.anchorRect.left+e.anchorRect.width/2-W/2;ce<ie&&(ce=ie),ce+W>window.innerWidth-ie&&(ce=window.innerWidth-W-ie),M(o,ce,!0);const re=e.anchorRect.top-U-ie;re>=ie?(M(a,re),M(l,!0)):(M(a,e.anchorRect.bottom+ie),M(l,!1))}to(()=>{O();function R(U){r&&!r.contains(U.target)&&b()}function W(U){U.key==="Escape"&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("mousedown",R)}),document.addEventListener("keydown",W),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",W)}}),bn(()=>{if(!i)return;const R=qt.create({doc:Cr(()=>g(c)),extensions:[f.of(Ja()),d.of(Cr(()=>g(u))==="markdoc"?Cc():[]),IO(),m,gc(h),gc(X2,{fallback:!0}),Go.of([...jO,...NO,_q,{key:"Mod-Enter",run:()=>(b(),!0)},{key:"Escape",run:()=>(e.onclose(),!0)}]),Qe.updateListener.of(U=>{U.docChanged&&M(c,U.state.doc.toString(),!0)}),Qe.lineWrapping]}),W=new Qe({state:R,parent:i});return M(s,W,!0),W.focus(),v(W,Cr(()=>g(u))),requestAnimationFrame(()=>O()),()=>{M(s,void 0),W.destroy()}});function v(R,W){const U=W?.trim();if(!U)return;if(U==="markdoc"){R.dispatch({effects:[f.reconfigure(Ja()),d.reconfigure(Cc())]});return}R.dispatch({effects:d.reconfigure([])});const ie=J.matchLanguageName(HC,U,!0);ie&&ie.load().then(ce=>{R.dispatch({effects:f.reconfigure(ce)})}).catch(console.error)}function b(){g(c)!==e.code&&e.onchange(g(c)),e.onclose()}function _(R){const W=R.target;M(u,W.value,!0),e.onlanguagechange(g(u)),g(s)&&v(g(s),g(u))}var C=aW();let w;var y=D(C),S=I(D(y),2);S.__click=function(...R){e.onclose?.apply(this,R)};var A=I(y,2),x=D(A);x.__change=_;var k=D(x);k.value=k.__value="";var E=I(k);Qt(E,17,()=>g(p),nn,(R,W)=>{var U=oW(),ie=D(U),ce={};fe(()=>{$e(ie,g(W)),ce!==(ce=g(W))&&(U.value=(U.__value=g(W))??"")}),Z(R,U)});var T;_f(x);var $=I(A,2);mn($,R=>i=R,()=>i);var L=I($,2),P=D(L);P.__click=b;var q=I(P,2);q.__click=function(...R){e.onremove?.apply(this,R)},mn(C,R=>r=R,()=>r),fe(()=>{w=Xe(C,1,"code-edit-popover svelte-rmoejq",null,w,{above:g(l),below:!g(l)}),Tr(C,`left: ${g(o)??""}px; top: ${g(a)??""}px`),T!==(T=g(u))&&(x.value=(x.__value=g(u))??"",ic(x,g(u)))}),Z(n,C),bt()}Kt(["click","change"]);const Zn="";async function vw(){const n=await fetch(`${Zn}/api/tree`);if(!n.ok)throw new Error(`Failed to load tree: ${n.status}`);return n.json()}async function Mp(n){const e=await fetch(`${Zn}/api/files/${encodeURIComponent(n)}`);if(!e.ok)throw new Error(`Failed to load file: ${e.status}`);return e.json()}async function cW(n,e){const t=await fetch(`${Zn}/api/files/${encodeURIComponent(n)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})});if(!t.ok)throw new Error(`Failed to save file: ${t.status}`)}async function uW(n,e){const t=await fetch(`${Zn}/api/preview`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:e})});if(!t.ok)throw new Error(`Preview failed: ${t.status}`);return t.text()}async function fW(n,e){const t=await fetch(`${Zn}/api/preview-data`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:e})});if(!t.ok)throw new Error(`Preview data failed: ${t.status}`);return t.json()}async function dW(){const n=await fetch(`${Zn}/api/config`);if(!n.ok)throw new Error(`Config failed: ${n.status}`);return n.json()}async function hW(){const n=await fetch(`${Zn}/api/route-rules`);if(!n.ok)throw new Error(`Failed to load route rules: ${n.status}`);return(await n.json()).routeRules}async function pW(n){const e=await fetch(`${Zn}/api/route-rules`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({routeRules:n})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to update route rules: ${e.status}`)}}async function mW(n){const e=await fetch(`${Zn}/api/pages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to create page: ${e.status}`)}return e.json()}async function bw(n){const e=await fetch(`${Zn}/api/directories`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to create directory: ${e.status}`)}return e.json()}async function gW(n,e){const t=await fetch(`${Zn}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPath:n,newName:e})});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(r.error??`Failed to rename: ${t.status}`)}return t.json()}async function OW(n){const e=await fetch(`${Zn}/api/duplicate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to duplicate: ${e.status}`)}return e.json()}async function vW(n){const e=await fetch(`${Zn}/api/files/${encodeURIComponent(n)}`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to delete: ${e.status}`)}}async function bW(n){const e=await fetch(`${Zn}/api/toggle-draft`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to toggle draft: ${e.status}`)}return e.json()}async function yW(){const n=await fetch(`${Zn}/api/assets`);if(!n.ok)throw new Error(`Failed to load assets: ${n.status}`);return(await n.json()).images}async function wW(n){const e=new FormData;e.append("file",n);const t=await fetch(`${Zn}/api/assets/upload`,{method:"POST",body:e});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(r.error??`Upload failed: ${t.status}`)}return t.json()}async function _W(){const n=await fetch(`${Zn}/api/runes`);if(!n.ok)throw new Error(`Failed to load runes: ${n.status}`);return(await n.json()).runes}async function kW(){const n=await fetch(`${Zn}/api/aggregated`);return n.ok?n.json():{}}function xW(n){const e=new EventSource(`${Zn}/api/events`);return e.addEventListener("file-changed",t=>n("file-changed",JSON.parse(t.data))),e.addEventListener("file-created",t=>n("file-created",JSON.parse(t.data))),e.addEventListener("file-deleted",t=>n("file-deleted",JSON.parse(t.data))),()=>e.close()}var SW=V('<div class="image-edit-modal__empty svelte-1yd8alm">Loading images...</div>'),AW=V('<div class="image-edit-modal__empty svelte-1yd8alm">No images found. Upload one to get started.</div>'),CW=V('<div class="image-edit-modal__empty svelte-1yd8alm"> </div>'),TW=V('<button><img loading="lazy" class="svelte-1yd8alm"/></button>'),PW=V('<div class="image-edit-modal__grid svelte-1yd8alm"></div>'),EW=V('<div class="image-edit-backdrop svelte-1yd8alm" role="dialog" aria-modal="true" aria-label="Select image"><div><div class="image-edit-modal__header svelte-1yd8alm"><span class="image-edit-modal__label svelte-1yd8alm">image</span> <button class="image-edit-modal__close svelte-1yd8alm" aria-label="Close">×</button></div> <div class="image-edit-modal__search svelte-1yd8alm"><input class="image-edit-modal__search-input svelte-1yd8alm" type="text" placeholder="Search images..."/></div> <div class="image-edit-modal__grid-area svelte-1yd8alm"><!></div> <div class="image-edit-modal__upload-bar svelte-1yd8alm"><button class="image-edit-modal__upload-btn svelte-1yd8alm"> </button> <span class="image-edit-modal__upload-hint svelte-1yd8alm">or drag & drop</span> <input type="file" accept="image/*" style="display: none"/></div> <div class="image-edit-modal__footer svelte-1yd8alm"><div class="image-edit-modal__row svelte-1yd8alm"><label class="image-edit-modal__field-label svelte-1yd8alm" for="image-alt">Alt</label> <input id="image-alt" class="image-edit-modal__input svelte-1yd8alm" type="text" placeholder="Describe this image..."/></div> <div class="image-edit-modal__actions svelte-1yd8alm"><button class="image-edit-modal__btn image-edit-modal__btn--apply svelte-1yd8alm">Apply</button> <button class="image-edit-modal__btn image-edit-modal__btn--remove svelte-1yd8alm">Remove</button></div></div></div></div>');function $W(n,e){vt(e,!0);let t,r,i,s=K(sn([])),o=K(!0),a=K(!1),l=K(""),c=K(sn(e.currentSrc)),u=K(sn(e.currentAlt)),f=K(!1);const d=ge(()=>g(l)?g(s).filter(he=>he.name.toLowerCase().includes(g(l).toLowerCase())):g(s));to(()=>{h();function he(Ee){Ee.key==="Escape"&&e.onclose()}return document.addEventListener("keydown",he),()=>document.removeEventListener("keydown",he)});async function h(){M(o,!0);try{M(s,await yW(),!0)}catch{M(s,[],!0)}M(o,!1)}function m(he){he.target===he.currentTarget&&e.onclose()}function p(he){if(M(c,he.path,!0),!g(u)){const Ee=he.name.replace(/\.[^.]+$/,"").replace(/[-_]/g," ");M(u,Ee,!0)}}function O(){g(c)&&e.onchange(g(c),g(u))}function v(){r?.click()}async function b(he){const Ee=he.target,Ye=Ee.files?.[0];Ye&&(await _(Ye),Ee.value="")}async function _(he){if(he.type.startsWith("image/")){M(a,!0);try{const Ee=await wW(he);if(await h(),M(c,Ee.path,!0),!g(u)){const Ye=Ee.name.replace(/\.[^.]+$/,"").replace(/[-_]/g," ");M(u,Ye,!0)}}catch(Ee){console.error("Upload failed:",Ee)}M(a,!1)}}function C(he){he.preventDefault(),M(f,!0)}function w(){M(f,!1)}async function y(he){he.preventDefault(),M(f,!1);const Ee=he.dataTransfer?.files[0];Ee&&await _(Ee)}function S(he){he.key==="Enter"&&(he.preventDefault(),O())}var A=EW();A.__click=m,A.__keydown=()=>{};var x=D(A);let k;var E=D(x),T=I(D(E),2);T.__click=function(...he){e.onclose?.apply(this,he)};var $=I(E,2),L=D($),P=I($,2),q=D(P);{var R=he=>{var Ee=SW();Z(he,Ee)},W=he=>{var Ee=AW();Z(he,Ee)},U=he=>{var Ee=CW(),Ye=D(Ee);fe(()=>$e(Ye,`No images match "${g(l)??""}"`)),Z(he,Ee)},ie=he=>{var Ee=PW();Qt(Ee,21,()=>g(d),Ye=>Ye.path,(Ye,rt)=>{var Ue=TW();let Ke;Ue.__click=()=>p(g(rt));var Me=D(Ue);fe(()=>{Ke=Xe(Ue,1,"image-edit-modal__thumb svelte-1yd8alm",null,Ke,{selected:g(c)===g(rt).path}),Et(Ue,"title",g(rt).name),Et(Me,"src",g(rt).path),Et(Me,"alt",g(rt).name)}),Z(Ye,Ue)}),Z(he,Ee)};ue(q,he=>{g(o)?he(R):g(d).length===0&&!g(l)?he(W,1):g(d).length===0?he(U,2):he(ie,!1)})}var ce=I(P,2),re=D(ce);re.__click=v;var H=D(re),ae=I(re,4);ae.__change=b,mn(ae,he=>r=he,()=>r);var oe=I(ce,2),z=D(oe),ne=I(D(z),2);ne.__keydown=S,mn(ne,he=>i=he,()=>i);var Se=I(z,2),Te=D(Se);Te.__click=O;var Le=I(Te,2);Le.__click=function(...he){e.onremove?.apply(this,he)},mn(x,he=>t=he,()=>t),fe(()=>{k=Xe(x,1,"image-edit-modal svelte-1yd8alm",null,k,{"drag-over":g(f)}),re.disabled=g(a),$e(H,g(a)?"Uploading...":"Upload image"),Te.disabled=!g(c)}),ft("dragover",x,C),ft("dragleave",x,w),ft("drop",x,y),Rn(L,()=>g(l),he=>M(l,he)),Rn(ne,()=>g(u),he=>M(u,he)),Z(n,A),bt()}Kt(["click","keydown","change"]);var QW=V('<div class="icon-picker-modal__empty svelte-1rc2pkk">No icons available.</div>'),LW=V('<div class="icon-picker-modal__empty svelte-1rc2pkk"> </div>'),MW=V('<button><span class="icon-picker-modal__icon-svg svelte-1rc2pkk"><!></span> <span class="icon-picker-modal__icon-name svelte-1rc2pkk"> </span></button>'),qW=V('<div class="icon-picker-modal__group svelte-1rc2pkk"><div class="icon-picker-modal__group-label svelte-1rc2pkk"> </div> <div class="icon-picker-modal__grid svelte-1rc2pkk"></div></div>'),DW=V('<div class="icon-picker-backdrop svelte-1rc2pkk" role="dialog" aria-modal="true" aria-label="Select icon"><div class="icon-picker-modal svelte-1rc2pkk"><div class="icon-picker-modal__header svelte-1rc2pkk"><span class="icon-picker-modal__label svelte-1rc2pkk">icon</span> <button class="icon-picker-modal__close svelte-1rc2pkk" aria-label="Close">×</button></div> <div class="icon-picker-modal__search svelte-1rc2pkk"><input class="icon-picker-modal__search-input svelte-1rc2pkk" type="text" placeholder="Search icons..."/></div> <div class="icon-picker-modal__grid-area svelte-1rc2pkk"><!></div> <div class="icon-picker-modal__footer svelte-1rc2pkk"><button class="icon-picker-modal__btn icon-picker-modal__btn--apply svelte-1rc2pkk">Apply</button> <button class="icon-picker-modal__btn icon-picker-modal__btn--cancel svelte-1rc2pkk">Cancel</button></div></div></div>');function RW(n,e){vt(e,!0);let t,r=K(sn(e.currentIcon)),i=K("");const s=ge(()=>{const x=[];for(const[k,E]of Object.entries(e.icons))for(const[T,$]of Object.entries(E)){const L=k==="global"?T:`${k}/${T}`;x.push({name:T,qualifiedName:L,group:k,svg:$})}return x}),o=ge(()=>g(i)?g(s).filter(x=>x.name.toLowerCase().includes(g(i).toLowerCase())||x.qualifiedName.toLowerCase().includes(g(i).toLowerCase())):g(s)),a=ge(()=>{const x=new Map;for(const k of g(o)){const E=x.get(k.group)??[];E.push(k),x.set(k.group,E)}return x});to(()=>{t?.focus();function x(k){k.key==="Escape"&&e.onclose()}return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)});function l(x){x.target===x.currentTarget&&e.onclose()}function c(x){M(r,x.qualifiedName,!0)}function u(){g(r)&&e.onchange(g(r))}var f=DW();f.__click=l,f.__keydown=()=>{};var d=D(f),h=D(d),m=I(D(h),2);m.__click=function(...x){e.onclose?.apply(this,x)};var p=I(h,2),O=D(p);mn(O,x=>t=x,()=>t);var v=I(p,2),b=D(v);{var _=x=>{var k=QW();Z(x,k)},C=x=>{var k=LW(),E=D(k);fe(()=>$e(E,`No icons match "${g(i)??""}"`)),Z(x,k)},w=x=>{var k=pn(),E=at(k);Qt(E,17,()=>[...g(a)],([T,$])=>T,(T,$)=>{var L=ge(()=>Dc(g($),2));let P=()=>g(L)[0],q=()=>g(L)[1];var R=qW(),W=D(R),U=D(W),ie=I(W,2);Qt(ie,21,q,ce=>ce.qualifiedName,(ce,re)=>{var H=MW();let ae;H.__click=()=>c(g(re));var oe=D(H),z=D(oe);u_(z,()=>g(re).svg);var ne=I(oe,2),Se=D(ne);fe(()=>{ae=Xe(H,1,"icon-picker-modal__icon svelte-1rc2pkk",null,ae,{selected:g(r)===g(re).qualifiedName}),Et(H,"title",g(re).qualifiedName),$e(Se,g(re).name)}),Z(ce,H)}),fe(()=>$e(U,P())),Z(T,R)}),Z(x,k)};ue(b,x=>{g(s).length===0?x(_):g(o).length===0?x(C,1):x(w,!1)})}var y=I(v,2),S=D(y);S.__click=u;var A=I(S,2);A.__click=function(...x){e.onclose?.apply(this,x)},fe(()=>S.disabled=!g(r)),Rn(O,()=>g(i),x=>M(i,x)),Z(n,f),bt()}Kt(["click","keydown"]);var IW=V('<div class="block-editor__empty svelte-10brcoc"><svg class="block-editor__empty-icon svelte-10brcoc" width="40" height="40" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="6" y="8" width="36" height="32" rx="3"></rect><line x1="14" y1="18" x2="34" y2="18"></line><line x1="14" y1="24" x2="28" y2="24"></line><line x1="14" y1="30" x2="22" y2="30"></line></svg> <span class="block-editor__empty-text svelte-10brcoc">No content blocks yet</span> <span class="block-editor__empty-hint svelte-10brcoc">Use the + button to add your first block</span></div>'),NW=V('<span class="block-editor__fm-desc svelte-10brcoc"> </span>'),BW=V('<div class="block-editor__fm-header svelte-10brcoc"><div class="block-editor__fm-info svelte-10brcoc"><span class="block-editor__fm-title svelte-10brcoc"> </span> <!></div> <button title="Edit frontmatter"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11.5 1.5l3 3L5 14H2v-3L11.5 1.5z"></path></svg> Edit</button></div>'),jW=V('<button class="block-editor__insert-marker block-editor__insert-marker--top svelte-10brcoc" title="Insert block above"><svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="5" y1="2" x2="5" y2="8"></line><line x1="2" y1="5" x2="8" y2="5"></line></svg></button> <button class="block-editor__insert-marker block-editor__insert-marker--bottom svelte-10brcoc" title="Insert block below"><svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="5" y1="2" x2="5" y2="8"></line><line x1="2" y1="5" x2="8" y2="5"></line></svg></button>',1),zW=V('<button class="block-editor__hover-label svelte-10brcoc"> </button>'),ZW=V('<div><div class="block-editor__block-cell svelte-10brcoc"><!></div> <!> <!></div>'),FW=V('<div class="block-editor__popover-backdrop svelte-10brcoc"></div> <div class="block-editor__popover svelte-10brcoc"><!></div>',1),XW=V('<div class="block-editor svelte-10brcoc"><!> <div class="block-editor__stage svelte-10brcoc"><div class="block-editor__scroll svelte-10brcoc"><div class="block-editor__list-wrap svelte-10brcoc"><!> <!></div></div></div> <!> <!> <!> <!> <!> <!> <!> <!></div>');function VW(n,e){vt(e,!0);let t=Pt(e,"highlightCss",3,""),r=Pt(e,"highlightTransform",3,null),i=Pt(e,"showInsertMenu",3,!0),s=Pt(e,"frontmatter",19,()=>({})),o=Pt(e,"readOnly",3,!1),a=Pt(e,"communityTags",3,null),l=Pt(e,"communityPostTransforms",3,null),c=Pt(e,"communityStyles",3,null),u=Pt(e,"aggregated",19,()=>({})),f=K(sn([])),d=ge(()=>rN(e.runes)),h="";function m(G,ee){if(G.length===0)return;const de=new Set(G.map(it=>it.id)),ye=new Set(ee.map(it=>it.id)),De=G.filter(it=>!ye.has(it.id)),st=ee.filter(it=>!de.has(it.id));if(De.length===0||st.length===0)return;const nt=[...De];for(const it of st){let ut=-1,Nt=1/0;for(let pt=0;pt<nt.length;pt++){const Mn=nt[pt],vn=Mn.type===it.type?0:1e3,gt=Math.abs(Mn.startLine-it.startLine)+vn;gt<Nt&&(Nt=gt,ut=pt)}ut>=0&&(it.id=nt[ut].id,nt.splice(ut,1))}}bn(()=>{const G=e.bodyContent;if(G!==h){const ee=_A(G);m(g(f),ee),M(f,ee,!0),h=G,M(k,null),M(S,!1),M(T,null),M(Me,null),M(C,null)}});function p(){const G=Hm(g(f));h=G,e.onchange(G)}let O=ge(()=>Z1(g(f)));function v(G){const ee=g(O)[G];if(!ee)return[0,0];if(ee.type==="prose"){const ye=ee.children[0],De=ee.children[ee.children.length-1],st=g(f).indexOf(ye),nt=g(f).indexOf(De);return[st,nt]}const de=g(f).indexOf(ee);return[de,de]}function b(G,ee){const[de,ye]=v(G),De=g(f).slice(de,ye+1);m(De,ee.children),M(f,[...g(f).slice(0,de),...ee.children,...g(f).slice(ye+1)],!0),p()}function _(G,ee){const de=g(O)[G];if(!de||de.type!=="prose")return;const ye=de.children[ee.childIndex];if(!ye)return;const[De]=v(G),st=De+ee.childIndex;if(ye.type==="fence"){const pt=ye,Mn=pt.code,vn=pt.language,gt=ye.source.split(`
|
|
599
599
|
`)[0],Fn=gt.match(/^(`{3,}|~{3,})/),Vr=Fn?Fn[1]:"```";M(ke,{blockIndex:st,rect:ee.rect,mapping:{source:ye.source,code:Mn,language:vn,opener:gt,delimiter:Vr}},!0);return}const nt=ye.source.trim();let it="",ut=nt;if(ye.type==="heading"){const pt=nt.match(/^(#{1,6}\s+)(.*)/);pt&&(it=pt[1],ut=pt[2])}else if(ye.type==="quote"){const pt=nt.match(/^(>\s*)(.*)/);pt&&(it=pt[1],ut=pt[2])}const Nt={dataName:ye.type,text:yi(ut),source:nt,sourcePrefix:it,inlineSource:ut};M(C,{editorIndex:G,childIndex:ee.childIndex,flatIndex:st,inlineSource:ut,rect:ee.rect,mapping:Nt},!0)}let C=K(null);function w(G){if(!g(C))return;const ee=g(f)[g(C).flatIndex];if(!ee)return;const de=g(C).mapping.sourcePrefix+G;let ye;ee.type==="heading"?(ye={...ee,text:G,source:""},ye.source=Km(ye)):ye={...ee,source:de},M(C,{...g(C),inlineSource:G,mapping:{...g(C).mapping,text:yi(G),source:de,inlineSource:G}},!0),oe(g(C).flatIndex,ye)}function y(){M(C,null)}let S=K(!1),A=ge(()=>s().title||""),x=ge(()=>()=>{const G=s().description||"";return G.length>80?G.slice(0,80)+"...":G}),k=K(null),E=K(null),T=K(null),$=K(null),L=K(0);const P=420,q=12;function R(G){if(!G.target.closest(".edit-panel__header")||G.target.closest("button"))return;G.preventDefault();const de=G.currentTarget,ye=de.getBoundingClientRect(),De=G.clientX,st=G.clientY,nt=ye.left,it=ye.top;function ut(pt){de.style.left=`${nt+(pt.clientX-De)}px`,de.style.top=`${it+(pt.clientY-st)}px`}function Nt(){window.removeEventListener("mousemove",ut),window.removeEventListener("mouseup",Nt)}window.addEventListener("mousemove",ut),window.addEventListener("mouseup",Nt)}let W=ge(()=>{if(!g(T))return"";const G=window.innerWidth,ee=window.innerHeight;let de=g(T).x+q;de+P>G-16&&(de=g(T).x-P-q),de<16&&(de=G-P-16);let ye=g(T).y;const De=ee-120,st=ee-Math.min(600,De)-16;return ye>st&&(ye=st),ye<60&&(ye=60),`left: ${de}px; top: ${ye}px; max-height: min(600px, ${De}px);`});function U(G,ee,de){M(S,!1),g(O)[G]&&(g(k)===G?(M(k,null),M(T,null),M($,null)):(ah(L),M(k,G,!0),M(T,{x:ee,y:de},!0),M($,null)))}function ie(G,ee,de,ye){M(S,!1),ah(L),M(k,G,!0),M(T,{x:ee,y:de},!0),M($,ye??null,!0)}function ce(G){M(k,null),g(S)?(M(S,!1),M(T,null)):(M(S,!0),M(T,{x:G.clientX,y:G.clientY},!0))}function re(G){if(!o()&&G.key==="Escape"){if(g(C)){y();return}(g(k)!==null||g(S))&&(M(k,null),M(S,!1),M(T,null),M($,null))}}function H(){(g(k)!==null||g(S))&&(M(k,null),M(S,!1),M(T,null),M($,null))}function ae(){g(T)&&M(T,{...g(T)},!0)}function oe(G,ee){M(f,g(f).map((de,ye)=>ye===G?ee:de),!0),p()}function z(G){const[ee,de]=v(G);g(k)!==null&&(g(k)===G?M(k,null):g(k)>G&&ah(k,-1)),M(f,[...g(f).slice(0,ee),...g(f).slice(de+1)],!0),p()}let ne=K(null),Se=K(null);function Te(G,ee){M(ne,ee,!0),M(k,null),M(S,!1),M(T,null),G.dataTransfer&&(G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",String(ee)))}function Le(G,ee){G.preventDefault(),G.dataTransfer&&(G.dataTransfer.dropEffect="move"),M(Se,ee,!0)}function he(G,ee){if(G.preventDefault(),g(ne)!==null&&g(ne)!==ee){const[de,ye]=v(g(ne)),De=g(f).slice(de,ye+1),st=[...g(f).slice(0,de),...g(f).slice(ye+1)];let nt;if(ee>=g(O).length)nt=st.length;else{const[it]=v(ee);nt=it>ye?it-De.length:it}if(st.splice(nt,0,...De),M(f,st,!0),g(k)!==null)if(g(k)===g(ne))M(k,ee>g(ne)?ee-1:ee,!0);else{let it=g(k);g(ne)<g(k)&&ee>=g(k)?it--:g(ne)>g(k)&&ee<=g(k)&&it++,M(k,it,!0)}p()}M(ne,null),M(Se,null)}let Ee=K(!1),Ye=K(null);function rt(G){M(Ye,G,!0),M(Ee,!0)}function Ue(){M(Ee,!1),M(Ye,null)}function Ke(G,ee){let de;const ye=`blk_new_${Date.now()}`;switch(G){case"heading":de={id:ye,type:"heading",source:"## New heading",startLine:0,endLine:0,level:2,text:"New heading"};break;case"paragraph":de={id:ye,type:"paragraph",source:"New paragraph text.",startLine:0,endLine:0};break;case"fence":de={id:ye,type:"fence",source:"```\n\n```",startLine:0,endLine:0,language:"",code:""};break;case"hr":de={id:ye,type:"hr",source:"---",startLine:0,endLine:0};break;case"rune":{const nt=ee??"hint",it=g(d).get(nt),ut=it?.selfClosing??!1,Nt={};if(it)for(const[vn,gt]of Object.entries(it.attributes))gt.required&&(Nt[vn]=gt.values?.[0]??"");const pt=Object.entries(Nt).map(([vn,gt])=>`${vn}="${gt}"`).join(" "),Mn=pt?" "+pt:"";if(ut)de={id:ye,type:"rune",source:`{% ${nt}${Mn} /%}`,startLine:0,endLine:0,runeName:nt,selfClosing:!0,attributes:Nt,innerContent:""};else{const vn=it?.example?iN(it.example,nt):"";de={id:ye,type:"rune",source:`{% ${nt}${Mn} %}
|
|
600
600
|
${vn}
|
|
601
601
|
{% /${nt} %}`,startLine:0,endLine:0,runeName:nt,selfClosing:!1,attributes:Nt,innerContent:vn}}break}}const De=g(Ye)??g(O).length;let st;if(De>=g(O).length)st=g(f).length;else{const[nt]=v(De);st=nt}if(M(f,[...g(f).slice(0,st),de,...g(f).slice(st)],!0),M(Ye,null),M(Ee,!1),M(S,!1),G==="rune"){const nt=Z1(g(f));M(k,nt.findIndex(it=>it.type==="rune"&&it===g(f)[st]),!0),g(k)===-1&&M(k,null)}else M(k,null);p()}let Me=K(null);function xt(G,ee){const de=g(O)[G];if(!de||de.type!=="rune")return;const[ye]=v(G),De=g(f)[ye];if(De.type!=="rune")return;const st=De,nt=ye;if(ee.editType==="link"){const ut=HB(st.innerContent,ee.text,ee.href??"");if(!ut)return;M(St,{blockIndex:nt,rect:ee.rect,mapping:ut},!0);return}if(ee.editType==="code"){const ut=JB(st.innerContent,ee.text);if(!ut)return;M(ke,{blockIndex:nt,rect:ee.rect,mapping:ut},!0);return}if(ee.editType==="image"){const ut=ee.href??"",Nt=nj(st.innerContent,ut);if(!Nt)return;M(te,{blockIndex:nt,mapping:Nt},!0);return}if(ee.editType==="icon"){const ut=ee.iconName??"",Nt=ij(st.innerContent,ut);if(!Nt)return;M(qe,{blockIndex:nt,mapping:Nt},!0);return}const it=JA(st.innerContent,ee.dataName,ee.text);it&&M(Me,{blockIndex:nt,dataName:ee.dataName,inlineSource:it.inlineSource,rect:ee.rect,mapping:it},!0)}function Vt(G){if(!g(Me))return;const ee=g(f)[g(Me).blockIndex];if(ee.type!=="rune")return;const de=ee,ye=GB(de.innerContent,g(Me).mapping,G),De={...de,innerContent:ye,source:""};De.source=tr(De),M(Me,{...g(Me),inlineSource:G,mapping:{...g(Me).mapping,text:yi(G),source:g(Me).mapping.sourcePrefix+G,inlineSource:G}},!0),oe(g(Me).blockIndex,De)}function En(){M(Me,null)}let St=K(null);function on(G,ee){if(!g(St))return;const de=g(f)[g(St).blockIndex];if(de.type!=="rune")return;const ye=de,De=KB(ye.innerContent,g(St).mapping,G,ee),st={...ye,innerContent:De,source:""};st.source=tr(st),oe(g(St).blockIndex,st)}function Cn(){if(!g(St))return;const G=g(St).blockIndex,ee=g(f)[G];if(ee.type!=="rune")return;const de=ee,ye=de.innerContent.replace(g(St).mapping.source+`
|
|
@@ -605,13 +605,13 @@ ${vn}
|
|
|
605
605
|
`+g(ke).mapping.delimiter;M(ke,{...g(ke),mapping:{...g(ke).mapping,language:G,opener:gt,source:Fn}},!0),oe(g(ke).blockIndex,pt);return}if(ee.type!=="rune")return;const de=ee,ye=tj(de.innerContent,g(ke).mapping,G),De={...de,innerContent:ye,source:""};De.source=tr(De);const nt=g(ke).mapping.opener.slice(g(ke).mapping.delimiter.length).replace(/^\w*/,"").trim(),it=g(ke).mapping.delimiter+G+(nt?" "+nt:""),ut=it+`
|
|
606
606
|
`+g(ke).mapping.code+`
|
|
607
607
|
`+g(ke).mapping.delimiter;M(ke,{...g(ke),mapping:{...g(ke).mapping,language:G,opener:it,source:ut}},!0),oe(g(ke).blockIndex,De)}let te=K(null);function ve(G,ee){if(!g(te))return;const de=g(f)[g(te).blockIndex];if(de.type!=="rune")return;const ye=de,De=rj(ye.innerContent,g(te).mapping,ee,G),st={...ye,innerContent:De,source:""};st.source=tr(st),oe(g(te).blockIndex,st)}function xe(){if(!g(te))return;const G=g(te).blockIndex,ee=g(f)[G];if(ee.type!=="rune")return;const de=ee,ye=de.innerContent.replace(g(te).mapping.source+`
|
|
608
|
-
`,"").replace(g(te).mapping.source,""),De={...de,innerContent:ye,source:""};De.source=tr(De),M(te,null),oe(G,De)}function Ce(){M(te,null)}let qe=K(null);function At(G){if(!g(qe))return;const ee=g(f)[g(qe).blockIndex];if(ee.type!=="rune")return;const de=ee,ye=sj(de.innerContent,g(qe).mapping,G),De={...de,innerContent:ye,source:""};De.source=tr(De),oe(g(qe).blockIndex,De)}function ht(){M(qe,null)}function Je(G,ee,de,ye){if(g(k)===null)return;const[De]=v(g(k));M(ke,null),M(Me,{blockIndex:De,dataName:G,inlineSource:ee,rect:de,mapping:ye},!0)}function Ct(G,ee,de,ye){if(g(k)===null)return;const[De]=v(g(k));M(Me,null),M(ke,{blockIndex:De,rect:de,mapping:ye},!0)}let mt=ge(()=>{const G=new Map;for(const ee of e.runes){const de=G.get(ee.category)??[];de.push(ee),G.set(ee.category,de)}return G});var lt=
|
|
608
|
+
`,"").replace(g(te).mapping.source,""),De={...de,innerContent:ye,source:""};De.source=tr(De),M(te,null),oe(G,De)}function Ce(){M(te,null)}let qe=K(null);function At(G){if(!g(qe))return;const ee=g(f)[g(qe).blockIndex];if(ee.type!=="rune")return;const de=ee,ye=sj(de.innerContent,g(qe).mapping,G),De={...de,innerContent:ye,source:""};De.source=tr(De),oe(g(qe).blockIndex,De)}function ht(){M(qe,null)}function Je(G,ee,de,ye){if(g(k)===null)return;const[De]=v(g(k));M(ke,null),M(Me,{blockIndex:De,dataName:G,inlineSource:ee,rect:de,mapping:ye},!0)}function Ct(G,ee,de,ye){if(g(k)===null)return;const[De]=v(g(k));M(Me,null),M(ke,{blockIndex:De,rect:de,mapping:ye},!0)}let mt=ge(()=>{const G=new Map;for(const ee of e.runes){const de=G.get(ee.category)??[];de.push(ee),G.set(ee.category,de)}return G});var lt=XW();ft("keydown",Ro,re),ft("resize",Ro,ae);var yt=D(lt);{var Oe=G=>{var ee=IW();Z(G,ee)};ue(yt,G=>{g(f).length===0&&!o()&&G(Oe)})}var _e=I(yt,2),Be=D(_e),tt=D(Be),Ve=D(tt);{var jt=G=>{var ee=BW(),de=D(ee),ye=D(de),De=D(ye),st=I(ye,2);{var nt=pt=>{var Mn=NW(),vn=D(Mn);fe(gt=>$e(vn,gt),[()=>g(x)()]),Z(pt,Mn)},it=ge(()=>g(x)());ue(st,pt=>{g(it)&&pt(nt)})}var ut=I(de,2);let Nt;ut.__click=pt=>ce(pt),fe(()=>{$e(De,g(A)||"Untitled"),Nt=Xe(ut,1,"block-editor__fm-edit svelte-10brcoc",null,Nt,{active:g(S)})}),Z(G,ee)};ue(Ve,G=>{o()||G(jt)})}var en=I(Ve,2);Qt(en,19,()=>g(O),G=>G.id,(G,ee,de)=>{var ye=ZW();let De;var st=D(ye),nt=D(st);{var it=gt=>{{let Fn=ge(()=>o()?void 0:hn=>_(g(de),hn)),Vr=ge(()=>o()?void 0:hn=>U(g(de),hn.x,hn.y)),$r=ge(()=>o()?void 0:hn=>Te(hn,g(de))),Ho=ge(()=>o()?void 0:hn=>Le(hn,g(de))),Ko=ge(()=>o()?void 0:hn=>he(hn,g(de)));hX(gt,{get block(){return g(ee)},get themeConfig(){return e.themeConfig},get themeCss(){return e.themeCss},get highlightCss(){return t()},get highlightTransform(){return r()},get communityTags(){return a()},get communityPostTransforms(){return l()},get communityStyles(){return c()},get aggregated(){return u()},get readOnly(){return o()},get onsectionclick(){return g(Fn)},get onblockclick(){return g(Vr)},get ondragstart(){return g($r)},get ondragover(){return g(Ho)},get ondrop(){return g(Ko)}})}},ut=gt=>{{let Fn=ge(()=>o()?void 0:hn=>xt(g(de),hn)),Vr=ge(()=>o()?void 0:hn=>ie(g(de),hn.x,hn.y,hn.nestedRuneIndex)),$r=ge(()=>o()?void 0:hn=>Te(hn,g(de))),Ho=ge(()=>o()?void 0:hn=>Le(hn,g(de))),Ko=ge(()=>o()?void 0:hn=>he(hn,g(de)));cX(gt,{get block(){return g(ee)},get themeConfig(){return e.themeConfig},get themeCss(){return e.themeCss},get highlightCss(){return t()},get highlightTransform(){return r()},get communityTags(){return a()},get communityPostTransforms(){return l()},get communityStyles(){return c()},get aggregated(){return u()},get readOnly(){return o()},get onsectionclick(){return g(Fn)},get onruneclick(){return g(Vr)},get ondragstart(){return g($r)},get ondragover(){return g(Ho)},get ondrop(){return g(Ko)}})}};ue(nt,gt=>{g(ee).type==="prose"?gt(it):gt(ut,!1)})}var Nt=I(st,2);{var pt=gt=>{var Fn=jW(),Vr=at(Fn);Vr.__click=()=>rt(g(de));var $r=I(Vr,2);$r.__click=()=>rt(g(de)+1),Z(gt,Fn)};ue(Nt,gt=>{!o()&&i()&>(pt)})}var Mn=I(Nt,2);{var vn=gt=>{var Fn=zW();Fn.__click=$r=>U(g(de),$r.clientX,$r.clientY);var Vr=D(Fn);fe($r=>{Et(Fn,"aria-pressed",g(k)===g(de)),$e(Vr,$r)},[()=>Ov(g(ee))]),Z(gt,Fn)};ue(Mn,gt=>{o()||gt(vn)})}fe(()=>De=Xe(ye,1,"block-editor__row svelte-10brcoc",null,De,{hovered:!o()&&g(E)===g(de),active:!o()&&g(k)===g(de),"drag-source":!o()&&g(ne)===g(de),"drag-over":!o()&&g(Se)===g(de)&&g(ne)!==g(de)})),ft("mouseenter",ye,()=>{o()||M(E,g(de),!0)}),ft("mouseleave",ye,()=>{!o()&&g(E)===g(de)&&M(E,null)}),Z(G,ye)});var cn=I(_e,2);{var tn=G=>{var ee=FW(),de=at(ee);de.__mousedown=()=>{M(k,null),M(S,!1),M(T,null),M($,null)};var ye=I(de,2);ye.__mousedown=R;var De=D(ye);{var st=ut=>{ZV(ut,{onclose:()=>{M(S,!1),M(T,null)}})},nt=ut=>{const Nt=ge(()=>g(f)[v(g(k))[0]]);var pt=pn(),Mn=at(pt);lb(Mn,()=>g(L),vn=>{MV(vn,{get block(){return g(Nt)},get runeMap(){return g(d)},runes:()=>e.runes,get aggregated(){return u()},get initialRuneIndex(){return g($)},onupdate:gt=>oe(v(g(k))[0],gt),onremove:()=>{const gt=g(k);M(k,null),M(T,null),M($,null),z(gt)},onclose:()=>{M(k,null),M(T,null),M($,null)},oneditfield:Je,oneditcode:Ct})}),Z(ut,pt)},it=ut=>{const Nt=ge(()=>g(O)[g(k)]);var pt=pn(),Mn=at(pt);lb(Mn,()=>g(L),vn=>{NV(vn,{get block(){return g(Nt)},runes:()=>e.runes,get aggregated(){return u()},onupdate:gt=>b(g(k),gt),onremove:()=>{const gt=g(k);M(k,null),M(T,null),z(gt)},onclose:()=>{M(k,null),M(T,null)}})}),Z(ut,pt)};ue(De,ut=>{g(S)?ut(st):g(k)!==null&&g(O)[g(k)]?.type==="rune"?ut(nt,1):g(k)!==null&&g(O)[g(k)]?.type==="prose"&&ut(it,2)})}fe(()=>Tr(ye,g(W))),Z(G,ee)};ue(cn,G=>{!o()&&(g(k)!==null||g(S))&&G(tn)})}var _t=I(cn,2);{var j=G=>{tW(G,{get runes(){return e.runes},get runesByCategory(){return g(mt)},oninsert:Ke,onclose:Ue})};ue(_t,G=>{g(Ee)&&G(j)})}var Pe=I(_t,2);{var Yt=G=>{Ow(G,{get anchorRect(){return g(Me).rect},get dataName(){return g(Me).dataName},get inlineSource(){return g(Me).inlineSource},onchange:Vt,onclose:En})};ue(Pe,G=>{g(Me)&&G(Yt)})}var dn=I(Pe,2);{var Ge=G=>{sW(G,{get anchorRect(){return g(St).rect},get text(){return g(St).mapping.text},get href(){return g(St).mapping.href},onchange:on,onremove:Cn,onclose:Wt})};ue(dn,G=>{g(St)&&G(Ge)})}var pr=I(dn,2);{var Ei=G=>{lW(G,{get anchorRect(){return g(ke).rect},get code(){return g(ke).mapping.code},get language(){return g(ke).mapping.language},onchange:Tn,onlanguagechange:On,onremove:Lt,onclose:Jt})};ue(pr,G=>{g(ke)&&G(Ei)})}var Nn=I(pr,2);{var Gi=G=>{$W(G,{get currentSrc(){return g(te).mapping.src},get currentAlt(){return g(te).mapping.alt},onchange:(ee,de)=>{ve(ee,de),Ce()},onremove:xe,onclose:Ce})};ue(Nn,G=>{g(te)&&G(Gi)})}var Bn=I(Nn,2);{var Ss=G=>{{let ee=ge(()=>e.themeConfig?.icons??{});RW(G,{get icons(){return g(ee)},get currentIcon(){return g(qe).mapping.name},onchange:de=>{At(de),ht()},onclose:ht})}};ue(Bn,G=>{g(qe)&&G(Ss)})}var Hi=I(Bn,2);{var mr=G=>{Ow(G,{get anchorRect(){return g(C).rect},get dataName(){return g(C).mapping.dataName},get inlineSource(){return g(C).inlineSource},onchange:w,onclose:y})};ue(Hi,G=>{g(C)&&G(mr)})}ft("scroll",tt,H),Z(n,lt),bt()}Kt(["click","mousedown"]);const yw=/\{%\s*region\s+([^%]*?)%\}([\s\S]*?)\{%\s*\/region\s*%\}/g,ww=/(\w+)="([^"]*)"/g;function WW(n){const e=[];let t;for(yw.lastIndex=0;(t=yw.exec(n))!==null;){const r=t[1],i=t[2],s={};let o;for(ww.lastIndex=0;(o=ww.exec(r))!==null;)s[o[1]]=o[2];const a=s.name||"",l=s.mode||"replace";let c=i;c.startsWith(`
|
|
609
609
|
`)&&(c=c.slice(1)),c.endsWith(`
|
|
610
|
-
`)&&(c=c.slice(0,-1)),e.push({name:a,mode:l,content:c})}return{regions:e}}function
|
|
611
|
-
`)}const Xv=/\{%\s*nav\s*%\}/,KC=/\{%\s*\/nav\s*%\}/;function
|
|
610
|
+
`)&&(c=c.slice(0,-1)),e.push({name:a,mode:l,content:c})}return{regions:e}}function YW(n){const e=["{% layout %}"];for(const t of n.regions){const r=t.mode!=="replace"?` mode="${t.mode}"`:"";e.push(`{% region name="${t.name}"${r} %}`),e.push(t.content),e.push("{% /region %}"),e.push("")}return e.push("{% /layout %}"),e.join(`
|
|
611
|
+
`)}const Xv=/\{%\s*nav\s*%\}/,KC=/\{%\s*\/nav\s*%\}/;function UW(n){return Xv.test(n)}function GW(n){const e=Xv.exec(n);if(!e)return null;const t=e.index+e[0].length,r=KC.exec(n.slice(t));if(!r)return null;let i=n.slice(t,t+r.index);return i.startsWith(`
|
|
612
612
|
`)&&(i=i.slice(1)),i.endsWith(`
|
|
613
|
-
`)&&(i=i.slice(0,-1)),i}function
|
|
613
|
+
`)&&(i=i.slice(0,-1)),i}function HW(n,e){const t=Xv.exec(n);if(!t)return n;const r=t.index+t[0].length,i=KC.exec(n.slice(r));if(!i)return n;const s=n.slice(0,r),o=n.slice(r+i.index);return`${s}
|
|
614
614
|
${e}
|
|
615
|
-
${o}`}function
|
|
616
|
-
`),t=[],r=[];let i=null;for(const s of e){const o=s.trim(),a=o.match(/^##\s+(.+)$/);if(a){i={title:a[1],items:[]},t.push(i);continue}const l=o.match(/^-\s+(.+)$/);if(l){const c=l[1].trim();i?i.items.push(c):r.push(c);continue}}return{groups:t,ungrouped:r}}function
|
|
617
|
-
`)}var JW=V('<input class="nav-item__input svelte-8xlxf2" type="text"/>'),eY=V('<button class="nav-item__slug svelte-8xlxf2"> </button>'),tY=V('<div class="nav-item svelte-8xlxf2"><button class="nav-item__grip svelte-8xlxf2" title="Drag to reorder"><svg width="10" height="14" viewBox="0 0 10 14" fill="none"><circle cx="3" cy="3" r="1.2" fill="currentColor"></circle><circle cx="7" cy="3" r="1.2" fill="currentColor"></circle><circle cx="3" cy="7" r="1.2" fill="currentColor"></circle><circle cx="7" cy="7" r="1.2" fill="currentColor"></circle><circle cx="3" cy="11" r="1.2" fill="currentColor"></circle><circle cx="7" cy="11" r="1.2" fill="currentColor"></circle></svg></button> <!> <button class="nav-item__remove svelte-8xlxf2" title="Remove item"><svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button></div>');function nY(n,e){vt(e,!0);let t=K(!1),r=K(sn(e.slug));function i(){M(r,e.slug,!0),M(t,!0)}function s(){const h=g(r).trim();h&&h!==e.slug&&e.onchange(h),M(t,!1)}function o(h){h.key==="Enter"?(h.preventDefault(),s()):h.key==="Escape"&&M(t,!1)}var a=tY(),l=D(a);l.__pointerdown=function(...h){e.ondragstart?.apply(this,h)};var c=I(l,2);{var u=h=>{var m=JW();m.__keydown=o,Os(m),ft("blur",m,s),Rn(m,()=>g(r),p=>M(r,p)),Z(h,m)},f=h=>{var m=eY();m.__dblclick=i;var p=D(m);fe(()=>$e(p,e.slug)),Z(h,m)};ue(c,h=>{g(t)?h(u):h(f,!1)})}var d=I(c,2);d.__click=function(...h){e.ondelete?.apply(this,h)},Z(n,a),bt()}Kt(["pointerdown","keydown","dblclick","click"]);var rY=V('<div role="listitem"><!></div>'),iY=V('<div class="nav-editor__add-item svelte-1h0zo48"><input class="nav-editor__add-input svelte-1h0zo48" type="text" placeholder="Page slug..."/></div>'),sY=V('<button class="nav-editor__add-item-btn svelte-1h0zo48">+ Add item</button>'),oY=V('<div class="nav-editor__group svelte-1h0zo48"><div class="nav-editor__group-header svelte-1h0zo48"><input class="nav-editor__group-title svelte-1h0zo48" type="text" placeholder="Group title"/> <button class="nav-editor__group-delete svelte-1h0zo48" title="Delete group"><svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button></div> <div class="nav-editor__items svelte-1h0zo48"></div> <!></div>'),aY=V('<div class="nav-editor__add-group svelte-1h0zo48"><input class="nav-editor__add-input svelte-1h0zo48" type="text" placeholder="Group title..."/></div>'),lY=V('<button class="nav-editor__add-group-btn svelte-1h0zo48">+ Add group</button>'),cY=V('<div class="nav-editor svelte-1h0zo48"><!> <!></div>');function uY(n,e){vt(e,!0);let t=K(sn({groups:[],ungrouped:[]})),r=K(null),i=K(""),s=K(""),o=K(!1),a=K(null),l=K(null);bn(()=>{const k=UW(e.content);k!==null&&M(t,HW(k),!0)});function c(){const k=KW(g(t)),E=GW(e.content,k);e.onchange(E)}function u(k,E){g(t).groups[k]={...g(t).groups[k],title:E},M(t,{...g(t)},!0),c()}function f(k){const E=g(t).groups[k];E.items.length>0&&!confirm(`Delete group "${E.title}" and its ${E.items.length} items?`)||(g(t).groups.splice(k,1),M(t,{...g(t)},!0),c())}function d(){const k=g(s).trim();k&&(g(t).groups.push({title:k,items:[]}),M(t,{...g(t)},!0),M(s,""),M(o,!1),c())}function h(k,E,T){g(t).groups[k].items[E]=T,M(t,{...g(t)},!0),c()}function m(k,E){g(t).groups[k].items.splice(E,1),M(t,{...g(t)},!0),c()}function p(k){const E=g(i).trim();E&&(g(t).groups[k].items.push(E),M(t,{...g(t)},!0),M(i,""),M(r,null),c())}function O(k,E){k.key==="Enter"?(k.preventDefault(),p(E)):k.key==="Escape"&&(M(r,null),M(i,""))}function v(k){k.key==="Enter"?(k.preventDefault(),d()):k.key==="Escape"&&(M(o,!1),M(s,""))}function b(k,E,T){k.currentTarget.setPointerCapture(k.pointerId),M(a,{groupIdx:E,itemIdx:T},!0)}function _(k,E,T){g(a)&&M(l,{groupIdx:E,itemIdx:T},!0)}function C(k){if(!g(a)||!g(l)){M(a,null),M(l,null);return}const{groupIdx:E,itemIdx:T}=g(a),{groupIdx:$,itemIdx:L}=g(l);if(E===$&&T===L){M(a,null),M(l,null);return}const[P]=g(t).groups[E].items.splice(T,1);let q=L;E===$&&T<L&&(q=L-1),g(t).groups[$].items.splice(q,0,P),M(t,{...g(t)},!0),M(a,null),M(l,null),c()}var w=cY(),y=D(w);Qt(y,17,()=>g(t).groups,nn,(k,E,T)=>{var $=oY(),L=D($),P=D(L);P.__input=ce=>u(T,ce.target.value);var q=I(P,2);q.__click=()=>f(T);var R=I(L,2);Qt(R,21,()=>g(E).items,nn,(ce,re,H)=>{var ae=rY();let oe;ae.__pointermove=ne=>_(ne,T,H),ae.__pointerup=C;var z=D(ae);nY(z,{get slug(){return g(re)},onchange:ne=>h(T,H,ne),ondelete:()=>m(T,H),ondragstart:ne=>b(ne,T,H)}),fe(()=>oe=Xe(ae,1,"nav-editor__item-wrapper svelte-1h0zo48",null,oe,{"drag-over":g(l)?.groupIdx===T&&g(l)?.itemIdx===H})),Z(ce,ae)});var W=I(R,2);{var U=ce=>{var re=iY(),H=D(re);H.__keydown=ae=>O(ae,T),Os(H),ft("blur",H,()=>{M(r,null),M(i,"")}),Rn(H,()=>g(i),ae=>M(i,ae)),Z(ce,re)},ie=ce=>{var re=sY();re.__click=()=>{M(r,T,!0),M(i,"")},Z(ce,re)};ue(W,ce=>{g(r)===T?ce(U):ce(ie,!1)})}fe(()=>fn(P,g(E).title)),Z(k,$)});var S=I(y,2);{var A=k=>{var E=aY(),T=D(E);T.__keydown=v,Os(T),ft("blur",T,()=>{M(o,!1),M(s,"")}),Rn(T,()=>g(s),$=>M(s,$)),Z(k,E)},x=k=>{var E=lY();E.__click=()=>{M(o,!0),M(s,"")},Z(k,E)};ue(S,k=>{g(o)?k(A):k(x,!1)})}Z(n,w),bt()}Kt(["input","click","pointermove","pointerup","keydown"]);var fY=V("<button> </button>"),dY=V("<button> </button>"),hY=V('<textarea class="region-card__textarea svelte-1ah7fba" placeholder="Region content..." rows="4"></textarea>'),pY=V('<div class="region-card svelte-1ah7fba"><div class="region-card__header svelte-1ah7fba"><div class="region-card__name-row svelte-1ah7fba"><input class="region-card__name svelte-1ah7fba" type="text" placeholder="Region name"/> <div class="region-card__mode svelte-1ah7fba"></div></div> <div class="region-card__actions svelte-1ah7fba"><!> <button class="region-card__delete-btn svelte-1ah7fba" title="Delete region"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button></div></div> <div class="region-card__body svelte-1ah7fba"><!></div></div>');function mY(n,e){vt(e,!0);let t=K(!1),r=ge(()=>YW(e.region.content));function i(A){const x=A.target;e.onchange({...e.region,name:x.value})}function s(A){e.onchange({...e.region,mode:A})}function o(A){const x=A.target;e.onchange({...e.region,content:x.value})}function a(A){e.onchange({...e.region,content:A})}function l(){e.region.content.trim()&&!confirm(`Delete region "${e.region.name}"? Its content will be lost.`)||e.ondelete()}function c(A){A.style.height="auto",A.style.height=`${A.scrollHeight}px`}function u(A){const x=A.target;c(x),o(A)}var f=pY(),d=D(f),h=D(d),m=D(h);m.__input=i;var p=I(m,2);Qt(p,20,()=>["replace","prepend","append"],nn,(A,x)=>{var k=fY();let E;k.__click=()=>s(x);var T=D(k);fe(()=>{E=Xe(k,1,"region-card__mode-btn svelte-1ah7fba",null,E,{active:e.region.mode===x}),$e(T,x)}),Z(A,k)});var O=I(h,2),v=D(O);{var b=A=>{var x=dY();let k;x.__click=()=>{M(t,!g(t))};var E=D(x);fe(()=>{k=Xe(x,1,"region-card__toggle-btn svelte-1ah7fba",null,k,{active:g(t)}),$e(E,g(t)?"Text":"Visual")}),Z(A,x)};ue(v,A=>{g(r)&&A(b)})}var _=I(v,2);_.__click=l;var C=I(d,2),w=D(C);{var y=A=>{uY(A,{get content(){return e.region.content},onchange:a})},S=A=>{var x=hY();x.__input=u,CP(x,k=>c?.(k)),fe(()=>fn(x,e.region.content)),Z(A,x)};ue(w,A=>{g(r)&&g(t)?A(y):A(S,!1)})}fe(()=>fn(m,e.region.name)),Z(n,f),bt()}Kt(["input","click"]);var gY=V('<span class="layout-editor__path svelte-u2phg9"> </span>'),OY=V('<div class="layout-editor__raw svelte-u2phg9"><!></div>'),vY=V('<div class="layout-editor__empty svelte-u2phg9"><p class="svelte-u2phg9">No regions defined. Add a region to get started.</p></div>'),bY=V('<div class="layout-editor__regions svelte-u2phg9"><!> <!> <button class="layout-editor__add-btn svelte-u2phg9"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M8 3v10M3 8h10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg> Add Region</button></div>'),yY=V('<div class="layout-editor svelte-u2phg9"><div class="layout-editor__header svelte-u2phg9"><div class="layout-editor__title-row svelte-u2phg9"><svg class="layout-editor__icon svelte-u2phg9" width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="1" width="14" height="14" rx="2" stroke="currentColor" stroke-width="1.2"></rect><path d="M1 5h14M6 5v10" stroke="currentColor" stroke-width="1.2"></path></svg> <span class="layout-editor__title svelte-u2phg9">Layout</span> <!></div> <div class="layout-editor__mode-track svelte-u2phg9"><button>Visual</button> <button>Raw</button></div></div> <!></div>');function wY(n,e){vt(e,!0);let t=K(!1),r=K(sn({regions:[]})),i="";bn(()=>{const y=F.editorContent;y!==i&&(M(r,VW(y),!0),i=y)});function s(){const y=WW(g(r));i=y,F.editorContent=y,F.bodyContent=y}function o(y,S){g(r).regions[y]=S,M(r,{...g(r)},!0),s()}function a(y){g(r).regions.splice(y,1),M(r,{...g(r)},!0),s()}function l(){g(r).regions.push({name:"",mode:"replace",content:""}),M(r,{...g(r)},!0),s()}var c=yY(),u=D(c),f=D(u),d=I(D(f),4);{var h=y=>{var S=gY(),A=D(S);fe(()=>$e(A,F.currentPath)),Z(y,S)};ue(d,y=>{F.currentPath&&y(h)})}var m=I(f,2),p=D(m);let O;p.__click=()=>{M(t,!1)};var v=I(p,2);let b;v.__click=()=>{M(t,!0)};var _=I(u,2);{var C=y=>{var S=OY(),A=D(S);yA(A,{}),Z(y,S)},w=y=>{var S=bY(),A=D(S);{var x=T=>{var $=vY();Z(T,$)};ue(A,T=>{g(r).regions.length===0&&T(x)})}var k=I(A,2);Qt(k,17,()=>g(r).regions,nn,(T,$,L)=>{mY(T,{get region(){return g($)},onchange:P=>o(L,P),ondelete:()=>a(L)})});var E=I(k,2);E.__click=l,Z(y,S)};ue(_,y=>{g(t)?y(C):y(w,!1)})}fe(()=>{O=Xe(p,1,"layout-editor__mode-btn svelte-u2phg9",null,O,{active:!g(t)}),b=Xe(v,1,"layout-editor__mode-btn svelte-u2phg9",null,b,{active:g(t)})}),Z(n,c),bt()}Kt(["click"]);var _Y=V('<div class="preview__empty svelte-1iqwj2q"><svg class="preview__empty-icon svelte-1iqwj2q" width="40" height="40" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="8" width="40" height="32" rx="3" class="svelte-1iqwj2q"></rect><line x1="4" y1="16" x2="44" y2="16" class="svelte-1iqwj2q"></line><circle cx="10" cy="12" r="1.5" fill="currentColor" stroke="none" class="svelte-1iqwj2q"></circle><circle cx="15" cy="12" r="1.5" fill="currentColor" stroke="none" class="svelte-1iqwj2q"></circle><circle cx="20" cy="12" r="1.5" fill="currentColor" stroke="none" class="svelte-1iqwj2q"></circle><line x1="14" y1="26" x2="34" y2="26" class="svelte-1iqwj2q"></line><line x1="14" y1="32" x2="28" y2="32" class="svelte-1iqwj2q"></line></svg> <span class="preview__empty-text svelte-1iqwj2q">Select a page to preview</span></div>'),kY=V('<div class="preview__progress svelte-1iqwj2q"></div>'),xY=V('<iframe title="Preview" src="/preview/" class="preview__iframe svelte-1iqwj2q"></iframe>'),SY=V('<iframe title="Preview" class="preview__iframe svelte-1iqwj2q"></iframe>'),AY=V('<div class="preview__container svelte-1iqwj2q"><!> <div class="preview__viewport svelte-1iqwj2q"><!></div></div>');function CY(n,e){vt(e,!0);let t=K(""),r=K(void 0),i=K(void 0),s,o=new Map,a=K(!1);const l=ge(()=>g(t).replace("<html",`<html data-theme="${F.previewTheme}"`));bn(()=>{function m(p){if(p.data?.type==="preview-ready")F.previewRuntimeReady=!0;else if(p.data?.type==="preview-navigate"){const O=p.data.href,v=o.get(O);v&&e.onnavigate&&e.onnavigate(v)}}return window.addEventListener("message",m),()=>window.removeEventListener("message",m)});const c=ge(()=>F.previewRuntimeAvailable&&F.previewRuntimeReady);bn(()=>{const m=ZT(F.routeRules);g(c)&&g(r)?.contentWindow&&g(r).contentWindow.postMessage({type:"route-rules-update",routeRules:m},"*")}),bn(()=>{const m=F.previewTheme;g(c)&&g(r)?.contentWindow&&g(r).contentWindow.postMessage({type:"theme-update",theme:m},"*")}),bn(()=>{const m=F.currentPath,p=F.editorContent,O=g(c);if(!m||!p){M(t,"");return}return M(a,!0),clearTimeout(s),s=setTimeout(async()=>{try{if(O){const v=await uW(m,p);v.pages&&(o=new Map(v.pages.map(b=>[b.url,b.path]))),g(r)?.contentWindow?.postMessage({type:"preview-update",page:v},"*")}else M(t,await cW(m,p),!0)}catch{}finally{M(a,!1)}},400),()=>clearTimeout(s)});var u=pn(),f=at(u);{var d=m=>{var p=_Y();Z(m,p)},h=m=>{var p=AY(),O=D(p);{var v=y=>{var S=kY();Z(y,S)};ue(O,y=>{g(a)&&y(v)})}var b=I(O,2),_=D(b);{var C=y=>{var S=xY();mn(S,A=>M(r,A),()=>g(r)),Z(y,S)},w=y=>{var S=SY();mn(S,A=>M(i,A),()=>g(i)),fe(()=>Et(S,"srcdoc",g(l))),Z(y,S)};ue(_,y=>{F.previewRuntimeAvailable?y(C):y(w,!1)})}Z(m,p)};ue(f,m=>{F.currentPath?m(h,!1):m(d)})}Z(n,u),bt()}var TY=V('<div class="page-card svelte-1nxc0wz"><!></div>');function PY(n,e){vt(e,!0);const t={desktop:1440,tablet:768,mobile:375},r=ge(()=>F.editorMode==="preview"?t[F.viewport]??1440:1440);var i=TY(),s=D(i);ha(s,()=>e.children),fe(()=>Tr(i,`--page-card-width: ${g(r)??""}px`)),Z(n,i),bt()}var EY=V('<div class="popover svelte-ohlzgl"><!></div>');function JC(n,e){vt(e,!0);let t,r=K(e.anchorRect.x+e.anchorRect.width+8),i=K(sn(e.anchorRect.y));to(()=>{if(t){const c=t.getBoundingClientRect();c.right>window.innerWidth-8&&M(r,e.anchorRect.x-c.width-8),c.bottom>window.innerHeight-8&&M(i,window.innerHeight-c.height-8),g(i)<8&&M(i,8)}function a(c){t&&!t.contains(c.target)&&e.onclose()}function l(c){c.key==="Escape"&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("click",a)}),document.addEventListener("keydown",l),()=>{document.removeEventListener("click",a),document.removeEventListener("keydown",l)}});var s=EY(),o=D(s);ha(o,()=>e.children),mn(s,a=>t=a,()=>t),fe(()=>Tr(s,`left: ${g(r)??""}px; top: ${g(i)??""}px`)),Z(n,s),bt()}var $Y=V('<span class="modal__location svelte-vqemeo"> </span>'),QY=V('<span class="modal__hint svelte-vqemeo">Auto-derived from title</span>'),LY=V('<label class="modal__field svelte-vqemeo"><span class="modal__label svelte-vqemeo">Title</span> <input class="modal__input svelte-vqemeo" type="text" placeholder="My New Page"/></label> <label class="modal__field svelte-vqemeo"><span class="modal__label svelte-vqemeo">Slug</span> <input class="modal__input svelte-vqemeo" type="text" placeholder="my-new-page"/> <!></label> <label class="modal__checkbox svelte-vqemeo"><input type="checkbox"/> <span>Create as draft</span></label> <div class="modal__actions svelte-vqemeo"><button type="button" class="modal__btn modal__btn--cancel svelte-vqemeo">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-vqemeo">Create</button></div>',1),MY=V('<span class="modal__error svelte-vqemeo">Use lowercase letters, numbers, and hyphens</span>'),qY=V('<label class="modal__field svelte-vqemeo"><span class="modal__label svelte-vqemeo">Name</span> <input class="modal__input svelte-vqemeo" type="text" placeholder="my-section"/> <!></label> <label class="modal__checkbox svelte-vqemeo"><input type="checkbox"/> <span>Create with _layout.md</span></label> <div class="modal__actions svelte-vqemeo"><button type="button" class="modal__btn modal__btn--cancel svelte-vqemeo">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-vqemeo">Create</button></div>',1),DY=V('<form class="modal__form svelte-vqemeo"><div class="modal__tabs svelte-vqemeo"><button type="button"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M9 1.5H4a1.5 1.5 0 0 0-1.5 1.5v10A1.5 1.5 0 0 0 4 14.5h8A1.5 1.5 0 0 0 13.5 13V6L9 1.5Z"></path><polyline points="9 1.5 9 6 13.5 6"></polyline></svg> File</button> <button type="button"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 4h4.5l1.5 1.5H14.5v8.5h-13z"></path><path d="M1.5 4v-1.5h4.5l1.5 1.5"></path></svg> Folder</button></div> <!> <!></form>');function RY(n,e){vt(e,!0);let t=Pt(e,"initialDirectory",3,""),r=K("file"),i=K(""),s=K(""),o=K(!1),a=K(!1),l=ge(()=>g(i).toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")),c=ge(()=>g(o)?g(s):g(l)),u=K(""),f=K(!0),d=ge(()=>/^[a-z0-9][a-z0-9-]*$/.test(g(u)));function h(m){if(m.preventDefault(),g(r)==="file"){if(!g(c))return;e.oncreate({directory:t(),slug:g(c),title:g(i)||g(c),template:"blank",draft:g(a)})}else{if(!g(d))return;e.oncreatefolder({parent:t(),name:g(u),createLayout:g(f)})}}JC(n,{get anchorRect(){return e.anchorRect},get onclose(){return e.onclose},children:(m,p)=>{var O=DY(),v=D(O),b=D(v);let _;b.__click=()=>M(r,"file");var C=I(b,2);let w;C.__click=()=>M(r,"folder");var y=I(v,2);{var S=E=>{var T=$Y(),$=D(T);fe(()=>$e($,`in ${t()??""}/`)),Z(E,T)};ue(y,E=>{t()&&E(S)})}var A=I(y,2);{var x=E=>{var T=LY(),$=at(T),L=I(D($),2);Os(L);var P=I($,2),q=I(D(P),2);q.__input=ae=>{M(s,ae.target.value,!0),M(o,!0)};var R=I(q,2);{var W=ae=>{var oe=QY();Z(ae,oe)};ue(R,ae=>{!g(o)&&g(i)&&ae(W)})}var U=I(P,2),ie=D(U),ce=I(U,2),re=D(ce);re.__click=function(...ae){e.onclose?.apply(this,ae)};var H=I(re,2);fe(()=>{fn(q,g(c)),H.disabled=!g(c)}),Rn(L,()=>g(i),ae=>M(i,ae)),zp(ie,()=>g(a),ae=>M(a,ae)),Z(E,T)},k=E=>{var T=qY(),$=at(T),L=I(D($),2);Os(L);var P=I(L,2);{var q=re=>{var H=MY();Z(re,H)};ue(P,re=>{g(u)&&!g(d)&&re(q)})}var R=I($,2),W=D(R),U=I(R,2),ie=D(U);ie.__click=function(...re){e.onclose?.apply(this,re)};var ce=I(ie,2);fe(()=>ce.disabled=!g(d)),Rn(L,()=>g(u),re=>M(u,re)),zp(W,()=>g(f),re=>M(f,re)),Z(E,T)};ue(A,E=>{g(r)==="file"?E(x):E(k,!1)})}fe(()=>{_=Xe(b,1,"modal__tab svelte-vqemeo",null,_,{active:g(r)==="file"}),w=Xe(C,1,"modal__tab svelte-vqemeo",null,w,{active:g(r)==="folder"})}),ft("submit",O,h),Z(m,O)},$$slots:{default:!0}}),bt()}Kt(["click","input"]);var IY=V('<span class="modal__error svelte-fv7j9w">Use lowercase letters, numbers, and hyphens</span>'),NY=V("<option> </option>"),BY=V('<dialog class="modal svelte-fv7j9w"><form class="modal__form svelte-fv7j9w"><h2 class="modal__title svelte-fv7j9w">New Directory</h2> <label class="modal__field svelte-fv7j9w"><span class="modal__label svelte-fv7j9w">Name</span> <input class="modal__input svelte-fv7j9w" type="text" placeholder="my-section"/> <!></label> <label class="modal__field svelte-fv7j9w"><span class="modal__label svelte-fv7j9w">Parent directory</span> <select class="modal__select svelte-fv7j9w"></select></label> <label class="modal__checkbox svelte-fv7j9w"><input type="checkbox"/> <span>Create with _layout.md</span></label> <div class="modal__actions svelte-fv7j9w"><button type="button" class="modal__btn modal__btn--cancel svelte-fv7j9w">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-fv7j9w">Create</button></div></form></dialog>');function jY(n,e){vt(e,!0);let t=K(""),r=K(""),i=K(!0),s;function o(A,x=[]){if(!A||A.type!=="directory")return x;x.push(A.path);for(const k of A.children??[])o(k,x);return x}let a=ge(()=>o(F.tree)),l=ge(()=>/^[a-z0-9][a-z0-9-]*$/.test(g(t)));bn(()=>{s&&!s.open&&s.showModal()});function c(A){A.preventDefault(),g(l)&&e.oncreate({parent:g(r),name:g(t),createLayout:g(i)})}function u(A){A.key==="Escape"&&e.onclose()}var f=BY();f.__keydown=u;var d=D(f),h=I(D(d),2),m=I(D(h),2);Os(m);var p=I(m,2);{var O=A=>{var x=IY();Z(A,x)};ue(p,A=>{g(t)&&!g(l)&&A(O)})}var v=I(h,2),b=I(D(v),2);Qt(b,21,()=>g(a),nn,(A,x)=>{var k=NY(),E=D(k),T={};fe(()=>{$e(E,g(x)||"/ (root)"),T!==(T=g(x))&&(k.value=(k.__value=g(x))??"")}),Z(A,k)});var _=I(v,2),C=D(_),w=I(_,2),y=D(w);y.__click=function(...A){e.onclose?.apply(this,A)};var S=I(y,2);mn(f,A=>s=A,()=>s),fe(()=>S.disabled=!g(l)),ft("close",f,function(...A){e.onclose?.apply(this,A)}),ft("submit",d,c),Rn(m,()=>g(t),A=>M(t,A)),f_(b,()=>g(r),A=>M(r,A)),zp(C,()=>g(i),A=>M(i,A)),Z(n,f),bt()}Kt(["keydown","click"]);var zY=V('<span class="modal__error svelte-e8lnud">Use lowercase letters, numbers, and hyphens</span>'),ZY=V('<span class="modal__hint svelte-e8lnud"> </span>'),FY=V("<option> </option>"),XY=V('<form class="modal__form svelte-e8lnud"><h2 class="modal__title svelte-e8lnud">New Category</h2> <p class="modal__desc svelte-e8lnud">Creates a directory with a route rule and layout.</p> <label class="modal__field svelte-e8lnud"><span class="modal__label svelte-e8lnud">Name</span> <input class="modal__input svelte-e8lnud" type="text" placeholder="tutorials"/> <!></label> <label class="modal__field svelte-e8lnud"><span class="modal__label svelte-e8lnud">Layout</span> <select class="modal__select svelte-e8lnud"></select></label> <div class="modal__actions svelte-e8lnud"><button type="button" class="modal__btn modal__btn--cancel svelte-e8lnud">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-e8lnud">Create</button></div></form>');function VY(n,e){vt(e,!0);let t=K(""),r=K("default"),i=ge(()=>/^[a-z0-9][a-z0-9-]*$/.test(g(t))),s=ge(()=>{const a=F.themeConfig;return a?.layouts?Object.keys(a.layouts):["default"]});function o(a){a.preventDefault(),g(i)&&e.oncreate({name:g(t),layout:g(r)})}JC(n,{get anchorRect(){return e.anchorRect},get onclose(){return e.onclose},children:(a,l)=>{var c=XY(),u=I(D(c),4),f=I(D(u),2);Os(f);var d=I(f,2);{var h=C=>{var w=zY();Z(C,w)},m=C=>{var w=ZY(),y=D(w);fe(()=>$e(y,`Pattern: ${g(t)??""}/** · Directory: ${g(t)??""}/`)),Z(C,w)};ue(d,C=>{g(t)&&!g(i)?C(h):g(t)&&C(m,1)})}var p=I(u,2),O=I(D(p),2);Qt(O,21,()=>g(s),nn,(C,w)=>{var y=FY(),S=D(y),A={};fe(()=>{$e(S,g(w)),A!==(A=g(w))&&(y.value=(y.__value=g(w))??"")}),Z(C,y)});var v=I(p,2),b=D(v);b.__click=function(...C){e.onclose?.apply(this,C)};var _=I(b,2);fe(()=>_.disabled=!g(i)),ft("submit",c,o),Rn(f,()=>g(t),C=>M(t,C)),f_(O,()=>g(r),C=>M(r,C)),Z(a,c)},$$slots:{default:!0}}),bt()}Kt(["click"]);var WY=ks('<svg class="context-menu__icon svelte-1ksg7ac" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path></path></svg>'),YY=V("<button><!> </button>"),UY=V('<div class="context-menu svelte-1ksg7ac"></div>');function GY(n,e){vt(e,!0);let t,r=K(sn(e.x)),i=K(sn(e.y));function s(l){switch(l){case"Rename":return"M12.5 3.5l-9 9L2 16l3.5-1.5 9-9zM10.5 5.5l2 2";case"Duplicate":return"M5 3h6l3 3v7H5zM3 6v9h8";case"Delete":return"M3 5h12M6 5V3h6v2M5 5v9h8V5";case"Publish":case"Set as Draft":return"M2 8h5v6H2zM9 4h5v10H9z";default:return null}}to(()=>{if(t){const c=t.getBoundingClientRect();c.right>window.innerWidth&&M(r,window.innerWidth-c.width-4),c.bottom>window.innerHeight&&M(i,window.innerHeight-c.height-4)}function l(c){t&&!t.contains(c.target)&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("click",l),document.addEventListener("contextmenu",l)}),()=>{document.removeEventListener("click",l),document.removeEventListener("contextmenu",l)}});function o(l){l(),e.onclose()}var a=UY();Qt(a,21,()=>e.items,nn,(l,c)=>{const u=ge(()=>s(g(c).label));var f=YY();let d;f.__click=()=>o(g(c).action);var h=D(f);{var m=O=>{var v=WY(),b=D(v);fe(()=>Et(b,"d",g(u))),Z(O,v)};ue(h,O=>{g(u)&&O(m)})}var p=I(h);fe(()=>{d=Xe(f,1,"context-menu__item svelte-1ksg7ac",null,d,{danger:g(c).danger}),$e(p,` ${g(c).label??""}`)}),Z(l,f)}),mn(a,l=>t=l,()=>t),fe(()=>Tr(a,`left: ${g(r)??""}px; top: ${g(i)??""}px`)),Z(n,a),bt()}Kt(["click"]);var HY=V('<dialog class="dialog svelte-19l8tke"><form class="dialog__form svelte-19l8tke"><h2 class="dialog__title svelte-19l8tke">Rename</h2> <input class="dialog__input svelte-19l8tke" type="text"/> <div class="dialog__actions svelte-19l8tke"><button type="button" class="dialog__btn dialog__btn--cancel svelte-19l8tke">Cancel</button> <button type="submit" class="dialog__btn dialog__btn--primary svelte-19l8tke">Rename</button></div></form></dialog>');function KY(n,e){vt(e,!0);let t=K(sn(e.currentName)),r;bn(()=>{r&&!r.open&&r.showModal()});function i(f){f.preventDefault();const d=g(t).trim();d&&d!==e.currentName&&e.onrename(d)}var s=HY(),o=D(s),a=I(D(o),2);Os(a),a.__keydown=f=>{f.key==="Escape"&&e.onclose()};var l=I(a,2),c=D(l);c.__click=function(...f){e.onclose?.apply(this,f)};var u=I(c,2);mn(s,f=>r=f,()=>r),fe(f=>u.disabled=f,[()=>!g(t).trim()||g(t).trim()===e.currentName]),ft("close",s,function(...f){e.onclose?.apply(this,f)}),ft("submit",o,i),Rn(a,()=>g(t),f=>M(t,f)),Z(n,s),bt()}Kt(["keydown","click"]);var JY=V('<dialog class="dialog svelte-1r8rwv8"><form class="dialog__form svelte-1r8rwv8"><h2 class="dialog__title svelte-1r8rwv8"> </h2> <p class="dialog__message svelte-1r8rwv8"> </p> <div class="dialog__actions svelte-1r8rwv8"><button type="button" class="dialog__btn dialog__btn--cancel svelte-1r8rwv8">Cancel</button> <button type="submit" class="dialog__btn dialog__btn--danger svelte-1r8rwv8"> </button></div></form></dialog>');function eU(n,e){vt(e,!0);let t=Pt(e,"confirmLabel",3,"Delete"),r;bn(()=>{r&&!r.open&&r.showModal()});function i(p){p.preventDefault(),e.onconfirm()}var s=JY(),o=D(s),a=D(o),l=D(a),c=I(a,2),u=D(c),f=I(c,2),d=D(f);d.__click=function(...p){e.onclose?.apply(this,p)};var h=I(d,2),m=D(h);mn(s,p=>r=p,()=>r),fe(()=>{$e(l,e.title),$e(u,e.message),$e(m,t())}),ft("close",s,function(...p){e.onclose?.apply(this,p)}),ft("submit",o,i),Z(n,s),bt()}Kt(["click"]);var tU=V('<div class="banner svelte-toaoe3"><span class="banner__text svelte-toaoe3"> </span> <button class="banner__btn banner__btn--reload svelte-toaoe3">Reload</button> <button class="banner__btn banner__btn--dismiss svelte-toaoe3">Dismiss</button></div>');function nU(n,e){vt(e,!0);const t=ge(()=>F.externalChange?.event==="file-deleted");var r=pn(),i=at(r);{var s=o=>{var a=tU(),l=D(a),c=D(l),u=I(l,2);u.__click=function(...d){e.onreload?.apply(this,d)};var f=I(u,2);f.__click=()=>{F.externalChange=null},fe(()=>$e(c,g(t)?"This file was deleted outside the editor.":"This file was changed outside the editor.")),Z(o,a)};ue(i,o=>{F.externalChange&&o(s)})}Z(n,r),bt()}Kt(["click"]);var rU=V("<!> <!>",1),iU=V("<!> <!>",1),sU=V('<div class="editor-placeholder svelte-16t0oly"><svg width="40" height="40" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-16t0oly"><rect x="6" y="4" width="24" height="32" rx="2"></rect><polyline points="20 4 20 14 30 14"></polyline><line x1="12" y1="22" x2="24" y2="22"></line><line x1="12" y1="27" x2="20" y2="27"></line><path d="M34 24l6 6M34 36l6-6"></path></svg> <span>Select a file to edit</span></div>'),oU=V('<div class="editor-app svelte-16t0oly"><!></div> <!> <!> <!> <!> <!> <!>',1);function aU(n,e){vt(e,!0),customElements.get("rf-diagram")||customElements.define("rf-diagram",eX),customElements.get("rf-sandbox")||customElements.define("rf-sandbox",nX),customElements.get("rf-map")||customElements.define("rf-map",tX);let t=K(!1),r=K(!1),i=K(!1),s=K(""),o=K(null),a=K(null),l=K(null),c=K(null),u=K(null),f="",d=0;to(()=>{(async()=>{F.treeLoading=!0;try{const[Se,Te,Le,he,Ee]=await Promise.all([vw(),wW(),fW(),dW(),_W()]);F.tree=Se,F.runes=Te,F.previewRuntimeAvailable=Le.previewRuntime,F.themeCss=Le.themeCss,F.themeConfig=Le.themeConfig,F.routeRules=he??[],F.aggregated=Ee,Le.hasCommunityTags&&se(()=>import("/api/community-tags.js"),[]).then(rt=>{F.communityTags=rt.communityTags??null,F.communityPostTransforms=rt.communityPostTransforms??null,F.communityStyles=rt.communityStyles??null}).catch(()=>{}),se(async()=>{const{createHighlightTransform:rt}=await import("./index-Dva5AxSS.js");return{createHighlightTransform:rt}},[]).then(({createHighlightTransform:rt})=>rt().then(Ue=>{F.highlightTransform=Ue,F.highlightCss=Ue.css})).catch(()=>{});const Ye=Se.children?.find(rt=>rt.type==="page"&&rt.name==="index.md");Ye&&m(Ye.path)}catch(Se){F.error=Se instanceof Error?Se.message:"Failed to load content tree"}finally{F.treeLoading=!1}})();let z;const ne=kW((Se,Te)=>{if(clearTimeout(z),z=setTimeout(()=>h(),500),Te.path===F.currentPath){if(f===Te.path&&Date.now()-d<2e3)return;F.externalChange={path:Te.path,event:Se}}});return()=>{ne(),clearTimeout(z)}});async function h(){try{F.tree=await vw()}catch{}}async function m(z){if(!(F.dirty&&!confirm("You have unsaved changes. Discard them?"))){F.externalChange=null,F.fileLoading=!0,F.error=null;try{const ne=await Mp(z);F.loadFile(z,ne.raw)}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to load file"}finally{F.fileLoading=!1}}}async function p(){if(!(!F.currentPath||!F.dirty)){F.saving=!0,F.error=null;try{f=F.currentPath,d=Date.now(),await lW(F.currentPath,F.editorContent),F.savedContent=F.editorContent,F.saveJustCompleted=!0,setTimeout(()=>{F.saveJustCompleted=!1},1500)}catch(z){F.error=z instanceof Error?z.message:"Failed to save file"}finally{F.saving=!1}}}function O(z){(z.metaKey||z.ctrlKey)&&z.key==="s"&&(z.preventDefault(),p())}async function v(z){try{const ne=await pW(z);M(t,!1),await h(),await m(ne.path)}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to create page"}}async function b(z){try{await bw(z),M(r,!1),M(t,!1),await h()}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to create directory"}}async function _(z){try{await bw({parent:"",name:z.name,createLayout:!0});const ne={pattern:`${z.name}/**`,layout:z.layout},Se=[...F.routeRules],Te=Se.findIndex(Le=>Le.pattern==="**");Te>=0?Se.splice(Te,0,ne):Se.push(ne),await hW(Se),F.routeRules=Se,M(i,!1),await h()}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to create category"}}function C(z,ne){M(l,{x:z.clientX,y:z.clientY,node:ne},!0)}function w(z){const ne=[];return z.type==="page"||z.type==="layout"?(ne.push({label:"Rename",action:()=>{M(c,z,!0)}}),z.type==="page"&&(ne.push({label:"Duplicate",action:()=>S(z)}),ne.push({label:z.draft?"Publish":"Set as Draft",action:()=>k(z)})),ne.push({label:"Delete",action:()=>{M(u,z,!0)},danger:!0})):z.type==="directory"&&(ne.push({label:"Rename",action:()=>{M(c,z,!0)}}),ne.push({label:"Delete",action:()=>{M(u,z,!0)},danger:!0})),ne}async function y(z){if(!g(c))return;const ne=g(c).path;try{const Se=await mW(ne,z);M(c,null),await h(),F.currentPath===ne&&await m(Se.newPath)}catch(Se){F.error=Se instanceof Error?Se.message:"Failed to rename"}}async function S(z){try{const ne=await gW(z.path);await h(),await m(ne.path)}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to duplicate"}}async function A(){if(!g(u))return;const z=g(u).path;try{await OW(z),M(u,null),await h(),F.currentPath===z&&(F.currentPath=null,F.editorContent="",F.savedContent="",F.bodyContent="",F.frontmatter={})}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to delete"}}async function x(){if(!(F.dirty&&!confirm("You have unsaved changes. Reload will discard them."))){if(F.externalChange?.event==="file-deleted")F.currentPath=null,F.editorContent="",F.savedContent="",F.bodyContent="",F.frontmatter={};else if(F.externalChange){const z=await Mp(F.externalChange.path);F.loadFile(z.path,z.raw)}F.externalChange=null}}async function k(z){try{if(await vW(z.path),await h(),F.currentPath===z.path){const ne=await Mp(z.path);F.loadFile(z.path,ne.raw)}}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to toggle draft"}}var E=oU();ft("keydown",Ro,O);var T=at(E),$=D(T);u$($,{header:Le=>{l$(Le,{onsave:p})},left:Le=>{C$(Le,{onselectfile:m,onnewpage:(he,Ee)=>{M(s,he??"",!0),M(o,Ee,!0),M(t,!0)},onnewdirectory:he=>{M(r,!0)},onnewcategory:he=>{M(a,he,!0),M(i,!0)},oncontextmenu:C})},center:Le=>{var he=iU(),Ee=at(he);nU(Ee,{onreload:x});var Ye=I(Ee,2);{var rt=Ke=>{wY(Ke,{})},Ue=Ke=>{var Me=rU(),xt=at(Me);B$(xt,{forceRawMode:!0});var Vt=I(xt,2);yA(Vt,{}),Z(Ke,Me)};ue(Ye,Ke=>{F.currentFileType==="layout"?Ke(rt):F.currentPath&&Ke(Ue,1)})}Z(Le,he)},right:Le=>{var he=pn(),Ee=at(he);{var Ye=Ue=>{var Ke=sU();Z(Ue,Ke)},rt=Ue=>{PY(Ue,{children:(Ke,Me)=>{var xt=pn(),Vt=at(xt);{var En=on=>{CY(on,{onnavigate:m})},St=on=>{{let Cn=ge(()=>F.editorMode==="code");XW(on,{get bodyContent(){return F.bodyContent},onchange:Wt=>F.updateBody(Wt),get runes(){return F.runes},get themeConfig(){return F.themeConfig},get themeCss(){return F.themeCss},get highlightCss(){return F.highlightCss},get highlightTransform(){return F.highlightTransform},get frontmatter(){return F.frontmatter},get readOnly(){return g(Cn)},get communityTags(){return F.communityTags},get communityPostTransforms(){return F.communityPostTransforms},get communityStyles(){return F.communityStyles},get aggregated(){return F.aggregated}})}};ue(Vt,on=>{F.editorMode==="preview"?on(En):on(St,!1)})}Z(Ke,xt)},$$slots:{default:!0}})};ue(Ee,Ue=>{F.currentPath?F.currentFileType!=="layout"&&Ue(rt,1):Ue(Ye)})}Z(Le,he)},$$slots:{header:!0,left:!0,center:!0,right:!0}});var L=I(T,2);{var P=z=>{RY(z,{oncreate:v,oncreatefolder:b,onclose:()=>{M(t,!1)},get initialDirectory(){return g(s)},get anchorRect(){return g(o)}})};ue(L,z=>{g(t)&&g(o)&&z(P)})}var q=I(L,2);{var R=z=>{VY(z,{oncreate:_,onclose:()=>{M(i,!1)},get anchorRect(){return g(a)}})};ue(q,z=>{g(i)&&g(a)&&z(R)})}var W=I(q,2);{var U=z=>{jY(z,{oncreate:b,onclose:()=>{M(r,!1)}})};ue(W,z=>{g(r)&&z(U)})}var ie=I(W,2);{var ce=z=>{{let ne=ge(()=>w(g(l).node));GY(z,{get x(){return g(l).x},get y(){return g(l).y},get items(){return g(ne)},onclose:()=>{M(l,null)}})}};ue(ie,z=>{g(l)&&z(ce)})}var re=I(ie,2);{var H=z=>{KY(z,{get currentName(){return g(c).name},onrename:y,onclose:()=>{M(c,null)}})};ue(re,z=>{g(c)&&z(H)})}var ae=I(re,2);{var oe=z=>{{let ne=ge(()=>g(u).type==="directory"?"directory":"file");eU(z,{get title(){return`Delete ${g(ne)??""}`},get message(){return`Are you sure you want to delete "${g(u).name??""}"? This cannot be undone.`},onconfirm:A,onclose:()=>{M(u,null)}})}};ue(ae,z=>{g(u)&&z(oe)})}Z(n,E),bt()}yP(aU,{target:document.getElementById("app")});export{lS as C,Xr as E,Ut as I,Xa as L,q2 as N,se as _,Ya as a,fl as b,cf as c,xq as d,Qx as e,Uc as f,Ga as g,An as h,gn as i,Gf as j,KL as k,HL as l,Z2 as m,vr as n,Qe as o,me as p,YS as q,D2 as r,ul as s,N as t,xS as u,V2 as v,ri as w};
|
|
615
|
+
${o}`}function KW(n){const e=n.split(`
|
|
616
|
+
`),t=[],r=[];let i=null;for(const s of e){const o=s.trim(),a=o.match(/^##\s+(.+)$/);if(a){i={title:a[1],items:[]},t.push(i);continue}const l=o.match(/^-\s+(.+)$/);if(l){const c=l[1].trim();i?i.items.push(c):r.push(c);continue}}return{groups:t,ungrouped:r}}function JW(n){const e=[];for(const t of n.ungrouped)e.push(`- ${t}`);n.ungrouped.length>0&&n.groups.length>0&&e.push("");for(let t=0;t<n.groups.length;t++){const r=n.groups[t];e.push(`## ${r.title}`),e.push("");for(const i of r.items)e.push(`- ${i}`);t<n.groups.length-1&&e.push("")}return e.join(`
|
|
617
|
+
`)}var eY=V('<input class="nav-item__input svelte-8xlxf2" type="text"/>'),tY=V('<button class="nav-item__slug svelte-8xlxf2"> </button>'),nY=V('<div class="nav-item svelte-8xlxf2"><button class="nav-item__grip svelte-8xlxf2" title="Drag to reorder"><svg width="10" height="14" viewBox="0 0 10 14" fill="none"><circle cx="3" cy="3" r="1.2" fill="currentColor"></circle><circle cx="7" cy="3" r="1.2" fill="currentColor"></circle><circle cx="3" cy="7" r="1.2" fill="currentColor"></circle><circle cx="7" cy="7" r="1.2" fill="currentColor"></circle><circle cx="3" cy="11" r="1.2" fill="currentColor"></circle><circle cx="7" cy="11" r="1.2" fill="currentColor"></circle></svg></button> <!> <button class="nav-item__remove svelte-8xlxf2" title="Remove item"><svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button></div>');function rY(n,e){vt(e,!0);let t=K(!1),r=K(sn(e.slug));function i(){M(r,e.slug,!0),M(t,!0)}function s(){const h=g(r).trim();h&&h!==e.slug&&e.onchange(h),M(t,!1)}function o(h){h.key==="Enter"?(h.preventDefault(),s()):h.key==="Escape"&&M(t,!1)}var a=nY(),l=D(a);l.__pointerdown=function(...h){e.ondragstart?.apply(this,h)};var c=I(l,2);{var u=h=>{var m=eY();m.__keydown=o,Os(m),ft("blur",m,s),Rn(m,()=>g(r),p=>M(r,p)),Z(h,m)},f=h=>{var m=tY();m.__dblclick=i;var p=D(m);fe(()=>$e(p,e.slug)),Z(h,m)};ue(c,h=>{g(t)?h(u):h(f,!1)})}var d=I(c,2);d.__click=function(...h){e.ondelete?.apply(this,h)},Z(n,a),bt()}Kt(["pointerdown","keydown","dblclick","click"]);var iY=V('<div role="listitem"><!></div>'),sY=V('<div class="nav-editor__add-item svelte-1h0zo48"><input class="nav-editor__add-input svelte-1h0zo48" type="text" placeholder="Page slug..."/></div>'),oY=V('<button class="nav-editor__add-item-btn svelte-1h0zo48">+ Add item</button>'),aY=V('<div class="nav-editor__group svelte-1h0zo48"><div class="nav-editor__group-header svelte-1h0zo48"><input class="nav-editor__group-title svelte-1h0zo48" type="text" placeholder="Group title"/> <button class="nav-editor__group-delete svelte-1h0zo48" title="Delete group"><svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button></div> <div class="nav-editor__items svelte-1h0zo48"></div> <!></div>'),lY=V('<div class="nav-editor__add-group svelte-1h0zo48"><input class="nav-editor__add-input svelte-1h0zo48" type="text" placeholder="Group title..."/></div>'),cY=V('<button class="nav-editor__add-group-btn svelte-1h0zo48">+ Add group</button>'),uY=V('<div class="nav-editor svelte-1h0zo48"><!> <!></div>');function fY(n,e){vt(e,!0);let t=K(sn({groups:[],ungrouped:[]})),r=K(null),i=K(""),s=K(""),o=K(!1),a=K(null),l=K(null);bn(()=>{const k=GW(e.content);k!==null&&M(t,KW(k),!0)});function c(){const k=JW(g(t)),E=HW(e.content,k);e.onchange(E)}function u(k,E){g(t).groups[k]={...g(t).groups[k],title:E},M(t,{...g(t)},!0),c()}function f(k){const E=g(t).groups[k];E.items.length>0&&!confirm(`Delete group "${E.title}" and its ${E.items.length} items?`)||(g(t).groups.splice(k,1),M(t,{...g(t)},!0),c())}function d(){const k=g(s).trim();k&&(g(t).groups.push({title:k,items:[]}),M(t,{...g(t)},!0),M(s,""),M(o,!1),c())}function h(k,E,T){g(t).groups[k].items[E]=T,M(t,{...g(t)},!0),c()}function m(k,E){g(t).groups[k].items.splice(E,1),M(t,{...g(t)},!0),c()}function p(k){const E=g(i).trim();E&&(g(t).groups[k].items.push(E),M(t,{...g(t)},!0),M(i,""),M(r,null),c())}function O(k,E){k.key==="Enter"?(k.preventDefault(),p(E)):k.key==="Escape"&&(M(r,null),M(i,""))}function v(k){k.key==="Enter"?(k.preventDefault(),d()):k.key==="Escape"&&(M(o,!1),M(s,""))}function b(k,E,T){k.currentTarget.setPointerCapture(k.pointerId),M(a,{groupIdx:E,itemIdx:T},!0)}function _(k,E,T){g(a)&&M(l,{groupIdx:E,itemIdx:T},!0)}function C(k){if(!g(a)||!g(l)){M(a,null),M(l,null);return}const{groupIdx:E,itemIdx:T}=g(a),{groupIdx:$,itemIdx:L}=g(l);if(E===$&&T===L){M(a,null),M(l,null);return}const[P]=g(t).groups[E].items.splice(T,1);let q=L;E===$&&T<L&&(q=L-1),g(t).groups[$].items.splice(q,0,P),M(t,{...g(t)},!0),M(a,null),M(l,null),c()}var w=uY(),y=D(w);Qt(y,17,()=>g(t).groups,nn,(k,E,T)=>{var $=aY(),L=D($),P=D(L);P.__input=ce=>u(T,ce.target.value);var q=I(P,2);q.__click=()=>f(T);var R=I(L,2);Qt(R,21,()=>g(E).items,nn,(ce,re,H)=>{var ae=iY();let oe;ae.__pointermove=ne=>_(ne,T,H),ae.__pointerup=C;var z=D(ae);rY(z,{get slug(){return g(re)},onchange:ne=>h(T,H,ne),ondelete:()=>m(T,H),ondragstart:ne=>b(ne,T,H)}),fe(()=>oe=Xe(ae,1,"nav-editor__item-wrapper svelte-1h0zo48",null,oe,{"drag-over":g(l)?.groupIdx===T&&g(l)?.itemIdx===H})),Z(ce,ae)});var W=I(R,2);{var U=ce=>{var re=sY(),H=D(re);H.__keydown=ae=>O(ae,T),Os(H),ft("blur",H,()=>{M(r,null),M(i,"")}),Rn(H,()=>g(i),ae=>M(i,ae)),Z(ce,re)},ie=ce=>{var re=oY();re.__click=()=>{M(r,T,!0),M(i,"")},Z(ce,re)};ue(W,ce=>{g(r)===T?ce(U):ce(ie,!1)})}fe(()=>fn(P,g(E).title)),Z(k,$)});var S=I(y,2);{var A=k=>{var E=lY(),T=D(E);T.__keydown=v,Os(T),ft("blur",T,()=>{M(o,!1),M(s,"")}),Rn(T,()=>g(s),$=>M(s,$)),Z(k,E)},x=k=>{var E=cY();E.__click=()=>{M(o,!0),M(s,"")},Z(k,E)};ue(S,k=>{g(o)?k(A):k(x,!1)})}Z(n,w),bt()}Kt(["input","click","pointermove","pointerup","keydown"]);var dY=V("<button> </button>"),hY=V("<button> </button>"),pY=V('<textarea class="region-card__textarea svelte-1ah7fba" placeholder="Region content..." rows="4"></textarea>'),mY=V('<div class="region-card svelte-1ah7fba"><div class="region-card__header svelte-1ah7fba"><div class="region-card__name-row svelte-1ah7fba"><input class="region-card__name svelte-1ah7fba" type="text" placeholder="Region name"/> <div class="region-card__mode svelte-1ah7fba"></div></div> <div class="region-card__actions svelte-1ah7fba"><!> <button class="region-card__delete-btn svelte-1ah7fba" title="Delete region"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button></div></div> <div class="region-card__body svelte-1ah7fba"><!></div></div>');function gY(n,e){vt(e,!0);let t=K(!1),r=ge(()=>UW(e.region.content));function i(A){const x=A.target;e.onchange({...e.region,name:x.value})}function s(A){e.onchange({...e.region,mode:A})}function o(A){const x=A.target;e.onchange({...e.region,content:x.value})}function a(A){e.onchange({...e.region,content:A})}function l(){e.region.content.trim()&&!confirm(`Delete region "${e.region.name}"? Its content will be lost.`)||e.ondelete()}function c(A){A.style.height="auto",A.style.height=`${A.scrollHeight}px`}function u(A){const x=A.target;c(x),o(A)}var f=mY(),d=D(f),h=D(d),m=D(h);m.__input=i;var p=I(m,2);Qt(p,20,()=>["replace","prepend","append"],nn,(A,x)=>{var k=dY();let E;k.__click=()=>s(x);var T=D(k);fe(()=>{E=Xe(k,1,"region-card__mode-btn svelte-1ah7fba",null,E,{active:e.region.mode===x}),$e(T,x)}),Z(A,k)});var O=I(h,2),v=D(O);{var b=A=>{var x=hY();let k;x.__click=()=>{M(t,!g(t))};var E=D(x);fe(()=>{k=Xe(x,1,"region-card__toggle-btn svelte-1ah7fba",null,k,{active:g(t)}),$e(E,g(t)?"Text":"Visual")}),Z(A,x)};ue(v,A=>{g(r)&&A(b)})}var _=I(v,2);_.__click=l;var C=I(d,2),w=D(C);{var y=A=>{fY(A,{get content(){return e.region.content},onchange:a})},S=A=>{var x=pY();x.__input=u,CP(x,k=>c?.(k)),fe(()=>fn(x,e.region.content)),Z(A,x)};ue(w,A=>{g(r)&&g(t)?A(y):A(S,!1)})}fe(()=>fn(m,e.region.name)),Z(n,f),bt()}Kt(["input","click"]);var OY=V('<span class="layout-editor__path svelte-u2phg9"> </span>'),vY=V('<div class="layout-editor__raw svelte-u2phg9"><!></div>'),bY=V('<div class="layout-editor__empty svelte-u2phg9"><p class="svelte-u2phg9">No regions defined. Add a region to get started.</p></div>'),yY=V('<div class="layout-editor__regions svelte-u2phg9"><!> <!> <button class="layout-editor__add-btn svelte-u2phg9"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M8 3v10M3 8h10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg> Add Region</button></div>'),wY=V('<div class="layout-editor svelte-u2phg9"><div class="layout-editor__header svelte-u2phg9"><div class="layout-editor__title-row svelte-u2phg9"><svg class="layout-editor__icon svelte-u2phg9" width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="1" width="14" height="14" rx="2" stroke="currentColor" stroke-width="1.2"></rect><path d="M1 5h14M6 5v10" stroke="currentColor" stroke-width="1.2"></path></svg> <span class="layout-editor__title svelte-u2phg9">Layout</span> <!></div> <div class="layout-editor__mode-track svelte-u2phg9"><button>Visual</button> <button>Raw</button></div></div> <!></div>');function _Y(n,e){vt(e,!0);let t=K(!1),r=K(sn({regions:[]})),i="";bn(()=>{const y=F.editorContent;y!==i&&(M(r,WW(y),!0),i=y)});function s(){const y=YW(g(r));i=y,F.editorContent=y,F.bodyContent=y}function o(y,S){g(r).regions[y]=S,M(r,{...g(r)},!0),s()}function a(y){g(r).regions.splice(y,1),M(r,{...g(r)},!0),s()}function l(){g(r).regions.push({name:"",mode:"replace",content:""}),M(r,{...g(r)},!0),s()}var c=wY(),u=D(c),f=D(u),d=I(D(f),4);{var h=y=>{var S=OY(),A=D(S);fe(()=>$e(A,F.currentPath)),Z(y,S)};ue(d,y=>{F.currentPath&&y(h)})}var m=I(f,2),p=D(m);let O;p.__click=()=>{M(t,!1)};var v=I(p,2);let b;v.__click=()=>{M(t,!0)};var _=I(u,2);{var C=y=>{var S=vY(),A=D(S);yA(A,{}),Z(y,S)},w=y=>{var S=yY(),A=D(S);{var x=T=>{var $=bY();Z(T,$)};ue(A,T=>{g(r).regions.length===0&&T(x)})}var k=I(A,2);Qt(k,17,()=>g(r).regions,nn,(T,$,L)=>{gY(T,{get region(){return g($)},onchange:P=>o(L,P),ondelete:()=>a(L)})});var E=I(k,2);E.__click=l,Z(y,S)};ue(_,y=>{g(t)?y(C):y(w,!1)})}fe(()=>{O=Xe(p,1,"layout-editor__mode-btn svelte-u2phg9",null,O,{active:!g(t)}),b=Xe(v,1,"layout-editor__mode-btn svelte-u2phg9",null,b,{active:g(t)})}),Z(n,c),bt()}Kt(["click"]);var kY=V('<div class="preview__empty svelte-1iqwj2q"><svg class="preview__empty-icon svelte-1iqwj2q" width="40" height="40" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="8" width="40" height="32" rx="3" class="svelte-1iqwj2q"></rect><line x1="4" y1="16" x2="44" y2="16" class="svelte-1iqwj2q"></line><circle cx="10" cy="12" r="1.5" fill="currentColor" stroke="none" class="svelte-1iqwj2q"></circle><circle cx="15" cy="12" r="1.5" fill="currentColor" stroke="none" class="svelte-1iqwj2q"></circle><circle cx="20" cy="12" r="1.5" fill="currentColor" stroke="none" class="svelte-1iqwj2q"></circle><line x1="14" y1="26" x2="34" y2="26" class="svelte-1iqwj2q"></line><line x1="14" y1="32" x2="28" y2="32" class="svelte-1iqwj2q"></line></svg> <span class="preview__empty-text svelte-1iqwj2q">Select a page to preview</span></div>'),xY=V('<div class="preview__progress svelte-1iqwj2q"></div>'),SY=V('<iframe title="Preview" src="/preview/" class="preview__iframe svelte-1iqwj2q"></iframe>'),AY=V('<iframe title="Preview" class="preview__iframe svelte-1iqwj2q"></iframe>'),CY=V('<div class="preview__container svelte-1iqwj2q"><!> <div class="preview__viewport svelte-1iqwj2q"><!></div></div>');function TY(n,e){vt(e,!0);let t=K(""),r=K(void 0),i=K(void 0),s,o=new Map,a=K(!1);const l=ge(()=>g(t).replace("<html",`<html data-theme="${F.previewTheme}"`));bn(()=>{function m(p){if(p.data?.type==="preview-ready")F.previewRuntimeReady=!0;else if(p.data?.type==="preview-navigate"){const O=p.data.href,v=o.get(O);v&&e.onnavigate&&e.onnavigate(v)}}return window.addEventListener("message",m),()=>window.removeEventListener("message",m)});const c=ge(()=>F.previewRuntimeAvailable&&F.previewRuntimeReady);bn(()=>{const m=ZT(F.routeRules);g(c)&&g(r)?.contentWindow&&g(r).contentWindow.postMessage({type:"route-rules-update",routeRules:m},"*")}),bn(()=>{const m=F.previewTheme;g(c)&&g(r)?.contentWindow&&g(r).contentWindow.postMessage({type:"theme-update",theme:m},"*")}),bn(()=>{const m=F.currentPath,p=F.editorContent,O=g(c);if(!m||!p){M(t,"");return}return M(a,!0),clearTimeout(s),s=setTimeout(async()=>{try{if(O){const v=await fW(m,p);v.pages&&(o=new Map(v.pages.map(b=>[b.url,b.path]))),g(r)?.contentWindow?.postMessage({type:"preview-update",page:v},"*")}else M(t,await uW(m,p),!0)}catch{}finally{M(a,!1)}},400),()=>clearTimeout(s)});var u=pn(),f=at(u);{var d=m=>{var p=kY();Z(m,p)},h=m=>{var p=CY(),O=D(p);{var v=y=>{var S=xY();Z(y,S)};ue(O,y=>{g(a)&&y(v)})}var b=I(O,2),_=D(b);{var C=y=>{var S=SY();mn(S,A=>M(r,A),()=>g(r)),Z(y,S)},w=y=>{var S=AY();mn(S,A=>M(i,A),()=>g(i)),fe(()=>Et(S,"srcdoc",g(l))),Z(y,S)};ue(_,y=>{F.previewRuntimeAvailable?y(C):y(w,!1)})}Z(m,p)};ue(f,m=>{F.currentPath?m(h,!1):m(d)})}Z(n,u),bt()}var PY=V('<div class="page-card svelte-1nxc0wz"><!></div>');function EY(n,e){vt(e,!0);const t={desktop:1440,tablet:768,mobile:375},r=ge(()=>F.editorMode==="preview"?t[F.viewport]??1440:1440);var i=PY(),s=D(i);ha(s,()=>e.children),fe(()=>Tr(i,`--page-card-width: ${g(r)??""}px`)),Z(n,i),bt()}var $Y=V('<div class="popover svelte-ohlzgl"><!></div>');function JC(n,e){vt(e,!0);let t,r=K(e.anchorRect.x+e.anchorRect.width+8),i=K(sn(e.anchorRect.y));to(()=>{if(t){const c=t.getBoundingClientRect();c.right>window.innerWidth-8&&M(r,e.anchorRect.x-c.width-8),c.bottom>window.innerHeight-8&&M(i,window.innerHeight-c.height-8),g(i)<8&&M(i,8)}function a(c){t&&!t.contains(c.target)&&e.onclose()}function l(c){c.key==="Escape"&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("click",a)}),document.addEventListener("keydown",l),()=>{document.removeEventListener("click",a),document.removeEventListener("keydown",l)}});var s=$Y(),o=D(s);ha(o,()=>e.children),mn(s,a=>t=a,()=>t),fe(()=>Tr(s,`left: ${g(r)??""}px; top: ${g(i)??""}px`)),Z(n,s),bt()}var QY=V('<span class="modal__location svelte-vqemeo"> </span>'),LY=V('<span class="modal__hint svelte-vqemeo">Auto-derived from title</span>'),MY=V('<label class="modal__field svelte-vqemeo"><span class="modal__label svelte-vqemeo">Title</span> <input class="modal__input svelte-vqemeo" type="text" placeholder="My New Page"/></label> <label class="modal__field svelte-vqemeo"><span class="modal__label svelte-vqemeo">Slug</span> <input class="modal__input svelte-vqemeo" type="text" placeholder="my-new-page"/> <!></label> <label class="modal__checkbox svelte-vqemeo"><input type="checkbox"/> <span>Create as draft</span></label> <div class="modal__actions svelte-vqemeo"><button type="button" class="modal__btn modal__btn--cancel svelte-vqemeo">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-vqemeo">Create</button></div>',1),qY=V('<span class="modal__error svelte-vqemeo">Use lowercase letters, numbers, and hyphens</span>'),DY=V('<label class="modal__field svelte-vqemeo"><span class="modal__label svelte-vqemeo">Name</span> <input class="modal__input svelte-vqemeo" type="text" placeholder="my-section"/> <!></label> <label class="modal__checkbox svelte-vqemeo"><input type="checkbox"/> <span>Create with _layout.md</span></label> <div class="modal__actions svelte-vqemeo"><button type="button" class="modal__btn modal__btn--cancel svelte-vqemeo">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-vqemeo">Create</button></div>',1),RY=V('<form class="modal__form svelte-vqemeo"><div class="modal__tabs svelte-vqemeo"><button type="button"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M9 1.5H4a1.5 1.5 0 0 0-1.5 1.5v10A1.5 1.5 0 0 0 4 14.5h8A1.5 1.5 0 0 0 13.5 13V6L9 1.5Z"></path><polyline points="9 1.5 9 6 13.5 6"></polyline></svg> File</button> <button type="button"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 4h4.5l1.5 1.5H14.5v8.5h-13z"></path><path d="M1.5 4v-1.5h4.5l1.5 1.5"></path></svg> Folder</button></div> <!> <!></form>');function IY(n,e){vt(e,!0);let t=Pt(e,"initialDirectory",3,""),r=K("file"),i=K(""),s=K(""),o=K(!1),a=K(!1),l=ge(()=>g(i).toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")),c=ge(()=>g(o)?g(s):g(l)),u=K(""),f=K(!0),d=ge(()=>/^[a-z0-9][a-z0-9-]*$/.test(g(u)));function h(m){if(m.preventDefault(),g(r)==="file"){if(!g(c))return;e.oncreate({directory:t(),slug:g(c),title:g(i)||g(c),template:"blank",draft:g(a)})}else{if(!g(d))return;e.oncreatefolder({parent:t(),name:g(u),createLayout:g(f)})}}JC(n,{get anchorRect(){return e.anchorRect},get onclose(){return e.onclose},children:(m,p)=>{var O=RY(),v=D(O),b=D(v);let _;b.__click=()=>M(r,"file");var C=I(b,2);let w;C.__click=()=>M(r,"folder");var y=I(v,2);{var S=E=>{var T=QY(),$=D(T);fe(()=>$e($,`in ${t()??""}/`)),Z(E,T)};ue(y,E=>{t()&&E(S)})}var A=I(y,2);{var x=E=>{var T=MY(),$=at(T),L=I(D($),2);Os(L);var P=I($,2),q=I(D(P),2);q.__input=ae=>{M(s,ae.target.value,!0),M(o,!0)};var R=I(q,2);{var W=ae=>{var oe=LY();Z(ae,oe)};ue(R,ae=>{!g(o)&&g(i)&&ae(W)})}var U=I(P,2),ie=D(U),ce=I(U,2),re=D(ce);re.__click=function(...ae){e.onclose?.apply(this,ae)};var H=I(re,2);fe(()=>{fn(q,g(c)),H.disabled=!g(c)}),Rn(L,()=>g(i),ae=>M(i,ae)),zp(ie,()=>g(a),ae=>M(a,ae)),Z(E,T)},k=E=>{var T=DY(),$=at(T),L=I(D($),2);Os(L);var P=I(L,2);{var q=re=>{var H=qY();Z(re,H)};ue(P,re=>{g(u)&&!g(d)&&re(q)})}var R=I($,2),W=D(R),U=I(R,2),ie=D(U);ie.__click=function(...re){e.onclose?.apply(this,re)};var ce=I(ie,2);fe(()=>ce.disabled=!g(d)),Rn(L,()=>g(u),re=>M(u,re)),zp(W,()=>g(f),re=>M(f,re)),Z(E,T)};ue(A,E=>{g(r)==="file"?E(x):E(k,!1)})}fe(()=>{_=Xe(b,1,"modal__tab svelte-vqemeo",null,_,{active:g(r)==="file"}),w=Xe(C,1,"modal__tab svelte-vqemeo",null,w,{active:g(r)==="folder"})}),ft("submit",O,h),Z(m,O)},$$slots:{default:!0}}),bt()}Kt(["click","input"]);var NY=V('<span class="modal__error svelte-fv7j9w">Use lowercase letters, numbers, and hyphens</span>'),BY=V("<option> </option>"),jY=V('<dialog class="modal svelte-fv7j9w"><form class="modal__form svelte-fv7j9w"><h2 class="modal__title svelte-fv7j9w">New Directory</h2> <label class="modal__field svelte-fv7j9w"><span class="modal__label svelte-fv7j9w">Name</span> <input class="modal__input svelte-fv7j9w" type="text" placeholder="my-section"/> <!></label> <label class="modal__field svelte-fv7j9w"><span class="modal__label svelte-fv7j9w">Parent directory</span> <select class="modal__select svelte-fv7j9w"></select></label> <label class="modal__checkbox svelte-fv7j9w"><input type="checkbox"/> <span>Create with _layout.md</span></label> <div class="modal__actions svelte-fv7j9w"><button type="button" class="modal__btn modal__btn--cancel svelte-fv7j9w">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-fv7j9w">Create</button></div></form></dialog>');function zY(n,e){vt(e,!0);let t=K(""),r=K(""),i=K(!0),s;function o(A,x=[]){if(!A||A.type!=="directory")return x;x.push(A.path);for(const k of A.children??[])o(k,x);return x}let a=ge(()=>o(F.tree)),l=ge(()=>/^[a-z0-9][a-z0-9-]*$/.test(g(t)));bn(()=>{s&&!s.open&&s.showModal()});function c(A){A.preventDefault(),g(l)&&e.oncreate({parent:g(r),name:g(t),createLayout:g(i)})}function u(A){A.key==="Escape"&&e.onclose()}var f=jY();f.__keydown=u;var d=D(f),h=I(D(d),2),m=I(D(h),2);Os(m);var p=I(m,2);{var O=A=>{var x=NY();Z(A,x)};ue(p,A=>{g(t)&&!g(l)&&A(O)})}var v=I(h,2),b=I(D(v),2);Qt(b,21,()=>g(a),nn,(A,x)=>{var k=BY(),E=D(k),T={};fe(()=>{$e(E,g(x)||"/ (root)"),T!==(T=g(x))&&(k.value=(k.__value=g(x))??"")}),Z(A,k)});var _=I(v,2),C=D(_),w=I(_,2),y=D(w);y.__click=function(...A){e.onclose?.apply(this,A)};var S=I(y,2);mn(f,A=>s=A,()=>s),fe(()=>S.disabled=!g(l)),ft("close",f,function(...A){e.onclose?.apply(this,A)}),ft("submit",d,c),Rn(m,()=>g(t),A=>M(t,A)),f_(b,()=>g(r),A=>M(r,A)),zp(C,()=>g(i),A=>M(i,A)),Z(n,f),bt()}Kt(["keydown","click"]);var ZY=V('<span class="modal__error svelte-e8lnud">Use lowercase letters, numbers, and hyphens</span>'),FY=V('<span class="modal__hint svelte-e8lnud"> </span>'),XY=V("<option> </option>"),VY=V('<form class="modal__form svelte-e8lnud"><h2 class="modal__title svelte-e8lnud">New Category</h2> <p class="modal__desc svelte-e8lnud">Creates a directory with a route rule and layout.</p> <label class="modal__field svelte-e8lnud"><span class="modal__label svelte-e8lnud">Name</span> <input class="modal__input svelte-e8lnud" type="text" placeholder="tutorials"/> <!></label> <label class="modal__field svelte-e8lnud"><span class="modal__label svelte-e8lnud">Layout</span> <select class="modal__select svelte-e8lnud"></select></label> <div class="modal__actions svelte-e8lnud"><button type="button" class="modal__btn modal__btn--cancel svelte-e8lnud">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-e8lnud">Create</button></div></form>');function WY(n,e){vt(e,!0);let t=K(""),r=K("default"),i=ge(()=>/^[a-z0-9][a-z0-9-]*$/.test(g(t))),s=ge(()=>{const a=F.themeConfig;return a?.layouts?Object.keys(a.layouts):["default"]});function o(a){a.preventDefault(),g(i)&&e.oncreate({name:g(t),layout:g(r)})}JC(n,{get anchorRect(){return e.anchorRect},get onclose(){return e.onclose},children:(a,l)=>{var c=VY(),u=I(D(c),4),f=I(D(u),2);Os(f);var d=I(f,2);{var h=C=>{var w=ZY();Z(C,w)},m=C=>{var w=FY(),y=D(w);fe(()=>$e(y,`Pattern: ${g(t)??""}/** · Directory: ${g(t)??""}/`)),Z(C,w)};ue(d,C=>{g(t)&&!g(i)?C(h):g(t)&&C(m,1)})}var p=I(u,2),O=I(D(p),2);Qt(O,21,()=>g(s),nn,(C,w)=>{var y=XY(),S=D(y),A={};fe(()=>{$e(S,g(w)),A!==(A=g(w))&&(y.value=(y.__value=g(w))??"")}),Z(C,y)});var v=I(p,2),b=D(v);b.__click=function(...C){e.onclose?.apply(this,C)};var _=I(b,2);fe(()=>_.disabled=!g(i)),ft("submit",c,o),Rn(f,()=>g(t),C=>M(t,C)),f_(O,()=>g(r),C=>M(r,C)),Z(a,c)},$$slots:{default:!0}}),bt()}Kt(["click"]);var YY=ks('<svg class="context-menu__icon svelte-1ksg7ac" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path></path></svg>'),UY=V("<button><!> </button>"),GY=V('<div class="context-menu svelte-1ksg7ac"></div>');function HY(n,e){vt(e,!0);let t,r=K(sn(e.x)),i=K(sn(e.y));function s(l){switch(l){case"Rename":return"M12.5 3.5l-9 9L2 16l3.5-1.5 9-9zM10.5 5.5l2 2";case"Duplicate":return"M5 3h6l3 3v7H5zM3 6v9h8";case"Delete":return"M3 5h12M6 5V3h6v2M5 5v9h8V5";case"Publish":case"Set as Draft":return"M2 8h5v6H2zM9 4h5v10H9z";default:return null}}to(()=>{if(t){const c=t.getBoundingClientRect();c.right>window.innerWidth&&M(r,window.innerWidth-c.width-4),c.bottom>window.innerHeight&&M(i,window.innerHeight-c.height-4)}function l(c){t&&!t.contains(c.target)&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("click",l),document.addEventListener("contextmenu",l)}),()=>{document.removeEventListener("click",l),document.removeEventListener("contextmenu",l)}});function o(l){l(),e.onclose()}var a=GY();Qt(a,21,()=>e.items,nn,(l,c)=>{const u=ge(()=>s(g(c).label));var f=UY();let d;f.__click=()=>o(g(c).action);var h=D(f);{var m=O=>{var v=YY(),b=D(v);fe(()=>Et(b,"d",g(u))),Z(O,v)};ue(h,O=>{g(u)&&O(m)})}var p=I(h);fe(()=>{d=Xe(f,1,"context-menu__item svelte-1ksg7ac",null,d,{danger:g(c).danger}),$e(p,` ${g(c).label??""}`)}),Z(l,f)}),mn(a,l=>t=l,()=>t),fe(()=>Tr(a,`left: ${g(r)??""}px; top: ${g(i)??""}px`)),Z(n,a),bt()}Kt(["click"]);var KY=V('<dialog class="dialog svelte-19l8tke"><form class="dialog__form svelte-19l8tke"><h2 class="dialog__title svelte-19l8tke">Rename</h2> <input class="dialog__input svelte-19l8tke" type="text"/> <div class="dialog__actions svelte-19l8tke"><button type="button" class="dialog__btn dialog__btn--cancel svelte-19l8tke">Cancel</button> <button type="submit" class="dialog__btn dialog__btn--primary svelte-19l8tke">Rename</button></div></form></dialog>');function JY(n,e){vt(e,!0);let t=K(sn(e.currentName)),r;bn(()=>{r&&!r.open&&r.showModal()});function i(f){f.preventDefault();const d=g(t).trim();d&&d!==e.currentName&&e.onrename(d)}var s=KY(),o=D(s),a=I(D(o),2);Os(a),a.__keydown=f=>{f.key==="Escape"&&e.onclose()};var l=I(a,2),c=D(l);c.__click=function(...f){e.onclose?.apply(this,f)};var u=I(c,2);mn(s,f=>r=f,()=>r),fe(f=>u.disabled=f,[()=>!g(t).trim()||g(t).trim()===e.currentName]),ft("close",s,function(...f){e.onclose?.apply(this,f)}),ft("submit",o,i),Rn(a,()=>g(t),f=>M(t,f)),Z(n,s),bt()}Kt(["keydown","click"]);var eU=V('<dialog class="dialog svelte-1r8rwv8"><form class="dialog__form svelte-1r8rwv8"><h2 class="dialog__title svelte-1r8rwv8"> </h2> <p class="dialog__message svelte-1r8rwv8"> </p> <div class="dialog__actions svelte-1r8rwv8"><button type="button" class="dialog__btn dialog__btn--cancel svelte-1r8rwv8">Cancel</button> <button type="submit" class="dialog__btn dialog__btn--danger svelte-1r8rwv8"> </button></div></form></dialog>');function tU(n,e){vt(e,!0);let t=Pt(e,"confirmLabel",3,"Delete"),r;bn(()=>{r&&!r.open&&r.showModal()});function i(p){p.preventDefault(),e.onconfirm()}var s=eU(),o=D(s),a=D(o),l=D(a),c=I(a,2),u=D(c),f=I(c,2),d=D(f);d.__click=function(...p){e.onclose?.apply(this,p)};var h=I(d,2),m=D(h);mn(s,p=>r=p,()=>r),fe(()=>{$e(l,e.title),$e(u,e.message),$e(m,t())}),ft("close",s,function(...p){e.onclose?.apply(this,p)}),ft("submit",o,i),Z(n,s),bt()}Kt(["click"]);var nU=V('<div class="banner svelte-toaoe3"><span class="banner__text svelte-toaoe3"> </span> <button class="banner__btn banner__btn--reload svelte-toaoe3">Reload</button> <button class="banner__btn banner__btn--dismiss svelte-toaoe3">Dismiss</button></div>');function rU(n,e){vt(e,!0);const t=ge(()=>F.externalChange?.event==="file-deleted");var r=pn(),i=at(r);{var s=o=>{var a=nU(),l=D(a),c=D(l),u=I(l,2);u.__click=function(...d){e.onreload?.apply(this,d)};var f=I(u,2);f.__click=()=>{F.externalChange=null},fe(()=>$e(c,g(t)?"This file was deleted outside the editor.":"This file was changed outside the editor.")),Z(o,a)};ue(i,o=>{F.externalChange&&o(s)})}Z(n,r),bt()}Kt(["click"]);var iU=V("<!> <!>",1),sU=V("<!> <!>",1),oU=V('<div class="editor-placeholder svelte-16t0oly"><svg width="40" height="40" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-16t0oly"><rect x="6" y="4" width="24" height="32" rx="2"></rect><polyline points="20 4 20 14 30 14"></polyline><line x1="12" y1="22" x2="24" y2="22"></line><line x1="12" y1="27" x2="20" y2="27"></line><path d="M34 24l6 6M34 36l6-6"></path></svg> <span>Select a file to edit</span></div>'),aU=V('<div class="editor-app svelte-16t0oly"><!></div> <!> <!> <!> <!> <!> <!>',1);function lU(n,e){vt(e,!0),customElements.get("rf-diagram")||customElements.define("rf-diagram",tX),customElements.get("rf-sandbox")||customElements.define("rf-sandbox",rX),customElements.get("rf-map")||customElements.define("rf-map",nX);let t=K(!1),r=K(!1),i=K(!1),s=K(""),o=K(null),a=K(null),l=K(null),c=K(null),u=K(null),f="",d=0;to(()=>{(async()=>{F.treeLoading=!0;try{const[Se,Te,Le,he,Ee]=await Promise.all([vw(),_W(),dW(),hW(),kW()]);F.tree=Se,F.runes=Te,F.previewRuntimeAvailable=Le.previewRuntime,F.themeCss=Le.themeCss,F.themeConfig=Le.themeConfig,F.routeRules=he??[],F.aggregated=Ee,Le.hasCommunityTags&&se(()=>import("/api/community-tags.js"),[]).then(rt=>{F.communityTags=rt.communityTags??null,F.communityPostTransforms=rt.communityPostTransforms??null,F.communityStyles=rt.communityStyles??null}).catch(()=>{}),se(async()=>{const{createHighlightTransform:rt}=await import("./index-DtoSl7Q7.js");return{createHighlightTransform:rt}},[]).then(({createHighlightTransform:rt})=>rt().then(Ue=>{F.highlightTransform=Ue,F.highlightCss=Ue.css})).catch(()=>{});const Ye=Se.children?.find(rt=>rt.type==="page"&&rt.name==="index.md");Ye&&m(Ye.path)}catch(Se){F.error=Se instanceof Error?Se.message:"Failed to load content tree"}finally{F.treeLoading=!1}})();let z;const ne=xW((Se,Te)=>{if(clearTimeout(z),z=setTimeout(()=>h(),500),Te.path===F.currentPath){if(f===Te.path&&Date.now()-d<2e3)return;F.externalChange={path:Te.path,event:Se}}});return()=>{ne(),clearTimeout(z)}});async function h(){try{F.tree=await vw()}catch{}}async function m(z){if(!(F.dirty&&!confirm("You have unsaved changes. Discard them?"))){F.externalChange=null,F.fileLoading=!0,F.error=null;try{const ne=await Mp(z);F.loadFile(z,ne.raw)}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to load file"}finally{F.fileLoading=!1}}}async function p(){if(!(!F.currentPath||!F.dirty)){F.saving=!0,F.error=null;try{f=F.currentPath,d=Date.now(),await cW(F.currentPath,F.editorContent),F.savedContent=F.editorContent,F.saveJustCompleted=!0,setTimeout(()=>{F.saveJustCompleted=!1},1500)}catch(z){F.error=z instanceof Error?z.message:"Failed to save file"}finally{F.saving=!1}}}function O(z){(z.metaKey||z.ctrlKey)&&z.key==="s"&&(z.preventDefault(),p())}async function v(z){try{const ne=await mW(z);M(t,!1),await h(),await m(ne.path)}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to create page"}}async function b(z){try{await bw(z),M(r,!1),M(t,!1),await h()}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to create directory"}}async function _(z){try{await bw({parent:"",name:z.name,createLayout:!0});const ne={pattern:`${z.name}/**`,layout:z.layout},Se=[...F.routeRules],Te=Se.findIndex(Le=>Le.pattern==="**");Te>=0?Se.splice(Te,0,ne):Se.push(ne),await pW(Se),F.routeRules=Se,M(i,!1),await h()}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to create category"}}function C(z,ne){M(l,{x:z.clientX,y:z.clientY,node:ne},!0)}function w(z){const ne=[];return z.type==="page"||z.type==="layout"?(ne.push({label:"Rename",action:()=>{M(c,z,!0)}}),z.type==="page"&&(ne.push({label:"Duplicate",action:()=>S(z)}),ne.push({label:z.draft?"Publish":"Set as Draft",action:()=>k(z)})),ne.push({label:"Delete",action:()=>{M(u,z,!0)},danger:!0})):z.type==="directory"&&(ne.push({label:"Rename",action:()=>{M(c,z,!0)}}),ne.push({label:"Delete",action:()=>{M(u,z,!0)},danger:!0})),ne}async function y(z){if(!g(c))return;const ne=g(c).path;try{const Se=await gW(ne,z);M(c,null),await h(),F.currentPath===ne&&await m(Se.newPath)}catch(Se){F.error=Se instanceof Error?Se.message:"Failed to rename"}}async function S(z){try{const ne=await OW(z.path);await h(),await m(ne.path)}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to duplicate"}}async function A(){if(!g(u))return;const z=g(u).path;try{await vW(z),M(u,null),await h(),F.currentPath===z&&(F.currentPath=null,F.editorContent="",F.savedContent="",F.bodyContent="",F.frontmatter={})}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to delete"}}async function x(){if(!(F.dirty&&!confirm("You have unsaved changes. Reload will discard them."))){if(F.externalChange?.event==="file-deleted")F.currentPath=null,F.editorContent="",F.savedContent="",F.bodyContent="",F.frontmatter={};else if(F.externalChange){const z=await Mp(F.externalChange.path);F.loadFile(z.path,z.raw)}F.externalChange=null}}async function k(z){try{if(await bW(z.path),await h(),F.currentPath===z.path){const ne=await Mp(z.path);F.loadFile(z.path,ne.raw)}}catch(ne){F.error=ne instanceof Error?ne.message:"Failed to toggle draft"}}var E=aU();ft("keydown",Ro,O);var T=at(E),$=D(T);u$($,{header:Le=>{l$(Le,{onsave:p})},left:Le=>{C$(Le,{onselectfile:m,onnewpage:(he,Ee)=>{M(s,he??"",!0),M(o,Ee,!0),M(t,!0)},onnewdirectory:he=>{M(r,!0)},onnewcategory:he=>{M(a,he,!0),M(i,!0)},oncontextmenu:C})},center:Le=>{var he=sU(),Ee=at(he);rU(Ee,{onreload:x});var Ye=I(Ee,2);{var rt=Ke=>{_Y(Ke,{})},Ue=Ke=>{var Me=iU(),xt=at(Me);B$(xt,{forceRawMode:!0});var Vt=I(xt,2);yA(Vt,{}),Z(Ke,Me)};ue(Ye,Ke=>{F.currentFileType==="layout"?Ke(rt):F.currentPath&&Ke(Ue,1)})}Z(Le,he)},right:Le=>{var he=pn(),Ee=at(he);{var Ye=Ue=>{var Ke=oU();Z(Ue,Ke)},rt=Ue=>{EY(Ue,{children:(Ke,Me)=>{var xt=pn(),Vt=at(xt);{var En=on=>{TY(on,{onnavigate:m})},St=on=>{{let Cn=ge(()=>F.editorMode==="code");VW(on,{get bodyContent(){return F.bodyContent},onchange:Wt=>F.updateBody(Wt),get runes(){return F.runes},get themeConfig(){return F.themeConfig},get themeCss(){return F.themeCss},get highlightCss(){return F.highlightCss},get highlightTransform(){return F.highlightTransform},get frontmatter(){return F.frontmatter},get readOnly(){return g(Cn)},get communityTags(){return F.communityTags},get communityPostTransforms(){return F.communityPostTransforms},get communityStyles(){return F.communityStyles},get aggregated(){return F.aggregated}})}};ue(Vt,on=>{F.editorMode==="preview"?on(En):on(St,!1)})}Z(Ke,xt)},$$slots:{default:!0}})};ue(Ee,Ue=>{F.currentPath?F.currentFileType!=="layout"&&Ue(rt,1):Ue(Ye)})}Z(Le,he)},$$slots:{header:!0,left:!0,center:!0,right:!0}});var L=I(T,2);{var P=z=>{IY(z,{oncreate:v,oncreatefolder:b,onclose:()=>{M(t,!1)},get initialDirectory(){return g(s)},get anchorRect(){return g(o)}})};ue(L,z=>{g(t)&&g(o)&&z(P)})}var q=I(L,2);{var R=z=>{WY(z,{oncreate:_,onclose:()=>{M(i,!1)},get anchorRect(){return g(a)}})};ue(q,z=>{g(i)&&g(a)&&z(R)})}var W=I(q,2);{var U=z=>{zY(z,{oncreate:b,onclose:()=>{M(r,!1)}})};ue(W,z=>{g(r)&&z(U)})}var ie=I(W,2);{var ce=z=>{{let ne=ge(()=>w(g(l).node));HY(z,{get x(){return g(l).x},get y(){return g(l).y},get items(){return g(ne)},onclose:()=>{M(l,null)}})}};ue(ie,z=>{g(l)&&z(ce)})}var re=I(ie,2);{var H=z=>{JY(z,{get currentName(){return g(c).name},onrename:y,onclose:()=>{M(c,null)}})};ue(re,z=>{g(c)&&z(H)})}var ae=I(re,2);{var oe=z=>{{let ne=ge(()=>g(u).type==="directory"?"directory":"file");tU(z,{get title(){return`Delete ${g(ne)??""}`},get message(){return`Are you sure you want to delete "${g(u).name??""}"? This cannot be undone.`},onconfirm:A,onclose:()=>{M(u,null)}})}};ue(ae,z=>{g(u)&&z(oe)})}Z(n,E),bt()}yP(lU,{target:document.getElementById("app")});export{lS as C,Xr as E,Ut as I,Xa as L,q2 as N,se as _,Ya as a,fl as b,cf as c,xq as d,Qx as e,Uc as f,Ga as g,An as h,gn as i,Gf as j,KL as k,HL as l,Z2 as m,vr as n,Qe as o,me as p,YS as q,D2 as r,ul as s,N as t,xS as u,V2 as v,ri as w};
|