diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..98b36b1 --- /dev/null +++ b/404.html @@ -0,0 +1,33 @@ + + + + + + + + + ✨ Spellblog + + + + +

404

There's nothing here.
Take me home
+ + + diff --git a/about.html b/about.html new file mode 100644 index 0000000..043277b --- /dev/null +++ b/about.html @@ -0,0 +1,33 @@ + + + + + + + + + About | ✨ Spellblog + + + + +

About

Welcome, internet traveler!

I'm Guilherme Petry, cyberwich, journalist, tech chronicler, writer, web developer, and cybersecurity apprentice.

You are now reading my narrated learning into the depths of computer witchcraft, programming spellcasting, and code chronicles.

Here you will find some uncovered knowledge on post-modern spells.

Wanna see another cool project?

↓ Click! ↓

icoopen in new window

Send me some smoke signs on GitHubopen in new window or LinkedInopen in new window.

Here is the GitHub repositoryopen in new window for this project.

The Rider–Waite Tarotopen in new window.

+ + + diff --git a/assets/404.e32eafdf.js b/assets/404.e32eafdf.js new file mode 100644 index 0000000..84b9705 --- /dev/null +++ b/assets/404.e32eafdf.js @@ -0,0 +1 @@ +import{_ as d,f as i,u as f,g as p,r as v,o as k,c as L,a as o,t as c,b as g,w as x,h as l,d as B}from"./app.03d0ed6d.js";const N={class:"theme-container"},T={class:"theme-default-content"},b=o("h1",null,"404",-1),C=i({__name:"404",setup(M){var a,s,n;const r=f(),e=p(),t=(a=e.value.notFound)!=null?a:["Not Found"],u=()=>t[Math.floor(Math.random()*t.length)],_=(s=e.value.home)!=null?s:r.value,m=(n=e.value.backToHome)!=null?n:"Back to home";return(R,V)=>{const h=v("RouterLink");return k(),L("div",N,[o("div",T,[b,o("blockquote",null,c(u()),1),g(h,{to:l(_)},{default:x(()=>[B(c(l(m)),1)]),_:1},8,["to"])])])}}});var D=d(C,[["__file","404.vue"]]);export{D as default}; diff --git a/assets/404.html.6ec09e14.js b/assets/404.html.6ec09e14.js new file mode 100644 index 0000000..94d7ca8 --- /dev/null +++ b/assets/404.html.6ec09e14.js @@ -0,0 +1 @@ +import{_ as e,o as _,c}from"./app.03d0ed6d.js";const r={};function t(o,a){return _(),c("div")}var s=e(r,[["render",t],["__file","404.html.vue"]]);export{s as default}; diff --git a/assets/404.html.7d858b3d.js b/assets/404.html.7d858b3d.js new file mode 100644 index 0000000..c4c5770 --- /dev/null +++ b/assets/404.html.7d858b3d.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-3706649a","path":"/404.html","title":"","lang":"en-US","frontmatter":{"layout":"404"},"excerpt":"","headers":[],"git":{},"filePathRelative":null}');export{t as data}; diff --git a/assets/Layout.a2c43ac0.js b/assets/Layout.a2c43ac0.js new file mode 100644 index 0000000..f942771 --- /dev/null +++ b/assets/Layout.a2c43ac0.js @@ -0,0 +1 @@ +import{_ as C,r as A,o as n,c as i,b as $,f as S,i as P,j as h,k as _e,h as e,F as H,l as R,a as g,t as x,m as w,n as z,p as Y,q as T,w as N,s as ve,v as k,d as j,x as X,y as Te,z as xe,A as Ne,B as J,C as Q,D as E,E as K,G as pe,H as he,u as me,g as I,T as fe,I as O,J as be,K as q,L as G,M as Be,N as Ie,O as Z,P as ge,Q as ke,e as He,R as ee,S as Me,U,V as te,W as De,X as Pe,Y as Ee,Z as Ae}from"./app.03d0ed6d.js";const Re={},Fe={class:"theme-default-content"};function Oe(v,a){const t=A("Content");return n(),i("div",Fe,[$(t)])}var ze=C(Re,[["render",Oe],["__file","HomeContent.vue"]]);const We={key:0,class:"features"},Ve=S({__name:"HomeFeatures",setup(v){const a=P(),t=h(()=>_e(a.value.features)?a.value.features:[]);return(l,r)=>e(t).length?(n(),i("div",We,[(n(!0),i(H,null,R(e(t),p=>(n(),i("div",{key:p.title,class:"feature"},[g("h2",null,x(p.title),1),g("p",null,x(p.details),1)]))),128))])):w("",!0)}});var Ue=C(Ve,[["__file","HomeFeatures.vue"]]);const je=["innerHTML"],Ke=["textContent"],qe=S({__name:"HomeFooter",setup(v){const a=P(),t=h(()=>a.value.footer),l=h(()=>a.value.footerHtml);return(r,p)=>e(t)?(n(),i(H,{key:0},[e(l)?(n(),i("div",{key:0,class:"footer",innerHTML:e(t)},null,8,je)):(n(),i("div",{key:1,class:"footer",textContent:x(e(t))},null,8,Ke))],64)):w("",!0)}});var Ge=C(qe,[["__file","HomeFooter.vue"]]);const Xe=["href","rel","target","aria-label"],Ye=S({inheritAttrs:!1}),Je=S({...Ye,__name:"AutoLink",props:{item:{type:Object,required:!0}},setup(v){const a=v,t=z(),l=Ne(),{item:r}=Y(a),p=h(()=>X(r.value.link)),m=h(()=>Te(r.value.link)||xe(r.value.link)),c=h(()=>{if(!m.value){if(r.value.target)return r.value.target;if(p.value)return"_blank"}}),o=h(()=>c.value==="_blank"),s=h(()=>!p.value&&!m.value&&!o.value),u=h(()=>{if(!m.value){if(r.value.rel)return r.value.rel;if(o.value)return"noopener noreferrer"}}),d=h(()=>r.value.ariaLabel||r.value.text),_=h(()=>{const y=Object.keys(l.value.locales);return y.length?!y.some(f=>f===r.value.link):r.value.link!=="/"}),b=h(()=>_.value?t.path.startsWith(r.value.link):!1),L=h(()=>s.value?r.value.activeMatch?new RegExp(r.value.activeMatch).test(t.path):b.value:!1);return(y,f)=>{const B=A("RouterLink"),M=A("AutoLinkExternalIcon");return e(s)?(n(),T(B,ve({key:0,class:{"router-link-active":e(L)},to:e(r).link,"aria-label":e(d)},y.$attrs),{default:N(()=>[k(y.$slots,"before"),j(" "+x(e(r).text)+" ",1),k(y.$slots,"after")]),_:3},16,["class","to","aria-label"])):(n(),i("a",ve({key:1,class:"external-link",href:e(r).link,rel:e(u),target:e(c),"aria-label":e(d)},y.$attrs),[k(y.$slots,"before"),j(" "+x(e(r).text)+" ",1),e(o)?(n(),T(M,{key:0})):w("",!0),k(y.$slots,"after")],16,Xe))}}});var D=C(Je,[["__file","AutoLink.vue"]]);const Qe={class:"hero"},Ze={key:0,id:"main-title"},et={key:1,class:"description"},tt={key:2,class:"actions"},at=S({__name:"HomeHero",setup(v){const a=P(),t=J(),l=Q(),r=h(()=>l.value&&a.value.heroImageDark!==void 0?a.value.heroImageDark:a.value.heroImage),p=h(()=>a.value.heroText===null?null:a.value.heroText||t.value.title||"Hello"),m=h(()=>a.value.heroAlt||p.value||"hero"),c=h(()=>a.value.tagline===null?null:a.value.tagline||t.value.description||"Welcome to your VuePress site"),o=h(()=>_e(a.value.actions)?a.value.actions.map(({text:u,link:d,type:_="primary"})=>({text:u,link:d,type:_})):[]),s=()=>{if(!r.value)return null;const u=K("img",{src:pe(r.value),alt:m.value});return a.value.heroImageDark===void 0?u:K(he,()=>u)};return(u,d)=>(n(),i("header",Qe,[$(s),e(p)?(n(),i("h1",Ze,x(e(p)),1)):w("",!0),e(c)?(n(),i("p",et,x(e(c)),1)):w("",!0),e(o).length?(n(),i("p",tt,[(n(!0),i(H,null,R(e(o),_=>(n(),T(D,{key:_.text,class:E(["action-button",[_.type]]),item:_},null,8,["class","item"]))),128))])):w("",!0)]))}});var nt=C(at,[["__file","HomeHero.vue"]]);const ot={class:"home"},rt=S({__name:"Home",setup(v){return(a,t)=>(n(),i("main",ot,[$(nt),$(Ue),$(ze),$(Ge)]))}});var st=C(rt,[["__file","Home.vue"]]);const lt=S({__name:"NavbarBrand",setup(v){const a=me(),t=J(),l=I(),r=Q(),p=h(()=>l.value.home||a.value),m=h(()=>t.value.title),c=h(()=>r.value&&l.value.logoDark!==void 0?l.value.logoDark:l.value.logo),o=()=>{if(!c.value)return null;const s=K("img",{class:"logo",src:pe(c.value),alt:m.value});return l.value.logoDark===void 0?s:K(he,()=>s)};return(s,u)=>{const d=A("RouterLink");return n(),T(d,{to:e(p)},{default:N(()=>[$(o),e(m)?(n(),i("span",{key:0,class:E(["site-name",{"can-hide":e(c)}])},x(e(m)),3)):w("",!0)]),_:1},8,["to"])}}});var ut=C(lt,[["__file","NavbarBrand.vue"]]);const it=S({__name:"DropdownTransition",setup(v){const a=l=>{l.style.height=l.scrollHeight+"px"},t=l=>{l.style.height=""};return(l,r)=>(n(),T(fe,{name:"dropdown",onEnter:a,onAfterEnter:t,onBeforeLeave:a},{default:N(()=>[k(l.$slots,"default")]),_:3}))}});var $e=C(it,[["__file","DropdownTransition.vue"]]);const ct=["aria-label"],vt={class:"title"},dt=g("span",{class:"arrow down"},null,-1),_t=["aria-label"],pt={class:"title"},ht={class:"navbar-dropdown"},mt={class:"navbar-dropdown-subtitle"},ft={key:1},bt={class:"navbar-dropdown-subitem-wrapper"},gt=S({__name:"NavbarDropdown",props:{item:{type:Object,required:!0}},setup(v){const a=v,{item:t}=Y(a),l=h(()=>t.value.ariaLabel||t.value.text),r=O(!1),p=z();be(()=>p.path,()=>{r.value=!1});const m=o=>{o.detail===0?r.value=!r.value:r.value=!1},c=(o,s)=>s[s.length-1]===o;return(o,s)=>(n(),i("div",{class:E(["navbar-dropdown-wrapper",{open:r.value}])},[g("button",{class:"navbar-dropdown-title",type:"button","aria-label":e(l),onClick:m},[g("span",vt,x(e(t).text),1),dt],8,ct),g("button",{class:"navbar-dropdown-title-mobile",type:"button","aria-label":e(l),onClick:s[0]||(s[0]=u=>r.value=!r.value)},[g("span",pt,x(e(t).text),1),g("span",{class:E(["arrow",r.value?"down":"right"])},null,2)],8,_t),$($e,null,{default:N(()=>[q(g("ul",ht,[(n(!0),i(H,null,R(e(t).children,u=>(n(),i("li",{key:u.text,class:"navbar-dropdown-item"},[u.children?(n(),i(H,{key:0},[g("h4",mt,[u.link?(n(),T(D,{key:0,item:u,onFocusout:d=>c(u,e(t).children)&&u.children.length===0&&(r.value=!1)},null,8,["item","onFocusout"])):(n(),i("span",ft,x(u.text),1))]),g("ul",bt,[(n(!0),i(H,null,R(u.children,d=>(n(),i("li",{key:d.link,class:"navbar-dropdown-subitem"},[$(D,{item:d,onFocusout:_=>c(d,u.children)&&c(u,e(t).children)&&(r.value=!1)},null,8,["item","onFocusout"])]))),128))])],64)):(n(),T(D,{key:1,item:u,onFocusout:d=>c(u,e(t).children)&&(r.value=!1)},null,8,["item","onFocusout"]))]))),128))],512),[[G,r.value]])]),_:1})],2))}});var kt=C(gt,[["__file","NavbarDropdown.vue"]]);const de=v=>decodeURI(v).replace(/#.*$/,"").replace(/(index)?\.(md|html)$/,""),$t=(v,a)=>{if(a.hash===v)return!0;const t=de(a.path),l=de(v);return t===l},Le=(v,a)=>v.link&&$t(v.link,a)?!0:v.children?v.children.some(t=>Le(t,a)):!1,ye=v=>!X(v)||/github\.com/.test(v)?"GitHub":/bitbucket\.org/.test(v)?"Bitbucket":/gitlab\.com/.test(v)?"GitLab":/gitee\.com/.test(v)?"Gitee":null,Lt={GitHub:":repo/edit/:branch/:path",GitLab:":repo/-/edit/:branch/:path",Gitee:":repo/edit/:branch/:path",Bitbucket:":repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default"},yt=({docsRepo:v,editLinkPattern:a})=>{if(a)return a;const t=ye(v);return t!==null?Lt[t]:null},wt=({docsRepo:v,docsBranch:a,docsDir:t,filePathRelative:l,editLinkPattern:r})=>{if(!l)return null;const p=yt({docsRepo:v,editLinkPattern:r});return p?p.replace(/:repo/,X(v)?v:`https://github.com/${v}`).replace(/:branch/,a).replace(/:path/,Be(`${Ie(t)}/${l}`)):null},Ct={key:0,class:"navbar-items"},St=S({__name:"NavbarItems",setup(v){const a=()=>{const s=Z(),u=me(),d=J(),_=I();return h(()=>{var B,M;const b=Object.keys(d.value.locales);if(b.length<2)return[];const L=s.currentRoute.value.path,y=s.currentRoute.value.fullPath;return[{text:(B=_.value.selectLanguageText)!=null?B:"unknown language",ariaLabel:(M=_.value.selectLanguageAriaLabel)!=null?M:"unkown language",children:b.map(F=>{var oe,re,se,le,ue,ie;const W=(re=(oe=d.value.locales)==null?void 0:oe[F])!=null?re:{},ae=(le=(se=_.value.locales)==null?void 0:se[F])!=null?le:{},ne=`${W.lang}`,Ce=(ue=ae.selectLanguageName)!=null?ue:ne;let V;if(ne===d.value.lang)V=y;else{const ce=L.replace(u.value,F);s.getRoutes().some(Se=>Se.path===ce)?V=ce:V=(ie=ae.home)!=null?ie:F}return{text:Ce,link:V}})}]})},t=()=>{const s=I(),u=h(()=>s.value.repo),d=h(()=>u.value?ye(u.value):null),_=h(()=>u.value&&!X(u.value)?`https://github.com/${u.value}`:u.value),b=h(()=>_.value?s.value.repoLabel?s.value.repoLabel:d.value===null?"Source":d.value:null);return h(()=>!_.value||!b.value?[]:[{text:b.value,link:_.value}])},l=s=>ge(s)?ke(s):s.children?{...s,children:s.children.map(l)}:s,p=(()=>{const s=I();return h(()=>(s.value.navbar||[]).map(l))})(),m=a(),c=t(),o=h(()=>[...p.value,...m.value,...c.value]);return(s,u)=>e(o).length?(n(),i("nav",Ct,[(n(!0),i(H,null,R(e(o),d=>(n(),i("div",{key:d.text,class:"navbar-item"},[d.children?(n(),T(kt,{key:0,item:d},null,8,["item"])):(n(),T(D,{key:1,item:d},null,8,["item"]))]))),128))])):w("",!0)}});var we=C(St,[["__file","NavbarItems.vue"]]);const Tt=["title"],xt={class:"icon",focusable:"false",viewBox:"0 0 32 32"},Nt=He('',9),Bt=[Nt],It={class:"icon",focusable:"false",viewBox:"0 0 32 32"},Ht=g("path",{d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z",fill:"currentColor"},null,-1),Mt=[Ht],Dt=S({__name:"ToggleColorModeButton",setup(v){const a=I(),t=Q(),l=()=>{t.value=!t.value};return(r,p)=>(n(),i("button",{class:"toggle-color-mode-button",title:e(a).toggleColorMode,onClick:l},[q((n(),i("svg",xt,Bt,512)),[[G,!e(t)]]),q((n(),i("svg",It,Mt,512)),[[G,e(t)]])],8,Tt))}});var Pt=C(Dt,[["__file","ToggleColorModeButton.vue"]]);const Et=["title"],At=g("div",{class:"icon","aria-hidden":"true"},[g("span"),g("span"),g("span")],-1),Rt=[At],Ft=S({__name:"ToggleSidebarButton",emits:["toggle"],setup(v){const a=I();return(t,l)=>(n(),i("div",{class:"toggle-sidebar-button",title:e(a).toggleSidebar,"aria-expanded":"false",role:"button",tabindex:"0",onClick:l[0]||(l[0]=r=>t.$emit("toggle"))},Rt,8,Et))}});var Ot=C(Ft,[["__file","ToggleSidebarButton.vue"]]);const zt=S({__name:"Navbar",emits:["toggle-sidebar"],setup(v){const a=I(),t=O(null),l=O(null),r=O(0),p=h(()=>r.value?{maxWidth:r.value+"px"}:{});ee(()=>{const o=m(t.value,"paddingLeft")+m(t.value,"paddingRight"),s=()=>{var u;window.innerWidth<=719?r.value=0:r.value=t.value.offsetWidth-o-(((u=l.value)==null?void 0:u.offsetWidth)||0)};s(),window.addEventListener("resize",s,!1),window.addEventListener("orientationchange",s,!1)});function m(c,o){var d,_,b;const s=(b=(_=(d=c==null?void 0:c.ownerDocument)==null?void 0:d.defaultView)==null?void 0:_.getComputedStyle(c,null))==null?void 0:b[o],u=Number.parseInt(s,10);return Number.isNaN(u)?0:u}return(c,o)=>{const s=A("NavbarSearch");return n(),i("header",{ref_key:"navbar",ref:t,class:"navbar"},[$(Ot,{onToggle:o[0]||(o[0]=u=>c.$emit("toggle-sidebar"))}),g("span",{ref_key:"navbarBrand",ref:l},[$(ut)],512),g("div",{class:"navbar-items-wrapper",style:Me(e(p))},[k(c.$slots,"before"),$(we,{class:"can-hide"}),k(c.$slots,"after"),e(a).colorModeSwitch?(n(),T(Pt,{key:0})):w("",!0),$(s)],4)],512)}}});var Wt=C(zt,[["__file","Navbar.vue"]]);const Vt={class:"page-meta"},Ut={key:0,class:"meta-item edit-link"},jt={key:1,class:"meta-item last-updated"},Kt={class:"meta-item-label"},qt={class:"meta-item-info"},Gt={key:2,class:"meta-item contributors"},Xt={class:"meta-item-label"},Yt={class:"meta-item-info"},Jt=["title"],Qt=j(", "),Zt=S({__name:"PageMeta",setup(v){const a=()=>{const o=I(),s=U(),u=P();return h(()=>{var M,F,W;if(!((F=(M=u.value.editLink)!=null?M:o.value.editLink)!=null?F:!0))return null;const{repo:_,docsRepo:b=_,docsBranch:L="main",docsDir:y="",editLinkText:f}=o.value;if(!b)return null;const B=wt({docsRepo:b,docsBranch:L,docsDir:y,filePathRelative:s.value.filePathRelative,editLinkPattern:(W=u.value.editLinkPattern)!=null?W:o.value.editLinkPattern});return B?{text:f!=null?f:"Edit this page",link:B}:null})},t=()=>{const o=I(),s=U(),u=P();return h(()=>{var b,L,y,f;return!((L=(b=u.value.lastUpdated)!=null?b:o.value.lastUpdated)!=null?L:!0)||!((y=s.value.git)!=null&&y.updatedTime)?null:new Date((f=s.value.git)==null?void 0:f.updatedTime).toLocaleString()})},l=()=>{const o=I(),s=U(),u=P();return h(()=>{var _,b,L,y;return((b=(_=u.value.contributors)!=null?_:o.value.contributors)!=null?b:!0)&&(y=(L=s.value.git)==null?void 0:L.contributors)!=null?y:null})},r=I(),p=a(),m=t(),c=l();return(o,s)=>{const u=A("ClientOnly");return n(),i("footer",Vt,[e(p)?(n(),i("div",Ut,[$(D,{class:"meta-item-label",item:e(p)},null,8,["item"])])):w("",!0),e(m)?(n(),i("div",jt,[g("span",Kt,x(e(r).lastUpdatedText)+": ",1),$(u,null,{default:N(()=>[g("span",qt,x(e(m)),1)]),_:1})])):w("",!0),e(c)&&e(c).length?(n(),i("div",Gt,[g("span",Xt,x(e(r).contributorsText)+": ",1),g("span",Yt,[(n(!0),i(H,null,R(e(c),(d,_)=>(n(),i(H,{key:_},[g("span",{class:"contributor",title:`email: ${d.email}`},x(d.name),9,Jt),_!==e(c).length-1?(n(),i(H,{key:0},[Qt],64)):w("",!0)],64))),128))])])):w("",!0)])}}});var ea=C(Zt,[["__file","PageMeta.vue"]]);const ta={key:0,class:"page-nav"},aa={class:"inner"},na={key:0,class:"prev"},oa={key:1,class:"next"},ra=S({__name:"PageNav",setup(v){const a=o=>o===!1?null:ge(o)?ke(o):De(o)?o:!1,t=(o,s,u)=>{const d=o.findIndex(_=>_.link===s);if(d!==-1){const _=o[d+u];return _!=null&&_.link?_:null}for(const _ of o)if(_.children){const b=t(_.children,s,u);if(b)return b}return null},l=P(),r=te(),p=z(),m=h(()=>{const o=a(l.value.prev);return o!==!1?o:t(r.value,p.path,-1)}),c=h(()=>{const o=a(l.value.next);return o!==!1?o:t(r.value,p.path,1)});return(o,s)=>e(m)||e(c)?(n(),i("nav",ta,[g("p",aa,[e(m)?(n(),i("span",na,[$(D,{item:e(m)},null,8,["item"])])):w("",!0),e(c)?(n(),i("span",oa,[$(D,{item:e(c)},null,8,["item"])])):w("",!0)])])):w("",!0)}});var sa=C(ra,[["__file","PageNav.vue"]]);const la={class:"page"},ua={class:"theme-default-content"},ia=S({__name:"Page",setup(v){return(a,t)=>{const l=A("Content");return n(),i("main",la,[k(a.$slots,"top"),g("div",ua,[k(a.$slots,"content-top"),$(l),k(a.$slots,"content-bottom")]),$(ea),$(sa),k(a.$slots,"bottom")])}}});var ca=C(ia,[["__file","Page.vue"]]);const va={class:"sidebar-item-children"},da=S({__name:"SidebarItem",props:{item:{type:Object,required:!0},depth:{type:Number,required:!1,default:0}},setup(v){const a=v,{item:t,depth:l}=Y(a),r=z(),p=Z(),m=h(()=>Le(t.value,r)),c=h(()=>({"sidebar-item":!0,"sidebar-heading":l.value===0,active:m.value,collapsible:t.value.collapsible})),o=O(!0),s=O(void 0);return t.value.collapsible&&(o.value=m.value,s.value=()=>{o.value=!o.value},p.afterEach(()=>{o.value=m.value})),(u,d)=>{var b;const _=A("SidebarItem",!0);return n(),i("li",null,[e(t).link?(n(),T(D,{key:0,class:E(e(c)),item:e(t)},null,8,["class","item"])):(n(),i("p",{key:1,tabindex:"0",class:E(e(c)),onClick:d[0]||(d[0]=(...L)=>s.value&&s.value(...L)),onKeydown:d[1]||(d[1]=Pe((...L)=>s.value&&s.value(...L),["enter"]))},[j(x(e(t).text)+" ",1),e(t).collapsible?(n(),i("span",{key:0,class:E(["arrow",o.value?"down":"right"])},null,2)):w("",!0)],34)),(b=e(t).children)!=null&&b.length?(n(),T($e,{key:2},{default:N(()=>[q(g("ul",va,[(n(!0),i(H,null,R(e(t).children,L=>(n(),T(_,{key:`${e(l)}${L.text}${L.link}`,item:L,depth:e(l)+1},null,8,["item","depth"]))),128))],512),[[G,o.value]])]),_:1})):w("",!0)])}}});var _a=C(da,[["__file","SidebarItem.vue"]]);const pa={key:0,class:"sidebar-items"},ha=S({__name:"SidebarItems",setup(v){const a=z(),t=te();return ee(()=>{be(()=>a.hash,l=>{const r=document.querySelector(".sidebar");if(!r)return;const p=document.querySelector(`.sidebar a.sidebar-item[href="${a.path}${l}"]`);if(!p)return;const{top:m,height:c}=r.getBoundingClientRect(),{top:o,height:s}=p.getBoundingClientRect();om+c&&p.scrollIntoView(!1)})}),(l,r)=>e(t).length?(n(),i("ul",pa,[(n(!0),i(H,null,R(e(t),p=>(n(),T(_a,{key:p.link||p.text,item:p},null,8,["item"]))),128))])):w("",!0)}});var ma=C(ha,[["__file","SidebarItems.vue"]]);const fa={class:"sidebar"},ba=S({__name:"Sidebar",setup(v){return(a,t)=>(n(),i("aside",fa,[$(we),k(a.$slots,"top"),$(ma),k(a.$slots,"bottom")]))}});var ga=C(ba,[["__file","Sidebar.vue"]]);const ka=S({__name:"Layout",setup(v){const a=U(),t=P(),l=I(),r=h(()=>t.value.navbar!==!1&&l.value.navbar!==!1),p=te(),m=O(!1),c=f=>{m.value=typeof f=="boolean"?f:!m.value},o={x:0,y:0},s=f=>{o.x=f.changedTouches[0].clientX,o.y=f.changedTouches[0].clientY},u=f=>{const B=f.changedTouches[0].clientX-o.x,M=f.changedTouches[0].clientY-o.y;Math.abs(B)>Math.abs(M)&&Math.abs(B)>40&&(B>0&&o.x<=80?c(!0):c(!1))},d=h(()=>[{"no-navbar":!r.value,"no-sidebar":!p.value.length,"sidebar-open":m.value},t.value.pageClass]);let _;ee(()=>{_=Z().afterEach(()=>{c(!1)})}),Ee(()=>{_()});const b=Ae(),L=b.resolve,y=b.pending;return(f,B)=>(n(),i("div",{class:E(["theme-container",e(d)]),onTouchstart:s,onTouchend:u},[k(f.$slots,"navbar",{},()=>[e(r)?(n(),T(Wt,{key:0,onToggleSidebar:c},{before:N(()=>[k(f.$slots,"navbar-before")]),after:N(()=>[k(f.$slots,"navbar-after")]),_:3})):w("",!0)]),g("div",{class:"sidebar-mask",onClick:B[0]||(B[0]=M=>c(!1))}),k(f.$slots,"sidebar",{},()=>[$(ga,null,{top:N(()=>[k(f.$slots,"sidebar-top")]),bottom:N(()=>[k(f.$slots,"sidebar-bottom")]),_:3})]),k(f.$slots,"page",{},()=>[e(t).home?(n(),T(st,{key:0})):(n(),T(fe,{key:1,name:"fade-slide-y",mode:"out-in",onBeforeEnter:e(L),onBeforeLeave:e(y)},{default:N(()=>[(n(),T(ca,{key:e(a).path},{top:N(()=>[k(f.$slots,"page-top")]),"content-top":N(()=>[k(f.$slots,"page-content-top")]),"content-bottom":N(()=>[k(f.$slots,"page-content-bottom")]),bottom:N(()=>[k(f.$slots,"page-bottom")]),_:3}))]),_:3},8,["onBeforeEnter","onBeforeLeave"]))])],34))}});var La=C(ka,[["__file","Layout.vue"]]);export{La as default}; diff --git a/assets/about.html.74c00bc7.js b/assets/about.html.74c00bc7.js new file mode 100644 index 0000000..4582a88 --- /dev/null +++ b/assets/about.html.74c00bc7.js @@ -0,0 +1 @@ +import{_ as r,r as s,o as i,c as a,a as e,b as n,d as t}from"./app.03d0ed6d.js";const c={},l=e("h1",{id:"about",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#about","aria-hidden":"true"},"#"),t(" About")],-1),_=e("p",null,"Welcome, internet traveler!",-1),h=e("p",null,"I'm Guilherme Petry, cyberwich, journalist, tech chronicler, writer, web developer, and cybersecurity apprentice.",-1),d=e("p",null,"You are now reading my narrated learning into the depths of computer witchcraft, programming spellcasting, and code chronicles.",-1),p=e("p",null,"Here you will find some uncovered knowledge on post-modern spells.",-1),u=e("p",null,[e("strong",null,"Wanna see another cool project?")],-1),m=e("p",null,[e("strong",null,"\u2193 Click! \u2193")],-1),f={href:"https://reported.space/",target:"_blank",rel:"noopener noreferrer"},b=e("img",{src:"https://reported.space/favicon.ico",alt:"ico"},null,-1),g=t("Send me some smoke signs on "),k={href:"https://github.com/petry078",target:"_blank",rel:"noopener noreferrer"},v=t("GitHub"),y=t(" or "),w={href:"https://linkedin.com/in/petry078",target:"_blank",rel:"noopener noreferrer"},x=t("LinkedIn"),E=t("."),H=t("Here is the "),I={href:"https://github.com/petry078/spellblog",target:"_blank",rel:"noopener noreferrer"},T=t("GitHub repository"),W=t(" for this project."),j={href:"https://en.wikipedia.org/wiki/Rider%E2%80%93Waite_Tarot",target:"_blank",rel:"noopener noreferrer"},B=t("The Rider\u2013Waite Tarot"),G=t(".");function L(N,V){const o=s("ExternalLinkIcon");return i(),a("div",null,[l,_,h,d,p,u,m,e("p",null,[e("a",f,[b,n(o)])]),e("p",null,[g,e("a",k,[v,n(o)]),y,e("a",w,[x,n(o)]),E]),e("p",null,[H,e("a",I,[T,n(o)]),W]),e("p",null,[e("a",j,[B,n(o)]),G])])}var R=r(c,[["render",L],["__file","about.html.vue"]]);export{R as default}; diff --git a/assets/about.html.a15c021f.js b/assets/about.html.a15c021f.js new file mode 100644 index 0000000..3a63e9c --- /dev/null +++ b/assets/about.html.a15c021f.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-22a39d25","path":"/about.html","title":"About","lang":"en-US","frontmatter":{"sidebar":false,"home":true,"heroText":null,"tagline":null,"footer":"Made with VuePress 2 and Markdown \u2014 Guilherme M. Petry 2022"},"excerpt":"","headers":[],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"about.md"}');export{e as data}; diff --git a/assets/api-enchantment-with-javascript.html.c5281fd9.js b/assets/api-enchantment-with-javascript.html.c5281fd9.js new file mode 100644 index 0000000..e2c6087 --- /dev/null +++ b/assets/api-enchantment-with-javascript.html.c5281fd9.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-724095ba","path":"/posts/api-enchantment-with-javascript.html","title":"API enchantment with JavaScript","lang":"en-US","frontmatter":{"title":"API enchantment with JavaScript","date":"2023-07-17","sidebar":"auto","tags":["API","JavaScript","Fetch API"]},"excerpt":"","headers":[{"level":2,"title":"1. The Fetch API","slug":"_1-the-fetch-api","children":[]}],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"posts/api-enchantment-with-javascript.md"}');export{t as data}; diff --git a/assets/api-enchantment-with-javascript.html.eec3b62c.js b/assets/api-enchantment-with-javascript.html.eec3b62c.js new file mode 100644 index 0000000..ad94398 --- /dev/null +++ b/assets/api-enchantment-with-javascript.html.eec3b62c.js @@ -0,0 +1,56 @@ +import{_ as n,o as s,c as a,e as t}from"./app.03d0ed6d.js";const p={},e=t(`

API enchantment with JavaScript

Content in progress.

1. The Fetch API

Fetch API GET request:

Request: call fetch(<path>). Response: a stream of data in a format of a file (JSON, plain text, HTML, XML, PNG, JPG, GIF, SVG, PDF, CSV, binary files and error responses [status code]).

Image from the web example:

    <img src="" id="rainbow">
+    <script>
+        catchRainbow().then(response => {console.log('all good!')})
+
+        async function catchRainbow(){
+            const response = await fetch('https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Double-alaskan-rainbow.jpg/1200px-Double-alaskan-rainbow.jpg')
+            const blob = await response.blob()
+            document.getElementById('rainbow').src = URL.createObjectURL(blob)
+            console.log(blob)
+        }
+    </script>
+

.txt file from the same domain example:

    <p id="rainbow"></p>
+    <script>
+        catchRainbow()
+
+        async function catchRainbow(){
+            const response = await fetch('/index.txt')
+            const text = await response.text()
+            const printedResponse = String(text)
+            document.getElementById("rainbow").innerText = printedResponse
+        }
+        
+    </script>
+

Parsing and logging a .csv file from /:

getData()
+
+async function getData(){
+    const response = await fetch('fileName.csv') //ask for it
+    const data = await response.text()           //treat the data, in this case text
+    console.log(data)                            //do something with it
+
+    const table = data.split('\\n').slice(1)      //spliting it by line break \`\\n\`
+    table.forEach(row => {                       //array.forEach(splitedProduct => { 
+        const columns = row.split(',')           //split again separating it by columns}
+        const year = columns[0]                  //defining what the first column is
+        const temp = columns[1]                  //defining what the second column is
+        console.log(year, temp)                  //logging it
+    })
+}
+
+

Parsing and logging a .csv file from web server:

    getData()
+
+    async function getData () {
+        const response = await fetch('https://raw.githubusercontent.com/petry078/exercicios-javascript/main/planilha.csv')
+        const data = await response.text()
+        const table = data.split('\\n').slice(1)
+
+            table.forEach(elt => {
+                const columns = elt.split(',')
+                const year = columns[0]
+                const temp = columns[1]
+                console.log(columns)
+                console.log(year, temp)
+            })
+
+    }
+
`,14),o=[e];function c(i,l){return s(),a("div",null,o)}var k=n(p,[["render",c],["__file","api-enchantment-with-javascript.html.vue"]]);export{k as default}; diff --git a/assets/app.03d0ed6d.js b/assets/app.03d0ed6d.js new file mode 100644 index 0000000..cfa876b --- /dev/null +++ b/assets/app.03d0ed6d.js @@ -0,0 +1,10 @@ +const cr={},ys="modulepreload",_o={},xs="/",ue=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${xs}${r}`,r in _o)return;_o[r]=!0;const o=r.endsWith(".css"),i=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${i}`))return;const a=document.createElement("link");if(a.rel=o?"stylesheet":ys,o||(a.as="script",a.crossOrigin=""),a.href=r,document.head.appendChild(a),o)return new Promise((s,l)=>{a.addEventListener("load",s),a.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},_s={"v-22a39d25":()=>ue(()=>import("./about.html.a15c021f.js"),[]).then(({data:e})=>e),"v-8daa1a0e":()=>ue(()=>import("./index.html.6956a64c.js"),[]).then(({data:e})=>e),"v-abde92f0":()=>ue(()=>import("./tarot.html.201441c9.js"),[]).then(({data:e})=>e),"v-724095ba":()=>ue(()=>import("./api-enchantment-with-javascript.html.c5281fd9.js"),[]).then(({data:e})=>e),"v-5029e009":()=>ue(()=>import("./bash-scriptage.html.b7ee1856.js"),[]).then(({data:e})=>e),"v-3ec37569":()=>ue(()=>import("./github-once-and-for-all.html.4b9b7f93.js"),[]).then(({data:e})=>e),"v-5f1b757b":()=>ue(()=>import("./intro-on-web-security-with-helmet-js.html.1823eee7.js"),[]).then(({data:e})=>e),"v-5f5834b4":()=>ue(()=>import("./javascript-references.html.eb9dad91.js"),[]).then(({data:e})=>e),"v-6801703b":()=>ue(()=>import("./kali-metasploitable-virtualbox.html.2cf9bdb1.js"),[]).then(({data:e})=>e),"v-04a11941":()=>ue(()=>import("./latex-pdf-press.html.5e865e84.js"),[]).then(({data:e})=>e),"v-09db1bdd":()=>ue(()=>import("./markdown-cheat-sheet.html.b6a5efec.js"),[]).then(({data:e})=>e),"v-6decc2f5":()=>ue(()=>import("./terminal-commands.html.29baacb0.js"),[]).then(({data:e})=>e),"v-3706649a":()=>ue(()=>import("./404.html.7d858b3d.js"),[]).then(({data:e})=>e)};function Vr(e,t){const n=Object.create(null),r=e.split(",");for(let o=0;o!!n[o.toLowerCase()]:o=>!!n[o]}const Es="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ks=Vr(Es);function Oi(e){return!!e||e===""}function Jn(e){if(G(e)){const t={};for(let n=0;n{if(n){const r=n.split(Ss);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function yn(e){let t="";if(ge(e))t=e;else if(G(e))for(let n=0;nge(e)?e:e==null?"":G(e)||xe(e)&&(e.toString===Mi||!X(e.toString))?JSON.stringify(e,Ri,2):String(e),Ri=(e,t)=>t&&t.__v_isRef?Ri(e,t.value):$t(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o])=>(n[`${r} =>`]=o,n),{})}:Ii(t)?{[`Set(${t.size})`]:[...t.values()]}:xe(t)&&!G(t)&&!Ni(t)?String(t):t,pe={},Dt=[],Je=()=>{},Ps=()=>!1,Ls=/^on[^a-z]/,xn=e=>Ls.test(e),qr=e=>e.startsWith("onUpdate:"),Ce=Object.assign,Wr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Os=Object.prototype.hasOwnProperty,re=(e,t)=>Os.call(e,t),G=Array.isArray,$t=e=>Gn(e)==="[object Map]",Ii=e=>Gn(e)==="[object Set]",X=e=>typeof e=="function",ge=e=>typeof e=="string",Jr=e=>typeof e=="symbol",xe=e=>e!==null&&typeof e=="object",zi=e=>xe(e)&&X(e.then)&&X(e.catch),Mi=Object.prototype.toString,Gn=e=>Mi.call(e),Rs=e=>Gn(e).slice(8,-1),Ni=e=>Gn(e)==="[object Object]",Gr=e=>ge(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,an=Vr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Yn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Is=/-(\w)/g,Qe=Yn(e=>e.replace(Is,(t,n)=>n?n.toUpperCase():"")),zs=/\B([A-Z])/g,Rt=Yn(e=>e.replace(zs,"-$1").toLowerCase()),Qn=Yn(e=>e.charAt(0).toUpperCase()+e.slice(1)),ur=Yn(e=>e?`on${Qn(e)}`:""),hn=(e,t)=>!Object.is(e,t),dr=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Hi=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Eo;const Ms=()=>Eo||(Eo=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let Me;class Ns{constructor(t=!1){this.active=!0,this.effects=[],this.cleanups=[],!t&&Me&&(this.parent=Me,this.index=(Me.scopes||(Me.scopes=[])).push(this)-1)}run(t){if(this.active){const n=Me;try{return Me=this,t()}finally{Me=n}}}on(){Me=this}off(){Me=this.parent}stop(t){if(this.active){let n,r;for(n=0,r=this.effects.length;n{const t=new Set(e);return t.w=0,t.n=0,t},Fi=e=>(e.w>)>0,Di=e=>(e.n>)>0,$s=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r{(c==="length"||c>=r)&&s.push(l)});else switch(n!==void 0&&s.push(a.get(n)),t){case"add":G(e)?Gr(n)&&s.push(a.get("length")):(s.push(a.get(At)),$t(e)&&s.push(a.get(Tr)));break;case"delete":G(e)||(s.push(a.get(At)),$t(e)&&s.push(a.get(Tr)));break;case"set":$t(e)&&s.push(a.get(At));break}if(s.length===1)s[0]&&Ar(s[0]);else{const l=[];for(const c of s)c&&l.push(...c);Ar(Yr(l))}}function Ar(e,t){const n=G(e)?e:[...e];for(const r of n)r.computed&&Co(r);for(const r of n)r.computed||Co(r)}function Co(e,t){(e!==qe||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const Bs=Vr("__proto__,__v_isRef,__isVue"),Bi=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Jr)),Us=Zr(),Ks=Zr(!1,!0),Vs=Zr(!0),So=qs();function qs(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=se(this);for(let i=0,a=this.length;i{e[t]=function(...n){Wt();const r=se(this)[t].apply(this,n);return Jt(),r}}),e}function Zr(e=!1,t=!1){return function(r,o,i){if(o==="__v_isReactive")return!e;if(o==="__v_isReadonly")return e;if(o==="__v_isShallow")return t;if(o==="__v_raw"&&i===(e?t?ll:Wi:t?qi:Vi).get(r))return r;const a=G(r);if(!e&&a&&re(So,o))return Reflect.get(So,o,i);const s=Reflect.get(r,o,i);return(Jr(o)?Bi.has(o):Bs(o))||(e||Fe(r,"get",o),t)?s:ke(s)?a&&Gr(o)?s:s.value:xe(s)?e?to(s):Gt(s):s}}const Ws=Ui(),Js=Ui(!0);function Ui(e=!1){return function(n,r,o,i){let a=n[r];if(pn(a)&&ke(a)&&!ke(o))return!1;if(!e&&!pn(o)&&(Pr(o)||(o=se(o),a=se(a)),!G(n)&&ke(a)&&!ke(o)))return a.value=o,!0;const s=G(n)&&Gr(r)?Number(r)e,Zn=e=>Reflect.getPrototypeOf(e);function Sn(e,t,n=!1,r=!1){e=e.__v_raw;const o=se(e),i=se(t);n||(t!==i&&Fe(o,"get",t),Fe(o,"get",i));const{has:a}=Zn(o),s=r?Xr:n?ro:mn;if(a.call(o,t))return s(e.get(t));if(a.call(o,i))return s(e.get(i));e!==o&&e.get(t)}function Tn(e,t=!1){const n=this.__v_raw,r=se(n),o=se(e);return t||(e!==o&&Fe(r,"has",e),Fe(r,"has",o)),e===o?n.has(e):n.has(e)||n.has(o)}function An(e,t=!1){return e=e.__v_raw,!t&&Fe(se(e),"iterate",At),Reflect.get(e,"size",e)}function To(e){e=se(e);const t=se(this);return Zn(t).has.call(t,e)||(t.add(e),nt(t,"add",e,e)),this}function Ao(e,t){t=se(t);const n=se(this),{has:r,get:o}=Zn(n);let i=r.call(n,e);i||(e=se(e),i=r.call(n,e));const a=o.call(n,e);return n.set(e,t),i?hn(t,a)&&nt(n,"set",e,t):nt(n,"add",e,t),this}function Po(e){const t=se(this),{has:n,get:r}=Zn(t);let o=n.call(t,e);o||(e=se(e),o=n.call(t,e)),r&&r.call(t,e);const i=t.delete(e);return o&&nt(t,"delete",e,void 0),i}function Lo(){const e=se(this),t=e.size!==0,n=e.clear();return t&&nt(e,"clear",void 0,void 0),n}function Pn(e,t){return function(r,o){const i=this,a=i.__v_raw,s=se(a),l=t?Xr:e?ro:mn;return!e&&Fe(s,"iterate",At),a.forEach((c,d)=>r.call(o,l(c),l(d),i))}}function Ln(e,t,n){return function(...r){const o=this.__v_raw,i=se(o),a=$t(i),s=e==="entries"||e===Symbol.iterator&&a,l=e==="keys"&&a,c=o[e](...r),d=n?Xr:t?ro:mn;return!t&&Fe(i,"iterate",l?Tr:At),{next(){const{value:p,done:f}=c.next();return f?{value:p,done:f}:{value:s?[d(p[0]),d(p[1])]:d(p),done:f}},[Symbol.iterator](){return this}}}}function it(e){return function(...t){return e==="delete"?!1:this}}function el(){const e={get(i){return Sn(this,i)},get size(){return An(this)},has:Tn,add:To,set:Ao,delete:Po,clear:Lo,forEach:Pn(!1,!1)},t={get(i){return Sn(this,i,!1,!0)},get size(){return An(this)},has:Tn,add:To,set:Ao,delete:Po,clear:Lo,forEach:Pn(!1,!0)},n={get(i){return Sn(this,i,!0)},get size(){return An(this,!0)},has(i){return Tn.call(this,i,!0)},add:it("add"),set:it("set"),delete:it("delete"),clear:it("clear"),forEach:Pn(!0,!1)},r={get(i){return Sn(this,i,!0,!0)},get size(){return An(this,!0)},has(i){return Tn.call(this,i,!0)},add:it("add"),set:it("set"),delete:it("delete"),clear:it("clear"),forEach:Pn(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Ln(i,!1,!1),n[i]=Ln(i,!0,!1),t[i]=Ln(i,!1,!0),r[i]=Ln(i,!0,!0)}),[e,n,t,r]}const[tl,nl,rl,ol]=el();function eo(e,t){const n=t?e?ol:rl:e?nl:tl;return(r,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(re(n,o)&&o in r?n:r,o,i)}const il={get:eo(!1,!1)},al={get:eo(!1,!0)},sl={get:eo(!0,!1)},Vi=new WeakMap,qi=new WeakMap,Wi=new WeakMap,ll=new WeakMap;function cl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ul(e){return e.__v_skip||!Object.isExtensible(e)?0:cl(Rs(e))}function Gt(e){return pn(e)?e:no(e,!1,Ki,il,Vi)}function dl(e){return no(e,!1,Xs,al,qi)}function to(e){return no(e,!0,Zs,sl,Wi)}function no(e,t,n,r,o){if(!xe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=o.get(e);if(i)return i;const a=ul(e);if(a===0)return e;const s=new Proxy(e,a===2?r:n);return o.set(e,s),s}function jt(e){return pn(e)?jt(e.__v_raw):!!(e&&e.__v_isReactive)}function pn(e){return!!(e&&e.__v_isReadonly)}function Pr(e){return!!(e&&e.__v_isShallow)}function Ji(e){return jt(e)||pn(e)}function se(e){const t=e&&e.__v_raw;return t?se(t):e}function Gi(e){return Hn(e,"__v_skip",!0),e}const mn=e=>xe(e)?Gt(e):e,ro=e=>xe(e)?to(e):e;function Yi(e){pt&&qe&&(e=se(e),ji(e.dep||(e.dep=Yr())))}function Qi(e,t){e=se(e),e.dep&&Ar(e.dep)}function ke(e){return!!(e&&e.__v_isRef===!0)}function we(e){return Xi(e,!1)}function Zi(e){return Xi(e,!0)}function Xi(e,t){return ke(e)?e:new fl(e,t)}class fl{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:se(t),this._value=n?t:mn(t)}get value(){return Yi(this),this._value}set value(t){t=this.__v_isShallow?t:se(t),hn(t,this._rawValue)&&(this._rawValue=t,this._value=this.__v_isShallow?t:mn(t),Qi(this))}}function Pt(e){return ke(e)?e.value:e}const hl={get:(e,t,n)=>Pt(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return ke(o)&&!ke(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function ea(e){return jt(e)?e:new Proxy(e,hl)}function pl(e){const t=G(e)?new Array(e.length):{};for(const n in e)t[n]=gl(e,n);return t}class ml{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}}function gl(e,t,n){const r=e[t];return ke(r)?r:new ml(e,t,n)}class vl{constructor(t,n,r,o){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new Qr(t,()=>{this._dirty||(this._dirty=!0,Qi(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=r}get value(){const t=se(this);return Yi(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function bl(e,t,n=!1){let r,o;const i=X(e);return i?(r=e,o=Je):(r=e.get,o=e.set),new vl(r,o,i||!o,n)}function mt(e,t,n,r){let o;try{o=r?e(...r):e()}catch(i){_n(i,t,n)}return o}function Ue(e,t,n,r){if(X(e)){const i=mt(e,t,n,r);return i&&zi(i)&&i.catch(a=>{_n(a,t,n)}),i}const o=[];for(let i=0;i>>1;gn(Ne[r])Xe&&Ne.splice(t,1)}function ra(e,t,n,r){G(e)?n.push(...e):(!t||!t.includes(e,e.allowRecurse?r+1:r))&&n.push(e),na()}function _l(e){ra(e,on,sn,Nt)}function El(e){ra(e,ut,ln,Ht)}function Xn(e,t=null){if(sn.length){for(Or=t,on=[...new Set(sn)],sn.length=0,Nt=0;Ntgn(n)-gn(r)),Ht=0;Hte.id==null?1/0:e.id;function oa(e){Lr=!1,Fn=!0,Xn(e),Ne.sort((n,r)=>gn(n)-gn(r));const t=Je;try{for(Xe=0;Xeb.trim())),p&&(o=n.map(Hi))}let s,l=r[s=ur(t)]||r[s=ur(Qe(t))];!l&&i&&(l=r[s=ur(Rt(t))]),l&&Ue(l,e,6,o);const c=r[s+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Ue(c,e,6,o)}}function ia(e,t,n=!1){const r=t.emitsCache,o=r.get(e);if(o!==void 0)return o;const i=e.emits;let a={},s=!1;if(!X(e)){const l=c=>{const d=ia(c,t,!0);d&&(s=!0,Ce(a,d))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!i&&!s?(r.set(e,null),null):(G(i)?i.forEach(l=>a[l]=null):Ce(a,i),r.set(e,a),a)}function er(e,t){return!e||!xn(t)?!1:(t=t.slice(2).replace(/Once$/,""),re(e,t[0].toLowerCase()+t.slice(1))||re(e,Rt(t))||re(e,t))}let Se=null,aa=null;function $n(e){const t=Se;return Se=e,aa=e&&e.type.__scopeId||null,t}function Cl(e,t=Se,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&jo(-1);const i=$n(t),a=e(...o);return $n(i),r._d&&jo(1),a};return r._n=!0,r._c=!0,r._d=!0,r}function fr(e){const{type:t,vnode:n,proxy:r,withProxy:o,props:i,propsOptions:[a],slots:s,attrs:l,emit:c,render:d,renderCache:p,data:f,setupState:b,ctx:y,inheritAttrs:L}=e;let T,m;const w=$n(e);try{if(n.shapeFlag&4){const M=o||r;T=Ve(d.call(M,M,p,i,b,f,y)),m=l}else{const M=t;T=Ve(M.length>1?M(i,{attrs:l,slots:s,emit:c}):M(i,null)),m=t.props?l:Sl(l)}}catch(M){un.length=0,_n(M,e,1),T=be(He)}let C=T;if(m&&L!==!1){const M=Object.keys(m),{shapeFlag:j}=C;M.length&&j&7&&(a&&M.some(qr)&&(m=Tl(m,a)),C=vt(C,m))}return n.dirs&&(C=vt(C),C.dirs=C.dirs?C.dirs.concat(n.dirs):n.dirs),n.transition&&(C.transition=n.transition),T=C,$n(w),T}const Sl=e=>{let t;for(const n in e)(n==="class"||n==="style"||xn(n))&&((t||(t={}))[n]=e[n]);return t},Tl=(e,t)=>{const n={};for(const r in e)(!qr(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Al(e,t,n){const{props:r,children:o,component:i}=e,{props:a,children:s,patchFlag:l}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Oo(r,a,c):!!a;if(l&8){const d=t.dynamicProps;for(let p=0;pe.__isSuspense;function sa(e,t){t&&t.pendingBranch?G(e)?t.effects.push(...e):t.effects.push(e):El(e)}function Lt(e,t){if(_e){let n=_e.provides;const r=_e.parent&&_e.parent.provides;r===n&&(n=_e.provides=Object.create(r)),n[e]=t}}function Ee(e,t,n=!1){const r=_e||Se;if(r){const o=r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides;if(o&&e in o)return o[e];if(arguments.length>1)return n&&X(t)?t.call(r.proxy):t}}const Ro={};function tt(e,t,n){return la(e,t,n)}function la(e,t,{immediate:n,deep:r,flush:o,onTrack:i,onTrigger:a}=pe){const s=_e;let l,c=!1,d=!1;if(ke(e)?(l=()=>e.value,c=Pr(e)):jt(e)?(l=()=>e,r=!0):G(e)?(d=!0,c=e.some(m=>jt(m)||Pr(m)),l=()=>e.map(m=>{if(ke(m))return m.value;if(jt(m))return Tt(m);if(X(m))return mt(m,s,2)})):X(e)?t?l=()=>mt(e,s,2):l=()=>{if(!(s&&s.isUnmounted))return p&&p(),Ue(e,s,3,[f])}:l=Je,t&&r){const m=l;l=()=>Tt(m())}let p,f=m=>{p=T.onStop=()=>{mt(m,s,4)}};if(Kt)return f=Je,t?n&&Ue(t,s,3,[l(),d?[]:void 0,f]):l(),Je;let b=d?[]:Ro;const y=()=>{if(!!T.active)if(t){const m=T.run();(r||c||(d?m.some((w,C)=>hn(w,b[C])):hn(m,b)))&&(p&&p(),Ue(t,s,3,[m,b===Ro?void 0:b,f]),b=m)}else T.run()};y.allowRecurse=!!t;let L;o==="sync"?L=y:o==="post"?L=()=>Oe(y,s&&s.suspense):L=()=>_l(y);const T=new Qr(l,L);return t?n?y():b=T.run():o==="post"?Oe(T.run.bind(T),s&&s.suspense):T.run(),()=>{T.stop(),s&&s.scope&&Wr(s.scope.effects,T)}}function Ol(e,t,n){const r=this.proxy,o=ge(e)?e.includes(".")?ca(r,e):()=>r[e]:e.bind(r,r);let i;X(t)?i=t:(i=t.handler,n=t);const a=_e;Ut(this);const s=la(o,i.bind(r),n);return a?Ut(a):Ot(),s}function ca(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o{Tt(n,t)});else if(Ni(e))for(const n in e)Tt(e[n],t);return e}function Rl(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ot(()=>{e.isMounted=!0}),nr(()=>{e.isUnmounting=!0}),e}const je=[Function,Array],Il={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:je,onEnter:je,onAfterEnter:je,onEnterCancelled:je,onBeforeLeave:je,onLeave:je,onAfterLeave:je,onLeaveCancelled:je,onBeforeAppear:je,onAppear:je,onAfterAppear:je,onAppearCancelled:je},setup(e,{slots:t}){const n=Ra(),r=Rl();let o;return()=>{const i=t.default&&fa(t.default(),!0);if(!i||!i.length)return;let a=i[0];if(i.length>1){for(const L of i)if(L.type!==He){a=L;break}}const s=se(e),{mode:l}=s;if(r.isLeaving)return hr(a);const c=Io(a);if(!c)return hr(a);const d=Rr(c,s,r,n);Ir(c,d);const p=n.subTree,f=p&&Io(p);let b=!1;const{getTransitionKey:y}=c.type;if(y){const L=y();o===void 0?o=L:L!==o&&(o=L,b=!0)}if(f&&f.type!==He&&(!Ct(c,f)||b)){const L=Rr(f,s,r,n);if(Ir(f,L),l==="out-in")return r.isLeaving=!0,L.afterLeave=()=>{r.isLeaving=!1,n.update()},hr(a);l==="in-out"&&c.type!==He&&(L.delayLeave=(T,m,w)=>{const C=da(r,f);C[String(f.key)]=f,T._leaveCb=()=>{m(),T._leaveCb=void 0,delete d.delayedLeave},d.delayedLeave=w})}return a}}},ua=Il;function da(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Rr(e,t,n,r){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:s,onEnter:l,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:p,onLeave:f,onAfterLeave:b,onLeaveCancelled:y,onBeforeAppear:L,onAppear:T,onAfterAppear:m,onAppearCancelled:w}=t,C=String(e.key),M=da(n,e),j=(g,J)=>{g&&Ue(g,r,9,J)},D=(g,J)=>{const $=J[1];j(g,J),G(g)?g.every(V=>V.length<=1)&&$():g.length<=1&&$()},z={mode:i,persisted:a,beforeEnter(g){let J=s;if(!n.isMounted)if(o)J=L||s;else return;g._leaveCb&&g._leaveCb(!0);const $=M[C];$&&Ct(e,$)&&$.el._leaveCb&&$.el._leaveCb(),j(J,[g])},enter(g){let J=l,$=c,V=d;if(!n.isMounted)if(o)J=T||l,$=m||c,V=w||d;else return;let x=!1;const N=g._enterCb=O=>{x||(x=!0,O?j(V,[g]):j($,[g]),z.delayedLeave&&z.delayedLeave(),g._enterCb=void 0)};J?D(J,[g,N]):N()},leave(g,J){const $=String(e.key);if(g._enterCb&&g._enterCb(!0),n.isUnmounting)return J();j(p,[g]);let V=!1;const x=g._leaveCb=N=>{V||(V=!0,J(),N?j(y,[g]):j(b,[g]),g._leaveCb=void 0,M[$]===e&&delete M[$])};M[$]=e,f?D(f,[g,x]):x()},clone(g){return Rr(g,t,n,r)}};return z}function hr(e){if(En(e))return e=vt(e),e.children=null,e}function Io(e){return En(e)?e.children?e.children[0]:void 0:e}function Ir(e,t){e.shapeFlag&6&&e.component?Ir(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function fa(e,t=!1,n){let r=[],o=0;for(let i=0;i1)for(let i=0;i!!e.type.__asyncLoader;function Pe(e){X(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,timeout:i,suspensible:a=!0,onError:s}=e;let l=null,c,d=0;const p=()=>(d++,l=null,f()),f=()=>{let b;return l||(b=l=t().catch(y=>{if(y=y instanceof Error?y:new Error(String(y)),s)return new Promise((L,T)=>{s(y,()=>L(p()),()=>T(y),d+1)});throw y}).then(y=>b!==l&&l?l:(y&&(y.__esModule||y[Symbol.toStringTag]==="Module")&&(y=y.default),c=y,y)))};return De({name:"AsyncComponentWrapper",__asyncLoader:f,get __asyncResolved(){return c},setup(){const b=_e;if(c)return()=>pr(c,b);const y=w=>{l=null,_n(w,b,13,!r)};if(a&&b.suspense||Kt)return f().then(w=>()=>pr(w,b)).catch(w=>(y(w),()=>r?be(r,{error:w}):null));const L=we(!1),T=we(),m=we(!!o);return o&&setTimeout(()=>{m.value=!1},o),i!=null&&setTimeout(()=>{if(!L.value&&!T.value){const w=new Error(`Async component timed out after ${i}ms.`);y(w),T.value=w}},i),f().then(()=>{L.value=!0,b.parent&&En(b.parent.vnode)&&ao(b.parent.update)}).catch(w=>{y(w),T.value=w}),()=>{if(L.value&&c)return pr(c,b);if(T.value&&r)return be(r,{error:T.value});if(n&&!m.value)return be(n)}}})}function pr(e,{vnode:{ref:t,props:n,children:r,shapeFlag:o},parent:i}){const a=be(e,n,r);return a.ref=t,a}const En=e=>e.type.__isKeepAlive;function zl(e,t){ha(e,"a",t)}function Ml(e,t){ha(e,"da",t)}function ha(e,t,n=_e){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(tr(t,r,n),n){let o=n.parent;for(;o&&o.parent;)En(o.parent.vnode)&&Nl(r,t,n,o),o=o.parent}}function Nl(e,t,n,r){const o=tr(t,e,r,!0);so(()=>{Wr(r[t],o)},n)}function tr(e,t,n=_e,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...a)=>{if(n.isUnmounted)return;Wt(),Ut(n);const s=Ue(t,n,e,a);return Ot(),Jt(),s});return r?o.unshift(i):o.push(i),i}}const rt=e=>(t,n=_e)=>(!Kt||e==="sp")&&tr(e,t,n),pa=rt("bm"),ot=rt("m"),Hl=rt("bu"),Fl=rt("u"),nr=rt("bum"),so=rt("um"),Dl=rt("sp"),$l=rt("rtg"),jl=rt("rtc");function Bl(e,t=_e){tr("ec",e,t)}function dh(e,t){const n=Se;if(n===null)return e;const r=ir(n)||n.proxy,o=e.dirs||(e.dirs=[]);for(let i=0;it(a,s,void 0,i&&i[s]));else{const a=Object.keys(e);o=new Array(a.length);for(let s=0,l=a.length;sKn(t)?!(t.type===He||t.type===Re&&!va(t.children)):!0)?e:null}const zr=e=>e?Ia(e)?ir(e)||e.proxy:zr(e.parent):null,jn=Ce(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>zr(e.parent),$root:e=>zr(e.root),$emit:e=>e.emit,$options:e=>wa(e),$forceUpdate:e=>e.f||(e.f=()=>ao(e.update)),$nextTick:e=>e.n||(e.n=io.bind(e.proxy)),$watch:e=>Ol.bind(e)}),ql={get({_:e},t){const{ctx:n,setupState:r,data:o,props:i,accessCache:a,type:s,appContext:l}=e;let c;if(t[0]!=="$"){const b=a[t];if(b!==void 0)switch(b){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(r!==pe&&re(r,t))return a[t]=1,r[t];if(o!==pe&&re(o,t))return a[t]=2,o[t];if((c=e.propsOptions[0])&&re(c,t))return a[t]=3,i[t];if(n!==pe&&re(n,t))return a[t]=4,n[t];Mr&&(a[t]=0)}}const d=jn[t];let p,f;if(d)return t==="$attrs"&&Fe(e,"get",t),d(e);if((p=s.__cssModules)&&(p=p[t]))return p;if(n!==pe&&re(n,t))return a[t]=4,n[t];if(f=l.config.globalProperties,re(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:i}=e;return o!==pe&&re(o,t)?(o[t]=n,!0):r!==pe&&re(r,t)?(r[t]=n,!0):re(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,propsOptions:i}},a){let s;return!!n[a]||e!==pe&&re(e,a)||t!==pe&&re(t,a)||(s=i[0])&&re(s,a)||re(r,a)||re(jn,a)||re(o.config.globalProperties,a)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:re(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};let Mr=!0;function Wl(e){const t=wa(e),n=e.proxy,r=e.ctx;Mr=!1,t.beforeCreate&&Mo(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:a,watch:s,provide:l,inject:c,created:d,beforeMount:p,mounted:f,beforeUpdate:b,updated:y,activated:L,deactivated:T,beforeDestroy:m,beforeUnmount:w,destroyed:C,unmounted:M,render:j,renderTracked:D,renderTriggered:z,errorCaptured:g,serverPrefetch:J,expose:$,inheritAttrs:V,components:x,directives:N,filters:O}=t;if(c&&Jl(c,r,null,e.appContext.config.unwrapInjectedRef),a)for(const Z in a){const te=a[Z];X(te)&&(r[Z]=te.bind(n))}if(o){const Z=o.call(n,n);xe(Z)&&(e.data=Gt(Z))}if(Mr=!0,i)for(const Z in i){const te=i[Z],ye=X(te)?te.bind(n,n):X(te.get)?te.get.bind(n,n):Je,Te=!X(te)&&X(te.set)?te.set.bind(n):Je,Ie=me({get:ye,set:Te});Object.defineProperty(r,Z,{enumerable:!0,configurable:!0,get:()=>Ie.value,set:$e=>Ie.value=$e})}if(s)for(const Z in s)ba(s[Z],r,n,Z);if(l){const Z=X(l)?l.call(n):l;Reflect.ownKeys(Z).forEach(te=>{Lt(te,Z[te])})}d&&Mo(d,e,"c");function F(Z,te){G(te)?te.forEach(ye=>Z(ye.bind(n))):te&&Z(te.bind(n))}if(F(pa,p),F(ot,f),F(Hl,b),F(Fl,y),F(zl,L),F(Ml,T),F(Bl,g),F(jl,D),F($l,z),F(nr,w),F(so,M),F(Dl,J),G($))if($.length){const Z=e.exposed||(e.exposed={});$.forEach(te=>{Object.defineProperty(Z,te,{get:()=>n[te],set:ye=>n[te]=ye})})}else e.exposed||(e.exposed={});j&&e.render===Je&&(e.render=j),V!=null&&(e.inheritAttrs=V),x&&(e.components=x),N&&(e.directives=N)}function Jl(e,t,n=Je,r=!1){G(e)&&(e=Nr(e));for(const o in e){const i=e[o];let a;xe(i)?"default"in i?a=Ee(i.from||o,i.default,!0):a=Ee(i.from||o):a=Ee(i),ke(a)&&r?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>a.value,set:s=>a.value=s}):t[o]=a}}function Mo(e,t,n){Ue(G(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function ba(e,t,n,r){const o=r.includes(".")?ca(n,r):()=>n[r];if(ge(e)){const i=t[e];X(i)&&tt(o,i)}else if(X(e))tt(o,e.bind(n));else if(xe(e))if(G(e))e.forEach(i=>ba(i,t,n,r));else{const i=X(e.handler)?e.handler.bind(n):t[e.handler];X(i)&&tt(o,i,e)}}function wa(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:a}}=e.appContext,s=i.get(t);let l;return s?l=s:!o.length&&!n&&!r?l=t:(l={},o.length&&o.forEach(c=>Bn(l,c,a,!0)),Bn(l,t,a)),i.set(t,l),l}function Bn(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&Bn(e,i,n,!0),o&&o.forEach(a=>Bn(e,a,n,!0));for(const a in t)if(!(r&&a==="expose")){const s=Gl[a]||n&&n[a];e[a]=s?s(e[a],t[a]):t[a]}return e}const Gl={data:No,props:_t,emits:_t,methods:_t,computed:_t,beforeCreate:Ae,created:Ae,beforeMount:Ae,mounted:Ae,beforeUpdate:Ae,updated:Ae,beforeDestroy:Ae,beforeUnmount:Ae,destroyed:Ae,unmounted:Ae,activated:Ae,deactivated:Ae,errorCaptured:Ae,serverPrefetch:Ae,components:_t,directives:_t,watch:Ql,provide:No,inject:Yl};function No(e,t){return t?e?function(){return Ce(X(e)?e.call(this,this):e,X(t)?t.call(this,this):t)}:t:e}function Yl(e,t){return _t(Nr(e),Nr(t))}function Nr(e){if(G(e)){const t={};for(let n=0;n0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let p=0;p{l=!0;const[f,b]=xa(p,t,!0);Ce(a,f),b&&s.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!l)return r.set(e,Dt),Dt;if(G(i))for(let d=0;d-1,b[1]=L<0||y-1||re(b,"default"))&&s.push(p)}}}const c=[a,s];return r.set(e,c),c}function Ho(e){return e[0]!=="$"}function Fo(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:e===null?"null":""}function Do(e,t){return Fo(e)===Fo(t)}function $o(e,t){return G(t)?t.findIndex(n=>Do(n,e)):X(t)&&Do(t,e)?0:-1}const _a=e=>e[0]==="_"||e==="$stable",lo=e=>G(e)?e.map(Ve):[Ve(e)],ec=(e,t,n)=>{if(t._n)return t;const r=Cl((...o)=>lo(t(...o)),n);return r._c=!1,r},Ea=(e,t,n)=>{const r=e._ctx;for(const o in e){if(_a(o))continue;const i=e[o];if(X(i))t[o]=ec(o,i,r);else if(i!=null){const a=lo(i);t[o]=()=>a}}},ka=(e,t)=>{const n=lo(t);e.slots.default=()=>n},tc=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=se(t),Hn(t,"_",n)):Ea(t,e.slots={})}else e.slots={},t&&ka(e,t);Hn(e.slots,or,1)},nc=(e,t,n)=>{const{vnode:r,slots:o}=e;let i=!0,a=pe;if(r.shapeFlag&32){const s=t._;s?n&&s===1?i=!1:(Ce(o,t),!n&&s===1&&delete o._):(i=!t.$stable,Ea(t,o)),a=t}else t&&(ka(e,t),a={default:1});if(i)for(const s in o)!_a(s)&&!(s in a)&&delete o[s]};function Ca(){return{app:null,config:{isNativeTag:Ps,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let rc=0;function oc(e,t){return function(r,o=null){X(r)||(r=Object.assign({},r)),o!=null&&!xe(o)&&(o=null);const i=Ca(),a=new Set;let s=!1;const l=i.app={_uid:rc++,_component:r,_props:o,_container:null,_context:i,_instance:null,version:Ec,get config(){return i.config},set config(c){},use(c,...d){return a.has(c)||(c&&X(c.install)?(a.add(c),c.install(l,...d)):X(c)&&(a.add(c),c(l,...d))),l},mixin(c){return i.mixins.includes(c)||i.mixins.push(c),l},component(c,d){return d?(i.components[c]=d,l):i.components[c]},directive(c,d){return d?(i.directives[c]=d,l):i.directives[c]},mount(c,d,p){if(!s){const f=be(r,o);return f.appContext=i,d&&t?t(f,c):e(f,c,p),s=!0,l._container=c,c.__vue_app__=l,ir(f.component)||f.component.proxy}},unmount(){s&&(e(null,l._container),delete l._container.__vue_app__)},provide(c,d){return i.provides[c]=d,l}};return l}}function Un(e,t,n,r,o=!1){if(G(e)){e.forEach((f,b)=>Un(f,t&&(G(t)?t[b]:t),n,r,o));return}if(Bt(r)&&!o)return;const i=r.shapeFlag&4?ir(r.component)||r.component.proxy:r.el,a=o?null:i,{i:s,r:l}=e,c=t&&t.r,d=s.refs===pe?s.refs={}:s.refs,p=s.setupState;if(c!=null&&c!==l&&(ge(c)?(d[c]=null,re(p,c)&&(p[c]=null)):ke(c)&&(c.value=null)),X(l))mt(l,s,12,[a,d]);else{const f=ge(l),b=ke(l);if(f||b){const y=()=>{if(e.f){const L=f?d[l]:l.value;o?G(L)&&Wr(L,i):G(L)?L.includes(i)||L.push(i):f?(d[l]=[i],re(p,l)&&(p[l]=d[l])):(l.value=[i],e.k&&(d[e.k]=l.value))}else f?(d[l]=a,re(p,l)&&(p[l]=a)):b&&(l.value=a,e.k&&(d[e.k]=a))};a?(y.id=-1,Oe(y,n)):y()}}}let at=!1;const On=e=>/svg/.test(e.namespaceURI)&&e.tagName!=="foreignObject",Rn=e=>e.nodeType===8;function ic(e){const{mt:t,p:n,o:{patchProp:r,createText:o,nextSibling:i,parentNode:a,remove:s,insert:l,createComment:c}}=e,d=(m,w)=>{if(!w.hasChildNodes()){n(null,m,w),Dn(),w._vnode=m;return}at=!1,p(w.firstChild,m,null,null,null),Dn(),w._vnode=m,at&&console.error("Hydration completed but contains mismatches.")},p=(m,w,C,M,j,D=!1)=>{const z=Rn(m)&&m.data==="[",g=()=>L(m,w,C,M,j,z),{type:J,ref:$,shapeFlag:V,patchFlag:x}=w,N=m.nodeType;w.el=m,x===-2&&(D=!1,w.dynamicChildren=null);let O=null;switch(J){case vn:N!==3?w.children===""?(l(w.el=o(""),a(m),m),O=m):O=g():(m.data!==w.children&&(at=!0,m.data=w.children),O=i(m));break;case He:N!==8||z?O=g():O=i(m);break;case cn:if(N!==1&&N!==3)O=g();else{O=m;const ne=!w.children.length;for(let F=0;F{D=D||!!w.dynamicChildren;const{type:z,props:g,patchFlag:J,shapeFlag:$,dirs:V}=w,x=z==="input"&&V||z==="option";if(x||J!==-1){if(V&&Ye(w,null,C,"created"),g)if(x||!D||J&48)for(const O in g)(x&&O.endsWith("value")||xn(O)&&!an(O))&&r(m,O,null,g[O],!1,void 0,C);else g.onClick&&r(m,"onClick",null,g.onClick,!1,void 0,C);let N;if((N=g&&g.onVnodeBeforeMount)&&Be(N,C,w),V&&Ye(w,null,C,"beforeMount"),((N=g&&g.onVnodeMounted)||V)&&sa(()=>{N&&Be(N,C,w),V&&Ye(w,null,C,"mounted")},M),$&16&&!(g&&(g.innerHTML||g.textContent))){let O=b(m.firstChild,w,m,C,M,j,D);for(;O;){at=!0;const ne=O;O=O.nextSibling,s(ne)}}else $&8&&m.textContent!==w.children&&(at=!0,m.textContent=w.children)}return m.nextSibling},b=(m,w,C,M,j,D,z)=>{z=z||!!w.dynamicChildren;const g=w.children,J=g.length;for(let $=0;${const{slotScopeIds:z}=w;z&&(j=j?j.concat(z):z);const g=a(m),J=b(i(m),w,g,C,M,j,D);return J&&Rn(J)&&J.data==="]"?i(w.anchor=J):(at=!0,l(w.anchor=c("]"),g,J),J)},L=(m,w,C,M,j,D)=>{if(at=!0,w.el=null,D){const J=T(m);for(;;){const $=i(m);if($&&$!==J)s($);else break}}const z=i(m),g=a(m);return s(m),n(null,w,g,z,C,M,On(g),j),z},T=m=>{let w=0;for(;m;)if(m=i(m),m&&Rn(m)&&(m.data==="["&&w++,m.data==="]")){if(w===0)return i(m);w--}return m};return[d,p]}const Oe=sa;function ac(e){return sc(e,ic)}function sc(e,t){const n=Ms();n.__VUE__=!0;const{insert:r,remove:o,patchProp:i,createElement:a,createText:s,createComment:l,setText:c,setElementText:d,parentNode:p,nextSibling:f,setScopeId:b=Je,cloneNode:y,insertStaticContent:L}=e,T=(u,h,v,k=null,E=null,A=null,H=!1,P=null,I=!!h.dynamicChildren)=>{if(u===h)return;u&&!Ct(u,h)&&(k=U(u),Le(u,E,A,!0),u=null),h.patchFlag===-2&&(I=!1,h.dynamicChildren=null);const{type:S,ref:q,shapeFlag:K}=h;switch(S){case vn:m(u,h,v,k);break;case He:w(u,h,v,k);break;case cn:u==null&&C(h,v,k,H);break;case Re:N(u,h,v,k,E,A,H,P,I);break;default:K&1?D(u,h,v,k,E,A,H,P,I):K&6?O(u,h,v,k,E,A,H,P,I):(K&64||K&128)&&S.process(u,h,v,k,E,A,H,P,I,ce)}q!=null&&E&&Un(q,u&&u.ref,A,h||u,!h)},m=(u,h,v,k)=>{if(u==null)r(h.el=s(h.children),v,k);else{const E=h.el=u.el;h.children!==u.children&&c(E,h.children)}},w=(u,h,v,k)=>{u==null?r(h.el=l(h.children||""),v,k):h.el=u.el},C=(u,h,v,k)=>{[u.el,u.anchor]=L(u.children,h,v,k,u.el,u.anchor)},M=({el:u,anchor:h},v,k)=>{let E;for(;u&&u!==h;)E=f(u),r(u,v,k),u=E;r(h,v,k)},j=({el:u,anchor:h})=>{let v;for(;u&&u!==h;)v=f(u),o(u),u=v;o(h)},D=(u,h,v,k,E,A,H,P,I)=>{H=H||h.type==="svg",u==null?z(h,v,k,E,A,H,P,I):$(u,h,E,A,H,P,I)},z=(u,h,v,k,E,A,H,P)=>{let I,S;const{type:q,props:K,shapeFlag:W,transition:Y,patchFlag:oe,dirs:de}=u;if(u.el&&y!==void 0&&oe===-1)I=u.el=y(u.el);else{if(I=u.el=a(u.type,A,K&&K.is,K),W&8?d(I,u.children):W&16&&J(u.children,I,null,k,E,A&&q!=="foreignObject",H,P),de&&Ye(u,null,k,"created"),K){for(const ve in K)ve!=="value"&&!an(ve)&&i(I,ve,null,K[ve],A,u.children,k,E,R);"value"in K&&i(I,"value",null,K.value),(S=K.onVnodeBeforeMount)&&Be(S,k,u)}g(I,u,u.scopeId,H,k)}de&&Ye(u,null,k,"beforeMount");const fe=(!E||E&&!E.pendingBranch)&&Y&&!Y.persisted;fe&&Y.beforeEnter(I),r(I,h,v),((S=K&&K.onVnodeMounted)||fe||de)&&Oe(()=>{S&&Be(S,k,u),fe&&Y.enter(I),de&&Ye(u,null,k,"mounted")},E)},g=(u,h,v,k,E)=>{if(v&&b(u,v),k)for(let A=0;A{for(let S=I;S{const P=h.el=u.el;let{patchFlag:I,dynamicChildren:S,dirs:q}=h;I|=u.patchFlag&16;const K=u.props||pe,W=h.props||pe;let Y;v&&wt(v,!1),(Y=W.onVnodeBeforeUpdate)&&Be(Y,v,h,u),q&&Ye(h,u,v,"beforeUpdate"),v&&wt(v,!0);const oe=E&&h.type!=="foreignObject";if(S?V(u.dynamicChildren,S,P,v,k,oe,A):H||ye(u,h,P,null,v,k,oe,A,!1),I>0){if(I&16)x(P,h,K,W,v,k,E);else if(I&2&&K.class!==W.class&&i(P,"class",null,W.class,E),I&4&&i(P,"style",K.style,W.style,E),I&8){const de=h.dynamicProps;for(let fe=0;fe{Y&&Be(Y,v,h,u),q&&Ye(h,u,v,"updated")},k)},V=(u,h,v,k,E,A,H)=>{for(let P=0;P{if(v!==k){for(const P in k){if(an(P))continue;const I=k[P],S=v[P];I!==S&&P!=="value"&&i(u,P,S,I,H,h.children,E,A,R)}if(v!==pe)for(const P in v)!an(P)&&!(P in k)&&i(u,P,v[P],null,H,h.children,E,A,R);"value"in k&&i(u,"value",v.value,k.value)}},N=(u,h,v,k,E,A,H,P,I)=>{const S=h.el=u?u.el:s(""),q=h.anchor=u?u.anchor:s("");let{patchFlag:K,dynamicChildren:W,slotScopeIds:Y}=h;Y&&(P=P?P.concat(Y):Y),u==null?(r(S,v,k),r(q,v,k),J(h.children,v,q,E,A,H,P,I)):K>0&&K&64&&W&&u.dynamicChildren?(V(u.dynamicChildren,W,v,E,A,H,P),(h.key!=null||E&&h===E.subTree)&&Sa(u,h,!0)):ye(u,h,v,q,E,A,H,P,I)},O=(u,h,v,k,E,A,H,P,I)=>{h.slotScopeIds=P,u==null?h.shapeFlag&512?E.ctx.activate(h,v,k,H,I):ne(h,v,k,E,A,H,I):F(u,h,I)},ne=(u,h,v,k,E,A,H)=>{const P=u.component=gc(u,k,E);if(En(u)&&(P.ctx.renderer=ce),vc(P),P.asyncDep){if(E&&E.registerDep(P,Z),!u.el){const I=P.subTree=be(He);w(null,I,h,v)}return}Z(P,u,h,v,E,A,H)},F=(u,h,v)=>{const k=h.component=u.component;if(Al(u,h,v))if(k.asyncDep&&!k.asyncResolved){te(k,h,v);return}else k.next=h,xl(k.update),k.update();else h.el=u.el,k.vnode=h},Z=(u,h,v,k,E,A,H)=>{const P=()=>{if(u.isMounted){let{next:q,bu:K,u:W,parent:Y,vnode:oe}=u,de=q,fe;wt(u,!1),q?(q.el=oe.el,te(u,q,H)):q=oe,K&&dr(K),(fe=q.props&&q.props.onVnodeBeforeUpdate)&&Be(fe,Y,q,oe),wt(u,!0);const ve=fr(u),Ke=u.subTree;u.subTree=ve,T(Ke,ve,p(Ke.el),U(Ke),u,E,A),q.el=ve.el,de===null&&Pl(u,ve.el),W&&Oe(W,E),(fe=q.props&&q.props.onVnodeUpdated)&&Oe(()=>Be(fe,Y,q,oe),E)}else{let q;const{el:K,props:W}=h,{bm:Y,m:oe,parent:de}=u,fe=Bt(h);if(wt(u,!1),Y&&dr(Y),!fe&&(q=W&&W.onVnodeBeforeMount)&&Be(q,de,h),wt(u,!0),K&&Q){const ve=()=>{u.subTree=fr(u),Q(K,u.subTree,u,E,null)};fe?h.type.__asyncLoader().then(()=>!u.isUnmounted&&ve()):ve()}else{const ve=u.subTree=fr(u);T(null,ve,v,k,u,E,A),h.el=ve.el}if(oe&&Oe(oe,E),!fe&&(q=W&&W.onVnodeMounted)){const ve=h;Oe(()=>Be(q,de,ve),E)}(h.shapeFlag&256||de&&Bt(de.vnode)&&de.vnode.shapeFlag&256)&&u.a&&Oe(u.a,E),u.isMounted=!0,h=v=k=null}},I=u.effect=new Qr(P,()=>ao(S),u.scope),S=u.update=()=>I.run();S.id=u.uid,wt(u,!0),S()},te=(u,h,v)=>{h.component=u;const k=u.vnode.props;u.vnode=h,u.next=null,Xl(u,h.props,k,v),nc(u,h.children,v),Wt(),Xn(void 0,u.update),Jt()},ye=(u,h,v,k,E,A,H,P,I=!1)=>{const S=u&&u.children,q=u?u.shapeFlag:0,K=h.children,{patchFlag:W,shapeFlag:Y}=h;if(W>0){if(W&128){Ie(S,K,v,k,E,A,H,P,I);return}else if(W&256){Te(S,K,v,k,E,A,H,P,I);return}}Y&8?(q&16&&R(S,E,A),K!==S&&d(v,K)):q&16?Y&16?Ie(S,K,v,k,E,A,H,P,I):R(S,E,A,!0):(q&8&&d(v,""),Y&16&&J(K,v,k,E,A,H,P,I))},Te=(u,h,v,k,E,A,H,P,I)=>{u=u||Dt,h=h||Dt;const S=u.length,q=h.length,K=Math.min(S,q);let W;for(W=0;Wq?R(u,E,A,!0,!1,K):J(h,v,k,E,A,H,P,I,K)},Ie=(u,h,v,k,E,A,H,P,I)=>{let S=0;const q=h.length;let K=u.length-1,W=q-1;for(;S<=K&&S<=W;){const Y=u[S],oe=h[S]=I?dt(h[S]):Ve(h[S]);if(Ct(Y,oe))T(Y,oe,v,null,E,A,H,P,I);else break;S++}for(;S<=K&&S<=W;){const Y=u[K],oe=h[W]=I?dt(h[W]):Ve(h[W]);if(Ct(Y,oe))T(Y,oe,v,null,E,A,H,P,I);else break;K--,W--}if(S>K){if(S<=W){const Y=W+1,oe=YW)for(;S<=K;)Le(u[S],E,A,!0),S++;else{const Y=S,oe=S,de=new Map;for(S=oe;S<=W;S++){const ze=h[S]=I?dt(h[S]):Ve(h[S]);ze.key!=null&&de.set(ze.key,S)}let fe,ve=0;const Ke=W-oe+1;let It=!1,wo=0;const Zt=new Array(Ke);for(S=0;S=Ke){Le(ze,E,A,!0);continue}let Ge;if(ze.key!=null)Ge=de.get(ze.key);else for(fe=oe;fe<=W;fe++)if(Zt[fe-oe]===0&&Ct(ze,h[fe])){Ge=fe;break}Ge===void 0?Le(ze,E,A,!0):(Zt[Ge-oe]=S+1,Ge>=wo?wo=Ge:It=!0,T(ze,h[Ge],v,null,E,A,H,P,I),ve++)}const yo=It?lc(Zt):Dt;for(fe=yo.length-1,S=Ke-1;S>=0;S--){const ze=oe+S,Ge=h[ze],xo=ze+1{const{el:A,type:H,transition:P,children:I,shapeFlag:S}=u;if(S&6){$e(u.component.subTree,h,v,k);return}if(S&128){u.suspense.move(h,v,k);return}if(S&64){H.move(u,h,v,ce);return}if(H===Re){r(A,h,v);for(let K=0;KP.enter(A),E);else{const{leave:K,delayLeave:W,afterLeave:Y}=P,oe=()=>r(A,h,v),de=()=>{K(A,()=>{oe(),Y&&Y()})};W?W(A,oe,de):de()}else r(A,h,v)},Le=(u,h,v,k=!1,E=!1)=>{const{type:A,props:H,ref:P,children:I,dynamicChildren:S,shapeFlag:q,patchFlag:K,dirs:W}=u;if(P!=null&&Un(P,null,v,u,!0),q&256){h.ctx.deactivate(u);return}const Y=q&1&&W,oe=!Bt(u);let de;if(oe&&(de=H&&H.onVnodeBeforeUnmount)&&Be(de,h,u),q&6)B(u.component,v,k);else{if(q&128){u.suspense.unmount(v,k);return}Y&&Ye(u,null,h,"beforeUnmount"),q&64?u.type.remove(u,h,v,E,ce,k):S&&(A!==Re||K>0&&K&64)?R(S,h,v,!1,!0):(A===Re&&K&384||!E&&q&16)&&R(I,h,v),k&&Qt(u)}(oe&&(de=H&&H.onVnodeUnmounted)||Y)&&Oe(()=>{de&&Be(de,h,u),Y&&Ye(u,null,h,"unmounted")},v)},Qt=u=>{const{type:h,el:v,anchor:k,transition:E}=u;if(h===Re){_(v,k);return}if(h===cn){j(u);return}const A=()=>{o(v),E&&!E.persisted&&E.afterLeave&&E.afterLeave()};if(u.shapeFlag&1&&E&&!E.persisted){const{leave:H,delayLeave:P}=E,I=()=>H(v,A);P?P(u.el,A,I):I()}else A()},_=(u,h)=>{let v;for(;u!==h;)v=f(u),o(u),u=v;o(h)},B=(u,h,v)=>{const{bum:k,scope:E,update:A,subTree:H,um:P}=u;k&&dr(k),E.stop(),A&&(A.active=!1,Le(H,u,h,v)),P&&Oe(P,h),Oe(()=>{u.isUnmounted=!0},h),h&&h.pendingBranch&&!h.isUnmounted&&u.asyncDep&&!u.asyncResolved&&u.suspenseId===h.pendingId&&(h.deps--,h.deps===0&&h.resolve())},R=(u,h,v,k=!1,E=!1,A=0)=>{for(let H=A;Hu.shapeFlag&6?U(u.component.subTree):u.shapeFlag&128?u.suspense.next():f(u.anchor||u.el),le=(u,h,v)=>{u==null?h._vnode&&Le(h._vnode,null,null,!0):T(h._vnode||null,u,h,null,null,null,v),Dn(),h._vnode=u},ce={p:T,um:Le,m:$e,r:Qt,mt:ne,mc:J,pc:ye,pbc:V,n:U,o:e};let ee,Q;return t&&([ee,Q]=t(ce)),{render:le,hydrate:ee,createApp:oc(le,ee)}}function wt({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function Sa(e,t,n=!1){const r=e.children,o=t.children;if(G(r)&&G(o))for(let i=0;i>1,e[n[s]]0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,a=n[i-1];i-- >0;)n[i]=a,a=t[a];return n}const cc=e=>e.__isTeleport,Re=Symbol(void 0),vn=Symbol(void 0),He=Symbol(void 0),cn=Symbol(void 0),un=[];let We=null;function rr(e=!1){un.push(We=e?null:[])}function uc(){un.pop(),We=un[un.length-1]||null}let bn=1;function jo(e){bn+=e}function Ta(e){return e.dynamicChildren=bn>0?We||Dt:null,uc(),bn>0&&We&&We.push(e),e}function Aa(e,t,n,r,o,i){return Ta(Oa(e,t,n,r,o,i,!0))}function Pa(e,t,n,r,o){return Ta(be(e,t,n,r,o,!0))}function Kn(e){return e?e.__v_isVNode===!0:!1}function Ct(e,t){return e.type===t.type&&e.key===t.key}const or="__vInternal",La=({key:e})=>e!=null?e:null,Mn=({ref:e,ref_key:t,ref_for:n})=>e!=null?ge(e)||ke(e)||X(e)?{i:Se,r:e,k:t,f:!!n}:e:null;function Oa(e,t=null,n=null,r=0,o=null,i=e===Re?0:1,a=!1,s=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&La(t),ref:t&&Mn(t),scopeId:aa,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null};return s?(uo(l,n),i&128&&e.normalize(l)):n&&(l.shapeFlag|=ge(n)?8:16),bn>0&&!a&&We&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&We.push(l),l}const be=dc;function dc(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===Kl)&&(e=He),Kn(e)){const s=vt(e,t,!0);return n&&uo(s,n),bn>0&&!i&&We&&(s.shapeFlag&6?We[We.indexOf(e)]=s:We.push(s)),s.patchFlag|=-2,s}if(_c(e)&&(e=e.__vccOpts),t){t=fc(t);let{class:s,style:l}=t;s&&!ge(s)&&(t.class=yn(s)),xe(l)&&(Ji(l)&&!G(l)&&(l=Ce({},l)),t.style=Jn(l))}const a=ge(e)?1:Ll(e)?128:cc(e)?64:xe(e)?4:X(e)?2:0;return Oa(e,t,n,r,o,a,i,!0)}function fc(e){return e?Ji(e)||or in e?Ce({},e):e:null}function vt(e,t,n=!1){const{props:r,ref:o,patchFlag:i,children:a}=e,s=t?hc(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:s,key:s&&La(s),ref:t&&t.ref?n&&o?G(o)?o.concat(Mn(t)):[o,Mn(t)]:Mn(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Re?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&vt(e.ssContent),ssFallback:e.ssFallback&&vt(e.ssFallback),el:e.el,anchor:e.anchor}}function co(e=" ",t=0){return be(vn,null,e,t)}function hh(e,t){const n=be(cn,null,e);return n.staticCount=t,n}function ph(e="",t=!1){return t?(rr(),Pa(He,null,e)):be(He,null,e)}function Ve(e){return e==null||typeof e=="boolean"?be(He):G(e)?be(Re,null,e.slice()):typeof e=="object"?dt(e):be(vn,null,String(e))}function dt(e){return e.el===null||e.memo?e:vt(e)}function uo(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(G(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),uo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!(or in t)?t._ctx=Se:o===3&&Se&&(Se.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else X(t)?(t={default:t,_ctx:Se},n=32):(t=String(t),r&64?(n=16,t=[co(t)]):n=8);e.children=t,e.shapeFlag|=n}function hc(...e){const t={};for(let n=0;n_e||Se,Ut=e=>{_e=e,e.scope.on()},Ot=()=>{_e&&_e.scope.off(),_e=null};function Ia(e){return e.vnode.shapeFlag&4}let Kt=!1;function vc(e,t=!1){Kt=t;const{props:n,children:r}=e.vnode,o=Ia(e);Zl(e,n,o,t),tc(e,r);const i=o?bc(e,t):void 0;return Kt=!1,i}function bc(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Gi(new Proxy(e.ctx,ql));const{setup:r}=n;if(r){const o=e.setupContext=r.length>1?yc(e):null;Ut(e),Wt();const i=mt(r,e,0,[e.props,o]);if(Jt(),Ot(),zi(i)){if(i.then(Ot,Ot),t)return i.then(a=>{Bo(e,a,t)}).catch(a=>{_n(a,e,0)});e.asyncDep=i}else Bo(e,i,t)}else za(e,t)}function Bo(e,t,n){X(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:xe(t)&&(e.setupState=ea(t)),za(e,n)}let Uo;function za(e,t,n){const r=e.type;if(!e.render){if(!t&&Uo&&!r.render){const o=r.template;if(o){const{isCustomElement:i,compilerOptions:a}=e.appContext.config,{delimiters:s,compilerOptions:l}=r,c=Ce(Ce({isCustomElement:i,delimiters:s},a),l);r.render=Uo(o,c)}}e.render=r.render||Je}Ut(e),Wt(),Wl(e),Jt(),Ot()}function wc(e){return new Proxy(e.attrs,{get(t,n){return Fe(e,"get","$attrs"),t[n]}})}function yc(e){const t=r=>{e.exposed=r||{}};let n;return{get attrs(){return n||(n=wc(e))},slots:e.slots,emit:e.emit,expose:t}}function ir(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(ea(Gi(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in jn)return jn[n](e)}}))}function xc(e,t=!0){return X(e)?e.displayName||e.name:e.name||t&&e.__name}function _c(e){return X(e)&&"__vccOpts"in e}const me=(e,t)=>bl(e,t,Kt);function ae(e,t,n){const r=arguments.length;return r===2?xe(t)&&!G(t)?Kn(t)?be(e,null,[t]):be(e,t):be(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Kn(n)&&(n=[n]),be(e,t,n))}const Ec="3.2.37",kc="http://www.w3.org/2000/svg",St=typeof document!="undefined"?document:null,Ko=St&&St.createElement("template"),Cc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t?St.createElementNS(kc,e):St.createElement(e,n?{is:n}:void 0);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>St.createTextNode(e),createComment:e=>St.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>St.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode(e){const t=e.cloneNode(!0);return"_value"in e&&(t._value=e._value),t},insertStaticContent(e,t,n,r,o,i){const a=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{Ko.innerHTML=r?`${e}`:e;const s=Ko.content;if(r){const l=s.firstChild;for(;l.firstChild;)s.appendChild(l.firstChild);s.removeChild(l)}t.insertBefore(s,n)}return[a?a.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function Sc(e,t,n){const r=e._vtc;r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function Tc(e,t,n){const r=e.style,o=ge(n);if(n&&!o){for(const i in n)Fr(r,i,n[i]);if(t&&!ge(t))for(const i in t)n[i]==null&&Fr(r,i,"")}else{const i=r.display;o?t!==n&&(r.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(r.display=i)}}const Vo=/\s*!important$/;function Fr(e,t,n){if(G(n))n.forEach(r=>Fr(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Ac(e,t);Vo.test(n)?e.setProperty(Rt(r),n.replace(Vo,""),"important"):e[r]=n}}const qo=["Webkit","Moz","ms"],mr={};function Ac(e,t){const n=mr[t];if(n)return n;let r=Qe(t);if(r!=="filter"&&r in e)return mr[t]=r;r=Qn(r);for(let o=0;o{let e=Date.now,t=!1;if(typeof window!="undefined"){Date.now()>document.createEvent("Event").timeStamp&&(e=performance.now.bind(performance));const n=navigator.userAgent.match(/firefox\/(\d+)/i);t=!!(n&&Number(n[1])<=53)}return[e,t]})();let Dr=0;const Rc=Promise.resolve(),Ic=()=>{Dr=0},zc=()=>Dr||(Rc.then(Ic),Dr=Ma());function Mc(e,t,n,r){e.addEventListener(t,n,r)}function Nc(e,t,n,r){e.removeEventListener(t,n,r)}function Hc(e,t,n,r,o=null){const i=e._vei||(e._vei={}),a=i[t];if(r&&a)a.value=r;else{const[s,l]=Fc(t);if(r){const c=i[t]=Dc(r,o);Mc(e,s,c,l)}else a&&(Nc(e,s,a,l),i[t]=void 0)}}const Jo=/(?:Once|Passive|Capture)$/;function Fc(e){let t;if(Jo.test(e)){t={};let n;for(;n=e.match(Jo);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[Rt(e.slice(2)),t]}function Dc(e,t){const n=r=>{const o=r.timeStamp||Ma();(Oc||o>=n.attached-1)&&Ue($c(r,n.value),t,5,[r])};return n.value=e,n.attached=zc(),n}function $c(e,t){if(G(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const Go=/^on[a-z]/,jc=(e,t,n,r,o=!1,i,a,s,l)=>{t==="class"?Sc(e,r,o):t==="style"?Tc(e,n,r):xn(t)?qr(t)||Hc(e,t,n,r,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Bc(e,t,r,o))?Lc(e,t,r,i,a,s,l):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Pc(e,t,r,o))};function Bc(e,t,n,r){return r?!!(t==="innerHTML"||t==="textContent"||t in e&&Go.test(t)&&X(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||Go.test(t)&&ge(n)?!1:t in e}const st="transition",Xt="animation",fo=(e,{slots:t})=>ae(ua,Uc(e),t);fo.displayName="Transition";const Na={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};fo.props=Ce({},ua.props,Na);const yt=(e,t=[])=>{G(e)?e.forEach(n=>n(...t)):e&&e(...t)},Yo=e=>e?G(e)?e.some(t=>t.length>1):e.length>1:!1;function Uc(e){const t={};for(const x in e)x in Na||(t[x]=e[x]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:a=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:c=a,appearToClass:d=s,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:b=`${n}-leave-to`}=e,y=Kc(o),L=y&&y[0],T=y&&y[1],{onBeforeEnter:m,onEnter:w,onEnterCancelled:C,onLeave:M,onLeaveCancelled:j,onBeforeAppear:D=m,onAppear:z=w,onAppearCancelled:g=C}=t,J=(x,N,O)=>{xt(x,N?d:s),xt(x,N?c:a),O&&O()},$=(x,N)=>{x._isLeaving=!1,xt(x,p),xt(x,b),xt(x,f),N&&N()},V=x=>(N,O)=>{const ne=x?z:w,F=()=>J(N,x,O);yt(ne,[N,F]),Qo(()=>{xt(N,x?l:i),lt(N,x?d:s),Yo(ne)||Zo(N,r,L,F)})};return Ce(t,{onBeforeEnter(x){yt(m,[x]),lt(x,i),lt(x,a)},onBeforeAppear(x){yt(D,[x]),lt(x,l),lt(x,c)},onEnter:V(!1),onAppear:V(!0),onLeave(x,N){x._isLeaving=!0;const O=()=>$(x,N);lt(x,p),Wc(),lt(x,f),Qo(()=>{!x._isLeaving||(xt(x,p),lt(x,b),Yo(M)||Zo(x,r,T,O))}),yt(M,[x,O])},onEnterCancelled(x){J(x,!1),yt(C,[x])},onAppearCancelled(x){J(x,!0),yt(g,[x])},onLeaveCancelled(x){$(x),yt(j,[x])}})}function Kc(e){if(e==null)return null;if(xe(e))return[gr(e.enter),gr(e.leave)];{const t=gr(e);return[t,t]}}function gr(e){return Hi(e)}function lt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function xt(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function Qo(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Vc=0;function Zo(e,t,n,r){const o=e._endId=++Vc,i=()=>{o===e._endId&&r()};if(n)return setTimeout(i,n);const{type:a,timeout:s,propCount:l}=qc(e,t);if(!a)return r();const c=a+"end";let d=0;const p=()=>{e.removeEventListener(c,f),i()},f=b=>{b.target===e&&++d>=l&&p()};setTimeout(()=>{d(n[y]||"").split(", "),o=r(st+"Delay"),i=r(st+"Duration"),a=Xo(o,i),s=r(Xt+"Delay"),l=r(Xt+"Duration"),c=Xo(s,l);let d=null,p=0,f=0;t===st?a>0&&(d=st,p=a,f=i.length):t===Xt?c>0&&(d=Xt,p=c,f=l.length):(p=Math.max(a,c),d=p>0?a>c?st:Xt:null,f=d?d===st?i.length:l.length:0);const b=d===st&&/\b(transform|all)(,|$)/.test(n[st+"Property"]);return{type:d,timeout:p,propCount:f,hasTransform:b}}function Xo(e,t){for(;e.lengthei(n)+ei(e[r])))}function ei(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function Wc(){return document.body.offsetHeight}const Jc={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},mh=(e,t)=>n=>{if(!("key"in n))return;const r=Rt(n.key);if(t.some(o=>o===r||Jc[o]===r))return e(n)},gh={beforeMount(e,{value:t},{transition:n}){e._vod=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):en(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),en(e,!0),r.enter(e)):r.leave(e,()=>{en(e,!1)}):en(e,t))},beforeUnmount(e,{value:t}){en(e,t)}};function en(e,t){e.style.display=t?e._vod:"none"}const Gc=Ce({patchProp:jc},Cc);let vr,ti=!1;function Yc(){return vr=ti?vr:ac(Gc),ti=!0,vr}const Qc=(...e)=>{const t=Yc().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=Zc(r);if(o)return n(o,!0,o instanceof SVGElement)},t};function Zc(e){return ge(e)?document.querySelector(e):e}const Xc=JSON.parse('{"base":"/","lang":"en-US","title":"\u2728 Spellblog","description":"","head":[],"locales":{}}');var eu=([e,t,n])=>e==="meta"&&t.name?`${e}.${t.name}`:["title","base"].includes(e)?e:e==="template"&&t.id?`${e}.${t.id}`:JSON.stringify([e,t,n]),tu=e=>{const t=new Set,n=[];return e.forEach(r=>{const o=eu(r);t.has(o)||(t.add(o),n.push(r))}),n},nu=e=>/^(https?:)?\/\//.test(e),vh=e=>/^mailto:/.test(e),bh=e=>/^tel:/.test(e),Ha=e=>Object.prototype.toString.call(e)==="[object Object]",ru=e=>e.replace(/\/$/,""),ou=e=>e.replace(/^\//,""),Fa=(e,t)=>{const n=Object.keys(e).sort((r,o)=>{const i=o.split("/").length-r.split("/").length;return i!==0?i:o.length-r.length});for(const r of n)if(t.startsWith(r))return r;return"/"};const Da={"v-22a39d25":Pe(()=>ue(()=>import("./about.html.74c00bc7.js"),[])),"v-8daa1a0e":Pe(()=>ue(()=>import("./index.html.640e57a2.js"),[])),"v-abde92f0":Pe(()=>ue(()=>import("./tarot.html.7e588aa8.js"),[])),"v-724095ba":Pe(()=>ue(()=>import("./api-enchantment-with-javascript.html.eec3b62c.js"),[])),"v-5029e009":Pe(()=>ue(()=>import("./bash-scriptage.html.880d6510.js"),[])),"v-3ec37569":Pe(()=>ue(()=>import("./github-once-and-for-all.html.b135434f.js"),[])),"v-5f1b757b":Pe(()=>ue(()=>import("./intro-on-web-security-with-helmet-js.html.96b5daa1.js"),[])),"v-5f5834b4":Pe(()=>ue(()=>import("./javascript-references.html.a569c536.js"),[])),"v-6801703b":Pe(()=>ue(()=>import("./kali-metasploitable-virtualbox.html.663d8145.js"),[])),"v-04a11941":Pe(()=>ue(()=>import("./latex-pdf-press.html.551b5711.js"),[])),"v-09db1bdd":Pe(()=>ue(()=>import("./markdown-cheat-sheet.html.29b17839.js"),[])),"v-6decc2f5":Pe(()=>ue(()=>import("./terminal-commands.html.2349ded0.js"),[])),"v-3706649a":Pe(()=>ue(()=>import("./404.html.6ec09e14.js"),[]))},iu={404:Pe(()=>ue(()=>import("./404.e32eafdf.js"),[])),Layout:Pe(()=>ue(()=>import("./Layout.a2c43ac0.js"),[]))};var $a=we(_s),ja=to({key:"",path:"",title:"",lang:"",frontmatter:{},excerpt:"",headers:[]}),et=we(ja),kn=()=>et;cr.webpackHot&&(__VUE_HMR_RUNTIME__.updatePageData=e=>{$a.value[e.key]=()=>Promise.resolve(e),e.key===et.value.key&&(et.value=e)});var Ba=Symbol(""),au=()=>{const e=Ee(Ba);if(!e)throw new Error("usePageFrontmatter() is called without provider.");return e},Ua=Symbol(""),su=()=>{const e=Ee(Ua);if(!e)throw new Error("usePageHead() is called without provider.");return e},lu=Symbol(""),Ka=Symbol(""),cu=()=>{const e=Ee(Ka);if(!e)throw new Error("usePageLang() is called without provider.");return e},ho=Symbol(""),Va=()=>{const e=Ee(ho);if(!e)throw new Error("useRouteLocale() is called without provider.");return e},ht=we(Xc),uu=()=>ht;cr.webpackHot&&(__VUE_HMR_RUNTIME__.updateSiteData=e=>{ht.value=e});var qa=Symbol(""),wh=()=>{const e=Ee(qa);if(!e)throw new Error("useSiteLocaleData() is called without provider.");return e},du=Symbol(""),Et=Gt({resolvePageData:async e=>{const t=$a.value[e],n=await(t==null?void 0:t());return n!=null?n:ja},resolvePageFrontmatter:e=>e.frontmatter,resolvePageHead:(e,t,n)=>{const r=ge(t.description)?t.description:n.description,o=[...G(t.head)?t.head:[],...n.head,["title",{},e],["meta",{name:"description",content:r}]];return tu(o)},resolvePageHeadTitle:(e,t)=>`${e.title?`${e.title} | `:""}${t.title}`,resolvePageLang:e=>e.lang||"en",resolveRouteLocale:(e,t)=>Fa(e,t),resolveSiteLocaleData:(e,t)=>({...e,...e.locales[t]})}),fu=De({name:"ClientOnly",setup(e,t){const n=we(!1);return ot(()=>{n.value=!0}),()=>{var r,o;return n.value?(o=(r=t.slots).default)==null?void 0:o.call(r):null}}}),hu=De({name:"Content",props:{pageKey:{type:String,required:!1,default:""}},setup(e){const t=kn(),n=me(()=>Da[e.pageKey||t.value.key]);return()=>n.value?ae(n.value):ae("div","404 Not Found")}}),ni=De({name:"Vuepress",setup(){const e=kn(),t=me(()=>{let n;if(e.value.path){const r=e.value.frontmatter.layout;ge(r)?n=r:n="Layout"}else n="404";return iu[n]||Ul(n,!1)});return()=>ae(t.value)}}),pu=e=>nu(e)?e:`${uu().value.base}${ou(e)}`,bt=e=>e;function Wa(e,t,n){var r,o,i;t===void 0&&(t=50),n===void 0&&(n={});var a=(r=n.isImmediate)!=null&&r,s=(o=n.callback)!=null&&o,l=n.maxWait,c=Date.now(),d=[];function p(){if(l!==void 0){var b=Date.now()-c;if(b+t>=l)return l-b}return t}var f=function(){var b=[].slice.call(arguments),y=this;return new Promise(function(L,T){var m=a&&i===void 0;if(i!==void 0&&clearTimeout(i),i=setTimeout(function(){if(i=void 0,c=Date.now(),!a){var C=e.apply(y,b);s&&s(C),d.forEach(function(M){return(0,M.resolve)(C)}),d=[]}},p()),m){var w=e.apply(y,b);return s&&s(w),L(w)}d.push({resolve:L,reject:T})})};return f.cancel=function(b){i!==void 0&&clearTimeout(i),d.forEach(function(y){return(0,y.reject)(b)}),d=[]},f}/*! + * vue-router v4.0.16 + * (c) 2022 Eduardo San Martin Morote + * @license MIT + */const Ja=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",Yt=e=>Ja?Symbol(e):"_vr_"+e,mu=Yt("rvlm"),ri=Yt("rvd"),ar=Yt("r"),po=Yt("rl"),$r=Yt("rvl"),Ft=typeof window!="undefined";function gu(e){return e.__esModule||Ja&&e[Symbol.toStringTag]==="Module"}const he=Object.assign;function br(e,t){const n={};for(const r in t){const o=t[r];n[r]=Array.isArray(o)?o.map(e):e(o)}return n}const dn=()=>{},vu=/\/$/,bu=e=>e.replace(vu,"");function wr(e,t,n="/"){let r,o={},i="",a="";const s=t.indexOf("?"),l=t.indexOf("#",s>-1?s:0);return s>-1&&(r=t.slice(0,s),i=t.slice(s+1,l>-1?l:t.length),o=e(i)),l>-1&&(r=r||t.slice(0,l),a=t.slice(l,t.length)),r=_u(r!=null?r:t,n),{fullPath:r+(i&&"?")+i+a,path:r,query:o,hash:a}}function wu(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function oi(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function yu(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&Vt(t.matched[r],n.matched[o])&&Ga(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Vt(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ga(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!xu(e[n],t[n]))return!1;return!0}function xu(e,t){return Array.isArray(e)?ii(e,t):Array.isArray(t)?ii(t,e):e===t}function ii(e,t){return Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function _u(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o=n.length-1,i,a;for(i=0;i({left:window.pageXOffset,top:window.pageYOffset});function Tu(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=Su(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function ai(e,t){return(history.state?history.state.position-t:-1)+e}const jr=new Map;function Au(e,t){jr.set(e,t)}function Pu(e){const t=jr.get(e);return jr.delete(e),t}let Lu=()=>location.protocol+"//"+location.host;function Ya(e,t){const{pathname:n,search:r,hash:o}=t,i=e.indexOf("#");if(i>-1){let s=o.includes(e.slice(i))?e.slice(i).length:1,l=o.slice(s);return l[0]!=="/"&&(l="/"+l),oi(l,"")}return oi(n,e)+r+o}function Ou(e,t,n,r){let o=[],i=[],a=null;const s=({state:f})=>{const b=Ya(e,location),y=n.value,L=t.value;let T=0;if(f){if(n.value=b,t.value=f,a&&a===y){a=null;return}T=L?f.position-L.position:0}else r(b);o.forEach(m=>{m(n.value,y,{delta:T,type:wn.pop,direction:T?T>0?fn.forward:fn.back:fn.unknown})})};function l(){a=n.value}function c(f){o.push(f);const b=()=>{const y=o.indexOf(f);y>-1&&o.splice(y,1)};return i.push(b),b}function d(){const{history:f}=window;!f.state||f.replaceState(he({},f.state,{scroll:sr()}),"")}function p(){for(const f of i)f();i=[],window.removeEventListener("popstate",s),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",s),window.addEventListener("beforeunload",d),{pauseListeners:l,listen:c,destroy:p}}function si(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?sr():null}}function Ru(e){const{history:t,location:n}=window,r={value:Ya(e,n)},o={value:t.state};o.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(l,c,d){const p=e.indexOf("#"),f=p>-1?(n.host&&document.querySelector("base")?e:e.slice(p))+l:Lu()+e+l;try{t[d?"replaceState":"pushState"](c,"",f),o.value=c}catch(b){console.error(b),n[d?"replace":"assign"](f)}}function a(l,c){const d=he({},t.state,si(o.value.back,l,o.value.forward,!0),c,{position:o.value.position});i(l,d,!0),r.value=l}function s(l,c){const d=he({},o.value,t.state,{forward:l,scroll:sr()});i(d.current,d,!0);const p=he({},si(r.value,l,null),{position:d.position+1},c);i(l,p,!1),r.value=l}return{location:r,state:o,push:s,replace:a}}function Iu(e){e=Eu(e);const t=Ru(e),n=Ou(e,t.state,t.location,t.replace);function r(i,a=!0){a||n.pauseListeners(),history.go(i)}const o=he({location:"",base:e,go:r,createHref:Cu.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function zu(e){return typeof e=="string"||e&&typeof e=="object"}function Qa(e){return typeof e=="string"||typeof e=="symbol"}const Ze={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Za=Yt("nf");var li;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(li||(li={}));function qt(e,t){return he(new Error,{type:e,[Za]:!0},t)}function ct(e,t){return e instanceof Error&&Za in e&&(t==null||!!(e.type&t))}const ci="[^/]+?",Mu={sensitive:!1,strict:!1,start:!0,end:!0},Nu=/[.+*?^${}()[\]/\\]/g;function Hu(e,t){const n=he({},Mu,t),r=[];let o=n.start?"^":"";const i=[];for(const c of e){const d=c.length?[]:[90];n.strict&&!c.length&&(o+="/");for(let p=0;p1&&(d.endsWith("/")?d=d.slice(0,-1):p=!0);else throw new Error(`Missing required param "${y}"`);d+=w}}return d}return{re:a,score:r,keys:i,parse:s,stringify:l}}function Fu(e,t){let n=0;for(;nt.length?t.length===1&&t[0]===40+40?1:-1:0}function Du(e,t){let n=0;const r=e.score,o=t.score;for(;n0&&t[t.length-1]<0}const $u={type:0,value:""},ju=/[a-zA-Z0-9_]/;function Bu(e){if(!e)return[[]];if(e==="/")return[[$u]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${c}": ${b}`)}let n=0,r=n;const o=[];let i;function a(){i&&o.push(i),i=[]}let s=0,l,c="",d="";function p(){!c||(n===0?i.push({type:0,value:c}):n===1||n===2||n===3?(i.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:c,regexp:d,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),c="")}function f(){c+=l}for(;s{a(w)}:dn}function a(d){if(Qa(d)){const p=r.get(d);p&&(r.delete(d),n.splice(n.indexOf(p),1),p.children.forEach(a),p.alias.forEach(a))}else{const p=n.indexOf(d);p>-1&&(n.splice(p,1),d.record.name&&r.delete(d.record.name),d.children.forEach(a),d.alias.forEach(a))}}function s(){return n}function l(d){let p=0;for(;p=0&&(d.record.path!==n[p].record.path||!Xa(d,n[p]));)p++;n.splice(p,0,d),d.record.name&&!di(d)&&r.set(d.record.name,d)}function c(d,p){let f,b={},y,L;if("name"in d&&d.name){if(f=r.get(d.name),!f)throw qt(1,{location:d});L=f.record.name,b=he(Vu(p.params,f.keys.filter(w=>!w.optional).map(w=>w.name)),d.params),y=f.stringify(b)}else if("path"in d)y=d.path,f=n.find(w=>w.re.test(y)),f&&(b=f.parse(y),L=f.record.name);else{if(f=p.name?r.get(p.name):n.find(w=>w.re.test(p.path)),!f)throw qt(1,{location:d,currentLocation:p});L=f.record.name,b=he({},p.params,d.params),y=f.stringify(b)}const T=[];let m=f;for(;m;)T.unshift(m.record),m=m.parent;return{name:L,path:y,params:b,matched:T,meta:Ju(T)}}return e.forEach(d=>i(d)),{addRoute:i,resolve:c,removeRoute:a,getRoutes:s,getRecordMatcher:o}}function Vu(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function qu(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:Wu(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||{}:{default:e.component}}}function Wu(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="boolean"?n:n[r];return t}function di(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ju(e){return e.reduce((t,n)=>he(t,n.meta),{})}function fi(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function Xa(e,t){return t.children.some(n=>n===e||Xa(e,n))}const es=/#/g,Gu=/&/g,Yu=/\//g,Qu=/=/g,Zu=/\?/g,ts=/\+/g,Xu=/%5B/g,ed=/%5D/g,ns=/%5E/g,td=/%60/g,rs=/%7B/g,nd=/%7C/g,os=/%7D/g,rd=/%20/g;function mo(e){return encodeURI(""+e).replace(nd,"|").replace(Xu,"[").replace(ed,"]")}function od(e){return mo(e).replace(rs,"{").replace(os,"}").replace(ns,"^")}function Br(e){return mo(e).replace(ts,"%2B").replace(rd,"+").replace(es,"%23").replace(Gu,"%26").replace(td,"`").replace(rs,"{").replace(os,"}").replace(ns,"^")}function id(e){return Br(e).replace(Qu,"%3D")}function ad(e){return mo(e).replace(es,"%23").replace(Zu,"%3F")}function sd(e){return e==null?"":ad(e).replace(Yu,"%2F")}function Vn(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function ld(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;oi&&Br(i)):[r&&Br(r)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function cd(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Array.isArray(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}function tn(){let e=[];function t(r){return e.push(r),()=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function ft(e,t,n,r,o){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((a,s)=>{const l=p=>{p===!1?s(qt(4,{from:n,to:t})):p instanceof Error?s(p):zu(p)?s(qt(2,{from:t,to:p})):(i&&r.enterCallbacks[o]===i&&typeof p=="function"&&i.push(p),a())},c=e.call(r&&r.instances[o],t,n,l);let d=Promise.resolve(c);e.length<3&&(d=d.then(l)),d.catch(p=>s(p))})}function yr(e,t,n,r){const o=[];for(const i of e)for(const a in i.components){let s=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(ud(s)){const c=(s.__vccOpts||s)[t];c&&o.push(ft(c,n,r,i,a))}else{let l=s();o.push(()=>l.then(c=>{if(!c)return Promise.reject(new Error(`Couldn't resolve component "${a}" at "${i.path}"`));const d=gu(c)?c.default:c;i.components[a]=d;const f=(d.__vccOpts||d)[t];return f&&ft(f,n,r,i,a)()}))}}return o}function ud(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function pi(e){const t=Ee(ar),n=Ee(po),r=me(()=>t.resolve(Pt(e.to))),o=me(()=>{const{matched:l}=r.value,{length:c}=l,d=l[c-1],p=n.matched;if(!d||!p.length)return-1;const f=p.findIndex(Vt.bind(null,d));if(f>-1)return f;const b=mi(l[c-2]);return c>1&&mi(d)===b&&p[p.length-1].path!==b?p.findIndex(Vt.bind(null,l[c-2])):f}),i=me(()=>o.value>-1&&pd(n.params,r.value.params)),a=me(()=>o.value>-1&&o.value===n.matched.length-1&&Ga(n.params,r.value.params));function s(l={}){return hd(l)?t[Pt(e.replace)?"replace":"push"](Pt(e.to)).catch(dn):Promise.resolve()}return{route:r,href:me(()=>r.value.href),isActive:i,isExactActive:a,navigate:s}}const dd=De({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:pi,setup(e,{slots:t}){const n=Gt(pi(e)),{options:r}=Ee(ar),o=me(()=>({[gi(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[gi(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:ae("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},i)}}}),fd=dd;function hd(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function pd(e,t){for(const n in t){const r=t[n],o=e[n];if(typeof r=="string"){if(r!==o)return!1}else if(!Array.isArray(o)||o.length!==r.length||r.some((i,a)=>i!==o[a]))return!1}return!0}function mi(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const gi=(e,t,n)=>e!=null?e:t!=null?t:n,md=De({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Ee($r),o=me(()=>e.route||r.value),i=Ee(ri,0),a=me(()=>o.value.matched[i]);Lt(ri,i+1),Lt(mu,a),Lt($r,o);const s=we();return tt(()=>[s.value,a.value,e.name],([l,c,d],[p,f,b])=>{c&&(c.instances[d]=l,f&&f!==c&&l&&l===p&&(c.leaveGuards.size||(c.leaveGuards=f.leaveGuards),c.updateGuards.size||(c.updateGuards=f.updateGuards))),l&&c&&(!f||!Vt(c,f)||!p)&&(c.enterCallbacks[d]||[]).forEach(y=>y(l))},{flush:"post"}),()=>{const l=o.value,c=a.value,d=c&&c.components[e.name],p=e.name;if(!d)return vi(n.default,{Component:d,route:l});const f=c.props[e.name],b=f?f===!0?l.params:typeof f=="function"?f(l):f:null,L=ae(d,he({},b,t,{onVnodeUnmounted:T=>{T.component.isUnmounted&&(c.instances[p]=null)},ref:s}));return vi(n.default,{Component:L,route:l})||L}}});function vi(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const is=md;function gd(e){const t=Ku(e.routes,e),n=e.parseQuery||ld,r=e.stringifyQuery||hi,o=e.history,i=tn(),a=tn(),s=tn(),l=Zi(Ze);let c=Ze;Ft&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=br.bind(null,_=>""+_),p=br.bind(null,sd),f=br.bind(null,Vn);function b(_,B){let R,U;return Qa(_)?(R=t.getRecordMatcher(_),U=B):U=_,t.addRoute(U,R)}function y(_){const B=t.getRecordMatcher(_);B&&t.removeRoute(B)}function L(){return t.getRoutes().map(_=>_.record)}function T(_){return!!t.getRecordMatcher(_)}function m(_,B){if(B=he({},B||l.value),typeof _=="string"){const Q=wr(n,_,B.path),u=t.resolve({path:Q.path},B),h=o.createHref(Q.fullPath);return he(Q,u,{params:f(u.params),hash:Vn(Q.hash),redirectedFrom:void 0,href:h})}let R;if("path"in _)R=he({},_,{path:wr(n,_.path,B.path).path});else{const Q=he({},_.params);for(const u in Q)Q[u]==null&&delete Q[u];R=he({},_,{params:p(_.params)}),B.params=p(B.params)}const U=t.resolve(R,B),le=_.hash||"";U.params=d(f(U.params));const ce=wu(r,he({},_,{hash:od(le),path:U.path})),ee=o.createHref(ce);return he({fullPath:ce,hash:le,query:r===hi?cd(_.query):_.query||{}},U,{redirectedFrom:void 0,href:ee})}function w(_){return typeof _=="string"?wr(n,_,l.value.path):he({},_)}function C(_,B){if(c!==_)return qt(8,{from:B,to:_})}function M(_){return z(_)}function j(_){return M(he(w(_),{replace:!0}))}function D(_){const B=_.matched[_.matched.length-1];if(B&&B.redirect){const{redirect:R}=B;let U=typeof R=="function"?R(_):R;return typeof U=="string"&&(U=U.includes("?")||U.includes("#")?U=w(U):{path:U},U.params={}),he({query:_.query,hash:_.hash,params:_.params},U)}}function z(_,B){const R=c=m(_),U=l.value,le=_.state,ce=_.force,ee=_.replace===!0,Q=D(R);if(Q)return z(he(w(Q),{state:le,force:ce,replace:ee}),B||R);const u=R;u.redirectedFrom=B;let h;return!ce&&yu(r,U,R)&&(h=qt(16,{to:u,from:U}),Te(U,U,!0,!1)),(h?Promise.resolve(h):J(u,U)).catch(v=>ct(v)?ct(v,2)?v:ye(v):Z(v,u,U)).then(v=>{if(v){if(ct(v,2))return z(he(w(v.to),{state:le,force:ce,replace:ee}),B||u)}else v=V(u,U,!0,ee,le);return $(u,U,v),v})}function g(_,B){const R=C(_,B);return R?Promise.reject(R):Promise.resolve()}function J(_,B){let R;const[U,le,ce]=vd(_,B);R=yr(U.reverse(),"beforeRouteLeave",_,B);for(const Q of U)Q.leaveGuards.forEach(u=>{R.push(ft(u,_,B))});const ee=g.bind(null,_,B);return R.push(ee),zt(R).then(()=>{R=[];for(const Q of i.list())R.push(ft(Q,_,B));return R.push(ee),zt(R)}).then(()=>{R=yr(le,"beforeRouteUpdate",_,B);for(const Q of le)Q.updateGuards.forEach(u=>{R.push(ft(u,_,B))});return R.push(ee),zt(R)}).then(()=>{R=[];for(const Q of _.matched)if(Q.beforeEnter&&!B.matched.includes(Q))if(Array.isArray(Q.beforeEnter))for(const u of Q.beforeEnter)R.push(ft(u,_,B));else R.push(ft(Q.beforeEnter,_,B));return R.push(ee),zt(R)}).then(()=>(_.matched.forEach(Q=>Q.enterCallbacks={}),R=yr(ce,"beforeRouteEnter",_,B),R.push(ee),zt(R))).then(()=>{R=[];for(const Q of a.list())R.push(ft(Q,_,B));return R.push(ee),zt(R)}).catch(Q=>ct(Q,8)?Q:Promise.reject(Q))}function $(_,B,R){for(const U of s.list())U(_,B,R)}function V(_,B,R,U,le){const ce=C(_,B);if(ce)return ce;const ee=B===Ze,Q=Ft?history.state:{};R&&(U||ee?o.replace(_.fullPath,he({scroll:ee&&Q&&Q.scroll},le)):o.push(_.fullPath,le)),l.value=_,Te(_,B,R,ee),ye()}let x;function N(){x||(x=o.listen((_,B,R)=>{const U=m(_),le=D(U);if(le){z(he(le,{replace:!0}),U).catch(dn);return}c=U;const ce=l.value;Ft&&Au(ai(ce.fullPath,R.delta),sr()),J(U,ce).catch(ee=>ct(ee,12)?ee:ct(ee,2)?(z(ee.to,U).then(Q=>{ct(Q,20)&&!R.delta&&R.type===wn.pop&&o.go(-1,!1)}).catch(dn),Promise.reject()):(R.delta&&o.go(-R.delta,!1),Z(ee,U,ce))).then(ee=>{ee=ee||V(U,ce,!1),ee&&(R.delta?o.go(-R.delta,!1):R.type===wn.pop&&ct(ee,20)&&o.go(-1,!1)),$(U,ce,ee)}).catch(dn)}))}let O=tn(),ne=tn(),F;function Z(_,B,R){ye(_);const U=ne.list();return U.length?U.forEach(le=>le(_,B,R)):console.error(_),Promise.reject(_)}function te(){return F&&l.value!==Ze?Promise.resolve():new Promise((_,B)=>{O.add([_,B])})}function ye(_){return F||(F=!_,N(),O.list().forEach(([B,R])=>_?R(_):B()),O.reset()),_}function Te(_,B,R,U){const{scrollBehavior:le}=e;if(!Ft||!le)return Promise.resolve();const ce=!R&&Pu(ai(_.fullPath,0))||(U||!R)&&history.state&&history.state.scroll||null;return io().then(()=>le(_,B,ce)).then(ee=>ee&&Tu(ee)).catch(ee=>Z(ee,_,B))}const Ie=_=>o.go(_);let $e;const Le=new Set;return{currentRoute:l,addRoute:b,removeRoute:y,hasRoute:T,getRoutes:L,resolve:m,options:e,push:M,replace:j,go:Ie,back:()=>Ie(-1),forward:()=>Ie(1),beforeEach:i.add,beforeResolve:a.add,afterEach:s.add,onError:ne.add,isReady:te,install(_){const B=this;_.component("RouterLink",fd),_.component("RouterView",is),_.config.globalProperties.$router=B,Object.defineProperty(_.config.globalProperties,"$route",{enumerable:!0,get:()=>Pt(l)}),Ft&&!$e&&l.value===Ze&&($e=!0,M(o.location).catch(le=>{}));const R={};for(const le in Ze)R[le]=me(()=>l.value[le]);_.provide(ar,B),_.provide(po,Gt(R)),_.provide($r,l);const U=_.unmount;Le.add(_),_.unmount=function(){Le.delete(_),Le.size<1&&(c=Ze,x&&x(),x=null,l.value=Ze,$e=!1,F=!1),U()}}}}function zt(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function vd(e,t){const n=[],r=[],o=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;aVt(c,s))?r.push(s):n.push(s));const l=e.matched[a];l&&(t.matched.find(c=>Vt(c,l))||o.push(l))}return[n,r,o]}function lr(){return Ee(ar)}function go(){return Ee(po)}const bd=({headerLinkSelector:e,headerAnchorSelector:t,delay:n,offset:r=5})=>{const o=lr(),i=kn(),s=Wa(()=>{var T,m,w,C;const l=Math.max(window.scrollY,document.documentElement.scrollTop,document.body.scrollTop);if(Math.abs(l-0)b.some(j=>j.hash===M.hash));for(let M=0;M=((m=(T=j.parentElement)==null?void 0:T.offsetTop)!=null?m:0)-r,g=!D||l<((C=(w=D.parentElement)==null?void 0:w.offsetTop)!=null?C:0)-r;if(!(z&&g))continue;const $=decodeURIComponent(o.currentRoute.value.hash),V=decodeURIComponent(j.hash);if($===V)return;if(f){for(let x=M+1;x{s(),window.addEventListener("scroll",s)}),nr(()=>{window.removeEventListener("scroll",s)}),tt(()=>i.value.path,s)},bi=async(e,...t)=>{const{scrollBehavior:n}=e.options;e.options.scrollBehavior=void 0,await e.replace(...t).finally(()=>e.options.scrollBehavior=n)},wd="a.sidebar-item",yd=".header-anchor",xd=300,_d=5;var Ed=bt({setup(){bd({headerLinkSelector:wd,headerAnchorSelector:yd,delay:xd,offset:_d})}});const wi=()=>window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,kd=()=>window.scrollTo({top:0,behavior:"smooth"});const Cd=De({name:"BackToTop",setup(){const e=we(0),t=me(()=>e.value>300),n=Wa(()=>{e.value=wi()},100);ot(()=>{e.value=wi(),window.addEventListener("scroll",()=>n())});const r=ae("div",{class:"back-to-top",onClick:kd});return()=>ae(fo,{name:"back-to-top"},()=>t.value?r:null)}});var Sd=bt({rootComponents:[Cd]});const Td=ae("svg",{class:"external-link-icon",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"},[ae("path",{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}),ae("polygon",{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"})]),Ad=De({name:"ExternalLinkIcon",props:{locales:{type:Object,required:!1,default:()=>({})}},setup(e){const t=Va(),n=me(()=>{var r;return(r=e.locales[t.value])!=null?r:{openInNewWindow:"open in new window"}});return()=>ae("span",[Td,ae("span",{class:"external-link-icon-sr-only"},n.value.openInNewWindow)])}}),Pd={"/":{openInNewWindow:"open in new window"}};var Ld=bt({enhance({app:e}){e.component("ExternalLinkIcon",ae(Ad,{locales:Pd}))}});/*! medium-zoom 1.0.6 | MIT License | https://github.com/francoischalifour/medium-zoom */var kt=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},r=window.Promise||function(x){function N(){}x(N,N)},o=function(x){var N=x.target;if(N===J){y();return}C.indexOf(N)!==-1&&L({target:N})},i=function(){if(!(j||!g.original)){var x=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(D-x)>z.scrollOffset&&setTimeout(y,150)}},a=function(x){var N=x.key||x.keyCode;(N==="Escape"||N==="Esc"||N===27)&&y()},s=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=x;if(x.background&&(J.style.background=x.background),x.container&&x.container instanceof Object&&(N.container=kt({},z.container,x.container)),x.template){var O=Nn(x.template)?x.template:document.querySelector(x.template);N.template=O}return z=kt({},z,N),C.forEach(function(ne){ne.dispatchEvent(Mt("medium-zoom:update",{detail:{zoom:$}}))}),$},l=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e(kt({},z,x))},c=function(){for(var x=arguments.length,N=Array(x),O=0;O0?N.reduce(function(F,Z){return[].concat(F,xi(Z))},[]):C;return ne.forEach(function(F){F.classList.remove("medium-zoom-image"),F.dispatchEvent(Mt("medium-zoom:detach",{detail:{zoom:$}}))}),C=C.filter(function(F){return ne.indexOf(F)===-1}),$},p=function(x,N){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return C.forEach(function(ne){ne.addEventListener("medium-zoom:"+x,N,O)}),M.push({type:"medium-zoom:"+x,listener:N,options:O}),$},f=function(x,N){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return C.forEach(function(ne){ne.removeEventListener("medium-zoom:"+x,N,O)}),M=M.filter(function(ne){return!(ne.type==="medium-zoom:"+x&&ne.listener.toString()===N.toString())}),$},b=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=x.target,O=function(){var F={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},Z=void 0,te=void 0;if(z.container)if(z.container instanceof Object)F=kt({},F,z.container),Z=F.width-F.left-F.right-z.margin*2,te=F.height-F.top-F.bottom-z.margin*2;else{var ye=Nn(z.container)?z.container:document.querySelector(z.container),Te=ye.getBoundingClientRect(),Ie=Te.width,$e=Te.height,Le=Te.left,Qt=Te.top;F=kt({},F,{width:Ie,height:$e,left:Le,top:Qt})}Z=Z||F.width-z.margin*2,te=te||F.height-z.margin*2;var _=g.zoomedHd||g.original,B=yi(_)?Z:_.naturalWidth||Z,R=yi(_)?te:_.naturalHeight||te,U=_.getBoundingClientRect(),le=U.top,ce=U.left,ee=U.width,Q=U.height,u=Math.min(B,Z)/ee,h=Math.min(R,te)/Q,v=Math.min(u,h),k=(-ce+(Z-ee)/2+z.margin+F.left)/v,E=(-le+(te-Q)/2+z.margin+F.top)/v,A="scale("+v+") translate3d("+k+"px, "+E+"px, 0)";g.zoomed.style.transform=A,g.zoomedHd&&(g.zoomedHd.style.transform=A)};return new r(function(ne){if(N&&C.indexOf(N)===-1){ne($);return}var F=function Ie(){j=!1,g.zoomed.removeEventListener("transitionend",Ie),g.original.dispatchEvent(Mt("medium-zoom:opened",{detail:{zoom:$}})),ne($)};if(g.zoomed){ne($);return}if(N)g.original=N;else if(C.length>0){var Z=C;g.original=Z[0]}else{ne($);return}if(g.original.dispatchEvent(Mt("medium-zoom:open",{detail:{zoom:$}})),D=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,j=!0,g.zoomed=Id(g.original),document.body.appendChild(J),z.template){var te=Nn(z.template)?z.template:document.querySelector(z.template);g.template=document.createElement("div"),g.template.appendChild(te.content.cloneNode(!0)),document.body.appendChild(g.template)}if(document.body.appendChild(g.zoomed),window.requestAnimationFrame(function(){document.body.classList.add("medium-zoom--opened")}),g.original.classList.add("medium-zoom-image--hidden"),g.zoomed.classList.add("medium-zoom-image--opened"),g.zoomed.addEventListener("click",y),g.zoomed.addEventListener("transitionend",F),g.original.getAttribute("data-zoom-src")){g.zoomedHd=g.zoomed.cloneNode(),g.zoomedHd.removeAttribute("srcset"),g.zoomedHd.removeAttribute("sizes"),g.zoomedHd.src=g.zoomed.getAttribute("data-zoom-src"),g.zoomedHd.onerror=function(){clearInterval(ye),console.warn("Unable to reach the zoom image target "+g.zoomedHd.src),g.zoomedHd=null,O()};var ye=setInterval(function(){g.zoomedHd.complete&&(clearInterval(ye),g.zoomedHd.classList.add("medium-zoom-image--opened"),g.zoomedHd.addEventListener("click",y),document.body.appendChild(g.zoomedHd),O())},10)}else if(g.original.hasAttribute("srcset")){g.zoomedHd=g.zoomed.cloneNode(),g.zoomedHd.removeAttribute("sizes"),g.zoomedHd.removeAttribute("loading");var Te=g.zoomedHd.addEventListener("load",function(){g.zoomedHd.removeEventListener("load",Te),g.zoomedHd.classList.add("medium-zoom-image--opened"),g.zoomedHd.addEventListener("click",y),document.body.appendChild(g.zoomedHd),O()})}else O()})},y=function(){return new r(function(x){if(j||!g.original){x($);return}var N=function O(){g.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(g.zoomed),g.zoomedHd&&document.body.removeChild(g.zoomedHd),document.body.removeChild(J),g.zoomed.classList.remove("medium-zoom-image--opened"),g.template&&document.body.removeChild(g.template),j=!1,g.zoomed.removeEventListener("transitionend",O),g.original.dispatchEvent(Mt("medium-zoom:closed",{detail:{zoom:$}})),g.original=null,g.zoomed=null,g.zoomedHd=null,g.template=null,x($)};j=!0,document.body.classList.remove("medium-zoom--opened"),g.zoomed.style.transform="",g.zoomedHd&&(g.zoomedHd.style.transform=""),g.template&&(g.template.style.transition="opacity 150ms",g.template.style.opacity=0),g.original.dispatchEvent(Mt("medium-zoom:close",{detail:{zoom:$}})),g.zoomed.addEventListener("transitionend",N)})},L=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=x.target;return g.original?y():b({target:N})},T=function(){return z},m=function(){return C},w=function(){return g.original},C=[],M=[],j=!1,D=0,z=n,g={original:null,zoomed:null,zoomedHd:null,template:null};Object.prototype.toString.call(t)==="[object Object]"?z=t:(t||typeof t=="string")&&c(t),z=kt({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},z);var J=Rd(z.background);document.addEventListener("click",o),document.addEventListener("keyup",a),document.addEventListener("scroll",i),window.addEventListener("resize",y);var $={open:b,close:y,toggle:L,update:s,clone:l,attach:c,detach:d,on:p,off:f,getOptions:T,getImages:m,getZoomedImage:w};return $};function Md(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document=="undefined")){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var Nd=".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";Md(Nd);var Hd=zd;const Fd=Symbol("mediumZoom");const Dd=".theme-default-content > img, .theme-default-content :not(a) > img",$d={},jd=300;var Bd=bt({enhance({app:e,router:t}){const n=Hd($d);n.refresh=(r=Dd)=>{n.detach(),n.attach(r)},e.provide(Fd,n),t.afterEach(()=>{setTimeout(()=>n.refresh(),jd)})}});/** + * NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT + */const ie={settings:{minimum:.08,easing:"ease",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,barSelector:'[role="bar"]',parent:"body",template:'
'},status:null,set:e=>{const t=ie.isStarted();e=xr(e,ie.settings.minimum,1),ie.status=e===1?null:e;const n=ie.render(!t),r=n.querySelector(ie.settings.barSelector),o=ie.settings.speed,i=ie.settings.easing;return n.offsetWidth,Ud(a=>{zn(r,{transform:"translate3d("+_i(e)+"%,0,0)",transition:"all "+o+"ms "+i}),e===1?(zn(n,{transition:"none",opacity:"1"}),n.offsetWidth,setTimeout(function(){zn(n,{transition:"all "+o+"ms linear",opacity:"0"}),setTimeout(function(){ie.remove(),a()},o)},o)):setTimeout(()=>a(),o)}),ie},isStarted:()=>typeof ie.status=="number",start:()=>{ie.status||ie.set(0);const e=()=>{setTimeout(()=>{!ie.status||(ie.trickle(),e())},ie.settings.trickleSpeed)};return ie.settings.trickle&&e(),ie},done:e=>!e&&!ie.status?ie:ie.inc(.3+.5*Math.random()).set(1),inc:e=>{let t=ie.status;return t?(typeof e!="number"&&(e=(1-t)*xr(Math.random()*t,.1,.95)),t=xr(t+e,0,.994),ie.set(t)):ie.start()},trickle:()=>ie.inc(Math.random()*ie.settings.trickleRate),render:e=>{if(ie.isRendered())return document.getElementById("nprogress");Ei(document.documentElement,"nprogress-busy");const t=document.createElement("div");t.id="nprogress",t.innerHTML=ie.settings.template;const n=t.querySelector(ie.settings.barSelector),r=e?"-100":_i(ie.status||0),o=document.querySelector(ie.settings.parent);return zn(n,{transition:"all 0 linear",transform:"translate3d("+r+"%,0,0)"}),o!==document.body&&Ei(o,"nprogress-custom-parent"),o==null||o.appendChild(t),t},remove:()=>{ki(document.documentElement,"nprogress-busy"),ki(document.querySelector(ie.settings.parent),"nprogress-custom-parent");const e=document.getElementById("nprogress");e&&Kd(e)},isRendered:()=>!!document.getElementById("nprogress")},xr=(e,t,n)=>en?n:e,_i=e=>(-1+e)*100,Ud=function(){const e=[];function t(){const n=e.shift();n&&n(t)}return function(n){e.push(n),e.length===1&&t()}}(),zn=function(){const e=["Webkit","O","Moz","ms"],t={};function n(a){return a.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(s,l){return l.toUpperCase()})}function r(a){const s=document.body.style;if(a in s)return a;let l=e.length;const c=a.charAt(0).toUpperCase()+a.slice(1);let d;for(;l--;)if(d=e[l]+c,d in s)return d;return a}function o(a){return a=n(a),t[a]||(t[a]=r(a))}function i(a,s,l){s=o(s),a.style[s]=l}return function(a,s){for(const l in s){const c=s[l];c!==void 0&&Object.prototype.hasOwnProperty.call(s,l)&&i(a,l,c)}}}(),as=(e,t)=>(typeof e=="string"?e:vo(e)).indexOf(" "+t+" ")>=0,Ei=(e,t)=>{const n=vo(e),r=n+t;as(n,t)||(e.className=r.substring(1))},ki=(e,t)=>{const n=vo(e);if(!as(e,t))return;const r=n.replace(" "+t+" "," ");e.className=r.substring(1,r.length-1)},vo=e=>(" "+(e.className||"")+" ").replace(/\s+/gi," "),Kd=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)};const Vd=()=>{ot(()=>{const e=lr(),t=new Set;t.add(e.currentRoute.value.path),e.beforeEach(n=>{t.has(n.path)||ie.start()}),e.afterEach(n=>{t.add(n.path),ie.done()})})};var qd=bt({setup(){Vd()}});const Wd=JSON.parse(`{"colorModeSwitch":false,"colorMode":"dark","navbar":[{"text":"Spells","link":"/"},{"text":"Tarot","link":"/tarot.md"},{"text":"About","link":"/about.md"}],"locales":{"/":{"selectLanguageName":"English"}},"logo":null,"repo":null,"selectLanguageText":"Languages","selectLanguageAriaLabel":"Select language","sidebar":"auto","sidebarDepth":2,"editLink":true,"editLinkText":"Edit this page","lastUpdated":true,"lastUpdatedText":"Last Updated","contributors":true,"contributorsText":"Contributors","notFound":["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],"backToHome":"Take me home","openInNewWindow":"open in new window","toggleColorMode":"toggle color mode","toggleSidebar":"toggle sidebar"}`),ss=we(Wd),Jd=()=>ss;cr.webpackHot&&(__VUE_HMR_RUNTIME__.updateThemeData=e=>{ss.value=e});const ls=Symbol(""),Gd=()=>{const e=Ee(ls);if(!e)throw new Error("useThemeLocaleData() is called without provider.");return e},Yd=(e,t)=>{var n;return{...e,...(n=e.locales)==null?void 0:n[t]}};var Qd=bt({enhance({app:e}){const t=Jd(),n=e._context.provides[ho],r=me(()=>Yd(t.value,n.value));e.provide(ls,r),Object.defineProperties(e.config.globalProperties,{$theme:{get(){return t.value}},$themeLocale:{get(){return r.value}}})}}),cs=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n};const Zd=De({__name:"Badge",props:{type:{type:String,required:!1,default:"tip"},text:{type:String,required:!1,default:""},vertical:{type:String,required:!1,default:void 0}},setup(e){return(t,n)=>(rr(),Aa("span",{class:yn(["badge",e.type]),style:Jn({verticalAlign:e.vertical})},[ga(t.$slots,"default",{},()=>[co(As(e.text),1)])],6))}});var Xd=cs(Zd,[["__file","Badge.vue"]]);const ef=De({name:"CodeGroup",setup(e,{slots:t}){const n=we(-1),r=we([]),o=(s=n.value)=>{s{s>0?n.value=s-1:n.value=r.value.length-1,r.value[n.value].focus()},a=(s,l)=>{s.key===" "||s.key==="Enter"?(s.preventDefault(),n.value=l):s.key==="ArrowRight"?(s.preventDefault(),o(l)):s.key==="ArrowLeft"&&(s.preventDefault(),i(l))};return()=>{var l;const s=(((l=t.default)==null?void 0:l.call(t))||[]).filter(c=>c.type.name==="CodeGroupItem").map(c=>(c.props===null&&(c.props={}),c));return s.length===0?null:(n.value<0||n.value>s.length-1?(n.value=s.findIndex(c=>c.props.active===""||c.props.active===!0),n.value===-1&&(n.value=0)):s.forEach((c,d)=>{c.props.active=d===n.value}),ae("div",{class:"code-group"},[ae("div",{class:"code-group__nav"},ae("ul",{class:"code-group__ul"},s.map((c,d)=>{const p=d===n.value;return ae("li",{class:"code-group__li"},ae("button",{ref:f=>{f&&(r.value[d]=f)},class:{"code-group__nav-tab":!0,"code-group__nav-tab-active":p},ariaPressed:p,ariaExpanded:p,onClick:()=>n.value=d,onKeydown:f=>a(f,d)},c.props.title))}))),s]))}}}),tf=["aria-selected"],nf=De({name:"CodeGroupItem"}),rf=De({...nf,props:{title:{type:String,required:!0},active:{type:Boolean,required:!1,default:!1}},setup(e){return(t,n)=>(rr(),Aa("div",{class:yn(["code-group-item",{"code-group-item__active":e.active}]),"aria-selected":e.active},[ga(t.$slots,"default")],10,tf))}});var of=cs(rf,[["__file","CodeGroupItem.vue"]]);function us(e){return Fs()?(Ds(e),!0):!1}var Ci;const Cn=typeof window!="undefined",af=e=>typeof e=="string",_r=()=>{};Cn&&((Ci=window==null?void 0:window.navigator)==null?void 0:Ci.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function sf(e,t){function n(...r){e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})}return n}const ds=e=>e();function lf(e=ds){const t=we(!0);function n(){t.value=!1}function r(){t.value=!0}return{isActive:t,pause:n,resume:r,eventFilter:(...i)=>{t.value&&e(...i)}}}function cf(e,t=!0){Ra()?pa(e):t?e():io(e)}var Si=Object.getOwnPropertySymbols,uf=Object.prototype.hasOwnProperty,df=Object.prototype.propertyIsEnumerable,ff=(e,t)=>{var n={};for(var r in e)uf.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Si)for(var r of Si(e))t.indexOf(r)<0&&df.call(e,r)&&(n[r]=e[r]);return n};function hf(e,t,n={}){const r=n,{eventFilter:o=ds}=r,i=ff(r,["eventFilter"]);return tt(e,sf(o,t),i)}var pf=Object.defineProperty,mf=Object.defineProperties,gf=Object.getOwnPropertyDescriptors,qn=Object.getOwnPropertySymbols,fs=Object.prototype.hasOwnProperty,hs=Object.prototype.propertyIsEnumerable,Ti=(e,t,n)=>t in e?pf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vf=(e,t)=>{for(var n in t||(t={}))fs.call(t,n)&&Ti(e,n,t[n]);if(qn)for(var n of qn(t))hs.call(t,n)&&Ti(e,n,t[n]);return e},bf=(e,t)=>mf(e,gf(t)),wf=(e,t)=>{var n={};for(var r in e)fs.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qn)for(var r of qn(e))t.indexOf(r)<0&&hs.call(e,r)&&(n[r]=e[r]);return n};function yf(e,t,n={}){const r=n,{eventFilter:o}=r,i=wf(r,["eventFilter"]),{eventFilter:a,pause:s,resume:l,isActive:c}=lf(o);return{stop:hf(e,t,bf(vf({},i),{eventFilter:a})),pause:s,resume:l,isActive:c}}function xf(e){var t;const n=Pt(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Wn=Cn?window:void 0;Cn&&window.document;Cn&&window.navigator;Cn&&window.location;function _f(...e){let t,n,r,o;if(af(e[0])?([n,r,o]=e,t=Wn):[t,n,r,o]=e,!t)return _r;let i=_r;const a=tt(()=>xf(t),l=>{i(),l&&(l.addEventListener(n,r,o),i=()=>{l.removeEventListener(n,r,o),i=_r})},{immediate:!0,flush:"post"}),s=()=>{a(),i()};return us(s),s}function Ef(e,t={}){const{window:n=Wn}=t,r=Boolean(n&&"matchMedia"in n);let o;const i=we(!1),a=()=>{!r||(o||(o=n.matchMedia(e)),i.value=o.matches)};return cf(()=>{a(),o&&("addEventListener"in o?o.addEventListener("change",a):o.addListener(a),us(()=>{"removeEventListener"in o?o.removeEventListener("change",a):o.removeListener(a)}))}),i}const Ur=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Kr="__vueuse_ssr_handlers__";Ur[Kr]=Ur[Kr]||{};const kf=Ur[Kr];function Cf(e,t){return kf[e]||t}function Sf(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}const Tf={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function Af(e,t,n,r={}){var o;const{flush:i="pre",deep:a=!0,listenToStorageChanges:s=!0,writeDefaults:l=!0,shallow:c,window:d=Wn,eventFilter:p,onError:f=D=>{console.error(D)}}=r,b=(c?Zi:we)(t);if(!n)try{n=Cf("getDefaultStorage",()=>{var D;return(D=Wn)==null?void 0:D.localStorage})()}catch(D){f(D)}if(!n)return b;const y=Pt(t),L=Sf(y),T=(o=r.serializer)!=null?o:Tf[L],{pause:m,resume:w}=yf(b,()=>C(b.value),{flush:i,deep:a,eventFilter:p});return d&&s&&_f(d,"storage",j),j(),b;function C(D){try{D==null?n.removeItem(e):n.setItem(e,T.write(D))}catch(z){f(z)}}function M(D){if(!(D&&D.key!==e)){m();try{const z=D?D.newValue:n.getItem(e);return z==null?(l&&y!==null&&n.setItem(e,T.write(y)),y):typeof z!="string"?z:T.read(z)}catch(z){f(z)}finally{w()}}}function j(D){D&&D.key!==e||(b.value=M(D))}}function Pf(e){return Ef("(prefers-color-scheme: dark)",e)}var Ai;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Ai||(Ai={}));const ps=Symbol(""),yh=()=>{const e=Ee(ps);if(!e)throw new Error("useDarkMode() is called without provider.");return e},Lf=()=>{const e=bs(),t=Pf(),n=Af("vuepress-color-scheme",e.value.colorMode),r=me({get(){return e.value.colorModeSwitch?n.value==="auto"?t.value:n.value==="dark":e.value.colorMode==="dark"},set(o){o===t.value?n.value="auto":n.value=o?"dark":"light"}});Lt(ps,r),Of(r)},Of=e=>{const t=(n=e.value)=>{const r=window==null?void 0:window.document.querySelector("html");r==null||r.classList.toggle("dark",n)};ot(()=>{tt(e,t,{immediate:!0})}),so(()=>t())},ms=(...e)=>{const n=lr().resolve(...e),r=n.matched[n.matched.length-1];if(!(r!=null&&r.redirect))return n;const{redirect:o}=r,i=X(o)?o(n):o,a=ge(i)?{path:i}:i;return ms({hash:n.hash,query:n.query,params:n.params,...a})},Rf=e=>{const t=ms(encodeURI(e));return{text:t.meta.title||e,link:t.name==="404"?e:t.fullPath}};let Er=null,nn=null;const If={wait:()=>Er,pending:()=>{Er=new Promise(e=>nn=e)},resolve:()=>{nn==null||nn(),Er=null,nn=null}},zf=()=>If,gs=Symbol("sidebarItems"),xh=()=>{const e=Ee(gs);if(!e)throw new Error("useSidebarItems() is called without provider.");return e},Mf=()=>{const e=bs(),t=au(),n=me(()=>Nf(t.value,e.value));Lt(gs,n)},Nf=(e,t)=>{var o,i,a,s;const n=(i=(o=e.sidebar)!=null?o:t.sidebar)!=null?i:"auto",r=(s=(a=e.sidebarDepth)!=null?a:t.sidebarDepth)!=null?s:2;return e.home||n===!1?[]:n==="auto"?Ff(r):G(n)?vs(n,r):Ha(n)?Df(n,r):[]},Hf=(e,t)=>({text:e.title,link:`#${e.slug}`,children:bo(e.children,t)}),bo=(e,t)=>t>0?e.map(n=>Hf(n,t-1)):[],Ff=e=>{const t=kn();return[{text:t.value.title,children:bo(t.value.headers,e)}]},vs=(e,t)=>{const n=go(),r=kn(),o=i=>{var s;let a;if(ge(i)?a=Rf(i):a=i,a.children)return{...a,children:a.children.map(l=>o(l))};if(a.link===n.path){const l=((s=r.value.headers[0])==null?void 0:s.level)===1?r.value.headers[0].children:r.value.headers;return{...a,children:bo(l,t)}}return a};return e.map(i=>o(i))},Df=(e,t)=>{var i;const n=go(),r=Fa(e,n.path),o=(i=e[r])!=null?i:[];return vs(o,t)},bs=()=>Gd();var $f=bt({enhance({app:e,router:t}){e.component("Badge",Xd),e.component("CodeGroup",ef),e.component("CodeGroupItem",of),e.component("AutoLinkExternalIcon",()=>{const r=e.component("ExternalLinkIcon");return r?ae(r):null}),e.component("NavbarSearch",()=>{const r=e.component("Docsearch")||e.component("SearchBox");return r?ae(r):null});const n=t.options.scrollBehavior;t.options.scrollBehavior=async(...r)=>(await zf().wait(),n(...r))},setup(){Lf(),Mf()}});const jf=(e,t)=>t.some(n=>{if(ge(n))return n===e.key;const{key:r,ctrl:o=!1,shift:i=!1,alt:a=!1}=n;return r===e.key&&o===e.ctrlKey&&i===e.shiftKey&&a===e.altKey}),Bf=/[^\x00-\x7F]/,Uf=e=>e.split(/\s+/g).map(t=>t.trim()).filter(t=>!!t),Pi=e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),Li=(e,t)=>{const n=t.join(" "),r=Uf(e);if(Bf.test(e))return r.some(a=>n.toLowerCase().indexOf(a)>-1);const o=e.endsWith(" ");return new RegExp(r.map((a,s)=>r.length===s+1&&!o?`(?=.*\\b${Pi(a)})`:`(?=.*\\b${Pi(a)}\\b)`).join("")+".+","gi").test(n)},Kf=({input:e,hotKeys:t})=>{if(t.value.length===0)return;const n=r=>{!e.value||jf(r,t.value)&&!e.value.contains(r.target)&&(r.preventDefault(),e.value.focus())};ot(()=>{document.addEventListener("keydown",n)}),nr(()=>{document.removeEventListener("keydown",n)})},Vf=[{title:"About",headers:[],path:"/about.html",pathLocale:"/",extraFields:[]},{title:"",headers:[{level:3,title:"\u{1F4DF} LaTeX PDF press specification",slug:"latex-pdf-press-specification",children:[]},{level:3,title:"\u{1F30C} API enchantment with JavaScript",slug:"api-enchantment-with-javascript",children:[]},{level:3,title:"\u{1F38B} Set up Kali Linux and Metasploitable on VirtualBox",slug:"set-up-kali-linux-and-metasploitable-on-virtualbox",children:[]},{level:3,title:"\u{1F375} Intro on web security with Helmet.js",slug:"intro-on-web-security-with-helmet-js",children:[]},{level:3,title:"\u{1F391} Bash scriptage",slug:"bash-scriptage",children:[]},{level:3,title:"\u{1F52E} JavaScript cast specification",slug:"javascript-cast-specification",children:[]},{level:3,title:"\u{1F359} GitHub once and for all",slug:"github-once-and-for-all",children:[]},{level:3,title:"\u{1F4DF} Terminal commands",slug:"terminal-commands",children:[]},{level:3,title:"\u231B Markdown cheat sheet",slug:"markdown-cheat-sheet",children:[]}],path:"/",pathLocale:"/",extraFields:[]},{title:"",headers:[],path:"/tarot.html",pathLocale:"/",extraFields:[]},{title:"API enchantment with JavaScript",headers:[{level:2,title:"1. The Fetch API",slug:"_1-the-fetch-api",children:[]}],path:"/posts/api-enchantment-with-javascript.html",pathLocale:"/",extraFields:[]},{title:"Bash Scriptage",headers:[{level:2,title:"How to create a Bash Script",slug:"how-to-create-a-bash-script",children:[]},{level:2,title:"Bonus: how to create symbolic 'links', or soft links, to folders/files on the terminal",slug:"bonus-how-to-create-symbolic-links-or-soft-links-to-folders-files-on-the-terminal",children:[]}],path:"/posts/bash-scriptage.html",pathLocale:"/",extraFields:[]},{title:"GitHub once and for all",headers:[{level:2,title:"Clone, update, commit and push code to GitHub from the Terminal",slug:"clone-update-commit-and-push-code-to-github-from-the-terminal",children:[]},{level:2,title:"Working with branches",slug:"working-with-branches",children:[]},{level:2,title:"Git commands used",slug:"git-commands-used",children:[]}],path:"/posts/github-once-and-for-all.html",pathLocale:"/",extraFields:[]},{title:"Learn web security with Helmet.js",headers:[{level:2,title:"Installing",slug:"installing",children:[]},{level:2,title:"Usage",slug:"usage",children:[{level:3,title:"Not included in app.use(helmet());:",slug:"not-included-in-app-use-helmet",children:[]}]}],path:"/posts/intro-on-web-security-with-helmet-js.html",pathLocale:"/",extraFields:[]},{title:"JavaScript cast specification",headers:[{level:2,title:"1. Objects",slug:"_1-objects",children:[{level:3,title:"Primitive Values",slug:"primitive-values",children:[]},{level:3,title:"Functions",slug:"functions",children:[]}]},{level:2,title:"2. Strings and Numbers",slug:"_2-strings-and-numbers",children:[{level:3,title:"Template strings",slug:"template-strings",children:[]},{level:3,title:"String formatting",slug:"string-formatting",children:[]}]},{level:2,title:"3. Operators",slug:"_3-operators",children:[{level:3,title:"Arithmetic operators",slug:"arithmetic-operators",children:[]},{level:3,title:"Assignment operators",slug:"assignment-operators",children:[]},{level:3,title:"Comparison operators",slug:"comparison-operators",children:[]},{level:3,title:"Logical operators",slug:"logical-operators",children:[]},{level:3,title:"Conditional or Ternary operators",slug:"conditional-or-ternary-operators",children:[]}]},{level:2,title:"4. Document Object Model (DOM)",slug:"_4-document-object-model-dom",children:[{level:3,title:"Selectors",slug:"selectors",children:[]},{level:3,title:"innerText and innerHTML",slug:"innertext-and-innerhtml",children:[]},{level:3,title:"DOM Events",slug:"dom-events",children:[]}]},{level:2,title:"5. Math functions",slug:"_5-math-functions",children:[{level:3,title:"Rounding numbers",slug:"rounding-numbers",children:[]},{level:3,title:"Generating random numbers",slug:"generating-random-numbers",children:[]},{level:3,title:"Examples",slug:"examples",children:[]}]},{level:2,title:"6. Conditionals",slug:"_6-conditionals",children:[{level:3,title:"if...else",slug:"if-else",children:[]},{level:3,title:"switch...case",slug:"switch-case",children:[]}]},{level:2,title:"7. Repetitions (Loops)",slug:"_7-repetitions-loops",children:[{level:3,title:"for",slug:"for",children:[]},{level:3,title:"while",slug:"while",children:[]},{level:3,title:"do... while",slug:"do-while",children:[]},{level:3,title:"break and continue",slug:"break-and-continue",children:[]},{level:3,title:"Counters and accumulators",slug:"counters-and-accumulators",children:[]}]},{level:2,title:"8. Arrays",slug:"_8-arrays",children:[{level:3,title:"Array methods",slug:"array-methods",children:[]},{level:3,title:"Array properties",slug:"array-properties",children:[]},{level:3,title:"Array of objects",slug:"array-of-objects",children:[]},{level:3,title:"Locating content inside a array",slug:"locating-content-inside-a-array",children:[]}]},{level:2,title:"Cookies, local storage, session storage",slug:"cookies-local-storage-session-storage",children:[]},{level:2,title:"Node.js",slug:"node-js",children:[{level:3,title:"prompt-sync",slug:"prompt-sync",children:[]}]}],path:"/posts/javascript-references.html",pathLocale:"/",extraFields:[]},{title:"Set up Kali Linux and Metasploitable on VirtualBox",headers:[{level:2,title:"1: Download",slug:"_1-download",children:[]},{level:2,title:"2: Kali Linux virtual machine",slug:"_2-kali-linux-virtual-machine",children:[]},{level:2,title:"3: Metasploitable virtual machine",slug:"_3-metasploitable-virtual-machine",children:[]},{level:2,title:"4: Virtual machines network configuration",slug:"_4-virtual-machines-network-configuration",children:[]}],path:"/posts/kali-metasploitable-virtualbox.html",pathLocale:"/",extraFields:[]},{title:"LaTeX PDF press specification",headers:[{level:2,title:"The preamble",slug:"the-preamble",children:[{level:3,title:"\\documentclass",slug:"documentclass",children:[]},{level:3,title:"\\usepackage",slug:"usepackage",children:[]}]},{level:2,title:"The content",slug:"the-content",children:[]},{level:2,title:"Content techniques",slug:"content-techniques",children:[{level:3,title:"Paragraphs, chapters, sections, and subsections",slug:"paragraphs-chapters-sections-and-subsections",children:[]},{level:3,title:"Horizontal and vertical spacing of elements",slug:"horizontal-and-vertical-spacing-of-elements",children:[]},{level:3,title:"Font size and style",slug:"font-size-and-style",children:[]},{level:3,title:"Lists",slug:"lists",children:[]},{level:3,title:"Images",slug:"images",children:[]},{level:3,title:"Tables",slug:"tables",children:[]},{level:3,title:"Titlepage",slug:"titlepage",children:[]},{level:3,title:"Table of contents (TOC)",slug:"table-of-contents-toc",children:[]},{level:3,title:"Footnotes",slug:"footnotes",children:[]},{level:3,title:"Quotes",slug:"quotes",children:[]}]},{level:2,title:"Bibliographic references",slug:"bibliographic-references",children:[]},{level:2,title:"ABNT",slug:"abnt",children:[]},{level:2,title:"References \u{1F5A8}\uFE0F \u{1F5A8}",slug:"references-\u{1F5A8}\uFE0F-\u{1F5A8}",children:[]}],path:"/posts/latex-pdf-press.html",pathLocale:"/",extraFields:[]},{title:"Markdown cheat sheet",headers:[],path:"/posts/markdown-cheat-sheet.html",pathLocale:"/",extraFields:[]},{title:"Linux Terminal & commands",headers:[{level:2,title:"Directory Structure",slug:"directory-structure",children:[]},{level:2,title:"Commands",slug:"commands",children:[{level:3,title:"Navigation",slug:"navigation",children:[]},{level:3,title:"Package Management",slug:"package-management",children:[]},{level:3,title:"File management and editing",slug:"file-management-and-editing",children:[]},{level:3,title:"Networking and processes",slug:"networking-and-processes",children:[]},{level:3,title:"Utility",slug:"utility",children:[]}]},{level:2,title:"Bonus! Using curl to convert images from the web",slug:"bonus-using-curl-to-convert-images-from-the-web",children:[]}],path:"/posts/terminal-commands.html",pathLocale:"/",extraFields:[]},{title:"",headers:[],path:"/404.html",pathLocale:"/",extraFields:[]}],ws=we(Vf),qf=()=>ws;cr.webpackHot&&(__VUE_HMR_RUNTIME__.updateSearchIndex=e=>{ws.value=e});const Wf=({searchIndex:e,routeLocale:t,query:n,maxSuggestions:r})=>{const o=me(()=>e.value.filter(i=>i.pathLocale===t.value));return me(()=>{const i=n.value.trim().toLowerCase();if(!i)return[];const a=[],s=(l,c)=>{Li(i,[c.title])&&a.push({link:`${l.path}#${c.slug}`,title:l.title,header:c.title});for(const d of c.children){if(a.length>=r.value)return;s(l,d)}};for(const l of o.value){if(a.length>=r.value)break;if(Li(i,[l.title,...l.extraFields])){a.push({link:l.path,title:l.title});continue}for(const c of l.headers){if(a.length>=r.value)break;s(l,c)}}return a})},Jf=e=>{const t=we(0);return{focusIndex:t,focusNext:()=>{t.value{t.value>0?t.value-=1:t.value=e.value.length-1}}},Gf=De({name:"SearchBox",props:{locales:{type:Object,required:!1,default:()=>({})},hotKeys:{type:Array,required:!1,default:()=>[]},maxSuggestions:{type:Number,required:!1,default:5}},setup(e){const{locales:t,hotKeys:n,maxSuggestions:r}=pl(e),o=lr(),i=Va(),a=qf(),s=we(null),l=we(!1),c=we(""),d=me(()=>{var C;return(C=t.value[i.value])!=null?C:{}}),p=Wf({searchIndex:a,routeLocale:i,query:c,maxSuggestions:r}),{focusIndex:f,focusNext:b,focusPrev:y}=Jf(p);Kf({input:s,hotKeys:n});const L=me(()=>l.value&&!!p.value.length),T=()=>{!L.value||y()},m=()=>{!L.value||b()},w=C=>{if(!L.value)return;const M=p.value[C];!M||o.push(M.link).then(()=>{c.value="",f.value=0})};return()=>ae("form",{class:"search-box",role:"search"},[ae("input",{ref:s,type:"search",placeholder:d.value.placeholder,autocomplete:"off",spellcheck:!1,value:c.value,onFocus:()=>l.value=!0,onBlur:()=>l.value=!1,onInput:C=>c.value=C.target.value,onKeydown:C=>{switch(C.key){case"ArrowUp":{T();break}case"ArrowDown":{m();break}case"Enter":{C.preventDefault(),w(f.value);break}}}}),L.value&&ae("ul",{class:"suggestions",onMouseleave:()=>f.value=-1},p.value.map(({link:C,title:M,header:j},D)=>ae("li",{class:["suggestion",{focus:f.value===D}],onMouseenter:()=>f.value=D,onMousedown:()=>w(D)},ae("a",{href:C,onClick:z=>z.preventDefault()},[ae("span",{class:"page-title"},M),j&&ae("span",{class:"page-header"},`> ${j}`)]))))])}});const Yf={},Qf=["s","/"],Zf=5;var Xf=bt({enhance({app:e}){e.component("SearchBox",t=>ae(Gf,{locales:Yf,hotKeys:Qf,maxSuggestions:Zf,...t}))}});const kr=[Ed,Sd,Ld,Bd,qd,Qd,$f,Xf],eh=[["v-22a39d25","/about.html",{title:"About"},["/about","/about.md"]],["v-8daa1a0e","/",{title:""},["/index.html","/index.md"]],["v-abde92f0","/tarot.html",{title:""},["/tarot","/tarot.md"]],["v-724095ba","/posts/api-enchantment-with-javascript.html",{title:"API enchantment with JavaScript"},["/posts/api-enchantment-with-javascript","/posts/api-enchantment-with-javascript.md"]],["v-5029e009","/posts/bash-scriptage.html",{title:"Bash Scriptage"},["/posts/bash-scriptage","/posts/bash-scriptage.md"]],["v-3ec37569","/posts/github-once-and-for-all.html",{title:"GitHub once and for all"},["/posts/github-once-and-for-all","/posts/github-once-and-for-all.md"]],["v-5f1b757b","/posts/intro-on-web-security-with-helmet-js.html",{title:"Learn web security with Helmet.js"},["/posts/intro-on-web-security-with-helmet-js","/posts/intro-on-web-security-with-helmet-js.md"]],["v-5f5834b4","/posts/javascript-references.html",{title:"JavaScript cast specification"},["/posts/javascript-references","/posts/javascript-references.md"]],["v-6801703b","/posts/kali-metasploitable-virtualbox.html",{title:"Set up Kali Linux and Metasploitable on VirtualBox"},["/posts/kali-metasploitable-virtualbox","/posts/kali-metasploitable-virtualbox.md"]],["v-04a11941","/posts/latex-pdf-press.html",{title:"LaTeX PDF press specification"},["/posts/latex-pdf-press","/posts/latex-pdf-press.md"]],["v-09db1bdd","/posts/markdown-cheat-sheet.html",{title:"Markdown cheat sheet"},["/posts/markdown-cheat-sheet","/posts/markdown-cheat-sheet.md"]],["v-6decc2f5","/posts/terminal-commands.html",{title:"Linux Terminal & commands"},["/posts/terminal-commands","/posts/terminal-commands.md"]],["v-3706649a","/404.html",{title:""},["/404"]]];var th=()=>eh.reduce((e,[t,n,r,o])=>(e.push({name:t,path:n,component:ni,meta:r},...o.map(i=>({path:i,redirect:n}))),e),[{name:"404",path:"/:catchAll(.*)",component:ni}]),nh=Iu,rh=()=>{const e=gd({history:nh(ru(ht.value.base)),routes:th(),scrollBehavior:(t,n,r)=>r||(t.hash?{el:t.hash}:{top:0})});return e.beforeResolve(async(t,n)=>{var r;(t.path!==n.path||n===Ze)&&([et.value]=await Promise.all([Et.resolvePageData(t.name),(r=Da[t.name])==null?void 0:r.__asyncLoader()]))}),e},oh=e=>{e.component("ClientOnly",fu),e.component("Content",hu)},ih=(e,t)=>{const n=me(()=>Et.resolveRouteLocale(ht.value.locales,t.currentRoute.value.path)),r=me(()=>Et.resolveSiteLocaleData(ht.value,n.value)),o=me(()=>Et.resolvePageFrontmatter(et.value)),i=me(()=>Et.resolvePageHeadTitle(et.value,r.value)),a=me(()=>Et.resolvePageHead(i.value,o.value,r.value)),s=me(()=>Et.resolvePageLang(et.value));return e.provide(ho,n),e.provide(qa,r),e.provide(Ba,o),e.provide(lu,i),e.provide(Ua,a),e.provide(Ka,s),Object.defineProperties(e.config.globalProperties,{$frontmatter:{get:()=>o.value},$head:{get:()=>a.value},$headTitle:{get:()=>i.value},$lang:{get:()=>s.value},$page:{get:()=>et.value},$routeLocale:{get:()=>n.value},$site:{get:()=>ht.value},$siteLocale:{get:()=>r.value},$withBase:{get:()=>pu}}),{pageData:et,pageFrontmatter:o,pageHead:a,pageHeadTitle:i,pageLang:s,routeLocale:n,siteData:ht,siteLocaleData:r}},ah=()=>{const e=go(),t=su(),n=cu(),r=we([]),o=()=>{t.value.forEach(a=>{const s=sh(a);s&&r.value.push(s)})},i=()=>{document.documentElement.lang=n.value,r.value.forEach(a=>{a.parentNode===document.head&&document.head.removeChild(a)}),r.value.splice(0,r.value.length),t.value.forEach(a=>{const s=lh(a);s!==null&&(document.head.appendChild(s),r.value.push(s))})};Lt(du,i),ot(()=>{o(),i(),tt(()=>e.path,()=>i())})},sh=([e,t,n=""])=>{const r=Object.entries(t).map(([s,l])=>ge(l)?`[${s}="${l}"]`:l===!0?`[${s}]`:"").join(""),o=`head > ${e}${r}`;return Array.from(document.querySelectorAll(o)).find(s=>s.innerText===n)||null},lh=([e,t,n])=>{if(!ge(e))return null;const r=document.createElement(e);return Ha(t)&&Object.entries(t).forEach(([o,i])=>{ge(i)?r.setAttribute(o,i):i===!0&&r.setAttribute(o,"")}),ge(n)&&r.appendChild(document.createTextNode(n)),r},ch=Qc,uh=async()=>{var n;const e=ch({name:"VuepressApp",setup(){var r;ah();for(const o of kr)(r=o.setup)==null||r.call(o);return()=>[ae(is),...kr.flatMap(({rootComponents:o=[]})=>o.map(i=>ae(i)))]}}),t=rh();oh(e),ih(e,t);for(const r of kr)await((n=r.enhance)==null?void 0:n.call(r,{app:e,router:t,siteData:ht}));return e.use(t),{app:e,router:t}};uh().then(({app:e,router:t})=>{t.isReady().then(()=>{e.mount("#app")})});export{uu as A,wh as B,yh as C,yn as D,ae as E,Re as F,pu as G,fu as H,we as I,tt as J,dh as K,gh as L,ou as M,ru as N,lr as O,ge as P,Rf as Q,ot as R,Jn as S,fo as T,kn as U,xh as V,Ha as W,mh as X,so as Y,zf as Z,cs as _,Oa as a,be as b,Aa as c,uh as createVueApp,co as d,hh as e,De as f,bs as g,Pt as h,au as i,me as j,G as k,fh as l,ph as m,go as n,rr as o,pl as p,Pa as q,Ul as r,hc as s,As as t,Va as u,ga as v,Cl as w,nu as x,vh as y,bh as z}; diff --git a/assets/back-to-top.8efcbe56.svg b/assets/back-to-top.8efcbe56.svg new file mode 100644 index 0000000..8323678 --- /dev/null +++ b/assets/back-to-top.8efcbe56.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/bash-scriptage.html.880d6510.js b/assets/bash-scriptage.html.880d6510.js new file mode 100644 index 0000000..db30350 --- /dev/null +++ b/assets/bash-scriptage.html.880d6510.js @@ -0,0 +1,6 @@ +import{_ as e,o,c as s,e as a}from"./app.03d0ed6d.js";const t={},i=a(`

Bash Scriptage

Bourne Again Shell (Bash) scripts are scripts of commands used on Unix terminals, like the Linux terminal.

It allows you to enter a list of commands (in sequence) just by typing the name of the Bash Script file.

For example, to open Firefox for Developers on Linux systems, you need to open the folder where it is at and double click de file called firefox.

To do it from the terminal, you need:

  • Change Directory cd to the folder where firefox is;
  • Run ./firefox.

./ means "from this folder where i'm" + / to select file/folder you wish to work with.

To achieve this, you just typed a few commands on the terminal. To do this with a single command, you need a Bash Script.

How to create a Bash Script

At your user home folder $ (/home/user), create a file called script.sh.

Your user home folder is usually where your terminal starts. Type pwd to check. It needs to be /home/petry, for example.

Inside the script.sh write #!/bin/sh on the very first line. This will tell the terminal it is a Bash Script.

The first command of your script will be written above, and so on.

Example:

#!/bin/sh
+cd aurora
+./firefox &
+

This is the same as: cd aurora && ./firefox &.

In this case, is just two commands, but this can be used to create complex scripts, with logic operators and all that cool programming stuff.

As you can see on the example, the first command on the script is cd aurora. Aurora is the nickname for the Firefox for Developers, and this folder is actually /home/petry/aurora/.

This is a link. To create one, you will need the ln command. Like:

ln -s [path] [symbolic name]
+

Example:

ln -s /home/petry/aurora/ aurora
+

This is starting to look like magic...

`,25),n=[i];function r(c,l){return o(),s("div",null,n)}var p=e(t,[["render",r],["__file","bash-scriptage.html.vue"]]);export{p as default}; diff --git a/assets/bash-scriptage.html.b7ee1856.js b/assets/bash-scriptage.html.b7ee1856.js new file mode 100644 index 0000000..aa7bc83 --- /dev/null +++ b/assets/bash-scriptage.html.b7ee1856.js @@ -0,0 +1 @@ +const t=JSON.parse(`{"key":"v-5029e009","path":"/posts/bash-scriptage.html","title":"Bash Scriptage","lang":"en-US","frontmatter":{"title":"Bash Scriptage","date":"2022-11-01","sidebar":false,"tags":["bash","bash script","how-to create a bash script"]},"excerpt":"","headers":[{"level":2,"title":"How to create a Bash Script","slug":"how-to-create-a-bash-script","children":[]},{"level":2,"title":"Bonus: how to create symbolic 'links', or soft links, to folders/files on the terminal","slug":"bonus-how-to-create-symbolic-links-or-soft-links-to-folders-files-on-the-terminal","children":[]}],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"posts/bash-scriptage.md"}`);export{t as data}; diff --git a/assets/github-once-and-for-all.html.4b9b7f93.js b/assets/github-once-and-for-all.html.4b9b7f93.js new file mode 100644 index 0000000..15102ae --- /dev/null +++ b/assets/github-once-and-for-all.html.4b9b7f93.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3ec37569","path":"/posts/github-once-and-for-all.html","title":"GitHub once and for all","lang":"en-US","frontmatter":{"title":"GitHub once and for all","date":"2022-08-05","sidebar":"auto","tags":["github","github-guide","terminal","commands"]},"excerpt":"","headers":[{"level":2,"title":"Clone, update, commit and push code to GitHub from the Terminal","slug":"clone-update-commit-and-push-code-to-github-from-the-terminal","children":[]},{"level":2,"title":"Working with branches","slug":"working-with-branches","children":[]},{"level":2,"title":"Git commands used","slug":"git-commands-used","children":[]}],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"posts/github-once-and-for-all.md"}');export{e as data}; diff --git a/assets/github-once-and-for-all.html.b135434f.js b/assets/github-once-and-for-all.html.b135434f.js new file mode 100644 index 0000000..cbead12 --- /dev/null +++ b/assets/github-once-and-for-all.html.b135434f.js @@ -0,0 +1,8 @@ +import{_ as a,r as n,o as c,c as d,a as e,b as s,e as t,d as o}from"./app.03d0ed6d.js";const r={},l=t('

GitHub once and for all

Git and GitHub, at first, can be a little frustrating. Complex commands, Git running locally and the GitHub platform. I feel you... So, here is the easiest way (I know) to work with Git and GitHub repositories.

Clone, update, commit and push code to GitHub from the Terminal

Go to the GitHub repository you need work and copy the .git address, which is usually https://github.com/yourUserID/yourRepoName.git and head to the terminal.

Inside the Terminal, browse to the folder you wish to save the repository and type git clone + .git URL. Just like this:

git clone https://github.com/petry078/spellblog.git

Change directory to the repository you just cloned, with: cd + repositoryName.

cd spellblog

And open everything that it is inside the folder on Visual Studio Code, with: code .

Update and change what is needed and go back to the terminal to start the commit process.

First, run git status and read the results. If everything is correct, add every file to the commit, with: git add .

And then git commit -m "commit description" to write the commit.

To upload the commit, just run git push.

',13),u=o("It may ask for you to authenticate the access to your GitHub account, with user and password. For this to work, you need to have a token configured and use the token as your password. "),h={href:"https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token",target:"_blank",rel:"noopener noreferrer"},p=o("Learn more about GitHub tokens and how to create one here!"),m=t(`

The git push must return a message of success with the link of the repository you just pushed the commit. Click on it and check if it's all there.

Its nice to check. I've losted files in this process before...

Working with branches

  • git clone URL
  • cd repositoryName
  • git status
  • git checkout -b NewBranch
  • code .
  • Make your changes.
  • git add .
  • git commit -m "commit description"
  • git push --set-upstream origin NewBranch

This last command will bring the pull request page ready to pull it to main branch.

  • Create a pull request for "NewBranch" on GitHub by visiting "URL";
  • Create Pull Request;
  • Merge Pull Request;
  • Confirm merge;
  • Delete branch.

Git commands used

git status
+git clone gitURL
+git checkout -b NewBranch
+git add .
+git commit -m "commit description"
+git push
+git push --set-upstream origin NewBranch
+
`,10);function g(b,f){const i=n("ExternalLinkIcon");return c(),d("div",null,[l,e("blockquote",null,[e("p",null,[u,e("a",h,[p,s(i)])])]),m])}var w=a(r,[["render",g],["__file","github-once-and-for-all.html.vue"]]);export{w as default}; diff --git a/assets/index.html.640e57a2.js b/assets/index.html.640e57a2.js new file mode 100644 index 0000000..3b05ee5 --- /dev/null +++ b/assets/index.html.640e57a2.js @@ -0,0 +1 @@ +import{_ as e,o as a,c as t,e as r}from"./app.03d0ed6d.js";const i={},s=r('

\u{1F4DF} LaTeX PDF press specification

09 Jan 2024

Ancient tech that works. Feels just like the Gutemberg press.

Read more!


\u{1F30C} API enchantment with JavaScript

01 Jul 2023

Computing power and black magic do not come from just one source.

Read more!


\u{1F38B} Set up Kali Linux and Metasploitable on VirtualBox

03 Mar 2023

After a hours trying to fix all errors. Yeah. Maybe...

Read more!


\u{1F375} Intro on web security with Helmet.js

31 Jan 2023

Get to know more about headers, caching, CDN and web vulnerabilities.

Read more!


\u{1F391} Bash scriptage

01 Nov 2022

Command line scripts. This is starting to look like magic...

Read more!


\u{1F52E} JavaScript cast specification

20 Aug 2022

JavaScript is, indeed, for the mad.

Read more!


\u{1F359} GitHub once and for all

05 Aug 2022

Just the basics, but it will get you going.

Read more!


\u{1F4DF} Terminal commands

26 Jul 2022

Remember! Those are not spells, yet...

Read more!


\u231B Markdown cheat sheet

21 Jul 2022

Basic Markdown syntax

Read more!

',45),h=[s];function n(o,p){return a(),t("div",null,h)}var d=e(i,[["render",n],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html.6956a64c.js b/assets/index.html.6956a64c.js new file mode 100644 index 0000000..76cac8f --- /dev/null +++ b/assets/index.html.6956a64c.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-8daa1a0e","path":"/","title":"","lang":"en-US","frontmatter":{"home":true,"heroImage":"https://petry078.github.io/tarot.gif","heroText":"Spellblog","tagline":"Documentations, writings, spells and other stuff","footer":"Made with VuePress 2 and Markdown \u2014 Guilherme M. Petry 2022"},"excerpt":"","headers":[{"level":3,"title":"\u{1F4DF} LaTeX PDF press specification","slug":"latex-pdf-press-specification","children":[]},{"level":3,"title":"\u{1F30C} API enchantment with JavaScript","slug":"api-enchantment-with-javascript","children":[]},{"level":3,"title":"\u{1F38B} Set up Kali Linux and Metasploitable on VirtualBox","slug":"set-up-kali-linux-and-metasploitable-on-virtualbox","children":[]},{"level":3,"title":"\u{1F375} Intro on web security with Helmet.js","slug":"intro-on-web-security-with-helmet-js","children":[]},{"level":3,"title":"\u{1F391} Bash scriptage","slug":"bash-scriptage","children":[]},{"level":3,"title":"\u{1F52E} JavaScript cast specification","slug":"javascript-cast-specification","children":[]},{"level":3,"title":"\u{1F359} GitHub once and for all","slug":"github-once-and-for-all","children":[]},{"level":3,"title":"\u{1F4DF} Terminal commands","slug":"terminal-commands","children":[]},{"level":3,"title":"\u231B Markdown cheat sheet","slug":"markdown-cheat-sheet","children":[]}],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"index.md"}');export{e as data}; diff --git a/assets/intro-on-web-security-with-helmet-js.html.1823eee7.js b/assets/intro-on-web-security-with-helmet-js.html.1823eee7.js new file mode 100644 index 0000000..8ba9f72 --- /dev/null +++ b/assets/intro-on-web-security-with-helmet-js.html.1823eee7.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5f1b757b","path":"/posts/intro-on-web-security-with-helmet-js.html","title":"Learn web security with Helmet.js","lang":"en-US","frontmatter":{"title":"Learn web security with Helmet.js","date":"2023-01-31","sidebar":false,"tags":["inforsecurity","cybersecurity","helmet.js","websecurity"]},"excerpt":"","headers":[{"level":2,"title":"Installing","slug":"installing","children":[]},{"level":2,"title":"Usage","slug":"usage","children":[{"level":3,"title":"Not included in app.use(helmet());:","slug":"not-included-in-app-use-helmet","children":[]}]}],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"posts/intro-on-web-security-with-helmet-js.md"}');export{e as data}; diff --git a/assets/intro-on-web-security-with-helmet-js.html.96b5daa1.js b/assets/intro-on-web-security-with-helmet-js.html.96b5daa1.js new file mode 100644 index 0000000..9f43767 --- /dev/null +++ b/assets/intro-on-web-security-with-helmet-js.html.96b5daa1.js @@ -0,0 +1,11 @@ +import{_ as a,r as o,o as i,c,a as e,b as t,d as s,e as r}from"./app.03d0ed6d.js";const p={},l=e("h1",{id:"intro-on-web-security-with-helmet-js",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#intro-on-web-security-with-helmet-js","aria-hidden":"true"},"#"),s(" Intro on web security with Helmet.js")],-1),u=s(`"Helmet helps you secure your Express apps by setting various HTTP headers. It's not a silver bullet, but it can help!", says the developers. It is a middleware (communication software) that deals with HTTP headers and also offers security modules for the `),d={href:"https://expressjs.com",target:"_blank",rel:"noopener noreferrer"},h=s("Express"),m=s(" (Node.js framework) applications."),k=s("According to "),f={href:"https://stackshare.io/expressjs",target:"_blank",rel:"noopener noreferrer"},_=s("stackshare.io"),y=s(", Express.js is used in more than 1900 companies applications around the world, including Twitter, Accenture, BlaBlaCar and others. Helmet can be also be used with "),b={href:"https://github.com/helmetjs/helmet/wiki/How-to-use-Helmet-without-Express",target:"_blank",rel:"noopener noreferrer"},g=s("other frameworks"),v=s("."),w=s("This documentation is based on (and can help you follow) the "),x={href:"https://www.freecodecamp.org/learn/information-security/#information-security-with-helmetjs",target:"_blank",rel:"noopener noreferrer"},S=s("Information Security with HelmetJS"),T=s(" course on FreeCodeCamp."),j=r(`

Installing

Run npm install helmet and in your Express application (app.js):

const express = require("express");
+const helmet = require("helmet");
+const app = express();
+app.use(helmet());
+

It is all about headers. Use curl -v <URL> on terminal, to read headers and confirm Helmet.js is working.

Usage

On app.js write app.use(helmet()); to include all manual configurations listed below:

  • app.use(helmet.hidePoweredBy()); removes the X-Powered-By header;
  • app.use(helmet.frameguard({action: 'deny'})); makes your application break when used inside <frame> <iframe> HTML tags. This can help against Clickjacking attacks;
  • app.use(helmet.xssFilter()); sanitizes user input fields, protecting against Cross-Site Scripting (XSS) attacks;
  • app.use(helmet.noSniff()); tells the browser not to use MIME sniffing and read the file as the Content-Type header says.

    MIME sniffing is a technique used in browsers to determine the file type by reading some of its data. This can create vulnerabilities.

  • app.use(helmet.ieNoOpen()); prevents the mighty Internet Explorer to download and execute infected HTML files.
  • app.use(helmet.hsts({maxAge: ninetyDaysInSeconds, force: true})); configures HTTP Strict Transport Security (HSTS), or HTTPS only, avoiding insecure HTTP requests.

    You also gonna need to instantiate a variable with 90 days in seconds ninetyDaysInSeconds = 90*24*60*60 to check certification expiracy.

  • app.use(helmet.dnsPrefetchControl()); disables browser DNS Prefetch.

    To make navigation faster, DNS prefetch resolve domain names before the user tries to click on the link. However, it can cause user data leak, if you serve a malicious website in your application. The attack is the inplantation of this malicious link.

Not included in app.use(helmet());:

  • app.use(helmet.noCache()); prevents your user to use cached versions of your application. This can be good when you just pushed a security update.

  • Content Security Policy:

app.use(helmet.contentSecurityPolicy({
+	directives:{
+		scriptSrc: ["'self'"],
+		styleSrc: ["'self'"]
+	}
+}))
+

scriptSrc and styleSrc with "'self'" will restrict the execution of scripts and stylesheets, originated from the same origin as the domain itself. These directives enhance security by mitigating Cross-Site Scripting (XSS) and file injection attacks.

`,11),q=s("Test repository: "),H={href:"https://replit.com/@GuilhermePetry/boilerplate-infosec",target:"_blank",rel:"noopener noreferrer"},I=s("https://replit.com/@GuilhermePetry/boilerplate-infosec"),P=e("div",{class:"wisdom"},[e("img",{class:"wisdony",src:"https://upload.wikimedia.org/wikipedia/commons/1/11/Wands01.jpg",alt:""})],-1);function C(E,N){const n=o("ExternalLinkIcon");return i(),c("div",null,[l,e("p",null,[u,e("a",d,[h,t(n)]),m]),e("p",null,[k,e("a",f,[_,t(n)]),y,e("a",b,[g,t(n)]),v]),e("blockquote",null,[e("p",null,[w,e("a",x,[S,t(n)]),T])]),j,e("blockquote",null,[e("p",null,[q,e("a",H,[I,t(n)])])]),P])}var M=a(p,[["render",C],["__file","intro-on-web-security-with-helmet-js.html.vue"]]);export{M as default}; diff --git a/assets/javascript-references.html.a569c536.js b/assets/javascript-references.html.a569c536.js new file mode 100644 index 0000000..82fb25f --- /dev/null +++ b/assets/javascript-references.html.a569c536.js @@ -0,0 +1,325 @@ +import{_ as o,r as p,o as c,c as i,a as n,b as t,d as s,e}from"./app.03d0ed6d.js";const l={},u=n("h1",{id:"javascript-cast-specification",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#javascript-cast-specification","aria-hidden":"true"},"#"),s(" JavaScript cast specification")],-1),r=n("blockquote",null,[n("p",null,"Content in progress.")],-1),d=n("h2",{id:"_1-objects",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#_1-objects","aria-hidden":"true"},"#"),s(" 1. Objects")],-1),k=n("p",null,[n("em",null,'"ECMAScript is an object-oriented programming language for performing computations and manipulating computational objects within a host environment... In ECMAScript, an object is a collection of zero or more properties... Properties are containers that hold other objects, primitive values, or functions"')],-1),m=n("p",null,[n("em",null,'"...An object is a member of the built-in type Object; and a function is a callable object. A function that is associated with an object via a property is called a method."')],-1),v=s("The "),b={href:"https://tc39.es/ecma262/",target:"_blank",rel:"noopener noreferrer"},g=s("ECMAScript 262 \xAE 2024 Language Specification"),h=e(`

In JavaScript we write objects. Objects have properties, that can be:

  • Nothing;
  • Other Objects;
  • Primitive Values;
  • Functions.

Everything that is not a primitive value, is an object.

There are several built-in objects in JavaScript:

  • Object;
  • Function;
  • Boolean;
  • Symbol;
  • Various Error
  • Math;
  • Number;
  • Date;
  • String;
  • RegExp;
  • Array;
  • Nine different kinds of Typed Arrays;
  • Map;
  • Set;
  • JSON;
  • ArrayBuffer;
  • SharedArrayBuffer;
  • DataView;
  • Promise;
  • Proxy;
  • Reflect.

Objects can have methods, wich are functions that will use the object properties data.

"When a function is called as a method of an object, the object is passed to the function as its this value."

Primitive Values

  • Undefined;
  • Null;
  • Boolean;
  • Number;
  • BigInt;
  • String;
  • Symbol.

Use typeof varName to reveal data type of element at runtime.

Functions

A function is a callable object, with a set of commands that will be runned when the function is called. Example function().

Functions can return something and have scope {} defined.

Functions can be called as methods, that will run with the object properties data. Example: object.functionAsMethod() just like console.log().

As like an object it is, functions can have properties and methods.

function(paramenters){
+ commands
+}
+

Arrow functions

Alternative function syntax for using it as variables, or parameters. Arrow functions dosent have its own this and can't be used as constructor function.

let arrowFunction = (paramenters) => {
+    commands
+}
+

2. Strings and Numbers

  • Number(varName) coverts to number;
  • String(varName) converts to string;
  • Number.parseInt(varName) coverts to whole number;
  • Number.parseFloat(varName) converts to floating-point number.
  • console.log(Number.isInteger(12)) will check if number is floating-point.
let fu = "bar" //string
+let fuu = 123 //number
+

Template strings

console.log(\`Name: \${name};\`)
+console.log(\`Surname: \${surname}.\`)
+

String formatting

var jsString = "JavaScript";
+console.log(jsString.toUpperCase());
+console.log(jsString.toLowerCase());
+
+var jsStringLenght = jsString.length
+console.log(jsStringLenght)
+

3. Operators

  • Arithmetic (Aritim\xE9ticos);
  • Assignment (Atribui\xE7\xE3o);
  • Comparison (Relacionais);
  • Logical (L\xF3gicos);
  • Conditional or Ternary (Condicional ou Tern\xE1rio).

Precedence order:

  1. Arithmetic;
  2. Comparison;
  3. Logical;
  4. Ternary.

Arithmetic operators

OperatorFunction
+Addition
-Subtraction
*Multiplication
/Division
%Remainder (resto de uma divis\xE3o inteira)
**Power (Ex: 5\xB2 = [5 ** 2])

Arithmetic operators precedence order

  1. () first priority
  2. **
  3. *, /, %
  4. +, - last priority

Assignment operators

OperatorFunction
=Assignment (recebe)
// Auto-assignment
+=Addition (a += 5; // a = a + 5)
-=Subtraction (a -= 2; // a = a - 2)
*=Multiplication (a *= 3; // a = a * 3)
/=Division (a /= 2; // a = a / 2)
%=Remainder (a %= 2; // a = a % 2)
**=Exponentiation (a = 2; // a = a2)

Increment (++) and decrement (--)

  • x++ x = x + 1
  • x-- x = x - 1

Pre-increment ++x

Pre-decrement --x

Comparison operators

It returns true or false, comparing only the value.

OperatorFunction
>Greater than (maior que)
<Less than (menor que)
>=Greater than or equal to (maior que ou igual)
<=Less than or equal to (menor que ou igual)
==Equal to (same value)
!=Not equal to

Strict operators (igualdade e desigualdede)

Compares value and type.

OperatorFunction
===Strict equal to (igual restrito)
!==Strict not equal to (desigual restrito)

Examples:

5 > 2  //true
+7 < 4  //false
+8 >= 8 //true
+9 <= 7 //false
+5 == 5 //true
+4 != 4 //false
+
+// strict equal operator
+2 === 2 // true
+2 === '2' // false
+
+// strict not equal operator
+2 !== '2' // true
+2 !== 2 // false
+

Logical operators

| Operator  | Function       | Example                            |
+|-----------|----------------|------------------------------------|
+|     !     | Not (nega\xE7\xE3o)  | \`(x < 10 && y > 1)\` // true  	  |
+|    &&     | And (conjun\xE7\xE3o)| \`(x == 5 || y == 5)\` // false      |
+|    ||     | Or  (disjun\xE7\xE3o)| \`\`\`!(x == y)\`\`\` // true            |
+

Unary operator ! (not) only deals with one operating, turning 0 in 1 and 1 in 0. True to false, false to true.

Binary operators && and || deals with two operating and returns true or false after analysis. If you ask for a book heavy and && black, it must return true only if the book is heavy and black, but the or || operator will return true if at least one is true.

//Inverts the result
+!true //false
+!false //true
+
+//Both need to be \`true\` to return \`true\`.
+true && true //true
+true && false //false
+false && false //false
+false && true //false
+
+//Only one need to be \`true\` to return \`true\`
+true || true //true
+true || false //true
+false || false //false
+false || true //true
+

Conditional or Ternary operators

It begins with a logic test, if it returns true, it will run the code on the first true slot, and if it returns false, runs the second false slot.

Syntax:

x && b ? true : false

Examples:

// 1.
+let media = 5.5
+let mediaCalculada = media > 6 ? "Aprovado(true)" : "Reprovado(false)"
+
+console.log(mediaCalculada) // Reprovado(false)
+
+// 2.
+var x = 8
+var res = x % 2 == 0 ? 5 : 9 // 5 (true)
+
+//3. 
+var age = 18
+var r = age >= 18 ? "Adult" : "Child" // Adult (true)
+

4. Document Object Model (DOM)

The DOM tree:

window.location
+      .history
+      .document.<call to HTML tag (selector)>    	
+

Selectors

getElementsBy...

  • getElementById Select HTML tag by its ID.
  • getElementsByTagName() Select HTML tags.
  • getElementsByName() Select HTML tag by its name.
  • getElementsByClassName() Select HTML tags by its class name.

Usage:

<p id = "IdOfP">Old string</p>
+<script>
+window.document.getElementById("IdOfP").innerText = "New string"
+</script>
+

Query selectors

Modern aproach of selectors.

  • querySelector() Select the first HTML Tag
  • querySelectorAll() Creates a list of all elements. Not sure how it works.

querySelector() can be used to select HTML tag + ID/Class (# for ID or . for class)

Usage:

<p>String 1<p>
+<p id = "IdOfP">String 2</p>
+<p class = "ClassOfP">String 3</p> 
+<script>
+window.document.querySelector("p").innerText = "Select by HTML tag name"
+window.document.querySelector("#IdOfP").innerText = "Select by ID"
+window.document.querySelector(".ClassOfP").innerText = "Select by Class name"    
+</script>
+

innerText and innerHTML

  • innerText Write plain text on top of selected element;
  • innerHTML Write HTML on top of selected element;
<h1></h1>
+<p></p>
+<script>
+document.querySelector("h1").innerText="Inset only raw text";
+document.querySelector("p").innerHTML="Insert text with <strong>HTML Tags</strong>"
+</script>
+

Avoid using innerHTML, that can represent a risk of Cross-Site Scripting (XSS).

DOM Events

It works alongside with functions(). Events are called with reserved words, inside the .html file, like onkeydown="functionName()" or in the .js file with Event Listeners, like:

<button id="myBtn">Try it</button>
+
+<p id="textField"></p>
+
+<script>
+document.getElementById("myBtn").addEventListener("click", printDate);
+
+function printDate() {
+  document.getElementById("textField").innerHTML = Date();
+}
+</script>
+

This can also be done with Arrow Functions:

document.getElementById("myBtn").addEventListener("click", (printDate) => {
+    document.getElementById("textField").innerHTML = Date();
+})
+

Mouse events example:

<body>
+    <main>
+    </main>
+
+    <script>
+        let main = document.querySelector("main")
+        //Events
+        main.addEventListener("mouseenter", mouseenterFunction)
+        main.addEventListener("mouseout", mouseoutFunction)
+        main.addEventListener("click", clickFunction)
+
+        function mouseenterFunction() {
+            main.innerText = "mouseenter event"
+            main.style.background = "red"
+        }
+        
+        function mouseoutFunction() {
+            main.innerText = "mouseout event"
+            main.style.background = "yellow"
+        }
+        
+        function clickFunction() {
+            main.innerText = "click event"
+            main.style.background = "purple"
+        }
+    </script>
+
+    <style>
+        main {
+            width: 150px;
+            height: 150px;
+            background-color: green;
+        }
+    </style>
+</body>
+

Hello \${name} example:

This example needs refinement.

<body>
+    <form>
+        <label for="inName">Name:</label>
+        <input type="text" name="" id="inName">
+        <input type="submit" value="print">
+    </form>
+
+    <h1></h1>
+
+<script>
+    let name = document.querySelector("form").inName.value
+    document.querySelector("form").addEventListener("submit", (printName) => {
+        document.querySelector("h1").innerText = \`Hello, \${name}\`
+        printName.preventDefault()
+    })
+</script>
+</body>
+
`,87),f=s("For complete events list, see "),y={href:"https://developer.mozilla.org/en-US/docs/Web/Events",target:"_blank",rel:"noopener noreferrer"},q=s("MDN Web Docs"),w=s("."),x=e(`

5. Math functions

In addition to the Arithmetic operators, math can be done with the Math. functions.

Rounding numbers

  • Math.round(num) return the closest number. Example Math.round(4.4) = 4 and Math.round(4.5) = 5;
  • Math.ceil(num) round to bigger number. Example: Math.ceil(4.2) = 5;
  • Math.floor(num) round to lower number. Example: Math.floor(4.2) = 4;

Generating random numbers

Math.random() will return a random number between 0 and 1.

Examples

console.log(Math.round(8.4)) //8
+console.log(Math.round(8.5)) //9
+
+console.log(Math.ceil(4.2)) //5
+console.log(Math.floor(4.9)) //4
+
+console.log(Math.random()) //0.7099176926811621
+

6. Conditionals

Programs read data (input), process it, and return something. With conditionals you can have limitations to work with.

The syntax in JavaScript, and most languages, are if...else, switch...case and with ternary operators.

The condition (parameters) must be written with comparison operators. Each comparison will return true or false.

There are situations in which your program must analyze more than one condition. In that case, use logical operators inside the parameter/condition slot. Example: condition == true && condition == true or condition == true || condition != true.

if...else

The if...else conditions can be written in three different structures:

  • Simple if (condition == true){run};
  • Composed if (condition == true){run}... else{run};
  • Multiple if (condition == true){run}... else if{run}...else{run}.

Multiple conditions can have as many else if as necessary.

let n1 = prompt("N1: ")
+let n2 = prompt("N2: ")
+let n3 = prompt("N3: ")
+let n4 = prompt("N4: ")
+
+let average = (n1 + n2 + n3 + n4) / 4
+
+if (average >= 6){
+    console.log("Approved!")
+} else if (average == 5) {
+    console.log("Need recovery")
+} else {
+    console.log("Disapproved")
+}
+

switch...case

Just another structure to make conditionals. Usable when you have a lot of options based on values of a variable, or when you need to return a different case for every value possible of a variable.

Basic example:

let neighborhood = prompt("neighborhood: ")
+let fee
+
+switch (neighborhood) {
+    case "center":
+        fee = 5
+    break
+
+    case "fragata":
+    case "caranda": 
+        fee = 7 //Both (fragada and caranda) will return 7
+    break
+
+    case "elysee":
+        fee = 10
+    break
+
+    default:
+        fee = 8
+}
+
+console.log(fee)
+

7. Repetitions (Loops)

Repetitions, or Loops, (La\xE7os de Repeti\xE7\xE3o, in Portuguese) allows you to run one or more commands in a program or function as many times you need.

Loops need braking points and can be used with Conditional (if...else/switch... case/break/continue).

for

The for syntax is composed by 3 instructions for (initialValue; conditional; incremental/decremental){command}:

for (let i = 1; i <= 10; i = i + 1){command}
+        ||          ||        ||
+	    \\/          \\/        \\/
+{INITIAL VALUE}{CONDITIONAL}{INCREMENTAL}
+
+//This means that \`i\` starts as 1 and, and will run until it grows to 10, since each commands run, it grows by {INCREMENTAL/DECREMENTAL}, in that case 1.
+

Incremental short: i++

The last instruction can also be decremental: i = 1 -1 or i--

Example:

let numbers = 0
+for (let i = 1; i <=4; i++){
+    numbers++
+    console.log(numbers)
+} //It will print numbers from 1 to 4.
+

Multiplication table example:

let x = prompt("Number: ")
+
+for (let i = 1;  i <=10; i++){
+    let y = x * i
+    console.log(x + " * " + i + " = " + y)
+}
+
`,34),j={href:"https://replit.com/@GuilhermePetry/multiplication-table",target:"_blank",rel:"noopener noreferrer"},_=s("Run Multiplication Table on Replit"),S=e(`

Adding Conditional to for loops

for (let i = 1; i <1= 10; i++){
+	//command1
+	//command2
+	//command3
+	if (i % 2 == 0){
+		//command4
+	}
+}
+

while

It tests the conditional before, to see if it will run the commands or not.

Examples:

while (condition){
+	command
+} //While this condition is true, run {command}
+
let x = prompt("Number: ")
+while (x > 0) {
+    console.log("Oi")
+}
+

do... while

It executes the command at least once, even if the condition is not true.

Examples:

do {
+	command
+} while (condition);
+
let x = 0;
+
+do {
+    x++;
+    console.log(x)
+} while (x < 10)
+

break and continue

The break and continue are two commands that can be used inside JavaScript loops.

  • break: jumps out of a loop.
  • continue: jumps in the beginning of the loop.
while (condition1) {
+    commands
+    if (condition2) {
+        continue //It will test the condition and make the program continue in case of true.
+    }
+    commands
+    if (condition3) {
+        break //It breaks the loop, making the program ignore everything left inside the loop. If there is commands after the break, they will not be executed.
+    }
+    commands
+}
+commands
+

Example:

do {
+    const num = Number(prompt("Number: "))
+    if (num == 0 || isNaN(num)){
+        break
+    } else {
+        continue
+    }
+} while (true)
+

Counters and accumulators

Counters and accumulators are ways to track how many times a particular action or event has occurred. They are commonly used inside loops to count the number of iterations (iteration is a lap made by the program inside a loop or code block).

However, counters and accumulators are commonly used inside loops, they can also be used outside of loops, to count occurrences of an event or action that occurs multiple times in the program.

In JavaScript, counters and accumulators need to be initiated, usually receiving the value of 0. Since they are used to count cycles, you need to know how many cycles (iterations) it has done already, that is why to start a counter with 0.

Counters represent a variable = a variable + 1 (the count factor), accumulators represent a variable = a variable + another variable, and they can be written with the += operator.

Counter example:

let result = 0 //variable initiation
+result = result + 1 //traditional way
+result += 1 //with the += operator
+

Accumulator example:

let result = 0 //variable initiation
+result = result + price //traditional way
+result += price //with the += operator
+

Loop with counter example:

let counter = 0
+for (let i = 0; i < 10; i++) {
+  counter += 1
+  console.log(counter)
+}
+

8. Arrays

Different from variables, that hold only one data entry, arrays can hold many values. Its values can be the same as from the objects, all the JavaScript things.

Arrays can be declared with const even when your values may be changed. What const can't handle being essentially reassigned.

const arr = ["string1", "string2", 12] //Normal array of strings and number
+const newArray = new Array("string1", "string2", 12) //Used as constructor.
+

Array values are counted starting from 0 (zero) and the values are selected with its index number. Example:

const arr = ["string1", "string2", 12, 15, "string3"]
+
+console.log(arr[0])
+console.log(arr[1])
+console.log(arr[2])
+console.log(arr[3])
+console.log(arr[4])
+console.log(arr[5])
+
+//Value rewrite:
+arr[0] = "NewValue"
+

Array methods

  • arr.push() adds one, or more, elements to the end of the array and returns the new array lenght.
const arr = ["string1", "string2", 12, 15, "string3"]
+arr.push("one or", "more", "elements")
+
  • arr.pop() removes the last element of the array.
const arr = ["string1", "string2", 12, 15, "pop this one"]
+arr.pop()
+
  • arr.shift() removes the first element of the array.
const arr = ["shift this one", "string2", 12, 15, "pop this one"]
+arr.shift()
+
  • arr.unshift() adds one, or more, elements to the beginning of the array and returns the new array lenght.
const arr = ["string1", "string2", 12, 15, "string3"]
+arr.unshift("zero", "unshift", "test")
+
  • arr.splice() used to remove and replace elements.
const arr = ["string0", "string1", 2, 3, "remove 4", "remove 5"]
+arr.splice(4, 2) //Start position, number of elements to delete
+
+
+const arr = ["string0", "string1", 2, 3, "number this 4", "number this 5"]
+arr.splice(4, 2, "quatro", "cinco") //Start position, number os elements to replace, replace value, replace value.
+
  • arr.slice() select elements of an array in a new array.
const arr = ["string0", "string1", 2, 3, "quatro", "cinco", 6, 7, 8, 9, 10]
+arr.slice() //Copy the array
+arr.slice(2, 6) // Select elements from index 2 to 6
+
  • arr.map() expects a function as its argument. This function is then called for each element in the array.
const arr = [0, 1, 2, 3, 4, 5]
+const mappedArr = arr.map(plus)
+
+function plus(value, index, arr) {return value + 1}
+console.log(mappedArr)
+
  • arr.forEach() used for repetition loops. Run commands in each element of the array and saves results in the same array.
const arr = [0, 1, 2, 3, 4, 5]
+arr.forEach(plusFunction)
+
+function plusFunction(item, index, array) {
+    console.log(item + 1);
+}
+
+//with arrow function
+arr.forEach(item => {console.log(item + 1);})
+
  • arr.filter() creates a new array with all elements that pass the test implemented by the provided function.
const arr = [1, 2, 3, 4, 5, 6]
+const filteredArr = arr.filter(num => num > 3)
+console.log(filteredArr) // Output: [4, 5, 6]
+
  • arr.reduce() applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value.
const arr = [1, 2, 3, 4, 5]
+const sum = arr.reduce((total, value) => total + value, 0)
+console.log(sum) // Output: 15
+
  • arr.sort() sorts the elements of an array in place and returns the array.
const arr = [5, 2, 8, 1, 4]
+arr.sort()
+console.log(arr) // Output: [1, 2, 4, 5, 8]
+

Array properties

  • arr.length returns the number of elements.
  • arr.constructor returns the constructor function that created it.
  • arr.prototype don't really know, some cursed stuff.

Array of objects

{content in progress}

Locating content inside a array

The methods indexOf(), lastIndexOf(), and includes() are used to locate content inside arrays.

const arr = [0, 1, 2, 3, 4, 5]
+arr.indexOf(3) // Returns the index of the first occurrence of 3
+arr.lastIndexOf(3) // Returns the index of the last occurrence of 3
+arr.includes(3) // Returns true if the array contains 3
+

Cookies, local storage, session storage

{content in progress}

Node.js

JavaScript runs on browsers, as client side code. With Node.js you can run it as a server.

`,69),T={href:"https://nodejs.org/",target:"_blank",rel:"noopener noreferrer"},N=s("Node.js"),E=s("."),A=n("h3",{id:"prompt-sync",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#prompt-sync","aria-hidden":"true"},"#"),s(" prompt-sync")],-1),M={href:"https://github.com/heapwolf/prompt-sync",target:"_blank",rel:"noopener noreferrer"},I=s("prompt-sync"),L=s(" enables you to use "),O=n("code",null,"prompt",-1),C=s(" on the terminal."),D=e(`

It requires Node.js.

Run npm install prompt-sync. This will install node_modules and package.json.

On your JavaScript file:

const prompt = require("prompt-sync")();
+let promptData = prompt("Data: ")
+

On the terminal, open the folder where your JavaScript file is and run:

node <fileName>.js

`,6),B={href:"https://github.com/petry078/prompt-sync-template",target:"_blank",rel:"noopener noreferrer"},F=s("prompt-sync-template"),R=n("div",{class:"wisdom"},[n("img",{class:"wisdony",src:"https://upload.wikimedia.org/wikipedia/commons/1/17/RWS_Tarot_19_Sun.jpg",alt:""})],-1);function H(P,J){const a=p("ExternalLinkIcon");return c(),i("div",null,[u,r,d,k,m,n("blockquote",null,[n("p",null,[v,n("a",b,[g,t(a)])])]),h,n("blockquote",null,[n("p",null,[f,n("a",y,[q,t(a)]),w])]),x,n("blockquote",null,[n("p",null,[n("a",j,[_,t(a)])])]),S,n("blockquote",null,[n("p",null,[n("a",T,[N,t(a)]),E])]),A,n("p",null,[n("a",M,[I,t(a)]),L,O,C]),D,n("blockquote",null,[n("p",null,[n("a",B,[F,t(a)])])]),R])}var U=o(l,[["render",H],["__file","javascript-references.html.vue"]]);export{U as default}; diff --git a/assets/javascript-references.html.eb9dad91.js b/assets/javascript-references.html.eb9dad91.js new file mode 100644 index 0000000..652d0f8 --- /dev/null +++ b/assets/javascript-references.html.eb9dad91.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5f5834b4","path":"/posts/javascript-references.html","title":"JavaScript cast specification","lang":"en-US","frontmatter":{"title":"JavaScript cast specification","date":"2022-08-20","sidebar":"auto","tags":["javascript","ecmascript","reference"]},"excerpt":"","headers":[{"level":2,"title":"1. Objects","slug":"_1-objects","children":[{"level":3,"title":"Primitive Values","slug":"primitive-values","children":[]},{"level":3,"title":"Functions","slug":"functions","children":[]}]},{"level":2,"title":"2. Strings and Numbers","slug":"_2-strings-and-numbers","children":[{"level":3,"title":"Template strings","slug":"template-strings","children":[]},{"level":3,"title":"String formatting","slug":"string-formatting","children":[]}]},{"level":2,"title":"3. Operators","slug":"_3-operators","children":[{"level":3,"title":"Arithmetic operators","slug":"arithmetic-operators","children":[]},{"level":3,"title":"Assignment operators","slug":"assignment-operators","children":[]},{"level":3,"title":"Comparison operators","slug":"comparison-operators","children":[]},{"level":3,"title":"Logical operators","slug":"logical-operators","children":[]},{"level":3,"title":"Conditional or Ternary operators","slug":"conditional-or-ternary-operators","children":[]}]},{"level":2,"title":"4. Document Object Model (DOM)","slug":"_4-document-object-model-dom","children":[{"level":3,"title":"Selectors","slug":"selectors","children":[]},{"level":3,"title":"innerText and innerHTML","slug":"innertext-and-innerhtml","children":[]},{"level":3,"title":"DOM Events","slug":"dom-events","children":[]}]},{"level":2,"title":"5. Math functions","slug":"_5-math-functions","children":[{"level":3,"title":"Rounding numbers","slug":"rounding-numbers","children":[]},{"level":3,"title":"Generating random numbers","slug":"generating-random-numbers","children":[]},{"level":3,"title":"Examples","slug":"examples","children":[]}]},{"level":2,"title":"6. Conditionals","slug":"_6-conditionals","children":[{"level":3,"title":"if...else","slug":"if-else","children":[]},{"level":3,"title":"switch...case","slug":"switch-case","children":[]}]},{"level":2,"title":"7. Repetitions (Loops)","slug":"_7-repetitions-loops","children":[{"level":3,"title":"for","slug":"for","children":[]},{"level":3,"title":"while","slug":"while","children":[]},{"level":3,"title":"do... while","slug":"do-while","children":[]},{"level":3,"title":"break and continue","slug":"break-and-continue","children":[]},{"level":3,"title":"Counters and accumulators","slug":"counters-and-accumulators","children":[]}]},{"level":2,"title":"8. Arrays","slug":"_8-arrays","children":[{"level":3,"title":"Array methods","slug":"array-methods","children":[]},{"level":3,"title":"Array properties","slug":"array-properties","children":[]},{"level":3,"title":"Array of objects","slug":"array-of-objects","children":[]},{"level":3,"title":"Locating content inside a array","slug":"locating-content-inside-a-array","children":[]}]},{"level":2,"title":"Cookies, local storage, session storage","slug":"cookies-local-storage-session-storage","children":[]},{"level":2,"title":"Node.js","slug":"node-js","children":[{"level":3,"title":"prompt-sync","slug":"prompt-sync","children":[]}]}],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"posts/javascript-references.md"}');export{e as data}; diff --git a/assets/kali-metasploitable-virtualbox.html.2cf9bdb1.js b/assets/kali-metasploitable-virtualbox.html.2cf9bdb1.js new file mode 100644 index 0000000..432851b --- /dev/null +++ b/assets/kali-metasploitable-virtualbox.html.2cf9bdb1.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-6801703b","path":"/posts/kali-metasploitable-virtualbox.html","title":"Set up Kali Linux and Metasploitable on VirtualBox","lang":"en-US","frontmatter":{"title":"Set up Kali Linux and Metasploitable on VirtualBox","date":"2023-03-03","sidebar":"auto","tags":["kali","kali linux","metasploit framework","metasploitable","metasploitable2","virtualbox"]},"excerpt":"","headers":[{"level":2,"title":"1: Download","slug":"_1-download","children":[]},{"level":2,"title":"2: Kali Linux virtual machine","slug":"_2-kali-linux-virtual-machine","children":[]},{"level":2,"title":"3: Metasploitable virtual machine","slug":"_3-metasploitable-virtual-machine","children":[]},{"level":2,"title":"4: Virtual machines network configuration","slug":"_4-virtual-machines-network-configuration","children":[]}],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"posts/kali-metasploitable-virtualbox.md"}');export{t as data}; diff --git a/assets/kali-metasploitable-virtualbox.html.663d8145.js b/assets/kali-metasploitable-virtualbox.html.663d8145.js new file mode 100644 index 0000000..8b282c0 --- /dev/null +++ b/assets/kali-metasploitable-virtualbox.html.663d8145.js @@ -0,0 +1 @@ +import{_ as t,r as a,o as c,c as d,a as e,b as l,d as i,e as n}from"./app.03d0ed6d.js";const r={},s=e("h1",{id:"set-up-kali-linux-and-metasploitable-on-virtualbox",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#set-up-kali-linux-and-metasploitable-on-virtualbox","aria-hidden":"true"},"#"),i(" Set up Kali Linux and Metasploitable on VirtualBox")],-1),h=e("h2",{id:"_1-download",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#_1-download","aria-hidden":"true"},"#"),i(" 1: Download")],-1),u={href:"https://www.virtualbox.org/",target:"_blank",rel:"noopener noreferrer"},k=i("VirtualBox"),m=i("."),p={href:"https://www.kali.org/get-kali/#kali-virtual-machines",target:"_blank",rel:"noopener noreferrer"},_=i("Kali Linux"),b=i("."),x={href:"https://sourceforge.net/projects/metasploitable/",target:"_blank",rel:"noopener noreferrer"},v=i("Metasploitable"),w=i("."),g=n('

Extract Kali and Metasploitable to the same directory.

Inside the directory, locate the files kali-linux-2022.4-virtualbox-amd64.vdi and Metasploitable.vmdk, make sure you know where they are.

2: Kali Linux virtual machine

  1. Open VirtualBox and click New.
  2. Give it a name. On Machine Folder select the directory you extracted Kali and Metasploitable.
  3. In Type select Linux.
  4. In Version select Debian (64-bit).
  5. Click Next.
  6. Define its memory.
  7. Select Create a virtual hard disk now.
  8. Select VDI (VirtualBox Disk Image).
  9. Select Dynamically allocated.
  10. 8 GB is fine I guess...
  11. Click Create.

Now, you need to add the kali-linux-2022.4-virtualbox-amd64.vdi to the new virtual machine:

  1. Right-click the new virtual machine and click Settings.
  2. Go to Storage.
  3. Find and click in kali-linux-2022.4-virtualbox-amd64.vdi below Controller: SATA.
  4. At your right, in Attributes, you will find a small disk icon. Click on it!
  5. Select Choose/Create a Virtual Hard Disk.
  6. Select kali-linux-2022.4-virtualbox-amd64.vdi.
  7. Click Ok.

3: Metasploitable virtual machine

  1. Open VirtualBox and click New.
  2. Give it a name. On Machine Folder select the directory you extracted Kali and Metasploitable.
  3. In Type select Linux.
  4. In Version select Debian (64-bit).
  5. Click Next.
  6. Define its memory.
  7. Select Create a virtual hard disk now.
  8. Select VDI (VirtualBox Disk Image).
  9. Select Dynamically allocated.
  10. 8 GB is fine I guess...
  11. Click Create.

Now, you need to add the Metasploitable.vmdk to the new virtual machine:

  1. Right-click the new virtual machine and click Settings.
  2. Go to Storage.
  3. Find and click in Metasploitable.vmdk below Controller: SATA.
  4. At your right, in Attributes, you will find a small disk icon. Click on it!
  5. Select Choose/Create a Virtual Hard Disk.
  6. Select Metasploitable.vmdk.
  7. Click Ok.

4: Virtual machines network configuration

Don't forget to change the network config from NAT to Bridge Adapter on both virtual machines. Otherwise, Metasploitable won't be able to host:

  1. Right-click the new virtual machine and click Settings.
  2. Go to Network.
  3. On Attached to select Bridge Adapter.
  4. Click Ok.

I guess this is high cyber witchery already...

',15);function f(y,C){const o=a("ExternalLinkIcon");return c(),d("div",null,[s,h,e("ul",null,[e("li",null,[e("a",u,[k,l(o)]),m]),e("li",null,[e("a",p,[_,l(o)]),b]),e("li",null,[e("a",x,[v,l(o)]),w])]),g])}var V=t(r,[["render",f],["__file","kali-metasploitable-virtualbox.html.vue"]]);export{V as default}; diff --git a/assets/latex-pdf-press.html.551b5711.js b/assets/latex-pdf-press.html.551b5711.js new file mode 100644 index 0000000..126ffc3 --- /dev/null +++ b/assets/latex-pdf-press.html.551b5711.js @@ -0,0 +1,99 @@ +import{_ as o,r as c,o as i,c as l,a as e,b as a,e as t,d as n}from"./app.03d0ed6d.js";const p={},d=t(`

LaTeX PDF press specification

LaTeX is a powerful typesetting markup language, designed to make beautiful and readable printable documents.

Learn LaTeX is great because its old school, free and stable. You will never need to open shit and slow Google Docs, Microsoft Word and even Adobe inDesign, which are all private softwares.

LaTeX documents have to be written and than compiled. Write content using LaTeX markup syntax and than press it to PDF with the command:

pdflatex fileName.tex
+

To Press PDFs using LaTeX you need to have TeX installed.

sudo apt-get install texlive-full
+tex --version
+
`,7),r=n("Complicate stuff? "),u={href:"https://www.overleaf.com",target:"_blank",rel:"noopener noreferrer"},h=n("Overleaf"),m=n(", the LaTeX web editor and compiler got you there."),k=t(`

The syntax is divided by the preamble, the content and bibliographic references.

There are also some reserved characters:

CharacterDefinition
#Macro key.
$Mathematical environment.
%Comment.
^Superscript.
&Separation of columns in tables.
_Automatic subscript.
{}Scope.
~Space between text that cannot be broken.
\\Command initialization.

To print then, use \\ before. Example: \\#.

The preamble

The preamble is where you will define the structure, styles, aditional packages, rules, metadata, and other general configuration. This configurations will apply to the document as a whole.

The first command of the preamble is \\documentclass[]{} that will set the document class and its own parameters.

Here are the preamble commands discovered:

CommandDefinition
\\documentclass[]{}Initialize the document. Requires parameters [] and actual document class {}.
\\usepackage[]{}Import and use packages with additional functionality. Requires parameters [] and scope {}.
\\setlength{\\parindent}{0cm}Set paragraph identation.
\\setlength{\\parskip}{2em}Set space between paragraphs.
\\renewcommand{\\baselinestretch}{1.5}Space between lines.
\\title{Document title}Define title of the document.
\\author{Document author}Define author of the document.
\\date{Document date}Define date of the document.

\\documentclass

\\documentcalss parameters[], or parameters in genereal, are optionals and will change based on the actual class and command, that can be:

\\documentclass{article}
+\\documentclass{report}
+\\documentclass{book}
+\\documentclass{letter}
+\\documentclass{slides}
+\\documentclass{beamer}
+

\\documentclass parameters:

\\documentclass[12pt]{}
+\\documentclass[a4paper]{}
+\\documentclass[twocolumn]{}
+\\documentclass[twoside]{}
+\\documentclass[landscape]{}
+

\\usepackage

The \\usepackage commands imports aditional packages and features. Here are some examples:

\\usepackage[utf8]{inputenc}
+\\usepackage[portuguese]{babel}
+\\usepackage{graphicx}
+\\usepackage{url}
+

The content

Content commands are only allowed in the document scope:

\\begin{document}
+Content and content commands go here! Like \\LaTeX!
+\\end{document}
+
+
CommandDefinition
\\parNew paragraph
\\\\Line break, necessary on blank lines
\\textbf{Bold example}Bold text.
\\textit{Italic example}Italic text.
\\underline{Underline example}Underlined text.
\\begin{center}Text align: center. Requires \`\\end{center}
\\begin{flushright}Text align: right. Requires \`\\end{flushright}
\\newpage or \\clearpagePage break. Needs test, as they work diffrently.
\\vspace{4cm}Add vertical space between elements in line.
\\hspace{4cm}Add horizontal space between elements in line.
\\hfill and \\vfillFill horizontal and vertical space between elements in line.
\\begin{itemize} or \\begin{enumerate}Iniciates unordered or ordered list. Requires \\end{itemize} or \\end{enumerate}. For list item: \\item.
\\begin{figure}Iniciates image with standard snippet. Requires graphicx package \\usepackage{graphicx} in the document header.
\\begin{tabular}Iniciates image with standard snippet. Requires graphicx package \\usepackage{graphicx} in the document header.
\\begin{titlepage}Iniciate title page. Requires \\end{titlepage}. See example below.
\\tableofcontentsPrint table of contents. Nice to have \\newpage after the summary.
\\listoffiguresPrint figures list.
\\listoftablesPrint figures list.

Content techniques

Content techniques are commands used inside the content scope.

Paragraphs, chapters, sections, and subsections

A blank line and \\par after the text represent paragraph.

Paragraph 1
+
+Paragraph 2
+
+Paragraph 3\\par
+Paragraph 4\\par
+

For a simple line break, use \\\\ or \\newline at the end of the paragraph, or in a single line.

Simple line break\\\\
+Newline \\newline
+

Chapters, sections, and subsections:

\\chapter{Chapter 1}
+\\section{Chapter 1, Section 1}
+\\section{Chapter 1, Section 2}
+\\subsection{Chapter 1, Section 2, Subsection 1}
+\\section{Chapter 1, Section 3}
+\\subsection{Chapter 1, Section 3, Subsection 1}
+\\subsection{Chapter 1, Section 3, Subsection 2}
+

Horizontal and vertical spacing of elements

Whitespaces after commands are ignored. To print then, type the whitespace inside the commands scope {}. Example: textbf{text }.

\\hfill and \\hspace{3cm} examples:

Grape\\hfill100g
+1\\hspace{1cm}2\\hspace{1cm}3\\hspace{1cm}4\\hspace{1cm}
+

For vertical stuff, same thing, but \\vspace{1cm} and \\vfill.

Font size and style

Inline font size and style:

\\tiny{tiny text}\\\\
+\\scriptsize{scriptsize text}\\\\
+\\footnotesize{footnotesize text}\\\\
+\\small{small text}\\\\
+\\normalsize{normalsize text}\\\\
+\\large{large text}\\\\
+\\Large{Large text}\\\\
+\\LARGE{LARGE text}\\\\
+\\huge{huge text}\\\\
+\\Huge{Huge text}\\\\
+
+\\textrm{Roman Serif font}\\\\
+\\textsf{Sans Serif font}\\\\
+\\texttt{Monospaced font (typewriter)}\\\\
+

Any text style + any nother text style:

\\underline{\\textbf{\\textit{Underlined, bold, and italic text}}}
+

Lists

Unordered list:

\\begin{itemize}
+\\item 1
+\\item 2
+\\item 3
+\\item 4
+\\end{itemize}
+

Ordered list:

\\begin{enumerate}
+\\item 1
+\\item 2
+\\item 3
+\\item 4
+\\end{enumerate}
+

Images

Images are called figures in LaTeX, type \\begin{figure} and it should autocomplete to this:

\\begin{figure}
+    \\centering
+    \\includegraphics[scale=0.5]{imageExample.png}
+    \\caption{Caption text}
+    \\label{fig:enter-label}
+\\end{figure}
+

Tables

Not gonna lie, tables are complicated.

Titlepage

\\begin{titlepage}
+\\centering
+\\Huge{\\textbf{University of Chaos}}
+\\vfill
+\\huge{My very long article title}
+\\vfill
+\\large{\\textbf{Alum: Guilherme Petry}}
+\\vfill
+\\today
+\\end{titlepage}
+

Table of contents (TOC)

Just call \\tableofcontents where you want it to be printed.

Use * in the end of markup to avoid it beeing indexed by the \\tableofcontents. Example: \\section*{Chapter 1, Section 1}

Footnotes

Primeiro par\xE1grafo do cap\xEDtulo 1, se\xE7\xE3o 3 e subse\xE7\xE3o 2\\footnote{Nota de rodap\xE91}\\par
+Segundo par\xE1grafo do cap\xEDtulo 1, se\xE7\xE3o 3 e subse\xE7\xE3o 2\\footnote{Nota de rodap\xE92}\\par
+

Quotes

\\begin{quote}
+
+\\end{quote}
+

Bibliographic references

Bibliographic references in LaTeX requires the natbib package and the references file should be in bibTeX, or .bib.

Instanciate the bliblopgraphy:

\\bibliography{referencias}
+\\bibliographystyle{plainnat}
+

bibTeX bibliography example:

@book{de1999santa,
+  title={Santa Ifig{\\^e}nia},
+  author={de Athayde Jorge, C.},
+  lccn={99887098},
+  series={S{\\'e}rie Hist{\\'o}ria dos bairros de S{\\~a}o Paulo},
+  url={https://books.google.com.br/books?id=SDgsAAAAYAAJ},
+  year={1999},
+  publisher={Departamento do Patrim{\\^o}nio Hist{\\'o}rico}
+}
+

On text, call reference with \\cite{referenceOfBibliography}. The referenceOfBibliography in the example is de1999santa.

Google Books offers bibTeX references like this!

ABNT

Now!

References \u{1F5A8}\uFE0F \u{1F5A8}

`,70),b={href:"https://linorg.usp.br/CTAN/info/lshort/english/lshort.pdf",target:"_blank",rel:"noopener noreferrer"},v=n("The Not So Short Introduction to LATEX 2\u03B5Beguinners book"),f={href:"https://www.overleaf.com/learn/latex/Learn_LaTeX_in_30_minutes#What_is_LaTeX?",target:"_blank",rel:"noopener noreferrer"},g=n("Learn LaTeX in 30 minutes"),x={href:"https://github.com/abntex/abntex2/wiki/InstalacaoLinux#instala%C3%A7%C3%A3o-autom%C3%A1tica-do-texlive-e-do-abntex2-em-distribui%C3%A7%C3%B5es-debian-ubuntu-e-derivadas-recomendado",target:"_blank",rel:"noopener noreferrer"},y=n("abntex2"),w=n("Curso em Portugu\xEAs: "),_={href:"https://youtube.com/playlist?list=PLt2qoMeOJsQzWsM5vM7eWFUZKVbCZmWZB&si=M8rouIXyLS7dUfrb",target:"_blank",rel:"noopener noreferrer"},T=n("Prepara\xE7\xE3o de Documentos em LaTeX"),C=e("div",{class:"wisdom"},[e("img",{class:"wisdony",src:"https://upload.wikimedia.org/wikipedia/commons/a/ae/Cups07.jpg",alt:""})],-1);function S(L,P){const s=c("ExternalLinkIcon");return i(),l("div",null,[d,e("blockquote",null,[e("p",null,[r,e("a",u,[h,a(s)]),m])]),k,e("ul",null,[e("li",null,[e("a",b,[v,a(s)])]),e("li",null,[e("a",f,[g,a(s)])]),e("li",null,[e("a",x,[y,a(s)])]),e("li",null,[w,e("a",_,[T,a(s)])])]),C])}var A=o(p,[["render",S],["__file","latex-pdf-press.html.vue"]]);export{A as default}; diff --git a/assets/latex-pdf-press.html.5e865e84.js b/assets/latex-pdf-press.html.5e865e84.js new file mode 100644 index 0000000..6873b33 --- /dev/null +++ b/assets/latex-pdf-press.html.5e865e84.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-04a11941","path":"/posts/latex-pdf-press.html","title":"LaTeX PDF press specification","lang":"en-US","frontmatter":{"title":"LaTeX PDF press specification","date":"2024-01-09","sidebar":"auto","tags":["LaTeX","TeX","PDF"]},"excerpt":"","headers":[{"level":2,"title":"The preamble","slug":"the-preamble","children":[{"level":3,"title":"\\\\documentclass","slug":"documentclass","children":[]},{"level":3,"title":"\\\\usepackage","slug":"usepackage","children":[]}]},{"level":2,"title":"The content","slug":"the-content","children":[]},{"level":2,"title":"Content techniques","slug":"content-techniques","children":[{"level":3,"title":"Paragraphs, chapters, sections, and subsections","slug":"paragraphs-chapters-sections-and-subsections","children":[]},{"level":3,"title":"Horizontal and vertical spacing of elements","slug":"horizontal-and-vertical-spacing-of-elements","children":[]},{"level":3,"title":"Font size and style","slug":"font-size-and-style","children":[]},{"level":3,"title":"Lists","slug":"lists","children":[]},{"level":3,"title":"Images","slug":"images","children":[]},{"level":3,"title":"Tables","slug":"tables","children":[]},{"level":3,"title":"Titlepage","slug":"titlepage","children":[]},{"level":3,"title":"Table of contents (TOC)","slug":"table-of-contents-toc","children":[]},{"level":3,"title":"Footnotes","slug":"footnotes","children":[]},{"level":3,"title":"Quotes","slug":"quotes","children":[]}]},{"level":2,"title":"Bibliographic references","slug":"bibliographic-references","children":[]},{"level":2,"title":"ABNT","slug":"abnt","children":[]},{"level":2,"title":"References \u{1F5A8}\uFE0F \u{1F5A8}","slug":"references-\u{1F5A8}\uFE0F-\u{1F5A8}","children":[]}],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"posts/latex-pdf-press.md"}');export{e as data}; diff --git a/assets/markdown-cheat-sheet.html.29b17839.js b/assets/markdown-cheat-sheet.html.29b17839.js new file mode 100644 index 0000000..c963507 --- /dev/null +++ b/assets/markdown-cheat-sheet.html.29b17839.js @@ -0,0 +1,31 @@ +import{_ as e,o as i,c as n,e as t}from"./app.03d0ed6d.js";const d={},l=t(`

Markdown cheat sheet

| Markup syntax    | Name                            | Description & Examples            |
+|------------------|---------------------------------|-----------------------------------|
+| #                | Heading 1 <h1>                  | # H1                              |
+| ##               | Heading 2 <h2>                  | ## H2                             |
+| ###              | Heading 3 <h3>                  | ### H3                            |   
+| ####             | Heading 4 <h4>                  | #### H4                           | 
+| #####            | Heading 5 <h5>                  | ##### H5                          |  
+| ######           | Heading 6 <h6>                  | ###### H6                         | 
+| **bold**         | Bold                            | **Bold** example                  |
+| *italic*         | Italic                          | *Italic* example                  | 
+| ---              | Line <hr>                       | Line break (*** ___ )             |
+| >                | Quote/Comment                   | > Comment styled line             |
+| *                | Unordered list item             | * List item (- + are alternatives)|
+| 1.               | Number ordered list item        | 1. Just like this!                |
+| a.               | Character ordered list item     | a. Character styled list          |
+| - [ ] text       | Unmarked to-do list item        | Create to-do lists                |
+| - [x] text       | Checkd to-do list item          | This one is a checked [\u2714] box     |
+| \`\`\`code\`\`\`       | Code                            | \`\`\`Code styled line/block\`\`\`      | 
+| [text](URL)      | Hyperlink                       | [Download here!](URL)             |
+| ![alt text](URL) | Image                           | ![altText](URL)                   |
+| \\                | Disable Markdown style          | Use before \`\`\` * # - + ! |        |
+|------------------|---------------------------------|-----------------------------------|
+|                                                                                        |
+|                                 text-align on tables                                   |
+|                                                                                        |
+|               | text-align: left | text-align: center | text-align: right |            |
+|               |:-----------------|:------------------:|------------------:|            |
+|               | text             |        text        |              text |            |
+|                                                                                        |
+
+
`,3),s=[l];function a(r,c){return i(),n("div",null,s)}var m=e(d,[["render",a],["__file","markdown-cheat-sheet.html.vue"]]);export{m as default}; diff --git a/assets/markdown-cheat-sheet.html.b6a5efec.js b/assets/markdown-cheat-sheet.html.b6a5efec.js new file mode 100644 index 0000000..338d5a4 --- /dev/null +++ b/assets/markdown-cheat-sheet.html.b6a5efec.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-09db1bdd","path":"/posts/markdown-cheat-sheet.html","title":"Markdown cheat sheet","lang":"en-US","frontmatter":{"title":"Markdown cheat sheet","date":"2022-07-21","sidebar":false,"tags":["markdown","vuepress","tables"]},"excerpt":"","headers":[],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"posts/markdown-cheat-sheet.md"}');export{e as data}; diff --git a/assets/search.0782d0d1.svg b/assets/search.0782d0d1.svg new file mode 100644 index 0000000..03d8391 --- /dev/null +++ b/assets/search.0782d0d1.svg @@ -0,0 +1 @@ + diff --git a/assets/style.0cdbf2e7.css b/assets/style.0cdbf2e7.css new file mode 100644 index 0000000..e316c4d --- /dev/null +++ b/assets/style.0cdbf2e7.css @@ -0,0 +1 @@ +main{min-height:94vh}.wisdom{display:flex;justify-content:center}.wisdony{height:120px}@import url(https://fonts.googleapis.com/css2?family=Inconsolata&display=swap);:root{--back-to-top-z-index: 5;--back-to-top-color: #3eaf7c;--back-to-top-color-hover: #71cda3}.back-to-top{cursor:pointer;position:fixed;bottom:2rem;right:2.5rem;width:2rem;height:1.2rem;background-color:var(--back-to-top-color);-webkit-mask:url(/assets/back-to-top.8efcbe56.svg) no-repeat;mask:url(/assets/back-to-top.8efcbe56.svg) no-repeat;z-index:var(--back-to-top-z-index)}.back-to-top:hover{background-color:var(--back-to-top-color-hover)}@media (max-width: 959px){.back-to-top{display:none}}.back-to-top-enter-active,.back-to-top-leave-active{transition:opacity .3s}.back-to-top-enter-from,.back-to-top-leave-to{opacity:0}:root{--external-link-icon-color: #aaa}.external-link-icon{position:relative;display:inline-block;color:var(--external-link-icon-color);vertical-align:middle;top:-1px}.external-link-icon-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}:root{--medium-zoom-z-index: 100;--medium-zoom-bg-color: #ffffff;--medium-zoom-opacity: 1}.medium-zoom-overlay{background-color:var(--medium-zoom-bg-color)!important;z-index:var(--medium-zoom-z-index)}.medium-zoom-overlay~img{z-index:calc(var(--medium-zoom-z-index) + 1)}.medium-zoom--opened .medium-zoom-overlay{opacity:var(--medium-zoom-opacity)}:root{--nprogress-color: #29d;--nprogress-z-index: 1031}#nprogress{pointer-events:none}#nprogress .bar{background:var(--nprogress-color);position:fixed;z-index:var(--nprogress-z-index);top:0;left:0;width:100%;height:2px}:root{--c-brand: #3eaf7c;--c-brand-light: #4abf8a;--c-bg: #ffffff;--c-bg-light: #f3f4f5;--c-bg-lighter: #eeeeee;--c-bg-navbar: var(--c-bg);--c-bg-sidebar: var(--c-bg);--c-bg-arrow: #cccccc;--c-text: #2c3e50;--c-text-accent: var(--c-brand);--c-text-light: #3a5169;--c-text-lighter: #4e6e8e;--c-text-lightest: #6a8bad;--c-text-quote: #999999;--c-border: #eaecef;--c-border-dark: #dfe2e5;--c-tip: #42b983;--c-tip-bg: var(--c-bg-light);--c-tip-title: var(--c-text);--c-tip-text: var(--c-text);--c-tip-text-accent: var(--c-text-accent);--c-warning: #e7c000;--c-warning-bg: #fffae3;--c-warning-title: #ad9000;--c-warning-text: #746000;--c-warning-text-accent: var(--c-text);--c-danger: #cc0000;--c-danger-bg: #ffe0e0;--c-danger-title: #990000;--c-danger-text: #660000;--c-danger-text-accent: var(--c-text);--c-details-bg: #eeeeee;--c-badge-tip: var(--c-tip);--c-badge-warning: var(--c-warning);--c-badge-danger: var(--c-danger);--t-color: .3s ease;--t-transform: .3s ease;--code-bg-color: #282c34;--code-hl-bg-color: rgba(0, 0, 0, .66);--code-ln-color: #9e9e9e;--code-ln-wrapper-width: 3.5rem;--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--font-family-code: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;--navbar-height: 3.6rem;--navbar-padding-v: .7rem;--navbar-padding-h: 1.5rem;--sidebar-width: 20rem;--sidebar-width-mobile: calc(var(--sidebar-width) * .82);--content-width: 740px;--homepage-width: 960px}.back-to-top{--back-to-top-color: var(--c-brand);--back-to-top-color-hover: var(--c-brand-light)}.DocSearch{--docsearch-primary-color: var(--c-brand);--docsearch-text-color: var(--c-text);--docsearch-highlight-color: var(--c-brand);--docsearch-muted-color: var(--c-text-quote);--docsearch-container-background: rgba(9, 10, 17, .8);--docsearch-modal-background: var(--c-bg-light);--docsearch-searchbox-background: var(--c-bg-lighter);--docsearch-searchbox-focus-background: var(--c-bg);--docsearch-searchbox-shadow: inset 0 0 0 2px var(--c-brand);--docsearch-hit-color: var(--c-text-light);--docsearch-hit-active-color: var(--c-bg);--docsearch-hit-background: var(--c-bg);--docsearch-hit-shadow: 0 1px 3px 0 var(--c-border-dark);--docsearch-footer-background: var(--c-bg)}.external-link-icon{--external-link-icon-color: var(--c-text-quote)}.medium-zoom-overlay{--medium-zoom-bg-color: var(--c-bg)}#nprogress{--nprogress-color: var(--c-brand)}.pwa-popup{--pwa-popup-text-color: var(--c-text);--pwa-popup-bg-color: var(--c-bg);--pwa-popup-border-color: var(--c-brand);--pwa-popup-shadow: 0 4px 16px var(--c-brand);--pwa-popup-btn-text-color: var(--c-bg);--pwa-popup-btn-bg-color: var(--c-brand);--pwa-popup-btn-hover-bg-color: var(--c-brand-light)}.search-box{--search-bg-color: var(--c-bg);--search-accent-color: var(--c-brand);--search-text-color: var(--c-text);--search-border-color: var(--c-border);--search-item-text-color: var(--c-text-lighter);--search-item-focus-bg-color: var(--c-bg-light)}html.dark{--c-brand: #3aa675;--c-brand-light: #349469;--c-bg: #22272e;--c-bg-light: #2b313a;--c-bg-lighter: #262c34;--c-text: #adbac7;--c-text-light: #96a7b7;--c-text-lighter: #8b9eb0;--c-text-lightest: #8094a8;--c-border: #3e4c5a;--c-border-dark: #34404c;--c-tip: #318a62;--c-warning: #ceab00;--c-warning-bg: #7e755b;--c-warning-title: #ceac03;--c-warning-text: #362e00;--c-danger: #940000;--c-danger-bg: #806161;--c-danger-title: #610000;--c-danger-text: #3a0000;--c-details-bg: #323843;--code-hl-bg-color: #363b46}html.dark .DocSearch{--docsearch-logo-color: var(--c-text);--docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;--docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 2px 2px 0 rgba(3, 4, 9, .3);--docsearch-key-gradient: linear-gradient(-225deg, #444950, #1c1e21);--docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, .5), 0 -4px 8px 0 rgba(0, 0, 0, .2)}html,body{padding:0;margin:0;background-color:var(--c-bg);transition:background-color var(--t-color)}html.dark{color-scheme:dark}html{font-size:16px}body{font-family:var(--font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:1rem;color:var(--c-text)}a{font-weight:500;color:var(--c-text-accent);text-decoration:none;overflow-wrap:break-word}p a code{font-weight:400;color:var(--c-text-accent)}kbd{font-family:var(--font-family-code);color:var(--c-text);background:var(--c-bg-lighter);border:solid .15rem var(--c-border-dark);border-bottom:solid .25rem var(--c-border-dark);border-radius:.15rem;padding:0 .15em}code{font-family:var(--font-family-code);color:var(--c-text-lighter);padding:.25rem .5rem;margin:0;font-size:.85em;background-color:var(--c-bg-lighter);border-radius:3px;overflow-wrap:break-word;transition:background-color var(--t-color)}blockquote{font-size:1rem;color:var(--c-text-quote);border-left:.2rem solid var(--c-border-dark);margin:1rem 0;padding:.25rem 0 .25rem 1rem}blockquote>p{margin:0}ul,ol{padding-left:1.2em}strong{font-weight:600}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25}h1:focus-visible,h2:focus-visible,h3:focus-visible,h4:focus-visible,h5:focus-visible,h6:focus-visible{outline:none}h1:hover .header-anchor,h2:hover .header-anchor,h3:hover .header-anchor,h4:hover .header-anchor,h5:hover .header-anchor,h6:hover .header-anchor{opacity:1}h1{font-size:2.2rem}h2{font-size:1.65rem;padding-bottom:.3rem;border-bottom:1px solid var(--c-border);transition:border-color var(--t-color)}h3{font-size:1.35rem}h4{font-size:1.15rem}h5{font-size:1.05rem}h6{font-size:1rem}a.header-anchor{font-size:.85em;float:left;margin-left:-.87em;padding-right:.23em;margin-top:.125em;opacity:0}a.header-anchor:hover{text-decoration:none}a.header-anchor:focus-visible{opacity:1}p,ul,ol{line-height:1.7}hr{border:0;border-top:1px solid var(--c-border)}table{border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto;transition:border-color var(--t-color)}tr{border-top:1px solid var(--c-border-dark);transition:border-color var(--t-color)}tr:nth-child(2n){background-color:var(--c-bg-light);transition:background-color var(--t-color)}th,td{padding:.6em 1em;border:1px solid var(--c-border-dark);transition:border-color var(--t-color)}.arrow{display:inline-block;width:0;height:0}.arrow.up{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:6px solid var(--c-bg-arrow)}.arrow.down{border-left:4px solid transparent;border-right:4px solid transparent;border-top:6px solid var(--c-bg-arrow)}.arrow.right{border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:6px solid var(--c-bg-arrow)}.arrow.left{border-top:4px solid transparent;border-bottom:4px solid transparent;border-right:6px solid var(--c-bg-arrow)}.badge{display:inline-block;font-size:14px;height:18px;line-height:18px;border-radius:3px;padding:0 6px;color:var(--c-bg);vertical-align:top;transition:color var(--t-color),background-color var(--t-color)}.badge.tip{background-color:var(--c-badge-tip)}.badge.warning{background-color:var(--c-badge-warning)}.badge.danger{background-color:var(--c-badge-danger)}.badge+.badge{margin-left:5px}code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:var(--font-family-code);font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.block-comment,.token.prolog,.token.doctype,.token.cdata{color:#999}.token.punctuation{color:#ccc}.token.tag,.token.attr-name,.token.namespace,.token.deleted{color:#ec5975}.token.function-name{color:#6196cc}.token.boolean,.token.number,.token.function{color:#f08d49}.token.property,.token.class-name,.token.constant,.token.symbol{color:#f8c555}.token.selector,.token.important,.token.atrule,.token.keyword,.token.builtin{color:#cc99cd}.token.string,.token.char,.token.attr-value,.token.regex,.token.variable{color:#7ec699}.token.operator,.token.entity,.token.url{color:#67cdcc}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:#3eaf7c}.theme-default-content pre,.theme-default-content pre[class*=language-]{line-height:1.4;padding:1.3rem 1.5rem;margin:.85rem 0;border-radius:6px;overflow:auto}.theme-default-content pre code,.theme-default-content pre[class*=language-] code{color:#fff;padding:0;background-color:transparent;border-radius:0;overflow-wrap:unset;-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.theme-default-content .line-number{font-family:var(--font-family-code)}div[class*=language-]{position:relative;background-color:var(--code-bg-color);border-radius:6px}div[class*=language-]:before{position:absolute;z-index:3;top:.8em;right:1em;font-size:.75rem;color:var(--code-ln-color)}div[class*=language-] pre,div[class*=language-] pre[class*=language-]{background:transparent!important;position:relative;z-index:1}div[class*=language-] .highlight-lines{-webkit-user-select:none;-moz-user-select:none;user-select:none;padding-top:1.3rem;position:absolute;top:0;left:0;width:100%;line-height:1.4}div[class*=language-] .highlight-lines .highlight-line{background-color:var(--code-hl-bg-color)}div[class*=language-]:not(.line-numbers-mode) .line-numbers{display:none}div[class*=language-].line-numbers-mode .highlight-lines .highlight-line{position:relative}div[class*=language-].line-numbers-mode .highlight-lines .highlight-line:before{content:" ";position:absolute;z-index:2;left:0;top:0;display:block;width:var(--code-ln-wrapper-width);height:100%}div[class*=language-].line-numbers-mode pre{margin-left:var(--code-ln-wrapper-width);padding-left:1rem;vertical-align:middle}div[class*=language-].line-numbers-mode .line-numbers{position:absolute;top:0;width:var(--code-ln-wrapper-width);text-align:center;color:var(--code-ln-color);padding-top:1.25rem;line-height:1.4;counter-reset:line-number}div[class*=language-].line-numbers-mode .line-numbers .line-number{position:relative;z-index:3;-webkit-user-select:none;-moz-user-select:none;user-select:none;height:1.4em}div[class*=language-].line-numbers-mode .line-numbers .line-number:before{counter-increment:line-number;content:counter(line-number);font-size:.85em}div[class*=language-].line-numbers-mode:after{content:"";position:absolute;top:0;left:0;width:var(--code-ln-wrapper-width);height:100%;border-radius:6px 0 0 6px;border-right:1px solid var(--code-hl-bg-color)}div[class*=language-].ext-c:before{content:"c"}div[class*=language-].ext-cpp:before{content:"cpp"}div[class*=language-].ext-cs:before{content:"cs"}div[class*=language-].ext-css:before{content:"css"}div[class*=language-].ext-dart:before{content:"dart"}div[class*=language-].ext-docker:before{content:"docker"}div[class*=language-].ext-fs:before{content:"fs"}div[class*=language-].ext-go:before{content:"go"}div[class*=language-].ext-html:before{content:"html"}div[class*=language-].ext-java:before{content:"java"}div[class*=language-].ext-js:before{content:"js"}div[class*=language-].ext-json:before{content:"json"}div[class*=language-].ext-kt:before{content:"kt"}div[class*=language-].ext-less:before{content:"less"}div[class*=language-].ext-makefile:before{content:"makefile"}div[class*=language-].ext-md:before{content:"md"}div[class*=language-].ext-php:before{content:"php"}div[class*=language-].ext-py:before{content:"py"}div[class*=language-].ext-rb:before{content:"rb"}div[class*=language-].ext-rs:before{content:"rs"}div[class*=language-].ext-sass:before{content:"sass"}div[class*=language-].ext-scss:before{content:"scss"}div[class*=language-].ext-sh:before{content:"sh"}div[class*=language-].ext-styl:before{content:"styl"}div[class*=language-].ext-ts:before{content:"ts"}div[class*=language-].ext-toml:before{content:"toml"}div[class*=language-].ext-vue:before{content:"vue"}div[class*=language-].ext-yml:before{content:"yml"}@media (max-width: 419px){.theme-default-content div[class*=language-]{margin:.85rem -1.5rem;border-radius:0}}.code-group__nav{margin-top:.85rem;margin-bottom:calc(-1.7rem - 6px);padding-bottom:calc(1.7rem - 6px);padding-left:10px;padding-top:10px;border-top-left-radius:6px;border-top-right-radius:6px;background-color:var(--code-bg-color)}.code-group__ul{margin:auto 0;padding-left:0;display:inline-flex;list-style:none}.code-group__nav-tab{border:0;padding:5px;cursor:pointer;background-color:transparent;font-size:.85em;line-height:1.4;color:#ffffffe6;font-weight:600}.code-group__nav-tab:focus{outline:none}.code-group__nav-tab:focus-visible{outline:1px solid rgba(255,255,255,.9)}.code-group__nav-tab-active{border-bottom:var(--c-brand) 1px solid}@media (max-width: 419px){.code-group__nav{margin-left:-1.5rem;margin-right:-1.5rem;border-radius:0}}.code-group-item{display:none}.code-group-item__active{display:block}.code-group-item>pre{background-color:orange}.custom-container{transition:color var(--t-color),border-color var(--t-color),background-color var(--t-color)}.custom-container .custom-container-title{font-weight:600}.custom-container .custom-container-title:not(:only-child){margin-bottom:-.4rem}.custom-container.tip,.custom-container.warning,.custom-container.danger{padding:.1rem 1.5rem;border-left-width:.5rem;border-left-style:solid;margin:1rem 0}.custom-container.tip{border-color:var(--c-tip);background-color:var(--c-tip-bg);color:var(--c-tip-text)}.custom-container.tip .custom-container-title{color:var(--c-tip-title)}.custom-container.tip a{color:var(--c-tip-text-accent)}.custom-container.warning{border-color:var(--c-warning);background-color:var(--c-warning-bg);color:var(--c-warning-text)}.custom-container.warning .custom-container-title{color:var(--c-warning-title)}.custom-container.warning a{color:var(--c-warning-text-accent)}.custom-container.danger{border-color:var(--c-danger);background-color:var(--c-danger-bg);color:var(--c-danger-text)}.custom-container.danger .custom-container-title{color:var(--c-danger-title)}.custom-container.danger a{color:var(--c-danger-text-accent)}.custom-container.details{display:block;position:relative;border-radius:2px;margin:1.6em 0;padding:1.6em;background-color:var(--c-details-bg)}.custom-container.details h4{margin-top:0}.custom-container.details figure:last-child,.custom-container.details p:last-child{margin-bottom:0;padding-bottom:0}.custom-container.details summary{outline:none;cursor:pointer}.home{padding:var(--navbar-height) 2rem 0;max-width:var(--homepage-width);margin:0 auto;display:block}.home .hero{text-align:center}.home .hero img{max-width:100%;max-height:280px;display:block;margin:3rem auto 1.5rem}.home .hero h1{font-size:3rem}.home .hero h1,.home .hero .description,.home .hero .actions{margin:1.8rem auto}.home .hero .actions{display:flex;flex-wrap:wrap;gap:1rem;justify-content:center}.home .hero .description{max-width:35rem;font-size:1.6rem;line-height:1.3;color:var(--c-text-lightest)}.home .hero .action-button{display:inline-block;font-size:1.2rem;padding:.8rem 1.6rem;border-width:2px;border-style:solid;border-radius:4px;transition:background-color var(--t-color);box-sizing:border-box}.home .hero .action-button.primary{color:var(--c-bg);background-color:var(--c-brand);border-color:var(--c-brand)}.home .hero .action-button.primary:hover{background-color:var(--c-brand-light)}.home .hero .action-button.secondary{color:var(--c-brand);background-color:var(--c-bg);border-color:var(--c-brand)}.home .hero .action-button.secondary:hover{color:var(--c-bg);background-color:var(--c-brand-light)}.home .features{border-top:1px solid var(--c-border);transition:border-color var(--t-color);padding:1.2rem 0;margin-top:2.5rem;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:stretch;justify-content:space-between}.home .feature{flex-grow:1;flex-basis:30%;max-width:30%}.home .feature h2{font-size:1.4rem;font-weight:500;border-bottom:none;padding-bottom:0;color:var(--c-text-light)}.home .feature p{color:var(--c-text-lighter)}.home .theme-default-content{padding:0;margin:0}.home .footer{padding:2.5rem;border-top:1px solid var(--c-border);text-align:center;color:var(--c-text-lighter);transition:border-color var(--t-color)}@media (max-width: 719px){.home .features{flex-direction:column}.home .feature{max-width:100%;padding:0 2.5rem}}@media (max-width: 419px){.home{padding-left:1.5rem;padding-right:1.5rem}.home .hero img{max-height:210px;margin:2rem auto 1.2rem}.home .hero h1{font-size:2rem}.home .hero h1,.home .hero .description,.home .hero .actions{margin:1.2rem auto}.home .hero .description{font-size:1.2rem}.home .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home .feature h2{font-size:1.25rem}}.page{padding-top:var(--navbar-height);padding-left:var(--sidebar-width)}.navbar{position:fixed;z-index:20;top:0;left:0;right:0;height:var(--navbar-height);box-sizing:border-box;border-bottom:1px solid var(--c-border);background-color:var(--c-bg-navbar);transition:background-color var(--t-color),border-color var(--t-color)}.sidebar{font-size:16px;width:var(--sidebar-width);position:fixed;z-index:10;margin:0;top:var(--navbar-height);left:0;bottom:0;box-sizing:border-box;border-right:1px solid var(--c-border);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--c-brand) var(--c-border);background-color:var(--c-bg-sidebar);transition:transform var(--t-transform),background-color var(--t-color),border-color var(--t-color)}.sidebar::-webkit-scrollbar{width:7px}.sidebar::-webkit-scrollbar-track{background-color:var(--c-border)}.sidebar::-webkit-scrollbar-thumb{background-color:var(--c-brand)}.sidebar-mask{position:fixed;z-index:9;top:0;left:0;width:100vw;height:100vh;display:none}.theme-container.sidebar-open .sidebar-mask{display:block}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(1){transform:rotate(45deg) translate3d(5.5px,5.5px,0)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(2){transform:scale3d(0,1,1)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(3){transform:rotate(-45deg) translate3d(6px,-6px,0)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(1),.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(3){transform-origin:center}.theme-container.no-navbar .theme-default-content h1,.theme-container.no-navbar .theme-default-content h2,.theme-container.no-navbar .theme-default-content h3,.theme-container.no-navbar .theme-default-content h4,.theme-container.no-navbar .theme-default-content h5,.theme-container.no-navbar .theme-default-content h6{margin-top:1.5rem;padding-top:0}.theme-container.no-navbar .page{padding-top:0}.theme-container.no-navbar .sidebar{top:0}@media (min-width: 720px){.theme-container.no-sidebar .sidebar{display:none}.theme-container.no-sidebar .page{padding-left:0}}.theme-default-content a:hover{text-decoration:underline}.theme-default-content img{max-width:100%}.theme-default-content h1,.theme-default-content h2,.theme-default-content h3,.theme-default-content h4,.theme-default-content h5,.theme-default-content h6{margin-top:calc(.5rem - var(--navbar-height));padding-top:calc(1rem + var(--navbar-height));margin-bottom:0}.theme-default-content h1:first-child,.theme-default-content h2:first-child,.theme-default-content h3:first-child,.theme-default-content h4:first-child,.theme-default-content h5:first-child,.theme-default-content h6:first-child{margin-bottom:1rem}.theme-default-content h1:first-child+p,.theme-default-content h1:first-child+pre,.theme-default-content h1:first-child+.custom-container,.theme-default-content h2:first-child+p,.theme-default-content h2:first-child+pre,.theme-default-content h2:first-child+.custom-container,.theme-default-content h3:first-child+p,.theme-default-content h3:first-child+pre,.theme-default-content h3:first-child+.custom-container,.theme-default-content h4:first-child+p,.theme-default-content h4:first-child+pre,.theme-default-content h4:first-child+.custom-container,.theme-default-content h5:first-child+p,.theme-default-content h5:first-child+pre,.theme-default-content h5:first-child+.custom-container,.theme-default-content h6:first-child+p,.theme-default-content h6:first-child+pre,.theme-default-content h6:first-child+.custom-container{margin-top:2rem}@media (max-width: 959px){.sidebar{font-size:15px;width:var(--sidebar-width-mobile)}.page{padding-left:var(--sidebar-width-mobile)}}@media (max-width: 719px){.sidebar{top:0;padding-top:var(--navbar-height);transform:translate(-100%)}.page{padding-left:0}.theme-container.sidebar-open .sidebar{transform:translate(0)}.theme-container.no-navbar .sidebar{padding-top:0}}@media (max-width: 419px){h1{font-size:1.9rem}}.navbar{--navbar-line-height: calc( var(--navbar-height) - 2 * var(--navbar-padding-v) );padding:var(--navbar-padding-v) var(--navbar-padding-h);line-height:var(--navbar-line-height)}.navbar .logo{height:var(--navbar-line-height);margin-right:var(--navbar-padding-v);vertical-align:top}.navbar .site-name{font-size:1.3rem;font-weight:600;color:var(--c-text);position:relative}.navbar .navbar-items-wrapper{display:flex;position:absolute;box-sizing:border-box;top:var(--navbar-padding-v);right:var(--navbar-padding-h);height:var(--navbar-line-height);padding-left:var(--navbar-padding-h);white-space:nowrap;font-size:.9rem}.navbar .navbar-items-wrapper .search-box{flex:0 0 auto;vertical-align:top}@media (max-width: 719px){.navbar{padding-left:4rem}.navbar .can-hide{display:none}.navbar .site-name{width:calc(100vw - 9.4rem);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}}.navbar-items{display:inline-block}.navbar-items a{display:inline-block;line-height:1.4rem;color:inherit}.navbar-items a:hover,.navbar-items a.router-link-active{color:var(--c-text-accent)}.navbar-items .navbar-item{position:relative;display:inline-block;margin-left:1.5rem;line-height:var(--navbar-line-height)}.navbar-items .navbar-item:first-child{margin-left:0}@media (max-width: 719px){.navbar-items .navbar-item{margin-left:0}}@media (min-width: 719px){.navbar-items a:hover,.navbar-items a.router-link-active{color:var(--c-text)}.navbar-item>a:hover,.navbar-item>a.router-link-active{margin-bottom:-2px;border-bottom:2px solid var(--c-text-accent)}}.toggle-sidebar-button{position:absolute;top:.6rem;left:1rem;display:none;padding:.6rem;cursor:pointer}.toggle-sidebar-button .icon{display:flex;flex-direction:column;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;cursor:inherit}.toggle-sidebar-button .icon span{display:inline-block;width:100%;height:2px;border-radius:2px;background-color:var(--c-text);transition:transform var(--t-transform)}.toggle-sidebar-button .icon span:nth-child(2){margin:6px 0}@media screen and (max-width: 719px){.toggle-sidebar-button{display:block}}.toggle-color-mode-button{display:flex;margin:auto;margin-left:1rem;border:0;background:none;color:var(--c-text);opacity:.8;cursor:pointer}.toggle-color-mode-button:hover{opacity:1}.toggle-color-mode-button .icon{width:1.25rem;height:1.25rem}.DocSearch{transition:background-color var(--t-color)}.navbar-dropdown-wrapper{cursor:pointer}.navbar-dropdown-wrapper .navbar-dropdown-title,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile{display:block;font-size:.9rem;font-family:inherit;cursor:inherit;padding:inherit;line-height:1.4rem;background:transparent;border:none;font-weight:500;color:var(--c-text)}.navbar-dropdown-wrapper .navbar-dropdown-title:hover,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile:hover{border-color:transparent}.navbar-dropdown-wrapper .navbar-dropdown-title .arrow,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile .arrow{vertical-align:middle;margin-top:-1px;margin-left:.4rem}.navbar-dropdown-wrapper .navbar-dropdown-title-mobile{display:none;font-weight:600;font-size:inherit}.navbar-dropdown-wrapper .navbar-dropdown-title-mobile:hover{color:var(--c-text-accent)}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item{color:inherit;line-height:1.7rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle{margin:.45rem 0 0;border-top:1px solid var(--c-border);padding:1rem 0 .45rem;font-size:.9rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>span{padding:0 1.5rem 0 1.25rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>a{font-weight:inherit}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>a.router-link-active:after{display:none}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem-wrapper{padding:0;list-style:none}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem-wrapper .navbar-dropdown-subitem{font-size:.9em}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a{display:block;line-height:1.7rem;position:relative;border-bottom:none;font-weight:400;margin-bottom:0;padding:0 1.5rem 0 1.25rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a:hover,.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active{color:var(--c-text-accent)}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active:after{content:"";width:0;height:0;border-left:5px solid var(--c-text-accent);border-top:3px solid transparent;border-bottom:3px solid transparent;position:absolute;top:calc(50% - 2px);left:9px}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item:first-child .navbar-dropdown-subtitle{margin-top:0;padding-top:0;border-top:0}@media (max-width: 719px){.navbar-dropdown-wrapper.open .navbar-dropdown-title,.navbar-dropdown-wrapper.open .navbar-dropdown-title-mobile{margin-bottom:.5rem}.navbar-dropdown-wrapper .navbar-dropdown-title,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile{display:none}.navbar-dropdown-wrapper .navbar-dropdown-title-mobile{display:block}.navbar-dropdown-wrapper .navbar-dropdown{transition:height .1s ease-out;overflow:hidden}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle{border-top:0;margin-top:0;padding-top:0;padding-bottom:0}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle,.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item>a{font-size:15px;line-height:2rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem{font-size:14px;padding-left:1rem}}@media (min-width: 720px){.navbar-dropdown-wrapper{height:1.8rem}.navbar-dropdown-wrapper:hover .navbar-dropdown,.navbar-dropdown-wrapper.open .navbar-dropdown{display:block!important}.navbar-dropdown-wrapper.open:blur{display:none}.navbar-dropdown-wrapper .navbar-dropdown{display:none;height:auto!important;box-sizing:border-box;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;background-color:var(--c-bg-navbar);padding:.6rem 0;border:1px solid var(--c-border);border-bottom-color:var(--c-border-dark);text-align:left;border-radius:.25rem;white-space:nowrap;margin:0}}.page{padding-bottom:2rem;display:block}.page .theme-default-content{max-width:var(--content-width);margin:0 auto;padding:2rem 2.5rem;padding-top:0}@media (max-width: 959px){.page .theme-default-content{padding:2rem}}@media (max-width: 419px){.page .theme-default-content{padding:1.5rem}}.page-meta{max-width:var(--content-width);margin:0 auto;padding:1rem 2.5rem;overflow:auto}@media (max-width: 959px){.page-meta{padding:2rem}}@media (max-width: 419px){.page-meta{padding:1.5rem}}.page-meta .meta-item{cursor:default;margin-top:.8rem}.page-meta .meta-item .meta-item-label{font-weight:500;color:var(--c-text-lighter)}.page-meta .meta-item .meta-item-info{font-weight:400;color:var(--c-text-quote)}.page-meta .edit-link{display:inline-block;margin-right:.25rem}.page-meta .last-updated{float:right}@media (max-width: 719px){.page-meta .last-updated{font-size:.8em;float:none}.page-meta .contributors{font-size:.8em}}.page-nav{max-width:var(--content-width);margin:0 auto;padding:1rem 2.5rem 2rem;padding-bottom:0}@media (max-width: 959px){.page-nav{padding:2rem}}@media (max-width: 419px){.page-nav{padding:1.5rem}}.page-nav .inner{min-height:2rem;margin-top:0;border-top:1px solid var(--c-border);transition:border-color var(--t-color);padding-top:1rem;overflow:auto}.page-nav .prev a:before{content:"\2190"}.page-nav .next{float:right}.page-nav .next a:after{content:"\2192"}.sidebar ul{padding:0;margin:0;list-style-type:none}.sidebar a{display:inline-block}.sidebar .navbar-items{display:none;border-bottom:1px solid var(--c-border);transition:border-color var(--t-color);padding:.5rem 0 .75rem}.sidebar .navbar-items a{font-weight:600}.sidebar .navbar-items .navbar-item{display:block;line-height:1.25rem;font-size:1.1em;padding:.5rem 0 .5rem 1.5rem}.sidebar .sidebar-items{padding:1.5rem 0}@media (max-width: 719px){.sidebar .navbar-items{display:block}.sidebar .navbar-items .navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active:after{top:calc(1rem - 2px)}.sidebar .sidebar-items{padding:1rem 0}}.sidebar-item{cursor:default;border-left:.25rem solid transparent;color:var(--c-text)}.sidebar-item:focus-visible{outline-width:1px;outline-offset:-1px}.sidebar-item.active:not(p.sidebar-heading){font-weight:600;color:var(--c-text-accent);border-left-color:var(--c-text-accent)}.sidebar-item.sidebar-heading{transition:color .15s ease;font-size:1.1em;font-weight:700;padding:.35rem 1.5rem .35rem 1.25rem;width:100%;box-sizing:border-box;margin:0}.sidebar-item.sidebar-heading.collapsible{cursor:pointer}.sidebar-item.sidebar-heading.collapsible+.sidebar-item-children{transition:height .1s ease-out;overflow:hidden;margin-bottom:.75rem}.sidebar-item.sidebar-heading .arrow{position:relative;top:-.12em;left:.5em}.sidebar-item:not(.sidebar-heading){font-size:1em;font-weight:400;display:inline-block;margin:0;padding:.35rem 1rem .35rem 2rem;line-height:1.4;width:100%;box-sizing:border-box}.sidebar-item:not(.sidebar-heading)+.sidebar-item-children{padding-left:1rem;font-size:.95em}.sidebar-item-children .sidebar-item-children .sidebar-item:not(.sidebar-heading){padding:.25rem 1rem .25rem 1.75rem}.sidebar-item-children .sidebar-item-children .sidebar-item:not(.sidebar-heading).active{font-weight:500;border-left-color:transparent}a.sidebar-heading+.sidebar-item-children .sidebar-item:not(.sidebar-heading).active{border-left-color:transparent}a.sidebar-item{cursor:pointer}a.sidebar-item:hover{color:var(--c-text-accent)}.table-of-contents .badge{vertical-align:middle}.dropdown-enter-from,.dropdown-leave-to{height:0!important}.fade-slide-y-enter-active{transition:all .2s ease}.fade-slide-y-leave-active{transition:all .2s cubic-bezier(1,.5,.8,1)}.fade-slide-y-enter-from,.fade-slide-y-leave-to{transform:translateY(10px);opacity:0}*{font-family:Courier Prime,monospace}body{background-color:#0d1117!important}header{background-color:#0d1117!important}aside{background-color:#0d1117!important}::-moz-selection{background:rgb(255,255,0);color:#000}:root{--search-bg-color: #ffffff;--search-accent-color: #3eaf7c;--search-text-color: #2c3e50;--search-border-color: #eaecef;--search-item-text-color: #5d81a5;--search-item-focus-bg-color: #f3f4f5;--search-input-width: 8rem;--search-result-width: 20rem}.search-box{display:inline-block;position:relative;margin-left:1rem}.search-box input{cursor:text;width:var(--search-input-width);height:2rem;color:var(--search-text-color);display:inline-block;border:1px solid var(--search-border-color);border-radius:2rem;font-size:.9rem;line-height:2rem;padding:0 .5rem 0 2rem;outline:none;transition:all ease .3s;background:var(--search-bg-color) url(/assets/search.0782d0d1.svg) .6rem .5rem no-repeat;background-size:1rem}.search-box input:focus{cursor:auto;border-color:var(--search-accent-color)}.search-box .suggestions{background:var(--search-bg-color);width:var(--search-result-width);position:absolute;top:2rem;right:0;border:1px solid var(--search-border-color);border-radius:6px;padding:.4rem;list-style-type:none}.search-box .suggestion{line-height:1.4;padding:.4rem .6rem;border-radius:4px;cursor:pointer}.search-box .suggestion.focus{background-color:var(--search-item-focus-bg-color)}.search-box .suggestion.focus a{color:var(--search-accent-color)}.search-box .suggestion a{white-space:normal;color:var(--search-item-text-color)}.search-box .suggestion .page-title{font-weight:600}.search-box .suggestion .page-header{font-size:.9em;margin-left:.25em}@media (max-width: 720px){.search-box input{cursor:pointer;width:0;border-color:transparent;position:relative}.search-box input:focus{cursor:text;left:0;width:10rem}}@media (max-width: 420px){.search-box input:focus{width:8rem}.search-box .suggestions{width:calc(100vw - 4rem);right:-.5rem}} diff --git a/assets/tarot.html.201441c9.js b/assets/tarot.html.201441c9.js new file mode 100644 index 0000000..0128e4a --- /dev/null +++ b/assets/tarot.html.201441c9.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-abde92f0","path":"/tarot.html","title":"","lang":"en-US","frontmatter":{"sidebar":false,"home":true,"heroText":null,"tagline":null,"footer":"Made with VuePress 2 and Markdown \u2014 Guilherme M. Petry 2022"},"excerpt":"","headers":[],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"tarot.md"}');export{e as data}; diff --git a/assets/tarot.html.7e588aa8.js b/assets/tarot.html.7e588aa8.js new file mode 100644 index 0000000..759a716 --- /dev/null +++ b/assets/tarot.html.7e588aa8.js @@ -0,0 +1 @@ +import{_ as r,r as a,o,c as n,a as t,b as s,e as i,d as e}from"./app.03d0ed6d.js";const c={},l=i("

Tarot cards discovered:

NameIconSpell relation
Seven of Cups\u{1F4DF}LaTeX PDF press specification
The Chariot\u{1F30C}API enchantment with JavaScript
The Hermit\u{1F38B}Set up Kali Linux and Metasploitable on VirtualBox
Ace of Wands\u{1F375}Intro on web security with Helmet.js
Two of Pentacles\u{1F391}Bash scriptage
The Sun\u{1F52E}JavaScript cast specification
Ten of Cups\u{1F359}GitHub once and for all
Four of Cups\u{1F4DF}Terminal commands
Five of Cups\u231BMarkdown cheat sheet
",2),h={href:"https://en.wikipedia.org/wiki/Rider%E2%80%93Waite_Tarot",target:"_blank",rel:"noopener noreferrer"},p=e("The Rider\u2013Waite Tarot"),_=e(".");function f(u,m){const d=a("ExternalLinkIcon");return o(),n("div",null,[l,t("p",null,[t("a",h,[p,s(d)]),_])])}var b=r(c,[["render",f],["__file","tarot.html.vue"]]);export{b as default}; diff --git a/assets/terminal-commands.html.2349ded0.js b/assets/terminal-commands.html.2349ded0.js new file mode 100644 index 0000000..8c682f0 --- /dev/null +++ b/assets/terminal-commands.html.2349ded0.js @@ -0,0 +1,59 @@ +import{_ as e,o as i,c as n,e as t}from"./app.03d0ed6d.js";const a={},s=t(`

Linux Terminal & commands

The Linux Terminal is a way to interact with the machine by typing console commands. To use it, you need an interpreter, like:

  • Bourne Again Shell (Bash);
  • Z-shell (Zsh);
  • KornShell (Ksh);
  • C Shell (Csh).

But, don't worry about it. Most Linux distributions comes with one of those by standard, they all are going to work similarly and can do the job.

Directory Structure

Everything starts from the root which is /.

From there:

  • /bin essential user binaries;
  • /boot boot static files;
  • /dev (devices) device files (disks);
  • /etc system configuration files (servers like Apache and Nginex);
  • /home home directory, which contains users list directory;
  • /media mount points for removable media;
  • /mnt temporary mount directories;
  • /opt optional or third-party software;
  • /sbin binary system files;
  • /tmp temporary files, non-persistent or cleared on reboot;
  • /usr user related programs;
  • /var variable files (logs from OS or servers like Apache, Nginx);
  • /proc virtual and pseudo files;
  • /root home directory of the root user (sudo home).

/ and /root are different things. root is inside /. This folder is used for system adiministrative tasks/files and contains configuration files specific to the root user (or the sudo command).

Commands

| Command         | Description                                                 |
+|-----------------|-------------------------------------------------------------|
+| pwd             | Print working directory                                     |
+| ls              | List files and directories (-l, -la, -ls, -lh...)           |
+| cd              | Change directory                                            |
+| cd ..           | Navigate one folder back in the directory hierarchy         |
+| cd -            | Navigate to the folder you was before                       |
+| mkdir           | Create folder \`mkdir newFolder\`                             |
+| find            | Search inside current folder (case sensitive: find -i)      |
+| locate          | Need to run \`updatedb\` before \`locate index.html\`           |
+| xdg-open .      | Open current working directory on Files                     |
+| xdg-open "path" | Open folder/archive. "xdg-open /home/petry" will open home  |
+| xdg-open "file" | "xdg-open index.md" will open index.md form current folder  |
+

Package Management

| Command         | Description                                                 |
+|-----------------|-------------------------------------------------------------|
+| apt update      | Updates packages lists. Important before \`apt upgrade\`      | 
+| apt upgrade     | Actually updates the packages (apps).                       | 
+| apt search      | Searches for the specific app \`apt search <appName>\`.       | 
+| apt install     | Install app \`apt install <appName>\`.                        |
+| apt remove      | Remove app \`apt remove <appName>\`.                          |
+| apt purge       | Removes app and all dependencies \`apt remove <appName>\`.    |
+| dpkg -l         | Print all apps from packages.                               |
+| dpkg -r <app>   | Remove <app>.                                               |
+

Important files

  • cat /etc/apt/sources.list will print where system search for packages.

File management and editing

| Command         | Description                                                 |
+|-----------------|-------------------------------------------------------------|
+| cp              | Copy. \`cp imput.md output.md\`                               |
+| mv              | Move. \`mv file.md /home/petry/Desktop\`                      |
+| touch index.md  | Creates a new file                                          |
+| echo            | Print on screen. \`echo "Hello, world!" > hello.md\` to save. |
+| cat file.md     | Reads and prints file on terminal                           |
+| rm / rm -r      | Delete file / delete folder (may need to run as sudo)       |
+| code .          | Open directory on Visual Studio Code                        |
+| grep            | Search keyword in file (grep "keyword" file.md)             |
+| egrep           | Search with multiple keywords (egrep "zsh|bash" file.md)    |
+| cut             | Cut selected text inside file                               | 
+| sed             | Substitution (sed 's/texto1/texto2' index.md)               | 
+

Networking and processes

| Command                     | Description                                     |
+|-----------------------------|-------------------------------------------------|
+| top                         | Print system processes                          |
+| ps aux                      | Print all system processes                      |
+| ifconfig                    | Print network interfaces                        |
+| ip                          | Print network interfaces + IP and MAC addresses |
+| systemctl status networking | Print network status                            |  
+| systemctl start networking  | Network controls (start, stop, restart)         |
+| route                       | Print system routes (route -n)                  | 
+| netstat (netstat -l [list]) | Print network open doors and active connections |
+| dig +short <url>            | Print IP from from domain (dig +short hello.com)|
+

Important files

  • cat /etc/network/interfaces will print network configuration files.

Utility

| Command         | Description                                                 |
+|-----------------|-------------------------------------------------------------|
+| setxkbmap br    | Change keyboard language to <country>                       |
+| man <app>       | Print manual for <application>                              |
+| clear           | Clear terminal window                                       |
+| whereis <app>   | Print location if <application> files                       |
+| file hello.md   | Print file type (can be used with file name or file path)   |
+| xxd hello.md    | Print binaries from file (can be used with path)            |
+| curl URL        | Send GET request to URL. Try "curl wttr.in"                 |
+| curl -o URL     | Download content (alphabetic "o", not zero)                 |
+| !$              | Copy and paste last command entry, to command prompt        |
+

Remember! Those are not spells. We will get there...

Bonus! Using curl to convert images from the web

Define the output name and file extension after -o. Just like this:

curl -o output.png https://www.thehousedesigners.com/images/uploads/SiteImage-Landing-large-house-plans-1.webp

It works with .webp/.jpeg to .png

Web developers love the .webp/.webm. file format. It is smaller and loads faster. But content creators hate it. .webp/.webm doesn't open on preview apps.

This look shit... Don't worry. I'm working on a cURL post. Maybe after the dig and the traceroute commands.

`,32),d=[s];function r(o,l){return i(),n("div",null,d)}var m=e(a,[["render",r],["__file","terminal-commands.html.vue"]]);export{m as default}; diff --git a/assets/terminal-commands.html.29baacb0.js b/assets/terminal-commands.html.29baacb0.js new file mode 100644 index 0000000..258d051 --- /dev/null +++ b/assets/terminal-commands.html.29baacb0.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6decc2f5","path":"/posts/terminal-commands.html","title":"Linux Terminal & commands","lang":"en-US","frontmatter":{"title":"Linux Terminal & commands","date":"2022-07-26","sidebar":"auto","tags":["linux","terminal","commands"]},"excerpt":"","headers":[{"level":2,"title":"Directory Structure","slug":"directory-structure","children":[]},{"level":2,"title":"Commands","slug":"commands","children":[{"level":3,"title":"Navigation","slug":"navigation","children":[]},{"level":3,"title":"Package Management","slug":"package-management","children":[]},{"level":3,"title":"File management and editing","slug":"file-management-and-editing","children":[]},{"level":3,"title":"Networking and processes","slug":"networking-and-processes","children":[]},{"level":3,"title":"Utility","slug":"utility","children":[]}]},{"level":2,"title":"Bonus! Using curl to convert images from the web","slug":"bonus-using-curl-to-convert-images-from-the-web","children":[]}],"git":{"updatedTime":1725299410000,"contributors":[{"name":"Petry","email":"petry078@gmail.com","commits":1}]},"filePathRelative":"posts/terminal-commands.md"}');export{e as data}; diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..5cbab16 Binary files /dev/null and b/favicon.ico differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..31d8228 --- /dev/null +++ b/index.html @@ -0,0 +1,33 @@ + + + + + + + + + ✨ Spellblog + + + + +
Spellblog

Spellblog

Documentations, writings, spells and other stuff


📟 LaTeX PDF press specification

09 Jan 2024

Ancient tech that works. Feels just like the Gutemberg press.

Read more!


🌌 API enchantment with JavaScript

01 Jul 2023

Computing power and black magic do not come from just one source.

Read more!


🎋 Set up Kali Linux and Metasploitable on VirtualBox

03 Mar 2023

After a hours trying to fix all errors. Yeah. Maybe...

Read more!


🍵 Intro on web security with Helmet.js

31 Jan 2023

Get to know more about headers, caching, CDN and web vulnerabilities.

Read more!


🎑 Bash scriptage

01 Nov 2022

Command line scripts. This is starting to look like magic...

Read more!


🔮 JavaScript cast specification

20 Aug 2022

JavaScript is, indeed, for the mad.

Read more!


🍙 GitHub once and for all

05 Aug 2022

Just the basics, but it will get you going.

Read more!


📟 Terminal commands

26 Jul 2022

Remember! Those are not spells, yet...

Read more!


⌛ Markdown cheat sheet

21 Jul 2022

Basic Markdown syntax

Read more!

+ + + diff --git a/posts/api-enchantment-with-javascript.html b/posts/api-enchantment-with-javascript.html new file mode 100644 index 0000000..c404ab2 --- /dev/null +++ b/posts/api-enchantment-with-javascript.html @@ -0,0 +1,88 @@ + + + + + + + + + API enchantment with JavaScript | ✨ Spellblog + + + + +

API enchantment with JavaScript

Content in progress.

1. The Fetch API

Fetch API GET request:

Request: call fetch(<path>). Response: a stream of data in a format of a file (JSON, plain text, HTML, XML, PNG, JPG, GIF, SVG, PDF, CSV, binary files and error responses [status code]).

Image from the web example:

    <img src="" id="rainbow">
+    <script>
+        catchRainbow().then(response => {console.log('all good!')})
+
+        async function catchRainbow(){
+            const response = await fetch('https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Double-alaskan-rainbow.jpg/1200px-Double-alaskan-rainbow.jpg')
+            const blob = await response.blob()
+            document.getElementById('rainbow').src = URL.createObjectURL(blob)
+            console.log(blob)
+        }
+    </script>
+

.txt file from the same domain example:

    <p id="rainbow"></p>
+    <script>
+        catchRainbow()
+
+        async function catchRainbow(){
+            const response = await fetch('/index.txt')
+            const text = await response.text()
+            const printedResponse = String(text)
+            document.getElementById("rainbow").innerText = printedResponse
+        }
+        
+    </script>
+

Parsing and logging a .csv file from /:

getData()
+
+async function getData(){
+    const response = await fetch('fileName.csv') //ask for it
+    const data = await response.text()           //treat the data, in this case text
+    console.log(data)                            //do something with it
+
+    const table = data.split('\n').slice(1)      //spliting it by line break `\n`
+    table.forEach(row => {                       //array.forEach(splitedProduct => { 
+        const columns = row.split(',')           //split again separating it by columns}
+        const year = columns[0]                  //defining what the first column is
+        const temp = columns[1]                  //defining what the second column is
+        console.log(year, temp)                  //logging it
+    })
+}
+
+

Parsing and logging a .csv file from web server:

    getData()
+
+    async function getData () {
+        const response = await fetch('https://raw.githubusercontent.com/petry078/exercicios-javascript/main/planilha.csv')
+        const data = await response.text()
+        const table = data.split('\n').slice(1)
+
+            table.forEach(elt => {
+                const columns = elt.split(',')
+                const year = columns[0]
+                const temp = columns[1]
+                console.log(columns)
+                console.log(year, temp)
+            })
+
+    }
+
Last Updated:
Contributors: Petry
+ + + diff --git a/posts/bash-scriptage.html b/posts/bash-scriptage.html new file mode 100644 index 0000000..538c935 --- /dev/null +++ b/posts/bash-scriptage.html @@ -0,0 +1,38 @@ + + + + + + + + + Bash Scriptage | ✨ Spellblog + + + + +

Bash Scriptage

Bourne Again Shell (Bash) scripts are scripts of commands used on Unix terminals, like the Linux terminal.

It allows you to enter a list of commands (in sequence) just by typing the name of the Bash Script file.

For example, to open Firefox for Developers on Linux systems, you need to open the folder where it is at and double click de file called firefox.

To do it from the terminal, you need:

  • Change Directory cd to the folder where firefox is;
  • Run ./firefox.

./ means "from this folder where i'm" + / to select file/folder you wish to work with.

To achieve this, you just typed a few commands on the terminal. To do this with a single command, you need a Bash Script.

How to create a Bash Script

At your user home folder $ (/home/user), create a file called script.sh.

Your user home folder is usually where your terminal starts. Type pwd to check. It needs to be /home/petry, for example.

Inside the script.sh write #!/bin/sh on the very first line. This will tell the terminal it is a Bash Script.

The first command of your script will be written above, and so on.

Example:

#!/bin/sh
+cd aurora
+./firefox &
+

This is the same as: cd aurora && ./firefox &.

In this case, is just two commands, but this can be used to create complex scripts, with logic operators and all that cool programming stuff.

As you can see on the example, the first command on the script is cd aurora. Aurora is the nickname for the Firefox for Developers, and this folder is actually /home/petry/aurora/.

This is a link. To create one, you will need the ln command. Like:

ln -s [path] [symbolic name]
+

Example:

ln -s /home/petry/aurora/ aurora
+

This is starting to look like magic...

Last Updated:
Contributors: Petry
+ + + diff --git a/posts/github-once-and-for-all.html b/posts/github-once-and-for-all.html new file mode 100644 index 0000000..1eed609 --- /dev/null +++ b/posts/github-once-and-for-all.html @@ -0,0 +1,40 @@ + + + + + + + + + GitHub once and for all | ✨ Spellblog + + + + +

GitHub once and for all

Git and GitHub, at first, can be a little frustrating. Complex commands, Git running locally and the GitHub platform. I feel you... So, here is the easiest way (I know) to work with Git and GitHub repositories.

Clone, update, commit and push code to GitHub from the Terminal

Go to the GitHub repository you need work and copy the .git address, which is usually https://github.com/yourUserID/yourRepoName.git and head to the terminal.

Inside the Terminal, browse to the folder you wish to save the repository and type git clone + .git URL. Just like this:

git clone https://github.com/petry078/spellblog.git

Change directory to the repository you just cloned, with: cd + repositoryName.

cd spellblog

And open everything that it is inside the folder on Visual Studio Code, with: code .

Update and change what is needed and go back to the terminal to start the commit process.

First, run git status and read the results. If everything is correct, add every file to the commit, with: git add .

And then git commit -m "commit description" to write the commit.

To upload the commit, just run git push.

It may ask for you to authenticate the access to your GitHub account, with user and password. For this to work, you need to have a token configured and use the token as your password. Learn more about GitHub tokens and how to create one here!open in new window

The git push must return a message of success with the link of the repository you just pushed the commit. Click on it and check if it's all there.

Its nice to check. I've losted files in this process before...

Working with branches

  • git clone URL
  • cd repositoryName
  • git status
  • git checkout -b NewBranch
  • code .
  • Make your changes.
  • git add .
  • git commit -m "commit description"
  • git push --set-upstream origin NewBranch

This last command will bring the pull request page ready to pull it to main branch.

  • Create a pull request for "NewBranch" on GitHub by visiting "URL";
  • Create Pull Request;
  • Merge Pull Request;
  • Confirm merge;
  • Delete branch.

Git commands used

git status
+git clone gitURL
+git checkout -b NewBranch
+git add .
+git commit -m "commit description"
+git push
+git push --set-upstream origin NewBranch
+
Last Updated:
Contributors: Petry
+ + + diff --git a/posts/intro-on-web-security-with-helmet-js.html b/posts/intro-on-web-security-with-helmet-js.html new file mode 100644 index 0000000..456328e --- /dev/null +++ b/posts/intro-on-web-security-with-helmet-js.html @@ -0,0 +1,43 @@ + + + + + + + + + Learn web security with Helmet.js | ✨ Spellblog + + + + +

Intro on web security with Helmet.js

"Helmet helps you secure your Express apps by setting various HTTP headers. It's not a silver bullet, but it can help!", says the developers. It is a middleware (communication software) that deals with HTTP headers and also offers security modules for the Expressopen in new window (Node.js framework) applications.

According to stackshare.ioopen in new window, Express.js is used in more than 1900 companies applications around the world, including Twitter, Accenture, BlaBlaCar and others. Helmet can be also be used with other frameworksopen in new window.

This documentation is based on (and can help you follow) the Information Security with HelmetJSopen in new window course on FreeCodeCamp.

Installing

Run npm install helmet and in your Express application (app.js):

const express = require("express");
+const helmet = require("helmet");
+const app = express();
+app.use(helmet());
+

It is all about headers. Use curl -v <URL> on terminal, to read headers and confirm Helmet.js is working.

Usage

On app.js write app.use(helmet()); to include all manual configurations listed below:

  • app.use(helmet.hidePoweredBy()); removes the X-Powered-By header;
  • app.use(helmet.frameguard({action: 'deny'})); makes your application break when used inside <frame> <iframe> HTML tags. This can help against Clickjacking attacks;
  • app.use(helmet.xssFilter()); sanitizes user input fields, protecting against Cross-Site Scripting (XSS) attacks;
  • app.use(helmet.noSniff()); tells the browser not to use MIME sniffing and read the file as the Content-Type header says.

    MIME sniffing is a technique used in browsers to determine the file type by reading some of its data. This can create vulnerabilities.

  • app.use(helmet.ieNoOpen()); prevents the mighty Internet Explorer to download and execute infected HTML files.
  • app.use(helmet.hsts({maxAge: ninetyDaysInSeconds, force: true})); configures HTTP Strict Transport Security (HSTS), or HTTPS only, avoiding insecure HTTP requests.

    You also gonna need to instantiate a variable with 90 days in seconds ninetyDaysInSeconds = 90*24*60*60 to check certification expiracy.

  • app.use(helmet.dnsPrefetchControl()); disables browser DNS Prefetch.

    To make navigation faster, DNS prefetch resolve domain names before the user tries to click on the link. However, it can cause user data leak, if you serve a malicious website in your application. The attack is the inplantation of this malicious link.

Not included in app.use(helmet());:

  • app.use(helmet.noCache()); prevents your user to use cached versions of your application. This can be good when you just pushed a security update.

  • Content Security Policy:

app.use(helmet.contentSecurityPolicy({
+	directives:{
+		scriptSrc: ["'self'"],
+		styleSrc: ["'self'"]
+	}
+}))
+

scriptSrc and styleSrc with "'self'" will restrict the execution of scripts and stylesheets, originated from the same origin as the domain itself. These directives enhance security by mitigating Cross-Site Scripting (XSS) and file injection attacks.

Test repository: https://replit.com/@GuilhermePetry/boilerplate-infosecopen in new window

Last Updated:
Contributors: Petry
+ + + diff --git a/posts/javascript-references.html b/posts/javascript-references.html new file mode 100644 index 0000000..98a9936 --- /dev/null +++ b/posts/javascript-references.html @@ -0,0 +1,357 @@ + + + + + + + + + JavaScript cast specification | ✨ Spellblog + + + + +

JavaScript cast specification

Content in progress.

1. Objects

"ECMAScript is an object-oriented programming language for performing computations and manipulating computational objects within a host environment... In ECMAScript, an object is a collection of zero or more properties... Properties are containers that hold other objects, primitive values, or functions"

"...An object is a member of the built-in type Object; and a function is a callable object. A function that is associated with an object via a property is called a method."

The ECMAScript 262 ® 2024 Language Specificationopen in new window

In JavaScript we write objects. Objects have properties, that can be:

  • Nothing;
  • Other Objects;
  • Primitive Values;
  • Functions.

Everything that is not a primitive value, is an object.

There are several built-in objects in JavaScript:

  • Object;
  • Function;
  • Boolean;
  • Symbol;
  • Various Error
  • Math;
  • Number;
  • Date;
  • String;
  • RegExp;
  • Array;
  • Nine different kinds of Typed Arrays;
  • Map;
  • Set;
  • JSON;
  • ArrayBuffer;
  • SharedArrayBuffer;
  • DataView;
  • Promise;
  • Proxy;
  • Reflect.

Objects can have methods, wich are functions that will use the object properties data.

"When a function is called as a method of an object, the object is passed to the function as its this value."

Primitive Values

  • Undefined;
  • Null;
  • Boolean;
  • Number;
  • BigInt;
  • String;
  • Symbol.

Use typeof varName to reveal data type of element at runtime.

Functions

A function is a callable object, with a set of commands that will be runned when the function is called. Example function().

Functions can return something and have scope {} defined.

Functions can be called as methods, that will run with the object properties data. Example: object.functionAsMethod() just like console.log().

As like an object it is, functions can have properties and methods.

function(paramenters){
+ commands
+}
+

Arrow functions

Alternative function syntax for using it as variables, or parameters. Arrow functions dosent have its own this and can't be used as constructor function.

let arrowFunction = (paramenters) => {
+    commands
+}
+

2. Strings and Numbers

  • Number(varName) coverts to number;
  • String(varName) converts to string;
  • Number.parseInt(varName) coverts to whole number;
  • Number.parseFloat(varName) converts to floating-point number.
  • console.log(Number.isInteger(12)) will check if number is floating-point.
let fu = "bar" //string
+let fuu = 123 //number
+

Template strings

console.log(`Name: ${name};`)
+console.log(`Surname: ${surname}.`)
+

String formatting

var jsString = "JavaScript";
+console.log(jsString.toUpperCase());
+console.log(jsString.toLowerCase());
+
+var jsStringLenght = jsString.length
+console.log(jsStringLenght)
+

3. Operators

  • Arithmetic (Aritiméticos);
  • Assignment (Atribuição);
  • Comparison (Relacionais);
  • Logical (Lógicos);
  • Conditional or Ternary (Condicional ou Ternário).

Precedence order:

  1. Arithmetic;
  2. Comparison;
  3. Logical;
  4. Ternary.

Arithmetic operators

OperatorFunction
+Addition
-Subtraction
*Multiplication
/Division
%Remainder (resto de uma divisão inteira)
**Power (Ex: 5² = [5 ** 2])

Arithmetic operators precedence order

  1. () first priority
  2. **
  3. *, /, %
  4. +, - last priority

Assignment operators

OperatorFunction
=Assignment (recebe)
// Auto-assignment
+=Addition (a += 5; // a = a + 5)
-=Subtraction (a -= 2; // a = a - 2)
*=Multiplication (a *= 3; // a = a * 3)
/=Division (a /= 2; // a = a / 2)
%=Remainder (a %= 2; // a = a % 2)
**=Exponentiation (a = 2; // a = a2)

Increment (++) and decrement (--)

  • x++ x = x + 1
  • x-- x = x - 1

Pre-increment ++x

Pre-decrement --x

Comparison operators

It returns true or false, comparing only the value.

OperatorFunction
>Greater than (maior que)
<Less than (menor que)
>=Greater than or equal to (maior que ou igual)
<=Less than or equal to (menor que ou igual)
==Equal to (same value)
!=Not equal to

Strict operators (igualdade e desigualdede)

Compares value and type.

OperatorFunction
===Strict equal to (igual restrito)
!==Strict not equal to (desigual restrito)

Examples:

5 > 2  //true
+7 < 4  //false
+8 >= 8 //true
+9 <= 7 //false
+5 == 5 //true
+4 != 4 //false
+
+// strict equal operator
+2 === 2 // true
+2 === '2' // false
+
+// strict not equal operator
+2 !== '2' // true
+2 !== 2 // false
+

Logical operators

| Operator  | Function       | Example                            |
+|-----------|----------------|------------------------------------|
+|     !     | Not (negação)  | `(x < 10 && y > 1)` // true  	  |
+|    &&     | And (conjunção)| `(x == 5 || y == 5)` // false      |
+|    ||     | Or  (disjunção)| ```!(x == y)``` // true            |
+

Unary operator ! (not) only deals with one operating, turning 0 in 1 and 1 in 0. True to false, false to true.

Binary operators && and || deals with two operating and returns true or false after analysis. If you ask for a book heavy and && black, it must return true only if the book is heavy and black, but the or || operator will return true if at least one is true.

//Inverts the result
+!true //false
+!false //true
+
+//Both need to be `true` to return `true`.
+true && true //true
+true && false //false
+false && false //false
+false && true //false
+
+//Only one need to be `true` to return `true`
+true || true //true
+true || false //true
+false || false //false
+false || true //true
+

Conditional or Ternary operators

It begins with a logic test, if it returns true, it will run the code on the first true slot, and if it returns false, runs the second false slot.

Syntax:

x && b ? true : false

Examples:

// 1.
+let media = 5.5
+let mediaCalculada = media > 6 ? "Aprovado(true)" : "Reprovado(false)"
+
+console.log(mediaCalculada) // Reprovado(false)
+
+// 2.
+var x = 8
+var res = x % 2 == 0 ? 5 : 9 // 5 (true)
+
+//3. 
+var age = 18
+var r = age >= 18 ? "Adult" : "Child" // Adult (true)
+

4. Document Object Model (DOM)

The DOM tree:

window.location
+      .history
+      .document.<call to HTML tag (selector)>    	
+

Selectors

getElementsBy...

  • getElementById Select HTML tag by its ID.
  • getElementsByTagName() Select HTML tags.
  • getElementsByName() Select HTML tag by its name.
  • getElementsByClassName() Select HTML tags by its class name.

Usage:

<p id = "IdOfP">Old string</p>
+<script>
+window.document.getElementById("IdOfP").innerText = "New string"
+</script>
+

Query selectors

Modern aproach of selectors.

  • querySelector() Select the first HTML Tag
  • querySelectorAll() Creates a list of all elements. Not sure how it works.

querySelector() can be used to select HTML tag + ID/Class (# for ID or . for class)

Usage:

<p>String 1<p>
+<p id = "IdOfP">String 2</p>
+<p class = "ClassOfP">String 3</p> 
+<script>
+window.document.querySelector("p").innerText = "Select by HTML tag name"
+window.document.querySelector("#IdOfP").innerText = "Select by ID"
+window.document.querySelector(".ClassOfP").innerText = "Select by Class name"    
+</script>
+

innerText and innerHTML

  • innerText Write plain text on top of selected element;
  • innerHTML Write HTML on top of selected element;
<h1></h1>
+<p></p>
+<script>
+document.querySelector("h1").innerText="Inset only raw text";
+document.querySelector("p").innerHTML="Insert text with <strong>HTML Tags</strong>"
+</script>
+

Avoid using innerHTML, that can represent a risk of Cross-Site Scripting (XSS).

DOM Events

It works alongside with functions(). Events are called with reserved words, inside the .html file, like onkeydown="functionName()" or in the .js file with Event Listeners, like:

<button id="myBtn">Try it</button>
+
+<p id="textField"></p>
+
+<script>
+document.getElementById("myBtn").addEventListener("click", printDate);
+
+function printDate() {
+  document.getElementById("textField").innerHTML = Date();
+}
+</script>
+

This can also be done with Arrow Functions:

document.getElementById("myBtn").addEventListener("click", (printDate) => {
+    document.getElementById("textField").innerHTML = Date();
+})
+

Mouse events example:

<body>
+    <main>
+    </main>
+
+    <script>
+        let main = document.querySelector("main")
+        //Events
+        main.addEventListener("mouseenter", mouseenterFunction)
+        main.addEventListener("mouseout", mouseoutFunction)
+        main.addEventListener("click", clickFunction)
+
+        function mouseenterFunction() {
+            main.innerText = "mouseenter event"
+            main.style.background = "red"
+        }
+        
+        function mouseoutFunction() {
+            main.innerText = "mouseout event"
+            main.style.background = "yellow"
+        }
+        
+        function clickFunction() {
+            main.innerText = "click event"
+            main.style.background = "purple"
+        }
+    </script>
+
+    <style>
+        main {
+            width: 150px;
+            height: 150px;
+            background-color: green;
+        }
+    </style>
+</body>
+

Hello ${name} example:

This example needs refinement.

<body>
+    <form>
+        <label for="inName">Name:</label>
+        <input type="text" name="" id="inName">
+        <input type="submit" value="print">
+    </form>
+
+    <h1></h1>
+
+<script>
+    let name = document.querySelector("form").inName.value
+    document.querySelector("form").addEventListener("submit", (printName) => {
+        document.querySelector("h1").innerText = `Hello, ${name}`
+        printName.preventDefault()
+    })
+</script>
+</body>
+

For complete events list, see MDN Web Docsopen in new window.

5. Math functions

In addition to the Arithmetic operators, math can be done with the Math. functions.

Rounding numbers

  • Math.round(num) return the closest number. Example Math.round(4.4) = 4 and Math.round(4.5) = 5;
  • Math.ceil(num) round to bigger number. Example: Math.ceil(4.2) = 5;
  • Math.floor(num) round to lower number. Example: Math.floor(4.2) = 4;

Generating random numbers

Math.random() will return a random number between 0 and 1.

Examples

console.log(Math.round(8.4)) //8
+console.log(Math.round(8.5)) //9
+
+console.log(Math.ceil(4.2)) //5
+console.log(Math.floor(4.9)) //4
+
+console.log(Math.random()) //0.7099176926811621
+

6. Conditionals

Programs read data (input), process it, and return something. With conditionals you can have limitations to work with.

The syntax in JavaScript, and most languages, are if...else, switch...case and with ternary operators.

The condition (parameters) must be written with comparison operators. Each comparison will return true or false.

There are situations in which your program must analyze more than one condition. In that case, use logical operators inside the parameter/condition slot. Example: condition == true && condition == true or condition == true || condition != true.

if...else

The if...else conditions can be written in three different structures:

  • Simple if (condition == true){run};
  • Composed if (condition == true){run}... else{run};
  • Multiple if (condition == true){run}... else if{run}...else{run}.

Multiple conditions can have as many else if as necessary.

let n1 = prompt("N1: ")
+let n2 = prompt("N2: ")
+let n3 = prompt("N3: ")
+let n4 = prompt("N4: ")
+
+let average = (n1 + n2 + n3 + n4) / 4
+
+if (average >= 6){
+    console.log("Approved!")
+} else if (average == 5) {
+    console.log("Need recovery")
+} else {
+    console.log("Disapproved")
+}
+

switch...case

Just another structure to make conditionals. Usable when you have a lot of options based on values of a variable, or when you need to return a different case for every value possible of a variable.

Basic example:

let neighborhood = prompt("neighborhood: ")
+let fee
+
+switch (neighborhood) {
+    case "center":
+        fee = 5
+    break
+
+    case "fragata":
+    case "caranda": 
+        fee = 7 //Both (fragada and caranda) will return 7
+    break
+
+    case "elysee":
+        fee = 10
+    break
+
+    default:
+        fee = 8
+}
+
+console.log(fee)
+

7. Repetitions (Loops)

Repetitions, or Loops, (Laços de Repetição, in Portuguese) allows you to run one or more commands in a program or function as many times you need.

Loops need braking points and can be used with Conditional (if...else/switch... case/break/continue).

for

The for syntax is composed by 3 instructions for (initialValue; conditional; incremental/decremental){command}:

for (let i = 1; i <= 10; i = i + 1){command}
+        ||          ||        ||
+	    \/          \/        \/
+{INITIAL VALUE}{CONDITIONAL}{INCREMENTAL}
+
+//This means that `i` starts as 1 and, and will run until it grows to 10, since each commands run, it grows by {INCREMENTAL/DECREMENTAL}, in that case 1.
+

Incremental short: i++

The last instruction can also be decremental: i = 1 -1 or i--

Example:

let numbers = 0
+for (let i = 1; i <=4; i++){
+    numbers++
+    console.log(numbers)
+} //It will print numbers from 1 to 4.
+

Multiplication table example:

let x = prompt("Number: ")
+
+for (let i = 1;  i <=10; i++){
+    let y = x * i
+    console.log(x + " * " + i + " = " + y)
+}
+

Run Multiplication Table on Replitopen in new window

Adding Conditional to for loops

for (let i = 1; i <1= 10; i++){
+	//command1
+	//command2
+	//command3
+	if (i % 2 == 0){
+		//command4
+	}
+}
+

while

It tests the conditional before, to see if it will run the commands or not.

Examples:

while (condition){
+	command
+} //While this condition is true, run {command}
+
let x = prompt("Number: ")
+while (x > 0) {
+    console.log("Oi")
+}
+

do... while

It executes the command at least once, even if the condition is not true.

Examples:

do {
+	command
+} while (condition);
+
let x = 0;
+
+do {
+    x++;
+    console.log(x)
+} while (x < 10)
+

break and continue

The break and continue are two commands that can be used inside JavaScript loops.

  • break: jumps out of a loop.
  • continue: jumps in the beginning of the loop.
while (condition1) {
+    commands
+    if (condition2) {
+        continue //It will test the condition and make the program continue in case of true.
+    }
+    commands
+    if (condition3) {
+        break //It breaks the loop, making the program ignore everything left inside the loop. If there is commands after the break, they will not be executed.
+    }
+    commands
+}
+commands
+

Example:

do {
+    const num = Number(prompt("Number: "))
+    if (num == 0 || isNaN(num)){
+        break
+    } else {
+        continue
+    }
+} while (true)
+

Counters and accumulators

Counters and accumulators are ways to track how many times a particular action or event has occurred. They are commonly used inside loops to count the number of iterations (iteration is a lap made by the program inside a loop or code block).

However, counters and accumulators are commonly used inside loops, they can also be used outside of loops, to count occurrences of an event or action that occurs multiple times in the program.

In JavaScript, counters and accumulators need to be initiated, usually receiving the value of 0. Since they are used to count cycles, you need to know how many cycles (iterations) it has done already, that is why to start a counter with 0.

Counters represent a variable = a variable + 1 (the count factor), accumulators represent a variable = a variable + another variable, and they can be written with the += operator.

Counter example:

let result = 0 //variable initiation
+result = result + 1 //traditional way
+result += 1 //with the += operator
+

Accumulator example:

let result = 0 //variable initiation
+result = result + price //traditional way
+result += price //with the += operator
+

Loop with counter example:

let counter = 0
+for (let i = 0; i < 10; i++) {
+  counter += 1
+  console.log(counter)
+}
+

8. Arrays

Different from variables, that hold only one data entry, arrays can hold many values. Its values can be the same as from the objects, all the JavaScript things.

Arrays can be declared with const even when your values may be changed. What const can't handle being essentially reassigned.

const arr = ["string1", "string2", 12] //Normal array of strings and number
+const newArray = new Array("string1", "string2", 12) //Used as constructor.
+

Array values are counted starting from 0 (zero) and the values are selected with its index number. Example:

const arr = ["string1", "string2", 12, 15, "string3"]
+
+console.log(arr[0])
+console.log(arr[1])
+console.log(arr[2])
+console.log(arr[3])
+console.log(arr[4])
+console.log(arr[5])
+
+//Value rewrite:
+arr[0] = "NewValue"
+

Array methods

  • arr.push() adds one, or more, elements to the end of the array and returns the new array lenght.
const arr = ["string1", "string2", 12, 15, "string3"]
+arr.push("one or", "more", "elements")
+
  • arr.pop() removes the last element of the array.
const arr = ["string1", "string2", 12, 15, "pop this one"]
+arr.pop()
+
  • arr.shift() removes the first element of the array.
const arr = ["shift this one", "string2", 12, 15, "pop this one"]
+arr.shift()
+
  • arr.unshift() adds one, or more, elements to the beginning of the array and returns the new array lenght.
const arr = ["string1", "string2", 12, 15, "string3"]
+arr.unshift("zero", "unshift", "test")
+
  • arr.splice() used to remove and replace elements.
const arr = ["string0", "string1", 2, 3, "remove 4", "remove 5"]
+arr.splice(4, 2) //Start position, number of elements to delete
+
+
+const arr = ["string0", "string1", 2, 3, "number this 4", "number this 5"]
+arr.splice(4, 2, "quatro", "cinco") //Start position, number os elements to replace, replace value, replace value.
+
  • arr.slice() select elements of an array in a new array.
const arr = ["string0", "string1", 2, 3, "quatro", "cinco", 6, 7, 8, 9, 10]
+arr.slice() //Copy the array
+arr.slice(2, 6) // Select elements from index 2 to 6
+
  • arr.map() expects a function as its argument. This function is then called for each element in the array.
const arr = [0, 1, 2, 3, 4, 5]
+const mappedArr = arr.map(plus)
+
+function plus(value, index, arr) {return value + 1}
+console.log(mappedArr)
+
  • arr.forEach() used for repetition loops. Run commands in each element of the array and saves results in the same array.
const arr = [0, 1, 2, 3, 4, 5]
+arr.forEach(plusFunction)
+
+function plusFunction(item, index, array) {
+    console.log(item + 1);
+}
+
+//with arrow function
+arr.forEach(item => {console.log(item + 1);})
+
  • arr.filter() creates a new array with all elements that pass the test implemented by the provided function.
const arr = [1, 2, 3, 4, 5, 6]
+const filteredArr = arr.filter(num => num > 3)
+console.log(filteredArr) // Output: [4, 5, 6]
+
  • arr.reduce() applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value.
const arr = [1, 2, 3, 4, 5]
+const sum = arr.reduce((total, value) => total + value, 0)
+console.log(sum) // Output: 15
+
  • arr.sort() sorts the elements of an array in place and returns the array.
const arr = [5, 2, 8, 1, 4]
+arr.sort()
+console.log(arr) // Output: [1, 2, 4, 5, 8]
+

Array properties

  • arr.length returns the number of elements.
  • arr.constructor returns the constructor function that created it.
  • arr.prototype don't really know, some cursed stuff.

Array of objects

{content in progress}

Locating content inside a array

The methods indexOf(), lastIndexOf(), and includes() are used to locate content inside arrays.

const arr = [0, 1, 2, 3, 4, 5]
+arr.indexOf(3) // Returns the index of the first occurrence of 3
+arr.lastIndexOf(3) // Returns the index of the last occurrence of 3
+arr.includes(3) // Returns true if the array contains 3
+

Cookies, local storage, session storage

{content in progress}

Node.js

JavaScript runs on browsers, as client side code. With Node.js you can run it as a server.

Node.jsopen in new window.

prompt-sync

prompt-syncopen in new window enables you to use prompt on the terminal.

It requires Node.js.

Run npm install prompt-sync. This will install node_modules and package.json.

On your JavaScript file:

const prompt = require("prompt-sync")();
+let promptData = prompt("Data: ")
+

On the terminal, open the folder where your JavaScript file is and run:

node <fileName>.js

prompt-sync-templateopen in new window

Last Updated:
Contributors: Petry
+ + + diff --git a/posts/kali-metasploitable-virtualbox.html b/posts/kali-metasploitable-virtualbox.html new file mode 100644 index 0000000..a079df5 --- /dev/null +++ b/posts/kali-metasploitable-virtualbox.html @@ -0,0 +1,33 @@ + + + + + + + + + Set up Kali Linux and Metasploitable on VirtualBox | ✨ Spellblog + + + + +

Set up Kali Linux and Metasploitable on VirtualBox

1: Download

Extract Kali and Metasploitable to the same directory.

Inside the directory, locate the files kali-linux-2022.4-virtualbox-amd64.vdi and Metasploitable.vmdk, make sure you know where they are.

2: Kali Linux virtual machine

  1. Open VirtualBox and click New.
  2. Give it a name. On Machine Folder select the directory you extracted Kali and Metasploitable.
  3. In Type select Linux.
  4. In Version select Debian (64-bit).
  5. Click Next.
  6. Define its memory.
  7. Select Create a virtual hard disk now.
  8. Select VDI (VirtualBox Disk Image).
  9. Select Dynamically allocated.
  10. 8 GB is fine I guess...
  11. Click Create.

Now, you need to add the kali-linux-2022.4-virtualbox-amd64.vdi to the new virtual machine:

  1. Right-click the new virtual machine and click Settings.
  2. Go to Storage.
  3. Find and click in kali-linux-2022.4-virtualbox-amd64.vdi below Controller: SATA.
  4. At your right, in Attributes, you will find a small disk icon. Click on it!
  5. Select Choose/Create a Virtual Hard Disk.
  6. Select kali-linux-2022.4-virtualbox-amd64.vdi.
  7. Click Ok.

3: Metasploitable virtual machine

  1. Open VirtualBox and click New.
  2. Give it a name. On Machine Folder select the directory you extracted Kali and Metasploitable.
  3. In Type select Linux.
  4. In Version select Debian (64-bit).
  5. Click Next.
  6. Define its memory.
  7. Select Create a virtual hard disk now.
  8. Select VDI (VirtualBox Disk Image).
  9. Select Dynamically allocated.
  10. 8 GB is fine I guess...
  11. Click Create.

Now, you need to add the Metasploitable.vmdk to the new virtual machine:

  1. Right-click the new virtual machine and click Settings.
  2. Go to Storage.
  3. Find and click in Metasploitable.vmdk below Controller: SATA.
  4. At your right, in Attributes, you will find a small disk icon. Click on it!
  5. Select Choose/Create a Virtual Hard Disk.
  6. Select Metasploitable.vmdk.
  7. Click Ok.

4: Virtual machines network configuration

Don't forget to change the network config from NAT to Bridge Adapter on both virtual machines. Otherwise, Metasploitable won't be able to host:

  1. Right-click the new virtual machine and click Settings.
  2. Go to Network.
  3. On Attached to select Bridge Adapter.
  4. Click Ok.

I guess this is high cyber witchery already...

Last Updated:
Contributors: Petry
+ + + diff --git a/posts/latex-pdf-press.html b/posts/latex-pdf-press.html new file mode 100644 index 0000000..8f77398 --- /dev/null +++ b/posts/latex-pdf-press.html @@ -0,0 +1,131 @@ + + + + + + + + + LaTeX PDF press specification | ✨ Spellblog + + + + +

LaTeX PDF press specification

LaTeX is a powerful typesetting markup language, designed to make beautiful and readable printable documents.

Learn LaTeX is great because its old school, free and stable. You will never need to open shit and slow Google Docs, Microsoft Word and even Adobe inDesign, which are all private softwares.

LaTeX documents have to be written and than compiled. Write content using LaTeX markup syntax and than press it to PDF with the command:

pdflatex fileName.tex
+

To Press PDFs using LaTeX you need to have TeX installed.

sudo apt-get install texlive-full
+tex --version
+

Complicate stuff? Overleafopen in new window, the LaTeX web editor and compiler got you there.

The syntax is divided by the preamble, the content and bibliographic references.

There are also some reserved characters:

CharacterDefinition
#Macro key.
$Mathematical environment.
%Comment.
^Superscript.
&Separation of columns in tables.
_Automatic subscript.
{}Scope.
~Space between text that cannot be broken.
\Command initialization.

To print then, use \ before. Example: \#.

The preamble

The preamble is where you will define the structure, styles, aditional packages, rules, metadata, and other general configuration. This configurations will apply to the document as a whole.

The first command of the preamble is \documentclass[]{} that will set the document class and its own parameters.

Here are the preamble commands discovered:

CommandDefinition
\documentclass[]{}Initialize the document. Requires parameters [] and actual document class {}.
\usepackage[]{}Import and use packages with additional functionality. Requires parameters [] and scope {}.
\setlength{\parindent}{0cm}Set paragraph identation.
\setlength{\parskip}{2em}Set space between paragraphs.
\renewcommand{\baselinestretch}{1.5}Space between lines.
\title{Document title}Define title of the document.
\author{Document author}Define author of the document.
\date{Document date}Define date of the document.

\documentclass

\documentcalss parameters[], or parameters in genereal, are optionals and will change based on the actual class and command, that can be:

\documentclass{article}
+\documentclass{report}
+\documentclass{book}
+\documentclass{letter}
+\documentclass{slides}
+\documentclass{beamer}
+

\documentclass parameters:

\documentclass[12pt]{}
+\documentclass[a4paper]{}
+\documentclass[twocolumn]{}
+\documentclass[twoside]{}
+\documentclass[landscape]{}
+

\usepackage

The \usepackage commands imports aditional packages and features. Here are some examples:

\usepackage[utf8]{inputenc}
+\usepackage[portuguese]{babel}
+\usepackage{graphicx}
+\usepackage{url}
+

The content

Content commands are only allowed in the document scope:

\begin{document}
+Content and content commands go here! Like \LaTeX!
+\end{document}
+
+
CommandDefinition
\parNew paragraph
\\Line break, necessary on blank lines
\textbf{Bold example}Bold text.
\textit{Italic example}Italic text.
\underline{Underline example}Underlined text.
\begin{center}Text align: center. Requires `\end{center}
\begin{flushright}Text align: right. Requires `\end{flushright}
\newpage or \clearpagePage break. Needs test, as they work diffrently.
\vspace{4cm}Add vertical space between elements in line.
\hspace{4cm}Add horizontal space between elements in line.
\hfill and \vfillFill horizontal and vertical space between elements in line.
\begin{itemize} or \begin{enumerate}Iniciates unordered or ordered list. Requires \end{itemize} or \end{enumerate}. For list item: \item.
\begin{figure}Iniciates image with standard snippet. Requires graphicx package \usepackage{graphicx} in the document header.
\begin{tabular}Iniciates image with standard snippet. Requires graphicx package \usepackage{graphicx} in the document header.
\begin{titlepage}Iniciate title page. Requires \end{titlepage}. See example below.
\tableofcontentsPrint table of contents. Nice to have \newpage after the summary.
\listoffiguresPrint figures list.
\listoftablesPrint figures list.

Content techniques

Content techniques are commands used inside the content scope.

Paragraphs, chapters, sections, and subsections

A blank line and \par after the text represent paragraph.

Paragraph 1
+
+Paragraph 2
+
+Paragraph 3\par
+Paragraph 4\par
+

For a simple line break, use \\ or \newline at the end of the paragraph, or in a single line.

Simple line break\\
+Newline \newline
+

Chapters, sections, and subsections:

\chapter{Chapter 1}
+\section{Chapter 1, Section 1}
+\section{Chapter 1, Section 2}
+\subsection{Chapter 1, Section 2, Subsection 1}
+\section{Chapter 1, Section 3}
+\subsection{Chapter 1, Section 3, Subsection 1}
+\subsection{Chapter 1, Section 3, Subsection 2}
+

Horizontal and vertical spacing of elements

Whitespaces after commands are ignored. To print then, type the whitespace inside the commands scope {}. Example: textbf{text }.

\hfill and \hspace{3cm} examples:

Grape\hfill100g
+1\hspace{1cm}2\hspace{1cm}3\hspace{1cm}4\hspace{1cm}
+

For vertical stuff, same thing, but \vspace{1cm} and \vfill.

Font size and style

Inline font size and style:

\tiny{tiny text}\\
+\scriptsize{scriptsize text}\\
+\footnotesize{footnotesize text}\\
+\small{small text}\\
+\normalsize{normalsize text}\\
+\large{large text}\\
+\Large{Large text}\\
+\LARGE{LARGE text}\\
+\huge{huge text}\\
+\Huge{Huge text}\\
+
+\textrm{Roman Serif font}\\
+\textsf{Sans Serif font}\\
+\texttt{Monospaced font (typewriter)}\\
+

Any text style + any nother text style:

\underline{\textbf{\textit{Underlined, bold, and italic text}}}
+

Lists

Unordered list:

\begin{itemize}
+\item 1
+\item 2
+\item 3
+\item 4
+\end{itemize}
+

Ordered list:

\begin{enumerate}
+\item 1
+\item 2
+\item 3
+\item 4
+\end{enumerate}
+

Images

Images are called figures in LaTeX, type \begin{figure} and it should autocomplete to this:

\begin{figure}
+    \centering
+    \includegraphics[scale=0.5]{imageExample.png}
+    \caption{Caption text}
+    \label{fig:enter-label}
+\end{figure}
+

Tables

Not gonna lie, tables are complicated.

Titlepage

\begin{titlepage}
+\centering
+\Huge{\textbf{University of Chaos}}
+\vfill
+\huge{My very long article title}
+\vfill
+\large{\textbf{Alum: Guilherme Petry}}
+\vfill
+\today
+\end{titlepage}
+

Table of contents (TOC)

Just call \tableofcontents where you want it to be printed.

Use * in the end of markup to avoid it beeing indexed by the \tableofcontents. Example: \section*{Chapter 1, Section 1}

Footnotes

Primeiro parágrafo do capítulo 1, seção 3 e subseção 2\footnote{Nota de rodapé1}\par
+Segundo parágrafo do capítulo 1, seção 3 e subseção 2\footnote{Nota de rodapé2}\par
+

Quotes

\begin{quote}
+
+\end{quote}
+

Bibliographic references

Bibliographic references in LaTeX requires the natbib package and the references file should be in bibTeX, or .bib.

Instanciate the bliblopgraphy:

\bibliography{referencias}
+\bibliographystyle{plainnat}
+

bibTeX bibliography example:

@book{de1999santa,
+  title={Santa Ifig{\^e}nia},
+  author={de Athayde Jorge, C.},
+  lccn={99887098},
+  series={S{\'e}rie Hist{\'o}ria dos bairros de S{\~a}o Paulo},
+  url={https://books.google.com.br/books?id=SDgsAAAAYAAJ},
+  year={1999},
+  publisher={Departamento do Patrim{\^o}nio Hist{\'o}rico}
+}
+

On text, call reference with \cite{referenceOfBibliography}. The referenceOfBibliography in the example is de1999santa.

Google Books offers bibTeX references like this!

ABNT

Now!

References 🖨️ 🖨

Last Updated:
Contributors: Petry
+ + + diff --git a/posts/markdown-cheat-sheet.html b/posts/markdown-cheat-sheet.html new file mode 100644 index 0000000..b5b21d5 --- /dev/null +++ b/posts/markdown-cheat-sheet.html @@ -0,0 +1,63 @@ + + + + + + + + + Markdown cheat sheet | ✨ Spellblog + + + + +

Markdown cheat sheet

| Markup syntax    | Name                            | Description & Examples            |
+|------------------|---------------------------------|-----------------------------------|
+| #                | Heading 1 <h1>                  | # H1                              |
+| ##               | Heading 2 <h2>                  | ## H2                             |
+| ###              | Heading 3 <h3>                  | ### H3                            |   
+| ####             | Heading 4 <h4>                  | #### H4                           | 
+| #####            | Heading 5 <h5>                  | ##### H5                          |  
+| ######           | Heading 6 <h6>                  | ###### H6                         | 
+| **bold**         | Bold                            | **Bold** example                  |
+| *italic*         | Italic                          | *Italic* example                  | 
+| ---              | Line <hr>                       | Line break (*** ___ )             |
+| >                | Quote/Comment                   | > Comment styled line             |
+| *                | Unordered list item             | * List item (- + are alternatives)|
+| 1.               | Number ordered list item        | 1. Just like this!                |
+| a.               | Character ordered list item     | a. Character styled list          |
+| - [ ] text       | Unmarked to-do list item        | Create to-do lists                |
+| - [x] text       | Checkd to-do list item          | This one is a checked [✔] box     |
+| ```code```       | Code                            | ```Code styled line/block```      | 
+| [text](URL)      | Hyperlink                       | [Download here!](URL)             |
+| ![alt text](URL) | Image                           | ![altText](URL)                   |
+| \                | Disable Markdown style          | Use before ``` * # - + ! |        |
+|------------------|---------------------------------|-----------------------------------|
+|                                                                                        |
+|                                 text-align on tables                                   |
+|                                                                                        |
+|               | text-align: left | text-align: center | text-align: right |            |
+|               |:-----------------|:------------------:|------------------:|            |
+|               | text             |        text        |              text |            |
+|                                                                                        |
+
+
Last Updated:
Contributors: Petry
+ + + diff --git a/posts/terminal-commands.html b/posts/terminal-commands.html new file mode 100644 index 0000000..3935b91 --- /dev/null +++ b/posts/terminal-commands.html @@ -0,0 +1,91 @@ + + + + + + + + + Linux Terminal & commands | ✨ Spellblog + + + + +

Linux Terminal & commands

The Linux Terminal is a way to interact with the machine by typing console commands. To use it, you need an interpreter, like:

  • Bourne Again Shell (Bash);
  • Z-shell (Zsh);
  • KornShell (Ksh);
  • C Shell (Csh).

But, don't worry about it. Most Linux distributions comes with one of those by standard, they all are going to work similarly and can do the job.

Directory Structure

Everything starts from the root which is /.

From there:

  • /bin essential user binaries;
  • /boot boot static files;
  • /dev (devices) device files (disks);
  • /etc system configuration files (servers like Apache and Nginex);
  • /home home directory, which contains users list directory;
  • /media mount points for removable media;
  • /mnt temporary mount directories;
  • /opt optional or third-party software;
  • /sbin binary system files;
  • /tmp temporary files, non-persistent or cleared on reboot;
  • /usr user related programs;
  • /var variable files (logs from OS or servers like Apache, Nginx);
  • /proc virtual and pseudo files;
  • /root home directory of the root user (sudo home).

/ and /root are different things. root is inside /. This folder is used for system adiministrative tasks/files and contains configuration files specific to the root user (or the sudo command).

Commands

| Command         | Description                                                 |
+|-----------------|-------------------------------------------------------------|
+| pwd             | Print working directory                                     |
+| ls              | List files and directories (-l, -la, -ls, -lh...)           |
+| cd              | Change directory                                            |
+| cd ..           | Navigate one folder back in the directory hierarchy         |
+| cd -            | Navigate to the folder you was before                       |
+| mkdir           | Create folder `mkdir newFolder`                             |
+| find            | Search inside current folder (case sensitive: find -i)      |
+| locate          | Need to run `updatedb` before `locate index.html`           |
+| xdg-open .      | Open current working directory on Files                     |
+| xdg-open "path" | Open folder/archive. "xdg-open /home/petry" will open home  |
+| xdg-open "file" | "xdg-open index.md" will open index.md form current folder  |
+

Package Management

| Command         | Description                                                 |
+|-----------------|-------------------------------------------------------------|
+| apt update      | Updates packages lists. Important before `apt upgrade`      | 
+| apt upgrade     | Actually updates the packages (apps).                       | 
+| apt search      | Searches for the specific app `apt search <appName>`.       | 
+| apt install     | Install app `apt install <appName>`.                        |
+| apt remove      | Remove app `apt remove <appName>`.                          |
+| apt purge       | Removes app and all dependencies `apt remove <appName>`.    |
+| dpkg -l         | Print all apps from packages.                               |
+| dpkg -r <app>   | Remove <app>.                                               |
+

Important files

  • cat /etc/apt/sources.list will print where system search for packages.

File management and editing

| Command         | Description                                                 |
+|-----------------|-------------------------------------------------------------|
+| cp              | Copy. `cp imput.md output.md`                               |
+| mv              | Move. `mv file.md /home/petry/Desktop`                      |
+| touch index.md  | Creates a new file                                          |
+| echo            | Print on screen. `echo "Hello, world!" > hello.md` to save. |
+| cat file.md     | Reads and prints file on terminal                           |
+| rm / rm -r      | Delete file / delete folder (may need to run as sudo)       |
+| code .          | Open directory on Visual Studio Code                        |
+| grep            | Search keyword in file (grep "keyword" file.md)             |
+| egrep           | Search with multiple keywords (egrep "zsh|bash" file.md)    |
+| cut             | Cut selected text inside file                               | 
+| sed             | Substitution (sed 's/texto1/texto2' index.md)               | 
+

Networking and processes

| Command                     | Description                                     |
+|-----------------------------|-------------------------------------------------|
+| top                         | Print system processes                          |
+| ps aux                      | Print all system processes                      |
+| ifconfig                    | Print network interfaces                        |
+| ip                          | Print network interfaces + IP and MAC addresses |
+| systemctl status networking | Print network status                            |  
+| systemctl start networking  | Network controls (start, stop, restart)         |
+| route                       | Print system routes (route -n)                  | 
+| netstat (netstat -l [list]) | Print network open doors and active connections |
+| dig +short <url>            | Print IP from from domain (dig +short hello.com)|
+

Important files

  • cat /etc/network/interfaces will print network configuration files.

Utility

| Command         | Description                                                 |
+|-----------------|-------------------------------------------------------------|
+| setxkbmap br    | Change keyboard language to <country>                       |
+| man <app>       | Print manual for <application>                              |
+| clear           | Clear terminal window                                       |
+| whereis <app>   | Print location if <application> files                       |
+| file hello.md   | Print file type (can be used with file name or file path)   |
+| xxd hello.md    | Print binaries from file (can be used with path)            |
+| curl URL        | Send GET request to URL. Try "curl wttr.in"                 |
+| curl -o URL     | Download content (alphabetic "o", not zero)                 |
+| !$              | Copy and paste last command entry, to command prompt        |
+

Remember! Those are not spells. We will get there...

Bonus! Using curl to convert images from the web

Define the output name and file extension after -o. Just like this:

curl -o output.png https://www.thehousedesigners.com/images/uploads/SiteImage-Landing-large-house-plans-1.webp

It works with .webp/.jpeg to .png

Web developers love the .webp/.webm. file format. It is smaller and loads faster. But content creators hate it. .webp/.webm doesn't open on preview apps.

This look shit... Don't worry. I'm working on a cURL post. Maybe after the dig and the traceroute commands.

Last Updated:
Contributors: Petry
+ + + diff --git a/tarot.html b/tarot.html new file mode 100644 index 0000000..13eeb28 --- /dev/null +++ b/tarot.html @@ -0,0 +1,33 @@ + + + + + + + + + ✨ Spellblog + + + + +

Tarot cards discovered:

NameIconSpell relation
Seven of Cups📟LaTeX PDF press specification
The Chariot🌌API enchantment with JavaScript
The Hermit🎋Set up Kali Linux and Metasploitable on VirtualBox
Ace of Wands🍵Intro on web security with Helmet.js
Two of Pentacles🎑Bash scriptage
The Sun🔮JavaScript cast specification
Ten of Cups🍙GitHub once and for all
Four of Cups📟Terminal commands
Five of CupsMarkdown cheat sheet

The Rider–Waite Tarotopen in new window.

+ + +