1import{B as e,Cn as t,Ht as n,L as r,O as i,St as a,d as o,g as s,gn as c,k as l,r as u}from"./CrzdsfCC.js";import{n as d}from"./CKTlehgz.js";import{n as f,t as p}from"./DVJLo81D.js";import{r as m,t as h}from"./CGHUGu5B.js";import{c as g,n as _,o as v}from"./CY4utgz_.js";function y(e,t){return t.reduce((t,n)=>{let r=b(e,n);return r!==void 0&&(t[n]=r),t},{})}function b(e,t){return t.split(`.`).reduce((e,t)=>e&&e[t],e)}var x=`default`,S=/^@|^v-on:/,C=/^:|^v-bind:/,w=/^v-model/,T=[`select`,`textarea`,`input`],E=new Set([`math`,`svg`]),D=new Set,O=Object.fromEntries(`p.a.blockquote.code.pre.code.em.h1.h2.h3.h4.h5.h6.hr.img.ul.ol.li.strong.table.thead.tbody.td.th.tr.script`.split(`.`).map(e=>[e,`prose-${e}`])),k=[`script`,`base`],A=l({name:`MDCRenderer`,props:{body:{type:Object,required:!0},data:{type:Object,default:()=>({})},class:{type:[String,Object],default:void 0},tag:{type:[String,Boolean],default:void 0},prose:{type:Boolean,default:void 0},components:{type:Object,default:()=>({})},unwrap:{type:[Boolean,String],default:!1}},async setup(e){let i=r()?.appContext?.app?.$nuxt,a=i?.$route||i?._route,{mdc:o}=i?.$config?.public||{},l=o?.components?.customElements||o?.components?.custom;l&&l.forEach(e=>D.add(e));let u=s(()=>({...o?.components?.prose&&e.prose!==!1?O:{},...o?.components?.map||{},...t(e.data?.mdc?.components||{}),...e.components})),d=s(()=>{let t=(e.body?.children||[]).map(e=>e.tag||e.type).filter(e=>!q(e));return Array.from(new Set(t)).sort().join(`.`)}),f=c({...e.data});n(()=>e.data,e=>{Object.assign(f,e)}),await G(e.body,{tags:u.value});function p(e,t){let n=e.split(`.`).length-1;return e.split(`.`).reduce((e,r,i)=>i==n&&e?(e[r]=t,e[r]):typeof e==`object`?e[r]:void 0,f)}return{tags:u,contentKey:d,route:a,runtimeData:f,updateRuntimeData:p}},render(t){let{tags:n,tag:r,body:i,data:a,contentKey:o,route:s,unwrap:c,runtimeData:l,updateRuntimeData:u}=t;if(!i)return null;let d={...a,tags:n,$route:s,runtimeData:l,updateRuntimeData:u},f=r===!1?void 0:z(r||d.component?.name||d.component||`div`);return f?e(f,{...d.component?.props,class:t.class,...this.$attrs,key:o},{default:p}):p?.();function p(){let t=M(i,e,{documentMeta:d,parentScope:d,resolveComponent:z});return t?.default?c?_(t.default(),typeof c==`string`?c.split(` `):[`*`]):t.default():null}}});function j(e,t,n,r){let{documentMeta:i,parentScope:a,resolveComponent:s}=n;if(e.type===`text`)return t(o,e.value);if(e.type===`comment`)return t(u,null,e.value);let c=e.tag,l=K(e,i.tags);if(e.tag===`binding`)return N(e,t,i,a);let d=U(l)?e=>e:s;if(k.includes(f(l).toLowerCase()))return t(`pre`,{class:`mdc-renderer-dangerous-tag`},`<`+l+`>`+v(e)+`</`+l+`>`);let p=d(l);typeof p==`object`&&(p.tag=c);let m=P(e,i);return r&&(m.key=r),t(p,m,M(e,t,{documentMeta:i,parentScope:{...a,...m},resolveComponent:d}))}function M(e,t,n){let{documentMeta:r,parentScope:i,resolveComponent:a}=n,o=(e.children||[]).reduce((e,t)=>{if(!H(t))return e[x].children.push(t),e;let n=V(t);return e[n]=e[n]||{props:{},children:[]},t.type===`element`&&(e[n].props=t.props,e[n].children.push(...t.children||[])),e},{[x]:{props:{},children:[]}});return Object.entries(o).reduce((e,[n,{props:o,children:s}])=>(s.length&&(e[n]=(e={})=>{let n=y(e,Object.keys(o||{})),c=s.map((e,o)=>j(e,t,{documentMeta:r,parentScope:{...i,...n},resolveComponent:a},String(e.props?.key||o)));return o?.unwrap&&(c=_(c,o.unwrap)),W(c)}),e),{})}function N(e,t,n,r={}){let i={...n.runtimeData,...r,$document:n,$doc:n},a=(e.props?.value.trim().split(/\.|\[(\d+)\]/).filter(Boolean)).reduce((e,t)=>{if(e&&t in e)return typeof e[t]==`function`?e[t]():e[t]},i),s=e.props?.defaultValue;return t(o,a??s??``)}function P(e,t){let{tag:n=``,props:r={}}=e;return Object.keys(r).reduce(function(e,i){if(i===`__ignoreMap`)return e;let a=r[i];if(w.test(i))return F(i,a,e,t,{native:T.includes(n)});if(i===`v-bind`)return I(i,a,e,t);if(S.test(i))return L(i,a,e,t);if(C.test(i))return R(i,a,e,t);let{attribute:o}=m(h,i);return Array.isArray(a)&&a.every(e=>typeof e==`string`)?(e[o]=a.join(` `),e):(e[o]=a,e)},{})}function F(e,t,n,r,{native:i}){let a=e.match(/^v-model:([^=]+)/)?.[1]||`modelValue`,o=i?`value`:a,s=i?`onInput`:`onUpdate:${a}`;return n[o]=B(t,r.runtimeData),n[s]=e=>{r.updateRuntimeData(t,i?e.target?.value:e)},n}function I(e,t,n,r){let i=B(t,r);return n=Object.assign(n,i),n}function L(e,t,n,r){return e=e.replace(S,``),n.on=n.on||{},n.on[e]=()=>B(t,r),n}function R(e,t,n,r){return e=e.replace(C,``),n[e]=B(t,r),n}var z=e=>{if(typeof e==`string`){if(q(e))return e;let t=a(f(e),!1);return!e||t?.name===`AsyncComponentWrapper`||typeof t==`string`?t:`setup`in t?i(()=>new Promise(e=>e(t))):t}return e};function B(e,t){let n=e.split(`.`).reduce((e,t)=>
1typeof e==`object`?e[t]:void 0,t);return n===void 0?d(e):n}function V(e){let t=``;for(let n of Object.keys(e.props||{}))if(n.startsWith(`#`)||n.startsWith(`v-slot:`)){t=n.split(/[:#]/,2)[1];break}return t||x}function H(e){return e.tag===`template`}function U(e){return E.has(e)}function W(e){let t=[];for(let n of e){let e=t[t.length-1];n.type===o&&e?.type===o?e.children+=n.children:t.push(n)}return t}async function G(e,t){if(!e)return;let n=Array.from(new Set(r(e,t)));await Promise.all(n.map(async e=>{if(e?.render||e?.ssrRender||e?.__ssrInlineRender)return;let t=z(e);t?.__asyncLoader&&!t.__asyncResolved&&await t.__asyncLoader()}));function r(e,t){let n=e.tag;if(e.type===`text`||n===`binding`||e.type===`comment`)return[];let i=K(e,t.tags);if(U(i))return[];let a=[];e.type!==`root`&&!q(i)&&a.push(i);for(let n of e.children||[])a.push(...r(n,t));return a}}function K(e,t){let n=e.tag;return!n||e.props?.__ignoreMap!==void 0?n:t[n]||t[f(n)]||t[p(e.tag)]||n}function q(e){return typeof e==`string`&&D.has(e)||g.has(e)}var J=Object.assign(A,{__name:`MDCRenderer`});export{J as t}; 2//# sourceMappingURL=DxTD9ER4.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.