PageSourceSearch

https://data-loaders.netlify.app/assets/index-MwFKID_k.js

js data-loaders.netlify.app collected 2026-10-03 10:37:52 UTC 146,953 bytes, 245 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/md-DZY-nDTi.js","assets/modules/unplugin-icons-CbalBj52.js","assets/modules/vue-DJ0xH0Ky.js","assets/cover.vue_vue_type_script_setup_true_lang-CJootE6y.js","assets/slidev/context-w8aqc37Z.js","assets/modules/shiki-B8V5Spyo.js","assets/modules/shiki-BPvBenZD.css","assets/md-Bdszeg7m.js","assets/md-Db3JddnY.js","assets/slidev/VClicks-uoJRVFAw.js","assets/ShikiMagicMove.vue_vue_type_style_index_0_lang-WOt4CD7T.js","assets/modules/file-saver-LUhfcczZ.js","assets/ShikiMagicMove-ejARpPOy.css","assets/two-cols.vue_vue_type_script_setup_true_lang-D_92Gssf.js","assets/md-C6FEL42g.js","assets/slidev/CodeBlockWrapper.vue_vue_type_script_setup_true_lang-Y-4zE2uY.js","assets/md-BP5qkkxU.js","assets/md-CjTQMpLP.js","assets/md-CtkyIHKA.js","assets/md-D2wEOyJj.js","assets/md-1ANEOSgB.js","assets/md-CDwI_kNJ.js","assets/md-BZkt1utF.js","assets/default-Capo6uxf.js","assets/md-CuwVI_oR.js","assets/md-BKVr-Etl.js","assets/md-2f_Z9Wps.js","assets/md-CTFP4P7b.js","assets/demo-iframe.vue_vue_type_script_setup_true_lang-CIFmwd1W.js","assets/md-2wYxC8qT.js","assets/md-B1DILMYX.js","assets/md-CebTIFpT.js","assets/md-DFFSbsFn.js","assets/md-Cew5HIrL.js","assets/slidev/md-BioioVWu.js","assets/md-CCVBoHs6.js","assets/md-C72F7ELN.js","assets/pinia-colada-CIaweJSP.js","assets/md-DUbMR2GK.js","assets/md-uoexegF-.js","assets/md-B5R-IqNf.js","assets/md-BWk4OrR2.js","assets/md-BZ-UcpN5.css","assets/slidev/md-QkZpSGzI.js","assets/md-DE_oC8uO.js","assets/slidev/entry-BRtIsPaM.js","assets/entry-BeKxshec.css","assets/slidev/overview-O8Whz400.js","assets/slidev/DrawingPreview.vue_vue_type_script_setup_true_lang-Db8ug7nA.js","assets/DrawingPreview-CqGSAbqm.css","assets/slidev/IconButton.vue_vue_type_script_setup_true_lang-CV_ARxRs.js","assets/slidev/ClicksSlider-B4xDbfvI.js","assets/ClicksSlider-DzoTuZMX.css","assets/slidev/notes-CsL50E1e.js","assets/slidev/presenter-GNZCUBNM.js","assets/slidev/useWakeLock-DCaS7W6M.js","assets/useWakeLock-D4BKnOhA.css","assets/slidev/DrawingControls.vue_vue_type_style_index_0_lang-DTYt1-nl.js","assets/DrawingControls-C5T1oZL5.css","assets/presenter-DwqI_5b5.css","assets/slidev/play-CWKASmEx.js","assets/play-CoA43pdi.css","assets/slidev/404-CgGEBI5v.js","assets/404-DINzKjZq.css"])))=>i.map(i=>d[i]);
2import{A as b,n as Us,B as jo,C as An,D as Ks,t as I,E as nt,G as ee,H as xo,I as Fo,J as Vo,K as Gs,L,M as Wo,N as Bo,O as Ut,P as Js,Q as O,R as zo,o as Dt,b as pn,d as Qs,F as qo,e as Kn,g as Uo,S as Cn,T as Ko,U as Ys,V as Go,W as Jo,X as te,Y as Zs,Z as Kt,r as Qo,c as Yo,_ as Zo,$ as Xo,a0 as ea,a1 as ta,a2 as na,a3 as sa,a4 as oa,a5 as aa,a6 as ra,a7 as ia,a8 as la,a9 as ca,aa as ua,u as da}from"./modules/vue-DJ0xH0Ky.js";import{T as fa}from"./modules/shiki-B8V5Spyo.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const r of a.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();function gn(t,e,n){return Math.min(n,Math.max(e,t))}function ha(...t){return ga(t).reduce((e,n)=>e+n,0)}function pa(t){return t=t??[],Array.isArray(t)?t:[t]}function ga(t){return pa(t).flat(1)}function ma(t){return Array.from(new Set(t))}function Gn(...t){let e,n,s;t.length===1?(e=0,s=1,[n]=t):[e,n,s=1]=t;const o=[];let a=e;for(;a<n;)o.push(a),a+=s||1;return o}function ya(t){return t!=null}function va(t,e){return Object.fromEntries(Object.entries(t).map(([n,s])=>e(n,s)).filter(ya))}function Sc(t,e){return new Promise(n=>setTimeout(async()=>{await void 0,n()},t))}const H={theme:"@posva/slidev-theme",title:"Data Loaders | Elevating Data Fetching in Vue",titleTemplate:"%s - Slidev",addons:[],remoteAssets:!1,monaco:!0,monacoTypesSource:"local",monacoTypesAdditionalPackages:[],monacoTypesIgnorePackages:[],monacoRunAdditionalDeps:[],download:!1,export:{},info:`<h2>Data Loaders</h2>
3<p>Elevating Data Fetching in Vue</p>
4<p>Copyright 2024-present Eduardo San Martin Morote</p>
5`,highlighter:"shiki",twoslash:!0,lineNumbers:!1,colorSchema:"auto",routerMode:"history",aspectRatio:1.7777777777777777,canvasWidth:980,exportFilename:"",selectable:!1,themeConfig:{},fonts:{sans:['"Nanum Gothic"','"PT Serif"',"ui-sans-serif","system-ui","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial",'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:['"UniSans"','"PT Serif"',"ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:['"dm"','"PT Mono"',"ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"],webfonts:["Nanum Gothic","PT Serif","UniSans","dm","PT Mono"],provider:"google",local:["dm","UniSans","Nanum Gothic"],italic:!1,weights:["200","400","600"]},favicon:"https://cdn.jsdelivr.net/gh/slidevjs/slidev/assets/favicon.png",drawings:{enabled:!0,persist:!1,presenterOnly:!1,syncAll:!0},plantUmlServer:"https://www.plantuml.com/plantuml",codeCopy:!0,record:"dev",css:"unocss",presenter:!0,htmlAttrs:{},transition:"view-transition",editor:!0,contextMenu:null,wakeLock:!0,mdc:!0,class:"text-center","transition-duration":"1000ms",slidesTitle:"Data Loaders | Elevating Data Fetching in Vue - Slidev"},Mc="build",Xs=b(()=>H.aspectRatio),ka=b(()=>H.canvasWidth),Tc=b(()=>Math.ceil(ka.value/Xs.value)),wa=b(()=>
5va(H.themeConfig||{},(t,e)=>[`--slidev-theme-${t}`,e])),tn=H.slidesTitle,Pc="/",ba=new Set(["title","titleTemplate","script","style","noscript"]),Pt=new Set(["base","meta","link","style","script","noscript"]),_a=new Set(["title","titleTemplate","templateParams","base","htmlAttrs","bodyAttrs","meta","link","style","script","noscript"]),Sa=new Set(["base","title","titleTemplate","bodyAttrs","htmlAttrs","templateParams"]),eo=new Set(["tagPosition","tagPriority","tagDuplicateStrategy","children","innerHTML","textContent","processTemplateParams"]),Ma=typeof window<"u";function Rt(t){let e=9;for(let n=0;n<t.length;)e=Math.imul(e^t.charCodeAt(n++),9**9);return((e^e>>>9)+65536).toString(16).substring(1,8).toLowerCase()}function mn(t){if(t._h)return t._h;if(t._d)return Rt(t._d);let e=`${t.tag}:${t.textContent||t.innerHTML||""}:`;for(const n in t.props)e+=`${n}:${String(t.props[n])},`;return Rt(e)}function Ta(t,e){return t instanceof Promise?t.then(e):e(t)}function yn(t,e,n,s){const o=s||no(typeof e=="object"&&typeof e!="function"&&!(e instanceof Promise)?{...e}:{[t==="script"||t==="noscript"||t==="style"?"innerHTML":"textContent"]:e},t==="templateParams"||t==="titleTemplate");if(o instanceof Promise)return o.then(r=>yn(t,e,n,r));const a={tag:t,props:o};for(const r of eo){const i=a.props[r]!==void 0?a.props[r]:n[r];i!==void 0&&((!(r==="innerHTML"||r==="textContent"||r==="children")||ba.has(a.tag))&&(a[r==="children"?"innerHTML":r]=i),delete a.props[r])}return a.props.body&&(a.tagPosition="bodyClose",delete a.props.body),a.tag==="script"&&typeof a.innerHTML=="object"&&(a.innerHTML=JSON.stringify(a.innerHTML),a.props.type=a.props.type||"application/json"),Array.isArray(a.props.content)?a.props.content.map(r=>({...a,props:{...a.props,content:r}})):a}function Pa(t,e){var s;const n=t==="class"?" ":";";return e&&typeof e=="object"&&!Array.isArray(e)&&(e=Object.entries(e).filter(([,o])=>o).map(([o,a])=>t==="style"?`${o}:${a}`:o)),(s=String(Array.isArray(e)?e.join(n):e))==null?void 0:s.split(n).filter(o=>!!o.trim()).join(n)}function to(t,e,n,s){for(let o=s;o<n.length;o+=1){const a=n[o];if(a==="class"||a==="style"){t[a]=Pa(a,t[a]);continue}if(t[a]instanceof Promise)return t[a].then(r=>(t[a]=r,to(t,e,n,o)));if(!e&&!eo.has(a)){const r=String(t[a]),i=a.startsWith("data-");r==="true"||r===""?t[a]=i?"true":!0:t[a]||(i&&r==="false"?t[a]="false":delete t[a])}}}function no(t,e=!1){const n=to(t,e,Object.keys(t),0);return n instanceof Promise?n.then(()=>t):t}const La=10;function so(t,e,n){for(let s=n;s<e.length;s+=1){const o=e[s];if(o instanceof Promise)return o.then(a=>(e[s]=a,so(t,e,s)));Array.isArray(o)?t.push(...o):t.push(o)}}function Oa(t){const e=[],n=t.resolvedInput;for(const o in n){if(!Object.prototype.hasOwnProperty.call(n,o))continue;const a=n[o];if(!(a===void 0||!_a.has(o))){if(Array.isArray(a)){for(const r of a)e.pu
5sh(yn(o,r,t));continue}e.push(yn(o,a,t))}}if(e.length===0)return[];const s=[];return Ta(so(s,e,0),()=>s.map((o,a)=>(o._e=t._i,t.mode&&(o._m=t.mode),o._p=(t._i<<La)+a,o)))}const Jn=new Set(["onload","onerror","onabort","onprogress","onloadstart"]),Qn={base:-10,title:10},Yn={critical:-80,high:-10,low:20};function Nt(t){const e=t.tagPriority;if(typeof e=="number")return e;let n=100;return t.tag==="meta"?t.props["http-equiv"]==="content-security-policy"?n=-30:t.props.charset?n=-20:t.props.name==="viewport"&&(n=-15):t.tag==="link"&&t.props.rel==="preconnect"?n=20:t.tag in Qn&&(n=Qn[t.tag]),e&&e in Yn?n+Yn[e]:n}const $a=[{prefix:"before:",offset:-1},{prefix:"after:",offset:1}],Ea=["name","property","http-equiv"];function oo(t){const{props:e,tag:n}=t;if(Sa.has(n))return n;if(n==="link"&&e.rel==="canonical")return"canonical";if(e.charset)return"charset";if(e.id)return`${n}:id:${e.id}`;for(const s of Ea)if(e[s]!==void 0)return`${n}:${s}:${e[s]}`;return!1}const ue="%separator";function Aa(t,e){var s;let n;if(e==="s"||e==="pageTitle")n=t.pageTitle;else if(e.includes(".")){const o=e.indexOf(".");n=(s=t[e.substring(0,o)])==null?void 0:s[e.substring(o+1)]}else n=t[e];return n!==void 0?(n||"").replace(/"/g,'\\"'):void 0}const Ca=new RegExp(`${ue}(?:\\s*${ue})*`,"g");function wt(t,e,n){if(typeof t!="string"||!t.includes("%"))return t;let s=t;try{s=decodeURI(t)}catch{}const o=s.match(/%\w+(?:\.\w+)?/g);if(!o)return t;const a=t.includes(ue);return t=t.replace(/%\w+(?:\.\w+)?/g,r=>{if(r===ue||!o.includes(r))return r;const i=Aa(e,r.slice(1));return i!==void 0?i:r}).trim(),a&&(t.endsWith(ue)&&(t=t.slice(0,-ue.length)),t.startsWith(ue)&&(t=t.slice(ue.length)),t=t.replace(Ca,n).trim()),t}function Zn(t,e){return t==null?e||null:typeof t=="function"?t(e):t}async function Ia(t,e={}){const n=e.document||t.resolvedOptions.document;if(!n||!t.dirty)return;const s={shouldRender:!0,tags:[]};if(await t.hooks.callHook("dom:beforeRender",s),!!s.shouldRender)return t._domUpdatePromise||(t._domUpdatePromise=new Promise(async o=>{var h;const a=(await t.resolveTags()).map(f=>({tag:f,id:Pt.has(f.tag)?mn(f):f.tag,shouldRender:!0}));let r=t._dom;if(!r){r={elMap:{htmlAttrs:n.documentElement,bodyAttrs:n.body}};const f=new Set;for(const d of["body","head"]){const p=(h=n[d])==null?void 0:h.children;for(const g of p){const m=g.tagName.toLowerCase();if(!Pt.has(m))continue;const y={tag:m,props:await no(g.getAttributeNames().reduce((T,S)=>({...T,[S]:g.getAttribute(S)}),{})),innerHTML:g.innerHTML},v=oo(y);let k=v,_=1;for(;k&&f.has(k);)k=`${v}:${_++}`;k&&(y._d=k,f.add(k)),r.elMap[g.getAttribute("data-hid")||mn(y)]=g}}}r.pendingSideEffects={...r.sideEffects},r.sideEffects={};function i(f,d,p){const g=`${f}:${d}`;r.sideEffects[g]=p,delete r.pendingSideEffects[g]}function l({id:f,$el:d,tag:p}){const g=p.tag.endsWith("Attrs");if(r.elMap[f]=d,g||(p.textContent&&p.textContent!==d.textContent&&(d.textContent=p.textContent),p.innerHTML&&p.innerHTML!==d.innerHTML&&(d.innerHTML=p.innerHTML),i(f,"el",()=>{var m;(m=r.elMap[f])==null||m.remove(),delete r.elMap[f]})),p._eventHandlers)for(const m in p._eventHandlers)Object.prototype.hasOwnProperty.call(p._eventHandlers,m)&&d.getAttribute(`data-${m}`)!==""&&((p.tag==="bodyAttrs"?n.defaultView:d).addEventListener(m.substring(2),p._eventHandlers[m].bind(d)),d.setAttribute(`data-${m}`,""));for(const m in p.props){if(!Object.prototype.hasOwnProperty.call(p.props,m))continue;const y=p.props[m],v=`attr:${m}`;if(m==="class"){if(!y)continue;for(const k of y.split(" "))g&&i(f,`${v}:${k}`,()=>d.classList.remove(k)),!d.classList.contains(k)&&d.classList.add(k)}else if(m==="style"){if(!y)continue;for(const k of y.split(";")){const _=k.indexOf(":"),T=k.substring(0,_).trim(),S=k.substring(_+1).trim();i(f,`${v}:${T}`,()=>{d.style.removeProperty(T)}),d.style.setProperty(T,S)}}else d.getAttribute(m)!==y&&d.setAttribute(m,y===!0?"":String(y)),g&&i(f,v,()=>d.removeAttribute(m))}}const c=[],u={bodyClose:void 0,bodyOpen:void 0,head:void 0};for(const f of a){const{tag:d,shouldRender:p,id:g}=f;if(p){if(d.tag==="title"){n.title=d.textContent;continue}
5f.$el=f.$el||r.elMap[g],f.$el?l(f):Pt.has(d.tag)&&c.push(f)}}for(const f of c){const d=f.tag.tagPosition||"head";f.$el=n.createElement(f.tag.tag),l(f),u[d]=u[d]||n.createDocumentFragment(),u[d].appendChild(f.$el)}for(const f of a)await t.hooks.callHook("dom:renderTag",f,n,i);u.head&&n.head.appendChild(u.head),u.bodyOpen&&n.body.insertBefore(u.bodyOpen,n.body.firstChild),u.bodyClose&&n.body.appendChild(u.bodyClose);for(const f in r.pendingSideEffects)r.pendingSideEffects[f]();t._dom=r,await t.hooks.callHook("dom:rendered",{renders:a}),o()}).finally(()=>{t._domUpdatePromise=void 0,t.dirty=!1})),t._domUpdatePromise}function Da(t,e={}){const n=e.delayFn||(s=>setTimeout(s,10));return t._domDebouncedUpdatePromise=t._domDebouncedUpdatePromise||new Promise(s=>n(()=>Ia(t,e).then(()=>{delete t._domDebouncedUpdatePromise,s()})))}function Ra(t){return e=>{var s,o;const n=((o=(s=e.resolvedOptions.document)==null?void 0:s.head.querySelector('script[id="unhead:payload"]'))==null?void 0:o.innerHTML)||!1;return n&&e.push(JSON.parse(n)),{mode:"client",hooks:{"entries:updated":a=>{Da(a,t)}}}}}function vn(t,e={},n){for(const s in t){const o=t[s],a=n?`${n}:${s}`:s;typeof o=="object"&&o!==null?vn(o,e,a):typeof o=="function"&&(e[a]=o)}return e}const Na={run:t=>t()},Ha=()=>Na,ao=typeof console.createTask<"u"?console.createTask:Ha;function ja(t,e){const n=e.shift(),s=ao(n);return t.reduce((o,a)=>o.then(()=>s.run(()=>a(...e))),Promise.resolve())}function xa(t,e){const n=e.shift(),s=ao(n);return Promise.all(t.map(o=>s.run(()=>o(...e))))}function nn(t,e){for(const n of[...t])n(e)}class Fa{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,n,s={}){if(!e||typeof n!="function")return()=>{};const o=e;let a;for(;this._deprecatedHooks[e];)a=this._deprecatedHooks[e],e=a.to;if(a&&!s.allowDeprecated){let r=a.message;r||(r=`${o} hook has been deprecated`+(a.to?`, please use ${a.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(r)||(console.warn(r),this._deprecatedMessages.add(r))}if(!n.name)try{Object.defineProperty(n,"name",{get:()=>"_"+e.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(n),()=>{n&&(this.removeHook(e,n),n=void 0)}}hookOnce(e,n){let s,o=(...a)=>(typeof s=="function"&&s(),s=void 0,o=void 0,n(...a));return s=this.hook(e,o),s}removeHook(e,n){if(this._hooks[e]){const s=this._hooks[e].indexOf(n);s!==-1&&this._hooks[e].splice(s,1),this._hooks[e].length===0&&delete this._hooks[e]}}deprecateHook(e,n){this._deprecatedHooks[e]=typeof n=="string"?{to:n}:n;const s=this._hooks[e]||[];delete this._hooks[e];for(const o of s)this.hook(e,o)}deprecateHooks(e){Object.assign(this._deprecatedHooks,e);for(const n in e)this.deprecateHook(n,e[n])}addHooks(e){const n=vn(e),s=Object.keys(n).map(o=>this.hook(o,n[o]));return()=>{for(const o of s.splice(0,s.length))o()}}removeHooks(e){const n=vn(e);for(const s in n)this.removeHook(s,n[s])}removeAllHooks(){for(const e in this._hooks)delete this._hooks[e]}callHook(e,...n){return n.unshift(e),this.callHookWith(ja,e,...n)}callHookParallel(e,...n){return n.unshift(e),this.callHookWith(xa,e,...n)}callHookWith(e,n,...s){const o=this._before||this._after?{name:n,args:s,context:{}}:void 0;this._before&&nn(this._before,o);const a=e(n in this._hooks?[...this._hooks[n]]:[],s);return a instanceof Promise?a.finally(()=>{this._after&&o&&nn(this._after,o)}):(this._after&&o&&nn(this._after,o),a)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){const n=this._before.indexOf(e);n!==-1&&this._before.splice(n,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){const n=this._after.indexOf(e);n!==-1&&this._after.splice(n,1)}}}}function Va(){return new Fa}const Wa=new Set(["templateParams","htmlAttrs","bodyAttrs"]),Ba={hooks:{"tag:normalise":({tag:t})=>{t.props.hid&&(t.key=t.props.hid,delete t.props.hid),t.props.vmid&&(t.key=t.props.vmid,delete t.props.vmid),t.props.key&&
5(t.key=t.props.key,delete t.props.key);const e=oo(t);e&&!e.startsWith("meta:og:")&&!e.startsWith("meta:twitter:")&&delete t.key;const n=e||(t.key?`${t.tag}:${t.key}`:!1);n&&(t._d=n)},"tags:resolve":t=>{const e=Object.create(null);for(const s of t.tags){const o=(s.key?`${s.tag}:${s.key}`:s._d)||mn(s),a=e[o];if(a){let i=s==null?void 0:s.tagDuplicateStrategy;if(!i&&Wa.has(s.tag)&&(i="merge"),i==="merge"){const l=a.props;l.style&&s.props.style&&(l.style[l.style.length-1]!==";"&&(l.style+=";"),s.props.style=`${l.style} ${s.props.style}`),l.class&&s.props.class?s.props.class=`${l.class} ${s.props.class}`:l.class&&(s.props.class=l.class),e[o].props={...l,...s.props};continue}else if(s._e===a._e){a._duped=a._duped||[],s._d=`${a._d}:${a._duped.length+1}`,a._duped.push(s);continue}else if(Nt(s)>Nt(a))continue}if(!(s.innerHTML||s.textContent||Object.keys(s.props).length!==0)&&Pt.has(s.tag)){delete e[o];continue}e[o]=s}const n=[];for(const s in e){const o=e[s],a=o._duped;n.push(o),a&&(delete o._duped,n.push(...a))}t.tags=n,t.tags=t.tags.filter(s=>!(s.tag==="meta"&&(s.props.name||s.props.property)&&!s.props.content))}}},za=new Set(["script","link","bodyAttrs"]),qa=t=>({hooks:{"tags:resolve":e=>{for(const n of e.tags){if(!za.has(n.tag))continue;const s=n.props;for(const o in s){if(o[0]!=="o"||o[1]!=="n"||!Object.prototype.hasOwnProperty.call(s,o))continue;const a=s[o];typeof a=="function"&&(t.ssr&&Jn.has(o)?s[o]=`this.dataset.${o}fired = true`:delete s[o],n._eventHandlers=n._eventHandlers||{},n._eventHandlers[o]=a)}t.ssr&&n._eventHandlers&&(n.props.src||n.props.href)&&(n.key=n.key||Rt(n.props.src||n.props.href))}},"dom:renderTag":({$el:e,tag:n})=>{var o,a;const s=e==null?void 0:e.dataset;if(s)for(const r in s){if(!r.endsWith("fired"))continue;const i=r.slice(0,-5);Jn.has(i)&&((a=(o=n._eventHandlers)==null?void 0:o[i])==null||a.call(e,new Event(i.substring(2))))}}}}),Ua=new Set(["link","style","script","noscript"]),Ka={hooks:{"tag:normalise":({tag:t})=>{t.key&&Ua.has(t.tag)&&(t.props["data-hid"]=t._h=Rt(t.key))}}},Ga={mode:"server",hooks:{"tags:beforeResolve":t=>{const e={};let n=!1;for(const s of t.tags)s._m!=="server"||s.tag!=="titleTemplate"&&s.tag!=="templateParams"&&s.tag!=="title"||(e[s.tag]=s.tag==="title"||s.tag==="titleTemplate"?s.textContent:s.props,n=!0);n&&t.tags.push({tag:"script",innerHTML:JSON.stringify(e),props:{id:"unhead:payload",type:"application/json"}})}}},Ja={hooks:{"tags:resolve":t=>{var e;for(const n of t.tags)if(typeof n.tagPriority=="string")for(const{prefix:s,offset:o}of $a){if(!n.tagPriority.startsWith(s))continue;const a=n.tagPriority.substring(s.length),r=(e=t.tags.find(i=>i._d===a))==null?void 0:e._p;if(r!==void 0){n._p=r+o;break}}t.tags.sort((n,s)=>{const o=Nt(n),a=Nt(s);return o<a?-1:o>a?1:n._p-s._p})}}},Qa={meta:"content",link:"href",htmlAttrs:"lang"},Ya=["innerHTML","textContent"],Za=t=>({hooks:{"tags:resolve":e=>{var r;const{tags:n}=e;let s;for(let i=0;i<n.length;i+=1)n[i].tag==="templateParams"&&(s=e.tags.splice(i,1)[0].props,i-=1);const o=s||{},a=o.separator||"|";delete o.separator,o.pageTitle=wt(o.pageTitle||((r=n.find(i=>i.tag==="title"))==null?void 0:r.textContent)||"",o,a);for(const i of n){if(i.processTemplateParams===!1)continue;const l=Qa[i.tag];if(l&&typeof i.props[l]=="string")i.props[l]=wt(i.props[l],o,a);else if(i.processTemplateParams||i.tag==="titleTemplate"||i.tag==="title")for(const c of Ya)typeof i[c]=="string"&&(i[c]=wt(i[c],o,a))}t._templateParams=o,t._separator=a},"tags:afterResolve":({tags:e})=>{let n;for(let s=0;s<e.length;s+=1){const o=e[s];o.tag==="title"&&o.processTemplateParams!==!1&&(n=o)}n!=null&&n.textContent&&(n.textContent=wt(n.textContent,t._templateParams,t._separator))}}}),Xa={hooks:{"tags:resolve":t=>{const{tags:e}=t;let n,s;for(let o=0;o<e.length;o+=1){const a=e[o];a.tag==="title"?n=a:a.tag==="titleTemplate"&&(s=a)}if(s&&n){const o=Zn(s.textContent,n.textContent);o!==null?n.textContent=o||n.textContent:t.tags.splice(t.tags.indexOf(n),1)}else if(s){const o=Zn(s.textContent);o!==null&&(s.textContent=o,s.tag="title",s=void 0)}s&&t.tags.splice(t.tags.indexOf(s),1)}}},er={hooks:{"tags:afterResolve":t=>{for(const e of t.tags)typeof e.innerHTML=="string"&&(e.innerHTML&&(e.props.type==="application/ld+json"||e.props.type==="application/json")?e.innerHTML=e.innerHTML.replace(/</g,"\\u003C"):e.innerHTML=e.innerHTML.replace(new RegExp(`</${e.tag}`,"g"),`<\\/${e.tag}`))}}};let ro;function tr(t={}){const e=nr(t);return e.use(Ra()),ro=e}function Xn(t,e){return!t||t==="server"&&e||t==="client"&&!e}function nr(t={}){const e=Va();e.addHooks(t.hooks||{}),t.document=t.document||(Ma?document:void 0);const n=!t.document,s=()=>{i.dirty=!0,e.callHook("entries:updated",i)};let o=0,a=[];const r=[],i={plugins:r,dirty:!1,resolvedOptions:t,hooks:e,headEntries(){return a},use(l){const c=typeof l=="function"?l(i):l;(!c.key||!r.some(u=>u.key===c.key))&&(r.push(c),Xn(c.mode,n)&&e.addHooks(c.hooks||{}))},push(l,c){c==null||delete c.head;const u={_i:o++,input:l,...c};return Xn(u.mode,n)&&(a.push(u),s()),{dispose(){a=a.filter(h=>h._i!==u._i),s()},patch(h){for(const f of a)f._i===u._i&&(f.input=u.input=h);s()}}},async resolveTags(){const l={tags:[],entries:[...a]};await e.callHook("entries:resolve",l);for(const c of l.entries){const u=c.resolvedInput||c.input;if(c.resolvedInput=await(c.transform?c.transform(u):u),c.resolvedInput)for(const h of await Oa(c)){const f={tag:h,entry:c,resolvedOptions:i.resolvedOptions};await e.callHook("tag:normalise",f),l.tags.push(f.tag)}}return await e.callHook("tags:beforeResolve",l),await e.callHook("tags:resolve",l),await e.callHook("tags:afterResolve",l),l.tags},ssr:n};
5return[Ba,Ga,qa,Ka,Ja,Za,Xa,er,...(t==null?void 0:t.plugins)||[]].forEach(l=>i.use(l)),i.hooks.callHook("init",i),i}function sr(){return ro}const or=jo[0]==="3";function ar(t){return typeof t=="function"?t():An(t)}function Ht(t){if(t instanceof Promise||t instanceof Date||t instanceof RegExp)return t;const e=ar(t);if(!t||!e)return e;if(Array.isArray(e))return e.map(n=>Ht(n));if(typeof e=="object"){const n={};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(s==="titleTemplate"||s[0]==="o"&&s[1]==="n"){n[s]=An(e[s]);continue}n[s]=Ht(e[s])}return n}return e}const rr={hooks:{"entries:resolve":t=>{for(const e of t.entries)e.resolvedInput=Ht(e.input)}}},io="usehead";function ir(t){return{install(n){or&&(n.config.globalProperties.$unhead=t,n.config.globalProperties.$head=t,n.provide(io,t))}}.install}function lr(t={}){t.domDelayFn=t.domDelayFn||(n=>Us(()=>setTimeout(()=>n(),0)));const e=tr(t);return e.use(rr),e.install=ir(e),e}const es=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ts="__unhead_injection_handler__";function cr(){if(ts in es)return es[ts]();const t=Ks(io);return t||sr()}function ur(t,e={}){const n=e.head||cr();if(n)return n.ssr?n.push(t,e):dr(n,t,e)}function dr(t,e,n={}){const s=I(!1),o=I({});nt(()=>{o.value=s.value?{}:Ht(e)});const a=t.push(o.value,n);return ee(o,i=>{a.patch(i)}),Gs()&&(xo(()=>{a.dispose()}),Fo(()=>{s.value=!0}),Vo(()=>{s.value=!1})),a}function lo(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10)}function ne(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1})}const Ge=L({page:0,clicks:0});let fr=[],hr=[];ne(Ge,"$syncUp",!0);ne(Ge,"$syncDown",!0);ne(Ge,"$paused",!1);ne(Ge,"$onSet",t=>fr.push(t));ne(Ge,"$onPatch",t=>hr.push(t));lo();ne(Ge,"$patch",async()=>!1);function co(t,e,n=!1){const s=[];let o=!1,a=!1,r,i;const l=L(e);function c(d){s.push(d)}function u(d,p){l[d]!==p&&(clearTimeout(r),o=!0,l[d]=p,r=setTimeout(()=>o=!1,0))}function h(d){o||(clearTimeout(i),a=!0,Object.entries(d).forEach(([p,g])=>{l[p]=g}),i=setTimeout(()=>a=!1,0))}function f(d){let p;n?n&&window.addEventListener("storage",m=>{m&&m.key===d&&m.newValue&&h(JSON.parse(m.newValue))}):(p=new BroadcastChannel(d),p.addEventListener("message",m=>h(m.data)));function g(){!n&&p&&!a?p.postMessage(Wo(l)):n&&!a&&window.localStorage.setItem(d,JSON.stringify(l)),o||s.forEach(m=>m(l))}if(ee(l,g,{deep:!0,flush:"sync"}),n){const m=window.localStorage.getItem(d);m&&h(JSON.parse(m))}}return{init:f,onPatch:c,patch:u,state:l}}const{init:pr,onPatch:gr,patch:pe,state:Lc}=co(Ge,{page:1,clicks:0,clicksTotal:0,viewerPage:1,viewerClicks:0,viewerClicksTotal:0}),de=L({});let mr=[],yr=[];ne(de,"$syncUp",!0);ne(de,"$syncDown",!0);ne(de,"$paused",!1);ne(de,"$onSet",t=>mr.push(t));ne(de,"$onPatch",t=>yr.push(t));lo();ne(de,"$patch",async()=>!1);const{init:vr,onPatch:Oc,patch:$c,state:Ec}=co(de,de,!1),Gt="$$slidev-clicks-context",In="$$slidev-page",uo="$$slidev-slide-element",kr="$$slidev-slide-scale",wr="$$slidev-context",Ac="$$slidev-route",Dn="$$slidev-render-context",br="$$slidev-fontmatter",_r="$$slidev-slide-zoom",Lt="slidev-vclick-target",lt="slidev-vclick-hidden",ct="slidev-vclick-fade",sn="slidev-vclick-hidden-explicitly",on="slidev-vclick-current",an="slidev-vclick-prior",Ot=999999,Sr=["localhost","127.0.0.1"],Mr=["clicks","clicksStart","disabled","hide","hideInToc","layout","level","preload","routeAlias","src","title","transition","zoom","dragPos"],Cc=[...Mr,"theme","titleTemplate","info","author","keywords","presenter","download","exportFilename","export","highlighter","lineNumbers","monaco","monacoTypesSource","monacoTypesAdditionalPackages","monacoRunAdditionalDeps","remoteAssets","selectable","record","colorSchema","routerMode","aspectRatio","canvasWidth","themeConfig","favicon","plantUmlServer","fonts","defaults","drawings","htmlAttrs","mdc","contextMenu","wakeLock"],Rn=I(!1),Nn=Symbol.for("yaml.alias"),Tr=Symbol.for("yaml.document"),Ke=Symbol.for("yaml.map"),fo=Symbol.for("yaml.pair"),Hn=Symbol.for("yaml.scalar"),vt=Symbol.for("yaml.seq"),le=Symbol.for("yaml.node.type"),ot=t=>!!t&&typeof t=="object"&&t[le]===Nn,Jt=t=>!!t&&typeof t=="object"&&t[le]===Tr,ho=t=>!!t&&typeof t=="object"&&t[le]===Ke,B=t=>!!t&&typeof t=="object"&&t[le]===fo,V=t=>!!t&&typeof t=="object"&&t[le]===Hn,jn=t=>!!t&&typeof t=="object"&&t[le]===vt;function Y(t){if(t&&typeof t=="object")switch(t[le]){case Ke:case vt:return!0}return!1}function U(t){if(t&&typeof t=="object")switch(t[le]){case Nn:case Ke:case Hn:case vt:return!0}return!1}const Pr=t=>(V(t)||Y(t))&&!!t.anchor,ze=Symbol("break visit"),Lr=Symbol("skip children"),ht=Symbol("remove node");function mt(t,e){const n=Or(e);Jt(t)?Ze(null,t.contents,n,Object.freeze([t]))===ht&&(t.contents=null):Ze(null,t,n,Object.freeze([]))}mt.BREAK=ze;mt.SKIP=Lr;mt.REMOVE=ht;function Ze(t,e,n,s){const o=$r(t,e,n,s);if(U(o)||B(o))return Er(t,s,o),Ze(t,o,n,s);if(typeof o!="symbol"){if(Y(e)){s=Object.freeze(s.concat(e));for(let a=0;a<e.items.length;++a){const r=Ze(a,e.items[a],n,s);if(typeof r=="number")a=r-1;else{if(r===ze)return ze;r===ht&&(e.items.splice(a,1),a-=1)}}}else if(B(e)){s=Object.freeze(s.concat(e));const a=Ze("key",e.key,n,s);if(a===ze)return ze;
5a===ht&&(e.key=null);const r=Ze("value",e.value,n,s);if(r===ze)return ze;r===ht&&(e.value=null)}}return o}function Or(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function $r(t,e,n,s){var o,a,r,i,l;if(typeof n=="function")return n(t,e,s);if(ho(e))return(o=n.Map)==null?void 0:o.call(n,t,e,s);if(jn(e))return(a=n.Seq)==null?void 0:a.call(n,t,e,s);if(B(e))return(r=n.Pair)==null?void 0:r.call(n,t,e,s);if(V(e))return(i=n.Scalar)==null?void 0:i.call(n,t,e,s);if(ot(e))return(l=n.Alias)==null?void 0:l.call(n,t,e,s)}function Er(t,e,n){const s=e[e.length-1];if(Y(s))s.items[t]=n;else if(B(s))t==="key"?s.key=n:s.value=n;else if(Jt(s))s.contents=n;else{const o=ot(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}function po(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function ft(t,e,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let o=0,a=s.length;o<a;++o){const r=s[o],i=ft(t,s,String(o),r);i===void 0?delete s[o]:i!==r&&(s[o]=i)}else if(s instanceof Map)for(const o of Array.from(s.keys())){const a=s.get(o),r=ft(t,s,o,a);r===void 0?s.delete(o):r!==a&&s.set(o,r)}else if(s instanceof Set)for(const o of Array.from(s)){const a=ft(t,s,o,o);a===void 0?s.delete(o):a!==o&&(s.delete(o),s.add(a))}else for(const[o,a]of Object.entries(s)){const r=ft(t,s,o,a);r===void 0?delete s[o]:r!==a&&(s[o]=r)}return t.call(e,n,s)}function ae(t,e,n){if(Array.isArray(t))return t.map((s,o)=>ae(s,String(o),n));if(t&&typeof t.toJSON=="function"){if(!n||!Pr(t))return t.toJSON(e,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(t,s),n.onCreate=a=>{s.res=a,delete n.onCreate};const o=t.toJSON(e,n);return n.onCreate&&n.onCreate(o),o}return typeof t=="bigint"&&!(n!=null&&n.keep)?Number(t):t}class xn{constructor(e){Object.defineProperty(this,le,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:s,onAnchor:o,reviver:a}={}){if(!Jt(e))throw new TypeError("A document argument is required");const r={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},i=ae(this,"",r);if(typeof o=="function")for(const{count:l,res:c}of r.anchors.values())o(c,l);return typeof a=="function"?ft(a,{"":i},"",i):i}}class Ar extends xn{constructor(e){super(Nn),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let n;return mt(e,{Node:(s,o)=>
5{if(o===this)return mt.BREAK;o.anchor===this.source&&(n=o)}}),n}toJSON(e,n){if(!n)return{source:this.source};const{anchors:s,doc:o,maxAliasCount:a}=n,r=this.resolve(o);if(!r){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let i=s.get(r);if(i||(ae(r,null,n),i=s.get(r)),!i||i.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(a>=0&&(i.count+=1,i.aliasCount===0&&(i.aliasCount=$t(o,r,s)),i.count*i.aliasCount>a)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return i.res}toString(e,n,s){const o=`*${this.source}`;if(e){if(po(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(e.implicitKey)return`${o} `}return o}}function $t(t,e,n){if(ot(e)){const s=e.resolve(t),o=n&&s&&n.get(s);return o?o.count*o.aliasCount:0}else if(Y(e)){let s=0;for(const o of e.items){const a=$t(t,o,n);a>s&&(s=a)}return s}else if(B(e)){const s=$t(t,e.key,n),o=$t(t,e.value,n);return Math.max(s,o)}return 1}const go=t=>!t||typeof t!="function"&&typeof t!="object";class F extends xn{constructor(e){super(Hn),this.value=e}toJSON(e,n){return n!=null&&n.keep?this.value:ae(this.value,e,n)}toString(){return String(this.value)}}F.BLOCK_FOLDED="BLOCK_FOLDED";F.BLOCK_LITERAL="BLOCK_LITERAL";F.PLAIN="PLAIN";F.QUOTE_DOUBLE="QUOTE_DOUBLE";F.QUOTE_SINGLE="QUOTE_SINGLE";function Cr(t,e,n){return n.find(s=>{var o;return((o=s.identify)==null?void 0:o.call(s,t))&&!s.format})}function jt(t,e,n){var h,f,d;if(Jt(t)&&(t=t.contents),U(t))return t;if(B(t)){const p=(f=(h=n.schema[Ke]).createNode)==null?void 0:f.call(h,n.schema,null,
5n);return p.items.push(t),p}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:s,onAnchor:o,onTagObj:a,schema:r,sourceObjects:i}=n;let l;if(s&&t&&typeof t=="object"){if(l=i.get(t),l)return l.anchor||(l.anchor=o(t)),new Ar(l.anchor);l={anchor:null,node:null},i.set(t,l)}let c=Cr(t,e,r.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const p=new F(t);return l&&(l.node=p),p}c=t instanceof Map?r[Ke]:Symbol.iterator in Object(t)?r[vt]:r[Ke]}a&&(a(c),delete n.onTagObj);const u=c!=null&&c.createNode?c.createNode(n.schema,t,n):typeof((d=c==null?void 0:c.nodeClass)==null?void 0:d.from)=="function"?c.nodeClass.from(n.schema,t,n):new F(t);return c.default||(u.tag=c.tag),l&&(l.node=u),u}function ns(t,e,n){let s=n;for(let o=e.length-1;o>=0;--o){const a=e[o];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const r=[];r[a]=s,s=r}else s=new Map([[a,s]])}return jt(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Ir=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class mo extends xn{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(s=>U(s)||B(s)?s.clone(e):s),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Ir(e))this.add(n);else{const[s,...o]=e,a=this.get(s,!0);if(Y(a))a.addIn(o,n);else if(a===void 0&&this.schema)this.set(s,ns(this.schema,o,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${o}`)}}deleteIn(e){const[n,...s]=e;if(s.length===0)return this.delete(n);const o=this.get(n,!0);if(Y(o))return o.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(e,n){const[s,...o]=e,a=this.get(s,!0);return o.length===0?!n&&V(a)?a.value:a:Y(a)?a.getIn(o,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!B(n))return!1;const s=n.value;return s==null||e&&V(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[n,...s]=e;if(s.length===0)return this.has(n);const o=this.get(n,!0);return Y(o)?o.hasIn(s):!1}setIn(e,n){const[s,...o]=e;if(o.length===0)this.set(s,n);else{const a=this.get(s,!0);if(Y(a))a.setIn(o,n);else if(a===void 0&&this.schema)this.set(s,ns(this.schema,o,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${o}`)}}}const Dr=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function yt(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const Xe=(t,e,n)=>t.endsWith(`
6`)?yt(n,e):n.includes(`
7`)?`
8`+yt(n,e):(t.endsWith(" ")?"":" ")+n,yo="flow",kn="block",Et="quoted";function Qt(t,e,n="flow",{indentAtStart:s,lineWidth:o=80,minContentWidth:a=20,onFold:r,onOverflow:i}={}){if(!o||o<0)return t;o<a&&(a=0);const l=Math.max(1+a,1+o-e.length);if(t.length<=l)return t;const c=[],u={};let h=o-e.length;typeof s=="number"&&(s>o-Math.max(2,a)?c.push(0):h=o-s);let f,d,p=!1,g=-1,m=-1,y=-1;n===kn&&(g=ss(t,g,e.length),g!==-1&&(h=g+l));for(let k;k=t[g+=1];){if(n===Et&&k==="\\"){switch(m=g,t[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if(k===`
9`)n===kn&&(g=ss(t,g,e.length)),h=g+e.length+l,f=void 0;else{if(k===" "&&d&&d!==" "&&d!==`
10`&&d!=="	"){const _=t[g+1];_&&_!==" "&&_!==`
11`&&_!=="	"&&(f=g)}if(g>=h)if(f)c.push(f),h=f+l,f=void 0;else if(n===Et){for(;d===" "||d==="	";)d=k,k=t[g+=1],p=!0;const _=g>y+1?g-2:m-1;if(u[_])return t;c.push(_),u[_]=!0,h=_+l,f=void 0}else p=!0}d=k}if(p&&i&&i(),c.length===0)return t;r&&r();let v=t.slice(0,c[0]);for(let k=0;k<c.length;++k){const _=c[k],T=c[k+1]||t.length;_===0?v=`
12${e}${t.slice(0,T)}`:(n===Et&&u[_]&&(v+=`${t[_]}\\`),v+=`
13${e}${t.slice(_+1,T)}`)}return v}function ss(t,e,n){let s=e,o=e+1,a=t[o];for(;a===" "||a==="	";)if(e<o+n)a=t[++e];else{do a=t[++e];while(a&&a!==`
14`);s=e,o=e+1,a=t[o]}return s}const Yt=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}
14),Zt=t=>/^(%|---|\.\.\.)/m.test(t);function Rr(t,e,n){if(!e||e<0)return!1;const s=e-n,o=t.length;if(o<=s)return!1;for(let a=0,r=0;a<o;++a)if(t[a]===`
15`){if(a-r>s)return!0;if(r=a+1,o-r<=s)return!1}return!0}function pt(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=e,o=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(Zt(t)?"  ":"");let r="",i=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(r+=n.slice(i,l)+"\\ ",l+=1,i=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{r+=n.slice(i,l);const u=n.substr(l+2,4);switch(u){case"0000":r+="\\0";break;case"0007":r+="\\a";break;case"000b":r+="\\v";break;case"001b":r+="\\e";break;case"0085":r+="\\N";break;case"00a0":r+="\\_";break;case"2028":r+="\\L";break;case"2029":r+="\\P";break;default:u.substr(0,2)==="00"?r+="\\x"+u.substr(2):r+=n.substr(l,6)}l+=5,i=l+1}break;case"n":if(s||n[l+2]==='"'||n.length<o)l+=1;else{for(r+=n.slice(i,l)+`
16
17`;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)r+=`
18`,l+=2;r+=a,n[l+2]===" "&&(r+="\\"),l+=1,i=l+1}break;default:l+=1}return r=i?r+n.slice(i):n,s?r:Qt(r,a,Et,Yt(e,!1))}function wn(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19`)||/[ \t]\n|\n[ \t]/.test(t))return pt(t,e);const n=e.indent||(Zt(t)?"  ":""),s="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20${n}`)+"'";return e.implicitKey?s:Qt(s,n,yo,Yt(e,!1))}function et(t,e){const{singleQuote:n}=e.options;let s;if(n===!1)s=pt;else{const o=t.includes('"'),a=t.includes("'");o&&!a?s=wn:a&&!o?s=pt:s=n?wn:pt}return s(t,e)}let bn;try{bn=new RegExp(`(^|(?<!
21))
22+(?!
23|$)`,"g")}catch{bn=/\n+(?!\n|$)/g}function At({comment:t,type:e,value:n},s,o,a){const{blockQuote:r,commentString:i,lineWidth:l}=s.options;if(!r||/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return et(n,s);const c=s.indent||(s.forceBlockIndent||Zt(n)?"  ":""),u=r==="literal"?!0:r==="folded"||e===F.BLOCK_FOLDED?!1:e===F.BLOCK_LITERAL?!0:!Rr(n,l,c.length);if(!n)return u?`|
24`:`>
25`;let h,f;for(f=n.length;f>0;--f){const S=n[f-1];if(S!==`
26`&&S!=="	"&&S!==" ")break}let d=n.substring(f);const p=d.indexOf(`
27`);p===-1?h="-":n===d||p!==d.length-1?(h="+",a&&a()):h="",d&&(n=n.slice(0,-d.length),d[d.length-1]===`
28`&&(d=d.slice(0,-1)),d=d.replace(bn,`$&${c}`));let g=!1,m,y=-1;for(m=0;m<n.length;++m){const S=n[m];if(S===" ")g=!0;else if(S===`
29`)y=m;else break}let v=n.substring(0,y<m?y+1:m);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${c}`));let _=(u?"|":">")+(g?c?"2":"1":"")+h;if(t&&(_+=" "+i(t.replace(/ ?[\r\n]+/g," ")),o&&o()),u)return n=n.replace(/\n+/g,`$&${c}`),`${_}
30${c}${v}${n}${d}`;n=n.replace(/\n+/g,`
31$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);const T=Qt(`${v}${n}${d}`,c,kn,Yt(s,!0));return`${_}
32${c}${T}`}function Nr(t,e,n,s){const{type:o,value:a}=t,{actualString:r,implicitKey:i,indent:l,indentStep:c,inFlow:u}=e;if(i&&a.includes(`
33`)||u&&/[[\]{},]/.test(a))return et(a,e);if(!a||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return i||u||!a.includes(`
34`)?et(a,e):At(t,e,n,s);if(!i&&!u&&o!==F.PLAIN&&a.includes(`
35`))return At(t,e,n,s);if(Zt(a)){if(l==="")return e.forceBlockIndent=!0,At(t,e,n,s);if(i&&l===c)return et(a,e)}const h=a.replace(/\n+/g,`$&
36${l}`);if(r){const f=g=>{var m;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((m=g.test)==null?void 0:m.test(h))},{compat:d,tags:p}=e.doc.schema;if(p.some(f)||d!=null&&d.some(f))return et(a,e)}return i?h:Qt(h,l,yo,Yt(e,!1))}function Hr(t,e,n,s){const{implicitKey:o,inFlow:a}=e,r=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:i}=t;i!==F.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(r.value)&&(i=F.QUOTE_DOUBLE);const l=u=>{switch(u){case F.BLOCK_FOLDED:case F.BLOCK_LITERAL:return o||a?et(r.value,e):At(r,e,n,s);case F.QUOTE_DOUBLE:return pt(r.value,e);case F.QUOTE_SINGLE:return wn(r.value,e);case F.PLAIN:return Nr(r,e,n,s);default:return null}};let c=l(i);if(c===null){const{defaultKeyType:u,defaultStringType:h}=e.options,f=o&&u||h;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}function jr(t,e){const n=Object.assign({blockQuote:!0,commentString:Dr,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):"  ",inFlow:s,options:n}}function xr(t,e){var o;if(e.tag){const a=t.filter(r=>r.tag===e.tag);if(a.length>0)return a.find(r=>r.format===e.format)??a[0]}let n,s;if(V(e)){s=e.value;const a=t.filter(r=>{var i;return(i=r.identify)==null?void 0:i.call(r,s)});n=a.find(r=>r.format===e.format)??a.find(r=>!r.format)}else s=e,n=t.find(a=>a.nodeClass&&s instanceof a.nodeClass);if(!n){const a=((o=s==null?void 0:s.constructor)==null?void 0:o.name)??typeof s;throw new Error(`Tag not resolved for ${a} value`)}return n}function Fr(t,e,{anchors:n,doc:s}){if(!s.directives)return"";const o=[],a=(V(t)||Y(t))&&t.anchor;a&&po(a)&&(n.add(a),o.push(`&${a}`));const r=t.tag?t.tag:e.default?null:e.tag;return r&&o.push(s.directives.tagString(r)),o.join(" ")}function xt(t,e,n,s){var l;if(B(t))return t.toString(e,n,s);if(ot(t)){if(e.doc.directives)return t.toString(e);if((l=e.resolvedAliases)!=null&&l.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let o;const a=U(t)?t:e.doc.createNode(t,{onTagObj:c=>o=c});o||(o=xr(e.doc.schema.tags,a));const r=Fr(a,o,e);r.length>0&&(e.indentAtStart=(e.indentAtStart??0)+r.length+1);const i=typeof o.stringify=="function"?o.stringify(a,e,n,s):V(a)?Hr(a,e,n,s):a.toString(e,n,s);return r?V(a)||i[0]==="{"||i[0]==="["?`${r} ${i}`:`${r}
37${e.indent}${i}`:i}function Vr({key:t,value:e},n,s,o){const{allNullValues:a,doc:r,indent:i,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:h}}=n;let f=U(t)&&t.comment||null;if(h){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Y(t)||!U(t)&&typeof t=="object"){const E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let d=!h&&(!t||f&&e==null&&!n.inFlow||Y(t)||(V(t)?t.type===F.BLOCK_FOLDED||t.type===F.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({}
37,n,{allNullValues:!1,implicitKey:!d&&(h||!a),indent:i+l});let p=!1,g=!1,m=xt(t,n,()=>p=!0,()=>g=!0);if(!d&&!n.inFlow&&m.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(n.inFlow){if(a||e==null)return p&&s&&s(),m===""?"?":d?`? ${m}`:m}else if(a&&!h||e==null&&d)return m=`? ${m}`,f&&!p?m+=Xe(m,n.indent,c(f)):g&&o&&o(),m;p&&(f=null),d?(f&&(m+=Xe(m,n.indent,c(f))),m=`? ${m}
38${i}:`):(m=`${m}:`,f&&(m+=Xe(m,n.indent,c(f))));let y,v,k;U(e)?(y=!!e.spaceBefore,v=e.commentBefore,k=e.comment):(y=!1,v=null,k=null,e&&typeof e=="object"&&(e=r.createNode(e))),n.implicitKey=!1,!d&&!f&&V(e)&&(n.indentAtStart=m.length+1),g=!1,!u&&l.length>=2&&!n.inFlow&&!d&&jn(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let _=!1;const T=xt(e,n,()=>_=!0,()=>g=!0);let S=" ";if(f||y||v){if(S=y?`
39`:"",v){const E=c(v);S+=`
40${yt(E,n.indent)}`}T===""&&!n.inFlow?S===`
41`&&(S=`
42
43`):S+=`
44${n.indent}`}else if(!d&&Y(e)){const E=T[0],R=T.indexOf(`
45`),j=R!==-1,K=n.inFlow??e.flow??e.items.length===0;if(j||!K){let z=!1;if(j&&(E==="&"||E==="!")){let A=T.indexOf(" ");E==="&"&&A!==-1&&A<R&&T[A+1]==="!"&&(A=T.indexOf(" ",A+1)),(A===-1||R<A)&&(z=!0)}z||(S=`
46${n.indent}`)}}else(T===""||T[0]===`
47`)&&(S="");return m+=S+T,n.inFlow?_&&s&&s():k&&!_?m+=Xe(m,n.indent,c(k)):g&&o&&o(),m}function Wr(t,e){(t==="debug"||t==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}const os="<<";function vo(t,e,{key:n,value:s}){if(t!=null&&t.doc.schema.merge&&Br(n))if(s=ot(s)?s.resolve(t.doc):s,jn(s))for(const o of s.items)rn(t,e,o);else if(Array.isArray(s))for(const o of s)rn(t,e,o);else rn(t,e,s);else{const o=ae(n,"",t);if(e instanceof Map)e.set(o,ae(s,o,t));else if(e instanceof Set)e.add(o);else{const a=zr(n,o,t),r=ae(s,a,t);a in e?Object.defineProperty(e,a,{value:r,writable:!0,enumerable:!0,configurable:!0}):e[a]=r}}return e}const Br=t=>t===os||V(t)&&t.value===os&&(!t.type||t.type===F.PLAIN);function rn(t,e,n){const s=t&&ot(n)?n.resolve(t.doc):n;if(!ho(s))throw new Error("Merge sources must be maps or map aliases");const o=s.toJSON(null,t,Map);for(const[a,r]of o)e instanceof Map?e.has(a)||e.set(a,r):e instanceof Set?e.add(a):Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{value:r,writable:!0,enumerable:!0,configurable:!0});return e}function zr(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(U(t)&&(n!=null&&n.doc)){const s=jr(n.doc,{});s.anchors=new Set;for(const a of n.anchors.keys())s.anchors.add(a.anchor);s.inFlow=!0,s.inStringifyKey=!0;const o=t.toString(s);if(!n.mapKeyWarned){let a=JSON.stringify(o);a.length>40&&(a=a.substring(0,36)+'..."'),Wr(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return o}return JSON.stringify(e)}function Fn(t,e,n){const s=jt(t,void 0,n),o=jt(e,void 0,n);return new ce(s,o)}class ce{constructor(e,n=null){Object.defineProperty(this,le,{value:fo}),this.key=e,this.value=n}clone(e){let{key:n,value:s}=this;return U(n)&&(n=n.clone(e)),U(s)&&(s=s.clone(e)),new ce(n,s)}toJSON(e,n){const s=n!=null&&n.mapAsMap?new Map:{};return vo(n,s,this)}toString(e,n,s){return e!=null&&e.doc?Vr(this,e,n,s):JSON.stringify(this)}}function ko(t,e,n){return(e.inFlow??t.flow?Ur:qr)(t,e,n)}function qr({comment:t,items:e},n,{blockItemPrefix:s,flowChars:o,itemIndent:a,onChompKeep:r,onComment:i}){const{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:a,type:null});let h=!1;const f=[];for(let p=0;p<e.length;++p){const g=e[p];let m=null;if(U(g))!h&&g.spaceBefore&&f.push(""),Ft(n,f,g.commentBefore,h),g.comment&&(m=g.comment);else if(B(g)){const v=U(g.key)?g.key:null;v&&(!h&&v.spaceBefore&&f.push(""),Ft(n,f,v.commentBefore,h))}h=!1;let y=xt(g,u,()=>m=null,()=>h=!0);m&&(y+=Xe(y,a,c(m))),h&&m&&(h=!1),f.push(s+y)}let d;if(f.length===0)d=o.start+o.end;else{d=f[0];for(let p=1;p<f.length;++p){const g=f[p];d+=g?`
48${l}${g}`:`
49`}}return t?(d+=`
50`+yt(c(t),l),i&&i()):h&&r&&r(),d}function Ur({items:t},e,{flowChars:n,itemIndent:s}){const{indent:o,indentStep:a,flowCollectionPadding:r,options:{commentString:i}}=e;s+=a;const l=Object.assign({},e,{indent:s,inFlow:!0,type:null});let c=!1,u=0;const h=[];for(let p=0;p<t.length;++p){const g=t[p];let m=null;if(U(g))g.spaceBefore&&h.push(""),Ft(e,h,g.commentBefore,!1),g.comment&&(m=g.comment);else if(B(g)){const v=U(g.key)?g.key:null;v&&(v.spaceBefore&&h.push(""),Ft(e,h,v.commentBefore,!1),v.comment&&(c=!0));const k=U(g.value)?g.value:null;k?(k.comment&&(m=k.comment),k.commentBefore&&(c=!0)):g.value==null&&(v!=null&&v.comment)&&(m=v.comment)}m&&(c=!0);let y=xt(g,l,()=>m=null);p<t.length-1&&(y+=","),m&&(y+=Xe(y,s,i(m))),!c&&(h.length>u||y.includes(`
51`))&&(c=!0),h.push(y),u=h.length}const{start:f,end:d}=n;if(h.length===0)return f+d;if(!c){const p=h.reduce((g,m)=>g+m.length+2,2);c=e.options.lineWidth>0&&p>e.options.lineWidth}if(c){let p=f;for(const g of h)p+=g?`
52${a}${o}${g}`:`
53`;return`${p}
54${o}${d}`}else return`${f}${r}${h.join(" ")}${r}${d}`}function Ft({indent:t,options:{commentString:e}},n,s,o){if(s&&o&&(s=s.replace(/^\n+/,"")),s){const a=yt(e(s),t);n.push(a.trimStart())}}function Ue(t,e){const n=V(e)?e.value:e;for(const s of t)if(B(s)&&(s.key===e||s.key===n||V(s.key)&&s.key.value===n))return s}class Qe extends mo{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ke,e),this.items=[]}static from(e,n,s){const{keepUndefined:o,replacer:a}=s,r=new this(e),i=(l,c)=>{if(typeof a=="function")c=a.call(n,l,c);else if(Array.isArray(a)&&!a.includes(l))return;(c!==void 0||o)&&r.items.push(Fn(l,c,s))};if(n instanceof Map)for(const[l,c]of n)i(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))i(l,n[l]);return typeof e.sortMapEntries=="function"&&r.items.sort(e.sortMapEntries),r}add(e,n){var r;let s;B(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new ce(e,e==null?void 0:e.value):s=new ce(e.key,e.value);const o=Ue(this.items,s.key),a=(r=this.schema)==null?void 0:r.sortMapEntries;if(o){if(!n)throw new Error(`Key ${s.key} already set`);V(o.value)&&go(s.value)?o.value.value=s.value:o.value=s.value}else if(a){const i=this.items.findIndex(l=>a(s,l)<0);i===-1?this.items.push(s):this.items.splice(i,0,s)}else this.items.push(s)}delete(e){const n=Ue(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const s=Ue(this.items,e),o=s==null?void 0:s.value;return(!n&&V(o)?o.value:o)??void 0}has(e){return!!Ue(this.items,e)}set(e,n){this.add(new ce(e,n),!0)}toJSON(e,n,s){const o=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(o);for(const a of this.items)vo(n,o,a);return o}toString(e,n,s){if(!e)return JSON.stringify(this);for(const o of this.items)if(!B(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ko(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:n})}}class wo extends mo{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(vt,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=bt(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const s=bt(e);if(typeof s!="number")return;const o=this.items[s];return!n&&V(o)?o.value:o}has(e){const n=bt(e);return typeof n=="number"&&n<this.items.length}set(e,n){const s=bt(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);const o=this.items[s];V(o)&&go(n)?o.value=n:this.items[s]=n}toJSON(e,n){const s=[];n!=null&&n.onCreate&&n.onCreate(s);let o=0;for(const a of this.items)s.push(ae(a,String(o++),n));return s}toString(e,n,s){return e?ko(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+"  ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(e,n,s){const{replacer:o}=s,a=new this(e);if(n&&Symbol.iterator in Object(n)){let r=0;for(let i of n){if(typeof o=="function"){const l=n instanceof Set?i:String(r++);i=o.call(n,l,i)}a.items.push(jt(i,void 0,s))}}return a}}function bt(t){let e=V(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}function Kr(t,e,n){const{replacer:s}=n,o=new wo(t);o.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let r of e){typeof s=="function"&&(r=s.call(e,String(a++),r));let i,l;if(Array.isArray(r))if(r.length===2)i=r[0],l=r[1];else throw new TypeError(`Expected [key, value] tuple: ${r}`);else if(r&&r instanceof Object){const c=Object.keys(r);if(c.length===1)i=c[0],l=r[i];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else i=r;o.items.push(Fn(i,l,n))}return o}
54class Vn extends wo{constructor(){super(),this.add=Qe.prototype.add.bind(this),this.delete=Qe.prototype.delete.bind(this),this.get=Qe.prototype.get.bind(this),this.has=Qe.prototype.has.bind(this),this.set=Qe.prototype.set.bind(this),this.tag=Vn.tag}toJSON(e,n){if(!n)return super.toJSON(e);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const o of this.items){let a,r;if(B(o)?(a=ae(o.key,"",n),r=ae(o.value,a,n)):a=ae(o,"",n),s.has(a))throw new Error("Ordered maps must not include duplicate keys");s.set(a,r)}return s}static from(e,n,s){const o=Kr(e,n,s),a=new this;return a.items=o.items,a}}Vn.tag="tag:yaml.org,2002:omap";class Wn extends Qe{constructor(e){super(e),this.tag=Wn.tag}add(e){let n;B(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new ce(e.key,null):n=new ce(e,null),Ue(this.items,n.key)||this.items.push(n)}get(e,n){const s=Ue(this.items,e);return!n&&B(s)?V(s.key)?s.key.value:s.key:s}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=Ue(this.items,e);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new ce(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(e,n,s){const{replacer:o}=s,a=new this(e);if(n&&Symbol.iterator in Object(n))for(let r of n)typeof o=="function"&&(r=o.call(n,r,r)),a.items.push(Fn(r,null,s));return a}}Wn.tag="tag:yaml.org,2002:set";new Set("0123456789ABCDEFabcdef");new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");new Set(",[]{}");new Set(` ,[]{}
55\r	`);function Gr(t,e){if(!e||e==="all"||e==="*")return Gn(1,t+1);if(e==="none")return[];const n=[];for(const s of e.split(/[,;]/g))if(!s.includes("-"))n.push(+s);else{const[o,a]=s.split("-",2);n.push(...Gn(+o,a?+a+1:t+1))}return ma(n).filter(s=>s<=t).sort((s,o)=>s-o)}function Ic(){const t=I(Date.now()),e=Bo({interval:1e3}),n=b(()=>{const o=(e.value-t.value)/1e3,a=Math.floor(o%60).toString().padStart(2,"0");return`${Math.floor(o/60).toString().padStart(2,"0")}:${a}`});function s(){t.value=e.value}return{timer:n,resetTimer:s}}function Bn(t=5){const e=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",s=n.length;for(let o=0;o<t;o++)e.push(n.charAt(Math.floor(Math.random()*s)));return e.join("")}function Dc(t,e,n,s){const o=Gr(e+n-1,t);for(let a=0;a<e;a++){const r=s(a),i=o.includes(a+n);for(const l of r)l.classList.toggle("slidev-code-highlighted",i),l.classList.toggle("slidev-code-dishonored",!i),l.classList.toggle("highlighted",i),l.classList.toggle("dishonored",!i)}}const Jr={"slide-left":"slide-left | slide-right","slide-right":"slide-right | slide-left","slide-up":"slide-up | slide-down","slide-down":"slide-down | slide-up"};function Qr(t,e=!1){if(!t||(typeof t=="string"&&(t={name:t}),!t.name))return;let n=t.name.includes("|")?t.name:Jr[t.name]||t.name;if(n.includes("|")){const[s,o]=n.split("|").map(a=>a.trim());n=e?o:s}if(n)return{...t,name:n}}function Yr(t,e,n){var o,a;let s=t>0?(o=n==null?void 0:n.meta)==null?void 0:o.transition:(a=e==null?void 0:e.meta)==null?void 0:a.transition;return s||(s=H.transition||void 0),Qr(s,t<0)}function Zr(t,e,{mode:n="replace"}={}){const s=Ut();return b({get(){const o=s.currentRoute.value.query[t];
55return o==null?e:Array.isArray(o)?o.filter(Boolean):o},set(o){Us(()=>{(s.currentRoute.value.query[t]??(e==null?void 0:e.toString()))!==o.toString()&&s[An(n)]({query:{...s.currentRoute.value.query,[t]:`${o}`===e?void 0:o}})})}})}function bo(t,e,n=1){var o,a,r,i,l,c,u;const s=e.meta.slide.level??n;s&&s>n&&t.length>0?bo(t[t.length-1].children,e,n+1):t.push({no:e.no,children:[],level:n,titleLevel:s,path:tt(((a=(o=e.meta.slide)==null?void 0:o.frontmatter)==null?void 0:a.routeAlias)??e.no,!1),hideInToc:!!((l=(i=(r=e.meta)==null?void 0:r.slide)==null?void 0:i.frontmatter)!=null&&l.hideInToc),title:(u=(c=e.meta)==null?void 0:c.slide)==null?void 0:u.title})}function _o(t,e,n=!1,s,o){return t.map(a=>{const r={...a,active:a.no===(o==null?void 0:o.value),hasActiveParent:n};return r.children.length>0&&(r.children=_o(r.children,e,r.active||r.hasActiveParent,r,o)),s&&(r.active||r.activeParent)&&(s.activeParent=!0),r})}function So(t,e=1){return t.filter(n=>!n.hideInToc).map(n=>({...n,children:So(n.children,e+1)}))}function Xr(t,e,n){const s=b(()=>t.value.filter(a=>{var r,i;return(i=(r=a.meta)==null?void 0:r.slide)==null?void 0:i.title}).reduce((a,r)=>(bo(a,r),a),[])),o=b(()=>_o(s.value,n.value,void 0,void 0,e));return b(()=>So(o.value))}function _n(t){if(t===!1||t==="false")return null;if(t==null||t===!0||t==="true")return"+1";if(typeof t=="string"&&"+-".includes(t[0]))return t;const e=+t;return Number.isNaN(e)?(console.error(`Invalid "at" prop value: ${t}`),null):e}function ei(t){return Array.isArray(t)?[_n(t[0]),_n(t[1])]:null}function Mo(t,e=0,n){const s=I(!1);let o=new Map,a=new Map;const r={get current(){return gn(+t.value,e,r.total)},set current(i){t.value=s.value?gn(i,e,r.total):i},clicksStart:e,get relativeSizeMap(){return o},get maxMap(){return a},get isMounted(){return s.value},setup(){Js(()=>{s.value=!0,a=O(a),r.current=t.value}),zo(()=>{s.value=!1,o=new Map,a=new Map})},calculateSince(i,l=1){const c=_n(i);if(c==null)return null;let u,h,f;if(typeof c=="string"){const d=r.currentOffset,p=+c;u=d+p,h=d+p+l-1,f=p+l-1}else u=c,h=c+l-1,f=0;return{start:u,end:+Number.POSITIVE_INFINITY,max:h,delta:f,currentOffset:b(()=>r.current-u),isCurrent:b(()=>r.current===u),isActive:b(()=>r.current>=u)}},calculateRange(i){const l=ei(i);if(l==null)return null;const[c,u]=l;let h,f,d;return typeof c=="string"?(h=r.currentOffset+ +c,d=+c):(h=c,d=0),typeof u=="string"?(f=h+ +u,d+=+u):f=u,{start:h,end:f,max:f,delta:d,currentOffset:b(()=>r.current-h),isCurrent:b(()=>r.current===h),isActive:b(()=>h<=r.current&&r.current<f)}},calculate(i){return Array.isArray(i)?r.calculateRange(i):r.calculateSince(i)},register(i,l){if(!l)return;const{delta:c,max:u}=l;o.set(i,c),a.set(i,u)},unregister(i){o.delete(i),a.delete(i)},get currentOffset(){return ha(...o.values())},get total(){return n??(s.value?Math.max(0,...a.values()):0)}};return r}function ti(t,e=0){var s,o;const n=((s=t==null?void 0:t.meta.slide)==null?void 0:s.frontmatter.clicksStart)??0;return Mo(I(Math.max(e,n)),n,(o=t==null?void 0:t.meta)==null?void 0:o.clicks)}const ni="modulepreload",si=function(t){return"/"+t},as={},P=function(e,n,s){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),i=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=si(l),l in as)return;as[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":ni,c||(h.as="script"),h.crossOrigin="",h.href=l,i&&h.setAttribute("nonce",i),document.head.appendChild(h),c)return new Promise((f,d)=>{h.addEventListener("load",f),h.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(r){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=r,window.dispatchEvent(i),!i.defaultPrevented)throw r}return o.then(r=>{for(const i of r||[])i.status==="rejected"&&a(i.reason);return e().catch(a)})},oi=(t,e)=>{const n=t.__vccOpts||t;for(const[s,o]of e)n[s]=o;return n},ai={},ri={class:"px-4 py-10 text-center text-red-700 dark:text-red-500 font-bold font-mono"};function ii(t,e){return Dt(),pn("div",ri," An error occurred on this slide. Check the terminal for more information. ")}const $=oi(ai,[["render",ii]]),li={class:"h-full w-full flex items-center justify-center gap-2 slidev-slide-loading"},ci=Qs({__name:"SlideLoading",setup(t){const e=I(!1);return Js(()=>{setTimeout(()=>{e.value=!0},200)}),(n,s)=>(Dt(),pn("div",li,[e.value?(Dt(),pn(qo,{key:0},[s[0]||(s[0]=Kn("div",{class:"i-svg-spinners-90-ring-with-bg text-xl"}
55,null,-1)),s[1]||(s[1]=Kn("div",null,"Loading slide...",-1))],64)):Uo("v-if",!0)]))}}),ui={theme:"@posva/slidev-theme",title:"Data Loaders | Elevating Data Fetching in Vue",info:`## Data Loaders
56Elevating Data Fetching in Vue
57
58Copyright 2024-present Eduardo San Martin Morote
59`,class:"text-center",transition:"view-transition","transition-duration":"1000ms",mdc:!0},ge=L(ui),di=O({get layout(){return ge.layout},get transition(){return ge.transition},get class(){return ge.class},get clicks(){return ge.clicks},get name(){return ge.name},get preload(){return ge.preload},slide:{content:"",frontmatterRaw:`theme: '@posva/slidev-theme'
60title: Data Loaders | Elevating Data Fetching in Vue
61info: |
62  ## Data Loaders
63  Elevating Data Fetching in Vue
64
65  Copyright 2024-present Eduardo San Martin Morote
66class: text-center
67transition: view-transition
68transition-duration: 1000ms
69mdc: true
70`,note:"",title:"Data Loaders | Elevating Data Fetching in Vue",index:0,noteHTML:`<p>Hello everyone! I'm Eduardo, or posva on GitHub and Twitter.</p>
71<p>I'm the author of pinia, Vue Router, and other vue-related libraries like VueFire.</p>
72<p>I have been part of the core team for a very long time, I think it's 8 years now.</p>
73<p>During this journey I have encountered many different problems and I have tried to solve most of them.
74Except for one, Data Fetching.</p>
75`,raw:"",frontmatter:ge,filepath:"",start:0,id:0,no:1},__clicksContext:null,__preloaded:!1}),fi={layout:"cover"},me=L(fi),hi=O({get layout(){return me.layout},get transition(){return me.transition},get class(){return me.class},get clicks(){return me.clicks},get name(){return me.name},get preload(){return me.preload},slide:{content:"",frontmatterRaw:`layout: cover
76`,note:"",title:"Data Fetching",level:1,index:1,noteHTML:`<p>It's not like Data Fetching is my nemesis or anything. But I've always felt like every project I've seen used a <strong>completely</strong> different abstraction. Probably because there was no standard way to do it. Let me show you the most common ones.</p>
77`,raw:"",frontmatter:me,filepath:"",start:43,id:1,no:2},__clicksContext:null,__preloaded:!1}),pi={layout:"two-cols"},ye=L(pi),gi=O({get layout(){return ye.layout},get transition(){return ye.transition},get class(){return ye.class},get clicks(){return ye.clicks},get name(){return ye.name},get preload(){return ye.preload},slide:{content:"",frontmatterRaw:`layout: two-cols
78`,note:"",title:"Client-only Data Fetching",level:2,index:2,noteHTML:`<p>The most common one.
79If your application is Client-only, using a <code>watch</code> <span class="slidev-note-click-mark" data-clicks="1"></span> is a simple and effective way to fetch data.</p>
80<p>On top of that, it's easy to customize: <span class="slidev-note-click-mark" data-clicks="2"></span></p>
81<ul>
82<li>We can add loading state</li>
83<li><span class="slidev-note-click-mark" data-clicks="3"></span> Error handling</li>
84</ul>
85<p>This is because we are in the component itself, <span class="slidev-note-click-mark" data-clicks="4"></span> we can use the component data and we don't need to learn anything new in Vue.</p>
86<p>But <span class="slidev-note-click-mark" data-clicks="5"></span>, it has two major downsides:</p>
87<ul>
88<li>It's client-only. You can't do SSR with this approach because the data fetching only happens when the component is mounted and is not awaited when rendering the page on the server</li>
89<li><span class="slidev-note-click-mark" data-clicks="6"></span> It's quite verbose</li>
90</ul>
91<p>For most projects, this is fine: they don't need SSR after all. But what if you do?</p>
92`,raw:"",frontmatter:ye,filepath:"",start:54,id:2,no:3},__clicksContext:null,__preloaded:!1}),mi={layout:"two-cols"},ve=L(mi),yi=O({get layout(){return ve.layout},get transition(){return ve.transition},get class(){return ve.class},get clicks(){return ve.clicks},get name(){return ve.name},get preload(){return ve.preload},slide:{content:"",frontmatterRaw:`layout: two-cols
93`,note:"",title:"Suspense",level:2,index:3,noteHTML:`<p>You can rely on <code>&lt;Suspense&gt;</code></p>
94<ul>
95<li><span class="slidev-note-click-mark" data-clicks="1"></span> It's simple and intuitive</li>
96<li><span class="slidev-note-click-mark" data-clicks="2"></span> It works without the Router</li>
97<li><span class="slidev-note-click-mark" data-clicks="3"></span> But it depends on mounting the component</li>
98</ul>
99<p>This might not seem like a big deal, but the downsides are</p>
100<ul>
101<li><span class="slidev-note-click-mark" data-clicks="4"></span> Cascading fetching: any nested await will have to wait for the parent to finish fetching</li>
102<li><span class="slidev-note-click-mark" data-clicks="5"></span> No preloading: we have no way to tell a component to prefetch the data and then mounting it without fetching again</li>
103<li><span class="slidev-note-click-mark" data-clicks="6"></span> No watching (no automatic refetch): in order to refetch the data, we need to mount the component again. This is not always possible or desirable</li>
104</ul>
105`,raw:"",frontmatter:ve,filepath:"",start:172,id:3,no:4},__clicksContext:null,__preloaded:!1}),vi={layout:"two-cols"},ke=L(vi),ki=O({get layout(){return ke.layout},get transition(){return ke.transition},get class(){return ke.class},get clicks(){return ke.clicks},get name(){return ke.name},get preload(){return ke.preload},slide:{content:"",frontmatterRaw:`layout: two-cols
106`,note:"",title:"Using a composable",level:2,index:4,noteHTML:`<p>Then we have composables like Pinia Colada, Vue Query, swrv, or even Nuxt's useFetch().</p>
107<ul>
108<li><span class="slidev-note-click-mark" data-clicks="1"></span> It's feature rich. It comes with cache, request deduplication, optimistic updates, and more. The limit is your imagination</li>
109<li><span class="slidev-note-click-mark" data-clicks="2"></span> It's concise. We only need to use the <code>useQuery</code> composable and we are good to go</li>
110<li><span class="slidev-note-click-mark" data-clicks="3"></span> It usually supports SSR. For example, with Pinia Colada and Nuxt's data fetching methods, you don't need to do anything</li>
111</ul>
112`,raw:"",frontmatter:ke,filepath:"",start:243,id:4,no:5},__clicksContext:null,__preloaded:!1}),wi={layout:"two-cols"},we=L(wi),bi=O({get layout(){return we.layout},get transition(){return we.transition},get class(){return we.class},get clicks(){return we.clicks},get name(){return we.name},get preload(){return we.preload},slide:{content:"",frontmatterRaw:`layout: two-cols
113`,note:"",title:"Navigation guard",level:2,index:5,noteHTML:`<p>Last but not least, we have navigation guards. Implementation might vary but the general idea is this:</p>
114<ul>
115<li><span class="slidev-note-click-mark" data-clicks="1"></span> Define a custom <code>meta</code> property</li>
116<li><span class="slidev-note-click-mark" data-clicks="2"></span> Consume it in a navigation guard</li>
117<li>Then you put the data somewhere, for example a pinia store</li>
118</ul>
119<p><span class="slidev-note-click-mark" data-clicks="3"></span> Because we are in a navigation guard, we have a major advantage compared to other solutions: we can modify the navigation. For example, we can redirect to a 404 Not Found page. If the user is not authenticated, we can redirect them to the login page.</p>
120<p><span class="slidev-note-click-mark" data-clicks="4"></span> Also, because we are integrating the data fetching within the navigation, we have more realistic metrics about slow navigations.</p>
121<p><span class="slidev-note-click-mark" data-clicks="5"></span> Lastly, we should be able in the near future to show a native loading state in the browser UI.</p>
122<p>But there are also downsides to this approach:</p>
123<ul>
124<li><span class="slidev-note-click-mark" data-clicks="6"></span> We can't use component data</li>
125<li><span class="slidev-note-click-mark" data-clicks="7"></span> We need a store to put the data</li>
126</ul>
127<p>These 4 examples allow me to say two things about data fetching:</p>
128`,raw:"",frontmatter:we,filepath:"",start:292,id:5,no:6},__clicksContext:null,__preloaded:!1}),_i={layout:"cover",class:"text-center"},be=L(_i),Si=O({get layout(){return be.layout},get transition(){return be.transition},get class(){return be.class},get clicks(){return be.clicks},get name(){return be.name},get preload(){return be.preload},slide:{content:"",frontmatterRaw:`layout: cover
129class: text-center
130`,note:"",title:'Data Fetching is <span v-mark.underline.red="{ strokeWidth: 12 }">**Complex**</span>',level:1,index:6,noteHTML:`<p><span class="slidev-note-click-mark" data-clicks="1"></span> It's a complex topic with many ways to <strong>partially</strong> handle it yet, almost every application needs it.</p>
131`,raw:"",frontmatter:be,filepath:"",start:351,id:6,no:7},__clicksContext:null,__preloaded:!1}),Mi={layout:"cover",class:"text-center"},_e=L(Mi),Ti=O({get layout(){return _e.layout},get transition(){return _e.transition},get class(){return _e.class},get clicks(){return _e.clicks},get name(){return _e.name},get preload(){return _e.preload},slide:{content:"",frontmatterRaw:`layout: cover
132class: text-center
133`,note:"",title:"There is",level:1,index:7,noteHTML:`<p><span class="slidev-note-click-mark" data-clicks="1"></span> And yet, there is no standard way to do it. Every project ends up settling on a different abstraction that works the best for them.</p>
134`,raw:"",frontmatter:_e,filepath:"",start:362,id:7,no:8},__clicksContext:null,__preloaded:!1}),Pi={layout:"cover",class:"text-center font-thin"},Se=L(Pi),Li=O({get layout(){return Se.layout},get transition(){return Se.transition},get class(){return Se.class},get clicks(){return Se.clicks},get name(){return Se.name},get preload(){return Se.preload},slide:{content:"",frontmatterRaw:`layout: cover
135class: text-center font-thin
136`,note:"",title:"Code Collocation<br>+<br>Navigation Aware",level:1,index:8,noteHTML:`<p>The main drawback of these solutions is the lack of collocation of data fetching logic with the page component while being navigation aware.</p>
137<p><span class="slidev-note-click-mark" data-clicks="1"></span> Is it even possible?</p>
138`,raw:"",frontmatter:Se,filepath:"",start:376,id:8,no:9},__clicksContext:null,__preloaded:!1}),Oi={layout:"cover",class:"text-center"},Me=L(Oi),$i=O({get layout(){return Me.layout},get transition(){return Me.transition},get class(){return Me.class},get clicks(){return Me.clicks},get name(){return Me.name},get preload(){return Me.preload},slide:{content:"",frontmatterRaw:`layout: cover
139class: text-center
140`,note:"",title:"Data Loaders",level:1,index:9,noteHTML:`<p>Today, I'm excited to introduce what I believe could become the future standard for data fetching in Vue: Data Loaders.</p>
141`,raw:"",frontmatter:Me,filepath:"",start:395,id:9,no:10},__clicksContext:null,__preloaded:!1}),Ei={},Te=L(Ei),Ai=O({get layout(){return Te.layout},get transition(){return Te.transition},get class(){return Te.class},get clicks(){return Te.clicks},get name(){return Te.name},get preload(){return Te.preload},slide:{content:"",note:"",title:"Getting started",level:2,index:10,noteHTML:`<p>To get started, we need to add the <code>DataLoaderPlugin</code> to our Vue app. This plugin will add a navigation guard to the router that will handle the data fetching within a navigation.</p>
142`,raw:"",frontmatter:Te,filepath:"",start:409,id:10,no:11},__clicksContext:null,__preloaded:!1}),Ci={layout:"two-cols"},Pe=L(Ci),Ii=O({get layout(){return Pe.layout},get transition(){return Pe.transition},get class(){return Pe.class},get clicks(){return Pe.clicks},get name(){return Pe.name},get preload(){return Pe.preload},slide:{content:"",frontmatterRaw:`layout: two-cols
143`,note:"",title:"`defineLoader()`",level:1,index:11,noteHTML:`<p>Then we can start defining our data loaders with <code>defineLoader()</code>. This function is similar to <code>defineStore()</code>, it returns a composable that can be used in any component.</p>
144<p><span class="slidev-note-click-mark" data-clicks="1"></span> We have two <code>&lt;script&gt;</code> tags</p>
145<p><span class="slidev-note-click-mark" data-clicks="2"></span> we define the fetching within a function that receives the target location as an argument. This should allow us to fetch the data based on the URL. Which is a best practice. We return the data we want to expose.</p>
146<p><span class="slidev-note-click-mark" data-clicks="3"></span> As mentioned, <code>defineLoader()</code> returns a composable. We export it to let the router know about it. Then we can use it anywhere in our application. We are not limited to this page component. And they are still executed only once, even if we export it from multiple page components.</p>
147<p><span class="slidev-note-click-mark" data-clicks="4"></span> This gives access to a few properties:</p>
148<ul>
149<li><span class="slidev-note-click-mark" data-clicks="5"></span> starting with <code>data</code>, which is the returned value from the loader</li>
150<li><span class="slidev-note-click-mark" data-clicks="6"></span> <code>isLoading</code> is set to true while the loader is pending</li>
151<li><span class="slidev-note-click-mark" data-clicks="7"></span> <code>error</code> gives access to promise rejections. We will see this in more detail later</li>
152<li><span class="slidev-note-click-mark" data-clicks="8"></span> <code>reload</code> allows you to manually refresh the data <strong>without a navigation</strong></li>
153</ul>
154`,raw:"",frontmatter:Pe,filepath:"",start:431,id:11,no:12},__clicksContext:null,__preloaded:!1}),Di={},Le=L(Di),Ri=O({get layout(){return Le.layout},get transition(){return Le.transition},get class(){return Le.class},get clicks(){return Le.clicks},get name(){return Le.name},get preload(){return Le.preload},slide:{content:"",note:"",title:"Navigation Aware",level:2,index:12,noteHTML:`<p>Since we are &quot;Navigation Aware&quot; because we are within a navigation guard, we can control the navigation outcome. If the loader throws an error, the navigation is canceled.</p>
155<p><span class="slidev-note-click-mark" data-clicks="1"></span> Differently from regular navigation guards, we cannot just return <code>false</code> or a new location to redirect. We need to wrap it with <code>NavigationResult()</code> and we can either throw it or return it.</p>
156<p><span class="slidev-note-click-mark" data-clicks="2"></span> But that's not it. Being <em>Navigation Aware</em> is not just about controlling the navigation. And this is where things get really interesting for data loaders.</p>
157`,raw:"",frontmatter:Le,filepath:"",start:520,id:12,no:13},__clicksContext:null,__preloaded:!1}),Ni={},Oe=L(Ni),Hi=O({get layout(){return Oe.layout},get transition(){return Oe.transition},get class(){return Oe.class},get clicks(){return Oe.clicks},get name(){return Oe.name},get preload(){return Oe.preload},slide:{content:"",note:"",title:"Consistent partial updates",level:2,index:13,noteHTML:`<p>It's also about consistency. In loaders, by default, the data updates only once all of the loaders have properly resolved. Your UI won't display an old page with new data.</p>
158<p>We can also avoid writing code to display loading messages or small spinners.</p>
159<p>Let me show you with a demo.</p>
160`,raw:"",frontmatter:Oe,filepath:"",start:578,id:13,no:14},__clicksContext:null,__preloaded:!1}),ji={layout:"demo-iframe",url:"/inconsistent-state"},$e=L(ji),xi=O({get layout(){return $e.layout},get transition(){return $e.transition},get class(){return $e.class},get clicks(){return $e.clicks}
160,get name(){return $e.name},get preload(){return $e.preload},slide:{content:"",frontmatterRaw:`layout: demo-iframe
161url: /inconsistent-state
162`,note:"",index:14,noteHTML:`<p>Let's first see the basic client-side data fetching.</p>
163<p>This demo is using watchers based on the route params to fetch the data.</p>
164<p>We have two fetches, the profile information takes about 500ms while the follower count takes 2 seconds.</p>
165<p>With client side fetching, we end up with inconsistent states.</p>
166<p>The URL changes immediately, the profile information changes very quickly but the follower count is wrong for over a second. Not ideal.</p>
167<p>Let's see the data loaders version. The first thing we noticed is that little blue loading bar at the top.</p>
168<p>The navigation is blocked until the data is ready and that loading bar helps the user understand something is loading.</p>
169<p>When we switch between profiles, the data is always there and consistent thanks to the navigation blocking.</p>
170<p>But we don't always want to block the navigation. That's why we have lazy loaders.</p>
171<ul>
172<li>lazy but still consistent</li>
173</ul>
174`,raw:"",frontmatter:$e,filepath:"",start:593,id:14,no:15},__clicksContext:null,__preloaded:!1}),Fi={},Ee=L(Fi),Vi=O({get layout(){return Ee.layout},get transition(){return Ee.transition},get class(){return Ee.class},get clicks(){return Ee.clicks},get name(){return Ee.name},get preload(){return Ee.preload},slide:{content:"",note:"",title:"_Lazy_ loaders",level:2,index:15,noteHTML:`<p>Perfect for non-critical data. We just need <span class="slidev-note-click-mark" data-clicks="1"></span> to set <code>lazy: true</code>. Lazy are still conveniently integrated with data loaders:</p>
175<ul>
176<li><span class="slidev-note-click-mark" data-clicks="2"></span> A lazy loader is still triggered on each navigation but not awaited</li>
177<li><span class="slidev-note-click-mark" data-clicks="3"></span> Since it's not awaited, it cannot change the navigation</li>
178<li><span class="slidev-note-click-mark" data-clicks="4"></span> Any thrown error appears in <code>error</code> instead of aborting the navigation</li>
179<li>But, and this is the best part, <span class="slidev-note-click-mark" data-clicks="5"></span> it's still follow consistent updates</li>
180</ul>
181<p>Let me show you</p>
182`,raw:"",frontmatter:Ee,filepath:"",start:621,id:15,no:16},__clicksContext:null,__preloaded:!1}),Wi={layout:"demo-iframe",url:"/inconsistent-state/profile/posva/data-loader"},Ae=L(Wi),Bi=O({get layout(){return Ae.layout},get transition(){return Ae.transition},get class(){return Ae.class},get clicks(){return Ae.clicks},get name(){return Ae.name},get preload(){return Ae.preload},slide:{content:"",frontmatterRaw:`layout: demo-iframe
183url: /inconsistent-state/profile/posva/data-loader
184`,note:"",index:16,noteHTML:`<p>Same demo as before, but we are going to make the follower count lazy. So it's not blocking the navigation. We get a similar result to the client-side fetching.</p>
185<p>In this scenario we would use the <code>isLoading</code> state to show a loading spinner while the follower count is being fetched.</p>
186<p>What's interesting is that if we make the profile information lazy, we get the same consistent behavior. Even though it doesn't block the navigation anymore, because it finishes because the navigation is over, it still waits before setting the data. Let me show you.</p>
187<p>It's great not to have to worry some fetches being too fast but it's usually the slow ones that are the problem.</p>
188<p>Let's talk about why do we want to use lazy loaders.</p>
189`,raw:"",frontmatter:Ae,filepath:"",start:675,id:16,no:17},__clicksContext:null,__preloaded:!1}),zi={layout:"two-cols"},Ce=L(zi),qi=O({get layout(){return Ce.layout},get transition(){return Ce.transition},get class(){return Ce.class},get clicks(){return Ce.clicks},get name(){return Ce.name},get preload(){return Ce.preload},slide:{content:"",frontmatterRaw:`layout: two-cols
190`,note:"",title:'Why "lazy" loaders',level:2,index:17,noteHTML:`<p>Lazy loaders are more about non-critical data. <span class="slidev-note-click-mark" data-clicks="1"></span> In this example we have two loaders:
191<code>
191useArtworkDetails</code> and <code>useArtworkRelatedArtists</code>. The first one is the critical data, it's what the user is looking for. The second one is not as important, so it's better if we show the page as soon as the main data is ready.</p>
192<p>This has a few implications: <span class="slidev-note-click-mark" data-clicks="2"></span></p>
193<ul>
194<li>Artwork details are always defined, no need to write <code>v-if</code> checks</li>
195<li><span class="slidev-note-click-mark" data-clicks="3"></span> On the other hand, related Artists data starts as <code>undefined</code> and their type reflects that</li>
196</ul>
197<p><span class="slidev-note-click-mark" data-clicks="4"></span> This is a practical way to distinguish between critical and non-critical data. It enhances the user experience by prioritizing the data that the user needs most.</p>
198<p>It brings another topic: Error Management</p>
199<p>Since lazy loaders don't block the navigation, any error thrown will appear in <code>error</code>. This gives us the granularity to handle the error locally.</p>
200`,raw:"",frontmatter:Ce,filepath:"",start:692,id:17,no:18},__clicksContext:null,__preloaded:!1}),Ui={},Ie=L(Ui),Ki=O({get layout(){return Ie.layout},get transition(){return Ie.transition},get class(){return Ie.class},get clicks(){return Ie.clicks},get name(){return Ie.name},get preload(){return Ie.preload},slide:{content:"",note:"",title:"Error Management",level:2,index:18,noteHTML:`<p>But non-lazy loaders abort the navigation if an error is thrown.</p>
201<p><span class="slidev-note-click-mark" data-clicks="1"></span> But we can still define expected errors in the <code>error</code> option. This way, the navigation isn't aborted only if the error is expected.</p>
202<p><span class="slidev-note-click-mark" data-clicks="2"></span> It will also appear in <code>error</code> so it can be handled granularly. So we have the best of both worlds: we can handle errors globally with <code>router.onError()</code> and also locally in the component.</p>
203<p>Alright, so we have code collocation, navigation awareness, consistent updates, deduplication, lazy loading, and error management.</p>
204`,raw:"",frontmatter:Ie,filepath:"",start:755,id:18,no:19},__clicksContext:null,__preloaded:!1}),Gi={},De=L(Gi),Ji=O({get layout(){return De.layout},get transition(){return De.transition},get class(){return De.class},get clicks(){return De.clicks},get name(){return De.name},get preload(){return De.preload},slide:{content:"",note:"",title:"What about extra features?",level:2,index:19,noteHTML:`<p>But what about things like cache, optimistic updates? Everything that was mentioned for c
204omposables?</p>
205<p>I have a small confession to make. <span class="slidev-note-click-mark" data-clicks="1"></span> There is no <code>defineLoader()</code>.</p>
206<p><span class="slidev-note-click-mark" data-clicks="2"></span> What I have been explaining so far is called <code>defineBasicLoader()</code>.</p>
207<p><span class="slidev-note-click-mark" data-clicks="3"></span> It represents the baseline implementation for Data Loaders. Just a function. It cannot get simpler than that.</p>
208<p><span class="slidev-note-click-mark" data-clicks="4"></span> Data Loaders can also be integrated with other libraries for more advanced features. For example, with Pinia Colada. Colada loaders take an object with more options. But they are augmented with Data Loader features.</p>
209<p><span class="slidev-note-click-mark" data-clicks="5"></span> The <code>key</code>, a required parameter, has the route location as an argument. Allowing to easily cache the data based on the URL.</p>
210<p><span class="slidev-note-click-mark" data-clicks="6"></span> We can add a <code>staleTime</code> option to keep the data fresh for a certain amount of time. This is a feature of Pinia Colada.</p>
211<p><span class="slidev-note-click-mark" data-clicks="7"></span> And we can also augment the composable. For example, the colada loader exposes a <code>refresh()</code> method that refetches the data only if needed based on that <code>staleTime</code>.</p>
212`,raw:"",frontmatter:De,filepath:"",start:788,id:19,no:20},__clicksContext:null,__preloaded:!1}),Qi={},Re=L(Qi),Yi=O({get layout(){return Re.layout},get transition(){return Re.transition},get class(){return Re.class},get clicks(){return Re.clicks},get name(){return Re.name},get preload(){return Re.preload},slide:{content:"",note:"",title:"`defineLoader()` is a spec",level:2,index:20,noteHTML:`<p><code>defineLoader()</code>
212 is actually a spec. We currently have two implementations:</p>
213<ul>
214<li>A simple one for basic data fetching</li>
215<li>A feature rich one for more advanced apps</li>
216</ul>
217<p><span class="slidev-note-click-mark" data-clicks="1"></span> But we can imagine many more implementations in the future. For example, a loader for Vue Query, one for Websockets, GraphQL, or even Firebase.</p>
218`,raw:"",frontmatter:Re,filepath:"",start:892,id:20,no:21},__clicksContext:null,__preloaded:!1}),Zi={layout:"cover"},Ne=L(Zi),Xi=O({get layout(){return Ne.layout},get transition(){return Ne.transition},get class(){return Ne.class},get clicks(){return Ne.clicks},get name(){return Ne.name},get preload(){return Ne.preload},slide:{content:"",frontmatterRaw:`layout: cover
219`,note:"",title:"Piña Colada?",level:1,index:21,noteHTML:`<p>I have been mentioning this &quot;Pinia Colada&quot; thing a few times but I haven't explained what it is. I'm not talking about a cocktail.</p>
220`,raw:"",frontmatter:Ne,filepath:"",start:920,id:21,no:22},__clicksContext:null,__preloaded:!1}),el={layout:"cover",transition:"view-transition"},He=L(el),tl=O({get layout(){return He.layout},get transition(){return He.transition},get class(){return He.class},get clicks(){return He.clicks},get name(){return He.name},get preload(){return He.preload},slide:{content:"",frontmatterRaw:`layout: cover
221transition: view-transition
222`,note:"",title:"[Pinia Colada]{.inline-block.view-transition-title}",level:1,index:22,noteHTML:`<p>I'm talking about a library I have been working on for the past year.</p>
223`,raw:"",frontmatter:He,filepath:"",start:932,id:22,no:23},__clicksContext:null,__preloaded:!1}),nl={layout:"two-cols"},je=L(nl),sl=O({get layout(){return je.layout},get transition(){return je.transition},get class(){return je.class},get clicks(){return je.clicks},get name(){return je.name},get preload(){return je.preload},slide:{content:"",frontmatterRaw:`layout: two-cols
224`,note:"",title:"[Pinia Colada]{.inline-block.view-transition-title}",level:2,index:23,noteHTML:`<p>Pinia colada is a library built on top of Pinia stores to make async state management a breeze. It works by itself, without the Data Loaders or even the router. I left a couple of stickers around.</p>
225<p>It's the perfect companion for optimal data loaders. Let me know if you have given a try.</p>
226`,raw:"",frontmatter:je,filepath:"",start:945,id:23,no:24},__clicksContext:null,__preloaded:!1}),ol={layout:"demo-iframe",url:"/data-loaders/art-gallery/search"},xe=L(ol),al=O({get layout(){return xe.layout},get transition(){return xe.transition},get class(){return xe.class},get clicks(){return xe.clicks},get name(){return xe.name},get preload(){return xe.preload},slide:{content:"",frontmatterRaw:`layout: demo-iframe
227url: /data-loaders/art-gallery/search
228`,note:"",index:24,noteHTML:`<ul>
229<li>Connected to route</li>
230<li>Navigating back to old pages is nearly instant</li>
231</ul>
232`,raw:"",frontmatter:xe,filepath:"",start:968,id:24,no:25},__clicksContext:null,__preloaded:!1}),rl={},Fe=L(rl),il=O({get layout(){return Fe.layout},get transition(){return Fe.transition},get class(){return Fe.class},get clicks(){return Fe.clicks},get name(){return Fe.name},get preload(){return Fe.preload},slide:{content:"",note:"",title:"Data Loaders",level:1,index:25,noteHTML:`<p>Let's summarize Data Loaders. They are designed to be navigation aware, collocated with page components, and performant.
233The provide a flexible API to handle the loading state, errors and data both globally and locally. They are designed to create a consistent user experience by delaying data updates.</p>
234<p>Please, give it a try and let me know what you think.</p>
235`,raw:"",frontmatter:Fe,filepath:"",start:979,id:25,no:26},__clicksContext:null,__preloaded:!1}),ll={layout:"cover"},Ve=L(ll),cl=O({get layout(){return Ve.layout},get transition(){return Ve.transition},get class(){return Ve.class},get clicks(){return Ve.clicks},get name(){return Ve.name},get preload(){return Ve.preload},slide:{content:"",frontmatterRaw:`layout: cover
236`,note:"",title:"Links",level:1,index:26,noteHTML:`<p>The slides and demos are available on GitHub. Check out the links in this slide for more information.</p>
237`,raw:"",frontmatter:Ve,filepath:"",start:1003,id:26,no:27},__clicksContext:null,__preloaded:!1}),ul={layout:"image",image:"/mp-social.png",backgroundSize:"contain"},We=L(ul),dl=O({get layout(){return We.layout},get transition(){return We.transition},get class(){return We.class},get clicks(){return We.clicks},get name(){return We.name},get preload(){return We.preload},slide:{content:"",frontmatterRaw:`layout: image
238image: /mp-social.png
239backgroundSize: contain
240`,note:"",index:27,noteHTML:`<p>And last but not least, Pinia Colada started as an exercise for Mastering Pinia. So if you are curious about learning how it works internally and learning much more about state management in Vue. Give my course a try.</p>
241<p>And last but not least, if you are looking to improve your Vue.js skills with advanced exercises, or just want to supp
241ort my work, check out my Mastering Pinia course on masteringpinia.com
242I brought some Pinia pins with me. If you bought the course, come show me and I'll give you one.</p>
243`,raw:"",frontmatter:We,filepath:"",start:1026,id:27,no:28},__clicksContext:null,__preloaded:!1}),fl={layout:"cover"},Be=L(fl),hl=O({get layout(){return Be.layout},get transition(){return Be.transition},get class(){return Be.class},get clicks(){return Be.clicks},get name(){return Be.name},get preload(){return Be.preload},slide:{content:"",frontmatterRaw:`layout: cover
244`,note:"",title:"Thanks!",level:1,index:28,noteHTML:`<p>Thank you!</p>
245`,raw:"",frontmatter:Be,filepath:"",start:1039,id:28,no:29},__clicksContext:null,__preloaded:!1}),w=new Array(29),C=(t,e)=>Ko({loader:e,delay:300,loadingComponent:ci,errorComponent:$,onError:n=>console.error("Failed to load slide "+(t+1),n)}),rs=async()=>{try{return w[0]??(w[0]=await P(()=>import("./md-DZY-nDTi.js"),__vite__mapDeps([0,1,2,3,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},is=async()=>{try{return w[1]??(w[1]=await P(()=>import("./md-Bdszeg7m.js"),__vite__mapDeps([7,2,3,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},ls=async()=>{try{return w[2]??(w[2]=await P(()=>import("./md-Db3JddnY.js"),__vite__mapDeps([8,9,2,4,10,11,12,13,5,6])))}catch(t){return console.error("slide failed to load",t),$}},cs=async()=>{try{return w[3]??(w[3]=await P(()=>import("./md-C6FEL42g.js"),__vite__mapDeps([14,9,2,4,15,1,13,5,6])))}catch(t){return console.error("slide failed to load",t),$}},us=async()=>{try{return w[4]??(w[4]=await P(()=>import("./md-BP5qkkxU.js"),__vite__mapDeps([16,9,2,4,15,1,13,5,6])))}catch(t){return console.error("slide failed to load",t),$}},ds=async()=>{try{return w[5]??(w[5]=await P(()=>import("./md-CjTQMpLP.js"),__vite__mapDeps([17,9,2,4,15,1,13,5,6])))}catch(t){return console.error("slide failed to load",t),$}},fs=async()=>{try{return w[6]??(w[6]=await P(()=>import("./md-CtkyIHKA.js"),__vite__mapDeps([18,2,3,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},hs=async()=>{try{return w[7]??(w[7]=await P(()=>import("./md-D2wEOyJj.js"),__vite__mapDeps([19,2,3,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},ps=async()=>{try{return w[8]??(w[8]=await P(()=>import("./md-1ANEOSgB.js"),__vite__mapDeps([20,9,2,4,3,5,6])))}catch(t){return console.error("slide failed to load",t),$}},gs=async()=>{try{return w[9]??(w[9]=await P(()=>import("./md-CDwI_kNJ.js"),__vite__mapDeps([21,2,3,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},ms=async()=>{try{return w[10]??(w[10]=await P(()=>import("./md-BZkt1utF.js"),__vite__mapDeps([22,15,1,2,4,23,5,6])))}catch(t){return console.error("slide failed to load",t),$}},ys=async()=>{try{return w[11]??(w[11]=await P(()=>import("./md-CuwVI_oR.js"),__vite__mapDeps([24,15,1,2,4,13,5,6])))}catch(t){return console.error("slide failed to load",t),$}},vs=async()=>{try{return w[12]??(w[12]=await P(()=>import("./md-BKVr-Etl.js"),__vite__mapDeps([25,9,2,4,10,11,12,23,5,6])))}catch(t){return console.error("slide failed to load",t),$}},ks=async()=>{try{return w[13]??(w[13]=await P(()=>import("./md-2f_Z9Wps.js"),__vite__mapDeps([26,2,23,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},ws=async()=>{try{return w[14]??(w[14]=await P(()=>import("./md-CTFP4P7b.js"),__vite__mapDeps([27,2,28,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},bs=async()=>{try{return w[15]??(w[15]=await P(()=>import("./md-2wYxC8qT.js"),__vite__mapDeps([29,9,2,4,10,11,12,23,5,6])))}catch(t){return console.error("slide failed to load",t),$}},_s=async()=>{try{return w[16]??(w[16]=await P(()=>import("./md-B1DILMYX.js"),__vite__mapDeps([30,2,28,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},Ss=async()=>{try{return w[17]??(w[17]=await P(()=>import("./md-CebTIFpT.js"),__vite__mapDeps([31,15,1,2,4,13,5,6])))}catch(t){return console.error("slide failed to load",t),$}},Ms=async()=>{try{return w[18]??(w[18]=await P(()=>import("./md-DFFSbsFn.js"),__vite__mapDeps([32,15,1,2,4,23,5,6])))}catch(t){return console.error("slide failed to load",t),$}},Ts=async()=>{try{return w[19]??(w[19]=await P(()=>import("./md-Cew5HIrL.js"),__vite__mapDeps([33,10,2,11,4,12,23,5,6])))}catch(t){return console.error("slide failed to load",t),$}},Ps=async()=>{try{return w[20]??(w[20]=await P(()=>import("./slidev/md-BioioVWu.js"),__vite__mapDeps([34,2,9,4,23,5,6])))}catch(t){return console.error("slide failed to load",t),$}},Ls=async()=>{try{return w[21]??(w[21]=await P(()=>import("./md-CCVBoHs6.js"),__vite__mapDeps([35,2,3,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},Os=async()=>{try{return w[22]??(w[22]=await P(()=>import("./md-C72F7ELN.js"),__vite__mapDeps([36,2,37,3,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},$s=async()=>{try{return w[23]??(w[23]=await P(()=>import("./md-DUbMR2GK.js"),__vite__mapDeps([38,1,2,37,13,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},Es=async()=>{try{return w[24]??(w[24]=await P(()=>import("./md-uoexegF-.js"),__vite__mapDeps([39,2,28,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},As=async()=>{try{return w[25]??(w[25]=await P(()=>import("./md-B5R-IqNf.js"),__vite__mapDeps([40,2,23,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},Cs=async()=>{try{return w[26]??(w[26]=await P(()=>import("./md-BWk4OrR2.js"),__vite__mapDeps([41,1,2,3,4,5,6,42])))}catch(t){return console.error("slide failed to load",t),$}},Is=async()=>{try{return w[27]??(w[27]=await P(()=>import("./slidev/md-QkZpSGzI.js"),__vite__mapDeps([43,2,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},Ds=async()=>{try{return w[28]??(w[28]=await P(()=>import("./md-DE_oC8uO.js"),__vite__mapDeps([44,2,3,4,5,6])))}catch(t){return console.error("slide failed to load",t),$}},pl=[{no:1,meta:di,load:rs,component:C(0,rs)},{no:2,meta:hi,load:is,component:C(1,is)},{no:3,meta:gi,load:ls,component:C(2,ls)},{no:4,meta:yi,load:cs,component:C(3,cs)},{no:5,meta:ki,load:us,component:C(4,us)},{no:6,meta:bi,load:ds,component:C(5,ds)},{no:7,meta:Si,load:fs,component:C(6,fs)},{no:8,meta:Ti,load:hs,component:C(7,hs)},{no:9,meta:Li,load:ps,component:C(8,ps)},{no:10,meta:$i,load:gs,component:C(9,gs)},{no:11,meta:Ai,load:ms,component:C(10,ms)},{no:12,meta:Ii,load:ys,component:C(11,ys)},{no:13,meta:Ri,load:vs,component:C(12,vs)},{no:14,meta:Hi,load:ks,component:C(13,ks)},{no:15,meta:xi,load:ws,component:C(14,ws)},{no:16,meta:Vi,load:bs,component:C(15,bs)},{no:17,meta:Bi,load:_s,component:C(16,_s)},{no:18,meta:qi,load:Ss,component:C(17,Ss)},{no:19,meta:Ki,load:Ms,component:C(18,Ms)},{no:20,meta:Ji,load:Ts,component:C(19,Ts)},{no:21,meta:Yi,load:Ps,component:C(20,Ps)},{no:22,meta:Xi,load:Ls,component:C(21,Ls)},{no:23,meta:tl,load:Os,component:C(22,Os)},{no:24,meta:sl,load:$s,component:C(23,$s)},{no:25,meta:al,load:Es,component:C(24,Es)},{no:26,meta:il,load:As,component:C(25,As)},{no:27,meta:cl,load:Cs,component:C(26,Cs)}
245,{no:28,meta:dl,load:Is,component:C(27,Is)},{no:29,meta:hl,load:Ds,component:C(28,Ds)}],ie=Cn(pl);function gl(t,e,n=I(0),s,o,a){const r=b(()=>ie.value.length),i=I(0),l=I(0),c=b(()=>tt(t.value,s.value)),u=b(()=>t.value.no),h=b(()=>{var D;return((D=t.value.meta)==null?void 0:D.layout)||(u.value===1?"cover":"default")}),f=b(()=>e.value.current),d=b(()=>e.value.clicksStart),p=b(()=>e.value.total),g=b(()=>ie.value[Math.min(ie.value.length,u.value+1)-1]),m=b(()=>ie.value[Math.max(1,u.value-1)-1]),y=b(()=>u.value<ie.value.length||f.value<p.value),v=b(()=>u.value>1||f.value>0),k=b(()=>Yr(i.value,t.value,m.value));ee(t,(D,W)=>{i.value=D.no-W.no});async function _(D){return!1}const T=Xr(ie,u,t);async function S(){l.value=1,p.value<=n.value?await R():n.value+=1}async function E(){l.value=-1,n.value<=d.value?await j(!0):n.value-=1}async function R(D=!1){l.value=1,u.value<ie.value.length&&await A(u.value+1,D&&!o.value?Ot:void 0)}async function j(D=!1){l.value=-1,u.value>1&&await A(u.value-1,D&&!o.value?Ot:void 0)}function K(){return A(1)}function z(){return A(r.value)}async function A(D,W=0,re=!1){var he,rt,it;Rn.value=!1;const at=u.value!==D,se=W!==n.value,Z=(he=Xt(D))==null?void 0:he.meta,x=((rt=Z==null?void 0:Z.slide)==null?void 0:rt.frontmatter.clicksStart)??0;W=gn(W,x,((it=Z==null?void 0:Z.__clicksContext)==null?void 0:it.total)??Ot),(re||at||se)&&await(a==null?void 0:a.push({path:tt(D,s.value),query:{...a.currentRoute.value.query,clicks:W===0?void 0:W.toString(),embedded:location.search.includes("embedded")?"true":void 0}}))}function N(){a==null||a.push({path:tt(u.value,!0),query:{...a.currentRoute.value.query}})}function q(){a==null||a.push({path:tt(u.value,!1),query:{...a.currentRoute.value.query}})}return{slides:ie,total:r,currentPath:c,currentSlideNo:u,currentPage:u,currentSlideRoute:t,currentLayout:h,currentTransition:k,clicksDirection:l,nextRoute:g,prevRoute:m,clicksContext:e,clicks:f,clicksStart:d,clicksTotal:p,hasNext:y,hasPrev:v,tocTree:T,navDirection:i,openInEditor:_,next:S,prev:E,go:A,goLast:z,goFirst:K,nextSlide:R,prevSlide:j,enterPresenter:N,exitPresenter:q}}const ml=Ys(()=>{const t=Ut(),e=b(()=>t.currentRoute.value),n=b(()=>(t.currentRoute.value.query,new URLSearchParams(location.search))),s=b(()=>n.value.has("print")),o=b(()=>n.value.get("print")==="clicks"),a=b(()=>n.value.has("embedded")),r=b(()=>e.value.name==="play"),i=b(()=>e.value.name==="presenter"),l=b(()=>e.value.name==="notes"),c=b(()=>!i.value&&(!H.remote||n.value.get("password")===H.remote)),u=Go(r,i),h=b(()=>{var y;return u.value?((y=Xt(e.value.params.no))==null?void 0:y.no)??1:1}),f=b(()=>ie.value[h.value-1]),d=Zr("clicks","0"),p=b(()=>m(f.value)),g=b({get(){let y=+(d.value||0);return Number.isNaN(y)&&(y=0),y},set(y){Rn.value=!1,d.value=y.toString()}});function m(y){var _,T;if((_=y==null?void 0:y.meta)!=null&&_.__clicksContext)return y.meta.__clicksContext;const v=y.no,k=Mo(b({get(){return h.value===v?Math.max(+(d.value??0),k.clicksStart):h.value>v?Ot:k.clicksStart},set(S){h.value===v&&(d.value=S.toString())}}),((T=y==null?void 0:y.meta.slide)==null?void 0:T.frontmatter.clicksStart)??0,y==null?void 0:y.meta.clicks);return y!=null&&y.meta&&(y.meta.__clicksContext=k),k}return{router:t,currentRoute:e,isPrintMode:s,isPrintWithClicks:o,isEmbedded:a,isPlaying:r,isPresenter:i,isNotesViewer:l,isPresenterAvailable:c,hasPrimarySlide:u,currentSlideNo:h,currentSlideRoute:f,clicksContext:p,queryClicksRaw:d,queryClicks:g,getPrimaryClicks:m}}),Sn=Ys(()=>{const t=ml(),e=Ut(),n=gl(t.currentSlideRoute,t.clicksContext,t.queryClicks,t.isPresenter,t.isPrintMode,e);return ee([n.total,t.currentRoute],async()=>{const s=t.currentRoute.value.params.no;t.hasPrimarySlide.value&&!Xt(s)&&(s&&s!=="index.html"?await n.go(n.total.value,0,!0):await n.go(1,0,!0))},{flush:"pre",immediate:!0}),{...n,...t}});function Xt(t){return ie.value.find(e=>{var n;return e.no===+t||((n=e.meta.slide)==null?void 0:n.frontmatter.routeAlias)===t})}function tt(t,e){var s;(typeof t=="number"||typeof t=="string")&&(t=Xt(t));const n=((s=t.meta.slide)==null?void 0:s.frontmatter.routeAlias)??t.no;return e?`/presenter/${n}`:`/${n}`}const Rs=Jo(),ln=te("slidev-color-schema","auto"),Ns=b(()=>H.colorSchema!=="auto"),To=b({get(){return Ns.value?H.colorSchema==="dark":ln.value==="auto"?Rs.value:ln.value==="dark"},set(t){Ns.value||(ln.value=t===Rs.value?"auto":t?"dark":"light")}}),Rc=Zs(To);Kt&&ee(To,t=>{const e=document.querySelector("html");e.classList.toggle("dark",t),e.classList.toggle("light",!t)},{immediate:!0});const yl=[];function vl(){const t=Gs().appContext.app,e=L({nav:Sn(),configs:H,themeConfigs:b(()=>H.themeConfig)});t.provide(Dn,I("none")),t.provide(wr,e),t.provide(In,b(()=>
245e.nav.currentSlideNo)),t.provide(Gt,Cn(ti()));for(const u of yl)u();const{clicksContext:n,currentSlideNo:s,hasPrimarySlide:o,isNotesViewer:a,isPresenter:r}=Sn();ur({title:tn,htmlAttrs:H.htmlAttrs}),pr(`${tn} - shared`),vr(`${tn} - drawings`);const i=`${location.origin}_${Bn()}`;function l(){a.value||!r.value&&!Sr.includes(location.host.split(":")[0])||(r.value?(pe("page",+s.value),pe("clicks",n.value.current),pe("clicksTotal",n.value.total)):(pe("viewerPage",+s.value),pe("viewerClicks",n.value.current),pe("viewerClicksTotal",n.value.total)),pe("lastUpdate",{id:i,type:r.value?"presenter":"viewer",time:new Date().getTime()}))}const c=Ut();c.afterEach(l),ee(n,l),gr(u=>{var h;o.value&&((h=u.lastUpdate)==null?void 0:h.type)==="presenter"&&(+u.page!=+s.value||+n.value.current!=+u.clicks)&&(Rn.value=!1,c.replace({path:tt(u.page,r.value),query:{...c.currentRoute.value.query,clicks:u.clicks||0}}))})}const kl=Qs({__name:"App",setup(t){return vl(),nt(()=>{for(const[e,n]of Object.entries(wa.value))document.body.style.setProperty(e,n.toString())}),(e,n)=>{const s=Qo("RouterView");return Dt(),Yo(s)}}});function Nc(t,e=""){var o,a;const n=["slidev-page",e],s=(a=(o=t==null?void 0:t.meta)==null?void 0:o.slide)==null?void 0:a.no;return s!=null&&n.push(`slidev-page-${s}`),n.filter(Boolean).join(" ")}async function Hc(){const{saveAs:t}=await P(async()=>{const{saveAs:e}=await import("./modules/file-saver-LUhfcczZ.js").then(n=>n.F);return{saveAs:e}},[]);t(typeof H.download=="string"?H.download:H.exportFilename?`${H.exportFilename}.pdf`:"/slidev-exported.pdf",`${H.title}.pdf`)}function st(t,e,n){var s;return((s=t.instance)==null?void 0:s.$).provides[e]??n}function wl(){return{install(t){t.directive("click",{name:"v-click",mounted(e,n){const s=Ct(e,n,n.value);s!=null&&(e.classList.toggle(Lt,!0),e.dataset.slidevClicksStart=String(s.start),Number.isFinite(s.end)&&(e.dataset.slidevClicksEnd=String(s.end)),e.watchStopHandle=nt(()=>{const o=s.isActive.value,a=s.isCurrent.value,r=o&&!a;s.flagHide?(e.classList.toggle(s.flagFade?ct:lt,o),e.classList.toggle(sn,o)):e.classList.toggle(s.flagFade?ct:lt,!o),e.classList.toggle(on,a),e.classList.toggle(an,r)}))},unmounted:cn}),t.directive("after",{name:"v-after",mounted(e,n){const s=Ct(e,n,"+0");s!=null&&(e.classList.toggle(Lt,!0),e.watchStopHandle=nt(()=>{const o=s.isActive.value,a=s.isCurrent.value,r=o&&!a;s.flagHide?(e.classList.toggle(s.flagFade?ct:lt,o),e.classList.toggle(sn,o)):e.classList.toggle(s.flagFade?ct:lt,!o),e.classList.toggle(on,a),e.classList.toggle(an,r)}))},unmounted:cn}),t.directive("click-hide",{name:"v-click-hide",mounted(e,n){const s=Ct(e,n,n.value,!0);s!=null&&(e.classList.toggle(Lt,!0),e.watchStopHandle=nt(()=>{const o=s.isActive.value,a=s.isCurrent.value,r=o&&!a;e.classList.toggle(s.flagFade?ct:lt,o),e.classList.toggle(sn,o),e.classList.toggle(on,a),e.classList.toggle(an,r)}))},unmounted:cn})}}}const Po=new Map;function Ct(t,e,n,s=!1){var h;const o=(h=st(e,Gt))==null?void 0:h.value;if(!t||!o)return null;const a=s||e.modifiers.hide!==!1&&e.modifiers.hide!=null,r=e.modifiers.fade!==!1&&e.modifiers.fade!=null,i=o.calculate(n);if(!i)return null;o.register(t,i);const l=b(()=>a?!i.isActive.value:i.isActive.value),c=b(()=>l.value?"shown":Number.isFinite(i.end)?o.current<i.start?"before":"after":a?"after":"before"),u={...i,isShown:l,visibilityState:c,flagFade:r,flagHide:a};return Po.set(t,u),u}function cn(t,e){var s,o;t.classList.toggle(Lt,!1);const n=(s=st(e,Gt))==null?void 0:s.value;n==null||n.unregister(t),(o=t.watchStopHandle)==null||o.call(t)}function Lo(){return Math.floor(Math.random()*2**31)}class bl{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}function Mn(t,e,n){if(t&&t.length){const[s,o]=e,a=Math.PI/180*n,r=Math.cos(a),i=Math.sin(a);for(const l of t){const[c,u]=l;l[0]=(c-s)*r-(u-o)*i+s,l[1]=(c-s)*i+(u-o)*r+o}}}function _l(t,e,n){const s=[];t.forEach(o=>s.push(...o)),Mn(s,e,n)}function Sl(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ml(t,e,n,s=1){const o=n,a=Math.max(e,.1),r=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,i=[0,0];if(o)for(const c of r)Mn(c,i,o);const l=Tl(r,a,s);if(o){for(const c of r)Mn(c,i,-o);_l(l,i,-o)}return l}function Tl(t,e,n){const s=[];for(const c of t){const u=[...c];Sl(u[0],u[u.length-1])||u.push([u[0][0],u[0][1]]),u.length>2&&s.push(u)}const o=[];e=Math.max(e,.1);const a=[];for(const c of s)for(let u=0;u<c.length-1;u++){const h=c[u],f=c[u+1];if(h[1]!==f[1]){const d=Math.min(h[1],f[1]);a.push({ymin:d,ymax:Math.max(h[1],f[1]),x:d===h[1]?h[0]:f[0],islope:(f[0]-h[0])/(f[1]-h[
2451])})}}if(a.sort((c,u)=>c.ymin<u.ymin?-1:c.ymin>u.ymin?1:c.x<u.x?-1:c.x>u.x?1:c.ymax===u.ymax?0:(c.ymax-u.ymax)/Math.abs(c.ymax-u.ymax)),!a.length)return o;let r=[],i=a[0].ymin,l=0;for(;r.length||a.length;){if(a.length){let c=-1;for(let h=0;h<a.length&&!(a[h].ymin>i);h++)c=h;a.splice(0,c+1).forEach(h=>{r.push({s:i,edge:h})})}if(r=r.filter(c=>!(c.edge.ymax<=i)),r.sort((c,u)=>c.edge.x===u.edge.x?0:(c.edge.x-u.edge.x)/Math.abs(c.edge.x-u.edge.x)),(n!==1||l%e===0)&&r.length>1)for(let c=0;c<r.length;c=c+2){const u=c+1;if(u>=r.length)break;const h=r[c].edge,f=r[u].edge;o.push([[Math.round(h.x),i],[Math.round(f.x),i]])}i+=n,r.forEach(c=>{c.edge.x=c.edge.x+n*c.edge.islope}),l++}return o}function kt(t,e){var n;const s=e.hachureAngle+90;let o=e.hachureGap;o<0&&(o=e.strokeWidth*4),o=Math.round(Math.max(o,.1));let a=1;return e.roughness>=1&&(((n=e.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(a=o),Ml(t,o,s,a||1)}class zn{constructor(e){this.helper=e}fillPolygons(e,n){return this._fillPolygons(e,n)}_fillPolygons(e,n){const s=kt(e,n);return{type:"fillSketch",ops:this.renderLines(s,n)}}renderLines(e,n){const s=[];for(const o of e)s.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],n));return s}}function en(t){const e=t[0],n=t[1];return Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2))}class Pl extends zn{fillPolygons(e,n){let s=n.hachureGap;s<0&&(s=n.strokeWidth*4),s=Math.max(s,.1);const o=Object.assign({},n,{hachureGap:s}),a=kt(e,o),r=Math.PI/180*n.hachureAngle,i=[],l=s*.5*Math.cos(r),c=s*.5*Math.sin(r);for(const[h,f]of a)en([h,f])&&i.push([[h[0]-l,h[1]+c],[...f]],[[h[0]+l,h[1]-c],[...f]]);return{type:"fillSketch",ops:this.renderLines(i,n)}}}class Ll extends zn{fillPolygons(e,n){const s=this._fillPolygons(e,n),o=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),a=this._fillPolygons(e,o);return s.ops=s.ops.concat(a.ops),s}}class Ol{constructor(e){this.helper=e}fillPolygons(e,n){n=Object.assign({},n,{hachureAngle:0});const s=kt(e,n);return this.dotsOnLines(s,n)}dotsOnLines(e,n){const s=[];let o=n.hachureGap;o<0&&(o=n.strokeWidth*4),o=Math.max(o,.1);let a=n.fillWeight;a<0&&(a=n.strokeWidth/2);const r=o/4;for(const i of e){const l=en(i),c=l/o,u=Math.ceil(c)-1,h=l-u*o,f=(i[0][0]+i[1][0])/2-o/4,d=Math.min(i[0][1],i[1][1]);for(let p=0;p<u;p++){const g=d+h+p*o,m=f-r+Math.random()*2*r,y=g-r+Math.random()*2*r,v=this.helper.ellipse(m,y,a,a,n);s.push(...v.ops)}}return{type:"fillSketch",ops:s}}}class $l{constructor(e){this.helper=e}fillPolygons(e,n){const s=kt(e,n);return{type:"fillSketch",ops:this.dashedLine(s,n)}}dashedLine(e,n){const s=n.dashOffset<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashOffset,o=n.dashGap<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashGap,a=[];return e.forEach(r=>{const i=en(r),l=Math.floor(i/(s+o)),c=(i+o-l*(s+o))/2;let u=r[0],h=r[1];u[0]>h[0]&&(u=r[1],h=r[0]);const f=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let d=0;d<l;d++){const p=d*(s+o),g=p+s,m=[u[0]+p*Math.cos(f)+c*Math.cos(f),u[1]+
245p*Math.sin(f)+c*Math.sin(f)],y=[u[0]+g*Math.cos(f)+c*Math.cos(f),u[1]+g*Math.sin(f)+c*Math.sin(f)];a.push(...this.helper.doubleLineOps(m[0],m[1],y[0],y[1],n))}}),a}}class El{constructor(e){this.helper=e}fillPolygons(e,n){const s=n.hachureGap<0?n.strokeWidth*4:n.hachureGap,o=n.zigzagOffset<0?s:n.zigzagOffset;n=Object.assign({},n,{hachureGap:s+o});const a=kt(e,n);return{type:"fillSketch",ops:this.zigzagLines(a,o,n)}}zigzagLines(e,n,s){const o=[];return e.forEach(a=>{const r=en(a),i=Math.round(r/(2*n));let l=a[0],c=a[1];l[0]>c[0]&&(l=a[1],c=a[0]);const u=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let h=0;h<i;h++){const f=h*2*n,d=(h+1)*2*n,p=Math.sqrt(2*Math.pow(n,2)),g=[l[0]+f*Math.cos(u),l[1]+f*Math.sin(u)],m=[l[0]+d*Math.cos(u),l[1]+d*Math.sin(u)],y=[g[0]+p*Math.cos(u+Math.PI/4),g[1]+p*Math.sin(u+Math.PI/4)];o.push(...this.helper.doubleLineOps(g[0],g[1],y[0],y[1],s),...this.helper.doubleLineOps(y[0],y[1],m[0],m[1],s))}}),o}}const G={};function Al(t,e){let n=t.fillStyle||"hachure";if(!G[n])switch(n){case"zigzag":G[n]||(G[n]=new Pl(e));break;case"cross-hatch":G[n]||(G[n]=new Ll(e));break;case"dots":G[n]||(G[n]=new Ol(e));break;
245case"dashed":G[n]||(G[n]=new $l(e));break;case"zigzag-line":G[n]||(G[n]=new El(e));break;case"hachure":default:n="hachure",G[n]||(G[n]=new zn(e));break}return G[n]}const Cl=0,Tn=1,Oo=2,_t={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Il(t){const e=new Array;for(;t!=="";)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:Cl,text:RegExp.$1},t=t.substr(RegExp.$1.length);else if(t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))e[e.length]={type:Tn,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length);else return[];return e[e.length]={type:Oo,text:""},e}function un(t,e){return t.type===e}function qn(t){const e=[],n=Il(t);let s="BOD",o=0,a=n[o];for(;!un(a,Oo);){let r=0;const i=[];if(s==="BOD")if(a.text==="M"||a.text==="m")o++,r=_t[a.text],s=a.text;else return qn("M0,0"+t);else un(a,Tn)?r=_t[s]:(o++,r=_t[a.text],s=a.text);if(o+r<n.length){for(let l=o;l<o+r;l++){const c=n[l];if(un(c,Tn))i[i.length]=+c.text;else throw new Error("Param not a number: "+s+","+c.text)}if(typeof _t[s]=="number"){const l={key:s,data:i};e.push(l),o+=r,a=n[o],s==="M"&&(s="L"),s==="m"&&(s="l")}else throw new Error("Bad segment: "+s)}else throw new Error("Path data ended short")}return e}function $o(t){let e=0,n=0,s=0,o=0;const a=[];for(const{key:r,data:i}of t)switch(r){case"M":a.push({key:"M",data:[...i]}),[e,n]=i,[s,o]=i;break;case"m":e+=i[0],n+=i[1],a.push({key:"M",data:[e,n]}),s=e,o=n;break;case"L":a.push({key:"L",data:[...i]}),[e,n]=i;break;case"l":e+=i[0],n+=i[1],a.push({key:"L",data:[e,n]});break;case"C":a.push({key:"C",data:[...i]}),e=i[4],n=i[5];break;case"c":{const l=i.map((c,u)=>u%2?c+n:c+e);a.push({key:"C",data:l}),e=l[4],n=l[5];break}case"Q":a.push({key:"Q",data:[...i]}),e=i[2],n=i[3];break;case"q":{const l=i.map((c,u)=>u%2?c+n:c+e);a.push({key:"Q",data:l}),e=l[2],n=l[3];break}case"A":a.push({key:"A",data:[...i]}),e=i[5],n=i[6];break;case"a":e+=i[5],n+=i[6],a.push({key:"A",data:[i[0],i[1],i[2],i[3],i[4],e,
245n]});break;case"H":a.push({key:"H",data:[...i]}),e=i[0];break;case"h":e+=i[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...i]}),n=i[0];break;case"v":n+=i[0],a.push({key:"V",data:[n]});break;case"S":a.push({key:"S",data:[...i]}),e=i[2],n=i[3];break;case"s":{const l=i.map((c,u)=>u%2?c+n:c+e);a.push({key:"S",data:l}),e=l[2],n=l[3];break}case"T":a.push({key:"T",data:[...i]}),e=i[0],n=i[1];break;case"t":e+=i[0],n+=i[1],a.push({key:"T",data:[e,n]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=s,n=o;break}return a}function Eo(t){const e=[];let n="",s=0,o=0,a=0,r=0,i=0,l=0;for(const{key:c,data:u}of t){switch(c){case"M":e.push({key:"M",data:[...u]}),[s,o]=u,[a,r]=u;break;case"C":e.push({key:"C",data:[...u]}),s=u[4],o=u[5],i=u[2],l=u[3];break;case"L":e.push({key:"L",data:[...u]}),[s,o]=u;break;case"H":s=u[0],e.push({key:"L",data:[s,o]});break;case"V":o=u[0],e.push({key:"L",data:[s,o]});break;case"S":{let h=0,f=0;n==="C"||n==="S"?(h=s+(s-i),f=o+(o-l)):(h=s,f=o),e.push({key:"C",data:[h,f,...u]}),i=u[0],l=u[1],s=u[2],o=u[3];break}case"T":{const[h,f]=u;let d=0,p=0;n==="Q"||n==="T"?(d=s+(s-i),p=o+(o-l)):(d=s,p=o);const g=s+2*(d-s)/3,m=o+2*(p-o)/3,y=h+2*(d-h)/3,v=f+2*(p-f)/3;e.push({key:"C",data:[g,m,y,v,h,f]}),i=d,l=p,s=h,o=f;break}case"Q":{const[h,f,d,p]=u,g=s+2*(h-s)/3,m=o+2*(f-o)/3,y=d+2*(h-d)/3,v=p+2*(f-p)/3;e.push({key:"C",data:[g,m,y,v,d,p]}),i=h,l=f,s=d,o=p;break}case"A":{const h=Math.abs(u[0]),f=Math.abs(u[1]),d=u[2],p=u[3],g=u[4],m=u[5],y=u[6];h===0||f===0?(e.push({key:"C",data:[s,o,m,y,m,y]}),s=m,o=y):(s!==m||o!==y)&&(Ao(s,o,m,y,h,f,d,p,g).forEach(function(k){e.push({key:"C",data:k})}),s=m,o=y);break}case"Z":e.push({key:"Z",data:[]}),s=a,o=r;break}n=c}return e}function Dl(t){return Math.PI*t/180}function ut(t,e,n){const s=t*Math.cos(n)-e*Math.sin(n),o=t*Math.sin(n)+e*Math.cos(n);return[s,o]}function Ao(t,e,n,s,o,a,r,i,l,c){const u=Dl(r);let h=[],f=0,d=0,p=0,g=0;if(c)[f,d,p,g]=c;else{[t,e]=ut(t,e,-u),[n,s]=ut(n,s,-u);const A=(t-n)/2,N=(e-s)/2;let q=A*A/(o*o)+N*N/(a*a);q>1&&(q=Math.sqrt(q),o=q*o,a=q*a);const D=i===l?-1:1,W=o*o,re=a*a,at=W*re-W*N*N-re*A*A,se=W*N*N+re*A*A,Z=D*Math.sqrt(Math.abs(at/se));p=Z*o*N/a+(t+n)/2,g=Z*-a*A/o+(e+s)/2,f=Math.asin(parseFloat(((e-g)/a).toFixed(9))),d=Math.asin(parseFloat(((s-g)/a).toFixed(9))),t<p&&(f=Math.PI-f),n<p&&(d=Math.PI-d),f<0&&(f=Math.PI*2+f),d<0&&(d=Math.PI*2+d),l&&f>d&&(f=f-Math.PI*2),!l&&d>f&&(d=d-Math.PI*2)}let m=d-f;if(Math.abs(m)>Math.PI*120/180){const A=d,N=n,q=s;l&&d>
245f?d=f+Math.PI*120/180*1:d=f+Math.PI*120/180*-1,n=p+o*Math.cos(d),s=g+a*Math.sin(d),h=Ao(n,s,N,q,o,a,r,0,l,[d,A,p,g])}m=d-f;const y=Math.cos(f),v=Math.sin(f),k=Math.cos(d),_=Math.sin(d),T=Math.tan(m/4),S=4/3*o*T,E=4/3*a*T,R=[t,e],j=[t+S*v,e-E*y],K=[n+S*_,s-E*k],z=[n,s];if(j[0]=2*R[0]-j[0],j[1]=2*R[1]-j[1],c)return[j,K,z].concat(h);{h=[j,K,z].concat(h);const A=[];for(let N=0;N<h.length;N+=3){const q=ut(h[N][0],h[N][1],u),D=ut(h[N+1][0],h[N+1][1],u),W=ut(h[N+2][0],h[N+2][1],u);A.push([q[0],q[1],D[0],D[1],W[0],W[1]])}return A}}const Rl={randOffset:jl,randOffsetWithRange:xl,ellipse:Pn,doubleLineOps:Fl};function X(t,e,n,s,o){return{type:"path",ops:fe(t,e,n,s,o)}}function gt(t,e,n){const s=(t||[]).length;if(s>2){const o=[];for(let a=0;a<s-1;a++)o.push(...fe(t[a][0],t[a][1],t[a+1][0],t[a+1][1],n));return e&&o.push(...fe(t[s-1][0],t[s-1][1],t[0][0],t[0][1],n)),{type:"path",ops:o}}else if(s===2)return X(t[0][0],t[0][1],t[1][0],t[1][1],n);return{type:"path",ops:[]}}function Nl(t,e){return gt(t,!0,e)}function Co(t,e,n,s,o){const a=[[t,e],[t+n,e],[t+n,e+s],[t,e+s]];return Nl(a,o)}function Hs(t,e){if(t.length){const s=typeof t[0][0]=="number"?[t]:t,o=St(s[0],1*(1+e.roughness*.2),e),a=e.disableMultiStroke?[]:St(s[0],1.5*(1+e.roughness*.22),Fs(e));for(let r=1;r<s.length;r++){const i=s[r];if(i.length){const l=St(i,1*(1+e.roughness*.2),e),c=e.disableMultiStroke?[]:St(i,1.5*(1+e.roughness*.22),Fs(e));for(const u of l)u.op!=="move"&&o.push(u);for(const u of c)u.op!=="move"&&a.push(u)}}return{type:"path",ops:o.concat(a)}}return{type:"path",ops:[]}}function Pn(t,e,n,s,o){const a=Io(n,s,o);return Ln(t,e,o,a).opset}function Io(t,e,n){const s=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),o=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*s)),a=Math.PI*2/o;let r=Math.abs(t/2),i=Math.abs(e/2);const l=1-n.curveFitting;return r+=M(r*l,n),i+=M(i*l,n),{increment:a,rx:r,ry:i}}function Ln(t,e,n,s){const[o,a]=Vs(s.increment,t,e,s.rx,s.ry,1,s.increment*Vt(.1,Vt(.4,1,n),n),n);let r=Wt(o,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[i]=Vs(s.increment,t,e,s.rx,s.ry,1.5,0,n),l=Wt(i,null,n);r=r.concat(l)}return{estimatedPoints:a,opset:{type:"path",ops:r}}}function js(t,e,n,s,o,a,r,i,l){const c=t,u=e;let h=Math.abs(n/2),f=Math.abs(s/2);h+=M(h*.01,l),f+=M(f*.01,l);let d=o,p=a;for(;d<0;)d+=Math.PI*2,p+=Math.PI*2;p-d>Math.PI*2&&(d=0,p=Math.PI*2);const g=Math.PI*2/l.curveStepCount,m=Math.min(g/2,(p-d)/2),y=Ws(m,c,u,h,f,d,p,1,l);if(!l.disableMultiStroke){const v=Ws(m,c,u,h,f,d,p,1.5,l);y.push(...v)}return r&&(i?y.push(...fe(c,u,c+h*Math.cos(d),u+f*Math.sin(d),l),...fe(c,u,c+h*Math.cos(p),u+f*Math.sin(p),l)):y.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+h*Math.cos(d),u+f*Math.sin(d)]})),{type:"path",ops:y}}function xs(t,e){const n=Eo($o(qn(t))),s=[];let o=[0,0],a=[0,0];for(const{key:r,data:i}of n)switch(r){case"M":{a=[i[0],i[1]],o=[i[0],i[1]];break}case"L":s.push(...fe(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]];break;case"C":{const[l,c,u,h,f,d]=i;s.push(...Vl(l,c,u,h,f,d,a,e)),a=[f,d];break}case"Z":s.push(...fe(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break}return{type:"path",ops:s}}function dn(t,e){const n=[];for(const s of t)if(s.length){const o=e.maxRandomnessOffset||0,a=s.length;if(a>2){n.push({op:"move",data:[s[0][0]+M(o,e),s[0][1]+M(o,e)]});for(let r=1;r<a;r++)n.push({op:"lineTo",data:[s[r][0]+M(o,e),s[r][1]+M(o,e)]})}}return{type:"fillPath",ops:n}}function Ye(t,e){return Al(e,Rl).fillPolygons(t,e)}function Hl(t,e,n,s,o,a,r){const i=t,l=e;let c=Math.abs(n/2),u=Math.abs(s/2);c+=M(c*.01,r),u+=M(u*.01,r);let h=o,f=a;for(;h<0;)h+=Math.PI*2,f+=Math.PI*2;f-h>Math.PI*2&&(h=0,f=Math.PI*2);const d=(f-h)/r.curveStepCount,p=[];for(let g=h;g<=f;g=g+d)p.push([i+c*Math.cos(g),l+u*Math.sin(g)]);return p.push([i+c*Math.cos(f),l+u*Math.sin(f)]),p.push([i,l]),Ye([p],r)}function jl(t,e){return M(t,e)}function xl(t,e,n){return Vt(t,e,n)}function Fl(t,e,n,s,o){return fe(t,e,n,s,o,!0)}function Fs(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function Do(t){return t.randomizer||(t.randomizer=new bl(t.seed||0)),t.randomizer.next()}function Vt(t,e,n,s=1){return n.roughness*s*(Do(n)*(e-t)+t)}function M(t,e,n=1){return Vt(-t,t,e,n)}function fe(t,e,n,s,o,a=!1){const r=a?o.disableMultiStrokeFill:o.disableMultiStroke,i=On(t,e,n,s,o,!0,!1);if(r)return i;const l=On(t,e,n,s,o,!0,!0);return i.concat(l)}function On(t,e,n,s,o,a,r){const i=Math.pow(t-n,2)+Math.pow(e-s,2),l=Math.sqrt(i);let c=1;l<200?c=1:l>500?c=.4:c=-.0016668*l+1.233334;let u=o.maxRandomnessOffset||0;u*u*100>i&&(u=l/10);const h=u/2,f=.2+Do(o)*.2;let d=o.bowing*o.maxRandomnessOffset*(s-e)/200,p=o.bowing*o.maxRandomnessOffset*(t-n)/200;d=M(d,o,c),p=M(p,o,c);const g=[],m=()=>M(h,o,c),y=()=>M(u,o,c),v=o.preserveVertices;return r?g.push({op:"move",data:[t+(v?0:m()),e+(v?0:m())]}):g.push({op:"move",data:[t+(v?0:M(u,o,c)),e+(v?0:M(u,o,c))]}),r?g.push({op:"bcurveTo",data:[d+t+(n-t)*f+m(),p+e+(s-e)*f+m(),d+t+2*(n-t)*f+m(),p+e+2*(s-e)*f+m(),n+(v?0:m()),s+(v?0:m())]}):g.push({op:"bcurveTo",data:[d+t+(n-t)*f+y(),p+e+(s-e)*f+y(),d+t+2*(n-t)*f+y(),p+e+2*(s-e)*f+y(),n+(v?0:y()),s+(v?0:y())]}),g}function St(t,e,n){if(!t.length)return[];const s=[];
vendor: 6,321 bytes, line 245
245s.push([t[0][0]+M(e,n),t[0][1]+M(e,n)]),s.push([t[0][0]+M(e,n),t[0][1]+M(e,n)]);for(let o=1;o<t.length;o++)s.push([t[o][0]+M(e,n),t[o][1]+M(e,n)]),o===t.length-1&&s.push([t[o][0]+M(e,n),t[o][1]+M(e,n)]);return Wt(s,null,n)}function Wt(t,e,n){const s=t.length,o=[];if(s>3){const a=[],r=1-n.curveTightness;o.push({op:"move",data:[t[1][0],t[1][1]]});for(let i=1;i+2<s;i++){const l=t[i];a[0]=[l[0],l[1]],a[1]=[l[0]+(r*t[i+1][0]-r*t[i-1][0])/6,l[1]+(r*t[i+1][1]-r*t[i-1][1])/6],a[2]=[t[i+1][0]+(r*t[i][0]-r*t[i+2][0])/6,t[i+1][1]+(r*t[i][1]-r*t[i+2][1])/6],a[3]=[t[i+1][0],t[i+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}}else s===3?(o.push({op:"move",data:[t[1][0],t[1][1]]}),o.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):s===2&&o.push(...On(t[0][0],t[0][1],t[1][0],t[1][1],n,!0,!0));return o}function Vs(t,e,n,s,o,a,r,i){const l=i.roughness===0,c=[],u=[];if(l){t=t/4,u.push([e+s*Math.cos(-t),n+o*Math.sin(-t)]);for(let h=0;h<=Math.PI*2;h=h+t){const f=[e+s*Math.cos(h),n+o*Math.sin(h)];c.push(f),u.push(f)}u.push([e+s*Math.cos(0),n+o*Math.sin(0)]),u.push([e+s*Math.cos(t),n+o*Math.sin(t)])}else{const h=M(.5,i)-Math.PI/2;u.push([M(a,i)+e+.9*s*Math.cos(h-t),M(a,i)+n+.9*o*Math.sin(h-t)]);const f=Math.PI*2+h-.01;for(let d=h;d<f;d=d+t){const p=[M(a,i)+e+s*Math.cos(d),M(a,i)+n+o*Math.sin(d)];c.push(p),u.push(p)}u.push([M(a,i)+e+s*Math.cos(h+Math.PI*2+r*.5),M(a,i)+n+o*Math.sin(h+Math.PI*2+r*.5)]),u.push([M(a,i)+e+.98*s*Math.cos(h+r),M(a,i)+n+.98*o*Math.sin(h+r)]),u.push([M(a,i)+e+.9*s*Math.cos(h+r*.5),M(a,i)+n+.9*o*Math.sin(h+r*.5)])}return[u,c]}function Ws(t,e,n,s,o,a,r,i,l){const c=a+M(.1,l),u=[];u.push([M(i,l)+e+.9*s*Math.cos(c-t),M(i,l)+n+.9*o*Math.sin(c-t)]);for(let h=c;h<=r;h=h+t)u.push([M(i,l)+e+s*Math.cos(h),M(i,l)+n+o*Math.sin(h)]);return u.push([e+s*Math.cos(r),n+o*Math.sin(r)]),u.push([e+s*Math.cos(r),n+o*Math.sin(r)]),Wt(u,null,l)}function Vl(t,e,n,s,o,a,r,i){const l=[],c=[i.maxRandomnessOffset||1,(i.maxRandomnessOffset||1)+.3];let u=[0,0];const h=i.disableMultiStroke?1:2,f=i.preserveVertices;for(let d=0;d<h;d++)d===0?l.push({op:"move",data:[r[0],r[1]]}):l.push({op:"move",data:[r[0]+(f?0:M(c[0],i)),r[1]+(f?0:M(c[0],i))]}),u=f?[o,a]:[o+M(c[d],i),a+M(c[d],i)],l.push({op:"bcurveTo",data:[t+M(c[d],i),e+M(c[d],i),n+M(c[d],i),s+M(c[d],i),u[0],u[1]]});return l}function dt(t){return[...t]}function Bs(t,e=0){const n=t.length;if(n<3)throw new Error("A curve must have at least three points.");const s=[];if(n===3)s.push(dt(t[0]),dt(t[1]),dt(t[2]),dt(t[2]));else{const o=[];o.push(t[0],t[0]);for(let i=1;i<t.length;i++)o.push(t[i]),i===t.length-1&&o.push(t[i]);const a=[],r=1-e;s.push(dt(o[0]));for(let i=1;i+2<o.length;i++){const l=o[i];a[0]=[l[0],l[1]],a[1]=[l[0]+(r*o[i+1][0]-r*o[i-1][0])/6,l[1]+(r*o[i+1][1]-r*o[i-1][1])/6],a[2]=[o[i+1][0]+(r*o[i][0]-r*o[i+2][0])/6,o[i+1][1]+(r*o[i][1]-r*o[i+2][1])/6],a[3]=[o[i+1][0],o[i+1][1]],s.push(a[1],a[2],a[3])}}return s}function Wl(t,e){return Math.sqrt(It(t,e))}function It(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function Bl(t,e,n){const s=It(e,n);if(s===0)return It(t,e);let o=((t[0]-e[0])*(n[0]-e[0])+(t[1]-e[1])*(n[1]-e[1]))/s;return o=Math.max(0,Math.min(1,o)),It(t,qe(e,n,o))}function qe(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function zl(t,e){const n=t[e+0],s=t[e+1],o=t[e+2],a=t[e+3];let r=3*s[0]-2*n[0]-a[0];r*=r;let i=3*s[1]-2*n[1]-a[1];i*=i;let l=3*o[0]-2*a[0]-n[0];l*=l;let c=3*o[1]-2*a[1]-n[1];return c*=c,r<l&&(r=l),i<c&&(i=c),r+i}function $n(t,e,n,s){const o=s||[];if(zl(t,e)<n){const a=t[e+0];o.length?Wl(o[o.length-1],a)>1&&o.push(a):o.push(a),o.push(t[e+3])}else{const r=t[e+0],i=t[e+1],l=t[e+2],c=t[e+3],u=qe(r,i,.5),h=qe(i,l,.5),f=qe(l,c,.5),d=qe(u,h,.5),p=qe(h,f,.5),g=qe(d,p,.5);$n([r,u,d,g],0,n,o),$n([g,p,f,c],0,n,o)}return o}function ql(t,e){return Bt(t,0,t.length,e)}function Bt(t,e,n,s,o){const a=o||[],r=t[e],i=t[n-1];let l=0,c=1;for(let u=e+1;u<n-1;++u){const h=Bl(t[u],r,i);h>l&&(l=h,c=u)}return Math.sqrt(l)>s?(Bt(t,e,c+1,s,a),Bt(t,c,n,s,a)):(a.length||a.push(r),a.push(i)),a}function En(t,e=.15,n){const s=[],o=(t.length-1)/3;for(let a=0;a<o;a++){const r=a*3;$n(t,r,e,s)}return n&&n>0?Bt(s,0,s.length,n):s}function Ul(t,e,n){const s=qn(t),o=Eo($o(s)),a=[];let r=[],i=[0,0],l=[];const c=()=>{l.length>=4&&r.push(...En(l,e)),l=[]},u=()=>{c(),r.length&&(a.push(r),r=[])};for(const{key:f,data:d}of o)switch(f){case"M":u(),i=[d[0],d[1]],r.push(i);break;case"L":c(),r.push([d[0],d[1]]);break;case"C":if(!l.length){const p=r.length?r[r.length-1]:i;l.push([p[0],p[1]])}l.push([d[0],d[1]]),l.push([d[2],d[3]]),l.push([d[4],d[5]]);break;case"Z":c(),r.push([i[0],i[1]]);break}if(u(),!n)return a;const h=[];for(const f of a){const d=ql(f,n);d.length&&h.push(d)}return h}const Q="none";class Kl{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Lo()}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,n,s){return{shape:e,sets:n||[],options:s||this.defaultOptions}}line(e,n,s,o,a){const r=this._o(a);return this._d("line",[X(e,n,s,o,r)],r)}rectangle(e,n,s,o,a){const r=this._o(a),i=[],l=Co(e,n,s,o,r);if(r.fill){const c=[[e,n],[e+s,n],[e+s,n+o],[e,n+o]];r.fillStyle==="solid"?i.push(dn([c],r)):i.push(Ye([c],r))}return r.stroke!==Q&&i.push(l),this._d("rectangle",i,r)}ellipse(e,n,s,o,a){const r=this._o(a),i=[],l=Io(s,o,r),c=Ln(e,n,r,l);if(r.fill)if(r.fillStyle==="solid"){const u=Ln(e,n,r,l).opset;u.type="fillPath",i.push(u)}else i.push(Ye([c.estimatedPoints],r));return r.stroke!==Q&&i.push(c.opset),this._d("ellipse",i,r)}circle(e,n,s,o){const a=this.ellipse(e,n,s,s,o);return a.shape="circle",a}linearPath(e,n){const s=this._o(n);return this._d("linearPath",[gt(e,!1,s)],s)}arc(e,n,s,o,a,r,i=!1,l){const c=this._o(l),u=[],h=js(e,n,s,o,a,r,i,!0,c);if(i&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const d=js(e,n,s,o,a,r,!0,!1,f);
245d.type="fillPath",u.push(d)}else u.push(Hl(e,n,s,o,a,r,c));return c.stroke!==Q&&u.push(h),this._d("arc",u,c)}curve(e,n){const s=this._o(n),o=[],a=Hs(e,s);if(s.fill&&s.fill!==Q)if(s.fillStyle==="solid"){const r=Hs(e,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(r.ops)})}else{const r=[],i=e;if(i.length){const c=typeof i[0][0]=="number"?[i]:i;for(const u of c)u.length<3?r.push(...u):u.length===3?r.push(...En(Bs([u[0],u[0],u[1],u[2]]),10,(1+s.roughness)/2)):r.push(...En(Bs(u),10,(1+s.roughness)/2))}r.length&&o.push(Ye([r],s))}return s.stroke!==Q&&o.push(a),this._d("curve",o,s)}polygon(e,n){const s=this._o(n),o=[],a=gt(e,!0,s);return s.fill&&(s.fillStyle==="solid"?o.push(dn([e],s)):o.push(Ye([e],s))),s.stroke!==Q&&o.push(a),this._d("polygon",o,s)}path(e,n){const s=this._o(n),o=[];if(!e)return this._d("path",o,s);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=s.fill&&s.fill!=="transparent"&&s.fill!==Q,r=s.stroke!==Q,i=!!(s.simplification&&s.simplification<1),l=i?4-4*(s.simplification||1):(1+s.roughness)/2,c=Ul(e,1,l),u=xs(e,s);if(a)if(s.fillStyle==="solid")if(c.length===1){const h=xs(e,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(dn(c,s));else o.push(Ye(c,s));return r&&(i?c.forEach(h=>{o.push(gt(h,!1,s))}):o.push(u)),this._d("path",o,s)}opsToPath(e,n){let s="";for(const o of e.ops){const a=typeof n=="number"&&n>=0?o.data.map(r=>+r.toFixed(n)):o.data;switch(o.op){case"move":s+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":s+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":s+=`L${a[0]} ${a[1]} `;break}}return s.trim()}toPaths(e){const n=e.sets||[],s=e.options||this.defaultOptions,o=[];for(const a of n){let r=null;switch(a.type){case"path":r={d:this.opsToPath(a),stroke:s.stroke,strokeWidth:s.strokeWidth,fill:Q};break;case"fillPath":r={d:this.opsToPath(a),stroke:Q,strokeWidth:0,fill:s.fill||Q};break;case"fillSketch":r=this.fillSketch(a,s);break}r&&o.push(r)}return o}fillSketch(e,n){let s=n.fillWeight;return s<0&&(s=n.strokeWidth/2),{d:this.opsToPath(e),stroke:n.fill||Q,strokeWidth:s,fill:Q}}_mergedShape(e){return e.filter((n,s)=>s===0?!0:n.op!=="move")}}const Ro="http://www.w3.org/2000/svg",Gl=800;let fn=null;function Jl(){return fn||(fn=new Kl().defaultOptions),fn}function hn(t,e,n){return{...Jl(),maxRandomnessOffset:2,roughness:t==="highlight"?3:1.5,bowing:1,stroke:"#000",strokeWidth:1.5,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,disableMultiStroke:t!=="double",disableMultiStrokeFill:!1,seed:e,...n}}function Ql(t){const e=t.padding;if(e||e===0){if(typeof e=="number")return[e,e,e,e];if(Array.isArray(e)){const n=e;if(n.length)switch(n.length){case 4:return[...n];case 1:return[n[0],n[0],n[0],n[0]];case 2:return[...n,...n];case 3:return[...n,n[1]];default:return[n[0],n[1],n[2],n[3]]}}}return[5,5,5,5]}function Yl(t,e,n,s,o,a){const r=[];let i=n.strokeWidth||2;const l=Ql(n),c=n.animate===void 0?!0:!!n.animate,u=n.iterations||2,h=n.rtl?1:0,f=hn("single",a,n);switch(n.type){case"underline":{const d=e.y+e.h+l[2];for(let p=h;p<u+h;p++)p%2?r.push(X(e.x+e.w,d,e.x,d,f)):r.push(X(e.x,d,e.x+e.w,d,f));break}case"strike-through":{const d=e.y+e.h/2;for(let p=h;p<u+h;p++)p%2?r.push(X(e.x+e.w,d,e.x,d,f)):r.push(X(e.x,d,e.x+e.w,d,f));break}case"box":{const d=e.x-l[3],p=e.y-l[0],g=e.w+(l[1]+l[3]),m=e.h+(l[0]+l[2]);for(let y=0;y<u;y++)r.push(Co(d,p,g,m,f));break}case"bracket":{const d=Array.isArray(n.brackets)?n.brackets:n.brackets?[n.brackets]:["right"],p=e.x-l[3]*2,g=e.x+e.w+l[1]*2,m=e.y-l[0]*2,y=e.y+e.h+l[2]*2;for(const v of d){let k;switch(v){case"bottom":k=[[p,e.y+e.h],[p,y],[g,y],[g,e.y+e.h]];break;case"top":k=[[p,e.y],[p,m],[g,m],[g,e.y]];break;case"left":k=[[e.x,m],[p,m],[p,y],[e.x,y]];break;case"right":k=[[e.x+e.w,m],[g,m],[g,y],[e.x+e.w,y]];break}k&&r.push(gt(k,!1,f))}break}case"crossed-off":{const d=e.x,p=e.y,g=d+e.w,m=p+e.h;for(let y=h;y<u+h;y++)y%2?r.push(X(g,m,d,p,f)):r.push(X(d,p,g,m,f));for(let y=h;y<u+h;y++)y%2?r.push(X(d,m,g,p,f)):r.push(X(g,p,d,m,f));break}case"circle":{const d=hn("double",a,n),p=e.w+(l[1]+l[3]),g=e.h+(l[0]+l[2]),m=e.x-l[3]+p/2,y=e.y-l[0]+g/2,v=Math.floor(u/2),k=u-v*2;for(let _=0;_<v;_++)r.push(Pn(m,y,p,g,d));for(let _=0;_<k;_++)r.push(Pn(m,y,p,g,f));break}case"highlight":{const d=hn("highlight",a,n);i=e.h*.95;const p=e.y+e.h/2;for(let g=h;g<u+h;g++)g%2?r.push(X(e.x+e.w,p,e.x,p,d)):r.push(X(e.x,p,e.x+e.w,p,d));break}}if(r.length){const d=Zl(r),p=[],g=[];let m=0;const y=(v,k,_)=>v.setAttribute(k,_);for(const v of d){const k=document.createElementNS(Ro,"path");
245if(y(k,"d",v),y(k,"fill","none"),y(k,"stroke",n.color||"currentColor"),y(k,"stroke-width",`${i}`),n.opacity!==void 0&&y(k,"style",`opacity:${n.opacity}`),c){const _=k.getTotalLength();p.push(_),m+=_}t.appendChild(k),g.push(k)}if(c){let v=0;for(let k=0;k<g.length;k++){const _=g[k],T=p[k],S=m?o*(T/m):0,E=s+v,R=_.style;R.strokeDashoffset=`${T}`,R.strokeDasharray=`${T}`,R.animation=`rough-notation-dash ${S}ms ease-out ${E}ms forwards`,v+=S}return zs(o+s)}}return zs(0)}function zs(t){return new Promise(e=>setTimeout(e,t))}function Zl(t){const e=[];for(const n of t){let s="";for(const o of n.ops){const a=o.data;switch(o.op){case"move":s.trim()&&e.push(s.trim()),s=`M${a[0]} ${a[1]} `;break;case"bcurveTo":s+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":s+=`L${a[0]} ${a[1]} `;break}}s.trim()&&e.push(s.trim())}return e}function Xl(){if(!window.__rno_kf_s){const t=window.__rno_kf_s=document.createElement("style");t.textContent="@keyframes rough-notation-dash { to { stroke-dashoffset: 0; } }",document.head.appendChild(t)}}var ec=Object.defineProperty,tc=(t,e,n)=>e in t?ec(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oe=(t,e,n)=>(tc(t,typeof e!="symbol"?e+"":e,n),n);class nc{constructor(e,n){oe(this,"_state","unattached"),oe(this,"_config"),oe(this,"_resizing",!1),oe(this,"_ro"),oe(this,"_seed",Lo()),oe(this,"_e"),oe(this,"_svg"),oe(this,"_lastSizes",[]),oe(this,"_animationDelay",0),oe(this,"_resizeListener",()=>{this._resizing||(this._resizing=!0,setTimeout(()=>{this._resizing=!1,this._state==="showing"&&this.haveRectsChanged()&&this.show()},400))}),oe(this,"pendingRefresh"),this._e=e,this._config=JSON.parse(JSON.stringify(n)),this.attach()}getConfig(e){return this._config[e]}setConfig(e,n){this._config[e]!==n&&(this._config[e]=n,this.refresh())}get animate(){return this._config.animate}set animate(e){this._config.animate=e}get animationDuration(){return this._config.animationDuration}set animationDuration(e){this._config.animationDuration=e}get iterations(){return this._config.iterations}set iterations(e){this._config.iterations=e}get color(){return this._config.color}set color(e){this._config.color!==e&&(this._config.color=e,this.refresh())}get class(){return this._config.class}set class(e){this._config.class!==e&&(this._config.class=e,this._svg&&this._svg.setAttribute("class",["rough-annotation",this._config.class||""].filter(Boolean).join(" ")))}get strokeWidth(){return this._config.strokeWidth}set strokeWidth(e){this._config.strokeWidth!==e&&(this._config.strokeWidth=e,this.refresh())}get padding(){return this._config.padding}set padding(e){this._config.padding!==e&&(this._config.padding=e,this.refresh())}attach(){if(this._state==="unattached"&&this._e.parentElement){Xl();const e=this._svg=document.createElementNS(Ro,"svg");e.setAttribute("class",["rough-annotation",this._config.class||""].filter(Boolean).join(" "));const n=e.style;n.position="absolute",n.top="0",n.left="0",n.overflow="visible",n.pointerEvents="none",n.width="100px",n.height="100px";const s=this._config.type==="highlight";if(this._e.insertAdjacentElement(s?"beforebegin":"afterend",e),this._state="not-showing",s){const o=window.getComputedStyle(this._e).position;(!o||o==="static")&&(this._e.style.position="relative")}this.attachListeners()}}detachListeners(){window.removeEventListener("resize",this._resizeListener),this._ro&&this._ro.unobserve(this._e)}attachListeners(){this.detachListeners(),window.addEventListener("resize",this._resizeListener,{passive:!0}),!this._ro&&"ResizeObserver"in window&&(this._ro=new window.ResizeObserver(e=>{for(const n of e)n.contentRect&&this._resizeListener()})),this._ro&&this._ro.observe(this._e)}haveRectsChanged(){if(this._lastSizes.length){const e=this.rects();if(e.length===this._lastSizes.length){for(let n=0;n<e.length;n++)if(!this.isSameRect(e[n],this._lastSizes[n]))return!0}else return!0}return!1}isSameRect(e,n){const s=(o,a)=>Math.round(o)===Math.round(a);return s(e.x,n.x)&&s(e.y,n.y)&&s(e.w,n.w)&&s(e.h,n.h)}isShowing(){return this._state!=="not-showing"}refresh(){this.isShowing()&&!this.pendingRefresh&&(this.pendingRefresh=Promise.resolve().then(()=>{this.isShowing()&&this.show(),delete this.pendingRefresh}))}async show(){switch(this._state){case"unattached":break;case"showing":this.hide(),this._svg&&await this.render(this._svg,!0);break;case"not-showing":this.attach(),this._svg&&await this.render(this._svg,!1);break}}
245hide(){if(this._svg)for(;this._svg.lastChild;)this._svg.removeChild(this._svg.lastChild);this._state="not-showing"}remove(){this._svg&&this._svg.parentElement&&this._svg.parentElement.removeChild(this._svg),this._svg=void 0,this._state="unattached",this.detachListeners()}async render(e,n){let s=this._config;n&&(s=JSON.parse(JSON.stringify(this._config)),s.animate=!1);const o=this.rects();let a=0;o.forEach(c=>a+=c.w);const r=s.animationDuration||Gl;let i=0;const l=[];for(let c=0;c<o.length;c++){const u=o[c],h=r*(u.w/a);l.push(Yl(e,o[c],s,i+this._animationDelay+(this._config.delay||0),h,this._seed)),i+=h}return this._lastSizes=o,this._state="showing",await Promise.all(l)}rects(){const e=[];if(this._svg)if(this._config.multiline){const n=this._e.getClientRects();for(let s=0;s<n.length;s++)e.push(this.svgRect(this._svg,n[s]))}else e.push(this.svgRect(this._svg,this._e.getBoundingClientRect()));return e}svgRect(e,n){const s=e.getBoundingClientRect(),o=n;return{x:(o.x||o.left)-(s.x||s.left),y:(o.y||o.top)-(s.y||s.top),w:o.width,h:o.height}}}function sc(t,e){return new nc(t,e)}function J(t,e){return t.class=[t.class,e].filter(Boolean).join(" "),t}const qs={box:t=>Object.assign(t,{type:"box"}),circle:t=>Object.assign(t,{type:"circle"}),underline:t=>Object.assign(t,{type:"underline"}),highlight:t=>Object.assign(t,{type:"highlight"}),"strike-through":t=>Object.assign(t,{type:"strike-through"}),"crossed-off":t=>Object.assign(t,{type:"crossed-off"}),bracket:t=>Object.assign(t,{type:"bracket"}),strike:t=>Object.assign(t,{type:"strike-through"}),cross:t=>Object.assign(t,{type:"crossed-off"}),crossed:t=>Object.assign(t,{type:"crossed-off"}),linethrough:t=>Object.assign(t,{type:"strike-through"}),"line-through":t=>Object.assign(t,{type:"strike-through"}),black:t=>J(t,"text-black"),blue:t=>J(t,"text-blue"),cyan:t=>J(t,"text-cyan"),gray:t=>J(t,"text-gray"),green:t=>J(t,"text-green"),indigo:t=>J(t,"text-indigo"),lime:t=>J(t,"text-lime"),orange:t=>J(t,"text-orange"),pink:t=>J(t,"text-pink"),purple:t=>J(t,"text-purple"),red:t=>J(t,"text-red"),teal:t=>J(t,"text-teal"),white:t=>J(t,"text-white"),yellow:t=>J(t,"text-yellow")},oc=[[/^delay-?(\d+)?$/,(t,e,n)=>{const s=(t[1]?Number.parseInt(t[1]):n)||300;return e.delay=s,e}],[/^(?:op|opacity)-?(\d+)?$/,(t,e,n)=>{const s=(t[1]?Number.parseInt(t[1]):n)||100;return e.opacity=s/100,e}]];function ac(){return{install(t){t.directive("mark",{name:"v-mark",mounted:(e,n)=>{const s=b(()=>{const r=typeof n.value=="object"&&!Array.isArray(n.value)?{...n.value}:{at:n.value};let i={at:r.at};const l=Object.entries(n.modifiers).filter(([u,h])=>{if(qs[u])return i=qs[u](i,h),!1;for(const[f,d]of oc){const p=u.match(f);if(p)return i=d(p,i,h),!1}return!0});l.length&&console.warn("[Slidev] Invalid modifiers for v-mark:",l);const c={...i,...r};return c.type||(c.type="underline"),c}),o=sc(e,s.value),a=Ct(e,n,s.value.at);if(!a){o.show();return}e.watchStopHandle=nt(()=>{let r;s.value.class&&(o.class=s.value.class),s.value.color&&(o.color=s.value.color);const i=s.value.at;i===!0?r=!0:i===!1?r=!1:r=a.isActive.value,r!=null&&(r?o.show():o.hide())})},unmounted:e=>{var n;(n=e.watchStopHandle)==null||n.call(e)}})}}}const jc=I(!1),xc=I(!1),Fc=I(!1),rc=I(!1),Vc=I(!0),Wc=Zo({xs:460,...sa}),zt=Xo(),Bc=ea(),zc=b(()=>zt.height.value-zt.width.value/Xs.value>120),qc=ta(Kt?document.body:null),No=na(),Uc=b(()=>{var t;return["INPUT","TEXTAREA"].includes(((t=No.value)==null?void 0:t.tagName)||"")}),Kc=b(()=>{var t;return["BUTTON","A"].includes(((t=No.value)==null?void 0:t.tagName)||"")});te("slidev-camera","default",{listenToStorageChanges:!1});te("slidev-mic","default",{listenToStorageChanges:!1});const ic=te("slidev-scale",0),Gc=te("slidev-wake-lock",!0),Jc=te("slidev-presenter-cursor",!0,{listenToStorageChanges:!1}),lc=te("slidev-show-editor",!1,{listenToStorageChanges:!1}),cc=te("slidev-editor-vertical",!1,{listenToStorageChanges:!1}),uc=te("slidev-editor-width",Kt?window.innerWidth*.4:318,{listenToStorageChanges:!1}),dc=te("slidev-editor-height",Kt?window.innerHeight*.4:300,{listenToStorageChanges:!1}),Mt=Cn(null),qt=te("slidev-presenter-font-size",1,{listenToStorageChanges:!1}),Tt=te("slidev-presenter-layout",1,{listenToStorageChanges:!1});function Qc(){Tt.value=Tt.value+1,Tt.value>2&&(Tt.value=1)}function Yc(){qt.value=Math.min(2,qt.value+.1)}function Zc(){qt.value=Math.max(.5,qt.value-.1)}const Xc=Zs(rc);function fc(t=Ks(uo,I())){const e=oa(t),n=ee([lc,cc,uc,dc,ic,zt.width,zt.height],()=>{setTimeout(e.update,300)},{flush:"post",immediate:!0});return{...e,stop:n}}function hc(t){return()=>{}}function pc(t,e,n,s=!1){var Z;function o(x){return t?st(t,x):ia(x)}const a=o(Dn),r=o(br)??{},i=o(In),l=b(()=>hc(i.value)),c=o(kr)??I(1),u=o(_r)??I(1),{left:h,top:f,stop:d}=fc(o(uo)??I()),p=["slide","presenter"].includes(a.value);let g=t?"directive":"prop",m=Bn(),y;if(Array.isArray(e)?y=e:typeof e=="string"&&e.includes(",")?y=e.split(",").map(Number):e!=null&&(g="frontmatter",m=`${e}`,e=(Z=r==null?void 0:r.dragPos)==null?void 0:Z[m],y=e==null?void 0:e.split(",").map(Number)),g!=="frontmatter"&&!n)throw new Error("[Slidev] Can not identify the source position of the v-drag element, please provide an explicit `id` prop.");const v=[d],k=!s&&e!=null&&!Number.isFinite(y==null?void 0:y[3]);y??(y=[Number.NaN,Number.NaN,0]);const _=I(y[2]),T=I(y[0]+y[2]/2),S=I(s?0:y[4]??0),E=b(()=>S.value*Math.PI/180),R=b(()=>Math.sin(E.value)),j=b(()=>Math.cos(E.value)),K=I(),z=I({left:0,top:0,width:0,height:0}),A=I(0);function N(){if(!K.value)return;const x=K.value.getBoundingClientRect();z.value={left:x.left/u.value,top:x.top/u.value,width:x.width/u.value,height:x.height/u.value},A.value=(z.value.width+z.value.height)/c.value/(Math.abs(R.value)+Math.abs(j.value))-_.value}v.push(ee(_,N,{flush:"post"}));const q=I(y[3]??0),D=k?b({get:()=>(k?A.value:q.value)||0,set:x=>!k&&(q.value=x)}):q,W=k?I(y[1]):I(y[1]+y[3]/2),re=k?b({get:()=>W.value+D.value/2,set:x=>W.value=x-D.value/2}):W,at=b(()=>Number.isFinite(T.value)?{position:"absolute",zIndex:100,left:`${T.value-_.value/2}px`,top:`${re.value-D.value/2}px`,width:`${_.value}px`,height:k?void 0:`${D.value}px`,transformOrigin:"center center",transform:`rotate(${S.value}deg)`}:{position:"absolute",zIndex:100});v.push(ee([T,re,_,D,S],([x,he,rt,it,Un])=>{let Je=[x-rt/2,he-it/2,rt].map(Math.round).join();k?Je+=g==="directive"?",NaN":",_":Je+=`,${Math.round(it)}`,Math.round(Un)!==0&&(Je+=`,${Math.round(Un)}`),g==="directive"&&(Je=`[${Je}]`),l.value(m,Je,g,n)}));const se={dragId:m,dataSource:g,markdownSource:n,isArrow:s,zoom:u,autoHeight:k,x0:T,y0:re,width:_,height:D,rotate:S,container:K,containerStyle:at,watchStopHandles:v,dragging:b(()=>Mt.value===se),mounted(){p&&(N(),e||setTimeout(()=>{N(),T.value=(z.value.left+z.value.width/2-h.value)/c.value,re.value=(z.value.top-f.value)/c.value,_.value=z.value.width/c.value,D.value=z.value.height/c.value},100))},unmounted(){p&&se.stopDragging()},startDragging(){N(),Mt.value=se},stopDragging(){Mt.value===se&&(Mt.value=null)}};return v.push(aa(K,x=>{const he=document.querySelector("#drag-control-container");he&&x.target&&he.contains(x.target)||se.stopDragging()}),ee(ra(),x=>{x||se.stopDragging()})),se}function gc(){return{install(t){t.directive("drag",{name:"v-drag",created(e,n,s){var a;const o=pc(n,n.value,(a=s.props)==null?void 0:a.markdownSource);s.props&&(s.props={...s.props},delete s.props.markdownSource),o.container.value=e,e.draggingState=o,e.dataset.dragId=o.dragId,o.watchStopHandles.push(ee(o.containerStyle,r=>{for(const[i,l]of Object.entries(r))l&&(e.style[i]=l)},{immediate:!0})),e.addEventListener("dblclick",o.startDragging)},mounted(e){e.draggingState.mounted()},unmounted(e){const n=e.draggingState;n.unmounted(),e.removeEventListener("dblclick",n.startDragging),n.watchStopHandles.forEac
245h(s=>s())}})}}}function mc(){return{install(t){const e=la();t.directive("motion",{name:"v-motion",mounted(n,s,o,a){var k,_,T;const r=st(s,Gt),i=st(s,In),l=st(s,Dn),{currentPage:c,clicks:u,isPrintMode:h}=Sn(),f=o.props={...o.props},d={...f.initial,...(k=f.variants)==null?void 0:k["slidev-initial"]},p={...f.enter,...(_=f.variants)==null?void 0:_["slidev-enter"]},g={...f.leave,...(T=f.variants)==null?void 0:T["slidev-leave"]};delete f.initial,delete f.enter,delete f.leave;const m=`${Bn()}-`,y=[];for(const S of Object.keys(f))if(S.startsWith("click-")){const E=S.slice(6),R=E.includes("-")?E.split("-").map(Number):+E,j=m+E;y.push({id:j,at:R,variant:{...f[S]},info:r==null?void 0:r.value.calculate(R)}),delete f[S]}y.sort((S,E)=>(Array.isArray(S.at)?S.at[0]:S.at)-(Array.isArray(E.at)?E.at[0]:E.at)),e.created(n,s,o,a),e.mounted(n,s,o,a);const v=n.motionInstance;v.clickIds=y.map(S=>S.id),v.set(d),v.watchStopHandle=ee([i,c,u].filter(Boolean),()=>{var E;const S=((E=Po.get(n))==null?void 0:E.visibilityState.value)??"shown";if(!(r!=null&&r.value)||!["slide","presenter"].includes((l==null?void 0:l.value)??"")){const R={...d,...p};for(const{variant:j}of y)Object.assign(R,j);v.set(R)}else if(h.value||(i==null?void 0:i.value)===c.value)if(S==="shown"){const R={...d,...p};for(const{variant:j,info:K}of y)(!K||K.isActive.value)&&Object.assign(R,j);h.value?v.set(R):v.apply(R)}else v.apply(S==="before"?d:g);else v.apply(((i==null?void 0:i.value)??-1)>c.value?d:g)},{immediate:!0})},unmounted(n){n.motionInstance.watchStopHandle()}})}}}const yc=[];function vc(){const t=[];{let e=function(n){if(!H.remote||H.remote===n.query.password)return!0;if(H.remote&&n.query.password===void 0){const s=prompt("Enter password");if(H.remote===s)return!0}return n.params.no?{path:`/${n.params.no}`}:{path:""}};t.push({name:"entry",path:"/entry",component:()=>P(()=>import("./slidev/entry-BRtIsPaM.js"),__vite__mapDeps([45,1,2,5,6,46]))},{name:"overview",path:"/overview",component:()=>P(()=>import("./slidev/overview-O8Whz400.js"),__vite__mapDeps([47,1,2,48,49,50,51,52,5,6]))},{name:"notes",path:"/notes",component:()=>P(()=>import("./slidev/notes-CsL50E1e.js"),__vite__mapDeps([53,1,2,51,52,50,5,6])),beforeEnter:e},{name:"presenter",path:"/presenter/:no",component:()=>P(()=>import("./slidev/presenter-GNZCUBNM.js"),__vite__mapDeps([54,1,2,55,48,49,50,4,5,6,56,51,52,57,58,59])),beforeEnter:e},{path:"/presenter",redirect:{path:"/presenter/1"}})}return t.push({name:"play",path:"/:no",component:()=>P(()=>import("./slidev/play-CWKASmEx.js"),__vite__mapDeps([60,2,55,48,49,1,50,4,5,6,56,61]))},{path:"",redirect:{path:"/1"}},{path:"/:pathMatch(.*)*",name:"NotFound",component:()=>P(()=>import("./slidev/404-CgGEBI5v.js"),__vite__mapDeps([62,2,5,6,63]))}),yc.reduce((e,n)=>n(e),t)}const kc=[];async function wc(t){function e(){document.documentElement.style.setProperty("--vh",`${window.innerHeight*.01}px`)}e(),window.addEventListener("resize",e);const n=ca({history:ua("/"),routes:vc()});t.use(n),t.use(lr()),t.use(wl()),t.use(ac()),t.use(gc()),t.use(mc()),t.use(fa,{container:"#twoslash-container"});const s={app:t,router:n};for(const o of kc)await o(s)}const Ho=da(kl);wc(Ho);Ho.mount("#app");export{uo as $,Tc as A,zc as B,Ot as C,zt as D,cc as E,ie as F,Mt as G,rc as H,Xc as I,Fc as J,Bc as K,Hc as L,Vc as M,Kc as N,Uc as O,Mc as P,ic as Q,Gc as R,Wc as S,No as T,Qc as U,Xt as V,kr as W,fc as X,Rn as Y,Xs as Z,oi as _,Sn as a,Ac as a0,br as a1,In as a2,Dn as a3,Gt as a4,_r as a5,Nc as a6,Ec as a7,$c as a8,Oc as a9,Bn as aa,lt as ab,Dc as ac,Sc as ad,_n as ae,pa as af,wr as ag,Cc as ah,Mr as ai,To as b,ti as c,Lc as d,Mo as e,qc as f,tt as g,Ic as h,Ns as i,Jc as j,Tt as k,lc as l,qt as m,Yc as n,Zc as o,Pc as p,gn as q,Gn as r,tn as s,Rc as t,ur as u,H as v,P as w,jc as x,xc as y,ka as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.