/*! * github-buttons v2.27.0 McShelby/hugo-theme-relearn#155 - make render() available on window.githubButtons * (c) 2023 なつき * @license BSD-2-Clause */(function(){"use strict";var e=window.document,a=e.location,i=window.Math,u=window.HTMLElement,r=window.XMLHttpRequest,y="github-button",j="https://"+"buttons.github.io"+"/buttons.html",n="github.com",$="https://api."+n,k=r&&"prototype"in r&&"withCredentials"in r.prototype,N=k&&u&&"attachShadow"in u.prototype&&!("prototype"in u.prototype.attachShadow),o=function(e,t){for(var n=0,s=e.length;n'}}},download:{heights:{16:{width:16,path:''}}},eye:{heights:{16:{width:16,path:''}}},heart:{heights:{16:{width:16,path:''}}},"issue-opened":{heights:{16:{width:16,path:''}}},"mark-github":{heights:{16:{width:16,path:''}}},package:{heights:{16:{width:16,path:''}}},play:{heights:{16:{width:16,path:''}}},"repo-forked":{heights:{16:{width:16,path:''}}},"repo-template":{heights:{16:{width:16,path:''}}},star:{heights:{16:{width:16,path:''}}}},D=function(e,t){e=g(e).replace(/^octicon-/,""),c(l,e)||(e="mark-github");var n=t>=24&&24 in l[e].heights?24:16,s=l[e].heights[n];return'"},m={},L=function(e,n){var s,o,i,a,c,l=m[e]||(m[e]=[]);if(l.push(n)>1)return;o=C(function(){for(delete m[e];n=l.shift();)n.apply(null,arguments)}),k?(i=new r,t(i,"abort",o),t(i,"error",o),t(i,"load",function(){var e;try{e=JSON.parse(this.responseText)}catch(e){o(e);return}o(this.status!==200,e)}),i.open("GET",e),i.send()):(s=this||window,s._=function(e){s._=null,o(e.meta.status!==200,e.data)},a=h(s.document)("script",{async:!0,src:e+(e.indexOf("?")!==-1?"&":"?")+"callback=_"}),c=function(){s._&&s._({meta:{}})},t(a,"load",c),t(a,"error",c),w(a,/de|m/,c),s.document.getElementsByTagName("head")[0].appendChild(a))},f=function(e,t,s){var o,i,a,r,c,l,m,p,d=h(e.ownerDocument),u=e.appendChild(d("style",{type:"text/css"})),f=H+T(t["data-color-scheme"]);if(u.styleSheet?u.styleSheet.cssText=f:u.appendChild(e.ownerDocument.createTextNode(f)),m=g(t["data-size"])==="large",r=d("a",{className:"btn",href:t.href,rel:"noopener",target:"_blank",title:t.title||void 0,"aria-label":t["aria-label"]||void 0,innerHTML:D(t["data-icon"],m?16:14)+" "},[d("span",{},[t["data-text"]||""])]),c=e.appendChild(d("div",{className:"widget"+(m?" widget-lg":"")},[r])),i=r.hostname.replace(/\.$/,""),("."+i).substring(i.length-n.length)!=="."+n){r.removeAttribute("href"),s(c);return}if(o=(" /"+r.pathname).split(/\/+/),((i===n||i==="gist."+n)&&o[3]==="archive"||i===n&&o[3]==="releases"&&(o[4]==="download"||o[4]==="latest"&&o[5]==="download")||i==="codeload."+n)&&(r.target="_top"),g(t["data-show-count"])!=="true"||i!==n||o[1]==="marketplace"||o[1]==="sponsors"||o[1]==="orgs"||o[1]==="users"||o[1]==="-"){s(c);return}if(!o[2]&&o[1])a="followers",l="?tab=followers";else if(!o[3]&&o[2])a="stargazers_count",l="/stargazers";else if(!o[4]&&o[3]==="subscription")a="subscribers_count",l="/watchers";else if(!o[4]&&o[3]==="fork")a="forks_count",l="/forks";else if(o[3]==="issues")a="open_issues_count",l="/issues";else{s(c);return}p=o[2]?"/repos/"+o[1]+"/"+o[2]:"/users/"+o[1],L.call(this,$+p,function(e,t){if(!e){var n=t[a];c.appendChild(d("a",{className:"social-count",href:t.html_url+l,rel:"noopener",target:"_blank","aria-label":n+" "+a.replace(/_count$/,"").replace("_"," ").slice(0,n<2?-1:void 0)+" on GitHub"},[(""+n).replace(/\B(?=(\d{3})+(?!\d))/g,",")]))}s(c)})},P=function(e){var t={href:e.href,title:e.title,"aria-label":e.getAttribute("aria-label")};return o(["icon","color-scheme","text","size","show-count"],function(n){var s="data-"+n;t[s]=e.getAttribute(s)}),t["data-text"]==null&&(t["data-text"]=e.textContent||e.innerText),t},p=window.devicePixelRatio||1,O=function(e){return(p>1?i.ceil(i.round(e*p)/p*2)/2:i.ceil(e))||0},B=function(e){var s,t=e.offsetWidth,n=e.offsetHeight;return e.getBoundingClientRect&&(s=e.getBoundingClientRect(),t=i.max(t,O(s.width)),n=i.max(n,O(s.height))),[t,n]},_=function(e,t){e.style.width=t[0]+"px",e.style.height=t[1]+"px"},x=function(n,s){if(n==null||s==null)return;if(n.getAttribute&&(n=P(n)),N){var o,i,a=E("span");f(a.attachShadow({mode:"closed"}),n,function(){s(a)})}else o=E("iframe",{src:"javascript:0",title:n.title||void 0,allowtransparency:!0,scrolling:"no",frameBorder:0}),_(o,[0,0]),o.style.border="none",i=function(){var a,t=o.contentWindow;try{a=t.document.body}catch{e.body.appendChild(o.parentNode.removeChild(o));return}d(o,"load",i),f.call(t,a,n,function(e){var t=B(e);o.parentNode.removeChild(o),v(o,"load",function(){_(o,t)}),o.src=j+"#"+(o.name=V(n)),s(o)})},t(o,"load",i),e.body.appendChild(o)};a.protocol+"//"+a.host+a.pathname===j?f(e.body,b(window.name||a.hash.replace(/^#/,"")),function(){}):I(function(){var t=e.querySelectorAll?e.querySelectorAll("a."+y):function(){var t=[];return o(e.getElementsByTagName("a"),function(e){(" "+e.className+" ").replace(/[ \t\n\f\r]+/g," ").indexOf(" "+y+" ")!==-1&&t.push(e)}),t}();o(t,function(e){x(e,function(t){e.parentNode.replaceChild(t,e)})})}),window.githubButtons={render:x}})()