diff --git "a/assets/index-DI4pfleg.js" "b/assets/index-DI4pfleg.js" new file mode 100644--- /dev/null +++ "b/assets/index-DI4pfleg.js" @@ -0,0 +1,5 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();const Ja="modulepreload",Qa=function(e){return"/"+e},no={},vn=function(t,l,n){let i=Promise.resolve();if(l&&l.length>0){let a=function(u){return Promise.all(u.map(w=>Promise.resolve(w).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),m=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));i=a(l.map(u=>{if(u=Qa(u),u in no)return;no[u]=!0;const w=u.endsWith(".css"),_=w?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${_}`))return;const h=document.createElement("link");if(h.rel=w?"stylesheet":Ja,w||(h.as="script"),h.crossOrigin="",h.href=u,m&&h.setAttribute("nonce",m),document.head.appendChild(h),w)return new Promise((M,S)=>{h.addEventListener("load",M),h.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(a){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=a,window.dispatchEvent(d),!d.defaultPrevented)throw a}return i.then(a=>{for(const d of a||[])d.status==="rejected"&&o(d.reason);return t().catch(o)})};var ls,ke,ur,sl,so,fr,hr,Fs,Nn,pn,pr,oi,Ys,Ks,jn={},Gn=[],Za=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ns=Array.isArray;function Jt(e,t){for(var l in t)e[l]=t[l];return e}function ri(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Xa(e,t,l){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?ls.call(arguments,2):l),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Wn(e,a,n,i,null)}function Wn(e,t,l,n,i){var o={type:e,props:t,key:l,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++ur,__i:-1,__u:0};return i==null&&ke.vnode!=null&&ke.vnode(o),o}function ge(e){return e.children}function Bn(e,t){this.props=e,this.context=t}function kl(e,t){if(t==null)return e.__?kl(e.__,e.__i+1):null;for(var l;tt&&sl.sort(hr),e=sl.shift(),t=sl.length,ec(e)}finally{sl.length=Yn.__r=0}}function _r(e,t,l,n,i,o,a,d,m,u,w){var _,h,M,S,R,$,H=n&&n.__k||Gn,k=t.length;for(m=tc(l,t,H,m,k),_=0;_0?a=e.__k[o]=Wn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,m=o+h,a.__=e,a.__b=e.__b+1,d=null,(u=a.__i=lc(a,l,m,_))!=-1&&(_--,(d=l[u])&&(d.__u|=2)),d==null||d.__v==null?(u==-1&&(i>w?h--:im?h--:h++,a.__u|=4))):e.__k[o]=null;if(_)for(o=0;o(w?1:0)){for(i=l-1,o=l+1;i>=0||o=0?i--:o++])!=null&&(2&u.__u)==0&&d==u.key&&m==u.type)return a}return-1}function oo(e,t,l){t[0]=="-"?e.setProperty(t,l??""):e[t]=l==null?"":typeof l!="number"||Za.test(t)?l:l+"px"}function An(e,t,l,n,i){var o,a;e:if(t=="style")if(typeof l=="string")e.style.cssText=l;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)l&&t in l||oo(e.style,t,"");if(l)for(t in l)n&&l[t]==n[t]||oo(e.style,t,l[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(pr,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=l,l?n?l[pn]=n[pn]:(l[pn]=oi,e.addEventListener(t,o?Ks:Ys,o)):e.removeEventListener(t,o?Ks:Ys,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=l??"";break e}catch{}typeof l=="function"||(l==null||l===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&l==1?"":l))}}function ro(e){return function(t){if(this.l){var l=this.l[t.type+e];if(t[Nn]==null)t[Nn]=oi++;else if(t[Nn]0?e:ns(e)?e.map(yr):e.constructor!==void 0?null:Jt({},e)}function nc(e,t,l,n,i,o,a,d,m){var u,w,_,h,M,S,R,$=l.props||jn,H=t.props,k=t.type;if(k=="svg"?i="http://www.w3.org/2000/svg":k=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u=l.__.length&&l.__.push({}),l.__[e]}function ue(e){return Kn=1,rc(xr,e)}function rc(e,t,l){var n=di(gn++,2);if(n.t=e,!n.__c&&(n.__=[xr(void 0,t),function(d){var m=n.__N?n.__N[0]:n.__[0],u=n.t(m,d);m!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=ze,!ze.__f)){var i=function(d,m,u){if(!n.__c.__H)return!0;var w=!1,_=n.__c.props!==d;if(n.__c.__H.__.some(function(M){if(M.__N){w=!0;var S=M.__[0];M.__=M.__N,M.__N=void 0,S!==M.__[0]&&(_=!0)}}),o){var h=o.call(this,d,m,u);return w?h||_:h}return!w||_};ze.__f=!0;var o=ze.shouldComponentUpdate,a=ze.componentWillUpdate;ze.componentWillUpdate=function(d,m,u){if(this.__e){var w=o;o=void 0,i(d,m,u),o=w}a&&a.call(this,d,m,u)},ze.shouldComponentUpdate=i}return n.__N||n.__}function Dt(e,t){var l=di(gn++,3);!Be.__s&&Sr(l.__H,t)&&(l.__=e,l.u=t,ze.__H.__h.push(l))}function vl(e){return Kn=5,Gt(function(){return{current:e}},[])}function Gt(e,t){var l=di(gn++,7);return Sr(l.__H,t)&&(l.__=e(),l.__H=t,l.__h=e),l.__}function ac(){for(var e;e=kr.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(In),t.__h.some(qs),t.__h=[]}catch(l){t.__h=[],Be.__e(l,e.__v)}}}Be.__b=function(e){ze=null,co&&co(e)},Be.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),mo&&mo(e,t)},Be.__r=function(e){uo&&uo(e),gn=0;var t=(ze=e.__c).__H;t&&(Hs===ze?(t.__h=[],ze.__h=[],t.__.some(function(l){l.__N&&(l.__=l.__N),l.u=l.__N=void 0})):(t.__h.some(In),t.__h.some(qs),t.__h=[],gn=0)),Hs=ze},Be.diffed=function(e){fo&&fo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(kr.push(t)!==1&&ao===Be.requestAnimationFrame||((ao=Be.requestAnimationFrame)||cc)(ac)),t.__H.__.some(function(l){l.u&&(l.__H=l.u,l.u=void 0)})),Hs=ze=null},Be.__c=function(e,t){t.some(function(l){try{l.__h.some(In),l.__h=l.__h.filter(function(n){return!n.__||qs(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Be.__e(n,l.__v)}}),ho&&ho(e,t)},Be.unmount=function(e){po&&po(e);var t,l=e.__c;l&&l.__H&&(l.__H.__.some(function(n){try{In(n)}catch(i){t=i}}),l.__H=void 0,t&&Be.__e(t,l.__v))};var _o=typeof requestAnimationFrame=="function";function cc(e){var t,l=function(){clearTimeout(n),_o&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(l,35);_o&&(t=requestAnimationFrame(l))}function In(e){var t=ze,l=e.__c;typeof l=="function"&&(e.__c=void 0,l()),ze=t}function qs(e){var t=ze;e.__c=e.__(),ze=t}function Sr(e,t){return!e||e.length!==t.length||t.some(function(l,n){return l!==e[n]})}function xr(e,t){return typeof t=="function"?t(e):t}const Mr="https://modelpulse.ifsp.dev",$n=new Map;function $t(e){if(!$n.has(e)){const t=fetch(Mr+e).then(async l=>{if(!l.ok){const n=await l.json().catch(()=>({}));throw $n.delete(e),new Error(n.detail||`Request failed (${l.status})`)}return l.json()});$n.set(e,t)}return $n.get(e)}const Yt={model:e=>$t(`/api/model/${e}`),author:e=>$t(`/api/author/${encodeURIComponent(e)}`),search:e=>$t(`/api/search?q=${encodeURIComponent(e)}`),leaderboards:()=>$t("/api/leaderboards"),hub:()=>$t("/api/hub"),dataset:e=>$t(`/api/dataset/${e}`),space:e=>$t(`/api/space/${e}`),searchAll:e=>$t(`/api/search/all?q=${encodeURIComponent(e)}`),boards:e=>$t(`/api/leaderboards/${e}`),newSpaces:()=>$t("/api/spaces/new"),meta:()=>$t("/api/meta")},dc=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),uc=new Intl.NumberFormat("en"),ce=e=>e==null?"–":dc.format(e),X=e=>e==null?"–":uc.format(Math.round(e)),Sl=e=>e==null?"–":`${e>=0?"+":"−"}${Math.abs(e*100)>=10?Math.abs(e*100).toFixed(0):Math.abs(e*100).toFixed(1)}%`,Tr=e=>e?e>=1e9?`${(e/1e9).toFixed(e>=1e10?0:1)}B params`:e>=1e6?`${(e/1e6).toFixed(0)}M params`:`${(e/1e3).toFixed(0)}K params`:null,Ht=(e,t={month:"short",day:"numeric",year:"numeric"})=>new Date(typeof e=="string"?e+(e.length===10?"T00:00:00Z":""):e).toLocaleDateString("en",{timeZone:"UTC",...t}),fc=e=>{if(e==null)return"–";const t=["th","st","nd","rd"],l=e%100;return e.toLocaleString("en")+(t[(l-20)%10]||t[l]||t[0])},zt=e=>e?e.replace(/-/g," "):"untagged",go=86400,Ql=e=>Date.parse(e+"T00:00:00Z")/1e3;function qn(e,t){const l=[],n=[];let i=null,o=null;for(let a=0;a=t&&(n-=e[i-t]),l.push(n/Math.min(i+1,t));return l}function hc(e){const t=e.dl_all.findIndex(o=>o!=null);if(t<0)return[];const l=e.dl_all[e.dl_all.length-1]??0,n=[];for(const[o,a]of[[1e3,"1K"],[1e4,"10K"],[1e5,"100K"],[1e6,"1M"],[1e7,"10M"],[1e8,"100M"],[1e9,"1B"]]){if((e.dl_all[t]??0)>=o){n.push({value:o,label:a,day:null,before:e.day[t]});continue}const d=e.dl_all.findIndex(m=>m!=null&&m>=o);if(d>=0)n.push({value:o,label:a,day:e.day[d],before:null});else if(n.push({value:o,label:a,day:null,before:null}),o>l*10)break}const i=n.map(o=>!!o.before).lastIndexOf(!0);return n.filter((o,a)=>!o.before||a===i)}const Jn=!/\.hf\.space$/.test(location.hostname);function wo(){var n;const e=new URLSearchParams(location.search),t={model:e.get("model")||void 0,dataset:e.get("dataset")||void 0,space:e.get("space")||void 0,author:e.get("author")||void 0,compare:(n=e.get("compare"))==null?void 0:n.split(",").filter(Boolean),view:e.get("view")||void 0},l=location.pathname.split("/").filter(Boolean).map(decodeURIComponent);return l[0]==="model"&&l.length>1?t.model=l.slice(1).join("/"):l[0]==="dataset"&&l.length>1?t.dataset=l.slice(1).join("/"):l[0]==="space"&&l.length>1?t.space=l.slice(1).join("/"):l[0]==="author"&&l[1]?t.author=l[1]:l[0]==="galaxy"?(t.view="galaxy",l.length>1&&(t.model=l.slice(1).join("/"))):l[0]==="wrapped"?(t.view="wrapped",l[1]&&(t.author=l[1])):l[0]==="report"&&(t.view="report"),t}const Rn=e=>e.split("/").map(encodeURIComponent).join("/");function Cr(e){var l;let t="/";return e.view==="galaxy"?t=e.model?`/galaxy/${Rn(e.model)}`:"/galaxy":e.view==="wrapped"?t=e.author?`/wrapped/${encodeURIComponent(e.author)}`:"/wrapped":e.view==="report"?t="/report":e.model?t=`/model/${Rn(e.model)}`:e.dataset?t=`/dataset/${Rn(e.dataset)}`:e.space?t=`/space/${Rn(e.space)}`:e.author&&(t=`/author/${encodeURIComponent(e.author)}`),t+((l=e.compare)!=null&&l.length?`?compare=${e.compare.join(",")}`:"")}function He(e){return Jn?Cr(e):"?"+Dr(e)}function Dr(e){var l;const t=new URLSearchParams;return e.model&&t.set("model",e.model),e.dataset&&t.set("dataset",e.dataset),e.space&&t.set("space",e.space),e.author&&t.set("author",e.author),(l=e.compare)!=null&&l.length&&t.set("compare",e.compare.join(",")),e.view&&t.set("view",e.view),t.toString().replace(/%2F/g,"/").replace(/%2C/g,",")}const Pr="https://huggingface.co/spaces/tardellirs/model-pulse",pc="https://modelpulse.ifsp.dev";function mc(e){return pc+Cr(e)}function Te(e,t=!1){var n;const l=Jn?He(e):location.pathname+He(e).replace(/^\?$/,"");if(t?history.replaceState(null,"",l):history.pushState(null,"",l),!Jn)try{(n=window.parent)==null||n.postMessage({queryString:Dr(e),hash:""},"https://huggingface.co")}catch{}window.dispatchEvent(new Event("routechange")),t||window.scrollTo({top:0})}function vo(e){e=e.trim();const t=e.match(/(?:huggingface\.co|hf\.co)\/(?:(spaces|datasets)\/)?([^/\s?#]+\/[^/\s?#]+)/);return t?{kind:t[1]==="spaces"?"space":t[1]==="datasets"?"dataset":"model",id:t[2]}:/^[\w.-]+\/[\w.-]+$/.test(e)?{kind:"model",id:e}:null}function _c(e){e=e.trim();const t=e.match(/(?:huggingface\.co|hf\.co)\/(?!spaces\/|datasets\/)([^/\s?#]+\/[^/\s?#]+)/);return t?t[1]:/^[\w.-]+\/[\w.-]+$/.test(e)?e:null}const fi=7*86400;function Lr(e,t){const l=new Map;for(let o=0;oo-a),i=e[e.length-1];return{t:n.map(o=>o+fi/2),v:n.map(o=>l.get(o)),partial:i-n[n.length-1]<6*86400}}const gc=!0,Ke="u-",wc="uplot",vc=Ke+"hz",yc=Ke+"vt",bc=Ke+"title",kc=Ke+"wrap",Sc=Ke+"under",xc=Ke+"over",Mc=Ke+"axis",yl=Ke+"off",Tc=Ke+"select",Cc=Ke+"cursor-x",Dc=Ke+"cursor-y",Pc=Ke+"cursor-pt",Lc=Ke+"legend",Ec=Ke+"live",Ac=Ke+"inline",$c=Ke+"series",Rc=Ke+"marker",yo=Ke+"label",Fc=Ke+"value",un="width",fn="height",cn="top",bo="bottom",Vl="left",Os="right",hi="#000",ko=hi+"0",zs="mousemove",So="mousedown",Ns="mouseup",xo="mouseenter",Mo="mouseleave",To="dblclick",Hc="resize",Oc="scroll",Co="change",Qn="dppxchange",pi="--",Zl=typeof window<"u",Js=Zl?document:null,Gl=Zl?window:null,zc=Zl?navigator:null;let _e,Fn;function Qs(){let e=devicePixelRatio;_e!=e&&(_e=e,Fn&&Xs(Co,Fn,Qs),Fn=matchMedia(`(min-resolution: ${_e-.001}dppx) and (max-resolution: ${_e+.001}dppx)`),bl(Co,Fn,Qs),Gl.dispatchEvent(new CustomEvent(Qn)))}function wt(e,t){if(t!=null){let l=e.classList;!l.contains(t)&&l.add(t)}}function Zs(e,t){let l=e.classList;l.contains(t)&&l.remove(t)}function Ae(e,t,l){e.style[t]=l+"px"}function Rt(e,t,l,n){let i=Js.createElement(e);return t!=null&&wt(i,t),l!=null&&l.insertBefore(i,n),i}function Tt(e,t){return Rt("div",e,t)}const Do=new WeakMap;function jt(e,t,l,n,i){let o="translate("+t+"px,"+l+"px)",a=Do.get(e);o!=a&&(e.style.transform=o,Do.set(e,o),t<0||l<0||t>n||l>i?wt(e,yl):Zs(e,yl))}const Po=new WeakMap;function Lo(e,t,l){let n=t+l,i=Po.get(e);n!=i&&(Po.set(e,n),e.style.background=t,e.style.borderColor=l)}const Eo=new WeakMap;function Ao(e,t,l,n){let i=t+""+l,o=Eo.get(e);i!=o&&(Eo.set(e,i),e.style.height=l+"px",e.style.width=t+"px",e.style.marginLeft=n?-t/2+"px":0,e.style.marginTop=n?-l/2+"px":0)}const mi={passive:!0},Nc={...mi,capture:!0};function bl(e,t,l,n){t.addEventListener(e,l,n?Nc:mi)}function Xs(e,t,l,n){t.removeEventListener(e,l,mi)}Zl&&Qs();function Ft(e,t,l,n){let i;l=l||0,n=n||t.length-1;let o=n<=2147483647;for(;n-l>1;)i=o?l+n>>1:vt((l+n)/2),t[i]{let o=-1,a=-1;for(let d=n;d<=i;d++)if(e(l[d])){o=d;break}for(let d=i;d>=n;d--)if(e(l[d])){a=d;break}return[o,a]}}const Ar=e=>e!=null,$r=e=>e!=null&&e>0,ss=Er(Ar),Wc=Er($r);function Bc(e,t,l,n=0,i=!1){let o=i?Wc:ss,a=i?$r:Ar;[t,l]=o(e,t,l);let d=e[t],m=e[t];if(t>-1)if(n==1)d=e[t],m=e[l];else if(n==-1)d=e[l],m=e[t];else for(let u=t;u<=l;u++){let w=e[u];a(w)&&(wm&&(m=w))}return[d??ye,m??-ye]}function is(e,t,l,n){let i=Fo(e),o=Fo(t);e==t&&(i==-1?(e*=l,t/=l):(e/=l,t*=l));let a=l==10?Qt:Rr,d=i==1?vt:Ct,m=o==1?Ct:vt,u=d(a(Ye(e))),w=m(a(Ye(t))),_=Yl(l,u),h=Yl(l,w);return l==10&&(u<0&&(_=be(_,-u)),w<0&&(h=be(h,-w))),n||l==2?(e=_*i,t=h*o):(e=zr(e,_),t=os(t,h)),[e,t]}function _i(e,t,l,n){let i=is(e,t,l,n);return e==0&&(i[0]=0),t==0&&(i[1]=0),i}const gi=.1,$o={mode:3,pad:gi},mn={pad:0,soft:null,mode:0},Ic={min:mn,max:mn};function Zn(e,t,l,n){return rs(l)?Ro(e,t,l):(mn.pad=l,mn.soft=n?0:null,mn.mode=n?3:0,Ro(e,t,Ic))}function he(e,t){return e??t}function Vc(e,t,l){for(t=he(t,0),l=he(l,e.length-1);t<=l;){if(e[t]!=null)return!0;t++}return!1}function Ro(e,t,l){let n=l.min,i=l.max,o=he(n.pad,0),a=he(i.pad,0),d=he(n.hard,-ye),m=he(i.hard,ye),u=he(n.soft,ye),w=he(i.soft,-ye),_=he(n.mode,0),h=he(i.mode,0),M=t-e,S=Qt(M),R=dt(Ye(e),Ye(t)),$=Qt(R),H=Ye($-S);(M<1e-24||H>10)&&(M=0,(e==0||t==0)&&(M=1e-24,_==2&&u!=ye&&(o=0),h==2&&w!=-ye&&(a=0)));let k=M||R||1e3,O=Qt(k),T=Yl(10,vt(O)),E=k*(M==0?e==0?.1:1:o),L=be(zr(e-E,T/10),24),N=e>=u&&(_==1||_==3&&L<=u||_==2&&L>=u)?u:ye,v=dt(d,L=N?N:Ot(N,L)),W=k*(M==0?t==0?.1:1:a),D=be(os(t+W,T/10),24),P=t<=w&&(h==1||h==3&&D>=w||h==2&&D<=w)?w:-ye,Y=Ot(m,D>P&&t<=P?P:dt(P,D));return v==Y&&v==0&&(Y=100),[v,Y]}const Uc=new Intl.NumberFormat(Zl?zc.language:"en-US"),wi=e=>Uc.format(e),yt=Math,Un=yt.PI,Ye=yt.abs,vt=yt.floor,Ge=yt.round,Ct=yt.ceil,Ot=yt.min,dt=yt.max,Yl=yt.pow,Fo=yt.sign,Qt=yt.log10,Rr=yt.log2,jc=(e,t=1)=>yt.sinh(e)*t,Ws=(e,t=1)=>yt.asinh(e/t),ye=1/0;function Ho(e){return(Qt((e^e>>31)-(e>>31))|0)+1}function ei(e,t,l){return Ot(dt(e,t),l)}function Fr(e){return typeof e=="function"}function ae(e){return Fr(e)?e:()=>e}const Gc=()=>{},Hr=e=>e,Or=(e,t)=>t,Yc=e=>null,Oo=e=>!0,zo=(e,t)=>e==t,Kc=/\.\d*?(?=9{6,}|0{6,})/gm,xl=e=>{if(Wr(e)||ol.has(e))return e;const t=`${e}`,l=t.match(Kc);if(l==null)return e;let n=l[0].length-1;if(t.indexOf("e-")!=-1){let[i,o]=t.split("e");return+`${xl(i)}e${o}`}return be(e,n)};function gl(e,t){return xl(be(xl(e/t))*t)}function os(e,t){return xl(Ct(xl(e/t))*t)}function zr(e,t){return xl(vt(xl(e/t))*t)}function be(e,t=0){if(Wr(e))return e;let l=10**t,n=e*l*(1+Number.EPSILON);return Ge(n)/l}const ol=new Map;function Nr(e){return((""+e).split(".")[1]||"").length}function wn(e,t,l,n){let i=[],o=n.map(Nr);for(let a=t;a=0?0:d)+(a>=o[u]?0:o[u]),h=e==10?w:be(w,_);i.push(h),ol.set(h,_)}}return i}const _n={},vi=[],Kl=[null,null],il=Array.isArray,Wr=Number.isInteger,qc=e=>e===void 0;function No(e){return typeof e=="string"}function rs(e){let t=!1;if(e!=null){let l=e.constructor;t=l==null||l==Object}return t}function Jc(e){return e!=null&&typeof e=="object"}const Qc=Object.getPrototypeOf(Uint8Array),Br="__proto__";function ql(e,t=rs){let l;if(il(e)){let n=e.find(i=>i!=null);if(il(n)||t(n)){l=Array(e.length);for(let i=0;io){for(i=a-1;i>=0&&e[i]==null;)e[i--]=null;for(i=a+1;ia-d)],i=n[0].length,o=new Map;for(let a=0;a"u"?e=>Promise.resolve().then(e):queueMicrotask;function sd(e){let t=e[0],l=t.length,n=Array(l);for(let o=0;ot[o]-t[a]);let i=[];for(let o=0;o=n&&e[i]==null;)i--;if(i<=n)return!0;const o=dt(1,vt((i-n+1)/t));for(let a=e[n],d=n+o;d<=i;d+=o){const m=e[d];if(m!=null){if(m<=a)return!1;a=m}}return!0}const Ir=["January","February","March","April","May","June","July","August","September","October","November","December"],Vr=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Ur(e){return e.slice(0,3)}const rd=Vr.map(Ur),ad=Ir.map(Ur),cd={MMMM:Ir,MMM:ad,WWWW:Vr,WWW:rd};function dn(e){return(e<10?"0":"")+e}function dd(e){return(e<10?"00":e<100?"0":"")+e}const ud={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>dn(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>dn(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>dn(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return t==0?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>dn(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>dn(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>dd(e.getMilliseconds())};function yi(e,t){t=t||cd;let l=[],n=/\{([a-z]+)\}|[^{]+/gi,i;for(;i=n.exec(e);)l.push(i[0][0]=="{"?ud[i[1]]:i[0]);return o=>{let a="";for(let d=0;de%1==0,Xn=[1,2,2.5,5],pd=wn(10,-32,0,Xn),Gr=wn(10,0,32,Xn),md=Gr.filter(jr),wl=pd.concat(Gr),bi=` +`,Yr="{YYYY}",Wo=bi+Yr,Kr="{M}/{D}",hn=bi+Kr,Hn=hn+"/{YY}",qr="{aa}",_d="{h}:{mm}",jl=_d+qr,Bo=bi+jl,Io=":{ss}",we=null;function Jr(e){let t=e*1e3,l=t*60,n=l*60,i=n*24,o=i*30,a=i*365,m=(e==1?wn(10,0,3,Xn).filter(jr):wn(10,-3,0,Xn)).concat([t,t*5,t*10,t*15,t*30,l,l*5,l*10,l*15,l*30,n,n*2,n*3,n*4,n*6,n*8,n*12,i,i*2,i*3,i*4,i*5,i*6,i*7,i*8,i*9,i*10,i*15,o,o*2,o*3,o*4,o*6,a,a*2,a*5,a*10,a*25,a*50,a*100]);const u=[[a,Yr,we,we,we,we,we,we,1],[i*28,"{MMM}",Wo,we,we,we,we,we,1],[i,Kr,Wo,we,we,we,we,we,1],[n,"{h}"+qr,Hn,we,hn,we,we,we,1],[l,jl,Hn,we,hn,we,we,we,1],[t,Io,Hn+" "+jl,we,hn+" "+jl,we,Bo,we,1],[e,Io+".{fff}",Hn+" "+jl,we,hn+" "+jl,we,Bo,we,1]];function w(_){return(h,M,S,R,$,H)=>{let k=[],O=$>=a,T=$>=o&&$=i?i:$,D=vt(S)-vt(L),P=v+D+os(L-v,W);k.push(P);let Y=_(P),I=Y.getHours()+Y.getMinutes()/l+Y.getSeconds()/n,Q=$/n,z=h.axes[M]._space,J=H/z;for(;P=be(P+$,e==1?0:3),!(P>R);)if(Q>1){let K=vt(be(I+Q,6))%24,re=_(P).getHours()-K;re>1&&(re=-1),P-=re*n,I=(I+Q)%24;let de=k[k.length-1];be((P-de)/$,3)*J>=.7&&k.push(P)}else k.push(P)}return k}}return[m,u,w]}const[gd,wd,vd]=Jr(1),[yd,bd,kd]=Jr(.001);wn(2,-53,53,[1]);function Vo(e,t){return e.map(l=>l.map((n,i)=>i==0||i==8||n==null?n:t(i==1||l[8]==0?n:l[1]+n)))}function Uo(e,t){return(l,n,i,o,a)=>{let d=t.find(S=>a>=S[0])||t[t.length-1],m,u,w,_,h,M;return n.map(S=>{let R=e(S),$=R.getFullYear(),H=R.getMonth(),k=R.getDate(),O=R.getHours(),T=R.getMinutes(),E=R.getSeconds(),L=$!=m&&d[2]||H!=u&&d[3]||k!=w&&d[4]||O!=_&&d[5]||T!=h&&d[6]||E!=M&&d[7]||d[1];return m=$,u=H,w=k,_=O,h=T,M=E,L(R)})}}function Sd(e,t){let l=yi(t);return(n,i,o,a,d)=>i.map(m=>l(e(m)))}function Bs(e,t,l){return new Date(e,t,l)}function jo(e,t){return t(e)}const xd="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function Go(e,t){return(l,n,i,o)=>o==null?pi:t(e(n))}function Md(e,t){let l=e.series[t];return l.width?l.stroke(e,t):l.points.width?l.points.stroke(e,t):null}function Td(e,t){return e.series[t].fill(e,t)}const Cd={show:!0,live:!0,isolate:!1,mount:Gc,markers:{show:!0,width:2,stroke:Md,fill:Td,dash:"solid"},idx:null,idxs:null,values:[]};function Dd(e,t){let l=e.cursor.points,n=Tt(),i=l.size(e,t);Ae(n,un,i),Ae(n,fn,i);let o=i/-2;Ae(n,"marginLeft",o),Ae(n,"marginTop",o);let a=l.width(e,t,i);return a&&Ae(n,"borderWidth",a),n}function Pd(e,t){let l=e.series[t].points;return l._fill||l._stroke}function Ld(e,t){let l=e.series[t].points;return l._stroke||l._fill}function Ed(e,t){return e.series[t].points.size}const Is=[0,0];function Ad(e,t,l){return Is[0]=t,Is[1]=l,Is}function On(e,t,l,n=!0){return i=>{i.button==0&&(!n||i.target==t)&&l(i)}}function Vs(e,t,l,n=!0){return i=>{(!n||i.target==t)&&l(i)}}const $d={show:!0,x:!0,y:!0,lock:!1,move:Ad,points:{one:!1,show:Dd,size:Ed,width:0,stroke:Ld,fill:Pd},bind:{mousedown:On,mouseup:On,click:On,dblclick:On,mousemove:Vs,mouseleave:Vs,mouseenter:Vs},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,l,n,i)=>n-i,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},Qr={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},ki=Ie({},Qr,{filter:Or}),Zr=Ie({},ki,{size:10}),Xr=Ie({},Qr,{show:!1}),Si='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',ea="bold "+Si,ta=1.5,Yo={show:!0,scale:"x",stroke:hi,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:ea,side:2,grid:ki,ticks:Zr,border:Xr,font:Si,lineGap:ta,rotate:0},Rd="Value",Fd="Time",Ko={show:!0,scale:"x",auto:!1,sorted:1,min:ye,max:-ye,idxs:[]};function Hd(e,t,l,n,i){return t.map(o=>o==null?"":wi(o))}function Od(e,t,l,n,i,o,a){let d=[],m=ol.get(i)||0;l=a?l:be(os(l,i),m);for(let u=l;u<=n;u=be(u+i,m))d.push(Object.is(u,-0)?0:u);return d}function ti(e,t,l,n,i,o,a){const d=[],m=e.scales[e.axes[t].scale].log,u=m==10?Qt:Rr,w=vt(u(l));i=Yl(m,w),m==10&&(i=wl[Ft(i,wl)]);let _=l,h=i*m;m==10&&(h=wl[Ft(h,wl)]);do d.push(_),_=_+i,m==10&&!ol.has(_)&&(_=be(_,ol.get(i))),_>=h&&(i=_,h=i*m,m==10&&(h=wl[Ft(h,wl)]));while(_<=n);return d}function zd(e,t,l,n,i,o,a){let m=e.scales[e.axes[t].scale].asinh,u=n>m?ti(e,t,dt(m,l),n,i):[m],w=n>=0&&l<=0?[0]:[];return(l<-m?ti(e,t,dt(m,-n),-l,i):[m]).reverse().map(h=>-h).concat(w,u)}const la=/./,Nd=/[12357]/,Wd=/[125]/,qo=/1/,li=(e,t,l,n)=>e.map((i,o)=>t==4&&i==0||o%n==0&&l.test(i.toExponential()[i<0?1:0])?i:null);function Bd(e,t,l,n,i){let o=e.axes[l],a=o.scale,d=e.scales[a],m=e.valToPos,u=o._space,w=m(10,a),_=m(9,a)-w>=u?la:m(7,a)-w>=u?Nd:m(5,a)-w>=u?Wd:qo;if(_==qo){let h=Ye(m(1,a)-w);if(hi,Zo={show:!0,auto:!0,sorted:0,gaps:na,alpha:1,facets:[Ie({},Qo,{scale:"x"}),Ie({},Qo,{scale:"y"})]},Xo={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:na,alpha:1,points:{show:jd,filter:null},values:null,min:ye,max:-ye,idxs:[],path:null,clip:null};function Gd(e,t,l,n,i){return l/10}const sa={time:gc,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Yd=Ie({},sa,{time:!1,ori:1}),er={};function ia(e,t){let l=er[e];return l||(l={key:e,plots:[],sub(n){l.plots.push(n)},unsub(n){l.plots=l.plots.filter(i=>i!=n)},pub(n,i,o,a,d,m,u){for(let w=0;w{let H=a.pxRound;const k=u.dir*(u.ori==0?1:-1),O=u.ori==0?Xl:en;let T,E;k==1?(T=l,E=n):(T=n,E=l);let L=H(_(d[T],u,R,M)),N=H(h(m[T],w,$,S)),v=H(_(d[E],u,R,M)),W=H(h(o==1?w.max:w.min,w,$,S)),D=new Path2D(i);return O(D,v,W),O(D,L,W),O(D,L,N),D})}function as(e,t,l,n,i,o){let a=null;if(e.length>0){a=new Path2D;const d=t==0?us:Ti;let m=l;for(let _=0;_h[0]){let M=h[0]-m;M>0&&d(a,m,n,M,n+o),m=h[1]}}let u=l+i-m,w=10;u>0&&d(a,m,n-w/2,u,n+o+w)}return a}function qd(e,t,l){let n=e[e.length-1];n&&n[0]==t?n[1]=l:e.push([t,l])}function Mi(e,t,l,n,i,o,a){let d=[],m=e.length;for(let u=i==1?l:n;u>=l&&u<=n;u+=i)if(t[u]===null){let _=u,h=u;if(i==1)for(;++u<=n&&t[u]===null;)h=u;else for(;--u>=l&&t[u]===null;)h=u;let M=o(e[_]),S=h==_?M:o(e[h]),R=_-i;M=a<=0&&R>=0&&R=0&&H>=0&&H=M&&d.push([M,S])}return d}function tr(e){return e==0?Hr:e==1?Ge:t=>gl(t,e)}function oa(e){let t=e==0?cs:ds,l=e==0?(i,o,a,d,m,u)=>{i.arcTo(o,a,d,m,u)}:(i,o,a,d,m,u)=>{i.arcTo(a,o,m,d,u)},n=e==0?(i,o,a,d,m)=>{i.rect(o,a,d,m)}:(i,o,a,d,m)=>{i.rect(a,o,m,d)};return(i,o,a,d,m,u=0,w=0)=>{u==0&&w==0?n(i,o,a,d,m):(u=Ot(u,d/2,m/2),w=Ot(w,d/2,m/2),t(i,o+u,a),l(i,o+d,a,o+d,a+m,u),l(i,o+d,a+m,o,a+m,w),l(i,o,a+m,o,a,w),l(i,o,a,o+d,a,u),i.closePath())}}const cs=(e,t,l)=>{e.moveTo(t,l)},ds=(e,t,l)=>{e.moveTo(l,t)},Xl=(e,t,l)=>{e.lineTo(t,l)},en=(e,t,l)=>{e.lineTo(l,t)},us=oa(0),Ti=oa(1),ra=(e,t,l,n,i,o)=>{e.arc(t,l,n,i,o)},aa=(e,t,l,n,i,o)=>{e.arc(l,t,n,i,o)},ca=(e,t,l,n,i,o,a)=>{e.bezierCurveTo(t,l,n,i,o,a)},da=(e,t,l,n,i,o,a)=>{e.bezierCurveTo(l,t,i,n,a,o)};function ua(e){return(t,l,n,i,o)=>Ml(t,l,(a,d,m,u,w,_,h,M,S,R,$)=>{let{pxRound:H,points:k}=a,O,T;u.ori==0?(O=cs,T=ra):(O=ds,T=aa);const E=be(k.width*_e,3);let L=(k.size-k.width)/2*_e,N=be(L*2,3),v=new Path2D,W=new Path2D,{left:D,top:P,width:Y,height:I}=t.bbox;us(W,D-N,P-N,Y+N*2,I+N*2);const Q=z=>{if(m[z]!=null){let J=H(_(d[z],u,R,M)),K=H(h(m[z],w,$,S));O(v,J+L,K),T(v,J,K,L,0,Un*2)}};if(o)o.forEach(Q);else for(let z=n;z<=i;z++)Q(z);return{stroke:E>0?v:null,fill:v,clip:W,flags:Jl|ni}})}function fa(e){return(t,l,n,i,o,a)=>{n!=i&&(o!=n&&a!=n&&e(t,l,n),o!=i&&a!=i&&e(t,l,i),e(t,l,a))}}const Jd=fa(Xl),Qd=fa(en);function ha(e){const t=he(e==null?void 0:e.alignGaps,0);return(l,n,i,o)=>Ml(l,n,(a,d,m,u,w,_,h,M,S,R,$)=>{[i,o]=ss(m,i,o);let H=a.pxRound,k=I=>H(_(I,u,R,M)),O=I=>H(h(I,w,$,S)),T,E;u.ori==0?(T=Xl,E=Jd):(T=en,E=Qd);const L=u.dir*(u.ori==0?1:-1),N={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Jl},v=N.stroke;let W=!1;if(o-i>=R*4){let I=j=>l.posToVal(j,u.key,!0),Q=null,z=null,J,K,Ne,oe=k(d[L==1?i:o]),re=k(d[i]),de=k(d[o]),te=I(L==1?re+1:de-1);for(let j=L==1?i:o;j>=i&&j<=o;j+=L){let Ce=d[j],y=(L==1?Cete)?oe:k(Ce),x=m[j];y==oe?x!=null?(K=x,Q==null?(T(v,y,O(K)),J=Q=z=K):Kz&&(z=K)):x===null&&(W=!0):(Q!=null&&E(v,oe,O(Q),O(z),O(J),O(K)),x!=null?(K=x,T(v,y,O(K)),Q=z=J=K):(Q=z=null,x===null&&(W=!0)),oe=y,te=I(oe+L))}Q!=null&&Q!=z&&Ne!=oe&&E(v,oe,O(Q),O(z),O(J),O(K))}else for(let I=L==1?i:o;I>=i&&I<=o;I+=L){let Q=m[I];Q===null?W=!0:Q!=null&&T(v,k(d[I]),O(Q))}let[P,Y]=xi(l,n);if(a.fill!=null||P!=0){let I=N.fill=new Path2D(v),Q=a.fillTo(l,n,a.min,a.max,P),z=O(Q),J=k(d[i]),K=k(d[o]);L==-1&&([K,J]=[J,K]),T(I,K,z),T(I,J,z)}if(!a.spanGaps){let I=[];W&&I.push(...Mi(d,m,i,o,L,k,t)),N.gaps=I=a.gaps(l,n,i,o,I),N.clip=as(I,u.ori,M,S,R,$)}return Y!=0&&(N.band=Y==2?[Zt(l,n,i,o,v,-1),Zt(l,n,i,o,v,1)]:Zt(l,n,i,o,v,Y)),N})}function Zd(e){const t=he(e.align,1),l=he(e.ascDesc,!1),n=he(e.alignGaps,0),i=he(e.extend,!1);return(o,a,d,m)=>Ml(o,a,(u,w,_,h,M,S,R,$,H,k,O)=>{[d,m]=ss(_,d,m);let T=u.pxRound,{left:E,width:L}=o.bbox,N=re=>T(S(re,h,k,$)),v=re=>T(R(re,M,O,H)),W=h.ori==0?Xl:en;const D={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Jl},P=D.stroke,Y=h.dir*(h.ori==0?1:-1);let I=v(_[Y==1?d:m]),Q=N(w[Y==1?d:m]),z=Q,J=Q;i&&t==-1&&(J=E,W(P,J,I)),W(P,Q,I);for(let re=Y==1?d:m;re>=d&&re<=m;re+=Y){let de=_[re];if(de==null)continue;let te=N(w[re]),j=v(de);t==1?W(P,te,I):W(P,z,j),W(P,te,j),I=j,z=te}let K=z;i&&t==1&&(K=E+L,W(P,K,I));let[Ne,oe]=xi(o,a);if(u.fill!=null||Ne!=0){let re=D.fill=new Path2D(P),de=u.fillTo(o,a,u.min,u.max,Ne),te=v(de);W(re,K,te),W(re,J,te)}if(!u.spanGaps){let re=[];re.push(...Mi(w,_,d,m,Y,N,n));let de=u.width*_e/2,te=l||t==1?de:-de,j=l||t==-1?-de:de;re.forEach(Ce=>{Ce[0]+=te,Ce[1]+=j}),D.gaps=re=u.gaps(o,a,d,m,re),D.clip=as(re,h.ori,$,H,k,O)}return oe!=0&&(D.band=oe==2?[Zt(o,a,d,m,P,-1),Zt(o,a,d,m,P,1)]:Zt(o,a,d,m,P,oe)),D})}function lr(e,t,l,n,i,o,a=ye){if(e.length>1){let d=null;for(let m=0,u=1/0;m{}),{fill:_,stroke:h}=u;return(M,S,R,$)=>Ml(M,S,(H,k,O,T,E,L,N,v,W,D,P)=>{let Y=H.pxRound,I=l,Q=n*_e,z=d*_e,J=m*_e,K,Ne;T.ori==0?[K,Ne]=o(M,S):[Ne,K]=o(M,S);const oe=T.dir*(T.ori==0?1:-1);let re=T.ori==0?us:Ti,de=T.ori==0?w:(U,Me,je,Cl,cl,Nt,dl)=>{w(U,Me,je,cl,Cl,dl,Nt)},te=he(M.bands,vi).find(U=>U.series[0]==S),j=te!=null?te.dir:0,Ce=H.fillTo(M,S,H.min,H.max,j),Oe=Y(N(Ce,E,P,W)),y,x,le,pe=D,Z=Y(H.width*_e),De=!1,Ve=null,Se=null,Ue=null,xe=null;_!=null&&(Z==0||h!=null)&&(De=!0,Ve=_.values(M,S,R,$),Se=new Map,new Set(Ve).forEach(U=>{U!=null&&Se.set(U,new Path2D)}),Z>0&&(Ue=h.values(M,S,R,$),xe=new Map,new Set(Ue).forEach(U=>{U!=null&&xe.set(U,new Path2D)})));let{x0:qe,size:ht}=u;if(qe!=null&&ht!=null){I=1,k=qe.values(M,S,R,$),qe.unit==2&&(k=k.map(je=>M.posToVal(v+je*D,T.key,!0)));let U=ht.values(M,S,R,$);ht.unit==2?x=U[0]*D:x=L(U[0],T,D,v)-L(0,T,D,v),pe=lr(k,O,L,T,D,v,pe),le=pe-x+Q}else pe=lr(k,O,L,T,D,v,pe),le=pe*a+Q,x=pe-le;le<1&&(le=0),Z>=x/2&&(Z=0),le<5&&(Y=Hr);let kn=le>0,rl=pe-le-(kn?Z:0);x=Y(ei(rl,J,z)),y=(I==0?x/2:I==oe?0:x)-I*oe*((I==0?Q/2:0)+(kn?Z/2:0));const ot={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Tl=De?null:new Path2D;let Kt=null;if(te!=null)Kt=M.data[te.series[1]];else{let{y0:U,y1:Me}=u;U!=null&&Me!=null&&(O=Me.values(M,S,R,$),Kt=U.values(M,S,R,$))}let al=K*x,se=Ne*x;for(let U=oe==1?R:$;U>=R&&U<=$;U+=oe){let Me=O[U];if(Me==null)continue;if(Kt!=null){let ut=Kt[U]??0;if(Me-ut==0)continue;Oe=N(ut,E,P,W)}let je=T.distr!=2||u!=null?k[U]:U,Cl=L(je,T,D,v),cl=N(he(Me,Ce),E,P,W),Nt=Y(Cl-y),dl=Y(dt(cl,Oe)),pt=Y(Ot(cl,Oe)),bt=dl-pt;if(Me!=null){let ut=Me<0?se:al,Pt=Me<0?al:se;De?(Z>0&&Ue[U]!=null&&re(xe.get(Ue[U]),Nt,pt+vt(Z/2),x,dt(0,bt-Z),ut,Pt),Ve[U]!=null&&re(Se.get(Ve[U]),Nt,pt+vt(Z/2),x,dt(0,bt-Z),ut,Pt)):re(Tl,Nt,pt+vt(Z/2),x,dt(0,bt-Z),ut,Pt),de(M,S,U,Nt-Z/2,pt,x+Z,bt)}}return Z>0?ot.stroke=De?xe:Tl:De||(ot._fill=H.width==0?H._fill:H._stroke??H._fill,ot.width=0),ot.fill=De?Se:Tl,ot})}function eu(e,t){const l=he(t==null?void 0:t.alignGaps,0);return(n,i,o,a)=>Ml(n,i,(d,m,u,w,_,h,M,S,R,$,H)=>{[o,a]=ss(u,o,a);let k=d.pxRound,O=K=>k(h(K,w,$,S)),T=K=>k(M(K,_,H,R)),E,L,N;w.ori==0?(E=cs,N=Xl,L=ca):(E=ds,N=en,L=da);const v=w.dir*(w.ori==0?1:-1);let W=O(m[v==1?o:a]),D=W,P=[],Y=[];for(let K=v==1?o:a;K>=o&&K<=a;K+=v)if(u[K]!=null){let oe=m[K],re=O(oe);P.push(D=re),Y.push(T(u[K]))}const I={stroke:e(P,Y,E,N,L,k),fill:null,clip:null,band:null,gaps:null,flags:Jl},Q=I.stroke;let[z,J]=xi(n,i);if(d.fill!=null||z!=0){let K=I.fill=new Path2D(Q),Ne=d.fillTo(n,i,d.min,d.max,z),oe=T(Ne);N(K,D,oe),N(K,W,oe)}if(!d.spanGaps){let K=[];K.push(...Mi(m,u,o,a,v,O,l)),I.gaps=K=d.gaps(n,i,o,a,K),I.clip=as(K,w.ori,S,R,$,H)}return J!=0&&(I.band=J==2?[Zt(n,i,o,a,Q,-1),Zt(n,i,o,a,Q,1)]:Zt(n,i,o,a,Q,J)),I})}function tu(e){return eu(lu,e)}function lu(e,t,l,n,i,o){const a=e.length;if(a<2)return null;const d=new Path2D;if(l(d,e[0],t[0]),a==2)n(d,e[1],t[1]);else{let m=Array(a),u=Array(a-1),w=Array(a-1),_=Array(a-1);for(let h=0;h0!=u[h]>0?m[h]=0:(m[h]=3*(_[h-1]+_[h])/((2*_[h]+_[h-1])/u[h-1]+(_[h]+2*_[h-1])/u[h]),isFinite(m[h])||(m[h]=0));m[a-1]=u[a-2];for(let h=0;h{lt.pxRatio=_e}));const nu=ha(),su=ua();function sr(e,t,l,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((o,a)=>ii(o,a,t,l))}function iu(e,t){return e.map((l,n)=>n==0?{}:Ie({},t,l))}function ii(e,t,l,n){return Ie({},t==0?l:n,e)}function pa(e,t,l){return t==null?Kl:[t,l]}const ou=pa;function ru(e,t,l){return t==null?Kl:Zn(t,l,gi,!0)}function ma(e,t,l,n){return t==null?Kl:is(t,l,e.scales[n].log,!1)}const au=ma;function _a(e,t,l,n){return t==null?Kl:_i(t,l,e.scales[n].log,!1)}const cu=_a;function du(e,t,l,n,i){let o=dt(Ho(e),Ho(t)),a=t-e,d=Ft(i/n*a,l);do{let m=l[d],u=n*m/a;if(u>=i&&o+(m<5?ol.get(m):0)<=17)return[m,u]}while(++d(t=Ge((l=+i)*_e))+"px"),[e,t,l]}function uu(e){e.show&&[e.font,e.labelFont].forEach(t=>{let l=be(t[2]*_e,1);t[0]=t[0].replace(/[0-9.]+px/,l+"px"),t[1]=l})}function lt(e,t,l){const n={mode:he(e.mode,1)},i=n.mode;function o(r,c,f,p){let g=c.valToPct(r);return p+f*(c.dir==-1?1-g:g)}function a(r,c,f,p){let g=c.valToPct(r);return p+f*(c.dir==-1?g:1-g)}function d(r,c,f,p){return c.ori==0?o(r,c,f,p):a(r,c,f,p)}n.valToPosH=o,n.valToPosV=a;let m=!1;n.status=0;const u=n.root=Tt(wc);if(e.id!=null&&(u.id=e.id),wt(u,e.class),e.title){let r=Tt(bc,u);r.textContent=e.title}const w=Rt("canvas"),_=n.ctx=w.getContext("2d"),h=Tt(kc,u);bl("click",h,r=>{r.target===S&&(Pe!=zl||$e!=Nl)&&st.click(n,r)},!0);const M=n.under=Tt(Sc,h);h.appendChild(w);const S=n.over=Tt(xc,h);e=ql(e);const R=+he(e.pxAlign,1),$=tr(R);(e.plugins||[]).forEach(r=>{r.opts&&(e=r.opts(n,e)||e)});const H=e.ms||.001,k=n.series=i==1?sr(e.series||[],Ko,Xo,!1):iu(e.series||[null],Zo),O=n.axes=sr(e.axes||[],Yo,Jo,!0),T=n.scales={},E=n.bands=e.bands||[];E.forEach(r=>{r.fill=ae(r.fill||null),r.dir=he(r.dir,-1)});const L=i==2?k[1].facets[0].scale:k[0].scale,N={axes:Fa,series:La},v=(e.drawOrder||["axes","series"]).map(r=>N[r]);function W(r){const c=r.distr==3?f=>Qt(f>0?f:r.clamp(n,f,r.min,r.max,r.key)):r.distr==4?f=>Ws(f,r.asinh):r.distr==100?f=>r.fwd(f):f=>f;return f=>{let p=c(f),{_min:g,_max:b}=r,C=b-g;return(p-g)/C}}function D(r){let c=T[r];if(c==null){let f=(e.scales||_n)[r]||_n;if(f.from!=null){D(f.from);let p=Ie({},T[f.from],f,{key:r});p.valToPct=W(p),T[r]=p}else{c=T[r]=Ie({},r==L?sa:Yd,f),c.key=r;let p=c.time,g=c.range,b=il(g);if((r!=L||i==2&&!p)&&(b&&(g[0]==null||g[1]==null)&&(g={min:g[0]==null?$o:{mode:1,hard:g[0],soft:g[0]},max:g[1]==null?$o:{mode:1,hard:g[1],soft:g[1]}},b=!1),!b&&rs(g))){let C=g;g=(A,F,B)=>F==null?Kl:Zn(F,B,C)}c.range=ae(g||(p?ou:r==L?c.distr==3?au:c.distr==4?cu:pa:c.distr==3?ma:c.distr==4?_a:ru)),c.auto=ae(b?!1:c.auto),c.clamp=ae(c.clamp||Gd),c._min=c._max=null,c.valToPct=W(c)}}}D("x"),D("y"),i==1&&k.forEach(r=>{D(r.scale)}),O.forEach(r=>{D(r.scale)});for(let r in e.scales)D(r);const P=T[L],Y=P.distr;let I,Q;P.ori==0?(wt(u,vc),I=o,Q=a):(wt(u,yc),I=a,Q=o);const z={};for(let r in T){let c=T[r];(c.min!=null||c.max!=null)&&(z[r]={min:c.min,max:c.max},c.min=c.max=null)}const J=e.tzDate||(r=>new Date(Ge(r/H))),K=e.fmtDate||yi,Ne=H==1?vd(J):kd(J),oe=Uo(J,Vo(H==1?wd:bd,K)),re=Go(J,jo(xd,K)),de=[],te=n.legend=Ie({},Cd,e.legend),j=n.cursor=Ie({},$d,{drag:{y:i==2}},e.cursor),Ce=te.show,Oe=j.show,y=te.markers;te.idxs=de,y.width=ae(y.width),y.dash=ae(y.dash),y.stroke=ae(y.stroke),y.fill=ae(y.fill);let x,le,pe,Z=[],De=[],Ve,Se=!1,Ue={};if(te.live){const r=k[1]?k[1].values:null;Se=r!=null,Ve=Se?r(n,1,0):{_:0};for(let c in Ve)Ue[c]=pi}if(Ce)if(x=Rt("table",Lc,u),pe=Rt("tbody",null,x),te.mount(n,x),Se){le=Rt("thead",null,x,pe);let r=Rt("tr",null,le);Rt("th",null,r);for(var xe in Ve)Rt("th",yo,r).textContent=xe}else wt(x,Ac),te.live&&wt(x,Ec);const qe={show:!0},ht={show:!1};function kn(r,c){if(c==0&&(Se||!te.live||i==2))return Kl;let f=[],p=Rt("tr",$c,pe,pe.childNodes[c]);wt(p,r.class),r.show||wt(p,yl);let g=Rt("th",null,p);if(y.show){let A=Tt(Rc,g);if(c>0){let F=y.width(n,c);F&&(A.style.border=F+"px "+y.dash(n,c)+" "+y.stroke(n,c)),A.style.background=y.fill(n,c)}}let b=Tt(yo,g);r.label instanceof HTMLElement?b.appendChild(r.label):b.textContent=r.label,c>0&&(y.show||(b.style.color=r.width>0?y.stroke(n,c):y.fill(n,c)),ot("click",g,A=>{if(j._lock)return;fl(A);let F=k.indexOf(r);if((A.ctrlKey||A.metaKey)!=te.isolate){let B=k.some((V,G)=>G>0&&G!=F&&V.show);k.forEach((V,G)=>{G>0&&Bt(G,B?G==F?qe:ht:qe,!0,We.setSeries)})}else Bt(F,{show:!r.show},!0,We.setSeries)},!1),Pl&&ot(xo,g,A=>{j._lock||(fl(A),Bt(k.indexOf(r),Bl,!0,We.setSeries))},!1));for(var C in Ve){let A=Rt("td",Fc,p);A.textContent="--",f.push(A)}return[p,f]}const rl=new Map;function ot(r,c,f,p=!0){const g=rl.get(c)||{},b=j.bind[r](n,c,f,p);b&&(bl(r,c,g[r]=b),rl.set(c,g))}function Tl(r,c,f){const p=rl.get(c)||{};for(let g in p)(r==null||g==r)&&(Xs(g,c,p[g]),delete p[g]);r==null&&rl.delete(c)}let Kt=0,al=0,se=0,U=0,Me=0,je=0,Cl=Me,cl=je,Nt=se,dl=U,pt=0,bt=0,ut=0,Pt=0;n.bbox={};let fs=!1,Sn=!1,Dl=!1,ul=!1,xn=!1,kt=!1;function hs(r,c,f){(f||r!=n.width||c!=n.height)&&Ci(r,c),Rl(!1),Dl=!0,Sn=!0,Fl()}function Ci(r,c){n.width=Kt=se=r,n.height=al=U=c,Me=je=0,Sa(),xa();let f=n.bbox;pt=f.left=gl(Me*_e,.5),bt=f.top=gl(je*_e,.5),ut=f.width=gl(se*_e,.5),Pt=f.height=gl(U*_e,.5)}const ya=3;function ba(){let r=!1,c=0;for(;!r;){c++;let f=$a(c),p=Ra(c);r=c==ya||f&&p,r||(Ci(n.width,n.height),Sn=!0)}}function ka({width:r,height:c}){hs(r,c)}n.setSize=ka;function Sa(){let r=!1,c=!1,f=!1,p=!1;O.forEach((g,b)=>{if(g.show&&g._show){let{side:C,_size:A}=g,F=C%2,B=g.label!=null?g.labelSize:0,V=A+B;V>0&&(F?(se-=V,C==3?(Me+=V,p=!0):f=!0):(U-=V,C==0?(je+=V,r=!0):c=!0))}}),hl[0]=r,hl[1]=f,hl[2]=c,hl[3]=p,se-=Xt[1]+Xt[3],Me+=Xt[3],U-=Xt[2]+Xt[0],je+=Xt[0]}function xa(){let r=Me+se,c=je+U,f=Me,p=je;function g(b,C){switch(b){case 1:return r+=C,r-C;case 2:return c+=C,c-C;case 3:return f-=C,f+C;case 0:return p-=C,p+C}}O.forEach((b,C)=>{if(b.show&&b._show){let A=b.side;b._pos=g(A,b._size),b.label!=null&&(b._lpos=g(A,b.labelSize))}})}if(j.dataIdx==null){let r=j.hover,c=r.skip=new Set(r.skip??[]);c.add(void 0);let f=r.prox=ae(r.prox),p=r.bias??(r.bias=0);j.dataIdx=(g,b,C,A)=>{if(b==0)return C;let F=C,B=f(g,b,C,A)??ye,V=B>=0&&B0;)c.has(fe[q])||(ie=q);if(p==0||p==1)for(q=C;ee==null&&q++B&&(F=null);return F}}const fl=r=>{j.event=r};j.idxs=de,j._lock=!1;let it=j.points;it.show=ae(it.show),it.size=ae(it.size),it.stroke=ae(it.stroke),it.width=ae(it.width),it.fill=ae(it.fill);const Wt=n.focus=Ie({},e.focus||{alpha:.3},j.focus),Pl=Wt.prox>=0,Ll=Pl&&it.one;let St=[],El=[],Al=[];function Di(r,c){let f=it.show(n,c);if(f instanceof HTMLElement)return wt(f,Pc),wt(f,r.class),jt(f,-10,-10,se,U),S.insertBefore(f,St[c]),f}function Pi(r,c){if(i==1||c>0){let f=i==1&&T[r.scale].time,p=r.value;r.value=f?No(p)?Go(J,jo(p,K)):p||re:p||Vd,r.label=r.label||(f?Fd:Rd)}if(Ll||c>0){r.width=r.width==null?1:r.width,r.paths=r.paths||nu||Yc,r.fillTo=ae(r.fillTo||Kd),r.pxAlign=+he(r.pxAlign,R),r.pxRound=tr(r.pxAlign),r.stroke=ae(r.stroke||null),r.fill=ae(r.fill||null),r._stroke=r._fill=r._paths=r._focus=null;let f=Ud(dt(1,r.width),1),p=r.points=Ie({},{size:f,width:dt(1,f*.2),stroke:r.stroke,space:f*2,paths:su,_stroke:null,_fill:null},r.points);p.show=ae(p.show),p.filter=ae(p.filter),p.fill=ae(p.fill),p.stroke=ae(p.stroke),p.paths=ae(p.paths),p.pxAlign=r.pxAlign}if(Ce){let f=kn(r,c);Z.splice(c,0,f[0]),De.splice(c,0,f[1]),te.values.push(null)}if(Oe){de.splice(c,0,null);let f=null;Ll?c==0&&(f=Di(r,c)):c>0&&(f=Di(r,c)),St.splice(c,0,f),El.splice(c,0,0),Al.splice(c,0,0)}et("addSeries",c)}function Ma(r,c){c=c??k.length,r=i==1?ii(r,c,Ko,Xo):ii(r,c,{},Zo),k.splice(c,0,r),Pi(k[c],c)}n.addSeries=Ma;function Ta(r){if(k.splice(r,1),Ce){te.values.splice(r,1),De.splice(r,1);let c=Z.splice(r,1)[0];Tl(null,c.firstChild),c.remove()}Oe&&(de.splice(r,1),St.splice(r,1)[0].remove(),El.splice(r,1),Al.splice(r,1)),et("delSeries",r)}n.delSeries=Ta;const hl=[!1,!1,!1,!1];function Ca(r,c){if(r._show=r.show,r.show){let f=r.side%2,p=T[r.scale];p==null&&(r.scale=f?k[1].scale:L,p=T[r.scale]);let g=p.time;r.size=ae(r.size),r.space=ae(r.space),r.rotate=ae(r.rotate),il(r.incrs)&&r.incrs.forEach(C=>{!ol.has(C)&&ol.set(C,Nr(C))}),r.incrs=ae(r.incrs||(p.distr==2?md:g?H==1?gd:yd:wl)),r.splits=ae(r.splits||(g&&p.distr==1?Ne:p.distr==3?ti:p.distr==4?zd:Od)),r.stroke=ae(r.stroke),r.grid.stroke=ae(r.grid.stroke),r.ticks.stroke=ae(r.ticks.stroke),r.border.stroke=ae(r.border.stroke);let b=r.values;r.values=il(b)&&!il(b[0])?ae(b):g?il(b)?Uo(J,Vo(b,K)):No(b)?Sd(J,b):b||oe:b||Hd,r.filter=ae(r.filter||(p.distr>=3&&p.log==10?Bd:p.distr==3&&p.log==2?Id:Or)),r.font=ir(r.font),r.labelFont=ir(r.labelFont),r._size=r.size(n,null,c,0),r._space=r._rotate=r._incrs=r._found=r._splits=r._values=null,r._size>0&&(hl[c]=!0,r._el=Tt(Mc,h))}}function tn(r,c,f,p){let[g,b,C,A]=f,F=c%2,B=0;return F==0&&(A||b)&&(B=c==0&&!g||c==2&&!C?Ge(Yo.size/3):0),F==1&&(g||C)&&(B=c==1&&!b||c==3&&!A?Ge(Jo.size/2):0),B}const Li=n.padding=(e.padding||[tn,tn,tn,tn]).map(r=>ae(he(r,tn))),Xt=n._padding=Li.map((r,c)=>r(n,c,hl,0));let nt,Je=null,Qe=null;const Mn=i==1?k[0].idxs:null;let Lt=null,ln=!1;function Ei(r,c){if(t=r??[],n.data=n._data=t,i==2){nt=0;for(let f=1;f=0,kt=!0,Fl()}}n.setData=Ei;function ps(){ln=!0;let r,c;i==1&&(nt>0?(Je=Mn[0]=0,Qe=Mn[1]=nt-1,r=t[0][Je],c=t[0][Qe],Y==2?(r=Je,c=Qe):r==c&&(Y==3?[r,c]=is(r,r,P.log,!1):Y==4?[r,c]=_i(r,r,P.log,!1):P.time?c=r+Ge(86400/H):[r,c]=Zn(r,c,gi,!0))):(Je=Mn[0]=r=null,Qe=Mn[1]=c=null)),tl(L,r,c)}let Tn,$l,ms,_s,gs,ws,vs,ys,bs,ft;function Ai(r,c,f,p,g,b){r??(r=ko),f??(f=vi),p??(p="butt"),g??(g=ko),b??(b="round"),r!=Tn&&(_.strokeStyle=Tn=r),g!=$l&&(_.fillStyle=$l=g),c!=ms&&(_.lineWidth=ms=c),b!=gs&&(_.lineJoin=gs=b),p!=ws&&(_.lineCap=ws=p),f!=_s&&_.setLineDash(_s=f)}function $i(r,c,f,p){c!=$l&&(_.fillStyle=$l=c),r!=vs&&(_.font=vs=r),f!=ys&&(_.textAlign=ys=f),p!=bs&&(_.textBaseline=bs=p)}function ks(r,c,f,p,g=0){if(p.length>0&&r.auto(n,ln)&&(c==null||c.min==null)){let b=he(Je,0),C=he(Qe,p.length-1),A=f.min==null?Bc(p,b,C,g,r.distr==3):[f.min,f.max];r.min=Ot(r.min,f.min=A[0]),r.max=dt(r.max,f.max=A[1])}}const Ri={min:null,max:null};function Da(){for(let p in T){let g=T[p];z[p]==null&&(g.min==null||z[L]!=null&&g.auto(n,ln))&&(z[p]=Ri)}for(let p in T){let g=T[p];z[p]==null&&g.from!=null&&z[g.from]!=null&&(z[p]=Ri)}z[L]!=null&&Rl(!0);let r={};for(let p in z){let g=z[p];if(g!=null){let b=r[p]=ql(T[p],Jc);if(g.min!=null)Ie(b,g);else if(p!=L||i==2)if(nt==0&&b.from==null){let C=b.range(n,null,null,p);b.min=C[0],b.max=C[1]}else b.min=ye,b.max=-ye}}if(nt>0){k.forEach((p,g)=>{if(i==1){let b=p.scale,C=z[b];if(C==null)return;let A=r[b];if(g==0){let F=A.range(n,A.min,A.max,b);A.min=F[0],A.max=F[1],Je=Ft(A.min,t[0]),Qe=Ft(A.max,t[0]),Qe-Je>1&&(t[0][Je]A.max&&Qe--),p.min=Lt[Je],p.max=Lt[Qe]}else p.show&&p.auto&&ks(A,C,p,t[g],p.sorted);p.idxs[0]=Je,p.idxs[1]=Qe}else if(g>0&&p.show&&p.auto){let[b,C]=p.facets,A=b.scale,F=C.scale,[B,V]=t[g],G=r[A],ne=r[F];G!=null&&ks(G,z[A],b,B,b.sorted),ne!=null&&ks(ne,z[F],C,V,C.sorted),p.min=C.min,p.max=C.max}});for(let p in r){let g=r[p],b=z[p];if(g.from==null&&(b==null||b.min==null)){let C=g.range(n,g.min==ye?null:g.min,g.max==-ye?null:g.max,p);g.min=C[0],g.max=C[1]}}}for(let p in r){let g=r[p];if(g.from!=null){let b=r[g.from];if(b.min==null)g.min=g.max=null;else{let C=g.range(n,b.min,b.max,p);g.min=C[0],g.max=C[1]}}}let c={},f=!1;for(let p in r){let g=r[p],b=T[p];if(b.min!=g.min||b.max!=g.max){b.min=g.min,b.max=g.max;let C=b.distr;b._min=C==3?Qt(b.min):C==4?Ws(b.min,b.asinh):C==100?b.fwd(b.min):b.min,b._max=C==3?Qt(b.max):C==4?Ws(b.max,b.asinh):C==100?b.fwd(b.max):b.max,c[p]=f=!0}}if(f){k.forEach((p,g)=>{i==2?g>0&&c.y&&(p._paths=null):c[p.scale]&&(p._paths=null)});for(let p in c)Dl=!0,et("setScale",p);Oe&&j.left>=0&&(ul=kt=!0)}for(let p in z)z[p]=null}function Pa(r){let c=ei(Je-1,0,nt-1),f=ei(Qe+1,0,nt-1);for(;r[c]==null&&c>0;)c--;for(;r[f]==null&&f0){let r=k.some(c=>c._focus)&&ft!=Wt.alpha;r&&(_.globalAlpha=ft=Wt.alpha),k.forEach((c,f)=>{if(f>0&&c.show&&(Fi(f,!1),Fi(f,!0),c._paths==null)){let p=ft;ft!=c.alpha&&(_.globalAlpha=ft=c.alpha);let g=i==2?[0,t[f][0].length-1]:Pa(t[f]);c._paths=c.paths(n,f,g[0],g[1]),ft!=p&&(_.globalAlpha=ft=p)}}),k.forEach((c,f)=>{if(f>0&&c.show){let p=ft;ft!=c.alpha&&(_.globalAlpha=ft=c.alpha),c._paths!=null&&Hi(f,!1);{let g=c._paths!=null?c._paths.gaps:null,b=c.points.show(n,f,Je,Qe,g),C=c.points.filter(n,f,b,g);(b||C)&&(c.points._paths=c.points.paths(n,f,Je,Qe,C),Hi(f,!0))}ft!=p&&(_.globalAlpha=ft=p),et("drawSeries",f)}}),r&&(_.globalAlpha=ft=1)}}function Fi(r,c){let f=c?k[r].points:k[r];f._stroke=f.stroke(n,r),f._fill=f.fill(n,r)}function Hi(r,c){let f=c?k[r].points:k[r],{stroke:p,fill:g,clip:b,flags:C,_stroke:A=f._stroke,_fill:F=f._fill,_width:B=f.width}=f._paths;B=be(B*_e,3);let V=null,G=B%2/2;c&&F==null&&(F=B>0?"#fff":A);let ne=f.pxAlign==1&&G>0;if(ne&&_.translate(G,G),!c){let me=pt-B/2,fe=bt-B/2,ie=ut+B,ee=Pt+B;V=new Path2D,V.rect(me,fe,ie,ee)}c?Ss(A,B,f.dash,f.cap,F,p,g,C,b):Ea(r,A,B,f.dash,f.cap,F,p,g,C,V,b),ne&&_.translate(-G,-G)}function Ea(r,c,f,p,g,b,C,A,F,B,V){let G=!1;F!=0&&E.forEach((ne,me)=>{if(ne.series[0]==r){let fe=k[ne.series[1]],ie=t[ne.series[1]],ee=(fe._paths||_n).band;il(ee)&&(ee=ne.dir==1?ee[0]:ee[1]);let q,Ee=null;fe.show&&ee&&Vc(ie,Je,Qe)?(Ee=ne.fill(n,me)||b,q=fe._paths.clip):ee=null,Ss(c,f,p,g,Ee,C,A,F,B,V,q,ee),G=!0}}),G||Ss(c,f,p,g,b,C,A,F,B,V)}const Oi=Jl|ni;function Ss(r,c,f,p,g,b,C,A,F,B,V,G){Ai(r,c,f,p,g),(F||B||G)&&(_.save(),F&&_.clip(F),B&&_.clip(B)),G?(A&Oi)==Oi?(_.clip(G),V&&_.clip(V),Dn(g,C),Cn(r,b,c)):A&ni?(Dn(g,C),_.clip(G),Cn(r,b,c)):A&Jl&&(_.save(),_.clip(G),V&&_.clip(V),Dn(g,C),_.restore(),Cn(r,b,c)):(Dn(g,C),Cn(r,b,c)),(F||B||G)&&_.restore()}function Cn(r,c,f){f>0&&(c instanceof Map?c.forEach((p,g)=>{_.strokeStyle=Tn=g,_.stroke(p)}):c!=null&&r&&_.stroke(c))}function Dn(r,c){c instanceof Map?c.forEach((f,p)=>{_.fillStyle=$l=p,_.fill(f)}):c!=null&&r&&_.fill(c)}function Aa(r,c,f,p){let g=O[r],b;if(p<=0)b=[0,0];else{let C=g._space=g.space(n,r,c,f,p),A=g._incrs=g.incrs(n,r,c,f,p,C);b=du(c,f,A,p,C)}return g._found=b}function xs(r,c,f,p,g,b,C,A,F,B){let V=C%2/2;R==1&&_.translate(V,V),Ai(A,C,F,B,A),_.beginPath();let G,ne,me,fe,ie=g+(p==0||p==3?-b:b);f==0?(ne=g,fe=ie):(G=g,me=ie);for(let ee=0;ee{if(!f.show)return;let g=T[f.scale];if(g.min==null){f._show&&(c=!1,f._show=!1,Rl(!1));return}else f._show||(c=!1,f._show=!0,Rl(!1));let b=f.side,C=b%2,{min:A,max:F}=g,[B,V]=Aa(p,A,F,C==0?se:U);if(V==0)return;let G=g.distr==2,ne=f._splits=f.splits(n,p,A,F,B,V,G),me=g.distr==2?ne.map(q=>Lt[q]):ne,fe=g.distr==2?Lt[ne[1]]-Lt[ne[0]]:B,ie=f._values=f.values(n,f.filter(n,me,p,V,fe),p,V,fe);f._rotate=b==2?f.rotate(n,ie,p,V):0;let ee=f._size;f._size=Ct(f.size(n,ie,p,r)),ee!=null&&f._size!=ee&&(c=!1)}),c}function Ra(r){let c=!0;return Li.forEach((f,p)=>{let g=f(n,p,hl,r);g!=Xt[p]&&(c=!1),Xt[p]=g}),c}function Fa(){for(let r=0;rLt[at]):me,ie=V.distr==2?Lt[me[1]]-Lt[me[0]]:F,ee=c.ticks,q=c.border,Ee=ee.show?ee.size:0,Re=Ge(Ee*_e),tt=Ge((c.alignTo==2?c._size-Ee-c.gap:c.gap)*_e),ve=c._rotate*-Un/180,Fe=$(c._pos*_e),mt=(Re+tt)*A,rt=Fe+mt;b=p==0?rt:0,g=p==1?rt:0;let xt=c.font[0],Et=c.align==1?Vl:c.align==2?Os:ve>0?Vl:ve<0?Os:p==0?"center":f==3?Os:Vl,Vt=ve||p==1?"middle":f==2?cn:bo;$i(xt,C,Et,Vt);let _t=c.font[1]*c.lineGap,Mt=me.map(at=>$(d(at,V,G,ne))),At=c._values;for(let at=0;at{f>0&&(c._paths=null,r&&(i==1?(c.min=null,c.max=null):c.facets.forEach(p=>{p.min=null,p.max=null})))})}let Pn=!1,Ms=!1,nn=[];function Ha(){Ms=!1;for(let r=0;r0&&queueMicrotask(Ha)}n.batch=Oa;function zi(){if(fs&&(Da(),fs=!1),Dl&&(ba(),Dl=!1),Sn){if(Ae(M,Vl,Me),Ae(M,cn,je),Ae(M,un,se),Ae(M,fn,U),Ae(S,Vl,Me),Ae(S,cn,je),Ae(S,un,se),Ae(S,fn,U),Ae(h,un,Kt),Ae(h,fn,al),w.width=Ge(Kt*_e),w.height=Ge(al*_e),O.forEach(({_el:r,_show:c,_size:f,_pos:p,side:g})=>{if(r!=null)if(c){let b=g===3||g===0?f:0,C=g%2==1;Ae(r,C?"left":"top",p-b),Ae(r,C?"width":"height",f),Ae(r,C?"top":"left",C?je:Me),Ae(r,C?"height":"width",C?U:se),Zs(r,yl)}else wt(r,yl)}),Tn=$l=ms=gs=ws=vs=ys=bs=_s=null,ft=1,rn(!0),Me!=Cl||je!=cl||se!=Nt||U!=dl){Rl(!1);let r=se/Nt,c=U/dl;if(Oe&&!ul&&j.left>=0){j.left*=r,j.top*=c,Hl&&jt(Hl,Ge(j.left),0,se,U),Ol&&jt(Ol,0,Ge(j.top),se,U);for(let f=0;f=0&&Le.width>0){Le.left*=r,Le.width*=r,Le.top*=c,Le.height*=c;for(let f in Es)Ae(Wl,f,Le[f])}Cl=Me,cl=je,Nt=se,dl=U}et("setSize"),Sn=!1}Kt>0&&al>0&&(_.clearRect(0,0,w.width,w.height),et("drawClear"),v.forEach(r=>r()),et("draw")),Le.show&&xn&&(Ln(Le),xn=!1),Oe&&ul&&(ml(null,!0,!1),ul=!1),te.show&&te.live&&kt&&(Ps(),kt=!1),m||(m=!0,n.status=1,et("ready")),ln=!1,Pn=!1}n.redraw=(r,c)=>{Dl=c||!1,r!==!1?tl(L,P.min,P.max):Fl()};function Ts(r,c){let f=T[r];if(f.from==null){if(nt==0){let p=f.range(n,c.min,c.max,r);c.min=p[0],c.max=p[1]}if(c.min>c.max){let p=c.min;c.min=c.max,c.max=p}if(nt>1&&c.min!=null&&c.max!=null&&c.max-c.min<1e-16)return;r==L&&f.distr==2&&nt>0&&(c.min=Ft(c.min,t[0]),c.max=Ft(c.max,t[0]),c.min==c.max&&c.max++),z[r]=c,fs=!0,Fl()}}n.setScale=Ts;let Cs,Ds,Hl,Ol,Ni,Wi,zl,Nl,Bi,Ii,Pe,$e,el=!1;const st=j.drag;let Ze=st.x,Xe=st.y;Oe&&(j.x&&(Cs=Tt(Cc,S)),j.y&&(Ds=Tt(Dc,S)),P.ori==0?(Hl=Cs,Ol=Ds):(Hl=Ds,Ol=Cs),Pe=j.left,$e=j.top);const Le=n.select=Ie({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),Wl=Le.show?Tt(Tc,Le.over?S:M):null;function Ln(r,c){if(Le.show){for(let f in r)Le[f]=r[f],f in Es&&Ae(Wl,f,r[f]);c!==!1&&et("setSelect")}}n.setSelect=Ln;function za(r){if(k[r].show)Ce&&Zs(Z[r],yl);else if(Ce&&wt(Z[r],yl),Oe){let f=Ll?St[0]:St[r];f!=null&&jt(f,-10,-10,se,U)}}function tl(r,c,f){Ts(r,{min:c,max:f})}function Bt(r,c,f,p){c.focus!=null&&Va(r),c.show!=null&&k.forEach((g,b)=>{b>0&&(r==b||r==null)&&(g.show=c.show,za(b),i==2?(tl(g.facets[0].scale,null,null),tl(g.facets[1].scale,null,null)):tl(g.scale,null,null),Fl())}),f!==!1&&et("setSeries",r,c),p&&an("setSeries",n,r,c)}n.setSeries=Bt;function Na(r,c){Ie(E[r],c)}function Wa(r,c){r.fill=ae(r.fill||null),r.dir=he(r.dir,-1),c=c??E.length,E.splice(c,0,r)}function Ba(r){r==null?E.length=0:E.splice(r,1)}n.addBand=Wa,n.setBand=Na,n.delBand=Ba;function Ia(r,c){k[r].alpha=c,Oe&&St[r]!=null&&(St[r].style.opacity=c),Ce&&Z[r]&&(Z[r].style.opacity=c)}let qt,ll,pl;const Bl={focus:!0};function Va(r){if(r!=pl){let c=r==null,f=Wt.alpha!=1;k.forEach((p,g)=>{if(i==1||g>0){let b=c||g==0||g==r;p._focus=c?null:b,f&&Ia(g,b?1:Wt.alpha)}}),pl=r,f&&Fl()}}Ce&&Pl&&ot(Mo,x,r=>{j._lock||(fl(r),pl!=null&&Bt(null,Bl,!0,We.setSeries))});function It(r,c,f){let p=T[c];f&&(r=r/_e-(p.ori==1?je:Me));let g=se;p.ori==1&&(g=U,r=g-r),p.dir==-1&&(r=g-r);let b=p._min,C=p._max,A=r/g,F=b+(C-b)*A,B=p.distr;return B==3?Yl(10,F):B==4?jc(F,p.asinh):B==100?p.bwd(F):F}function Ua(r,c){let f=It(r,L,c);return Ft(f,t[0],Je,Qe)}n.valToIdx=r=>Ft(r,t[0]),n.posToIdx=Ua,n.posToVal=It,n.valToPos=(r,c,f)=>T[c].ori==0?o(r,T[c],f?ut:se,f?pt:0):a(r,T[c],f?Pt:U,f?bt:0),n.setCursor=(r,c,f)=>{Pe=r.left,$e=r.top,ml(null,c,f)};function Vi(r,c){Ae(Wl,Vl,Le.left=r),Ae(Wl,un,Le.width=c)}function Ui(r,c){Ae(Wl,cn,Le.top=r),Ae(Wl,fn,Le.height=c)}let sn=P.ori==0?Vi:Ui,on=P.ori==1?Vi:Ui;function ja(){if(Ce&&te.live)for(let r=i==2?1:0;r{de[p]=f}):qc(r.idx)||de.fill(r.idx),te.idx=de[0]),Ce&&te.live){for(let f=0;f0||i==1&&!Se)&&Ga(f,de[f]);ja()}kt=!1,c!==!1&&et("setLegend")}n.setLegend=Ps;function Ga(r,c){let f=k[r],p=r==0&&Y==2?Lt:t[r],g;Se?g=f.values(n,r,c)??Ue:(g=f.value(n,c==null?null:p[c],r,c),g=g==null?Ue:{_:g}),te.values[r]=g}function ml(r,c,f){Bi=Pe,Ii=$e,[Pe,$e]=j.move(n,Pe,$e),j.left=Pe,j.top=$e,Oe&&(Hl&&jt(Hl,Ge(Pe),0,se,U),Ol&&jt(Ol,0,Ge($e),se,U));let p,g=Je>Qe;qt=ye,ll=null;let b=P.ori==0?se:U,C=P.ori==1?se:U;if(Pe<0||nt==0||g){p=j.idx=null;for(let A=0;A0&&Ee.show){let mt=ve==null?-10:ve==p?B:I(i==1?t[0][ve]:t[q][0][ve],P,b,0),rt=Fe==null?-10:Q(Fe,i==1?T[Ee.scale]:T[Ee.facets[1].scale],C,0);if(Pl&&Fe!=null){let xt=P.ori==1?Pe:$e,Et=Ye(Wt.dist(n,q,ve,rt,xt));if(Et=0?1:-1,At=_t>=0?1:-1;At==Mt&&(At==1?Vt==1?Fe>=_t:Fe<=_t:Vt==1?Fe<=_t:Fe>=_t)&&(qt=Et,ll=q)}else qt=Et,ll=q}}if(kt||Ll){let xt,Et;P.ori==0?(xt=mt,Et=rt):(xt=rt,Et=mt);let Vt,_t,Mt,At,Ut,at,gt=!0,_l=it.bbox;if(_l!=null){gt=!1;let ct=_l(n,q);Mt=ct.left,At=ct.top,Vt=ct.width,_t=ct.height}else Mt=xt,At=Et,Vt=_t=it.size(n,q);if(at=it.fill(n,q),Ut=it.stroke(n,q),Ll)q==ll&&qt<=Wt.prox&&(V=Mt,G=At,ne=Vt,me=_t,fe=gt,ie=at,ee=Ut);else{let ct=St[q];ct!=null&&(El[q]=Mt,Al[q]=At,Ao(ct,Vt,_t,gt),Lo(ct,at,Ut),jt(ct,Ct(Mt),Ct(At),se,U))}}}}if(Ll){let q=Wt.prox,Ee=pl==null?qt<=q:qt>q||ll!=pl;if(kt||Ee){let Re=St[0];Re!=null&&(El[0]=V,Al[0]=G,Ao(Re,ne,me,fe),Lo(Re,ie,ee),jt(Re,Ct(V),Ct(G),se,U))}}}if(Le.show&&el)if(r!=null){let[A,F]=We.scales,[B,V]=We.match,[G,ne]=r.cursor.sync.scales,me=r.cursor.drag;if(Ze=me._x,Xe=me._y,Ze||Xe){let{left:fe,top:ie,width:ee,height:q}=r.select,Ee=r.scales[G].ori,Re=r.posToVal,tt,ve,Fe,mt,rt,xt=A!=null&&B(A,G),Et=F!=null&&V(F,ne);xt&&Ze?(Ee==0?(tt=fe,ve=ee):(tt=ie,ve=q),Fe=T[A],mt=I(Re(tt,G),Fe,b,0),rt=I(Re(tt+ve,G),Fe,b,0),sn(Ot(mt,rt),Ye(rt-mt))):sn(0,b),Et&&Xe?(Ee==1?(tt=fe,ve=ee):(tt=ie,ve=q),Fe=T[F],mt=Q(Re(tt,ne),Fe,C,0),rt=Q(Re(tt+ve,ne),Fe,C,0),on(Ot(mt,rt),Ye(rt-mt))):on(0,C)}else As()}else{let A=Ye(Bi-Ni),F=Ye(Ii-Wi);if(P.ori==1){let ne=A;A=F,F=ne}Ze=st.x&&A>=st.dist,Xe=st.y&&F>=st.dist;let B=st.uni;B!=null?Ze&&Xe&&(Ze=A>=B,Xe=F>=B,!Ze&&!Xe&&(F>A?Xe=!0:Ze=!0)):st.x&&st.y&&(Ze||Xe)&&(Ze=Xe=!0);let V,G;Ze&&(P.ori==0?(V=zl,G=Pe):(V=Nl,G=$e),sn(Ot(V,G),Ye(G-V)),Xe||on(0,C)),Xe&&(P.ori==1?(V=zl,G=Pe):(V=Nl,G=$e),on(Ot(V,G),Ye(G-V)),Ze||sn(0,b)),!Ze&&!Xe&&(sn(0,0),on(0,0))}if(st._x=Ze,st._y=Xe,r==null){if(f){if(to!=null){let[A,F]=We.scales;We.values[0]=A!=null?It(P.ori==0?Pe:$e,A):null,We.values[1]=F!=null?It(P.ori==1?Pe:$e,F):null}an(zs,n,Pe,$e,se,U,p)}if(Pl){let A=f&&We.setSeries,F=Wt.prox;pl==null?qt<=F&&Bt(ll,Bl,!0,A):qt>F?Bt(null,Bl,!0,A):ll!=pl&&Bt(ll,Bl,!0,A)}}kt&&(te.idx=p,Ps()),c!==!1&&et("setCursor")}let nl=null;Object.defineProperty(n,"rect",{get(){return nl==null&&rn(!1),nl}});function rn(r=!1){r?nl=null:(nl=S.getBoundingClientRect(),et("syncRect",nl))}function ji(r,c,f,p,g,b,C){j._lock||el&&r!=null&&r.movementX==0&&r.movementY==0||(Ls(r,c,f,p,g,b,C,!1,r!=null),r!=null?ml(null,!0,!0):ml(c,!0,!1))}function Ls(r,c,f,p,g,b,C,A,F){if(nl==null&&rn(!1),fl(r),r!=null)f=r.clientX-nl.left,p=r.clientY-nl.top;else{if(f<0||p<0){Pe=-10,$e=-10;return}let[B,V]=We.scales,G=c.cursor.sync,[ne,me]=G.values,[fe,ie]=G.scales,[ee,q]=We.match,Ee=c.axes[0].side%2==1,Re=P.ori==0?se:U,tt=P.ori==1?se:U,ve=Ee?b:g,Fe=Ee?g:b,mt=Ee?p:f,rt=Ee?f:p;if(fe!=null?f=ee(B,fe)?d(ne,T[B],Re,0):-10:f=Re*(mt/ve),ie!=null?p=q(V,ie)?d(me,T[V],tt,0):-10:p=tt*(rt/Fe),P.ori==1){let xt=f;f=p,p=xt}}F&&(c==null||c.cursor.event.type==zs)&&((f<=1||f>=se-1)&&(f=gl(f,se)),(p<=1||p>=U-1)&&(p=gl(p,U))),A?(Ni=f,Wi=p,[zl,Nl]=j.move(n,f,p)):(Pe=f,$e=p)}const Es={width:0,height:0,left:0,top:0};function As(){Ln(Es,!1)}let Gi,Yi,Ki,qi;function Ji(r,c,f,p,g,b,C){el=!0,Ze=Xe=st._x=st._y=!1,Ls(r,c,f,p,g,b,C,!0,!1),r!=null&&(ot(Ns,Js,Qi,!1),an(So,n,zl,Nl,se,U,null));let{left:A,top:F,width:B,height:V}=Le;Gi=A,Yi=F,Ki=B,qi=V}function Qi(r,c,f,p,g,b,C){el=st._x=st._y=!1,Ls(r,c,f,p,g,b,C,!1,!0);let{left:A,top:F,width:B,height:V}=Le,G=B>0||V>0,ne=Gi!=A||Yi!=F||Ki!=B||qi!=V;if(G&&ne&&Ln(Le),st.setScale&&G&&ne){let me=A,fe=B,ie=F,ee=V;if(P.ori==1&&(me=F,fe=V,ie=A,ee=B),Ze&&tl(L,It(me,L),It(me+fe,L)),Xe)for(let q in T){let Ee=T[q];q!=L&&Ee.from==null&&Ee.min!=ye&&tl(q,It(ie+ee,q),It(ie,q))}As()}else j.lock&&(j._lock=!j._lock,ml(c,!0,r!=null));r!=null&&(Tl(Ns,Js),an(Ns,n,Pe,$e,se,U,null))}function Ya(r,c,f,p,g,b,C){if(j._lock)return;fl(r);let A=el;if(el){let F=!0,B=!0,V=10,G,ne;P.ori==0?(G=Ze,ne=Xe):(G=Xe,ne=Ze),G&&ne&&(F=Pe<=V||Pe>=se-V,B=$e<=V||$e>=U-V),G&&F&&(Pe=Pe{let g=We.match[2];f=g(n,c,f),f!=-1&&Bt(f,p,!0,!1)},Oe&&(ot(So,S,Ji),ot(zs,S,ji),ot(xo,S,r=>{fl(r),rn(!1)}),ot(Mo,S,Ya),ot(To,S,Zi),si.add(n),n.syncRect=rn);const En=n.hooks=e.hooks||{};function et(r,c,f){Ms?nn.push([r,c,f]):r in En&&En[r].forEach(p=>{p.call(null,n,c,f)})}(e.plugins||[]).forEach(r=>{for(let c in r.hooks)En[c]=(En[c]||[]).concat(r.hooks[c])});const eo=(r,c,f)=>f,We=Ie({key:null,setSeries:!1,filters:{pub:Oo,sub:Oo},scales:[L,k[1]?k[1].scale:null],match:[zo,zo,eo],values:[null,null]},j.sync);We.match.length==2&&We.match.push(eo),j.sync=We;const to=We.key,$s=ia(to);function an(r,c,f,p,g,b,C){We.filters.pub(r,c,f,p,g,b,C)&&$s.pub(r,c,f,p,g,b,C)}$s.sub(n);function Ka(r,c,f,p,g,b,C){We.filters.sub(r,c,f,p,g,b,C)&&Il[r](null,c,f,p,g,b,C)}n.pub=Ka;function qa(){$s.unsub(n),si.delete(n),rl.clear(),Xs(Qn,Gl,Xi),u.remove(),x==null||x.remove(),et("destroy")}n.destroy=qa;function Rs(){et("init",e,t),Ei(t||e.data,!1),z[L]?Ts(L,z[L]):ps(),xn=Le.show&&(Le.width>0||Le.height>0),ul=kt=!0,hs(e.width,e.height)}return k.forEach(Pi),O.forEach(Ca),l?l instanceof HTMLElement?(l.appendChild(u),Rs()):l(n,Rs):Rs(),n}lt.assign=Ie;lt.fmtNum=wi;lt.rangeNum=Zn;lt.rangeLog=is;lt.rangeAsinh=_i;lt.orient=Ml;lt.pxRatio=_e;lt.join=ld;lt.fmtDate=yi,lt.tzDate=hd;lt.sync=ia;{lt.addGap=qd,lt.clipGaps=as;let e=lt.paths={points:ua};e.linear=ha,e.stepped=Zd,e.bars=Xd,e.spline=tu}const Ul=e=>getComputedStyle(document.documentElement).getPropertyValue(e).trim();function or(e,t){if(e.startsWith("#")){const l=parseInt(e.slice(1),16);return`rgba(${l>>16&255},${l>>8&255},${l&255},${t})`}return e}function yn({lines:e,range:t,log:l,markers:n=[],height:i=360,stacked:o,bars:a,partialLast:d,endLabel:m,onZoom:u,valueLabel:w,tipDate:_}){const h=vl(null),M=vl(null),S=vl(null),R=vl(0),$=vl(null),H=(k,O,T)=>{$.current=[O,T],k.setScale("x",{min:O,max:T})};return Dt(()=>{const k=h.current;if(!e.length)return;const O=Ul("--rule-2"),T=Ul("--ink"),E=Ul("--mark"),L=Ul("--surface"),N=Ul("--font-mono"),v=`12px ${N}`,W=Ul("--ink-2"),D=devicePixelRatio,P=!!a&&e.length===1&&!o,Y=!o&&!P;let I;e.length===1?I=[e[0].t,e[0].v]:I=lt.join(e.map(y=>[y.t,y.v]));const Q=I;let z=I;if(o){const y=I.slice();for(let x=2;x(le??0)+(y[x-1][pe]??0));z=y}const J=Y?[z[0],...z.slice(1).flatMap(y=>[y,y])]:z,K=y=>Y?2+y*2:1+y,Ne=e.length===1,oe=[{}];e.forEach(y=>{const x=y.width??(Ne?3:2.5);if(P){oe.push({label:y.label,stroke:T,width:2,fill:y.color,paths:lt.paths.bars({size:[.74,70,3],radius:.18}),points:{show:!1}});return}if(o){oe.push({label:y.label,stroke:T,width:1,fill:or(y.color,.92),spanGaps:!0,points:{show:!1}});return}oe.push({label:"",stroke:T,width:x+3,spanGaps:!0,points:{show:!1},fill:y.fill?or(y.color,.14):void 0}),oe.push({label:y.label,stroke:y.color,width:x,dash:y.dash?[5,4]:void 0,spanGaps:!0,points:{show:!1}})});const re=y=>{const{ctx:x}=y;x.save();for(const Z of n){const De=Math.round(y.valToPos(Z.t,"x",!0));if(Dey.bbox.left+y.bbox.width)continue;x.strokeStyle=T,x.globalAlpha=.55,x.lineWidth=1.5*D,x.setLineDash([4*D,4*D]),x.beginPath(),x.moveTo(De,y.bbox.top),x.lineTo(De,y.bbox.top+y.bbox.height),x.stroke(),x.setLineDash([]),x.globalAlpha=1,x.font=`600 ${11*D}px ${N}`;const Ve=x.measureText(Z.label).width+10*D,Se=18*D;x.fillStyle=E,x.beginPath(),x.roundRect(De-Ve/2,y.bbox.top-Se+4*D,Ve,Se,6*D),x.fill(),x.lineWidth=2*D,x.stroke(),x.fillStyle=T,x.textAlign="center",x.textBaseline="middle",x.fillText(Z.label,De,y.bbox.top-Se/2+4*D)}const le=y.data[0],pe=y.data[K(0)];if(P&&d&&le.length>1){const Z=le.length-1,De=pe[Z];if(De!=null){const Ve=y.valToPos(le[Z-1],"x",!0),Se=y.valToPos(le[Z],"x",!0),Ue=Math.min((Se-Ve)*.74,70*D),xe=y.valToPos(De,"y",!0),qe=y.valToPos(0,"y",!0);x.beginPath(),x.rect(Se-Ue/2,xe,Ue,qe-xe),x.clip(),x.strokeStyle=L,x.lineWidth=3*D;for(let ht=-qe;ht=0&&pe[Z]==null;)Z--;if(Z>=0&&le[Z]>=y.scales.x.min&&le[Z]<=y.scales.x.max){const De=y.valToPos(le[Z],"x",!0),Ve=y.valToPos(pe[Z],"y",!0);x.save(),x.fillStyle=e[0].color,x.strokeStyle=T,x.lineWidth=2.5*D,x.beginPath(),x.arc(De,Ve,6*D,0,Math.PI*2),x.fill(),x.stroke();const Se=w?w(pe[Z]):ce(pe[Z]);x.font=`600 ${12*D}px ${N}`;const Ue=x.measureText(Se).width+14*D,xe=22*D,qe=Math.max(y.bbox.left,De-Ue-12*D),ht=Math.max(y.bbox.top,Ve-xe-10*D);x.fillStyle=L,x.beginPath(),x.roundRect(qe,ht,Ue,xe,7*D),x.fill(),x.lineWidth=2*D,x.stroke(),x.fillStyle=T,x.textAlign="left",x.textBaseline="middle",x.fillText(Se,qe+7*D,ht+xe/2+.5*D),x.restore()}}},de={width:k.clientWidth,height:i,padding:[22,10,0,0],cursor:{drag:{x:!0,y:!1,setScale:!0},y:!1,points:P||o?{show:!1}:{size:(y,x)=>Y&&x%2===1?0:12,width:2.5,stroke:(y,x)=>Y&&x%2===1?"transparent":T,fill:(y,x)=>Y&&x%2===1?"transparent":oe[x].stroke}},legend:{show:!1},scales:{x:{time:!0},y:{distr:l?3:1,range:(y,x,le)=>[l?Math.max(1,x):0,le*1.1||1]}},axes:[{stroke:W,font:v,grid:{show:!1},ticks:{show:!0,stroke:T,width:2,size:5},gap:6,border:{show:!0,stroke:T,width:2},values:[[86400*365,"{YYYY}",null,null,null,null,null,null,1],[86400*28,"{MMM}",` +{YYYY}`,null,null,null,null,null,1],[86400,"{MMM} {D}",` +{YYYY}`,null,"{D}",null,"{MMM} {D}",null,1]]},{stroke:W,font:v,size:60,gap:8,grid:{stroke:O,width:1.5,dash:[4,5]},ticks:{show:!1},values:(y,x)=>x.map(le=>le==null?"":ce(le))}],series:oe,bands:o?e.slice(1).map((y,x)=>({series:[x+2,x+1]})):void 0,hooks:{draw:[re],setCursor:[y=>{const x=M.current,le=y.cursor.idx;if(le==null||y.cursor.left==null||y.cursor.left<0){x.style.display="none";return}const pe=e.map((xe,qe)=>({l:xe,i:qe,v:Q[qe+1][le]})).filter(xe=>xe.v!=null);if(!pe.length){x.style.display="none";return}const Z=J[0][le],De=_?_(Z):Ht(new Date(Z*1e3),{weekday:"short",month:"short",day:"numeric",year:"numeric"});x.innerHTML=`
${De}
`+pe.map(xe=>`
${e.length>1?fu(xe.l.label):""}${w?w(xe.v):X(xe.v)}
`).join(""),x.style.display="block";const Ve=y.cursor.left+y.bbox.left/D,Se=Math.min(...pe.map(xe=>y.valToPos(J[K(xe.i)][le],"y")))+y.bbox.top/D,Ue=x.offsetWidth/2;x.style.left=Math.min(Math.max(Ve,Ue),k.clientWidth-Ue)+"px",x.style.top=Math.max(Se-14,x.offsetHeight)+"px"}],setScale:[(y,x)=>{if(x!=="x"||!u)return;const le=$.current,pe=y.scales.x.min,Z=y.scales.x.max;le&&Math.abs(le[0]-pe)<1&&Math.abs(le[1]-Z)<1||u([pe+R.current,Z-R.current])}]}},te=new lt(de,J,k);S.current=te,R.current=P&&J[0].length>1?(J[0][1]-J[0][0])/2:0;const j=R.current;t?H(te,t[0]-j,t[1]+j):j&&H(te,J[0][0]-j,J[0][J[0].length-1]+j);const Ce=new ResizeObserver(()=>te.setSize({width:k.clientWidth,height:i}));Ce.observe(k);const Oe=()=>M.current.style.display="none";return k.addEventListener("mouseleave",Oe),()=>{Ce.disconnect(),k.removeEventListener("mouseleave",Oe),te.destroy(),S.current=null}},[e,l,n,i,o,a,d,m]),Dt(()=>{const k=S.current;if(!k)return;const O=k.data[0],T=R.current;t?H(k,t[0]-T,t[1]+T):H(k,O[0]-T,O[O.length-1]+T)},[t]),s("div",{class:"chart-box",children:[s("div",{ref:h,onDblClick:()=>u==null?void 0:u(null)}),s("div",{ref:M,class:"tip",style:{display:"none"}})]})}function fu(e){return e.replace(/[&<>"]/g,t=>({"&":"&","<":"<",">":">",'"':"""})[t])}function ga({v:e,w:t=96,h:l=28,color:n="var(--signal)"}){if(!e||e.length<2)return s("svg",{width:t,height:l});const i=Math.max(...e)||1,o=e.map((d,m)=>`${(m/(e.length-1)*(t-6)+3).toFixed(1)},${(l-4-d/i*(l-8)).toFixed(1)}`),a=o[o.length-1].split(",");return s("svg",{width:t,height:l,viewBox:`0 0 ${t} ${l}`,"aria-hidden":"true",style:{display:"block",overflow:"visible"},children:[s("path",{d:`M${o.join(" L")} L${t-3},${l} L3,${l}Z`,fill:n,opacity:"0.16"}),s("path",{d:`M${o.join(" L")}`,fill:"none",stroke:"var(--ink)","stroke-width":"4","stroke-linejoin":"round","stroke-linecap":"round"}),s("path",{d:`M${o.join(" L")}`,fill:"none",stroke:n,"stroke-width":"2","stroke-linejoin":"round","stroke-linecap":"round"}),s("circle",{cx:a[0],cy:a[1],r:"3.5",fill:n,stroke:"var(--ink)","stroke-width":"2"})]})}function hu({route:e}){var S,R,$,H,k,O,T,E,L,N;const t=e.author,[l,n]=ue(null),[i,o]=ue(null),[a,d]=ue("weekly"),[m,u]=ue(30),[w,_]=ue("models");Dt(()=>{n(null),o(null),Yt.author(t).then(v=>{var W;n(v),_(v.models.length?"models":(W=v.datasets)!=null&&W.length?"datasets":"spaces"),document.title=`${t} on Hugging Face: downloads and rankings · Model Pulse`}).catch(v=>o(v.message))},[t]);const h=Gt(()=>{if(!l)return[];const v=getComputedStyle(document.documentElement).getPropertyValue("--c1").trim(),W=l.series;if(a==="weekly"){const P=qn(W.day,W.dl_all),Y=Lr(P.t,P.v);return[{label:t,color:v,t:Y.t,v:Y.v}]}if(a==="daily"){const P=qn(W.day,W.dl_all);return[{label:t,color:v,t:P.t,v:ui(P.v,7),fill:!0}]}const D=Vn(W.day,a==="month"?W.dl30:W.dl_all);return[{label:t,color:v,t:D.t,v:D.v,fill:!0}]},[l,a]);if(i)return s("div",{class:"wrap err",children:[s("h1",{children:["Nothing found for ",t]}),s("p",{class:"muted",children:i})]});if(!l)return s("div",{class:"wrap hero",children:[s("div",{class:"crumbs",style:{visibility:"hidden"},children:s("span",{class:"chip",children:"loading"})}),s("h1",{class:"model-name",children:t}),s("div",{class:"skeleton",style:{marginTop:24}})]});const M=l.models.reduce((v,W)=>({all:v.all+(W.dl_all??0),m30:v.m30+(W.dl30??0),w:v.w+(W.dl_7d??0),likes:v.likes+(W.likes??0)}),{all:0,m30:0,w:0,likes:0});return s(ge,{children:[s("div",{class:"wrap hero",children:[s("div",{class:"crumbs",children:[l.models.length>0&&s("span",{class:"chip",children:[l.models.length>=200?"200+":l.models.length," tracked models"]}),!!((S=l.totals)!=null&&S.datasets)&&s("span",{class:"chip",children:[X(l.totals.datasets)," datasets"]}),!!((R=l.totals)!=null&&R.spaces)&&s("span",{class:"chip",children:[X(l.totals.spaces)," Spaces"]}),s("a",{class:"chip",href:`https://huggingface.co/${t}`,target:"_blank",rel:"noopener",children:"Open on Hugging Face ↗"}),s("a",{class:"chip chip-hot",href:He({view:"wrapped",author:t}),onClick:v=>{v.preventDefault(),Te({view:"wrapped",author:t})},children:["See ",t,"'s Wrapped"]})]}),s("h1",{class:"model-name",children:t}),l.models.length>0?s(ge,{children:[s("div",{class:"card stats",style:{padding:0},children:[s("div",{class:"fig fig-main",children:[s("div",{class:"num",children:X(M.all)}),s("div",{class:"label",children:"downloads all time, across all models"})]}),s("div",{class:"fig",children:[s("div",{class:"val",children:ce(M.m30)}),s("div",{class:"label",children:"last 30 days"})]}),s("div",{class:"fig",children:[s("div",{class:"val",children:ce(M.w)}),s("div",{class:"label",children:"last 7 days"})]}),s("div",{class:"fig",children:[s("div",{class:"val",children:ce(M.likes)}),s("div",{class:"label",children:"likes"})]})]}),s("div",{class:"card chart-card",children:[s("div",{class:"chart-bar",children:s("div",{class:"left",children:s("div",{class:"seg",role:"group","aria-label":"Metric",children:[s("button",{"aria-pressed":a==="weekly",onClick:()=>d("weekly"),children:"Weekly"}),s("button",{"aria-pressed":a==="daily",onClick:()=>d("daily"),children:"Daily"}),s("button",{"aria-pressed":a==="month",onClick:()=>d("month"),children:"Rolling 30 days"}),s("button",{"aria-pressed":a==="total",onClick:()=>d("total"),children:"All time"})]})})}),s(yn,{lines:h,height:340,bars:a==="weekly",endLabel:a!=="weekly",tipDate:a==="weekly"?v=>`Week of ${Ht(new Date((v-fi/2)*1e3),{month:"short",day:"numeric",year:"numeric"})}`:void 0})]})]}):s("div",{class:"card stats",style:{padding:0},children:[s("div",{class:"fig fig-main",children:[s("div",{class:"num",children:X((($=l.totals)==null?void 0:$.datasets_dl30)??0)}),s("div",{class:"label",children:"dataset downloads, last 30 days"})]}),s("div",{class:"fig",children:[s("div",{class:"val",children:X(((H=l.totals)==null?void 0:H.datasets)??0)}),s("div",{class:"label",children:"datasets"})]}),s("div",{class:"fig",children:[s("div",{class:"val",children:X(((k=l.totals)==null?void 0:k.spaces)??0)}),s("div",{class:"label",children:"Spaces"})]}),s("div",{class:"fig",children:[s("div",{class:"val",children:ce(((O=l.totals)==null?void 0:O.spaces_likes)??0)}),s("div",{class:"label",children:"Space likes"})]})]})]}),s("section",{class:"section",children:s("div",{class:"wrap",children:s("div",{class:"card",children:[s("div",{class:"seg repo-tabs",role:"tablist","aria-label":`What ${t} publishes`,children:[l.models.length>0&&s("button",{role:"tab","aria-selected":w==="models",onClick:()=>{_("models"),u(30)},children:"Models"}),!!((T=l.datasets)!=null&&T.length)&&s("button",{role:"tab","aria-selected":w==="datasets",onClick:()=>{_("datasets"),u(30)},children:["Datasets ",X((E=l.totals)==null?void 0:E.datasets)]}),!!((L=l.spaces)!=null&&L.length)&&s("button",{role:"tab","aria-selected":w==="spaces",onClick:()=>{_("spaces"),u(30)},children:["Spaces ",X((N=l.totals)==null?void 0:N.spaces)]})]}),w==="models"&&s(ge,{children:[s("div",{class:"section-head",children:s("div",{children:[s("h2",{children:["Models by ",t]}),s("p",{children:"Sorted by downloads in the last 30 days."})]})}),s("div",{class:"table-scroll",children:s("table",{class:"list",children:[s("thead",{children:s("tr",{children:[s("th",{children:"Model"}),s("th",{children:"This week"}),s("th",{children:"Change"}),s("th",{children:"30 days"}),s("th",{children:"All time"}),s("th",{children:"Likes"})]})}),s("tbody",{children:l.models.slice(0,m).map(v=>s("tr",{children:[s("td",{class:"name",children:[s("a",{href:He({model:v.id}),onClick:W=>{W.preventDefault(),Te({model:v.id})},children:v.id.split("/").slice(1).join("/")}),s("span",{class:"sub",children:[zt(v.pipeline_tag),Tr(v.params)].filter(Boolean).join(", ")})]}),s("td",{children:s("b",{children:ce(v.dl_7d)})}),s("td",{class:v.growth_7d==null?"muted":v.growth_7d>=0?"up":"down",children:Sl(v.growth_7d)}),s("td",{children:ce(v.dl30)}),s("td",{children:ce(v.dl_all)}),s("td",{children:ce(v.likes)})]},v.id))})]})}),l.models.length>m&&s("button",{class:"btn",style:{marginTop:16},onClick:()=>u(m+30),children:"Show 30 more"})]}),w==="datasets"&&l.datasets&&s(ge,{children:[s("div",{class:"section-head",children:s("div",{children:[s("h2",{children:["Datasets by ",t]}),s("p",{children:"Sorted by downloads in the last 30 days."})]})}),s("div",{class:"table-scroll",children:s("table",{class:"list",children:[s("thead",{children:s("tr",{children:[s("th",{children:"Dataset"}),s("th",{children:"This week"}),s("th",{children:"Change"}),s("th",{children:"30 days"}),s("th",{children:"All time"}),s("th",{children:"Models trained on it"})]})}),s("tbody",{children:l.datasets.slice(0,m).map(v=>s("tr",{children:[s("td",{class:"name",children:[s("a",{href:He({dataset:v.id}),onClick:W=>{W.preventDefault(),Te({dataset:v.id})},children:v.id.split("/").slice(1).join("/")}),s("span",{class:"sub",children:[v.pipeline_tag?zt(v.pipeline_tag):null,v.size].filter(Boolean).join(", ")})]}),s("td",{children:s("b",{children:ce(v.dl_7d)})}),s("td",{class:v.growth_7d==null?"muted":v.growth_7d>=0?"up":"down",children:Sl(v.growth_7d)}),s("td",{children:ce(v.dl30)}),s("td",{children:ce(v.dl_all)}),s("td",{children:v.used_by_models?X(v.used_by_models):"–"})]},v.id))})]})}),l.datasets.length>m&&s("button",{class:"btn",style:{marginTop:16},onClick:()=>u(m+30),children:"Show 30 more"})]}),w==="spaces"&&l.spaces&&s(ge,{children:[s("div",{class:"section-head",children:s("div",{children:[s("h2",{children:["Spaces by ",t]}),s("p",{children:"Sorted by likes. The Hub doesn't publish visits for Spaces."})]})}),s("div",{class:"table-scroll",children:s("table",{class:"list",children:[s("thead",{children:s("tr",{children:[s("th",{children:"Space"}),s("th",{children:"Likes this week"}),s("th",{children:"30 days"}),s("th",{children:"Likes"}),s("th",{children:"SDK"})]})}),s("tbody",{children:l.spaces.slice(0,m).map(v=>s("tr",{children:[s("td",{class:"name",children:[s("a",{href:He({space:v.id}),onClick:W=>{W.preventDefault(),Te({space:v.id})},children:[v.emoji?`${v.emoji} `:"",v.title||v.id.split("/").slice(1).join("/")]}),s("span",{class:"sub",children:v.id})]}),s("td",{children:s("b",{children:["+",X(v.likes_7d)]})}),s("td",{children:["+",X(v.likes_30d)]}),s("td",{children:ce(v.likes)}),s("td",{class:"muted",children:v.sdk??"–"})]},v.id))})]})}),l.spaces.length>m&&s("button",{class:"btn",style:{marginTop:16},onClick:()=>u(m+30),children:"Show 30 more"})]})]})})})]})}const wa=({size:e=32})=>s("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":"true",children:[s("rect",{x:"1.5",y:"1.5",width:"29",height:"29",rx:"8",fill:"#FFD21E",stroke:"#1B1B1F","stroke-width":"3"}),s("path",{d:"M5.5 17h4.5l3-8 5 15 3-7h5.5",fill:"none",stroke:"#1B1B1F","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"})]}),pu={model:"Models",dataset:"Datasets",space:"Spaces"},mu=({size:e=16})=>s("svg",{class:"icon",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","aria-hidden":"true",children:[s("circle",{cx:"11",cy:"11",r:"7"}),s("path",{d:"m20 20-3.5-3.5"})]});function es({onPick:e,big:t,placeholder:l,autoFocus:n,hotkey:i,exclude:o=[],all:a}){const[d,m]=ue(""),[u,w]=ue([]),[_,h]=ue(0),[M,S]=ue(!1),R=vl(null),$=vl(0);Dt(()=>{if(!i)return;const E=L=>{var N,v;(L.key==="k"&&(L.metaKey||L.ctrlKey)||L.key==="/"&&((N=document.activeElement)==null?void 0:N.tagName)!=="INPUT")&&(L.preventDefault(),(v=R.current)==null||v.focus())};return addEventListener("keydown",E),()=>removeEventListener("keydown",E)},[i]),Dt(()=>{const E=d.trim();if(E.length<2){w([]);return}const L=vo(E),N=L&&E.includes("huggingface.co")?L.id:E,v=++$.current,W=setTimeout(()=>{const D=P=>{v===$.current&&(w(P.filter(Y=>!o.includes(Y.id))),h(0))};a?Yt.searchAll(N).then(P=>{const Y=[P.models.map(z=>({id:z.id,kind:"model",meta:`${zt(z.pipeline_tag)} · ${ce(z.dl30)}/mo`})),P.datasets.map(z=>({id:z.id,kind:"dataset",meta:`${ce(z.dl30)}/mo`})),P.spaces.map(z=>({id:z.id,kind:"space",title:z.title,meta:`${z.emoji??""} ${ce(z.likes)} likes`.trim()}))],I=N.toLowerCase().split("/").pop(),Q=z=>z.some(J=>J.id.toLowerCase()===N.toLowerCase()||J.id.toLowerCase().split("/").pop()===I);D([...Y.filter(Q),...Y.filter(z=>!Q(z))].flat())}).catch(()=>{}):Yt.search(N).then(P=>D(P.map(Y=>({id:Y.id,kind:"model",meta:`${zt(Y.pipeline_tag)} · ${ce(Y.dl30)}/mo`})))).catch(()=>{})},120);return()=>clearTimeout(W)},[d]);const H=(E,L="model")=>{var N;m(""),w([]),S(!1),(N=R.current)==null||N.blur(),e(E,L)},k=E=>{var L;if(E.key==="ArrowDown")E.preventDefault(),h(N=>Math.min(N+1,u.length-1));else if(E.key==="ArrowUp")E.preventDefault(),h(N=>Math.max(N-1,0));else if(E.key==="Escape")S(!1),(L=R.current)==null||L.blur();else if(E.key==="Enter")if(E.preventDefault(),u[_])H(u[_].id,u[_].kind);else if(a){const N=vo(d);N&&H(N.id,N.kind)}else{const N=_c(d);N&&H(N)}},O=d.trim().toLowerCase(),T=E=>{const L=E.toLowerCase().indexOf(O);return L<0||!O?E:s(ge,{children:[E.slice(0,L),s("b",{children:E.slice(L,L+O.length)}),E.slice(L+O.length)]})};return s("div",{class:`search${t?" big":""}`,children:[s(mu,{size:t?20:16}),s("input",{ref:R,value:d,autoFocus:n,placeholder:l??(a?"Search models, datasets and Spaces":"Search models"),"aria-label":a?"Search models, datasets and Spaces":"Search models",role:"combobox","aria-expanded":M&&u.length>0,"aria-controls":"search-results",autocomplete:"off",spellcheck:!1,onInput:E=>{m(E.target.value),S(!0)},onFocus:()=>S(!0),onBlur:()=>setTimeout(()=>S(!1),150),onKeyDown:k}),i&&!d&&s("kbd",{children:"⌘K"}),M&&u.length>0&&s("ul",{class:"results",id:"search-results",role:"listbox",children:u.map((E,L)=>s(ge,{children:[a&&(L===0||u[L-1].kind!==E.kind)&&s("li",{class:"rgroup",role:"presentation",children:pu[E.kind]},`g-${E.kind}`),s("li",{role:"option","aria-selected":L===_,onMouseEnter:()=>h(L),onMouseDown:N=>{N.preventDefault(),H(E.id,E.kind)},children:[s("span",{class:"rid",children:T(E.id)}),s("span",{class:"rmeta",children:E.meta})]},`${E.kind}:${E.id}`)]},`${E.kind}:${E.id}`))})]})}const va=e=>{const t=e.currentTarget,l=t==null?void 0:t.parentElement;!t||!l||l.scrollWidth<=l.clientWidth||setTimeout(()=>{const n=t.getBoundingClientRect().left-l.getBoundingClientRect().left;l.scrollTo({left:l.scrollLeft+n-(l.clientWidth-t.offsetWidth)/2,behavior:"smooth"})},0)},Us=[{key:"gainers_7d",label:"Most downloaded this week",note:"Downloads in the last 7 days."},{key:"growth_7d",label:"Fastest growing",note:"Downloads this week compared with the average of the three weeks before, among models with at least 1,000 weekly downloads."},{key:"breakouts",label:"New this month",note:"Models created in the last 30 days, by downloads this week."},{key:"likes_7d",label:"Most liked this week",note:"Likes gained in the last 7 days, among models with at least 1,000 downloads this month."},{key:"families",label:"Biggest families",note:"Base models ranked by the 30-day downloads of the model plus all its derivatives."},{key:"authors_7d",label:"Organizations",note:"Authors ranked by downloads across all their models this week.",author:!0}],_u={datasets:[{key:"gainers_7d",label:"Most downloaded this week",note:"Dataset downloads in the last 7 days."},{key:"growth_7d",label:"Fastest growing",note:"Downloads this week compared with the average of the three weeks before, among datasets with at least 1,000 weekly downloads."},{key:"breakouts",label:"New this month",note:"Datasets created in the last 30 days, by downloads this week."},{key:"used_by_models",label:"Most used for training",note:"Datasets listed as training data by the most models."}],spaces:[{key:"likes_7d",label:"Most liked this week",note:"Likes gained in the last 7 days. The Hub doesn't publish visits for Spaces, so likes are the measure."},{key:"trending",label:"Trending",note:"The Hub's own trending score, from the latest snapshot."},{key:"breakouts",label:"New this month",note:"Spaces created in the last 30 days, by likes gained this week."},{key:"most_liked",label:"Most liked",note:"All-time likes."}]},ts=e=>getComputedStyle(document.documentElement).getPropertyValue(e).trim(),gu=["--c1","--c2","--c3","--c4","--c5"];function wu(){const[e,t]=ue(null),[l,n]=ue(null),[i,o]=ue(null),[a,d]=ue(Us[0].key),[m,u]=ue("models");Dt(()=>{document.title="Model Pulse · Download history for every Hugging Face model",Yt.leaderboards().then(t),Yt.hub().then(n),Yt.meta().then(o)},[]);const w=Gt(()=>{if(!l)return[];const S=[...new Set(l.day)],R=new Map(S.map((T,E)=>[T,E])),$=l.tags.map(()=>new Array(S.length).fill(0));l.day.forEach((T,E)=>{$[l.tags.indexOf(l.tag[E])][R.get(T)]+=l.dl[E]});const H=S.map(Ql),k=[...gu.map(ts),"#9aa0bd","#c1c5d8","#7f86a8"];return l.tags.map((T,E)=>({tag:T,v:ui($[E],7)})).map((T,E)=>({label:zt(T.tag),color:T.tag==="other"?ts("--rule"):k[E],t:H,v:T.v}))},[l]),_=(e==null?void 0:e.gainers_7d.slice(0,5).map(S=>S.id))??[],h=Us.find(S=>S.key===a),M=(e==null?void 0:e[a])??[];return s(ge,{children:[s("div",{class:"wrap home-hero",children:[s("div",{class:"sticker","aria-hidden":"true",children:[s("svg",{viewBox:"0 0 100 100",children:s("path",{fill:"#E5484D",stroke:"#1B1B1F","stroke-width":"3",d:"M50 3l7.6 11.5 13.2-4.3 1.8 13.7 13.7 1.8-4.3 13.2L97 50l-11.5 7.6 4.3 13.2-13.7 1.8-1.8 13.7-13.2-4.3L50 97l-7.6-11.5-13.2 4.3-1.8-13.7-13.7-1.8 4.3-13.2L3 50l11.5-7.6-4.3-13.2 13.7-1.8 1.8-13.7 13.2 4.3z"})}),s("span",{children:[i?ce(i.models):"1.6M",s("br",{}),"models"]})]}),s("h1",{children:[s(wa,{size:80}),"Model ",s("span",{class:"hl",children:"Pulse"})]}),s("p",{class:"lede",children:"The daily download history of every model and dataset on the Hugging Face Hub, and likes for every Space. Search one or paste its link to see how it grew, how it compares, and who builds on it."}),s("div",{class:"meta",children:i?`${X(i.models)} models · daily since ${Ht(i.first,{month:"short",year:"numeric"})} · updated ${Ht(i.last)}`:" "}),s(es,{big:!0,autoFocus:!0,all:!0,placeholder:"A model, dataset or Space, or paste its link",onPick:(S,R)=>Te({[R]:S})}),s("div",{class:"examples",children:[_.length>0&&s("span",{class:"muted",children:"popular this week"}),_.map(S=>s("a",{class:"chip",href:He({model:S}),onClick:R=>{R.preventDefault(),Te({model:S})},children:S},S))]})]}),s("div",{class:"wrap hub-chart",children:s("div",{class:"card",children:[s("h2",{children:"Daily downloads across the Hub"}),s("p",{class:"muted",style:{margin:"4px 0 14px"},children:"All public models, by task, 7-day average."}),w.length?s(ge,{children:[s("div",{class:"legend",style:{marginBottom:10},children:w.map(S=>s("span",{class:"chip",children:[s("i",{class:"sw",style:{background:S.color,height:10}}),S.label]},S.label))}),s(yn,{lines:w,stacked:!0,height:300,valueLabel:S=>X(S)})]}):s("div",{class:"skeleton",style:{height:300}})]})}),s("section",{class:"section",children:s("div",{class:"wrap",children:s("div",{class:"card",children:[s("div",{class:"seg repo-tabs",role:"tablist","aria-label":"Rankings for",children:["models","datasets","spaces"].map(S=>s("button",{role:"tab","aria-selected":m===S,onClick:()=>u(S),children:S[0].toUpperCase()+S.slice(1)},S))}),m==="models"?s(ge,{children:[s("div",{class:"section-head",children:s("div",{children:[s("h2",{children:h.label}),s("p",{children:[h.note,e?` Week ending ${Ht(e.updated)}.`:""]})]})}),s("div",{class:"seg lb-tabs",role:"tablist",children:Us.map(S=>s("button",{role:"tab","aria-selected":a===S.key,onClick:R=>{d(S.key),va(R)},children:S.label},S.key))}),e?s(vu,{rows:M,kind:a,author:!!h.author}):s("div",{class:"skeleton"})]}):s(bu,{kind:m},m)]})})})]})}function vu({rows:e,kind:t,author:l}){const[n,i]=ue(25),o=d=>Te(l?{author:d.author}:{model:d.id}),a=d=>He(l?{author:d.author}:{model:d.id});return s(ge,{children:[s("div",{class:"table-scroll",children:s("table",{class:"list",children:[s("thead",{children:s("tr",{children:[s("th",{children:l?"Organization":"Model"}),!l&&s("th",{children:"Last 4 weeks"}),t==="likes_7d"?s("th",{children:"Likes this week"}):s("th",{children:"This week"}),s("th",{children:"Change"}),s("th",{children:t==="families"?"Family, 30 days":"30 days"}),s("th",{children:l?"Models":t==="likes_7d"?"Likes":"All time"})]})}),s("tbody",{children:e.slice(0,n).map((d,m)=>s("tr",{children:[s("td",{class:"name",children:[s("span",{class:"rank",children:m+1}),s("a",{href:a(d),onClick:u=>{u.preventDefault(),o(d)},children:l?d.author:d.id}),!l&&s("span",{class:"sub",style:{paddingLeft:"2.5em"},children:[zt(d.pipeline_tag),t==="families"&&d.fam_members?`, ${X(d.fam_members)} derivatives`:""]})]}),!l&&s("td",{children:s(ga,{v:d.spark??[]})}),s("td",{children:s("b",{children:t==="likes_7d"?`+${X(d.likes_7d)}`:ce(d.dl_7d)})}),s("td",{class:d.growth_7d==null?"muted":d.growth_7d>=0?"up":"down",children:Sl(d.growth_7d)}),s("td",{children:ce(t==="families"?d.fam_dl30:d.dl30)}),s("td",{children:l?X(d.models):ce(t==="likes_7d"?d.likes:d.dl_all)})]},d.id??d.author))})]})}),e.length>n&&s("button",{class:"btn",style:{marginTop:16},onClick:()=>i(n+25),children:"Show 25 more"})]})}function yu(){const[e,t]=ue(null);Dt(()=>{Yt.newSpaces().then(t).catch(()=>{})},[]);const l=Gt(()=>{if(!e)return[];const n=[...new Set(e.week)].filter(a=>a>="2023-01-01").sort(),i=new Map(n.map((a,d)=>[a,d])),o=["--c1","--c2","--c3","--c4","--c5"].map(ts);return e.sdks.map((a,d)=>{const m=new Array(n.length).fill(0);return e.week.forEach((u,w)=>{e.sdk[w]===a&&i.has(u)&&(m[i.get(u)]+=e.n[w])}),{label:a,color:a==="other"?ts("--rule"):o[d%o.length],t:n.slice(0,-1).map(u=>Ql(u)+3.5*86400),v:m.slice(0,-1)}})},[e]);return!e||!l.length?null:s("div",{class:"new-spaces",children:[s("h3",{children:"New Spaces per week, by SDK"}),s("div",{class:"legend",style:{marginBottom:8},children:l.map(n=>s("span",{class:"chip",children:[s("i",{class:"sw",style:{background:n.color,height:10}}),n.label]},n.label))}),s(yn,{lines:l,stacked:!0,height:220,valueLabel:n=>X(n)}),s("p",{class:"chart-note",children:"Counted from the Spaces that exist today, by the week they were created."})]})}function bu({kind:e}){const t=_u[e],[l,n]=ue(null),[i,o]=ue(t[0].key),[a,d]=ue(25);Dt(()=>{Yt.boards(e).then(n).catch(()=>{})},[e]);const m=t.find(_=>_.key===i),u=(l==null?void 0:l[i])??[],w=_=>e==="datasets"?{dataset:_.id}:{space:_.id};return s(ge,{children:[e==="spaces"&&s(yu,{}),s("div",{class:"section-head",children:s("div",{children:[s("h2",{children:m.label}),s("p",{children:[m.note,l?` Week ending ${Ht(l.updated)}.`:""]})]})}),s("div",{class:"seg lb-tabs",role:"tablist",children:t.map(_=>s("button",{role:"tab","aria-selected":i===_.key,onClick:h=>{o(_.key),d(25),va(h)},children:_.label},_.key))}),l?s(ge,{children:[s("div",{class:"table-scroll",children:s("table",{class:"list",children:[s("thead",{children:e==="datasets"?s("tr",{children:[s("th",{children:"Dataset"}),s("th",{children:"Last 4 weeks"}),s("th",{children:"This week"}),s("th",{children:"Change"}),s("th",{children:"30 days"}),s("th",{children:i==="used_by_models"?"Models trained on it":"All time"})]}):s("tr",{children:[s("th",{children:"Space"}),s("th",{children:"Last 4 weeks"}),s("th",{children:"Likes this week"}),s("th",{children:"30 days"}),s("th",{children:"Likes"}),s("th",{children:"SDK"})]})}),s("tbody",{children:u.slice(0,a).map((_,h)=>s("tr",{children:[s("td",{class:"name",children:[s("span",{class:"rank",children:h+1}),s("a",{href:He(w(_)),onClick:M=>{M.preventDefault(),Te(w(_))},children:[e==="spaces"&&_.emoji?`${_.emoji} `:"",e==="spaces"&&_.title?_.title:_.id]}),s("span",{class:"sub",style:{paddingLeft:"2.5em"},children:e==="spaces"?_.id:zt(_.pipeline_tag)})]}),s("td",{children:s(ga,{v:_.spark??[],color:e==="spaces"?"var(--c3)":void 0})}),e==="datasets"?s(ge,{children:[s("td",{children:s("b",{children:ce(_.dl_7d)})}),s("td",{class:_.growth_7d==null?"muted":_.growth_7d>=0?"up":"down",children:Sl(_.growth_7d)}),s("td",{children:ce(_.dl30)}),s("td",{children:i==="used_by_models"?X(_.used_by_models):ce(_.dl_all)})]}):s(ge,{children:[s("td",{children:s("b",{children:["+",X(_.likes_7d)]})}),s("td",{children:["+",X(_.likes_30d)]}),s("td",{children:ce(_.likes)}),s("td",{class:"muted",children:_.sdk??"–"})]})]},_.id))})]})}),u.length>a&&s("button",{class:"btn",style:{marginTop:16},onClick:()=>d(a+25),children:"Show 25 more"})]}):s("div",{class:"skeleton"})]})}const ku=(()=>{try{return window.self!==window.top}catch{return!0}})(),js=({size:e=15,fill:t="currentColor"})=>s("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:t,"aria-hidden":"true",children:s("path",{d:"M12 21s-7.5-4.6-9.6-9.3C.9 8.2 3 4.5 6.6 4.5c2.1 0 3.6 1.1 5.4 3 1.8-1.9 3.3-3 5.4-3 3.6 0 5.7 3.7 4.2 7.2C19.5 16.4 12 21 12 21z"})});function Su(){return ku?s("span",{class:"btn like-fake",tabIndex:0,"aria-describedby":"like-tip",children:[s(js,{fill:"#ff4d6d"}),"Like on Hugging Face",s("span",{class:"like-tip",id:"like-tip",role:"tooltip",children:["Click ",s("span",{class:"hf-like",children:[s(js,{size:12,fill:"#ff4d6d"})," like"]})," in the Hugging Face bar above this page, next to ",s("code",{children:"tardellirs/model-pulse"}),"."]})]}):s("a",{class:"btn",href:Pr,target:"_blank",rel:"noopener",children:[s(js,{fill:"#ff4d6d"}),"Like on Hugging Face ↗"]})}const rr="https://modelpulse.ifsp.dev";function ar({text:e,label:t="Copy"}){const[l,n]=ue(!1);return s("button",{class:"btn",onClick:async()=>{try{await navigator.clipboard.writeText(e)}catch{const i=document.createElement("textarea");i.value=e,document.body.appendChild(i),i.select(),document.execCommand("copy"),i.remove()}n(!0),setTimeout(()=>n(!1),1600)},children:l?"Copied":t})}async function xu(e){await document.fonts.ready;const t=1200,l=675,n=2,i=document.createElement("canvas");i.width=t*n,i.height=l*n;const o=i.getContext("2d");o.scale(n,n);const a=w=>getComputedStyle(document.documentElement).getPropertyValue(w).trim();o.fillStyle=a("--paper"),o.fillRect(0,0,t,l),o.fillStyle=a("--ink"),o.beginPath(),o.roundRect(56,48,34,34,9),o.fill(),o.strokeStyle="#FFD43B",o.lineWidth=3,o.lineCap="round",o.lineJoin="round",o.beginPath(),o.moveTo(62,66),o.lineTo(68,66),o.lineTo(72,57),o.lineTo(78,75),o.lineTo(81,67),o.lineTo(85,67),o.stroke(),o.fillStyle=a("--ink"),o.font=`700 20px ${a("--font")}`,o.fillText("Model Pulse",102,72),o.fillStyle=a("--muted"),o.font=`400 18px ${a("--font")}`,o.textAlign="right",o.fillText("modelpulse.ifsp.dev",t-56,72),o.textAlign="left",o.fillStyle=a("--ink"),o.font=`600 36px ${a("--font")}`,o.fillText(e.id.length>48?e.id.slice(0,47)+"…":e.id,56,148),o.font=`600 88px ${a("--font-cond")}`;const d=(e.dl_all??e.dl30??0).toLocaleString("en");o.fillText(d,56,248);const m=o.measureText(d).width;o.fillStyle=a("--muted"),o.font=`400 20px ${a("--font")}`,o.fillText(e.dl_all!=null?"downloads all time":"downloads, last 30 days",60,280),e.growth_7d!=null&&(o.fillStyle=e.growth_7d>=0?a("--up"):a("--down"),o.font=`600 30px ${a("--font")}`,o.fillText(`${Sl(e.growth_7d)} this week`,56+m+28,240));const u=document.querySelector(".chart-box canvas");if(u){const w=t-112,_=l-330-40,h=Math.min(w/u.width,_/u.height);o.drawImage(u,(t-u.width*h)/2,320,u.width*h,u.height*h)}return new Promise(w=>i.toBlob(_=>w(_),"image/png"))}function Mu({model:e,url:t}){const[l,n]=ue("month"),i=`${rr}/badge/${e.id}.svg${l==="month"?"":`?metric=${l}`}`,o=`[![Model Pulse](${i})](${Pr}?model=${e.id})`,a=e.growth_7d!=null?` (${Sl(e.growth_7d)} week over week)`:"",d=`${e.id} has ${ce(e.dl_all??e.dl30)} downloads on Hugging Face${a}. Full download history:`;return s("section",{class:"section",children:s("div",{class:"wrap",children:[s("div",{class:"section-head",children:s("div",{children:[s("h2",{children:"Share this model's numbers"}),s("p",{children:"Every link opens this page with the same chart and comparison."})]})}),s("div",{class:"share-grid",children:[s("div",{children:[s("h3",{children:"Link"}),s("p",{children:"Opens Model Pulse on Hugging Face, ready to explore."}),s("div",{class:"code",children:[s("code",{children:t}),s(ar,{text:t})]}),s("div",{style:{display:"flex",gap:8,marginTop:12,flexWrap:"wrap"},children:[s("button",{class:"btn",onClick:async()=>{const m=await xu(e),u=document.createElement("a");u.href=URL.createObjectURL(m),u.download=`${e.id.replace("/","_")}-model-pulse.png`,u.click(),setTimeout(()=>URL.revokeObjectURL(u.href),2e3)},children:"Download image"}),s("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(d)}&url=${encodeURIComponent(t)}`,children:"Post on X"}),s("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(t)}`,children:"Share on LinkedIn"})]})]}),s("div",{children:[s("h3",{children:"Badge for your model card"}),s("p",{children:["Updates daily. Paste it into the README of ",e.id.split("/").pop(),"."]}),s("div",{class:"seg badge-opts",role:"group","aria-label":"Badge metric",children:[s("button",{"aria-pressed":l==="month",onClick:()=>n("month"),children:"Monthly"}),s("button",{"aria-pressed":l==="all",onClick:()=>n("all"),children:"All time"}),s("button",{"aria-pressed":l==="likes",onClick:()=>n("likes"),children:"Likes"})]}),s("div",{class:"badge-preview",children:s("img",{src:i.replace(rr,Mr),alt:"Model Pulse badge preview",height:22})}),s("div",{class:"code",children:[s("code",{children:o}),s(ar,{text:o,label:"Copy markdown"})]})]}),s("div",{class:"cta",children:[s("h3",{children:"Keep Model Pulse on model pages"}),s("p",{children:"Hugging Face lists the most-liked Spaces on each model page. A like keeps download history one click away for everyone."}),s(Su,{})]})]})]})})}const Tu=e=>getComputedStyle(document.documentElement).getPropertyValue(e).trim();function Cu({title:e,data:t,by:l,note:n}){const i=Gt(()=>{let o=0;const a=[],d=[];return t.months.month.forEach((m,u)=>{o+=t.months.n[u],a.push(Ql(`${m}-15`)),d.push(o)}),a.length?[{label:e,color:Tu(l==="space"?"--c3":"--c2"),t:a,v:d,fill:!0}]:[]},[t]);return t.count?s("div",{class:"card used-by",children:[s("div",{class:"ub-head",children:[s("h3",{children:e}),s("div",{class:"ub-n",children:[s("b",{children:X(t.count)})," ",l==="space"?t.count===1?"Space":"Spaces":t.count===1?"model":"models"]})]}),i.length>0&&i[0].t.length>1&&s(yn,{lines:i,height:150,endLabel:!0,valueLabel:o=>X(o)}),s("ol",{class:"ub-list",children:t.top.map(o=>{const a=l==="space"?{space:o.id}:{model:o.id};return s("li",{children:[s("a",{href:He(a),onClick:d=>{d.preventDefault(),Te(a)},children:[l==="space"&&s("span",{class:"emo","aria-hidden":"true",children:o.emoji||"·"}),s("span",{class:"nm",children:l==="space"&&o.title?s(ge,{children:[o.title," ",s("small",{children:o.id})]}):o.id}),s("span",{class:"v",children:l==="space"?`${ce(o.likes)} ${o.likes===1?"like":"likes"}`:`${ce(o.dl30)}/mo`})]}),l==="model"&&o.pipeline_tag&&s("span",{class:"ub-sub",children:zt(o.pipeline_tag)})]},o.id)})}),s("p",{class:"chart-note",children:n})]}):null}const cr={"1M":30,"3M":91,"6M":182,"1Y":365,All:null},dr=["--c1","--c2","--c3","--c4","--c5"],zn=e=>getComputedStyle(document.documentElement).getPropertyValue(dr[e%dr.length]).trim();function Gs(e,t,l){const n=l&&e.family?e.family:e.series;if(t==="weekly"){const{t:i,v:o}=qn(n.day,n.dl_all);return Lr(i,o)}if(t==="daily"){const{t:i,v:o}=qn(n.day,n.dl_all);return{t:i,v:ui(o,7),raw:o}}return t==="month"?Vn(n.day,n.dl30):t==="total"?Vn(n.day,n.dl_all):Vn(e.series.day,e.series.likes)}function Du({route:e}){var j,Ce,Oe;const t=e.model,l=e.compare??[],[n,i]=ue(null),[o,a]=ue([]),[d,m]=ue(null),[u,w]=ue("weekly"),[_,h]=ue("1Y"),[M,S]=ue(null),R=y=>{S(null),w(y)},[$,H]=ue(!1),[k,O]=ue(!1),[T,E]=ue(!1),[L,N]=ue("left");Dt(()=>{i(null),m(null),H(!1),S(null),Yt.model(t).then(y=>{i(y),y.model.id!==t&&Te({...e,model:y.model.id},!0),document.title=`${y.model.id} downloads: daily history and stats · Model Pulse`}).catch(y=>m(y.message))},[t]),Dt(()=>{Promise.all(l.map(y=>Yt.model(y).catch(()=>null))).then(y=>a(y.filter(Boolean)))},[l.join(",")]);const v=n==null?void 0:n.model,W=!!n&&n.series.dl_all.filter(y=>y!=null).length>7,D=(u==="daily"||u==="weekly")&&!W?"month":u,P=Gt(()=>{if(!n)return[];const y=Gs(n,D,$),x=[];return x.push({label:$?`${n.model.id} + derivatives`:n.model.id,color:zn(0),t:y.t,v:y.v,fill:!o.length}),o.forEach((le,pe)=>{const Z=Gs(le,D,!1);x.push({label:le.model.id,color:zn(pe+1),t:Z.t,v:Z.v})}),x},[n,o,D,$]),Y=Gt(()=>n&&D==="weekly"?Gs(n,"weekly",$).partial:!1,[n,D,$]),I=Gt(()=>n?hc($&&n.family?{...n.series,...n.family}:n.series):[],[n,$]),Q=Gt(()=>D==="likes"||o.length?[]:I.filter(y=>y.day).map(y=>({t:Ql(y.day),label:y.label})),[I,D,o.length]),z=Gt(()=>{if(M)return M;const y=cr[_];if(!y||!P.length)return null;const x=Math.max(...P.map(le=>le.t[le.t.length-1]??0));return[x-y*86400,x]},[_,M,P]);if(d)return s("div",{class:"wrap err",children:[s("h1",{children:["No history for ",t]}),s("p",{class:"muted",children:d}),s("p",{children:"Check the spelling, or try one of the models below."}),s(es,{onPick:y=>Te({model:y}),placeholder:"Search another model",autoFocus:!0})]});if(!n||!v)return s("div",{class:"wrap hero",children:[s("div",{class:"model-name",children:t}),s("div",{class:"skeleton",style:{marginTop:40}})]});const[J,K]=v.id.includes("/")?[v.id.split("/")[0],v.id.split("/").slice(1).join("/")]:[null,v.id],Ne=Tr(v.params),oe=(j=v.base_ids)==null?void 0:j[0],re={quantized:"Quantized from",finetune:"Fine-tuned from",adapter:"Adapter for",merge:"Merged from"},de=$&&v.fam_all?v.fam_all:v.dl_all??v.dl30,te=y=>Te({model:v.id,compare:y.length?y:void 0},!0);return s(ge,{children:[s("div",{class:"wrap hero",children:[s("div",{class:"crumbs",children:[v.pipeline_tag&&s("span",{class:"chip",children:zt(v.pipeline_tag)}),Ne&&s("span",{class:"chip",children:Ne}),v.license&&s("span",{class:"chip",children:v.license}),v.likes!=null&&s("span",{class:"chip",title:v.likes_7d?`${X(v.likes_7d)} new likes in the last 7 days`:void 0,children:[s("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#ff6b81","aria-hidden":"true",children:s("path",{d:"M12 21s-7.5-4.6-9.6-9.3C.9 8.2 3 4.5 6.6 4.5c2.1 0 3.6 1.1 5.4 3 1.8-1.9 3.3-3 5.4-3 3.6 0 5.7 3.7 4.2 7.2C19.5 16.4 12 21 12 21z"})}),X(v.likes)," likes",v.likes_7d?s("span",{class:"up",children:["+",X(v.likes_7d)]}):null]}),oe&&s("a",{class:"chip",href:He({model:oe}),onClick:y=>{y.preventDefault(),Te({model:oe})},children:[re[v.base_relation??""]??"Based on"," ",oe]}),(Ce=n.datasets)==null?void 0:Ce.slice(0,2).map(y=>s("a",{class:"chip",href:He({dataset:y.id}),onClick:x=>{x.preventDefault(),Te({dataset:y.id})},children:["Trained on ",y.id]},y.id)),s("a",{class:"chip",href:`https://huggingface.co/${v.id}`,target:"_blank",rel:"noopener",children:"Open on Hugging Face ↗"})]}),s("h1",{class:"model-name",children:[J&&s("a",{href:He({author:J}),onClick:y=>{y.preventDefault(),Te({author:J})},class:"org",children:[J,"/"]}),J&&s("wbr",{}),s("span",{class:"hl",children:K})]}),s("div",{class:"card stats",style:{padding:0},children:[s("div",{class:"fig fig-main",children:[s("div",{class:"num",title:X(de),children:X(de)}),s("div",{class:"label",children:[v.dl_all!=null?"downloads all time":"downloads in the last 30 days",$?`, including ${X(v.fam_members)} derivatives`:""]})]}),s("div",{class:"fig",children:[s("div",{class:"val",children:ce($?v.fam_dl30:v.dl30)}),s("div",{class:"label",children:"last 30 days"})]}),s("div",{class:"fig",children:[s("div",{class:"val",children:[ce($?v.fam_7d:v.dl_7d),!$&&v.growth_7d!=null&&s("small",{class:v.growth_7d>=0?"up":"down",children:Sl(v.growth_7d)})]}),s("div",{class:"label",children:["last 7 days",!$&&v.growth_7d!=null?", vs. 3-week average":""]})]}),s("div",{class:"fig",children:[s("div",{class:"val",children:["#",X(v.rank_dl30)]}),s("div",{class:"label",children:["on the Hub",v.rank_task&&v.pipeline_tag?`, ${fc(v.rank_task)} in ${zt(v.pipeline_tag)}`:""]})]})]}),s("div",{class:"card chart-card",children:[s("div",{class:"chart-bar",children:[s("div",{class:"left",children:[s("div",{class:"seg",role:"group","aria-label":"Metric",children:[W&&s("button",{"aria-pressed":D==="weekly",onClick:()=>R("weekly"),children:"Weekly"}),W&&s("button",{"aria-pressed":D==="daily",onClick:()=>R("daily"),children:"Daily"}),s("button",{"aria-pressed":D==="month",onClick:()=>R("month"),children:"Rolling 30 days"}),W&&s("button",{"aria-pressed":D==="total",onClick:()=>R("total"),children:"All time"}),s("button",{"aria-pressed":D==="likes",onClick:()=>{R("likes"),H(!1)},children:"Likes"})]}),s("div",{class:"seg",role:"group","aria-label":"Time range",children:Object.keys(cr).map(y=>s("button",{"aria-pressed":!M&&_===y,onClick:()=>{S(null),h(y)},children:y},y))})]}),s("div",{class:"right",children:[!!n.family&&!o.length&&D!=="likes"&&s("div",{class:"seg",children:s("button",{"aria-pressed":$,onClick:()=>H(!$),children:["Include ",X(v.fam_members)," derivatives"]})}),o.length>0&&s("div",{class:"seg",children:s("button",{"aria-pressed":k,onClick:()=>O(!k),children:"Log scale"})}),s("div",{class:`add-compare align-${L}`,children:[s("button",{class:"btn",onClick:y=>{const x=y.currentTarget.getBoundingClientRect();N(x.left+440>window.innerWidth-16?"right":"left"),E(!T)},"aria-expanded":T,disabled:l.length>=4,children:[s("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round",children:s("path",{d:"M12 5v14M5 12h14"})}),"Compare"]}),T&&s(es,{autoFocus:!0,placeholder:"Add a model to compare",exclude:[v.id,...l],onPick:y=>{E(!1),te([...l,y])}})]})]})]}),o.length>0&&s("div",{class:"legend",style:{marginBottom:8},children:[s("span",{class:"chip",children:[s("i",{class:"sw",style:{background:zn(0)}}),v.id]}),o.map((y,x)=>s("span",{class:"chip",children:[s("i",{class:"sw",style:{background:zn(x+1)}}),s("a",{href:He({model:y.model.id}),onClick:le=>{le.preventDefault(),Te({model:y.model.id})},children:y.model.id}),s("button",{"aria-label":`Remove ${y.model.id}`,onClick:()=>te(l.filter(le=>le!==y.model.id)),children:"✕"})]},y.model.id))]}),s(yn,{lines:P,range:z,log:k,markers:Q,onZoom:y=>S(y),height:380,bars:D==="weekly",partialLast:D==="weekly"&&!!Y,endLabel:D!=="weekly",tipDate:D==="weekly"?y=>`Week of ${Ht(new Date((y-fi/2)*1e3),{month:"short",day:"numeric",year:"numeric"})}`:void 0,valueLabel:D==="daily"?y=>X(y)+"/day":D==="weekly"?y=>X(y)+"/week":void 0}),s("p",{class:"chart-note",children:[D==="daily"&&"7-day average of daily downloads. ",D==="weekly"&&(o.length?"Downloads per week, Monday to Sunday. ":"Downloads per week, Monday to Sunday; the striped bar is the week in progress. "),D!=="likes"&&`Daily figures start on ${Ht("2025-02-27")}, when the Hub began reporting all-time totals; the rolling 30-day view goes back to ${Ht("2024-07-29")}. `,"The Hub sometimes books delayed downloads in a single day, which shows up as a short spike. Drag on the chart to zoom, double-click to reset."]})]})]}),I.length>0&&D!=="likes"&&s("section",{class:"section",children:s("div",{class:"wrap",children:[s("div",{class:"section-head",children:s("div",{children:[s("h2",{children:"Milestones"}),s("p",{children:["The day ",$?"the family":"the model"," first crossed each mark in all-time downloads."]})]})}),s("ol",{class:"timeline",children:I.map(y=>s("li",{class:y.day||y.before?"":"pending",children:[s("div",{class:"m",children:y.label}),s("div",{class:"when",children:y.day?Ht(y.day):y.before?`Before ${Ht(y.before,{month:"short",year:"numeric"})}`:"Not yet"})]},y.label))})]})}),(v.fam_members>0||n.children.length>0)&&s(Eu,{data:n}),!!((Oe=n.spaces)!=null&&Oe.count)&&s("section",{class:"section",children:s("div",{class:"wrap",children:[s("div",{class:"section-head",children:s("div",{children:[s("h2",{children:["Spaces using ",v.id.split("/").pop()]}),s("p",{children:"Spaces whose card lists this model, and how that number grew."})]})}),s(Cu,{title:"Spaces using it",data:n.spaces,by:"space",note:"Counted from today's Space cards, by the month each Space was created."})]})}),s(Lu,{data:n}),s(Mu,{model:v,url:mc({model:v.id,compare:l.length?l:void 0})})]})}const Pu={quantized:"a quantization",finetune:"a fine-tune",adapter:"an adapter",merge:"a merge"};function Lu({data:e}){var u;const t=e.model,[l]=t.id.includes("/")?t.id.split("/"):[""],n=t.id.split("/").pop(),i=t.pipeline_tag?zt(t.pipeline_tag):"",o=t.params?t.params>=1e9?`${(t.params/1e9).toFixed(1)}B`:`${Math.round(t.params/1e6)}M`:"",a=`${o?`${o}-parameter `:""}${i}`.trim(),d=(u=t.base_ids)==null?void 0:u[0],m=(w,_)=>s("a",{href:He(w),onClick:h=>{h.preventDefault(),Te(w)},children:_});return s("section",{class:"section",children:s("div",{class:"wrap about",children:[s("h2",{children:["About ",n]}),s("p",{children:[s("b",{children:t.id})," is ",/^[aeio8]|^1[18]/i.test(a)?"an":"a"," ",a?`${a} model`:"model",l&&s(ge,{children:[" by ",m({author:l},l)]}),"."," ","In the last 30 days it was downloaded ",s("b",{children:X(t.dl30)})," times (",X(t.dl_7d)," in the last 7 days)",t.dl_all?s(ge,{children:[", and ",s("b",{children:X(t.dl_all)})," times in total"]}):null,".",t.rank_dl30?s(ge,{children:[" It ranks #",X(t.rank_dl30)," on the Hub by monthly downloads",t.rank_task&&t.pipeline_tag?s(ge,{children:[" and #",X(t.rank_task)," among ",i," models"]}):null,"."]}):null,t.likes!=null?s(ge,{children:[" It has ",X(t.likes)," likes",t.likes_7d?`, ${X(t.likes_7d)} of them in the last week`:"","."]}):null]}),d&&s("p",{children:["It is ",Pu[t.base_relation??""]??"a derivative"," of ",m({model:d},d),"."]}),t.fam_members>0&&s("p",{children:[X(t.fam_members)," models build on ",n,": ",X(t.n_quantized)," quantized, ",X(t.n_finetune)," fine-tuned, ",X(t.n_adapter)," adapters and ",X(t.n_merge)," merges. Together with the original they were downloaded ",X(t.fam_dl30)," times in the last 30 days."," ",m({view:"galaxy",model:t.id},`See the ${n} galaxy`),"."]}),s("p",{class:"muted",children:"Figures come from daily snapshots of the Hugging Face Hub and update every day."})]})})}function Eu({data:e}){const t=e.model,l=[{k:"Quantized",n:t.n_quantized??0,c:"var(--c1)"},{k:"Fine-tuned",n:t.n_finetune??0,c:"var(--c2)"},{k:"Adapters",n:t.n_adapter??0,c:"var(--c3)"},{k:"Merges",n:t.n_merge??0,c:"var(--c4)"}],n=l.reduce((o,a)=>o+a.n,0)||1,i=t.fam_dl30&&t.dl30!=null?1-t.dl30/t.fam_dl30:null;return s("section",{class:"section",children:s("div",{class:"wrap",children:s("div",{class:"card family-top",children:[s("div",{class:"family-sum",children:[s("h2",{children:"Family"}),s("p",{children:t.fam_members>0?s(ge,{children:[X(t.fam_members)," models build on ",t.id.split("/").pop(),", directly or through other derivatives. Together with the original they were downloaded ",s("b",{children:ce(t.fam_dl30)})," times in the last 30 days",i!=null&&i>.01?s(ge,{children:[", and ",s("b",{children:[Math.round(i*100),"%"]})," of that went to derivatives"]}):null,"."]}):s(ge,{children:["Derivatives of ",t.id.split("/").pop()," on the Hub."]})}),t.fam_members>0&&s(ge,{children:[s("div",{class:"big",children:X(t.fam_all)}),s("div",{class:"muted",style:{marginBottom:18},children:"family downloads all time"}),s("div",{class:"rel","aria-hidden":"true",children:l.filter(o=>o.n).map(o=>s("span",{style:{width:`${o.n/n*100}%`,background:o.c}},o.k))}),s("div",{class:"rel-legend",children:l.map(o=>s("div",{children:[s("span",{children:[s("i",{style:{background:o.c}}),o.k]}),s("b",{children:X(o.n)})]},o.k))}),s("a",{class:"btn galaxy-btn",href:He({view:"galaxy",model:t.id}),onClick:o=>{o.preventDefault(),Te({view:"galaxy",model:t.id})},children:[s("span",{class:"g-dot","aria-hidden":"true"}),"See the ",X(t.fam_members)," models as a galaxy"]})]})]}),e.children.length>0&&s("div",{children:s("div",{class:"table-scroll",children:s("table",{class:"list",children:[s("thead",{children:s("tr",{children:[s("th",{children:"Most downloaded direct derivatives"}),s("th",{children:"Type"}),s("th",{children:"30 days"}),s("th",{children:"All time"})]})}),s("tbody",{children:e.children.slice(0,12).map(o=>s("tr",{children:[s("td",{class:"name",children:s("a",{href:He({model:o.id}),onClick:a=>{a.preventDefault(),Te({model:o.id})},children:o.id})}),s("td",{class:"muted",children:o.relation}),s("td",{children:ce(o.dl30)}),s("td",{children:ce(o.dl_all)})]},o.id))})]})})})]})})})}function bn(e){let t=null,l=null;return n=>{const[,i]=ue(0);return Dt(()=>{t||(l??(l=e())).then(o=>{t=o,i(a=>a+1)})},[]),t?s(t,{...n}):s("div",{class:"wrap",style:{minHeight:"70vh"}})}}const Au=bn(()=>vn(()=>import("./Galaxy-x3zB7EzA.js"),[]).then(e=>e.Galaxy)),$u=bn(()=>vn(()=>import("./Wrapped-DLnZ-VjX.js"),[]).then(e=>e.Wrapped)),Ru=bn(()=>vn(()=>import("./Report-B4-iXuei.js"),[]).then(e=>e.Report)),Fu=bn(()=>vn(()=>import("./Repos-csoY-8xv.js"),[]).then(e=>e.DatasetPage)),Hu=bn(()=>vn(()=>import("./Repos-csoY-8xv.js"),[]).then(e=>e.SpacePage));function Ou(){const[e,t]=ue(wo());Dt(()=>{var d;const a=()=>t(wo());if(addEventListener("popstate",a),addEventListener("routechange",a),!Jn)try{(d=window.parent)==null||d.postMessage({queryString:location.search.slice(1),hash:""},"https://huggingface.co")}catch{}return()=>{removeEventListener("popstate",a),removeEventListener("routechange",a)}},[]);const l=e.view==="report",n=e.view==="wrapped",i=e.view==="galaxy",o=!e.model&&!e.dataset&&!e.space&&!e.author&&!l&&!n&&!i;return s(ge,{children:[s("header",{class:"top",children:s("div",{class:"wrap",children:[s("a",{class:"brand","aria-label":"Model Pulse home",href:He({}),onClick:a=>{a.preventDefault(),Te({})},children:[s(wa,{}),s("span",{children:"Model Pulse"})]}),!o&&s(es,{hotkey:!0,all:!0,onPick:(a,d)=>Te({[d]:a})}),s("nav",{children:[!o&&s("a",{class:"btn nav-btn hide-sm",href:He({}),onClick:a=>{a.preventDefault(),Te({})},children:"Rankings"}),s("a",{class:"btn nav-btn","aria-current":i?"page":void 0,href:He({view:"galaxy"}),onClick:a=>{a.preventDefault(),Te({view:"galaxy"})},children:"Galaxy"}),s("a",{class:"btn nav-btn","aria-current":n?"page":void 0,href:He({view:"wrapped"}),onClick:a=>{a.preventDefault(),Te({view:"wrapped"})},children:"Wrapped"}),s("a",{class:`btn nav-btn${o||l?"":" hide-sm"}`,"aria-current":l?"page":void 0,href:He({view:"report"}),onClick:a=>{a.preventDefault(),Te({view:"report"})},children:"Report"})]})]})}),s("main",{children:i?s(Au,{model:e.model},e.model??"entry"):n?s($u,{author:e.author},e.author??"entry"):e.model?s(Du,{route:e},e.model):e.dataset?s(Fu,{id:e.dataset},e.dataset):e.space?s(Hu,{id:e.space},e.space):e.author?s(hu,{route:e},e.author):l?s(Ru,{}):s(wu,{})}),s("footer",{class:"foot",children:s("div",{class:"wrap",children:[s("span",{children:["Data from daily snapshots of ",s("a",{href:"https://huggingface.co/datasets/cfahlgren1/hub-stats",target:"_blank",rel:"noopener",children:"cfahlgren1/hub-stats"}),", refreshed every day. An independent project, not affiliated with Hugging Face."]}),s("span",{children:["Download counts follow the ",s("a",{href:"https://huggingface.co/docs/hub/models-download-stats",target:"_blank",rel:"noopener",children:"Hub's own counting rules"}),"."]}),s("span",{class:"maker",children:["Made by ",s("a",{href:"https://huggingface.co/tardellirs",target:"_blank",rel:"noopener",children:"Tardelli Stekel"})," ","(",s("a",{href:"https://huggingface.co/tardellirs",target:"_blank",rel:"noopener",children:"@tardellirs"})," on Hugging Face,"," ",s("a",{href:"https://stekel.ifsp.dev/",target:"_blank",rel:"noopener",children:"stekel.ifsp.dev"}),")",s("a",{class:"gh",href:"https://github.com/tardellirs/modelpulse",target:"_blank",rel:"noopener","aria-label":"Source code on GitHub",title:"Source code on GitHub",children:s("svg",{width:"18",height:"18",viewBox:"0 0 16 16","aria-hidden":"true",children:s("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})})})]})]})})]})}ic(s(Ou,{}),document.getElementById("app"));export{vl as A,rr as B,yn as C,Su as L,ge as S,Gt as T,Cu as U,fi as W,He as a,ce as b,wa as c,ue as d,es as e,X as f,$t as g,Dt as h,Mr as i,Ht as j,Yt as k,qn as l,ui as m,Te as n,Sl as o,Vn as p,fc as q,Pr as r,mc as s,zt as t,s as u,ar as v,Lr as w};