diff --git a/404.html b/404.html index 448bc1121..a8c91751c 100644 --- a/404.html +++ b/404.html @@ -8,7 +8,7 @@ - + @@ -33,14 +33,14 @@ - +
- + \ No newline at end of file diff --git a/assets/app.SVYAsRG1.js b/assets/app.CjguJqSp.js similarity index 95% rename from assets/app.SVYAsRG1.js rename to assets/app.CjguJqSp.js index 9ce85f9a1..45d7bbbbc 100644 --- a/assets/app.SVYAsRG1.js +++ b/assets/app.CjguJqSp.js @@ -1 +1 @@ -import{R as i}from"./chunks/theme.CTuKnC7d.js";import{R as o,aj as u,ak as l,al as c,am as f,an as d,ao as m,ap as h,aq as g,ar as A,as as v,d as P,u as R,v as w,s as y,at as C,au as b,av as E,a0 as S}from"./chunks/framework.BuqFyMr-.js";function p(e){if(e.extends){const a=p(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=p(i),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),b(),E(),s.setup&&s.setup(),()=>S(s.Layout)}});async function j(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(l,e);const t=c(e.route);return a.provide(f,t),a.component("Content",d),a.component("ClientOnly",m),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:h}),{app:a,router:e,data:t}}function D(){return g(T)}function _(){let e=o,a;return A(t=>{let n=v(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&j().then(({app:e,router:a,data:t})=>{a.go().then(()=>{u(a.route,t.site),e.mount("#app")})});export{j as createApp}; +import{R as i}from"./chunks/theme.CRvO5ONu.js";import{R as o,aj as u,ak as l,al as c,am as f,an as d,ao as m,ap as h,aq as g,ar as A,as as v,d as P,u as R,v as w,s as y,at as C,au as b,av as E,a0 as S}from"./chunks/framework.BuqFyMr-.js";function p(e){if(e.extends){const a=p(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=p(i),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),b(),E(),s.setup&&s.setup(),()=>S(s.Layout)}});async function j(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(l,e);const t=c(e.route);return a.provide(f,t),a.component("Content",d),a.component("ClientOnly",m),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:h}),{app:a,router:e,data:t}}function D(){return g(T)}function _(){let e=o,a;return A(t=>{let n=v(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&j().then(({app:e,router:a,data:t})=>{a.go().then(()=>{u(a.route,t.site),e.mount("#app")})});export{j as createApp}; diff --git a/assets/chunks/theme.CTuKnC7d.js b/assets/chunks/theme.CRvO5ONu.js similarity index 96% rename from assets/chunks/theme.CTuKnC7d.js rename to assets/chunks/theme.CRvO5ONu.js index c88db95c0..f9cbceb40 100644 --- a/assets/chunks/theme.CTuKnC7d.js +++ b/assets/chunks/theme.CRvO5ONu.js @@ -1,5 +1,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunks/index.BBEad1Fh.js","assets/chunks/framework.BuqFyMr-.js"])))=>i.map(i=>d[i]); -import{d as V,o as h,c as C,r as S,a as qe,t as se,n as de,b as X,w as A,e as G,T as Cn,_ as q,u as vn,i as hi,f as gi,g as In,h as U,j as w,k as g,l as Lt,m as Qn,p as z,q as ke,s as ft,v as We,x as An,y as kr,z as vi,A as _i,B as ht,F as ge,C as Me,D as Tn,E as Nn,G as Y,H as Ks,I as Ye,J as nn,K as dt,L as Ut,M as bi,N as Gs,O as yi,P as at,Q as Ys,R as Mn,S as ki,U as Zt,V as wr,W as Pn,X as wi,Y as _n,Z as bn,$ as Li,a0 as $t,a1 as zs,a2 as Xs,a3 as Ft,a4 as Ei,a5 as Si,a6 as Oi,a7 as Ci,a8 as Js,a9 as Ii,aa as Ai,ab as Ti,ac as Ni,ad as Mi,ae as Pi,af as Ri,ag as $i,ah as Fi,ai as yn}from"./framework.BuqFyMr-.js";const xi=V({__name:"VPBadge",props:{text:{},type:{default:"tip"}},setup(e){return(t,n)=>(h(),C("span",{class:de(["VPBadge",t.type])},[S(t.$slots,"default",{},()=>[qe(se(t.text),1)])],2))}}),Di={key:0,class:"VPBackdrop"},Vi=V({__name:"VPBackdrop",props:{show:{type:Boolean}},setup(e){return(t,n)=>(h(),X(Cn,{name:"fade"},{default:A(()=>[t.show?(h(),C("div",Di)):G("",!0)]),_:1}))}}),Ui=q(Vi,[["__scopeId","data-v-aa2f5bb7"]]),ie=vn;function Hi(e,t){let n,r=!1;return()=>{n&&clearTimeout(n),r?n=setTimeout(e,t):(e(),(r=!0)&&setTimeout(()=>r=!1,t))}}function Zn(e){return/^\//.test(e)?e:`/${e}`}function Lr(e){const{pathname:t,search:n,hash:r,protocol:a}=new URL(e,"http://a.com");if(hi(e)||e.startsWith("#")||!a.startsWith("http")||!gi(t))return e;const{site:s}=ie(),i=t.endsWith("/")||t.endsWith(".html")?e:e.replace(/(?:(^\.+)\/)?.*$/,`$1${t.replace(/(\.md)?$/,s.value.cleanUrls?"":".html")}${n}${r}`);return In(i)}function rn({correspondingLink:e=!1}={}){const{site:t,localeIndex:n,page:r,theme:a,hash:s}=ie(),i=U(()=>{var l,c;return{label:(l=t.value.locales[n.value])==null?void 0:l.label,link:((c=t.value.locales[n.value])==null?void 0:c.link)||(n.value==="root"?"/":`/${n.value}/`)}});return{localeLinks:U(()=>Object.entries(t.value.locales).flatMap(([l,c])=>i.value.label===c.label?[]:{text:c.label,link:Bi(c.link||(l==="root"?"/":`/${l}/`),a.value.i18nRouting!==!1&&e,r.value.relativePath.slice(i.value.link.length-1),!t.value.cleanUrls)+s.value})),currentLang:i}}function Bi(e,t,n,r){return t?e.replace(/\/$/,"")+Zn(n.replace(/(^|\/)index\.md$/,"$1").replace(/\.md$/,r?".html":"")):e}const Wi={class:"NotFound"},ji={class:"code"},Ki={class:"title"},Gi={class:"quote"},Yi={class:"action"},zi=["href","aria-label"],Xi=V({__name:"NotFound",setup(e){const{theme:t}=ie(),{currentLang:n}=rn();return(r,a)=>{var s,i,o,l,c;return h(),C("div",Wi,[w("p",ji,se(((s=g(t).notFound)==null?void 0:s.code)??"404"),1),w("h1",Ki,se(((i=g(t).notFound)==null?void 0:i.title)??"PAGE NOT FOUND"),1),a[0]||(a[0]=w("div",{class:"divider"},null,-1)),w("blockquote",Gi,se(((o=g(t).notFound)==null?void 0:o.quote)??"But if you don't change your direction, and if you keep looking, you may end up where you are heading."),1),w("div",Yi,[w("a",{class:"link",href:g(In)(g(n).link),"aria-label":((l=g(t).notFound)==null?void 0:l.linkLabel)??"go to home"},se(((c=g(t).notFound)==null?void 0:c.linkText)??"Take me home"),9,zi)])])}}}),Ji=q(Xi,[["__scopeId","data-v-46f27357"]]);function qs(e,t){if(Array.isArray(e))return pn(e);if(e==null)return[];t=Zn(t);const n=Object.keys(e).sort((a,s)=>s.split("/").length-a.split("/").length).find(a=>t.startsWith(Zn(a))),r=n?e[n]:[];return Array.isArray(r)?pn(r):pn(r.items,r.base)}function qi(e){const t=[];let n=0;for(const r in e){const a=e[r];if(a.items){n=t.push(a);continue}t[n]||t.push({items:[]}),t[n].items.push(a)}return t}function Qi(e){const t=[];function n(r){for(const a of r)a.text&&a.link&&t.push({text:a.text,link:a.link,docFooterText:a.docFooterText}),a.items&&n(a.items)}return n(e),t}function er(e,t){return Array.isArray(t)?t.some(n=>er(e,n)):Lt(e,t.link)?!0:t.items?er(e,t.items):!1}function pn(e,t){return[...e].map(n=>{const r={...n},a=r.base||t;return a&&r.link&&(r.link=a+r.link),r.items&&(r.items=pn(r.items,a)),r})}function ot(){const{frontmatter:e,page:t,theme:n}=ie(),r=Qn("(min-width: 960px)"),a=z(!1),s=U(()=>{const _=n.value.sidebar,b=t.value.relativePath;return _?qs(_,b):[]}),i=z(s.value);ke(s,(_,b)=>{JSON.stringify(_)!==JSON.stringify(b)&&(i.value=s.value)});const o=U(()=>e.value.sidebar!==!1&&i.value.length>0&&e.value.layout!=="home"),l=U(()=>c?e.value.aside==null?n.value.aside==="left":e.value.aside==="left":!1),c=U(()=>e.value.layout==="home"?!1:e.value.aside!=null?!!e.value.aside:n.value.aside!==!1),u=U(()=>o.value&&r.value),m=U(()=>o.value?qi(i.value):[]);function d(){a.value=!0}function v(){a.value=!1}function E(){a.value?v():d()}return{isOpen:a,sidebar:i,sidebarGroups:m,hasSidebar:o,hasAside:c,leftAside:l,isSidebarEnabled:u,open:d,close:v,toggle:E}}function Zi(e,t){let n;ft(()=>{n=e.value?document.activeElement:void 0}),We(()=>{window.addEventListener("keyup",r)}),An(()=>{window.removeEventListener("keyup",r)});function r(a){a.key==="Escape"&&e.value&&(t(),n==null||n.focus())}}function eo(e){const{page:t,hash:n}=ie(),r=z(!1),a=U(()=>e.value.collapsed!=null),s=U(()=>!!e.value.link),i=z(!1),o=()=>{i.value=Lt(t.value.relativePath,e.value.link)};ke([t,e,n],o),We(o);const l=U(()=>i.value?!0:e.value.items?er(t.value.relativePath,e.value.items):!1),c=U(()=>!!(e.value.items&&e.value.items.length));ft(()=>{r.value=!!(a.value&&e.value.collapsed)}),kr(()=>{(i.value||l.value)&&(r.value=!1)});function u(){a.value&&(r.value=!r.value)}return{collapsed:r,collapsible:a,isLink:s,isActiveLink:i,hasActiveLink:l,hasChildren:c,toggle:u}}function to(){const{hasSidebar:e}=ot(),t=Qn("(min-width: 960px)"),n=Qn("(min-width: 1280px)");return{isAsideEnabled:U(()=>!n.value&&!t.value?!1:e.value?n.value:t.value)}}const tr=[];function Qs(e){return typeof e.outline=="object"&&!Array.isArray(e.outline)&&e.outline.label||e.outlineTitle||"On this page"}function Er(e){const t=[...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")].filter(n=>n.id&&n.hasChildNodes()).map(n=>{const r=Number(n.tagName[1]);return{element:n,title:no(n),link:"#"+n.id,level:r}});return ro(t,e)}function no(e){let t="";for(const n of e.childNodes)if(n.nodeType===1){if(n.classList.contains("VPBadge")||n.classList.contains("header-anchor")||n.classList.contains("ignore-header"))continue;t+=n.textContent}else n.nodeType===3&&(t+=n.textContent);return t.trim()}function ro(e,t){if(t===!1)return[];const n=(typeof t=="object"&&!Array.isArray(t)?t.level:t)||2,[r,a]=typeof n=="number"?[n,n]:n==="deep"?[2,6]:n;e=e.filter(i=>i.level>=r&&i.level<=a),tr.length=0;for(const{element:i,link:o}of e)tr.push({element:i,link:o});const s=[];e:for(let i=0;i=0;l--){const c=e[l];if(c.level{requestAnimationFrame(s),window.addEventListener("scroll",r)}),vi(()=>{i(location.hash)}),An(()=>{window.removeEventListener("scroll",r)});function s(){if(!n.value)return;const o=window.scrollY,l=window.innerHeight,c=document.body.offsetHeight,u=Math.abs(o+l-c)<1,m=tr.map(({element:v,link:E})=>({link:E,top:ao(v)})).filter(({top:v})=>!Number.isNaN(v)).sort((v,E)=>v.top-E.top);if(!m.length){i(null);return}if(o<1){i(null);return}if(u){i(m[m.length-1].link);return}let d=null;for(const{link:v,top:E}of m){if(E>o+_i()+4)break;d=v}i(d)}function i(o){a&&a.classList.remove("active"),o==null?a=null:a=e.value.querySelector(`a[href="${decodeURIComponent(o)}"]`);const l=a;l?(l.classList.add("active"),t.value.style.top=l.offsetTop+39+"px",t.value.style.opacity="1"):(t.value.style.top="33px",t.value.style.opacity="0")}}function ao(e){let t=0;for(;e!==document.body;){if(e===null)return NaN;t+=e.offsetTop,e=e.offsetParent}return t}const io=["href","title"],oo=V({__name:"VPDocOutlineItem",props:{headers:{},root:{type:Boolean}},setup(e){function t({target:n}){const r=n.href.split("#")[1],a=document.getElementById(decodeURIComponent(r));a==null||a.focus({preventScroll:!0})}return(n,r)=>{const a=ht("VPDocOutlineItem",!0);return h(),C("ul",{class:de(["VPDocOutlineItem",n.root?"root":"nested"])},[(h(!0),C(ge,null,Me(n.headers,({children:s,link:i,title:o})=>(h(),C("li",null,[w("a",{class:"outline-link",href:i,onClick:t,title:o},se(o),9,io),s!=null&&s.length?(h(),X(a,{key:0,headers:s},null,8,["headers"])):G("",!0)]))),256))],2)}}}),Zs=q(oo,[["__scopeId","data-v-fc78d431"]]),lo={class:"content"},co={"aria-level":"2",class:"outline-title",id:"doc-outline-aria-label",role:"heading"},uo=V({__name:"VPDocAsideOutline",setup(e){const{frontmatter:t,theme:n}=ie(),r=Tn([]);Nn(()=>{r.value=Er(t.value.outline??n.value.outline)});const a=z(),s=z();return so(a,s),(i,o)=>(h(),C("nav",{"aria-labelledby":"doc-outline-aria-label",class:de(["VPDocAsideOutline",{"has-outline":r.value.length>0}]),ref_key:"container",ref:a},[w("div",lo,[w("div",{class:"outline-marker",ref_key:"marker",ref:s},null,512),w("div",co,se(g(Qs)(g(n))),1),Y(Zs,{headers:r.value,root:!0},null,8,["headers"])])],2))}}),mo=q(uo,[["__scopeId","data-v-e95709bb"]]),po={class:"VPDocAsideCarbonAds"},fo=V({__name:"VPDocAsideCarbonAds",props:{carbonAds:{}},setup(e){const t=()=>null;return(n,r)=>(h(),C("div",po,[Y(g(t),{"carbon-ads":n.carbonAds},null,8,["carbon-ads"])]))}}),ho={class:"VPDocAside"},go=V({__name:"VPDocAside",setup(e){const{theme:t}=ie();return(n,r)=>(h(),C("div",ho,[S(n.$slots,"aside-top",{},void 0,!0),S(n.$slots,"aside-outline-before",{},void 0,!0),Y(mo),S(n.$slots,"aside-outline-after",{},void 0,!0),r[0]||(r[0]=w("div",{class:"spacer"},null,-1)),S(n.$slots,"aside-ads-before",{},void 0,!0),g(t).carbonAds?(h(),X(fo,{key:0,"carbon-ads":g(t).carbonAds},null,8,["carbon-ads"])):G("",!0),S(n.$slots,"aside-ads-after",{},void 0,!0),S(n.$slots,"aside-bottom",{},void 0,!0)]))}}),vo=q(go,[["__scopeId","data-v-4bbff643"]]);function _o(){const{theme:e,page:t}=ie();return U(()=>{const{text:n="Edit this page",pattern:r=""}=e.value.editLink||{};let a;return typeof r=="function"?a=r(t.value):a=r.replace(/:path/g,t.value.filePath),{url:a,text:n}})}function bo(){const{page:e,theme:t,frontmatter:n}=ie();return U(()=>{var c,u,m,d,v,E,_,b;const r=qs(t.value.sidebar,e.value.relativePath),a=Qi(r),s=yo(a,M=>M.link.replace(/[?#].*$/,"")),i=s.findIndex(M=>Lt(e.value.relativePath,M.link)),o=((c=t.value.docFooter)==null?void 0:c.prev)===!1&&!n.value.prev||n.value.prev===!1,l=((u=t.value.docFooter)==null?void 0:u.next)===!1&&!n.value.next||n.value.next===!1;return{prev:o?void 0:{text:(typeof n.value.prev=="string"?n.value.prev:typeof n.value.prev=="object"?n.value.prev.text:void 0)??((m=s[i-1])==null?void 0:m.docFooterText)??((d=s[i-1])==null?void 0:d.text),link:(typeof n.value.prev=="object"?n.value.prev.link:void 0)??((v=s[i-1])==null?void 0:v.link)},next:l?void 0:{text:(typeof n.value.next=="string"?n.value.next:typeof n.value.next=="object"?n.value.next.text:void 0)??((E=s[i+1])==null?void 0:E.docFooterText)??((_=s[i+1])==null?void 0:_.text),link:(typeof n.value.next=="object"?n.value.next.link:void 0)??((b=s[i+1])==null?void 0:b.link)}}})}function yo(e,t){const n=new Set;return e.filter(r=>{const a=t(r);return n.has(a)?!1:n.add(a)})}const ze=V({__name:"VPLink",props:{tag:{},href:{},noIcon:{type:Boolean},target:{},rel:{}},setup(e){const t=e,n=U(()=>t.tag??(t.href?"a":"span")),r=U(()=>t.href&&Ks.test(t.href)||t.target==="_blank");return(a,s)=>(h(),X(Ye(n.value),{class:de(["VPLink",{link:a.href,"vp-external-link-icon":r.value,"no-icon":a.noIcon}]),href:a.href?g(Lr)(a.href):void 0,target:a.target??(r.value?"_blank":void 0),rel:a.rel??(r.value?"noreferrer":void 0)},{default:A(()=>[S(a.$slots,"default")]),_:3},8,["class","href","target","rel"]))}}),ko={class:"VPLastUpdated"},wo=["datetime"],Lo=V({__name:"VPDocFooterLastUpdated",setup(e){const{theme:t,page:n,lang:r}=ie(),a=U(()=>new Date(n.value.lastUpdated)),s=U(()=>a.value.toISOString()),i=z("");return We(()=>{ft(()=>{var o,l,c;i.value=new Intl.DateTimeFormat((l=(o=t.value.lastUpdated)==null?void 0:o.formatOptions)!=null&&l.forceLocale?r.value:void 0,((c=t.value.lastUpdated)==null?void 0:c.formatOptions)??{dateStyle:"short",timeStyle:"short"}).format(a.value)})}),(o,l)=>{var c;return h(),C("p",ko,[qe(se(((c=g(t).lastUpdated)==null?void 0:c.text)||g(t).lastUpdatedText||"Last updated")+": ",1),w("time",{datetime:s.value},se(i.value),9,wo)])}}}),Eo=q(Lo,[["__scopeId","data-v-3c231858"]]),So={key:0,class:"VPDocFooter"},Oo={key:0,class:"edit-info"},Co={key:0,class:"edit-link"},Io={key:1,class:"last-updated"},Ao={key:1,class:"prev-next","aria-labelledby":"doc-footer-aria-label"},To={class:"pager"},No=["innerHTML"],Mo=["innerHTML"],Po={class:"pager"},Ro=["innerHTML"],$o=["innerHTML"],Fo=V({__name:"VPDocFooter",setup(e){const{theme:t,page:n,frontmatter:r}=ie(),a=_o(),s=bo(),i=U(()=>t.value.editLink&&r.value.editLink!==!1),o=U(()=>n.value.lastUpdated),l=U(()=>i.value||o.value||s.value.prev||s.value.next);return(c,u)=>{var m,d,v,E;return l.value?(h(),C("footer",So,[S(c.$slots,"doc-footer-before",{},void 0,!0),i.value||o.value?(h(),C("div",Oo,[i.value?(h(),C("div",Co,[Y(ze,{class:"edit-link-button",href:g(a).url,"no-icon":!0},{default:A(()=>[u[0]||(u[0]=w("span",{class:"vpi-square-pen edit-link-icon"},null,-1)),qe(" "+se(g(a).text),1)]),_:1},8,["href"])])):G("",!0),o.value?(h(),C("div",Io,[Y(Eo)])):G("",!0)])):G("",!0),(m=g(s).prev)!=null&&m.link||(d=g(s).next)!=null&&d.link?(h(),C("nav",Ao,[u[1]||(u[1]=w("span",{class:"visually-hidden",id:"doc-footer-aria-label"},"Pager",-1)),w("div",To,[(v=g(s).prev)!=null&&v.link?(h(),X(ze,{key:0,class:"pager-link prev",href:g(s).prev.link},{default:A(()=>{var _;return[w("span",{class:"desc",innerHTML:((_=g(t).docFooter)==null?void 0:_.prev)||"Previous page"},null,8,No),w("span",{class:"title",innerHTML:g(s).prev.text},null,8,Mo)]}),_:1},8,["href"])):G("",!0)]),w("div",Po,[(E=g(s).next)!=null&&E.link?(h(),X(ze,{key:0,class:"pager-link next",href:g(s).next.link},{default:A(()=>{var _;return[w("span",{class:"desc",innerHTML:((_=g(t).docFooter)==null?void 0:_.next)||"Next page"},null,8,Ro),w("span",{class:"title",innerHTML:g(s).next.text},null,8,$o)]}),_:1},8,["href"])):G("",!0)])])):G("",!0)])):G("",!0)}}}),xo=q(Fo,[["__scopeId","data-v-00ab7d08"]]),Do={class:"container"},Vo={class:"aside-container"},Uo={class:"aside-content"},Ho={class:"content"},Bo={class:"content-container"},Wo={class:"main"},jo=V({__name:"VPDoc",setup(e){const{theme:t}=ie(),n=nn(),{hasSidebar:r,hasAside:a,leftAside:s}=ot(),i=U(()=>n.path.replace(/[./]+/g,"_").replace(/_html$/,""));return(o,l)=>{const c=ht("Content");return h(),C("div",{class:de(["VPDoc",{"has-sidebar":g(r),"has-aside":g(a)}])},[S(o.$slots,"doc-top",{},void 0,!0),w("div",Do,[g(a)?(h(),C("div",{key:0,class:de(["aside",{"left-aside":g(s)}])},[l[0]||(l[0]=w("div",{class:"aside-curtain"},null,-1)),w("div",Vo,[w("div",Uo,[Y(vo,null,{"aside-top":A(()=>[S(o.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":A(()=>[S(o.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":A(()=>[S(o.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":A(()=>[S(o.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":A(()=>[S(o.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":A(()=>[S(o.$slots,"aside-ads-after",{},void 0,!0)]),_:3})])])],2)):G("",!0),w("div",Ho,[w("div",Bo,[S(o.$slots,"doc-before",{},void 0,!0),w("main",Wo,[Y(c,{class:de(["vp-doc",[i.value,g(t).externalLinkIcon&&"external-link-icon-enabled"]])},null,8,["class"])]),Y(xo,null,{"doc-footer-before":A(()=>[S(o.$slots,"doc-footer-before",{},void 0,!0)]),_:3}),S(o.$slots,"doc-after",{},void 0,!0)])])]),S(o.$slots,"doc-bottom",{},void 0,!0)],2)}}}),Ko=q(jo,[["__scopeId","data-v-9f8645df"]]),Go=V({__name:"VPButton",props:{tag:{},size:{default:"medium"},theme:{default:"brand"},text:{},href:{},target:{},rel:{}},setup(e){const t=e,n=U(()=>t.href&&Ks.test(t.href)),r=U(()=>t.tag||t.href?"a":"button");return(a,s)=>(h(),X(Ye(r.value),{class:de(["VPButton",[a.size,a.theme]]),href:a.href?g(Lr)(a.href):void 0,target:t.target??(n.value?"_blank":void 0),rel:t.rel??(n.value?"noreferrer":void 0)},{default:A(()=>[qe(se(a.text),1)]),_:1},8,["class","href","target","rel"]))}}),Yo=q(Go,[["__scopeId","data-v-bbea5d5d"]]),zo=["src","alt"],Xo=V({inheritAttrs:!1,__name:"VPImage",props:{image:{},alt:{}},setup(e){return(t,n)=>{const r=ht("VPImage",!0);return t.image?(h(),C(ge,{key:0},[typeof t.image=="string"||"src"in t.image?(h(),C("img",dt({key:0,class:"VPImage"},typeof t.image=="string"?t.$attrs:{...t.image,...t.$attrs},{src:g(In)(typeof t.image=="string"?t.image:t.image.src),alt:t.alt??(typeof t.image=="string"?"":t.image.alt||"")}),null,16,zo)):(h(),C(ge,{key:1},[Y(r,dt({class:"dark",image:t.image.dark,alt:t.image.alt},t.$attrs),null,16,["image","alt"]),Y(r,dt({class:"light",image:t.image.light,alt:t.image.alt},t.$attrs),null,16,["image","alt"])],64))],64)):G("",!0)}}}),kn=q(Xo,[["__scopeId","data-v-7b8f395d"]]),Jo={class:"container"},qo={class:"main"},Qo={key:0,class:"name"},Zo=["innerHTML"],el=["innerHTML"],tl=["innerHTML"],nl={key:0,class:"actions"},rl={key:0,class:"image"},sl={class:"image-container"},al=V({__name:"VPHero",props:{name:{},text:{},tagline:{},image:{},actions:{}},setup(e){const t=Ut("hero-image-slot-exists");return(n,r)=>(h(),C("div",{class:de(["VPHero",{"has-image":n.image||g(t)}])},[w("div",Jo,[w("div",qo,[S(n.$slots,"home-hero-info-before",{},void 0,!0),S(n.$slots,"home-hero-info",{},()=>[n.name?(h(),C("h1",Qo,[w("span",{innerHTML:n.name,class:"clip"},null,8,Zo)])):G("",!0),n.text?(h(),C("p",{key:1,innerHTML:n.text,class:"text"},null,8,el)):G("",!0),n.tagline?(h(),C("p",{key:2,innerHTML:n.tagline,class:"tagline"},null,8,tl)):G("",!0)],!0),S(n.$slots,"home-hero-info-after",{},void 0,!0),n.actions?(h(),C("div",nl,[(h(!0),C(ge,null,Me(n.actions,a=>(h(),C("div",{key:a.link,class:"action"},[Y(Yo,{tag:"a",size:"medium",theme:a.theme,text:a.text,href:a.link,target:a.target,rel:a.rel},null,8,["theme","text","href","target","rel"])]))),128))])):G("",!0),S(n.$slots,"home-hero-actions-after",{},void 0,!0)]),n.image||g(t)?(h(),C("div",rl,[w("div",sl,[r[0]||(r[0]=w("div",{class:"image-bg"},null,-1)),S(n.$slots,"home-hero-image",{},()=>[n.image?(h(),X(kn,{key:0,class:"image-src",image:n.image},null,8,["image"])):G("",!0)],!0)])])):G("",!0)])],2))}}),il=q(al,[["__scopeId","data-v-0313f8fa"]]),ol=V({__name:"VPHomeHero",setup(e){const{frontmatter:t}=ie();return(n,r)=>g(t).hero?(h(),X(il,{key:0,class:"VPHomeHero",name:g(t).hero.name,text:g(t).hero.text,tagline:g(t).hero.tagline,image:g(t).hero.image,actions:g(t).hero.actions},{"home-hero-info-before":A(()=>[S(n.$slots,"home-hero-info-before")]),"home-hero-info":A(()=>[S(n.$slots,"home-hero-info")]),"home-hero-info-after":A(()=>[S(n.$slots,"home-hero-info-after")]),"home-hero-actions-after":A(()=>[S(n.$slots,"home-hero-actions-after")]),"home-hero-image":A(()=>[S(n.$slots,"home-hero-image")]),_:3},8,["name","text","tagline","image","actions"])):G("",!0)}}),ll={class:"box"},cl={key:0,class:"icon"},ul=["innerHTML"],dl=["innerHTML"],ml=["innerHTML"],pl={key:4,class:"link-text"},fl={class:"link-text-value"},hl=V({__name:"VPFeature",props:{icon:{},title:{},details:{},link:{},linkText:{},rel:{},target:{}},setup(e){return(t,n)=>(h(),X(ze,{class:"VPFeature",href:t.link,rel:t.rel,target:t.target,"no-icon":!0,tag:t.link?"a":"div"},{default:A(()=>[w("article",ll,[typeof t.icon=="object"&&t.icon.wrap?(h(),C("div",cl,[Y(kn,{image:t.icon,alt:t.icon.alt,height:t.icon.height||48,width:t.icon.width||48},null,8,["image","alt","height","width"])])):typeof t.icon=="object"?(h(),X(kn,{key:1,image:t.icon,alt:t.icon.alt,height:t.icon.height||48,width:t.icon.width||48},null,8,["image","alt","height","width"])):t.icon?(h(),C("div",{key:2,class:"icon",innerHTML:t.icon},null,8,ul)):G("",!0),w("h2",{class:"title",innerHTML:t.title},null,8,dl),t.details?(h(),C("p",{key:3,class:"details",innerHTML:t.details},null,8,ml)):G("",!0),t.linkText?(h(),C("div",pl,[w("p",fl,[qe(se(t.linkText)+" ",1),n[0]||(n[0]=w("span",{class:"vpi-arrow-right link-text-icon"},null,-1))])])):G("",!0)])]),_:1},8,["href","rel","target","tag"]))}}),gl=q(hl,[["__scopeId","data-v-ce15ebd4"]]),vl={key:0,class:"VPFeatures"},_l={class:"container"},bl={class:"items"},yl=V({__name:"VPFeatures",props:{features:{}},setup(e){const t=e,n=U(()=>{const r=t.features.length;if(r){if(r===2)return"grid-2";if(r===3)return"grid-3";if(r%3===0)return"grid-6";if(r>3)return"grid-4"}else return});return(r,a)=>r.features?(h(),C("div",vl,[w("div",_l,[w("div",bl,[(h(!0),C(ge,null,Me(r.features,s=>(h(),C("div",{key:s.title,class:de(["item",[n.value]])},[Y(gl,{icon:s.icon,title:s.title,details:s.details,link:s.link,"link-text":s.linkText,rel:s.rel,target:s.target},null,8,["icon","title","details","link","link-text","rel","target"])],2))),128))])])])):G("",!0)}}),kl=q(yl,[["__scopeId","data-v-b79e191c"]]),wl=V({__name:"VPHomeFeatures",setup(e){const{frontmatter:t}=ie();return(n,r)=>g(t).features?(h(),X(kl,{key:0,class:"VPHomeFeatures",features:g(t).features},null,8,["features"])):G("",!0)}}),Ll=V({__name:"VPHomeContent",setup(e){const{width:t}=bi({initialWidth:0,includeScrollbar:!1});return(n,r)=>(h(),C("div",{class:"vp-doc container",style:Gs(g(t)?{"--vp-offset":`calc(50% - ${g(t)/2}px)`}:{})},[S(n.$slots,"default",{},void 0,!0)],4))}}),El=q(Ll,[["__scopeId","data-v-269c2bad"]]),Sl={class:"VPHome"},Ol=V({__name:"VPHome",setup(e){const{frontmatter:t}=ie();return(n,r)=>{const a=ht("Content");return h(),C("div",Sl,[S(n.$slots,"home-hero-before",{},void 0,!0),Y(ol,null,{"home-hero-info-before":A(()=>[S(n.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":A(()=>[S(n.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":A(()=>[S(n.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":A(()=>[S(n.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":A(()=>[S(n.$slots,"home-hero-image",{},void 0,!0)]),_:3}),S(n.$slots,"home-hero-after",{},void 0,!0),S(n.$slots,"home-features-before",{},void 0,!0),Y(wl),S(n.$slots,"home-features-after",{},void 0,!0),g(t).markdownStyles!==!1?(h(),X(El,{key:0},{default:A(()=>[Y(a)]),_:1})):(h(),X(a,{key:1}))])}}}),Cl=q(Ol,[["__scopeId","data-v-c1e44215"]]),Il={},Al={class:"VPPage"};function Tl(e,t){const n=ht("Content");return h(),C("div",Al,[S(e.$slots,"page-top"),Y(n),S(e.$slots,"page-bottom")])}const Nl=q(Il,[["render",Tl]]),Ml=V({__name:"VPContent",setup(e){const{page:t,frontmatter:n}=ie(),{hasSidebar:r}=ot();return(a,s)=>(h(),C("div",{class:de(["VPContent",{"has-sidebar":g(r),"is-home":g(n).layout==="home"}]),id:"VPContent"},[g(t).isNotFound?S(a.$slots,"not-found",{key:0},()=>[Y(Ji)],!0):g(n).layout==="page"?(h(),X(Nl,{key:1},{"page-top":A(()=>[S(a.$slots,"page-top",{},void 0,!0)]),"page-bottom":A(()=>[S(a.$slots,"page-bottom",{},void 0,!0)]),_:3})):g(n).layout==="home"?(h(),X(Cl,{key:2},{"home-hero-before":A(()=>[S(a.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":A(()=>[S(a.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":A(()=>[S(a.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":A(()=>[S(a.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":A(()=>[S(a.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":A(()=>[S(a.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":A(()=>[S(a.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":A(()=>[S(a.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":A(()=>[S(a.$slots,"home-features-after",{},void 0,!0)]),_:3})):g(n).layout&&g(n).layout!=="doc"?(h(),X(Ye(g(n).layout),{key:3})):(h(),X(Ko,{key:4},{"doc-top":A(()=>[S(a.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":A(()=>[S(a.$slots,"doc-bottom",{},void 0,!0)]),"doc-footer-before":A(()=>[S(a.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":A(()=>[S(a.$slots,"doc-before",{},void 0,!0)]),"doc-after":A(()=>[S(a.$slots,"doc-after",{},void 0,!0)]),"aside-top":A(()=>[S(a.$slots,"aside-top",{},void 0,!0)]),"aside-outline-before":A(()=>[S(a.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":A(()=>[S(a.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":A(()=>[S(a.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":A(()=>[S(a.$slots,"aside-ads-after",{},void 0,!0)]),"aside-bottom":A(()=>[S(a.$slots,"aside-bottom",{},void 0,!0)]),_:3}))],2))}}),Pl=q(Ml,[["__scopeId","data-v-c575eed1"]]),Rl={class:"container"},$l=["innerHTML"],Fl=["innerHTML"],xl=V({__name:"VPFooter",setup(e){const{theme:t,frontmatter:n}=ie(),{hasSidebar:r}=ot();return(a,s)=>g(t).footer&&g(n).footer!==!1?(h(),C("footer",{key:0,class:de(["VPFooter",{"has-sidebar":g(r)}])},[w("div",Rl,[g(t).footer.message?(h(),C("p",{key:0,class:"message",innerHTML:g(t).footer.message},null,8,$l)):G("",!0),g(t).footer.copyright?(h(),C("p",{key:1,class:"copyright",innerHTML:g(t).footer.copyright},null,8,Fl)):G("",!0)])],2)):G("",!0)}}),Dl=q(xl,[["__scopeId","data-v-042815a5"]]);function Vl(){const{theme:e,frontmatter:t}=ie(),n=Tn([]),r=U(()=>n.value.length>0);return Nn(()=>{n.value=Er(t.value.outline??e.value.outline)}),{headers:n,hasLocalNav:r}}const Ul={class:"menu-text"},Hl={class:"header"},Bl={class:"outline"},Wl=V({__name:"VPLocalNavOutlineDropdown",props:{headers:{},navHeight:{}},setup(e){const t=e,{theme:n}=ie(),r=z(!1),a=z(0),s=z(),i=z();function o(m){var d;(d=s.value)!=null&&d.contains(m.target)||(r.value=!1)}ke(r,m=>{if(m){document.addEventListener("click",o);return}document.removeEventListener("click",o)}),yi("Escape",()=>{r.value=!1}),Nn(()=>{r.value=!1});function l(){r.value=!r.value,a.value=window.innerHeight+Math.min(window.scrollY-t.navHeight,0)}function c(m){m.target.classList.contains("outline-link")&&(i.value&&(i.value.style.transition="none"),at(()=>{r.value=!1}))}function u(){r.value=!1,window.scrollTo({top:0,left:0,behavior:"smooth"})}return(m,d)=>(h(),C("div",{class:"VPLocalNavOutlineDropdown",style:Gs({"--vp-vh":a.value+"px"}),ref_key:"main",ref:s},[m.headers.length>0?(h(),C("button",{key:0,onClick:l,class:de({open:r.value})},[w("span",Ul,se(g(Qs)(g(n))),1),d[0]||(d[0]=w("span",{class:"vpi-chevron-right icon"},null,-1))],2)):(h(),C("button",{key:1,onClick:u},se(g(n).returnToTopLabel||"Return to top"),1)),Y(Cn,{name:"flyout"},{default:A(()=>[r.value?(h(),C("div",{key:0,ref_key:"items",ref:i,class:"items",onClick:c},[w("div",Hl,[w("a",{class:"top-link",href:"#",onClick:u},se(g(n).returnToTopLabel||"Return to top"),1)]),w("div",Bl,[Y(Zs,{headers:m.headers},null,8,["headers"])])],512)):G("",!0)]),_:1})],4))}}),jl=q(Wl,[["__scopeId","data-v-fd549330"]]),Kl={class:"container"},Gl=["aria-expanded"],Yl={class:"menu-text"},zl=V({__name:"VPLocalNav",props:{open:{type:Boolean}},emits:["open-menu"],setup(e){const{theme:t,frontmatter:n}=ie(),{hasSidebar:r}=ot(),{headers:a}=Vl(),{y:s}=Ys(),i=z(0);We(()=>{i.value=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--vp-nav-height"))}),Nn(()=>{a.value=Er(n.value.outline??t.value.outline)});const o=U(()=>a.value.length===0),l=U(()=>o.value&&!r.value),c=U(()=>({VPLocalNav:!0,"has-sidebar":r.value,empty:o.value,fixed:l.value}));return(u,m)=>g(n).layout!=="home"&&(!l.value||g(s)>=i.value)?(h(),C("div",{key:0,class:de(c.value)},[w("div",Kl,[g(r)?(h(),C("button",{key:0,class:"menu","aria-expanded":u.open,"aria-controls":"VPSidebarNav",onClick:m[0]||(m[0]=d=>u.$emit("open-menu"))},[m[1]||(m[1]=w("span",{class:"vpi-align-left menu-icon"},null,-1)),w("span",Yl,se(g(t).sidebarMenuLabel||"Menu"),1)],8,Gl)):G("",!0),Y(jl,{headers:g(a),navHeight:i.value},null,8,["headers","navHeight"])])],2)):G("",!0)}}),Xl=q(zl,[["__scopeId","data-v-6c3804f2"]]);function Jl(){const e=z(!1);function t(){e.value=!0,window.addEventListener("resize",a)}function n(){e.value=!1,window.removeEventListener("resize",a)}function r(){e.value?n():t()}function a(){window.outerWidth>=768&&n()}const s=nn();return ke(()=>s.path,n),{isScreenOpen:e,openScreen:t,closeScreen:n,toggleScreen:r}}const ql={},Ql={class:"VPSwitch",type:"button",role:"switch"},Zl={class:"check"},ec={key:0,class:"icon"};function tc(e,t){return h(),C("button",Ql,[w("span",Zl,[e.$slots.default?(h(),C("span",ec,[S(e.$slots,"default",{},void 0,!0)])):G("",!0)])])}const nc=q(ql,[["render",tc],["__scopeId","data-v-bdb57495"]]),rc=V({__name:"VPSwitchAppearance",setup(e){const{isDark:t,theme:n}=ie(),r=Ut("toggle-appearance",()=>{t.value=!t.value}),a=z("");return kr(()=>{a.value=t.value?n.value.lightModeSwitchTitle||"Switch to light theme":n.value.darkModeSwitchTitle||"Switch to dark theme"}),(s,i)=>(h(),X(nc,{title:a.value,class:"VPSwitchAppearance","aria-checked":g(t),onClick:g(r)},{default:A(()=>i[0]||(i[0]=[w("span",{class:"vpi-sun sun"},null,-1),w("span",{class:"vpi-moon moon"},null,-1)])),_:1},8,["title","aria-checked","onClick"]))}}),Sr=q(rc,[["__scopeId","data-v-41f06fec"]]),sc={key:0,class:"VPNavBarAppearance"},ac=V({__name:"VPNavBarAppearance",setup(e){const{site:t}=ie();return(n,r)=>g(t).appearance&&g(t).appearance!=="force-dark"&&g(t).appearance!=="force-auto"?(h(),C("div",sc,[Y(Sr)])):G("",!0)}}),ic=q(ac,[["__scopeId","data-v-12ad808b"]]),Or=z();let ea=!1,Wn=0;function oc(e){const t=z(!1);if(Mn){!ea&&lc(),Wn++;const n=ke(Or,r=>{var a,s,i;r===e.el.value||(a=e.el.value)!=null&&a.contains(r)?(t.value=!0,(s=e.onFocus)==null||s.call(e)):(t.value=!1,(i=e.onBlur)==null||i.call(e))});An(()=>{n(),Wn--,Wn||cc()})}return ki(t)}function lc(){document.addEventListener("focusin",ta),ea=!0,Or.value=document.activeElement}function cc(){document.removeEventListener("focusin",ta)}function ta(){Or.value=document.activeElement}const uc={class:"VPMenuLink"},dc=V({__name:"VPMenuLink",props:{item:{}},setup(e){const{page:t}=ie();return(n,r)=>(h(),C("div",uc,[Y(ze,{class:de({active:g(Lt)(g(t).relativePath,n.item.activeMatch||n.item.link,!!n.item.activeMatch)}),href:n.item.link,target:n.item.target,rel:n.item.rel},{default:A(()=>[qe(se(n.item.text),1)]),_:1},8,["class","href","target","rel"])]))}}),Rn=q(dc,[["__scopeId","data-v-7e61137e"]]),mc={class:"VPMenuGroup"},pc={key:0,class:"title"},fc=V({__name:"VPMenuGroup",props:{text:{},items:{}},setup(e){return(t,n)=>(h(),C("div",mc,[t.text?(h(),C("p",pc,se(t.text),1)):G("",!0),(h(!0),C(ge,null,Me(t.items,r=>(h(),C(ge,null,["link"in r?(h(),X(Rn,{key:0,item:r},null,8,["item"])):G("",!0)],64))),256))]))}}),hc=q(fc,[["__scopeId","data-v-b7ccc091"]]),gc={class:"VPMenu"},vc={key:0,class:"items"},_c=V({__name:"VPMenu",props:{items:{}},setup(e){return(t,n)=>(h(),C("div",gc,[t.items?(h(),C("div",vc,[(h(!0),C(ge,null,Me(t.items,r=>(h(),C(ge,{key:JSON.stringify(r)},["link"in r?(h(),X(Rn,{key:0,item:r},null,8,["item"])):"component"in r?(h(),X(Ye(r.component),dt({key:1,ref_for:!0},r.props),null,16)):(h(),X(hc,{key:2,text:r.text,items:r.items},null,8,["text","items"]))],64))),128))])):G("",!0),S(t.$slots,"default",{},void 0,!0)]))}}),bc=q(_c,[["__scopeId","data-v-e8a1c26e"]]),yc=["aria-expanded","aria-label"],kc={key:0,class:"text"},wc=["innerHTML"],Lc={key:1,class:"vpi-more-horizontal icon"},Ec={class:"menu"},Sc=V({__name:"VPFlyout",props:{icon:{},button:{},label:{},items:{}},setup(e){const t=z(!1),n=z();oc({el:n,onBlur:r});function r(){t.value=!1}return(a,s)=>(h(),C("div",{class:"VPFlyout",ref_key:"el",ref:n,onMouseenter:s[1]||(s[1]=i=>t.value=!0),onMouseleave:s[2]||(s[2]=i=>t.value=!1)},[w("button",{type:"button",class:"button","aria-haspopup":"true","aria-expanded":t.value,"aria-label":a.label,onClick:s[0]||(s[0]=i=>t.value=!t.value)},[a.button||a.icon?(h(),C("span",kc,[a.icon?(h(),C("span",{key:0,class:de([a.icon,"option-icon"])},null,2)):G("",!0),a.button?(h(),C("span",{key:1,innerHTML:a.button},null,8,wc)):G("",!0),s[3]||(s[3]=w("span",{class:"vpi-chevron-down text-icon"},null,-1))])):(h(),C("span",Lc))],8,yc),w("div",Ec,[Y(bc,{items:a.items},{default:A(()=>[S(a.$slots,"default",{},void 0,!0)]),_:3},8,["items"])])],544))}}),Cr=q(Sc,[["__scopeId","data-v-7e42a472"]]),Oc=["href","aria-label","innerHTML"],Cc=V({__name:"VPSocialLink",props:{icon:{},link:{},ariaLabel:{}},setup(e){const t=e,n=U(()=>typeof t.icon=="object"?t.icon.svg:``);return(r,a)=>(h(),C("a",{class:"VPSocialLink no-icon",href:r.link,"aria-label":r.ariaLabel??(typeof r.icon=="string"?r.icon:""),target:"_blank",rel:"noopener",innerHTML:n.value},null,8,Oc))}}),Ic=q(Cc,[["__scopeId","data-v-1d65eafe"]]),Ac={class:"VPSocialLinks"},Tc=V({__name:"VPSocialLinks",props:{links:{}},setup(e){return(t,n)=>(h(),C("div",Ac,[(h(!0),C(ge,null,Me(t.links,({link:r,icon:a,ariaLabel:s})=>(h(),X(Ic,{key:r,icon:a,link:r,ariaLabel:s},null,8,["icon","link","ariaLabel"]))),128))]))}}),Ir=q(Tc,[["__scopeId","data-v-259de3d6"]]),Nc={key:0,class:"group translations"},Mc={class:"trans-title"},Pc={key:1,class:"group"},Rc={class:"item appearance"},$c={class:"label"},Fc={class:"appearance-action"},xc={key:2,class:"group"},Dc={class:"item social-links"},Vc=V({__name:"VPNavBarExtra",setup(e){const{site:t,theme:n}=ie(),{localeLinks:r,currentLang:a}=rn({correspondingLink:!0}),s=U(()=>r.value.length&&a.value.label||t.value.appearance||n.value.socialLinks);return(i,o)=>s.value?(h(),X(Cr,{key:0,class:"VPNavBarExtra",label:"extra navigation"},{default:A(()=>[g(r).length&&g(a).label?(h(),C("div",Nc,[w("p",Mc,se(g(a).label),1),(h(!0),C(ge,null,Me(g(r),l=>(h(),X(Rn,{key:l.link,item:l},null,8,["item"]))),128))])):G("",!0),g(t).appearance&&g(t).appearance!=="force-dark"&&g(t).appearance!=="force-auto"?(h(),C("div",Pc,[w("div",Rc,[w("p",$c,se(g(n).darkModeSwitchLabel||"Appearance"),1),w("div",Fc,[Y(Sr)])])])):G("",!0),g(n).socialLinks?(h(),C("div",xc,[w("div",Dc,[Y(Ir,{class:"social-links-list",links:g(n).socialLinks},null,8,["links"])])])):G("",!0)]),_:1})):G("",!0)}}),Uc=q(Vc,[["__scopeId","data-v-1b59c413"]]),Hc=["aria-expanded"],Bc=V({__name:"VPNavBarHamburger",props:{active:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>(h(),C("button",{type:"button",class:de(["VPNavBarHamburger",{active:t.active}]),"aria-label":"mobile navigation","aria-expanded":t.active,"aria-controls":"VPNavScreen",onClick:n[0]||(n[0]=r=>t.$emit("click"))},n[1]||(n[1]=[w("span",{class:"container"},[w("span",{class:"top"}),w("span",{class:"middle"}),w("span",{class:"bottom"})],-1)]),10,Hc))}}),Wc=q(Bc,[["__scopeId","data-v-0fa0fd27"]]),jc=["innerHTML"],Kc=V({__name:"VPNavBarMenuLink",props:{item:{}},setup(e){const{page:t}=ie();return(n,r)=>(h(),X(ze,{class:de({VPNavBarMenuLink:!0,active:g(Lt)(g(t).relativePath,n.item.activeMatch||n.item.link,!!n.item.activeMatch)}),href:n.item.link,noIcon:n.item.noIcon,target:n.item.target,rel:n.item.rel,tabindex:"0"},{default:A(()=>[w("span",{innerHTML:n.item.text},null,8,jc)]),_:1},8,["class","href","noIcon","target","rel"]))}}),Gc=q(Kc,[["__scopeId","data-v-e692fe86"]]),Yc=V({__name:"VPNavBarMenuGroup",props:{item:{}},setup(e){const t=e,{page:n}=ie(),r=s=>"component"in s?!1:"link"in s?Lt(n.value.relativePath,s.link,!!t.item.activeMatch):s.items.some(r),a=U(()=>r(t.item));return(s,i)=>(h(),X(Cr,{class:de({VPNavBarMenuGroup:!0,active:g(Lt)(g(n).relativePath,s.item.activeMatch,!!s.item.activeMatch)||a.value}),button:s.item.text,items:s.item.items},null,8,["class","button","items"]))}}),zc={key:0,"aria-labelledby":"main-nav-aria-label",class:"VPNavBarMenu"},Xc=V({__name:"VPNavBarMenu",setup(e){const{theme:t}=ie();return(n,r)=>g(t).nav?(h(),C("nav",zc,[r[0]||(r[0]=w("span",{id:"main-nav-aria-label",class:"visually-hidden"}," Main Navigation ",-1)),(h(!0),C(ge,null,Me(g(t).nav,a=>(h(),C(ge,{key:JSON.stringify(a)},["link"in a?(h(),X(Gc,{key:0,item:a},null,8,["item"])):"component"in a?(h(),X(Ye(a.component),dt({key:1,ref_for:!0},a.props),null,16)):(h(),X(Yc,{key:2,item:a},null,8,["item"]))],64))),128))])):G("",!0)}}),Jc=q(Xc,[["__scopeId","data-v-30753f5b"]]);var xr;const na=typeof window<"u",qc=e=>typeof e=="string",fn=()=>{};na&&((xr=window==null?void 0:window.navigator)!=null&&xr.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function nr(e){return typeof e=="function"?e():g(e)}function Qc(e,t){function n(...r){e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})}return n}function Zc(e,t={}){let n,r;return a=>{const s=nr(e),i=nr(t.maxWait);if(n&&clearTimeout(n),s<=0||i!==void 0&&i<=0)return r&&(clearTimeout(r),r=null),a();i&&!r&&(r=setTimeout(()=>{n&&clearTimeout(n),r=null,a()},i)),n=setTimeout(()=>{r&&clearTimeout(r),r=null,a()},s)}}function eu(e){return e}function tu(e){return zs()?(Xs(e),!0):!1}function ra(e,t=200,n={}){return Qc(Zc(t,n),e)}function jn(e,t=200,n={}){if(t<=0)return e;const r=z(e.value),a=ra(()=>{r.value=e.value},t,n);return ke(e,()=>a()),r}function sa(e,t,n){return ke(e,(r,a,s)=>{r&&t(r,a,s)},n)}function nu(e){var t;const n=nr(e);return(t=n==null?void 0:n.$el)!=null?t:n}const aa=na?window:void 0;function un(...e){let t,n,r,a;if(qc(e[0])?([n,r,a]=e,t=aa):[t,n,r,a]=e,!t)return fn;let s=fn;const i=ke(()=>nu(t),l=>{s(),l&&(l.addEventListener(n,r,a),s=()=>{l.removeEventListener(n,r,a),s=fn})},{immediate:!0,flush:"post"}),o=()=>{i(),s()};return tu(o),o}const Dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vr="__vueuse_ssr_handlers__";Dr[Vr]=Dr[Vr]||{};const ru={ctrl:"control",command:"meta",cmd:"meta",option:"alt",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright"};function su(e={}){const{reactive:t=!1,target:n=aa,aliasMap:r=ru,passive:a=!0,onEventFired:s=fn}=e,i=Zt(new Set),o={toJSON(){return{}},current:i},l=t?Zt(o):o,c=new Set,u=new Set;function m(_,b){_ in l&&(t?l[_]=b:l[_].value=b)}function d(){for(const _ of u)m(_,!1)}function v(_,b){var M,W;const y=(M=_.key)==null?void 0:M.toLowerCase(),L=[(W=_.code)==null?void 0:W.toLowerCase(),y].filter(Boolean);y&&(b?i.add(y):i.delete(y));for(const T of L)u.add(T),m(T,b);y==="meta"&&!b?(c.forEach(T=>{i.delete(T),m(T,!1)}),c.clear()):typeof _.getModifierState=="function"&&_.getModifierState("Meta")&&b&&[...i,...L].forEach(T=>c.add(T))}un(n,"keydown",_=>(v(_,!0),s(_)),{passive:a}),un(n,"keyup",_=>(v(_,!1),s(_)),{passive:a}),un("blur",d,{passive:!0}),un("focus",d,{passive:!0});const E=new Proxy(l,{get(_,b,M){if(typeof b!="string")return Reflect.get(_,b,M);if(b=b.toLowerCase(),b in r&&(b=r[b]),!(b in l))if(/[+_-]/.test(b)){const y=b.split(/[+_-]/g).map(L=>L.trim());l[b]=U(()=>y.every(L=>g(E[L])))}else l[b]=z(!1);const W=Reflect.get(_,b,M);return t?g(W):W}});return E}var Ur;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Ur||(Ur={}));var au=Object.defineProperty,Hr=Object.getOwnPropertySymbols,iu=Object.prototype.hasOwnProperty,ou=Object.prototype.propertyIsEnumerable,Br=(e,t,n)=>t in e?au(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lu=(e,t)=>{for(var n in t||(t={}))iu.call(t,n)&&Br(e,n,t[n]);if(Hr)for(var n of Hr(t))ou.call(t,n)&&Br(e,n,t[n]);return e};const cu={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};lu({linear:eu},cu);function it(e){return Array.isArray?Array.isArray(e):la(e)==="[object Array]"}const uu=1/0;function du(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-uu?"-0":t}function mu(e){return e==null?"":du(e)}function Ke(e){return typeof e=="string"}function ia(e){return typeof e=="number"}function pu(e){return e===!0||e===!1||fu(e)&&la(e)=="[object Boolean]"}function oa(e){return typeof e=="object"}function fu(e){return oa(e)&&e!==null}function Fe(e){return e!=null}function Kn(e){return!e.trim().length}function la(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const hu="Incorrect 'index' type",gu=e=>`Invalid value for key ${e}`,vu=e=>`Pattern length exceeds max of ${e}.`,_u=e=>`Missing ${e} property in key`,bu=e=>`Property 'weight' in key '${e}' must be a positive integer`,Wr=Object.prototype.hasOwnProperty;class yu{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let a=ca(r);n+=a.weight,this._keys.push(a),this._keyMap[a.id]=a,n+=a.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ca(e){let t=null,n=null,r=null,a=1,s=null;if(Ke(e)||it(e))r=e,t=jr(e),n=rr(e);else{if(!Wr.call(e,"name"))throw new Error(_u("name"));const i=e.name;if(r=i,Wr.call(e,"weight")&&(a=e.weight,a<=0))throw new Error(bu(i));t=jr(i),n=rr(i),s=e.getFn}return{path:t,id:n,weight:a,src:r,getFn:s}}function jr(e){return it(e)?e:e.split(".")}function rr(e){return it(e)?e.join("."):e}function ku(e,t){let n=[],r=!1;const a=(s,i,o)=>{if(Fe(s))if(!i[o])n.push(s);else{let l=i[o];const c=s[l];if(!Fe(c))return;if(o===i.length-1&&(Ke(c)||ia(c)||pu(c)))n.push(mu(c));else if(it(c)){r=!0;for(let u=0,m=c.length;ue.score===t.score?e.idx{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ke(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();Ke(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n{let i=a.getFn?a.getFn(t):this.getFn(t,a.path);if(Fe(i)){if(it(i)){let o=[];const l=[{nestedArrIndex:-1,value:i}];for(;l.length;){const{nestedArrIndex:c,value:u}=l.pop();if(Fe(u))if(Ke(u)&&!Kn(u)){let m={v:u,i:c,n:this.norm.get(u)};o.push(m)}else it(u)&&u.forEach((m,d)=>{l.push({nestedArrIndex:d,value:m})})}r.$[s]=o}else if(Ke(i)&&!Kn(i)){let o={v:i,n:this.norm.get(i)};r.$[s]=o}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function ua(e,t,{getFn:n=ee.getFn,fieldNormWeight:r=ee.fieldNormWeight}={}){const a=new Ar({getFn:n,fieldNormWeight:r});return a.setKeys(e.map(ca)),a.setSources(t),a.create(),a}function Iu(e,{getFn:t=ee.getFn,fieldNormWeight:n=ee.fieldNormWeight}={}){const{keys:r,records:a}=e,s=new Ar({getFn:t,fieldNormWeight:n});return s.setKeys(r),s.setIndexRecords(a),s}function dn(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:a=ee.distance,ignoreLocation:s=ee.ignoreLocation}={}){const i=t/e.length;if(s)return i;const o=Math.abs(r-n);return a?i+o/a:o?1:i}function Au(e=[],t=ee.minMatchCharLength){let n=[],r=-1,a=-1,s=0;for(let i=e.length;s=t&&n.push([r,a]),r=-1)}return e[s-1]&&s-r>=t&&n.push([r,s-1]),n}const wt=32;function Tu(e,t,n,{location:r=ee.location,distance:a=ee.distance,threshold:s=ee.threshold,findAllMatches:i=ee.findAllMatches,minMatchCharLength:o=ee.minMatchCharLength,includeMatches:l=ee.includeMatches,ignoreLocation:c=ee.ignoreLocation}={}){if(t.length>wt)throw new Error(vu(wt));const u=t.length,m=e.length,d=Math.max(0,Math.min(r,m));let v=s,E=d;const _=o>1||l,b=_?Array(m):[];let M;for(;(M=e.indexOf(t,E))>-1;){let R=dn(t,{currentLocation:M,expectedLocation:d,distance:a,ignoreLocation:c});if(v=Math.min(R,v),E=M+u,_){let x=0;for(;x=me;D-=1){let re=D-1,Ee=n[e.charAt(re)];if(_&&(b[re]=+!!Ee),Z[D]=(Z[D+1]<<1|1)&Ee,R&&(Z[D]|=(W[D+1]|W[D])<<1|1|W[D+1]),Z[D]&T&&(y=dn(t,{errors:R,currentLocation:re,expectedLocation:d,distance:a,ignoreLocation:c}),y<=v)){if(v=y,E=re,E<=d)break;me=Math.max(1,2*d-E)}}if(dn(t,{errors:R+1,currentLocation:d,expectedLocation:d,distance:a,ignoreLocation:c})>v)break;W=Z}const I={isMatch:E>=0,score:Math.max(.001,y)};if(_){const R=Au(b,o);R.length?l&&(I.indices=R):I.isMatch=!1}return I}function Nu(e){let t={};for(let n=0,r=e.length;n{this.chunks.push({pattern:d,alphabet:Nu(d),startIndex:v})},m=this.pattern.length;if(m>wt){let d=0;const v=m%wt,E=m-v;for(;d{const{isMatch:M,score:W,indices:y}=Tu(t,E,_,{location:a+b,distance:s,threshold:i,findAllMatches:o,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});M&&(d=!0),m+=W,M&&y&&(u=[...u,...y])});let v={isMatch:d,score:d?m/this.chunks.length:1};return d&&r&&(v.indices=u),v}}class gt{constructor(t){this.pattern=t}static isMultiMatch(t){return Kr(t,this.multiRegex)}static isSingleMatch(t){return Kr(t,this.singleRegex)}search(){}}function Kr(e,t){const n=e.match(t);return n?n[1]:null}class Mu extends gt{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class Pu extends gt{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const n=t.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Ru extends gt{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class $u extends gt{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Fu extends gt{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class xu extends gt{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class ma extends gt{constructor(t,{location:n=ee.location,threshold:r=ee.threshold,distance:a=ee.distance,includeMatches:s=ee.includeMatches,findAllMatches:i=ee.findAllMatches,minMatchCharLength:o=ee.minMatchCharLength,isCaseSensitive:l=ee.isCaseSensitive,ignoreLocation:c=ee.ignoreLocation}={}){super(t),this._bitapSearch=new da(t,{location:n,threshold:r,distance:a,includeMatches:s,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class pa extends gt{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const a=[],s=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+s,a.push([r,n-1]);const i=!!a.length;return{isMatch:i,score:i?0:1,indices:a}}}const sr=[Mu,pa,Ru,$u,xu,Fu,Pu,ma],Gr=sr.length,Du=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Vu="|";function Uu(e,t={}){return e.split(Vu).map(n=>{let r=n.trim().split(Du).filter(s=>s&&!!s.trim()),a=[];for(let s=0,i=r.length;s!!(e[wn.AND]||e[wn.OR]),ju=e=>!!e[or.PATH],Ku=e=>!it(e)&&oa(e)&&!lr(e),Yr=e=>({[wn.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function fa(e,t,{auto:n=!0}={}){const r=a=>{let s=Object.keys(a);const i=ju(a);if(!i&&s.length>1&&!lr(a))return r(Yr(a));if(Ku(a)){const l=i?a[or.PATH]:s[0],c=i?a[or.PATTERN]:a[l];if(!Ke(c))throw new Error(gu(l));const u={keyId:rr(l),pattern:c};return n&&(u.searcher=ir(c,t)),u}let o={children:[],operator:s[0]};return s.forEach(l=>{const c=a[l];it(c)&&c.forEach(u=>{o.children.push(r(u))})}),o};return lr(e)||(e=Yr(e)),r(e)}function Gu(e,{ignoreFieldNorm:t=ee.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:a,norm:s,score:i})=>{const o=a?a.weight:null;r*=Math.pow(i===0&&o?Number.EPSILON:i,(o||1)*(t?1:s))}),n.score=r})}function Yu(e,t){const n=e.matches;t.matches=[],Fe(n)&&n.forEach(r=>{if(!Fe(r.indices)||!r.indices.length)return;const{indices:a,value:s}=r;let i={indices:a,value:s};r.key&&(i.key=r.key.src),r.idx>-1&&(i.refIndex=r.idx),t.matches.push(i)})}function zu(e,t){t.score=e.score}function Xu(e,t,{includeMatches:n=ee.includeMatches,includeScore:r=ee.includeScore}={}){const a=[];return n&&a.push(Yu),r&&a.push(zu),e.map(s=>{const{idx:i}=s,o={item:t[i],refIndex:i};return a.length&&a.forEach(l=>{l(s,o)}),o})}class Et{constructor(t,n={},r){this.options={...ee,...n},this.options.useExtendedSearch,this._keyStore=new yu(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof Ar))throw new Error(hu);this._myIndex=n||ua(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){!Fe(t)||(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,a=this._docs.length;r-1&&(l=l.slice(0,n)),Xu(l,this._docs,{includeMatches:r,includeScore:a})}_searchStringList(t){const n=ir(t,this.options),{records:r}=this._myIndex,a=[];return r.forEach(({v:s,i,n:o})=>{if(!Fe(s))return;const{isMatch:l,score:c,indices:u}=n.searchIn(s);l&&a.push({item:s,idx:i,matches:[{score:c,value:s,norm:o,indices:u}]})}),a}_searchLogical(t){const n=fa(t,this.options),r=(o,l,c)=>{if(!o.children){const{keyId:m,searcher:d}=o,v=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(l,m),searcher:d});return v&&v.length?[{idx:c,item:l,matches:v}]:[]}const u=[];for(let m=0,d=o.children.length;m{if(Fe(o)){let c=r(n,o,l);c.length&&(s[l]||(s[l]={idx:l,item:o,matches:[]},i.push(s[l])),c.forEach(({matches:u})=>{s[l].matches.push(...u)}))}}),i}_searchObjectList(t){const n=ir(t,this.options),{keys:r,records:a}=this._myIndex,s=[];return a.forEach(({$:i,i:o})=>{if(!Fe(i))return;let l=[];r.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:i[u],searcher:n}))}),l.length&&s.push({idx:o,item:i,matches:l})}),s}_findMatches({key:t,value:n,searcher:r}){if(!Fe(n))return[];let a=[];if(it(n))n.forEach(({v:s,i,n:o})=>{if(!Fe(s))return;const{isMatch:l,score:c,indices:u}=r.searchIn(s);l&&a.push({score:c,key:t,value:s,idx:i,norm:o,indices:u})});else{const{v:s,n:i}=n,{isMatch:o,score:l,indices:c}=r.searchIn(s);o&&a.push({score:l,key:t,value:s,norm:i,indices:c})}return a}}Et.version="6.6.2";Et.createIndex=ua;Et.parseIndex=Iu;Et.config=ee;Et.parseQuery=fa;Wu(Bu);const zr=Zt({selectedNode:"",selectedGroup:"",search:"",dataValue:"",filtered:{count:0,items:new Map,groups:new Set}}),Ht=()=>({isSearching:U(()=>zr.search!==""),...Li(zr)});function Ju(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(a){a(n)}),(r=e.get("*"))&&r.slice().map(function(a){a(t,n)})}}}const qu=Ju(),$n=()=>({emitter:qu});function Qu(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Zu(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}const ed=["command-theme"],td={"command-root":""},nd=V({name:"Command"}),rd=V({...nd,props:{theme:{type:String,default:"default"},fuseOptions:{type:Object,default:()=>({threshold:.2,keys:["label"]})}},emits:["select-item"],setup(e,{emit:t}){const n=e,r='[command-item=""]',a="command-item-key",s='[command-group=""]',i="command-group-key",o='[command-group-heading=""]',l=`${r}:not([aria-disabled="true"])`,c=`${r}[aria-selected="true"]`,u="command-item-select",m="data-value";wr("theme",n.theme||"default");const{selectedNode:d,search:v,dataValue:E,filtered:_}=Ht(),{emitter:b}=$n(),M=z(),W=jn(z(new Map),333),y=jn(z(new Set),333),L=jn(z(new Map)),T=U(()=>{const j=[];for(const[le,oe]of W.value.entries())j.push({key:le,label:oe});return j}),I=U(()=>{const j=Et.createIndex(n.fuseOptions.keys,T.value);return new Et(T.value,n.fuseOptions,j)}),R=()=>{var j,le,oe;const pe=x();pe&&(((j=pe.parentElement)==null?void 0:j.firstElementChild)===pe&&((oe=(le=pe.closest(s))==null?void 0:le.querySelector(o))==null||oe.scrollIntoView({block:"nearest"})),pe.scrollIntoView({block:"nearest"}))},x=()=>{var j;return(j=M.value)==null?void 0:j.querySelector(c)},$=(j=M.value)=>{const le=j==null?void 0:j.querySelectorAll(l);return le?Array.from(le):[]},me=()=>{var j;const le=(j=M.value)==null?void 0:j.querySelectorAll(s);return le?Array.from(le):[]},we=()=>{const[j]=$();j&&j.getAttribute(a)&&(d.value=j.getAttribute(a)||"")},Z=j=>{const le=$()[j];le&&(d.value=le.getAttribute(a)||"")},D=j=>{const le=x(),oe=$(),pe=oe.findIndex(je=>je===le),$e=oe[pe+j];$e?d.value=$e.getAttribute(a)||"":j>0?Z(0):Z(oe.length-1)},re=j=>{const le=x();let oe=le==null?void 0:le.closest(s),pe=null;for(;oe&&!pe;)oe=j>0?Qu(oe,s):Zu(oe,s),pe=oe==null?void 0:oe.querySelector(l);pe?d.value=pe.getAttribute(a)||"":D(j)},Ee=()=>Z(0),Oe=()=>Z($().length-1),_e=j=>{j.preventDefault(),j.metaKey?Oe():j.altKey?re(1):D(1)},De=j=>{j.preventDefault(),j.metaKey?Ee():j.altKey?re(-1):D(-1)},Ze=j=>{switch(j.key){case"n":case"j":{j.ctrlKey&&_e(j);break}case"ArrowDown":{_e(j);break}case"p":case"k":{j.ctrlKey&&De(j);break}case"ArrowUp":{De(j);break}case"Home":{Ee();break}case"End":{Oe();break}case"Enter":{const le=x();if(le){const oe=new Event(u);le.dispatchEvent(oe)}}}},be=()=>{if(!v.value){_.value.count=y.value.size;return}_.value.groups=new Set("");const j=new Map,le=I.value.search(v.value).map(oe=>oe.item);for(const{key:oe,label:pe}of le)j.set(oe,pe);for(const[oe,pe]of L.value)for(const $e of pe)j.get($e)&&_.value.groups.add(oe);at(()=>{_.value.count=j.size,_.value.items=j})},Le=()=>{const j=$(),le=me();for(const oe of j){const pe=oe.getAttribute(a)||"",$e=oe.getAttribute(m)||"";y.value.add(pe),W.value.set(pe,$e),_.value.count=W.value.size}for(const oe of le){const pe=$(oe),$e=oe.getAttribute(i)||"",je=new Set("");for(const bt of pe){const lt=bt.getAttribute(a)||"";je.add(lt)}L.value.set($e,je)}};ke(()=>d.value,j=>{j&&at(R)},{deep:!0}),ke(()=>v.value,j=>{be(),at(we)}),b.on("selectItem",j=>{t("select-item",j)});const Ve=ra(j=>{j&&(Le(),at(we))},100);return b.on("rerenderList",Ve),We(()=>{Le(),we()}),(j,le)=>(h(),C("div",{class:de(e.theme),onKeydown:Ze,ref_key:"commandRef",ref:M,"command-theme":e.theme},[w("div",td,[S(j.$slots,"default")])],42,ed))}}),Bt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},cr=Bt(rd,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/Command.vue"]]),sd={"command-dialog":""},ad={"command-dialog-mask":""},id={"command-dialog-wrapper":""},od={"command-dialog-header":""},ld={"command-dialog-body":""},cd={key:0,"command-dialog-footer":""},ud=V({name:"Command.Dialog"}),dd=V({...ud,props:{visible:{type:Boolean,required:!0},theme:{type:String,required:!0}},emits:["select-item"],setup(e,{emit:t}){const n=e,{search:r,filtered:a}=Ht(),{emitter:s}=$n(),i=z();s.on("selectItem",l=>{t("select-item",l)});const o=()=>{r.value="",a.value.count=0,a.value.items=new Map,a.value.groups=new Set};return sa(()=>n.visible,o),Pn(o),(l,c)=>(h(),X(wi,{to:"body",ref_key:"dialogRef",ref:i},[Y(Cn,{name:"command-dialog",appear:""},{default:A(()=>[e.visible?(h(),X(cr,{key:0,theme:e.theme},{default:A(()=>[w("div",sd,[w("div",ad,[w("div",id,[w("div",od,[S(l.$slots,"header")]),w("div",ld,[S(l.$slots,"body")]),l.$slots.footer?(h(),C("div",cd,[S(l.$slots,"footer")])):G("v-if",!0)])])])]),_:3},8,["theme"])):G("v-if",!0)]),_:3})],512))}}),md=Bt(dd,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/CommandDialog.vue"]]);let ha=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const pd=["command-group-key","data-value"],fd={key:0,"command-group-heading":""},hd={"command-group-items":"",role:"group"},gd=V({name:"Command.Group"}),vd=V({...gd,props:{heading:{type:String,required:!0}},setup(e){const t=U(()=>`command-group-${ha()}`),{filtered:n,isSearching:r}=Ht(),a=U(()=>r.value?n.value.groups.has(t.value):!0);return(s,i)=>_n((h(),C("div",{"command-group":"",role:"presentation",key:g(t),"command-group-key":g(t),"data-value":e.heading},[e.heading?(h(),C("div",fd,se(e.heading),1)):G("v-if",!0),w("div",hd,[S(s.$slots,"default")])],8,pd)),[[bn,g(a)]])}}),_d=Bt(vd,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/CommandGroup.vue"]]),bd=["placeholder","value"],yd=V({name:"Command.Input"}),kd=V({...yd,props:{placeholder:{type:String,required:!0},value:{type:String,required:!1}},emits:["input","update:value"],setup(e,{emit:t}){const n=z(null),{search:r}=Ht(),a=U(()=>r.value),s=i=>{const o=i,l=i.target;r.value=l==null?void 0:l.value,t("input",o),t("update:value",r.value)};return ft(()=>{var i;(i=n.value)==null||i.focus()}),(i,o)=>(h(),C("input",{ref_key:"inputRef",ref:n,"command-input":"","auto-focus":"","auto-complete":"off","auto-correct":"off","spell-check":!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,placeholder:e.placeholder,value:g(a),onInput:s},null,40,bd))}}),wd=Bt(kd,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/CommandInput.vue"]]),Ld=["aria-selected","aria-disabled","command-item-key"],Ed=V({name:"Command.Item"}),Sd=V({...Ed,props:{shortcut:{type:Array,required:!1},perform:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const n=e,r="command-item-select",a="data-value",{current:s}=su(),{selectedNode:i,filtered:o,isSearching:l}=Ht(),{emitter:c}=$n(),u=z(),m=U(()=>`command-item-${ha()}`),d=U(()=>{const _=o.value.items.get(m.value);return l.value?_!==void 0:!0}),v=U(()=>Array.from(s)),E=()=>{var _;const b={key:m.value,value:((_=u.value)==null?void 0:_.getAttribute(a))||""};t("select",b),c.emit("selectItem",b)};return sa(v,_=>{n.shortcut&&n.shortcut.length>0&&n.shortcut.every(b=>s.has(b.toLowerCase()))&&n.perform&&n.perform()}),ft(()=>{var _;(_=u.value)==null||_.addEventListener(r,E)}),Pn(()=>{var _;(_=u.value)==null||_.removeEventListener(r,E)}),(_,b)=>_n((h(),C("div",{ref_key:"itemRef",ref:u,"command-item":"",role:"option","aria-selected":g(i)===g(m),"aria-disabled":!g(d),key:g(m),"command-item-key":g(m),onClick:E},[S(_.$slots,"default")],8,Ld)),[[bn,g(d)]])}}),Od=Bt(Sd,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/CommandItem.vue"]]),Cd=V({name:"Command.List"}),Id=V({...Cd,setup(e){const{emitter:t}=$n(),n=z(),r=z();let a=null,s;return ft(()=>{s=r.value;const i=n.value;s&&i&&(a=new ResizeObserver(o=>{at(()=>{const l=s==null?void 0:s.offsetHeight;i==null||i.style.setProperty("--command-list-height",`${l==null?void 0:l.toFixed(1)}px`),t.emit("rerenderList",!0)})}),a.observe(s))}),Pn(()=>{a!==null&&s&&a.unobserve(s)}),(i,o)=>(h(),C("div",{"command-list":"",role:"listbox","aria-label":"Suggestions",ref_key:"listRef",ref:n},[w("div",{"command-list-sizer":"",ref_key:"heightRef",ref:r},[S(i.$slots,"default")],512)],512))}}),Ad=Bt(Id,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/CommandList.vue"]]),Td=V({name:"Command.Empty",setup(e,{attrs:t,slots:n}){const{filtered:r}=Ht(),a=U(()=>r.value.count===0);return()=>a.value?$t("div",{"command-empty":"",role:"presentation",...t},n):$t("div",{"command-empty":"hidden",role:"presentation",style:{display:"none"},...t})}}),Nd=V({name:"Command.Loading",setup(e,{attrs:t,slots:n}){return()=>$t("div",{"command-loading":"",role:"progressbar",...t},n)}}),Md=V({name:"Command.Separator",setup(e,{attrs:t,slots:n}){return()=>$t("div",{"command-separator":"",role:"separator",...t})}}),It=Object.assign(cr,{Dialog:md,Empty:Td,Group:_d,Input:wd,Item:Od,List:Ad,Loading:Nd,Separator:Md,Root:cr});var Xr;const ga=typeof window<"u",Pd=e=>typeof e=="string",va=()=>{};ga&&((Xr=window==null?void 0:window.navigator)!=null&&Xr.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function _a(e){return typeof e=="function"?e():g(e)}function Rd(e){return e}function $d(e){return zs()?(Xs(e),!0):!1}function Fd(e,t=!0){Ft()?We(e):t?e():at(e)}function xd(e){var t;const n=_a(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Tr=ga?window:void 0;function Mt(...e){let t,n,r,a;if(Pd(e[0])||Array.isArray(e[0])?([n,r,a]=e,t=Tr):[t,n,r,a]=e,!t)return va;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const s=[],i=()=>{s.forEach(u=>u()),s.length=0},o=(u,m,d,v)=>(u.addEventListener(m,d,v),()=>u.removeEventListener(m,d,v)),l=ke(()=>[xd(t),_a(a)],([u,m])=>{i(),u&&s.push(...n.flatMap(d=>r.map(v=>o(u,d,v,m))))},{immediate:!0,flush:"post"}),c=()=>{l(),i()};return $d(c),c}const Jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},qr="__vueuse_ssr_handlers__";Jr[qr]=Jr[qr]||{};const Dd={ctrl:"control",command:"meta",cmd:"meta",option:"alt",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright"};function Vd(e={}){const{reactive:t=!1,target:n=Tr,aliasMap:r=Dd,passive:a=!0,onEventFired:s=va}=e,i=Zt(new Set),o={toJSON(){return{}},current:i},l=t?Zt(o):o,c=new Set,u=new Set;function m(_,b){_ in l&&(t?l[_]=b:l[_].value=b)}function d(){i.clear();for(const _ of u)m(_,!1)}function v(_,b){var M,W;const y=(M=_.key)==null?void 0:M.toLowerCase(),T=[(W=_.code)==null?void 0:W.toLowerCase(),y].filter(Boolean);y&&(b?i.add(y):i.delete(y));for(const I of T)u.add(I),m(I,b);y==="meta"&&!b?(c.forEach(I=>{i.delete(I),m(I,!1)}),c.clear()):typeof _.getModifierState=="function"&&_.getModifierState("Meta")&&b&&[...i,...T].forEach(I=>c.add(I))}Mt(n,"keydown",_=>(v(_,!0),s(_)),{passive:a}),Mt(n,"keyup",_=>(v(_,!1),s(_)),{passive:a}),Mt("blur",d,{passive:!0}),Mt("focus",d,{passive:!0});const E=new Proxy(l,{get(_,b,M){if(typeof b!="string")return Reflect.get(_,b,M);if(b=b.toLowerCase(),b in r&&(b=r[b]),!(b in l))if(/[+_-]/.test(b)){const y=b.split(/[+_-]/g).map(L=>L.trim());l[b]=U(()=>y.every(L=>g(E[L])))}else l[b]=z(!1);const W=Reflect.get(_,b,M);return t?g(W):W}});return E}var Qr;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Qr||(Qr={}));var Ud=Object.defineProperty,Zr=Object.getOwnPropertySymbols,Hd=Object.prototype.hasOwnProperty,Bd=Object.prototype.propertyIsEnumerable,es=(e,t,n)=>t in e?Ud(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wd=(e,t)=>{for(var n in t||(t={}))Hd.call(t,n)&&es(e,n,t[n]);if(Zr)for(var n of Zr(t))Bd.call(t,n)&&es(e,n,t[n]);return e};const jd={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};Wd({linear:Rd},jd);function Kd(e={}){const{window:t=Tr,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:a=!0,includeScrollbar:s=!0}=e,i=z(n),o=z(r),l=()=>{t&&(s?(i.value=t.innerWidth,o.value=t.innerHeight):(i.value=t.document.documentElement.clientWidth,o.value=t.document.documentElement.clientHeight))};return l(),Fd(l),Mt("resize",l,{passive:!0}),a&&Mt("orientationchange",l,{passive:!0}),{width:i,height:o}}const Gn=z([{route:"/ran/src/article/babel.html",meta:{description:"",title:"Babel",date:"2024-09-15 05:16:48"}},{route:"/ran/src/article/bundle.html",meta:{description:"",title:"Bundle",date:"2024-09-15 05:16:48"}},{route:"/ran/src/article/designMode.html",meta:{description:"",title:"23classicdesignpatterns",date:"2024-09-15 05:16:48"}},{route:"/ran/src/article/functionalProgramming.html",meta:{description:"",title:"函数式编程",date:"2024-09-15 05:16:48"}},{route:"/ran/src/article/imagemin.html",meta:{description:"",title:"imagemin图片压缩源码分析",date:"2024-09-15 05:16:48"}},{route:"/ran/src/ranui/",meta:{description:`# ranui +import{d as V,o as h,c as C,r as S,a as qe,t as se,n as de,b as X,w as A,e as G,T as Cn,_ as q,u as vn,i as hi,f as gi,g as In,h as U,j as w,k as g,l as Lt,m as Qn,p as z,q as ke,s as ft,v as We,x as An,y as kr,z as vi,A as _i,B as ht,F as ge,C as Me,D as Tn,E as Nn,G as Y,H as Ks,I as Ye,J as nn,K as dt,L as Ut,M as bi,N as Gs,O as yi,P as at,Q as Ys,R as Mn,S as ki,U as Zt,V as wr,W as Pn,X as wi,Y as _n,Z as bn,$ as Li,a0 as $t,a1 as zs,a2 as Xs,a3 as Ft,a4 as Ei,a5 as Si,a6 as Oi,a7 as Ci,a8 as Js,a9 as Ii,aa as Ai,ab as Ti,ac as Ni,ad as Mi,ae as Pi,af as Ri,ag as $i,ah as Fi,ai as yn}from"./framework.BuqFyMr-.js";const xi=V({__name:"VPBadge",props:{text:{},type:{default:"tip"}},setup(e){return(t,n)=>(h(),C("span",{class:de(["VPBadge",t.type])},[S(t.$slots,"default",{},()=>[qe(se(t.text),1)])],2))}}),Di={key:0,class:"VPBackdrop"},Vi=V({__name:"VPBackdrop",props:{show:{type:Boolean}},setup(e){return(t,n)=>(h(),X(Cn,{name:"fade"},{default:A(()=>[t.show?(h(),C("div",Di)):G("",!0)]),_:1}))}}),Ui=q(Vi,[["__scopeId","data-v-aa2f5bb7"]]),ie=vn;function Hi(e,t){let n,r=!1;return()=>{n&&clearTimeout(n),r?n=setTimeout(e,t):(e(),(r=!0)&&setTimeout(()=>r=!1,t))}}function Zn(e){return/^\//.test(e)?e:`/${e}`}function Lr(e){const{pathname:t,search:n,hash:r,protocol:a}=new URL(e,"http://a.com");if(hi(e)||e.startsWith("#")||!a.startsWith("http")||!gi(t))return e;const{site:s}=ie(),i=t.endsWith("/")||t.endsWith(".html")?e:e.replace(/(?:(^\.+)\/)?.*$/,`$1${t.replace(/(\.md)?$/,s.value.cleanUrls?"":".html")}${n}${r}`);return In(i)}function rn({correspondingLink:e=!1}={}){const{site:t,localeIndex:n,page:r,theme:a,hash:s}=ie(),i=U(()=>{var l,c;return{label:(l=t.value.locales[n.value])==null?void 0:l.label,link:((c=t.value.locales[n.value])==null?void 0:c.link)||(n.value==="root"?"/":`/${n.value}/`)}});return{localeLinks:U(()=>Object.entries(t.value.locales).flatMap(([l,c])=>i.value.label===c.label?[]:{text:c.label,link:Bi(c.link||(l==="root"?"/":`/${l}/`),a.value.i18nRouting!==!1&&e,r.value.relativePath.slice(i.value.link.length-1),!t.value.cleanUrls)+s.value})),currentLang:i}}function Bi(e,t,n,r){return t?e.replace(/\/$/,"")+Zn(n.replace(/(^|\/)index\.md$/,"$1").replace(/\.md$/,r?".html":"")):e}const Wi={class:"NotFound"},ji={class:"code"},Ki={class:"title"},Gi={class:"quote"},Yi={class:"action"},zi=["href","aria-label"],Xi=V({__name:"NotFound",setup(e){const{theme:t}=ie(),{currentLang:n}=rn();return(r,a)=>{var s,i,o,l,c;return h(),C("div",Wi,[w("p",ji,se(((s=g(t).notFound)==null?void 0:s.code)??"404"),1),w("h1",Ki,se(((i=g(t).notFound)==null?void 0:i.title)??"PAGE NOT FOUND"),1),a[0]||(a[0]=w("div",{class:"divider"},null,-1)),w("blockquote",Gi,se(((o=g(t).notFound)==null?void 0:o.quote)??"But if you don't change your direction, and if you keep looking, you may end up where you are heading."),1),w("div",Yi,[w("a",{class:"link",href:g(In)(g(n).link),"aria-label":((l=g(t).notFound)==null?void 0:l.linkLabel)??"go to home"},se(((c=g(t).notFound)==null?void 0:c.linkText)??"Take me home"),9,zi)])])}}}),Ji=q(Xi,[["__scopeId","data-v-46f27357"]]);function qs(e,t){if(Array.isArray(e))return pn(e);if(e==null)return[];t=Zn(t);const n=Object.keys(e).sort((a,s)=>s.split("/").length-a.split("/").length).find(a=>t.startsWith(Zn(a))),r=n?e[n]:[];return Array.isArray(r)?pn(r):pn(r.items,r.base)}function qi(e){const t=[];let n=0;for(const r in e){const a=e[r];if(a.items){n=t.push(a);continue}t[n]||t.push({items:[]}),t[n].items.push(a)}return t}function Qi(e){const t=[];function n(r){for(const a of r)a.text&&a.link&&t.push({text:a.text,link:a.link,docFooterText:a.docFooterText}),a.items&&n(a.items)}return n(e),t}function er(e,t){return Array.isArray(t)?t.some(n=>er(e,n)):Lt(e,t.link)?!0:t.items?er(e,t.items):!1}function pn(e,t){return[...e].map(n=>{const r={...n},a=r.base||t;return a&&r.link&&(r.link=a+r.link),r.items&&(r.items=pn(r.items,a)),r})}function ot(){const{frontmatter:e,page:t,theme:n}=ie(),r=Qn("(min-width: 960px)"),a=z(!1),s=U(()=>{const _=n.value.sidebar,b=t.value.relativePath;return _?qs(_,b):[]}),i=z(s.value);ke(s,(_,b)=>{JSON.stringify(_)!==JSON.stringify(b)&&(i.value=s.value)});const o=U(()=>e.value.sidebar!==!1&&i.value.length>0&&e.value.layout!=="home"),l=U(()=>c?e.value.aside==null?n.value.aside==="left":e.value.aside==="left":!1),c=U(()=>e.value.layout==="home"?!1:e.value.aside!=null?!!e.value.aside:n.value.aside!==!1),u=U(()=>o.value&&r.value),m=U(()=>o.value?qi(i.value):[]);function d(){a.value=!0}function v(){a.value=!1}function E(){a.value?v():d()}return{isOpen:a,sidebar:i,sidebarGroups:m,hasSidebar:o,hasAside:c,leftAside:l,isSidebarEnabled:u,open:d,close:v,toggle:E}}function Zi(e,t){let n;ft(()=>{n=e.value?document.activeElement:void 0}),We(()=>{window.addEventListener("keyup",r)}),An(()=>{window.removeEventListener("keyup",r)});function r(a){a.key==="Escape"&&e.value&&(t(),n==null||n.focus())}}function eo(e){const{page:t,hash:n}=ie(),r=z(!1),a=U(()=>e.value.collapsed!=null),s=U(()=>!!e.value.link),i=z(!1),o=()=>{i.value=Lt(t.value.relativePath,e.value.link)};ke([t,e,n],o),We(o);const l=U(()=>i.value?!0:e.value.items?er(t.value.relativePath,e.value.items):!1),c=U(()=>!!(e.value.items&&e.value.items.length));ft(()=>{r.value=!!(a.value&&e.value.collapsed)}),kr(()=>{(i.value||l.value)&&(r.value=!1)});function u(){a.value&&(r.value=!r.value)}return{collapsed:r,collapsible:a,isLink:s,isActiveLink:i,hasActiveLink:l,hasChildren:c,toggle:u}}function to(){const{hasSidebar:e}=ot(),t=Qn("(min-width: 960px)"),n=Qn("(min-width: 1280px)");return{isAsideEnabled:U(()=>!n.value&&!t.value?!1:e.value?n.value:t.value)}}const tr=[];function Qs(e){return typeof e.outline=="object"&&!Array.isArray(e.outline)&&e.outline.label||e.outlineTitle||"On this page"}function Er(e){const t=[...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")].filter(n=>n.id&&n.hasChildNodes()).map(n=>{const r=Number(n.tagName[1]);return{element:n,title:no(n),link:"#"+n.id,level:r}});return ro(t,e)}function no(e){let t="";for(const n of e.childNodes)if(n.nodeType===1){if(n.classList.contains("VPBadge")||n.classList.contains("header-anchor")||n.classList.contains("ignore-header"))continue;t+=n.textContent}else n.nodeType===3&&(t+=n.textContent);return t.trim()}function ro(e,t){if(t===!1)return[];const n=(typeof t=="object"&&!Array.isArray(t)?t.level:t)||2,[r,a]=typeof n=="number"?[n,n]:n==="deep"?[2,6]:n;e=e.filter(i=>i.level>=r&&i.level<=a),tr.length=0;for(const{element:i,link:o}of e)tr.push({element:i,link:o});const s=[];e:for(let i=0;i=0;l--){const c=e[l];if(c.level{requestAnimationFrame(s),window.addEventListener("scroll",r)}),vi(()=>{i(location.hash)}),An(()=>{window.removeEventListener("scroll",r)});function s(){if(!n.value)return;const o=window.scrollY,l=window.innerHeight,c=document.body.offsetHeight,u=Math.abs(o+l-c)<1,m=tr.map(({element:v,link:E})=>({link:E,top:ao(v)})).filter(({top:v})=>!Number.isNaN(v)).sort((v,E)=>v.top-E.top);if(!m.length){i(null);return}if(o<1){i(null);return}if(u){i(m[m.length-1].link);return}let d=null;for(const{link:v,top:E}of m){if(E>o+_i()+4)break;d=v}i(d)}function i(o){a&&a.classList.remove("active"),o==null?a=null:a=e.value.querySelector(`a[href="${decodeURIComponent(o)}"]`);const l=a;l?(l.classList.add("active"),t.value.style.top=l.offsetTop+39+"px",t.value.style.opacity="1"):(t.value.style.top="33px",t.value.style.opacity="0")}}function ao(e){let t=0;for(;e!==document.body;){if(e===null)return NaN;t+=e.offsetTop,e=e.offsetParent}return t}const io=["href","title"],oo=V({__name:"VPDocOutlineItem",props:{headers:{},root:{type:Boolean}},setup(e){function t({target:n}){const r=n.href.split("#")[1],a=document.getElementById(decodeURIComponent(r));a==null||a.focus({preventScroll:!0})}return(n,r)=>{const a=ht("VPDocOutlineItem",!0);return h(),C("ul",{class:de(["VPDocOutlineItem",n.root?"root":"nested"])},[(h(!0),C(ge,null,Me(n.headers,({children:s,link:i,title:o})=>(h(),C("li",null,[w("a",{class:"outline-link",href:i,onClick:t,title:o},se(o),9,io),s!=null&&s.length?(h(),X(a,{key:0,headers:s},null,8,["headers"])):G("",!0)]))),256))],2)}}}),Zs=q(oo,[["__scopeId","data-v-fc78d431"]]),lo={class:"content"},co={"aria-level":"2",class:"outline-title",id:"doc-outline-aria-label",role:"heading"},uo=V({__name:"VPDocAsideOutline",setup(e){const{frontmatter:t,theme:n}=ie(),r=Tn([]);Nn(()=>{r.value=Er(t.value.outline??n.value.outline)});const a=z(),s=z();return so(a,s),(i,o)=>(h(),C("nav",{"aria-labelledby":"doc-outline-aria-label",class:de(["VPDocAsideOutline",{"has-outline":r.value.length>0}]),ref_key:"container",ref:a},[w("div",lo,[w("div",{class:"outline-marker",ref_key:"marker",ref:s},null,512),w("div",co,se(g(Qs)(g(n))),1),Y(Zs,{headers:r.value,root:!0},null,8,["headers"])])],2))}}),mo=q(uo,[["__scopeId","data-v-e95709bb"]]),po={class:"VPDocAsideCarbonAds"},fo=V({__name:"VPDocAsideCarbonAds",props:{carbonAds:{}},setup(e){const t=()=>null;return(n,r)=>(h(),C("div",po,[Y(g(t),{"carbon-ads":n.carbonAds},null,8,["carbon-ads"])]))}}),ho={class:"VPDocAside"},go=V({__name:"VPDocAside",setup(e){const{theme:t}=ie();return(n,r)=>(h(),C("div",ho,[S(n.$slots,"aside-top",{},void 0,!0),S(n.$slots,"aside-outline-before",{},void 0,!0),Y(mo),S(n.$slots,"aside-outline-after",{},void 0,!0),r[0]||(r[0]=w("div",{class:"spacer"},null,-1)),S(n.$slots,"aside-ads-before",{},void 0,!0),g(t).carbonAds?(h(),X(fo,{key:0,"carbon-ads":g(t).carbonAds},null,8,["carbon-ads"])):G("",!0),S(n.$slots,"aside-ads-after",{},void 0,!0),S(n.$slots,"aside-bottom",{},void 0,!0)]))}}),vo=q(go,[["__scopeId","data-v-4bbff643"]]);function _o(){const{theme:e,page:t}=ie();return U(()=>{const{text:n="Edit this page",pattern:r=""}=e.value.editLink||{};let a;return typeof r=="function"?a=r(t.value):a=r.replace(/:path/g,t.value.filePath),{url:a,text:n}})}function bo(){const{page:e,theme:t,frontmatter:n}=ie();return U(()=>{var c,u,m,d,v,E,_,b;const r=qs(t.value.sidebar,e.value.relativePath),a=Qi(r),s=yo(a,M=>M.link.replace(/[?#].*$/,"")),i=s.findIndex(M=>Lt(e.value.relativePath,M.link)),o=((c=t.value.docFooter)==null?void 0:c.prev)===!1&&!n.value.prev||n.value.prev===!1,l=((u=t.value.docFooter)==null?void 0:u.next)===!1&&!n.value.next||n.value.next===!1;return{prev:o?void 0:{text:(typeof n.value.prev=="string"?n.value.prev:typeof n.value.prev=="object"?n.value.prev.text:void 0)??((m=s[i-1])==null?void 0:m.docFooterText)??((d=s[i-1])==null?void 0:d.text),link:(typeof n.value.prev=="object"?n.value.prev.link:void 0)??((v=s[i-1])==null?void 0:v.link)},next:l?void 0:{text:(typeof n.value.next=="string"?n.value.next:typeof n.value.next=="object"?n.value.next.text:void 0)??((E=s[i+1])==null?void 0:E.docFooterText)??((_=s[i+1])==null?void 0:_.text),link:(typeof n.value.next=="object"?n.value.next.link:void 0)??((b=s[i+1])==null?void 0:b.link)}}})}function yo(e,t){const n=new Set;return e.filter(r=>{const a=t(r);return n.has(a)?!1:n.add(a)})}const ze=V({__name:"VPLink",props:{tag:{},href:{},noIcon:{type:Boolean},target:{},rel:{}},setup(e){const t=e,n=U(()=>t.tag??(t.href?"a":"span")),r=U(()=>t.href&&Ks.test(t.href)||t.target==="_blank");return(a,s)=>(h(),X(Ye(n.value),{class:de(["VPLink",{link:a.href,"vp-external-link-icon":r.value,"no-icon":a.noIcon}]),href:a.href?g(Lr)(a.href):void 0,target:a.target??(r.value?"_blank":void 0),rel:a.rel??(r.value?"noreferrer":void 0)},{default:A(()=>[S(a.$slots,"default")]),_:3},8,["class","href","target","rel"]))}}),ko={class:"VPLastUpdated"},wo=["datetime"],Lo=V({__name:"VPDocFooterLastUpdated",setup(e){const{theme:t,page:n,lang:r}=ie(),a=U(()=>new Date(n.value.lastUpdated)),s=U(()=>a.value.toISOString()),i=z("");return We(()=>{ft(()=>{var o,l,c;i.value=new Intl.DateTimeFormat((l=(o=t.value.lastUpdated)==null?void 0:o.formatOptions)!=null&&l.forceLocale?r.value:void 0,((c=t.value.lastUpdated)==null?void 0:c.formatOptions)??{dateStyle:"short",timeStyle:"short"}).format(a.value)})}),(o,l)=>{var c;return h(),C("p",ko,[qe(se(((c=g(t).lastUpdated)==null?void 0:c.text)||g(t).lastUpdatedText||"Last updated")+": ",1),w("time",{datetime:s.value},se(i.value),9,wo)])}}}),Eo=q(Lo,[["__scopeId","data-v-3c231858"]]),So={key:0,class:"VPDocFooter"},Oo={key:0,class:"edit-info"},Co={key:0,class:"edit-link"},Io={key:1,class:"last-updated"},Ao={key:1,class:"prev-next","aria-labelledby":"doc-footer-aria-label"},To={class:"pager"},No=["innerHTML"],Mo=["innerHTML"],Po={class:"pager"},Ro=["innerHTML"],$o=["innerHTML"],Fo=V({__name:"VPDocFooter",setup(e){const{theme:t,page:n,frontmatter:r}=ie(),a=_o(),s=bo(),i=U(()=>t.value.editLink&&r.value.editLink!==!1),o=U(()=>n.value.lastUpdated),l=U(()=>i.value||o.value||s.value.prev||s.value.next);return(c,u)=>{var m,d,v,E;return l.value?(h(),C("footer",So,[S(c.$slots,"doc-footer-before",{},void 0,!0),i.value||o.value?(h(),C("div",Oo,[i.value?(h(),C("div",Co,[Y(ze,{class:"edit-link-button",href:g(a).url,"no-icon":!0},{default:A(()=>[u[0]||(u[0]=w("span",{class:"vpi-square-pen edit-link-icon"},null,-1)),qe(" "+se(g(a).text),1)]),_:1},8,["href"])])):G("",!0),o.value?(h(),C("div",Io,[Y(Eo)])):G("",!0)])):G("",!0),(m=g(s).prev)!=null&&m.link||(d=g(s).next)!=null&&d.link?(h(),C("nav",Ao,[u[1]||(u[1]=w("span",{class:"visually-hidden",id:"doc-footer-aria-label"},"Pager",-1)),w("div",To,[(v=g(s).prev)!=null&&v.link?(h(),X(ze,{key:0,class:"pager-link prev",href:g(s).prev.link},{default:A(()=>{var _;return[w("span",{class:"desc",innerHTML:((_=g(t).docFooter)==null?void 0:_.prev)||"Previous page"},null,8,No),w("span",{class:"title",innerHTML:g(s).prev.text},null,8,Mo)]}),_:1},8,["href"])):G("",!0)]),w("div",Po,[(E=g(s).next)!=null&&E.link?(h(),X(ze,{key:0,class:"pager-link next",href:g(s).next.link},{default:A(()=>{var _;return[w("span",{class:"desc",innerHTML:((_=g(t).docFooter)==null?void 0:_.next)||"Next page"},null,8,Ro),w("span",{class:"title",innerHTML:g(s).next.text},null,8,$o)]}),_:1},8,["href"])):G("",!0)])])):G("",!0)])):G("",!0)}}}),xo=q(Fo,[["__scopeId","data-v-00ab7d08"]]),Do={class:"container"},Vo={class:"aside-container"},Uo={class:"aside-content"},Ho={class:"content"},Bo={class:"content-container"},Wo={class:"main"},jo=V({__name:"VPDoc",setup(e){const{theme:t}=ie(),n=nn(),{hasSidebar:r,hasAside:a,leftAside:s}=ot(),i=U(()=>n.path.replace(/[./]+/g,"_").replace(/_html$/,""));return(o,l)=>{const c=ht("Content");return h(),C("div",{class:de(["VPDoc",{"has-sidebar":g(r),"has-aside":g(a)}])},[S(o.$slots,"doc-top",{},void 0,!0),w("div",Do,[g(a)?(h(),C("div",{key:0,class:de(["aside",{"left-aside":g(s)}])},[l[0]||(l[0]=w("div",{class:"aside-curtain"},null,-1)),w("div",Vo,[w("div",Uo,[Y(vo,null,{"aside-top":A(()=>[S(o.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":A(()=>[S(o.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":A(()=>[S(o.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":A(()=>[S(o.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":A(()=>[S(o.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":A(()=>[S(o.$slots,"aside-ads-after",{},void 0,!0)]),_:3})])])],2)):G("",!0),w("div",Ho,[w("div",Bo,[S(o.$slots,"doc-before",{},void 0,!0),w("main",Wo,[Y(c,{class:de(["vp-doc",[i.value,g(t).externalLinkIcon&&"external-link-icon-enabled"]])},null,8,["class"])]),Y(xo,null,{"doc-footer-before":A(()=>[S(o.$slots,"doc-footer-before",{},void 0,!0)]),_:3}),S(o.$slots,"doc-after",{},void 0,!0)])])]),S(o.$slots,"doc-bottom",{},void 0,!0)],2)}}}),Ko=q(jo,[["__scopeId","data-v-9f8645df"]]),Go=V({__name:"VPButton",props:{tag:{},size:{default:"medium"},theme:{default:"brand"},text:{},href:{},target:{},rel:{}},setup(e){const t=e,n=U(()=>t.href&&Ks.test(t.href)),r=U(()=>t.tag||t.href?"a":"button");return(a,s)=>(h(),X(Ye(r.value),{class:de(["VPButton",[a.size,a.theme]]),href:a.href?g(Lr)(a.href):void 0,target:t.target??(n.value?"_blank":void 0),rel:t.rel??(n.value?"noreferrer":void 0)},{default:A(()=>[qe(se(a.text),1)]),_:1},8,["class","href","target","rel"]))}}),Yo=q(Go,[["__scopeId","data-v-bbea5d5d"]]),zo=["src","alt"],Xo=V({inheritAttrs:!1,__name:"VPImage",props:{image:{},alt:{}},setup(e){return(t,n)=>{const r=ht("VPImage",!0);return t.image?(h(),C(ge,{key:0},[typeof t.image=="string"||"src"in t.image?(h(),C("img",dt({key:0,class:"VPImage"},typeof t.image=="string"?t.$attrs:{...t.image,...t.$attrs},{src:g(In)(typeof t.image=="string"?t.image:t.image.src),alt:t.alt??(typeof t.image=="string"?"":t.image.alt||"")}),null,16,zo)):(h(),C(ge,{key:1},[Y(r,dt({class:"dark",image:t.image.dark,alt:t.image.alt},t.$attrs),null,16,["image","alt"]),Y(r,dt({class:"light",image:t.image.light,alt:t.image.alt},t.$attrs),null,16,["image","alt"])],64))],64)):G("",!0)}}}),kn=q(Xo,[["__scopeId","data-v-7b8f395d"]]),Jo={class:"container"},qo={class:"main"},Qo={key:0,class:"name"},Zo=["innerHTML"],el=["innerHTML"],tl=["innerHTML"],nl={key:0,class:"actions"},rl={key:0,class:"image"},sl={class:"image-container"},al=V({__name:"VPHero",props:{name:{},text:{},tagline:{},image:{},actions:{}},setup(e){const t=Ut("hero-image-slot-exists");return(n,r)=>(h(),C("div",{class:de(["VPHero",{"has-image":n.image||g(t)}])},[w("div",Jo,[w("div",qo,[S(n.$slots,"home-hero-info-before",{},void 0,!0),S(n.$slots,"home-hero-info",{},()=>[n.name?(h(),C("h1",Qo,[w("span",{innerHTML:n.name,class:"clip"},null,8,Zo)])):G("",!0),n.text?(h(),C("p",{key:1,innerHTML:n.text,class:"text"},null,8,el)):G("",!0),n.tagline?(h(),C("p",{key:2,innerHTML:n.tagline,class:"tagline"},null,8,tl)):G("",!0)],!0),S(n.$slots,"home-hero-info-after",{},void 0,!0),n.actions?(h(),C("div",nl,[(h(!0),C(ge,null,Me(n.actions,a=>(h(),C("div",{key:a.link,class:"action"},[Y(Yo,{tag:"a",size:"medium",theme:a.theme,text:a.text,href:a.link,target:a.target,rel:a.rel},null,8,["theme","text","href","target","rel"])]))),128))])):G("",!0),S(n.$slots,"home-hero-actions-after",{},void 0,!0)]),n.image||g(t)?(h(),C("div",rl,[w("div",sl,[r[0]||(r[0]=w("div",{class:"image-bg"},null,-1)),S(n.$slots,"home-hero-image",{},()=>[n.image?(h(),X(kn,{key:0,class:"image-src",image:n.image},null,8,["image"])):G("",!0)],!0)])])):G("",!0)])],2))}}),il=q(al,[["__scopeId","data-v-0313f8fa"]]),ol=V({__name:"VPHomeHero",setup(e){const{frontmatter:t}=ie();return(n,r)=>g(t).hero?(h(),X(il,{key:0,class:"VPHomeHero",name:g(t).hero.name,text:g(t).hero.text,tagline:g(t).hero.tagline,image:g(t).hero.image,actions:g(t).hero.actions},{"home-hero-info-before":A(()=>[S(n.$slots,"home-hero-info-before")]),"home-hero-info":A(()=>[S(n.$slots,"home-hero-info")]),"home-hero-info-after":A(()=>[S(n.$slots,"home-hero-info-after")]),"home-hero-actions-after":A(()=>[S(n.$slots,"home-hero-actions-after")]),"home-hero-image":A(()=>[S(n.$slots,"home-hero-image")]),_:3},8,["name","text","tagline","image","actions"])):G("",!0)}}),ll={class:"box"},cl={key:0,class:"icon"},ul=["innerHTML"],dl=["innerHTML"],ml=["innerHTML"],pl={key:4,class:"link-text"},fl={class:"link-text-value"},hl=V({__name:"VPFeature",props:{icon:{},title:{},details:{},link:{},linkText:{},rel:{},target:{}},setup(e){return(t,n)=>(h(),X(ze,{class:"VPFeature",href:t.link,rel:t.rel,target:t.target,"no-icon":!0,tag:t.link?"a":"div"},{default:A(()=>[w("article",ll,[typeof t.icon=="object"&&t.icon.wrap?(h(),C("div",cl,[Y(kn,{image:t.icon,alt:t.icon.alt,height:t.icon.height||48,width:t.icon.width||48},null,8,["image","alt","height","width"])])):typeof t.icon=="object"?(h(),X(kn,{key:1,image:t.icon,alt:t.icon.alt,height:t.icon.height||48,width:t.icon.width||48},null,8,["image","alt","height","width"])):t.icon?(h(),C("div",{key:2,class:"icon",innerHTML:t.icon},null,8,ul)):G("",!0),w("h2",{class:"title",innerHTML:t.title},null,8,dl),t.details?(h(),C("p",{key:3,class:"details",innerHTML:t.details},null,8,ml)):G("",!0),t.linkText?(h(),C("div",pl,[w("p",fl,[qe(se(t.linkText)+" ",1),n[0]||(n[0]=w("span",{class:"vpi-arrow-right link-text-icon"},null,-1))])])):G("",!0)])]),_:1},8,["href","rel","target","tag"]))}}),gl=q(hl,[["__scopeId","data-v-ce15ebd4"]]),vl={key:0,class:"VPFeatures"},_l={class:"container"},bl={class:"items"},yl=V({__name:"VPFeatures",props:{features:{}},setup(e){const t=e,n=U(()=>{const r=t.features.length;if(r){if(r===2)return"grid-2";if(r===3)return"grid-3";if(r%3===0)return"grid-6";if(r>3)return"grid-4"}else return});return(r,a)=>r.features?(h(),C("div",vl,[w("div",_l,[w("div",bl,[(h(!0),C(ge,null,Me(r.features,s=>(h(),C("div",{key:s.title,class:de(["item",[n.value]])},[Y(gl,{icon:s.icon,title:s.title,details:s.details,link:s.link,"link-text":s.linkText,rel:s.rel,target:s.target},null,8,["icon","title","details","link","link-text","rel","target"])],2))),128))])])])):G("",!0)}}),kl=q(yl,[["__scopeId","data-v-b79e191c"]]),wl=V({__name:"VPHomeFeatures",setup(e){const{frontmatter:t}=ie();return(n,r)=>g(t).features?(h(),X(kl,{key:0,class:"VPHomeFeatures",features:g(t).features},null,8,["features"])):G("",!0)}}),Ll=V({__name:"VPHomeContent",setup(e){const{width:t}=bi({initialWidth:0,includeScrollbar:!1});return(n,r)=>(h(),C("div",{class:"vp-doc container",style:Gs(g(t)?{"--vp-offset":`calc(50% - ${g(t)/2}px)`}:{})},[S(n.$slots,"default",{},void 0,!0)],4))}}),El=q(Ll,[["__scopeId","data-v-269c2bad"]]),Sl={class:"VPHome"},Ol=V({__name:"VPHome",setup(e){const{frontmatter:t}=ie();return(n,r)=>{const a=ht("Content");return h(),C("div",Sl,[S(n.$slots,"home-hero-before",{},void 0,!0),Y(ol,null,{"home-hero-info-before":A(()=>[S(n.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":A(()=>[S(n.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":A(()=>[S(n.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":A(()=>[S(n.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":A(()=>[S(n.$slots,"home-hero-image",{},void 0,!0)]),_:3}),S(n.$slots,"home-hero-after",{},void 0,!0),S(n.$slots,"home-features-before",{},void 0,!0),Y(wl),S(n.$slots,"home-features-after",{},void 0,!0),g(t).markdownStyles!==!1?(h(),X(El,{key:0},{default:A(()=>[Y(a)]),_:1})):(h(),X(a,{key:1}))])}}}),Cl=q(Ol,[["__scopeId","data-v-c1e44215"]]),Il={},Al={class:"VPPage"};function Tl(e,t){const n=ht("Content");return h(),C("div",Al,[S(e.$slots,"page-top"),Y(n),S(e.$slots,"page-bottom")])}const Nl=q(Il,[["render",Tl]]),Ml=V({__name:"VPContent",setup(e){const{page:t,frontmatter:n}=ie(),{hasSidebar:r}=ot();return(a,s)=>(h(),C("div",{class:de(["VPContent",{"has-sidebar":g(r),"is-home":g(n).layout==="home"}]),id:"VPContent"},[g(t).isNotFound?S(a.$slots,"not-found",{key:0},()=>[Y(Ji)],!0):g(n).layout==="page"?(h(),X(Nl,{key:1},{"page-top":A(()=>[S(a.$slots,"page-top",{},void 0,!0)]),"page-bottom":A(()=>[S(a.$slots,"page-bottom",{},void 0,!0)]),_:3})):g(n).layout==="home"?(h(),X(Cl,{key:2},{"home-hero-before":A(()=>[S(a.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":A(()=>[S(a.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":A(()=>[S(a.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":A(()=>[S(a.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":A(()=>[S(a.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":A(()=>[S(a.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":A(()=>[S(a.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":A(()=>[S(a.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":A(()=>[S(a.$slots,"home-features-after",{},void 0,!0)]),_:3})):g(n).layout&&g(n).layout!=="doc"?(h(),X(Ye(g(n).layout),{key:3})):(h(),X(Ko,{key:4},{"doc-top":A(()=>[S(a.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":A(()=>[S(a.$slots,"doc-bottom",{},void 0,!0)]),"doc-footer-before":A(()=>[S(a.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":A(()=>[S(a.$slots,"doc-before",{},void 0,!0)]),"doc-after":A(()=>[S(a.$slots,"doc-after",{},void 0,!0)]),"aside-top":A(()=>[S(a.$slots,"aside-top",{},void 0,!0)]),"aside-outline-before":A(()=>[S(a.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":A(()=>[S(a.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":A(()=>[S(a.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":A(()=>[S(a.$slots,"aside-ads-after",{},void 0,!0)]),"aside-bottom":A(()=>[S(a.$slots,"aside-bottom",{},void 0,!0)]),_:3}))],2))}}),Pl=q(Ml,[["__scopeId","data-v-c575eed1"]]),Rl={class:"container"},$l=["innerHTML"],Fl=["innerHTML"],xl=V({__name:"VPFooter",setup(e){const{theme:t,frontmatter:n}=ie(),{hasSidebar:r}=ot();return(a,s)=>g(t).footer&&g(n).footer!==!1?(h(),C("footer",{key:0,class:de(["VPFooter",{"has-sidebar":g(r)}])},[w("div",Rl,[g(t).footer.message?(h(),C("p",{key:0,class:"message",innerHTML:g(t).footer.message},null,8,$l)):G("",!0),g(t).footer.copyright?(h(),C("p",{key:1,class:"copyright",innerHTML:g(t).footer.copyright},null,8,Fl)):G("",!0)])],2)):G("",!0)}}),Dl=q(xl,[["__scopeId","data-v-042815a5"]]);function Vl(){const{theme:e,frontmatter:t}=ie(),n=Tn([]),r=U(()=>n.value.length>0);return Nn(()=>{n.value=Er(t.value.outline??e.value.outline)}),{headers:n,hasLocalNav:r}}const Ul={class:"menu-text"},Hl={class:"header"},Bl={class:"outline"},Wl=V({__name:"VPLocalNavOutlineDropdown",props:{headers:{},navHeight:{}},setup(e){const t=e,{theme:n}=ie(),r=z(!1),a=z(0),s=z(),i=z();function o(m){var d;(d=s.value)!=null&&d.contains(m.target)||(r.value=!1)}ke(r,m=>{if(m){document.addEventListener("click",o);return}document.removeEventListener("click",o)}),yi("Escape",()=>{r.value=!1}),Nn(()=>{r.value=!1});function l(){r.value=!r.value,a.value=window.innerHeight+Math.min(window.scrollY-t.navHeight,0)}function c(m){m.target.classList.contains("outline-link")&&(i.value&&(i.value.style.transition="none"),at(()=>{r.value=!1}))}function u(){r.value=!1,window.scrollTo({top:0,left:0,behavior:"smooth"})}return(m,d)=>(h(),C("div",{class:"VPLocalNavOutlineDropdown",style:Gs({"--vp-vh":a.value+"px"}),ref_key:"main",ref:s},[m.headers.length>0?(h(),C("button",{key:0,onClick:l,class:de({open:r.value})},[w("span",Ul,se(g(Qs)(g(n))),1),d[0]||(d[0]=w("span",{class:"vpi-chevron-right icon"},null,-1))],2)):(h(),C("button",{key:1,onClick:u},se(g(n).returnToTopLabel||"Return to top"),1)),Y(Cn,{name:"flyout"},{default:A(()=>[r.value?(h(),C("div",{key:0,ref_key:"items",ref:i,class:"items",onClick:c},[w("div",Hl,[w("a",{class:"top-link",href:"#",onClick:u},se(g(n).returnToTopLabel||"Return to top"),1)]),w("div",Bl,[Y(Zs,{headers:m.headers},null,8,["headers"])])],512)):G("",!0)]),_:1})],4))}}),jl=q(Wl,[["__scopeId","data-v-fd549330"]]),Kl={class:"container"},Gl=["aria-expanded"],Yl={class:"menu-text"},zl=V({__name:"VPLocalNav",props:{open:{type:Boolean}},emits:["open-menu"],setup(e){const{theme:t,frontmatter:n}=ie(),{hasSidebar:r}=ot(),{headers:a}=Vl(),{y:s}=Ys(),i=z(0);We(()=>{i.value=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--vp-nav-height"))}),Nn(()=>{a.value=Er(n.value.outline??t.value.outline)});const o=U(()=>a.value.length===0),l=U(()=>o.value&&!r.value),c=U(()=>({VPLocalNav:!0,"has-sidebar":r.value,empty:o.value,fixed:l.value}));return(u,m)=>g(n).layout!=="home"&&(!l.value||g(s)>=i.value)?(h(),C("div",{key:0,class:de(c.value)},[w("div",Kl,[g(r)?(h(),C("button",{key:0,class:"menu","aria-expanded":u.open,"aria-controls":"VPSidebarNav",onClick:m[0]||(m[0]=d=>u.$emit("open-menu"))},[m[1]||(m[1]=w("span",{class:"vpi-align-left menu-icon"},null,-1)),w("span",Yl,se(g(t).sidebarMenuLabel||"Menu"),1)],8,Gl)):G("",!0),Y(jl,{headers:g(a),navHeight:i.value},null,8,["headers","navHeight"])])],2)):G("",!0)}}),Xl=q(zl,[["__scopeId","data-v-6c3804f2"]]);function Jl(){const e=z(!1);function t(){e.value=!0,window.addEventListener("resize",a)}function n(){e.value=!1,window.removeEventListener("resize",a)}function r(){e.value?n():t()}function a(){window.outerWidth>=768&&n()}const s=nn();return ke(()=>s.path,n),{isScreenOpen:e,openScreen:t,closeScreen:n,toggleScreen:r}}const ql={},Ql={class:"VPSwitch",type:"button",role:"switch"},Zl={class:"check"},ec={key:0,class:"icon"};function tc(e,t){return h(),C("button",Ql,[w("span",Zl,[e.$slots.default?(h(),C("span",ec,[S(e.$slots,"default",{},void 0,!0)])):G("",!0)])])}const nc=q(ql,[["render",tc],["__scopeId","data-v-bdb57495"]]),rc=V({__name:"VPSwitchAppearance",setup(e){const{isDark:t,theme:n}=ie(),r=Ut("toggle-appearance",()=>{t.value=!t.value}),a=z("");return kr(()=>{a.value=t.value?n.value.lightModeSwitchTitle||"Switch to light theme":n.value.darkModeSwitchTitle||"Switch to dark theme"}),(s,i)=>(h(),X(nc,{title:a.value,class:"VPSwitchAppearance","aria-checked":g(t),onClick:g(r)},{default:A(()=>i[0]||(i[0]=[w("span",{class:"vpi-sun sun"},null,-1),w("span",{class:"vpi-moon moon"},null,-1)])),_:1},8,["title","aria-checked","onClick"]))}}),Sr=q(rc,[["__scopeId","data-v-41f06fec"]]),sc={key:0,class:"VPNavBarAppearance"},ac=V({__name:"VPNavBarAppearance",setup(e){const{site:t}=ie();return(n,r)=>g(t).appearance&&g(t).appearance!=="force-dark"&&g(t).appearance!=="force-auto"?(h(),C("div",sc,[Y(Sr)])):G("",!0)}}),ic=q(ac,[["__scopeId","data-v-12ad808b"]]),Or=z();let ea=!1,Wn=0;function oc(e){const t=z(!1);if(Mn){!ea&&lc(),Wn++;const n=ke(Or,r=>{var a,s,i;r===e.el.value||(a=e.el.value)!=null&&a.contains(r)?(t.value=!0,(s=e.onFocus)==null||s.call(e)):(t.value=!1,(i=e.onBlur)==null||i.call(e))});An(()=>{n(),Wn--,Wn||cc()})}return ki(t)}function lc(){document.addEventListener("focusin",ta),ea=!0,Or.value=document.activeElement}function cc(){document.removeEventListener("focusin",ta)}function ta(){Or.value=document.activeElement}const uc={class:"VPMenuLink"},dc=V({__name:"VPMenuLink",props:{item:{}},setup(e){const{page:t}=ie();return(n,r)=>(h(),C("div",uc,[Y(ze,{class:de({active:g(Lt)(g(t).relativePath,n.item.activeMatch||n.item.link,!!n.item.activeMatch)}),href:n.item.link,target:n.item.target,rel:n.item.rel},{default:A(()=>[qe(se(n.item.text),1)]),_:1},8,["class","href","target","rel"])]))}}),Rn=q(dc,[["__scopeId","data-v-7e61137e"]]),mc={class:"VPMenuGroup"},pc={key:0,class:"title"},fc=V({__name:"VPMenuGroup",props:{text:{},items:{}},setup(e){return(t,n)=>(h(),C("div",mc,[t.text?(h(),C("p",pc,se(t.text),1)):G("",!0),(h(!0),C(ge,null,Me(t.items,r=>(h(),C(ge,null,["link"in r?(h(),X(Rn,{key:0,item:r},null,8,["item"])):G("",!0)],64))),256))]))}}),hc=q(fc,[["__scopeId","data-v-b7ccc091"]]),gc={class:"VPMenu"},vc={key:0,class:"items"},_c=V({__name:"VPMenu",props:{items:{}},setup(e){return(t,n)=>(h(),C("div",gc,[t.items?(h(),C("div",vc,[(h(!0),C(ge,null,Me(t.items,r=>(h(),C(ge,{key:JSON.stringify(r)},["link"in r?(h(),X(Rn,{key:0,item:r},null,8,["item"])):"component"in r?(h(),X(Ye(r.component),dt({key:1,ref_for:!0},r.props),null,16)):(h(),X(hc,{key:2,text:r.text,items:r.items},null,8,["text","items"]))],64))),128))])):G("",!0),S(t.$slots,"default",{},void 0,!0)]))}}),bc=q(_c,[["__scopeId","data-v-e8a1c26e"]]),yc=["aria-expanded","aria-label"],kc={key:0,class:"text"},wc=["innerHTML"],Lc={key:1,class:"vpi-more-horizontal icon"},Ec={class:"menu"},Sc=V({__name:"VPFlyout",props:{icon:{},button:{},label:{},items:{}},setup(e){const t=z(!1),n=z();oc({el:n,onBlur:r});function r(){t.value=!1}return(a,s)=>(h(),C("div",{class:"VPFlyout",ref_key:"el",ref:n,onMouseenter:s[1]||(s[1]=i=>t.value=!0),onMouseleave:s[2]||(s[2]=i=>t.value=!1)},[w("button",{type:"button",class:"button","aria-haspopup":"true","aria-expanded":t.value,"aria-label":a.label,onClick:s[0]||(s[0]=i=>t.value=!t.value)},[a.button||a.icon?(h(),C("span",kc,[a.icon?(h(),C("span",{key:0,class:de([a.icon,"option-icon"])},null,2)):G("",!0),a.button?(h(),C("span",{key:1,innerHTML:a.button},null,8,wc)):G("",!0),s[3]||(s[3]=w("span",{class:"vpi-chevron-down text-icon"},null,-1))])):(h(),C("span",Lc))],8,yc),w("div",Ec,[Y(bc,{items:a.items},{default:A(()=>[S(a.$slots,"default",{},void 0,!0)]),_:3},8,["items"])])],544))}}),Cr=q(Sc,[["__scopeId","data-v-7e42a472"]]),Oc=["href","aria-label","innerHTML"],Cc=V({__name:"VPSocialLink",props:{icon:{},link:{},ariaLabel:{}},setup(e){const t=e,n=U(()=>typeof t.icon=="object"?t.icon.svg:``);return(r,a)=>(h(),C("a",{class:"VPSocialLink no-icon",href:r.link,"aria-label":r.ariaLabel??(typeof r.icon=="string"?r.icon:""),target:"_blank",rel:"noopener",innerHTML:n.value},null,8,Oc))}}),Ic=q(Cc,[["__scopeId","data-v-1d65eafe"]]),Ac={class:"VPSocialLinks"},Tc=V({__name:"VPSocialLinks",props:{links:{}},setup(e){return(t,n)=>(h(),C("div",Ac,[(h(!0),C(ge,null,Me(t.links,({link:r,icon:a,ariaLabel:s})=>(h(),X(Ic,{key:r,icon:a,link:r,ariaLabel:s},null,8,["icon","link","ariaLabel"]))),128))]))}}),Ir=q(Tc,[["__scopeId","data-v-259de3d6"]]),Nc={key:0,class:"group translations"},Mc={class:"trans-title"},Pc={key:1,class:"group"},Rc={class:"item appearance"},$c={class:"label"},Fc={class:"appearance-action"},xc={key:2,class:"group"},Dc={class:"item social-links"},Vc=V({__name:"VPNavBarExtra",setup(e){const{site:t,theme:n}=ie(),{localeLinks:r,currentLang:a}=rn({correspondingLink:!0}),s=U(()=>r.value.length&&a.value.label||t.value.appearance||n.value.socialLinks);return(i,o)=>s.value?(h(),X(Cr,{key:0,class:"VPNavBarExtra",label:"extra navigation"},{default:A(()=>[g(r).length&&g(a).label?(h(),C("div",Nc,[w("p",Mc,se(g(a).label),1),(h(!0),C(ge,null,Me(g(r),l=>(h(),X(Rn,{key:l.link,item:l},null,8,["item"]))),128))])):G("",!0),g(t).appearance&&g(t).appearance!=="force-dark"&&g(t).appearance!=="force-auto"?(h(),C("div",Pc,[w("div",Rc,[w("p",$c,se(g(n).darkModeSwitchLabel||"Appearance"),1),w("div",Fc,[Y(Sr)])])])):G("",!0),g(n).socialLinks?(h(),C("div",xc,[w("div",Dc,[Y(Ir,{class:"social-links-list",links:g(n).socialLinks},null,8,["links"])])])):G("",!0)]),_:1})):G("",!0)}}),Uc=q(Vc,[["__scopeId","data-v-1b59c413"]]),Hc=["aria-expanded"],Bc=V({__name:"VPNavBarHamburger",props:{active:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>(h(),C("button",{type:"button",class:de(["VPNavBarHamburger",{active:t.active}]),"aria-label":"mobile navigation","aria-expanded":t.active,"aria-controls":"VPNavScreen",onClick:n[0]||(n[0]=r=>t.$emit("click"))},n[1]||(n[1]=[w("span",{class:"container"},[w("span",{class:"top"}),w("span",{class:"middle"}),w("span",{class:"bottom"})],-1)]),10,Hc))}}),Wc=q(Bc,[["__scopeId","data-v-0fa0fd27"]]),jc=["innerHTML"],Kc=V({__name:"VPNavBarMenuLink",props:{item:{}},setup(e){const{page:t}=ie();return(n,r)=>(h(),X(ze,{class:de({VPNavBarMenuLink:!0,active:g(Lt)(g(t).relativePath,n.item.activeMatch||n.item.link,!!n.item.activeMatch)}),href:n.item.link,noIcon:n.item.noIcon,target:n.item.target,rel:n.item.rel,tabindex:"0"},{default:A(()=>[w("span",{innerHTML:n.item.text},null,8,jc)]),_:1},8,["class","href","noIcon","target","rel"]))}}),Gc=q(Kc,[["__scopeId","data-v-e692fe86"]]),Yc=V({__name:"VPNavBarMenuGroup",props:{item:{}},setup(e){const t=e,{page:n}=ie(),r=s=>"component"in s?!1:"link"in s?Lt(n.value.relativePath,s.link,!!t.item.activeMatch):s.items.some(r),a=U(()=>r(t.item));return(s,i)=>(h(),X(Cr,{class:de({VPNavBarMenuGroup:!0,active:g(Lt)(g(n).relativePath,s.item.activeMatch,!!s.item.activeMatch)||a.value}),button:s.item.text,items:s.item.items},null,8,["class","button","items"]))}}),zc={key:0,"aria-labelledby":"main-nav-aria-label",class:"VPNavBarMenu"},Xc=V({__name:"VPNavBarMenu",setup(e){const{theme:t}=ie();return(n,r)=>g(t).nav?(h(),C("nav",zc,[r[0]||(r[0]=w("span",{id:"main-nav-aria-label",class:"visually-hidden"}," Main Navigation ",-1)),(h(!0),C(ge,null,Me(g(t).nav,a=>(h(),C(ge,{key:JSON.stringify(a)},["link"in a?(h(),X(Gc,{key:0,item:a},null,8,["item"])):"component"in a?(h(),X(Ye(a.component),dt({key:1,ref_for:!0},a.props),null,16)):(h(),X(Yc,{key:2,item:a},null,8,["item"]))],64))),128))])):G("",!0)}}),Jc=q(Xc,[["__scopeId","data-v-30753f5b"]]);var xr;const na=typeof window<"u",qc=e=>typeof e=="string",fn=()=>{};na&&((xr=window==null?void 0:window.navigator)!=null&&xr.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function nr(e){return typeof e=="function"?e():g(e)}function Qc(e,t){function n(...r){e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})}return n}function Zc(e,t={}){let n,r;return a=>{const s=nr(e),i=nr(t.maxWait);if(n&&clearTimeout(n),s<=0||i!==void 0&&i<=0)return r&&(clearTimeout(r),r=null),a();i&&!r&&(r=setTimeout(()=>{n&&clearTimeout(n),r=null,a()},i)),n=setTimeout(()=>{r&&clearTimeout(r),r=null,a()},s)}}function eu(e){return e}function tu(e){return zs()?(Xs(e),!0):!1}function ra(e,t=200,n={}){return Qc(Zc(t,n),e)}function jn(e,t=200,n={}){if(t<=0)return e;const r=z(e.value),a=ra(()=>{r.value=e.value},t,n);return ke(e,()=>a()),r}function sa(e,t,n){return ke(e,(r,a,s)=>{r&&t(r,a,s)},n)}function nu(e){var t;const n=nr(e);return(t=n==null?void 0:n.$el)!=null?t:n}const aa=na?window:void 0;function un(...e){let t,n,r,a;if(qc(e[0])?([n,r,a]=e,t=aa):[t,n,r,a]=e,!t)return fn;let s=fn;const i=ke(()=>nu(t),l=>{s(),l&&(l.addEventListener(n,r,a),s=()=>{l.removeEventListener(n,r,a),s=fn})},{immediate:!0,flush:"post"}),o=()=>{i(),s()};return tu(o),o}const Dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vr="__vueuse_ssr_handlers__";Dr[Vr]=Dr[Vr]||{};const ru={ctrl:"control",command:"meta",cmd:"meta",option:"alt",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright"};function su(e={}){const{reactive:t=!1,target:n=aa,aliasMap:r=ru,passive:a=!0,onEventFired:s=fn}=e,i=Zt(new Set),o={toJSON(){return{}},current:i},l=t?Zt(o):o,c=new Set,u=new Set;function m(_,b){_ in l&&(t?l[_]=b:l[_].value=b)}function d(){for(const _ of u)m(_,!1)}function v(_,b){var M,W;const y=(M=_.key)==null?void 0:M.toLowerCase(),L=[(W=_.code)==null?void 0:W.toLowerCase(),y].filter(Boolean);y&&(b?i.add(y):i.delete(y));for(const T of L)u.add(T),m(T,b);y==="meta"&&!b?(c.forEach(T=>{i.delete(T),m(T,!1)}),c.clear()):typeof _.getModifierState=="function"&&_.getModifierState("Meta")&&b&&[...i,...L].forEach(T=>c.add(T))}un(n,"keydown",_=>(v(_,!0),s(_)),{passive:a}),un(n,"keyup",_=>(v(_,!1),s(_)),{passive:a}),un("blur",d,{passive:!0}),un("focus",d,{passive:!0});const E=new Proxy(l,{get(_,b,M){if(typeof b!="string")return Reflect.get(_,b,M);if(b=b.toLowerCase(),b in r&&(b=r[b]),!(b in l))if(/[+_-]/.test(b)){const y=b.split(/[+_-]/g).map(L=>L.trim());l[b]=U(()=>y.every(L=>g(E[L])))}else l[b]=z(!1);const W=Reflect.get(_,b,M);return t?g(W):W}});return E}var Ur;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Ur||(Ur={}));var au=Object.defineProperty,Hr=Object.getOwnPropertySymbols,iu=Object.prototype.hasOwnProperty,ou=Object.prototype.propertyIsEnumerable,Br=(e,t,n)=>t in e?au(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lu=(e,t)=>{for(var n in t||(t={}))iu.call(t,n)&&Br(e,n,t[n]);if(Hr)for(var n of Hr(t))ou.call(t,n)&&Br(e,n,t[n]);return e};const cu={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};lu({linear:eu},cu);function it(e){return Array.isArray?Array.isArray(e):la(e)==="[object Array]"}const uu=1/0;function du(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-uu?"-0":t}function mu(e){return e==null?"":du(e)}function Ke(e){return typeof e=="string"}function ia(e){return typeof e=="number"}function pu(e){return e===!0||e===!1||fu(e)&&la(e)=="[object Boolean]"}function oa(e){return typeof e=="object"}function fu(e){return oa(e)&&e!==null}function Fe(e){return e!=null}function Kn(e){return!e.trim().length}function la(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const hu="Incorrect 'index' type",gu=e=>`Invalid value for key ${e}`,vu=e=>`Pattern length exceeds max of ${e}.`,_u=e=>`Missing ${e} property in key`,bu=e=>`Property 'weight' in key '${e}' must be a positive integer`,Wr=Object.prototype.hasOwnProperty;class yu{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let a=ca(r);n+=a.weight,this._keys.push(a),this._keyMap[a.id]=a,n+=a.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ca(e){let t=null,n=null,r=null,a=1,s=null;if(Ke(e)||it(e))r=e,t=jr(e),n=rr(e);else{if(!Wr.call(e,"name"))throw new Error(_u("name"));const i=e.name;if(r=i,Wr.call(e,"weight")&&(a=e.weight,a<=0))throw new Error(bu(i));t=jr(i),n=rr(i),s=e.getFn}return{path:t,id:n,weight:a,src:r,getFn:s}}function jr(e){return it(e)?e:e.split(".")}function rr(e){return it(e)?e.join("."):e}function ku(e,t){let n=[],r=!1;const a=(s,i,o)=>{if(Fe(s))if(!i[o])n.push(s);else{let l=i[o];const c=s[l];if(!Fe(c))return;if(o===i.length-1&&(Ke(c)||ia(c)||pu(c)))n.push(mu(c));else if(it(c)){r=!0;for(let u=0,m=c.length;ue.score===t.score?e.idx{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ke(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();Ke(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n{let i=a.getFn?a.getFn(t):this.getFn(t,a.path);if(Fe(i)){if(it(i)){let o=[];const l=[{nestedArrIndex:-1,value:i}];for(;l.length;){const{nestedArrIndex:c,value:u}=l.pop();if(Fe(u))if(Ke(u)&&!Kn(u)){let m={v:u,i:c,n:this.norm.get(u)};o.push(m)}else it(u)&&u.forEach((m,d)=>{l.push({nestedArrIndex:d,value:m})})}r.$[s]=o}else if(Ke(i)&&!Kn(i)){let o={v:i,n:this.norm.get(i)};r.$[s]=o}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function ua(e,t,{getFn:n=ee.getFn,fieldNormWeight:r=ee.fieldNormWeight}={}){const a=new Ar({getFn:n,fieldNormWeight:r});return a.setKeys(e.map(ca)),a.setSources(t),a.create(),a}function Iu(e,{getFn:t=ee.getFn,fieldNormWeight:n=ee.fieldNormWeight}={}){const{keys:r,records:a}=e,s=new Ar({getFn:t,fieldNormWeight:n});return s.setKeys(r),s.setIndexRecords(a),s}function dn(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:a=ee.distance,ignoreLocation:s=ee.ignoreLocation}={}){const i=t/e.length;if(s)return i;const o=Math.abs(r-n);return a?i+o/a:o?1:i}function Au(e=[],t=ee.minMatchCharLength){let n=[],r=-1,a=-1,s=0;for(let i=e.length;s=t&&n.push([r,a]),r=-1)}return e[s-1]&&s-r>=t&&n.push([r,s-1]),n}const wt=32;function Tu(e,t,n,{location:r=ee.location,distance:a=ee.distance,threshold:s=ee.threshold,findAllMatches:i=ee.findAllMatches,minMatchCharLength:o=ee.minMatchCharLength,includeMatches:l=ee.includeMatches,ignoreLocation:c=ee.ignoreLocation}={}){if(t.length>wt)throw new Error(vu(wt));const u=t.length,m=e.length,d=Math.max(0,Math.min(r,m));let v=s,E=d;const _=o>1||l,b=_?Array(m):[];let M;for(;(M=e.indexOf(t,E))>-1;){let R=dn(t,{currentLocation:M,expectedLocation:d,distance:a,ignoreLocation:c});if(v=Math.min(R,v),E=M+u,_){let x=0;for(;x=me;D-=1){let re=D-1,Ee=n[e.charAt(re)];if(_&&(b[re]=+!!Ee),Z[D]=(Z[D+1]<<1|1)&Ee,R&&(Z[D]|=(W[D+1]|W[D])<<1|1|W[D+1]),Z[D]&T&&(y=dn(t,{errors:R,currentLocation:re,expectedLocation:d,distance:a,ignoreLocation:c}),y<=v)){if(v=y,E=re,E<=d)break;me=Math.max(1,2*d-E)}}if(dn(t,{errors:R+1,currentLocation:d,expectedLocation:d,distance:a,ignoreLocation:c})>v)break;W=Z}const I={isMatch:E>=0,score:Math.max(.001,y)};if(_){const R=Au(b,o);R.length?l&&(I.indices=R):I.isMatch=!1}return I}function Nu(e){let t={};for(let n=0,r=e.length;n{this.chunks.push({pattern:d,alphabet:Nu(d),startIndex:v})},m=this.pattern.length;if(m>wt){let d=0;const v=m%wt,E=m-v;for(;d{const{isMatch:M,score:W,indices:y}=Tu(t,E,_,{location:a+b,distance:s,threshold:i,findAllMatches:o,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});M&&(d=!0),m+=W,M&&y&&(u=[...u,...y])});let v={isMatch:d,score:d?m/this.chunks.length:1};return d&&r&&(v.indices=u),v}}class gt{constructor(t){this.pattern=t}static isMultiMatch(t){return Kr(t,this.multiRegex)}static isSingleMatch(t){return Kr(t,this.singleRegex)}search(){}}function Kr(e,t){const n=e.match(t);return n?n[1]:null}class Mu extends gt{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class Pu extends gt{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const n=t.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Ru extends gt{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class $u extends gt{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Fu extends gt{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class xu extends gt{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class ma extends gt{constructor(t,{location:n=ee.location,threshold:r=ee.threshold,distance:a=ee.distance,includeMatches:s=ee.includeMatches,findAllMatches:i=ee.findAllMatches,minMatchCharLength:o=ee.minMatchCharLength,isCaseSensitive:l=ee.isCaseSensitive,ignoreLocation:c=ee.ignoreLocation}={}){super(t),this._bitapSearch=new da(t,{location:n,threshold:r,distance:a,includeMatches:s,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class pa extends gt{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const a=[],s=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+s,a.push([r,n-1]);const i=!!a.length;return{isMatch:i,score:i?0:1,indices:a}}}const sr=[Mu,pa,Ru,$u,xu,Fu,Pu,ma],Gr=sr.length,Du=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Vu="|";function Uu(e,t={}){return e.split(Vu).map(n=>{let r=n.trim().split(Du).filter(s=>s&&!!s.trim()),a=[];for(let s=0,i=r.length;s!!(e[wn.AND]||e[wn.OR]),ju=e=>!!e[or.PATH],Ku=e=>!it(e)&&oa(e)&&!lr(e),Yr=e=>({[wn.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function fa(e,t,{auto:n=!0}={}){const r=a=>{let s=Object.keys(a);const i=ju(a);if(!i&&s.length>1&&!lr(a))return r(Yr(a));if(Ku(a)){const l=i?a[or.PATH]:s[0],c=i?a[or.PATTERN]:a[l];if(!Ke(c))throw new Error(gu(l));const u={keyId:rr(l),pattern:c};return n&&(u.searcher=ir(c,t)),u}let o={children:[],operator:s[0]};return s.forEach(l=>{const c=a[l];it(c)&&c.forEach(u=>{o.children.push(r(u))})}),o};return lr(e)||(e=Yr(e)),r(e)}function Gu(e,{ignoreFieldNorm:t=ee.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:a,norm:s,score:i})=>{const o=a?a.weight:null;r*=Math.pow(i===0&&o?Number.EPSILON:i,(o||1)*(t?1:s))}),n.score=r})}function Yu(e,t){const n=e.matches;t.matches=[],Fe(n)&&n.forEach(r=>{if(!Fe(r.indices)||!r.indices.length)return;const{indices:a,value:s}=r;let i={indices:a,value:s};r.key&&(i.key=r.key.src),r.idx>-1&&(i.refIndex=r.idx),t.matches.push(i)})}function zu(e,t){t.score=e.score}function Xu(e,t,{includeMatches:n=ee.includeMatches,includeScore:r=ee.includeScore}={}){const a=[];return n&&a.push(Yu),r&&a.push(zu),e.map(s=>{const{idx:i}=s,o={item:t[i],refIndex:i};return a.length&&a.forEach(l=>{l(s,o)}),o})}class Et{constructor(t,n={},r){this.options={...ee,...n},this.options.useExtendedSearch,this._keyStore=new yu(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof Ar))throw new Error(hu);this._myIndex=n||ua(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){!Fe(t)||(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,a=this._docs.length;r-1&&(l=l.slice(0,n)),Xu(l,this._docs,{includeMatches:r,includeScore:a})}_searchStringList(t){const n=ir(t,this.options),{records:r}=this._myIndex,a=[];return r.forEach(({v:s,i,n:o})=>{if(!Fe(s))return;const{isMatch:l,score:c,indices:u}=n.searchIn(s);l&&a.push({item:s,idx:i,matches:[{score:c,value:s,norm:o,indices:u}]})}),a}_searchLogical(t){const n=fa(t,this.options),r=(o,l,c)=>{if(!o.children){const{keyId:m,searcher:d}=o,v=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(l,m),searcher:d});return v&&v.length?[{idx:c,item:l,matches:v}]:[]}const u=[];for(let m=0,d=o.children.length;m{if(Fe(o)){let c=r(n,o,l);c.length&&(s[l]||(s[l]={idx:l,item:o,matches:[]},i.push(s[l])),c.forEach(({matches:u})=>{s[l].matches.push(...u)}))}}),i}_searchObjectList(t){const n=ir(t,this.options),{keys:r,records:a}=this._myIndex,s=[];return a.forEach(({$:i,i:o})=>{if(!Fe(i))return;let l=[];r.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:i[u],searcher:n}))}),l.length&&s.push({idx:o,item:i,matches:l})}),s}_findMatches({key:t,value:n,searcher:r}){if(!Fe(n))return[];let a=[];if(it(n))n.forEach(({v:s,i,n:o})=>{if(!Fe(s))return;const{isMatch:l,score:c,indices:u}=r.searchIn(s);l&&a.push({score:c,key:t,value:s,idx:i,norm:o,indices:u})});else{const{v:s,n:i}=n,{isMatch:o,score:l,indices:c}=r.searchIn(s);o&&a.push({score:l,key:t,value:s,norm:i,indices:c})}return a}}Et.version="6.6.2";Et.createIndex=ua;Et.parseIndex=Iu;Et.config=ee;Et.parseQuery=fa;Wu(Bu);const zr=Zt({selectedNode:"",selectedGroup:"",search:"",dataValue:"",filtered:{count:0,items:new Map,groups:new Set}}),Ht=()=>({isSearching:U(()=>zr.search!==""),...Li(zr)});function Ju(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(a){a(n)}),(r=e.get("*"))&&r.slice().map(function(a){a(t,n)})}}}const qu=Ju(),$n=()=>({emitter:qu});function Qu(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Zu(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}const ed=["command-theme"],td={"command-root":""},nd=V({name:"Command"}),rd=V({...nd,props:{theme:{type:String,default:"default"},fuseOptions:{type:Object,default:()=>({threshold:.2,keys:["label"]})}},emits:["select-item"],setup(e,{emit:t}){const n=e,r='[command-item=""]',a="command-item-key",s='[command-group=""]',i="command-group-key",o='[command-group-heading=""]',l=`${r}:not([aria-disabled="true"])`,c=`${r}[aria-selected="true"]`,u="command-item-select",m="data-value";wr("theme",n.theme||"default");const{selectedNode:d,search:v,dataValue:E,filtered:_}=Ht(),{emitter:b}=$n(),M=z(),W=jn(z(new Map),333),y=jn(z(new Set),333),L=jn(z(new Map)),T=U(()=>{const j=[];for(const[le,oe]of W.value.entries())j.push({key:le,label:oe});return j}),I=U(()=>{const j=Et.createIndex(n.fuseOptions.keys,T.value);return new Et(T.value,n.fuseOptions,j)}),R=()=>{var j,le,oe;const pe=x();pe&&(((j=pe.parentElement)==null?void 0:j.firstElementChild)===pe&&((oe=(le=pe.closest(s))==null?void 0:le.querySelector(o))==null||oe.scrollIntoView({block:"nearest"})),pe.scrollIntoView({block:"nearest"}))},x=()=>{var j;return(j=M.value)==null?void 0:j.querySelector(c)},$=(j=M.value)=>{const le=j==null?void 0:j.querySelectorAll(l);return le?Array.from(le):[]},me=()=>{var j;const le=(j=M.value)==null?void 0:j.querySelectorAll(s);return le?Array.from(le):[]},we=()=>{const[j]=$();j&&j.getAttribute(a)&&(d.value=j.getAttribute(a)||"")},Z=j=>{const le=$()[j];le&&(d.value=le.getAttribute(a)||"")},D=j=>{const le=x(),oe=$(),pe=oe.findIndex(je=>je===le),$e=oe[pe+j];$e?d.value=$e.getAttribute(a)||"":j>0?Z(0):Z(oe.length-1)},re=j=>{const le=x();let oe=le==null?void 0:le.closest(s),pe=null;for(;oe&&!pe;)oe=j>0?Qu(oe,s):Zu(oe,s),pe=oe==null?void 0:oe.querySelector(l);pe?d.value=pe.getAttribute(a)||"":D(j)},Ee=()=>Z(0),Oe=()=>Z($().length-1),_e=j=>{j.preventDefault(),j.metaKey?Oe():j.altKey?re(1):D(1)},De=j=>{j.preventDefault(),j.metaKey?Ee():j.altKey?re(-1):D(-1)},Ze=j=>{switch(j.key){case"n":case"j":{j.ctrlKey&&_e(j);break}case"ArrowDown":{_e(j);break}case"p":case"k":{j.ctrlKey&&De(j);break}case"ArrowUp":{De(j);break}case"Home":{Ee();break}case"End":{Oe();break}case"Enter":{const le=x();if(le){const oe=new Event(u);le.dispatchEvent(oe)}}}},be=()=>{if(!v.value){_.value.count=y.value.size;return}_.value.groups=new Set("");const j=new Map,le=I.value.search(v.value).map(oe=>oe.item);for(const{key:oe,label:pe}of le)j.set(oe,pe);for(const[oe,pe]of L.value)for(const $e of pe)j.get($e)&&_.value.groups.add(oe);at(()=>{_.value.count=j.size,_.value.items=j})},Le=()=>{const j=$(),le=me();for(const oe of j){const pe=oe.getAttribute(a)||"",$e=oe.getAttribute(m)||"";y.value.add(pe),W.value.set(pe,$e),_.value.count=W.value.size}for(const oe of le){const pe=$(oe),$e=oe.getAttribute(i)||"",je=new Set("");for(const bt of pe){const lt=bt.getAttribute(a)||"";je.add(lt)}L.value.set($e,je)}};ke(()=>d.value,j=>{j&&at(R)},{deep:!0}),ke(()=>v.value,j=>{be(),at(we)}),b.on("selectItem",j=>{t("select-item",j)});const Ve=ra(j=>{j&&(Le(),at(we))},100);return b.on("rerenderList",Ve),We(()=>{Le(),we()}),(j,le)=>(h(),C("div",{class:de(e.theme),onKeydown:Ze,ref_key:"commandRef",ref:M,"command-theme":e.theme},[w("div",td,[S(j.$slots,"default")])],42,ed))}}),Bt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},cr=Bt(rd,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/Command.vue"]]),sd={"command-dialog":""},ad={"command-dialog-mask":""},id={"command-dialog-wrapper":""},od={"command-dialog-header":""},ld={"command-dialog-body":""},cd={key:0,"command-dialog-footer":""},ud=V({name:"Command.Dialog"}),dd=V({...ud,props:{visible:{type:Boolean,required:!0},theme:{type:String,required:!0}},emits:["select-item"],setup(e,{emit:t}){const n=e,{search:r,filtered:a}=Ht(),{emitter:s}=$n(),i=z();s.on("selectItem",l=>{t("select-item",l)});const o=()=>{r.value="",a.value.count=0,a.value.items=new Map,a.value.groups=new Set};return sa(()=>n.visible,o),Pn(o),(l,c)=>(h(),X(wi,{to:"body",ref_key:"dialogRef",ref:i},[Y(Cn,{name:"command-dialog",appear:""},{default:A(()=>[e.visible?(h(),X(cr,{key:0,theme:e.theme},{default:A(()=>[w("div",sd,[w("div",ad,[w("div",id,[w("div",od,[S(l.$slots,"header")]),w("div",ld,[S(l.$slots,"body")]),l.$slots.footer?(h(),C("div",cd,[S(l.$slots,"footer")])):G("v-if",!0)])])])]),_:3},8,["theme"])):G("v-if",!0)]),_:3})],512))}}),md=Bt(dd,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/CommandDialog.vue"]]);let ha=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const pd=["command-group-key","data-value"],fd={key:0,"command-group-heading":""},hd={"command-group-items":"",role:"group"},gd=V({name:"Command.Group"}),vd=V({...gd,props:{heading:{type:String,required:!0}},setup(e){const t=U(()=>`command-group-${ha()}`),{filtered:n,isSearching:r}=Ht(),a=U(()=>r.value?n.value.groups.has(t.value):!0);return(s,i)=>_n((h(),C("div",{"command-group":"",role:"presentation",key:g(t),"command-group-key":g(t),"data-value":e.heading},[e.heading?(h(),C("div",fd,se(e.heading),1)):G("v-if",!0),w("div",hd,[S(s.$slots,"default")])],8,pd)),[[bn,g(a)]])}}),_d=Bt(vd,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/CommandGroup.vue"]]),bd=["placeholder","value"],yd=V({name:"Command.Input"}),kd=V({...yd,props:{placeholder:{type:String,required:!0},value:{type:String,required:!1}},emits:["input","update:value"],setup(e,{emit:t}){const n=z(null),{search:r}=Ht(),a=U(()=>r.value),s=i=>{const o=i,l=i.target;r.value=l==null?void 0:l.value,t("input",o),t("update:value",r.value)};return ft(()=>{var i;(i=n.value)==null||i.focus()}),(i,o)=>(h(),C("input",{ref_key:"inputRef",ref:n,"command-input":"","auto-focus":"","auto-complete":"off","auto-correct":"off","spell-check":!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,placeholder:e.placeholder,value:g(a),onInput:s},null,40,bd))}}),wd=Bt(kd,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/CommandInput.vue"]]),Ld=["aria-selected","aria-disabled","command-item-key"],Ed=V({name:"Command.Item"}),Sd=V({...Ed,props:{shortcut:{type:Array,required:!1},perform:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const n=e,r="command-item-select",a="data-value",{current:s}=su(),{selectedNode:i,filtered:o,isSearching:l}=Ht(),{emitter:c}=$n(),u=z(),m=U(()=>`command-item-${ha()}`),d=U(()=>{const _=o.value.items.get(m.value);return l.value?_!==void 0:!0}),v=U(()=>Array.from(s)),E=()=>{var _;const b={key:m.value,value:((_=u.value)==null?void 0:_.getAttribute(a))||""};t("select",b),c.emit("selectItem",b)};return sa(v,_=>{n.shortcut&&n.shortcut.length>0&&n.shortcut.every(b=>s.has(b.toLowerCase()))&&n.perform&&n.perform()}),ft(()=>{var _;(_=u.value)==null||_.addEventListener(r,E)}),Pn(()=>{var _;(_=u.value)==null||_.removeEventListener(r,E)}),(_,b)=>_n((h(),C("div",{ref_key:"itemRef",ref:u,"command-item":"",role:"option","aria-selected":g(i)===g(m),"aria-disabled":!g(d),key:g(m),"command-item-key":g(m),onClick:E},[S(_.$slots,"default")],8,Ld)),[[bn,g(d)]])}}),Od=Bt(Sd,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/CommandItem.vue"]]),Cd=V({name:"Command.List"}),Id=V({...Cd,setup(e){const{emitter:t}=$n(),n=z(),r=z();let a=null,s;return ft(()=>{s=r.value;const i=n.value;s&&i&&(a=new ResizeObserver(o=>{at(()=>{const l=s==null?void 0:s.offsetHeight;i==null||i.style.setProperty("--command-list-height",`${l==null?void 0:l.toFixed(1)}px`),t.emit("rerenderList",!0)})}),a.observe(s))}),Pn(()=>{a!==null&&s&&a.unobserve(s)}),(i,o)=>(h(),C("div",{"command-list":"",role:"listbox","aria-label":"Suggestions",ref_key:"listRef",ref:n},[w("div",{"command-list-sizer":"",ref_key:"heightRef",ref:r},[S(i.$slots,"default")],512)],512))}}),Ad=Bt(Id,[["__file","/Users/xiaoyunwei/Documents/GitHub/oss/vue-command-palette/packages/CommandList.vue"]]),Td=V({name:"Command.Empty",setup(e,{attrs:t,slots:n}){const{filtered:r}=Ht(),a=U(()=>r.value.count===0);return()=>a.value?$t("div",{"command-empty":"",role:"presentation",...t},n):$t("div",{"command-empty":"hidden",role:"presentation",style:{display:"none"},...t})}}),Nd=V({name:"Command.Loading",setup(e,{attrs:t,slots:n}){return()=>$t("div",{"command-loading":"",role:"progressbar",...t},n)}}),Md=V({name:"Command.Separator",setup(e,{attrs:t,slots:n}){return()=>$t("div",{"command-separator":"",role:"separator",...t})}}),It=Object.assign(cr,{Dialog:md,Empty:Td,Group:_d,Input:wd,Item:Od,List:Ad,Loading:Nd,Separator:Md,Root:cr});var Xr;const ga=typeof window<"u",Pd=e=>typeof e=="string",va=()=>{};ga&&((Xr=window==null?void 0:window.navigator)!=null&&Xr.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function _a(e){return typeof e=="function"?e():g(e)}function Rd(e){return e}function $d(e){return zs()?(Xs(e),!0):!1}function Fd(e,t=!0){Ft()?We(e):t?e():at(e)}function xd(e){var t;const n=_a(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Tr=ga?window:void 0;function Mt(...e){let t,n,r,a;if(Pd(e[0])||Array.isArray(e[0])?([n,r,a]=e,t=Tr):[t,n,r,a]=e,!t)return va;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const s=[],i=()=>{s.forEach(u=>u()),s.length=0},o=(u,m,d,v)=>(u.addEventListener(m,d,v),()=>u.removeEventListener(m,d,v)),l=ke(()=>[xd(t),_a(a)],([u,m])=>{i(),u&&s.push(...n.flatMap(d=>r.map(v=>o(u,d,v,m))))},{immediate:!0,flush:"post"}),c=()=>{l(),i()};return $d(c),c}const Jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},qr="__vueuse_ssr_handlers__";Jr[qr]=Jr[qr]||{};const Dd={ctrl:"control",command:"meta",cmd:"meta",option:"alt",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright"};function Vd(e={}){const{reactive:t=!1,target:n=Tr,aliasMap:r=Dd,passive:a=!0,onEventFired:s=va}=e,i=Zt(new Set),o={toJSON(){return{}},current:i},l=t?Zt(o):o,c=new Set,u=new Set;function m(_,b){_ in l&&(t?l[_]=b:l[_].value=b)}function d(){i.clear();for(const _ of u)m(_,!1)}function v(_,b){var M,W;const y=(M=_.key)==null?void 0:M.toLowerCase(),T=[(W=_.code)==null?void 0:W.toLowerCase(),y].filter(Boolean);y&&(b?i.add(y):i.delete(y));for(const I of T)u.add(I),m(I,b);y==="meta"&&!b?(c.forEach(I=>{i.delete(I),m(I,!1)}),c.clear()):typeof _.getModifierState=="function"&&_.getModifierState("Meta")&&b&&[...i,...T].forEach(I=>c.add(I))}Mt(n,"keydown",_=>(v(_,!0),s(_)),{passive:a}),Mt(n,"keyup",_=>(v(_,!1),s(_)),{passive:a}),Mt("blur",d,{passive:!0}),Mt("focus",d,{passive:!0});const E=new Proxy(l,{get(_,b,M){if(typeof b!="string")return Reflect.get(_,b,M);if(b=b.toLowerCase(),b in r&&(b=r[b]),!(b in l))if(/[+_-]/.test(b)){const y=b.split(/[+_-]/g).map(L=>L.trim());l[b]=U(()=>y.every(L=>g(E[L])))}else l[b]=z(!1);const W=Reflect.get(_,b,M);return t?g(W):W}});return E}var Qr;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Qr||(Qr={}));var Ud=Object.defineProperty,Zr=Object.getOwnPropertySymbols,Hd=Object.prototype.hasOwnProperty,Bd=Object.prototype.propertyIsEnumerable,es=(e,t,n)=>t in e?Ud(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wd=(e,t)=>{for(var n in t||(t={}))Hd.call(t,n)&&es(e,n,t[n]);if(Zr)for(var n of Zr(t))Bd.call(t,n)&&es(e,n,t[n]);return e};const jd={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};Wd({linear:Rd},jd);function Kd(e={}){const{window:t=Tr,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:a=!0,includeScrollbar:s=!0}=e,i=z(n),o=z(r),l=()=>{t&&(s?(i.value=t.innerWidth,o.value=t.innerHeight):(i.value=t.document.documentElement.clientWidth,o.value=t.document.documentElement.clientHeight))};return l(),Fd(l),Mt("resize",l,{passive:!0}),a&&Mt("orientationchange",l,{passive:!0}),{width:i,height:o}}const Gn=z([{route:"/ran/src/article/babel.html",meta:{description:"",title:"Babel",date:"2024-09-15 07:25:12"}},{route:"/ran/src/article/bundle.html",meta:{description:"",title:"Bundle",date:"2024-09-15 07:25:12"}},{route:"/ran/src/article/designMode.html",meta:{description:"",title:"23classicdesignpatterns",date:"2024-09-15 07:25:12"}},{route:"/ran/src/article/functionalProgramming.html",meta:{description:"",title:"函数式编程",date:"2024-09-15 07:25:12"}},{route:"/ran/src/article/imagemin.html",meta:{description:"",title:"imagemin图片压缩源码分析",date:"2024-09-15 07:25:12"}},{route:"/ran/src/ranui/",meta:{description:`# ranui Development scheme based on \`Web Components\` @@ -283,12 +283,12 @@ However, if you do need to use the 'on' attribute, here is an example: + - + - + @@ -36,14 +36,14 @@ - +
Skip to content

ran

风起于青萍之末

A ship in harbor is safe, but that is not what ships are built for.

logo

Released under the MIT License.

- + \ No newline at end of file diff --git a/cn/src/article/astParse/tokenizer.html b/cn/src/article/astParse/tokenizer.html index caa3ac7c7..87f323a18 100644 --- a/cn/src/article/astParse/tokenizer.html +++ b/cn/src/article/astParse/tokenizer.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -226,8 +226,8 @@ { type: 'RightParen', value: ')', start: 17, end: 18 }, { type: 'LeftCurly', value: '{', start: 19, end: 20 }, { type: 'RightCurly', value: '}', start: 20, end: 21 }, -];

一个简易版本的分词器已经被我们开发出来了,不过目前的分词器还比较简陋,仅仅支持有限的语法,不过在明确了核心的开发步骤之后,后面继续完善的过程就比较简单了。

四。编写语法分析器(Parser)

在解析出词法 token 之后,我们就可以进入语法分析阶段了。在这个阶段,我们会依次遍历 token ,对代码进行语法结构层面的分析,最后的目标是生成 AST 数据结构。至于代码的 AST 结构到底是什么样子,你可以去 AST Explorer 网站进行在线预览:

接下来,我们要做的就是将 token 数组转换为上图所示的 AST 数据。

开发步骤主要分为:

  • 初始化类型声明

Released under the MIT License.

- +];

一个简易版本的分词器已经被我们开发出来了,不过目前的分词器还比较简陋,仅仅支持有限的语法,不过在明确了核心的开发步骤之后,后面继续完善的过程就比较简单了。

四。编写语法分析器(Parser)

在解析出词法 token 之后,我们就可以进入语法分析阶段了。在这个阶段,我们会依次遍历 token ,对代码进行语法结构层面的分析,最后的目标是生成 AST 数据结构。至于代码的 AST 结构到底是什么样子,你可以去 AST Explorer 网站进行在线预览:

接下来,我们要做的就是将 token 数组转换为上图所示的 AST 数据。

开发步骤主要分为:

  • 初始化类型声明

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/babel.html b/cn/src/article/babel.html index d1cb48813..17cfcab87 100644 --- a/cn/src/article/babel.html +++ b/cn/src/article/babel.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

Babel

babel 核心库主要是:

  • @babel/parser 对源码进行 parse,可以通过 plugins、sourceType 等来指定 parse 语法,功能是把源码转成 AST。
  • @babel/traverse 通过 visitor 函数对遍历到的 ast 进行处理,分为 enter 和 exit 两个阶段,具体操作 AST 使用 path 的 api,还可以通过 state 来在遍历过程中传递一些数据
  • @babel/types 用于创建、判断 AST 节点,提供了 xxx、isXxx、assertXxx 的 api
  • @babel/template 当需要批量创建 AST 的时候可以使用 @babel/template 来简化 AST 创建逻辑。
  • @babel/code-frame 可以创建友好的报错信息
  • @babel/generator 打印 AST 成目标代码字符串,支持 comments、minified、sourceMaps 等选项。
  • @babel/core 基于上面的包来完成 babel 的编译流程,并应用 plugin 和 preset。

Released under the MIT License.

- +
Skip to content

Babel

babel 核心库主要是:

  • @babel/parser 对源码进行 parse,可以通过 plugins、sourceType 等来指定 parse 语法,功能是把源码转成 AST。
  • @babel/traverse 通过 visitor 函数对遍历到的 ast 进行处理,分为 enter 和 exit 两个阶段,具体操作 AST 使用 path 的 api,还可以通过 state 来在遍历过程中传递一些数据
  • @babel/types 用于创建、判断 AST 节点,提供了 xxx、isXxx、assertXxx 的 api
  • @babel/template 当需要批量创建 AST 的时候可以使用 @babel/template 来简化 AST 创建逻辑。
  • @babel/code-frame 可以创建友好的报错信息
  • @babel/generator 打印 AST 成目标代码字符串,支持 comments、minified、sourceMaps 等选项。
  • @babel/core 基于上面的包来完成 babel 的编译流程,并应用 plugin 和 preset。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/bundle.html b/cn/src/article/bundle.html index bf9a27df6..d1eb9b008 100644 --- a/cn/src/article/bundle.html +++ b/cn/src/article/bundle.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

Bundle

Bundle 的本质就是输入,转换,输出。在机器上直接运行的代码,往往都难以维护和理解,我们需要将开发者方便理解和维护的代码,通过打包等工具转换成方便机器或者程序使用的代码。对于 web 前端来说,打包工具,至少需要以下功能:

  • 编译能力
  • 插件机制
  • HMR
  • cli 和命令行能力

Released under the MIT License.

- +
Skip to content

Bundle

Bundle 的本质就是输入,转换,输出。在机器上直接运行的代码,往往都难以维护和理解,我们需要将开发者方便理解和维护的代码,通过打包等工具转换成方便机器或者程序使用的代码。对于 web 前端来说,打包工具,至少需要以下功能:

  • 编译能力
  • 插件机制
  • HMR
  • cli 和命令行能力

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/designMode.html b/cn/src/article/designMode.html index c9bcdc679..28b44c507 100644 --- a/cn/src/article/designMode.html +++ b/cn/src/article/designMode.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -794,8 +794,8 @@ Visitor.push(a,1,2,3,4); Visitor.push(a,4,5,6); Visitor.pop(a); -Visitor.splice(a,2);

访问者模式解决了数据与数据的操作方法之间的耦合,让数据的操作方法独立于数据,使其可以自由演变。因此,访问者模式更适合于那些数据稳定、但数据的操作方法易变的环境下。

优点:

  • 增加新的访问操作很方便。使用访问者模式,增加新的访问操作就意味着增加一个新的具体访问者类,实现简单,无须修改源代码,符合“开闭原则”。
  • 将有关元素对象的访问行为集中到一个访问者对象中,而不是分散在一个个的元素类中。类的职责更加清晰,有利于对象结构中元素对象的复用,相同的对象结构可以供多个不同的访问者访问。
  • 让用户能够在不修改现有元素类层次结构的情况下,定义作用于该层次结构的操作。

缺点:

  • 增加新的元素类很困难。在访问者模式中,每增加一个新的元素类都意味着要在抽象访问者角色中增加一个新的抽象操作,并在每一个具体访问者类中增加相应的具体操作,这违背了“开闭原则”的要求。
  • 破坏封装。访问者模式要求访问者对象访问并调用每一个元素对象的操作,这意味着元素对象有时候必须暴露一些自己的内部操作和内部状态,否则无法供访问者访问。

总结

系统地学习设计模式后,你可以在过往的开发经历中发现,设计模式是无处不在的。在学习设计模式之前的很多时候我们是凭借过往经验和智慧来完善系统的设计,而这些经验很多和某个设计模式的思想不谋而合。

还有一些地方没有完全理解,文中有误之处还望不吝指出。

参考资料

Released under the MIT License.

- +Visitor.splice(a,2);

访问者模式解决了数据与数据的操作方法之间的耦合,让数据的操作方法独立于数据,使其可以自由演变。因此,访问者模式更适合于那些数据稳定、但数据的操作方法易变的环境下。

优点:

  • 增加新的访问操作很方便。使用访问者模式,增加新的访问操作就意味着增加一个新的具体访问者类,实现简单,无须修改源代码,符合“开闭原则”。
  • 将有关元素对象的访问行为集中到一个访问者对象中,而不是分散在一个个的元素类中。类的职责更加清晰,有利于对象结构中元素对象的复用,相同的对象结构可以供多个不同的访问者访问。
  • 让用户能够在不修改现有元素类层次结构的情况下,定义作用于该层次结构的操作。

缺点:

  • 增加新的元素类很困难。在访问者模式中,每增加一个新的元素类都意味着要在抽象访问者角色中增加一个新的抽象操作,并在每一个具体访问者类中增加相应的具体操作,这违背了“开闭原则”的要求。
  • 破坏封装。访问者模式要求访问者对象访问并调用每一个元素对象的操作,这意味着元素对象有时候必须暴露一些自己的内部操作和内部状态,否则无法供访问者访问。

总结

系统地学习设计模式后,你可以在过往的开发经历中发现,设计模式是无处不在的。在学习设计模式之前的很多时候我们是凭借过往经验和智慧来完善系统的设计,而这些经验很多和某个设计模式的思想不谋而合。

还有一些地方没有完全理解,文中有误之处还望不吝指出。

参考资料

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/docPreview.html b/cn/src/article/docPreview.html index affce14c7..8104e312f 100644 --- a/cn/src/article/docPreview.html +++ b/cn/src/article/docPreview.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -304,8 +304,8 @@ public static void main(String[] args) { convertToPDF("/Users/koolearn/Desktop/asdf.docx", "/Users/koolearn/Desktop/adsf.pdf"); } -}

2.kkFileView

github地址:https://github.com/kekingcn/kkFileView

支持的文件预览格式非常丰富 image.png

接下来是 从零到一 的启动步骤,按着步骤来,任何人都能搞定

  1. 安装java:
sh
brew install java
  1. 安装maven,java的包管理工具:
sh
brew install mvn
  1. 检查是否安装成功

执行java --versionmvn -v。我这里遇到mvn找不到java home的报错。解决方式如下:

我用的是zsh,所以需要去.zshrc添加路径:

export JAVA_HOME=$(/usr/libexec/java_home)

添加完后,执行

source .zshrc
  1. 安装下libreoffice :

kkFileView明确要求的额外依赖,否则无法启动

brew install libreoffice
  1. mvn安装依赖

进入项目,在根目录执行依赖安装,同时清理缓存,跳过单测 (遇到了单测报错的问题)

mvn clean install -DskipTests
  1. 启动项目

找到主文件,主函数mian,点击vscode上面的Run即可执行,路径如下图

image.png

  1. 访问页面

启动完成后,点击终端输出的地址

image.png

  1. 最终结果

最终展示如下,可以添加链接进行预览,也可以选择本地文件进行预览

image.png

预览效果非常好

3.onlyOffice

官网地址:https://www.onlyoffice.com/zh

github地址:https://github.com/ONLYOFFICE

开发者版本和社区版免费,企业版付费:https://www.onlyoffice.com/zh/docs-enterprise-prices.aspx

预览的文件种类没有kkFileView多,但对office三件套有很好的支持,甚至支持多人编辑。

四:总结

  1. 外部服务,推荐微软的view.officeapps.live.com/op/view.aspx,但只建议预览一些互联网公开的文件,不建议使用在要求保密性和稳定性的文件。
  2. 对保密性和稳定性有要求,且不差钱的,可以试试大厂服务,阿里云解决方案。
  3. 服务端技术比较给力的,使用服务端预览方案。目前最好最全的效果是服务端预览方案。
  4. 不想花钱,没有服务器的,使用前端预览方案,客户端渲染零成本。

五:参考文档:

  1. 在 java 中如何使用 openOffice 进行格式转换
  2. MAC 搭建 OpenOffice 完整教程 - 保姆级
  3. 纯 js 实现 docx、xlsx、pdf 文件预览库,使用超简单
  4. 前端实现 word、excel、pdf、ppt、mp4、图片、文本等文件的预览

Released under the MIT License.

- +}

2.kkFileView

github地址:https://github.com/kekingcn/kkFileView

支持的文件预览格式非常丰富 image.png

接下来是 从零到一 的启动步骤,按着步骤来,任何人都能搞定

  1. 安装java:
sh
brew install java
  1. 安装maven,java的包管理工具:
sh
brew install mvn
  1. 检查是否安装成功

执行java --versionmvn -v。我这里遇到mvn找不到java home的报错。解决方式如下:

我用的是zsh,所以需要去.zshrc添加路径:

export JAVA_HOME=$(/usr/libexec/java_home)

添加完后,执行

source .zshrc
  1. 安装下libreoffice :

kkFileView明确要求的额外依赖,否则无法启动

brew install libreoffice
  1. mvn安装依赖

进入项目,在根目录执行依赖安装,同时清理缓存,跳过单测 (遇到了单测报错的问题)

mvn clean install -DskipTests
  1. 启动项目

找到主文件,主函数mian,点击vscode上面的Run即可执行,路径如下图

image.png

  1. 访问页面

启动完成后,点击终端输出的地址

image.png

  1. 最终结果

最终展示如下,可以添加链接进行预览,也可以选择本地文件进行预览

image.png

预览效果非常好

3.onlyOffice

官网地址:https://www.onlyoffice.com/zh

github地址:https://github.com/ONLYOFFICE

开发者版本和社区版免费,企业版付费:https://www.onlyoffice.com/zh/docs-enterprise-prices.aspx

预览的文件种类没有kkFileView多,但对office三件套有很好的支持,甚至支持多人编辑。

四:总结

  1. 外部服务,推荐微软的view.officeapps.live.com/op/view.aspx,但只建议预览一些互联网公开的文件,不建议使用在要求保密性和稳定性的文件。
  2. 对保密性和稳定性有要求,且不差钱的,可以试试大厂服务,阿里云解决方案。
  3. 服务端技术比较给力的,使用服务端预览方案。目前最好最全的效果是服务端预览方案。
  4. 不想花钱,没有服务器的,使用前端预览方案,客户端渲染零成本。

五:参考文档:

  1. 在 java 中如何使用 openOffice 进行格式转换
  2. MAC 搭建 OpenOffice 完整教程 - 保姆级
  3. 纯 js 实现 docx、xlsx、pdf 文件预览库,使用超简单
  4. 前端实现 word、excel、pdf、ppt、mp4、图片、文本等文件的预览

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/functionalProgramming.html b/cn/src/article/functionalProgramming.html index 746700893..a2a6d2b6c 100644 --- a/cn/src/article/functionalProgramming.html +++ b/cn/src/article/functionalProgramming.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -379,8 +379,8 @@ }; let r = readFile('package.json') //这里可以用 map 去处理内容 .flatMap(print) - .join();

参考资料

Released under the MIT License.

- + .join();

参考资料

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/imagemin.html b/cn/src/article/imagemin.html index f1e67a97d..080b79e22 100644 --- a/cn/src/article/imagemin.html +++ b/cn/src/article/imagemin.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + - - + + \ No newline at end of file diff --git a/cn/src/article/javascript/domLoad.html b/cn/src/article/javascript/domLoad.html index 5c48a96b2..76a59604e 100644 --- a/cn/src/article/javascript/domLoad.html +++ b/cn/src/article/javascript/domLoad.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -44,8 +44,8 @@
Skip to content

页面加载完成后事件

window.onload

DOMContentLoaded

js
document.addEventListener('DOMContentLoaded', fun);

<body onload="fun()">

readyState

js
document.readyState;
 
-document.onreadystatechange;

一个文档的 readyState 可以是以下之一:

  • loading / 加载。document 仍在加载。
  • interactive / 互动。文档已经完成加载,文档已被解析,但是诸如图像,样式表和框架之类的子资源仍在加载。
  • complete / 完成。T 文档和所有子资源已完成加载。状态表示 load 事件即将被触发。

Released under the MIT License.

- +document.onreadystatechange;

一个文档的 readyState 可以是以下之一:

  • loading / 加载。document 仍在加载。
  • interactive / 互动。文档已经完成加载,文档已被解析,但是诸如图像,样式表和框架之类的子资源仍在加载。
  • complete / 完成。T 文档和所有子资源已完成加载。状态表示 load 事件即将被触发。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/sort/bubble/index.html b/cn/src/article/sort/bubble/index.html index 4c1585e3f..fbf29081e 100644 --- a/cn/src/article/sort/bubble/index.html +++ b/cn/src/article/sort/bubble/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -55,8 +55,8 @@ } } return list; -};

Released under the MIT License.

- +};

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/sort/bucket/index.html b/cn/src/article/sort/bucket/index.html index e06daa930..9dd848280 100644 --- a/cn/src/article/sort/bucket/index.html +++ b/cn/src/article/sort/bucket/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -98,8 +98,8 @@ list = list.concat(count(buckets[i])); } return list; -};

算法分析

桶排序最好情况下使用线性时间 O(n),桶排序的时间复杂度,取决与对各个桶之间数据进行排序的时间复杂度,因为其它部分的时间复杂度都为 O(n)。很显然,桶划分的越小,各个桶之间的数据越少,排序所用的时间也会越少。但相应的空间消耗就会增大。

Released under the MIT License.

- +};

算法分析

桶排序最好情况下使用线性时间 O(n),桶排序的时间复杂度,取决与对各个桶之间数据进行排序的时间复杂度,因为其它部分的时间复杂度都为 O(n)。很显然,桶划分的越小,各个桶之间的数据越少,排序所用的时间也会越少。但相应的空间消耗就会增大。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/sort/count/index.html b/cn/src/article/sort/count/index.html index 56555dd1e..d339218f5 100644 --- a/cn/src/article/sort/count/index.html +++ b/cn/src/article/sort/count/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -76,8 +76,8 @@ } } return result; -};

算法分析

计数排序是一个稳定的排序算法。当输入的元素是 n 个 0 到 k 之间的整数时,时间复杂度是 O(n+k),空间复杂度也是 O(n+k),其排序速度快于任何比较排序算法。当 k 不是很大并且序列比较集中时,计数排序是一个很有效的排序算法。

Released under the MIT License.

- +};

算法分析

计数排序是一个稳定的排序算法。当输入的元素是 n 个 0 到 k 之间的整数时,时间复杂度是 O(n+k),空间复杂度也是 O(n+k),其排序速度快于任何比较排序算法。当 k 不是很大并且序列比较集中时,计数排序是一个很有效的排序算法。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/sort/heap/index.html b/cn/src/article/sort/heap/index.html index 666b1fde5..8231504e6 100644 --- a/cn/src/article/sort/heap/index.html +++ b/cn/src/article/sort/heap/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -92,8 +92,8 @@ const heap = (list: Array<number>): Array<number> => { const { value } = new Heap(list); return value; -};

Released under the MIT License.

- +};

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/sort/index.html b/cn/src/article/sort/index.html index 645c12629..0d1603a5c 100644 --- a/cn/src/article/sort/index.html +++ b/cn/src/article/sort/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,14 +37,14 @@ - + -
Skip to content

十大经典排序

十种常见排序算法可以分为两大类:

  • 比较类排序:通过比较来决定元素间的相对次序,由于其时间复杂度不能突破 O(nlogn),因此也称为非线性时间比较类排序。
  • 非比较类排序:不通过比较来决定元素间的相对次序,它可以突破基于比较排序的时间下界,以线性时间运行,因此也称为线性时间非比较类排序。

排序分类

算法复杂度

算法复杂度

相关概念

  • 稳定:如果 a 原本在 b 前面,而 a=b,排序之后 a 仍然在 b 的前面。
  • 不稳定:如果 a 原本在 b 的前面,而 a=b,排序之后 a 可能会出现在 b 的后面。
  • 时间复杂度:对排序数据的总的操作次数。反映当 n 变化时,操作次数呈现什么规律。
  • 空间复杂度:是指算法在计算机内执行时所需存储空间的度量,它也是数据规模 n 的函数。

Released under the MIT License.

- +
Skip to content

十大经典排序

十种常见排序算法可以分为两大类:

  • 比较类排序:通过比较来决定元素间的相对次序,由于其时间复杂度不能突破 O(nlogn),因此也称为非线性时间比较类排序。
  • 非比较类排序:不通过比较来决定元素间的相对次序,它可以突破基于比较排序的时间下界,以线性时间运行,因此也称为线性时间非比较类排序。

排序分类

算法复杂度

算法复杂度

相关概念

  • 稳定:如果 a 原本在 b 前面,而 a=b,排序之后 a 仍然在 b 的前面。
  • 不稳定:如果 a 原本在 b 的前面,而 a=b,排序之后 a 可能会出现在 b 的后面。
  • 时间复杂度:对排序数据的总的操作次数。反映当 n 变化时,操作次数呈现什么规律。
  • 空间复杂度:是指算法在计算机内执行时所需存储空间的度量,它也是数据规模 n 的函数。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/sort/insert/index.html b/cn/src/article/sort/insert/index.html index f7b48363f..935959ac2 100644 --- a/cn/src/article/sort/insert/index.html +++ b/cn/src/article/sort/insert/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -55,8 +55,8 @@ list[preIndex + 1] = current; } return list; -};

算法分析

插入排序在实现上,通常采用 in-place 排序(即只需用到 O(1)的额外空间的排序),因而在从后向前扫描过程中,需要反复把已排序元素逐步向后挪位,为最新元素提供插入空间。

Released under the MIT License.

- +};

算法分析

插入排序在实现上,通常采用 in-place 排序(即只需用到 O(1)的额外空间的排序),因而在从后向前扫描过程中,需要反复把已排序元素逐步向后挪位,为最新元素提供插入空间。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/sort/merge/index.html b/cn/src/article/sort/merge/index.html index 7fdb40df8..b7dc06d2f 100644 --- a/cn/src/article/sort/merge/index.html +++ b/cn/src/article/sort/merge/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -75,8 +75,8 @@ const left = list.slice(0, middle); const right = list.slice(middle); return combine(merge(left), merge(right)); -};

算法分析

归并排序是一种稳定的排序方法。和选择排序一样,归并排序的性能不受输入数据的影响,但表现比选择排序好的多,因为始终都是 O(nlogn)的时间复杂度。代价是需要额外的内存空间。

Released under the MIT License.

- +};

算法分析

归并排序是一种稳定的排序方法。和选择排序一样,归并排序的性能不受输入数据的影响,但表现比选择排序好的多,因为始终都是 O(nlogn)的时间复杂度。代价是需要额外的内存空间。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/sort/quick/index.html b/cn/src/article/sort/quick/index.html index d5898c85b..03e7b93b3 100644 --- a/cn/src/article/sort/quick/index.html +++ b/cn/src/article/sort/quick/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -93,8 +93,8 @@ const quick = (list: number[] = []): number[] => { const size = list.length; return combine(list, 0, size - 1); -};

Released under the MIT License.

- +};

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/sort/radix/index.html b/cn/src/article/sort/radix/index.html index 14ad94228..54a77e3ec 100644 --- a/cn/src/article/sort/radix/index.html +++ b/cn/src/article/sort/radix/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -78,8 +78,8 @@ list = list.concat(count(buckets[i])); } return list; -};

算法分析

基数排序基于分配排序,所以是稳定的。但基数排序的性能比桶排序要略差,每一次关键字的桶分配都需要 O(n)的时间复杂度,而且分配之后得到新的关键字序列又需要 O(n)的时间复杂度。假如待排数据可以分为 d 个关键字,则基数排序的时间复杂度将是 O(d*2n) ,当然 d 要远远小于 n,因此基本上还是线性级别的。

基数排序的空间复杂度为 O(n+k),其中 k 为桶的数量。一般来说 n>>k,因此额外空间需要大概 n 个左右。

Released under the MIT License.

- +};

算法分析

基数排序基于分配排序,所以是稳定的。但基数排序的性能比桶排序要略差,每一次关键字的桶分配都需要 O(n)的时间复杂度,而且分配之后得到新的关键字序列又需要 O(n)的时间复杂度。假如待排数据可以分为 d 个关键字,则基数排序的时间复杂度将是 O(d*2n) ,当然 d 要远远小于 n,因此基本上还是线性级别的。

基数排序的空间复杂度为 O(n+k),其中 k 为桶的数量。一般来说 n>>k,因此额外空间需要大概 n 个左右。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/sort/select/index.html b/cn/src/article/sort/select/index.html index 41c197f23..751049ab0 100644 --- a/cn/src/article/sort/select/index.html +++ b/cn/src/article/sort/select/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -59,8 +59,8 @@ } } return list; -};

算法分析

表现最稳定的排序算法之一,因为无论什么数据进去都是 O(n2)的时间复杂度,所以用到它的时候,数据规模越小越好。唯一的好处可能就是不占用额外的内存空间了吧。理论上讲,选择排序可能也是平时排序一般人想到的最多的排序方法了吧。

Released under the MIT License.

- +};

算法分析

表现最稳定的排序算法之一,因为无论什么数据进去都是 O(n2)的时间复杂度,所以用到它的时候,数据规模越小越好。唯一的好处可能就是不占用额外的内存空间了吧。理论上讲,选择排序可能也是平时排序一般人想到的最多的排序方法了吧。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/sort/shell/index.html b/cn/src/article/sort/shell/index.html index c857b94d3..367dfee1f 100644 --- a/cn/src/article/sort/shell/index.html +++ b/cn/src/article/sort/shell/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -62,8 +62,8 @@ } } return list; -};

算法分析

希尔排序的核心在于间隔序列的设定。既可以提前设定好间隔序列,也可以动态的定义间隔序列。动态定义间隔序列的算法是《算法(第 4 版)》的合著者 Robert Sedgewick 提出的。

Released under the MIT License.

- +};

算法分析

希尔排序的核心在于间隔序列的设定。既可以提前设定好间隔序列,也可以动态的定义间隔序列。动态定义间隔序列的算法是《算法(第 4 版)》的合著者 Robert Sedgewick 提出的。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/systemDesign.html b/cn/src/article/systemDesign.html new file mode 100644 index 000000000..f03c4aa37 --- /dev/null +++ b/cn/src/article/systemDesign.html @@ -0,0 +1,49 @@ + + + + + + 如何处理一个系统设计 | ran + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Skip to content

如何处理一个系统设计

系统设计是一个开放式的对话。他们期望你去主导这个对话。

你可以使用下面的步骤来指引讨论。为了巩固这个过程,请使用下面的步骤完成系统设计的面试题和解答这个章节。

第一步:描述使用场景,约束和假设

把所有需要的东西聚集在一起,审视问题。不停的提问,以至于我们可以明确使用场景和约束。讨论假设。

谁会使用它? 他们会怎样使用它? 有多少用户? 系统的作用是什么? 系统的输入输出分别是什么? 我们希望处理多少数据? 我们希望每秒钟处理多少请求? 我们希望的读写比率?

第二步:创造一个高层级的设计

使用所有重要的组件来描绘出一个高层级的设计。

画出主要的组件和连接 证明你的想法

第三步:设计核心组件

对每一个核心组件进行详细深入的分析。举例来说,如果你被问到设计一个 url 缩写服务,开始讨论:

生成并储存一个完整 url 的 hash MD5 和 Base62 Hash 碰撞 SQL 还是 NoSQL 数据库模型 将一个 hashed url 翻译成完整的 url 数据库查找 API 和面向对象设计

第四步:扩展设计

确认和处理瓶颈以及一些限制。举例来说就是你需要下面的这些来完成扩展性的议题吗?

负载均衡 水平扩展 缓存 数据库分片 论述可能的解决办法和代价。每件事情需要取舍。可以使用可扩展系统的设计原则来处理瓶颈。

Released under the MIT License.

+ + + + \ No newline at end of file diff --git a/cn/src/article/typescript/calculate.html b/cn/src/article/typescript/calculate.html index 8af6ca121..131bd56d7 100644 --- a/cn/src/article/typescript/calculate.html +++ b/cn/src/article/typescript/calculate.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -72,8 +72,8 @@ ? CurrentArr['length'] : FibonacciLoop<CurrentArr, [...PrevArr, ...CurrentArr], [...IndexArr, unknown], Num>; -type Fibonacci<Num extends number> = FibonacciLoop<[1], [], [], Num>;

类型参数 PrevArr 是代表之前的累加值的数组。类型参数 CurrentArr 是代表当前数值的数组。

类型参数 IndexArr 用于记录 index,每次递归加一,默认值是 [],代表从 0 开始。

类型参数 Num 代表求数列的第几个数。

判断当前 index 也就是 IndexArr['length'] 是否到了 Num,到了就返回当前的数值 CurrentArr['length']。

否则求出当前 index 对应的数值,用之前的数加上当前的数 [...PrevArr, ... CurrentArr]。

然后继续递归,index + 1,也就是 [...IndexArr, unknown]。

这就是递归计算 Fibinacci 数列的数的过程。

可以正确的算出第 8 个数是 21:

Released under the MIT License.

- +type Fibonacci<Num extends number> = FibonacciLoop<[1], [], [], Num>;

类型参数 PrevArr 是代表之前的累加值的数组。类型参数 CurrentArr 是代表当前数值的数组。

类型参数 IndexArr 用于记录 index,每次递归加一,默认值是 [],代表从 0 开始。

类型参数 Num 代表求数列的第几个数。

判断当前 index 也就是 IndexArr['length'] 是否到了 Num,到了就返回当前的数值 CurrentArr['length']。

否则求出当前 index 对应的数值,用之前的数加上当前的数 [...PrevArr, ... CurrentArr]。

然后继续递归,index + 1,也就是 [...IndexArr, unknown]。

这就是递归计算 Fibinacci 数列的数的过程。

可以正确的算出第 8 个数是 21:

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/typescript/index.html b/cn/src/article/typescript/index.html index 4dcb8fb30..4d5e01abc 100644 --- a/cn/src/article/typescript/index.html +++ b/cn/src/article/typescript/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -197,8 +197,8 @@ type TestAnyResult = TestAny<any>; // type TestAnyResult = 1 | 2

联合类型、never、any 在作为条件类型的类型参数时的这些特殊情况,也会在后面的原理篇来解释原因。

IsTuple

元组类型怎么判断呢?它和数组有什么区别呢?

元组类型的 length 是数字字面量,而数组的 length 是 number。

ts
type len

UnionToIntersection

类型之间是有父子关系的,更具体的那个是子类型,比如 A 和 B 的交叉类型 A & B 就是联合类型 A | B 的子类型,因为更具体。

如果允许父类型赋值给子类型,就叫做逆变

如果允许子类型赋值给父类型,就叫做协变

(关于逆变、协变等概念的详细解释可以看原理篇)

在 TypeScript 中有函数参数是有逆变的性质的,也就是如果参数可能是多个类型,参数类型会变成它们的交叉类型。

所以联合转交叉可以这样实现 :

ts
type UnionToIntersection<U> = (U extends U ? (x: U) => unknown : never) extends (x: infer R) => unknown ? R : never;

类型参数 U 是要转换的联合类型。

U extends U 是为了触发联合类型的 distributive 的性质,让每个类型单独传入做计算,最后合并。

利用 U 做为参数构造个函数,通过模式匹配取参数的类型。

结果就是交叉类型

函数参数的逆变性质一般就联合类型转交叉类型会用,记住就行。

GetOptional

如何提取索引类型中的可选索引呢?

这也要利用可选索引的特性:可选索引的值为 undefined 和值类型的联合类型。

过滤可选索引,就要构造一个新的索引类型,过程中做过滤:

ts
type GetOptional<Obj extends Record<string, any>> = {
   [Key in keyof Obj as {} extends Pick<Obj, Key> ? Key : never]: Obj[Key];
-};

类型参数 Obj 为待处理的索引类型,类型约束为索引为 string、值为任意类型的索引类型 Record<string, any>。

用映射类型的语法重新构造索引类型,索引是之前的索引也就是 Key in keyof Obj,但要做一些过滤,也就是 as 之后的部分。

过滤的方式就是单独取出该索引之后,判断空对象是否是其子类型。

这里的 Pick 是 ts 提供的内置高级类型,就是取出某个 Key 构造新的索引类型:

ts
type Pick<T, K extends keyof T> = { [P in K]: T[P] };

比如单独取出 age 构造的新的索引类型是这样的:

可选的意思是这个索引可能没有,没有的时候,那 Pick<Obj, Key> 就是空的,所以 {} extends Pick<Obj, Key> 就能过滤出可选索引。

值的类型依然是之前的,也就是 Obj[Key]。

这样,就能过滤出所有可选索引,构造成新的索引类型:

总结

  • any 类型与任何类型的交叉都是 any,也就是 1 & any 结果是 any,可以用这个特性判断 any 类型。
  • 联合类型作为类型参数出现在条件类型左侧时,会分散成单个类型传入,最后合并。
  • never 作为类型参数出现在条件类型左侧时,会直接返回 never。
  • any 作为类型参数出现在条件类型左侧时,会直接返回 trueType 和 falseType 的联合类型。
  • 元组类型也是数组类型,但 length 是数字字面量,而数组的 length 是 number。可以用来判断元组类型。
  • 函数参数处会发生逆变,可以用来实现联合类型转交叉类型。
  • 可选索引的索引可能没有,那 Pick 出来的就可能是 {},可以用来过滤可选索引,反过来也可以过滤非可选索引。
  • 索引类型的索引为字符串字面量类型,而可索引签名不是,可以用这个特性过滤掉可索引签名。
  • keyof 只能拿到 class 的 public 的索引,可以用来过滤出 public 的属性。
  • 默认推导出来的不是字面量类型,加上 as const 可以推导出字面量类型,但带有 readonly 修饰,这样模式匹配的时候也得加上 readonly 才行。

Released under the MIT License.

- +};

类型参数 Obj 为待处理的索引类型,类型约束为索引为 string、值为任意类型的索引类型 Record<string, any>。

用映射类型的语法重新构造索引类型,索引是之前的索引也就是 Key in keyof Obj,但要做一些过滤,也就是 as 之后的部分。

过滤的方式就是单独取出该索引之后,判断空对象是否是其子类型。

这里的 Pick 是 ts 提供的内置高级类型,就是取出某个 Key 构造新的索引类型:

ts
type Pick<T, K extends keyof T> = { [P in K]: T[P] };

比如单独取出 age 构造的新的索引类型是这样的:

可选的意思是这个索引可能没有,没有的时候,那 Pick<Obj, Key> 就是空的,所以 {} extends Pick<Obj, Key> 就能过滤出可选索引。

值的类型依然是之前的,也就是 Obj[Key]。

这样,就能过滤出所有可选索引,构造成新的索引类型:

总结

  • any 类型与任何类型的交叉都是 any,也就是 1 & any 结果是 any,可以用这个特性判断 any 类型。
  • 联合类型作为类型参数出现在条件类型左侧时,会分散成单个类型传入,最后合并。
  • never 作为类型参数出现在条件类型左侧时,会直接返回 never。
  • any 作为类型参数出现在条件类型左侧时,会直接返回 trueType 和 falseType 的联合类型。
  • 元组类型也是数组类型,但 length 是数字字面量,而数组的 length 是 number。可以用来判断元组类型。
  • 函数参数处会发生逆变,可以用来实现联合类型转交叉类型。
  • 可选索引的索引可能没有,那 Pick 出来的就可能是 {},可以用来过滤可选索引,反过来也可以过滤非可选索引。
  • 索引类型的索引为字符串字面量类型,而可索引签名不是,可以用这个特性过滤掉可索引签名。
  • keyof 只能拿到 class 的 public 的索引,可以用来过滤出 public 的属性。
  • 默认推导出来的不是字面量类型,加上 as const 可以推导出字面量类型,但带有 readonly 修饰,这样模式匹配的时候也得加上 readonly 才行。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/typescript/pattern.html b/cn/src/article/typescript/pattern.html index b25905bbd..31d6795d8 100644 --- a/cn/src/article/typescript/pattern.html +++ b/cn/src/article/typescript/pattern.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -134,8 +134,8 @@ : never : never;

类型参数 Props 为待处理的类型。

通过 keyof Props 取出 Props 的所有索引构成的联合类型,判断下 ref 是否在其中,也就是 'ref' extends keyof Props。

为什么要做这个判断,上面注释里写了:

在 ts3.0 里面如果没有对应的索引,Obj[Key] 返回的是 {} 而不是 never,所以这样做下兼容处理。

如果有 ref 这个索引的话,就通过 infer 提取 Value 的类型返回,否则返回 never。

ts
type GetPropsRefResult = GetPropsRef<{ ref: 1; name: 'str' }>;
 // type GetPropsRefResult = 1

当 ref 为 undefined 时:

ts
type GetPropsRefResult = GetPropsRef<{ ref: undefined; name: 'str' }>;
-// type GetPropsRefResult = undefined

Released under the MIT License.

- +// type GetPropsRefResult = undefined

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/typescript/reconstruction.html b/cn/src/article/typescript/reconstruction.html index e0fa6068d..c2d5b9f23 100644 --- a/cn/src/article/typescript/reconstruction.html +++ b/cn/src/article/typescript/reconstruction.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -89,8 +89,8 @@ [Key in keyof T]-?: T[Key]; };

给索引类型 T 的索引去掉 ? 的修饰 ,其余保持不变。

FilterByValueType

可以在构造新索引类型的时候根据值的类型做下过滤:

ts
type FilterByValueType<Obj extends Record<string, any>, ValueType> = {
   [Key in keyof Obj as Obj[Key] extends ValueType ? Key : never]: Obj[Key];
-};

类型参数 Obj 为要处理的索引类型,通过 extends 约束为索引为 string,值为任意类型的索引类型 Record<string, any>。

类型参数 ValueType 为要过滤出的值的类型。

构造新的索引类型,索引为 Obj 的索引,也就是 Key in keyof Obj,但要做一些变换,也就是 as 之后的部分。

如果原来索引的值 Obj[Key] 是 ValueType 类型,索引依然为之前的索引 Key,否则索引设置为 never,never 的索引会在生成新的索引类型时被去掉。

值保持不变,依然为原来索引的值,也就是 Obj[Key]。

这样就达到了过滤索引类型的索引,产生新的索引类型的目的:

Released under the MIT License.

- +};

类型参数 Obj 为要处理的索引类型,通过 extends 约束为索引为 string,值为任意类型的索引类型 Record<string, any>。

类型参数 ValueType 为要过滤出的值的类型。

构造新的索引类型,索引为 Obj 的索引,也就是 Key in keyof Obj,但要做一些变换,也就是 as 之后的部分。

如果原来索引的值 Obj[Key] 是 ValueType 类型,索引依然为之前的索引 Key,否则索引设置为 never,never 的索引会在生成新的索引类型时被去掉。

值保持不变,依然为原来索引的值,也就是 Obj[Key]。

这样就达到了过滤索引类型的索引,产生新的索引类型的目的:

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/typescript/recursion.html b/cn/src/article/typescript/recursion.html index 606093d0a..ce7513e14 100644 --- a/cn/src/article/typescript/recursion.html +++ b/cn/src/article/typescript/recursion.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -106,8 +106,8 @@ : DeepReadonly<Obj[Key]> : Obj[Key]; } - : never;

Released under the MIT License.

- + : never;

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/typescript/unionType.html b/cn/src/article/typescript/unionType.html index b15076266..aae090375 100644 --- a/cn/src/article/typescript/unionType.html +++ b/cn/src/article/typescript/unionType.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -62,8 +62,8 @@ > = `${Block}__${Element[number]}--${Modifiers[number]}`;

类型参数 Block、Element、Modifiers 分别是 bem 规范的三部分,其中 Element 和 Modifiers 都可能多个,约束为 string[]。

构造一个字符串类型,其中 Element 和 Modifiers 通过索引访问来变为联合类型。

字符串类型中遇到联合类型的时候,会每个元素单独传入计算,也就是这样的效果:

ts
type RemResult = BEM<'a', ['b', 'c'], ['d', 'e']>;
 // type RemResult = 'a__b--d' | 'a__b--e' | 'a__c--d' | 'a__b--e'

可以看到,用好了联合类型,确实能简化类型编程逻辑。

AllCombinations

我们再来实现一个全组合的高级类型,也是联合类型相关的:

希望传入 'A' | 'B' 的时候,能够返回所有的组合: 'A' | 'B' | 'BA' | 'AB'。

这种全组合问题的实现思路就是两两组合,组合出的字符串再和其他字符串两两组和:

比如 'A' | 'B' | 'c',就是 A 和 B、C 组合,B 和 A、C 组合,C 和 A、B 组合。然后组合出来的字符串再和其他字符串组合。

任何两个类型的组合有四种:A、B、AB、BA

ts
type Combination<A extends string, B extends string> = A | B | `${A}${B}` | `${B}${A}`;

然后构造出来的字符串再和其他字符串组合。

所以全组合的高级类型就是这样:

ts
type AllCombinations<A extends string, B extends string = A> = A extends A
   ? Combination<A, AllCombinations<Exclude<B, A>>>
-  : never;

类型参数 A、B 是待组合的两个联合类型,B 默认是 A 也就是同一个。

A extends A 的意义就是让联合类型每个类型单独传入做处理,上面我们刚学会。

A 的处理就是 A 和 B 中去掉 A 以后的所有类型组合,也就是 Combination<A, B 去掉 A 以后的所有组合>。

而 B 去掉 A 以后的所有组合就是 AllCombinations<Exclude<B, A>>,所以全组合就是 Combination<A, AllCombinations<Exclude<B, A>>>。

总结

联合类型中的每个类型都是相互独立的,TypeScript 对它做了特殊处理,也就是遇到字符串类型、条件类型的时候会把每个类型单独传入做计算,最后把每个类型的计算结果合并成联合类型。

条件类型左边是联合类型的时候就会触法这种处理,叫做分布式条件类型。

有两点特别要注意:

  • A extends A 不是没意义,意义是取出联合类型中的单个类型放入 A

  • A extends A 才是分布式条件类型, [A] extends [A] 就不是了,只有左边是单独的类型参数才可以。

我们后面做了一些案例,发现联合类型的这种 distributive 的特性确实能简化类型编程,但是也增加了认知成本,不过这也是不可避免的事。

Released under the MIT License.

- + : never;

类型参数 A、B 是待组合的两个联合类型,B 默认是 A 也就是同一个。

A extends A 的意义就是让联合类型每个类型单独传入做处理,上面我们刚学会。

A 的处理就是 A 和 B 中去掉 A 以后的所有类型组合,也就是 Combination<A, B 去掉 A 以后的所有组合>。

而 B 去掉 A 以后的所有组合就是 AllCombinations<Exclude<B, A>>,所以全组合就是 Combination<A, AllCombinations<Exclude<B, A>>>。

总结

联合类型中的每个类型都是相互独立的,TypeScript 对它做了特殊处理,也就是遇到字符串类型、条件类型的时候会把每个类型单独传入做计算,最后把每个类型的计算结果合并成联合类型。

条件类型左边是联合类型的时候就会触法这种处理,叫做分布式条件类型。

有两点特别要注意:

  • A extends A 不是没意义,意义是取出联合类型中的单个类型放入 A

  • A extends A 才是分布式条件类型, [A] extends [A] 就不是了,只有左边是单独的类型参数才可以。

我们后面做了一些案例,发现联合类型的这种 distributive 的特性确实能简化类型编程,但是也增加了认知成本,不过这也是不可避免的事。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/video.html b/cn/src/article/video.html index 59670e308..57b11bdf4 100644 --- a/cn/src/article/video.html +++ b/cn/src/article/video.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -326,8 +326,8 @@ display: none; }

由于播放器本身就是一个元素,那么可以任意的在里面添加元素,添加逻辑。

jsx
<r-player onChange={change} src="hls/example.m3u8">
   <div>111111</div>
-</r-player>

所以,这就解决配置项,长达好几页的问题,同时看到也就知道怎么配置,怎么开发了。

八:总结

目前已经从前后端的角度,实现了

  1. 视频的标准加密
  2. 视频的动态码率播放
  3. 视频的分片加载
  4. 可拖拽进度条
  5. 音量控制
  6. 手动清晰度切换
  7. 倍速播放
  8. 样式自定义覆盖
  9. 基于原生开发,可在所有框架运行,统一跨框架情况,各浏览器控件统一

这是demo和源码地址:

demo和文档地址:https://chaxus.github.io/ran/src/ranui/player/

源码地址:https://github.com/chaxus/ran

demo文档做了国际化,可切换到中文

Released under the MIT License.

- +</r-player>

所以,这就解决配置项,长达好几页的问题,同时看到也就知道怎么配置,怎么开发了。

八:总结

目前已经从前后端的角度,实现了

  1. 视频的标准加密
  2. 视频的动态码率播放
  3. 视频的分片加载
  4. 可拖拽进度条
  5. 音量控制
  6. 手动清晰度切换
  7. 倍速播放
  8. 样式自定义覆盖
  9. 基于原生开发,可在所有框架运行,统一跨框架情况,各浏览器控件统一

这是demo和源码地址:

demo和文档地址:https://chaxus.github.io/ran/src/ranui/player/

源码地址:https://github.com/chaxus/ran

demo文档做了国际化,可切换到中文

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/article/visual.html b/cn/src/article/visual.html index d2fbc5af6..965839281 100644 --- a/cn/src/article/visual.html +++ b/cn/src/article/visual.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -184,8 +184,8 @@ if (lineStyle.visible) { ctx.globalAlpha = lineStyle.alpha * this.worldAlpha; ctx.stroke(); -}

三 层级管理

在 canvas 绘图环境中,先绘制的图形会被后绘制的图形所覆盖,因此,层级的管理就自然地通过绘制顺序来实现。在这种情况下,最先被绘制的图形将位于最底层,而随后绘制的图形则逐层叠加,直至最上层。

我们已经实现了各种基础图形的绘制,接下来继续分离绘制时的数据和绘制操作。

我们需要一个容器类,在容器类中统一绘制所有的图形。

用一个 children 属性来添加所有的图形,在 render 方法中统一绘制。

同时,我们会根据 zIndex 属性来排序子元素,zIndex 越大的元素会被排在 children 数组的越后面,但是注意,排序的时候,要保证相同 zIndex 的相对顺序不变。

四 图形组的管理

我们会实现一个节点类 Vertex 这个类代表了最原始的‘节点’的概念,所有可以被展示到 canvas 画布上的、各种类型的节点都会继承于这个类,这是一个抽象类,我们并不会直接实例化这个类。

这个类上面挂载了‘节点’的各种属性,比如:父元素、透明度、旋转角度、缩放、平移、节点是否可见等。

为了进行图形组的管理,会继续实现一个容器类 Container,这个类代表了‘组’的概念,它提供了添加子元素,移除子元素等的方法;后续的要被渲染的一些类 (如 Graphics,Text,Sprite 等) 会继承于这个类;这个类本身不会被渲染 (因为它只是一个‘组’,它本身没有内容可以渲染)。

这个类继承于 Vertex 类,‘组’也算作‘节点’。

Graphics 这个类会用来构建一些几何图形元素;它会继承 Container 类。

在渲染引擎中,一切变换 (平移、旋转、缩放等) 都会转化成变换矩阵 (matrix),因为 canvas 只接受矩阵变换,虽然 canvas 为了开发的便捷,也提供了 ctx.rotate,ctx.scale 等操作,但是 canvas 中的这些操作会直接转换成变换矩阵,而不像 DOM 那样,有锚点的概念,所以 canvas 提供的 rotate,scale 等操作,和 DOM 提供的 rotate,scale 的表现是不一样的。

Matrix 类将会提供各种各样的与矩阵操作相关的函数 (矩阵相乘,矩阵求逆等),任何变换的叠加都将会转换成 matrix,方便我们调用 canvas 的指令。

Transform 类就类似 CSS 的 transform,它提供了一些更清晰、更符合人类直觉的变换,而不用直接使用矩阵变换,当然,这些变换最终会转换成矩阵变换。

参考资料:

  1. 如何通俗地讲解「仿射变换」?
  2. 仿射变换及其变换矩阵的理解
  3. 深入理解贝塞尔曲线
  4. 如何理解并应用贝塞尔曲线

Released under the MIT License.

- +}

三 层级管理

在 canvas 绘图环境中,先绘制的图形会被后绘制的图形所覆盖,因此,层级的管理就自然地通过绘制顺序来实现。在这种情况下,最先被绘制的图形将位于最底层,而随后绘制的图形则逐层叠加,直至最上层。

我们已经实现了各种基础图形的绘制,接下来继续分离绘制时的数据和绘制操作。

我们需要一个容器类,在容器类中统一绘制所有的图形。

用一个 children 属性来添加所有的图形,在 render 方法中统一绘制。

同时,我们会根据 zIndex 属性来排序子元素,zIndex 越大的元素会被排在 children 数组的越后面,但是注意,排序的时候,要保证相同 zIndex 的相对顺序不变。

四 图形组的管理

我们会实现一个节点类 Vertex 这个类代表了最原始的‘节点’的概念,所有可以被展示到 canvas 画布上的、各种类型的节点都会继承于这个类,这是一个抽象类,我们并不会直接实例化这个类。

这个类上面挂载了‘节点’的各种属性,比如:父元素、透明度、旋转角度、缩放、平移、节点是否可见等。

为了进行图形组的管理,会继续实现一个容器类 Container,这个类代表了‘组’的概念,它提供了添加子元素,移除子元素等的方法;后续的要被渲染的一些类 (如 Graphics,Text,Sprite 等) 会继承于这个类;这个类本身不会被渲染 (因为它只是一个‘组’,它本身没有内容可以渲染)。

这个类继承于 Vertex 类,‘组’也算作‘节点’。

Graphics 这个类会用来构建一些几何图形元素;它会继承 Container 类。

在渲染引擎中,一切变换 (平移、旋转、缩放等) 都会转化成变换矩阵 (matrix),因为 canvas 只接受矩阵变换,虽然 canvas 为了开发的便捷,也提供了 ctx.rotate,ctx.scale 等操作,但是 canvas 中的这些操作会直接转换成变换矩阵,而不像 DOM 那样,有锚点的概念,所以 canvas 提供的 rotate,scale 等操作,和 DOM 提供的 rotate,scale 的表现是不一样的。

Matrix 类将会提供各种各样的与矩阵操作相关的函数 (矩阵相乘,矩阵求逆等),任何变换的叠加都将会转换成 matrix,方便我们调用 canvas 的指令。

Transform 类就类似 CSS 的 transform,它提供了一些更清晰、更符合人类直觉的变换,而不用直接使用矩阵变换,当然,这些变换最终会转换成矩阵变换。

参考资料:

  1. 如何通俗地讲解「仿射变换」?
  2. 仿射变换及其变换矩阵的理解
  3. 深入理解贝塞尔曲线
  4. 如何理解并应用贝塞尔曲线

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/note/centos.html b/cn/src/note/centos.html index 5cf34bd65..a2d3e394f 100644 --- a/cn/src/note/centos.html +++ b/cn/src/note/centos.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -63,8 +63,8 @@ baseurl=http://vault.centos.org/8.5.2111/extras/$basearch/os/ gpgcheck=1 enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

更新缓存并重试

  1. 清理缓存:yum clean all
  2. 生成新的缓存:yum makecache
  3. 更新系统:yum update

Last updated:

Released under the MIT License.

- +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

更新缓存并重试

  1. 清理缓存:yum clean all
  2. 生成新的缓存:yum makecache
  3. 更新系统:yum update

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/note/docker.html b/cn/src/note/docker.html index 054227e38..9d3e74e6d 100644 --- a/cn/src/note/docker.html +++ b/cn/src/note/docker.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -108,8 +108,8 @@ EXPOSR 3000 # 表示容器启动后自动执行 CMD node demos/01.js
  • CMD 命令和 RUN 命令的区别
    • RUN 命令在 image 文件的构建阶段执行,执行结果都会打包进行 image 文件
    • CMD 命令是容器启动后执行
    • 一个 dockerfile 可以有多个 RUN 命令,但只有一个 CMD 命令
    • 指定了 CMD 命令后,docker container run 命令就不能附加命令了 (比如前面的/bin/bash),否则他会覆盖 CMD 命令,现在可以使用
shell
$ docker container run --rm - p 8000:3000 -it koa-demo:0.0.1

问题:

  1. 如果遇到 docker desktop 登录不上,可以尝试 docker login进行登录,命令行登录会输出错误的信息,如果发现是网络问题,换一个代理即可。
  2. Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
shell
# docker服务没有启动
-$ service docker start

参考资料

Last updated:

Released under the MIT License.

- +$ service docker start

参考资料

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/note/libreoffice2wasm.html b/cn/src/note/libreoffice2wasm.html index 38f70db66..d7864ae45 100644 --- a/cn/src/note/libreoffice2wasm.html +++ b/cn/src/note/libreoffice2wasm.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -148,8 +148,8 @@ --disable-odk --disable-pch --disable-skia ---disable-scripting

通过这些步骤,你应该能够显著减小生成的 WebAssembly 文件的体积,同时保留将文件转换为 PDF 的功能。如果遇到具体问题,请提供详细的错误信息,以便更好地帮助你解决问题。

wasm-opt 是 Binaryen 项目的一部分,它是一个用于优化和处理 WebAssembly 二进制文件的工具。你可以在 Ubuntu 上通过以下步骤安装和使用 wasm-opt:

  1. 安装依赖项 首先,确保你的系统上已经安装了必要的依赖项:

sudo apt update sudo apt install cmake build-essential git 2. 下载和编译 Binaryen 接下来,从源码编译 Binaryen:

克隆 Binaryen 仓库

git clone https://github.com/WebAssembly/binaryen.git cd binaryen

创建并进入构建目录

mkdir build cd build

使用 CMake 配置构建

cmake ..

编译 Binaryen

make

安装 Binaryen

sudo make install 3. 使用 wasm-opt 安装完成后,你可以使用 wasm-opt 命令来优化 WebAssembly 文件。例如:

假设你有一个名为 original.wasm 的 WebAssembly 文件

wasm-opt -Oz -o optimized.wasm original.wasm 在这个命令中:

-Oz 表示进行最大化的尺寸优化。 -o optimized.wasm 指定输出文件名为 optimized.wasm。 original.wasm 是输入的 WebAssembly 文件。 4. 验证安装 你可以通过运行以下命令来验证 wasm-opt 是否正确安装:

wasm-opt --version 这将输出 wasm-opt 的版本信息,确认它已成功安装并可以使用。

示例 假设你有一个名为 example.wasm 的 WebAssembly 文件,你可以通过以下命令优化它:

wasm-opt -Oz -o example_optimized.wasm example.wasm 这将生成一个优化后的 WebAssembly 文件 example_optimized.wasm,其体积通常会显著减小。

通过这些步骤,你应该能够在 Ubuntu 上成功安装和使用 wasm-opt 来优化你的 WebAssembly 文件。如果在安装或使用过程中遇到任何问题,请提供详细的错误信息,以便进一步帮助你解决问题。

--disable-debug --enable-sal-log --disable-crashdump --host=wasm32-local-emscripten --disable-gui --with-main-module=writer --with-package-format=emscripten --disable-dbus --disable-odk --disable-postgresql-sdbc --disable-firebird-sdbc --disable-coinmp --disable-cve-tests --disable-gtk3 --disable-gstreamer-1-0 --disable-kf5 --disable-scripting-beanshell --disable-scripting-javascript --disable-extensions --disable-epm --disable-online-update --disable-python --disable-pdfimport --disable-lpsolve --disable-sdremote --disable-scripting --disable-avmedia --disable-coinmp --disable-report-builder --disable-odk --disable-pch --disable-skia --disable-scripting

步骤 1:下载最新的 OpenSSL 源代码 首先,确保你在一个干净的目录中,然后下载最新版本的 OpenSSL 源代码。你可以访问 OpenSSL 官方网站 查看最新版本。假设最新版本是 openssl-3.0.9:

wget https://www.openssl.org/source/openssl-3.0.9.tar.gz tar -xzvf openssl-3.0.9.tar.gz cd openssl-3.0.9 步骤 2:编译和安装 OpenSSL 接下来,编译并安装 OpenSSL:

./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib make make test make install 步骤 3:确认 OpenSSL 安装路径 确保 OpenSSL 的头文件和库文件已正确安装:

ls /usr/local/ssl/include ls /usr/local/ssl/lib 步骤 4:设置环境变量 设置正确的环境变量,以便编译时能找到 OpenSSL:

export PKG_CONFIG_PATH="/usr/local/ssl/lib/pkgconfig" export CFLAGS="-I/usr/local/ssl/include" export LDFLAGS="-L/usr/local/ssl/lib -lssl -lcrypto" 步骤 5:清理之前的配置 在重新运行 configure 脚本之前,清理之前的配置:

make clean 步骤 6:重新运行 configure 脚本 重新运行 configure 脚本,以确保它能找到新的 OpenSSL 版本:

emconfigure ./configure --disable-debug --enable-sal-log --disable-crashdump --host=wasm32-local-emscripten --disable-gui --with-main-module=writer --with-package-format=emscripten --disable-dbus --disable-odk --disable-postgresql-sdbc --disable-firebird-sdbc --disable-coinmp --disable-cve-tests --disable-gtk3 --disable-gstreamer-1-0 --disable-kf5 --disable-scripting-beanshell --disable-scripting-javascript --disable-extensions --disable-epm --disable-online-update --disable-python --disable-pdfimport --disable-lpsolve --disable-sdremote --disable-scripting --disable-avmedia --disable-coinmp --disable-report-builder --disable-odk --disable-pch --disable-skia --disable-scripting --srcdir=/home/core --enable-option-checking=fatal --disable-pthreads 步骤 7:检查 config.log 如果配置仍然失败,请检查 config.log 文件以获取更多详细信息:

cat config.log | grep openssl 通过确保 OpenSSL 已正确安装并设置正确的环境变量,我们应该能够解决配置过程中遇到的问题。如果问题仍然存在,请提供 config.log 文件中与 OpenSSL 相关的更多详细信息,以便进一步诊断和解决问题。

emconfigure ./configure --disable-debug --enable-sal-log --disable-crashdump --host=wasm32-local-emscripten --disable-gui --with-main-module=writer --with-package-format=emscripten --disable-dbus --disable-odk --disable-postgresql-sdbc --disable-firebird-sdbc --disable-coinmp --disable-cve-tests --disable-gtk3 --disable-gstreamer-1-0 --disable-kf5 --disable-scripting-beanshell --disable-scripting-javascript --disable-extensions --disable-epm --disable-online-update --disable-python --disable-pdfimport --disable-lpsolve --disable-sdremote --disable-scripting --disable-avmedia --disable-coinmp --disable-report-builder --disable-odk --disable-pch --disable-skia --disable-scripting --srcdir=/home/core --enable-option-checking=fatal

emmake make CXXFLAGS="-I/usr/local/ssl/include -O3 -g0 -msimd128" LDFLAGS="-L/usr/local/ssl/lib -lssl -lcrypto -O3 -g0"

emconfigure ./configure --disable-cups --disable-dbus --without-system-fontconfig --with-system-zlib --disable-dynamic-loading --disable-gui CXXFLAGS=-std=c++20 --host=wasm32-unknown-emscripten

root@8cb3480a4441:/home/core/instsetoo_native# vim CustomTarget_emscripten-install.mk

使用 file_packager.py 工具将文件预加载到虚拟文件系统中。确保 Emscripten 的环境变量已经正确设置,然后运行以下命令:

python3 /home/emsdk/upstream/emscripten/tools/file_packager.py preload.data --preload /home/core/instdir/share@/instdir/share --js-output=preload.js

Last updated:

Released under the MIT License.

- +--disable-scripting

通过这些步骤,你应该能够显著减小生成的 WebAssembly 文件的体积,同时保留将文件转换为 PDF 的功能。如果遇到具体问题,请提供详细的错误信息,以便更好地帮助你解决问题。

wasm-opt 是 Binaryen 项目的一部分,它是一个用于优化和处理 WebAssembly 二进制文件的工具。你可以在 Ubuntu 上通过以下步骤安装和使用 wasm-opt:

  1. 安装依赖项 首先,确保你的系统上已经安装了必要的依赖项:

sudo apt update sudo apt install cmake build-essential git 2. 下载和编译 Binaryen 接下来,从源码编译 Binaryen:

克隆 Binaryen 仓库

git clone https://github.com/WebAssembly/binaryen.git cd binaryen

创建并进入构建目录

mkdir build cd build

使用 CMake 配置构建

cmake ..

编译 Binaryen

make

安装 Binaryen

sudo make install 3. 使用 wasm-opt 安装完成后,你可以使用 wasm-opt 命令来优化 WebAssembly 文件。例如:

假设你有一个名为 original.wasm 的 WebAssembly 文件

wasm-opt -Oz -o optimized.wasm original.wasm 在这个命令中:

-Oz 表示进行最大化的尺寸优化。 -o optimized.wasm 指定输出文件名为 optimized.wasm。 original.wasm 是输入的 WebAssembly 文件。 4. 验证安装 你可以通过运行以下命令来验证 wasm-opt 是否正确安装:

wasm-opt --version 这将输出 wasm-opt 的版本信息,确认它已成功安装并可以使用。

示例 假设你有一个名为 example.wasm 的 WebAssembly 文件,你可以通过以下命令优化它:

wasm-opt -Oz -o example_optimized.wasm example.wasm 这将生成一个优化后的 WebAssembly 文件 example_optimized.wasm,其体积通常会显著减小。

通过这些步骤,你应该能够在 Ubuntu 上成功安装和使用 wasm-opt 来优化你的 WebAssembly 文件。如果在安装或使用过程中遇到任何问题,请提供详细的错误信息,以便进一步帮助你解决问题。

--disable-debug --enable-sal-log --disable-crashdump --host=wasm32-local-emscripten --disable-gui --with-main-module=writer --with-package-format=emscripten --disable-dbus --disable-odk --disable-postgresql-sdbc --disable-firebird-sdbc --disable-coinmp --disable-cve-tests --disable-gtk3 --disable-gstreamer-1-0 --disable-kf5 --disable-scripting-beanshell --disable-scripting-javascript --disable-extensions --disable-epm --disable-online-update --disable-python --disable-pdfimport --disable-lpsolve --disable-sdremote --disable-scripting --disable-avmedia --disable-coinmp --disable-report-builder --disable-odk --disable-pch --disable-skia --disable-scripting

步骤 1:下载最新的 OpenSSL 源代码 首先,确保你在一个干净的目录中,然后下载最新版本的 OpenSSL 源代码。你可以访问 OpenSSL 官方网站 查看最新版本。假设最新版本是 openssl-3.0.9:

wget https://www.openssl.org/source/openssl-3.0.9.tar.gz tar -xzvf openssl-3.0.9.tar.gz cd openssl-3.0.9 步骤 2:编译和安装 OpenSSL 接下来,编译并安装 OpenSSL:

./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib make make test make install 步骤 3:确认 OpenSSL 安装路径 确保 OpenSSL 的头文件和库文件已正确安装:

ls /usr/local/ssl/include ls /usr/local/ssl/lib 步骤 4:设置环境变量 设置正确的环境变量,以便编译时能找到 OpenSSL:

export PKG_CONFIG_PATH="/usr/local/ssl/lib/pkgconfig" export CFLAGS="-I/usr/local/ssl/include" export LDFLAGS="-L/usr/local/ssl/lib -lssl -lcrypto" 步骤 5:清理之前的配置 在重新运行 configure 脚本之前,清理之前的配置:

make clean 步骤 6:重新运行 configure 脚本 重新运行 configure 脚本,以确保它能找到新的 OpenSSL 版本:

emconfigure ./configure --disable-debug --enable-sal-log --disable-crashdump --host=wasm32-local-emscripten --disable-gui --with-main-module=writer --with-package-format=emscripten --disable-dbus --disable-odk --disable-postgresql-sdbc --disable-firebird-sdbc --disable-coinmp --disable-cve-tests --disable-gtk3 --disable-gstreamer-1-0 --disable-kf5 --disable-scripting-beanshell --disable-scripting-javascript --disable-extensions --disable-epm --disable-online-update --disable-python --disable-pdfimport --disable-lpsolve --disable-sdremote --disable-scripting --disable-avmedia --disable-coinmp --disable-report-builder --disable-odk --disable-pch --disable-skia --disable-scripting --srcdir=/home/core --enable-option-checking=fatal --disable-pthreads 步骤 7:检查 config.log 如果配置仍然失败,请检查 config.log 文件以获取更多详细信息:

cat config.log | grep openssl 通过确保 OpenSSL 已正确安装并设置正确的环境变量,我们应该能够解决配置过程中遇到的问题。如果问题仍然存在,请提供 config.log 文件中与 OpenSSL 相关的更多详细信息,以便进一步诊断和解决问题。

emconfigure ./configure --disable-debug --enable-sal-log --disable-crashdump --host=wasm32-local-emscripten --disable-gui --with-main-module=writer --with-package-format=emscripten --disable-dbus --disable-odk --disable-postgresql-sdbc --disable-firebird-sdbc --disable-coinmp --disable-cve-tests --disable-gtk3 --disable-gstreamer-1-0 --disable-kf5 --disable-scripting-beanshell --disable-scripting-javascript --disable-extensions --disable-epm --disable-online-update --disable-python --disable-pdfimport --disable-lpsolve --disable-sdremote --disable-scripting --disable-avmedia --disable-coinmp --disable-report-builder --disable-odk --disable-pch --disable-skia --disable-scripting --srcdir=/home/core --enable-option-checking=fatal

emmake make CXXFLAGS="-I/usr/local/ssl/include -O3 -g0 -msimd128" LDFLAGS="-L/usr/local/ssl/lib -lssl -lcrypto -O3 -g0"

emconfigure ./configure --disable-cups --disable-dbus --without-system-fontconfig --with-system-zlib --disable-dynamic-loading --disable-gui CXXFLAGS=-std=c++20 --host=wasm32-unknown-emscripten

root@8cb3480a4441:/home/core/instsetoo_native# vim CustomTarget_emscripten-install.mk

使用 file_packager.py 工具将文件预加载到虚拟文件系统中。确保 Emscripten 的环境变量已经正确设置,然后运行以下命令:

python3 /home/emsdk/upstream/emscripten/tools/file_packager.py preload.data --preload /home/core/instdir/share@/instdir/share --js-output=preload.js

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/note/ubuntu.html b/cn/src/note/ubuntu.html index 01c9375bf..9b582d47f 100644 --- a/cn/src/note/ubuntu.html +++ b/cn/src/note/ubuntu.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -44,8 +44,8 @@
Skip to content

ubuntu

sh
apt update
 
-apt install openjdk-11-jdk  wget curl junit4 ant libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgtk-3-dev libglib2.0-dev libatk1.0-dev libcairo2-dev zip flex uuid-runtime bison libxrandr-dev libxrender-dev libxext-dev libnss3-dev libnspr4-dev libkrb5-dev python3 python3-pip libxml2-utils xsltproc libxslt1-dev gperf libfontconfig1-dev libcups2-dev gcc make autoconf pkg-config automake

Last updated:

Released under the MIT License.

- +apt install openjdk-11-jdk wget curl junit4 ant libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgtk-3-dev libglib2.0-dev libatk1.0-dev libcairo2-dev zip flex uuid-runtime bison libxrandr-dev libxrender-dev libxext-dev libnss3-dev libnspr4-dev libkrb5-dev python3 python3-pip libxml2-utils xsltproc libxslt1-dev gperf libfontconfig1-dev libcups2-dev gcc make autoconf pkg-config automake

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/button/index.html b/cn/src/ranui/button/index.html index 80f2971a6..46680a9a9 100644 --- a/cn/src/ranui/button/index.html +++ b/cn/src/ranui/button/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -50,8 +50,8 @@ <r-button type="text" disabled>文本按钮</r-button> <r-button disabled>默认按钮</r-button>

图标icon

当需要在 Button 内嵌入 Icon 时,可以设置 icon 属性,或者直接在 Button 内使用 Icon 组件。

如果想控制 Icon 具体的位置,只能直接使用 Icon 组件,而非 icon 属性。

默认按钮
主要按钮
xml
<r-button type="default" icon="user">默认按钮</r-button>
 <r-button type="primary" icon="home">主要按钮</r-button>

特效 effect

如果需要纯净的 Button,可以加上 effect = false,屏蔽点击时候的水波纹特效

默认按钮主要按钮
xml
<r-button type="default" icon="user">默认按钮</r-button>
-<r-button type="primary" icon="home">主要按钮</r-button>

Released under the MIT License.

- +<r-button type="primary" icon="home">主要按钮</r-button>

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/checkbox/index.html b/cn/src/ranui/checkbox/index.html index bd971d7cf..fcd8e4414 100644 --- a/cn/src/ranui/checkbox/index.html +++ b/cn/src/ranui/checkbox/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -45,8 +45,8 @@
Skip to content

CheckBox 多选框

代码演示

xml
 <r-checkbox ></r-checkbox>

属性

checked

xml
 <r-checkbox checked="true"></r-checkbox>
  <r-checkbox checked="false"></r-checkbox>

disabled

xml
 <r-checkbox checked="true" disabled></r-checkbox>
  <r-checkbox checked="false" disabled></r-checkbox>

事件event

改变的时候触发。

onchange

xml
 <r-checkbox onchange="console.log(this.checked)"></r-checkbox>
- <r-checkbox onchange="console.log(this.checked)"></r-checkbox>

Released under the MIT License.

- + <r-checkbox onchange="console.log(this.checked)"></r-checkbox>

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/icon/index.html b/cn/src/ranui/icon/index.html index 9d5d705c3..d0377cf03 100644 --- a/cn/src/ranui/icon/index.html +++ b/cn/src/ranui/icon/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -53,8 +53,8 @@ <r-icon name="lock" size="50" color="#F44336"></r-icon> <r-icon name="lock" size="50" color="#3F51B5"></r-icon>

旋转spin

设置 spin 开启旋转,传入数字控制旋转的速度,数字越小旋转越快

html
<r-icon name="loading" size="50" color="#1E90FF" spin="0.7"></r-icon>
 <r-icon name="loading" size="50" color="#1E90FF" spin></r-icon>
-<r-icon name="loading" size="50" color="#1E90FF" spin="5"></r-icon>

图标列表

Released under the MIT License.

- +<r-icon name="loading" size="50" color="#1E90FF" spin="5"></r-icon>

图标列表

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/image/index.html b/cn/src/ranui/image/index.html index 6b47f71df..fa2cbdbff 100644 --- a/cn/src/ranui/image/index.html +++ b/cn/src/ranui/image/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

Image 图片

代码演示

xml
 <r-img src="" fallback=""></r-img>

属性

图片加载地址src

图片的地址

图片加载失败fallback

src配置的图片加载失败,兜底的图片地址,下面是默认加载失败图片

Released under the MIT License.

- +
Skip to content

Image 图片

代码演示

xml
 <r-img src="" fallback=""></r-img>

属性

图片加载地址src

图片的地址

图片加载失败fallback

src配置的图片加载失败,兜底的图片地址,下面是默认加载失败图片

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/index.html b/cn/src/ranui/index.html index ee315c3c3..dcde11d14 100644 --- a/cn/src/ranui/index.html +++ b/cn/src/ranui/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -128,8 +128,8 @@ percent="0.70" type="drag" style="--ran-progress-wrap-background:linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);" -></r-progress>

具体css3变量名称可以参考每个组件的介绍和说明

Compatibility 兼容性

  • 不支持 IE,其他均有较好支持

Contributors 贡献者

Other 相关资源

  1. 优秀的组件设计
  2. 在线生成 CSS 渐变色
  3. 优秀设计作品,有 psd 和 sketch
  4. 3D UI 设计,类似于 3D 版的 figma
  5. 设计规范
  6. 优秀设计作品
  7. element UI 中文网
  8. Ant design 中文网
  9. 在线绘制 CSS 动画
  10. tailwindcss 组件库
  11. animate css 非常优秀的 css 动画
  12. can i use 检测兼容性 API 网站
  13. figma

协议和标准

  1. RFCs
  2. ECMA
  3. w3c

Released under the MIT License.

- +></r-progress>

具体css3变量名称可以参考每个组件的介绍和说明

Compatibility 兼容性

  • 不支持 IE,其他均有较好支持

Contributors 贡献者

Other 相关资源

  1. 优秀的组件设计
  2. 在线生成 CSS 渐变色
  3. 优秀设计作品,有 psd 和 sketch
  4. 3D UI 设计,类似于 3D 版的 figma
  5. 设计规范
  6. 优秀设计作品
  7. element UI 中文网
  8. Ant design 中文网
  9. 在线绘制 CSS 动画
  10. tailwindcss 组件库
  11. animate css 非常优秀的 css 动画
  12. can i use 检测兼容性 API 网站
  13. figma

协议和标准

  1. RFCs
  2. ECMA
  3. w3c

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/input/index.html b/cn/src/ranui/input/index.html index 13ad93668..e64f1f792 100644 --- a/cn/src/ranui/input/index.html +++ b/cn/src/ranui/input/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -53,8 +53,8 @@ const func = (e) => { console.log(e); }; -input.addEventListener('input', func);

事件的e参数结构 input方法

Released under the MIT License.

- +input.addEventListener('input', func);

事件的e参数结构 input方法

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/loading/index.html b/cn/src/ranui/loading/index.html index a7863d554..1e96d20e4 100644 --- a/cn/src/ranui/loading/index.html +++ b/cn/src/ranui/loading/index.html @@ -8,13 +8,13 @@ - + - + - + @@ -38,7 +38,7 @@ - + @@ -47,8 +47,8 @@
Skip to content

Loading

一些好看的 loading

Code demo

xml
<r-loading name="circle"></r-loading>

属性

name

这里有很多好看的 loading,可供选择

xml
<r-loading name="double-bounce"></r-loading>
 <r-loading name="rotate"></r-loading>
 <r-loading name="stretch"></r-loading>
-<r-loading name="cube"></r-loading>

Loading list

Move the mouse over the icon to see the loading animation

stretch
rotate
double-bounce
cube
dot
triple-bounce
scale-out
circle
circle-line
square
pulse
solar
cube-fold
circle-fold
cube-grid
circle-turn
circle-rotate
circle-spin
dot-bar
dot-circle
line
dot-pulse
line-scale
text
cube-dim
dot-line
arc
drop
pacman

Released under the MIT License.

- +<r-loading name="cube"></r-loading>

Loading list

Move the mouse over the icon to see the loading animation

stretch
rotate
double-bounce
cube
dot
triple-bounce
scale-out
circle
circle-line
square
pulse
solar
cube-fold
circle-fold
cube-grid
circle-turn
circle-rotate
circle-spin
dot-bar
dot-circle
line
dot-pulse
line-scale
text
cube-dim
dot-line
arc
drop
pacman

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/math/index.html b/cn/src/ranui/math/index.html index 4357d4aa7..66c254676 100644 --- a/cn/src/ranui/math/index.html +++ b/cn/src/ranui/math/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

math 数学公式

HTML 页面中高质量展示 LaTeX 数学公式

代码演示

xml
<r-math latex="\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 \quad (a > b > 0)"></r-math>

属性

latex string

xml
  <r-math latex="x = {-b \pm \sqrt{b^2-4ac} \over 2a}"></r-math>

Released under the MIT License.

- +
Skip to content

math 数学公式

HTML 页面中高质量展示 LaTeX 数学公式

代码演示

xml
<r-math latex="\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 \quad (a > b > 0)"></r-math>

属性

latex string

xml
  <r-math latex="x = {-b \pm \sqrt{b^2-4ac} \over 2a}"></r-math>

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/message/index.html b/cn/src/ranui/message/index.html index cb3a3edbf..8cf6d89c9 100644 --- a/cn/src/ranui/message/index.html +++ b/cn/src/ranui/message/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -46,8 +46,8 @@ <r-button onclick="message.warning('这是一条提示')">警告提示</r-button> <r-button onclick="message.error('这是一条提示')">错误提示</r-button> <r-button onclick="message.success('这是一条提示')">成功提示</r-button> -<r-button onclick="message.toast('这是一条提示')">toast提示</r-button>

方法

组件提供了一些静态方法,使用方式和参数如下:

  1. 可以只传一个参数,提示的内容,默认提示 3000 毫秒

message.info('这是一条提示')

message.warning('这是一条提示')

message.error('这是一条提示')

message.success('这是一条提示')

message.toast('这是一条提示')"

  1. 也可以传一个对象,设置提示内容,关闭延时,关闭时触发的回调函数

message.info({content:'这是一条提示', duration: 2000, close: () => {}})

message.warning({content:'这是一条提示', duration: 2000, close: () => {}})

message.error({content:'这是一条提示', duration: 2000, close: () => {}})

message.success({content:'这是一条提示', duration: 2000, close: () => {}})

message.toast({content:'这是一条提示', duration: 2000, close: () => {}})

参数说明类型
content提示内容string
duration自动关闭的延时,单位毫秒。默认 3000 毫秒number
close关闭时触发的回调函数() => void

Released under the MIT License.

- +<r-button onclick="message.toast('这是一条提示')">toast提示</r-button>

方法

组件提供了一些静态方法,使用方式和参数如下:

  1. 可以只传一个参数,提示的内容,默认提示 3000 毫秒

message.info('这是一条提示')

message.warning('这是一条提示')

message.error('这是一条提示')

message.success('这是一条提示')

message.toast('这是一条提示')"

  1. 也可以传一个对象,设置提示内容,关闭延时,关闭时触发的回调函数

message.info({content:'这是一条提示', duration: 2000, close: () => {}})

message.warning({content:'这是一条提示', duration: 2000, close: () => {}})

message.error({content:'这是一条提示', duration: 2000, close: () => {}})

message.success({content:'这是一条提示', duration: 2000, close: () => {}})

message.toast({content:'这是一条提示', duration: 2000, close: () => {}})

参数说明类型
content提示内容string
duration自动关闭的延时,单位毫秒。默认 3000 毫秒number
close关闭时触发的回调函数() => void

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/modal/index.html b/cn/src/ranui/modal/index.html index cb09295b8..2f196602e 100644 --- a/cn/src/ranui/modal/index.html +++ b/cn/src/ranui/modal/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + - - + + \ No newline at end of file diff --git a/cn/src/ranui/player/index.html b/cn/src/ranui/player/index.html index cbbefb807..ad17fa2b7 100644 --- a/cn/src/ranui/player/index.html +++ b/cn/src/ranui/player/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

r-player 视频播放器

基于hlsjsweb components,让原生的标签r-player拥有统一的视频控件。 不采用new Player(options)的方式挂载到指定dom,视图的归视图,逻辑的归逻辑,所见及所得,更加直观。

  1. 可拖拽进度条
  2. 音量控制
  3. 根据当前带宽自适应码率切换
  4. 手动清晰度切换
  5. 倍速播放
  6. 样式自定义覆盖
  7. hls协议标准加密视频播放
  8. 基于原生开发,可在所有框架运行,统一跨框架情况
  9. 各浏览器控件统一

代码演示

xml
  <r-player src="/ran/hls/example.m3u8"></r-player>

属性

src

视频的资源地址

volume

设置初始音量,默认 0.5

currentTime

设置初始播放时间,默认从头开始播放

playbackRate

设置倍速,默认 1.0

debug

控制台会打印输出一些信息

事件event

onchange

监听任何播放器发生的变化,返回的值如下。

可通过这个方法获得播放器的实例

活着通过type判断不同的事件类型,进行不同的操作

属性说明类型
type发生变化的事件类型string
data事件的值Object
currentTime播放的当前时间number
duration视频的总时长number
tag播放器的实例Element

其中type类型有

名称说明
canplay浏览器可以播放媒体文件了,但估计没有足够的数据来支撑播放到结束,不必停下来进一步缓冲内容。
canplaythrough浏览器估计它可以在不停止内容缓冲的情况下播放媒体直到结束。
completeOfflineAudioContext 渲染完成。
durationchangeduration 属性的值改变时触发。
emptied媒体内容变为空;例如,当这个 media 已经加载完成(或者部分加载完成),则发送此事件,并调用 load() 方法重新加载它。
ended视频停止播放,因为 media 已经到达结束点。
loadedmetadata已加载元数据。
progress在浏览器加载资源时周期性触发。
ratechange播放速率发生变化。
seeked跳帧(seek)操作完成。
seeking跳帧(seek)操作开始。
stalled用户代理(user agent)正在尝试获取媒体数据,但数据意外未出现。
suspend媒体数据加载已暂停。
loadeddatamedia 中的首帧已经完成加载。
timeupdatecurrentTime 属性指定的时间发生变化。
volumechange音量发生变化。
waiting由于暂时缺少数据,播放已停止。
play播放已开始。
playing由于缺乏数据而暂停或延迟后,播放准备开始。
pause播放已暂停。
volume音量发生变化。
fullscreen触发全屏事件

Released under the MIT License.

- +
Skip to content

r-player 视频播放器

基于hlsjsweb components,让原生的标签r-player拥有统一的视频控件。 不采用new Player(options)的方式挂载到指定dom,视图的归视图,逻辑的归逻辑,所见及所得,更加直观。

  1. 可拖拽进度条
  2. 音量控制
  3. 根据当前带宽自适应码率切换
  4. 手动清晰度切换
  5. 倍速播放
  6. 样式自定义覆盖
  7. hls协议标准加密视频播放
  8. 基于原生开发,可在所有框架运行,统一跨框架情况
  9. 各浏览器控件统一

代码演示

xml
  <r-player src="/ran/hls/example.m3u8"></r-player>

属性

src

视频的资源地址

volume

设置初始音量,默认 0.5

currentTime

设置初始播放时间,默认从头开始播放

playbackRate

设置倍速,默认 1.0

debug

控制台会打印输出一些信息

事件event

onchange

监听任何播放器发生的变化,返回的值如下。

可通过这个方法获得播放器的实例

活着通过type判断不同的事件类型,进行不同的操作

属性说明类型
type发生变化的事件类型string
data事件的值Object
currentTime播放的当前时间number
duration视频的总时长number
tag播放器的实例Element

其中type类型有

名称说明
canplay浏览器可以播放媒体文件了,但估计没有足够的数据来支撑播放到结束,不必停下来进一步缓冲内容。
canplaythrough浏览器估计它可以在不停止内容缓冲的情况下播放媒体直到结束。
completeOfflineAudioContext 渲染完成。
durationchangeduration 属性的值改变时触发。
emptied媒体内容变为空;例如,当这个 media 已经加载完成(或者部分加载完成),则发送此事件,并调用 load() 方法重新加载它。
ended视频停止播放,因为 media 已经到达结束点。
loadedmetadata已加载元数据。
progress在浏览器加载资源时周期性触发。
ratechange播放速率发生变化。
seeked跳帧(seek)操作完成。
seeking跳帧(seek)操作开始。
stalled用户代理(user agent)正在尝试获取媒体数据,但数据意外未出现。
suspend媒体数据加载已暂停。
loadeddatamedia 中的首帧已经完成加载。
timeupdatecurrentTime 属性指定的时间发生变化。
volumechange音量发生变化。
waiting由于暂时缺少数据,播放已停止。
play播放已开始。
playing由于缺乏数据而暂停或延迟后,播放准备开始。
pause播放已暂停。
volume音量发生变化。
fullscreen触发全屏事件

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/popover/index.html b/cn/src/ranui/popover/index.html index b8f208915..7c191d157 100644 --- a/cn/src/ranui/popover/index.html +++ b/cn/src/ranui/popover/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -67,8 +67,8 @@ <r-content> <div>top</div> </r-content> - </r-popover>

Released under the MIT License.

- + </r-popover>

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/preview/index.html b/cn/src/ranui/preview/index.html index c254469d3..69d9f9408 100644 --- a/cn/src/ranui/preview/index.html +++ b/cn/src/ranui/preview/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -61,8 +61,8 @@ } }; }; -</script>

属性

资源地址src

src 地址即可打开弹窗,没有src就不展示

html
<r-preview src=""></r-preview>

是否可关闭closeable

closeable 默认为 true ,可以关闭,设置成 false 时, 表示不可关闭,将不会展示右上角的关闭按钮

html
<r-preview closeable="false"></r-preview>

Released under the MIT License.

- +</script>

属性

资源地址src

src 地址即可打开弹窗,没有src就不展示

html
<r-preview src=""></r-preview>

是否可关闭closeable

closeable 默认为 true ,可以关闭,设置成 false 时, 表示不可关闭,将不会展示右上角的关闭按钮

html
<r-preview closeable="false"></r-preview>

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/progress/index.html b/cn/src/ranui/progress/index.html index 7ea9aac52..48ca5a89e 100644 --- a/cn/src/ranui/progress/index.html +++ b/cn/src/ranui/progress/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -48,8 +48,8 @@ <r-progress type="primary" percent="40%"></r-progress> <r-progress type="primary" percent="100%"></r-progress>

进度条的点dot

默认展示,设置成false可隐藏

html
<r-progress type="drag" percent="30%" dot="false"></r-progress>
 <r-progress type="primary" percent="40%" dot="true"></r-progress>
-<r-progress type="primary" percent="40%"></r-progress>

类型type

  • primary: 默认的进度条,不设置type属性是默认
  • drag: 可拖动,可点击的进度条(拖动需要设置dottrue
html
<r-progress type="drag" percent="30%"></r-progress> <r-progress type="primary" percent="40%"></r-progress>

方法

change

percenttotal属性发生变化时,触发change事件。

属性说明类型
value当前进度string|number
percent当前进度string|number
total总进度string|number

Released under the MIT License.

- +<r-progress type="primary" percent="40%"></r-progress>

类型type

  • primary: 默认的进度条,不设置type属性是默认
  • drag: 可拖动,可点击的进度条(拖动需要设置dottrue
html
<r-progress type="drag" percent="30%"></r-progress> <r-progress type="primary" percent="40%"></r-progress>

方法

change

percenttotal属性发生变化时,触发change事件。

属性说明类型
value当前进度string|number
percent当前进度string|number
total总进度string|number

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/radar/index.html b/cn/src/ranui/radar/index.html index 420bea568..305582f11 100644 --- a/cn/src/ranui/radar/index.html +++ b/cn/src/ranui/radar/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -96,8 +96,8 @@ "abilityName": "暴击伤害", "scoreRate": "50" } -]

Released under the MIT License.

- +]

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/select/index.html b/cn/src/ranui/select/index.html index 032101f15..c26231e89 100644 --- a/cn/src/ranui/select/index.html +++ b/cn/src/ranui/select/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -83,8 +83,8 @@ <r-option value="185">Mike</r-option> <r-option value="186">Tom</r-option> <r-option value="187">Lucy</r-option> - </r-select>

Released under the MIT License.

- + </r-select>

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/skeleton/index.html b/cn/src/ranui/skeleton/index.html index 30e83d20f..c6bcad13c 100644 --- a/cn/src/ranui/skeleton/index.html +++ b/cn/src/ranui/skeleton/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

skeleton 骨架屏

在需要等待加载内容的位置提供一个占位图形组合。

代码演示

骨架长度跟随父级元素的长度

xml
<r-skeleton ></r-skeleton>

Released under the MIT License.

- +
Skip to content

skeleton 骨架屏

在需要等待加载内容的位置提供一个占位图形组合。

代码演示

骨架长度跟随父级元素的长度

xml
<r-skeleton ></r-skeleton>

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/tab/index.html b/cn/src/ranui/tab/index.html index 3839dfc58..b8b2d153f 100644 --- a/cn/src/ranui/tab/index.html +++ b/cn/src/ranui/tab/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -84,8 +84,8 @@ <r-tab label="tab1">11111</r-tab> <r-tab label="tab2">22222</r-tab> <r-tab label="tab3">33333</r-tab> - </r-tabs>

Released under the MIT License.

- + </r-tabs>

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranui/tabs/index.html b/cn/src/ranui/tabs/index.html index 8e5c2ae89..db5980b17 100644 --- a/cn/src/ranui/tabs/index.html +++ b/cn/src/ranui/tabs/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -66,8 +66,8 @@ <r-tab icon="home" iconSize="22">tab1</r-tab> <r-tab icon="message" iconSize="22">tab2</r-tab> <r-tab icon="user" iconSize="22">tab3</r-tab> -</r-tabs>

风格type

风格有 text,clean,

对齐align

事件event

onchange

切换完成时触发。

Released under the MIT License.

- +</r-tabs>

风格type

风格有 text,clean,

对齐align

事件event

onchange

切换完成时触发。

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/binaryTree/index.html b/cn/src/ranuts/binaryTree/index.html index bca35e714..8031e4d66 100644 --- a/cn/src/ranuts/binaryTree/index.html +++ b/cn/src/ranuts/binaryTree/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,14 +37,14 @@ - + -
Skip to content

二叉树的定义

在计算机科学中,二叉树(Binary tree)是每个节点最多只有两个分支(即不存在分支度大于 2 的节点)的树结构。通常分支被称作“左子树”或“右子树”。二叉树的分支具有左右次序,不能随意颠倒[1]。。

二叉树的性质

  • 在二叉树的第 i 层上最多有 2^(i-1)个结点(i>=1)
  • 深度为 h 的二叉树,最多有 2^h-1 个结点,最少有 h 个结点(h>=1)
  • 包含 n 个结点的二叉树的高度至少为(log2n)+1
  • 非空的二叉树,分支度为 0 的总数为 n0,分支度为 2 的总数为 n2,则 n0=n2+1
  • 二叉树的总结点数 n = n1 + n2 + n0
  • 总连线数等于总节点数减一(B = n - 1)
  • 总连线数等于分支度为 2 的节点的两倍加上分支度为 1 的节点(B = n2 _ 2 + n1 _ 1)

二叉树的类型

满二叉树

一棵深度为 k 且有 2k-1 个节点的二叉树称为满二叉树。 除最后一层无任何子节点外,每一层上的所有结点都有两个子结点的二叉树[2]

完全二叉树

一棵深度为 k 的有 n 个结点的二叉树,对树中的结点按从上至下、从左到右的顺序进行编号,如果编号为 i(1≤i≤n)的结点与满二叉树中编号为 i 的结点在二叉树中的位置相同,则这棵二叉树称为完全二叉树。

二叉搜索树

二叉搜索树(BST)又称二叉查找树或二叉排序树。它或者是一棵空树,或者是具有下列性质的二叉树: 若它的左子树不空,则左子树上所有结点的值均小于它的根结点的值; 若它的右子树不空,则右子树上所有结点的值均大于它的根结点的值; 它的左、右子树也分别为二叉排序树。

平衡二叉树

平衡二叉树(AVL)一定是二叉搜索树,且左子树和右子树的高度差的绝对值不超过 1。 平衡二叉树

B 树

B 树属于多叉树又名平衡多路查找树(查找路径不只两个)

B+树

B+树是 B 树的变体,也是一种多路搜索树。

B*树

B* 树是 B+树的变体,在 B+树的非根和非叶子结点再增加指向兄弟的指针;B* 树定义了非叶子结点关键字个数至少为(2/3)M,即块的最低使用率为 2/3(代替 B+树的 1/2)。B 树分配新结点的概率比 B+树要低,空间使用率更高;

红黑树

红黑树是一种平衡二叉查找树的变体,它的左右子树高差有可能大于 1,所以红黑树不是严格意义上的平衡二叉树(AVL),但对它进行平衡的代价较低, 其平均统计性能要强于 AVL 。

遍历

前序遍历

后序遍历

中序遍历

层序遍历

常见算法题

镜像二叉树

重建二叉树

二叉树深度

二叉树节点总数

判断二叉树子结构

输入两棵二叉树 A 和 B,判断 B 是不是 A 的子结构。(ps:约定空树不是任意一个树的子结构)

参考文档

  1. 维基百科二叉树
  2. 百度百科满二叉树

Released under the MIT License.

- +
Skip to content

二叉树的定义

在计算机科学中,二叉树(Binary tree)是每个节点最多只有两个分支(即不存在分支度大于 2 的节点)的树结构。通常分支被称作“左子树”或“右子树”。二叉树的分支具有左右次序,不能随意颠倒[1]。。

二叉树的性质

  • 在二叉树的第 i 层上最多有 2^(i-1)个结点(i>=1)
  • 深度为 h 的二叉树,最多有 2^h-1 个结点,最少有 h 个结点(h>=1)
  • 包含 n 个结点的二叉树的高度至少为(log2n)+1
  • 非空的二叉树,分支度为 0 的总数为 n0,分支度为 2 的总数为 n2,则 n0=n2+1
  • 二叉树的总结点数 n = n1 + n2 + n0
  • 总连线数等于总节点数减一(B = n - 1)
  • 总连线数等于分支度为 2 的节点的两倍加上分支度为 1 的节点(B = n2 _ 2 + n1 _ 1)

二叉树的类型

满二叉树

一棵深度为 k 且有 2k-1 个节点的二叉树称为满二叉树。 除最后一层无任何子节点外,每一层上的所有结点都有两个子结点的二叉树[2]

完全二叉树

一棵深度为 k 的有 n 个结点的二叉树,对树中的结点按从上至下、从左到右的顺序进行编号,如果编号为 i(1≤i≤n)的结点与满二叉树中编号为 i 的结点在二叉树中的位置相同,则这棵二叉树称为完全二叉树。

二叉搜索树

二叉搜索树(BST)又称二叉查找树或二叉排序树。它或者是一棵空树,或者是具有下列性质的二叉树: 若它的左子树不空,则左子树上所有结点的值均小于它的根结点的值; 若它的右子树不空,则右子树上所有结点的值均大于它的根结点的值; 它的左、右子树也分别为二叉排序树。

平衡二叉树

平衡二叉树(AVL)一定是二叉搜索树,且左子树和右子树的高度差的绝对值不超过 1。 平衡二叉树

B 树

B 树属于多叉树又名平衡多路查找树(查找路径不只两个)

B+树

B+树是 B 树的变体,也是一种多路搜索树。

B*树

B* 树是 B+树的变体,在 B+树的非根和非叶子结点再增加指向兄弟的指针;B* 树定义了非叶子结点关键字个数至少为(2/3)M,即块的最低使用率为 2/3(代替 B+树的 1/2)。B 树分配新结点的概率比 B+树要低,空间使用率更高;

红黑树

红黑树是一种平衡二叉查找树的变体,它的左右子树高差有可能大于 1,所以红黑树不是严格意义上的平衡二叉树(AVL),但对它进行平衡的代价较低, 其平均统计性能要强于 AVL 。

遍历

前序遍历

后序遍历

中序遍历

层序遍历

常见算法题

镜像二叉树

重建二叉树

二叉树深度

二叉树节点总数

判断二叉树子结构

输入两棵二叉树 A 和 B,判断 B 是不是 A 的子结构。(ps:约定空树不是任意一个树的子结构)

参考文档

  1. 维基百科二叉树
  2. 百度百科满二叉树

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/bundler/index.html b/cn/src/ranuts/bundler/index.html index 05c1c5635..3c849f1fe 100644 --- a/cn/src/ranuts/bundler/index.html +++ b/cn/src/ranuts/bundler/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -52,8 +52,8 @@ generate: () => bundle.render() }; }); -}

架构图

Released under the MIT License.

- +}

架构图

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/file/appendFile.html b/cn/src/ranuts/file/appendFile.html index 2fb4fd8ca..aefa46294 100644 --- a/cn/src/ranuts/file/appendFile.html +++ b/cn/src/ranuts/file/appendFile.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

AppendFile

追加一些数据到文件内

API

Return

  • Promise
参数说明类型描述
success是否追加成功booleantrue 追加成功 false 追加失败
data追加失败的原因,添加成功后的文件内容any

Options

参数说明类型默认值
path文件路径,需要追加的文件stringundefined
content需要追加的内容string

Example

Released under the MIT License.

- +
Skip to content

AppendFile

追加一些数据到文件内

API

Return

  • Promise
参数说明类型描述
success是否追加成功booleantrue 追加成功 false 追加失败
data追加失败的原因,添加成功后的文件内容any

Options

参数说明类型默认值
path文件路径,需要追加的文件stringundefined
content需要追加的内容string

Example

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/file/fileInfo.html b/cn/src/ranuts/file/fileInfo.html index 480241b31..a274b1382 100644 --- a/cn/src/ranuts/file/fileInfo.html +++ b/cn/src/ranuts/file/fileInfo.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

QueryFileInfo

查询一个文件的详细信息,一般用于区分文件还是目录,可以通过返回的 data 来判断(data.isDirectory())

API

Return

  • Promise
参数说明类型描述
success是否检查成功booleantrue 成功 false 失败
data文件的信息,或者错误的原因Stats

Options

参数说明类型默认值
path文件路径,需要检查的文件路径stringundefined

Example

Released under the MIT License.

- +
Skip to content

QueryFileInfo

查询一个文件的详细信息,一般用于区分文件还是目录,可以通过返回的 data 来判断(data.isDirectory())

API

Return

  • Promise
参数说明类型描述
success是否检查成功booleantrue 成功 false 失败
data文件的信息,或者错误的原因Stats

Options

参数说明类型默认值
path文件路径,需要检查的文件路径stringundefined

Example

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/file/readDir.html b/cn/src/ranuts/file/readDir.html index f2248c0f7..17409b05b 100644 --- a/cn/src/ranuts/file/readDir.html +++ b/cn/src/ranuts/file/readDir.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

ReadDir

读一个目录下的所有文件

API

Return

  • Promise
参数说明类型描述
result目录下所有文件的数组array传入函数的参数

Options

参数说明类型默认值
optionsobject传入函数的参数
dirPath文件的路径Stats

Example

Released under the MIT License.

- +
Skip to content

ReadDir

读一个目录下的所有文件

API

Return

  • Promise
参数说明类型描述
result目录下所有文件的数组array传入函数的参数

Options

参数说明类型默认值
optionsobject传入函数的参数
dirPath文件的路径Stats

Example

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/file/readFile.html b/cn/src/ranuts/file/readFile.html index d33a799e4..f64c10bd7 100644 --- a/cn/src/ranuts/file/readFile.html +++ b/cn/src/ranuts/file/readFile.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

ReadFile

观察一个文件是否改变

API

Return

  • Promise
参数说明类型描述
data文件是否被改变booleantrue 文件改变 false 文件没变

Options

参数说明类型默认值
path文件路径,需要监听的文件stringundefined
interval监听文件改变的时间,单位毫秒。number20

Example

Released under the MIT License.

- +
Skip to content

ReadFile

观察一个文件是否改变

API

Return

  • Promise
参数说明类型描述
data文件是否被改变booleantrue 文件改变 false 文件没变

Options

参数说明类型默认值
path文件路径,需要监听的文件stringundefined
interval监听文件改变的时间,单位毫秒。number20

Example

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/file/watchFile.html b/cn/src/ranuts/file/watchFile.html index 5b09b16dd..591f2407a 100644 --- a/cn/src/ranuts/file/watchFile.html +++ b/cn/src/ranuts/file/watchFile.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

WatchFile

观察一个文件是否改变

API

Return

  • Promise
参数说明类型描述
status文件是否被改变booleantrue 文件改变 false 文件没变

Options

参数说明类型默认值
path文件路径,需要监听的文件stringundefined
interval监听文件改变的时间,单位毫秒。number20

Released under the MIT License.

- +
Skip to content

WatchFile

观察一个文件是否改变

API

Return

  • Promise
参数说明类型描述
status文件是否被改变booleantrue 文件改变 false 文件没变

Options

参数说明类型默认值
path文件路径,需要监听的文件stringundefined
interval监听文件改变的时间,单位毫秒。number20

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/file/writeFile.html b/cn/src/ranuts/file/writeFile.html index 4ff9cb4b9..c6823e73d 100644 --- a/cn/src/ranuts/file/writeFile.html +++ b/cn/src/ranuts/file/writeFile.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

WriteFile

将内容写入文件

API

Return

  • Promise
参数说明类型描述
success是否写入成功booleantrue 成功 false 失败
data写入失败的原因,添加成功后的文件内容和文件路径any

Options

参数说明类型默认值
path文件路径,需要追加的文件stringundefined
content需要追加的内容string

Released under the MIT License.

- +
Skip to content

WriteFile

将内容写入文件

API

Return

  • Promise
参数说明类型描述
success是否写入成功booleantrue 成功 false 失败
data写入失败的原因,添加成功后的文件内容和文件路径any

Options

参数说明类型默认值
path文件路径,需要追加的文件stringundefined
content需要追加的内容string

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/index.html b/cn/src/ranuts/index.html index 3599ce484..eb1e4bcd0 100644 --- a/cn/src/ranuts/index.html +++ b/cn/src/ranuts/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

ranuts overview

方法列表

方法说明详细内容
writeFile写入文件writeFile
readFile读取文件readFile
readDir读取目录,获取目录下所有文件的名字readDir
watchFile观察文件的内容是否发生变化watchFile
queryFileInfo查询文件信息queryFileInfo
filterObj过滤对象filterObj
EventEmitter发布订阅类EventEmitter
str2Xml字符串转成xmlstr2Xml
getMime根据文件格式后缀获取 mime typegetMime
getCookie获取指定 cookie 的值writeFile
formatJson格式化 JSONformatJson

TOTP

2FA Verification
Generate
code:
expires:

Released under the MIT License.

- +
Skip to content

ranuts overview

方法列表

方法说明详细内容
writeFile写入文件writeFile
readFile读取文件readFile
readDir读取目录,获取目录下所有文件的名字readDir
watchFile观察文件的内容是否发生变化watchFile
queryFileInfo查询文件信息queryFileInfo
filterObj过滤对象filterObj
EventEmitter发布订阅类EventEmitter
str2Xml字符串转成xmlstr2Xml
getMime根据文件格式后缀获取 mime typegetMime
getCookie获取指定 cookie 的值writeFile
formatJson格式化 JSONformatJson

TOTP

2FA Verification
Generate
code:
expires:

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/mimeType/mimeType.html b/cn/src/ranuts/mimeType/mimeType.html index 4c86b7ee7..826fd729b 100644 --- a/cn/src/ranuts/mimeType/mimeType.html +++ b/cn/src/ranuts/mimeType/mimeType.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -49,8 +49,8 @@ // 'application/vnd.openxmlformats-officedocument.presentationml.presentation const res = getMime('.txt'); console.log(result); -// text/plain

Released under the MIT License.

- +// text/plain

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/mode/subscribe.html b/cn/src/ranuts/mode/subscribe.html index c4da52b66..32427dd91 100644 --- a/cn/src/ranuts/mode/subscribe.html +++ b/cn/src/ranuts/mode/subscribe.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -73,8 +73,8 @@ // 订阅一次,触发一次自动取消 subscribe.once('other', () => { console.log(5); -});

Released under the MIT License.

- +});

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/utils/convertImageToBase64.html b/cn/src/ranuts/utils/convertImageToBase64.html index d7b3c318f..c9d19d867 100644 --- a/cn/src/ranuts/utils/convertImageToBase64.html +++ b/cn/src/ranuts/utils/convertImageToBase64.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -46,8 +46,8 @@ convertImageToBase64(file).then((res) => { console.log(result); -});

Released under the MIT License.

- +});

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/utils/filterObj.html b/cn/src/ranuts/utils/filterObj.html index 4ab500483..4cb5097ef 100644 --- a/cn/src/ranuts/utils/filterObj.html +++ b/cn/src/ranuts/utils/filterObj.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -54,8 +54,8 @@ console.log(result); -// { age:10 }

Released under the MIT License.

- +// { age:10 }

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/utils/formatJson.html b/cn/src/ranuts/utils/formatJson.html index 4d7f5d9e8..ce182d440 100644 --- a/cn/src/ranuts/utils/formatJson.html +++ b/cn/src/ranuts/utils/formatJson.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -51,8 +51,8 @@ const result = formatJson(json); -console.log(result);

Released under the MIT License.

- +console.log(result);

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/utils/getCookie.html b/cn/src/ranuts/utils/getCookie.html index 844de7e5a..5057cf896 100644 --- a/cn/src/ranuts/utils/getCookie.html +++ b/cn/src/ranuts/utils/getCookie.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -48,8 +48,8 @@ console.log(result); -// ''

Released under the MIT License.

- +// ''

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/utils/ocr.html b/cn/src/ranuts/utils/ocr.html index a8035dd66..580588d74 100644 --- a/cn/src/ranuts/utils/ocr.html +++ b/cn/src/ranuts/utils/ocr.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -56,8 +56,8 @@ // And when thou lovest thy pale orb to shroud // Behind the gather’d blackness lost on high; // And when thou dartest from the wind-rent cloud -// Thy placid lightning o’er the awaken’d sky.

Lang Code

Lang CodeLanguage
afrAfrikaans
amhAmharic
araArabic
asmAssamese
azeAzerbaijani
aze_cyrlAzerbaijani - Cyrillic
belBelarusian
benBengali
bodTibetan
bosBosnian
bulBulgarian
catCatalan; Valencian
cebCebuano
cesCzech
chi_simChinese - Simplified
chi_traChinese - Traditional
chrCherokee
cymWelsh
danDanish
deuGerman
dzoDzongkha
ellGreek, Modern (1453-)
engEnglish
enmEnglish, Middle (1100-1500)
epoEsperanto
estEstonian
eusBasque
fasPersian
finFinnish
fraFrench
frkGerman Fraktur
frmFrench, Middle (ca. 1400-1600)
gleIrish
glgGalician
grcGreek, Ancient (-1453)
gujGujarati
hatHaitian; Haitian Creole
hebHebrew
hinHindi
hrvCroatian
hunHungarian
ikuInuktitut
indIndonesian
islIcelandic
itaItalian
ita_oldItalian - Old
javJavanese
jpnJapanese
kanKannada
katGeorgian
kat_oldGeorgian - Old
kazKazakh
khmCentral Khmer
kirKirghiz; Kyrgyz
korKorean
kurKurdish
laoLao
latLatin
lavLatvian
litLithuanian
malMalayalam
marMarathi
mkdMacedonian
mltMaltese
msaMalay
myaBurmese
nepNepali
nldDutch; Flemish
norNorwegian
oriOriya
panPanjabi; Punjabi
polPolish
porPortuguese
pusPushto; Pashto
ronRomanian; Moldavian; Moldovan
rusRussian
sanSanskrit
sinSinhala; Sinhalese
slkSlovak
slvSlovenian
spaSpanish; Castilian
spa_oldSpanish; Castilian - Old
sqiAlbanian
srpSerbian
srp_latnSerbian - Latin
swaSwahili
sweSwedish
syrSyriac
tamTamil
telTelugu
tgkTajik
tglTagalog
thaThai
tirTigrinya
turTurkish
uigUighur; Uyghur
ukrUkrainian
urdUrdu
uzbUzbek
uzb_cyrlUzbek - Cyrillic
vieVietnamese
yidYiddish

Released under the MIT License.

- +// Thy placid lightning o’er the awaken’d sky.

Lang Code

Lang CodeLanguage
afrAfrikaans
amhAmharic
araArabic
asmAssamese
azeAzerbaijani
aze_cyrlAzerbaijani - Cyrillic
belBelarusian
benBengali
bodTibetan
bosBosnian
bulBulgarian
catCatalan; Valencian
cebCebuano
cesCzech
chi_simChinese - Simplified
chi_traChinese - Traditional
chrCherokee
cymWelsh
danDanish
deuGerman
dzoDzongkha
ellGreek, Modern (1453-)
engEnglish
enmEnglish, Middle (1100-1500)
epoEsperanto
estEstonian
eusBasque
fasPersian
finFinnish
fraFrench
frkGerman Fraktur
frmFrench, Middle (ca. 1400-1600)
gleIrish
glgGalician
grcGreek, Ancient (-1453)
gujGujarati
hatHaitian; Haitian Creole
hebHebrew
hinHindi
hrvCroatian
hunHungarian
ikuInuktitut
indIndonesian
islIcelandic
itaItalian
ita_oldItalian - Old
javJavanese
jpnJapanese
kanKannada
katGeorgian
kat_oldGeorgian - Old
kazKazakh
khmCentral Khmer
kirKirghiz; Kyrgyz
korKorean
kurKurdish
laoLao
latLatin
lavLatvian
litLithuanian
malMalayalam
marMarathi
mkdMacedonian
mltMaltese
msaMalay
myaBurmese
nepNepali
nldDutch; Flemish
norNorwegian
oriOriya
panPanjabi; Punjabi
polPolish
porPortuguese
pusPushto; Pashto
ronRomanian; Moldavian; Moldovan
rusRussian
sanSanskrit
sinSinhala; Sinhalese
slkSlovak
slvSlovenian
spaSpanish; Castilian
spa_oldSpanish; Castilian - Old
sqiAlbanian
srpSerbian
srp_latnSerbian - Latin
swaSwahili
sweSwedish
syrSyriac
tamTamil
telTelugu
tgkTajik
tglTagalog
thaThai
tirTigrinya
turTurkish
uigUighur; Uyghur
ukrUkrainian
urdUrdu
uzbUzbek
uzb_cyrlUzbek - Cyrillic
vieVietnamese
yidYiddish

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/utils/str2xml.html b/cn/src/ranuts/utils/str2xml.html index cf5b27adb..055507e58 100644 --- a/cn/src/ranuts/utils/str2xml.html +++ b/cn/src/ranuts/utils/str2xml.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -49,8 +49,8 @@ const icon = str2Xml(svg, 'image/svg+xml'); -document.body.appendChild(icon);

Released under the MIT License.

- +document.body.appendChild(icon);

Released under the MIT License.

+ \ No newline at end of file diff --git a/cn/src/ranuts/utils/task.html b/cn/src/ranuts/utils/task.html index bdafa970b..e18a63483 100644 --- a/cn/src/ranuts/utils/task.html +++ b/cn/src/ranuts/utils/task.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -48,8 +48,8 @@ const time = taskEnd(taskId); -console.log('task 执行花费的时间', time);

二.new Date().getTime()

new Date().getTime() 返回一个数值,表示从 1970 年 1 月 1 日 0 时 0 分 0 秒(UTC,即协调世界时)距离该日期对象所代表时间的毫秒数。用来计算 JS 执行时间会有两个问题:

  1. 某些情况下,毫秒级精度可能不够。
  2. new Date() 解析的时间在不同浏览器,或者不同设备上可能并不一致。MDN 说明

    由于浏览器之间的差异与不一致性,强烈不推荐使用 Date 构造函数来解析日期字符串 (或使用与其等价的 Date.parse)。对 RFC 2822 格式的日期仅有约定俗成的支持。对 ISO 8601 格式的支持中,仅有日期的串 (例如 "1970-01-01") 会被处理为 UTC 而不是本地时间,与其他格式的串的处理不同。

三.console.time(), console.timeEnd()

启动一个计时器来跟踪某一个操作的占用时长。每一个计时器必须拥有唯一的名字,页面中最多能同时运行 10,000 个计时器。当以此计时器名字为参数调用 console.timeEnd() 时,浏览器将以毫秒为单位,输出对应计时器所经过的时间。比起new Date().getTime(),统计时间更加精确,可以统计到 0.001 毫秒(比如:0.134ms)

四.performance.now()

performance.now()返回的时间精度最高可达微秒级,且不会受到系统时间的影响(系统时钟可能会被手动调整或被 NTP 等软件篡改)。另外,performance.timing.navigationStart + performance.now() 约等于 Date.now()。因此对于统计 JS 执行耗时方面,更推荐使用performance.now()

注意:为了提供对定时攻击和指纹的保护,performance.now() 的精度可能会根据浏览器的设置而被舍弃。 在 Firefox 中,privacy.reduceTimerPrecision 偏好是默认启用的,默认值为 1ms。可以启用 privacy.resistFingerprinting 这将精度改为 100ms 或privacy.resistFingerprinting.reduceTimerPrecision.microseconds 的值,以较大者为准。

Released under the MIT License.

- +console.log('task 执行花费的时间', time);

二.new Date().getTime()

new Date().getTime() 返回一个数值,表示从 1970 年 1 月 1 日 0 时 0 分 0 秒(UTC,即协调世界时)距离该日期对象所代表时间的毫秒数。用来计算 JS 执行时间会有两个问题:

  1. 某些情况下,毫秒级精度可能不够。
  2. new Date() 解析的时间在不同浏览器,或者不同设备上可能并不一致。MDN 说明

    由于浏览器之间的差异与不一致性,强烈不推荐使用 Date 构造函数来解析日期字符串 (或使用与其等价的 Date.parse)。对 RFC 2822 格式的日期仅有约定俗成的支持。对 ISO 8601 格式的支持中,仅有日期的串 (例如 "1970-01-01") 会被处理为 UTC 而不是本地时间,与其他格式的串的处理不同。

三.console.time(), console.timeEnd()

启动一个计时器来跟踪某一个操作的占用时长。每一个计时器必须拥有唯一的名字,页面中最多能同时运行 10,000 个计时器。当以此计时器名字为参数调用 console.timeEnd() 时,浏览器将以毫秒为单位,输出对应计时器所经过的时间。比起new Date().getTime(),统计时间更加精确,可以统计到 0.001 毫秒(比如:0.134ms)

四.performance.now()

performance.now()返回的时间精度最高可达微秒级,且不会受到系统时间的影响(系统时钟可能会被手动调整或被 NTP 等软件篡改)。另外,performance.timing.navigationStart + performance.now() 约等于 Date.now()。因此对于统计 JS 执行耗时方面,更推荐使用performance.now()

注意:为了提供对定时攻击和指纹的保护,performance.now() 的精度可能会根据浏览器的设置而被舍弃。 在 Firefox 中,privacy.reduceTimerPrecision 偏好是默认启用的,默认值为 1ms。可以启用 privacy.resistFingerprinting 这将精度改为 100ms 或privacy.resistFingerprinting.reduceTimerPrecision.microseconds 的值,以较大者为准。

Released under the MIT License.

+ \ No newline at end of file diff --git "a/cn/src/types/TS\347\261\273\345\236\213.html" "b/cn/src/types/TS\347\261\273\345\236\213.html" index 928c79c1e..42e50582e 100644 --- "a/cn/src/types/TS\347\261\273\345\236\213.html" +++ "b/cn/src/types/TS\347\261\273\345\236\213.html" @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -89,8 +89,8 @@ age?: number; } -type tuple = [string, number?];

Last updated:

Released under the MIT License.

- +type tuple = [string, number?];

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git "a/cn/src/types/\346\250\241\345\274\217\345\214\271\351\205\215.html" "b/cn/src/types/\346\250\241\345\274\217\345\214\271\351\205\215.html" index 7f8617fc9..762b59d72 100644 --- "a/cn/src/types/\346\250\241\345\274\217\345\214\271\351\205\215.html" +++ "b/cn/src/types/\346\250\241\345\274\217\345\214\271\351\205\215.html" @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -52,8 +52,8 @@ new (name: string): Person; }

这里的 PersonConstructor 返回的是 Person 类型的实例对象,这个也可以通过模式匹配取出来。

ts
type GetInstanceType<C extends new (...args: unknown[]) => unknown> = C extends new (...args: unknown[]) => infer T
   ? T
-  : unknown;

Last updated:

Released under the MIT License.

- + : unknown;

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git "a/cn/src/types/\347\261\273\345\236\213\350\277\220\347\256\227.html" "b/cn/src/types/\347\261\273\345\236\213\350\277\220\347\256\227.html" index abf57559d..f339effc2 100644 --- "a/cn/src/types/\347\261\273\345\236\213\350\277\220\347\256\227.html" +++ "b/cn/src/types/\347\261\273\345\236\213\350\277\220\347\256\227.html" @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -68,8 +68,8 @@ // type res = { // aaa:[1,1,1] // bbb:[2,2,2] -// }

这里的 & string 可能大家会迷惑,解释一下:

因为索引类型(对象、class 等)可以用 string、number 和 symbol 作为 key,这里 keyof T 取出的索引就是 string | number | symbol 的联合类型,和 string 取交叉部分就只剩下 string 了。就像前面所说,交叉类型会把同一类型做合并,不同类型舍弃。

因为 js 处理对象比较多,所以索引类型的映射比较重要。

Last updated:

Released under the MIT License.

- +// }

这里的 & string 可能大家会迷惑,解释一下:

因为索引类型(对象、class 等)可以用 string、number 和 symbol 作为 key,这里 keyof T 取出的索引就是 string | number | symbol 的联合类型,和 string 取交叉部分就只剩下 string 了。就像前面所说,交叉类型会把同一类型做合并,不同类型舍弃。

因为 js 处理对象比较多,所以索引类型的映射比较重要。

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git "a/cn/src/types/\351\253\230\347\272\247\347\261\273\345\236\213.html" "b/cn/src/types/\351\253\230\347\272\247\347\261\273\345\236\213.html" index 385e0e4ce..65ad09b6e 100644 --- "a/cn/src/types/\351\253\230\347\272\247\347\261\273\345\236\213.html" +++ "b/cn/src/types/\351\253\230\347\272\247\347\261\273\345\236\213.html" @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

TypeScript 内置的高级类型

Parameters

Parameters 用于提取函数类型的参数类型。

ReturnType

ReturnType 用于提取函数类型的返回值类型。

ConstructorParameters

构造器类型和函数类型的区别就是可以被 new。

Parameters 用于提取函数参数的类型,而 ConstructorParameters 用于提取构造器参数的类型。

InstanceType

提取了构造器参数的类型,自然也可以提取构造器返回值的类型,就是 InstanceType。

ThisParameterType

OmitThisParameter

Partial

Required

Readonly

Pick

Record

Exclude

Extract

Omit

Awaited

NonNullable

Uppercase

Lowercase

Capitalize

Uncapitalize

总结

比如用模式匹配可以实现:Parameters、ReturnType、ConstructorParameters、InstanceType、ThisParameterType。

用模式匹配 + 重新构造可以实现:OmitThisParameter

用重新构造可以实现:Partial、Required、Readonly、Pick、Record

用模式匹配 + 递归可以实现: Awaited

用联合类型在分布式条件类型的特性可以实现: Exclude

此外还有 NonNullable 和四个编译器内部实现的类型:Uppercase、Lowercase、Capitalize、Uncapitalize。

Last updated:

Released under the MIT License.

- +
Skip to content

TypeScript 内置的高级类型

Parameters

Parameters 用于提取函数类型的参数类型。

ReturnType

ReturnType 用于提取函数类型的返回值类型。

ConstructorParameters

构造器类型和函数类型的区别就是可以被 new。

Parameters 用于提取函数参数的类型,而 ConstructorParameters 用于提取构造器参数的类型。

InstanceType

提取了构造器参数的类型,自然也可以提取构造器返回值的类型,就是 InstanceType。

ThisParameterType

OmitThisParameter

Partial

Required

Readonly

Pick

Record

Exclude

Extract

Omit

Awaited

NonNullable

Uppercase

Lowercase

Capitalize

Uncapitalize

总结

比如用模式匹配可以实现:Parameters、ReturnType、ConstructorParameters、InstanceType、ThisParameterType。

用模式匹配 + 重新构造可以实现:OmitThisParameter

用重新构造可以实现:Partial、Required、Readonly、Pick、Record

用模式匹配 + 递归可以实现: Awaited

用联合类型在分布式条件类型的特性可以实现: Exclude

此外还有 NonNullable 和四个编译器内部实现的类型:Uppercase、Lowercase、Capitalize、Uncapitalize。

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git a/hashmap.json b/hashmap.json index b85ff5f54..fcf75f7cb 100644 --- a/hashmap.json +++ b/hashmap.json @@ -1 +1 @@ -{"cn_index.md":"DBuoKLX0","cn_src_article_astparse_tokenizer.md":"fifNjLwi","cn_src_article_babel.md":"CaqzHljn","cn_src_article_bundle.md":"DvOQbHwY","cn_src_article_designmode.md":"ht3y5UhU","cn_src_article_docpreview.md":"DeliAFz1","cn_src_article_functionalprogramming.md":"CBLq1EiU","cn_src_article_imagemin.md":"CIvMu-pO","cn_src_article_javascript_domload.md":"CofzgV5H","cn_src_article_sort_bubble_index.md":"BMi-t-6w","cn_src_article_sort_bucket_index.md":"lmPlZNVD","cn_src_article_sort_count_index.md":"bjLrOBPd","cn_src_article_sort_heap_index.md":"CT_uZ0AG","cn_src_article_sort_index.md":"Bgve4TGK","cn_src_article_sort_insert_index.md":"DyiV5HPJ","cn_src_article_sort_merge_index.md":"DNFoib9i","cn_src_article_sort_quick_index.md":"BEu_JOn1","cn_src_article_sort_radix_index.md":"DnU-u4D7","cn_src_article_sort_select_index.md":"CkHR0au5","cn_src_article_sort_shell_index.md":"DLjWkzsn","cn_src_article_typescript_calculate.md":"BrhBa9BE","cn_src_article_typescript_index.md":"CHVcwHl4","cn_src_article_typescript_pattern.md":"BLHldN0n","cn_src_article_typescript_reconstruction.md":"DJ9gZX-Y","cn_src_article_typescript_recursion.md":"DeW8HIDH","cn_src_article_typescript_uniontype.md":"D7LW3SoG","cn_src_article_video.md":"BsBGm6Pq","cn_src_article_visual.md":"BsZNGi-k","cn_src_note_centos.md":"CbGizVxk","cn_src_note_docker.md":"C8ga9dP1","cn_src_note_libreoffice2wasm.md":"D2xeX9P9","cn_src_note_ubuntu.md":"BJJgQ1Ct","cn_src_ranui_button_index.md":"12XVTc4M","cn_src_ranui_checkbox_index.md":"DDrq4ZE6","cn_src_ranui_icon_index.md":"C8Joalst","cn_src_ranui_image_index.md":"DO1YIYRf","cn_src_ranui_index.md":"7MnYzmyC","cn_src_ranui_input_index.md":"BkI4N5qK","cn_src_ranui_loading_index.md":"DXZG-8vN","cn_src_ranui_math_index.md":"CbuzM75G","cn_src_ranui_message_index.md":"8eVMbJN5","cn_src_ranui_modal_index.md":"DsB0cf0q","cn_src_ranui_player_index.md":"HFCY959w","cn_src_ranui_popover_index.md":"CrixuNrz","cn_src_ranui_preview_index.md":"P57SjbBj","cn_src_ranui_progress_index.md":"C4wZ-wFu","cn_src_ranui_radar_index.md":"DmjI63Gt","cn_src_ranui_select_index.md":"BErf4YsQ","cn_src_ranui_skeleton_index.md":"DdC6olmK","cn_src_ranui_tab_index.md":"CVOm96LC","cn_src_ranui_tabs_index.md":"1aqMePxF","cn_src_ranuts_binarytree_index.md":"ko44XfcW","cn_src_ranuts_bundler_index.md":"D_ftAOSG","cn_src_ranuts_file_appendfile.md":"CtR2NfUK","cn_src_ranuts_file_fileinfo.md":"BOv8vrAv","cn_src_ranuts_file_readdir.md":"DNVwaFG5","cn_src_ranuts_file_readfile.md":"D1dihUhP","cn_src_ranuts_file_watchfile.md":"CKB-dDn6","cn_src_ranuts_file_writefile.md":"DX-HWmZs","cn_src_ranuts_index.md":"pPHvoy25","cn_src_ranuts_mimetype_mimetype.md":"CCxE8Y5Q","cn_src_ranuts_mode_subscribe.md":"BPC8IsHd","cn_src_ranuts_utils_convertimagetobase64.md":"L_KuuFb0","cn_src_ranuts_utils_filterobj.md":"RUrQuB-I","cn_src_ranuts_utils_formatjson.md":"DC5RDora","cn_src_ranuts_utils_getcookie.md":"OZ5LyZvi","cn_src_ranuts_utils_ocr.md":"BVb2T5rQ","cn_src_ranuts_utils_str2xml.md":"CtAVLpga","cn_src_ranuts_utils_task.md":"Dgr2bcgV","cn_src_types_ts类型.md":"CWyGfA_p","cn_src_types_模式匹配.md":"Bc22d1w4","cn_src_types_类型运算.md":"BMZHsZTS","cn_src_types_高级类型.md":"C2EkbCmJ","index.md":"CgG_GtZv","src_article_astparse_tokenizer.md":"C4QMCy48","src_article_babel.md":"BcNuJ1LQ","src_article_bundle.md":"DZGRRaw8","src_article_designmode.md":"DVOb8Fuj","src_article_functionalprogramming.md":"DiKATL--","src_article_imagemin.md":"BUcXrKer","src_article_javascript_domload.md":"C6qPDJam","src_article_sort_bubble_index.md":"DsiOo06S","src_article_sort_bucket_index.md":"ZfhUbkFZ","src_article_sort_count_index.md":"BFT1IsSo","src_article_sort_heap_index.md":"BwsCoEDM","src_article_sort_index.md":"DpVPeINX","src_article_sort_insert_index.md":"Bv2-9O3S","src_article_sort_merge_index.md":"C0x8sv1w","src_article_sort_quick_index.md":"M3hZ_ic7","src_article_sort_radix_index.md":"mikZKipj","src_article_sort_select_index.md":"h9RCL_1D","src_article_sort_shell_index.md":"mb62UxpQ","src_article_typescript_calculate.md":"BBrSJykC","src_article_typescript_index.md":"DwScdmSF","src_article_typescript_pattern.md":"C85RnjQq","src_article_typescript_reconstruction.md":"D7vCk3k6","src_article_typescript_recursion.md":"DcYohhN4","src_article_typescript_uniontype.md":"DLhAxtq8","src_ranui_button_index.md":"Ctjoisvd","src_ranui_checkbox_index.md":"DZCOjcke","src_ranui_icon_index.md":"DsA9f7NJ","src_ranui_image_index.md":"DFVz4CUQ","src_ranui_index.md":"DpegwwWE","src_ranui_input_index.md":"CeyO-5oi","src_ranui_loading_index.md":"Do3eVfRU","src_ranui_math_index.md":"B-FtK30k","src_ranui_message_index.md":"ydgBavCZ","src_ranui_modal_index.md":"QXH3NLdT","src_ranui_player_index.md":"DP2f3_CY","src_ranui_popover_index.md":"Bf9XaTFQ","src_ranui_preview_index.md":"BHd7KxZT","src_ranui_progress_index.md":"CANtKpM_","src_ranui_radar_index.md":"CcKS4hpA","src_ranui_select_index.md":"n79mfmVf","src_ranui_skeleton_index.md":"Brp_dtir","src_ranui_tab_index.md":"6OqNOELf","src_ranui_tabs_index.md":"BIpNb4vr","src_ranuts_binarytree_index.md":"CCmdOl3F","src_ranuts_bundler_index.md":"mnKBYV8g","src_ranuts_file_appendfile.md":"D932HMN4","src_ranuts_file_fileinfo.md":"B3-PUZm0","src_ranuts_file_readdir.md":"HSsQqOjC","src_ranuts_file_readfile.md":"zLyxaea7","src_ranuts_file_watchfile.md":"C6QSbB7C","src_ranuts_file_writefile.md":"AwFJpmSz","src_ranuts_index.md":"BxrdPLgS","src_ranuts_mimetype_mimetype.md":"Ie06XqVB","src_ranuts_mode_subscribe.md":"B3N1C4oA","src_ranuts_utils_convertimagetobase64.md":"CgDGIUsS","src_ranuts_utils_filterobj.md":"Dn4oR--y","src_ranuts_utils_formatjson.md":"aozF1R3k","src_ranuts_utils_getcookie.md":"-ZpjU0cd","src_ranuts_utils_ocr.md":"gK2Ihzud","src_ranuts_utils_str2xml.md":"Dd46b24j","src_ranuts_utils_task.md":"d4vnLy6C","src_types_ts类型.md":"q_ClzjzK","src_types_模式匹配.md":"CHNYs6NO","src_types_类型运算.md":"DI_Hlf12","src_types_高级类型.md":"BfdzeJGK"} +{"cn_index.md":"-8ngwy_i","cn_src_article_astparse_tokenizer.md":"4wYw3ic3","cn_src_article_babel.md":"PvGMHAWM","cn_src_article_bundle.md":"CQqX6KsE","cn_src_article_designmode.md":"DlwQ1o0o","cn_src_article_docpreview.md":"Dgo5TWxU","cn_src_article_functionalprogramming.md":"DAKK45h5","cn_src_article_imagemin.md":"DVJvJILr","cn_src_article_javascript_domload.md":"Cjc9hOHo","cn_src_article_sort_bubble_index.md":"BTREgeo6","cn_src_article_sort_bucket_index.md":"BBjzg8PH","cn_src_article_sort_count_index.md":"BnLbi7pA","cn_src_article_sort_heap_index.md":"BDHsjcqp","cn_src_article_sort_index.md":"CfDxRvv2","cn_src_article_sort_insert_index.md":"CWB9NN2r","cn_src_article_sort_merge_index.md":"CdCiiEzt","cn_src_article_sort_quick_index.md":"CzO4Oomr","cn_src_article_sort_radix_index.md":"C33KYACF","cn_src_article_sort_select_index.md":"Dg9QrcP5","cn_src_article_sort_shell_index.md":"DWSsaZXm","cn_src_article_systemdesign.md":"CL_WM1Zy","cn_src_article_typescript_calculate.md":"CCtF2BN5","cn_src_article_typescript_index.md":"CoyT_emr","cn_src_article_typescript_pattern.md":"Cekzq9t7","cn_src_article_typescript_reconstruction.md":"eQW6hKH-","cn_src_article_typescript_recursion.md":"BLpcY1tW","cn_src_article_typescript_uniontype.md":"DrGww32o","cn_src_article_video.md":"BnS7BWvN","cn_src_article_visual.md":"tnhp0Xqs","cn_src_note_centos.md":"D0i6PxrH","cn_src_note_docker.md":"CFz9ipKs","cn_src_note_libreoffice2wasm.md":"W96C5_98","cn_src_note_ubuntu.md":"BvKNJYgl","cn_src_ranui_button_index.md":"BG4PNyqv","cn_src_ranui_checkbox_index.md":"fJgM4YS5","cn_src_ranui_icon_index.md":"C2sGRB8-","cn_src_ranui_image_index.md":"DRJD-95R","cn_src_ranui_index.md":"ws7DkRqw","cn_src_ranui_input_index.md":"B_1B0kId","cn_src_ranui_loading_index.md":"CyfyGH-8","cn_src_ranui_math_index.md":"BGUDNL8W","cn_src_ranui_message_index.md":"DLxMrXZp","cn_src_ranui_modal_index.md":"CUVT-ut7","cn_src_ranui_player_index.md":"DE3v144q","cn_src_ranui_popover_index.md":"70mC-Rqv","cn_src_ranui_preview_index.md":"CxTR4mUp","cn_src_ranui_progress_index.md":"CmfZXYGe","cn_src_ranui_radar_index.md":"BnFj7a-D","cn_src_ranui_select_index.md":"DiOGlFSl","cn_src_ranui_skeleton_index.md":"Dsrc0lLs","cn_src_ranui_tab_index.md":"BwQYum8a","cn_src_ranui_tabs_index.md":"C99PdVnz","cn_src_ranuts_binarytree_index.md":"DF2AU0eV","cn_src_ranuts_bundler_index.md":"BP8CcmbM","cn_src_ranuts_file_appendfile.md":"D2XkhH2B","cn_src_ranuts_file_fileinfo.md":"Bm1gqueF","cn_src_ranuts_file_readdir.md":"D3BP3gKv","cn_src_ranuts_file_readfile.md":"CfJHCkuJ","cn_src_ranuts_file_watchfile.md":"DEkh--uT","cn_src_ranuts_file_writefile.md":"A4SqY7IV","cn_src_ranuts_index.md":"BuaFTRrs","cn_src_ranuts_mimetype_mimetype.md":"BXKqytdq","cn_src_ranuts_mode_subscribe.md":"B_yqkhda","cn_src_ranuts_utils_convertimagetobase64.md":"BVxP3Y4J","cn_src_ranuts_utils_filterobj.md":"MlTb1jtF","cn_src_ranuts_utils_formatjson.md":"CJeC9Vqe","cn_src_ranuts_utils_getcookie.md":"BOR_GUfN","cn_src_ranuts_utils_ocr.md":"CNe-dlRv","cn_src_ranuts_utils_str2xml.md":"DH5nvnpc","cn_src_ranuts_utils_task.md":"JiNfIGgL","cn_src_types_ts类型.md":"CPBo-Z8o","cn_src_types_模式匹配.md":"k2Sn13f9","cn_src_types_类型运算.md":"J_LQEvnq","cn_src_types_高级类型.md":"CJNwod2u","index.md":"BEZWnQN_","src_article_astparse_tokenizer.md":"W6tYDAhq","src_article_babel.md":"DbGK9noy","src_article_bundle.md":"n4vvn7Ig","src_article_designmode.md":"Cygn2uVN","src_article_functionalprogramming.md":"DpsP-ua6","src_article_imagemin.md":"uYgv1Gxw","src_article_javascript_domload.md":"BGlU-nCp","src_article_sort_bubble_index.md":"CyhYCOsV","src_article_sort_bucket_index.md":"6-1zsle_","src_article_sort_count_index.md":"D2Qv7jPN","src_article_sort_heap_index.md":"CdR2jVzG","src_article_sort_index.md":"BIPYK-Ok","src_article_sort_insert_index.md":"DWXFaZLt","src_article_sort_merge_index.md":"D-rV1sbV","src_article_sort_quick_index.md":"BbsLDEfT","src_article_sort_radix_index.md":"C4idJI31","src_article_sort_select_index.md":"C8DuU50W","src_article_sort_shell_index.md":"jumHap7P","src_article_typescript_calculate.md":"fkCRSr5X","src_article_typescript_index.md":"NB2OS2YQ","src_article_typescript_pattern.md":"Bh7TYXd6","src_article_typescript_reconstruction.md":"Dnx3_2D1","src_article_typescript_recursion.md":"DG6i_SHd","src_article_typescript_uniontype.md":"Dhn_HEeP","src_ranui_button_index.md":"DlhFg8_e","src_ranui_checkbox_index.md":"CRJDIbp0","src_ranui_icon_index.md":"DUb9Ziec","src_ranui_image_index.md":"CR-zpzpn","src_ranui_index.md":"DMQuqK0O","src_ranui_input_index.md":"-VqhWNTp","src_ranui_loading_index.md":"adGvJ3b3","src_ranui_math_index.md":"BJBOIEyn","src_ranui_message_index.md":"DylTPcsH","src_ranui_modal_index.md":"WIJTopSI","src_ranui_player_index.md":"CqeU06z7","src_ranui_popover_index.md":"D-FeGUo5","src_ranui_preview_index.md":"DPHFMZv9","src_ranui_progress_index.md":"m5OqoR_m","src_ranui_radar_index.md":"DdUb2lWU","src_ranui_select_index.md":"DPzRRhtl","src_ranui_skeleton_index.md":"DjequKLz","src_ranui_tab_index.md":"kRkTGQVS","src_ranui_tabs_index.md":"DlIC1yii","src_ranuts_binarytree_index.md":"CPSkXGOJ","src_ranuts_bundler_index.md":"Duihjwnb","src_ranuts_file_appendfile.md":"ByRzuDEV","src_ranuts_file_fileinfo.md":"BtUHbk2k","src_ranuts_file_readdir.md":"CFfdXdbL","src_ranuts_file_readfile.md":"HwhoeptV","src_ranuts_file_watchfile.md":"CRULQFIp","src_ranuts_file_writefile.md":"Clwh8RIL","src_ranuts_index.md":"BvJRrWnB","src_ranuts_mimetype_mimetype.md":"n1DSeR1k","src_ranuts_mode_subscribe.md":"Dx6-RTZV","src_ranuts_utils_convertimagetobase64.md":"DhOUyQ-b","src_ranuts_utils_filterobj.md":"CE_SjJ6W","src_ranuts_utils_formatjson.md":"CA-QmLAe","src_ranuts_utils_getcookie.md":"Cr2WSzYV","src_ranuts_utils_ocr.md":"hx9G9Wty","src_ranuts_utils_str2xml.md":"Bx2-A0rM","src_ranuts_utils_task.md":"g-64gMZD","src_types_ts类型.md":"B6oAQhlt","src_types_模式匹配.md":"BUM7A3x9","src_types_类型运算.md":"B97x76_P","src_types_高级类型.md":"nuvOE5PP"} diff --git a/index.html b/index.html index 976dfa944..709b042f2 100644 --- a/index.html +++ b/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - +
Skip to content

ran

A Troupe of little vagrants of the world , leave your footprints in my words .

logo

Released under the MIT License.

- + \ No newline at end of file diff --git a/pagefind/fragment/zh-cn_f7dcce8.pf_fragment b/pagefind/fragment/zh-cn_f7dcce8.pf_fragment new file mode 100644 index 000000000..31c5ef44f Binary files /dev/null and b/pagefind/fragment/zh-cn_f7dcce8.pf_fragment differ diff --git a/pagefind/index/zh-cn_24997a4.pf_index b/pagefind/index/zh-cn_24997a4.pf_index deleted file mode 100644 index accf67772..000000000 Binary files a/pagefind/index/zh-cn_24997a4.pf_index and /dev/null differ diff --git a/pagefind/index/zh-cn_47b5d7b.pf_index b/pagefind/index/zh-cn_47b5d7b.pf_index deleted file mode 100644 index bce99e615..000000000 Binary files a/pagefind/index/zh-cn_47b5d7b.pf_index and /dev/null differ diff --git a/pagefind/index/zh-cn_629cfe2.pf_index b/pagefind/index/zh-cn_629cfe2.pf_index new file mode 100644 index 000000000..7056e9077 Binary files /dev/null and b/pagefind/index/zh-cn_629cfe2.pf_index differ diff --git a/pagefind/index/zh-cn_6e146a8.pf_index b/pagefind/index/zh-cn_6e146a8.pf_index new file mode 100644 index 000000000..fa663b581 Binary files /dev/null and b/pagefind/index/zh-cn_6e146a8.pf_index differ diff --git a/pagefind/index/zh-cn_b018389.pf_index b/pagefind/index/zh-cn_b018389.pf_index deleted file mode 100644 index 584ae807b..000000000 Binary files a/pagefind/index/zh-cn_b018389.pf_index and /dev/null differ diff --git a/pagefind/index/zh-cn_bc6475b.pf_index b/pagefind/index/zh-cn_bc6475b.pf_index deleted file mode 100644 index 8b636f8b7..000000000 Binary files a/pagefind/index/zh-cn_bc6475b.pf_index and /dev/null differ diff --git a/pagefind/index/zh-cn_c7671ec.pf_index b/pagefind/index/zh-cn_c7671ec.pf_index new file mode 100644 index 000000000..288a799e3 Binary files /dev/null and b/pagefind/index/zh-cn_c7671ec.pf_index differ diff --git a/pagefind/index/zh-cn_db15dcf.pf_index b/pagefind/index/zh-cn_db15dcf.pf_index new file mode 100644 index 000000000..5195af8ad Binary files /dev/null and b/pagefind/index/zh-cn_db15dcf.pf_index differ diff --git a/pagefind/index/zh-cn_dda31a2.pf_index b/pagefind/index/zh-cn_dda31a2.pf_index deleted file mode 100644 index 3127c692c..000000000 Binary files a/pagefind/index/zh-cn_dda31a2.pf_index and /dev/null differ diff --git a/pagefind/index/zh-cn_f5ed6e5.pf_index b/pagefind/index/zh-cn_f5ed6e5.pf_index new file mode 100644 index 000000000..5e8637d13 Binary files /dev/null and b/pagefind/index/zh-cn_f5ed6e5.pf_index differ diff --git a/pagefind/pagefind-entry.json b/pagefind/pagefind-entry.json index 3b42f49a7..f1750f0bf 100644 --- a/pagefind/pagefind-entry.json +++ b/pagefind/pagefind-entry.json @@ -1 +1 @@ -{"version":"1.1.1","languages":{"en":{"hash":"en_77315dadfd","wasm":"en","page_count":65},"zh-cn":{"hash":"zh-cn_8f6e3f26981c1","wasm":null,"page_count":72}}} \ No newline at end of file +{"version":"1.1.1","languages":{"zh-cn":{"hash":"zh-cn_72488e9ca2573","wasm":null,"page_count":73},"en":{"hash":"en_77315dadfd","wasm":"en","page_count":65}}} \ No newline at end of file diff --git a/pagefind/pagefind.zh-cn_72488e9ca2573.pf_meta b/pagefind/pagefind.zh-cn_72488e9ca2573.pf_meta new file mode 100644 index 000000000..e4f7672d5 Binary files /dev/null and b/pagefind/pagefind.zh-cn_72488e9ca2573.pf_meta differ diff --git a/pagefind/pagefind.zh-cn_8f6e3f26981c1.pf_meta b/pagefind/pagefind.zh-cn_8f6e3f26981c1.pf_meta deleted file mode 100644 index 5a0924f3e..000000000 Binary files a/pagefind/pagefind.zh-cn_8f6e3f26981c1.pf_meta and /dev/null differ diff --git a/src/article/astParse/tokenizer.html b/src/article/astParse/tokenizer.html index 8b5caa0b4..0df0b7dc7 100644 --- a/src/article/astParse/tokenizer.html +++ b/src/article/astParse/tokenizer.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -226,8 +226,8 @@ { type: 'RightParen', value: ')', start: 17, end: 18 }, { type: 'LeftCurly', value: '{', start: 19, end: 20 }, { type: 'RightCurly', value: '}', start: 20, end: 21 }, -];

一个简易版本的分词器已经被我们开发出来了,不过目前的分词器还比较简陋,仅仅支持有限的语法,不过在明确了核心的开发步骤之后,后面继续完善的过程就比较简单了。

四。编写语法分析器(Parser)

在解析出词法 token 之后,我们就可以进入语法分析阶段了。在这个阶段,我们会依次遍历 token ,对代码进行语法结构层面的分析,最后的目标是生成 AST 数据结构。至于代码的 AST 结构到底是什么样子,你可以去 AST Explorer 网站进行在线预览:

接下来,我们要做的就是将 token 数组转换为上图所示的 AST 数据。

开发步骤主要分为:

  • 初始化类型声明

Released under the MIT License.

- +];

一个简易版本的分词器已经被我们开发出来了,不过目前的分词器还比较简陋,仅仅支持有限的语法,不过在明确了核心的开发步骤之后,后面继续完善的过程就比较简单了。

四。编写语法分析器(Parser)

在解析出词法 token 之后,我们就可以进入语法分析阶段了。在这个阶段,我们会依次遍历 token ,对代码进行语法结构层面的分析,最后的目标是生成 AST 数据结构。至于代码的 AST 结构到底是什么样子,你可以去 AST Explorer 网站进行在线预览:

接下来,我们要做的就是将 token 数组转换为上图所示的 AST 数据。

开发步骤主要分为:

  • 初始化类型声明

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/babel.html b/src/article/babel.html index 7991150d3..c2899253e 100644 --- a/src/article/babel.html +++ b/src/article/babel.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

Babel

babel 核心库主要是:

  • @babel/parser 对源码进行 parse,可以通过 plugins、sourceType 等来指定 parse 语法,功能是把源码转成 AST。
  • @babel/traverse 通过 visitor 函数对遍历到的 ast 进行处理,分为 enter 和 exit 两个阶段,具体操作 AST 使用 path 的 api,还可以通过 state 来在遍历过程中传递一些数据
  • @babel/types 用于创建、判断 AST 节点,提供了 xxx、isXxx、assertXxx 的 api
  • @babel/template 当需要批量创建 AST 的时候可以使用 @babel/template 来简化 AST 创建逻辑。
  • @babel/code-frame 可以创建友好的报错信息
  • @babel/generator 打印 AST 成目标代码字符串,支持 comments、minified、sourceMaps 等选项。
  • @babel/core 基于上面的包来完成 babel 的编译流程,并应用 plugin 和 preset。

Released under the MIT License.

- +
Skip to content

Babel

babel 核心库主要是:

  • @babel/parser 对源码进行 parse,可以通过 plugins、sourceType 等来指定 parse 语法,功能是把源码转成 AST。
  • @babel/traverse 通过 visitor 函数对遍历到的 ast 进行处理,分为 enter 和 exit 两个阶段,具体操作 AST 使用 path 的 api,还可以通过 state 来在遍历过程中传递一些数据
  • @babel/types 用于创建、判断 AST 节点,提供了 xxx、isXxx、assertXxx 的 api
  • @babel/template 当需要批量创建 AST 的时候可以使用 @babel/template 来简化 AST 创建逻辑。
  • @babel/code-frame 可以创建友好的报错信息
  • @babel/generator 打印 AST 成目标代码字符串,支持 comments、minified、sourceMaps 等选项。
  • @babel/core 基于上面的包来完成 babel 的编译流程,并应用 plugin 和 preset。

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/bundle.html b/src/article/bundle.html index e2fa2d1f2..64ee4e41c 100644 --- a/src/article/bundle.html +++ b/src/article/bundle.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

Bundle

Bundle 的本质就是输入,转换,输出。在机器上直接运行的代码,往往都难以维护和理解,我们需要将开发者方便理解和维护的代码,通过打包等工具转换成方便机器或者程序使用的代码。对于 web 前端来说,打包工具,至少需要以下功能:

  • 编译能力
  • 插件机制
  • HMR
  • cli 和命令行能力

Released under the MIT License.

- +
Skip to content

Bundle

Bundle 的本质就是输入,转换,输出。在机器上直接运行的代码,往往都难以维护和理解,我们需要将开发者方便理解和维护的代码,通过打包等工具转换成方便机器或者程序使用的代码。对于 web 前端来说,打包工具,至少需要以下功能:

  • 编译能力
  • 插件机制
  • HMR
  • cli 和命令行能力

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/designMode.html b/src/article/designMode.html index 8243e3122..2e07deb90 100644 --- a/src/article/designMode.html +++ b/src/article/designMode.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -785,8 +785,8 @@ Visitor.push(a,1,2,3,4); Visitor.push(a,4,5,6); Visitor.pop(a); -Visitor.splice(a,2);

The visitor pattern solves the coupling between the data and the manipulation of the data, making the manipulation of the data independent of the data, so that it can freely evolve. Therefore, the visitor pattern is more suitable for those environments where the data is stable but the data manipulation method is variable.

Advantages:

  • Easy to add new access operations. Using the visitor pattern, adding a new access operation means adding a new concrete visitor class, which is simple to implement without modifying the source code and conforms to the "open and closed principle".
  • Centralize access to element objects into a single visitor object, rather than spreading it across individual element classes. Class responsibilities are clearer, facilitating reuse of element objects in the object structure, and the same object structure can be accessed by multiple different visitors.
  • Enables users to define operations that act on an existing element class hierarchy without modifying it.

Disadvantage:

  • Adding new element classes is difficult. In the visitor pattern, adding a new element class means adding a new abstract operation to the abstract visitor role and a corresponding concrete operation to each concrete visitor class, which violates the "open closed principle".
  • Break the package. The visitor pattern requires the visitor object to access and invoke the operations of each element object, which means that the element object must sometimes expose some of its own internal operations and internal state, otherwise it cannot be accessed by the visitor.

VII.Sum up

After systematically studying design patterns, you can see in your past development experience that design patterns are everywhere. Before learning design patterns, we often rely on past experience and wisdom to improve the design of a system, and many of these experiences coincide with the idea of a certain design pattern.

There are still some places that are not fully understood, and I would like to point out the mistakes in the article.

VIII.Reference material

Released under the MIT License.

- +Visitor.splice(a,2);

The visitor pattern solves the coupling between the data and the manipulation of the data, making the manipulation of the data independent of the data, so that it can freely evolve. Therefore, the visitor pattern is more suitable for those environments where the data is stable but the data manipulation method is variable.

Advantages:

  • Easy to add new access operations. Using the visitor pattern, adding a new access operation means adding a new concrete visitor class, which is simple to implement without modifying the source code and conforms to the "open and closed principle".
  • Centralize access to element objects into a single visitor object, rather than spreading it across individual element classes. Class responsibilities are clearer, facilitating reuse of element objects in the object structure, and the same object structure can be accessed by multiple different visitors.
  • Enables users to define operations that act on an existing element class hierarchy without modifying it.

Disadvantage:

  • Adding new element classes is difficult. In the visitor pattern, adding a new element class means adding a new abstract operation to the abstract visitor role and a corresponding concrete operation to each concrete visitor class, which violates the "open closed principle".
  • Break the package. The visitor pattern requires the visitor object to access and invoke the operations of each element object, which means that the element object must sometimes expose some of its own internal operations and internal state, otherwise it cannot be accessed by the visitor.

VII.Sum up

After systematically studying design patterns, you can see in your past development experience that design patterns are everywhere. Before learning design patterns, we often rely on past experience and wisdom to improve the design of a system, and many of these experiences coincide with the idea of a certain design pattern.

There are still some places that are not fully understood, and I would like to point out the mistakes in the article.

VIII.Reference material

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/functionalProgramming.html b/src/article/functionalProgramming.html index 4ddf4fcd2..7d94abab6 100644 --- a/src/article/functionalProgramming.html +++ b/src/article/functionalProgramming.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -379,8 +379,8 @@ }; let r = readFile('package.json') //这里可以用 map 去处理内容 .flatMap(print) - .join();

参考资料

Released under the MIT License.

- + .join();

参考资料

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/imagemin.html b/src/article/imagemin.html index 367b0faec..d25de4bbf 100644 --- a/src/article/imagemin.html +++ b/src/article/imagemin.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

imagemin 图片压缩源码分析

Released under the MIT License.

- +
Skip to content

imagemin 图片压缩源码分析

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/javascript/domLoad.html b/src/article/javascript/domLoad.html index 3b1cdc991..35a5d334c 100644 --- a/src/article/javascript/domLoad.html +++ b/src/article/javascript/domLoad.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -44,8 +44,8 @@
Skip to content

页面加载完成后事件

window.onload

DOMContentLoaded

js
document.addEventListener('DOMContentLoaded', fun);

<body onload="fun()">

readyState

js
document.readyState;
 
-document.onreadystatechange;

一个文档的 readyState 可以是以下之一:

  • loading / 加载。document 仍在加载。
  • interactive / 互动。文档已经完成加载,文档已被解析,但是诸如图像,样式表和框架之类的子资源仍在加载。
  • complete / 完成。T 文档和所有子资源已完成加载。状态表示 load 事件即将被触发。

Released under the MIT License.

- +document.onreadystatechange;

一个文档的 readyState 可以是以下之一:

  • loading / 加载。document 仍在加载。
  • interactive / 互动。文档已经完成加载,文档已被解析,但是诸如图像,样式表和框架之类的子资源仍在加载。
  • complete / 完成。T 文档和所有子资源已完成加载。状态表示 load 事件即将被触发。

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/sort/bubble/index.html b/src/article/sort/bubble/index.html index ad861beee..557984bed 100644 --- a/src/article/sort/bubble/index.html +++ b/src/article/sort/bubble/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -55,8 +55,8 @@ } } return list; -};

Released under the MIT License.

- +};

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/sort/bucket/index.html b/src/article/sort/bucket/index.html index 17249c014..0413d76e7 100644 --- a/src/article/sort/bucket/index.html +++ b/src/article/sort/bucket/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -98,8 +98,8 @@ list = list.concat(count(buckets[i])); } return list; -};

Algorithm analysis

Bucket sorting best uses linear time O(n), and the time complexity of bucket sorting depends on the time complexity of sorting data between buckets, because the time complexity of other parts is O(n). Obviously, the smaller the buckets, the less data there is between them, and the less time it takes to sort them. But the corresponding space consumption will increase.

Released under the MIT License.

- +};

Algorithm analysis

Bucket sorting best uses linear time O(n), and the time complexity of bucket sorting depends on the time complexity of sorting data between buckets, because the time complexity of other parts is O(n). Obviously, the smaller the buckets, the less data there is between them, and the less time it takes to sort them. But the corresponding space consumption will increase.

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/sort/count/index.html b/src/article/sort/count/index.html index c33645ee1..88de3ee33 100644 --- a/src/article/sort/count/index.html +++ b/src/article/sort/count/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -76,8 +76,8 @@ } } return result; -};

Algorithm analysis

Counting sort is a stable sorting algorithm. When the input elements are n integers between 0 and k, the time complexity is O(n+k) and the space complexity is also O(n+k), which sorts faster than any comparison sorting algorithm. Counting sort is an efficient sorting algorithm when k is not large and the sequence is concentrated.

Released under the MIT License.

- +};

Algorithm analysis

Counting sort is a stable sorting algorithm. When the input elements are n integers between 0 and k, the time complexity is O(n+k) and the space complexity is also O(n+k), which sorts faster than any comparison sorting algorithm. Counting sort is an efficient sorting algorithm when k is not large and the sequence is concentrated.

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/sort/heap/index.html b/src/article/sort/heap/index.html index 62395efb1..b521eeff4 100644 --- a/src/article/sort/heap/index.html +++ b/src/article/sort/heap/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -92,8 +92,8 @@ const heap = (list: Array<number>): Array<number> => { const { value } = new Heap(list); return value; -};

Released under the MIT License.

- +};

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/sort/index.html b/src/article/sort/index.html index ffea9f409..b99b88faa 100644 --- a/src/article/sort/index.html +++ b/src/article/sort/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,14 +37,14 @@ - + -
Skip to content

Ten classic sorting algorithms

The ten common sorting algorithms can be divided into two broad categories:

  • Comparator sort:By comparison to determine the relative order between elements, because its time complexity can not break through O(nlogn), so it is also called nonlinear time comparison class sorting.
  • Non-comparison sort:Instead of determining the relative order between elements by comparison, it can break through the time lower bound based on comparison sort and run in linear time, so it is also called linear time non-comparison sort.

Sorting algorithm classification

Algorithm complexity

Algorithm complexity

  • Stable: If a was originally in front of b and a=b, a is still in front of b after sorting.
  • Unstable: If a originally comes before b and a=b, a may come after b after sorting.
  • Time complexity: The total number of operations on sorted data. Reflects what rule the number of operations presents when n changes.
  • Spatial complexity: refers to the measure of the storage space required when the algorithm is executed in the computer, and it is also a function of the data size n.

Released under the MIT License.

- +
Skip to content

Ten classic sorting algorithms

The ten common sorting algorithms can be divided into two broad categories:

  • Comparator sort:By comparison to determine the relative order between elements, because its time complexity can not break through O(nlogn), so it is also called nonlinear time comparison class sorting.
  • Non-comparison sort:Instead of determining the relative order between elements by comparison, it can break through the time lower bound based on comparison sort and run in linear time, so it is also called linear time non-comparison sort.

Sorting algorithm classification

Algorithm complexity

Algorithm complexity

  • Stable: If a was originally in front of b and a=b, a is still in front of b after sorting.
  • Unstable: If a originally comes before b and a=b, a may come after b after sorting.
  • Time complexity: The total number of operations on sorted data. Reflects what rule the number of operations presents when n changes.
  • Spatial complexity: refers to the measure of the storage space required when the algorithm is executed in the computer, and it is also a function of the data size n.

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/sort/insert/index.html b/src/article/sort/insert/index.html index 2a28526ca..aee0ff4ae 100644 --- a/src/article/sort/insert/index.html +++ b/src/article/sort/insert/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -55,8 +55,8 @@ list[preIndex + 1] = current; } return list; -};

Algorithm analysis

Insertion sort in the implementation, usually use in-place sort (that is, only need to use O(1) of the additional space of the sort), so in the process of scanning from back to forward, the sorted elements need to be repeatedly moved backward step by step, to provide insertion space for the latest elements.

Released under the MIT License.

- +};

Algorithm analysis

Insertion sort in the implementation, usually use in-place sort (that is, only need to use O(1) of the additional space of the sort), so in the process of scanning from back to forward, the sorted elements need to be repeatedly moved backward step by step, to provide insertion space for the latest elements.

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/sort/merge/index.html b/src/article/sort/merge/index.html index 38fa666ac..a86003207 100644 --- a/src/article/sort/merge/index.html +++ b/src/article/sort/merge/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -75,8 +75,8 @@ const left = list.slice(0, middle); const right = list.slice(middle); return combine(merge(left), merge(right)); -};

Algorithm analysis

Merge sort is a stable sort method. Like select sort, merge sort performs independently of the input data, but performs much better than select sort because it is always O(nlogn) in time complexity. The trade-off is extra memory space.

Released under the MIT License.

- +};

Algorithm analysis

Merge sort is a stable sort method. Like select sort, merge sort performs independently of the input data, but performs much better than select sort because it is always O(nlogn) in time complexity. The trade-off is extra memory space.

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/sort/quick/index.html b/src/article/sort/quick/index.html index 444e536b2..af9b8d114 100644 --- a/src/article/sort/quick/index.html +++ b/src/article/sort/quick/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -93,8 +93,8 @@ const quick = (list: number[] = []): number[] => { const size = list.length; return combine(list, 0, size - 1); -};

Released under the MIT License.

- +};

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/sort/radix/index.html b/src/article/sort/radix/index.html index f212e8c54..ae314d548 100644 --- a/src/article/sort/radix/index.html +++ b/src/article/sort/radix/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -78,8 +78,8 @@ list = list.concat(count(buckets[i])); } return list; -};

Algorithm analysis

Radix sort is based on distributive sort, so it is stable. But the performance of radix sort is slightly worse than bucket sort, each keyword bucket allocation requires O(n) time complexity, and after allocation to get a new keyword sequence requires O(n) time complexity. If the data to be sorted can be divided into d keywords, the time complexity of radix sort will be O(d*2n), of course, d is far less than n, so it is basically linear level.

The spatial complexity of radix sort is O(n+k), where k is the number of buckets. Generally speaking, n> > k, so you need about n extra Spaces.

Released under the MIT License.

- +};

Algorithm analysis

Radix sort is based on distributive sort, so it is stable. But the performance of radix sort is slightly worse than bucket sort, each keyword bucket allocation requires O(n) time complexity, and after allocation to get a new keyword sequence requires O(n) time complexity. If the data to be sorted can be divided into d keywords, the time complexity of radix sort will be O(d*2n), of course, d is far less than n, so it is basically linear level.

The spatial complexity of radix sort is O(n+k), where k is the number of buckets. Generally speaking, n> > k, so you need about n extra Spaces.

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/sort/select/index.html b/src/article/sort/select/index.html index b46dad65b..dca22d6f8 100644 --- a/src/article/sort/select/index.html +++ b/src/article/sort/select/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -59,8 +59,8 @@ } } return list; -};

Algorithm analysis

One of the most stable sorting algorithms, because whatever data goes in is O(n2) time complexity, so when using it, the smaller the data size, the better. The only benefit may be that it doesn't take up extra memory space. In theory, selection sorting may also be the most common sorting method that people think of.

Released under the MIT License.

- +};

Algorithm analysis

One of the most stable sorting algorithms, because whatever data goes in is O(n2) time complexity, so when using it, the smaller the data size, the better. The only benefit may be that it doesn't take up extra memory space. In theory, selection sorting may also be the most common sorting method that people think of.

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/sort/shell/index.html b/src/article/sort/shell/index.html index 60c374891..d5c1038d4 100644 --- a/src/article/sort/shell/index.html +++ b/src/article/sort/shell/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -62,8 +62,8 @@ } } return list; -};

Algorithm analysis

The core of Hill sort is the setting of interval sequence. The interval sequence can be set in advance, and the interval sequence can be defined dynamically. The algorithm for dynamically defining interval sequences was developed by Robert Sedgewick, co-author of Algorithms (4th Edition).

Released under the MIT License.

- +};

Algorithm analysis

The core of Hill sort is the setting of interval sequence. The interval sequence can be set in advance, and the interval sequence can be defined dynamically. The algorithm for dynamically defining interval sequences was developed by Robert Sedgewick, co-author of Algorithms (4th Edition).

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/typescript/calculate.html b/src/article/typescript/calculate.html index 9a88ecda2..f4ecff28b 100644 --- a/src/article/typescript/calculate.html +++ b/src/article/typescript/calculate.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -72,8 +72,8 @@ ? CurrentArr['length'] : FibonacciLoop<CurrentArr, [...PrevArr, ...CurrentArr], [...IndexArr, unknown], Num>; -type Fibonacci<Num extends number> = FibonacciLoop<[1], [], [], Num>;

类型参数 PrevArr 是代表之前的累加值的数组。类型参数 CurrentArr 是代表当前数值的数组。

类型参数 IndexArr 用于记录 index,每次递归加一,默认值是 [],代表从 0 开始。

类型参数 Num 代表求数列的第几个数。

判断当前 index 也就是 IndexArr['length'] 是否到了 Num,到了就返回当前的数值 CurrentArr['length']。

否则求出当前 index 对应的数值,用之前的数加上当前的数 [...PrevArr, ... CurrentArr]。

然后继续递归,index + 1,也就是 [...IndexArr, unknown]。

这就是递归计算 Fibinacci 数列的数的过程。

可以正确的算出第 8 个数是 21:

Released under the MIT License.

- +type Fibonacci<Num extends number> = FibonacciLoop<[1], [], [], Num>;

类型参数 PrevArr 是代表之前的累加值的数组。类型参数 CurrentArr 是代表当前数值的数组。

类型参数 IndexArr 用于记录 index,每次递归加一,默认值是 [],代表从 0 开始。

类型参数 Num 代表求数列的第几个数。

判断当前 index 也就是 IndexArr['length'] 是否到了 Num,到了就返回当前的数值 CurrentArr['length']。

否则求出当前 index 对应的数值,用之前的数加上当前的数 [...PrevArr, ... CurrentArr]。

然后继续递归,index + 1,也就是 [...IndexArr, unknown]。

这就是递归计算 Fibinacci 数列的数的过程。

可以正确的算出第 8 个数是 21:

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/typescript/index.html b/src/article/typescript/index.html index 39c0d8275..dbc3f4b4b 100644 --- a/src/article/typescript/index.html +++ b/src/article/typescript/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -197,8 +197,8 @@ type TestAnyResult = TestAny<any>; // type TestAnyResult = 1 | 2

联合类型、never、any 在作为条件类型的类型参数时的这些特殊情况,也会在后面的原理篇来解释原因。

IsTuple

元组类型怎么判断呢?它和数组有什么区别呢?

元组类型的 length 是数字字面量,而数组的 length 是 number。

ts
type len

UnionToIntersection

类型之间是有父子关系的,更具体的那个是子类型,比如 A 和 B 的交叉类型 A & B 就是联合类型 A | B 的子类型,因为更具体。

如果允许父类型赋值给子类型,就叫做逆变

如果允许子类型赋值给父类型,就叫做协变

(关于逆变、协变等概念的详细解释可以看原理篇)

在 TypeScript 中有函数参数是有逆变的性质的,也就是如果参数可能是多个类型,参数类型会变成它们的交叉类型。

所以联合转交叉可以这样实现:

ts
type UnionToIntersection<U> = (U extends U ? (x: U) => unknown : never) extends (x: infer R) => unknown ? R : never;

类型参数 U 是要转换的联合类型。

U extends U 是为了触发联合类型的 distributive 的性质,让每个类型单独传入做计算,最后合并。

利用 U 做为参数构造个函数,通过模式匹配取参数的类型。

结果就是交叉类型

函数参数的逆变性质一般就联合类型转交叉类型会用,记住就行。

GetOptional

如何提取索引类型中的可选索引呢?

这也要利用可选索引的特性:可选索引的值为 undefined 和值类型的联合类型。

过滤可选索引,就要构造一个新的索引类型,过程中做过滤:

ts
type GetOptional<Obj extends Record<string, any>> = {
   [Key in keyof Obj as {} extends Pick<Obj, Key> ? Key : never]: Obj[Key];
-};

类型参数 Obj 为待处理的索引类型,类型约束为索引为 string、值为任意类型的索引类型 Record<string, any>。

用映射类型的语法重新构造索引类型,索引是之前的索引也就是 Key in keyof Obj,但要做一些过滤,也就是 as 之后的部分。

过滤的方式就是单独取出该索引之后,判断空对象是否是其子类型。

这里的 Pick 是 ts 提供的内置高级类型,就是取出某个 Key 构造新的索引类型:

ts
type Pick<T, K extends keyof T> = { [P in K]: T[P] };

比如单独取出 age 构造的新的索引类型是这样的:

可选的意思是这个索引可能没有,没有的时候,那 Pick<Obj, Key> 就是空的,所以 {} extends Pick<Obj, Key> 就能过滤出可选索引。

值的类型依然是之前的,也就是 Obj[Key]。

这样,就能过滤出所有可选索引,构造成新的索引类型:

总结

  • any 类型与任何类型的交叉都是 any,也就是 1 & any 结果是 any,可以用这个特性判断 any 类型。
  • 联合类型作为类型参数出现在条件类型左侧时,会分散成单个类型传入,最后合并。
  • never 作为类型参数出现在条件类型左侧时,会直接返回 never。
  • any 作为类型参数出现在条件类型左侧时,会直接返回 trueType 和 falseType 的联合类型。
  • 元组类型也是数组类型,但 length 是数字字面量,而数组的 length 是 number。可以用来判断元组类型。
  • 函数参数处会发生逆变,可以用来实现联合类型转交叉类型。
  • 可选索引的索引可能没有,那 Pick 出来的就可能是 {},可以用来过滤可选索引,反过来也可以过滤非可选索引。
  • 索引类型的索引为字符串字面量类型,而可索引签名不是,可以用这个特性过滤掉可索引签名。
  • keyof 只能拿到 class 的 public 的索引,可以用来过滤出 public 的属性。
  • 默认推导出来的不是字面量类型,加上 as const 可以推导出字面量类型,但带有 readonly 修饰,这样模式匹配的时候也得加上 readonly 才行。

Released under the MIT License.

- +};

类型参数 Obj 为待处理的索引类型,类型约束为索引为 string、值为任意类型的索引类型 Record<string, any>。

用映射类型的语法重新构造索引类型,索引是之前的索引也就是 Key in keyof Obj,但要做一些过滤,也就是 as 之后的部分。

过滤的方式就是单独取出该索引之后,判断空对象是否是其子类型。

这里的 Pick 是 ts 提供的内置高级类型,就是取出某个 Key 构造新的索引类型:

ts
type Pick<T, K extends keyof T> = { [P in K]: T[P] };

比如单独取出 age 构造的新的索引类型是这样的:

可选的意思是这个索引可能没有,没有的时候,那 Pick<Obj, Key> 就是空的,所以 {} extends Pick<Obj, Key> 就能过滤出可选索引。

值的类型依然是之前的,也就是 Obj[Key]。

这样,就能过滤出所有可选索引,构造成新的索引类型:

总结

  • any 类型与任何类型的交叉都是 any,也就是 1 & any 结果是 any,可以用这个特性判断 any 类型。
  • 联合类型作为类型参数出现在条件类型左侧时,会分散成单个类型传入,最后合并。
  • never 作为类型参数出现在条件类型左侧时,会直接返回 never。
  • any 作为类型参数出现在条件类型左侧时,会直接返回 trueType 和 falseType 的联合类型。
  • 元组类型也是数组类型,但 length 是数字字面量,而数组的 length 是 number。可以用来判断元组类型。
  • 函数参数处会发生逆变,可以用来实现联合类型转交叉类型。
  • 可选索引的索引可能没有,那 Pick 出来的就可能是 {},可以用来过滤可选索引,反过来也可以过滤非可选索引。
  • 索引类型的索引为字符串字面量类型,而可索引签名不是,可以用这个特性过滤掉可索引签名。
  • keyof 只能拿到 class 的 public 的索引,可以用来过滤出 public 的属性。
  • 默认推导出来的不是字面量类型,加上 as const 可以推导出字面量类型,但带有 readonly 修饰,这样模式匹配的时候也得加上 readonly 才行。

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/typescript/pattern.html b/src/article/typescript/pattern.html index 6666f04fe..8028153bd 100644 --- a/src/article/typescript/pattern.html +++ b/src/article/typescript/pattern.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -134,8 +134,8 @@ : never : never;

类型参数 Props 为待处理的类型。

通过 keyof Props 取出 Props 的所有索引构成的联合类型,判断下 ref 是否在其中,也就是 'ref' extends keyof Props。

为什么要做这个判断,上面注释里写了:

在 ts3.0 里面如果没有对应的索引,Obj[Key] 返回的是 {} 而不是 never,所以这样做下兼容处理。

如果有 ref 这个索引的话,就通过 infer 提取 Value 的类型返回,否则返回 never。

ts
type GetPropsRefResult = GetPropsRef<{ ref: 1; name: 'str' }>;
 // type GetPropsRefResult = 1

当 ref 为 undefined 时:

ts
type GetPropsRefResult = GetPropsRef<{ ref: undefined; name: 'str' }>;
-// type GetPropsRefResult = undefined

Released under the MIT License.

- +// type GetPropsRefResult = undefined

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/typescript/reconstruction.html b/src/article/typescript/reconstruction.html index 387f3c555..64e658674 100644 --- a/src/article/typescript/reconstruction.html +++ b/src/article/typescript/reconstruction.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -89,8 +89,8 @@ [Key in keyof T]-?: T[Key]; };

给索引类型 T 的索引去掉 ? 的修饰,其余保持不变。

FilterByValueType

可以在构造新索引类型的时候根据值的类型做下过滤:

ts
type FilterByValueType<Obj extends Record<string, any>, ValueType> = {
   [Key in keyof Obj as Obj[Key] extends ValueType ? Key : never]: Obj[Key];
-};

类型参数 Obj 为要处理的索引类型,通过 extends 约束为索引为 string,值为任意类型的索引类型 Record<string, any>。

类型参数 ValueType 为要过滤出的值的类型。

构造新的索引类型,索引为 Obj 的索引,也就是 Key in keyof Obj,但要做一些变换,也就是 as 之后的部分。

如果原来索引的值 Obj[Key] 是 ValueType 类型,索引依然为之前的索引 Key,否则索引设置为 never,never 的索引会在生成新的索引类型时被去掉。

值保持不变,依然为原来索引的值,也就是 Obj[Key]。

这样就达到了过滤索引类型的索引,产生新的索引类型的目的:

Released under the MIT License.

- +};

类型参数 Obj 为要处理的索引类型,通过 extends 约束为索引为 string,值为任意类型的索引类型 Record<string, any>。

类型参数 ValueType 为要过滤出的值的类型。

构造新的索引类型,索引为 Obj 的索引,也就是 Key in keyof Obj,但要做一些变换,也就是 as 之后的部分。

如果原来索引的值 Obj[Key] 是 ValueType 类型,索引依然为之前的索引 Key,否则索引设置为 never,never 的索引会在生成新的索引类型时被去掉。

值保持不变,依然为原来索引的值,也就是 Obj[Key]。

这样就达到了过滤索引类型的索引,产生新的索引类型的目的:

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/typescript/recursion.html b/src/article/typescript/recursion.html index 326796be3..9d0a31032 100644 --- a/src/article/typescript/recursion.html +++ b/src/article/typescript/recursion.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -106,8 +106,8 @@ : DeepReadonly<Obj[Key]> : Obj[Key]; } - : never;

Released under the MIT License.

- + : never;

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/article/typescript/unionType.html b/src/article/typescript/unionType.html index 7fd401a1a..df616e448 100644 --- a/src/article/typescript/unionType.html +++ b/src/article/typescript/unionType.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -62,8 +62,8 @@ > = `${Block}__${Element[number]}--${Modifiers[number]}`;

类型参数 Block、Element、Modifiers 分别是 bem 规范的三部分,其中 Element 和 Modifiers 都可能多个,约束为 string[]。

构造一个字符串类型,其中 Element 和 Modifiers 通过索引访问来变为联合类型。

字符串类型中遇到联合类型的时候,会每个元素单独传入计算,也就是这样的效果:

ts
type RemResult = BEM<'a', ['b', 'c'], ['d', 'e']>;
 // type RemResult = 'a__b--d' | 'a__b--e' | 'a__c--d' | 'a__b--e'

可以看到,用好了联合类型,确实能简化类型编程逻辑。

AllCombinations

我们再来实现一个全组合的高级类型,也是联合类型相关的:

希望传入 'A' | 'B' 的时候,能够返回所有的组合: 'A' | 'B' | 'BA' | 'AB'。

这种全组合问题的实现思路就是两两组合,组合出的字符串再和其他字符串两两组和:

比如 'A' | 'B' | 'c',就是 A 和 B、C 组合,B 和 A、C 组合,C 和 A、B 组合。然后组合出来的字符串再和其他字符串组合。

任何两个类型的组合有四种:A、B、AB、BA

ts
type Combination<A extends string, B extends string> = A | B | `${A}${B}` | `${B}${A}`;

然后构造出来的字符串再和其他字符串组合。

所以全组合的高级类型就是这样:

ts
type AllCombinations<A extends string, B extends string = A> = A extends A
   ? Combination<A, AllCombinations<Exclude<B, A>>>
-  : never;

类型参数 A、B 是待组合的两个联合类型,B 默认是 A 也就是同一个。

A extends A 的意义就是让联合类型每个类型单独传入做处理,上面我们刚学会。

A 的处理就是 A 和 B 中去掉 A 以后的所有类型组合,也就是 Combination<A, B 去掉 A 以后的所有组合>。

而 B 去掉 A 以后的所有组合就是 AllCombinations<Exclude<B, A>>,所以全组合就是 Combination<A, AllCombinations<Exclude<B, A>>>。

总结

联合类型中的每个类型都是相互独立的,TypeScript 对它做了特殊处理,也就是遇到字符串类型、条件类型的时候会把每个类型单独传入做计算,最后把每个类型的计算结果合并成联合类型。

条件类型左边是联合类型的时候就会触法这种处理,叫做分布式条件类型。

有两点特别要注意:

  • A extends A 不是没意义,意义是取出联合类型中的单个类型放入 A

  • A extends A 才是分布式条件类型, [A] extends [A] 就不是了,只有左边是单独的类型参数才可以。

我们后面做了一些案例,发现联合类型的这种 distributive 的特性确实能简化类型编程,但是也增加了认知成本,不过这也是不可避免的事。

Released under the MIT License.

- + : never;

类型参数 A、B 是待组合的两个联合类型,B 默认是 A 也就是同一个。

A extends A 的意义就是让联合类型每个类型单独传入做处理,上面我们刚学会。

A 的处理就是 A 和 B 中去掉 A 以后的所有类型组合,也就是 Combination<A, B 去掉 A 以后的所有组合>。

而 B 去掉 A 以后的所有组合就是 AllCombinations<Exclude<B, A>>,所以全组合就是 Combination<A, AllCombinations<Exclude<B, A>>>。

总结

联合类型中的每个类型都是相互独立的,TypeScript 对它做了特殊处理,也就是遇到字符串类型、条件类型的时候会把每个类型单独传入做计算,最后把每个类型的计算结果合并成联合类型。

条件类型左边是联合类型的时候就会触法这种处理,叫做分布式条件类型。

有两点特别要注意:

  • A extends A 不是没意义,意义是取出联合类型中的单个类型放入 A

  • A extends A 才是分布式条件类型, [A] extends [A] 就不是了,只有左边是单独的类型参数才可以。

我们后面做了一些案例,发现联合类型的这种 distributive 的特性确实能简化类型编程,但是也增加了认知成本,不过这也是不可避免的事。

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/button/index.html b/src/ranui/button/index.html index 0021dcee7..23ef319b6 100644 --- a/src/ranui/button/index.html +++ b/src/ranui/button/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -50,8 +50,8 @@ <r-button type="text" disabled>Text button</r-button> <r-button disabled>Default button</r-button>

icon

When you need to embed an Icon inside a Button, you can set the icon property or use the Icon component directly inside a Button.

If you want to control the specific position of the Icon, you can only use the Icon component directly, not the icon property.

Default button
Primary button
xml
<r-button type="default" icon="user">Default button</r-button>
 <r-button type="primary" icon="home">Primary button</r-button>

特效 effect

If you want a pure Button, you can add effect = false to block the water ripple effect when clicked

Default buttonPrimary button
xml
<r-button type="default" icon="user">Default button</r-button>
-<r-button type="primary" icon="home">Primary button</r-button>

Released under the MIT License.

- +<r-button type="primary" icon="home">Primary button</r-button>

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/checkbox/index.html b/src/ranui/checkbox/index.html index 178f75bba..8d38e7c48 100644 --- a/src/ranui/checkbox/index.html +++ b/src/ranui/checkbox/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -45,8 +45,8 @@
Skip to content

CheckBox

Code demo

xml
 <r-checkbox ></r-checkbox>

Attribute

checked

xml
 <r-checkbox checked="true"></r-checkbox>
  <r-checkbox checked="false"></r-checkbox>

disabled

xml
 <r-checkbox checked="true" disabled></r-checkbox>
  <r-checkbox checked="false" disabled></r-checkbox>

event

Common callback events.

onchange

xml
 <r-checkbox onchange="console.log(this.checked)"></r-checkbox>
- <r-checkbox onchange="console.log(this.checked)"></r-checkbox>

Released under the MIT License.

- + <r-checkbox onchange="console.log(this.checked)"></r-checkbox>

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/icon/index.html b/src/ranui/icon/index.html index 20228f9eb..aae98651b 100644 --- a/src/ranui/icon/index.html +++ b/src/ranui/icon/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -53,8 +53,8 @@ <r-icon name="lock" size="50" color="#F44336"></r-icon> <r-icon name="lock" size="50" color="#3F51B5"></r-icon>

spin

Set spin to turn on the rotation, and pass in a number to control the rotation speed. The smaller the number, the faster the rotation

html
<r-icon name="loading" size="50" color="#1E90FF" spin="0.7"></r-icon>
 <r-icon name="loading" size="50" color="#1E90FF" spin></r-icon>
-<r-icon name="loading" size="50" color="#1E90FF" spin="5"></r-icon>

Icon list

Released under the MIT License.

- +<r-icon name="loading" size="50" color="#1E90FF" spin="5"></r-icon>

Icon list

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/image/index.html b/src/ranui/image/index.html index 3f01ae692..1f7211507 100644 --- a/src/ranui/image/index.html +++ b/src/ranui/image/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

Image

Code demo

xml
 <r-img src="" fallback=""></r-img>

Attribute

src

Image address

Image loading failurefallback

srcConfiguration of the picture loading failure, the bottom of the picture address, the following is the default loading failure picture

Released under the MIT License.

- +
Skip to content

Image

Code demo

xml
 <r-img src="" fallback=""></r-img>

Attribute

src

Image address

Image loading failurefallback

srcConfiguration of the picture loading failure, the bottom of the picture address, the following is the default loading failure picture

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/index.html b/src/ranui/index.html index f0c50dac6..5af6cbbfc 100644 --- a/src/ranui/index.html +++ b/src/ranui/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -127,8 +127,8 @@ percent="0.70" type="drag" style="--ran-progress-wrap-background:linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);" -></r-progress>

For specific CSS3 variable names, refer to the introduction and description of each component.

Compatibility

  • Do not support IE, others have better support

Contributors

Other

  1. 优秀的组件设计
  2. 在线生成 CSS 渐变色
  3. 优秀设计作品,有 psd 和 sketch
  4. 3D UI 设计,类似于 3D 版的 figma
  5. 设计规范
  6. 优秀设计作品
  7. element UI 中文网
  8. Ant design 中文网
  9. 在线绘制 CSS 动画
  10. tailwindcss
  11. animate css
  12. can i use
  13. figma

Protocols and standards

  1. RFCs
  2. ECMA
  3. w3c

Released under the MIT License.

- +></r-progress>

For specific CSS3 variable names, refer to the introduction and description of each component.

Compatibility

  • Do not support IE, others have better support

Contributors

Other

  1. 优秀的组件设计
  2. 在线生成 CSS 渐变色
  3. 优秀设计作品,有 psd 和 sketch
  4. 3D UI 设计,类似于 3D 版的 figma
  5. 设计规范
  6. 优秀设计作品
  7. element UI 中文网
  8. Ant design 中文网
  9. 在线绘制 CSS 动画
  10. tailwindcss
  11. animate css
  12. can i use
  13. figma

Protocols and standards

  1. RFCs
  2. ECMA
  3. w3c

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/input/index.html b/src/ranui/input/index.html index fa058b7b6..1e13a4a7e 100644 --- a/src/ranui/input/index.html +++ b/src/ranui/input/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -53,8 +53,8 @@ const func = (e) => { console.log(e); }; -input.addEventListener('input', func);

The e parameter structure of the event

input method

Released under the MIT License.

- +input.addEventListener('input', func);

The e parameter structure of the event

input method

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/loading/index.html b/src/ranui/loading/index.html index 1e7f44279..9ec45e39e 100644 --- a/src/ranui/loading/index.html +++ b/src/ranui/loading/index.html @@ -8,13 +8,13 @@ - + - + - + @@ -38,7 +38,7 @@ - + @@ -47,8 +47,8 @@
Skip to content

Loading

Some nice looking loading.

Code demo

xml
<r-loading name="circle"></r-loading>

Attribute

name

There's a lot of different loading here

xml
<r-loading name="double-bounce"></r-loading>
 <r-loading name="rotate"></r-loading>
 <r-loading name="stretch"></r-loading>
-<r-loading name="cube"></r-loading>

Loading list

Move the mouse over the icon to see the loading animation

stretch
rotate
double-bounce
cube
dot
triple-bounce
scale-out
circle
circle-line
square
pulse
solar
cube-fold
circle-fold
cube-grid
circle-turn
circle-rotate
circle-spin
dot-bar
dot-circle
line
dot-pulse
line-scale
text
cube-dim
dot-line
arc
drop
pacman

Released under the MIT License.

- +<r-loading name="cube"></r-loading>

Loading list

Move the mouse over the icon to see the loading animation

stretch
rotate
double-bounce
cube
dot
triple-bounce
scale-out
circle
circle-line
square
pulse
solar
cube-fold
circle-fold
cube-grid
circle-turn
circle-rotate
circle-spin
dot-bar
dot-circle
line
dot-pulse
line-scale
text
cube-dim
dot-line
arc
drop
pacman

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/math/index.html b/src/ranui/math/index.html index fb2e2eb62..614663277 100644 --- a/src/ranui/math/index.html +++ b/src/ranui/math/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

math

High-quality display of LaTeX in HTML pages

Code demo

xml
<r-math latex="\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 \quad (a > b > 0)"></r-math>

Attribute

latex string

xml
  <r-math latex="x = {-b \pm \sqrt{b^2-4ac} \over 2a}"></r-math>

Released under the MIT License.

- +
Skip to content

math

High-quality display of LaTeX in HTML pages

Code demo

xml
<r-math latex="\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 \quad (a > b > 0)"></r-math>

Attribute

latex string

xml
  <r-math latex="x = {-b \pm \sqrt{b^2-4ac} \over 2a}"></r-math>

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/message/index.html b/src/ranui/message/index.html index 6421c0baf..f923659cf 100644 --- a/src/ranui/message/index.html +++ b/src/ranui/message/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -46,8 +46,8 @@ <r-button onclick="message.warning('This is a hint')">Warning prompt</r-button> <r-button onclick="message.error('This is a hint')">Error prompt</r-button> <r-button onclick="message.success('This is a hint')">Success tip</r-button> -<r-button onclick="message.toast('This is a hint')">toast tip</r-button>

Method

The component provides a number of static methods, using the following methods and parameters:

  1. You can pass only one parameter, prompt the content, the default prompt 3000 milliseconds

message.info('This is a hint')

message.warning('This is a hint')

message.error('This is a hint')

message.success('This is a hint')

message.toast('This is a hint')"

  1. You can also pass an object, set the prompt content, turn off the delay, and trigger the callback function when you close it

message.info({content:'This is a hint', duration: 2000, close: () => {}})

message.warning({content:'This is a hint', duration: 2000, close: () => {}})

message.error({content:'This is a hint', duration: 2000, close: () => {}})

message.success({content:'This is a hint', duration: 2000, close: () => {}})

message.toast({content:'This is a hint', duration: 2000, close: () => {}})

参数说明类型
contentPrompt contentstring
durationAutomatic shutdown delay, in milliseconds. Default 3000 msnumber
closeCallback function triggered when closed() => void

Released under the MIT License.

- +<r-button onclick="message.toast('This is a hint')">toast tip</r-button>

Method

The component provides a number of static methods, using the following methods and parameters:

  1. You can pass only one parameter, prompt the content, the default prompt 3000 milliseconds

message.info('This is a hint')

message.warning('This is a hint')

message.error('This is a hint')

message.success('This is a hint')

message.toast('This is a hint')"

  1. You can also pass an object, set the prompt content, turn off the delay, and trigger the callback function when you close it

message.info({content:'This is a hint', duration: 2000, close: () => {}})

message.warning({content:'This is a hint', duration: 2000, close: () => {}})

message.error({content:'This is a hint', duration: 2000, close: () => {}})

message.success({content:'This is a hint', duration: 2000, close: () => {}})

message.toast({content:'This is a hint', duration: 2000, close: () => {}})

参数说明类型
contentPrompt contentstring
durationAutomatic shutdown delay, in milliseconds. Default 3000 msnumber
closeCallback function triggered when closed() => void

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/modal/index.html b/src/ranui/modal/index.html index 95745a4bb..ff945cff6 100644 --- a/src/ranui/modal/index.html +++ b/src/ranui/modal/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

Released under the MIT License.

- +
Skip to content

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/player/index.html b/src/ranui/player/index.html index 19fc17dc4..b2effde43 100644 --- a/src/ranui/player/index.html +++ b/src/ranui/player/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

r-player

Video player

Based on 'hlsjs' and' web components', let the native tag 'r-player' have a unified video control. Do not use the 'new Player(options)' way to mount to the specified 'dom', view return view, logic return logic, see and get, more intuitive.

  1. Drag and drop the progress bar
  2. Volume control
  3. The bitrate is automatically switched based on the current bandwidth
  4. Manual definition switch
  5. Play at double speed
  6. Style custom overlay
  7. 'hls' protocol standard encryption video playback
  8. Based on native development, it can run in all frameworks and unify the cross-framework situation
  9. Unified browser controls

Code demo

xml
  <r-player src="/ran/hls/example.m3u8"></r-player>

Attribute

src

Resource address of the video

volume

Set the initial volume. The default is 0.5

currentTime

Set the initial playback time. By default, the playback starts from the beginning

playbackRate

Set the double speed. The default is 1.0

debug

console.log some info

event

onchange

Listen for any player changes, and the value returned is as follows.

An 'instance of the player' can be obtained through this method.

Live by 'type' to judge different event types, perform different operations

propertyexplains thatis of type
typeIndicates the type of the changed event'string'
dataThe value of the'Object'
currentTimeThe current playback time'number'
durationTotal duration of videos'number'
tagAn example of the player'Element'

Where 'type' type has

NameDescription
canplayYour browser is ready to play the media file, but it probably doesn't have enough data to play it to the end without pausing to buffer the content further.
canplaythroughThe browser estimates that it canplay media until the end without stopping content buffering.
completeOfflineAudioContext The rendering is complete.
durationchangeduration is triggered when the value of the duration property changes.
emptiedMedia content emptied; For example, when the media is already loaded (or partially loaded), this event is sent and the load() method is called to reload it.
endedThe video stops playing because the media has reached the end point.
loadedmetadataThe metadata is loaded.
progressis triggered periodically when the browser loads the resource.
ratechangeThe play rate changes.
seekedThe seek operation is complete.
seekingseek begins.
stalledThe user agent is trying to obtain media data but it has not appeared unexpectedly.
suspendMedia data loading has been suspended.
loadeddataThe first frame in media has been added. media has loaded.
timeupdateThe time specified by the currentTime property changes. currentTime attribute has changed.
volumechangeThe volume changes.
waitingPlaying has stopped due to lack of data.
playPlayback has started.
playingAfter a pause or delay due to lack of data, playback is ready to begin.
pausePlay is paused.
volumeThe volume changes.
fullscreenTriggers a full-screen event

Released under the MIT License.

- +
Skip to content

r-player

Video player

Based on 'hlsjs' and' web components', let the native tag 'r-player' have a unified video control. Do not use the 'new Player(options)' way to mount to the specified 'dom', view return view, logic return logic, see and get, more intuitive.

  1. Drag and drop the progress bar
  2. Volume control
  3. The bitrate is automatically switched based on the current bandwidth
  4. Manual definition switch
  5. Play at double speed
  6. Style custom overlay
  7. 'hls' protocol standard encryption video playback
  8. Based on native development, it can run in all frameworks and unify the cross-framework situation
  9. Unified browser controls

Code demo

xml
  <r-player src="/ran/hls/example.m3u8"></r-player>

Attribute

src

Resource address of the video

volume

Set the initial volume. The default is 0.5

currentTime

Set the initial playback time. By default, the playback starts from the beginning

playbackRate

Set the double speed. The default is 1.0

debug

console.log some info

event

onchange

Listen for any player changes, and the value returned is as follows.

An 'instance of the player' can be obtained through this method.

Live by 'type' to judge different event types, perform different operations

propertyexplains thatis of type
typeIndicates the type of the changed event'string'
dataThe value of the'Object'
currentTimeThe current playback time'number'
durationTotal duration of videos'number'
tagAn example of the player'Element'

Where 'type' type has

NameDescription
canplayYour browser is ready to play the media file, but it probably doesn't have enough data to play it to the end without pausing to buffer the content further.
canplaythroughThe browser estimates that it canplay media until the end without stopping content buffering.
completeOfflineAudioContext The rendering is complete.
durationchangeduration is triggered when the value of the duration property changes.
emptiedMedia content emptied; For example, when the media is already loaded (or partially loaded), this event is sent and the load() method is called to reload it.
endedThe video stops playing because the media has reached the end point.
loadedmetadataThe metadata is loaded.
progressis triggered periodically when the browser loads the resource.
ratechangeThe play rate changes.
seekedThe seek operation is complete.
seekingseek begins.
stalledThe user agent is trying to obtain media data but it has not appeared unexpectedly.
suspendMedia data loading has been suspended.
loadeddataThe first frame in media has been added. media has loaded.
timeupdateThe time specified by the currentTime property changes. currentTime attribute has changed.
volumechangeThe volume changes.
waitingPlaying has stopped due to lack of data.
playPlayback has started.
playingAfter a pause or delay due to lack of data, playback is ready to begin.
pausePlay is paused.
volumeThe volume changes.
fullscreenTriggers a full-screen event

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/popover/index.html b/src/ranui/popover/index.html index e2ccb2f4f..0aa6d4e7a 100644 --- a/src/ranui/popover/index.html +++ b/src/ranui/popover/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -67,8 +67,8 @@ <r-content> <div>top</div> </r-content> - </r-popover>

Released under the MIT License.

- + </r-popover>

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/preview/index.html b/src/ranui/preview/index.html index cc66ea1fe..b870c5cb7 100644 --- a/src/ranui/preview/index.html +++ b/src/ranui/preview/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -61,8 +61,8 @@ } }; }; -</script>

Attribute

src

If there is a 'src' address, the popup window will be opened, and if there is no 'src', it will not be displayed

html
<r-preview src=""></r-preview>

closeable

'closeable' defaults to 'true' and can be closed, when set to 'false', it cannot be closed, and the close button in the upper right corner will not be displayed

html
<r-preview closeable="false"></r-preview>

Released under the MIT License.

- +</script>

Attribute

src

If there is a 'src' address, the popup window will be opened, and if there is no 'src', it will not be displayed

html
<r-preview src=""></r-preview>

closeable

'closeable' defaults to 'true' and can be closed, when set to 'false', it cannot be closed, and the close button in the upper right corner will not be displayed

html
<r-preview closeable="false"></r-preview>

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/progress/index.html b/src/ranui/progress/index.html index 84ad96fb9..0595f93c6 100644 --- a/src/ranui/progress/index.html +++ b/src/ranui/progress/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -48,8 +48,8 @@ <r-progress type="primary" percent="40%"></r-progress> <r-progress type="primary" percent="100%"></r-progress>

dot

Point of the progress bar, Default display, set to 'false' can be hidden

html
<r-progress type="drag" percent="30%" dot="false"></r-progress>
 <r-progress type="primary" percent="40%" dot="true"></r-progress>
-<r-progress type="primary" percent="40%"></r-progress>

type

  • primary: Default progress bar, not setting the 'type' attribute is the default
  • drag: Draggable, clickable progress bar (dragging requires' dot 'to be' true ')
html
<r-progress type="drag" percent="30%"></r-progress> <r-progress type="primary" percent="40%"></r-progress>

Method

change

The 'change' event is triggered when the 'percent' and 'total' properties change.

propertyexplains thattype
valueCurrent progress'string or number'
percentCurrent progress'string or number'
totalTotal progress'string or number'

Released under the MIT License.

- +<r-progress type="primary" percent="40%"></r-progress>

type

  • primary: Default progress bar, not setting the 'type' attribute is the default
  • drag: Draggable, clickable progress bar (dragging requires' dot 'to be' true ')
html
<r-progress type="drag" percent="30%"></r-progress> <r-progress type="primary" percent="40%"></r-progress>

Method

change

The 'change' event is triggered when the 'percent' and 'total' properties change.

propertyexplains thattype
valueCurrent progress'string or number'
percentCurrent progress'string or number'
totalTotal progress'string or number'

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/radar/index.html b/src/ranui/radar/index.html index 141feab83..7324e5afa 100644 --- a/src/ranui/radar/index.html +++ b/src/ranui/radar/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -96,8 +96,8 @@ "abilityName": "Critical hit damage", "scoreRate": "50" } -]

Released under the MIT License.

- +]

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/select/index.html b/src/ranui/select/index.html index 6b965700c..f5ca38bb0 100644 --- a/src/ranui/select/index.html +++ b/src/ranui/select/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -83,8 +83,8 @@ <r-option value="185">Mike</r-option> <r-option value="186">Tom</r-option> <r-option value="187">Lucy</r-option> - </r-select>

Released under the MIT License.

- + </r-select>

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/skeleton/index.html b/src/ranui/skeleton/index.html index 9a53cb5b1..5b29e2348 100644 --- a/src/ranui/skeleton/index.html +++ b/src/ranui/skeleton/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

skeleton

Provides a combination of placeholder graphics where you need to wait for content to load.

Code demo

The skeleton length follows the length of the parent element

xml
<r-skeleton ></r-skeleton>

Released under the MIT License.

- +
Skip to content

skeleton

Provides a combination of placeholder graphics where you need to wait for content to load.

Code demo

The skeleton length follows the length of the parent element

xml
<r-skeleton ></r-skeleton>

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/tab/index.html b/src/ranui/tab/index.html index 50b58b0bb..52746751a 100644 --- a/src/ranui/tab/index.html +++ b/src/ranui/tab/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -84,8 +84,8 @@ <r-tab label="tab1">11111</r-tab> <r-tab label="tab2">22222</r-tab> <r-tab label="tab3">33333</r-tab> - </r-tabs>

Released under the MIT License.

- + </r-tabs>

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranui/tabs/index.html b/src/ranui/tabs/index.html index 92f6adf83..337d382a0 100644 --- a/src/ranui/tabs/index.html +++ b/src/ranui/tabs/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -66,8 +66,8 @@ <r-tab icon="home" iconSize="22">tab1</r-tab> <r-tab icon="message" iconSize="22">tab2</r-tab> <r-tab icon="user" iconSize="22">tab3</r-tab> -</r-tabs>

'type'

The style is text, clean,

event '

onchange

Triggered when the switch is complete.

Released under the MIT License.

- +</r-tabs>

'type'

The style is text, clean,

event '

onchange

Triggered when the switch is complete.

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/binaryTree/index.html b/src/ranuts/binaryTree/index.html index 77dc892b3..b68980baf 100644 --- a/src/ranuts/binaryTree/index.html +++ b/src/ranuts/binaryTree/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,14 +37,14 @@ - + -
Skip to content

二叉树的定义

在计算机科学中,二叉树(Binary tree)是每个节点最多只有两个分支(即不存在分支度大于 2 的节点)的树结构。通常分支被称作“左子树”或“右子树”。二叉树的分支具有左右次序,不能随意颠倒[1]。。

二叉树的性质

  • 在二叉树的第 i 层上最多有 2^(i-1)个结点(i>=1)
  • 深度为 h 的二叉树,最多有 2^h-1 个结点,最少有 h 个结点(h>=1)
  • 包含 n 个结点的二叉树的高度至少为(log2n)+1
  • 非空的二叉树,分支度为 0 的总数为 n0,分支度为 2 的总数为 n2,则 n0=n2+1
  • 二叉树的总结点数 n = n1 + n2 + n0
  • 总连线数等于总节点数减一(B = n - 1)
  • 总连线数等于分支度为 2 的节点的两倍加上分支度为 1 的节点(B = n2 _ 2 + n1 _ 1)

二叉树的类型

满二叉树

一棵深度为 k 且有 2k-1 个节点的二叉树称为满二叉树。 除最后一层无任何子节点外,每一层上的所有结点都有两个子结点的二叉树[2]

完全二叉树

一棵深度为 k 的有 n 个结点的二叉树,对树中的结点按从上至下、从左到右的顺序进行编号,如果编号为 i(1≤i≤n)的结点与满二叉树中编号为 i 的结点在二叉树中的位置相同,则这棵二叉树称为完全二叉树。

二叉搜索树

二叉搜索树(BST)又称二叉查找树或二叉排序树。它或者是一棵空树,或者是具有下列性质的二叉树: 若它的左子树不空,则左子树上所有结点的值均小于它的根结点的值; 若它的右子树不空,则右子树上所有结点的值均大于它的根结点的值; 它的左、右子树也分别为二叉排序树。

平衡二叉树

平衡二叉树(AVL)一定是二叉搜索树,且左子树和右子树的高度差的绝对值不超过 1。 平衡二叉树

B 树

B 树属于多叉树又名平衡多路查找树(查找路径不只两个)

B+树

B+树是 B 树的变体,也是一种多路搜索树。

B*树

B* 树是 B+树的变体,在 B+树的非根和非叶子结点再增加指向兄弟的指针;B* 树定义了非叶子结点关键字个数至少为(2/3)M,即块的最低使用率为 2/3(代替 B+树的 1/2)。B 树分配新结点的概率比 B+树要低,空间使用率更高;

红黑树

红黑树是一种平衡二叉查找树的变体,它的左右子树高差有可能大于 1,所以红黑树不是严格意义上的平衡二叉树(AVL),但对它进行平衡的代价较低, 其平均统计性能要强于 AVL 。

遍历

前序遍历

后序遍历

中序遍历

层序遍历

常见算法题

镜像二叉树

重建二叉树

二叉树深度

二叉树节点总数

判断二叉树子结构

输入两棵二叉树 A 和 B,判断 B 是不是 A 的子结构。(ps:约定空树不是任意一个树的子结构)

参考文档

  1. 维基百科二叉树
  2. 百度百科满二叉树

Released under the MIT License.

- +
Skip to content

二叉树的定义

在计算机科学中,二叉树(Binary tree)是每个节点最多只有两个分支(即不存在分支度大于 2 的节点)的树结构。通常分支被称作“左子树”或“右子树”。二叉树的分支具有左右次序,不能随意颠倒[1]。。

二叉树的性质

  • 在二叉树的第 i 层上最多有 2^(i-1)个结点(i>=1)
  • 深度为 h 的二叉树,最多有 2^h-1 个结点,最少有 h 个结点(h>=1)
  • 包含 n 个结点的二叉树的高度至少为(log2n)+1
  • 非空的二叉树,分支度为 0 的总数为 n0,分支度为 2 的总数为 n2,则 n0=n2+1
  • 二叉树的总结点数 n = n1 + n2 + n0
  • 总连线数等于总节点数减一(B = n - 1)
  • 总连线数等于分支度为 2 的节点的两倍加上分支度为 1 的节点(B = n2 _ 2 + n1 _ 1)

二叉树的类型

满二叉树

一棵深度为 k 且有 2k-1 个节点的二叉树称为满二叉树。 除最后一层无任何子节点外,每一层上的所有结点都有两个子结点的二叉树[2]

完全二叉树

一棵深度为 k 的有 n 个结点的二叉树,对树中的结点按从上至下、从左到右的顺序进行编号,如果编号为 i(1≤i≤n)的结点与满二叉树中编号为 i 的结点在二叉树中的位置相同,则这棵二叉树称为完全二叉树。

二叉搜索树

二叉搜索树(BST)又称二叉查找树或二叉排序树。它或者是一棵空树,或者是具有下列性质的二叉树: 若它的左子树不空,则左子树上所有结点的值均小于它的根结点的值; 若它的右子树不空,则右子树上所有结点的值均大于它的根结点的值; 它的左、右子树也分别为二叉排序树。

平衡二叉树

平衡二叉树(AVL)一定是二叉搜索树,且左子树和右子树的高度差的绝对值不超过 1。 平衡二叉树

B 树

B 树属于多叉树又名平衡多路查找树(查找路径不只两个)

B+树

B+树是 B 树的变体,也是一种多路搜索树。

B*树

B* 树是 B+树的变体,在 B+树的非根和非叶子结点再增加指向兄弟的指针;B* 树定义了非叶子结点关键字个数至少为(2/3)M,即块的最低使用率为 2/3(代替 B+树的 1/2)。B 树分配新结点的概率比 B+树要低,空间使用率更高;

红黑树

红黑树是一种平衡二叉查找树的变体,它的左右子树高差有可能大于 1,所以红黑树不是严格意义上的平衡二叉树(AVL),但对它进行平衡的代价较低, 其平均统计性能要强于 AVL 。

遍历

前序遍历

后序遍历

中序遍历

层序遍历

常见算法题

镜像二叉树

重建二叉树

二叉树深度

二叉树节点总数

判断二叉树子结构

输入两棵二叉树 A 和 B,判断 B 是不是 A 的子结构。(ps:约定空树不是任意一个树的子结构)

参考文档

  1. 维基百科二叉树
  2. 百度百科满二叉树

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/bundler/index.html b/src/ranuts/bundler/index.html index c14cfd868..46958a4e4 100644 --- a/src/ranuts/bundler/index.html +++ b/src/ranuts/bundler/index.html @@ -8,12 +8,12 @@ - + - + - + @@ -37,7 +37,7 @@ - + @@ -52,8 +52,8 @@ generate: () => bundle.render() }; }); -}

架构图

Released under the MIT License.

- +}

架构图

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/file/appendFile.html b/src/ranuts/file/appendFile.html index 20bf0892f..1a96afdbb 100644 --- a/src/ranuts/file/appendFile.html +++ b/src/ranuts/file/appendFile.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

AppendFile

追加一些数据到文件内

API

Return

  • Promise
参数说明类型描述
success是否追加成功booleantrue 追加成功 false 追加失败
data追加失败的原因,添加成功后的文件内容any

Options

参数说明类型默认值
path文件路径,需要追加的文件stringundefined
content需要追加的内容string

Example

Released under the MIT License.

- +
Skip to content

AppendFile

追加一些数据到文件内

API

Return

  • Promise
参数说明类型描述
success是否追加成功booleantrue 追加成功 false 追加失败
data追加失败的原因,添加成功后的文件内容any

Options

参数说明类型默认值
path文件路径,需要追加的文件stringundefined
content需要追加的内容string

Example

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/file/fileInfo.html b/src/ranuts/file/fileInfo.html index 5d70959f4..e17283328 100644 --- a/src/ranuts/file/fileInfo.html +++ b/src/ranuts/file/fileInfo.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

QueryFileInfo

查询一个文件的详细信息,一般用于区分文件还是目录,可以通过返回的 data 来判断(data.isDirectory())

API

Return

  • Promise
参数说明类型描述
success是否检查成功booleantrue 成功 false 失败
data文件的信息,或者错误的原因Stats

Options

参数说明类型默认值
path文件路径,需要检查的文件路径stringundefined

Example

Released under the MIT License.

- +
Skip to content

QueryFileInfo

查询一个文件的详细信息,一般用于区分文件还是目录,可以通过返回的 data 来判断(data.isDirectory())

API

Return

  • Promise
参数说明类型描述
success是否检查成功booleantrue 成功 false 失败
data文件的信息,或者错误的原因Stats

Options

参数说明类型默认值
path文件路径,需要检查的文件路径stringundefined

Example

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/file/readDir.html b/src/ranuts/file/readDir.html index 6836bbe82..e90b34ad2 100644 --- a/src/ranuts/file/readDir.html +++ b/src/ranuts/file/readDir.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

ReadDir

读一个目录下的所有文件

API

Return

  • Promise
参数说明类型描述
result目录下所有文件的数组array传入函数的参数

Options

参数说明类型默认值
optionsobject传入函数的参数
dirPath文件的路径Stats

Example

Released under the MIT License.

- +
Skip to content

ReadDir

读一个目录下的所有文件

API

Return

  • Promise
参数说明类型描述
result目录下所有文件的数组array传入函数的参数

Options

参数说明类型默认值
optionsobject传入函数的参数
dirPath文件的路径Stats

Example

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/file/readFile.html b/src/ranuts/file/readFile.html index 1962ee2bd..c05cf3bef 100644 --- a/src/ranuts/file/readFile.html +++ b/src/ranuts/file/readFile.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

ReadFile

观察一个文件是否改变

API

Return

  • Promise
参数说明类型描述
data文件是否被改变booleantrue 文件改变 false 文件没变

Options

参数说明类型默认值
path文件路径,需要监听的文件stringundefined
interval监听文件改变的时间,单位毫秒。number20

Example

Released under the MIT License.

- +
Skip to content

ReadFile

观察一个文件是否改变

API

Return

  • Promise
参数说明类型描述
data文件是否被改变booleantrue 文件改变 false 文件没变

Options

参数说明类型默认值
path文件路径,需要监听的文件stringundefined
interval监听文件改变的时间,单位毫秒。number20

Example

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/file/watchFile.html b/src/ranuts/file/watchFile.html index a90b2125a..959d1f9ed 100644 --- a/src/ranuts/file/watchFile.html +++ b/src/ranuts/file/watchFile.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

WatchFile

观察一个文件是否改变

API

Return

  • Promise
参数说明类型描述
status文件是否被改变booleantrue 文件改变 false 文件没变

Options

参数说明类型默认值
path文件路径,需要监听的文件stringundefined
interval监听文件改变的时间,单位毫秒。number20

Released under the MIT License.

- +
Skip to content

WatchFile

观察一个文件是否改变

API

Return

  • Promise
参数说明类型描述
status文件是否被改变booleantrue 文件改变 false 文件没变

Options

参数说明类型默认值
path文件路径,需要监听的文件stringundefined
interval监听文件改变的时间,单位毫秒。number20

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/file/writeFile.html b/src/ranuts/file/writeFile.html index f43025d42..0043f0c00 100644 --- a/src/ranuts/file/writeFile.html +++ b/src/ranuts/file/writeFile.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

WriteFile

将内容写入文件

API

Return

  • Promise
参数说明类型描述
success是否写入成功booleantrue 成功 false 失败
data写入失败的原因,添加成功后的文件内容和文件路径any

Options

参数说明类型默认值
path文件路径,需要追加的文件stringundefined
content需要追加的内容string

Released under the MIT License.

- +
Skip to content

WriteFile

将内容写入文件

API

Return

  • Promise
参数说明类型描述
success是否写入成功booleantrue 成功 false 失败
data写入失败的原因,添加成功后的文件内容和文件路径any

Options

参数说明类型默认值
path文件路径,需要追加的文件stringundefined
content需要追加的内容string

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/index.html b/src/ranuts/index.html index d1bdb1eb9..8d851b323 100644 --- a/src/ranuts/index.html +++ b/src/ranuts/index.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

ranuts overview

Method list

Methoddescriptiondetail
writeFileWrite to filewriteFile
readFileRead filereadFile
readDirRead the directory and get the names of all the files in the directoryreadDir
watchFileCheck whether the contents of the file have changedwatchFile
queryFileInfoQuery file informationqueryFileInfo
filterObjFilter objectfilterObj
EventEmitterPublish-subscribe classEventEmitter
str2XmlString is converted to xmlstr2Xml
getMimeGets the mime type based on the file format suffixgetMime
getCookieGets the value of the specified cookiewriteFile
formatJsonFormatted JSONformatJson

TOTP

2FA Verification
Generate
code:
expires:

Released under the MIT License.

- +
Skip to content

ranuts overview

Method list

Methoddescriptiondetail
writeFileWrite to filewriteFile
readFileRead filereadFile
readDirRead the directory and get the names of all the files in the directoryreadDir
watchFileCheck whether the contents of the file have changedwatchFile
queryFileInfoQuery file informationqueryFileInfo
filterObjFilter objectfilterObj
EventEmitterPublish-subscribe classEventEmitter
str2XmlString is converted to xmlstr2Xml
getMimeGets the mime type based on the file format suffixgetMime
getCookieGets the value of the specified cookiewriteFile
formatJsonFormatted JSONformatJson

TOTP

2FA Verification
Generate
code:
expires:

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/mimeType/mimeType.html b/src/ranuts/mimeType/mimeType.html index 86cbe4387..ecc273574 100644 --- a/src/ranuts/mimeType/mimeType.html +++ b/src/ranuts/mimeType/mimeType.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -49,8 +49,8 @@ // 'application/vnd.openxmlformats-officedocument.presentationml.presentation const res = getMime('.txt'); console.log(result); -// text/plain

Released under the MIT License.

- +// text/plain

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/mode/subscribe.html b/src/ranuts/mode/subscribe.html index a233545c0..3594de2e1 100644 --- a/src/ranuts/mode/subscribe.html +++ b/src/ranuts/mode/subscribe.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -73,8 +73,8 @@ // 订阅一次,触发一次自动取消 subscribe.once('other', () => { console.log(5); -});

Released under the MIT License.

- +});

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/utils/convertImageToBase64.html b/src/ranuts/utils/convertImageToBase64.html index 098287c70..5a4c99b2c 100644 --- a/src/ranuts/utils/convertImageToBase64.html +++ b/src/ranuts/utils/convertImageToBase64.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -46,8 +46,8 @@ convertImageToBase64(file).then((res) => { console.log(result); -});

Released under the MIT License.

- +});

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/utils/filterObj.html b/src/ranuts/utils/filterObj.html index 187f352fd..2c285245d 100644 --- a/src/ranuts/utils/filterObj.html +++ b/src/ranuts/utils/filterObj.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -54,8 +54,8 @@ console.log(result); -// { age:10 }

Released under the MIT License.

- +// { age:10 }

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/utils/formatJson.html b/src/ranuts/utils/formatJson.html index e45728831..79fd1d0d5 100644 --- a/src/ranuts/utils/formatJson.html +++ b/src/ranuts/utils/formatJson.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -51,8 +51,8 @@ const result = formatJson(json); -console.log(result);

Released under the MIT License.

- +console.log(result);

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/utils/getCookie.html b/src/ranuts/utils/getCookie.html index 1885916a4..0fb3e3491 100644 --- a/src/ranuts/utils/getCookie.html +++ b/src/ranuts/utils/getCookie.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -48,8 +48,8 @@ console.log(result); -// ''

Released under the MIT License.

- +// ''

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/utils/ocr.html b/src/ranuts/utils/ocr.html index cd0122ba1..f4adffcb1 100644 --- a/src/ranuts/utils/ocr.html +++ b/src/ranuts/utils/ocr.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -56,8 +56,8 @@ // And when thou lovest thy pale orb to shroud // Behind the gather’d blackness lost on high; // And when thou dartest from the wind-rent cloud -// Thy placid lightning o’er the awaken’d sky.

Lang Code

Lang CodeLanguage
afrAfrikaans
amhAmharic
araArabic
asmAssamese
azeAzerbaijani
aze_cyrlAzerbaijani - Cyrillic
belBelarusian
benBengali
bodTibetan
bosBosnian
bulBulgarian
catCatalan; Valencian
cebCebuano
cesCzech
chi_simChinese - Simplified
chi_traChinese - Traditional
chrCherokee
cymWelsh
danDanish
deuGerman
dzoDzongkha
ellGreek, Modern (1453-)
engEnglish
enmEnglish, Middle (1100-1500)
epoEsperanto
estEstonian
eusBasque
fasPersian
finFinnish
fraFrench
frkGerman Fraktur
frmFrench, Middle (ca. 1400-1600)
gleIrish
glgGalician
grcGreek, Ancient (-1453)
gujGujarati
hatHaitian; Haitian Creole
hebHebrew
hinHindi
hrvCroatian
hunHungarian
ikuInuktitut
indIndonesian
islIcelandic
itaItalian
ita_oldItalian - Old
javJavanese
jpnJapanese
kanKannada
katGeorgian
kat_oldGeorgian - Old
kazKazakh
khmCentral Khmer
kirKirghiz; Kyrgyz
korKorean
kurKurdish
laoLao
latLatin
lavLatvian
litLithuanian
malMalayalam
marMarathi
mkdMacedonian
mltMaltese
msaMalay
myaBurmese
nepNepali
nldDutch; Flemish
norNorwegian
oriOriya
panPanjabi; Punjabi
polPolish
porPortuguese
pusPushto; Pashto
ronRomanian; Moldavian; Moldovan
rusRussian
sanSanskrit
sinSinhala; Sinhalese
slkSlovak
slvSlovenian
spaSpanish; Castilian
spa_oldSpanish; Castilian - Old
sqiAlbanian
srpSerbian
srp_latnSerbian - Latin
swaSwahili
sweSwedish
syrSyriac
tamTamil
telTelugu
tgkTajik
tglTagalog
thaThai
tirTigrinya
turTurkish
uigUighur; Uyghur
ukrUkrainian
urdUrdu
uzbUzbek
uzb_cyrlUzbek - Cyrillic
vieVietnamese
yidYiddish

Released under the MIT License.

- +// Thy placid lightning o’er the awaken’d sky.

Lang Code

Lang CodeLanguage
afrAfrikaans
amhAmharic
araArabic
asmAssamese
azeAzerbaijani
aze_cyrlAzerbaijani - Cyrillic
belBelarusian
benBengali
bodTibetan
bosBosnian
bulBulgarian
catCatalan; Valencian
cebCebuano
cesCzech
chi_simChinese - Simplified
chi_traChinese - Traditional
chrCherokee
cymWelsh
danDanish
deuGerman
dzoDzongkha
ellGreek, Modern (1453-)
engEnglish
enmEnglish, Middle (1100-1500)
epoEsperanto
estEstonian
eusBasque
fasPersian
finFinnish
fraFrench
frkGerman Fraktur
frmFrench, Middle (ca. 1400-1600)
gleIrish
glgGalician
grcGreek, Ancient (-1453)
gujGujarati
hatHaitian; Haitian Creole
hebHebrew
hinHindi
hrvCroatian
hunHungarian
ikuInuktitut
indIndonesian
islIcelandic
itaItalian
ita_oldItalian - Old
javJavanese
jpnJapanese
kanKannada
katGeorgian
kat_oldGeorgian - Old
kazKazakh
khmCentral Khmer
kirKirghiz; Kyrgyz
korKorean
kurKurdish
laoLao
latLatin
lavLatvian
litLithuanian
malMalayalam
marMarathi
mkdMacedonian
mltMaltese
msaMalay
myaBurmese
nepNepali
nldDutch; Flemish
norNorwegian
oriOriya
panPanjabi; Punjabi
polPolish
porPortuguese
pusPushto; Pashto
ronRomanian; Moldavian; Moldovan
rusRussian
sanSanskrit
sinSinhala; Sinhalese
slkSlovak
slvSlovenian
spaSpanish; Castilian
spa_oldSpanish; Castilian - Old
sqiAlbanian
srpSerbian
srp_latnSerbian - Latin
swaSwahili
sweSwedish
syrSyriac
tamTamil
telTelugu
tgkTajik
tglTagalog
thaThai
tirTigrinya
turTurkish
uigUighur; Uyghur
ukrUkrainian
urdUrdu
uzbUzbek
uzb_cyrlUzbek - Cyrillic
vieVietnamese
yidYiddish

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/utils/str2xml.html b/src/ranuts/utils/str2xml.html index f193b5a18..87b9b016a 100644 --- a/src/ranuts/utils/str2xml.html +++ b/src/ranuts/utils/str2xml.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -49,8 +49,8 @@ const icon = str2Xml(svg, 'image/svg+xml'); -document.body.appendChild(icon);

Released under the MIT License.

- +document.body.appendChild(icon);

Released under the MIT License.

+ \ No newline at end of file diff --git a/src/ranuts/utils/task.html b/src/ranuts/utils/task.html index 6f7c26ae7..71fdcf0d6 100644 --- a/src/ranuts/utils/task.html +++ b/src/ranuts/utils/task.html @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -48,8 +48,8 @@ const time = taskEnd(taskId); -console.log('task 执行花费的时间', time);

二.new Date().getTime()

new Date().getTime() 返回一个数值,表示从 1970 年 1 月 1 日 0 时 0 分 0 秒(UTC,即协调世界时)距离该日期对象所代表时间的毫秒数。用来计算 JS 执行时间会有两个问题:

  1. 某些情况下,毫秒级精度可能不够。
  2. new Date() 解析的时间在不同浏览器,或者不同设备上可能并不一致。MDN 说明

    由于浏览器之间的差异与不一致性,强烈不推荐使用 Date 构造函数来解析日期字符串 (或使用与其等价的 Date.parse)。对 RFC 2822 格式的日期仅有约定俗成的支持。对 ISO 8601 格式的支持中,仅有日期的串 (例如 "1970-01-01") 会被处理为 UTC 而不是本地时间,与其他格式的串的处理不同。

三.console.time(), console.timeEnd()

启动一个计时器来跟踪某一个操作的占用时长。每一个计时器必须拥有唯一的名字,页面中最多能同时运行 10,000 个计时器。当以此计时器名字为参数调用 console.timeEnd() 时,浏览器将以毫秒为单位,输出对应计时器所经过的时间。比起new Date().getTime(),统计时间更加精确,可以统计到 0.001 毫秒(比如:0.134ms)

四.performance.now()

performance.now()返回的时间精度最高可达微秒级,且不会受到系统时间的影响(系统时钟可能会被手动调整或被 NTP 等软件篡改)。另外,performance.timing.navigationStart + performance.now() 约等于 Date.now()。因此对于统计 JS 执行耗时方面,更推荐使用performance.now()

注意:为了提供对定时攻击和指纹的保护,performance.now() 的精度可能会根据浏览器的设置而被舍弃。 在 Firefox 中,privacy.reduceTimerPrecision 偏好是默认启用的,默认值为 1ms。可以启用 privacy.resistFingerprinting 这将精度改为 100ms 或privacy.resistFingerprinting.reduceTimerPrecision.microseconds 的值,以较大者为准。

Released under the MIT License.

- +console.log('task 执行花费的时间', time);

二.new Date().getTime()

new Date().getTime() 返回一个数值,表示从 1970 年 1 月 1 日 0 时 0 分 0 秒(UTC,即协调世界时)距离该日期对象所代表时间的毫秒数。用来计算 JS 执行时间会有两个问题:

  1. 某些情况下,毫秒级精度可能不够。
  2. new Date() 解析的时间在不同浏览器,或者不同设备上可能并不一致。MDN 说明

    由于浏览器之间的差异与不一致性,强烈不推荐使用 Date 构造函数来解析日期字符串 (或使用与其等价的 Date.parse)。对 RFC 2822 格式的日期仅有约定俗成的支持。对 ISO 8601 格式的支持中,仅有日期的串 (例如 "1970-01-01") 会被处理为 UTC 而不是本地时间,与其他格式的串的处理不同。

三.console.time(), console.timeEnd()

启动一个计时器来跟踪某一个操作的占用时长。每一个计时器必须拥有唯一的名字,页面中最多能同时运行 10,000 个计时器。当以此计时器名字为参数调用 console.timeEnd() 时,浏览器将以毫秒为单位,输出对应计时器所经过的时间。比起new Date().getTime(),统计时间更加精确,可以统计到 0.001 毫秒(比如:0.134ms)

四.performance.now()

performance.now()返回的时间精度最高可达微秒级,且不会受到系统时间的影响(系统时钟可能会被手动调整或被 NTP 等软件篡改)。另外,performance.timing.navigationStart + performance.now() 约等于 Date.now()。因此对于统计 JS 执行耗时方面,更推荐使用performance.now()

注意:为了提供对定时攻击和指纹的保护,performance.now() 的精度可能会根据浏览器的设置而被舍弃。 在 Firefox 中,privacy.reduceTimerPrecision 偏好是默认启用的,默认值为 1ms。可以启用 privacy.resistFingerprinting 这将精度改为 100ms 或privacy.resistFingerprinting.reduceTimerPrecision.microseconds 的值,以较大者为准。

Released under the MIT License.

+ \ No newline at end of file diff --git "a/src/types/TS\347\261\273\345\236\213.html" "b/src/types/TS\347\261\273\345\236\213.html" index 12d5aa72b..8e6c62d56 100644 --- "a/src/types/TS\347\261\273\345\236\213.html" +++ "b/src/types/TS\347\261\273\345\236\213.html" @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -89,8 +89,8 @@ age?: number; } -type tuple = [string, number?];

Last updated:

Released under the MIT License.

- +type tuple = [string, number?];

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git "a/src/types/\346\250\241\345\274\217\345\214\271\351\205\215.html" "b/src/types/\346\250\241\345\274\217\345\214\271\351\205\215.html" index c73fbccdd..d5c41bbe9 100644 --- "a/src/types/\346\250\241\345\274\217\345\214\271\351\205\215.html" +++ "b/src/types/\346\250\241\345\274\217\345\214\271\351\205\215.html" @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -52,8 +52,8 @@ new (name: string): Person; }

这里的 PersonConstructor 返回的是 Person 类型的实例对象,这个也可以通过模式匹配取出来。

ts
type GetInstanceType<C extends new (...args: unknown[]) => unknown> = C extends new (...args: unknown[]) => infer T
   ? T
-  : unknown;

Last updated:

Released under the MIT License.

- + : unknown;

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git "a/src/types/\347\261\273\345\236\213\350\277\220\347\256\227.html" "b/src/types/\347\261\273\345\236\213\350\277\220\347\256\227.html" index 58ef2c256..3ba51a767 100644 --- "a/src/types/\347\261\273\345\236\213\350\277\220\347\256\227.html" +++ "b/src/types/\347\261\273\345\236\213\350\277\220\347\256\227.html" @@ -8,11 +8,11 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -68,8 +68,8 @@ // type res = { // aaa:[1,1,1] // bbb:[2,2,2] -// }

这里的 & string 可能大家会迷惑,解释一下:

因为索引类型(对象、class 等)可以用 string、number 和 symbol 作为 key,这里 keyof T 取出的索引就是 string | number | symbol 的联合类型,和 string 取交叉部分就只剩下 string 了。就像前面所说,交叉类型会把同一类型做合并,不同类型舍弃。

因为 js 处理对象比较多,所以索引类型的映射比较重要。

Last updated:

Released under the MIT License.

- +// }

这里的 & string 可能大家会迷惑,解释一下:

因为索引类型(对象、class 等)可以用 string、number 和 symbol 作为 key,这里 keyof T 取出的索引就是 string | number | symbol 的联合类型,和 string 取交叉部分就只剩下 string 了。就像前面所说,交叉类型会把同一类型做合并,不同类型舍弃。

因为 js 处理对象比较多,所以索引类型的映射比较重要。

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git "a/src/types/\351\253\230\347\272\247\347\261\273\345\236\213.html" "b/src/types/\351\253\230\347\272\247\347\261\273\345\236\213.html" index 9764bf833..9be239aff 100644 --- "a/src/types/\351\253\230\347\272\247\347\261\273\345\236\213.html" +++ "b/src/types/\351\253\230\347\272\247\347\261\273\345\236\213.html" @@ -8,11 +8,11 @@ - + - + - + @@ -36,14 +36,14 @@ - + -
Skip to content

TypeScript 内置的高级类型

Parameters

Parameters 用于提取函数类型的参数类型。

ReturnType

ReturnType 用于提取函数类型的返回值类型。

ConstructorParameters

构造器类型和函数类型的区别就是可以被 new。

Parameters 用于提取函数参数的类型,而 ConstructorParameters 用于提取构造器参数的类型。

InstanceType

提取了构造器参数的类型,自然也可以提取构造器返回值的类型,就是 InstanceType。

ThisParameterType

OmitThisParameter

Partial

Required

Readonly

Pick

Record

Exclude

Extract

Omit

Awaited

NonNullable

Uppercase

Lowercase

Capitalize

Uncapitalize

总结

比如用模式匹配可以实现:Parameters、ReturnType、ConstructorParameters、InstanceType、ThisParameterType。

用模式匹配 + 重新构造可以实现:OmitThisParameter

用重新构造可以实现:Partial、Required、Readonly、Pick、Record

用模式匹配 + 递归可以实现: Awaited

用联合类型在分布式条件类型的特性可以实现: Exclude

此外还有 NonNullable 和四个编译器内部实现的类型:Uppercase、Lowercase、Capitalize、Uncapitalize。

Last updated:

Released under the MIT License.

- +
Skip to content

TypeScript 内置的高级类型

Parameters

Parameters 用于提取函数类型的参数类型。

ReturnType

ReturnType 用于提取函数类型的返回值类型。

ConstructorParameters

构造器类型和函数类型的区别就是可以被 new。

Parameters 用于提取函数参数的类型,而 ConstructorParameters 用于提取构造器参数的类型。

InstanceType

提取了构造器参数的类型,自然也可以提取构造器返回值的类型,就是 InstanceType。

ThisParameterType

OmitThisParameter

Partial

Required

Readonly

Pick

Record

Exclude

Extract

Omit

Awaited

NonNullable

Uppercase

Lowercase

Capitalize

Uncapitalize

总结

比如用模式匹配可以实现:Parameters、ReturnType、ConstructorParameters、InstanceType、ThisParameterType。

用模式匹配 + 重新构造可以实现:OmitThisParameter

用重新构造可以实现:Partial、Required、Readonly、Pick、Record

用模式匹配 + 递归可以实现: Awaited

用联合类型在分布式条件类型的特性可以实现: Exclude

此外还有 NonNullable 和四个编译器内部实现的类型:Uppercase、Lowercase、Capitalize、Uncapitalize。

Last updated:

Released under the MIT License.

+ \ No newline at end of file diff --git a/sw1726377850.js b/sw1726385521.js similarity index 60% rename from sw1726377850.js rename to sw1726385521.js index 48de780a5..83ec1a7c7 100644 --- a/sw1726377850.js +++ b/sw1726385521.js @@ -29,290 +29,294 @@ const SERVICE_WORK_CACHE_FILE_PATHS = [ "/ran/screenshots_748x1340.jpg", "/ran/icon.png", "/ran/icon_144.png", -"/ran/assets/src_ranuts_utils_ocr.md.gK2Ihzud.js", +"/ran/assets/cn_src_article_astParse_tokenizer.md.4wYw3ic3.js", "/ran/assets/export.ne8l5ppO.jpeg", +"/ran/assets/src_types_类型运算.md.B97x76_P.js", "/ran/assets/extra.Da45cF33.jpeg", -"/ran/assets/src_ranui_image_index.md.DFVz4CUQ.js", -"/ran/assets/cn_src_ranui_modal_index.md.DsB0cf0q.js", +"/ran/assets/cn_src_ranuts_file_appendFile.md.D2XkhH2B.js", +"/ran/assets/src_ranuts_utils_formatJson.md.CA-QmLAe.lean.js", "/ran/assets/shell.CZ-z1IVg.gif", -"/ran/assets/src_ranuts_utils_convertImageToBase64.md.CgDGIUsS.lean.js", -"/ran/assets/src_ranui_preview_index.md.BHd7KxZT.lean.js", -"/ran/assets/cn_src_ranuts_utils_getCookie.md.OZ5LyZvi.js", -"/ran/assets/index.md.CgG_GtZv.js", -"/ran/assets/src_ranui_math_index.md.B-FtK30k.lean.js", -"/ran/assets/cn_src_article_sort_count_index.md.bjLrOBPd.js", +"/ran/assets/cn_src_article_video.md.BnS7BWvN.js", +"/ran/assets/cn_src_types_类型运算.md.J_LQEvnq.js", +"/ran/assets/cn_src_article_systemDesign.md.CL_WM1Zy.lean.js", +"/ran/assets/cn_src_article_sort_quick_index.md.CzO4Oomr.js", "/ran/assets/inter-roman-cyrillic.C5lxZ8CY.woff2", -"/ran/assets/src_ranui_input_index.md.CeyO-5oi.lean.js", +"/ran/assets/cn_src_ranui_input_index.md.B_1B0kId.js", +"/ran/assets/src_article_babel.md.DbGK9noy.js", +"/ran/assets/src_ranui_tabs_index.md.DlIC1yii.js", +"/ran/assets/src_article_designMode.md.Cygn2uVN.js", +"/ran/assets/cn_src_article_visual.md.tnhp0Xqs.lean.js", "/ran/assets/inter-italic-greek-ext.1u6EdAuj.woff2", -"/ran/assets/cn_src_types_类型运算.md.BMZHsZTS.lean.js", -"/ran/assets/src_article_sort_insert_index.md.Bv2-9O3S.js", -"/ran/assets/cn_src_types_高级类型.md.C2EkbCmJ.lean.js", -"/ran/assets/src_article_typescript_recursion.md.DcYohhN4.lean.js", -"/ran/assets/src_article_designMode.md.DVOb8Fuj.lean.js", -"/ran/assets/src_ranuts_utils_ocr.md.gK2Ihzud.lean.js", -"/ran/assets/src_ranui_icon_index.md.DsA9f7NJ.lean.js", -"/ran/assets/cn_src_article_sort_count_index.md.bjLrOBPd.lean.js", +"/ran/assets/cn_src_article_sort_select_index.md.Dg9QrcP5.lean.js", +"/ran/assets/src_ranui_input_index.md.-VqhWNTp.js", +"/ran/assets/src_ranuts_file_readFile.md.HwhoeptV.js", +"/ran/assets/src_article_sort_bucket_index.md.6-1zsle_.lean.js", +"/ran/assets/cn_src_ranuts_file_fileInfo.md.Bm1gqueF.js", "/ran/assets/组合.StqZ1pDc.png", -"/ran/assets/src_types_模式匹配.md.CHNYs6NO.lean.js", "/ran/assets/heap.D4myjC6C.gif", -"/ran/assets/src_article_bundle.md.DZGRRaw8.js", -"/ran/assets/cn_src_ranuts_utils_ocr.md.BVb2T5rQ.js", -"/ran/assets/src_ranui_tabs_index.md.BIpNb4vr.js", -"/ran/assets/cn_src_ranui_message_index.md.8eVMbJN5.lean.js", -"/ran/assets/cn_src_article_typescript_unionType.md.D7LW3SoG.js", -"/ran/assets/src_ranui_select_index.md.n79mfmVf.lean.js", -"/ran/assets/src_ranui_message_index.md.ydgBavCZ.js", -"/ran/assets/src_ranuts_index.md.BxrdPLgS.lean.js", +"/ran/assets/cn_src_article_typescript_recursion.md.BLpcY1tW.js", +"/ran/assets/src_ranuts_utils_convertImageToBase64.md.DhOUyQ-b.lean.js", +"/ran/assets/cn_src_ranuts_file_writeFile.md.A4SqY7IV.lean.js", +"/ran/assets/cn_src_ranuts_utils_ocr.md.CNe-dlRv.lean.js", +"/ran/assets/cn_src_ranui_modal_index.md.CUVT-ut7.js", "/ran/assets/ms_support.CaZSSiRt.webp", "/ran/assets/complexity.DSLVsjHt.png", -"/ran/assets/src_ranuts_mimeType_mimeType.md.Ie06XqVB.js", "/ran/assets/继承.Dta6_xdc.png", -"/ran/assets/cn_src_article_sort_heap_index.md.CT_uZ0AG.lean.js", -"/ran/assets/src_article_sort_insert_index.md.Bv2-9O3S.lean.js", -"/ran/assets/src_ranui_skeleton_index.md.Brp_dtir.lean.js", -"/ran/assets/src_article_imagemin.md.BUcXrKer.lean.js", -"/ran/assets/src_ranui_progress_index.md.CANtKpM_.lean.js", -"/ran/assets/cn_src_article_docPreview.md.DeliAFz1.lean.js", -"/ran/assets/src_article_sort_bubble_index.md.DsiOo06S.js", -"/ran/assets/src_article_sort_heap_index.md.BwsCoEDM.lean.js", -"/ran/assets/cn_index.md.DBuoKLX0.js", -"/ran/assets/src_types_类型运算.md.DI_Hlf12.lean.js", -"/ran/assets/cn_src_ranui_image_index.md.DO1YIYRf.js", +"/ran/assets/cn_src_ranuts_utils_ocr.md.CNe-dlRv.js", +"/ran/assets/src_article_typescript_recursion.md.DG6i_SHd.lean.js", +"/ran/assets/cn_src_ranuts_file_readFile.md.CfJHCkuJ.lean.js", +"/ran/assets/src_ranui_progress_index.md.m5OqoR_m.js", +"/ran/assets/src_article_sort_shell_index.md.jumHap7P.js", +"/ran/assets/cn_src_ranuts_utils_convertImageToBase64.md.BVxP3Y4J.js", +"/ran/assets/cn_src_ranui_progress_index.md.CmfZXYGe.lean.js", "/ran/assets/inter-roman-latin.Di8DUHzh.woff2", -"/ran/assets/cn_src_ranuts_mimeType_mimeType.md.CCxE8Y5Q.js", -"/ran/assets/cn_src_ranui_tabs_index.md.1aqMePxF.lean.js", -"/ran/assets/src_article_javascript_domLoad.md.C6qPDJam.lean.js", -"/ran/assets/src_article_sort_radix_index.md.mikZKipj.lean.js", -"/ran/assets/src_ranui_popover_index.md.Bf9XaTFQ.js", +"/ran/assets/cn_src_article_visual.md.tnhp0Xqs.js", +"/ran/assets/cn_src_ranui_index.md.ws7DkRqw.lean.js", +"/ran/assets/src_article_typescript_unionType.md.Dhn_HEeP.js", +"/ran/assets/src_ranuts_file_fileInfo.md.BtUHbk2k.lean.js", +"/ran/assets/cn_src_article_functionalProgramming.md.DAKK45h5.js", +"/ran/assets/cn_src_ranuts_mode_subscribe.md.B_yqkhda.js", +"/ran/assets/cn_src_note_docker.md.CFz9ipKs.lean.js", +"/ran/assets/cn_src_ranui_loading_index.md.CyfyGH-8.js", +"/ran/assets/cn_src_ranui_icon_index.md.C2sGRB8-.js", +"/ran/assets/cn_src_ranui_radar_index.md.BnFj7a-D.lean.js", +"/ran/assets/src_ranui_preview_index.md.DPHFMZv9.lean.js", +"/ran/assets/cn_src_ranui_popover_index.md.70mC-Rqv.lean.js", +"/ran/assets/cn_src_article_imagemin.md.DVJvJILr.lean.js", "/ran/assets/safari_support_media.Bafr23bR.webp", +"/ran/assets/src_ranuts_utils_str2xml.md.Bx2-A0rM.js", +"/ran/assets/src_article_sort_merge_index.md.D-rV1sbV.js", "/ran/assets/Program.BBf_t-me.jpeg", "/ran/assets/wps_office.DiET-U8x.webp", -"/ran/assets/cn_src_note_docker.md.C8ga9dP1.js", -"/ran/assets/src_ranuts_file_writeFile.md.AwFJpmSz.js", -"/ran/assets/cn_src_article_functionalProgramming.md.CBLq1EiU.lean.js", -"/ran/assets/cn_src_ranuts_utils_task.md.Dgr2bcgV.js", +"/ran/assets/cn_src_ranuts_utils_str2xml.md.DH5nvnpc.js", +"/ran/assets/cn_src_ranui_tabs_index.md.C99PdVnz.lean.js", +"/ran/assets/cn_src_ranuts_file_appendFile.md.D2XkhH2B.lean.js", +"/ran/assets/src_article_sort_quick_index.md.BbsLDEfT.lean.js", +"/ran/assets/cn_src_article_sort_quick_index.md.CzO4Oomr.lean.js", +"/ran/assets/cn_src_ranui_preview_index.md.CxTR4mUp.js", +"/ran/assets/src_ranui_radar_index.md.DdUb2lWU.lean.js", +"/ran/assets/cn_src_article_javascript_domLoad.md.Cjc9hOHo.js", +"/ran/assets/cn_src_article_sort_merge_index.md.CdCiiEzt.lean.js", "/ran/assets/策略.BAijEgGz.png", -"/ran/assets/src_ranui_popover_index.md.Bf9XaTFQ.lean.js", -"/ran/assets/src_ranuts_file_fileInfo.md.B3-PUZm0.lean.js", -"/ran/assets/src_article_typescript_pattern.md.C85RnjQq.js", -"/ran/assets/cn_src_article_typescript_calculate.md.BrhBa9BE.js", +"/ran/assets/src_article_sort_shell_index.md.jumHap7P.lean.js", +"/ran/assets/cn_src_ranuts_utils_str2xml.md.DH5nvnpc.lean.js", +"/ran/assets/src_ranuts_utils_getCookie.md.Cr2WSzYV.js", +"/ran/assets/cn_index.md.-8ngwy_i.lean.js", "/ran/assets/inter-italic-vietnamese.BSbpV94h.woff2", +"/ran/assets/src_ranuts_index.md.BvJRrWnB.js", +"/ran/assets/src_ranuts_file_fileInfo.md.BtUHbk2k.js", "/ran/assets/状态.Bt_a2OKX.png", -"/ran/assets/cn_src_article_typescript_pattern.md.BLHldN0n.js", -"/ran/assets/src_ranui_tabs_index.md.BIpNb4vr.lean.js", -"/ran/assets/cn_src_ranui_input_index.md.BkI4N5qK.js", -"/ran/assets/src_ranuts_utils_formatJson.md.aozF1R3k.js", -"/ran/assets/cn_src_article_typescript_unionType.md.D7LW3SoG.lean.js", -"/ran/assets/cn_src_ranui_progress_index.md.C4wZ-wFu.lean.js", -"/ran/assets/src_ranuts_utils_task.md.d4vnLy6C.lean.js", -"/ran/assets/src_ranui_modal_index.md.QXH3NLdT.lean.js", +"/ran/assets/cn_src_ranui_player_index.md.DE3v144q.js", +"/ran/assets/src_ranuts_bundler_index.md.Duihjwnb.js", +"/ran/assets/src_ranuts_binaryTree_index.md.CPSkXGOJ.js", +"/ran/assets/cn_src_ranuts_utils_formatJson.md.CJeC9Vqe.lean.js", +"/ran/assets/src_article_javascript_domLoad.md.BGlU-nCp.js", +"/ran/assets/cn_src_ranui_skeleton_index.md.Dsrc0lLs.js", +"/ran/assets/src_ranuts_bundler_index.md.Duihjwnb.lean.js", +"/ran/assets/src_ranui_select_index.md.DPzRRhtl.js", +"/ran/assets/cn_src_ranui_modal_index.md.CUVT-ut7.lean.js", +"/ran/assets/src_article_bundle.md.n4vvn7Ig.js", +"/ran/assets/src_ranui_tab_index.md.kRkTGQVS.js", +"/ran/assets/cn_src_ranuts_mimeType_mimeType.md.BXKqytdq.lean.js", +"/ran/assets/cn_src_ranui_button_index.md.BG4PNyqv.js", +"/ran/assets/cn_src_article_sort_bucket_index.md.BBjzg8PH.lean.js", "/ran/assets/wps_office_price.ler9htjh.webp", -"/ran/assets/src_article_typescript_unionType.md.DLhAxtq8.lean.js", -"/ran/assets/src_article_sort_merge_index.md.C0x8sv1w.js", -"/ran/assets/cn_src_ranui_icon_index.md.C8Joalst.lean.js", -"/ran/assets/cn_src_ranui_image_index.md.DO1YIYRf.lean.js", -"/ran/assets/src_article_sort_quick_index.md.M3hZ_ic7.js", -"/ran/assets/cn_src_ranuts_utils_formatJson.md.DC5RDora.lean.js", -"/ran/assets/src_article_sort_radix_index.md.mikZKipj.js", -"/ran/assets/src_ranuts_utils_formatJson.md.aozF1R3k.lean.js", -"/ran/assets/cn_src_ranuts_file_writeFile.md.DX-HWmZs.lean.js", -"/ran/assets/cn_src_ranui_player_index.md.HFCY959w.lean.js", -"/ran/assets/cn_src_ranui_index.md.7MnYzmyC.lean.js", -"/ran/assets/cn_src_note_centos.md.CbGizVxk.lean.js", +"/ran/assets/src_ranui_popover_index.md.D-FeGUo5.js", +"/ran/assets/cn_src_article_designMode.md.DlwQ1o0o.js", +"/ran/assets/cn_src_ranui_input_index.md.B_1B0kId.lean.js", +"/ran/assets/cn_src_ranui_preview_index.md.CxTR4mUp.lean.js", +"/ran/assets/src_ranuts_utils_formatJson.md.CA-QmLAe.js", +"/ran/assets/src_article_typescript_recursion.md.DG6i_SHd.js", "/ran/assets/File.BiH2GpuW.jpeg", "/ran/assets/ms_excel.CJXFi2bf.webp", +"/ran/assets/src_article_functionalProgramming.md.DpsP-ua6.js", "/ran/assets/axtexplorerSave.a5hTrvd2.jpeg", -"/ran/assets/src_article_sort_count_index.md.BFT1IsSo.lean.js", +"/ran/assets/src_article_typescript_index.md.NB2OS2YQ.lean.js", +"/ran/assets/src_ranui_index.md.DMQuqK0O.js", "/ran/assets/firefox_support_media.BLmSeBNy.webp", -"/ran/assets/cn_src_article_sort_index.md.Bgve4TGK.js", -"/ran/assets/cn_src_ranuts_index.md.pPHvoy25.js", -"/ran/assets/cn_src_ranui_button_index.md.12XVTc4M.js", -"/ran/assets/cn_src_ranui_tab_index.md.CVOm96LC.lean.js", -"/ran/assets/src_article_sort_shell_index.md.mb62UxpQ.lean.js", -"/ran/assets/cn_src_article_imagemin.md.CIvMu-pO.js", -"/ran/assets/src_article_typescript_reconstruction.md.D7vCk3k6.js", -"/ran/assets/src_ranuts_file_readDir.md.HSsQqOjC.lean.js", -"/ran/assets/src_ranuts_file_appendFile.md.D932HMN4.lean.js", -"/ran/assets/cn_src_ranuts_mode_subscribe.md.BPC8IsHd.lean.js", -"/ran/assets/cn_src_ranuts_file_appendFile.md.CtR2NfUK.js", -"/ran/assets/src_ranuts_bundler_index.md.mnKBYV8g.lean.js", -"/ran/assets/cn_src_article_sort_insert_index.md.DyiV5HPJ.lean.js", -"/ran/assets/cn_src_ranui_message_index.md.8eVMbJN5.js", -"/ran/assets/cn_src_ranuts_utils_str2xml.md.CtAVLpga.js", +"/ran/assets/cn_src_ranuts_utils_getCookie.md.BOR_GUfN.lean.js", +"/ran/assets/cn_src_ranuts_file_writeFile.md.A4SqY7IV.js", +"/ran/assets/src_ranui_image_index.md.CR-zpzpn.lean.js", +"/ran/assets/src_article_bundle.md.n4vvn7Ig.lean.js", +"/ran/assets/src_ranui_modal_index.md.WIJTopSI.js", +"/ran/assets/src_article_sort_index.md.BIPYK-Ok.js", +"/ran/assets/src_types_模式匹配.md.BUM7A3x9.js", +"/ran/assets/src_ranuts_binaryTree_index.md.CPSkXGOJ.lean.js", +"/ran/assets/src_article_typescript_calculate.md.fkCRSr5X.lean.js", +"/ran/assets/cn_src_ranuts_bundler_index.md.BP8CcmbM.js", +"/ran/assets/src_article_sort_insert_index.md.DWXFaZLt.lean.js", +"/ran/assets/cn_src_ranuts_utils_convertImageToBase64.md.BVxP3Y4J.lean.js", "/ran/assets/ms_ppt.C2zYd_IC.webp", "/ran/assets/video_format.CRMCTmKB.webp", -"/ran/assets/cn_src_ranui_radar_index.md.DmjI63Gt.lean.js", +"/ran/assets/cn_src_ranui_image_index.md.DRJD-95R.lean.js", "/ran/assets/抽象工厂.DlwNEriZ.png", -"/ran/assets/cn_src_note_docker.md.C8ga9dP1.lean.js", -"/ran/assets/cn_src_ranuts_file_readFile.md.D1dihUhP.lean.js", +"/ran/assets/cn_src_article_typescript_index.md.CoyT_emr.lean.js", "/ran/assets/axtexplorer.D7PG-3cx.jpeg", -"/ran/assets/src_ranuts_utils_task.md.d4vnLy6C.js", -"/ran/assets/src_ranuts_utils_getCookie.md.-ZpjU0cd.lean.js", -"/ran/assets/cn_src_article_typescript_index.md.CHVcwHl4.lean.js", -"/ran/assets/src_ranui_checkbox_index.md.DZCOjcke.lean.js", -"/ran/assets/cn_src_ranui_checkbox_index.md.DDrq4ZE6.lean.js", -"/ran/assets/cn_src_ranui_checkbox_index.md.DDrq4ZE6.js", -"/ran/assets/src_article_sort_merge_index.md.C0x8sv1w.lean.js", -"/ran/assets/cn_src_article_sort_shell_index.md.DLjWkzsn.lean.js", -"/ran/assets/cn_src_ranuts_utils_str2xml.md.CtAVLpga.lean.js", +"/ran/assets/src_article_sort_count_index.md.D2Qv7jPN.js", +"/ran/assets/src_ranui_math_index.md.BJBOIEyn.js", +"/ran/assets/cn_src_article_typescript_calculate.md.CCtF2BN5.js", +"/ran/assets/src_ranui_popover_index.md.D-FeGUo5.lean.js", +"/ran/assets/src_article_sort_insert_index.md.DWXFaZLt.js", +"/ran/assets/cn_src_article_sort_radix_index.md.C33KYACF.lean.js", +"/ran/assets/src_ranui_progress_index.md.m5OqoR_m.lean.js", +"/ran/assets/src_article_astParse_tokenizer.md.W6tYDAhq.js", +"/ran/assets/src_ranui_icon_index.md.DUb9Ziec.js", +"/ran/assets/cn_src_ranuts_bundler_index.md.BP8CcmbM.lean.js", +"/ran/assets/cn_src_ranui_index.md.ws7DkRqw.js", "/ran/assets/bilibili_video_code.DgWtgAEf.webp", "/ran/assets/tiktik_video_demo.mxxBzLay.webp", -"/ran/assets/cn_src_ranui_modal_index.md.DsB0cf0q.lean.js", +"/ran/assets/src_ranui_loading_index.md.adGvJ3b3.js", +"/ran/assets/src_ranui_checkbox_index.md.CRJDIbp0.js", "/ran/assets/Class.Cx5QD1OX.jpeg", -"/ran/assets/src_ranui_button_index.md.Ctjoisvd.js", -"/ran/assets/cn_src_article_typescript_pattern.md.BLHldN0n.lean.js", -"/ran/assets/cn_src_article_typescript_recursion.md.DeW8HIDH.lean.js", -"/ran/assets/src_article_designMode.md.DVOb8Fuj.js", -"/ran/assets/src_ranui_input_index.md.CeyO-5oi.js", -"/ran/assets/cn_src_ranuts_utils_filterObj.md.RUrQuB-I.lean.js", -"/ran/assets/cn_src_article_sort_select_index.md.CkHR0au5.lean.js", -"/ran/assets/src_article_typescript_unionType.md.DLhAxtq8.js", -"/ran/assets/cn_src_article_sort_bubble_index.md.BMi-t-6w.lean.js", -"/ran/assets/src_ranui_radar_index.md.CcKS4hpA.lean.js", -"/ran/assets/src_ranuts_binaryTree_index.md.CCmdOl3F.js", -"/ran/assets/src_article_sort_bucket_index.md.ZfhUbkFZ.js", +"/ran/assets/cn_src_note_centos.md.D0i6PxrH.lean.js", +"/ran/assets/cn_src_article_typescript_recursion.md.BLpcY1tW.lean.js", +"/ran/assets/src_ranuts_file_watchFile.md.CRULQFIp.js", +"/ran/assets/src_ranui_skeleton_index.md.DjequKLz.lean.js", +"/ran/assets/cn_src_ranui_skeleton_index.md.Dsrc0lLs.lean.js", +"/ran/assets/cn_src_ranui_checkbox_index.md.fJgM4YS5.js", +"/ran/assets/app.CjguJqSp.js", "/ran/assets/访问者.aEI4m-5a.png", -"/ran/assets/app.SVYAsRG1.js", +"/ran/assets/src_ranui_button_index.md.DlhFg8_e.lean.js", "/ran/assets/Comment.BYtNY-L1.jpeg", -"/ran/assets/src_ranuts_utils_filterObj.md.Dn4oR--y.js", -"/ran/assets/src_ranuts_mimeType_mimeType.md.Ie06XqVB.lean.js", -"/ran/assets/cn_src_ranuts_utils_task.md.Dgr2bcgV.lean.js", +"/ran/assets/cn_src_article_docPreview.md.Dgo5TWxU.lean.js", +"/ran/assets/src_ranuts_utils_convertImageToBase64.md.DhOUyQ-b.js", +"/ran/assets/src_article_sort_bubble_index.md.CyhYCOsV.lean.js", "/ran/assets/备忘录.meL0YZxn.jpg", -"/ran/assets/src_ranuts_mode_subscribe.md.B3N1C4oA.lean.js", -"/ran/assets/src_article_sort_shell_index.md.mb62UxpQ.js", -"/ran/assets/cn_src_article_sort_select_index.md.CkHR0au5.js", -"/ran/assets/src_ranui_icon_index.md.DsA9f7NJ.js", -"/ran/assets/src_article_typescript_pattern.md.C85RnjQq.lean.js", -"/ran/assets/cn_src_ranui_select_index.md.BErf4YsQ.js", -"/ran/assets/cn_src_article_sort_shell_index.md.DLjWkzsn.js", -"/ran/assets/cn_src_article_sort_bubble_index.md.BMi-t-6w.js", -"/ran/assets/cn_src_ranui_tabs_index.md.1aqMePxF.js", -"/ran/assets/src_ranui_message_index.md.ydgBavCZ.lean.js", -"/ran/assets/src_article_sort_select_index.md.h9RCL_1D.lean.js", -"/ran/assets/cn_src_note_libreoffice2wasm.md.D2xeX9P9.js", +"/ran/assets/src_ranui_message_index.md.DylTPcsH.lean.js", +"/ran/assets/src_ranuts_utils_ocr.md.hx9G9Wty.lean.js", +"/ran/assets/cn_src_article_sort_select_index.md.Dg9QrcP5.js", +"/ran/assets/src_article_designMode.md.Cygn2uVN.lean.js", "/ran/assets/balanceTree.DP_9yIkO.png", -"/ran/assets/cn_src_ranui_radar_index.md.DmjI63Gt.js", +"/ran/assets/src_types_高级类型.md.nuvOE5PP.js", +"/ran/assets/cn_src_article_docPreview.md.Dgo5TWxU.js", "/ran/assets/bili_demo.CI8Ur8IA.webp", +"/ran/assets/src_article_typescript_pattern.md.Bh7TYXd6.lean.js", "/ran/assets/kkfile_output.DD8iZdbo.webp", -"/ran/assets/cn_src_ranui_math_index.md.CbuzM75G.js", +"/ran/assets/cn_src_ranuts_binaryTree_index.md.DF2AU0eV.lean.js", "/ran/assets/ts_demo.D_l_mv9k.webp", -"/ran/assets/index.md.CgG_GtZv.lean.js", -"/ran/assets/cn_src_article_typescript_reconstruction.md.DJ9gZX-Y.lean.js", -"/ran/assets/src_article_typescript_calculate.md.BBrSJykC.js", +"/ran/assets/cn_src_note_centos.md.D0i6PxrH.js", +"/ran/assets/src_article_sort_quick_index.md.BbsLDEfT.js", +"/ran/assets/cn_src_article_babel.md.PvGMHAWM.lean.js", +"/ran/assets/src_ranui_player_index.md.CqeU06z7.js", +"/ran/assets/cn_src_ranuts_utils_getCookie.md.BOR_GUfN.js", "/ran/assets/Identifier.lJSxyFTe.jpeg", -"/ran/assets/cn_src_article_sort_quick_index.md.BEu_JOn1.lean.js", -"/ran/assets/cn_src_ranuts_index.md.pPHvoy25.lean.js", -"/ran/assets/cn_src_ranuts_binaryTree_index.md.ko44XfcW.lean.js", -"/ran/assets/src_article_typescript_index.md.DwScdmSF.lean.js", +"/ran/assets/src_ranui_modal_index.md.WIJTopSI.lean.js", "/ran/assets/firefox_pdf.BWQR-ogn.webp", -"/ran/assets/src_ranuts_utils_str2xml.md.Dd46b24j.lean.js", -"/ran/assets/cn_src_article_video.md.BsBGm6Pq.lean.js", +"/ran/assets/cn_src_types_高级类型.md.CJNwod2u.js", +"/ran/assets/cn_src_article_typescript_pattern.md.Cekzq9t7.js", "/ran/assets/sort.CSVZS1AV.png", -"/ran/assets/cn_src_article_sort_merge_index.md.DNFoib9i.js", -"/ran/assets/src_ranui_button_index.md.Ctjoisvd.lean.js", -"/ran/assets/cn_src_ranuts_utils_getCookie.md.OZ5LyZvi.lean.js", +"/ran/assets/cn_src_article_functionalProgramming.md.DAKK45h5.lean.js", "/ran/assets/ali_doc.CYo30EHy.webp", -"/ran/assets/src_types_高级类型.md.BfdzeJGK.js", -"/ran/assets/cn_src_ranuts_utils_convertImageToBase64.md.L_KuuFb0.js", -"/ran/assets/cn_src_article_designMode.md.ht3y5UhU.lean.js", -"/ran/assets/cn_src_ranuts_file_fileInfo.md.BOv8vrAv.js", +"/ran/assets/src_article_sort_select_index.md.C8DuU50W.js", +"/ran/assets/cn_src_article_typescript_unionType.md.DrGww32o.js", +"/ran/assets/cn_src_ranuts_binaryTree_index.md.DF2AU0eV.js", +"/ran/assets/cn_src_article_sort_count_index.md.BnLbi7pA.js", "/ran/assets/ms_answer_2.D-D9H1v0.webp", +"/ran/assets/cn_src_ranuts_utils_task.md.JiNfIGgL.lean.js", +"/ran/assets/cn_src_note_docker.md.CFz9ipKs.js", +"/ran/assets/src_ranui_icon_index.md.DUb9Ziec.lean.js", +"/ran/assets/src_article_sort_heap_index.md.CdR2jVzG.lean.js", "/ran/assets/mdn_pdf.DbNmeC8H.webp", -"/ran/assets/cn_src_article_visual.md.BsZNGi-k.js", -"/ran/assets/cn_src_ranui_player_index.md.HFCY959w.js", -"/ran/assets/src_ranui_preview_index.md.BHd7KxZT.js", -"/ran/assets/cn_src_types_TS类型.md.CWyGfA_p.lean.js", -"/ran/assets/src_ranui_player_index.md.DP2f3_CY.lean.js", +"/ran/assets/src_ranuts_index.md.BvJRrWnB.lean.js", +"/ran/assets/cn_src_ranuts_file_readDir.md.D3BP3gKv.js", +"/ran/assets/src_article_javascript_domLoad.md.BGlU-nCp.lean.js", +"/ran/assets/cn_src_ranui_button_index.md.BG4PNyqv.lean.js", +"/ran/assets/src_ranui_message_index.md.DylTPcsH.js", +"/ran/assets/cn_src_article_sort_merge_index.md.CdCiiEzt.js", +"/ran/assets/src_ranuts_utils_filterObj.md.CE_SjJ6W.js", +"/ran/assets/cn_src_note_ubuntu.md.BvKNJYgl.js", +"/ran/assets/cn_src_article_typescript_reconstruction.md.eQW6hKH-.js", +"/ran/assets/cn_src_article_sort_shell_index.md.DWSsaZXm.lean.js", "/ran/assets/享元.EIifVVTy.png", -"/ran/assets/cn_src_article_sort_radix_index.md.DnU-u4D7.lean.js", +"/ran/assets/src_ranui_math_index.md.BJBOIEyn.lean.js", +"/ran/assets/cn_src_article_systemDesign.md.CL_WM1Zy.js", +"/ran/assets/cn_src_ranui_tab_index.md.BwQYum8a.js", "/ran/assets/装饰.CuuWN9YK.jpg", +"/ran/assets/src_article_imagemin.md.uYgv1Gxw.lean.js", +"/ran/assets/src_ranuts_utils_task.md.g-64gMZD.js", +"/ran/assets/cn_src_ranui_tabs_index.md.C99PdVnz.js", "/ran/assets/桥接.DX0mO5JC.png", -"/ran/assets/src_ranui_player_index.md.DP2f3_CY.js", -"/ran/assets/src_article_sort_index.md.DpVPeINX.js", -"/ran/assets/cn_src_types_类型运算.md.BMZHsZTS.js", -"/ran/assets/cn_src_ranui_icon_index.md.C8Joalst.js", -"/ran/assets/cn_src_ranuts_bundler_index.md.D_ftAOSG.lean.js", -"/ran/assets/cn_src_ranuts_binaryTree_index.md.ko44XfcW.js", -"/ran/assets/cn_src_note_ubuntu.md.BJJgQ1Ct.lean.js", -"/ran/assets/src_article_typescript_calculate.md.BBrSJykC.lean.js", -"/ran/assets/src_article_typescript_reconstruction.md.D7vCk3k6.lean.js", -"/ran/assets/src_types_类型运算.md.DI_Hlf12.js", -"/ran/assets/src_ranui_select_index.md.n79mfmVf.js", +"/ran/assets/src_ranui_tabs_index.md.DlIC1yii.lean.js", +"/ran/assets/cn_src_ranui_checkbox_index.md.fJgM4YS5.lean.js", +"/ran/assets/cn_src_ranuts_file_watchFile.md.DEkh--uT.js", +"/ran/assets/src_ranuts_file_writeFile.md.Clwh8RIL.lean.js", +"/ran/assets/index.md.BEZWnQN_.lean.js", +"/ran/assets/cn_src_ranuts_utils_formatJson.md.CJeC9Vqe.js", +"/ran/assets/cn_src_note_ubuntu.md.BvKNJYgl.lean.js", +"/ran/assets/cn_src_ranui_math_index.md.BGUDNL8W.lean.js", +"/ran/assets/src_ranuts_file_watchFile.md.CRULQFIp.lean.js", +"/ran/assets/src_ranui_checkbox_index.md.CRJDIbp0.lean.js", "/ran/assets/inter-roman-latin-ext.4ZJIpNVo.woff2", -"/ran/assets/cn_src_article_docPreview.md.DeliAFz1.js", -"/ran/assets/src_ranui_loading_index.md.Do3eVfRU.js", -"/ran/assets/cn_src_article_astParse_tokenizer.md.fifNjLwi.js", -"/ran/assets/cn_src_ranui_input_index.md.BkI4N5qK.lean.js", +"/ran/assets/cn_index.md.-8ngwy_i.js", +"/ran/assets/cn_src_article_typescript_calculate.md.CCtF2BN5.lean.js", "/ran/assets/insert.gf3GhDvq.gif", "/ran/assets/原型.DYbH0CSA.jpg", "/ran/assets/inter-italic-latin.C2AdPX0b.woff2", -"/ran/assets/src_ranuts_utils_convertImageToBase64.md.CgDGIUsS.js", -"/ran/assets/cn_src_article_astParse_tokenizer.md.fifNjLwi.lean.js", -"/ran/assets/cn_src_ranuts_file_readDir.md.DNVwaFG5.js", -"/ran/assets/src_ranui_tab_index.md.6OqNOELf.lean.js", -"/ran/assets/src_ranui_image_index.md.DFVz4CUQ.lean.js", -"/ran/assets/cn_src_ranui_loading_index.md.DXZG-8vN.lean.js", -"/ran/assets/src_ranui_tab_index.md.6OqNOELf.js", -"/ran/assets/src_article_functionalProgramming.md.DiKATL--.lean.js", -"/ran/assets/cn_src_ranuts_utils_formatJson.md.DC5RDora.js", -"/ran/assets/cn_src_ranui_popover_index.md.CrixuNrz.js", +"/ran/assets/cn_src_article_bundle.md.CQqX6KsE.lean.js", +"/ran/assets/cn_src_article_sort_index.md.CfDxRvv2.js", +"/ran/assets/src_ranuts_mimeType_mimeType.md.n1DSeR1k.lean.js", +"/ran/assets/src_article_sort_heap_index.md.CdR2jVzG.js", +"/ran/assets/cn_src_ranui_radar_index.md.BnFj7a-D.js", +"/ran/assets/cn_src_ranuts_utils_filterObj.md.MlTb1jtF.lean.js", +"/ran/assets/src_ranui_input_index.md.-VqhWNTp.lean.js", +"/ran/assets/cn_src_article_sort_heap_index.md.BDHsjcqp.lean.js", +"/ran/assets/src_ranui_image_index.md.CR-zpzpn.js", +"/ran/assets/src_types_类型运算.md.B97x76_P.lean.js", +"/ran/assets/cn_src_ranuts_utils_task.md.JiNfIGgL.js", "/ran/assets/inter-italic-cyrillic-ext.r48I6akx.woff2", -"/ran/assets/cn_src_ranuts_file_appendFile.md.CtR2NfUK.lean.js", -"/ran/assets/cn_src_article_typescript_index.md.CHVcwHl4.js", -"/ran/assets/cn_src_article_babel.md.CaqzHljn.lean.js", -"/ran/assets/src_ranuts_file_readFile.md.zLyxaea7.js", -"/ran/assets/src_ranuts_file_watchFile.md.C6QSbB7C.lean.js", -"/ran/assets/cn_src_ranui_preview_index.md.P57SjbBj.lean.js", -"/ran/assets/cn_src_ranuts_mode_subscribe.md.BPC8IsHd.js", -"/ran/assets/cn_src_article_sort_index.md.Bgve4TGK.lean.js", -"/ran/assets/src_article_sort_index.md.DpVPeINX.lean.js", -"/ran/assets/cn_src_article_visual.md.BsZNGi-k.lean.js", -"/ran/assets/src_article_sort_select_index.md.h9RCL_1D.js", -"/ran/assets/cn_src_note_ubuntu.md.BJJgQ1Ct.js", -"/ran/assets/cn_src_article_sort_bucket_index.md.lmPlZNVD.js", +"/ran/assets/src_types_TS类型.md.B6oAQhlt.lean.js", +"/ran/assets/cn_src_ranui_popover_index.md.70mC-Rqv.js", +"/ran/assets/cn_src_types_TS类型.md.CPBo-Z8o.lean.js", +"/ran/assets/src_ranuts_file_writeFile.md.Clwh8RIL.js", +"/ran/assets/cn_src_article_sort_radix_index.md.C33KYACF.js", +"/ran/assets/cn_src_ranui_select_index.md.DiOGlFSl.lean.js", +"/ran/assets/cn_src_ranuts_index.md.BuaFTRrs.lean.js", +"/ran/assets/src_article_astParse_tokenizer.md.W6tYDAhq.lean.js", +"/ran/assets/cn_src_ranuts_index.md.BuaFTRrs.js", +"/ran/assets/src_ranuts_file_readDir.md.CFfdXdbL.lean.js", +"/ran/assets/src_ranuts_mode_subscribe.md.Dx6-RTZV.lean.js", "/ran/assets/radix.Bwrylu8F.gif", -"/ran/assets/src_article_sort_count_index.md.BFT1IsSo.js", +"/ran/assets/src_article_imagemin.md.uYgv1Gxw.js", +"/ran/assets/src_ranuts_utils_getCookie.md.Cr2WSzYV.lean.js", "/ran/assets/外观.Cm0-J0eF.png", "/ran/assets/ExpressionStatement.zaIHlhIF.jpeg", -"/ran/assets/src_ranuts_file_readDir.md.HSsQqOjC.js", -"/ran/assets/cn_src_article_typescript_reconstruction.md.DJ9gZX-Y.js", "/ran/assets/rplayer_demo.CoJ7kuJt.webp", -"/ran/assets/src_types_TS类型.md.q_ClzjzK.js", -"/ran/assets/cn_src_article_javascript_domLoad.md.CofzgV5H.js", -"/ran/assets/cn_src_ranui_loading_index.md.DXZG-8vN.js", -"/ran/assets/cn_src_ranui_progress_index.md.C4wZ-wFu.js", -"/ran/assets/cn_src_article_sort_heap_index.md.CT_uZ0AG.js", -"/ran/assets/src_types_TS类型.md.q_ClzjzK.lean.js", +"/ran/assets/src_ranuts_utils_filterObj.md.CE_SjJ6W.lean.js", +"/ran/assets/src_article_sort_count_index.md.D2Qv7jPN.lean.js", +"/ran/assets/src_article_typescript_index.md.NB2OS2YQ.js", +"/ran/assets/cn_src_ranuts_utils_filterObj.md.MlTb1jtF.js", +"/ran/assets/src_types_高级类型.md.nuvOE5PP.lean.js", +"/ran/assets/cn_src_ranui_tab_index.md.BwQYum8a.lean.js", "/ran/assets/适配器.C2VH4lXy.png", "/ran/assets/inter-italic-latin-ext.CN1xVJS-.woff2", -"/ran/assets/cn_src_ranui_skeleton_index.md.DdC6olmK.lean.js", -"/ran/assets/src_ranui_modal_index.md.QXH3NLdT.js", +"/ran/assets/src_article_typescript_unionType.md.Dhn_HEeP.lean.js", "/ran/assets/inter-roman-greek.BBVDIX6e.woff2", -"/ran/assets/cn_src_ranui_tab_index.md.CVOm96LC.js", +"/ran/assets/cn_src_ranui_player_index.md.DE3v144q.lean.js", +"/ran/assets/cn_src_ranui_select_index.md.DiOGlFSl.js", "/ran/assets/Expression.DczLaznn.jpeg", -"/ran/assets/cn_src_ranuts_utils_ocr.md.BVb2T5rQ.lean.js", -"/ran/assets/cn_src_ranuts_file_writeFile.md.DX-HWmZs.js", +"/ran/assets/src_article_sort_bucket_index.md.6-1zsle_.js", "/ran/assets/bilibili_video_m4s.BccuY7bk.webp", -"/ran/assets/src_article_typescript_index.md.DwScdmSF.js", +"/ran/assets/src_article_sort_radix_index.md.C4idJI31.js", +"/ran/assets/src_article_sort_radix_index.md.C4idJI31.lean.js", +"/ran/assets/cn_src_article_sort_index.md.CfDxRvv2.lean.js", "/ran/assets/inter-roman-greek-ext.CqjqNYQ-.woff2", +"/ran/assets/cn_src_article_sort_insert_index.md.CWB9NN2r.js", +"/ran/assets/cn_src_article_typescript_unionType.md.DrGww32o.lean.js", "/ran/assets/import.BTsVI5Tc.jpeg", "/ran/assets/ms_answer.Cgv6ylFF.webp", "/ran/assets/inter-italic-cyrillic.By2_1cv3.woff2", -"/ran/assets/src_ranui_checkbox_index.md.DZCOjcke.js", -"/ran/assets/src_article_bundle.md.DZGRRaw8.lean.js", +"/ran/assets/cn_src_ranui_message_index.md.DLxMrXZp.lean.js", "/ran/assets/ms_word.3k-0mjp0.webp", -"/ran/assets/cn_src_article_bundle.md.DvOQbHwY.lean.js", +"/ran/assets/cn_src_note_libreoffice2wasm.md.W96C5_98.lean.js", +"/ran/assets/src_ranuts_file_readFile.md.HwhoeptV.lean.js", "/ran/assets/xml.NyzOyhr4.webp", -"/ran/assets/src_article_astParse_tokenizer.md.C4QMCy48.lean.js", "/ran/assets/bubble.Csp5B4TH.gif", -"/ran/assets/src_ranuts_file_writeFile.md.AwFJpmSz.lean.js", "/ran/assets/chunks/bundle.BxrzsuA1.js", "/ran/assets/chunks/bubble.Dg5jgvyl.js", "/ran/assets/chunks/complexity.CSkvDr7k.js", "/ran/assets/chunks/docx-VUApAnRr.Cl4GUa7G.js", "/ran/assets/chunks/message-D36_Zo2l.CR8K3LhI.js", "/ran/assets/chunks/input-input.MnARRJC6.js", -"/ran/assets/chunks/theme.CTuKnC7d.js", "/ran/assets/chunks/extra.Cu56q3CZ.js", "/ran/assets/chunks/en.Bkn4-Vvy.js", "/ran/assets/chunks/eye-D_mEt17f.DJFa_ttF.js", @@ -355,6 +359,7 @@ const SERVICE_WORK_CACHE_FILE_PATHS = [ "/ran/assets/chunks/preview-CJbz9GjO.C8N16-9H.js", "/ran/assets/chunks/colz-DJZvo_8B.DBiU5Tau.js", "/ran/assets/chunks/pdf-Cx0VWKFo.DIqk-40L.js", +"/ran/assets/chunks/theme.CRvO5ONu.js", "/ran/assets/chunks/book-nTEFXU2x.DPEdiL1I.js", "/ran/assets/chunks/loading-Dcc5RApI.D3l74EUI.js", "/ran/assets/chunks/home-BUQ4USMk.BqTharGj.js", @@ -362,104 +367,100 @@ const SERVICE_WORK_CACHE_FILE_PATHS = [ "/ran/assets/chunks/lock-Cr7BnmWN.0WfYXC2j.js", "/ran/assets/chunks/close-circle-fill-jSqPPw9i.BsLXh5-a.js", "/ran/assets/chunks/customElements.qitHOM3M.js", -"/ran/assets/src_ranui_index.md.DpegwwWE.lean.js", -"/ran/assets/src_ranui_progress_index.md.CANtKpM_.js", -"/ran/assets/src_ranui_loading_index.md.Do3eVfRU.lean.js", -"/ran/assets/cn_src_article_sort_bucket_index.md.lmPlZNVD.lean.js", -"/ran/assets/src_article_babel.md.BcNuJ1LQ.js", +"/ran/assets/cn_src_ranui_image_index.md.DRJD-95R.js", +"/ran/assets/src_ranuts_utils_task.md.g-64gMZD.lean.js", "/ran/assets/bundle.bky0NmdF.png", -"/ran/assets/cn_src_ranuts_mimeType_mimeType.md.CCxE8Y5Q.lean.js", -"/ran/assets/src_article_typescript_recursion.md.DcYohhN4.js", -"/ran/assets/src_ranui_skeleton_index.md.Brp_dtir.js", -"/ran/assets/src_ranuts_bundler_index.md.mnKBYV8g.js", -"/ran/assets/src_article_imagemin.md.BUcXrKer.js", -"/ran/assets/cn_src_ranuts_file_readDir.md.DNVwaFG5.lean.js", -"/ran/assets/src_article_astParse_tokenizer.md.C4QMCy48.js", +"/ran/assets/src_ranui_player_index.md.CqeU06z7.lean.js", +"/ran/assets/cn_src_article_astParse_tokenizer.md.4wYw3ic3.lean.js", +"/ran/assets/src_article_typescript_calculate.md.fkCRSr5X.js", +"/ran/assets/src_article_sort_index.md.BIPYK-Ok.lean.js", +"/ran/assets/cn_src_ranui_math_index.md.BGUDNL8W.js", +"/ran/assets/cn_src_types_模式匹配.md.k2Sn13f9.js", "/ran/assets/单例.B4dKFqxx.jpg", -"/ran/assets/cn_src_ranui_index.md.7MnYzmyC.js", -"/ran/assets/cn_src_ranui_math_index.md.CbuzM75G.lean.js", +"/ran/assets/src_article_typescript_reconstruction.md.Dnx3_2D1.lean.js", +"/ran/assets/src_ranui_skeleton_index.md.DjequKLz.js", +"/ran/assets/src_ranui_radar_index.md.DdUb2lWU.js", +"/ran/assets/cn_src_article_sort_count_index.md.BnLbi7pA.lean.js", "/ran/assets/select.B8GwndZy.gif", -"/ran/assets/cn_src_ranuts_utils_convertImageToBase64.md.L_KuuFb0.lean.js", -"/ran/assets/src_ranui_index.md.DpegwwWE.js", -"/ran/assets/cn_src_article_typescript_recursion.md.DeW8HIDH.js", -"/ran/assets/cn_src_note_centos.md.CbGizVxk.js", +"/ran/assets/src_article_babel.md.DbGK9noy.lean.js", +"/ran/assets/cn_src_article_bundle.md.CQqX6KsE.js", "/ran/assets/tiktok_video.DuwKyIdt.webp", -"/ran/assets/src_ranuts_index.md.BxrdPLgS.js", -"/ran/assets/cn_src_article_javascript_domLoad.md.CofzgV5H.lean.js", -"/ran/assets/cn_src_article_bundle.md.DvOQbHwY.js", -"/ran/assets/src_article_sort_bubble_index.md.DsiOo06S.lean.js", -"/ran/assets/src_ranuts_utils_str2xml.md.Dd46b24j.js", -"/ran/assets/cn_src_ranuts_file_watchFile.md.CKB-dDn6.lean.js", +"/ran/assets/src_ranuts_mimeType_mimeType.md.n1DSeR1k.js", +"/ran/assets/src_ranui_index.md.DMQuqK0O.lean.js", +"/ran/assets/src_ranuts_file_appendFile.md.ByRzuDEV.lean.js", +"/ran/assets/src_ranuts_utils_str2xml.md.Bx2-A0rM.lean.js", "/ran/assets/kkfile_doc.CPfEUxoD.webp", -"/ran/assets/src_article_sort_quick_index.md.M3hZ_ic7.lean.js", "/ran/assets/style.ENRbqgO1.css", -"/ran/assets/src_ranuts_binaryTree_index.md.CCmdOl3F.lean.js", -"/ran/assets/cn_src_article_designMode.md.ht3y5UhU.js", "/ran/assets/ow365.CXWyYekS.webp", -"/ran/assets/src_ranuts_file_fileInfo.md.B3-PUZm0.js", -"/ran/assets/cn_src_types_TS类型.md.CWyGfA_p.js", +"/ran/assets/cn_src_ranuts_file_readFile.md.CfJHCkuJ.js", +"/ran/assets/cn_src_ranuts_mimeType_mimeType.md.BXKqytdq.js", +"/ran/assets/cn_src_article_sort_shell_index.md.DWSsaZXm.js", +"/ran/assets/src_types_模式匹配.md.BUM7A3x9.lean.js", +"/ran/assets/src_article_sort_select_index.md.C8DuU50W.lean.js", +"/ran/assets/cn_src_ranuts_mode_subscribe.md.B_yqkhda.lean.js", "/ran/assets/quick.DD28bswc.gif", -"/ran/assets/cn_src_article_imagemin.md.CIvMu-pO.lean.js", -"/ran/assets/cn_src_article_babel.md.CaqzHljn.js", -"/ran/assets/cn_src_ranui_preview_index.md.P57SjbBj.js", -"/ran/assets/cn_src_article_functionalProgramming.md.CBLq1EiU.js", -"/ran/assets/cn_src_note_libreoffice2wasm.md.D2xeX9P9.lean.js", -"/ran/assets/cn_src_types_模式匹配.md.Bc22d1w4.lean.js", +"/ran/assets/cn_src_ranui_progress_index.md.CmfZXYGe.js", +"/ran/assets/cn_src_note_libreoffice2wasm.md.W96C5_98.js", +"/ran/assets/cn_src_types_TS类型.md.CPBo-Z8o.js", +"/ran/assets/src_article_typescript_pattern.md.Bh7TYXd6.js", +"/ran/assets/cn_src_types_模式匹配.md.k2Sn13f9.lean.js", +"/ran/assets/cn_src_article_typescript_index.md.CoyT_emr.js", "/ran/assets/count.CWSWBe_h.gif", -"/ran/assets/src_ranuts_utils_getCookie.md.-ZpjU0cd.js", -"/ran/assets/cn_src_ranui_select_index.md.BErf4YsQ.lean.js", +"/ran/assets/cn_src_article_video.md.BnS7BWvN.lean.js", "/ran/assets/customElements.DbqgaaNb.png", +"/ran/assets/cn_src_article_babel.md.PvGMHAWM.js", +"/ran/assets/cn_src_ranuts_file_fileInfo.md.Bm1gqueF.lean.js", "/ran/assets/red_book.DiBEvryP.webp", -"/ran/assets/src_article_sort_heap_index.md.BwsCoEDM.js", "/ran/assets/merge.Bguw-KQu.gif", "/ran/assets/inter-italic-greek.DJ8dCoTZ.woff2", -"/ran/assets/cn_src_ranuts_file_watchFile.md.CKB-dDn6.js", -"/ran/assets/src_ranuts_file_watchFile.md.C6QSbB7C.js", -"/ran/assets/cn_src_types_模式匹配.md.Bc22d1w4.js", "/ran/assets/xdoc.CeowcMPq.webp", -"/ran/assets/src_ranuts_utils_filterObj.md.Dn4oR--y.lean.js", +"/ran/assets/cn_src_ranuts_file_readDir.md.D3BP3gKv.lean.js", +"/ran/assets/cn_src_ranui_icon_index.md.C2sGRB8-.lean.js", "/ran/assets/Literal.Dl-JxujV.jpeg", -"/ran/assets/cn_src_ranui_skeleton_index.md.DdC6olmK.js", -"/ran/assets/cn_src_article_typescript_calculate.md.BrhBa9BE.lean.js", -"/ran/assets/src_article_functionalProgramming.md.DiKATL--.js", -"/ran/assets/cn_src_article_sort_quick_index.md.BEu_JOn1.js", -"/ran/assets/src_ranui_radar_index.md.CcKS4hpA.js", -"/ran/assets/cn_src_types_高级类型.md.C2EkbCmJ.js", -"/ran/assets/src_ranuts_file_appendFile.md.D932HMN4.js", +"/ran/assets/cn_src_article_imagemin.md.DVJvJILr.js", +"/ran/assets/src_ranui_tab_index.md.kRkTGQVS.lean.js", +"/ran/assets/src_article_sort_merge_index.md.D-rV1sbV.lean.js", +"/ran/assets/src_article_functionalProgramming.md.DpsP-ua6.lean.js", +"/ran/assets/src_ranui_button_index.md.DlhFg8_e.js", "/ran/assets/建造者.B6neb_7R.jpeg", "/ran/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2", -"/ran/assets/cn_src_article_sort_radix_index.md.DnU-u4D7.js", +"/ran/assets/src_ranuts_file_appendFile.md.ByRzuDEV.js", "/ran/assets/解释器.DymUKGTa.jpg", -"/ran/assets/cn_src_ranuts_utils_filterObj.md.RUrQuB-I.js", +"/ran/assets/cn_src_article_typescript_reconstruction.md.eQW6hKH-.lean.js", +"/ran/assets/src_ranui_select_index.md.DPzRRhtl.lean.js", "/ran/assets/google_doc_view.BknjnOKw.webp", "/ran/assets/kkfile.X1tAqvNa.webp", -"/ran/assets/src_article_javascript_domLoad.md.C6qPDJam.js", "/ran/assets/Declaration.CplvpFd-.jpeg", -"/ran/assets/cn_src_ranuts_file_readFile.md.D1dihUhP.js", +"/ran/assets/cn_src_article_sort_bubble_index.md.BTREgeo6.lean.js", +"/ran/assets/src_ranuts_utils_ocr.md.hx9G9Wty.js", "/ran/assets/xgplayer_docs.CpHb1Wan.webp", -"/ran/assets/src_article_babel.md.BcNuJ1LQ.lean.js", -"/ran/assets/cn_src_ranuts_bundler_index.md.D_ftAOSG.js", -"/ran/assets/src_types_模式匹配.md.CHNYs6NO.js", -"/ran/assets/cn_index.md.DBuoKLX0.lean.js", +"/ran/assets/cn_src_ranuts_file_watchFile.md.DEkh--uT.lean.js", +"/ran/assets/cn_src_ranui_message_index.md.DLxMrXZp.js", +"/ran/assets/cn_src_article_typescript_pattern.md.Cekzq9t7.lean.js", +"/ran/assets/cn_src_article_designMode.md.DlwQ1o0o.lean.js", +"/ran/assets/src_ranui_preview_index.md.DPHFMZv9.js", +"/ran/assets/cn_src_article_sort_bubble_index.md.BTREgeo6.js", +"/ran/assets/cn_src_article_sort_insert_index.md.CWB9NN2r.lean.js", "/ran/assets/kkfile_des.CENUMtpY.webp", "/ran/assets/bili_demo_url.BQDGtHUp.webp", +"/ran/assets/index.md.BEZWnQN_.js", +"/ran/assets/cn_src_types_高级类型.md.CJNwod2u.lean.js", "/ran/assets/input-input.1X1aE5oH.jpg", -"/ran/assets/cn_src_ranui_popover_index.md.CrixuNrz.lean.js", -"/ran/assets/cn_src_article_video.md.BsBGm6Pq.js", -"/ran/assets/cn_src_article_sort_merge_index.md.DNFoib9i.lean.js", -"/ran/assets/src_ranuts_mode_subscribe.md.B3N1C4oA.js", -"/ran/assets/src_ranuts_file_readFile.md.zLyxaea7.lean.js", +"/ran/assets/cn_src_types_类型运算.md.J_LQEvnq.lean.js", +"/ran/assets/src_types_TS类型.md.B6oAQhlt.js", +"/ran/assets/src_article_typescript_reconstruction.md.Dnx3_2D1.js", +"/ran/assets/src_article_sort_bubble_index.md.CyhYCOsV.js", +"/ran/assets/cn_src_article_javascript_domLoad.md.Cjc9hOHo.lean.js", "/ran/assets/ms_file_not.DgOrkG3n.webp", "/ran/assets/inter-roman-vietnamese.BjW4sHH5.woff2", -"/ran/assets/src_types_高级类型.md.BfdzeJGK.lean.js", -"/ran/assets/cn_src_ranuts_file_fileInfo.md.BOv8vrAv.lean.js", -"/ran/assets/src_ranui_math_index.md.B-FtK30k.js", +"/ran/assets/cn_src_article_sort_bucket_index.md.BBjzg8PH.js", +"/ran/assets/src_ranuts_file_readDir.md.CFfdXdbL.js", "/ran/assets/Statement.9lGuRes5.jpeg", "/ran/assets/aqiyi_demo.s0swGzvF.webp", -"/ran/assets/src_article_sort_bucket_index.md.ZfhUbkFZ.lean.js", -"/ran/assets/cn_src_article_sort_insert_index.md.DyiV5HPJ.js", -"/ran/assets/cn_src_ranui_button_index.md.12XVTc4M.lean.js", -"/ran/sw1726377850.js", +"/ran/assets/cn_src_ranui_loading_index.md.CyfyGH-8.lean.js", +"/ran/assets/src_ranuts_mode_subscribe.md.Dx6-RTZV.js", +"/ran/assets/src_ranui_loading_index.md.adGvJ3b3.lean.js", +"/ran/assets/cn_src_article_sort_heap_index.md.BDHsjcqp.js", "/ran/src/ranui/preview/index.html", "/ran/src/ranui/checkbox/index.html", "/ran/src/ranui/popover/index.html", @@ -579,6 +580,7 @@ const SERVICE_WORK_CACHE_FILE_PATHS = [ "/ran/cn/src/article/typescript/recursion.html", "/ran/cn/src/article/typescript/pattern.html", "/ran/cn/src/article/typescript/unionType.html", +"/ran/cn/src/article/systemDesign.html", "/ran/cn/src/article/imagemin.html", "/ran/cn/src/article/video.html", "/ran/cn/src/article/sort/index.html", @@ -603,12 +605,13 @@ const SERVICE_WORK_CACHE_FILE_PATHS = [ "/ran/home.svg", "/ran/screenshots_2560x1440.jpg", "/ran/icon_72.png", +"/ran/sw1726385521.js", "/ran/icon_192.png", "/ran/pagefind/pagefind-modular-ui.css", "/ran/pagefind/wasm.en.pagefind", "/ran/pagefind/wasm.unknown.pagefind", -"/ran/pagefind/pagefind.zh-cn_8f6e3f26981c1.pf_meta", "/ran/pagefind/pagefind-highlight.js", +"/ran/pagefind/pagefind.zh-cn_72488e9ca2573.pf_meta", "/ran/pagefind/pagefind-modular-ui.js", "/ran/pagefind/fragment/zh-cn_d388141.pf_fragment", "/ran/pagefind/fragment/zh-cn_67d6c7a.pf_fragment", @@ -724,6 +727,7 @@ const SERVICE_WORK_CACHE_FILE_PATHS = [ "/ran/pagefind/fragment/zh-cn_3de2e5c.pf_fragment", "/ran/pagefind/fragment/zh-cn_5ca356d.pf_fragment", "/ran/pagefind/fragment/zh-cn_50313a9.pf_fragment", +"/ran/pagefind/fragment/zh-cn_f7dcce8.pf_fragment", "/ran/pagefind/fragment/en_6a9915b.pf_fragment", "/ran/pagefind/fragment/zh-cn_5df12ef.pf_fragment", "/ran/pagefind/fragment/zh-cn_3fb29d3.pf_fragment", @@ -751,17 +755,17 @@ const SERVICE_WORK_CACHE_FILE_PATHS = [ "/ran/pagefind/pagefind-entry.json", "/ran/pagefind/pagefind.js", "/ran/pagefind/pagefind-ui.css", -"/ran/pagefind/index/zh-cn_dda31a2.pf_index", "/ran/pagefind/index/en_4e472e0.pf_index", "/ran/pagefind/index/en_6af7abf.pf_index", -"/ran/pagefind/index/zh-cn_b018389.pf_index", -"/ran/pagefind/index/zh-cn_bc6475b.pf_index", -"/ran/pagefind/index/zh-cn_47b5d7b.pf_index", +"/ran/pagefind/index/zh-cn_629cfe2.pf_index", +"/ran/pagefind/index/zh-cn_c7671ec.pf_index", +"/ran/pagefind/index/zh-cn_db15dcf.pf_index", +"/ran/pagefind/index/zh-cn_6e146a8.pf_index", +"/ran/pagefind/index/zh-cn_f5ed6e5.pf_index", "/ran/pagefind/index/en_4c9d511.pf_index", -"/ran/pagefind/index/zh-cn_24997a4.pf_index", "/ran/pagefind/pagefind-ui.js", ]; -const VERSION = "1726377850"; +const VERSION = "1726385521"; const CACHE_NAME = 'chaxus_ran_' + VERSION const IGNORE_REQUEST_LIST = [