@codename/deck 0.3.0 → 0.4.0
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/README.md +4 -4
- package/dist/deck.bundle.mjs +100 -94
- package/dist/deck.bundle.mjs.map +4 -4
- package/dist/deck.css +111 -0
- package/dist/deck.js +208 -91
- package/dist/deck.js.map +4 -4
- package/dist/deck.mjs +42 -36
- package/dist/deck.mjs.map +4 -4
- package/dist/template.mjs +3 -3
- package/dist/template.mjs.map +3 -3
- package/dist/types/blocks.d.ts +6 -4
- package/dist/types/figures.d.ts +68 -0
- package/dist/types/kit.d.ts +16 -0
- package/dist/types/mindmap.d.ts +69 -0
- package/dist/types/pptx.d.ts +3 -1
- package/dist/types/render.d.ts +21 -3
- package/dist/types/version.d.ts +1 -1
- package/docs/format.md +85 -4
- package/docs/host.md +3 -3
- package/docs/kits.md +10 -2
- package/package.json +1 -1
- package/src/blocks.js +26 -9
- package/src/deck.css +111 -0
- package/src/deck.js +11 -1
- package/src/figures.js +255 -0
- package/src/kit.js +35 -6
- package/src/mindmap.js +208 -0
- package/src/pptx.js +132 -17
- package/src/render.js +122 -19
- package/src/version.js +1 -1
package/dist/deck.bundle.mjs
CHANGED
|
@@ -1,114 +1,120 @@
|
|
|
1
|
-
function
|
|
1
|
+
function ve(e){let t=e.replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
|
-
`).map(
|
|
4
|
-
`);return
|
|
3
|
+
`).map(s=>({indent:s.length-s.trimStart().length,text:En(s).trimEnd(),raw:s})),r=Ie(t,{i:0},0);return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}function En(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(t)r===t&&(t="");else if(r==='"'||r==="'")t=r;else if(r==="#"&&(n===0||/\s/.test(e[n-1])))return e.slice(0,n)}return e}function Ie(e,t,n){for(;t.i<e.length&&!e[t.i].text.trim();)t.i++;if(t.i>=e.length||e[t.i].indent<n)return null;let r=e[t.i].indent;if(/^-(\s|$)/.test(e[t.i].text.trim())){let i=[];for(;t.i<e.length;){let l=e[t.i];if(!l.text.trim()){t.i++;continue}if(l.indent!==r||!/^-(\s|$)/.test(l.text.trim()))break;let a=l.text.trim().slice(1).trim();if(t.i++,!a)i.push(Ie(e,t,r+1));else if(/^[^'"[{][^:]*:(\s|$)/.test(a)){let c=l.raw.indexOf(a);e.splice(t.i,0,{indent:c,text:" ".repeat(c)+a,raw:" ".repeat(c)+a}),i.push(Ie(e,t,c))}else i.push(qe(a))}return i}let s={};for(;t.i<e.length;){let i=e[t.i];if(!i.text.trim()){t.i++;continue}if(i.indent!==r)break;let l=/^("(?:[^"\\]|\\.)*"|'(?:[^']|'')*'|[^:]+?)\s*:(?:\s+(.*))?$/.exec(i.text.trim());if(t.i++,!l)continue;let a=String(qe(l[1])),c=(l[2]??"").trim();c==="|"||c===">"||/^[|>][+-]$/.test(c)?s[a]=Mn(e,t,r,c[0]===">"):c?s[a]=qe(c):s[a]=Ie(e,t,r+1)}return s}function Mn(e,t,n,r){let s=[];for(;t.i<e.length&&(!e[t.i].raw.trim()||e[t.i].indent>n);)s.push(e[t.i++].raw);for(;s.length&&!s.at(-1)?.trim();)s.pop();let i=Math.min(...s.filter(a=>a.trim()).map(a=>a.length-a.trimStart().length)),l=s.map(a=>a.slice(i)).join(`
|
|
4
|
+
`);return r?l.replace(/([^\n])\n(?=[^\n])/g,"$1 "):l}function qe(e){let t=e.trim();if(t.startsWith("[")||t.startsWith("{")){let n=Ot(t,{i:0});if(n!==void 0)return n}if(/^"(?:[^"\\]|\\.)*"$/.test(t))try{return JSON.parse(t)}catch{return t.slice(1,-1)}return/^'(?:[^']|'')*'$/.test(t)?t.slice(1,-1).replace(/''/g,"'"):/^(true|yes|on)$/i.test(t)?!0:/^(false|no|off)$/i.test(t)?!1:/^(null|~)$/i.test(t)||t===""?null:/^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?$/i.test(t)?Number(t):t}function Ot(e,t){let n=()=>{for(;/\s/.test(e[t.i]??"");)t.i++},r=()=>{if(n(),e[t.i]==="["||e[t.i]==="{")return Ot(e,t);let l=t.i;if(e[t.i]==='"'||e[t.i]==="'"){let a=e[t.i++];for(;t.i<e.length&&!(e[t.i]===a&&e[t.i-1]!=="\\");)t.i++;t.i++}else for(;t.i<e.length&&!/[,\]}]/.test(e[t.i])&&!(e[t.i]===":"&&/^[\s,\]}]?$/.test(e[t.i+1]??""));)t.i++;return qe(e.slice(l,t.i))},s=e[t.i++];if(n(),s==="["){let l=[];for(;t.i<e.length&&e[t.i]!=="]";){if(l.push(r()),n(),e[t.i]===",")t.i++;else if(e[t.i]!=="]")return;n()}return t.i++,l}let i={};for(;t.i<e.length&&e[t.i]!=="}";){let l=r();if(n(),e[t.i]!==":")return;if(t.i++,i[String(l)]=r(),n(),e[t.i]===",")t.i++;else if(e[t.i]!=="}")return;n()}return t.i++,i}var Pn=/^::([\w-]+)::\s*$/;function De(e){let n=e.replace(/\r\n?/g,`
|
|
5
5
|
`).split(`
|
|
6
|
-
`),
|
|
7
|
-
`)):{},
|
|
8
|
-
`)),n=
|
|
9
|
-
`),
|
|
10
|
-
`).trim(),
|
|
11
|
-
`:"")+
|
|
12
|
-
`:"")+
|
|
13
|
-
`),
|
|
14
|
-
`),start:
|
|
15
|
-
`));for(let[v
|
|
16
|
-
`).entries()){let Z=/^\s*(`{3,}|~{3,})/.exec(E)?.[1],K=fn.exec(E)??(z.has(v)?[E,z.get(v)]:null);if(k)Z&&E.trimStart().startsWith(k)&&(k="");else if(Z)k=Z;else if(K){x(),m=K[1],b=[],f=n+v+1;continue}b.push(E)}x();let W=h.filter((v,E)=>E>0||v.text.trim()||h.length===1),q=/^#{1,6}\s+(.+)$/m.exec(o.replace(/^```[\s\S]*?^```/gm,""));return{index:i,start:e[r?r[0]-1:n],end:e[s]-1,settings:a,slots:W,notes:u,title:String(a.title??q?.[1]??"").trim()}}var Oe=/^[a-z][a-z0-9-]{0,31}$/,kn=/^(auto|min-content|max-content|\d{1,2}(\.\d)?fr|\d{1,3}%)$/,bn=["Title Slide","Title and Content","Section Header","Two Content","Comparison","Title Only","Blank","Content with Caption","Picture with Caption"],Et={align:["start","center","end"],justify:["start","center","end"],paper:["paper","fill","ink","soft"],title:["normal","large","huge"],logo:["small","big","none"]},ge=["top-end","top-start","bottom-end","bottom-start"],Pt=t=>typeof t=="string"&&t.length<=7e5&&/^data:image\/(png|jpeg|gif|webp|svg\+xml);base64,[a-z0-9+/]+=*$/i.test(t)?t:null,xn=t=>typeof t=="string"&&t.length<=3145728&&/^data:image\/(?:(?:png|jpeg|gif|webp|svg\+xml);base64,[a-z0-9+/]+=*|svg\+xml,[\w.!~*'()%/+=-]*)$/i.test(t)?t:null,Ue={title:"cover","title-slide":"cover","two-columns":"two-cols","two-column":"two-cols",columns:"two-cols",comparison:"two-cols-header","three-columns":"three-cols","section-header":"section",divider:"section",big:"fact",number:"fact","image-text":"image-right",closing:"end",thanks:"end"},Me={name:"standard",tokens:{},pictures:{},layouts:Object.fromEntries(Object.entries({default:{label:{en:"Title and content",fr:"Titre et contenu"},pptx:"Title and Content"},cover:{label:{en:"Cover",fr:"Couverture"},justify:"center",paper:"fill",title:"huge",logo:"big",pptx:"Title Slide",numbered:!1},intro:{label:{en:"Introduction",fr:"Introduction"},justify:"center",paper:"fill",title:"large",logo:"big",pptx:"Title Slide",numbered:!1},section:{label:{en:"Section",fr:"Section"},justify:"center",paper:"ink",title:"huge",pptx:"Section Header",numbered:!1},center:{label:{en:"Centred",fr:"Centré"},justify:"center",align:"center",pptx:"Title Only"},statement:{label:{en:"Statement",fr:"Affirmation"},justify:"center",align:"center",title:"large",pptx:"Title Only"},fact:{label:{en:"Big number",fr:"Grand chiffre"},justify:"center",align:"center",title:"huge",pptx:"Title Only"},quote:{label:{en:"Quote",fr:"Citation"},justify:"center",pptx:"Title Only"},end:{label:{en:"Closing",fr:"Clôture"},justify:"center",align:"center",paper:"fill",title:"large",logo:"big",pptx:"Title Slide",numbered:!1},full:{label:{en:"Full",fr:"Plein cadre"},logo:"none",pptx:"Blank",numbered:!1},none:{label:{en:"Blank",fr:"Vide"},logo:"none",pptx:"Blank",numbered:!1},"two-cols":{label:{en:"Two columns",fr:"Deux colonnes"},slots:["default","right"],areas:"default right",columns:"1fr 1fr",pptx:"Two Content"},"two-cols-header":{label:{en:"Comparison",fr:"Comparaison"},slots:["default","left","right","bottom"],areas:"default default | left right | bottom bottom",columns:"1fr 1fr",rows:"auto 1fr auto",pptx:"Comparison"},"three-cols":{label:{en:"Three columns",fr:"Trois colonnes"},slots:["default","left","middle","right"],areas:"default default default | left middle right",columns:"1fr 1fr 1fr",rows:"auto 1fr",pptx:"Comparison"},"image-left":{label:{en:"Picture left",fr:"Image à gauche"},pptx:"Picture with Caption",justify:"center"},"image-right":{label:{en:"Picture right",fr:"Image à droite"},pptx:"Picture with Caption",justify:"center"},image:{label:{en:"Picture",fr:"Image"},logo:"none",pptx:"Blank",numbered:!1}}).map(([t,e])=>[t,Ge(e).layout]))};function Ge(t){let e=[];if(!t||typeof t!="object")return{layout:null,problems:["not a layout"]};let n={},s=Array.isArray(t.slots)||typeof t.slots=="string"?[t.slots].flat().map(String):t.slots&&typeof t.slots=="object"?Object.entries(t.slots).map(([f,k])=>(k&&typeof k=="object"&&(n[f]=yn(k)),f==="title"?"default":f)):["default"],r=[...new Set(s)];if(!r.every(f=>Oe.test(f)))return{layout:null,problems:["a slot name is not a-z, 0-9 and -"]};r.includes("default")||r.unshift("default");let a=(Array.isArray(t.areas)?t.areas.map(f=>[f].flat().join(" ")):String(t.areas??r.join(" ")).split(/\||\n/)).map(f=>f.trim().replace(/^"|"$/g,"").split(/\s+/)).filter(f=>f.length&&f[0]),l=a[0]?.length??0;if(!a.length||a.some(f=>f.length!==l)||a.flat().some(f=>f!=="."&&!r.includes(f)))return{layout:null,problems:["areas are not a rectangle of its slots"]};for(let f of r){let k=a.flatMap((z,W)=>z.map((q,v)=>[q,v,W])).filter(([z])=>z===f);if(!k.length){f!=="default"&&e.push(`slot ${f} has no area`);continue}let b=k.map(z=>z[1]),x=k.map(z=>z[2]);if(k.length!==(Math.max(...b)-Math.min(...b)+1)*(Math.max(...x)-Math.min(...x)+1))return{layout:null,problems:[`slot ${f} is not a rectangle`]}}let o=(f,k)=>{let b=f===void 0?Array(k).fill("1fr"):(Array.isArray(f)?f:String(f).split(/\s+/)).map(String);return b.length===k&&b.every(x=>kn.test(x))?b:null},u=o(t.columns,l),p=o(t.rows,a.length);if(!u||!p)return{layout:null,problems:["columns or rows are not tracks deck knows (auto, 1fr, 40%…), one per column or row"]};let c=(f,k)=>{let b=String(t[f]??k);return Et[f].includes(b)?b:(e.push(`${f} ${b} is not one of ${Et[f].join(", ")}`),k)},d=typeof t.label=="string"||t.label&&typeof t.label=="object"?t.label:void 0,h=Array.isArray(t.art)&&t.art.length<=8&&t.art.every(f=>typeof f=="string"&&Oe.test(f))?t.art:void 0;t.art!==void 0&&!h&&e.push("art is not 8 names at most");let m=f=>typeof f=="string"?f.slice(0,300):void 0;return{layout:{label:d,intent:m(t.intent),use_when:m(t.use_when),avoid_when:m(t.avoid_when),slots:r,budgets:n,areas:a,columns:u,rows:p,align:c("align","start"),justify:c("justify","start"),paper:c("paper","paper"),title:c("title","normal"),logo:c("logo","small"),pptx:bn.includes(t.pptx)?t.pptx:r.length>1?"Comparison":"Title and Content",numbered:t.numbered!==!1,art:h},problems:e}}function yn(t){let e={};for(let n of["max_words","max_chars","item_max_words","heading_max_words"])Number.isInteger(t[n])&&t[n]>0&&(e[n]=t[n]);return Array.isArray(t.items)&&t.items.length===2&&t.items.every(Number.isInteger)&&(e.items=t.items),typeof t.required=="boolean"&&(e.required=t.required),typeof t.kind=="string"&&/^[a-z-]{1,20}$/.test(t.kind)&&(e.kind=t.kind),e}function zt(t){if(!t||typeof t!="object")return{};if(!JSON.stringify(t).includes('"$value"'))return t;let e=d=>d&&typeof d=="object"&&"$value"in d?d.$value:d,n=d=>{let h=e(d);return typeof h=="string"?h:typeof h?.hex=="string"?`${h.hex}${typeof h.alpha=="number"&&h.alpha<1?Math.round(Math.max(0,h.alpha)*255).toString(16).padStart(2,"0"):""}`:void 0},s=d=>{let h=e(d);return Array.isArray(h)?h.map(String):typeof h=="string"?[h]:void 0},r={bg:"paper",background:"paper",paper:"paper",fg:"ink",text:"ink",ink:"ink",accent:"primary",primary:"primary",muted:"muted",surface:"soft",soft:"soft"},i=d=>Object.fromEntries(Object.entries(d??{}).filter(([h])=>h in r).map(([h,m])=>[r[h],n(m)]).filter(([,h])=>h)),a=t.color??t.colour??{},l={...i(a),...i(a.light)},o=i(a.dark);Object.keys(o).length&&(l.dark=o);let u=t.font??t.fontFamily??{},p=s(u.heading??u.display??u.sans),c=s(u.body??u.text??u.sans);return(p||c)&&(l.fonts={heading:p??c,body:c??p}),l}function _e(...t){let e={name:"standard",tokens:{},layouts:{...Me.layouts},pictures:{}},n=[];for(let s of t)if(!(!s||typeof s!="object")){if(typeof s.name=="string"&&(e.name=s.name),s.tokens&&typeof s.tokens=="object"){let r=zt(s.tokens),i=r.dark&&typeof r.dark=="object"?{...e.tokens.dark,...r.dark}:e.tokens.dark;e.tokens={...e.tokens,...r,...i&&{dark:i}}}for(let[r,i]of Object.entries(s.pictures??{}))Oe.test(r)&&xn(i)?e.pictures[r]=i:n.push(`picture ${r}: not a picture inside the kit`);for(let[r,i]of Object.entries(s.layouts??s.types??{})){if(!Oe.test(r)){n.push(`layout ${r}: not a-z, 0-9 and -`);continue}if(i===!1){r!=="default"&&delete e.layouts[r];continue}let{layout:a,problems:l}=Ge(i);n.push(...l.map(o=>`layout ${r}: ${o}`)),a&&(e.layouts[r]=a)}}for(let[s,r]of[["logo",e.tokens],["dark logo",e.tokens.dark]])r?.logo!==void 0&&!Pt(r.logo)&&(n.push(`${s}: not a picture inside the kit (PNG, JPEG, GIF, WebP or SVG as data:, 512 KB at most)`),delete r.logo);return e.tokens.logoAt!==void 0&&!ge.includes(e.tokens.logoAt)&&(n.push(`logoAt ${e.tokens.logoAt} is not one of ${ge.join(", ")}`),delete e.tokens.logoAt),{kit:e,problems:n}}function Qe(t,e,n){return typeof t.label=="string"?t.label:t.label?.[n]??t.label?.[n.split("-")[0]]??t.label?.en??e}function Ve(t){let e=t.slots.map(r=>r.name);if(e.includes("middle"))return"three-cols";if(e.includes("left"))return"two-cols-header";if(e.includes("right"))return"two-cols";if(t.index===0)return"cover";let s=t.slots.map(r=>r.text).join(`
|
|
6
|
+
`),r=[0];for(let o of n)r.push(r.at(-1)+o.length+1);let s=[],i=0,l=null,a=!1;for(let o=0;o<n.length;o++){let d=n[o].trimEnd();if(a){a=Lt(d,!0);continue}if(d.startsWith("---")&&!/^---\s*-/.test(d)){if((o>i||l)&&s.push({start:i,end:o,matter:l}),l=null,i=o+1,d[3]!=="-"&&n[o+1]?.trim()&&/^\s*([\w-]+\s*:|#\s)/.test(n[o+1])&&!/^#{1,6}\s/.test(n[o+1])){let h=o+1;for(;h<n.length&&n[h].trimEnd()!=="---";)h++;l=[o+1,h],o=h,i=h+1}}else if(/^\s*(`{3,}|~{3,})/.test(d)){let h=/^\s*(`{3,}|~{3,})/.exec(d)[1],g=o+1;for(;g<n.length&&!n[g].trimStart().startsWith(h);)g++;g<n.length&&(o=g)}else a=Lt(d,!1)}(i<n.length||l)&&s.push({start:i,end:n.length,matter:l});let c=s.at(-1);if(s.length===1&&c){let o="",d=[];for(let h=c.start;h<c.end;h++){let g=/^\s*(`{3,}|~{3,})/.exec(n[h])?.[1];o?g&&n[h].trimStart().startsWith(o)&&(o=""):g?o=g:/^#{1,2}\s+\S/.test(n[h])&&d.push(h)}if(d.length>=2){s.pop();let h=d[0]>c.start&&!n.slice(c.start,d[0]).some(g=>g.trim())?d:[c.start,...d.slice(d[0]===c.start?1:0)];h.forEach((g,u)=>s.push({start:u===0?c.start:g,end:h[u+1]??c.end,matter:u===0?c.matter:null}))}}let p=s.map(({start:o,end:d,matter:h},g)=>Ln(n,r,o,d,h,g)).filter((o,d)=>d===0||o.slots.some(h=>h.text.trim())||Object.keys(o.settings).length);return p.forEach((o,d)=>{o.index=d}),{settings:p[0]?.settings??{},slides:p}}function On(e){let t=new Map,n=e.findIndex(a=>/^:{3,}[ \t]*\{?[ \t]*\.?columns\b/.test(a));if(n<0)return t;let r=/^:+/.exec(e[n])[0],s=e.findIndex((a,c)=>c>n&&a.trim()===r),i=e.map((a,c)=>[a,c]).filter(([a,c])=>Number(c)>n&&(s<0||Number(c)<s)&&/^:{3,}[ \t]*\{?[ \t]*\.?col(umn)?\b/.test(String(a))).map(([,a])=>Number(a));if(i.length<2)return t;let l=i.length===2?["left","right"]:["left","middle","right",...i.slice(3).map((a,c)=>`col-${c+4}`)];return i.forEach((a,c)=>t.set(a,l[c])),s>0&&e.slice(s+1).some(a=>a.trim())&&t.set(s,"bottom"),t}function Lt(e,t){let n=0;for(;;)if(t){let r=e.indexOf("-->",n);if(r<0)return!0;t=!1,n=r+3}else{let r=e.indexOf("<!--",n);if(r<0)return!1;let s=e.indexOf("-->",r+4);if(s<0)return!0;n=s+3}}function Ln(e,t,n,r,s,i){let l=s?ve(e.slice(s[0],s[1]).join(`
|
|
7
|
+
`)):{},a=n;for(;a<r&&!e[a].trim();)a++;if(!s&&/^```ya?ml\s*$/.test(e[a]??"")){let S=a+1;for(;S<r&&!e[S].startsWith("```");)S++;l=ve(e.slice(a+1,S).join(`
|
|
8
|
+
`)),n=S+1}let c=e.slice(n,r).join(`
|
|
9
|
+
`),p="",o=/^(\?\?\?|Notes?:)[ \t]*(.*)$/m.exec(c);o&&o.index!==void 0&&!/^```/m.test(c.slice(o.index))&&(p=[o[2],c.slice(o.index+o[0].length)].join(`
|
|
10
|
+
`).trim(),c=c.slice(0,o.index)),c=c.replace(/<aside\b[^>]*class=["']?notes["']?[^>]*>([\s\S]*?)<\/aside>/gi,(S,v)=>(p+=(p?`
|
|
11
|
+
`:"")+v.replace(/<[^>]*>/g," ").replace(/[ \t]+/g," ").trim(),S.replace(/[^\n]/g," "))),c=c.replace(/^(:{3,})[ \t]*\{?[ \t]*\.?notes[ \t]*\}?[ \t]*\n([\s\S]*?)\n\1[ \t]*$/gm,(S,v,N)=>(p+=(p?`
|
|
12
|
+
`:"")+N.trim(),S.replace(/[^\n]/g," ")));let h=[...c.matchAll(/<!--([\s\S]*?)-->/g)].at(-1);h&&h.index!==void 0&&!c.slice(h.index+h[0].length).trim()&&(p=[h[1].trim(),p].filter(Boolean).join(`
|
|
13
|
+
`),c=c.slice(0,h.index));let g=[],u="default",f=n,m="",k=[],y=()=>g.push({name:u,text:k.join(`
|
|
14
|
+
`),start:t[f]}),x=On(c.split(`
|
|
15
|
+
`));for(let[S,v]of c.split(`
|
|
16
|
+
`).entries()){let N=/^\s*(`{3,}|~{3,})/.exec(v)?.[1],E=Pn.exec(v)??(x.has(S)?[v,x.get(S)]:null);if(m)N&&v.trimStart().startsWith(m)&&(m="");else if(N)m=N;else if(E){y(),u=E[1],k=[],f=n+S+1;continue}k.push(v)}y();let C=g.filter((S,v)=>v>0||S.text.trim()||g.length===1),A=/^#{1,6}\s+(.+)$/m.exec(c.replace(/^```[\s\S]*?^```/gm,""));return{index:i,start:t[s?s[0]-1:n],end:t[r]-1,settings:l,slots:C,notes:p,title:String(l.title??A?.[1]??"").trim()}}var Fe=/^[a-z][a-z0-9-]{0,31}$/,zn=/^(auto|min-content|max-content|\d{1,2}(\.\d)?fr|\d{1,3}%)$/,Nn=["Title Slide","Title and Content","Section Header","Two Content","Comparison","Title Only","Blank","Content with Caption","Picture with Caption"],zt={align:["start","center","end"],justify:["start","center","end"],paper:["paper","fill","ink","soft"],title:["normal","large","huge"],logo:["small","big","none"],lists:["bullets","mindmap","steps","metrics","timeline","process","agenda","pyramid","bento"],parts:["none","versus","matrix"]},Se=["top-end","top-start","bottom-end","bottom-start"],_t=e=>typeof e=="string"&&e.length<=7e5&&/^data:image\/(png|jpeg|gif|webp|svg\+xml);base64,[a-z0-9+/]+=*$/i.test(e)?e:null,_n=e=>typeof e=="string"&&e.length<=3145728&&/^data:image\/(?:(?:png|jpeg|gif|webp|svg\+xml);base64,[a-z0-9+/]+=*|svg\+xml,[\w.!~*'()%/+=-]*)$/i.test(e)?e:null,Nt={title:"cover","title-slide":"cover","two-columns":"two-cols","two-column":"two-cols",columns:"two-cols",comparison:"two-cols-header","three-columns":"three-cols","section-header":"section",divider:"section",big:"fact",number:"fact","image-text":"image-right",closing:"end",thanks:"end","mind-map":"mindmap",map:"mindmap",toc:"summary",contents:"summary","table-of-contents":"summary",outline:"summary","sub-section":"subsection","subsection-header":"subsection",cards:"steps",kpi:"metrics",kpis:"metrics",stats:"metrics",numbers:"metrics",roadmap:"timeline",milestones:"timeline",chevrons:"process",schedule:"agenda",programme:"agenda",program:"agenda",hierarchy:"pyramid",mosaic:"bento",vs:"versus","face-off":"versus",quadrant:"matrix",quadrants:"matrix","2x2":"matrix"},Be={name:"standard",tokens:{},pictures:{},layouts:Object.fromEntries(Object.entries({default:{label:{en:"Title and content",fr:"Titre et contenu"},pptx:"Title and Content"},cover:{label:{en:"Cover",fr:"Couverture"},justify:"center",paper:"fill",title:"huge",logo:"big",pptx:"Title Slide",numbered:!1},intro:{label:{en:"Introduction",fr:"Introduction"},justify:"center",paper:"fill",title:"large",logo:"big",pptx:"Title Slide",numbered:!1},section:{label:{en:"Section",fr:"Section"},justify:"center",paper:"ink",title:"huge",pptx:"Section Header",numbered:!1},subsection:{label:{en:"Subsection",fr:"Sous-section"},justify:"center",paper:"soft",title:"large",pptx:"Section Header",numbered:!1},summary:{label:{en:"Contents",fr:"Sommaire"},contents:!0,pptx:"Title and Content"},center:{label:{en:"Centred",fr:"Centré"},justify:"center",align:"center",pptx:"Title Only"},statement:{label:{en:"Statement",fr:"Affirmation"},justify:"center",align:"center",title:"large",pptx:"Title Only"},fact:{label:{en:"Big number",fr:"Grand chiffre"},justify:"center",align:"center",title:"huge",pptx:"Title Only"},quote:{label:{en:"Quote",fr:"Citation"},justify:"center",pptx:"Title Only"},end:{label:{en:"Closing",fr:"Clôture"},justify:"center",align:"center",paper:"fill",title:"large",logo:"big",pptx:"Title Slide",numbered:!1},full:{label:{en:"Full",fr:"Plein cadre"},logo:"none",pptx:"Blank",numbered:!1},none:{label:{en:"Blank",fr:"Vide"},logo:"none",pptx:"Blank",numbered:!1},"two-cols":{label:{en:"Two columns",fr:"Deux colonnes"},slots:["default","right"],areas:"default right",columns:"1fr 1fr",pptx:"Two Content"},"two-cols-header":{label:{en:"Comparison",fr:"Comparaison"},slots:["default","left","right","bottom"],areas:"default default | left right | bottom bottom",columns:"1fr 1fr",rows:"auto 1fr auto",pptx:"Comparison"},"three-cols":{label:{en:"Three columns",fr:"Trois colonnes"},slots:["default","left","middle","right"],areas:"default default default | left middle right",columns:"1fr 1fr 1fr",rows:"auto 1fr",pptx:"Comparison"},"image-left":{label:{en:"Picture left",fr:"Image à gauche"},pptx:"Picture with Caption",justify:"center"},"image-right":{label:{en:"Picture right",fr:"Image à droite"},pptx:"Picture with Caption",justify:"center"},image:{label:{en:"Picture",fr:"Image"},logo:"none",pptx:"Blank",numbered:!1},mindmap:{label:{en:"Mind map",fr:"Carte mentale"},lists:"mindmap",pptx:"Title Only"},steps:{label:{en:"Steps",fr:"Étapes"},lists:"steps",pptx:"Title Only"},metrics:{label:{en:"Key figures",fr:"Chiffres clés"},lists:"metrics",pptx:"Title Only"},timeline:{label:{en:"Timeline",fr:"Frise"},lists:"timeline",pptx:"Title Only"},process:{label:{en:"Process",fr:"Processus"},lists:"process",pptx:"Title Only"},agenda:{label:{en:"Agenda",fr:"Programme"},lists:"agenda",pptx:"Title Only"},pyramid:{label:{en:"Pyramid",fr:"Pyramide"},lists:"pyramid",pptx:"Title Only"},bento:{label:{en:"Bento",fr:"Mosaïque"},lists:"bento",pptx:"Title Only"},versus:{label:{en:"Versus",fr:"Face à face"},parts:"versus",pptx:"Title Only"},matrix:{label:{en:"Matrix",fr:"Matrice"},parts:"matrix",pptx:"Title Only"}}).map(([e,t])=>[e,nt(t).layout]))};function nt(e){let t=[];if(!e||typeof e!="object")return{layout:null,problems:["not a layout"]};let n={},r=Array.isArray(e.slots)||typeof e.slots=="string"?[e.slots].flat().map(String):e.slots&&typeof e.slots=="object"?Object.entries(e.slots).map(([f,m])=>(m&&typeof m=="object"&&(n[f]=jn(m)),f==="title"?"default":f)):["default"],s=[...new Set(r)];if(!s.every(f=>Fe.test(f)))return{layout:null,problems:["a slot name is not a-z, 0-9 and -"]};s.includes("default")||s.unshift("default");let l=(Array.isArray(e.areas)?e.areas.map(f=>[f].flat().join(" ")):String(e.areas??s.join(" ")).split(/\||\n/)).map(f=>f.trim().replace(/^"|"$/g,"").split(/\s+/)).filter(f=>f.length&&f[0]),a=l[0]?.length??0;if(!l.length||l.some(f=>f.length!==a)||l.flat().some(f=>f!=="."&&!s.includes(f)))return{layout:null,problems:["areas are not a rectangle of its slots"]};for(let f of s){let m=l.flatMap((x,C)=>x.map((A,S)=>[A,S,C])).filter(([x])=>x===f);if(!m.length){f!=="default"&&t.push(`slot ${f} has no area`);continue}let k=m.map(x=>x[1]),y=m.map(x=>x[2]);if(m.length!==(Math.max(...k)-Math.min(...k)+1)*(Math.max(...y)-Math.min(...y)+1))return{layout:null,problems:[`slot ${f} is not a rectangle`]}}let c=(f,m)=>{let k=f===void 0?Array(m).fill("1fr"):(Array.isArray(f)?f:String(f).split(/\s+/)).map(String);return k.length===m&&k.every(y=>zn.test(y))?k:null},p=c(e.columns,a),o=c(e.rows,l.length);if(!p||!o)return{layout:null,problems:["columns or rows are not tracks deck knows (auto, 1fr, 40%…), one per column or row"]};let d=(f,m)=>{let k=String(e[f]??m);return zt[f].includes(k)?k:(t.push(`${f} ${k} is not one of ${zt[f].join(", ")}`),m)},h=typeof e.label=="string"||e.label&&typeof e.label=="object"?e.label:void 0,g=Array.isArray(e.art)&&e.art.length<=8&&e.art.every(f=>typeof f=="string"&&Fe.test(f))?e.art:void 0;e.art!==void 0&&!g&&t.push("art is not 8 names at most");let u=f=>typeof f=="string"?f.slice(0,300):void 0;return{layout:{label:h,intent:u(e.intent),use_when:u(e.use_when),avoid_when:u(e.avoid_when),slots:s,budgets:n,areas:l,columns:p,rows:o,align:d("align","start"),justify:d("justify","start"),paper:d("paper","paper"),title:d("title","normal"),logo:d("logo","small"),lists:d("lists","bullets"),parts:d("parts","none"),contents:e.contents===!0,pptx:Nn.includes(e.pptx)?e.pptx:s.length>1?"Comparison":"Title and Content",numbered:e.numbered!==!1,art:g},problems:t}}function jn(e){let t={};for(let n of["max_words","max_chars","item_max_words","heading_max_words"])Number.isInteger(e[n])&&e[n]>0&&(t[n]=e[n]);return Array.isArray(e.items)&&e.items.length===2&&e.items.every(Number.isInteger)&&(t.items=e.items),typeof e.required=="boolean"&&(t.required=e.required),typeof e.kind=="string"&&/^[a-z-]{1,20}$/.test(e.kind)&&(t.kind=e.kind),t}function jt(e){if(!e||typeof e!="object")return{};if(!JSON.stringify(e).includes('"$value"'))return e;let t=h=>h&&typeof h=="object"&&"$value"in h?h.$value:h,n=h=>{let g=t(h);return typeof g=="string"?g:typeof g?.hex=="string"?`${g.hex}${typeof g.alpha=="number"&&g.alpha<1?Math.round(Math.max(0,g.alpha)*255).toString(16).padStart(2,"0"):""}`:void 0},r=h=>{let g=t(h);return Array.isArray(g)?g.map(String):typeof g=="string"?[g]:void 0},s={bg:"paper",background:"paper",paper:"paper",fg:"ink",text:"ink",ink:"ink",accent:"primary",primary:"primary",muted:"muted",surface:"soft",soft:"soft"},i=h=>Object.fromEntries(Object.entries(h??{}).filter(([g])=>g in s).map(([g,u])=>[s[g],n(u)]).filter(([,g])=>g)),l=e.color??e.colour??{},a={...i(l),...i(l.light)},c=i(l.dark);Object.keys(c).length&&(a.dark=c);let p=e.font??e.fontFamily??{},o=r(p.heading??p.display??p.sans),d=r(p.body??p.text??p.sans);return(o||d)&&(a.fonts={heading:o??d,body:d??o}),a}function He(...e){let t={name:"standard",tokens:{},layouts:{...Be.layouts},pictures:{}},n=[];for(let r of e)if(!(!r||typeof r!="object")){if(typeof r.name=="string"&&(t.name=r.name),r.tokens&&typeof r.tokens=="object"){let s=jt(r.tokens),i=s.dark&&typeof s.dark=="object"?{...t.tokens.dark,...s.dark}:t.tokens.dark;t.tokens={...t.tokens,...s,...i&&{dark:i}}}for(let[s,i]of Object.entries(r.pictures??{}))Fe.test(s)&&_n(i)?t.pictures[s]=i:n.push(`picture ${s}: not a picture inside the kit`);for(let[s,i]of Object.entries(r.layouts??r.types??{})){if(!Fe.test(s)){n.push(`layout ${s}: not a-z, 0-9 and -`);continue}if(i===!1){s!=="default"&&delete t.layouts[s];continue}let{layout:l,problems:a}=nt(i);n.push(...a.map(c=>`layout ${s}: ${c}`)),l&&(t.layouts[s]=l)}}for(let[r,s]of[["logo",t.tokens],["dark logo",t.tokens.dark]])s?.logo!==void 0&&!_t(s.logo)&&(n.push(`${r}: not a picture inside the kit (PNG, JPEG, GIF, WebP or SVG as data:, 512 KB at most)`),delete s.logo);return t.tokens.logoAt!==void 0&&!Se.includes(t.tokens.logoAt)&&(n.push(`logoAt ${t.tokens.logoAt} is not one of ${Se.join(", ")}`),delete t.tokens.logoAt),{kit:t,problems:n}}function st(e,t,n){return typeof e.label=="string"?e.label:e.label?.[n]??e.label?.[n.split("-")[0]]??e.label?.en??t}function We(e,t){let n=String(e.settings.layout??"").trim().toLowerCase();return t.layouts[n]?n:t.layouts[Nt[n]]?Nt[n]:It(e)}function It(e){let t=e.slots.map(s=>s.name);if(t.includes("middle"))return"three-cols";if(t.includes("left"))return"two-cols-header";if(t.includes("right"))return"two-cols";if(e.index===0)return"cover";let r=e.slots.map(s=>s.text).join(`
|
|
17
17
|
`).trim().split(`
|
|
18
|
-
`).filter(
|
|
19
|
-
`))?"fact":
|
|
20
|
-
`)
|
|
18
|
+
`).filter(s=>s.trim());return r.length===1&&/^#{1,2}\s+\S/.test(r[0])?"section":/^#\s+[^\s]*\d[\d\s.,%€$£¥]*\S*\s*$/u.test(r[0]??"")&&r.length<=3&&!/^\s*[-*\d]+[.)]?\s/m.test(r.slice(1).join(`
|
|
19
|
+
`))?"fact":r.length&&r.every((s,i)=>s.startsWith(">")||i===r.length-1&&!s.startsWith("#"))&&r[0].startsWith(">")?"quote":"default"}var In=/^([ \t]*)(?:[-*+]|\d{1,9}[.)])(?:[ \t]+(?:\[[ xX]\][ \t]+)?|$)/;function qt(e,t){let n=[],r=[],s=t,i=null;for(let l of e.split(`
|
|
20
|
+
`)){let a=s;if(s+=l.length+1,i){if(l.trimStart().startsWith(i.fence)&&!l.trim().slice(i.fence.length).trim()){let o=r.at(-1).item;(o.blocks??=[]).push({lang:i.lang,text:i.lines.join(`
|
|
21
|
+
`)}),i=null}else i.lines.push(l.slice(Math.min(i.indent,/^[ \t]*/.exec(l)?.[0].length??0)));continue}let c=/^([ \t]*)(`{3,}|~{3,})(.*)$/.exec(l);if(c&&r.length){i={fence:c[2],indent:c[1].length,lang:c[3].trim(),lines:[]};continue}let p=In.exec(l);if(p){let o=p[1].replace(/\t/g," ").length,d={text:l.slice(p[0].length).trim(),start:a+p[0].length,end:a+l.trimEnd().length,children:[]};for(;r.length&&r.at(-1).indent>=o;)r.pop();(r.at(-1)?.item.children??n).push(d),r.push({indent:o,item:d})}else if(l.trim()&&r.length){let o=r.at(-1).item;o.text=`${o.text} ${l.trim()}`.trim(),o.end=a+l.trimEnd().length}}return n}var Ze=e=>e.normalize("NFC").replace(/[*_`~]/g,"").replace(/\s+/g," ").trim().toLowerCase();function rt(e){let t=[],n=new Map;for(let r of e){let s=Ze(r.text),i=s?n.get(s):void 0;if(i){i.children.push(...r.children),i.step=i.step||r.step;continue}let l={...r,children:[...r.children]};s&&n.set(s,l),t.push(l)}for(let r of t)r.children=rt(r.children);return t}function qn(e,{rtl:t=!1,aspect:n=0}={}){let r=Te(e,t,1);if(n>0&&r.width/r.height>n&&Te(e,t,4).height<r.width/n)r=Te(e,t,4);else if(n>0&&r.width/r.height>n){let s=1,i=4;for(let l=0;l<12;l++){let a=(s+i)/2;Te(e,t,a).height<r.width/n?s=a:i=a}r=Te(e,t,s)}return r}function Te(e,t,n){let r=x=>x<=1?2.4:1.5,s=x=>x<=1?.8*n:.3*Math.sqrt(n),i=(x,C)=>(x.inner=x.children.reduce((A,S)=>A+i(S,C+1),0)+s(C+1)*Math.max(0,x.children.length-1),x.span=Math.max(x.h,x.inner),x.span),l=[],a=(x,C,A,S,v,N)=>{let E=A+x.span/2;x.x=S>0?C:C-x.w,x.side=t?-S:S,x.y=E-x.h/2;let q=E-x.inner/2,I=C+S*x.w;for(let Q of x.children){let Y=I+S*r(v+1);a(Q,Y,q,S,v+1,N),l.push({branch:N,depth:v+1,x1:I,y1:E,x2:Y,y2:q+Q.span/2}),q+=Q.span+s(v+1)}};for(let x of e.children)i(x,1);e.span=e.h,e.side=0,e.x=-e.w/2,e.y=-e.h/2;let c=x=>x.reduce((C,A)=>C+A.span,0)+s(1)*Math.max(0,x.length-1),p=e.children.length,o=p;for(let x=Math.ceil(p/2);x<=p;x++)Math.max(c(e.children.slice(0,x)),c(e.children.slice(x)))<Math.max(c(e.children.slice(0,o)),c(e.children.slice(o)))&&(o=x);for(let[x,C]of[[1,e.children.slice(0,o)],[-1,e.children.slice(o).reverse()]]){let A=-c(C)/2;for(let S of C){let v=x*(e.w/2+r(1));a(S,v,A,x,1,e.children.indexOf(S)),l.push({branch:e.children.indexOf(S),depth:1,x1:x*e.w/2,y1:0,x2:v,y2:A+S.span/2}),A+=S.span+s(1)}}let d=[],h=x=>{d.push(x),x.children.forEach(h)};h(e);let g=Math.min(...d.map(x=>x.x)),u=Math.max(...d.map(x=>x.x+x.w)),f=Math.min(...d.map(x=>x.y)),m=Math.max(...d.map(x=>x.y+x.h)),k=u-g,y=x=>t?k-(x-g):x-g;for(let x of d)x.x=t?k-(x.x-g)-x.w:x.x-g,x.y=x.y-f;for(let x of l)Object.assign(x,{x1:y(x.x1),x2:y(x.x2),y1:x.y1-f,y2:x.y2-f});return{width:k,height:m-f,lines:l}}var Dn=({x1:e,y1:t,x2:n,y2:r})=>`M${e.toFixed(3)} ${t.toFixed(3)}C${((e+n)/2).toFixed(3)} ${t.toFixed(3)} ${((e+n)/2).toFixed(3)} ${r.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)}`;function Dt(e){let t=e.querySelector(".deck-map-plane"),n=t.querySelector(".deck-map-lines"),r=t.querySelector(".deck-map-tree > li"),s=()=>{if(!e.clientWidth||!e.clientHeight)return;let l=parseFloat(getComputedStyle(t).fontSize)||16,a=[],c=g=>{let u=g.firstElementChild,f=g.lastElementChild?.tagName==="UL"?[...g.lastElementChild.children]:[],m={w:u.offsetWidth/l,h:u.offsetHeight/l,children:f.map(c)};return a.push([u,m]),m},{width:p,height:o,lines:d}=qn(c(r),{rtl:getComputedStyle(e).direction==="rtl",aspect:e.clientWidth/e.clientHeight});for(let[g,u]of a)g.style.setProperty("left",`${u.x/p*100}%`),g.style.setProperty("top",`${u.y/o*100}%`),g.setAttribute("data-side",u.side===1?"right":u.side===-1?"left":"middle");t.style.setProperty("width",`${p}em`),t.style.setProperty("height",`${o}em`),n.setAttribute("viewBox",`0 0 ${p.toFixed(3)} ${o.toFixed(3)}`);let h=[...n.children];for(let g of h)g.replaceChildren();for(let g of d){let u=document.createElementNS("http://www.w3.org/2000/svg","path");u.setAttribute("d",Dn(g)),u.setAttribute("data-depth",String(g.depth)),h[g.branch]?.append(u)}t.style.setProperty("scale",String(Math.min(1,e.clientWidth/(p*l),e.clientHeight/(o*l))))},i=new ResizeObserver(s);i.observe(e);for(let l of t.querySelectorAll(".deck-map-node"))i.observe(l)}var Ft=/^\s*(?:[::—–|·-]\s*)?/,Fn=/^\d{1,2}(?:[:h.]\d{2}|h)?(?:\s?[ap]\.?m\.?)?(?:\s?[–-]\s?\d{1,2}(?:[:h.]\d{2}|h)?(?:\s?[ap]\.?m\.?)?)?(?=\s|$)/i,Bn=/^[+−-]?[^\p{L}\p{N}\s]?\d[\d., ]*\S*(?=\s|$)/u,Hn={agenda:Fn,metrics:Bn},Bt=e=>e.type==="paragraph"&&e.raw.trim().split(`
|
|
22
|
+
`).every(t=>/^\s*(\*\*|__)\S/.test(t));function Ht(e,t,n){if(e.type==="paragraph"){let s=t;return e.raw.split(`
|
|
23
|
+
`).flatMap(i=>{let l=s;s+=i.length+1;let a=i.trim();if(!a)return[];let[c]=n(a);return[{tokens:c?.tokens??[],start:l+i.length-i.trimStart().length,end:l+i.trimEnd().length,blocks:[],step:0}]})}let r=0;return e.items.map(s=>{let i=e.raw.indexOf(s.raw,r);r=i+s.raw.length;let l=t+Math.max(0,i),a=/^\s*(?:[-*+]|\d+[.)])\s+(?:\[[ xX]\]\s+)?/.exec(s.raw),[c,...p]=s.tokens,o=c&&(c.type==="text"||c.type==="paragraph")?c:null,d=l+(a?.[0].length??0);return{tokens:o?o.tokens??[{type:"text",raw:o.text,text:o.text}]:[],start:d,end:o&&a&&!o.raw.trim().includes(`
|
|
24
|
+
`)?d+o.raw.trim().length:-1,blocks:(o?p:s.tokens).map(h=>({token:h,start:l+Math.max(0,s.raw.indexOf(h.raw))})),step:0}})}function Wn(e,t){let[n,...r]=e.tokens,s=e.end>=0,i=(a,c)=>{let p=a[0],o=p?.type==="text"?Ft.exec(p.raw)[0].length:0,d=(o?[{...p,raw:p.raw.slice(o),text:p.text.slice(Ft.exec(p.text)[0].length)},...a.slice(1)]:a).filter(h=>h.raw.trim()||h.type!=="text");return{rest:d,restAt:s&&d.length&&c+o<e.end?[c+o,e.end]:null}};if(n?.type==="strong")return{lead:n.tokens,leadAt:s?[e.start+2,e.start+n.raw.length-2]:null,...i(r,e.start+n.raw.length)};let l=n?.type==="text"&&Hn[t]?.exec(n.raw);if(l){let a=n.raw.slice(l[0].length);return{lead:[{type:"text",raw:l[0],text:l[0]}],leadAt:s?[e.start,e.start+l[0].length]:null,...i([...a?[{type:"text",raw:a,text:a}]:[],...r],e.start+l[0].length)}}return{lead:null,leadAt:null,rest:e.tokens,restAt:s?[e.start,e.end]:null}}function Wt(e,t){let n=e.flatMap((i,l)=>i.type==="heading"?[{depth:i.depth,i:l}]:[]);if(!n.length)return new Set;let r=n.at(-1).depth,s=n.filter(i=>i.depth===r).map(i=>i.i);return new Set(s.length>t&&s[0]===e.findIndex(i=>i.type!=="space")?s.slice(1):s)}function Zn(e,t,n,r=2){let s=e.map(a=>{let c=We(a,t),p=a.settings.level,o=a.settings.hideInToc,d=/^(#{1,6})\s/m.exec(a.slots.map(f=>f.text).join(`
|
|
25
|
+
`).replace(/^(`{3,}|~{3,})[\s\S]*?^\1/gm,""))?.[1].length??1,h=Number.isInteger(p)||c==="section"||c==="subsection",g=Number.isInteger(p)?p:c==="section"?1:c==="subsection"?2:d,u=!!a.title&&(o===!1||o!==!0&&a.index!==n&&!t.layouts[c]?.contents&&!["cover","intro","end"].includes(c));return{index:a.index,title:a.title,level:g,part:h,kept:u,shown:o===!1}}).filter(a=>a.kept),i=s.some(a=>a.part)?s.filter(a=>a.part||a.shown):s,l=Math.min(...i.map(a=>a.level));return i.map(({index:a,title:c,level:p})=>({index:a,title:c,level:p-l+1})).filter(a=>a.level<=Math.max(1,r))}var Ue=(e,t,n)=>e.style.setProperty("grid-template-columns",`repeat(${t<=n?t:Math.ceil(t/2)}, minmax(0, 1fr))`);function Zt(e,t,n){let r=t.map(u=>({entry:u,...Wn(u,e)})),s=r.length,i=w("div",{class:`deck-figure deck-${e}`,"data-count":s});i.style.setProperty("--deck-count",String(s));let l=u=>u?ue(...u):void 0,a=u=>u.lead?w("span",{class:"deck-words deck-lead",dir:"auto","data-edit":l(u.leadAt)},Z(u.lead,n)):null,c=u=>u.rest.length?w("span",{class:"deck-words deck-text",dir:"auto","data-edit":l(u.restAt)},Z(u.rest,n)):null,p=u=>u.entry.blocks.map(({token:f,start:m})=>{let k=de(f,m,n,null);return k&&!k.matches(".deck-block, .deck-table, pre")&&k.classList.add("deck-words"),k}),o=(u,f)=>{if(u.entry.step)for(let m of f)m&&pe(m,u.entry.step)},d=(u,f,m)=>(u.style.setProperty("grid-column",String(f)),u.style.setProperty("grid-row",String(m)),u),h=u=>a(u)??c(u)??w("span",{class:"deck-words deck-lead"}),g=(u,f)=>w("div",{class:f},[u.lead?c(u):null,...p(u)]);switch(e){case"steps":Ue(i,s,5);for(let[u,f]of r.entries()){let m=w("div",{class:"deck-card deck-shape"},[w("span",{class:"deck-words deck-badge deck-shape"},[n.number(u+1)]),a(f),c(f),...p(f)]);o(f,[m]),i.append(m)}break;case"metrics":Ue(i,s,4);for(let u of r){let f=w("div",{class:"deck-metric deck-shape"},[a(u),c(u),...p(u)]);o(u,[f]),i.append(f)}break;case"timeline":Ue(i,s,99),i.append(w("span",{class:"deck-timeline-line deck-shape"}));for(let[u,f]of r.entries()){let m=[d(a(f)??w("span",{class:"deck-lead"}),u+1,1),d(w("span",{class:"deck-dot deck-shape"}),u+1,2),d(w("div",{class:"deck-milestone"},[c(f),...p(f)]),u+1,3)];o(f,m),i.append(...m)}break;case"process":Ue(i,s,99);for(let[u,f]of r.entries()){let m=[d(w("div",{class:"deck-chevron deck-shape","data-first":u===0||void 0,"data-last":u===s-1||void 0},[h(f)]),u+1,1),d(g(f,"deck-under"),u+1,2)];o(f,m),i.append(...m)}break;case"agenda":{let u=s>=7?[r.slice(0,Math.ceil(s/2)),r.slice(Math.ceil(s/2))]:[r];i.style.setProperty("grid-template-columns",`repeat(${u.length}, minmax(0, 1fr))`);for(let f of u)i.append(w("div",{class:"deck-agenda-col"},f.map(m=>{let k=w("div",{class:"deck-row deck-shape"},[a(m)??w("span",{class:"deck-lead"}),c(m),...p(m)]);return o(m,[k]),k})));break}case"pyramid":{let u=r.some(m=>m.lead&&(m.rest.length||m.entry.blocks.length));i.style.setProperty("grid-template-columns",u?"minmax(0, 1.15fr) minmax(0, 1fr)":"minmax(0, 30em)");let f=m=>Math.round(5e3*(.16+.84*m/s))/100;for(let[m,k]of r.entries()){let y=d(w("div",{class:"deck-level deck-shape"},[h(k)]),1,m+1);y.style.setProperty("clip-path",`polygon(${50-f(m)}% 0%, ${50+f(m)}% 0%, ${50+f(m+1)}% 100%, ${50-f(m+1)}% 100%)`),y.style.setProperty("padding-inline",`max(0.4em, ${Math.round((50-f(m))*100)/100}%)`);let x=[y,u?d(g(k,"deck-beside"),2,m+1):null];o(k,x),i.append(...x.filter(C=>C!==null))}break}case"bento":for(let[u,f]of r.entries()){let m=w("div",{class:`deck-tile deck-shape${u===0?" is-big":""}`},[a(f),c(f),...p(f)]);o(f,[m]),i.append(m)}break}return i}function Ut(e,t){let n=w("div",{class:`deck-figure deck-${e}`,"data-count":t.length});e==="versus"&&n.style.setProperty("grid-template-columns",t.map(()=>"minmax(0, 1fr)").join(" auto "));for(let[r,s]of t.entries()){for(let l of s)l instanceof HTMLElement&&!l.matches(".deck-block, .deck-table, pre, .deck-picture")&&l.classList.add("deck-words");e==="versus"&&r>0&&n.append(w("span",{class:"deck-vs deck-shape deck-words","aria-hidden":"true"},["VS"]));let i=t.length>1&&(e==="versus"?r===t.length-1:r===1);n.append(w("div",{class:`deck-part deck-shape${i?" is-highlight":""}`},s))}return n}function Gt(e,t,n){let r=e.deck?Zn(e.deck.slides,e.kit,t,n):[];if(!r.length)return null;let s=0,i=r.map(({index:c,title:p,level:o})=>{let[d]=e.lex(`# ${p}`);return w("div",{class:`deck-row deck-shape${o>1?" is-sub":""}`,"data-go":c,role:"link",tabindex:0},[w("span",{class:"deck-words deck-lead"},o>1?[]:[e.number(++s)]),w("span",{class:"deck-words deck-text",dir:"auto"},Z(d?.tokens??[{type:"text",text:p}],e))])}),l=i.length>=7?[i.slice(0,Math.ceil(i.length/2)),i.slice(Math.ceil(i.length/2))]:[i],a=w("div",{class:"deck-figure deck-agenda deck-contents","data-count":i.length},l.map(c=>w("div",{class:"deck-agenda-col"},c)));return a.style.setProperty("grid-template-columns",`repeat(${l.length}, minmax(0, 1fr))`),a}function w(e,t={},n=[]){let r=document.createElement(e);for(let[s,i]of Object.entries(t))i!==void 0&&i!==!1&&r.setAttribute(s,i===!0?"":String(i));for(let s of n)(s||s==="")&&r.append(s);return r}function Un(e){let t=String(e??"").trim();return/^(https?:|mailto:|blob:|#)/i.test(t)||/^data:image\/(png|jpe?g|gif|webp|avif|svg\+xml);/i.test(t)?t:/^[a-z][\w+.-]*:/i.test(t)?null:t}function Ge(e,t){let n=We(e,t.kit),r=t.kit.layouts[n]??Be.layouts.default,s=String(e.settings.class??"").split(/\s+/).filter(k=>["invert","text-center","text-left"].includes(k)),i={step:0},l=new Map(e.slots.map(k=>[k.name,k])),a=r.slots,c=(r.art??[]).map(k=>t.kit.pictures?.[k]).filter(Boolean),p=w("section",{class:["deck-slide",`deck-layout-${n}`,...s.map(k=>`deck-class-${k}`),...c.length?["has-art"]:[]].join(" "),"data-index":e.index,"data-layout":n,"data-paper":r.paper,"data-align":r.align,"data-justify":r.justify,"data-title":r.title,"aria-roledescription":t.slide,role:"group"});for(let k of c)p.append(w("img",{class:"deck-art",src:k,alt:"","aria-hidden":"true"}));let o=w("div",{class:"deck-canvas"});o.style.setProperty("grid-template-areas",r.areas.map(k=>`"${k.map(y=>y==="."?".":`s-${y}`).join(" ")}"`).join(" ")),o.style.setProperty("grid-template-columns",r.columns.join(" ")),o.style.setProperty("grid-template-rows",r.rows.join(" ")),p.append(o);let d=e.settings.image??e.settings.background;if(typeof d=="string"&&["image-left","image-right","image","cover","quote"].includes(n)){let k=t.resolve(d);if(k){let y=w("div",{class:"deck-image",role:"img","aria-label":String(e.settings.alt??"")||void 0});y.style.setProperty("--deck-image",`url("${k.replace(/["\\\n]/g,encodeURIComponent)}")`),o.append(y),p.classList.add("has-image")}}for(let k of a){let y=l.get(k),x=w("div",{class:"deck-slot","data-slot":k},y?Vt(y,t,i,r.lists,r.parts):[]);x.style.setProperty("grid-area",`s-${k}`),o.append(x)}let h=r.contents&&Gt(t,e.index,Number(e.settings.maxDepth)||void 0);h&&o.querySelector(`.deck-slot[data-slot="${a[0]}"]`)?.append(h);for(let k of e.slots)a.includes(k.name)||o.append(w("div",{class:"deck-slot","data-slot":k.name},Vt(k,t,i)));r.numbered&&e.settings.paginate!==!1&&p.append(w("span",{class:"deck-number","aria-hidden":"true"},[t.number(e.index+1)]));let{logo:g,logoAt:u,dark:f}=t.kit.tokens,m=Se.includes(u)?u:Se[0];if(g&&r.logo!=="none")for(let[k,y]of[[g,f?.logo?"has-dark":""],[f?.logo,"is-dark"]])k&&p.append(w("img",{class:`deck-logo ${y}`.trim(),src:k,alt:"","aria-hidden":"true","data-size":r.logo,"data-at":m}));return{element:p,steps:i.step}}function Vt(e,t,n,r="bullets",s="none"){let i=t.lex(e.text),l=[],a=s==="none"?new Set:Wt(i,s==="versus"?2:4),c=[],p=l,o=-1,d=r==="mindmap"&&!a.size,h=r!=="bullets"&&r!=="mindmap"&&!a.size,g=[],u=-1,f=[],m=-1,k=null,y=e.start,x="";for(let[C,A]of i.entries()){let S=y;if(y+=A.raw.length,a.has(C)&&(o<0&&(o=l.length),c.push(p=[])),h&&(A.type==="list"||Bt(A))){u<0&&(u=l.length);let E=Ht(A,S,t.lex),q=x==="click"?++n.step:0;for(let I of E)I.step=q||(x==="clicks"?++n.step:0);g.push(...E);continue}if(d&&(A.type==="list"||A.type==="heading"&&l.length&&i.slice(C+1).find(E=>E.type!=="space")?.type==="list")){if(m<0&&(m=l.length),A.type==="heading"){k=de(A,S,t,null);continue}let E=qt(A.raw,S);for(let q of E)x==="clicks"&&(q.step=!0);f.push({items:k?[{text:k.textContent??"",start:S,end:S,children:E,element:k,step:x==="clicks"}]:E,step:x==="clicks"}),k=null;continue}let v=A.type==="paragraph"?A.raw.trim().split(`
|
|
26
|
+
`).map(E=>E.trim()):[];if(v.length&&v.every(E=>/^:{3,}/.test(E))){for(let E of v)/^:{3,}[ \t]*\{?[ \t]*\.?incremental\b/.test(E)?x="clicks":/^:{3,}\s*$/.test(E)&&x==="clicks"&&(x="");continue}if(A.type==="html"){let E=/^\s*<(\/?)(v-clicks?|br)\b[^>]*>\s*$/i.exec(A.raw);if(E&&E[2]==="br")p.push(w("br"));else if(E)x=E[1]?"":E[2].toLowerCase()==="v-clicks"?"clicks":"click";else if(/<li\b/i.test(A.raw)){let q=w(/<ol\b/i.test(A.raw)?"ol":"ul",{dir:"auto"});for(let[,I,Q]of A.raw.matchAll(/<li\b([^>]*)>([\s\S]*?)(?=<\/li>|<li\b|<\/[ou]l>|$)/gi)){let Y=Q.replace(/<!--[\s\S]*?-->/g,"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();if(!Y)continue;let ne=w("li",{dir:"auto"},[Y]);(/\bv-click\b/.test(I)||x==="clicks")&&pe(ne,++n.step),q.append(ne)}q.childElementCount&&p.push(q)}else{let q=A.raw.replace(/<!--[\s\S]*?-->/g,"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();q&&p.push(w("p",{},[q]))}continue}let N=de(A,S,t,x==="clicks"?n:null);N&&((x==="click"||x==="clicks"&&A.type!=="list")&&pe(N,++n.step),p.push(N))}return f.length&&Gn(l,f.flatMap(C=>C.items),t,n,m),g.length&&l.splice(u,0,Zt(r,g,t)),c.length&&l.splice(o,0,Ut(s,c)),l}function Gn(e,t,n,r,s){let i=rt(t),l=s>0&&e[0]instanceof HTMLElement&&e[0].matches("h1, h2, h3, h4, h5, h6, .deck-h")?e[0]:null,a;i.length===1&&(!l||Ze(l.textContent??"")===Ze(i[0].text))?a={...i[0],element:l??i[0].element}:i.length===1?a=i[0]:a={text:l?.textContent??"",start:0,end:0,children:i,element:l??void 0},l&&a.element===l&&(e.shift(),s--);let c=(u,f)=>{if(u.element)return u.element.classList.add("deck-map-node"),u.element.setAttribute("data-depth",String(f)),u.element;let[m]=u.text?n.lex(u.text):[],k=Z(m?.tokens??[{type:"text",text:u.text}],n);return u.blocks?.length?w("div",{class:"deck-map-node has-block","data-depth":f},[u.text?w("span",{class:"deck-map-words",dir:"auto","data-edit":ue(u.start,u.end)},k):null,...u.blocks.map(y=>de({type:"code",lang:y.lang,text:y.text,raw:y.text},u.start,n,null))]):w("span",{class:"deck-map-node","data-depth":f,dir:"auto","data-edit":ue(u.start,u.end)},k)},p=(u,f)=>w("li",{},[c(u,f),u.children.length?w("ul",{},u.children.map(m=>p(m,f+1))):null]),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("class","deck-map-lines"),o.setAttribute("aria-hidden","true"),o.setAttribute("preserveAspectRatio","none");let d=a.children.map((u,f)=>{let m=p(u,1),k=document.createElementNS("http://www.w3.org/2000/svg","g");for(let y of[m,k])y.setAttribute("data-branch",String(f%6+1));if(u.step){let y=++r.step;pe(m,y),pe(k,y)}return o.append(k),m}),h=w("li",{},[c(a,0),d.length?w("ul",{},d):null]),g=w("div",{class:"deck-mindmap"},[w("div",{class:"deck-map-plane"},[o,w("ul",{class:"deck-map-tree"},[h])])]);Dt(g),e.splice(s,0,g)}var pe=(e,t)=>{e.classList.add("deck-step"),e.setAttribute("data-step",String(t))};function de(e,t,n,r){switch(e.type){case"heading":{let s=/^\s*#{1,6}[ \t]+/.exec(e.raw),i=s?ue(t+s[0].length,t+e.raw.replace(/\s*#*\s*$/,"").length):void 0;return n.headings==="real"?w(`h${e.depth}`,{dir:"auto","data-edit":i},Z(e.tokens,n)):w("p",{class:`deck-h deck-h${e.depth}`,role:"heading","aria-level":Math.min(6,e.depth+2),dir:"auto","data-edit":i},Z(e.tokens,n))}case"paragraph":{let s=e.tokens.length===1&&e.tokens[0].type==="image";return w("p",{dir:"auto",class:s?"deck-picture":void 0,"data-edit":s?void 0:ue(t,t+e.raw.trimEnd().length)},Z(e.tokens,n))}case"text":return w("p",{dir:"auto"},Z(e.tokens??[{type:"text",text:e.text}],n));case"blockquote":return w("blockquote",{},Vn(e.tokens,t,e.raw,n));case"list":{let s=0,i=w(e.ordered?"ol":"ul",{start:e.ordered&&e.start!==1?e.start:void 0,class:e.items.some(l=>l.task)?"deck-tasks":void 0});for(let l of e.items){let a=e.raw.indexOf(l.raw,s);s=a+l.raw.length;let c=t+Math.max(0,a),p=/^\s*(?:[-*+]|\d+[.)])\s+(?:\[[ xX]\]\s+)?/.exec(l.raw),o=l.tokens.length===1&&l.tokens[0].type==="text"&&!/\n\s*\S/.test(l.raw.trim().split(`
|
|
21
27
|
`).slice(1).join(`
|
|
22
|
-
`)),
|
|
23
|
-
`).entries())
|
|
24
|
-
`]));return w("pre",{dir:"ltr",class:l.size?"has-marks":void 0,tabindex:0},[o])}case"table":{let r=i=>i??void 0;return w("div",{class:"deck-table"},[w("table",{},[w("thead",{},[w("tr",{},t.header.map((i,a)=>w("th",{"data-align":r(t.align[a]),dir:"auto"},G(i.tokens,n))))]),w("tbody",{},t.rows.map(i=>w("tr",{},i.map((a,l)=>w("td",{"data-align":r(t.align[l]),dir:"auto"},G(a.tokens,n))))))])])}default:return null}}function Sn(t,e,n,s){let r=0;return t.map(i=>{let a=n.indexOf(i.raw,r);return r=Math.max(r,a+i.raw.length),Je(i,e+Math.max(0,a),s,null)})}function $n(t){let e=new Set;for(let n of t.split(/[,|]/)){let[s,r]=n.split("-").map(i=>parseInt(i,10));if(Number.isFinite(s))for(let i=s;i<=(Number.isFinite(r)?r:s);i++)e.add(i)}return e}var Xe=(t,e)=>e>t?`${t}-${e}`:void 0;function G(t=[],e){return t.flatMap(n=>{switch(n.type){case"text":case"escape":return n.tokens?G(n.tokens,e):[n.text.replace(/&(amp|lt|gt|quot|#39);/g,(s,r)=>({amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"})[r])];case"strong":return[w("strong",{},G(n.tokens,e))];case"em":return[w("em",{},G(n.tokens,e))];case"del":return[w("del",{},G(n.tokens,e))];case"codespan":return[w("code",{},[n.text.replace(/&(amp|lt|gt|quot|#39);/g,(s,r)=>({amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"})[r])])];case"br":return[w("br")];case"link":{let s=wn(n.href);return s?[w("a",{href:s,rel:"noopener noreferrer",target:s.startsWith("#")?void 0:"_blank"},G(n.tokens,e))]:G(n.tokens,e)}case"image":{let s=e.resolve(n.href);return s?[w("img",{src:s,alt:n.text,loading:"lazy"})]:[n.text]}case"html":return/^<br\s*\/?>$/i.test(n.raw)?[w("br")]:[];default:return n.text?[n.text]:[]}})}var Ye={default:{paper:"#fffdf8",ink:"#1d1b16",primary:"#f7c531",voice:"calm",radius:10},ocean:{paper:"#f6fafb",ink:"#0d2530",primary:"#0f766e",voice:"calm",radius:6},ember:{paper:"#fff8f3",ink:"#2a160c",primary:"#d9480f",voice:"bold",radius:2},ink:{paper:"#ffffff",ink:"#111111",primary:"#3b5bdb",voice:"elegant",radius:0}},tt={calm:{heading:'ui-sans-serif, system-ui, "Segoe UI", Roboto, "Noto Sans", sans-serif',body:'ui-sans-serif, system-ui, "Segoe UI", Roboto, "Noto Sans", sans-serif'},elegant:{heading:'ui-serif, "Iowan Old Style", Georgia, "Noto Serif", serif',body:'ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif'},bold:{heading:'"Avenir Next Condensed", "Arial Narrow", ui-sans-serif, system-ui, sans-serif',body:'ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif'},friendly:{heading:'ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif',body:'ui-rounded, "SF Pro Rounded", system-ui, sans-serif'}};function nt(t,e={}){let n=Ye[String(t.theme??"")]??Ye.default,s=typeof t.themeConfig=="object"&&t.themeConfig?t.themeConfig:{},r={...n,...Ot(e),...Ot(s)};return tt[r.voice]||(r.voice="calm"),r}function Ot(t){let e={};for(let n of["paper","ink","primary","muted","soft"])typeof t[n]=="string"&&H(t[n])&&(e[n]=t[n]);return t.dark&&typeof t.dark=="object"&&(e.dark=Object.fromEntries(Object.entries(t.dark).filter(([,n])=>typeof n=="string"&&H(n)))),t.fonts&&Array.isArray(t.fonts.heading)&&Array.isArray(t.fonts.body)&&(e.fonts={heading:t.fonts.heading.map(String),body:t.fonts.body.map(String)}),typeof t.voice=="string"&&(e.voice=t.voice),typeof t.radius=="number"&&(e.radius=t.radius),Array.isArray(t.series)&&t.series.length&&t.series.every(n=>typeof n=="string"&&H(n))&&(e.series=t.series.slice(0,6)),e}function rt(t,e){let n=H(t.paper)??[255,253,248],s=H(t.ink,n)??[29,27,22],r=e==="dark"?t.dark??{}:{},i=me(H(r.paper??"",e==="dark"?[0,0,0]:[255,255,255])??(e==="dark"?ce(s,[0,0,0],.35):n)),a=me(H(r.ink??"",i)??(e==="dark"?ce(n,[255,255,255],.2):s)),l=H(r.primary??t.primary,i)??[247,197,49],o=Ne(l,i,4.5),u=pe(a,l)>=pe(i,l)?a:i,p=(t.series??[]).map(d=>H(d,i)).filter(d=>d!==null),c=[0,1,2,3,4,5].map(d=>Ne(p[d%(p.length||1)]??An(l,d*57),i,3));return{paper:le(i),ink:le(a),muted:le(Ne(me(H(r.muted??(e==="light"?t.muted??"":""),i)??ce(a,i,.38)),i,4.5)),line:le(ce(a,i,.82)),primary:le(o),onPrimary:le(u),soft:le(H(r.soft??(e==="light"?t.soft??"":""),i)??ce(l,i,.78)),series:c.map(le)}}function H(t,e=[255,255,255]){let n=String(t).trim(),s=/^#?([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.exec(n)?.[1],r=/^rgba?\(([^)]*)\)$/i.exec(n)?.[1].split(/[\s,/]+/).filter(Boolean),i=(p,c)=>p.endsWith("%")?parseFloat(p)/100*c:Number(p),[a,l,o,u=1]=s?(s.length<5?[...s].map(p=>p+p):s.match(/../g)).map((p,c)=>parseInt(p,16)/(c>2?255:1)):r?.length===3||r?.length===4?r.map((p,c)=>i(p,c>2?1:255)):[];return a!==void 0&&[a,l,o].every(p=>p>=0&&p<=255)&&u>=0&&u<=1?me(ce(e,[a,l,o],u)):null}var le=t=>`#${t.map(e=>Math.round(Math.max(0,Math.min(255,e))).toString(16).padStart(2,"0")).join("")}`,me=t=>t.map(e=>Math.round(Math.max(0,Math.min(255,e)))),ce=(t,e,n)=>t.map((s,r)=>s+(e[r]-s)*n);function et(t){let[e,n,s]=t.map(r=>{let i=r/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4});return .2126*e+.7152*n+.0722*s}function pe(t,e){let[n,s]=[et(t),et(e)].sort((r,i)=>i-r);return(n+.05)/(s+.05)}function Ne(t,e,n){let s=et(e)>.18?[0,0,0]:[255,255,255],r=0,i=me(t);for(;pe(i,e)<n&&r<1;)i=me(ce(t,s,r=Math.min(1,r+.02)));return i}function An(t,e){let[n,s,r]=t.map(b=>b/255),i=Math.max(n,s,r),a=Math.min(n,s,r),l=(i+a)/2,o=i-a,u=o===0?0:o/(1-Math.abs(2*l-1)),p=o===0?0:i===n?(s-r)/o%6:i===s?(r-n)/o+2:(n-s)/o+4;p=(p*60+e+360)%360;let c=(1-Math.abs(2*l-1))*Math.max(u,.55),d=c*(1-Math.abs(p/60%2-1)),h=l-c/2,[m,f,k]=p<60?[c,d,0]:p<120?[d,c,0]:p<180?[0,c,d]:p<240?[0,d,c]:p<300?[d,0,c]:[c,0,d];return[m+h,f+h,k+h].map(b=>b*255)}var Mt={en:{deck:"Slides",slide:"slide",carousel:"carousel",previous:"Previous",next:"Next",present:"Present full screen",presenter:"Presenter view",overview:"All slides",edit:"Change",scheme:"Light or dark",export:"Save as PowerPoint",source:"The deck as text",notes:"Notes",noNotes:"No notes for this slide.",upNext:"Next",last:"Last slide",where:"Slide {n} of {count}",saved:"Saved"},fr:{deck:"Diapositives",slide:"diapositive",carousel:"carrousel",previous:"Précédente",next:"Suivante",present:"Présenter en plein écran",presenter:"Vue présentateur",overview:"Toutes les diapositives",edit:"Modifier",scheme:"Clair ou sombre",export:"Enregistrer en PowerPoint",source:"La présentation en texte",notes:"Notes",noNotes:"Pas de notes pour cette diapositive.",upNext:"Ensuite",last:"Dernière diapositive",where:"Diapositive {n} sur {count}",saved:"Enregistré"},ar:{deck:"الشرائح",slide:"شريحة",carousel:"عرض شرائح",previous:"السابقة",next:"التالية",present:"العرض بملء الشاشة",presenter:"عرض المقدّم",overview:"كل الشرائح",edit:"تعديل",scheme:"فاتح أو داكن",export:"الحفظ بصيغة PowerPoint",source:"العرض كنص",notes:"الملاحظات",noNotes:"لا ملاحظات لهذه الشريحة.",upNext:"التالية",last:"الشريحة الأخيرة",where:"الشريحة {n} من {count}",saved:"تم الحفظ"},ja:{deck:"スライド",slide:"スライド",carousel:"カルーセル",previous:"前へ",next:"次へ",present:"全画面で発表",presenter:"発表者ビュー",overview:"すべてのスライド",edit:"編集",scheme:"ライトまたはダーク",export:"PowerPoint で保存",source:"テキストとしてのスライド",notes:"メモ",noNotes:"このスライドにメモはありません。",upNext:"次",last:"最後のスライド",where:"スライド {n} / {count}",saved:"保存しました"}},_t=t=>Mt[t.split("-")[0].toLowerCase()]??Mt.en;function ot(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var fe=ot();function Ut(t){fe=t}var de={exec:()=>null};function ke(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),r=e[s];return r||(r=t(s),e[s]=r),r}}function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(N.caret,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,e)};return s}var Cn=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),N={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ke(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ke(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:ke(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:ke(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:ke(t=>new RegExp(`^ {0,${t}}(?:</?(?:${$e})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:ke(t=>new RegExp(`^ {0,${t}}>`))},Rn=/^(?:[ \t]*(?:\n|$))+/,Tn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,vn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Se=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,En=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ct=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Gt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Qt=S(Gt).replace(/bull/g,ct).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Pn=S(Gt).replace(/bull/g,ct).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),pt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,zn=/^[^\n]+/,ut=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ln=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ut).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),On=S(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ct).getRegex(),$e="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",dt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Mn=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",dt).replace("tag",$e).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vt=t=>S(pt).replace("hr",Se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",$e).getRegex(),_n=Vt(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),jn=Vt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Nn=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",jn).getRegex(),ht={blockquote:Nn,code:Tn,def:Ln,fences:vn,heading:En,hr:Se,html:Mn,lheading:Qt,list:On,newline:Rn,paragraph:_n,table:de,text:zn},jt=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",$e).getRegex(),In={...ht,lheading:Pn,table:jt,paragraph:S(pt).replace("hr",Se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",jt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",$e).getRegex()},Dn={...ht,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",dt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:de,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(pt).replace("hr",Se).replace("heading",` *#{1,6} *[^
|
|
25
|
-
]`).replace("lheading",
|
|
26
|
-
`),n=
|
|
27
|
-
`)}function
|
|
28
|
-
`).map(i=>{let
|
|
29
|
-
`)}function
|
|
30
|
-
`),depth:
|
|
31
|
-
`)}}blockquote(
|
|
28
|
+
`)),d=w("li",{dir:"auto","data-edit":o&&p?ue(c+p[0].length,c+l.raw.trimEnd().length):void 0},[l.task?w("input",{type:"checkbox",checked:l.checked,disabled:!0,"aria-label":l.text}):null,...l.tokens.flatMap(h=>h.type==="text"?Z(h.tokens??[{type:"text",text:h.text}],n):[de(h,c+Math.max(0,l.raw.indexOf(h.raw)),n,null)])]);r&&pe(d,++r.step),i.append(d)}return i}case"code":{let s=/^(\S*)\s*(?:\{([^}]*)\})?/.exec(e.lang??"")??[],i=(s[1]??"").toLowerCase(),l=n.blocks[i];if(l){let p=w("div",{class:`deck-block deck-${i}`,"data-source":e.text});return p.append(w("pre",{class:"deck-block-source",dir:"ltr"},[w("code",{},[e.text])])),queueMicrotask(()=>Promise.resolve(l(p,e.text,Qn(e.lang??""))).catch(()=>p.classList.add("is-failed"))),p}let a=Xn(s[2]??""),c=w("code",{class:i?`language-${i}`:void 0});for(let[p,o]of e.text.split(`
|
|
29
|
+
`).entries())c.append(w("span",{class:a.has(p+1)?"deck-line is-marked":"deck-line"},[o,`
|
|
30
|
+
`]));return w("pre",{dir:"ltr",class:a.size?"has-marks":void 0,tabindex:0},[c])}case"table":{let s=i=>i??void 0;return w("div",{class:"deck-table"},[w("table",{},[w("thead",{},[w("tr",{},e.header.map((i,l)=>w("th",{"data-align":s(e.align[l]),dir:"auto"},Z(i.tokens,n))))]),w("tbody",{},e.rows.map(i=>w("tr",{},i.map((l,a)=>w("td",{"data-align":s(e.align[a]),dir:"auto"},Z(l.tokens,n))))))])])}default:return null}}function Vn(e,t,n,r){let s=0;return e.map(i=>{let l=n.indexOf(i.raw,s);return s=Math.max(s,l+i.raw.length),de(i,t+Math.max(0,l),r,null)})}function Qn(e){let t=/\{[\s\S]*\}/.exec(e)?.[0];if(!t)return{};let n=ve(`options: ${t.replace(/\n/g," ")}`).options;return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function Xn(e){let t=new Set;for(let n of e.split(/[,|]/)){let[r,s]=n.split("-").map(i=>parseInt(i,10));if(Number.isFinite(r))for(let i=r;i<=(Number.isFinite(s)?s:r);i++)t.add(i)}return t}var ue=(e,t)=>t>e?`${e}-${t}`:void 0;function Z(e=[],t){return e.flatMap(n=>{switch(n.type){case"text":case"escape":return n.tokens?Z(n.tokens,t):[n.text.replace(/&(amp|lt|gt|quot|#39);/g,(r,s)=>({amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"})[s])];case"strong":return[w("strong",{},Z(n.tokens,t))];case"em":return[w("em",{},Z(n.tokens,t))];case"del":return[w("del",{},Z(n.tokens,t))];case"codespan":return[w("code",{},[n.text.replace(/&(amp|lt|gt|quot|#39);/g,(r,s)=>({amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"})[s])])];case"br":return[w("br")];case"link":{let r=Un(n.href);return r?[w("a",{href:r,rel:"noopener noreferrer",target:r.startsWith("#")?void 0:"_blank"},Z(n.tokens,t))]:Z(n.tokens,t)}case"image":{let r=t.resolve(n.href);return r?[w("img",{src:r,alt:n.text,loading:"lazy"})]:[n.text]}case"html":return/^<br\s*\/?>$/i.test(n.raw)?[w("br")]:[];default:return n.text?[n.text]:[]}})}var it={default:{paper:"#fffdf8",ink:"#1d1b16",primary:"#f7c531",voice:"calm",radius:10},ocean:{paper:"#f6fafb",ink:"#0d2530",primary:"#0f766e",voice:"calm",radius:6},ember:{paper:"#fff8f3",ink:"#2a160c",primary:"#d9480f",voice:"bold",radius:2},ink:{paper:"#ffffff",ink:"#111111",primary:"#3b5bdb",voice:"elegant",radius:0}},lt={calm:{heading:'ui-sans-serif, system-ui, "Segoe UI", Roboto, "Noto Sans", sans-serif',body:'ui-sans-serif, system-ui, "Segoe UI", Roboto, "Noto Sans", sans-serif'},elegant:{heading:'ui-serif, "Iowan Old Style", Georgia, "Noto Serif", serif',body:'ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif'},bold:{heading:'"Avenir Next Condensed", "Arial Narrow", ui-sans-serif, system-ui, sans-serif',body:'ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif'},friendly:{heading:'ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif',body:'ui-rounded, "SF Pro Rounded", system-ui, sans-serif'}};function ot(e,t={}){let n=it[String(e.theme??"")]??it.default,r=typeof e.themeConfig=="object"&&e.themeConfig?e.themeConfig:{},s={...n,...Qt(t),...Qt(r)};return lt[s.voice]||(s.voice="calm"),s}function Qt(e){let t={};for(let n of["paper","ink","primary","muted","soft"])typeof e[n]=="string"&&K(e[n])&&(t[n]=e[n]);return e.dark&&typeof e.dark=="object"&&(t.dark=Object.fromEntries(Object.entries(e.dark).filter(([,n])=>typeof n=="string"&&K(n)))),e.fonts&&Array.isArray(e.fonts.heading)&&Array.isArray(e.fonts.body)&&(t.fonts={heading:e.fonts.heading.map(String),body:e.fonts.body.map(String)}),typeof e.voice=="string"&&(t.voice=e.voice),typeof e.radius=="number"&&(t.radius=e.radius),Array.isArray(e.series)&&e.series.length&&e.series.every(n=>typeof n=="string"&&K(n))&&(t.series=e.series.slice(0,6)),t}function ct(e,t){let n=K(e.paper)??[255,253,248],r=K(e.ink,n)??[29,27,22],s=t==="dark"?e.dark??{}:{},i=$e(K(s.paper??"",t==="dark"?[0,0,0]:[255,255,255])??(t==="dark"?he(r,[0,0,0],.35):n)),l=$e(K(s.ink??"",i)??(t==="dark"?he(n,[255,255,255],.2):r)),a=K(s.primary??e.primary,i)??[247,197,49],c=Ve(a,i,4.5),p=fe(l,a)>=fe(i,a)?l:i,o=(e.series??[]).map(h=>K(h,i)).filter(h=>h!==null),d=[0,1,2,3,4,5].map(h=>Ve(o[h%(o.length||1)]??Kn(a,h*57),i,3));return{paper:oe(i),ink:oe(l),muted:oe(Ve($e(K(s.muted??(t==="light"?e.muted??"":""),i)??he(l,i,.38)),i,4.5)),line:oe(he(l,i,.82)),primary:oe(c),onPrimary:oe(p),soft:oe(K(s.soft??(t==="light"?e.soft??"":""),i)??he(a,i,.78)),series:d.map(oe)}}function K(e,t=[255,255,255]){let n=String(e).trim(),r=/^#?([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.exec(n)?.[1],s=/^rgba?\(([^)]*)\)$/i.exec(n)?.[1].split(/[\s,/]+/).filter(Boolean),i=(o,d)=>o.endsWith("%")?parseFloat(o)/100*d:Number(o),[l,a,c,p=1]=r?(r.length<5?[...r].map(o=>o+o):r.match(/../g)).map((o,d)=>parseInt(o,16)/(d>2?255:1)):s?.length===3||s?.length===4?s.map((o,d)=>i(o,d>2?1:255)):[];return l!==void 0&&[l,a,c].every(o=>o>=0&&o<=255)&&p>=0&&p<=1?$e(he(t,[l,a,c],p)):null}var oe=e=>`#${e.map(t=>Math.round(Math.max(0,Math.min(255,t))).toString(16).padStart(2,"0")).join("")}`,$e=e=>e.map(t=>Math.round(Math.max(0,Math.min(255,t)))),he=(e,t,n)=>e.map((r,s)=>r+(t[s]-r)*n);function at(e){let[t,n,r]=e.map(s=>{let i=s/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r}function fe(e,t){let[n,r]=[at(e),at(t)].sort((s,i)=>i-s);return(n+.05)/(r+.05)}function Ve(e,t,n){let r=at(t)>.18?[0,0,0]:[255,255,255],s=0,i=$e(e);for(;fe(i,t)<n&&s<1;)i=$e(he(e,r,s=Math.min(1,s+.02)));return i}function Kn(e,t){let[n,r,s]=e.map(k=>k/255),i=Math.max(n,r,s),l=Math.min(n,r,s),a=(i+l)/2,c=i-l,p=c===0?0:c/(1-Math.abs(2*a-1)),o=c===0?0:i===n?(r-s)/c%6:i===r?(s-n)/c+2:(n-r)/c+4;o=(o*60+t+360)%360;let d=(1-Math.abs(2*a-1))*Math.max(p,.55),h=d*(1-Math.abs(o/60%2-1)),g=a-d/2,[u,f,m]=o<60?[d,h,0]:o<120?[h,d,0]:o<180?[0,d,h]:o<240?[0,h,d]:o<300?[h,0,d]:[d,0,h];return[u+g,f+g,m+g].map(k=>k*255)}var Xt={en:{deck:"Slides",slide:"slide",carousel:"carousel",previous:"Previous",next:"Next",present:"Present full screen",presenter:"Presenter view",overview:"All slides",edit:"Change",scheme:"Light or dark",export:"Save as PowerPoint",source:"The deck as text",notes:"Notes",noNotes:"No notes for this slide.",upNext:"Next",last:"Last slide",where:"Slide {n} of {count}",saved:"Saved"},fr:{deck:"Diapositives",slide:"diapositive",carousel:"carrousel",previous:"Précédente",next:"Suivante",present:"Présenter en plein écran",presenter:"Vue présentateur",overview:"Toutes les diapositives",edit:"Modifier",scheme:"Clair ou sombre",export:"Enregistrer en PowerPoint",source:"La présentation en texte",notes:"Notes",noNotes:"Pas de notes pour cette diapositive.",upNext:"Ensuite",last:"Dernière diapositive",where:"Diapositive {n} sur {count}",saved:"Enregistré"},ar:{deck:"الشرائح",slide:"شريحة",carousel:"عرض شرائح",previous:"السابقة",next:"التالية",present:"العرض بملء الشاشة",presenter:"عرض المقدّم",overview:"كل الشرائح",edit:"تعديل",scheme:"فاتح أو داكن",export:"الحفظ بصيغة PowerPoint",source:"العرض كنص",notes:"الملاحظات",noNotes:"لا ملاحظات لهذه الشريحة.",upNext:"التالية",last:"الشريحة الأخيرة",where:"الشريحة {n} من {count}",saved:"تم الحفظ"},ja:{deck:"スライド",slide:"スライド",carousel:"カルーセル",previous:"前へ",next:"次へ",present:"全画面で発表",presenter:"発表者ビュー",overview:"すべてのスライド",edit:"編集",scheme:"ライトまたはダーク",export:"PowerPoint で保存",source:"テキストとしてのスライド",notes:"メモ",noNotes:"このスライドにメモはありません。",upNext:"次",last:"最後のスライド",where:"スライド {n} / {count}",saved:"保存しました"}},Kt=e=>Xt[e.split("-")[0].toLowerCase()]??Xt.en;function ft(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var xe=ft();function cn(e){xe=e}var me={exec:()=>null};function Ae(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),s=t[r];return s||(s=e(r),t[r]=s),s}}function T(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(s,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(U.caret,"$1"),n=n.replace(s,l),r},getRegex:()=>new RegExp(n,t)};return r}var Yn=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),U={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Ae(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ae(e=>new RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Ae(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ae(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Ae(e=>new RegExp(`^ {0,${e}}(?:</?(?:${Pe})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:Ae(e=>new RegExp(`^ {0,${e}}>`))},Jn=/^(?:[ \t]*(?:\n|$))+/,es=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ts=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Me=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ns=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,gt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,dn=T(pn).replace(/bull/g,gt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ss=T(pn).replace(/bull/g,gt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),mt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,rs=/^[^\n]+/,kt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,is=T(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),as=T(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,gt).getRegex(),Pe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",xt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ls=T("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",xt).replace("tag",Pe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),un=e=>T(mt).replace("hr",Me).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Pe).getRegex(),os=un(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),cs=un(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),ps=T(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cs).getRegex(),bt={blockquote:ps,code:es,def:is,fences:ts,heading:ns,hr:Me,html:ls,lheading:dn,list:as,newline:Jn,paragraph:os,table:me,text:rs},Yt=T("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Me).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Pe).getRegex(),ds={...bt,lheading:ss,table:Yt,paragraph:T(mt).replace("hr",Me).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Pe).getRegex()},us={...bt,html:T(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:me,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:T(mt).replace("hr",Me).replace("heading",` *#{1,6} *[^
|
|
31
|
+
]`).replace("lheading",dn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},hs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fs=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,hn=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,gs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,re=/[\p{P}\p{S}]/u,Ce=/[\s\p{P}\p{S}]/u,Oe=/[^\s\p{P}\p{S}]/u,ms=T(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ce).getRegex(),ks=/[\p{Pi}\p{Ps}"']/u,fn=/(?!~)[\p{P}\p{S}]/u,xs=/(?!~)[\s\p{P}\p{S}]/u,bs=/(?:[^\s\p{P}\p{S}]|~)/u,ys=T(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Yn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),gn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ws=T(gn,"u").replace(/punct/g,re).getRegex(),Ss=T(gn,"u").replace(/punct/g,fn).getRegex(),$s=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,As=T($s,"u").replace(/openQuote/g,ks).replace(/punct/g,re).getRegex(),mn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Cs=T(mn,"gu").replace(/notPunctSpace/g,Oe).replace(/punctSpace/g,Ce).replace(/punct/g,re).getRegex(),vs=T(mn,"gu").replace(/notPunctSpace/g,bs).replace(/punctSpace/g,xs).replace(/punct/g,fn).getRegex(),Ts="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Rs=T(Ts,"gu").replace(/notPunctSpace/g,Oe).replace(/punctSpace/g,Ce).replace(/punct/g,re).getRegex(),Es=T("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Oe).replace(/punctSpace/g,Ce).replace(/punct/g,re).getRegex(),Ms="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Ps=T(Ms,"gu").replace(/notPunctSpace/g,Oe).replace(/punctSpace/g,Ce).replace(/punct/g,re).getRegex(),Os=T(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,re).getRegex(),Ls="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",zs=T(Ls,"gu").replace(/notPunctSpace/g,Oe).replace(/punctSpace/g,Ce).replace(/punct/g,re).getRegex(),Ns=T(/\\(punct)/,"gu").replace(/punct/g,re).getRegex(),_s=T(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,re).getRegex(),js=T(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Is=T(xt).replace("(?:-->|$)","-->").getRegex(),qs=T("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Is).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),kn=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Xe=T(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",kn).getRegex(),Ds=T(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Xe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Fs=T(/^!?\[(label)\]\[(ref)\]/).replace("label",Xe).replace("ref",kt).getRegex(),Bs=T(/^!?\[(ref)\](?:\[\])?/).replace("ref",kt).getRegex(),Jt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Hs=T(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",kn).getRegex(),Ws=T("reflink|nolink(?!\\()","g").replace("reflink",T(/^!?\[(label)\]\[(ref)\]/).replace("label",Hs).replace("ref",Jt).getRegex()).replace("nolink",T(/^!?\[(ref)\](?:\[\])?/).replace("ref",Jt).getRegex()).getRegex(),en=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Zs=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Us=T(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Zs).getRegex(),yt={_backpedal:me,anyPunctuation:Ns,anyPunctuationOutsideCode:_s,autolink:js,blockSkip:ys,br:hn,code:fs,del:me,delLDelim:me,delRDelim:me,emStrongLDelim:ws,emStrongRDelimAst:Cs,emStrongRDelimUnd:Es,escape:hs,link:Ds,nolink:Bs,punctuation:ms,reflink:Fs,reflinkSearch:Ws,tag:qs,text:gs,url:me},Gs={...yt,emStrongLDelim:As,emStrongRDelimAst:Rs,emStrongRDelimUnd:Ps,link:T(/^!?\[(label)\]\((.*?)\)/).replace("label",Xe).getRegex(),reflink:T(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xe).getRegex()},dt={...yt,emStrongRDelimAst:vs,emStrongLDelim:Ss,delLDelim:Os,delRDelim:zs,url:T(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Us).replace("protocol",en).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:T(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",en).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Vs={...dt,br:T(hn).replace("{2,}","*").getRegex(),text:T(dt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Qe={normal:bt,gfm:ds,pedantic:us},Re={normal:yt,gfm:dt,breaks:Vs,pedantic:Gs},Qs={"&":"&","<":"<",">":">",'"':""","'":"'"},tn=e=>Qs[e];function J(e,t){if(t){if(U.escapeTest.test(e))return e.replace(U.escapeReplace,tn)}else if(U.escapeTestNoEncode.test(e))return e.replace(U.escapeReplaceNoEncode,tn);return e}function Xs(e){return U.numericCharacterReference.test(e)?e.replace(U.numericCharacterReferenceOrAmpersand,(t,n,r)=>{if(n===void 0&&r===void 0)return"&";let s=n===void 0?Number.parseInt(r,16):Number.parseInt(n,10);return s===0||s>1114111||s>=55296&&s<=57343?"�":s===38?"&":String.fromCodePoint(s)}):e}function nn(e){try{e=encodeURI(e).replace(U.percentDecode,"%")}catch{return null}return e}function sn(e,t){let n=e.replace(U.findPipe,(i,l,a)=>{let c=!1,p=l;for(;--p>=0&&a[p]==="\\";)c=!c;return c?"|":" |"}),r=n.split(U.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(U.slashPipe,"|");return r}function ce(e,t,n){let r=e.length;if(r===0)return"";let s=0;for(;s<r;){let i=e.charAt(r-s-1);if(i===t&&!n)s++;else if(i!==t&&n)s++;else break}return e.slice(0,r-s)}function rn(e){let t=e.split(`
|
|
32
|
+
`),n=t.length-1;for(;n>=0&&U.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
33
|
+
`)}function Ke(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function an(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function pt(e,t=0){let n=t,r="";for(let s of e)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function ln(e,t,n,r,s){let i=t.href,l=t.title||null,a=e[1].replace(s.other.outputLinkReplace,"$1"),c=e[0].charAt(0)==="!",p=r.state.inLink,o=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let h=r.inlineTokens(a),g=r.state.linkEmitted;if(r.state.linkEmitted=o,r.state.inLink=p,!c){if(g){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?"image":"link",raw:n,href:i,title:l,text:a,tokens:h}}function Ks(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
|
|
34
|
+
`).map(i=>{let l=i.match(n.other.beginningSpace);if(l===null)return i;let[a]=l;return i.slice(Math.min(a.length,s.length))}).join(`
|
|
35
|
+
`)}function on(e,t,n,r){if(!t.includes("<"))return!1;for(let s=0;s<t.length;s++){if(t[s]==="\\"){s++;continue}if(t[s]==="`"){let a=r.inline.code.exec(t.slice(s));if(a){s+=a[0].length-1;continue}}if(t[s]!=="<")continue;let i=e.slice(n+s),l=r.inline.tag.exec(i)||r.inline.autolink.exec(i);if(l){if(l[0].length>t.length-s)return!0;s+=l[0].length-1}}return!1}var Ye=class{options;rules;lexer;constructor(e){this.options=e||xe}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=this.options.pedantic?t[0]:rn(t[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Ks(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=ce(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceTabChar.test(r))&&(n=r.trim())}return{type:"heading",raw:ce(t[0],`
|
|
36
|
+
`),depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ce(t[0],`
|
|
37
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=ce(t[0],`
|
|
32
38
|
`).split(`
|
|
33
|
-
`),
|
|
34
|
-
`),p
|
|
35
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");
|
|
36
|
-
${
|
|
37
|
-
${
|
|
38
|
-
`),f=
|
|
39
|
-
`+
|
|
40
|
-
`).length:0,
|
|
41
|
-
${
|
|
42
|
-
`)}`),
|
|
39
|
+
`),r="",s="",i=[];for(;n.length>0;){let l=!1,a=[],c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))a.push(n[c]),l=!0;else if(!l)a.push(n[c]);else break;n=n.slice(c);let p=a.join(`
|
|
40
|
+
`),o=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
41
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
42
|
+
${p}`:p,s=s?`${s}
|
|
43
|
+
${o}`:o;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,i,!0),this.lexer.state.top=d,n.length===0)break;let h=i.at(-1);if(h?.type==="code"||h?.type==="heading"||h?.type==="hr"||h?.type==="html")break;if(h?.type==="blockquote"){let g=h,u=n.join(`
|
|
44
|
+
`),f=g.raw+`
|
|
45
|
+
`+u.replace(this.rules.other.blockquoteSetextReplace2,""),m=this.blockquote(f);i[i.length-1]=m;let k=f.substring(m.raw.length).replace(/^\n/,""),y=k?k.split(`
|
|
46
|
+
`).length:0,x=y?n.slice(0,-y):n;x.length>0&&(r=`${r}
|
|
47
|
+
${x.join(`
|
|
48
|
+
`)}`),s=s.substring(0,s.length-g.text.length)+m.text;break}else if(h?.type==="list"){let g=h,u=g.raw+`
|
|
43
49
|
`+n.join(`
|
|
44
|
-
`),f=this.list(
|
|
45
|
-
`);continue}}return{type:"blockquote",raw:
|
|
46
|
-
`,1)[0],
|
|
47
|
-
`,1)[0],
|
|
48
|
-
`,1)[0],
|
|
49
|
-
`+
|
|
50
|
-
`+k
|
|
51
|
-
`),href:
|
|
52
|
-
`):[],i={type:"table",raw:
|
|
53
|
-
`),header:[],align:[],rows:[]};if(n.length===
|
|
54
|
-
`),depth:
|
|
55
|
-
`?
|
|
56
|
-
`),this.blockTokens(
|
|
57
|
-
`:n.push(i);continue}if(i=this.tokenizer.code(
|
|
50
|
+
`),f=this.list(u);i[i.length-1]=f,r=r.substring(0,r.length-h.raw.length)+f.raw,s=s.substring(0,s.length-g.raw.length)+f.raw,n=u.substring(i.at(-1).raw.length).split(`
|
|
51
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,s=t[1].trim(),i=s.length>1,l={type:"list",raw:"",ordered:i,start:i?+s.slice(0,-1):"",loose:!1,items:[]};s=i?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=i?s:"[*+-]");let a=this.rules.other.listItemRegex(s),c=!1;for(;e;){let o=!1,d="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;let h=r();e=e.substring(t[0].length);let g=t[2].split(`
|
|
52
|
+
`,1)[0],u=t[1].length,f=this.options.pedantic?pt(g,u):g.replace(this.rules.other.leadingSpaceTab,C=>pt(C,u)),m=e.split(`
|
|
53
|
+
`,1)[0],k=!f.trim(),y=0;if(this.options.pedantic?(y=2,d=f.trimStart()):k?y=u+1:(y=f.search(this.rules.other.nonSpaceChar),y=y>4?1:y,d=f.slice(y),y+=u),k&&this.rules.other.blankLine.test(m)&&(e=e.substring(m.length+1),o=!0),!o){let C=this.rules.other.nextBulletRegex(y),A=this.rules.other.hrRegex(y),S=this.rules.other.fencesBeginRegex(y),v=this.rules.other.headingBeginRegex(y),N=this.rules.other.htmlBeginRegex(y),E=this.rules.other.blockquoteBeginRegex(y);for(;e;){let q=e.split(`
|
|
54
|
+
`,1)[0],I;if(m=q,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),I=m):I=m.replace(this.rules.other.leadingSpaceTab,Q=>pt(Q)),S.test(m)||v.test(m)||N.test(m)||E.test(m)||C.test(m)||A.test(m))break;if(I.search(this.rules.other.nonSpaceChar)>=y||!m.trim())d+=`
|
|
55
|
+
`+I.slice(y);else{if(k||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(f)||v.test(f)||A.test(f))break;d+=`
|
|
56
|
+
`+m}k=!m.trim(),e=e.substring(q.length+1),f=I.slice(y)}}let x=n.slice(h,r());l.loose||(c?l.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(c=!0)),l.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]})}let p=l.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;l.raw=n.slice(0,r()).trimEnd();for(let o of l.items)if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),!l.loose){let d=o.tokens.filter(g=>g.type==="space"),h=d.length>0&&d.some(g=>this.rules.other.anyLine.test(g.raw));l.loose=h}for(let o of l.items){let d=o.tokens[0];if(o.task&&(d?.type==="text"||d?.type==="paragraph")){o.text=o.text.replace(this.rules.other.listReplaceTask,""),d.raw=d.raw.replace(this.rules.other.listReplaceTask,""),d.text=d.text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(o.raw);if(h){let g={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};o.checked=g.checked,l.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=g.raw+o.tokens[0].raw,o.tokens[0].text=g.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(g)):o.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):o.tokens.unshift(g)}}else o.task&&(o.task=!1)}if(l.loose)for(let o of l.items){o.loose=!0;for(let d of o.tokens)d.type==="text"&&(d.type="paragraph")}return l}}html(e){let t=this.rules.block.html.exec(e);if(t){let n=rn(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&an(t[2],"()")!==-1)return;let n=Ke(t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:ce(t[0],`
|
|
57
|
+
`),href:r,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=sn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
58
|
+
`):[],i={type:"table",raw:ce(t[0],`
|
|
59
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<n.length;l++)i.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:i.align[l]});for(let l of s)i.rows.push(sn(l,i.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:ce(t[0],`
|
|
60
|
+
`),depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
61
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&on(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let l=ce(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{let l=an(t[2],"()");if(l===-2)return;if(l>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let s=t[2],i="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(s);l&&(s=l[1],i=l[3])}else i=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),ln(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&on(e,n[1],r,this.rules))return;let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[Ke(s)];if(!i){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return ln(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,l,a=s,c=0,p=r[0][0],o=n===p,d=p==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+s);(r=d.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(l=[...i].length,r[3]||r[4]){a+=l;continue}else if(r[5]||r[6]){if(s%3&&!((s+l)%3)){c+=l;continue}if(o)break}if(a-=l,a>0)continue;l=Math.min(l,l+a+c);let h=[...r[0]][0].length,g=e.slice(0,s+r.index+h+l);if(Math.min(s,l)%2){let f=g.slice(1,-1);return{type:"em",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}let u=g.slice(2,-2);return{type:"strong",raw:g,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,l,a=s,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(l=[...i].length,l!==s))continue;if(r[3]||r[4]){a+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a);let p=[...r[0]][0].length,o=e.slice(0,s+r.index+p+l),d=o.slice(s,-s);return{type:"del",raw:o,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:n?t[0]:Xs(t[0]),escaped:n}}}},ee=class ut{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||xe,this.options.tokenizer=this.options.tokenizer||new Ye,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:U,block:Qe.normal,inline:Re.normal};this.options.pedantic?(n.block=Qe.pedantic,n.inline=Re.pedantic):this.options.gfm&&(n.block=Qe.gfm,this.options.breaks?n.inline=Re.breaks:n.inline=Re.gfm),this.tokenizer.rules=n}static get rules(){return{block:Qe,inline:Re}}static lex(t,n){return new ut(n).lex(t)}static lexInline(t,n){return new ut(n).inlineTokens(t)}lex(t){t=t.replace(U.carriageReturn,`
|
|
62
|
+
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(U.tabCharGlobal," ").replace(U.spaceLine,""));let s=1/0;for(;t;){if(t.length<s)s=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
|
|
63
|
+
`:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
58
64
|
`)?"":`
|
|
59
|
-
`)+i.raw,
|
|
60
|
-
`+i.text,this.inlineQueue.at(-1).src=
|
|
65
|
+
`)+i.raw,a.text+=`
|
|
66
|
+
`+i.text,this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
61
67
|
`)?"":`
|
|
62
|
-
`)+i.raw,
|
|
63
|
-
`+i.raw,this.inlineQueue.at(-1).src=
|
|
68
|
+
`)+i.raw,a.text+=`
|
|
69
|
+
`+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let l=t;if(this.options.extensions?.startBlock){let a=1/0,c=t.slice(1),p;this.options.extensions.startBlock.forEach(o=>{p=o.call({lexer:this},c),typeof p=="number"&&p>=0&&(a=Math.min(a,p))}),a<1/0&&a>=0&&(l=t.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(l))){let a=n.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
64
70
|
`)?"":`
|
|
65
|
-
`)+i.raw,
|
|
66
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=
|
|
71
|
+
`)+i.raw,a.text+=`
|
|
72
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),r=l.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
67
73
|
`)?"":`
|
|
68
|
-
`)+i.raw,
|
|
69
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=
|
|
70
|
-
`:"";return
|
|
71
|
-
`:"<pre><code>"+(n?
|
|
72
|
-
`}blockquote({tokens:
|
|
73
|
-
${this.parser.parse(
|
|
74
|
-
`}html({text:
|
|
75
|
-
`}hr(
|
|
76
|
-
`}list(
|
|
77
|
-
`+
|
|
78
|
-
`}listitem(
|
|
79
|
-
`}checkbox({checked:
|
|
80
|
-
`}table(
|
|
74
|
+
`)+i.raw,a.text+=`
|
|
75
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}linkInText(t){if(!t.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let r of t.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(r[0])&&t.charAt(r.index-1)!=="!")return!0;for(let r of t.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let s=r[0],i=s.lastIndexOf("[");if(!(s.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Ke(s.slice(i+1,-1))))&&!(i>1&&this.linkInText(s.slice(1,i-1))))return!0}return!1}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=this.state.linkParenPossible;this.state.linkParenPossible=r&&t.includes(")");try{return this.#e(t,n)}finally{this.state.linkParenPossible=r}}#e(t,n){let r=t;if(this.tokens.links&&t.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,c=p=>{let o=p.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Ke(p.slice(o+1,-1))))return p;if(o>1&&p.charAt(0)!=="!"){let d=p.slice(1,o-1);if(this.linkInText(d))return"["+d.replace(a,c)+"]["+"a".repeat(p.length-o-2)+"]"}return"["+"a".repeat(p.length-2)+"]"};r=r.replace(a,c)}r=r.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(a,c,p)=>p?"+".repeat(a.length):c?c+a.slice(c.length,-c.length).replace(/`/g,"+")+c:a),r=r.replace(this.tokenizer.rules.inline.blockSkip,(a,c,p)=>{let o=p?p.length:0;return a.slice(0,o)+"["+"a".repeat(a.length-o-2)+"]"}),r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let s=!1,i="",l=1/0;for(;t;){if(t.length<l)l=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}s||(i=""),s=!1;let a;if(this.options.extensions?.inline?.some(p=>(a=p.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(a.raw.length);let p=n.at(-1);a.type==="text"&&p?.type==="text"?(p.raw+=a.raw,p.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(t,r,i)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(t,r,i)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(t)){t=t.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(t))){t=t.substring(a.raw.length),n.push(a);continue}let c=t;if(this.options.extensions?.startInline){let p=1/0,o=t.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},o),typeof d=="number"&&d>=0&&(p=Math.min(p,d))}),p<1/0&&p>=0&&(c=t.substring(0,p+1))}if(a=this.tokenizer.inlineText(c)){t=t.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(i=a.raw.slice(-1)),s=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=a.raw,p.text+=a.text):n.push(a);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return n}infiniteLoopError(t){let n="Infinite loop on byte: "+t;if(this.options.silent)console.error(n);else throw new Error(n)}},Je=class{options;parser;constructor(e){this.options=e||xe}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(U.notSpaceStart)?.[0],s=e?e.replace(U.endingNewline,"")+`
|
|
76
|
+
`:"";return r?'<pre><code class="language-'+J(r)+'">'+(n?s:J(s,!0))+`</code></pre>
|
|
77
|
+
`:"<pre><code>"+(n?s:J(s,!0))+`</code></pre>
|
|
78
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
79
|
+
${this.parser.parse(e)}</blockquote>
|
|
80
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
81
|
+
`}hr(e){return`<hr>
|
|
82
|
+
`}list(e){let t=e.ordered,n=e.start,r="";for(let l=0;l<e.items.length;l++){let a=e.items[l];r+=this.listitem(a)}let s=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+s+i+`>
|
|
83
|
+
`+r+"</"+s+`>
|
|
84
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
85
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
86
|
+
`}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let r="";for(let s=0;s<e.rows.length;s++){let i=e.rows[s];n="";for(let l=0;l<i.length;l++)n+=this.tablecell(i[l]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
81
87
|
<thead>
|
|
82
|
-
`+
|
|
83
|
-
`+
|
|
84
|
-
`}tablerow({text:
|
|
85
|
-
${
|
|
86
|
-
`}tablecell(
|
|
87
|
-
`}strong({tokens:
|
|
88
|
-
Please report this to https://github.com/markedjs/marked.`,
|
|
89
|
-
`),
|
|
90
|
-
`),
|
|
91
|
-
`,A:`[${
|
|
92
|
-
<html lang="${
|
|
88
|
+
`+t+`</thead>
|
|
89
|
+
`+r+`</table>
|
|
90
|
+
`}tablerow({text:e}){return`<tr>
|
|
91
|
+
${e}</tr>
|
|
92
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
93
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${J(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:s}){let i=s?J(n,!0):this.parser.parseInline(r),l=nn(e);if(l===null)return i;e=J(l,s);let a='<a href="'+e+'"';return t&&(a+=' title="'+J(t)+'"'),a+=">"+i+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=nn(e);if(s===null)return J(n);e=s;let i=`<img src="${J(e)}" alt="${J(n)}"`;return t&&(i+=` title="${J(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:J(e.text)}},wt=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},se=class ht{options;renderer;textRenderer;constructor(t){this.options=t||xe,this.options.renderer=this.options.renderer||new Je,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new wt}static parse(t,n){return new ht(n).parse(t)}static parseInline(t,n){return new ht(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let s=t[r];if(this.options.extensions?.renderers?.[s.type]){let l=s,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(l.type)){n+=a||"";continue}}let i=s;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<t.length;s++){let i=t[s];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){r+=a||"";continue}}let l=i;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},Ee=class{options;block;constructor(e){this.options=e||xe}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ee.lex:ee.lexInline}provideParser(e=this.block){return e?se.parse:se.parseInline}};function ge(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var Ys=class{defaults=ft();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=se;Renderer=Je;TextRenderer=wt;Lexer=ee;Tokenizer=Ye;Hooks=Ee;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(ge(n,t.call(this,r)),r.type){case"table":{let s=r;for(let i of s.header)ge(n,this.walkTokens(i.tokens,t));for(let i of s.rows)for(let l of i)ge(n,this.walkTokens(l.tokens,t));break}case"list":{let s=r;ge(n,this.walkTokens(s.items,t));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{let l=s[i].flat(1/0);ge(n,this.walkTokens(l,t))}):s.tokens&&ge(n,this.walkTokens(s.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=t.renderers[s.name];i?t.renderers[s.name]=function(...l){let a=s.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[s.level];i?i.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){let s=this.defaults.renderer||new Je(this.defaults);for(let i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,a=n.renderer[l],c=s[l];s[l]=(...p)=>{let o=a.apply(s,p);return o===!1&&(o=c.apply(s,p)),o||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new Ye(this.defaults);for(let i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,a=n.tokenizer[l],c=s[l];s[l]=(...p)=>{let o=a.apply(s,p);return o===!1&&(o=c.apply(s,p)),o}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new Ee;for(let i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,a=n.hooks[l],c=s[l];Ee.passThroughHooks.has(i)?s[l]=p=>{if(this.defaults.async&&Ee.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await a.call(s,p);return c.call(s,d)})();let o=a.call(s,p);return c.call(s,o)}:s[l]=(...p)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(s,p);return d===!1&&(d=await c.apply(s,p)),d})();let o=a.apply(s,p);return o===!1&&(o=c.apply(s,p)),o}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),s&&ge(a,s.call(this,l)),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ee.lex(e,t??this.defaults)}parser(e,t){return se.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let l=s.hooks?await s.hooks.preprocess(t):t,a=await(s.hooks?await s.hooks.provideLexer(e):e?ee.lex:ee.lexInline)(l,s),c=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let p=await(s.hooks?await s.hooks.provideParser(e):e?se.parse:se.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(p):p})().catch(i);try{s.hooks&&(t=s.hooks.preprocess(t));let l=(s.hooks?s.hooks.provideLexer(e):e?ee.lex:ee.lexInline)(t,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(e):e?se.parse:se.parseInline)(l,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(l){return i(l)}}}onError(e,t){return n=>{if(n.message+=`
|
|
94
|
+
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+J(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},ke=new Ys;function _(e,t){return ke.parse(e,t)}_.options=_.setOptions=function(e){return ke.setOptions(e),_.defaults=ke.defaults,cn(_.defaults),_};_.getDefaults=ft;_.defaults=xe;function Js(...e){return ke.use(...e),_.defaults=ke.defaults,cn(_.defaults),_}_.use=Js;_.walkTokens=function(e,t){return ke.walkTokens(e,t)};_.parseInline=ke.parseInline;_.Parser=se;_.parser=se.parse;_.Renderer=Je;_.TextRenderer=wt;_.Lexer=ee;_.lexer=ee.lex;_.Tokenizer=Ye;_.Hooks=Ee;_.parse=_;var Ir=_.options,qr=_.setOptions,Dr=_.walkTokens,Fr=_.parseInline;var Br=se.parse,Hr=ee.lex;var er=/^(ar|he|fa|ur|ps|sd|ug|yi|dv|ckb)\b/i,tr={back:"M15 5l-7 7 7 7",next:"M9 5l7 7-7 7",present:"M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5",presenter:"M3 5h12v9H3zM18 8h3M18 12h3M6 19h6",grid:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z",edit:"M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4",scheme:"M12 3a9 9 0 1 0 9 9 7 7 0 0 1-9-9z",export:"M12 4v11M7 10l5 5 5-5M5 20h14"};function nr(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true"),(e==="back"||e==="next")&&t.setAttribute("class","deck-flip");let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",tr[e]),t.append(n),t}function sr(e,t){let n=t.source.replace(/\r\n?/g,`
|
|
95
|
+
`),r=De(n),s=0,i=0,l=[],a=String(t.lang??r.settings.lang??document.documentElement.lang??"en")||"en",c=String(t.dir??r.settings.dir??(er.test(a)?"rtl":"ltr")),p={...Kt(a),...t.strings},o=new Intl.NumberFormat(a).format,d=matchMedia("(prefers-color-scheme: dark)"),h="light",g=Date.now();e.classList.add("deck"),e.lang=a,e.dir=c;let u=w("div",{class:"deck-stage",tabindex:0,role:"region","aria-roledescription":p.carousel,"aria-label":p.deck}),f=w("span",{class:"deck-where","aria-live":"polite"}),m=(b,$,M)=>{let F=w("button",{type:"button","aria-label":$,"data-act":b},[nr(b)]);return F.addEventListener("click",M),F},k=m("back",p.previous,()=>O(-1)),y=m("next",p.next,()=>O(1)),x=m("edit",p.edit,()=>j("is-editing")),C=m("presenter",p.presenter,()=>j("is-presenting")),A=m("grid",p.overview,()=>j("is-overview")),S=w("div",{class:"deck-bar"},[k,f,y,w("span",{class:"deck-gap"}),A,C,t.editable===!1?null:x,m("scheme",p.scheme,()=>{h=h==="dark"?"light":"dark",ne()}),t.onExport?m("export",p.export,()=>t.onExport?.(Mt)):null,document.fullscreenEnabled?m("present",p.present,()=>te()):null]),v=w("textarea",{class:"deck-source",spellcheck:"false","aria-label":p.source,dir:"auto"}),N=w("div",{class:"deck-next"}),E=w("div",{class:"deck-notes",dir:"auto","aria-label":p.notes}),q=w("span",{class:"deck-clock"}),I=w("div",{class:"deck-presenter"},[N,E]);e.replaceChildren(v,u,I,S),S.insertBefore(q,S.querySelector(".deck-gap"));let Q=[],Y=()=>{let b=He(t.kit,r.settings.kit);return Q=b.problems,b.kit};function ne(){V.kit=Y();let b=ot(r.settings,V.kit.tokens),$=ct(b,h),M=z=>z.map(W=>/^[\w-]+$/.test(W)?W:`"${W.replace(/["\\]/g,"")}"`).join(", "),F=b.fonts?{heading:M(b.fonts.heading),body:M(b.fonts.body)}:lt[b.voice];for(let[z,W]of Object.entries({paper:$.paper,ink:$.ink,muted:$.muted,line:$.line,primary:$.primary,fill:b.primary,"on-fill":$.onPrimary,soft:$.soft,heading:F.heading,body:F.body,radius:`${b.radius}px`,...Object.fromEntries($.series.map((B,D)=>[`series-${D+1}`,B]))}))e.style.setProperty(`--deck-${z}`,W);e.dataset.scheme=h,e.dataset.fill=(z=>fe(z,[255,255,255])>fe(z,[0,0,0])?"dark":"light")(K(b.primary)??[247,197,49]),e.dispatchEvent(new CustomEvent("deck-scheme",{detail:{scheme:h,colours:$,tokens:b}}))}let G=()=>{let b=t.scheme??r.settings.colorSchema??"auto";h=b==="dark"||b==="auto"&&d.matches?"dark":"light"},V={blocks:t.blocks??{},resolve:t.resolve??(b=>b),headings:t.headings??"real",number:b=>o(b),total:0,kit:He().kit,lex:t.lex??(b=>new ee({gfm:!0}).lex(b)),slide:p.slide};function ye(){V.total=r.slides.length,V.deck=r,l=r.slides.map(b=>Ge(b,V));for(let[b,{element:$}]of l.entries())$.setAttribute("aria-label",p.where.replace("{n}",o(b+1)).replace("{count}",o(l.length))),$.addEventListener("click",()=>{e.classList.contains("is-overview")&&(j("is-overview"),R(b,0))});u.replaceChildren(...l.map(({element:b})=>b)),s=Math.min(s,l.length-1),L(),requestAnimationFrame(()=>we())}function we(){for(let{element:b}of l)P(b)}function P(b){let $=!1;for(let M of b.querySelectorAll(".deck-slot")){let F=1;for(M.style.setProperty("--deck-fit","1");M.scrollHeight>M.clientHeight+1&&F>.6;)M.style.setProperty("--deck-fit",String(F=Math.round((F-.05)*100)/100));M.scrollHeight>M.clientHeight+1&&($=!0)}$?b.dataset.overflow="true":delete b.dataset.overflow}function L(){for(let[$,{element:M,steps:F}]of l.entries()){M.classList.toggle("is-shown",$===s),M.inert=$!==s&&!e.classList.contains("is-overview");for(let z of M.querySelectorAll(".deck-step"))z.classList.toggle("is-on",$<s||$===s&&Number(z.getAttribute("data-step"))<=i||F===0)}f.textContent=`${o(s+1)} / ${o(l.length)}`,k.toggleAttribute("disabled",s===0&&i===0),y.toggleAttribute("disabled",s>=l.length-1&&i>=(l[s]?.steps??0)),E.textContent=r.slides[s]?.notes||p.noNotes;let b=r.slides[s+1];N.replaceChildren(w("span",{},[b?p.upNext:p.last]),...b?[Ge(b,V).element]:[]),e.dispatchEvent(new CustomEvent("deck-move",{detail:{at:s,step:i}}))}function O(b){let $=l[s]?.steps??0;if(b>0&&i<$){i++,L();return}if(b<0&&i>0){i--,L();return}let M=s+b;M<0||M>=l.length||R(M,b>0?0:l[M].steps)}function R(b,$=0){if(b===s){i=$,L();return}let M=b>s,F=r.slides[M?b:s]?.settings??{},z=String(F.transition??r.settings.transition??"none"),[W,B]=z.split("|").map(_e=>_e.trim()),D=M?W:B??W;c==="rtl"&&(D=D.replace(/-(left|right)$/,(_e,je)=>je==="left"?"-right":"-left")),D==="view-transition"&&(D="morph");let le=()=>{s=b,i=$,D==="morph"&&X(l[b].element),L()},Rn=matchMedia("(prefers-reduced-motion: reduce)").matches;if(!document.startViewTransition||D==="none"||Rn||e.classList.contains("is-overview"))return le();D==="morph"&&X(l[s].element,l[b].element),document.documentElement.dataset.deckTransition=D;let Pt=document.startViewTransition(le);Pt.ready.catch(()=>{}),Pt.finished.finally(()=>{delete document.documentElement.dataset.deckTransition;for(let{element:_e}of l)for(let je of _e.querySelectorAll("[data-morph]"))je.style.removeProperty("view-transition-name"),je.removeAttribute("data-morph")})}function X(b,$){let M=z=>`${z.tagName}:${z.tagName==="IMG"?z.getAttribute("src"):(z.textContent??"").trim().slice(0,80)}`,F=z=>[...z.querySelectorAll("h1, h2, h3, h4, .deck-h, li, p, img, .deck-block, blockquote, .deck-image, .deck-map-node")].filter(W=>!W.matches(".deck-mindmap li"));if($){let z=new Map(F($).map(B=>[M(B),B])),W=0;for(let B of F(b)){let D=z.get(M(B));if(!D||D.dataset.morph||B.closest("[data-morph]"))continue;let le=`deck-m${W++}`;B.dataset.morph=D.dataset.morph=le,B.style.setProperty("view-transition-name",le)}return}for(let z of b.querySelectorAll("[data-morph]")){let W=z.dataset.morph;for(let B of u.querySelectorAll(`[data-morph="${W}"]`))B!==z&&B.style.removeProperty("view-transition-name");z.style.setProperty("view-transition-name",W)}}function j(b){for(let $ of["is-editing","is-presenting","is-overview"])$!==b&&e.classList.remove($);e.classList.toggle(b),x.setAttribute("aria-pressed",String(e.classList.contains("is-editing"))),C.setAttribute("aria-pressed",String(e.classList.contains("is-presenting"))),A.setAttribute("aria-pressed",String(e.classList.contains("is-overview"))),e.classList.contains("is-editing")&&(v.value=n,v.focus()),L(),requestAnimationFrame(()=>we())}function te(){u.requestFullscreen?.().then(()=>u.focus(),()=>{})}function ie(b){n=b.replace(/\r\n?/g,`
|
|
96
|
+
`),r=De(n),ne(),ye(),t.onChange?.(n)}let ae=0;v.addEventListener("input",b=>{b.isComposing||(clearTimeout(ae),ae=setTimeout(()=>ie(v.value),120))});let Tt=()=>{let b=v.selectionStart,$=r.slides.findIndex(M=>b>=M.start&&b<=M.end+1);$>=0&&$!==s&&(s=$,i=l[$]?.steps??0,L())};v.addEventListener("keyup",Tt),v.addEventListener("click",Tt),u.addEventListener("dblclick",b=>{if(t.editable===!1||document.fullscreenElement)return;let $=b.target.closest("[data-edit]");if(!$)return;let[M,F]=$.dataset.edit.split("-").map(Number);$.contentEditable="true",$.focus();let z=D=>{$.removeEventListener("keydown",W),$.removeEventListener("blur",B),$.contentEditable="false";let le=St($);D&&le!==n.slice(M,F)?ie(n.slice(0,M)+le+n.slice(F)):ye()},W=D=>{D.isComposing||(D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),z(!0)),D.key==="Escape"&&(D.preventDefault(),z(!1)))},B=()=>z(!0);$.addEventListener("keydown",W),$.addEventListener("blur",B)});let Rt=b=>b.target.closest(".deck-slide.is-shown [data-go]");e.addEventListener("keydown",b=>{let $=b.target;if($.isContentEditable||$===v||$.tagName==="BUTTON"&&(b.key===" "||b.key==="Enter")){(b.metaKey||b.ctrlKey)&&b.key==="s"&&(b.preventDefault(),t.onSave?.(n));return}let M=Rt(b);if(M&&b.key==="Enter"){b.preventDefault(),R(Number(M.dataset.go));return}let F=c==="rtl"?"ArrowLeft":"ArrowRight",z=c==="rtl"?"ArrowRight":"ArrowLeft";if(b.altKey||b.ctrlKey||b.metaKey){(b.metaKey||b.ctrlKey)&&b.key==="s"&&(b.preventDefault(),t.onSave?.(n));return}let B={[F]:()=>O(1),[z]:()=>O(-1),ArrowDown:()=>O(1),ArrowUp:()=>O(-1),PageDown:()=>O(1),PageUp:()=>O(-1)," ":()=>O(1),Home:()=>R(0),End:()=>R(l.length-1,l.at(-1)?.steps??0),f:te,p:()=>j("is-presenting"),o:()=>j("is-overview"),e:()=>j("is-editing")}[b.key];B&&(b.preventDefault(),B())}),u.addEventListener("click",b=>{let $=Rt(b);$&&!e.classList.contains("is-editing")&&!e.classList.contains("is-overview")&&(b.stopPropagation(),R(Number($.dataset.go)))},!0),u.addEventListener("click",b=>{document.fullscreenElement&&!b.target.closest("a, button, input")&&O(1)});let Et=0;u.addEventListener("touchstart",b=>{Et=b.touches[0].clientX},{passive:!0}),u.addEventListener("touchend",b=>{let $=b.changedTouches[0].clientX-Et;Math.abs($)>50&&O($<0==(c!=="rtl")?1:-1)}),d.addEventListener("change",()=>{G(),ne()});let Tn=setInterval(()=>{let b=Math.floor((Date.now()-g)/1e3);q.textContent=e.classList.contains("is-presenting")?`${String(Math.floor(b/60)).padStart(2,"0")}:${String(b%60).padStart(2,"0")}`:""},1e3);G(),ne(),ye(),document.fonts?.ready.then(()=>we());let Mt={root:e,stage:u,get source(){return n},get deck(){return r},get at(){return s},get scheme(){return h},get kit(){return V.kit},get kitProblems(){return Q},lang:a,dir:c,slides:()=>l.map(({element:b})=>b),setSource:ie,go:R,toggle:j,present:te,fitAll:we,setScheme:b=>{h=b,ne()},destroy:()=>clearInterval(Tn)};return Mt}function St(e){let t="";for(let n of e.childNodes)if(n.nodeType===Node.TEXT_NODE)t+=(n.textContent??"").replace(/([*_`[\]\\])/g,"\\$1");else if(n instanceof HTMLElement){let r=St(n);t+={STRONG:`**${r}**`,B:`**${r}**`,EM:`*${r}*`,I:`*${r}*`,CODE:`\`${n.textContent}\``,DEL:`~~${r}~~`,BR:`
|
|
97
|
+
`,A:`[${r}](${n.getAttribute("href")??""})`}[n.tagName]??r}return t.replace(/ /g," ").replace(/\n+$/,"")}var et="0.4.0";var $t='<script type="text/markdown" id="deck">',rr="<\/script>",xn=e=>e.replace(/<(\\*)(\/?script)/gi,"<\\$1$2"),bn=e=>e.replace(/<\\(\\*)(\/?script)/gi,"<$1$2"),Le=e=>e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<"),ir=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");function ar(e){if(/\\<(!--|\/?script)/i.test(e))throw new Error("This code cannot be held in a page as it is.");return e.replace(/<(!--|\/?script)/gi,"\\x3C$1")}function lr(e){let t=e.indexOf($t);if(t<0)return null;let n=t+$t.length,r=e.slice(n).search(/<\/script/i);return r<0?null:bn(e.slice(n,n+r).replace(/^\n/,"").replace(/\n$/,""))}var yn=(e=et)=>`https://cdn.jsdelivr.net/npm/@codename/deck@${e}/dist/deck.js`;function or(e,{title:t="",lang:n="en",dir:r="auto",renderer:s={src:yn()},base:i,generator:l=`deck ${et}`}={}){let a=i?` data-base="${Le(i)}"`:"",c="src"in s?`<script src="${Le(s.src)}"${a}><\/script>`:`<script${a}>${ar(s.code)}<\/script>`;return`<!doctype html>
|
|
98
|
+
<html lang="${Le(n)}" dir="${Le(r)}">
|
|
93
99
|
<meta charset="utf-8">
|
|
94
100
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
95
|
-
<meta name="generator" content="${
|
|
96
|
-
<title>${
|
|
101
|
+
<meta name="generator" content="${Le(l)}">
|
|
102
|
+
<title>${ir(t)}</title>
|
|
97
103
|
<style>#deck{display:block;white-space:pre-wrap;overflow-wrap:anywhere;font:1rem/1.6 ui-monospace,Menlo,Consolas,monospace;max-width:72ch;margin:2rem auto;padding:0 1rem}</style>
|
|
98
104
|
<body>
|
|
99
|
-
${
|
|
100
|
-
${
|
|
101
|
-
${
|
|
102
|
-
${
|
|
105
|
+
${$t}
|
|
106
|
+
${xn(e)}
|
|
107
|
+
${rr}
|
|
108
|
+
${c}
|
|
103
109
|
</html>
|
|
104
|
-
`}var He=13.333,bt=7.5,sn="h1, h2, h3, h4, h5, h6, .deck-h, p:not(.deck-picture), ul, ol, blockquote";function X(t){let e=/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/.exec(t);return e?[e[1],e[2],e[3]].map(n=>Math.round(Number(n)).toString(16).padStart(2,"0")).join("").toUpperCase():t.replace("#","").toUpperCase().slice(0,6)||"000000"}async function jr(t,{PptxGenJS:e,JSZip:n}){let s=new e;s.layout="LAYOUT_WIDE",s.title=t.deck.slides[0]?.title??"",s.rtlMode=t.dir==="rtl";let r=getComputedStyle(t.root),i=m=>m.split(",").map(f=>f.trim().replace(/^["']|["']$/g,"")).find(f=>!/^(ui-|system-ui|-apple|sans-serif|serif|monospace)/.test(f))??"Arial";s.theme={headFontFace:i(r.getPropertyValue("--deck-heading")),bodyFontFace:i(r.getPropertyValue("--deck-body"))};let a={slides:0,charts:0,pictures:0,tables:0,placeholders:0},l=t.dir==="rtl",o=t.slides(),u=new Map,p=[];for(let[m,f]of o.entries()){let k=f.getBoundingClientRect(),b=He/k.width,x=R=>{let M=R.getBoundingClientRect();return{x:(M.left-k.left)*b,y:(M.top-k.top)*b,w:M.width*b,h:M.height*b}},z=R=>{let M=R.closest(".deck-slot")??R,{x:U,w:$}=x(M),{y:I,h:C}=x(R),_=getComputedStyle(M),re=parseFloat(_.paddingInlineStart)*b,se=parseFloat(_.paddingInlineEnd)*b;return{x:U+(l?se:re),y:I,w:$-re-se,h:C*1.08}},W=R=>getComputedStyle(R).justifyContent==="center"?"middle":"top",q=R=>Math.round(R*b*72*10)/10,v=getComputedStyle(f),E=f.dataset.layout??"default",Z=[...f.querySelectorAll(".deck-slot")],K=Z[0]?.firstElementChild,B=K&&K.matches("h1, h2, h3, .deck-h")?K:null,J=t.kit.layouts[E],ee=`${J?Qe(J,E,t.lang):E}${f.classList.contains("deck-class-invert")?" (dark)":""}`;if(!u.has(ee)){let R=[],M=[...f.querySelectorAll("img.deck-art")].map(C=>C.src),U=M.length&&await Re(M,He*150,bt*150,!1,v.backgroundColor);U&&(R.push({image:{data:U,x:0,y:0,w:He,h:bt}}),a.pictures++),B&&R.push({placeholder:{options:{name:"title",type:"title",...z(B),valign:"bottom",margin:0,fontFace:s.theme.headFontFace,color:X(getComputedStyle(B).color),align:l?"right":"left"},text:""}});for(let C of Z){let _=x(C),re=B&&C===Z[0]?x(B).y+x(B).h:_.y,se=C.firstElementChild&&C.firstElementChild!==B?z(C.firstElementChild):{x:_.x,w:_.w};R.push({placeholder:{options:{name:`body-${C.dataset.slot}`,type:"body",x:se.x,y:re+.08,w:se.w,h:Math.max(.3,_.y+_.h-re-.08),margin:0,valign:W(C),color:X(getComputedStyle(C).color)},text:""}})}let $=[...f.querySelectorAll(".deck-logo")].find(C=>getComputedStyle(C).display!=="none"),I=$&&await Re($.src,$.clientWidth*3,$.clientHeight*3);$&&I&&(R.push({image:{data:I,...x($)}}),a.pictures++),s.defineSlideMaster({title:ee,background:{color:X(v.backgroundColor)},objects:R,slideNumber:J?.numbered!==!1?{x:l?.3:He-.9,y:bt-.55,w:.6,h:.3,fontSize:10,color:X(r.getPropertyValue("--deck-muted").trim()||"#666666")}:void 0}),u.set(ee,new Set(R.flatMap(C=>C.placeholder?[C.placeholder.options.name]:[])))}let Te=u.get(ee),F=s.addSlide({masterName:ee});a.slides++;let ie=f.querySelector(".deck-image");if(ie){let R=/url\("?(.*?)"?\)/.exec(getComputedStyle(ie).backgroundImage)?.[1],M=R&&await Re(R,ie.clientWidth*2,ie.clientHeight*2,!0);M&&(F.addImage({data:M,...x(ie)}),a.pictures++)}B&&Te.has("title")&&(F.addText(xt(B,{pt:q,rtl:l,lang:t.lang}),{placeholder:"title"}),a.placeholders++);for(let R of Z){let M=[...R.children].filter($=>$!==B);if(M.length>0&&M.every($=>$.matches(sn))&&Te.has(`body-${R.dataset.slot}`)){F.addText(M.flatMap($=>xt($,{pt:q,rtl:l,lang:t.lang})),{placeholder:`body-${R.dataset.slot}`,valign:W(R),...an(R)}),a.placeholders++;continue}for(let $ of M){let I=x($);if($.matches(sn))F.addText(xt($,{pt:q,rtl:l,lang:t.lang}),{...z($),valign:"top",margin:0,...an(R)});else if($.matches("pre"))F.addText($.textContent?.replace(/\n$/,"")??"",{...I,fontFace:"Consolas",fontSize:q(parseFloat(getComputedStyle($).fontSize)),color:X(getComputedStyle($).color),fill:{color:X(getComputedStyle($).backgroundColor)},valign:"top",margin:6,rtlMode:!1,align:"left"});else if($.matches(".deck-table"))Ir(F,$,I,{pt:q,rtl:l,lang:t.lang}),a.tables++;else if($.matches(".deck-echarts")&&$.chart){let C=$.chart;Dr(s,F,C,I,{pt:q,rtl:l,lang:t.lang,ink:X(v.color)})?a.charts++:(F.addImage({data:await Re(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(C.renderToSVGString())}`,I.w/b*2,I.h/b*2),...I}),a.pictures++)}else{let C=$.querySelector("img");if(C){C.complete||(C.loading="eager",await C.decode().catch(()=>{}));let _=await Re(C.src,C.clientWidth*2,C.clientHeight*2);_&&(F.addImage({data:_,...x(C),altText:C.alt}),a.pictures++)}}}}let ne=t.deck.slides[m]?.notes;ne&&F.addNotes(ne);let xe=t.deck.slides[m]?.settings??{};p.push(String(xe.transition??t.deck.settings.transition??"none").split("|")[0].trim())}let c=await n.loadAsync(await s.write({outputType:"arraybuffer",compression:!0}));for(let[m,f]of p.entries()){let k=`ppt/slides/slide${m+1}.xml`,b=await c.file(k)?.async("string");!b||f==="none"||c.file(k,b.replace(/<\/p:clrMapOvr>|(?=<p:timing|<\/p:sld>)/,x=>`${x}${qr(f,l)}`))}let d=await c.file("ppt/theme/theme1.xml")?.async("string");if(d){let m=b=>X(r.getPropertyValue(`--deck-${b}`).trim()),f=[m("fill"),...[2,3,4,5,6].map(b=>m(`series-${b}`))],k=`<a:clrScheme name="Deck"><a:dk1><a:srgbClr val="${m("ink")}"/></a:dk1><a:lt1><a:srgbClr val="${m("paper")}"/></a:lt1><a:dk2><a:srgbClr val="${m("ink")}"/></a:dk2><a:lt2><a:srgbClr val="${m("soft")}"/></a:lt2>${f.map((b,x)=>`<a:accent${x+1}><a:srgbClr val="${b}"/></a:accent${x+1}>`).join("")}<a:hlink><a:srgbClr val="${m("primary")}"/></a:hlink><a:folHlink><a:srgbClr val="${m("primary")}"/></a:folHlink></a:clrScheme>`;c.file("ppt/theme/theme1.xml",d.replace(/<a:clrScheme[\s\S]*?<\/a:clrScheme>/,k))}return{blob:await c.generateAsync({type:"blob",compression:"DEFLATE",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}),report:a}}function an(t){let e=t.firstElementChild,n=e?parseFloat(getComputedStyle(e).marginBlockEnd):0;return{paraSpaceAfter:Math.round(n*.5)}}function xt(t,e){let n=[],s=(i,a)=>{let l=getComputedStyle(i),o={fontSize:e.pt(parseFloat(l.fontSize)),color:X(l.color),bold:Number(l.fontWeight)>=600,lang:e.lang,rtlMode:e.rtl,align:l.textAlign==="center"?"center":e.rtl?"right":"left",...a},u=Nr(i,o);u.length&&(u[u.length-1].options.breakLine=!0,n.push(...u))},r=(i,a)=>{let l=0;for(let o of i.children){l++;let u=[...o.children].filter(c=>c.matches("ul, ol")),p=o.cloneNode(!0);for(let c of[...p.children])c.matches("ul, ol, input")&&c.remove();o.after(p),s(p,{bullet:i.tagName==="OL"?{type:"number",startAt:l===1?Number(i.getAttribute("start")??1):void 0}:!0,indentLevel:a}),p.remove();for(let c of u)r(c,a+1)}};if(t.matches("ul, ol"))r(t,0);else if(t.matches("blockquote"))for(let i of t.children)s(i,{italic:getComputedStyle(i).fontStyle==="italic"});else s(t,{});return n}function Nr(t,e){let n=[],s=(r,i)=>{if(r.nodeType===Node.TEXT_NODE){let l=(r.textContent??"").replace(/\s+/g," ");l&&n.push({text:l,options:{...i}});return}if(!(r instanceof HTMLElement))return;if(r.tagName==="BR"){n.length&&(n[n.length-1].options.breakLine=!0);return}let a={...i};r.matches("strong, b")&&(a.bold=!0,a.color=X(getComputedStyle(r).color)),r.matches("em, i")&&(a.italic=!0),r.matches("del, s")&&(a.strike="sngStrike"),r.matches("code")&&(a.fontFace="Consolas"),r.matches("a[href]")&&(a.hyperlink={url:r.getAttribute("href")});for(let l of r.childNodes)s(l,a)};for(let r of t.childNodes)s(r,e);return n.length&&(n[0].text=n[0].text.trimStart(),n[n.length-1].text=n[n.length-1].text.trimEnd()),n.filter(r=>r.text)}function Ir(t,e,n,s){let r=[...e.querySelectorAll("tr")].map(l=>[...l.children].map(o=>{let u=getComputedStyle(o),p=o.getAttribute("data-align");return{text:o.textContent?.trim()??"",options:{bold:o.tagName==="TH",fontSize:s.pt(parseFloat(u.fontSize)),color:X(u.color),lang:s.lang,rtlMode:s.rtl,align:p==="center"?"center":p==="right"!==s.rtl?"right":"left",border:[{type:"none"},{type:"none"},{type:"solid",pt:o.tagName==="TH"?1.5:.75,color:X(u.borderBlockEndColor)},{type:"none"}]}}})),i=[...e.querySelector("tr")?.children??[]].map(l=>l.getBoundingClientRect().width),a=i.reduce((l,o)=>l+o,0)||1;t.addTable(s.rtl?r.map(l=>l.reverse()):r,{...n,colW:(s.rtl?i.reverse():i).map(l=>l/a*n.w),margin:.06})}function Dr(t,e,n,s,r){let i=n.getOption(),a=i.series??[];if(!a.length)return!1;let l=new Set(a.map(c=>c.type)),o=(i.color??[]).map(X),u=c=>Array.isArray(c)?Number(c.at(-1)):Number(typeof c=="object"&&c!==null?c.value:c),p={...s,showLegend:a.length>1||l.has("pie"),legendPos:"b",legendFontSize:12,legendColor:r.ink,chartColors:o,showTitle:!!i.title?.[0]?.text,title:i.title?.[0]?.text,titleFontSize:16,titleColor:r.ink,catAxisLabelColor:r.ink,valAxisLabelColor:r.ink,dataLabelColor:r.ink,lang:r.lang};if(l.size===1&&l.has("pie")){let c=a[0],d=Array.isArray(c.radius)&&parseFloat(c.radius[0])>0;return e.addChart(d?t.charts.DOUGHNUT:t.charts.PIE,[{name:c.name??"",labels:c.data.map(h=>h.name),values:c.data.map(u)}],{...p,showPercent:!0,showLegend:!0,holeSize:d?55:void 0}),!0}if([...l].every(c=>c==="bar"||c==="line")){let c=i.yAxis?.[0]?.type==="category",d=(c?i.yAxis:i.xAxis)?.[0]?.data??[],h=k=>[{name:k.name??"",labels:d.map(String),values:k.data.map(u)}],m=k=>k.type==="bar"?t.charts.BAR:k.areaStyle?t.charts.AREA:t.charts.LINE,f={catAxisLabelFontSize:11,valAxisLabelFontSize:11,valGridLine:{color:"D9D9D9",size:.5},catAxisOrientation:r.rtl&&!c?"maxMin":"minMax",valAxisLabelFormatCode:"#,##0"};if(l.size===1){let k=a.flatMap(h);e.addChart(m(a[0]),k,{...p,...f,barDir:c?"bar":"col",barGrouping:a.some(b=>b.stack)?"stacked":"clustered",lineDataSymbol:"circle",lineSize:2})}else e.addChart(a.map(k=>({type:m(k),data:h(k),options:{barDir:c?"bar":"col",chartColors:[o[a.indexOf(k)%o.length]]}})),{...p,...f});return!0}if(l.size===1&&l.has("scatter")){let c=a[0].data.map(d=>Array.isArray(d)?d:[d.value?.[0],d.value?.[1]]);return e.addChart(t.charts.SCATTER,[{name:"X",values:c.map(d=>d[0])},{name:a[0].name??"Y",values:c.map(d=>d[1])}],{...p,lineSize:0,lineDataSymbolSize:8}),!0}if(l.size===1&&l.has("radar")){let c=i.radar?.[0]?.indicator??[];return e.addChart(t.charts.RADAR,a[0].data.map(d=>({name:d.name??"",labels:c.map(h=>h.name),values:d.value})),{...p,showLegend:!0,radarStyle:"standard"}),!0}return!1}function qr(t,e){let n=s=>`<p:transition spd="med"><p:push dir="${s}"/></p:transition>`;return t==="view-transition"||t==="morph"?'<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice xmlns:p159="http://schemas.microsoft.com/office/powerpoint/2015/09/main" Requires="p159"><p:transition spd="slow"><p159:morph option="byObject"/></p:transition></mc:Choice><mc:Fallback><p:transition spd="slow"><p:fade/></p:transition></mc:Fallback></mc:AlternateContent>':t==="slide-left"?n(e?"r":"l"):t==="slide-right"?n(e?"l":"r"):t==="slide-up"?n("u"):t==="slide-down"?n("d"):'<p:transition spd="med"><p:fade/></p:transition>'}async function Re(t,e,n,s=!1,r=""){try{let i=await Promise.all([t].flat().map(async d=>{let h=new Image;return h.crossOrigin="anonymous",h.src=d,await h.decode(),h})),a=i[0],l=document.createElement("canvas");l.width=Math.max(1,Math.round(e)),l.height=Math.max(1,Math.round(n));let o=l.getContext("2d"),u=a.naturalWidth||e,p=a.naturalHeight||n,c=s?Math.max(l.width/u,l.height/p):Math.min(l.width/u,l.height/p);if(!r)o.drawImage(a,(l.width-u*c)/2,(l.height-p*c)/2,u*c,p*c);else{o.fillStyle=r,o.fillRect(0,0,l.width,l.height);for(let d of i)o.drawImage(d,0,0,l.width,l.height)}return l.toDataURL(r?"image/jpeg":"image/png",.9)}catch{return null}}var yt=new Map;function ln(t,e){return yt.has(t)||yt.set(t,new Promise((n,s)=>{let r=document.createElement("script");r.src=t,r.onload=()=>n(globalThis[e]),r.onerror=s,document.head.append(r)})),yt.get(t)}var wt=(t,e,n,s)=>/node_modules\/$/.test(t)?`${t}${e}/${s}`:`${t}${e}@${n}/${s}`;function Br({base:t,root:e,versions:n={}}){let{echarts:s="6.1.0",pele:r="1.10.0"}=n,i=new Set,a=null;e.addEventListener("deck-scheme",o=>{a=o.detail.colours;for(let u of i)u.chart.setOption(l(u.option,u.box),!0)});let l=(o,u)=>{let p=parseFloat(getComputedStyle(u).fontSize)||16,c=getComputedStyle(u).direction==="rtl",d=Math.round(p*.6),h=(m,f)=>m===void 0?void 0:[m].flat().map(k=>({axisLabel:{color:a?.muted,fontSize:d},axisLine:{lineStyle:{color:a?.line}},splitLine:{lineStyle:{color:a?.line}},nameTextStyle:{color:a?.muted,fontSize:d},...c&&f&&k.type==="category"?{inverse:!0}:{},...c&&!f?{position:"right"}:{},...k}));return{color:a?.series,backgroundColor:"transparent",animation:!matchMedia("(prefers-reduced-motion: reduce)").matches,textStyle:{fontFamily:getComputedStyle(e).getPropertyValue("--deck-body")||"system-ui",color:a?.ink,fontSize:d},...o,title:o.title?{...o.title,textStyle:{color:a?.ink,fontSize:Math.round(p*.8),...o.title?.textStyle}}:void 0,legend:o.legend?{itemWidth:d*1.6,itemHeight:d,...o.legend,textStyle:{color:a?.ink,fontSize:d,...o.legend?.textStyle}}:void 0,grid:{containLabel:!0,left:d,right:d,top:o.title?p*1.8:d,bottom:o.legend?p*1.6:d,...o.grid},xAxis:h(o.xAxis,!0),yAxis:h(o.yAxis,!1),toolbox:void 0,series:[o.series??[]].flat().map(m=>m.type==="pie"?{label:{color:a?.ink,fontSize:d},...m}:m)}};return{async echarts(o,u){let p=JSON.parse(u),c=await ln(wt(t,"echarts",s,"dist/echarts.min.js"),"echarts"),d=document.createElement("div");d.className="deck-chart",d.setAttribute("role","img"),d.setAttribute("aria-label",String(p.title?.text??"")),o.append(d);let h=c.init(d,null,{renderer:"svg",locale:document.documentElement.lang?.startsWith("ja")?"JA":"EN"}),m={chart:h,option:p,box:o};i.add(m),h.setOption(l(p,o)),new ResizeObserver(()=>{h.resize(),h.setOption(l(p,o),!0)}).observe(d),Object.assign(o,{chart:h})},async mermaid(o,u){let p=await ln(wt(t,"pele",r,"dist/pele.global.js"),"pele"),c=getComputedStyle(e).getPropertyValue("--deck-body")||"system-ui, sans-serif",{svg:d}=p.render(u,{fontFamily:c,links:!1,images:!1,autoDirection:!0,maxWidth:Math.max(320,o.clientWidth*1.4)}),h=`--pele-bg:transparent;--pele-fg:${a?.ink};--pele-muted:${a?.muted};--pele-line:${a?.muted};--pele-surface:${a?.soft};--pele-surface-alt:${a?.line};--pele-border:${a?.primary};--pele-accent:${a?.primary};--pele-font:${c.replace(/[<>"]/g,"")}`,m=document.createElement("img");m.alt=u,m.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d.replace(/^(<svg\b[^>]*>)/,`$1<style>svg{${h}}</style>`))}`;let f=document.createElement("div");f.className="deck-diagram",f.append(m),o.append(f)}}}var on=/^(\s*(?:image|background|backgroundImage)\s*:\s*)(['"]?)([^'"\n#]+?)\2(\s*(?:#.*)?)$/gm,cn=/(!\[[^\]\n]*\]\()(<[^>\n]+>|[^\s)\n]+)((?:\s+(?:"[^"\n]*"|'[^'\n]*'))?\))/g,Fr=t=>/^data:/i.test(t),Zr=t=>/^(https?:)?\/\//i.test(t);function Hr(t){let e="";for(let n=0;n<t.length;n+=32768)e+=String.fromCharCode(...t.subarray(n,n+32768));return btoa(e)}async function Wr(t,e,{web:n=!1,largest:s=8*1024*1024}={}){let r=new Map,i=[...t.matchAll(cn)].map(c=>c[2].replace(/^<|>$/g,"")).concat([...t.matchAll(on)].map(c=>c[3].trim())),a=[],l=[],o=[];for(let c of new Set(i)){if(Fr(c)||Zr(c)&&!n||/^(#|mailto:|javascript:)/i.test(c))continue;let d=await e(c).catch(()=>null);if(!d||!/^image\/(png|jpeg|gif|webp|avif|svg\+xml)$/.test(d.type)){l.push(c),r.set(c,null);continue}if(d.bytes.length>s){o.push(c),r.set(c,null);continue}r.set(c,`data:${d.type};base64,${Hr(d.bytes)}`),a.push(c)}let u=c=>r.get(c)??null;return{source:t.replace(cn,(c,d,h,m)=>{let f=u(h.replace(/^<|>$/g,""));return f?`${d}${f}${m}`:c}).replace(on,(c,d,h,m,f)=>{let k=u(m.trim());return k?`${d}${h}${k}${h}${f}`:c}),inlined:a,missing:l,kept:o}}var Ur=/^(`{3,}|~{3,})[ \t]*(deck|slidev|markdown|md)?[ \t]*$/,Gr="layout|transition|class|image|background|clicks|title|level|hide|zoom|theme|colorSchema|lang|themeConfig|paginate|alt";function Qr(t){let e=t.replace(/\r\n?/g,`
|
|
110
|
+
`}var tt=13.333,At=7.5,wn="h1, h2, h3, h4, h5, h6, .deck-h, p:not(.deck-picture), ul, ol, blockquote";function H(e){let t=/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/.exec(e);if(t)return[t[1],t[2],t[3]].map(r=>Math.round(Number(r)).toString(16).padStart(2,"0")).join("").toUpperCase();let n=/color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/.exec(e);return n?[n[1],n[2],n[3]].map(r=>Math.round(Number(r)*255).toString(16).padStart(2,"0")).join("").toUpperCase():e.replace("#","").toUpperCase().slice(0,6)||"000000"}var be=e=>{let t=/rgba\((?:[^,]*,){3}\s*([\d.]+)\s*\)|\/\s*([\d.]+)\s*\)/.exec(e);return e==="transparent"?0:Number(t?.[1]??t?.[2]??1)};async function cr(e,{PptxGenJS:t,JSZip:n}){let r=new t;r.layout="LAYOUT_WIDE",r.title=e.deck.slides[0]?.title??"",r.rtlMode=e.dir==="rtl";let s=getComputedStyle(e.root),i=u=>u.split(",").map(f=>f.trim().replace(/^["']|["']$/g,"")).find(f=>!/^(ui-|system-ui|-apple|sans-serif|serif|monospace)/.test(f))??"Arial";r.theme={headFontFace:i(s.getPropertyValue("--deck-heading")),bodyFontFace:i(s.getPropertyValue("--deck-body"))};let l={slides:0,charts:0,pictures:0,tables:0,placeholders:0,maps:0,figures:0},a=e.dir==="rtl",c=e.slides(),p=new Map,o=[];for(let[u,f]of c.entries()){let m=f.getBoundingClientRect(),k=tt/m.width,y=P=>{let L=P.getBoundingClientRect();return{x:(L.left-m.left)*k,y:(L.top-m.top)*k,w:L.width*k,h:L.height*k}},x=P=>{let L=P.closest(".deck-slot")??P,{x:O,w:R}=y(L),{y:X,h:j}=y(P),te=getComputedStyle(L),ie=parseFloat(te.paddingInlineStart)*k,ae=parseFloat(te.paddingInlineEnd)*k;return{x:O+(a?ae:ie),y:X,w:R-ie-ae,h:j*1.08}},C=async(P,L)=>{if(P.matches(".deck-echarts")&&P.chart){let X=P.chart;hr(r,G,X,L,{pt:S,rtl:a,lang:e.lang,ink:H(v.color)})?l.charts++:(G.addImage({data:await ze(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(X.renderToSVGString())}`,L.w/k*2,L.h/k*2),...L}),l.pictures++);return}let O=P.querySelector("img");if(!O)return;O.complete||(O.loading="eager",await O.decode().catch(()=>{}));let R=await ze(O.src,O.clientWidth*2,O.clientHeight*2);R&&(G.addImage({data:R,...y(O),altText:O.alt}),l.pictures++)},A=P=>getComputedStyle(P).justifyContent==="center"?"middle":"top",S=P=>Math.round(P*k*72*10)/10,v=getComputedStyle(f),N=f.dataset.layout??"default",E=[...f.querySelectorAll(".deck-slot")],q=E[0]?.firstElementChild,I=q&&q.matches("h1, h2, h3, .deck-h")?q:null,Q=e.kit.layouts[N],Y=`${Q?st(Q,N,e.lang):N}${f.classList.contains("deck-class-invert")?" (dark)":""}`;if(!p.has(Y)){let P=[],L=[...f.querySelectorAll("img.deck-art")].map(j=>j.src),O=L.length&&await ze(L,tt*150,At*150,!1,v.backgroundColor);O&&(P.push({image:{data:O,x:0,y:0,w:tt,h:At}}),l.pictures++),I&&P.push({placeholder:{options:{name:"title",type:"title",...x(I),valign:"bottom",margin:0,fontFace:r.theme.headFontFace,color:H(getComputedStyle(I).color),align:a?"right":"left"},text:""}});for(let j of E){let te=y(j),ie=I&&j===E[0]?y(I).y+y(I).h:te.y,ae=j.firstElementChild&&j.firstElementChild!==I?x(j.firstElementChild):{x:te.x,w:te.w};P.push({placeholder:{options:{name:`body-${j.dataset.slot}`,type:"body",x:ae.x,y:ie+.08,w:ae.w,h:Math.max(.3,te.y+te.h-ie-.08),margin:0,valign:A(j),color:H(getComputedStyle(j).color)},text:""}})}let R=[...f.querySelectorAll(".deck-logo")].find(j=>getComputedStyle(j).display!=="none"),X=R&&await ze(R.src,R.clientWidth*3,R.clientHeight*3);R&&X&&(P.push({image:{data:X,...y(R)}}),l.pictures++),r.defineSlideMaster({title:Y,background:{color:H(v.backgroundColor)},objects:P,slideNumber:Q?.numbered!==!1?{x:a?.3:tt-.9,y:At-.55,w:.6,h:.3,fontSize:10,color:H(s.getPropertyValue("--deck-muted").trim()||"#666666")}:void 0}),p.set(Y,new Set(P.flatMap(j=>j.placeholder?[j.placeholder.options.name]:[])))}let ne=p.get(Y),G=r.addSlide({masterName:Y});l.slides++;let V=f.querySelector(".deck-image");if(V){let P=/url\("?(.*?)"?\)/.exec(getComputedStyle(V).backgroundImage)?.[1],L=P&&await ze(P,V.clientWidth*2,V.clientHeight*2,!0);L&&(G.addImage({data:L,...y(V)}),l.pictures++);let O=getComputedStyle(V,"::after");O.content!=="none"&&be(O.backgroundColor)>0&&G.addShape(r.shapes.RECTANGLE,{...y(V),fill:{color:H(O.backgroundColor),transparency:Math.round((1-be(O.backgroundColor))*100)},line:{type:"none"}})}I&&ne.has("title")&&(G.addText(Ne(I,{pt:S,rtl:a,lang:e.lang}),{placeholder:"title"}),l.placeholders++);for(let P of E){let L=[...P.children].filter(R=>R!==I);if(L.length>0&&L.every(R=>R.matches(wn))&&ne.has(`body-${P.dataset.slot}`)){G.addText(L.flatMap(R=>Ne(R,{pt:S,rtl:a,lang:e.lang})),{placeholder:`body-${P.dataset.slot}`,valign:A(P),...Sn(P)}),l.placeholders++;continue}for(let R of L){let X=y(R);R.matches(wn)?G.addText(Ne(R,{pt:S,rtl:a,lang:e.lang}),{...x(R),valign:"top",margin:0,...Sn(P)}):R.matches("pre")?G.addText(R.textContent?.replace(/\n$/,"")??"",{...X,fontFace:"Consolas",fontSize:S(parseFloat(getComputedStyle(R).fontSize)),color:H(getComputedStyle(R).color),fill:{color:H(getComputedStyle(R).backgroundColor)},valign:"top",margin:6,rtlMode:!1,align:"left"}):R.matches(".deck-table")?($n(G,R,X,{pt:S,rtl:a,lang:e.lang}),l.tables++):R.matches(".deck-mindmap")?(await pr(r,G,R,y,{pt:S,rtl:a,lang:e.lang},C),l.maps++):R.matches(".deck-figure")?(await dr(r,G,R,y,{pt:S,rtl:a,lang:e.lang},C),l.figures++):await C(R,X)}}let ye=e.deck.slides[u]?.notes;ye&&G.addNotes(ye);let we=e.deck.slides[u]?.settings??{};o.push(String(we.transition??e.deck.settings.transition??"none").split("|")[0].trim())}let d=await n.loadAsync(await r.write({outputType:"arraybuffer",compression:!0}));for(let[u,f]of o.entries()){let m=`ppt/slides/slide${u+1}.xml`,k=await d.file(m)?.async("string");!k||f==="none"||d.file(m,k.replace(/<\/p:clrMapOvr>|(?=<p:timing|<\/p:sld>)/,y=>`${y}${fr(f,a)}`))}let h=await d.file("ppt/theme/theme1.xml")?.async("string");if(h){let u=k=>H(s.getPropertyValue(`--deck-${k}`).trim()),f=[u("fill"),...[2,3,4,5,6].map(k=>u(`series-${k}`))],m=`<a:clrScheme name="Deck"><a:dk1><a:srgbClr val="${u("ink")}"/></a:dk1><a:lt1><a:srgbClr val="${u("paper")}"/></a:lt1><a:dk2><a:srgbClr val="${u("ink")}"/></a:dk2><a:lt2><a:srgbClr val="${u("soft")}"/></a:lt2>${f.map((k,y)=>`<a:accent${y+1}><a:srgbClr val="${k}"/></a:accent${y+1}>`).join("")}<a:hlink><a:srgbClr val="${u("primary")}"/></a:hlink><a:folHlink><a:srgbClr val="${u("primary")}"/></a:folHlink></a:clrScheme>`;d.file("ppt/theme/theme1.xml",h.replace(/<a:clrScheme[\s\S]*?<\/a:clrScheme>/,m))}return{blob:await d.generateAsync({type:"blob",compression:"DEFLATE",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}),report:l}}async function pr(e,t,n,r,s,i){let l=n.querySelector(".deck-map-plane"),a=n.querySelector(".deck-map-lines"),c=l.getBoundingClientRect().width/(l.offsetWidth||1),p=r(a),o=Number(a.getAttribute("viewBox")?.split(" ")[2])||1,d=p.w/o;for(let g of a.querySelectorAll("path")){let[u,f,,,,,m,k]=(g.getAttribute("d")?.match(/-?[\d.]+/g)??[]).map((S,v)=>(v%2?p.y:p.x)+Number(S)*d),y=Math.min(u,m),x=Math.min(f,k),C=(u+m)/2-y,A=getComputedStyle(g);t.addShape(e.shapes.CUSTOM_GEOMETRY,{x:y,y:x,w:Math.max(.01,Math.abs(m-u)),h:Math.max(.01,Math.abs(k-f)),line:{color:H(A.stroke),width:Math.round(parseFloat(A.strokeWidth)*d*72*10)/10},points:[{x:u-y,y:f-x},{x:m-y,y:k-x,curve:{type:"cubic",x1:C,y1:f-x,x2:C,y2:k-x}}]})}let h={...s,pt:g=>s.pt(g*c)};for(let g of n.querySelectorAll(".deck-map-node")){let u=getComputedStyle(g),f=r(g),m=u.textAlign==="left"||u.textAlign==="right"?u.textAlign:u.textAlign==="center"?"center":s.rtl?"right":"left",k=g.matches(".has-block")?g.querySelector(".deck-map-words"):g,y=k?Ne(k,h).map(N=>({...N,options:{...N.options,align:m}})):[],x=parseFloat(u.borderTopWidth)||0,C=h.pt(parseFloat(u.paddingInlineStart)||0)/72,A=be(u.backgroundColor)>0?{color:H(u.backgroundColor),transparency:Math.round((1-be(u.backgroundColor))*100)}:void 0,S=A||x?f.w*.04:f.w*.08,v=m==="left"?f.x:m==="right"?f.x-S:f.x-S/2;if(t.addText(k===g&&y.length?y:"",{x:v,y:f.y,w:f.w+S,h:f.h,margin:[C*72,C*72,0,0],valign:"middle",align:m,wrap:!0,...A||x?{shape:e.shapes.ROUNDED_RECTANGLE,rectRadius:Math.min(f.h/2,h.pt(parseFloat(u.borderTopLeftRadius)||0)/72),fill:A}:{},...x?{line:{color:H(u.borderTopColor),width:Math.round(h.pt(x)*10)/10}}:{}}),k!==g){k&&t.addText(y,{...r(k),margin:0,valign:"middle",align:"center",wrap:!0});for(let N of g.querySelectorAll(".deck-block"))await i(N,r(N))}}}async function dr(e,t,n,r,s,i){let l=c=>s.pt(c)/72,a=c=>parseInt(getComputedStyle(c).zIndex,10)||0;for(let c of[...n.querySelectorAll(".deck-shape")].sort((p,o)=>a(p)-a(o))){let p=getComputedStyle(c),o=r(c),d=c.getBoundingClientRect(),h=be(p.backgroundColor)>0?{color:H(p.backgroundColor),transparency:Math.round((1-be(p.backgroundColor))*100)}:void 0,g=["Top","Right","Bottom","Left"].map(k=>({side:k,width:parseFloat(p[`border${k}Width`])||0,colour:p[`border${k}Color`]})).map(k=>({...k,width:be(k.colour)>0?k.width:0})),u=g.every(k=>Math.abs(k.width-g[0].width)<.1),f=u&&g[0].width>0?{color:H(g[0].colour),width:Math.round(s.pt(g[0].width)*10)/10}:{type:"none"},m=/^polygon\((.*)\)$/.exec(p.clipPath)?.[1];if(m&&(h||u&&g[0].width)){let k=(x,C)=>[...x.replace(/^calc\(|\)$/g,"").matchAll(/([+-]?)\s*([\d.]+)(%|px)?/g)].reduce((A,[,S,v,N])=>A+(S==="-"?-1:1)*(N==="%"?Number(v)/100*C:l(Number(v))),0),y=m.split(/,(?![^(]*\))/).map(x=>x.trim().match(/calc\([^)]*\)|[-\d.]+(?:%|px)?/g)??[]).map(([x="0",C="0"])=>({x:k(x,o.w),y:k(C,o.h)}));t.addShape(e.shapes.CUSTOM_GEOMETRY,{...o,fill:h,line:f,points:[...y,{close:!0}]})}else if(h||f.width){let k=p.borderTopLeftRadius.endsWith("%")?Math.min(d.width,d.height)*parseFloat(p.borderTopLeftRadius)/100:parseFloat(p.borderTopLeftRadius)||0,x=k>=Math.min(d.width,d.height)/2-.5&&Math.abs(d.width-d.height)<1?e.shapes.OVAL:k>0?e.shapes.ROUNDED_RECTANGLE:e.shapes.RECTANGLE;t.addShape(x,{...o,fill:h,line:f,...x===e.shapes.ROUNDED_RECTANGLE?{rectRadius:Math.min(o.h/2,o.w/2,l(k))}:{}})}if(!u)for(let{side:k,width:y,colour:x}of g){if(!y)continue;let C=l(y),A={Top:{x:o.x,y:o.y+C/2,w:o.w,h:0},Bottom:{x:o.x,y:o.y+o.h-C/2,w:o.w,h:0},Left:{x:o.x+C/2,y:o.y,w:0,h:o.h},Right:{x:o.x+o.w-C/2,y:o.y,w:0,h:o.h}}[k];t.addShape(e.shapes.LINE,{...A,line:{color:H(x),width:Math.round(s.pt(y)*10)/10}})}}for(let c of n.querySelectorAll(".deck-words")){if(c.parentElement?.closest(".deck-words")||!c.textContent?.trim())continue;let p=getComputedStyle(c),o=r(c),d=p.textAlign==="center"?"center":p.textAlign==="left"||p.textAlign==="right"?p.textAlign:p.textAlign==="end"!==s.rtl?"right":"left",h=o.w*.08,g=d==="left"?o.x:d==="right"?o.x-h:o.x-h/2;t.addText(Ne(c,s).map(u=>({...u,options:{...u.options,align:d}})),{x:g,y:o.y,w:o.w+h,h:o.h,margin:0,valign:c.matches(".deck-shape")?"middle":"top",align:d,wrap:!0})}for(let c of n.querySelectorAll(".deck-table"))$n(t,c,r(c),s);for(let c of n.querySelectorAll(".deck-block"))await i(c,r(c))}function Sn(e){let t=e.firstElementChild,n=t?parseFloat(getComputedStyle(t).marginBlockEnd):0;return{paraSpaceAfter:Math.round(n*.5)}}function Ne(e,t){let n=[],r=(i,l)=>{let a=getComputedStyle(i),c={fontSize:t.pt(parseFloat(a.fontSize)),color:H(a.color),bold:Number(a.fontWeight)>=600,lang:t.lang,rtlMode:t.rtl,align:a.textAlign==="center"?"center":t.rtl?"right":"left",...l},p=ur(i,c);p.length&&(p[p.length-1].options.breakLine=!0,n.push(...p))},s=(i,l)=>{let a=0;for(let c of i.children){a++;let p=[...c.children].filter(d=>d.matches("ul, ol")),o=c.cloneNode(!0);for(let d of[...o.children])d.matches("ul, ol, input")&&d.remove();c.after(o),r(o,{bullet:i.tagName==="OL"?{type:"number",startAt:a===1?Number(i.getAttribute("start")??1):void 0}:!0,indentLevel:l}),o.remove();for(let d of p)s(d,l+1)}};if(e.matches("ul, ol"))s(e,0);else if(e.matches("blockquote"))for(let i of e.children)r(i,{italic:getComputedStyle(i).fontStyle==="italic"});else r(e,{});return n}function ur(e,t){let n=[],r=(s,i)=>{if(s.nodeType===Node.TEXT_NODE){let a=(s.textContent??"").replace(/\s+/g," ");a&&n.push({text:a,options:{...i}});return}if(!(s instanceof HTMLElement))return;if(s.tagName==="BR"){n.length&&(n[n.length-1].options.breakLine=!0);return}let l={...i};s.matches("strong, b")&&(l.bold=!0,l.color=H(getComputedStyle(s).color)),s.matches("em, i")&&(l.italic=!0),s.matches("del, s")&&(l.strike="sngStrike"),s.matches("code")&&(l.fontFace="Consolas"),s.matches("a[href]")&&(l.hyperlink={url:s.getAttribute("href")});for(let a of s.childNodes)r(a,l)};for(let s of e.childNodes)r(s,t);return n.length&&(n[0].text=n[0].text.trimStart(),n[n.length-1].text=n[n.length-1].text.trimEnd()),n.filter(s=>s.text)}function $n(e,t,n,r){let s=[...t.querySelectorAll("tr")].map(a=>[...a.children].map(c=>{let p=getComputedStyle(c),o=c.getAttribute("data-align");return{text:c.textContent?.trim()??"",options:{bold:c.tagName==="TH",fontSize:r.pt(parseFloat(p.fontSize)),color:H(p.color),lang:r.lang,rtlMode:r.rtl,align:o==="center"?"center":o==="right"!==r.rtl?"right":"left",border:[{type:"none"},{type:"none"},{type:"solid",pt:c.tagName==="TH"?1.5:.75,color:H(p.borderBlockEndColor)},{type:"none"}]}}})),i=[...t.querySelector("tr")?.children??[]].map(a=>a.getBoundingClientRect().width),l=i.reduce((a,c)=>a+c,0)||1;e.addTable(r.rtl?s.map(a=>a.reverse()):s,{...n,colW:(r.rtl?i.reverse():i).map(a=>a/l*n.w),margin:.06})}function hr(e,t,n,r,s){let i=n.getOption(),l=i.series??[];if(!l.length)return!1;let a=new Set(l.map(d=>d.type)),c=(i.color??[]).map(H),p=d=>Array.isArray(d)?Number(d.at(-1)):Number(typeof d=="object"&&d!==null?d.value:d),o={...r,showLegend:l.length>1||a.has("pie"),legendPos:"b",legendFontSize:12,legendColor:s.ink,chartColors:c,showTitle:!!i.title?.[0]?.text,title:i.title?.[0]?.text,titleFontSize:16,titleColor:s.ink,catAxisLabelColor:s.ink,valAxisLabelColor:s.ink,dataLabelColor:s.ink,lang:s.lang};if(a.size===1&&a.has("pie")){let d=l[0],h=Array.isArray(d.radius)&&parseFloat(d.radius[0])>0;return t.addChart(h?e.charts.DOUGHNUT:e.charts.PIE,[{name:d.name??"",labels:d.data.map(g=>g.name),values:d.data.map(p)}],{...o,showPercent:!0,showLegend:!0,holeSize:h?55:void 0}),!0}if([...a].every(d=>d==="bar"||d==="line")){let d=i.yAxis?.[0]?.type==="category",h=(d?i.yAxis:i.xAxis)?.[0]?.data??[],g=m=>[{name:m.name??"",labels:h.map(String),values:m.data.map(p)}],u=m=>m.type==="bar"?e.charts.BAR:m.areaStyle?e.charts.AREA:e.charts.LINE,f={catAxisLabelFontSize:11,valAxisLabelFontSize:11,valGridLine:{color:"D9D9D9",size:.5},catAxisOrientation:s.rtl&&!d?"maxMin":"minMax",valAxisLabelFormatCode:"#,##0"};if(a.size===1){let m=l.flatMap(g);t.addChart(u(l[0]),m,{...o,...f,barDir:d?"bar":"col",barGrouping:l.some(k=>k.stack)?"stacked":"clustered",lineDataSymbol:"circle",lineSize:2})}else t.addChart(l.map(m=>({type:u(m),data:g(m),options:{barDir:d?"bar":"col",chartColors:[c[l.indexOf(m)%c.length]]}})),{...o,...f});return!0}if(a.size===1&&a.has("scatter")){let d=l[0].data.map(h=>Array.isArray(h)?h:[h.value?.[0],h.value?.[1]]);return t.addChart(e.charts.SCATTER,[{name:"X",values:d.map(h=>h[0])},{name:l[0].name??"Y",values:d.map(h=>h[1])}],{...o,lineSize:0,lineDataSymbolSize:8}),!0}if(a.size===1&&a.has("radar")){let d=i.radar?.[0]?.indicator??[];return t.addChart(e.charts.RADAR,l[0].data.map(h=>({name:h.name??"",labels:d.map(g=>g.name),values:h.value})),{...o,showLegend:!0,radarStyle:"standard"}),!0}return!1}function fr(e,t){let n=r=>`<p:transition spd="med"><p:push dir="${r}"/></p:transition>`;return e==="view-transition"||e==="morph"?'<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice xmlns:p159="http://schemas.microsoft.com/office/powerpoint/2015/09/main" Requires="p159"><p:transition spd="slow"><p159:morph option="byObject"/></p:transition></mc:Choice><mc:Fallback><p:transition spd="slow"><p:fade/></p:transition></mc:Fallback></mc:AlternateContent>':e==="slide-left"?n(t?"r":"l"):e==="slide-right"?n(t?"l":"r"):e==="slide-up"?n("u"):e==="slide-down"?n("d"):'<p:transition spd="med"><p:fade/></p:transition>'}async function ze(e,t,n,r=!1,s=""){try{let i=await Promise.all([e].flat().map(async h=>{let g=new Image;return g.crossOrigin="anonymous",g.src=h,await g.decode(),g})),l=i[0],a=document.createElement("canvas");a.width=Math.max(1,Math.round(t)),a.height=Math.max(1,Math.round(n));let c=a.getContext("2d"),p=l.naturalWidth||t,o=l.naturalHeight||n,d=r?Math.max(a.width/p,a.height/o):Math.min(a.width/p,a.height/o);if(!s)c.drawImage(l,(a.width-p*d)/2,(a.height-o*d)/2,p*d,o*d);else{c.fillStyle=s,c.fillRect(0,0,a.width,a.height);for(let h of i)c.drawImage(h,0,0,a.width,a.height)}return a.toDataURL(s?"image/jpeg":"image/png",.9)}catch{return null}}var Ct=new Map;function An(e,t){return Ct.has(e)||Ct.set(e,new Promise((n,r)=>{let s=document.createElement("script");s.src=e,s.onload=()=>n(globalThis[t]),s.onerror=r,document.head.append(s)})),Ct.get(e)}var vt=(e,t,n,r)=>/node_modules\/$/.test(e)?`${e}${t}/${r}`:`${e}${t}@${n}/${r}`;function gr({base:e,root:t,versions:n={}}){let{echarts:r="6.1.0",pele:s="1.10.0"}=n,i=new Set,l=new Set,a=null;t.addEventListener("deck-scheme",o=>{a=o.detail.colours;for(let d of i)d.chart.setOption(p(d.option,d.box),!0);for(let d of l)d.picture.src=c(d.svg)});let c=o=>{let d=getComputedStyle(t).getPropertyValue("--deck-body")||"system-ui, sans-serif",h=Array.from({length:8},(u,f)=>`--pele-series-${f+1}:${a?.series?.[f%(a?.series?.length||1)]}`).join(";"),g=`--pele-bg:transparent;--pele-fg:${a?.ink};--pele-muted:${a?.muted};--pele-line:${a?.muted};--pele-surface:${a?.soft};--pele-surface-alt:${a?.line};--pele-border:${a?.primary};--pele-accent:${a?.primary};${h};--pele-font:${d.replace(/[<>"]/g,"")}`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(o.replace(/^(<svg\b[^>]*>)/,`$1<style>svg{${g}}</style>`))}`},p=(o,d)=>{let h=parseFloat(getComputedStyle(d).fontSize)||16,g=getComputedStyle(d).direction==="rtl",u=Math.round(h*.6),f=(m,k)=>m===void 0?void 0:[m].flat().map(y=>({axisLabel:{color:a?.muted,fontSize:u},axisLine:{lineStyle:{color:a?.line}},splitLine:{lineStyle:{color:a?.line}},nameTextStyle:{color:a?.muted,fontSize:u},...g&&k&&y.type==="category"?{inverse:!0}:{},...g&&!k?{position:"right"}:{},...y}));return{color:a?.series,backgroundColor:"transparent",animation:!matchMedia("(prefers-reduced-motion: reduce)").matches,textStyle:{fontFamily:getComputedStyle(t).getPropertyValue("--deck-body")||"system-ui",color:a?.ink,fontSize:u},...o,title:o.title?{...o.title,textStyle:{color:a?.ink,fontSize:Math.round(h*.8),...o.title?.textStyle}}:void 0,legend:o.legend?{itemWidth:u*1.6,itemHeight:u,...o.legend,textStyle:{color:a?.ink,fontSize:u,...o.legend?.textStyle}}:void 0,grid:{containLabel:!0,left:u,right:u,top:o.title?h*1.8:u,bottom:o.legend?h*1.6:u,...o.grid},xAxis:f(o.xAxis,!0),yAxis:f(o.yAxis,!1),toolbox:void 0,series:[o.series??[]].flat().map(m=>m.type==="pie"?{label:{color:a?.ink,fontSize:u},...m}:m)}};return{async echarts(o,d){let h=JSON.parse(d),g=await An(vt(e,"echarts",r,"dist/echarts.min.js"),"echarts"),u=document.createElement("div");u.className="deck-chart",u.setAttribute("role","img"),u.setAttribute("aria-label",String(h.title?.text??"")),o.append(u);let f=g.init(u,null,{renderer:"svg",locale:document.documentElement.lang?.startsWith("ja")?"JA":"EN"}),m={chart:f,option:h,box:o};i.add(m),f.setOption(p(h,o)),new ResizeObserver(()=>{f.resize(),f.setOption(p(h,o),!0)}).observe(u),Object.assign(o,{chart:f})},async mermaid(o,d,h={}){let g=await An(vt(e,"pele",s,"dist/pele.global.js"),"pele"),u=getComputedStyle(t).getPropertyValue("--deck-body")||"system-ui, sans-serif",{scale:f,theme:m,...k}=h,{svg:y}=g.render(d,{fontFamily:u,links:!1,images:!1,autoDirection:!0,maxWidth:Math.max(320,o.clientWidth*1.4),...Object.keys(k).length&&{config:k}}),x=document.createElement("img");x.alt=d,x.src=c(y);let C=Number(f);if(C>0&&C<1)for(let S of["max-inline-size","max-block-size"])x.style.setProperty(S,`${C*100}%`);l.add({picture:x,svg:y});let A=document.createElement("div");A.className="deck-diagram",A.append(x),o.append(A)}}}var Cn=/^(\s*(?:image|background|backgroundImage)\s*:\s*)(['"]?)([^'"\n#]+?)\2(\s*(?:#.*)?)$/gm,vn=/(!\[[^\]\n]*\]\()(<[^>\n]+>|[^\s)\n]+)((?:\s+(?:"[^"\n]*"|'[^'\n]*'))?\))/g,mr=e=>/^data:/i.test(e),kr=e=>/^(https?:)?\/\//i.test(e);function xr(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}async function br(e,t,{web:n=!1,largest:r=8*1024*1024}={}){let s=new Map,i=[...e.matchAll(vn)].map(d=>d[2].replace(/^<|>$/g,"")).concat([...e.matchAll(Cn)].map(d=>d[3].trim())),l=[],a=[],c=[];for(let d of new Set(i)){if(mr(d)||kr(d)&&!n||/^(#|mailto:|javascript:)/i.test(d))continue;let h=await t(d).catch(()=>null);if(!h||!/^image\/(png|jpeg|gif|webp|avif|svg\+xml)$/.test(h.type)){a.push(d),s.set(d,null);continue}if(h.bytes.length>r){c.push(d),s.set(d,null);continue}s.set(d,`data:${h.type};base64,${xr(h.bytes)}`),l.push(d)}let p=d=>s.get(d)??null;return{source:e.replace(vn,(d,h,g,u)=>{let f=p(g.replace(/^<|>$/g,""));return f?`${h}${f}${u}`:d}).replace(Cn,(d,h,g,u,f)=>{let m=p(u.trim());return m?`${h}${g}${m}${g}${f}`:d}),inlined:l,missing:a,kept:c}}var yr=/^(`{3,}|~{3,})[ \t]*(deck|slidev|markdown|md)?[ \t]*$/,wr="layout|transition|class|image|background|clicks|title|level|hide|zoom|theme|colorSchema|lang|themeConfig|paginate|alt";function Sr(e){let t=e.replace(/\r\n?/g,`
|
|
105
111
|
`).split(`
|
|
106
|
-
`),n=[];for(let
|
|
107
|
-
`),
|
|
108
|
-
$1---`),
|
|
112
|
+
`),n=[];for(let c=0;c<t.length;c++){let p=yr.exec(t[c]);if(!p)continue;let o=p[1],d=c+1,h=!1,g=[];for(;d<t.length;d++){let u=t[d].trimEnd();if(!h&&u===o)break;/^(`{3,}|~{3,})\s*\S/.test(u)&&!h?h=!0:h&&/^(`{3,}|~{3,})\s*$/.test(u)&&(h=!1),g.push(t[d])}n.push({tag:p[2]??"",body:g}),c=d}let r=n.find(c=>c.tag==="deck")??n.find(c=>c.body.filter(p=>/^---\s*$/.test(p)).length>=2);if(!r)return null;let s=[];r.tag!=="deck"&&s.push(`fenced as ${r.tag||"nothing"}`);let i=r.body.join(`
|
|
113
|
+
`),l=(c,p,o)=>{let d=i.replace(p,o);d!==i&&(s.push(c),i=d)};l("settings after an empty line",new RegExp(`^---[ \\t]*\\n\\s*\\n((?:(?:${wr})\\s*:.*\\n(?:[ \\t]+\\S.*\\n)*)+)---[ \\t]*$`,"gm"),`---
|
|
114
|
+
$1---`),l("steps without empty lines",/^[ \t]*(<\/?v-clicks?>)[ \t]*$/gm,`
|
|
109
115
|
$1
|
|
110
|
-
`);let
|
|
111
|
-
${
|
|
116
|
+
`);let a=i.replace(/^```json[ \t]*\n([\s\S]*?)^```/gm,(c,p)=>p.includes('"series"')?`\`\`\`echarts
|
|
117
|
+
${p}\`\`\``:c);return a!==i&&(s.push("a chart fenced as json"),i=a),l("words after a slot marker",/^::([\w-]+)::[ \t]+(\S.*)$/gm,`::$1::
|
|
112
118
|
|
|
113
|
-
$2`),{source:i,mended:
|
|
119
|
+
$2`),{source:i,mended:s}}export{Se as CORNERS,it as LOOKS,Be as STANDARD,et as VERSION,fe as contrast,sr as createDeck,Sr as deckIn,gr as defaultBlocks,xn as escape,It as inferLayout,br as inlinePictures,st as labelOf,nt as layoutOf,vt as libraryAt,_t as logoOf,St as markdownOf,He as mergeKits,De as parseDeck,lr as readDeckFile,Ve as readable,Ge as renderSlide,yn as rendererUrl,K as rgbOf,ct as schemeOf,cr as toPptx,jt as tokensFrom,ot as tokensOf,bn as unescape,or as writeDeckFile};
|
|
114
120
|
//# sourceMappingURL=deck.bundle.mjs.map
|