Files
deno/assets/slidev/md-B6RFtVdw.js
T

2 lines
2.8 KiB
JavaScript

import{d as v,L as T,O as $,b as A,o as S,F as z,aJ as I,h as o,e as k,aK as f,aL as V,ah as L,aM as M,w as g,g as D,ad as E,v as F,x as G,T as x}from"../modules/vue-B5Z8nqrj.js";import{ai as P,aj as j,ak as J,C as K}from"../index-rf-F2tFP.js";import{u as C,f as O}from"./context-4Zmiv8Pf.js";import{I as R}from"./center-DAJrXehz.js";import"../modules/shiki-CcvRnmUC.js";const U=v({__name:"VClickGap",props:{size:{type:[String,Number],default:1}},setup(a){const l=a,{$clicksContext:i}=C(),t=P();let s=+l.size;return Number.isNaN(s)&&(console.warn(`[slidev] Invalid size for VClickGap: ${l.size}`),s=1),T(()=>{const d=i.currentOffset+s-1;i.register(t,{max:d,delta:s})}),$(()=>{i.unregister(t)}),(d,c)=>(S(),A(z))}}),b=["ul","ol"],W=v({props:{depth:{type:[Number,String],default:1},every:{type:[Number,String],default:1},at:{type:[Number,String],default:"+1"},hide:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},handleSpecialElements:{type:Boolean,default:!0}},render(){const a=+this.every,l=j(this.at),i=typeof l=="string";let t=this.$slots.default?.();if(l==null||!t)return t;const s=I("click"),d=(n,e)=>L(n,[[s,e,"",{hide:this.hide,fade:this.fade}]]),c=n=>n.flatMap(e=>f(e)&&typeof e.type=="symbol"&&Array.isArray(e.children)?c(e.children):[e]);t=c(J(t));const w=(n,e=1)=>c(n).map(r=>{if(!f(r))return r;if(b.includes(r.type)&&Array.isArray(r.children)){const u=p(r.children,e+1);return o(r,{},u)}return o(r)});let N=1,h=0;const p=(n,e=1)=>c(n).map(r=>{if(!f(r)||r.type===V)return r;const u=+l+Math.ceil(N++/a)-1;let y;e<+this.depth&&Array.isArray(r.children)?y=o(r,{},w(r.children,e)):y=o(r);const _=u-h;return h=u,d(y,i?_>=0?`+${_}`:`${_}`:u)}),m=()=>k(U,{size:+l+Math.ceil((N-1)/a)-1-h});if(this.handleSpecialElements){if(t.length===1&&b.includes(t[0].type)&&Array.isArray(t[0].children))return o(t[0],{},[...p(t[0].children),m()]);if(t.length===1&&t[0].type==="table"){const n=t[0];if(Array.isArray(n.children))return o(n,{},n.children.map(e=>f(e)?e.type==="tbody"&&Array.isArray(e.children)?o(e,{},[...p(e.children),m()]):o(e):e))}}return[...p(t),m()]}}),X=v({props:{at:{type:[Number,String],default:"+1"},hide:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},wrapText:{type:Function,default:a=>o("span",a)}},render(){return o(W,{every:K,at:this.at,hide:this.hide,fade:this.fade,handleSpecialElements:!1},{default:()=>this.$slots.default?.().map(a=>a.type===M?this.wrapText(a):a)})}}),ee={__name:"slides.md__slidev_2",setup(a){const{$clicksContext:l,$frontmatter:i}=C();return l.setup(),(t,s)=>{const d=X;return S(),A(R,F(G(x(O)(x(i),1))),{default:g(()=>[s[1]||(s[1]=D("h1",null,"What is Deno?",-1)),k(d,null,{default:g(()=>s[0]||(s[0]=[E(" Deno is the open-source JavaScript runtime for the modern web. Built on web standards with zero-config TypeScript, unmatched security, and a complete built-in toolchain. ",-1)])),_:1,__:[0]})]),_:1,__:[1]},16)}}};export{ee as default};