10 lines
332 KiB
JavaScript
10 lines
332 KiB
JavaScript
|
|
/**
|
||
|
|
* Minified by jsDelivr using Terser v5.39.0.
|
||
|
|
* Original file: /npm/markmap-lib@0.18.12/dist/browser/index.iife.js
|
||
|
|
*
|
||
|
|
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||
|
|
*/
|
||
|
|
!function(t,e){"use strict";const n={jsdelivr:t=>`https://cdn.jsdelivr.net/npm/${t}`,unpkg:t=>`https://unpkg.com/${t}`};class r{constructor(){this.providers={...n},this.provider="jsdelivr"}async getFastestProvider(t=5e3,e="npm2url/dist/index.cjs"){const n=new AbortController;let r=0;try{return await new Promise(((s,i)=>{Promise.all(Object.entries(this.providers).map((async([t,r])=>{try{await async function(t,e){const n=await fetch(t,{signal:e});if(!n.ok)throw n;await n.text()}(r(e),n.signal),s(t)}catch{}}))).then((()=>i(new Error("All providers failed")))),r=setTimeout(i,t,new Error("Timed out"))}))}finally{n.abort(),clearTimeout(r)}}async findFastestProvider(t,e){return this.provider=await this.getFastestProvider(t,e),this.provider}setProvider(t,e){e?this.providers[t]=e:delete this.providers[t]}getFullUrl(t,e=this.provider){if(t.includes("://"))return t;const n=this.providers[e];if(!n)throw new Error(`Provider ${e} not found`);return n(t)}}class s{constructor(){this.listeners=[]}tap(t){return this.listeners.push(t),()=>this.revoke(t)}revoke(t){const e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}revokeAll(){this.listeners.splice(0)}call(...t){for(const e of this.listeners)e(...t)}}function i(){}function o(t,e){return(...n)=>e(t,...n)}Math.random().toString(36).slice(2,8);
|
||
|
|
/*! @gera2ld/jsx-dom v2.2.2 | ISC License */
|
||
|
|
const a="http://www.w3.org/1999/xlink",c={show:a,actuate:a,href:a};function l(t,e,...n){return function(t,e){let n;if("string"==typeof t)n=1;else{if("function"!=typeof t)throw new Error("Invalid VNode type");n=2}return{vtype:n,type:t,props:e}}(t,e=Object.assign({},e,{children:1===n.length?n[0]:n}))}function u(t){return t.children}const h={isSvg:!1};function f(t,e){Array.isArray(e)||(e=[e]),(e=e.filter(Boolean)).length&&t.append(...e)}const d={className:"class",labelFor:"for"};function p(t,e,n,r){if(e=d[e]||e,!0===n)t.setAttribute(e,"");else if(!1===n)t.removeAttribute(e);else{const s=r?c[e]:void 0;void 0!==s?t.setAttributeNS(s,e,n):t.setAttribute(e,n)}}function m(t,e){return Array.isArray(t)?t.map((t=>m(t,e))).reduce(((t,e)=>t.concat(e)),[]):g(t,e)}function g(t,e=h){if(null==t||"boolean"==typeof t)return null;if(t instanceof Node)return t;if(2===(null==(n=t)?void 0:n.vtype)){const{type:n,props:r}=t;if(n===u){const t=document.createDocumentFragment();if(r.children){f(t,m(r.children,e))}return t}return g(n(r),e)}var n;if((t=>"string"==typeof t||"number"==typeof t)(t))return document.createTextNode(`${t}`);if((t=>1===(null==t?void 0:t.vtype))(t)){let n;const{type:r,props:s}=t;if(e.isSvg||"svg"!==r||(e=Object.assign({},e,{isSvg:!0})),n=e.isSvg?document.createElementNS("http://www.w3.org/2000/svg",r):document.createElement(r),function(t,e,n){for(const r in e)if("key"!==r&&"children"!==r&&"ref"!==r)if("dangerouslySetInnerHTML"===r)t.innerHTML=e[r].__html;else if("innerHTML"===r||"textContent"===r||"innerText"===r||"value"===r&&["textarea","select"].includes(t.tagName)){const n=e[r];null!=n&&(t[r]=n)}else r.startsWith("on")?t[r.toLowerCase()]=e[r]:p(t,r,e[r],n.isSvg)}(n,s,e),s.children){let t=e;e.isSvg&&"foreignObject"===r&&(t=Object.assign({},t,{isSvg:!1}));const i=m(s.children,t);null!=i&&f(n,i)}const{ref:i}=s;return"function"==typeof i&&i(n),n}throw new Error("mount: Invalid Vnode!")}function y(...t){return g(l(...t))}const b=function(t){const e={};return function(...n){const r=`${n[0]}`;let s=e[r];return s||(s={value:t(...n)},e[r]=s),s.value}}((t=>{document.head.append(y("link",{rel:"preload",as:"script",href:t}))})),k={};async function _(t,e){var n;const r="script"===t.type&&(null==(n=t.data)?void 0:n.src)||"";if(t.loaded||(t.loaded=k[r]),!t.loaded){const n=function(){const t={};return t.promise=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),t}();if(t.loaded=n.promise,"script"===t.type&&(document.head.append(y("script",{...t.data,onLoad:()=>n.resolve(),onError:n.reject})),r?k[r]=t.loaded:n.resolve()),"iife"===t.type){const{fn:r,getParams:s}=t.data;r(...(null==s?void 0:s(e))||[]),n.resolve()}}await t.loaded}async function v(t,e){t.forEach((t=>{var e;"script"===t.type&&(null==(e=t.data)?void 0:e.src)&&b(t.data.src)})),e={getMarkmap:()=>window.markmap,...e};for(const n of t)await _(n,e)}function w(t){return{type:"script",data:{src:t}}}function A(t){return{type:"stylesheet",data:{href:t}}}const E={_useHtmlParser2:!1};function x(t,e){if(!t)return null!=e?e:E;const n={_useHtmlParser2:!!t.xmlMode,...e,...t};return t.xml?(n._useHtmlParser2=!0,n.xmlMode=!0,!0!==t.xml&&Object.assign(n,t.xml)):t.xmlMode&&(n._useHtmlParser2=!0),n}var C,S;(S=C||(C={})).Root="root",S.Text="text",S.Directive="directive",S.Comment="comment",S.Script="script",S.Style="style",S.Tag="tag",S.CDATA="cdata",S.Doctype="doctype";const D=C.Root,T=C.Text,N=C.Directive,I=C.Comment,F=C.Script,L=C.Style,q=C.Tag,O=C.CDATA,B=C.Doctype;let $=class{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return Q(this,t)}};class M extends ${constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}}class P extends M{constructor(){super(...arguments),this.type=C.Text}get nodeType(){return 3}}class j extends M{constructor(){super(...arguments),this.type=C.Comment}get node
|
||
|
|
//# sourceMappingURL=/sm/67c2054fc56210f03623bfab1192ec2fbd118e1103cfbed4dfc0b3bea79fc2c2.map
|