代码拉取完成,页面将自动刷新
同步操作将从 Yaohaixiao/outline.js 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Outline=e()}(this,(function(){"use strict";const t=t=>Object.prototype.toString.apply(t),e=e=>"function"==typeof e||"[object Function]"===t(e),s=(t,s=300)=>!!e(t)&&setTimeout((()=>{t()}),s),i=s=>("[object Object]"===t(s)||"object"==typeof s||e(s))&&null!==s,r=e=>Array.isArray?Array.isArray(e):"[object Array]"===t(e),l=t=>{let e={};return null===t?null:(r(t)?e=Array.from(t):(e=Object.assign({},t),Object.keys(e).forEach((s=>e[s]=i(t[s])?l(t[s]):t[s]))),e)},n=t=>"string"==typeof t,o=t=>!!(i(t)&&t.nodeName&&t.tagName&&1===t.nodeType),h=(t,e)=>{const s=new RegExp("(\\s|^)"+e+"(\\s|$)");let i,r;return!!o(t)&&(i=t.className,!!i&&(r=t.classList,r?.contains?t.classList.contains(e):!!s.exec(i)))},a=(t,e)=>{let s,i;if(h(t,e))return!1;s=t.classList,s?.add?s.add(e):(i=t.className,i+=i.length>0?" "+e:e,t.className=i)},c=t=>!!n(t)&&t.replace(/(^\s+)|(\s+$)/g,""),u=(t,e)=>{let s,i=t.className;if(!i||!h(t,e))return!1;s=t.classList,s?.remove?s.remove(e):(i=c(i.replace(e,"")),t.className=i)},d=t=>t*t,m=(t=null)=>{let e,s;return t?n(t)?s=document.querySelector(t):o(t)&&(s=t):(e=document.querySelectorAll("html,body"),s=e[0].scrollTop-e[1].scrollTop>=0?e[0]:e[1]),s},p=(t,s,i)=>{const r=m(t);let l=r.scrollTop,n=0;const o=s-l,h=r.scrollHeight,a=s-h<=0?s:h,c=t=>(e(i)&&i(t),!1),u=()=>{if(n+=1,o<0){if(l-=d(n),r.scrollTop=l,l<=s)return r.scrollTop=s,c(s)}else if(l+=d(n),r.scrollTop=l,l>=a)return r.scrollTop=a,c(a);requestAnimationFrame(u)};requestAnimationFrame(u)},f=["focusout","blur","focusin","focus","load","unload","mouseenter","mouseleave"],g=(t,e,s)=>{const i=f.indexOf(e)>-1;s._delegateListener&&delete(s=s._delegateListener)._delegateListener,function(t,e,s){const i=t._listeners;let r=-1;if(i.length<1)return!1;i.forEach(((t,i)=>{const l=t.fn;e===t.type&&(r=i,l===s&&(r=i))})),r>-1&&i.splice(r,1)}(t,e,s),t.removeEventListener(e,s,i)},b=function(t,e,s=!1){const i=n(t)?document.querySelector(t):t,r=i.childNodes,l=((t,e)=>{let s=t._listeners||[];return n(e)&&e&&(s=s.filter((t=>t.type===e))),s})(i,e);l.forEach((t=>{g(i,t.type,t.fn)})),(s||!0===e||1===arguments.length)&&i&&r&&r.forEach((t=>{o(t)&&b(t,e,s)}))},y=(t,s,i)=>{if(!e(i))return b(t,s);g(t,s,i)},$=(t,s,i,r,l,n=!1)=>{const o=f.indexOf(s)>-1,h=function(e){let o=l||t;!0===l&&(o=r),!0===n&&y(t,s,h),i.call(o,e,r)};if(!e(i))return!1;t._listeners||(t._listeners=[]),t._listeners.push({el:t,type:s,fn:h,data:r,context:l,capture:o}),i._delegateListener=h,t.addEventListener(s,h,o)},v=(t,e="")=>{const s=e.replace(/^>/i,"");return!!(e&&s&&t)&&(t.matches?t.matches(s):!!t.msMatchesSelector&&t.msMatchesSelector(s))},_=t=>t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode,T=(t,e,s,i,r,l,n=!1)=>{const o=f.indexOf(s)>-1,h=function(o){const a=function(t){const e=t.target;return(s=e)&&3===s.nodeType?s.parentNode:s;var s}(o),c=((t,e,s,i)=>{const r=s||document;if(!t)return null;do{if(null!=e&&(e.startsWith(">")?t.parentNode===r&&v(t,e):v(t,e))||i&&t===r)return t;if(t===r)break}while(t=_(t))})(a,e,t);let u=l||t;o.delegateTarget=c,!0===l&&(u=r),c&&(!0===n&&y(t,s,h),i.call(u,o,r))};t._listeners||(t._listeners=[]),t._listeners.push({el:t,selector:e,type:s,fn:h,data:r,context:l,capture:o}),i._delegateListener=h,t.addEventListener(s,h,o)},w=function(t){t.stopPropagation(),t.preventDefault()},E=(t,e)=>{const s=Object.prototype.hasOwnProperty;return t&&s.call(t,e)},S=(t,e)=>{Object.keys(e).forEach((s=>{E(e,s)&&(t[s]=e[s])}))},x={},C=t=>E(x,t)&&x[t].length>0,L=(t,e=!0)=>e?C(t):(t=>{let e=C(t),s=t.lastIndexOf(".");for(;!e&&-1!==s;)s=(t=t.substring(0,s)).lastIndexOf("."),e=C(t);return e})(t),z=(e,s,i=!0)=>{const r=e=>{if(!C(e))return!1;x[e].forEach((e=>{const i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object BigInt64Array]","[object BigUint64Array]"].indexOf(t(s))>-1?s.toString():s;e.callback.call(e.context||e,i)}))},l=()=>{let t=e,s=e.lastIndexOf(".");for(;-1!==s;)t=t.substring(0,s),s=t.lastIndexOf("."),r(t);r(e),r("*")};if(!L(e))return!1;i?setTimeout(l,10):l()},k=(()=>{let t=0;return e=>(t+=1,e?e+"-"+t:"guid-"+t)})(),M=t=>{if(!E(x,t))return!1;delete x[t]},A=(t,e)=>{if(!L(t))return!1;e?(t=>{const e=Object.keys(x);if(!t||e.length<1)return!1;e.forEach((e=>{const s=x[e];let i;s.forEach(((e,r)=>{e.callback!==t&&e.token!==t||(i=e.topic,s.splice(-1,r))})),s.length<1&&M(i)}))})(e):M(t)};class N{constructor(t){this.attrs={},t&&this.initialize(t)}initialize(t){return this.attr(t).render().addListeners(),this}attr(t,e){const s=this.attrs;return n(t)?e&&E(s,t)?(s[t]=e,this):s[t]:i(t)?(S(s,t),this):0===arguments.length?s:this}render(){return this}destroy(){return this.removeListeners(),this}reload(t){return this.destroy().initialize(t),this}$emit(t,e){return z(t,e),this}$on(t,s){return((t,s,i=null)=>{const r=k();let l="symbol"==typeof t?t.toString():t;e(s)&&(x[l]||(x[l]=[]),x[l].push({topic:l,callback:s,context:i,token:r}))})(t,s,this),this}$off(t,e){return A(t,e),this}addListeners(){return this}removeListeners(){return this}}const D=[];let H,O;function q(t){for(;t.timeRemaining()>0&&D.length;){const t=D.shift();if(!e(t))return!1;t()}D.length?H=requestIdleCallback(q):(H=0,e(O)&&(O(),O=null))}void 0===window.requestIdleCallback&&(window.requestIdleCallback=function(t){const e=Date.now();return s((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),10)},window.cancelIdleCallback=function(t){clearTimeout(t)});const j=(t,s=null)=>{D.push(t),e(s)&&(O=s),H||requestIdleCallback(q)},F=t=>{let e=t.offsetTop;return null!==t.offsetParent&&(e+=F(t.offsetParent)),e},U=['<symbol id="outline-icon-up" viewBox="0 0 1024 1024"><path d="M494.784 261.696c0.832-0.448 1.536-1.216 2.368-1.536a38.72 38.72 0 0 1 46.08 8.256l277.824 302.272a41.92 41.92 0 0 1-1.536 58.048 39.104 39.104 0 0 1-56.448-1.6L513.728 355.904 260.736 626.048a39.104 39.104 0 0 1-56.448 1.088 41.6 41.6 0 0 1-1.088-57.984L483.84 269.696c0.512-0.512 1.344-0.768 1.92-1.408l1.088-1.344c2.368-2.496 5.312-3.648 8-5.248z"></path></symbol>','<symbol id="outline-icon-down" viewBox="0 0 1024 1024"><path d="M494.784 762.304c0.832 0.448 1.536 1.216 2.368 1.536 15.232 7.488 33.92 4.992 46.08-8.256l277.824-302.272a41.92 41.92 0 0 0-1.536-58.048 39.104 39.104 0 0 0-56.448 1.6l-249.344 271.232-252.992-270.144a39.104 39.104 0 0 0-56.448-1.088 41.6 41.6 0 0 0-1.088 57.984l280.576 299.456c0.512 0.512 1.344 0.768 1.92 1.408l1.088 1.344c2.368 2.496 5.312 3.648 8 5.248z"></path></symbol>','<symbol id="outline-icon-menu" viewBox="0 0 1024 1024"><path d="M320 256h640V128H320zM320 576h640V448H320zM320 896h640v-128H320zM64 256h128V128H64zM64 576h128V448H64zM64 896h128v-128H64z"></path></symbol>','<symbol id="outline-icon-file" viewBox="0 0 1024 1024"><path d="M320 640h256v128H320z"></path><path d="M320 448h384v128H320z"></path><path d="M640 0l320 320v557.696C960 958.528 909.824 1024 848 1024H176C114.176 1024 64 958.528 64 877.696V146.304C64 65.472 114.176 0 176 0H640z m0 128H192v768h640V320h-192V128z"></path></symbol>','<symbol id="outline-icon-hash" viewBox="0 0 24 24"><path d="M14.216 10l-0.444 4h-3.988l0.444-4zM15.006 2.89l-0.568 5.11h-3.988l0.543-4.89c0.061-0.549-0.335-1.043-0.883-1.104s-1.043 0.335-1.104 0.884l-0.568 5.11h-4.438c-0.552 0-1 0.448-1 1s0.448 1 1 1h4.216l-0.444 4h-3.772c-0.552 0-1 0.448-1 1s0.448 1 1 1h3.549l-0.543 4.89c-0.061 0.549 0.335 1.043 0.883 1.104s1.043-0.335 1.104-0.883l0.569-5.111h3.988l-0.543 4.89c-0.061 0.549 0.335 1.043 0.883 1.104s1.043-0.335 1.104-0.883l0.568-5.111h4.438c0.552 0 1-0.448 1-1s-0.448-1-1-1h-4.216l0.444-4h3.772c0.552 0 1-0.448 1-1s-0.448-1-1-1h-3.549l0.543-4.89c0.061-0.549-0.335-1.043-0.883-1.104s-1.043 0.335-1.104 0.883z"></path></symbol>','<symbol id="outline-icon-close" viewBox="0 0 1024 1024"><path d="M536.96 491.648L310.592 265.344a32 32 0 1 0-45.248 45.248L491.584 536.96l-226.304 226.304a32 32 0 0 0 45.312 45.248l226.24-226.304 226.304 226.304a32 32 0 0 0 45.248-45.248L582.144 536.896l226.304-226.24a32 32 0 0 0-45.248-45.248L536.896 491.584z"></path></symbol>','<symbol id="outline-icon-homepage" viewBox="0 0 26 28"><path d="M22 15.5v7.5c0 0.547-0.453 1-1 1h-6v-6h-4v6h-6c-0.547 0-1-0.453-1-1v-7.5c0-0.031 0.016-0.063 0.016-0.094l8.984-7.406 8.984 7.406c0.016 0.031 0.016 0.063 0.016 0.094zM25.484 14.422l-0.969 1.156c-0.078 0.094-0.203 0.156-0.328 0.172h-0.047c-0.125 0-0.234-0.031-0.328-0.109l-10.813-9.016-10.813 9.016c-0.109 0.078-0.234 0.125-0.375 0.109-0.125-0.016-0.25-0.078-0.328-0.172l-0.969-1.156c-0.172-0.203-0.141-0.531 0.063-0.703l11.234-9.359c0.656-0.547 1.719-0.547 2.375 0l3.813 3.187v-3.047c0-0.281 0.219-0.5 0.5-0.5h3c0.281 0 0.5 0.219 0.5 0.5v6.375l3.422 2.844c0.203 0.172 0.234 0.5 0.063 0.703z"></path></symbol>','<symbol id="outline-icon-github" viewBox="0 0 24 28"><path d="M12 2c6.625 0 12 5.375 12 12 0 5.297-3.437 9.797-8.203 11.391-0.609 0.109-0.828-0.266-0.828-0.578 0-0.391 0.016-1.687 0.016-3.297 0-1.125-0.375-1.844-0.812-2.219 2.672-0.297 5.484-1.313 5.484-5.922 0-1.313-0.469-2.375-1.234-3.219 0.125-0.313 0.531-1.531-0.125-3.187-1-0.313-3.297 1.234-3.297 1.234-0.953-0.266-1.984-0.406-3-0.406s-2.047 0.141-3 0.406c0 0-2.297-1.547-3.297-1.234-0.656 1.656-0.25 2.875-0.125 3.187-0.766 0.844-1.234 1.906-1.234 3.219 0 4.594 2.797 5.625 5.469 5.922-0.344 0.313-0.656 0.844-0.766 1.609-0.688 0.313-2.438 0.844-3.484-1-0.656-1.141-1.844-1.234-1.844-1.234-1.172-0.016-0.078 0.734-0.078 0.734 0.781 0.359 1.328 1.75 1.328 1.75 0.703 2.141 4.047 1.422 4.047 1.422 0 1 0.016 1.937 0.016 2.234 0 0.313-0.219 0.688-0.828 0.578-4.766-1.594-8.203-6.094-8.203-11.391 0-6.625 5.375-12 12-12zM4.547 19.234c0.031-0.063-0.016-0.141-0.109-0.187-0.094-0.031-0.172-0.016-0.203 0.031-0.031 0.063 0.016 0.141 0.109 0.187 0.078 0.047 0.172 0.031 0.203-0.031zM5.031 19.766c0.063-0.047 0.047-0.156-0.031-0.25-0.078-0.078-0.187-0.109-0.25-0.047-0.063 0.047-0.047 0.156 0.031 0.25 0.078 0.078 0.187 0.109 0.25 0.047zM5.5 20.469c0.078-0.063 0.078-0.187 0-0.297-0.063-0.109-0.187-0.156-0.266-0.094-0.078 0.047-0.078 0.172 0 0.281s0.203 0.156 0.266 0.109zM6.156 21.125c0.063-0.063 0.031-0.203-0.063-0.297-0.109-0.109-0.25-0.125-0.313-0.047-0.078 0.063-0.047 0.203 0.063 0.297 0.109 0.109 0.25 0.125 0.313 0.047zM7.047 21.516c0.031-0.094-0.063-0.203-0.203-0.25-0.125-0.031-0.266 0.016-0.297 0.109s0.063 0.203 0.203 0.234c0.125 0.047 0.266 0 0.297-0.094zM8.031 21.594c0-0.109-0.125-0.187-0.266-0.172-0.141 0-0.25 0.078-0.25 0.172 0 0.109 0.109 0.187 0.266 0.172 0.141 0 0.25-0.078 0.25-0.172zM8.937 21.438c-0.016-0.094-0.141-0.156-0.281-0.141-0.141 0.031-0.234 0.125-0.219 0.234 0.016 0.094 0.141 0.156 0.281 0.125s0.234-0.125 0.219-0.219z"></path></symbol>','<symbol id="outline-icon-issues" viewBox="0 0 24 28"><path d="M25.5 15c0 0.547-0.453 1-1 1h-3.5c0 1.953-0.422 3.422-1.047 4.531l3.25 3.266c0.391 0.391 0.391 1.016 0 1.406-0.187 0.203-0.453 0.297-0.703 0.297s-0.516-0.094-0.703-0.297l-3.094-3.078s-2.047 1.875-4.703 1.875v-14h-2v14c-2.828 0-4.891-2.063-4.891-2.063l-2.859 3.234c-0.203 0.219-0.469 0.328-0.75 0.328-0.234 0-0.469-0.078-0.672-0.25-0.406-0.375-0.438-1-0.078-1.422l3.156-3.547c-0.547-1.078-0.906-2.469-0.906-4.281h-3.5c-0.547 0-1-0.453-1-1s0.453-1 1-1h3.5v-4.594l-2.703-2.703c-0.391-0.391-0.391-1.016 0-1.406s1.016-0.391 1.406 0l2.703 2.703h13.188l2.703-2.703c0.391-0.391 1.016-0.391 1.406 0s0.391 1.016 0 1.406l-2.703 2.703v4.594h3.5c0.547 0 1 0.453 1 1zM18 6h-10c0-2.766 2.234-5 5-5s5 2.234 5 5z"></path></symbol>','<symbol id="outline-icon-tags" viewBox="0 0 26 28"><path d="M7 7c0-1.109-0.891-2-2-2s-2 0.891-2 2 0.891 2 2 2 2-0.891 2-2zM23.672 16c0 0.531-0.219 1.047-0.578 1.406l-7.672 7.688c-0.375 0.359-0.891 0.578-1.422 0.578s-1.047-0.219-1.406-0.578l-11.172-11.188c-0.797-0.781-1.422-2.297-1.422-3.406v-6.5c0-1.094 0.906-2 2-2h6.5c1.109 0 2.625 0.625 3.422 1.422l11.172 11.156c0.359 0.375 0.578 0.891 0.578 1.422zM29.672 16c0 0.531-0.219 1.047-0.578 1.406l-7.672 7.688c-0.375 0.359-0.891 0.578-1.422 0.578-0.812 0-1.219-0.375-1.75-0.922l7.344-7.344c0.359-0.359 0.578-0.875 0.578-1.406s-0.219-1.047-0.578-1.422l-11.172-11.156c-0.797-0.797-2.312-1.422-3.422-1.422h3.5c1.109 0 2.625 0.625 3.422 1.422l11.172 11.156c0.359 0.375 0.578 0.891 0.578 1.422z"></path></symbol>','<symbol id="outline-icon-print" viewBox="0 0 24 24"><path d="M18 3v3.984h-12v-3.984h12zM18.984 12q0.422 0 0.727-0.281t0.305-0.703-0.305-0.727-0.727-0.305-0.703 0.305-0.281 0.727 0.281 0.703 0.703 0.281zM15.984 18.984v-4.969h-7.969v4.969h7.969zM18.984 8.016q1.219 0 2.109 0.891t0.891 2.109v6h-3.984v3.984h-12v-3.984h-3.984v-6q0-1.219 0.891-2.109t2.109-0.891h13.969z"></path></symbol>','<symbol id="outline-icon-info" viewBox="0 0 1024 1024"><path d="M512 384.295982a95.994 95.994 0 0 1 95.994 95.994V928.006a95.994 95.994 0 0 1-191.988 0V480.289982a95.994 95.994 0 0 1 95.994-95.994z m0-128.375977A127.992 127.992 0 1 1 512 0.063996a127.992 127.992 0 0 1 0 255.984001z"></path></symbol>','<symbol id="outline-icon-warning" viewBox="0 0 1024 1024"><path d="M512 639.704018a95.994 95.994 0 0 1-95.994-95.994V95.994a95.994 95.994 0 0 1 191.988 0v447.716018a95.994 95.994 0 0 1-95.994 95.994z m0 128.375977A127.992 127.992 0 1 1 512 1023.936004a127.992 127.992 0 0 1 0-255.984001z"></path></symbol>','<symbol id="outline-icon-error" viewBox="0 0 1024 1024"><path d="M512.64 376.96L263.744 128 128 263.744l248.96 248.96L128 761.472l135.744 135.808 248.96-248.96 248.832 248.96 135.808-135.808-248.96-248.896 248.96-248.896L761.536 128 512.64 376.96z"></path></symbol>','<symbol id="outline-icon-success" viewBox="0 0 1024 1024"><path d="M426.368 580.864l-226.56-226.56L64 489.984l362.048 362.112 0.32-0.32 0.32 0.32 588.288-588.352L879.36 128 426.304 580.864z"></path></symbol>','<symbol id="outline-icon-circle-info" viewBox="0 0 1024 1024"><path d="M512 810.666667s-42.666667 4.266667-42.666667-42.666667v-341.333333c0-46.933333 42.666667-42.666667 42.666667-42.666667s42.666667-4.266667 42.666667 42.666667v341.333333c0 46.933333-42.666667 42.666667-42.666667 42.666667z m0 213.333333C228.949333 1024 0 795.050667 0 512S228.949333 0 512 0s512 228.949333 512 512-229.674667 512-512 512z m0-938.666667C276.608 85.333333 85.333333 276.608 85.333333 512s191.274667 426.666667 426.666667 426.666667 426.666667-191.274667 426.666667-426.666667S747.392 85.333333 512 85.333333z m0 213.333334c-23.466667 0-42.666667-19.2-42.666667-42.666667s19.2-42.666667 42.666667-42.666667 42.666667 19.2 42.666667 42.666667-19.2 42.666667-42.666667 42.666667z"></path></symbol>','<symbol id="outline-icon-circle-warning" viewBox="0 0 1024 1024"><path d="M512 213.333333s-42.666667-4.266667-42.666667 42.666667v341.333333c0 46.933333 42.666667 42.666667 42.666667 42.666667s42.666667 4.266667 42.666667-42.666667V256c0-46.933333-42.666667-42.666667-42.666667-42.666667z m0-213.333333C228.949333 0 0 228.949333 0 512s228.949333 512 512 512 512-228.949333 512-512S794.325333 0 512 0z m0 938.666667C276.608 938.666667 85.333333 747.392 85.333333 512S276.608 85.333333 512 85.333333s426.666667 191.274667 426.666667 426.666667-191.274667 426.666667-426.666667 426.666667z m0-213.333334c-23.466667 0-42.666667 19.2-42.666667 42.666667s19.2 42.666667 42.666667 42.666667 42.666667-19.2 42.666667-42.666667-19.2-42.666667-42.666667-42.666667z"></path></symbol>','<symbol id="outline-icon-circle-error" viewBox="0 0 1024 1024"><path d="M512 0a512 512 0 1 0 512 512 512 512 0 0 0-512-512z m0 955.776A443.84 443.84 0 0 1 512 68.224a443.904 443.904 0 0 1 0 887.552z"></path><path d="M641.664 326.144a32 32 0 0 1 50.304 39.168l-3.52 4.48-306.112 328.064a32 32 0 0 1-50.304-39.168l3.52-4.48 306.112-328.064z"></path><path d="M324.608 337.088a32 32 0 0 1 40.704-5.12l4.48 3.584 328.064 306.112a32 32 0 0 1-39.168 50.304l-4.48-3.52-328.064-306.112a32 32 0 0 1-1.536-45.248z"></path></symbol>','<symbol id="outline-icon-circle-success" viewBox="0 0 1024 1024"><path d="M512 0C228.949333 0 0 228.949333 0 512s228.949333 512 512 512 512-228.949333 512-512S794.325333 0 512 0z m0 950.869333C269.909333 950.869333 73.130667 754.090667 73.130667 512 73.130667 269.909333 269.909333 73.130667 512 73.130667c242.090667 0 438.869333 196.778667 438.869333 438.869333 0 242.090667-196.778667 438.869333-438.869333 438.869333z"></path><path d="M737.834667 353.834667a42.666667 42.666667 0 0 1 63.872 56.32l-3.541334 4.010666L486.997333 725.333333a85.333333 85.333333 0 0 1-115.242666 4.992L366.336 725.333333l-140.501333-140.501333a42.666667 42.666667 0 0 1 56.32-63.872l4.010666 3.541333L426.666667 665.002667l311.168-311.168z"></path></symbol>'],I=(t,e="icon")=>n(t)?((t,e="icon")=>{const s=/id="(.*?)"/,i=/^(\w+)-/;return U.find((r=>{const l=s.exec(r)[1];return i.exec(l)[1]===e&&l===("icon"===e?`${e}-${t}`:`${e}-icon-${t}`)}))})(t,e):[...U],R=(t="")=>{const e=document.body;let s=document.querySelector("#outline-icons"),i=[];(t=>{if(!t)return!1;r(t)&&t.length>0?t.forEach((t=>{-1===U.indexOf(t)&&n(t)&&U.push(t)})):n(t)&&U.push(t)})(t),i=I(),s?s.innerHTML=i.join(""):(s=document.createElement("div"),s.innerHTML=`<svg id="outline-icons" aria-hidden="true" style="position:absolute;display:none;width:0;height:0;overflow:hidden;">${i.join("")}</svg>`,e.insertBefore(s.firstChild,e.firstChild))},B=e=>{return!(!i(e)||!(o(e)||(e=>!(!i(e)||"[object NodeList]"!==t(e)))(e)||(s=e,i(s)&&"[object DocumentFragment]"===t(s))||(e=>!(!i(e)||!("[object Text]"===t(e)||e.tagName&&3===e.nodeType)))(e)));var s},P=(t,e,s)=>{let i=t.tagName.toLowerCase();switch(e){case"style":t.style.cssText=s;break;case"value":"input"===i||"textarea"===i?t.value=s:t.setAttribute(e,s);break;case"htmlFor":t.setAttribute("for",s);break;case"className":t.className=s;break;case"innerHTML":t.innerHTML=s;break;case"innerText":t.innerText=s;break;default:t.setAttribute(e,s)}},V=(t,e)=>{if(!t||!i(e))return!1;Object.keys(e).forEach((s=>{const i=e[s];E(e,s)&&P(t,s,i)}))},Q=(t,e,s)=>{const l=document.createDocumentFragment(),o=document.createElement(t),h=t=>B(t)||n(t),a=t=>{let e;if(!h(t))return!1;B(t)?e=t:n(t)&&(e=document.createTextNode(t)),l.appendChild(e)};return i(e)?V(o,e):r(e)&&e.every((t=>h(t)))?e.forEach((t=>{a(t)})):B(e)?a(e):n(e)&&a(document.createTextNode(e)),r(s)?s.forEach((t=>{a(t)})):a(s),o.appendChild(l),o},W=(t,e={})=>{const s="outline-icon",i=e.size||0,l=e.color||"",o=e.iconSet||"",h=r(i)?i[0]:i,a=r(i)?i[1]:i,c=i?`width:${h}px;height:${a}px;`:"",u=l?c+`color:${l}`:c,d=e.attrs||{},m=document.createElement("i");let p,f="",g="";return n(t)?((t=>{const e=new RegExp("^\\s*(?:<\\?xml[^>]*>\\s*)?(?:<\\!doctype svg[^>]*\\s*(?:\\[?(?:\\s*<![^>]*>\\s*)*\\]?)*[^>]*>\\s*)?<svg[^>]*>[^]*<\\/svg>\\s*$\\s*$","i");return n(t)&&e.test(t)})(t)?g=t:(f=o&&"icon"!==o?`xlink:href="#${o}-icon-${t}"`:`xlink:href="#icon-${t}"`,g=`<svg><use ${f}></use></svg>`),m.innerHTML=g,d.className?d.className=`${s} ${d.className}`:d.className=s,V(m,d),p=m.querySelector("svg"),V(p,{"aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg",class:"outline-icon__svg",width:200,height:200,style:u}),m):null},J=(t,e={})=>W(t,e),Y=(t,e=!0,s=!0)=>{const i="outline-heading",r=t.innerHTML;let l;if(t.innerHTML=r.replace(/^\d+(\.?\d+)*\s?/gi,""),t.removeAttribute("id"),t.removeAttribute("data-id"),u(t,i),!e)return!1;var o;l=t.querySelector(`.${i}__anchor`),s&&u(t,`${i}_start`),o=c(t.className),n(o)&&""===o&&t.removeAttribute("class"),t.removeChild(l)},G=(t,s=!0,i=null)=>{let l=1,o=0,h="";const a=[];return t.forEach(((t,s)=>{const r=t.tagName,u=r.replace(/h/i,"");let d=parseInt(u,10),m=-1;var p;d>l?(o+=1,m=1===o?-1:s-1):d===l||d<l&&d>o?1===d?(o=1,m=-1):m=a[s-1].pid:d<=o&&(1===d?o=1:(o-=l-d,o<=1&&(o=1)),m=1===o?-1:((t,e,s)=>{let i,r,l=t[s-1];for(r=0;r<e;r+=1)i=l.pid,l=t[i];return i=l.pid,i})(a,l-d,s)),l=d,p=c(t.innerHTML),h=n(p)?p.replace(/<\/?[^>]+(>|$)/g,""):"",e(i)&&(h=i(h)),a.push({id:s,pid:m,level:o,rel:`heading-${s}`,text:h,tagName:r})})),s?(t=>{const e={};return t.forEach((t=>{const s=JSON.stringify((t=>[t.pid])(t));e[s]=e[s]||[],e[s].push(t),t.index=e[s].length,-1===t.pid&&(t.code=String(t.index))})),Object.keys(e).forEach((t=>{e[t].forEach((t=>{const s=e[`[${t.id}]`];if(!s||!r(s))return!1;s.forEach((e=>{e.code=t.code+"."+e.index}))}))})),t})(a):a};class K extends N{constructor(t){super(),this.attrs=K.DEFAULTS,this.$articleElement=null,this.$scrollElement=null,this.$headings=[],this.chapters=[],t&&this.initialize(t)}initialize(t){const s=this.attr("showCode")||!0;let i,r,l,h,a;return this.attr(t),a=this.attr("articleElement"),r=this.attr("scrollElement"),l=this.attr("selector"),i=this.attr("created"),n(a)?h=document.querySelector(a):o(a)&&(h=a),h?(this.$articleElement=h,this.$scrollElement=m(r),this.$headings=[...h.querySelectorAll(l)],this.$headings.length<1||(this.chapters=G(this.$headings,s,this.attr("chapterTextFilter")),e(i)&&i.call(this),this.render().addListeners()),this):this}getChapters(t=!1){const e=this.chapters;return t?((t,e,s)=>{const i={},r=[];return t.forEach(((t,s)=>{i[t[e]]=s,t.children=[]})),t.forEach((e=>{const l=t[i[e[s]]];-1!==e[s]?l.children.push(e):r.push(e)})),r})(e,"id","pid"):e}count(){return this.chapters.length}render(){const t=400,s=this.attr("mounted"),i=this.attr("hasAnchor"),r=this.attr("isAtStart"),l=this.attr("showCode"),n=this.attr("anchorURL"),o=this.count(),h=[...this.$headings],a=this.getChapters(),u=(e,s)=>{e.forEach(((e,o)=>{const h=o+s*t,u=a[h].code;((t,e,s)=>{const i="outline-heading",r=s.hasAnchor||!0,l=s.isAtStart||!0,n=s.showCode||!1,o=s.chapterCode||"",h=s.anchorURL||"",a=`heading-${e}`,u={id:a,className:l?`${i} ${i}_start`:i,"data-id":e},d=c(t.innerHTML);let m,p;if(n&&(u.innerHTML=o+" "+d),V(t,u),!r)return!1;p=J("hash",{iconSet:"outline"}),m=Q("a",{id:`anchor-${e}`,className:`${i}__anchor anchor-${e}`,href:h||`#${a}`,target:h?"_blank":"self","data-id":e},p),t.appendChild(m)})(e,h,{hasAnchor:i,isAtStart:r,showCode:l,chapterCode:u,anchorURL:n})}))};let d=-1;if(R(),o>t)for(d+=1,u(h.splice(0,t),0);h.length>0;){const e=h.splice(0,t);j((()=>{u(e,d+=1)}),(()=>{this.$emit("anchors:all:paint")}))}else u(h,0);return e(s)&&s.call(this),this}scrollTo(t,e){const s=this.$scrollElement;return p(s,t,e),this}destroy(){const t=this.attr("hasAnchor"),s=this.attr("isAtStart"),i=this.attr("beforeDestroy"),r=this.attr("afterDestroy"),l=this.$headings;return e(i)&&i.call(this),this.removeListeners(),l.forEach((e=>{Y(e,t,s)})),this.attr(K.DEFAULTS),this.$articleElement=null,this.$scrollElement=null,this.$headings=[],this.chapters=[],e(r)&&r.call(this),this}onAnchorTrigger(t){const i=this.attr("anchorURL"),r=this.attr("afterScroll"),l=this.attr("stickyHeight"),n=t.delegateTarget.parentNode,o=F(n)-(l+10),h=this.$scrollElement,a=h.scrollHeight-h.clientHeight;return this.scrollTo(o,(()=>{e(r)&&r.call(this,"anchor"),s((()=>{this.$emit("toolbar:update",{top:o,min:0,max:a})}))})),i||w(t),this}addListeners(){const t=this.$articleElement;return this.count()<1||T(t,".outline-heading__anchor","click",this.onAnchorTrigger,this,!0),this}removeListeners(){const t=this.$articleElement;return this.count()<1||y(t,"click",this.onAnchorTrigger),this}}K.DEFAULTS={scrollElement:"html,body",articleElement:"#article",selector:"h1,h2,h3,h4,h5,h6",stickyHeight:0,anchorURL:"",hasAnchor:!0,isAtStart:!0,showCode:!1,created:null,mounted:null,afterScroll:null,beforeDestroy:null,afterDestroy:null,chapterTextFilter:null};const X=(t,e)=>{document.documentElement.style.setProperty(t,e)};let Z=2e3;const tt=t=>(t?Z=t:Z+=1,X("--outline-zIndex",`${Z}`),Z);class et extends N{constructor(t){super(),this.attrs=l(et.DEFAULTS),this.title="",this.closed=!0,this.$el=null,this.$modal=null,this.$header=null,this.$title=null,this.$close=null,this.$main=null,this.$footer=null,this.$overlay=null,this.zIndex=0,t&&this.initialize(t)}initialize(t){let s;return this.attr(t),this.title=this.attr("title"),s=this.attr("created"),e(s)&&s.call(this),this.render().addListeners(),this}setTitle(t){return this.attr("title",t),this.title=t,this.$title.innerHTML=t,this}isClosed(){return this.closed}render(){const t=this.attr("mounted"),s=this.attr("size"),i=this.attr("placement"),r=this.attr("hasClose"),l=this.attr("hasOverlay"),n=this.attr("hasOffset"),o=this.attr("hasPadding"),h=this.attr("autoHeight"),c=this.attr("customClass");let u,d,m,p,f,g,b,y;return R(),this.zIndex=tt(),p=Q("h2",{className:"outline-drawer__title"},this.title),this.$title=p,r&&(f=Q("div",{className:"outline-drawer__close"},J("close",{iconSet:"outline",size:20})),this.$close=f),m=Q("header",{className:"outline-drawer__header"},[p,f]),this.$header=m,g=Q("div",{className:"outline-drawer__main"}),this.$main=g,o||a(g,"outline-drawer_full"),b=Q("footer",{className:"outline-drawer__footer"}),this.$footer=b,d=Q("div",{className:`outline-drawer__modal outline-drawer_${i} outline-drawer_${s} outline-drawer_closed`},[m,g,b]),this.$modal=d,n&&a(d,"outline-drawer_offset"),h&&a(d,"outline-drawer_auto"),c&&a(d,c),l&&(y=Q("div",{className:"outline-drawer__overlay"}),this.$overlay=y),u=Q("div",{className:"outline-drawer"},[d,y]),this.$el=u,document.body.appendChild(u),e(t)&&t.call(this),this}open(){const t=this.attr("afterOpened"),i=this.$modal;return a(this.$el,"outline-drawer_opened"),u(i,"outline-drawer_closed"),a(i,"outline-drawer_opened"),s((()=>{this.closed=!1,e(t)&&t.call(this)})),this}close(){const t=this.attr("afterClosed"),i=this.$modal;return u(i,"outline-drawer_opened"),a(i,"outline-drawer_closed"),s((()=>{u(this.$el,"outline-drawer_opened"),this.closed=!0,e(t)&&t.call(this)})),this}toggle(){const t=this.attr("afterToggle"),i=this.isClosed();return i?this.open():this.close(),e(t)&&s((()=>{t.call(this,i)})),this}destroy(){const t=this.attr("afterDestroy"),s=this.attr("beforeDestroy");let i=this.zIndex;return e(s)&&s.call(this),this.removeListeners(),this.attrs=et.DEFAULTS,this.title="",this.closed=!1,this.$el=null,this.$modal=null,this.$header=null,this.$title=null,this.$close=null,this.$main=null,this.$footer=null,this.$overlay=null,i-=1,tt(i),this.zIndex=0,e(t)&&t.call(this),this}addListeners(){const t=this.attr("hasClose"),e=this.attr("hasOverlay"),s=this.$el;return t&&T(s,".outline-drawer__close","click",this.onClose,this,!0),e&&T(s,".outline-drawer__overlay","click",this.onClose,this,!0),this}removeListeners(){const t=this.attr("hasClose"),e=this.attr("hasOverlay"),s=this.$el;return t||e?(y(s,"click",this.onClose),this):this}onClose(){return this.close(),this}}et.DEFAULTS={placement:"rtl",title:"标题",size:"regular",hasClose:!0,hasOverlay:!0,hasOffset:!1,hasPadding:!0,autoHeight:!0,created:null,mounted:null,afterClosed:null,afterOpened:null,afterScroll:null,beforeDestroy:null,afterDestroy:null,afterToggle:null};const st=(t,e)=>getComputedStyle(t)[e];class it extends N{constructor(t){super(),this.attrs=l(it.DEFAULTS),this._init(),this.scrollTimer=null,this.resizeTimer=null,this.observerTimer=null,this.Observer=null,t&&this.initialize(t)}_init(){return this.$el=null,this.$title=null,this.$main=null,this.$list=null,this.$placeholder=null,this.$parentElement=null,this.$scrollElement=null,this.$active=null,this.chapters=[],this.active=0,this.offsetWidth=0,this.offsetTop=0,this.playing=!1,this.closed=!1,this}initialize(t){let s,i,r,l;return this.attr(t),s=this.attr("created"),i=this.attr("parentElement"),r=this.attr("scrollElement"),n(i)?l=document.querySelector(i):o(i)&&(l=i),this.$parentElement=l,this.$scrollElement=m(r),this.chapters=this.attr("chapters"),this.closed=this.attr("closed"),this.active=this.attr("active"),e(s)&&s.call(this),this.chapters.length<1||(this.render().addListeners(),this.$active=document.querySelector(`#chapter-${this.active}`)),this}isClosed(){return this.closed}isSticky(){return"sticky"===this.attr("position")}isFixed(){return"fixed"===this.attr("position")}isInside(){return this.isFixed()||this.isSticky()}isOutside(){return!this.isInside()}count(){return this.chapters.length}_paintEdge(){const t=document.createDocumentFragment(),e=this.attr("title"),s=this.attr("animationCurrent"),i=this.attr("customClass"),r=this.$parentElement,l=[],n=[];let o,h,c,u,d=null;return r?(this.isInside()&&e&&(d=Q("h2",{className:"outline-chapters__title"},e),this.$title=d,n.push(d)),c=Q("ul",{className:"outline-chapters__list"}),this.$list=c,l.push(c),s&&(u=Q("div",{className:"outline-chapters__placeholder"}),this.$placeholder=u,l.push(u)),h=Q("div",{className:"outline-chapters__main"},l),this.$main=h,n.push(h),o=Q("nav",{id:"outline-chapters",className:"outline-chapters outline-chapters_hidden"},n),this.$el=o,this.isSticky()&&(this.calculateStickyHeight(),a(o,"outline-chapters_sticky")),i&&a(o,i),t.appendChild(o),r.appendChild(t),this):this}render(){const t=this.attr("showCode"),i=this.attr("mounted"),r=this.$parentElement,l=this.chapters,n=this.count();let o,h;return!r||l.length<1||(this.isInside()&&a(r,"outline-chapters-parent"),this._paintEdge(),o=this.$el,h=this.$list,((t,e,s=!1)=>{const i=e.length,r=[...e],l=e=>{const i=e=>t.querySelector(`#${e}`);e.forEach((e=>{const r=e.pid,l=e.id,n=e.rel,o=[],h=Q("span",{className:"outline-chapters__text"},e.text);let a,c,u,d,m;s&&(c=Q("span",{className:"outline-chapters__code","data-id":l},e.code),o.push(c)),o.push(h),a=Q("a",{id:`chapter__anchor-${l}`,className:"outline-chapters__anchor",href:"#"+n,rel:n,"data-id":l},o),u=Q("li",{id:`chapter-${l}`,className:"outline-chapters__item","data-id":l},a),-1===r?t.appendChild(u):(m=i(`chapter-${r}`),d=i(`subject-${r}`),d?d.appendChild(u):(d=Q("ul",{id:"subject-"+r,className:"outline-chapters__subject"},u),m.appendChild(d)))}))};if(i>400)for(l(r.splice(0,400));r.length>0;){const t=r.splice(0,400);j((()=>{l(t)}))}else l(r)})(h,l,t),u(o,"outline-chapters_hidden"),s((()=>{this.highlight(this.active)}),60),this.offsetTop=F(o),this.offsetWidth=o.offsetWidth,this.isFixed()&&(this.sticky(),X("--outline-chapters-width",`${this.offsetWidth}px`)),e(i)&&i.call(this),n<400&&this.onObserver()),this}positionPlaceholder(t){const e=this.$main,s=this.$list,i=this.$placeholder,r=s.querySelector(".outline-chapters__anchor"),l=this.attr("animationCurrent"),n=parseInt(st(e,"padding-top"),10),o=parseInt(st(e,"border-top-width"),10),h=parseInt(st(s,"padding-top"),10),a=parseInt(st(s,"margin-top"),10),c=parseInt(st(s,"border-top-width"),10);let u,d=r.offsetHeight,m=0;return l?(n&&(m+=n),h&&(m+=h),a&&(m+=a),o&&(m+=o),c&&(m+=c),u=d*t,i.style.cssText=`transform: translateY(${m+u}px);height:${d}px;`,this):this}highlight(t){const e=this.$el,s=this.attr("animationCurrent"),i="outline-chapters_active",r="outline-chapters_highlight";let l=null;return e?(l=e.querySelector(`#chapter__anchor-${t}`),l?(this.active=parseInt(l.getAttribute("data-id"),10),this.$active&&(u(this.$active,r),u(this.$active,i)),this.$active=l,a(this.$active,i),s?this.positionPlaceholder(this.active):a(this.$active,r),this):this):this}sticky(){const t=this.attr("afterSticky"),s="outline-chapters_fixed",i=this.$el,r=this.offsetTop,l=this.$scrollElement.scrollTop;let n;return this.isFixed()?(n=l>=r,n?a(i,s):u(i,s),e(t)&&t.call(this,this.isClosed(),n),this):this}calculateStickyHeight(){const t=document.documentElement,e=Math.max(t.clientHeight||0,window.innerHeight||0);return X("--outline-sticky-height",`${e}px`),this}scrollTo(t,e){const s=this.$scrollElement;return p(s,t,e),this}show(){const t="outline-chapters_hidden",i=this.attr("afterOpened"),r=this.count(),l=this.$el,n=this.$parentElement;return this.isInside()?r>800?u(n,t):(u(n,t),s((()=>{u(n,"outline-chapters_folded")}),30)):u(l,t),this.closed=!1,e(i)&&i.call(this),this}hide(){const t="outline-chapters_hidden",i=this.attr("afterClosed"),r=this.count(),l=this.$el,n=this.$parentElement;return this.isInside()?r>800?a(n,t):(a(n,"outline-chapters_folded"),s((()=>{a(n,t)}))):a(l,t),this.closed=!0,e(i)&&i.call(this),this}toggle(){const t=this.attr("afterToggle"),i=this.offsetTop,r=this.$scrollElement.scrollTop;let l;return this.isClosed()?this.show():this.hide(),e(t)&&s((()=>{l=r>=i,t.call(this,this.isClosed(),l)})),this}destroy(){const t=this.attr("beforeDestroy"),s=this.attr("afterDestroy");return e(t)&&t.call(this),this.removeListeners(),this.attr(it.DEFAULTS),this.scrollTimer&&(clearTimeout(this.scrollTimer),this.scrollTimer=null),this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=null),this.observerTimer&&(clearTimeout(this.observerTimer),this.observerTimer=null),this.Observer&&(this.Observer=null),this.$parentElement.removeChild(this.$el),this._init(),e(s)&&s.call(this),this}onObserver(){const t=this.attr("selector");return this.Observer=((t,s={})=>{const i=s.root||null,r=s.selector||".outline-heading",l=s.context||null,n={rootMargin:s.rootMargin||"0px 0px -90% 0px"},h=new IntersectionObserver((s=>{s.forEach((s=>{s.intersectionRatio>0&&e(t)&&t.call(l||s.target,s.target)}))}),n),a=o(i)?i:document;return i&&(n.root=i),a.querySelectorAll(r).forEach((t=>{h.observe(t)})),h})((t=>{const e=t.getAttribute("data-id");if(this.playing)return!1;this.observerTimer&&clearTimeout(this.observerTimer),this.observerTimer=s((()=>{this.highlight(e)}),100)}),{selector:t,context:this}),this}onSelect(t){const i=this.attr("stickyHeight"),r=t.delegateTarget,l=r.getAttribute("data-id"),n=r.href.split("#")[1],o=document.querySelector(`#${n}`),h=F(o)-(i+10),a=this.$scrollElement.scrollHeight,c=this.attr("afterScroll"),u=()=>{e(c)&&c.call(this,"chapter"),s((()=>{this.playing=!1,this.$emit("toolbar:update",{top:h,min:0,max:a})}))};return this.playing=!0,this.isFixed()?(this.sticky(),s((()=>{this.scrollTo(h,u),this.highlight(l)}),10)):(this.scrollTo(h,u),this.highlight(l)),w(t),this}onScroll(){const t=this.$scrollElement;return this.scrollTimer&&clearTimeout(this.scrollTimer),this.scrollTimer=s((()=>{const e=t.scrollTop,s=t.scrollHeight-t.clientHeight;this.isFixed()&&this.sticky(),this.$emit("toolbar:update",{top:e,min:0,max:s})}),100),this}onResize(){return this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=s((()=>{this.calculateStickyHeight()})),this}addListeners(){const t=this.$el,e=this.$scrollElement,s=e.tagName.toLowerCase();let i=e;return this.count()<1||("html"!==s&&"body"!==s||(i=window),T(t,".outline-chapters__anchor","click",this.onSelect,this,!0),$(i,"scroll",this.onScroll,this,!0),this.isSticky()&&$(window,"resize",this.onResize,this,!0),this.$on("anchors:all:paint",this.onObserver,this)),this}removeListeners(){const t=this.attr("selector"),e=this.$el,s=this.$scrollElement,i=s.tagName.toLowerCase();let r=s;return this.count()<1||("html"!==i&&"body"!==i||(r=window),y(e,"click",this.onSelect),y(r,"scroll",this.onScroll),this.isSticky()&&$(window,"resize",this.onResize),this.$off("anchors:all:paint"),this.Observer&&document.querySelectorAll(t).forEach((t=>{this.Observer.unobserve(t)}))),this}}it.DEFAULTS={parentElement:"",scrollElement:"",selector:".outline-heading",active:0,closed:!1,showCode:!0,animationCurrent:!0,position:"relative",stickyHeight:0,chapters:[],created:null,mounted:null,afterClosed:null,afterOpened:null,afterScroll:null,beforeDestroy:null,afterDestroy:null,afterSticky:null};const rt=(t,e=!0)=>{const s=J(t.icon,{iconSet:t.iconSet||"outline",color:t.color||"",size:t.size}),i=Q("a",{className:"outline-toolbar__anchor",href:t.link},s),r=Q("div",{className:`outline-toolbar__button ${t.name}`},[t.link?i:s]);return a(s,"outline-toolbar__icon"),e&&a(r,"outline-toolbar_rounded"),t.disabled&&a(r,"outline-toolbar_disabled"),r},lt="outline-toolbar_disabled",nt="outline-toolbar_hidden";class ot extends N{constructor(t){super(),this.attrs=l(ot.DEFAULTS),this.$el=null,this.disabled=!1,this.closed=!1,this.buttons=[],t&&this.initialize(t)}initialize(t){let s;return this.attr(t),s=this.attr("created"),this.disabled=this.attr("disabled"),this.closed=this.attr("closed"),e(s)&&s.call(this),this.render().addListeners(),this}isDisabled(t){const e=this.attr("buttons");let s;return t?(s=e.find((e=>e.name===t)),s?.disabled):this.disabled}isClosed(){return this.closed}highlight(t){const e=this.buttons.find((e=>e.name===t)),s="outline-toolbar_active";let i;return i||(i=e.$el,h(i,s)?u(i,s):a(i,s)),this}render(){const t=this.attr("mounted"),s=this.attr("buttons")||[],i=this.attr("rounded"),r=this.attr("placement"),l=[];return R(),s.forEach((t=>{const e=rt(t,i);l.push(e),this.buttons.push({name:t.name,$el:e})})),this.$el=Q("div",{id:"outline-toolbar",className:`outline-toolbar outline-toolbar_${r}`},l),document.body.appendChild(this.$el),this.closed&&this.hide(),this.disabled&&this.disable(),e(t)&&t.call(this),this}add(t){const s=this.$el,l=this.attr("buttons"),n=t.action,o=document.createDocumentFragment();let h;return i(t)?(l.push(t),o.appendChild(rt(t))):r(t)&&t.forEach((t=>{o.appendChild(rt(t))})),s.appendChild(o),n&&e(n.handler)&&(h=n.type||"click",T(s,`.${t.name}`,h,n.handler)),this}remove(t){const e=this.$el,s=this.attr("buttons"),i=s.find((e=>e.name===t));let r,l=-1;return i?(s.forEach(((e,s)=>{e.name===t&&(l=s)})),l>-1&&this.attr().buttons.splice(l,1),r=e.querySelector(`.${t}`),this.switch(t,!1),e.removeChild(r),this):this}switch(t,e){const s=this.$el,i=this.attr("buttons"),r=i.find((e=>e.name===t));let l,n,o,h;return r?(i.forEach((s=>{s.name===t&&(r.disabled=!e)})),l=r.action,h=s.querySelector(`.${t}`),l&&(n=l.type||"click",o=l.handler),e?(u(h,lt),n&&o&&T(s,`.${t}`,n,o)):(a(h,lt),n&&o&&y(s,n,o)),this):this}disable(t){const s=this.attr("afterDisabled");return t?this.switch(t,!1):(a(this.$el,lt),this.removeListeners(),this.disabled=!0,e(s)&&s.call(this)),this}enable(t){const s=this.attr("afterEnabled");return t?this.switch(t,!0):(this.disabled=!1,u(this.$el,lt),this.addListeners(),e(s)&&s.call(this)),this}show(t){const i=this.attr("afterOpened"),r=this.attr("buttons").find((e=>e.name===t)),l=this.$el;let n;if(t){if(!r)return this;n=l.querySelector(`.${t}`),u(n,nt)}else u(l,nt),this.closed=!1,e(i)&&s((()=>{i.call(this)}),310);return this}hide(t){const i=this.attr("afterClosed"),r=this.attr("buttons").find((e=>e.name===t)),l=this.$el;let n;if(t){if(!r)return this;n=l.querySelector(`.${t}`),a(n,nt)}else a(l,nt),this.closed=!0,e(i)&&s((()=>{i.call(this)}),310);return this}toggle(){return this.isClosed()?this.show():this.hide(),this}destroy(){const t=this.attr("beforeDestroy"),s=this.attr("afterDestroy");let i=this.$el;return e(t)&&t.call(this),this.removeListeners(),document.body.removeChild(i),i=null,this.attr(ot.DEFAULTS),this.disabled=!1,this.closed=!1,this.buttons=[],e(s)&&s.call(this),this}refresh(){const t=this.$el,e=this.attr("buttons")||[];return this.removeListeners(),t.innerHTML="",e.forEach((t=>{this.$el.appendChild(rt(t))})),this.addListeners(),this}addListeners(){const t=this.attr("buttons"),s=this.$el;return!t||t.length<1||t.forEach((t=>{const i=t.action;let r,l,o,h;if(this.disabled)return!1;i&&(l=i.handler,n(l)&&(h=l,i.handler=function(){this.$emit(h,t.name)},l=i.handler),r=i.type||"click",o=i.context),e(l)&&T(s,`.${t.name}`,r,l,o||this,!0)})),this}removeListeners(){const t=this.attr("buttons"),s=this.$el;return!t||t.length<1||t.forEach((t=>{const i=t.action;let r,l;if(this.disabled)return!1;i&&(l=i.handler,r=i.type||"click"),e(l)&&y(s,r,l)})),this}}ot.DEFAULTS={placement:"ltr",closed:!1,disabled:!1,rounded:!0,buttons:[],created:null,mounted:null,afterClosed:null,afterOpened:null,afterDisabled:null,afterEnabled:null,beforeDestroy:null,afterDestroy:null};const ht=t=>{const e=Object.getPrototypeOf;let s;if(!(t=>i(t)&&null!==t)(t))return!1;if(s=t.prototype,!s)return!0;for(s=t;null!==e(s);)s=e(s);return e(t)===s},at=t=>t.replace(/<script[^>]*>.*?<\/script>/gi,""),ct=t=>{const e={"&":"&","<":"<",">":">","'":"'",'"':"""};return t.replace(/[&<>'"]/g,(t=>e[t]||t))},ut=[];let dt;R();class mt extends N{constructor(t){super(),this.attrs=l(mt.DEFAULTS),this.$el=null,this.id="",this.closed=!1,this.visible=!1,this.offset=-50,this.timer=null,this.destroyed=!1,t&&this.initialize(t)}initialize(t){return this.attr(t),this.id=this.attr("id"),this.offset=this.attr("offset")||-50,this.$emit("created",{...this.attr()}),this.render().addListeners(),this.attr("visible")&&this.open(),this}isClosed(){return this.closed}isDestroyed(){return this.destroyed}_getClassName(){const t=this.attr("type"),e=this.attr("effect"),s=this.attr("round"),i=this.attr("closable"),r=this.attr("visible"),l=this.attr("customClass"),n=["outline-message",`outline-message_${t}`,`outline-message_${e}`];return s&&n.push("outline-message_round"),i||n.push("outline-message_full-width"),r&&n.push("outline-message_visible"),l&&n.push(l),n}render(){const t=this.attr("type"),e=this.attr("message"),s=this.attr("effect"),i=this.attr("round"),r=this.attr("closable"),l=this.attr("dangerouslyUseHTMLString"),n=this._getClassName(),o=[];let h,c,u,d,m,p=20;return i&&"default"===s&&(p=12),"plain"!==s&&(h=J("light"===s?`circle-${t}`:t,{iconSet:"outline",size:p}),a(h,"outline-message__icon"),o.push(h)),l?(u=document.createDocumentFragment(),u.innerHTML=e):u=document.createTextNode(ct(at(e))),c=Q("p",{className:"outline-message__content"},[u]),o.push(c),r&&(d=J("close",{iconSet:"outline",size:18}),a(d,"outline-message__close"),o.push(d)),m=Q("div",{className:n.join(" ")},o),m.style.cssText="top:-50px;",this.$el=m,document.body.appendChild(this.$el),this.$emit("mounted"),this}_refreshIcon(){const t=".outline-message_hidden",e=this.$el;let s,i,r,l,n,o,h,c=20;return this.isDestroyed()?this:(n=e.querySelector(".outline-icon"),n?(s=this.attr("type"),i=this.attr("effect"),r=this.attr("round"),"plain"===i?a(n,t):(u(n,t),r&&"default"===i&&(c=12)),o=n.querySelector(".outline-icon__svg"),V(o,{style:`width:${c}px;height:${c}px;`}),h=o.querySelector("use"),l="light"===i?`circle-${s}`:s,P(h,"xlink:href",`#outline-icon-${l}`),this):this)}_refreshMessage(){const t=this.$el;let e,s,i,r;return this.isDestroyed()||(e=t.querySelector(".outline-message__content"),s=this.attr("dangerouslyUseHTMLString"),i=this.attr("message"),r=s?i:ct(at(i)),e.innerHTML=r),this}_refreshClose(){const t=".outline-message_hidden",e=this.$el;let s,i;return this.isDestroyed()||(s=e.querySelector(".outline-message__close"),i=this.attr("closable"),s&&(i?a(s,t):u(s,t))),this}_refreshEl(){const t=this.$el;let e;return this.isDestroyed()||(e=this._getClassName(),P(t,"className",e.join(" "))),this}refresh(t){return ht(t)?(this.attr(t)._refreshIcon()._refreshMessage()._refreshClose()._refreshEl(),this):this}clearTimer(){return this.isDestroyed()||this.timer&&(clearTimeout(this.timer),this.timer=null),this}startTimer(t){return this.isDestroyed()||(this.timer=s((()=>{this.$emit("opened"),this.close()}),1e3*t)),this}open(t){const e=this.$el;let i,r,l,n;return this.isDestroyed()||(this.isClosed()&&this.refresh(t),i=this.attr("offset"),r=this.attr("duration"),l=i&&i>=this.offset?i:this.offset,n=`top:${l}px;`,this.clearTimer(),this.$emit("beforeOpen"),s((()=>{this.visible=!0,a(e,"outline-message_visible"),e.style.cssText=n,r>0&&this.startTimer(r)}),100)),this}close(){const t=this.$el;let i,r;return this.isDestroyed()||(i=this.attr("destroyAfterClosed"),r=this.attr("beforeClose"),e(r)&&r.call(this),t.style.cssText="top:-50px;",u(t,"outline-message_visible"),this.visible=!1,this.closed=!0,s((()=>{this.$emit("closed"),i&&this.destroy()}),500)),this}destroy(){return this.$emit("beforeDestroy"),this.isDestroyed()||(this.removeListeners(),document.body.removeChild(this.$el),this.attr(mt.DEFAULTS),this.id="",this.closed=!0,this.visible=!1,this.offset=-50,clearTimeout(this.timer),this.timer=null,this.destroyed=!0,this.$el=null,this.$emit("afterDestroy")),this}onMouseEnter(){return this.clearTimer(),this}onMouseLeave(){const t=this.attr("duration"),e=this.attr("delay");return t<=0||this.startTimer(e),this}onClose(){return this.clearTimer(),this.close(),this}addListeners(){const t=this.$el;return T(t,".outline-message__content","mouseenter",this.onMouseEnter,this,!0),T(t,".outline-message__content","mouseleave",this.onMouseLeave,this,!0),T(t,".outline-message__close","click",this.onClose,this,!0),this}removeListeners(){const t=this.$el;return y(t,"mouseenter",this.onMouseEnter),y(t,"mouseleave",this.onMouseLeave),y(t,"click",this.onClose),this}}mt.DEFAULTS={id:"",type:"info",effect:"default",round:!1,offset:30,duration:3,delay:2,message:"",customClass:"",closable:!0,visible:!0,dangerouslyUseHTMLString:!1,destroyAfterClosed:!0,beforeClose:null},["info","success","warning","error"].forEach((t=>{mt[t]=e=>{const s={},i=k("outline-message-"),r=e.beforeClose||null;let l=e.offset||30;return n(e)?s.message=e:ht(e)&&S(s,e),s.id=i,s.type=t,s.offset=l,s.visible=!1,s.beforeClose=()=>{mt.close(i,r)},dt=new mt(s),ut.forEach((t=>{l+=t.$el.offsetHeight+16})),dt.offset=l,dt.open(),ut.push(dt),dt}})),mt.close=(t,s)=>{const i=ut.length;let r,l,n=-1;if(ut.forEach(((i,r)=>{t===i.id&&(l=i.$el.offsetHeight,n=r,e(s)&&s.call(i),ut.splice(r,1))})),i<=1||-1===n||n>ut.length-1)return!1;for(r=n;r<i-1;r+=1){const t=ut[r].$el;t.style.top=parseInt(t.style.top,10)-l-16+"px"}},mt.clear=()=>{let t=ut.length-1;for(;t>=0;t-=1)ut[t].close()};const pt=(t,e)=>{let s,i=t;for(;i;)s=i.tagName.toLowerCase(),"script"!==s&&"style"!==s&&a(i,"outline-print_sibling"),i=e?i.previousElementSibling:i.nextElementSibling},ft="进入阅读模式,按 ESC 键可退出阅读模式";class gt extends N{constructor(t){super(),this.attrs=l(gt.DEFAULTS),this.anchors=null,this.drawer=null,this.chapters=null,this.toolbar=null,this.buttons=[],this.reading=!1,t&&this.initialize(t)}initialize(t){return this.attr(t),this.$emit("created",{...this.attr()}),this.render().addListeners(),this}getChapters(t=!1){return this.anchors.getChapters(t)}count(){return this.anchors.count()}render(){const t=this.attr("hasToolbar"),e=this.attr("scrollElement");let s;return n(e)?s=document.querySelector(e):o(e)&&(s=e),this._renderPrint()._renderAnchors()._renderChapters()._renderToolbar(),s&&t&&this.onToolbarUpdate({top:s.scrollTop,min:0,max:s.scrollHeight}),this.$emit("mounted"),this}_renderPrint(){const t=this.attr("print"),e=this.attr("articleElement");let i,r,l;return t.element?(n(e)?i=document.querySelector(e):o(e)&&(i=e),a(i,"outline-article"),l=t.element,n(l)?r=document.querySelector(l):o(l)&&(r=l),((t,e)=>{const i=document.createDocumentFragment();let r,l,h,a,c,u,d,m=e;if(n(t)?r=document.querySelector(t):o(t)&&(r=t),!r)return!1;u=J("close",{iconSet:"outline",size:20,attrs:{className:"outline-print__close"}}),a=r.querySelector("h1"),o(e)&&(a=e),o(a)&&(m=a.innerText),a=Q("h1",{className:"outline-print__title"},m),h=Q("article",{id:"outline-print__article",className:"outline-print__article"}),l=Q("section",{id:"outline-print",className:"outline-print"},[u,a,h]),document.body.appendChild(l),s((()=>{c=l.previousElementSibling,pt(c,!0),c=l.nextElementSibling,pt(c),d=[...r.cloneNode(!0).children],d.forEach((t=>{i.appendChild(t)})),h.appendChild(i)}))})(r,t.title),this):this}_renderAnchors(){const t=this.attr("articleElement"),e=this.attr("selector"),s=this.attr("stickyHeight"),i=this.attr("scrollElement"),r=this.attr("showCode"),l=this.attr("anchorURL"),n=this.attr("afterScroll"),o=this.attr("chapterTextFilter");return this.anchors=new K({articleElement:t,stickyHeight:s,scrollElement:i,selector:e,showCode:r,anchorURL:l,afterScroll:n,chapterTextFilter:o}),this}_renderChapters(){const t=this.attr("title"),e=this.attr("stickyHeight"),s=this.attr("scrollElement"),i=this.attr("customClass"),r=this.attr("showCode"),l=this.attr("animationCurrent"),n=this.attr("position"),o=this.attr("placement"),h=this.attr("afterSticky"),a=this.attr("afterToggle"),c=this.attr("afterScroll"),u=this.count();let d,m=this.attr("parentElement");return u<1||(d={scrollElement:s,showCode:r,animationCurrent:l,position:n,title:t,stickyHeight:e,chapters:this.getChapters(),afterSticky:h,afterToggle:a,afterScroll:c},"relative"===n?(this.drawer=new et({placement:o,title:t,size:"tiny",hasOffset:!0,hasPadding:!1,customClass:i,afterClosed:()=>{this.toolbar.toggle()}}),m=this.drawer.$main):d.customClass=i,d.parentElement=m,this.chapters=new it(d)),this}_renderToolbar(){const t=this.attr("hasToolbar"),s=this.attr("placement"),i=this.attr("homepage"),r=this.attr("git"),l=this.attr("tags"),n=this.attr("issues"),o=this.attr("tools"),h=this.attr("print"),a=this.count(),c={name:"homepage",icon:"homepage",size:20,link:i},u={name:"github",icon:"github",size:20,link:r},d={name:"tags",icon:"tags",size:20,link:l},m={name:"issues",icon:"issues",size:20,link:n},p={name:"menu",icon:"menu",size:18,action:{type:"click",handler:"toolbar:action:toggle"}},f={name:"reading",icon:"file",size:18,action:{type:"click",handler:"toolbar:action:reading"}},g={name:"print",icon:"print",size:20,action:{type:"click",handler:"toolbar:action:print"}},b=[];return t?(b.push({name:"up",icon:"up",size:20,action:{type:"click",handler:"toolbar:action:up"}}),a>0&&b.push(p),i&&b.push(c),r&&b.push(u),l&&b.push(d),n&&b.push(m),h.element&&(b.push(f),e(print)&&b.push(g)),o?.length>0&&b.push(...o),b.push({name:"down",icon:"down",size:20,action:{type:"click",handler:"toolbar:action:down"}}),this.buttons=[...b],this.toolbar=new ot({placement:s,buttons:b}),this):this}addButton(t){const e=this.toolbar,s=this.buttons;return s.splice(-1,0,t),e.attr({buttons:s}),e.refresh(),this}removeButton(t){return this.toolbar.remove(t),this}toTop(){const t=this.attr("afterScroll"),s=this.toolbar,i=this.chapters,r=this.count();return r>0&&(i.playing=!0),this.scrollTo(0,(()=>{s.hide("up"),s.show("down"),r>0&&(i.highlight(0),i.playing=!1),e(t)&&t.call(s,"up")})),this}toBottom(){const t=this.attr("afterScroll"),s=m(this.attr("scrollElement")),i=this.toolbar,r=this.chapters,l=this.count(),n=Math.floor(s.scrollHeight-s.clientHeight);return l>0&&(r.playing=!0),this.scrollTo(n,(()=>{i.hide("down"),i.show("up"),l>0&&(r.highlight(l-1),r.playing=!1),e(t)&&t.call(i,"bottom")})),this}scrollTo(t,e){const s=this.attr("scrollElement");return p(s,t,e),this}enterReading(){const t="outline-reading",e=`${t}_hidden`,s=document.querySelector("#outline-print"),i=document.querySelectorAll(".outline-print_sibling"),r=this.attr("print").enterReadingTip||ft;return this.reading||!s||(i.forEach((t=>{a(t,e)})),a(s,t),this.reading=!0,this.toolbar.toggle(),mt.info({round:!0,message:r}),this.$emit("enterReading")),this}exitReading(){const t="outline-reading",e=`${t}_hidden`,s=document.querySelector("#outline-print"),i=document.querySelectorAll(".outline-print_sibling");return this.reading&&s?(u(s,t),i.forEach((t=>{u(t,e)})),this.reading=!1,this.toolbar.toggle(),this.$emit("exitReading"),this):this}switchReading(){return document.querySelector("#outline-print")?(this.reading?this.exitReading():this.enterReading(),this):this}toggle(){const t=this.attr("position"),e=this.toolbar,i=this.drawer,r=this.chapters;return this.count()<1||("relative"!==t?(r.toggle(),e.highlight("menu")):(e.toggle(),s((()=>{i.toggle()})))),this}print(){return e(print)?(print(),this):this}destroy(){let t=this.anchors,e=this.chapters,s=this.drawer,i=this.toolbar,r=!1;const l=this.count(),n=document.querySelector("#outline-print");return this.$emit("beforeDestroy"),this.removeListeners(),n&&document.body.removeChild(n),l>0&&e&&(r=e.isOutside(),e.destroy(),e=null,r&&s&&(s.destroy(),s=null)),t&&(t.destroy(),t=null),i&&(i.destroy(),i=null),this.attr(gt.DEFAULTS),this}onToggle(){return this.toggle(),this}onScrollTop(){return this.toTop(),this}onScrollBottom(){return this.toBottom(),this}onEnterReading(){return this.switchReading(),this}onExitReading(t){return 27===t.keyCode&&this.reading&&(this.switchReading(),w(t)),this}onPrint(){return this.print(),this}onToolbarUpdate({top:t,min:e,max:s}){const i=this.toolbar,r=Math.ceil(t);return r<=e?(i.hide("up"),i.show("down")):r>=s?(i.hide("down"),i.show("up")):r>e&&r<s&&(i.show("up"),i.show("down")),this}addListeners(){const t=this.attr("hasToolbar"),e=document.querySelector("#outline-print");return t&&(this.$on("toolbar:update",this.onToolbarUpdate),this.$on("toolbar:action:up",this.onScrollTop),this.$on("toolbar:action:toggle",this.onToggle),this.$on("toolbar:action:reading",this.onEnterReading),this.$on("toolbar:action:down",this.onScrollBottom)),e&&($(document,"keyup",this.onExitReading,this,!0),T(e,".outline-print__close","click",this.exitReading,this,!0),this.$on("toolbar:action:print",this.onPrint)),this}removeListeners(){const t=this.attr("hasToolbar"),e=document.querySelector("#outline-print");return t&&(this.$off("toolbar:update"),this.$off("toolbar:action:up"),this.$off("toolbar:action:toggle"),this.$off("toolbar:action:down")),e&&(y(document,"keyup",this.onExitReading),y(e,"click",this.exitReading),this.$off("toolbar:action:print")),this}}return gt.DEFAULTS={articleElement:"#article",selector:"h2,h3,h4,h5,h6",title:"目录",scrollElement:"html,body",position:"relative",parentElement:"#aside",placement:"rtl",animationCurrent:!0,showCode:!0,hasToolbar:!0,anchorURL:"",stickyHeight:0,homepage:"",git:"",tags:"",issues:"",tools:[],print:{element:"",title:"",enterReadingTip:ft},customClass:"",afterSticky:null,afterToggle:null,afterScroll:null,chapterTextFilter:null},window.jQuery&&jQuery.extend(jQuery.fn,{outline:function(t){let e=jQuery(this);return new gt(jQuery.extend({},t,{articleElement:e}))}}),gt}));
//# sourceMappingURL=outline.min.js.map
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。