1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./D923fASB.js","./CzHeHbBU.js","./e3jp4aij.js","./entry.WIlqpo9B.css","./B8nwDQuz.js"])))=>i.map(i=>d[i]); 2import Ts from"./37ovQUGQ.js";import{_ as ho}from"./BpKf9z5s.js";import{u as uo,_ as fo,a as Ze,b as _o,c as mo}from"./DNXaLKX0.js";import{_ as go}from"./0wwi-VuO.js";import{aL as tn,p as Z,P as ot,g as w,ad as Q,a1 as ct,i as h,$ as x,k as _,a2 as $,h as T,ao as Y,ap as rt,e as P,af as po,o as Lt,a as Kt,j as Cs,a7 as R,a0 as W,q as It,a9 as Qe,r as j,u as bo,R as Ps,H as Vs,w as en,b as vo,f as xo,am as yo,aH as Te,aa as Ce,aG as wo,y as we,au as Pe,aP as Qt,s as ko,W as Mo}from"./e3jp4aij.js";import{a as So,b as To,A as Co}from"./l7w3BVKM.js";import{_ as J}from"./CzHeHbBU.js";import{t as sn,e as nn,d as Ns}from"./Bs8oFpNW.js";import{_ as Je}from"./7gxMQCUi.js";import{u as on}from"./DBB9QGDD.js";import{_ as Po}from"./BrBQmooz.js";import{u as an}from"./BmGdNcZt.js";import{s as ge}from"./822s66Yz.js";import{b as rn,s as ln,u as vs,d as Oo}from"./C_k67jX0.js";import Do from"./f0v-hg7n.js";import{_ as Io}from"./CN_DsAQx.js";import"./NGGd1KL6.js";import"./Jlxi7eDu.js";import"./CsWyEkkb.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"ecos-frontend-cp@12213eb99e1069e82980933c1ec51c50139958dd"};var t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="5cfac4c6-0206-4cdc-8997-497ddcfcfca5",s._sentryDebugIdIdentifier="sentry-dbid-5cfac4c6-0206-4cdc-8997-497ddcfcfca5")}catch{}})();const Ao=tn("/images/tbb/image/img.webp"),Bo={class:"pcb__top"},Lo={class:"pcb__eyebrow"},$o={class:"pcb__live"},Fo={class:"pcb__body"},Ro={class:"pcb__content"},Eo={class:"pcb__title"},zo={class:"pcb__desc"},Vo={class:"pcb__stats"},No={class:"pcb__btn"},jo=Z({__name:"PromoContractsBanner",setup(s){const{t}=ot(),e=a=>`$${a.toLocaleString("en-US")}`,i=e(So),n=e(To(Co)),o=P(()=>[{value:i,label:t("pages.tbb_prepaid.promo_stat_contracts")},{value:"3",label:t("pages.tbb_prepaid.promo_stat_launch")}]);return(a,r)=>{const l=go;return w(),Q(l,{class:"pcb",to:"/mining-store/promo"},{default:ct(()=>[h("div",Bo,[h("span",Lo,x(_(t)("pages.tbb_prepaid.promo_eyebrow")),1),h("span",$o,[r[0]||(r[0]=h("span",{"aria-hidden":"true"},null,-1)),$(" "+x(_(t)("pages.tbb_prepaid.promo_live")),1)])]),h("div",Fo,[h("div",Ro,[h("h3",Eo,x(_(t)("pages.tbb_prepaid.promo_title",{amount:_(n)})),1),h("p",zo,x(_(t)("pages.tbb_prepaid.promo_desc",{amount:_(i)})),1)]),r[1]||(r[1]=h("img",{class:"pcb__visual",src:Ao,alt:"",width:"552",height:"298",loading:"lazy","aria-hidden":"true"},null,-1))]),h("div",Vo,[(w(!0),T(Y,null,rt(_(o),c=>(w(),T("div",{key:c.value,class:"pcb__stat"},[h("strong",null,x(c.value),1),h("span",null,x(c.label),1)]))),128))]),h("span",No,x(_(t)("pages.tbb_prepaid.promo_btn")),1)]),_:1})}}}),Wo=Object.assign(J(jo,[["__scopeId","data-v-a01ac673"]]),{__name:"TBBPromoContractsBanner"}),Ho={class:"pcc"},Uo={class:"pcc__icon-block"},Yo={class:"pcc__text-block"},Ko={class:"pcc__title"},Xo={class:"pcc__desc"},qo={class:"pcc__features"},Go=Z({__name:"PrepaidCloudCard",emits:["buy"],setup(s,{emit:t}){const e=t,{t:i}=ot(),n=P(()=>[i("pages.tbb_prepaid.cloud_feat_1"),i("pages.tbb_prepaid.cloud_feat_2"),i("pages.tbb_prepaid.cloud_feat_3")]);return(o,a)=>(w(),T("div",Ho,[a[3]||(a[3]=h("div",{class:"pcc__orb pcc__orb--1"},null,-1)),a[4]||(a[4]=h("div",{class:"pcc__orb pcc__orb--2"},null,-1)),h("div",Uo,[a[1]||(a[1]=h("div",{class:"pcc__icon"},[h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none"},[h("path",{d:"M6.5 19C4.01472 19 2 16.9853 2 14.5C2 12.1564 3.79151 10.2313 6.07974 10.0194C6.54781 7.17213 9.02024 5 12 5C14.9798 5 17.4522 7.17213 17.9203 10.0194C20.2085 10.2313 22 12.1564 22 14.5C22 16.9853 19.9853 19 17.5 19C13.1102 19 10.3433 19 6.5 19Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),h("div",Yo,[h("div",Ko,x(_(i)("pages.tbb_prepaid.cloud_title")),1),h("div",Xo,x(_(i)("pages.tbb_prepaid.cloud_desc")),1
2)])]),h("div",qo,[(w(!0),T(Y,null,rt(_(n),r=>(w(),T("div",{key:r,class:"pcc__feat"},[a[2]||(a[2]=h("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none"},[h("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),$(" "+x(r),1)]))),128))]),h("button",{class:"pcc__btn",onClick:a[0]||(a[0]=r=>e("buy"))},x(_(i)("pages.tbb_prepaid.cloud_btn")),1)]))}}),Zo=Object.assign(J(Go,[["__scopeId","data-v-8e2dcd57"]]),{__name:"TBBPrepaidCloudCard"}),Qo={class:"pt"},Jo={class:"pt__header"},ta={class:"pt__title"},ea={class:"pt__note"},sa={key:0,class:"pt__error",role:"alert"},ia={class:"pt__dots","aria-hidden":"true"},na=["onClick"],oa=Z({__name:"PrepaidTariffs",emits:["buy"],setup(s,{emit:t}){const e=t,{t:i}=ot(),n=uo(),{error:o,loaded:a,loading:r,visibleTariffs:l}=po(n),c=j(null),d=j(0),u=P(()=>!a.value||r.value);Lt(()=>{n.loadTrialTariffs()});const f=P(()=>u.value?3:l.value.length+2+(o.value?1:0)),m=P(()=>f.value);Kt(f,g=>{d.value>=g&&(d.value=g-1)});const v=()=>{const g=c.value,b=g?Array.from(g.children):[];if(!g||b.length===0)return;const y=b[0]?.offsetLeft??0,k=b.reduce((S,M,O)=>{const C=b[S]??M,D=Math.abs(C.offsetLeft-y-g.scrollLeft);return Math.abs(M.offsetLeft-y-g.scrollLeft)<D?O:S},0);d.value=k},p=g=>{const b=c.value,y=b?.children[g];!b||!y||(b.scrollTo({left:y.offsetLeft-b.children[0].offsetLeft,behavior:"smooth"}),d.value=g)};return(g,b)=>{const y=fo,k=Wo,S=Zo;return w(),T("div",Qo,[h("div",Jo,[h("div",ta,x(_(i)("pages.tbb_prepaid.title")),1),h("div",ea,x(_(i)("pages.tbb_prepaid.note")),1)]),h("div",{ref_key:"ptGrid",ref:c,class:"pt__grid",style:It({"--cards-count":String(_(f))}),onScrollPassive:v},[_(u)?(w(),T(Y,{key:0},rt(3,M=>h("div",{key:M,class:"pt__skeleton-card"},[...b[2]||(b[2]=[Cs('<div class="pt__sk-top" data-v-bc6b7485><div class="pt__sk pt__sk--roi" data-v-bc6b7485></div></div><div class="pt__sk pt__sk--name" data-v-bc6b7485></div><div class="pt__sk pt__sk--price" data-v-bc6b7485></div><div class="pt__sk-rows" data-v-bc6b7485><div class="pt__sk pt__sk--row-cell" data-v-bc6b7485></div><div class="pt__sk pt__sk--row-cell" data-v-bc6b7485></div></div><div class="pt__sk pt__sk--profit" data-v-bc6b7485></div><div class="pt__sk pt__sk--btn" data-v-bc6b7485></div>',6)])])),64)):(w(),T(Y,{key:1},[_(o)?(w(),T("div",sa,[h("span",null,x(_(i)("common.load_failed")),1),h("button",{type:"button",onClick:b[0]||(b[0]=M=>_(n).loadTrialTariffs(!0))},x(_(i)("common.retry")),1)])):R("",!0),(w(!0),T(Y,null,rt(_(l),M=>(w(),Q(y,{key:M.id,name:M.name,price:M.priceUsd,hashrate:M.hashrateTh,days:M.durationDays,"roi-percent":M.roiPercent,"mining-output-btc":M.miningOutputBtc,"mining-output-usd":M.miningOutputUsd,"can-buy":M.canBuy,"btn-label":_(i)("pages.tbb_prepaid.start_contract"),href:`/order/tariff/${M.id}`},null,8,["name","price","hashrate","days","roi-percent","mining-output-btc","mining-output-usd","can-buy","btn-label","href"]))),128)),W(k),W(S,{onBuy:b[1]||(b[1]=M=>e("buy"))})],64))],36),h("div",ia,[(w(!0),T(Y,null,rt(_(m),M=>(w(),T("button",{key:M,class:Qe(["pt__dot",{"pt__dot--active":_(d)===M-1}]),type:"button",tabindex:"-1",onClick:O=>p(M-1)},null,10,na))),128))])])}}}),cn=Object.assign(J(oa,[["__scopeId","data-v-bc6b7485"]]),{__name:"TBBPrepaidTariffs"}),aa={class:"tm-welcome"},ra={class:"tm-welcome__header"},la={class:"tm-welcome__header-left"},ca={class:"tm-welcome__title"},da={class:"tm-welcome__free-badge"},ha={class:"tm-welcome__promo-card"},ua={class:"tm-welcome__promo-left"},fa={class:"tm-welcome__promo-badge-pill"},_a={class:"tm-welcome__promo-headline"},ma={class:"tm-welcome__promo-headline-main"},ga={class:"tm-welcome__promo-headline-sub"},pa={class:"tm-welcome__promo-model"},ba={class:"tm-welcome__promo-infospecs"},va={class:"tm-welcome__promo-spec"},xa={class:"tm-welcome__promo-spec-lbl"},ya={class:"tm-welcome__promo-spec-val"},wa={class:"tm-welcome__promo-spec"},ka={class:"tm-welcome__promo-spec-lbl"},Ma={class:"tm-welcome__promo-spec-val"},Sa={class:"tm-welcome__promo-spec"},Ta={class:"tm-welcome__promo-spec-lbl"},Ca={class:"tm-welcome__promo-spec-val tm-welcome__promo-spec-val--free"},Pa={class:"tm-welcome__promo-spec"},Oa={class:"tm-welcome__promo-spec-lbl"},Da={class:"tm-welcome__promo-spec-val"},Ia={class:"tm-welcome__promo-spec"},Aa={class:"tm-welcome__promo-spec-lbl"},Ba={class:"tm-welcome__promo-spec-val"},La={class:"tm-welcome__promo-right"},$a={class:"tm-welcome__promo-right-content"},Fa={class:"tm-welcome__promo-right-title"},Ra={class:"tm-welcome__promo-right-sub"},Ea={class:"tm-welcome__promo-action"},za={style:{position:"relative"}}
2,Va=["alt"],Na={class:"tm-welcome__steps"},ja={class:"tm-welcome__step-card"},Wa={class:"tm-welcome__step-head"},Ha={class:"tm-welcome__step-num"},Ua={class:"tm-welcome__step-title"},Ya={class:"tm-welcome__checklist"},Ka={class:"tm-welcome__check-text"},Xa={class:"tm-welcome__check-main"},qa={key:0,class:"tm-welcome__sub-item"},Ga={key:0},Za={key:1},Qa={key:0,class:"tm-welcome__step-arrow","aria-hidden":"true"},Ja=Z({__name:"TrialMiningWelcome",setup(s){const e=vo().public.API_V2_URL,i=j(!1),{t:n}=ot(),o=bo(),a=Ps(),r=Ze(),l=on();function c(k){return typeof k=="object"&&k!==null&&Array.isArray(k.parts)}const d=P(()=>l.fpps||88e-9),u=P(()=>l.btcRate||95e3),f=P(()=>d.value*270),m=P(()=>(f.value*u.value).toFixed(2)),v=()=>{Vs("/mining-store/buy-cloud")},p=async()=>{if(!i.value){i.value=!0;try{const k=g("trial_activation");nn(k);const S=await xo(`${e}/trial-mining/activate`,{redirect_uri:"",result_uri:"",terms:!0});if(!S.ok){console.error("Trial mining activation error:",S.failure.message);return}await a.loadUser(),r.isLoad=!0,await r.fetchTrialData()}catch(k){console.error("Trial mining activation error:",k)}finally{i.value=!1}}};function g(k){return{productKey:"trial_mining_tbb",itemId:"try_before_buy",itemName:"Trial Mining TBB",price:0,value:0,quantity:1,itemParams:{trial_action:k,hashrate_th:270,duration_days:30,expected_daily_btc:f.value,expected_daily_usd:Number(m.value),entry_point:"cp_trial_mining_welcome"}}}Lt(()=>{sn(g("view")),o.query.activateTrial==="1"&&a.isAuthenticated&&(p(),Vs({path:o.path,query:{}},{replace:!0}))});function b(k){return{parts:k.split("$#$").map((M,O)=>({text:M,bold:O%2===1,breakLine:!0}))}}const y=j([]);return en(()=>{y.value=[{id:1,title:n("pages.tbb_activate_trial"),titleMobile:n("pages.tbb_activate_trial"),items:[{text:n("pages.tbb_simple"),subItems:[n("pages.tbb_activate_asic")]},{text:n("Quick"),subItems:[n("pages.tbb_within_24h")]},{text:n("pages.tbb_hassle_free"),subItems:[n("pages.tbb_no_setup")]}],image:"step_1"},{id:2,title:n("pages.tbb_start_mining"),titleMobile:n("pages.tbb_start_mining"),items:[{text:n("pages.tbb_start"),subItems:[n("pages.tbb_asic_miner")]},{text:n("pages.tbb_mine"),subItems:[n("pages.tbb_phase_lasts")]},{text:n("pages.tbb_monitor"),subItems:[n("pages.tbb_real_time")]}],image:"step_2"},{id:3,title:n("pages.tbb_earn_btc"),titleMobile:n("pages.tbb_earn_btc"),items:[{text:n("pages.tbb_earn"),subItems:[n("pages.tbb_mining_session")]},{text:n("pages.tbb_experience"),subItems:[n("pages.tbb_real_bitcoin")]},{text:n("pages.tbb_make_decision"),subItems:[n("pages.tbb_expected_rewards")]}],image:"step_3"},{id:4,title:n("pages.tbb_secure_btc"),titleMobile:n("pages.tbb_secure_btc"),items:[{text:n("pages.tbb_start_real"),subItems:[b(n("pages.tbb_keep_btc"))]},{text:n("pages.tbb_grow_earnings"),subItems:[n("pages.tbb_purchasing_ecos")]},{text:n("pages.tbb_30_days"),subItems:[n("pages.tbb_buy_to_withdraw")]}],image:"step_4"}]}),Lt(()=>{l.loadMiningFarmInfo()}),(k,S)=>{const M=Ts,O=ho,C=cn;return w(),T("div",aa,[h("div",ra,[h("div",la,[W(M),h("h1",ca,x(_(n)("pages.tbb_trial_mining")),1)]),h("span",da,[S[0]||(S[0]=h("span",{class:"tm-welcome__badge-dot"},null,-1)),$(" "+x(_(n)("pages.tbb_trial_mining")),1)])]),h("div",ha,[h("div",ua,[h("div",fa,x(_(n)("tbb.db_badge")),1),h("div",_a,[h("span",ma,x(_(n)("tbb.db_headline_main")),1),h("span",ga,x(_(n)("tbb.db_headline_sub")),1),h("div",pa,x(_(n)("tbb.db_model")),1)]),h("div",ba,[h("div",va,[h("span",xa,x(_(n)("tbb.spec_power_lbl")),1),h("span",ya,x(_(n)("tbb.spec_power_val")),1)]),S[1]||(S[1]=h("div",{class:"tm-welcome__promo-spec-div"},null,-1)),h("div",wa,[h("span",ka,x(_(n)("tbb.spec_term_lbl")),1),h("span",Ma,x(_(n)("tbb.spec_term_val")),1)]),S[2]||(S[2]=h("div",{class:"tm-welcome__promo-spec-div"},null,-1)),h("div",Sa,[h("span",Ta,x(_(n)("tbb.spec_cost_lbl")),1),h("span",Ca,x(_(n)("tbb.spec_cost_val")),1)]),S[3]||(S[3]=h("div",{class:"tm-welcome__promo-spec-div"},null,-1)),h("div",Pa,[h("span",Oa,x(_(n)("tbb.spec_withdraw_lbl")),1),h("span",Da,x(_(n)("tbb.spec_withdraw_val")),1)]),S[4]||(S[4]=h("div",{class:"tm-welcome__promo-spec-div"},null,-1)),h("div",Ia,[h("span",Aa,x(_(n)("tbb.spec_pool_lbl")),1),h("span",Ba,x(_(n)("tbb.spec_pool_val")),1)])])]),h("div",La,[h("div",$a,[h("p",Fa,x(_(n)("tbb.btc_to_wallet")),1),h("p",Ra,x(_(n)("tbb.n
2o_wait_withdraw")),1),h("div",Ea,[h("div",za,[_(i)?(w(),Q(O,{key:0})):R("",!0),W(Je,{variant:"green",disabled:_(i),class:"tm-welcome__cta",onClick:p},{default:ct(()=>[$(x(_(n)("pages.tbb_activate")),1)]),_:1},8,["disabled"])])])]),h("img",{src:"/images/tbb/image/img.webp",alt:_(n)("tbb.db_asic_alt"),class:"tm-welcome__promo-asic-img"},null,8,Va)])]),h("div",Na,[(w(!0),T(Y,null,rt(_(y),(D,I)=>(w(),T(Y,{key:D.id},[h("div",ja,[h("div",Wa,[h("span",Ha,x(D.id),1),h("h3",Ua,x(D.title),1)]),h("ul",Ya,[(w(!0),T(Y,null,rt(D.items,(L,A)=>(w(),T("li",{key:A,class:"tm-welcome__check-item"},[S[5]||(S[5]=h("span",{class:"tm-welcome__check-icon"},[h("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none"},[h("path",{d:"M2 6L5 9L10 3",stroke:"white","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),h("div",Ka,[h("span",Xa,x(L.text),1),L.subItems&&L.subItems.length?(w(),T("span",qa,[typeof L.subItems[0]=="string"?(w(),T(Y,{key:0},[$(x(L.subItems[0]),1)],64)):c(L.subItems[0])?(w(!0),T(Y,{key:1},rt(L.subItems[0].parts,(B,G)=>(w(),T("span",{key:G},[G===1?(w(),T("br",Ga)):R("",!0),B.bold?(w(),T("strong",Za,x(B.text),1)):(w(),T(Y,{key:2},[$(x(B.text),1)],64))]))),128)):R("",!0)])):R("",!0)])]))),128))])]),I<_(y).length-1?(w(),T("div",Qa,[...S[6]||(S[6]=[h("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},[h("circle",{cx:"11",cy:"11",r:"10.5",stroke:"#b2ddff"}),h("path",{d:"M8 11H14M14 11L11 8M14 11L11 14",stroke:"#1570ef","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):R("",!0)],64))),128))]),W(C,{onBuy:v})])}}}),tr=Object.assign(J(Ja,[["__scopeId","data-v-245d083d"]]),{__name:"TBBTrialMiningWelcome"}),er=tn("/images/tbb/image/congratulations.svg"),sr={key:0,class:"overlay"},ir={class:"tbb-modal"},nr={class:"tbb-madal__body"},or={class:"tbb-modal__text-block"},ar={key:0,class:"tbb-modal__title"},rr={key:1,class:"tbb-modal__title"},lr={key:2,class:"tbb-modal__title"},cr={key:3,class:"tbb-modal__subtitle"},dr={key:4,class:"tbb-modal__subtitle"},hr={class:"tbb-madal__value"},ur={key:5,class:"tbb-modal__subtitle"},fr=Z({__name:"Modal",props:{isVisible:Boolean},emits:["update:isVisible","scroll-to-section"],setup(s,{emit:t}){const e=s,i=t,n=j({btc:0,usd:0,usd_$:0}),o=an(),{Status:a}=o,{t:r}=ot(),l=P(()=>o.status),c=P(()=>o.wallet),d=Ze(),{closeTrial:u}=d,f=P(()=>d.data?.step),m=P(()=>d.lastWithdrawResult?.success===!0),v=async()=>{f.value!==void 0&&(await u({step:f.value,type:"popup"}),i("update:isVisible",!1))};return en(()=>{if(l.value===a.Executed){if(!c.value.PromoBTC)return;const p=c.value.PromoBTC;n.value.btc=+p.sum}}),(p,g)=>{const b=Po,y=Je;return e.isVisible&&_(f)!==2&&_(f)!==4?(w(),T("div",sr,[h("div",ir,[h("div",nr,[W(b,{class:"tbb-madal__close",onClick:v}),g[2]||(g[2]=h("img",{src:"https://s3.ecos.am/files/xdeLfWzyKYN2sy5FuHbdcTds6yQ176VawooY5Ibj.svg",alt:"ecos-logo",class:"tbb-modal__logo"},null,-1)),h("div",or,[_(f)===1?(w(),T("p",ar,x(_(r)("pages.tbb_congratulations_trial")),1)):R("",!0),_(f)===3?(w(),T("p",rr,x(_(r)("pages.tbb_congratulations")),1)):R("",!0),_(m)?(w(),T("p",lr,[g[1]||(g[1]=h("img",{src:er,alt:"congratulations-icon"},null,-1)),$(" "+x(_(r)("pages.tbb_congratulations")),1)])):R("",!0),_(f)===1?(w(),T("p",cr,x(_(r)("pages.tbb_congratulations_trial_text")),1)):R("",!0),_(f)===3&&!_(m)?(w(),T("p",dr,[$(x(_(r)("pages.tbb_balance_available_1"))+" ",1),h("span",hr,x(_(n).btc.toFixed(8)),1),$(" "+x(_(r)("pages.tbb_balance_available_2")),1)])):R("",!0),_(m)?(w(),T("p",ur,x(_(r)("pages.tbb_withdraw_success")),1)):R("",!0)]),_(f)===1?(w(),Q(y,{key:0,variant:"orange",onClick:v},{default:ct(()=>[$(x(_(r)("pages.tbb_ok")),1)]),_:1})):R("",!0),_(f)===3&&!_(m)?(w(),Q(y,{key:1,variant:"orange",onClick:g[0]||(g[0]=()=>{p.$emit("scroll-to-section","ecos-products-link"),v()})},{default:ct(()=>[$(x(_(r)("pages.tbb_view_ecos")),1)]),_:1})):R("",!0),_(m)?(w(),Q(y,{key:2,variant:"orange",onClick:v},{default:ct(()=>[$(x(_(r)("pages.tbb_view_wallet")),1)]),_:1})):R("",!0)])])])):R("",!0)}}}),_r=Object.assign(J(fr,[["__scopeId","data-v-c5a632d6"]]),{__name:"TBBModal"}),mr={key:0,class:"tib__block"},gr={class:"tib__text-info"},pr=Z({__name:"InfoBanner",props:{isVisible:Boolean},emits:["update:isVisible"],setup(s,{emit:t}){const e=s,i=t,{t:n,locale:o}=ot(),a=Ze(),{closeTrial:r}=a,l=P(()=>a.data?.step),c=P(()=>{const m=a.withdrawalInfo;return m&&Number(m.can_withdraw)>0}),d=async()=>{l.value!==void 0&&(await r({step:l.value,type:"banner"}),i("update:isVisible",!1))},u=j([]),f=()=>{u.value=[{id:1,message:n("pages.tbb_info_text_1"),icon:Te(()=>Ce(()=>import("./D923fASB.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:2,message:n("pages.tbb_info_text_2"),icon:Te(()=>Ce(()=>import("./D923fASB.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:3,message:c.value?n("pages.tbb_info_text_4"):n("pages.tbb_mining_complete"),icon:c.value?Te(()=>Ce(()=>import("./B8nwDQuz.js"),__vite__mapDeps([4,1,2,3]),import.meta.url)):Te(()=>Ce(()=>import("./D923fASB.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))}]};return f(),Kt(o,()=>{f()}),(m,v)=>e.isVisible&&_(l)!==4?(w(),T("div",{key:0,class:Qe(["tib holder",{"tib__block--change":_(c)}])},[(w(),T("svg",{class:"tib__close-icon",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",onClick:d},[...v[0]||(v[0]=[h("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#667085","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])),(w(!0),T(Y,null,rt(_(u),p=>(w(),T("div",{key:p.id},[p.id===_(l)?(w(),T("div",mr,[(w(),Q(yo(p.icon),{class:"tib__icon"})),h("p",gr,x(p.message),1)])):R("",!0)]))),128))],2)):R("",!0)}}),br=Object.assign(J(pr,[["__scopeId","data-v-71f96cdb"]]),{__name:"TBBInfoBanner"}),vr={class:"tml__card"},xr={class:"tml__card-head"},yr={class:"tml__card-title"},wr={class:"tml__card-sub"},kr={class:"tml__card-body"},Mr={class:"tml__launch"},Sr={class:"tml__launch-ico"},Tr={key:0,class:"tml__spin"},Cr={key:1,width:"10",height:"10",viewBox:"0 0 12 12",fill:"none"},Pr={key:2,class:"tml__launch-dot"},Or={key:0,class:"tml__miner-card"},Dr={class:"tml__miner-card-left"},Ir={class:"tml__miner-name"},Ar={class:"tml__miner-loc"},Br={class:"tml__miner-ths"},Lr={class:"tml__miner-ths-lbl"},$r={key:0,class:"tml__launch-checks"},Fr={class:"tml__check-row tml__check-row--ok"},Rr={class:"tml__check-row tml__check-row--ok"},Er={class:"tml__check-row tml__check-row--warn"},zr={class:"tml__check-text"},Vr={key:0,class:"tml__hw-grid"},Nr={class:"tml__hw-cell"},jr={class:"tml__hw-lbl"},Wr={class:"tml__hw-cell"},Hr={class:"tml__hw-lbl"},Ur={class:"tml__hw-val tml__hw-val--or"},Yr={key:0,class:"tml__launch-expect"},Kr={class:"tml__launch-expect-lbl"},Xr={class:"tml__launch-expect-val"},qr={class:"tml__launch-expect-btc"},Gr={class:"tml__launch-expect-usd"},Zr={class:"tml__launch-expect-sub"},Qr=Z({__name:"MiningLaunch",props:{btcRate:{},dailyBtcStr:{},expectedTotalBtc:{},expectedTotalUsd:{},promoActivationDate:{}},setup(s,{expose:t}){const e=s,{t:i}=ot(),n=wo("tbb-launch-animated",()=>!1),o=j([{text:i("tbb.launch_step1"),state:"idle"},{text:i("tbb.launch_step2"),state:"idle"},{text:i("tbb.launch_step3"),state:"idle"}]),a=j(!1),r=j(!1),l=j(!1),c=j(0),d=P(()=>{const b=c.value;if(b<=0)return"00:00:00";const y=Math.floor(b/3600),k=Math.floor(b%3600/60),S=b%60;return[y,k,S].map(M=>String(M).padStart(2,"0")).join(":")});let u=null;const f=[],m=()=>{for(;f.length;)clearTimeout(f.pop())},v=()=>{const b=e.promoActivationDate??Math.floor(Date.now()/1e3),y=()=>{c.value=Math.max(0,b-Math.floor(Date.now()/1e3))};y(),u&&clearInterval(u),u=ge(y,1e3)},p=()=>{l.value=!0,n.value=!0,v()};return t({run:()=>
2{if(n.value){o.value=o.value.map(k=>({...k,state:"done"})),a.value=!0,r.value=!0,l.value=!0,v();return}let b=0;const y=()=>{if(b>0){const k=o.value[b-1];k&&(k.state="done")}if(b<o.value.length){const k=o.value[b];k&&(k.state="run"),b++,f.push(setTimeout(y,1e3))}else f.push(setTimeout(()=>{a.value=!0,f.push(setTimeout(()=>{r.value=!0,f.push(setTimeout(p,600))},500))},400))};f.push(setTimeout(y,300))}}),we(()=>{m(),u&&clearInterval(u)}),(b,y)=>(w(),T("div",vr,[h("div",xr,[h("div",yr,x(_(i)("pages.tbb_trial_mining")),1),h("div",wr,x(_(i)("tbb.card_sub")),1)]),h("div",kr,[h("div",Mr,[(w(!0),T(Y,null,rt(_(o),(k,S)=>(w(),T("div",{key:S,class:Qe(["tml__launch-row",`tml__launch-row--${k.state}`])},[h("span",Sr,[k.state==="run"?(w(),T("span",Tr,"â»")):k.state==="done"?(w(),T("svg",Cr,[...y[0]||(y[0]=[h("path",{d:"M2 6L5 9L10 3",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(w(),T("span",Pr))]),$(" "+x(k.text),1)],2))),128))]),W(Pe,{name:"tml-fade"},{default:ct(()=>[_(a)?(w(),T("div",Or,[h("div",Dr,[h("div",null,[h("div",Ir,x(_(i)("tbb.miner_name")),1),h("div",Ar,x(_(i)("tbb.miner_loc_step1")),1)])]),h("div",Br,[y[1]||(y[1]=h("div",{class:"tml__miner-ths-val"},"270 TH/s",-1)),h("div",Lr,x(_(i)("tbb.miner_power")),1)])])):R("",!0)]),_:1}),W(Pe,{name:"tml-fade"},{default:ct(()=>[_(r)?(w(),T("div",$r,[h("div",Fr,[y[2]||(y[2]=h("span",{class:"tml__ck tml__ck--ok"},[h("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none"},[h("path",{d:"M2 5L4 7.5L8 2.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),h("span",null,x(_(i)("tbb.check_miner_started")),1)]),h("div",Rr,[y[3]||(y[3]=h("span",{class:"tml__ck tml__ck--ok"},[h("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none"},[h("path",{d:"M2 5L4 7.5L8 2.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),h("span",null,x(_(i)("tbb.check_pool_connected")),1)]),h("div",Er,[y[4]||(y[4]=h("span",{class:"tml__ck tml__ck--warn"},"!",-1)),h("span",zr,[$(x(_(i)("tbb.check_first_btc_prefix")),1),h("strong",null,x(_(i)("tbb.check_first_btc_strong")),1)])])])):R("",!0)]),_:1}),W(Pe,{name:"tml-fade"},{default:ct(()=>[_(l)?(w(),T("div",Vr,[h("div",Nr,[h("div",jr,x(_(i)("tbb.hw_hashrate")),1),y[5]||(y[5]=h("div",{class:"tml__hw-val tml__hw-val--bl"},"270 TH/s",-1)),y[6]||(y[6]=h("div",{class:"tml__hw-bar"},[h("div",{class:"tml__hw-fill"})],-1))]),h("div",Wr,[h("div",Hr,x(_(i)("tbb.hw_first_btc")),1),h("div",Ur,x(_(d)),1)])])):R("",!0)]),_:1}),W(Pe,{name:"tml-fade"},{default:ct(()=>[_(l)?(w(),T("div",Yr,[h("div",Kr,x(_(i)("tbb.expect_label")),1),h("div",Xr,[h("span",qr,"â "+x(s.expectedTotalBtc)+" BTC",1),h("span",Gr,"= $"+x(s.expectedTotalUsd),1)]),h("div",Zr,x(_(i)("tbb.expect_sub",{rate:s.dailyBtcStr,price:Number(s.btcRate).toFixed(2)})),1)])):R("",!0)]),_:1})])]))}}),Jr=Object.assign(J(Qr,[["__scopeId","data-v-99271f47"]]),{__name:"TBBMiningLaunch"}),tl={},el={class:"tma-sk"};function sl(s,t){return w(),T("div",el,[...t[0]||(t[0]=[Cs('<div class="tma-sk__card" data-v-31d7c037><div class="tma-sk__item tma-sk__item--title" data-v-31d7c037></div><div class="tma-sk__item tma-sk__item--sub" data-v-31d7c037></div><div class="tma-sk__item tma-sk__item--row" data-v-31d7c037></div><div class="tma-sk__item tma-sk__item--row" data-v-31d7c037></div><div class="tma-sk__item tma-sk__item--row" data-v-31d7c037></div></div><div class="tma-sk__card" data-v-31d7c037><div class="tma-sk__stat-row" data-v-31d7c037><div class="tma-sk__item tma-sk__item--stat" data-v-31d7c037></div><div class="tma-sk__item tma-sk__item--stat" data-v-31d7c037></div><div class="tma-sk__item tma-sk__item--stat" data-v-31d7c037></div></div><div class="tma-sk__item tma-sk__item--progress" data-v-31d7c037></div><div class="tma-sk__item tma-sk__item--chart" data-v-31d7c037></div></div>',2)])])}const il=Object.assign(J(tl,[["render",sl],["__scopeId","data-v-31d7c037"]]),{__name:"SkeletonTrialMiningActive"}),nl={class:"tmc__wrap"},ol={key:0,class:"tmc__banner"},al={class:"tmc__label"},rl={class:"tmc__boxes"},ll={class:"tmc__box"},cl={class:"tmc__val"},dl={class:"tmc__unit"},hl={class:"tmc__box"},ul={class:"tmc__val"},fl={class:"tmc__unit"},_l={class:"tmc__box"},ml={class:"tmc__val"},gl={class:"tmc__unit"},pl={class:"tmc__box"},bl={class:"tmc__val"},vl={class:"tmc__unit"},xl={class:"tmc__promo"},yl={class:"tmc__cta"},wl=Z({__name:"MiningCountdown",props:{activationDate:{},isTrialExpired:{type:Boolean}},setup(s){const t=s,{t:e}=ot(),i=j(0);let n=null;const o=P(()=>{const r=Math.max(0,i.value);return{d:Math.floor(r/86400),h:Math.floor(r%86400/3600),m:Math.floor(r%3600/60),sec:r%60}}),a=r=>String(r).padStart(2,"0");return Lt(()=>{const r=Math.floor(rn(ln(vs(t.activationDate)),30).getTime()/1e3),l=()=>{i.value=Math.max(0,r-Math.floor(Date.now()/1e3))};l(),n=ge(l,1e3)}),we(()=>{n&&clearInterval(n)}),(r,l)=>(w(),T("div",nl,[s.isTrialExpired?R("",!0):(w(),T("div",ol,[h("div",al,x(_(e)("tbb.countdown_label")),1),h("div",rl,[h("div",ll,[h("span",cl,x(a(_(o).d)),1),h("span",dl,x(_(e)("tbb.countdown_days")),1)]),h("div",hl,[h("span",ul,x(a(_(o).h)),1),h("span",fl,x(_(e)("tbb.countdown_hours")),1)]),h("div",_l,[h("span",ml,x(a(_(o).m)),1),h("span",gl,x(_(e)("tbb.countdown_minutes")),1)]),h("div",pl,[h("span",bl,x(a(_(o).sec)),1),h("span",vl,x(_(e)("tbb.countdown_seconds")),1)])])])),h("div",xl,[h("div",yl,[$(x(_(e)("tbb.countdown_cta_line1")),1),l[0]||(l[0]=h("br",null,null,-1)),$(x(_(e)("tbb.countdown_cta_line2")),1)])])]))}}),kl=Object.assign(J(wl,[["__scopeId","data-v-a0155a98"]]),{__name:"TBBMiningCountdown"}),Ml={class:"mhs"},Sl={class:"mhs__stat"},Tl={class:"mhs__lbl"},Cl={class:"mhs__val mhs__val--main"},Pl={class:"mhs__ticker"},Ol={class:"mhs__usd"},Dl={class:"mhs__stat"},Il={class:"mhs__lbl"},Al={class:"mhs__val"},Bl={class:"mhs__usd"},Ll={class:"mhs__stat"},$l={class:"mhs__lbl"},Fl={class:"mhs__val"},Rl={class:"mhs__usd"},El=Z({__name:"MiningHeroStats",props:{liveBtc:{},liveUsd:{},dailyBtcStr:{},dailyUsdStr:{},miningDay:{},miningPct:{},showTodayStat:{type:Boolean}},setup(s){const{t}=ot();return(e,i)=>(w(),T("div",Ml,[h("div",Sl,[h("div",Tl,x(_(t)("tbb.hero_accumulated_btc")),1),h("div",Cl,[h("span",Pl,x(s.liveBtc),1),i[0]||(i[0]=h("span",{class:"mhs__unit"},"BTC",-1))]),h("div",Ol,"â $"+x(s.liveUsd),1)]),s.showTodayStat?(w(),T(Y,{key:0},[i[2]||(i[2]=h("div",{class:"mhs__divider"},null,-1)),h("div",Dl,[h("div",Il,[i[1]||(i[1]=h("span",{class:"mhs__live-badge"},"â LIVE",-1)),$(" "+x(_(t)("tbb.hero_today")),1)]),h("div",Al,x(s.dailyBtcStr),1),h("div",Bl,x(s.dailyUsdStr)+x(_(t)("tbb.per_day")),1)])],64)):R("",!0),i[4]||(i[4]=h("div",{class:"mhs__divider"},null,-1)),h("div",Ll,[h("div",$l,x(_(t)("tbb.hero_day")),1),h("div",Fl,[$(x(s.miningDay),1),i[3]||(i[3]=h("span",{class:"mhs__unit"},"/30",-1))]),h("div",Rl,x(s.miningPct)+"% "+x(_(t)("tbb.hero_completed")),1)])]))}}),zl=Object.assign(J(El,[["__scopeId","data-v-8505486f"]]),{__name:"TBBMiningHeroStats"}),Vl={class:"mp"},Nl={class:"mp__track"},jl=Z({__name:"MiningProgress",props:{miningPct:{}},setup(s){return(t,e)=>(w(),T("div",Vl,[h("div",Nl,[h("div",{class:"mp__fill",style:It({width:s.miningPct+"%"})},null,4),h("div",{class:"mp__marker",style:It({left:s.miningPct+"%"})},[...e[0]||(e[0]=[h("div",{class:"mp__marker-dot"},null,-1)])],4)]),e[1]||(e[1]=h("div",{class:"mp__ticks"},[h("span",null,"1"),h("span",null,"10"),h("span",null,"20"),h("span",null,"30")],-1))]))}}),Wl=Object.assign(J(jl,[["__scopeId","data-v-fbfc32fa"]]),{__name:"TBBMiningProgress"});function ke(s){return s+.5|0}const Pt=(s,t,e)=>Math.max(Math.min(s,e),t);function ce(s){return Pt(ke(s*2.55),0,255)}
2function At(s){return Pt(ke(s*255),0,255)}function kt(s){return Pt(ke(s/2.55)/100,0,1)}function js(s){return Pt(ke(s*100),0,100)}const lt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},xs=[..."0123456789ABCDEF"],Hl=s=>xs[s&15],Ul=s=>xs[(s&240)>>4]+xs[s&15],Oe=s=>(s&240)>>4===(s&15),Yl=s=>Oe(s.r)&&Oe(s.g)&&Oe(s.b)&&Oe(s.a);function Kl(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255<[s[1]]*17,g:255<[s[2]]*17,b:255<[s[3]]*17,a:t===5?lt[s[4]]*17:255}:(t===7||t===9)&&(e={r:lt[s[1]]<<4|lt[s[2]],g:lt[s[3]]<<4|lt[s[4]],b:lt[s[5]]<<4|lt[s[6]],a:t===9?lt[s[7]]<<4|lt[s[8]]:255})),e}const Xl=(s,t)=>s<255?t(s):"";function ql(s){var t=Yl(s)?Hl:Ul;return s?"#"+t(s.r)+t(s.g)+t(s.b)+Xl(s.a,t):void 0}const Gl=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function dn(s,t,e){const i=t*Math.min(e,1-e),n=(o,a=(o+s/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function Zl(s,t,e){const i=(n,o=(n+s/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function Ql(s,t,e){const i=dn(s,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function Jl(s,t,e,i,n){return s===n?(t-e)/i+(t<e?6:0):t===n?(e-s)/i+2:(s-t)/i+4}function Os(s){const e=s.r/255,i=s.g/255,n=s.b/255,o=Math.max(e,i,n),a=Math.min(e,i,n),r=(o+a)/2;let l,c,d;return o!==a&&(d=o-a,c=r>.5?d/(2-o-a):d/(o+a),l=Jl(e,i,n,d,o),l=l*60+.5),[l|0,c||0,r]}function Ds(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(At)}function Is(s,t,e){return Ds(dn,s,t,e)}function tc(s,t,e){return Ds(Ql,s,t,e)}function ec(s,t,e){return Ds(Zl,s,t,e)}function hn(s){return(s%360+360)%360}function sc(s){const t=Gl.exec(s);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?ce(+t[5]):At(+t[5]));const n=hn(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=tc(n,o,a):t[1]==="hsv"?i=ec(n,o,a):i=Is(n,o,a),{r:i[0],g:i[1],b:i[2],a:e}}function ic(s,t){var e=Os(s);e[0]=hn(e[0]+t),e=Is(e),s.r=e[0],s.g=e[1],s.b=e[2]}function nc(s){if(!s)return;const t=Os(s),e=t[0],i=js(t[1]),n=js(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${kt(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}const Ws={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Hs={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function oc(){const s={},t=Object.keys(Hs),e=Object.keys(Ws);let i,n,o,a,r;for(i=0;i<t.length;i++){for(a=r=t[i],n=0;n<e.length;n++)o=e[n],r=r.replace(o,Ws[o]);o=parseInt(Hs[a],16),s[r]=[o>>16&255,o>>8&255,o&255]}return s}let De;function ac(s){De||(De=oc(),De.transparent=[0,0,0,0]);const t=De[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const rc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function lc(s){const t=rc.exec(s);let e=255,i,n,o;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?ce(a):Pt(a*255,0,255)}return i=+t[1],n=+t[3],o=+t[5],i=255&(t[2]?ce(i):Pt(i,0,255)),n=255&(t[4]?ce(n):Pt(n,0,255)),o=255&(t[6]?ce(o):Pt(o,0,255)),{r:i,g:n,b:o,a:e}}}function cc(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${kt(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}const ns=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,Zt=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function dc(s,t,e){const i=Zt(kt(s.r)),n=Zt(kt(s.g)),o=Zt(kt(s.b));return{r:At(ns(i+e*(Zt(kt(t.r))-i))),g:At(ns(n+e*(Zt(kt(t.g))-n))),b:At(ns(o+e*(Zt(kt(t.b))-o))),a:s.a+e*(t.a-s.a)}}function Ie(s,t,e){if(s){let i=Os(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Is(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function un(s,t){return s&&Object.assign(t||{},s)}function Us(s){var t={r:0,g:0,b:0,a:255};return Array.isArray(s)?s.length>=3&&(t={r:s[0],g:s[1],b:s[2],a:255},s.length>3&&(t.a=At(s[3]))):(t=un(s,{r:0,g:0,b:0,a:1}),t.a=At(t.a)),t}function hc(s){return s.charAt(0)==="r"?lc(s):sc(s)}class pe{constructor(t){if(t instanceof pe)return t;const e=typeof t;let i;e==="object"?i=Us(t):e==="string"&&(i=Kl(t)||ac(t)||hc(t)),this._rgb=i,this._val
2id=!!i}get valid(){return this._valid}get rgb(){var t=un(this._rgb);return t&&(t.a=kt(t.a)),t}set rgb(t){this._rgb=Us(t)}rgbString(){return this._valid?cc(this._rgb):void 0}hexString(){return this._valid?ql(this._rgb):void 0}hslString(){return this._valid?nc(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=i.a-n.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,i.r=255&c*i.r+o*n.r+.5,i.g=255&c*i.g+o*n.g+.5,i.b=255&c*i.b+o*n.b+.5,i.a=a*i.a+(1-a)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=dc(this._rgb,t._rgb,e)),this}clone(){return new pe(this.rgb)}alpha(t){return this._rgb.a=At(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ke(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ie(this._rgb,2,t),this}darken(t){return Ie(this._rgb,2,-t),this}saturate(t){return Ie(this._rgb,1,t),this}desaturate(t){return Ie(this._rgb,1,-t),this}rotate(t){return ic(this._rgb,t),this}}function xt(){}const uc=(()=>{let s=0;return()=>s++})();function z(s){return s==null}function q(s){if(Array.isArray&&Array.isArray(s))return!0;const t=Object.prototype.toString.call(s);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function F(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}function dt(s){return(typeof s=="number"||s instanceof Number)&&isFinite(+s)}function mt(s,t){return dt(s)?s:t}function H(s,t){return typeof s>"u"?t:s}const fc=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function U(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function E(s,t,e,i){let n,o,a;if(q(s))for(o=s.length,n=0;n<o;n++)t.call(e,s[n],n);else if(F(s))for(a=Object.keys(s),o=a.length,n=0;n<o;n++)t.call(e,s[a[n]],a[n])}function Ue(s,t){let e,i,n,o;if(!s||!t||s.length!==t.length)return!1;for(e=0,i=s.length;e<i;++e)if(n=s[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Ye(s){if(q(s))return s.map(Ye);if(F(s)){const t=Object.create(null),e=Object.keys(s),i=e.length;let n=0;for(;n<i;++n)t[e[n]]=Ye(s[e[n]]);return t}return s}function fn(s){return["__proto__","prototype","constructor"].indexOf(s)===-1}function _c(s,t,e,i){if(!fn(s))return;const n=t[s],o=e[s];F(n)&&F(o)?be(n,o,i):t[s]=Ye(o)}function be(s,t,e){const i=q(t)?t:[t],n=i.length;if(!F(s))return s;e=e||{};const o=e.merger||_c;let a;for(let r=0;r<n;++r){if(a=i[r],!F(a))continue;const l=Object.keys(a);for(let c=0,d=l.length;c<d;++c)o(l[c],s,a,e)}return s}function ue(s,t){return be(s,t,{merger:mc})}function mc(s,t,e){if(!fn(s))return;const i=t[s],n=e[s];F(i)&&F(n)?ue(i,n):Object.prototype.hasOwnProperty.call(t,s)||(t[s]=Ye(n))}const Ys={"":s=>s,x:s=>s.x,y:s=>s.y};function gc(s){const t=s.split("."),e=[];let i="";for(const n of t)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function pc(s){const t=gc(s);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Jt(s,t){return(Ys[t]||(Ys[t]=pc(t)))(s)}function As(s){return s.charAt(0).toUpperCase()+s.slice(1)}const ve=s=>typeof s<"u",$t=s=>typeof s=="function",Ks=(s,t)=>{if(s.size!==t.size)return!1;for(const e of s)if(!t.has(e))return!1;return!0};function bc(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}const nt=Math.PI,Xt=2*nt,Ke=Number.POSITIVE_INFINITY,vc=nt/180,ut=nt/2,Vt=nt/4,Xs=nt*2/3,_n=Math.log10,Bt=Math.sign;function je(s,t,e){return Math.abs(s-t)<e}function qs(s){const t=Math.round(s);s=je(s,t,s/1e3)?t:s;const e=Math.pow(10,Math.floor(_n(s))),i=s/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function xc(s){const t=[],e=Math.sqrt(s);let i;for(i=1;i<e;i++)s%i===0&&(t.push(i),t.push(s/i));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function yc(s){return typeof s=="symbol"||typeof s=="object"&&s!==null&&!(Symbol.toPrimitive in s||"toString"in s||"valueOf"in s)}function Xe(s){return!yc(s)&&!isNaN(parseFloat(s))&&isFinite(s)}function wc(s,t){const e=Math.round(s);return e-t<=s&&e+t>=s}function kc(s,t,e){let i,n,o;for(i=0,n=s.length;i<n;i++)o=s[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Yt(s){return s*(nt/180)}function Mc(s){return s*(180/nt)}function Gs(s){if(!dt(s))return;let t=1,e=0;for(;Math.round(s*t)/t!==s;)t*=10,e++;return e}function Sc(s,t){const e=t.x-s.x,i=t.y-s.y,n=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*nt&&(o+=Xt),{angle:o,distance:n}}function Tc(s,t){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function Nt(s){return(s%Xt+Xt)%Xt}function Cc(s,t,e,i){const n=Nt(s),o=Nt(t),a=Nt(e),r=Nt(o-n),l=Nt(a-n),c=Nt(n-o),d=Nt(n-a);return n===o||n===a||i||r>l&&c<d}function ft(s,t,e){return Math.max(t,Math.min(e,s))}function Pc(s){return ft(s,-32768,32767)}function Zs(s,t,e,i=1e-6){return s>=Math.min(t,e)-i&&s<=Math.max(t,e)+i}function Bs(s,t,e){e=e||(a=>s[a]<t);let i=s.length-1,n=0,o;for(;i-n>1;)o=n+i>>1,e(o)?n=o:i=o;return{lo:n,hi:i}}const ys=(s,t,e,i)=>Bs(s,e,i?n=>{const o=s[n][t];return o<e||o===e&&s[n+1][t]===e}:n=>s[n][t]<e),Oc=(s,t,e)=>Bs(s,e,i=>s[i][t]>=e);function Dc(s,t,e){let i=0,n=s.length;for(;i<n&&s[i]<t;)i++;for(;n>i&&s[n-1]>e;)n--;return i>0||n<s.length?s.slice(i,n):s}const mn=["push","pop","shift","splice","unshift"];function Ic(s,t){if(s._chartjs){s._chartjs.listeners.push(t);return}Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}
2),mn.forEach(e=>{const i="_onData"+As(e),n=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...o){const a=n.apply(this,o);return s._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...o)}),a}})})}function Qs(s,t){const e=s._chartjs;if(!e)return;const i=e.listeners,n=i.indexOf(t);n!==-1&&i.splice(n,1),!(i.length>0)&&(mn.forEach(o=>{delete s[o]}),delete s._chartjs)}function gn(s){const t=new Set(s);return t.size===s.length?s:Array.from(t)}const pn=(function(){return typeof window>"u"?function(s){return s()}:window.requestAnimationFrame})();function bn(s,t){let e=[],i=!1;return function(...n){e=n,i||(i=!0,pn.call(window,()=>{i=!1,s.apply(t,e)}))}}function Ac(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}const Bc=s=>s==="start"?"left":s==="end"?"right":"center",Js=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,Ae=s=>s===0||s===1,ti=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*Xt/e)),ei=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*Xt/e)+1,fe={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>-s*(s-2),easeInOutQuad:s=>(s/=.5)<1?.5*s*s:-.5*(--s*(s-2)-1),easeInCubic:s=>s*s*s,easeOutCubic:s=>(s-=1)*s*s+1,easeInOutCubic:s=>(s/=.5)<1?.5*s*s*s:.5*((s-=2)*s*s+2),easeInQuart:s=>s*s*s*s,easeOutQuart:s=>-((s-=1)*s*s*s-1),easeInOutQuart:s=>(s/=.5)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2),easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>(s-=1)*s*s*s*s+1,easeInOutQuint:s=>(s/=.5)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2),easeInSine:s=>-Math.cos(s*ut)+1,easeOutSine:s=>Math.sin(s*ut),easeInOutSine:s=>-.5*(Math.cos(nt*s)-1),easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:-Math.pow(2,-10*s)+1,easeInOutExpo:s=>Ae(s)?s:s<.5?.5*Math.pow(2,10*(s*2-1)):.5*(-Math.pow(2,-10*(s*2-1))+2),easeInCirc:s=>s>=1?s:-(Math.sqrt(1-s*s)-1),easeOutCirc:s=>Math.sqrt(1-(s-=1)*s),easeInOutCirc:s=>(s/=.5)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1),easeInElastic:s=>Ae(s)?s:ti(s,.075,.3),easeOutElastic:s=>Ae(s)?s:ei(s,.075,.3),easeInOutElastic(s){return Ae(s)?s:s<.5?.5*ti(s*2,.1125,.45):.5+.5*ei(s*2-1,.1125,.45)},easeInBack(s){return s*s*((1.70158+1)*s-1.70158)},easeOutBack(s){return(s-=1)*s*((1.70158+1)*s+1.70158)+1},easeInOutBack(s){let t=1.70158;return(s/=.5)<1?.5*(s*s*(((t*=1.525)+1)*s-t)):.5*((s-=2)*s*(((t*=1.525)+1)*s+t)+2)},easeInBounce:s=>1-fe.easeOutBounce(1-s),easeOutBounce(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},easeInOutBounce:s=>s<.5?fe.easeInBounce(s*2)*.5:fe.easeOutBounce(s*2-1)*.5+.5};function vn(s){if(s&&typeof s=="object"){const t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function si(s){return vn(s)?s:new pe(s)}function os(s){return vn(s)?s:new pe(s).saturate(.5).darken(.1).hexString()}const Lc=["x","y","borderWidth","radius","tension"],$c=["color","borderColor","backgroundColor"];function Fc(s){s.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),s.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),s.set("animations",{colors:{type:"color",properties:$c},numbers:{type:"number",properties:Lc}}),s.describe("animations",{_fallback:"animation"}),s.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Rc(s){s.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ii=new Map;function Ec(s,t){t=t||{};const e=s+JSON.stringify(t);let i=ii.get(e);return i||(i=new Intl.NumberFormat(s,t),ii.set(e,i)),i}function xn(s,t,e){return Ec(t,e).format(s)}const zc={values(s){return q(s)?s:""+s},numeric(s,t,e){if(s===0)return"0";const i=this.chart.options.locale;let n,o=s;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=Vc(s,e)}const a=_n(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),xn(s,i,l)}};function Vc(s,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&s!==Math.floor(s)&&(e=s-Math.floor(s)),e}var yn={formatters:zc};function Nc(s){s.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:yn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.route("scale.ticks","color","","color"),s.route("scale.grid","color","","borderColor"),s.route("scale.border","color","","borderColor"),s.route("scale.title","color","","color"),s.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),s.describe("scales",{_fallback:"scale"}),s.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Gt=Object.create(null),ws=Object.create(null);function _e(s,t){if(!t)return s;const e=t.split(".");for(let i=0,n=e.length;i<n;++i){const o=e[i];s=s[o]||(s[o]=Object.create(null))}return s}function as(s,t,e){return typeof t=="string"?be(_e(s,t),e):be(_e(s,""),t)}class jc{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={}
2,this.hoverBackgroundColor=(i,n)=>os(n.backgroundColor),this.hoverBorderColor=(i,n)=>os(n.borderColor),this.hoverColor=(i,n)=>os(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return as(this,t,e)}get(t){return _e(this,t)}describe(t,e){return as(ws,t,e)}override(t,e){return as(Gt,t,e)}route(t,e,i,n){const o=_e(this,t),a=_e(this,i),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[n];return F(l)?Object.assign({},c,l):H(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var K=new jc({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Fc,Rc,Nc]);function Wc(s){return!s||z(s.size)||z(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function ni(s,t,e,i,n){let o=t[n];return o||(o=t[n]=s.measureText(n).width,e.push(n)),o>i&&(i=o),i}function jt(s,t,e){const i=s.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*i)/i+n}function oi(s,t){!t&&!s||(t=t||s.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,s.width,s.height),t.restore())}function ai(s,t,e,i){Hc(s,t,e,i)}function Hc(s,t,e,i,n){let o,a,r,l,c,d,u,f;const m=t.pointStyle,v=t.rotation,p=t.radius;let g=(v||0)*vc;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){s.save(),s.translate(e,i),s.rotate(g),s.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),s.restore();return}if(!(isNaN(p)||p<=0)){switch(s.beginPath(),m){default:s.arc(e,i,p,0,Xt),s.closePath();break;case"triangle":d=p,s.moveTo(e+Math.sin(g)*d,i-Math.cos(g)*p),g+=Xs,s.lineTo(e+Math.sin(g)*d,i-Math.cos(g)*p),g+=Xs,s.lineTo(e+Math.sin(g)*d,i-Math.cos(g)*p),s.closePath();break;case"rectRounded":c=p*.516,l=p-c,a=Math.cos(g+Vt)*l,u=Math.cos(g+Vt)*l,r=Math.sin(g+Vt)*l,f=Math.sin(g+Vt)*l,s.arc(e-u,i-r,c,g-nt,g-ut),s.arc(e+f,i-a,c,g-ut,g),s.arc(e+u,i+r,c,g,g+ut),s.arc(e-f,i+a,c,g+ut,g+nt),s.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*p,d=l,s.rect(e-d,i-l,2*d,2*l);break}g+=Vt;case"rectRot":u=Math.cos(g)*p,a=Math.cos(g)*p,r=Math.sin(g)*p,f=Math.sin(g)*p,s.moveTo(e-u,i-r),s.lineTo(e+f,i-a),s.lineTo(e+u,i+r),s.lineTo(e-f,i+a),s.closePath();break;case"crossRot":g+=Vt;case"cross":u=Math.cos(g)*p,a=Math.cos(g)*p,r=Math.sin(g)*p,f=Math.sin(g)*p,s.moveTo(e-u,i-r),s.lineTo(e+u,i+r),s.moveTo(e+f,i-a),s.lineTo(e-f,i+a);break;case"star":u=Math.cos(g)*p,a=Math.cos(g)*p,r=Math.sin(g)*p,f=Math.sin(g)*p,s.moveTo(e-u,i-r),s.lineTo(e+u,i+r),s.moveTo(e+f,i-a),s.lineTo(e-f,i+a),g+=Vt,u=Math.cos(g)*p,a=Math.cos(g)*p,r=Math.sin(g)*p,f=Math.sin(g)*p,s.moveTo(e-u,i-r),s.lineTo(e+u,i+r),s.moveTo(e+f,i-a),s.lineTo(e-f,i+a);break;case"line":a=Math.cos(g)*p,r=Math.sin(g)*p,s.moveTo(e-a,i-r),s.lineTo(e+a,i+r);break;case"dash":s.moveTo(e,i),s.lineTo(e+Math.cos(g)*p,i+Math.sin(g)*p);break;case!1:s.closePath();break}s.fill(),s.stroke()}}function wn(s,t,e){return e=e||.5,!t||s&&s.x>t.left-e&&s.x<t.right+e&&s.y>t.top-e&&s.y<t.bottom+e}function kn(s,t){s.save(),s.beginPath(),s.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),s.clip()}function Mn(s){s.restore()}function Uc(s,t){t.translation&&s.translate(t.translation[0],t.translation[1]),z(t.rotation)||s.rotate(t.rotation),t.color&&(s.fillStyle=t.color),t.textAlign&&(s.textAlign=t.textAlign),t.textBaseline&&(s.textBaseline=t.textBaseline)}function Yc(s,t,e,i,n){if(n.strikethrough||n.underline){const o=s.measureText(i),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,d=n.strikethrough?(l+c)/2:c;s.strokeStyle=s.fillStyle,s.beginPath(),s.lineWidth=n.decorationWidth||2,s.moveTo(a,d),s.lineTo(r,d),s.stroke()}}function Kc(s,t){const e=s.fillStyle;s.fillStyle=t.color,s.fillRect(t.left,t.top,t.width,t.height),s.fillStyle=e}function ri(s,t,e,i,n,o={}){const a=q(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(s.save(),s.font=n.string,Uc(s,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&Kc(s,o.backdrop),r&&(o.strokeColor&&(s.strokeStyle=o.strokeColor),z(o.strokeWidth)||(s.lineWidth=o.strokeWidth),s.strokeText(c,e,i,o.maxWidth)),s.fillText(c,e,i,o.maxWidth),Yc(s,e,i,c,o),i+=Number(n.lineHeight);
2s.restore()}function ks(s,t){const{x:e,y:i,w:n,h:o,radius:a}=t;s.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*nt,nt,!0),s.lineTo(e,i+o-a.bottomLeft),s.arc(e+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,nt,ut,!0),s.lineTo(e+n-a.bottomRight,i+o),s.arc(e+n-a.bottomRight,i+o-a.bottomRight,a.bottomRight,ut,0,!0),s.lineTo(e+n,i+a.topRight),s.arc(e+n-a.topRight,i+a.topRight,a.topRight,0,-ut,!0),s.lineTo(e+a.topLeft,i)}const Xc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,qc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Gc(s,t){const e=(""+s).match(Xc);if(!e||e[1]==="normal")return t*1.2;switch(s=+e[2],e[3]){case"px":return s;case"%":s/=100;break}return t*s}const Zc=s=>+s||0;function Sn(s,t){const e={},i=F(t),n=i?Object.keys(t):t,o=F(s)?i?a=>H(s[a],s[t[a]]):a=>s[a]:()=>s;for(const a of n)e[a]=Zc(o(a));return e}function Tn(s){return Sn(s,{top:"y",right:"x",bottom:"y",left:"x"})}function me(s){return Sn(s,["topLeft","topRight","bottomLeft","bottomRight"])}function Ft(s){const t=Tn(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function bt(s,t){s=s||{},t=t||K.font;let e=H(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=H(s.style,t.style);i&&!(""+i).match(qc)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const n={family:H(s.family,t.family),lineHeight:Gc(H(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:H(s.weight,t.weight),string:""};return n.string=Wc(n),n}function Be(s,t,e,i){let n,o,a;for(n=0,o=s.length;n<o;++n)if(a=s[n],a!==void 0&&a!==void 0)return a}function Qc(s,t,e){const{min:i,max:n}=s,o=fc(t,(n-i)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(i,-Math.abs(o)),max:a(n,o)}}function ee(s,t){return Object.assign(Object.create(s),t)}function Ls(s,t=[""],e,i,n=()=>s[0]){const o=e||s;typeof i>"u"&&(i=Dn("_fallback",s));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:o,_fallback:i,_getTarget:n,override:r=>Ls([r,...s],t,o,i)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete s[0][l],!0},get(r,l){return Pn(r,l,()=>ad(l,t,s,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(r,l){return ci(r).includes(l)},ownKeys(r){return ci(r)},set(r,l,c){const d=r._storage||(r._storage=n());return r[l]=d[l]=c,delete r._keys,!0}})}function te(s,t,e,i){const n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:Cn(s,i),setContext:o=>te(s,o,e,i),override:o=>te(s.override(o),t,e,i)};return new Proxy(n,{deleteProperty(o,a){return delete o[a],delete s[a],!0},get(o,a,r){return Pn(o,a,()=>td(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(s,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,a)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(o,a){return Reflect.has(s,a)},ownKeys(){return Reflect.ownKeys(s)},set(o,a,r){return s[a]=r,delete o[a],!0}})}function Cn(s,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:n=t.allKeys}=s;return{allKeys:n,scriptable:e,indexable:i,isScriptable:$t(e)?e:()=>e,isIndexable:$t(i)?i:()=>i}}const Jc=(s,t)=>s?s+As(t):t,$s=(s,t)=>F(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Pn(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t)||t==="constructor")return s[t];const i=e();return s[t]=i,i}function td(s,t,e){const{_proxy:i,_context:n,_subProxy:o,_descriptors:a}=s;let r=i[t];return $t(r)&&a.isScriptable(t)&&(r=ed(t,r,s,e)),q(r)&&r.length&&(r=sd(t,r,s,a.isIndexable)),$s(t,r)&&(r=te(r,n,o&&o[t],a)),r}function ed(s,t,e,i){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=e;if(r.has(s))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+s);r.add(s);let l=t(o,a||i);return r.delete(s),$s(s,l)&&(l=Fs(n._scopes,n,s,l)),l}function sd(s,t,e,i){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&i(s))return t[o.index%t.length];if(F(t[0])){const l=t,c=n._scopes.filter(d=>d!==l);t=[];for(const d of l){const u=Fs(c,n,s,d);t.push(te(u,o,a&&a[s],r))}}return t}function On(s,t,e){return $t(s)?s(t,e):s}const id=(s,t)=>s===!0?t:typeof s=="string"?Jt(t,s):void 0;
2function nd(s,t,e,i,n){for(const o of t){const a=id(e,o);if(a){s.add(a);const r=On(a._fallback,e,n);if(typeof r<"u"&&r!==e&&r!==i)return r}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function Fs(s,t,e,i){const n=t._rootScopes,o=On(t._fallback,e,i),a=[...s,...n],r=new Set;r.add(i);let l=li(r,a,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=li(r,a,o,l,i),l===null)?!1:Ls(Array.from(r),[""],n,o,()=>od(t,e,i))}function li(s,t,e,i,n){for(;e;)e=nd(s,t,e,i,n);return e}function od(s,t,e){const i=s._getTarget();t in i||(i[t]={});const n=i[t];return q(n)&&F(e)?e:n||{}}function ad(s,t,e,i){let n;for(const o of t)if(n=Dn(Jc(o,s),e),typeof n<"u")return $s(s,n)?Fs(e,i,s,n):n}function Dn(s,t){for(const e of t){if(!e)continue;const i=e[s];if(typeof i<"u")return i}}function ci(s){let t=s._keys;return t||(t=s._keys=rd(s._scopes)),t}function rd(s){const t=new Set;for(const e of s)for(const i of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(i);return Array.from(t)}function Rs(){return typeof window<"u"&&typeof document<"u"}function Es(s){let t=s.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function qe(s,t,e){let i;return typeof s=="string"?(i=parseInt(s,10),s.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=s,i}const ts=s=>s.ownerDocument.defaultView.getComputedStyle(s,null);function ld(s,t){return ts(s).getPropertyValue(t)}const cd=["top","right","bottom","left"];function qt(s,t,e){const i={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=cd[n];i[o]=parseFloat(s[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const dd=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function hd(s,t){const e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:o}=i;let a=!1,r,l;if(dd(n,o,s.target))r=n,l=o;else{const c=t.getBoundingClientRect();r=i.clientX-c.left,l=i.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Ut(s,t){if("native"in s)return s;const{canvas:e,currentDevicePixelRatio:i}=t,n=ts(e),o=n.boxSizing==="border-box",a=qt(n,"padding"),r=qt(n,"border","width"),{x:l,y:c,box:d}=hd(s,e),u=a.left+(d&&r.left),f=a.top+(d&&r.top);let{width:m,height:v}=t;return o&&(m-=a.width+r.width,v-=a.height+r.height),{x:Math.round((l-u)/m*e.width/i),y:Math.round((c-f)/v*e.height/i)}}function ud(s,t,e){let i,n;if(t===void 0||e===void 0){const o=s&&Es(s);if(!o)t=s.clientWidth,e=s.clientHeight;else{const a=o.getBoundingClientRect(),r=ts(o),l=qt(r,"border","width"),c=qt(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,i=qe(r.maxWidth,o,"clientWidth"),n=qe(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||Ke,maxHeight:n||Ke}}const Ot=s=>Math.round(s*10)/10;function fd(s,t,e,i){const n=ts(s),o=qt(n,"margin"),a=qe(n.maxWidth,s,"clientWidth")||Ke,r=qe(n.maxHeight,s,"clientHeight")||Ke,l=ud(s,t,e);let{width:c,height:d}=l;if(n.boxSizing==="content-box"){const f=qt(n,"border","width"),m=qt(n,"padding");c-=m.width+f.width,d-=m.height+f.height}return c=Math.max(0,c-o.width),d=Math.max(0,i?c/i:d-o.height),c=Ot(Math.min(c,a,l.maxWidth)),d=Ot(Math.min(d,r,l.maxHeight)),c&&!d&&(d=Ot(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&d>l.height&&(d=l.height,c=Ot(Math.floor(d*i))),{width:c,height:d}}function di(s,t,e){const i=t||1,n=Ot(s.height*i),o=Ot(s.width*i);s.height=Ot(s.height),s.width=Ot(s.width);const a=s.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${s.height}px`,a.style.width=`${s.width}px`),s.currentDevicePixelRatio!==i||a.height!==n||a.width!==o?(s.currentDevicePixelRatio=i,a.height=n,a.width=o,s.ctx.setTransform(i,0,0,i,0,0),!0):!1}const _d=(function(){let s=!1;try{const t={get passive(){return s=!0,!1}};Rs()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return s})();function hi(s,t){const e=ld(s,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}const md=function(s,t){return{x(e){return s+s+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},gd=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,t){return s+t},leftForLtr(s,t){return s}}};function rs(s,t,e){return s?md(t,e):gd()}function pd(s,t){let e,i;(t==="ltr"||t==="rtl")&&(e=s.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),s.prevTextDirection=i)}function bd(s,t){t!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",t[0],t[1]))}function Le(s,t,e){return s.options.clip?s[e]:t[e]}function vd(s,t){const{xScale:e,yScale:i}=s;
2return e&&i?{left:Le(e,t,"left"),right:Le(e,t,"right"),top:Le(i,t,"top"),bottom:Le(i,t,"bottom")}:t}function xd(s,t){const e=t._clip;if(e.disabled)return!1;const i=vd(t,s.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?s.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?s.height:i.bottom+(e.bottom===!0?0:e.bottom)}}class yd{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=pn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(n.draw(),this._notify(n,i,t,"progress")),o.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yt=new yd;const ui="transparent",wd={boolean(s,t,e){return e>.5?t:s},color(s,t,e){const i=si(s||ui),n=i.valid&&si(t||ui);
2return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}};class kd{constructor(t,e,i,n){const o=e[i];n=Be([t.to,n,o,t.from]);const a=Be([t.from,o,n]);this._active=!0,this._fn=t.fn||wd[t.type||typeof a],this._easing=fe[t.easing]||fe.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Be([t.to,e,n,t.from]),this._from=Be([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<i),!this._active){this._target[n]=r,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}}class In{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!F(t))return;const e=Object.keys(K.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!F(o))return;const a={};for(const r of e)a[r]=o[r];(q(o.properties)&&o.properties||[n]).forEach(r=>{(r===n||!i.has(r))&&i.set(r,a)})})}_animateOptions(t,e){const i=e.options,n=Sd(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&Md(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const d=e[c];let u=o[c];const f=i.get(c);if(u)if(f&&u.active()){u.update(f,d,r);continue}else u.cancel();if(!f||!f.duration){t[c]=d;continue}o[c]=u=new kd(f,t,c,d),n.push(u)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return yt.add(this._chart,i),!0}}function Md(s,t){const e=[],i=Object.keys(t);for(let n=0;n<i.length;n++){const o=s[i[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Sd(s,t){if(!t)return;let e=s.options;if(!e){s.options=t;return}return e.$shared&&(s.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function fi(s,t){const e=s&&s.options||{},i=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:n,end:i?n:o}}function Td(s,t,e){if(e===!1)return!1;const i=fi(s,e),n=fi(t,e);return{top:n.end,right:i.end,bottom:n.start,left:i.start}}function Cd(s){let t,e,i,n;return F(s)?(t=s.top,e=s.right,i=s.bottom,n=s.left):t=e=i=n=s,{top:t,right:e,bottom:i,left:n,disabled:s===!1}}function An(s,t){const e=[],i=s._getSortedDatasetMetas(t);let n,o;for(n=0,o=i.length;n<o;++n)e.push(i[n].index);return e}function _i(s,t,e,i={}){const n=s.keys,o=i.mode==="single";let a,r,l,c;if(t===null)return;let d=!1;for(a=0,r=n.length;a<r;++a){if(l=+n[a],l===e){if(d=!0,i.all)continue;break}c=s.values[l],dt(c)&&(o||t===0||Bt(t)===Bt(c))&&(t+=c)}return!d&&!i.all?0:t}function Pd(s,t){const{iScale:e,vScale:i}=t,n=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",a=Object.keys(s),r=new Array(a.length);let l,c,d;for(l=0,c=a.length;l<c;++l)d=a[l],r[l]={[n]:d,[o]:s[d]};return r}function ls(s,t){const e=s&&s.options.stacked;return e||e===void 0&&t.stack!==void 0}function Od(s,t,e){return`${s.id}.${t.id}.${e.stack||e.type}`}function Dd(s){const{min:t,max:e,minDefined:i,maxDefined:n}=s.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function Id(s,t,e){const i=s[t]||(s[t]={});return i[e]||(i[e]={})}function mi(s,t,e,i){for(const n of t.getMatchingVisibleMetas(i).reverse()){const o=s[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function gi(s,t){const{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=i,l=o.axis,c=a.axis,d=Od(o,a,i),u=t.length;let f;for(let m=0;m<u;++m){const v=t[m],{[l]:p,[c]:g}=v,b=v._stacks||(v._stacks={});f=b[c]=Id(n,d,p),f[r]=g,f._top=mi(f,a,!0,i.type),f._bottom=mi(f,a,!1,i.type);const y=f._visualValues||(f._visualValues={});y[r]=g}}function cs(s,t){const e=s.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Ad(s,t){return ee(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Bd(s,t,e){return ee(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ne(s,t){const e=s.controller.index,i=s.vScale&&s.vScale.axis;
2if(i){t=t||s._parsed;for(const n of t){const o=n._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const ds=s=>s==="reset"||s==="none",pi=(s,t)=>t?s:Object.assign({},s),Ld=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:An(e,!0),values:null};class Bn{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ls(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ne(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(u,f,m,v)=>u==="x"?f:u==="r"?v:m,o=e.xAxisID=H(i.xAxisID,cs(t,"x")),a=e.yAxisID=H(i.yAxisID,cs(t,"y")),r=e.rAxisID=H(i.rAxisID,cs(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,a,r),d=e.vAxisID=n(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Qs(this._data,this),t._stacked&&ne(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(F(e)){const n=this._cachedMeta;this._data=Pd(e,n)}else if(i!==e){if(i){Qs(i,this);const n=this._cachedMeta;ne(n),n._parsed=[]}e&&Object.isExtensible(e)&&Ic(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=ls(e.vScale,e),e.stack!==i.stack&&(n=!0,ne(e),e.stack=i.stack),this._resyncElements(t),(n||o!==e._stacked)&&(gi(this,e._parsed),e._stacked=ls(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:a}=i,r=o.axis;let l=t===0&&e===n.length?!0:i._sorted,c=t>0&&i._parsed[t-1],d,u,f;if(this._parsing===!1)i._parsed=n,i._sorted=!0,f=n;else{q(n[t])?f=this.parseArrayData(i,n,t,e):F(n[t])?f=this.parseObjectData(i,n,t,e):f=this.parsePrimitiveData(i,n,t,e);const m=()=>u[r]===null||c&&u[r]<c[r];for(d=0;d<e;++d)i._parsed[d+t]=u=f[d],l&&(m()&&(l=!1),c=u);i._sorted=l}a&&gi(this,f)}parsePrimitiveData(t,e,i,n){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),d=o===a,u=new Array(n);let f,m,v;for(f=0,m=n;f<m;++f)v=f+i,u[f]={[r]:d||o.parse(c[v],v),[l]:a.parse(e[v],v)};return u}parseArrayData(t,e,i,n){const{xScale:o,yScale:a}=t,r=new Array(n);let l,c,d,u;for(l=0,c=n;l<c;++l)d=l+i,u=e[d],r[l]={x:o.parse(u[0],d),y:a.parse(u[1],d)};return r}parseObjectData(t,e,i,n){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let d,u,f,m;for(d=0,u=n;d<u;++d)f=d+i,m=e[f],c[d]={x:o.parse(Jt(m,r),f),y:a.parse(Jt(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:An(n,!0),values:e._stacks[t.axis]._visualValues};return _i(r,a,o.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const o=i[e.axis];let a=o===null?NaN:o;const r=n&&i._stacks[e.axis];n&&r&&(n.values=r,a=_i(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,o=i._sorted&&t===i.iScale,a=n.length,r=this._getOtherScale(t),l=Ld(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=Dd(r);let f,m;function v(){m=n[f];const p=m[r.axis];return!dt(m[t.axis])||d>p||u<p}for(f=0;f<a&&!(!v()&&(this.updateRangeFromParsed(c,t,m,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!v()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n][t.axis],dt(a)&&i.push(a);return i}getMaxOverflow(){return!1}
2getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Cd(H(this.options.clip,Td(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||n.length-r,c=this.options.drawActiveElementsOnTop;let d;for(i.dataset&&i.dataset.draw(t,o,r,l),d=r;d<r+l;++d){const u=n[d];u.hidden||(u.active&&c?a.push(u):u.draw(t,o))}for(d=0;d<a.length;++d)a[d].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=Bd(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Ad(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&ve(i);if(r)return pi(r,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),u=n?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),d),m=Object.keys(K.elements[t]),v=()=>this.getContext(i,n,e),p=c.resolveNamedOptions(f,m,v,u);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(pi(p,l))),p}_resolveAnimations(t,e,i){const n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(n.options.animation!==!1){const d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,e),f=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(f,this.getContext(t,i,e))}const c=new In(n,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ds(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:a}}updateElement(t,e,i,n){ds(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ds(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const n=i.length,o=e.length,a=Math.min(o,n);a&&this.parse(0,a),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,i=!0){const n=this._cachedMeta,o=n.data,a=t+e;let r;const l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&ne(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function $d(s,t){if(!s._cache.$bar){const e=s.getMatchingVisibleMetas(t);let i=[];for(let n=0,o=e.length;n<o;n++)i=i.concat(e[n].controller.getAllParsedValues(s));s._cache.$bar=gn(i.sort((n,o)=>n-o))}return s._cache.$bar}function Fd(s){const t=s.iScale,e=$d(t,s.type);let i=t._length,n,o,a,r;const l=()=>{a===32767||a===-32768||(ve(r)&&(i=Math.min(i,Math.abs(a-r)||i)),r=a)};for(n=0,o=e.length;n<o;
2++n)a=t.getPixelForValue(e[n]),l();for(r=void 0,n=0,o=t.ticks.length;n<o;++n)a=t.getPixelForTick(n),l();return i}function Rd(s,t,e,i){const n=e.barThickness;let o,a;return z(n)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=n*i,a=1),{chunk:o/i,ratio:a,start:t.pixels[s]-o/2}}function Ed(s,t,e,i){const n=t.pixels,o=n[s];let a=s>0?n[s-1]:null,r=s<n.length-1?n[s+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/i,ratio:e.barPercentage,start:c}}function zd(s,t,e,i){const n=e.parse(s[0],i),o=e.parse(s[1],i),a=Math.min(n,o),r=Math.max(n,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:a,max:r}}function Ln(s,t,e,i){return q(s)?zd(s,t,e,i):t[e.axis]=e.parse(s,i),t}function bi(s,t,e,i){const n=s.iScale,o=s.vScale,a=n.getLabels(),r=n===o,l=[];let c,d,u,f;for(c=e,d=e+i;c<d;++c)f=t[c],u={},u[n.axis]=r||n.parse(a[c],c),l.push(Ln(f,u,o,c));return l}function hs(s){return s&&s.barStart!==void 0&&s.barEnd!==void 0}function Vd(s,t,e){return s!==0?Bt(s):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Nd(s){let t,e,i,n,o;return s.horizontal?(t=s.base>s.x,e="left",i="right"):(t=s.base<s.y,e="bottom",i="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:i,reverse:t,top:n,bottom:o}}function jd(s,t,e,i){let n=t.borderSkipped;const o={};if(!n){s.borderSkipped=o;return}if(n===!0){s.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:d}=Nd(s);n==="middle"&&e&&(s.enableBorderRadius=!0,(e._top||0)===i?n=c:(e._bottom||0)===i?n=d:(o[vi(d,a,r,l)]=!0,n=c)),o[vi(n,a,r,l)]=!0,s.borderSkipped=o}function vi(s,t,e,i){return i?(s=Wd(s,t,e),s=xi(s,e,t)):s=xi(s,t,e),s}function Wd(s,t,e){return s===t?e:s===e?t:s}function xi(s,t,e){return s==="start"?t:s==="end"?e:s}function Hd(s,{inflateAmount:t},e){s.inflateAmount=t==="auto"?e===1?.33:0:t}class $n extends Bn{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return bi(t,e,i,n)}parseArrayData(t,e,i,n){return bi(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,d=a.axis==="x"?r:l,u=[];let f,m,v,p;for(f=i,m=i+n;f<m;++f)p=e[f],v={},v[o.axis]=o.parse(Jt(p,c),f),u.push(Ln(Jt(p,d),v,a,f));return u}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const o=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,o=this.getParsed(t),a=o._custom,r=hs(a)?"["+a.start+", "+a.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const o=n==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(e,n);for(let m=e;m<e+i;m++){const v=this.getParsed(m),p=o||z(v[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),g=this._calculateBarIndexPixels(m,d),b=(v._stacks||{})[r.axis],y={horizontal:c,base:p.base,enableBorderRadius:!b||hs(v._custom)||a===b._top||a===b._bottom,x:c?p.head:g.center,y:c?g.center:p.head,height:c?g.size:Math.abs(p.size),width:c?Math.abs(p.size):g.size};f&&(y.options=u||this.resolveDataElementOptions(m,t[m].active?"active":n));const k=y.options||t[m].options;jd(y,k,b,a),Hd(y,k,d.ratio),this.updateElement(t[m],m,y,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=i.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[i.axis],c=d=>{const u=d._parsed.find(m=>
2m[i.axis]===l),f=u&&u[d.vScale.axis];if(z(f)||isNaN(f))return!0};for(const d of n)if(!(e!==void 0&&c(d))&&((o===!1||a.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&a.push(d.stack),d.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[H(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const n=this._getStacks(t,i),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let o,a;for(o=0,a=e.data.length;o<a;++o)n.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const r=t.barThickness;return{min:r||Fd(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,d=hs(c);let u=l[e.axis],f=0,m=i?this.applyStack(e,l,i):u,v,p;m!==u&&(f=m-u,m=u),d&&(u=c.barStart,m=c.barEnd-c.barStart,u!==0&&Bt(u)!==Bt(c.barEnd)&&(f=0),f+=u);const g=!z(o)&&!d?o:f;let b=e.getPixelForValue(g);if(this.chart.getDataVisibility(t)?v=e.getPixelForValue(f+m):v=b,p=v-b,Math.abs(p)<a){p=Vd(p,e,r)*a,u===r&&(b-=p/2);const y=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),S=Math.min(y,k),M=Math.max(y,k);b=Math.max(Math.min(b,M),S),v=b+p,i&&!d&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(v)-e.getValueForPixel(b))}if(b===e.getPixelForValue(r)){const y=Bt(p)*e.getLineWidthForValue(r)/2;b+=y,p-=y}return{size:p,base:b,head:v,center:v+p/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,o=n.skipNull,a=H(n.maxBarThickness,1/0);let r,l;const c=this._getAxisCount();if(e.grouped){const d=o?this._getStackCount(t):e.stackCount,u=n.barThickness==="flex"?Ed(t,e,n,d*c):Rd(t,e,n,d*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(H(f,this.getFirstScaleIdForIndexAxis())),v=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+m;r=u.start+u.chunk*v+u.chunk/2,l=Math.min(a,u.chunk*u.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}function Wt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class zs{static override(t){Object.assign(zs.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Wt()}parse(){return Wt()}format(){return Wt()}add(){return Wt()}diff(){return Wt()}startOf(){return Wt()}endOf(){return Wt()}}var Ud={_date:zs};function Yd(s,t,e,i){const{controller:n,data:o,_sorted:a}=s,r=n._cachedMeta.iScale,l=s.dataset&&s.dataset.options?s.dataset.options.spanGaps:null;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const c=r._reversePixels?Oc:ys;if(i){if(n._sharedOptions){const d=o[0],u=typeof d.getRange=="function"&&d.getRange(t);if(u){const f=c(o,t,e-u),m=c(o,t,e+u);return{lo:f.lo,hi:m.hi}}}}else{const d=c(o,t,e);if(l){const{vScale:u}=n._cachedMeta,{_parsed:f}=s,m=f.slice(0,d.lo+1).reverse().findIndex(p=>!z(p[u.axis]));d.lo-=Math.max(0,m);const v=f.slice(d.hi).findIndex(p=>!z(p[u.axis]));d.hi+=Math.max(0,v)}return d}}return{lo:0,hi:o.length-1}}function es(s,t,e,i,n){const o=s.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:d}=o[r],{lo:u,hi:f}=Yd(o[r],t,a,n);for(let m=u;m<=f;++m){const v=d[m];v.skip||i(v,c,m)}}}function Kd(s){const t=s.indexOf("x")!==-1,e=s.indexOf("y")!==-1;return function(i,n){const o=t?Math.abs(i.x-n.x):0,a=e?Math.abs(i.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function us(s,t,e,i,n){const o=[];return!n&&!s.isPointInArea(t)||es(s,e,t,function(r,l,c){!n&&!wn(r,s.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function Xd(s,t,e,i){let n=[];function o(a,r,l){const{startAngle:c,endAngle:d}=a.getProps(["startAngle","endAngle"],i),{angle:u}=Sc(a,{x:t.x,y:t.y});Cc(u,c,d)&&n.push({element:a,datasetIndex:r,index:l})}return es(s,e,t,o),n}function qd(s,t,e,i,n,o){let a=[];const r=Kd(e);let l=Number.POSITIVE_INFINITY;function c(d,u,f){const m=d.inRange(t.x,t.y,n);if(i&&!m)return;const v=d.getCenterPoint(n);if(!(!!o||s.isPointInArea(v))&&!m)return;const g=r(t,v);g<l?(a=[{element:d,datasetIndex:u,index:f}],l=g):g===l&&a.push({element:d,datasetIndex:u,index:f})}return es(s,e,t,c),a}function fs(s,t,e,i,n,o){return!o&&!s.isPointInArea(t)?[]:e==="r"&&!i?Xd(s,t,e,n):qd(s,t,e,i,n,o)}function yi(s,t,e,i,n){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return es(s,e,t,(l,c,d)=>
2{l[a]&&l[a](t[e],n)&&(o.push({element:l,datasetIndex:c,index:d}),r=r||l.inRange(t.x,t.y,n))}),i&&!r?[]:o}var Gd={modes:{index(s,t,e,i){const n=Ut(t,s),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?us(s,n,o,i,a):fs(s,n,o,!1,i,a),l=[];return r.length?(s.getSortedVisibleDatasetMetas().forEach(c=>{const d=r[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d})}),l):[]},dataset(s,t,e,i){const n=Ut(t,s),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?us(s,n,o,i,a):fs(s,n,o,!1,i,a);if(r.length>0){const l=r[0].datasetIndex,c=s.getDatasetMeta(l).data;r=[];for(let d=0;d<c.length;++d)r.push({element:c[d],datasetIndex:l,index:d})}return r},point(s,t,e,i){const n=Ut(t,s),o=e.axis||"xy",a=e.includeInvisible||!1;return us(s,n,o,i,a)},nearest(s,t,e,i){const n=Ut(t,s),o=e.axis||"xy",a=e.includeInvisible||!1;return fs(s,n,o,e.intersect,i,a)},x(s,t,e,i){const n=Ut(t,s);return yi(s,n,"x",e.intersect,i)},y(s,t,e,i){const n=Ut(t,s);return yi(s,n,"y",e.intersect,i)}}};const Fn=["left","top","right","bottom"];function oe(s,t){return s.filter(e=>e.pos===t)}function wi(s,t){return s.filter(e=>Fn.indexOf(e.pos)===-1&&e.box.axis===t)}function ae(s,t){return s.sort((e,i)=>{const n=t?i:e,o=t?e:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Zd(s){const t=[];let e,i,n,o,a,r;for(e=0,i=(s||[]).length;e<i;++e)n=s[e],{position:o,options:{stack:a,stackWeight:r=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return t}function Qd(s){const t={};for(const e of s){const{stack:i,pos:n,stackWeight:o}=e;if(!i||!Fn.includes(n))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Jd(s,t){const e=Qd(s),{vBoxMaxWidth:i,hBoxMaxHeight:n}=t;let o,a,r;for(o=0,a=s.length;o<a;++o){r=s[o];const{fullSize:l}=r.box,c=e[r.stack],d=c&&r.stackWeight/c.weight;r.horizontal?(r.width=d?d*i:l&&t.availableWidth,r.height=n):(r.width=i,r.height=d?d*n:l&&t.availableHeight)}return e}function th(s){const t=Zd(s),e=ae(t.filter(c=>c.box.fullSize),!0),i=ae(oe(t,"left"),!0),n=ae(oe(t,"right")),o=ae(oe(t,"top"),!0),a=ae(oe(t,"bottom")),r=wi(t,"x"),l=wi(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:oe(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}function ki(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function Rn(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function eh(s,t,e,i){const{pos:n,box:o}=e,a=s.maxPadding;if(!F(n)){e.size&&(s[n]-=e.size);const u=i[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?o.height:o.width),e.size=u.size/u.count,s[n]+=e.size}o.getPadding&&Rn(a,o.getPadding());const r=Math.max(0,t.outerWidth-ki(a,s,"left","right")),l=Math.max(0,t.outerHeight-ki(a,s,"top","bottom")),c=r!==s.w,d=l!==s.h;return s.w=r,s.h=l,e.horizontal?{same:c,other:d}:{same:d,other:c}}function sh(s){const t=s.maxPadding;function e(i){const n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function ih(s,t){const e=t.maxPadding;function i(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return i(s?["left","right"]:["top","bottom"])}function de(s,t,e,i){const n=[];let o,a,r,l,c,d;for(o=0,a=s.length,c=0;o<a;++o){r=s[o],l=r.box,l.update(r.width||t.w,r.height||t.h,ih(r.horizontal,t));const{same:u,other:f}=eh(t,e,r,i);c|=u&&n.length,d=d||f,l.fullSize||n.push(r)}return c&&de(n,t,e,i)||d}function $e(s,t,e,i,n){s.top=e,s.left=t,s.right=t+i,s.bottom=e+n,s.width=i,s.height=n}function Mi(s,t,e,i){const n=e.padding;let{x:o,y:a}=t;for(const r of s){const l=r.box,c=i[r.stack]||{placed:0,weight:1},d=r.stackWeight/c.weight||1;if(r.horizontal){const u=t.w*d,f=c.size||l.height;ve(c.start)&&(a=c.start),l.fullSize?$e(l,n.left,a,e.outerWidth-n.right-n.left,f):$e(l,t.left+c.placed,a,u,f),c.start=a,c.placed+=u,a=l.bottom}else{const u=t.h*d,f=c.size||l.width;ve(c.start)&&(o=c.start),l.fullSize?$e(l,o,n.top,f,e.outerHeight-n.bottom-n.top):$e(l,o,t.top+c.placed,f,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=a}var Fe={addBox(s,t){s.boxes||(s.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},s.boxes.push(t)},removeBox(s,t){const e=s.boxes?s.boxes.indexOf(t):-1;e!==-1&&s.boxes.splice(e,1)},configure(s,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(s,t,e,i){if(!s)return;const n=Ft(s.options.layout.padding),o=Math.max(t-n.width,0),a=Math.max(e-n.height,0),r=th(s.boxes),l=r.vertical,c=r.horizontal;E(s.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const d=l.reduce((p,g)=>g.box.options&&g.box.options.display===!1?p:p+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),f=Object.assign({},n);Rn(f,Ft(i));const m=Object.assign({maxPadding:f,w:o,h:a,x:n.left,y:n.top},n),v=Jd(l.concat(c),u);de(r.fullSize,m,u,v),de(l,m,u,v),de(c,m,u,v)&&de(l,m,u,v),sh(m),Mi(r.leftAndTop,m,u,v),m.x+=m.w,m.y+=m.h,Mi(r.rightAndBottom,m,u,v),s.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},E(r.chartArea,p=>{const g=p.box;Object.assign(g,s.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class En{acquireContext(t,e){}releaseContext(t){return!1}
2addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class nh extends En{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const We="$chartjs",oh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Si=s=>s===null||s==="";function ah(s,t){const e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[We]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Si(n)){const o=hi(s,"width");o!==void 0&&(s.width=o)}if(Si(i))if(s.style.height==="")s.height=s.width/(t||2);else{const o=hi(s,"height");o!==void 0&&(s.height=o)}return s}const zn=_d?{passive:!0}:!1;function rh(s,t,e){s&&s.addEventListener(t,e,zn)}function lh(s,t,e){s&&s.canvas&&s.canvas.removeEventListener(t,e,zn)}function ch(s,t){const e=oh[s.type]||s.type,{x:i,y:n}=Ut(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function Ge(s,t){for(const e of s)if(e===t||e.contains(t))return!0}function dh(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Ge(r.addedNodes,i),a=a&&!Ge(r.removedNodes,i);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function hh(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Ge(r.removedNodes,i),a=a&&!Ge(r.addedNodes,i);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const xe=new Map;let Ti=0;function Vn(){const s=window.devicePixelRatio;s!==Ti&&(Ti=s,xe.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function uh(s,t){xe.size||window.addEventListener("resize",Vn),xe.set(s,t)}function fh(s){xe.delete(s),xe.size||window.removeEventListener("resize",Vn)}function _h(s,t,e){const i=s.canvas,n=i&&Es(i);if(!n)return;const o=bn((r,l)=>{const c=n.clientWidth;e(r,l),c<n.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return a.observe(n),uh(s,o),a}function _s(s,t,e){e&&e.disconnect(),t==="resize"&&fh(s)}function mh(s,t,e){const i=s.canvas,n=bn(o=>{s.ctx!==null&&e(ch(o,s))},s);return rh(i,t,n),n}
2class gh extends En{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(ah(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[We])return!1;const i=e[We].initial;["height","width"].forEach(o=>{const a=i[o];z(a)?e.removeAttribute(o):e.setAttribute(o,a)});const n=i.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[We],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:dh,detach:hh,resize:_h}[e]||mh;n[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:_s,detach:_s,resize:_s}[e]||lh)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return fd(t,e,i,n)}isAttached(t){const e=t&&Es(t);return!!(e&&e.isConnected)}}function ph(s){return!Rs()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?nh:gh}class ss{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Xe(this.x)&&Xe(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(o=>{n[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),n}}function bh(s,t){const e=s.options.ticks,i=vh(s),n=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?yh(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>n)return wh(t,c,o,a/n),c;const d=xh(o,t,n);if(a>0){let u,f;const m=a>1?Math.round((l-r)/(a-1)):null;for(Re(t,c,d,z(m)?0:r-m,r),u=0,f=a-1;u<f;u++)Re(t,c,d,o[u],o[u+1]);return Re(t,c,d,l,z(m)?t.length:l+m),c}return Re(t,c,d),c}function vh(s){const t=s.options.offset,e=s._tickSize(),i=s._length/e+(t?0:1),n=s._maxLength/e;return Math.floor(Math.min(i,n))}function xh(s,t,e){const i=kh(s),n=t.length/e;if(!i)return Math.max(n,1);const o=xc(i);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>n)return l}return Math.max(n,1)}function yh(s){const t=[];let e,i;for(e=0,i=s.length;e<i;e++)s[e].major&&t.push(e);return t}function wh(s,t,e,i){let n=0,o=e[0],a;for(i=Math.ceil(i),a=0;a<s.length;a++)a===o&&(t.push(s[a]),n++,o=e[n*i])}function Re(s,t,e,i,n){const o=H(i,0),a=Math.min(H(n,s.length),s.length);let r=0,l,c,d;for(e=Math.ceil(e),n&&(l=n-i,e=l/Math.floor(l/e)),d=o;d<0;)r++,d=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===d&&(t.push(s[c]),r++,d=Math.round(o+r*e))}function kh(s){const t=s.length;let e,i;if(t<2)return!1;for(i=s[0],e=1;e<t;++e)if(s[e]-s[e-1]!==i)return!1;return i}const Mh=s=>s==="left"?"right":s==="right"?"left":s,Ci=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,Pi=(s,t)=>Math.min(t||s,s);function Oi(s,t){const e=[],i=s.length/t,n=s.length;let o=0;for(;o<n;o+=i)e.push(s[Math.floor(o)]);return e}function Sh(s,t,e){const i=s.ticks.length,n=Math.min(t,i-1),o=s._startPixel,a=s._endPixel,r=1e-6;let l=s.getPixelForTick(n),c;if(!(e&&(i===1?c=Math.max(l-o,a-l):t===0?c=(s.getPixelForTick(1)-l)/2:c=(l-s.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-r||l>a+r)))return l}function Th(s,t){E(s,e=>{const i=e.gc,n=i.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[i[o]];i.splice(0,n)}})}function re(s){return s.drawTicks?s.tickLength:0}function Di(s,t){if(!s.display)return 0;const e=bt(s.font,t),i=Ft(s.padding);return(q(s.text)?s.text.length:1)*e.lineHeight+i.height}function Ch(s,t){return ee(s,{scale:t,type:"scale"})}function Ph(s,t,e){return ee(s,{tick:e,index:t,type:"tick"})}function Oh(s,t,e){let i=Bc(s);return(e&&t!=="right"||!e&&t==="right")&&(i=Mh(i)),i}function Dh(s,t,e,i){const{top:n,left:o,bottom:a,right:r,chart:l}=s,{chartArea:c,scales:d}=l;let u=0,f,m,v;const p=a-n,g=r-o;if(s.isHorizontal()){if(m=Js(i,o,r),F(e)){const b=Object.keys(e)[0],y=e[b];v=d[b].getPixelForValue(y)+p-t}else e==="center"?v=(c.bottom+c.top)/2+p-t:v=Ci(s,e,t);f=r-o}else{if(F(e)){const b=Object.keys(e)[0],y=e[b];m=d[b].getPixelForValue(y)-g+t}else e==="center"?m=(c.left+c.right)/2-g+t:m=Ci(s,e,t);v=Js(i,a,n),u=e==="left"?-ut:ut}return{titleX:m,titleY:v,maxWidth:f,rotation:u}}class se extends ss{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=mt(t,Number.POSITIVE_INFINITY),e=mt(e,Number.NEGATIVE_INFINITY),i=mt(i,Number.POSITIVE_INFINITY),n=mt(n,Number.NEGATIVE_INFINITY),{min:mt(t,i),max:mt(e,n),minDefined:dt(t),maxDefined:dt(e)}}getMinMax(t){let{min:e,max:i,minDefined:n,maxDefined:o}=this.getUserBounds(),a;if(n&&o)return{min:e,max:i};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;
2++l)a=r[l].controller.getMinMax(this,t),n||(e=Math.min(e,a.min)),o||(i=Math.max(i,a.max));return e=o&&e>i?i:e,i=n&&e>i?e:i,{min:mt(e,mt(i,e)),max:mt(i,mt(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){U(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Qc(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?Oi(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=bh(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){U(this.options.afterUpdate,[this])}beforeSetDimensions(){U(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){U(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),U(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){U(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,o;for(i=0,n=t.length;i<n;i++)o=t[i],o.label=U(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){U(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){U(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Pi(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let a=n,r,l,c;if(!this._isVisible()||!e.display||n>=o||i<=1||!this.isHorizontal()){this.labelRotation=n;return}const d=this._getLabelSizes(),u=d.widest.width,f=d.highest.height,m=ft(this.chart.width-u,0,this.maxWidth);r=t.offset?this.maxWidth/i:m/(i-1),u+6>r&&(r=m/(i-(t.offset?.5:1)),l=this.maxHeight-re(t.grid)-e.padding-Di(t.title,this.chart.options.font),c=Math.sqrt(u*u+f*f),a=Mc(Math.min(Math.asin(ft((d.highest.height+6)/r,-1,1)),Math.asin(ft(l/c,-1,1))-Math.asin(ft(f/c,-1,1)))),a=Math.max(n,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){U(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){U(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Di(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=re(o)+l):(t.height=this.maxHeight,t.width=re(o)+l),i.display&&this.ticks.length){const{first:c,last:d,widest:u,highest:f}=this._getLabelSizes(),m=i.padding*2,v=Yt(this.labelRotation),p=Math.cos(v),g=Math.sin(v);if(r){const b=i.mirror?0:g*u.width+p*f.height;t.height=Math.min(this.maxHeight,t.height+b+m)}else{const b=i.mirror?0:p*u.width+g*f.height;t.width=Math.min(this.maxWidth,t.width+b+m)}this._calculatePadding(c,d,g,p)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;l?c?(f=n*t.width,m=i*e.height):(f=i*t.height,m=n*e.width):o==="start"?m=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,m=e.width/2),this.paddingLeft=Math.max((f-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((m-u+a)*this.width/(this.width-u),0)}else{let d=e.height/2,u=t.height/2;o==="start"?(d=0,u=t.height):o==="end"&&(d=e.height,u=0),this.paddingTop=d+a,this.paddingBottom=u+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){U(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)z(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Oi(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Pi(e,i));let c=0,d=0,u,f,m,v,p,g,b,y,k,S,M;for(u=0;
2u<e;u+=l){if(v=t[u].label,p=this._resolveTickFontOptions(u),n.font=g=p.string,b=o[g]=o[g]||{data:{},gc:[]},y=p.lineHeight,k=S=0,!z(v)&&!q(v))k=ni(n,b.data,b.gc,k,v),S=y;else if(q(v))for(f=0,m=v.length;f<m;++f)M=v[f],!z(M)&&!q(M)&&(k=ni(n,b.data,b.gc,k,M),S+=y);a.push(k),r.push(S),c=Math.max(k,c),d=Math.max(S,d)}Th(o,e);const O=a.indexOf(c),C=r.indexOf(d),D=I=>({width:a[I]||0,height:r[I]||0});return{first:D(0),last:D(e-1),widest:D(O),highest:D(C),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Pc(this._alignToPixels?jt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Ph(this.getContext(),t,i))}return this.$context||(this.$context=Ch(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Yt(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*i>r*n?r/i:l/n:l*n<r*i?l/i:r/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:a,border:r}=n,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),f=re(o),m=[],v=r.setContext(this.getContext()),p=v.display?v.width:0,g=p/2,b=function(N){return jt(i,N,p)};let y,k,S,M,O,C,D,I,L,A,B,G;if(a==="top")y=b(this.bottom),C=this.bottom-f,I=y-g,A=b(t.top)+g,G=t.bottom;else if(a==="bottom")y=b(this.top),A=t.top,G=b(t.bottom)-g,C=y+g,I=this.top+f;else if(a==="left")y=b(this.right),O=this.right-f,D=y-g,L=b(t.left)+g,B=t.right;else if(a==="right")y=b(this.left),L=t.left,B=b(t.right)-g,O=y+g,D=this.left+f;else if(e==="x"){if(a==="center")y=b((t.top+t.bottom)/2+.5);else if(F(a)){const N=Object.keys(a)[0],tt=a[N];y=b(this.chart.scales[N].getPixelForValue(tt))}A=t.top,G=t.bottom,C=y+g,I=C+f}else if(e==="y"){if(a==="center")y=b((t.left+t.right)/2);else if(F(a)){const N=Object.keys(a)[0],tt=a[N];y=b(this.chart.scales[N].getPixelForValue(tt))}O=y-g,D=O-f,L=t.left,B=t.right}const _t=H(n.ticks.maxTicksLimit,u),V=Math.max(1,Math.ceil(u/_t));for(k=0;k<u;k+=V){const N=this.getContext(k),tt=o.setContext(N),Rt=r.setContext(N),Mt=tt.lineWidth,St=tt.color,Et=Rt.dash||[],Tt=Rt.dashOffset,zt=tt.tickWidth,at=tt.tickColor,ht=tt.tickBorderDash||[],vt=tt.tickBorderDashOffset;S=Sh(this,k,l),S!==void 0&&(M=jt(i,S,Mt),c?O=D=L=B=M:C=I=A=G=M,m.push({tx1:O,ty1:C,tx2:D,ty2:I,x1:L,y1:A,x2:B,y2:G,width:Mt,color:St,borderDash:Et,borderDashOffset:Tt,tickWidth:zt,tickColor:at,tickBorderDash:ht,tickBorderDashOffset:vt}))}return this._ticksLength=u,this._borderValue=y,m}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:d,mirror:u}=o,f=re(i.grid),m=f+d,v=u?-d:m,p=-Yt(this.labelRotation),g=[];let b,y,k,S,M,O,C,D,I,L,A,B,G="middle";if(n==="top")O=this.bottom-v,C=this._getXAxisLabelAlignment();else if(n==="bottom")O=this.top+v,C=this._getXAxisLabelAlignment();else if(n==="left"){const V=this._getYAxisLabelAlignment(f);C=V.textAlign,M=V.x}else if(n==="right"){const V=this._getYAxisLabelAlignment(f);C=V.textAlign,M=V.x}else if(e==="x"){if(n==="center")O=(t.top+t.bottom)/2+m;else if(F(n)){const V=Object.keys(n)[0],N=n[V];O=this.chart.scales[V].getPixelForValue(N)+m}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")M=(t.left+t.right)/2-m;else if(F(n)){const V=Object.keys(n)[0],N=n[V];M=this.chart.scales[V].getPixelForValue(N)}C=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?G="top":l==="end"&&(G="bottom"));const _t=this._getLabelSizes();for(b=0,y=r.length;b<y;++b){k=r[b],S=k.label;const V=o.setContext(this.getContext(b));D=this.getPixelForTick(b)+o.labelOffset,I=this._resolveTickFontOptions(b),L=I.lineHeight,A=q(S)?S.length:1;const N=A/2,tt=V.color,Rt=V.textStrokeColor,Mt=V.textStrokeWidth;let St=C;
2a?(M=D,C==="inner"&&(b===y-1?St=this.options.reverse?"left":"right":b===0?St=this.options.reverse?"right":"left":St="center"),n==="top"?c==="near"||p!==0?B=-A*L+L/2:c==="center"?B=-_t.highest.height/2-N*L+L:B=-_t.highest.height+L/2:c==="near"||p!==0?B=L/2:c==="center"?B=_t.highest.height/2-N*L:B=_t.highest.height-A*L,u&&(B*=-1),p!==0&&!V.showLabelBackdrop&&(M+=L/2*Math.sin(p))):(O=D,B=(1-A)*L/2);let Et;if(V.showLabelBackdrop){const Tt=Ft(V.backdropPadding),zt=_t.heights[b],at=_t.widths[b];let ht=B-Tt.top,vt=0-Tt.left;switch(G){case"middle":ht-=zt/2;break;case"bottom":ht-=zt;break}switch(C){case"center":vt-=at/2;break;case"right":vt-=at;break;case"inner":b===y-1?vt-=at:b>0&&(vt-=at/2);break}Et={left:vt,top:ht,width:at+Tt.width,height:zt+Tt.height,color:V.backdropColor}}g.push({label:S,font:I,textOffset:B,options:{rotation:p,color:tt,strokeColor:Rt,strokeWidth:Mt,textAlign:St,textBaseline:G,translation:[M,O],backdrop:Et}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Yt(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,d;return e==="left"?n?(d=this.right+o,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-r,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d=this.left)):e==="right"?n?(d=this.left+o,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+r,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};
2if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,d)=>{!d.width||!d.color||(i.save(),i.lineWidth=d.width,i.strokeStyle=d.color,i.setLineDash(d.borderDash||[]),i.lineDashOffset=d.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(o=0,a=n.length;o<a;++o){const l=n[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,u,f;this.isHorizontal()?(c=jt(t,this.left,a)-a/2,d=jt(t,this.right,r)+r/2,u=f=l):(u=jt(t,this.top,a)-a/2,f=jt(t,this.bottom,r)+r/2,c=d=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,u),e.lineTo(d,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,n=this._computeLabelArea();n&&kn(i,n);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,d=a.textOffset;ri(i,c,0,d,l,r)}n&&Mn(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=bt(i.font),a=Ft(i.padding),r=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||F(e)?(l+=a.bottom,q(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:d,maxWidth:u,rotation:f}=Dh(this,l,e,r);ri(t,i.text,0,0,o,{color:i.color,maxWidth:u,rotation:f,textAlign:Oh(r,e,n),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=H(t.grid&&t.grid.z,-1),n=H(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==se.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[i]===this.id&&(!t||r.type===t)&&n.push(r)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return bt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ee{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Bh(e)&&(i=this.register(e));const n=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,Ih(t,a,i),this.override&&K.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in K[n]&&(delete K[n][i],this.override&&delete Gt[i])}}function Ih(s,t,e){const i=be(Object.create(null),[e?K.get(e):{},K.get(t),s.defaults]);K.set(t,i),s.defaultRoutes&&Ah(t,s.defaultRoutes),s.descriptors&&K.describe(t,s.descriptors)}function Ah(s,t){Object.keys(t).forEach(e=>{const i=e.split("."),n=i.pop(),o=[s].concat(i).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");K.route(o,n,l,r)})}function Bh(s){return"id"in s&&"defaults"in s}class Lh{constructor(){this.controllers=new Ee(Bn,"datasets",!0),this.elements=new Ee(ss,"elements"),this.plugins=new Ee(Object,"plugins"),this.scales=new Ee(se,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}
2removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{const o=i||this._getRegistryForType(n);i||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):E(n,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,i){const n=As(t);U(i["before"+n],[],i),e[t](i),U(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var pt=new Lh;class $h{constructor(){this._init=void 0}notify(t,e,i,n){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=n?this._descriptors(t).filter(n):this._descriptors(t),a=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,n){n=n||{};for(const o of t){const a=o.plugin,r=a[i],l=[e,n,o.options];if(U(r,l,a)===!1&&n.cancelable)return!1}return!0}invalidate(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=H(i.options&&i.options.plugins,{}),o=Fh(i);return n===!1&&!e?[]:Eh(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Fh(s){const t={},e=[],i=Object.keys(pt.plugins.items);for(let o=0;o<i.length;o++)e.push(pt.getPlugin(i[o]));const n=s.plugins||[];for(let o=0;o<n.length;o++){const a=n[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Rh(s,t){return!t&&s===!1?null:s===!0?{}:s}function Eh(s,{plugins:t,localIds:e},i,n){const o=[],a=s.getContext();for(const r of t){const l=r.id,c=Rh(i[l],n);c!==null&&o.push({plugin:r,options:zh(s.config,{plugin:r,local:e[l]},c,a)})}return o}function zh(s,{plugin:t,local:e},i,n){const o=s.pluginScopeKeys(t),a=s.getOptionScopes(i,o);return e&&t.defaults&&a.push(t.defaults),s.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ms(s,t){const e=K.datasets[s]||{};return((t.datasets||{})[s]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Vh(s,t){let e=s;return s==="_index_"?e=t:s==="_value_"&&(e=t==="x"?"y":"x"),e}function Nh(s,t){return s===t?"_index_":"_value_"}function Ii(s){if(s==="x"||s==="y"||s==="r")return s}function jh(s){if(s==="top"||s==="bottom")return"x";if(s==="left"||s==="right")return"y"}function Ss(s,...t){if(Ii(s))return s;for(const e of t){const i=e.axis||jh(e.position)||s.length>1&&Ii(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function Ai(s,t,e){if(e[t+"AxisID"]===s)return{axis:t}}function Wh(s,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(e.length)return Ai(s,"x",e[0])||Ai(s,"y",e[0])}return{}}function Hh(s,t){const e=Gt[s.type]||{scales:{}},i=t.scales||{},n=Ms(s.type,t),o=Object.create(null);
2return Object.keys(i).forEach(a=>{const r=i[a];if(!F(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=Ss(a,r,Wh(a,s),K.scales[r.type]),c=Nh(l,n),d=e.scales||{};o[a]=ue(Object.create(null),[{axis:l},r,d[l],d[c]])}),s.data.datasets.forEach(a=>{const r=a.type||s.type,l=a.indexAxis||Ms(r,t),d=(Gt[r]||{}).scales||{};Object.keys(d).forEach(u=>{const f=Vh(u,l),m=a[f+"AxisID"]||f;o[m]=o[m]||Object.create(null),ue(o[m],[{axis:f},i[m],d[u]])})}),Object.keys(o).forEach(a=>{const r=o[a];ue(r,[K.scales[r.type],K.scale])}),o}function Nn(s){const t=s.options||(s.options={});t.plugins=H(t.plugins,{}),t.scales=Hh(s,t)}function jn(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function Uh(s){return s=s||{},s.data=jn(s.data),Nn(s),s}const Bi=new Map,Wn=new Set;function ze(s,t){let e=Bi.get(s);return e||(e=t(),Bi.set(s,e),Wn.add(e)),e}const le=(s,t,e)=>{const i=Jt(t,e);i!==void 0&&s.add(i)};class Yh{constructor(t){this._config=Uh(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=jn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Nn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ze(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ze(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ze(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return ze(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,a=this._cachedScopes(t,i),r=a.get(e);if(r)return r;const l=new Set;e.forEach(d=>{t&&(l.add(t),d.forEach(u=>le(l,t,u))),d.forEach(u=>le(l,n,u)),d.forEach(u=>le(l,Gt[o]||{},u)),d.forEach(u=>le(l,K,u)),d.forEach(u=>le(l,ws,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Wn.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Gt[e]||{},K.datasets[e]||{},{type:e},K,ws]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Li(this._resolverCache,t,n);let l=a;if(Xh(a,e)){o.$shared=!1,i=$t(i)?i():i;const c=this.createResolver(t,i,r);l=te(a,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Li(this._resolverCache,t,i);return F(e)?te(o,e,void 0,n):o}}function Li(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));const n=e.join();let o=i.get(n);
2return o||(o={resolver:Ls(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},i.set(n,o)),o}const Kh=s=>F(s)&&Object.getOwnPropertyNames(s).some(t=>$t(s[t]));function Xh(s,t){const{isScriptable:e,isIndexable:i}=Cn(s);for(const n of t){const o=e(n),a=i(n),r=(a||o)&&s[n];if(o&&($t(r)||Kh(r))||a&&q(r))return!0}return!1}var qh="4.5.1";const Gh=["top","bottom","left","right","chartArea"];function $i(s,t){return s==="top"||s==="bottom"||Gh.indexOf(s)===-1&&t==="x"}function Fi(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function Ri(s){const t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),U(e&&e.onComplete,[s],t)}function Zh(s){const t=s.chart,e=t.options.animation;U(e&&e.onProgress,[s],t)}function Hn(s){return Rs()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const He={},Ei=s=>{const t=Hn(s);return Object.values(He).filter(e=>e.canvas===t).pop()};function Qh(s,t,e){const i=Object.keys(s);for(const n of i){const o=+n;if(o>=t){const a=s[n];delete s[n],(e>0||o>t)&&(s[o+e]=a)}}}function Jh(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}class ye{static defaults=K;static instances=He;static overrides=Gt;static registry=pt;static version=qh;static getChart=Ei;static register(...t){pt.add(...t),zi()}static unregister(...t){pt.remove(...t),zi()}constructor(t,e){const i=this.config=new Yh(e),n=Hn(t),o=Ei(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||ph(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,d=l&&l.width;if(this.id=uc(),this.ctx=r,this.canvas=l,this.width=d,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new $h,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ac(u=>this.update(u),a.resizeDelay||0),this._dataChanges=[],He[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}yt.listen(this,"complete",Ri),yt.listen(this,"progress",Zh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return z(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return pt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():di(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return oi(this.canvas,this.ctx),this}stop(){return yt.stop(this),this}resize(t,e){yt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,di(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),U(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};E(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=Ss(a,r),c=l==="r",d=l==="x";return{options:r,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),E(o,a=>{const r=a.options,l=r.id,c=Ss(l,r),d=H(r.type,a.dtype);(r.position===void 0||$i(r.position,c)!==$i(a.dposition))&&(r.position=a.dposition),n[l]=!0;let u=null;if(l in i&&i[l].type===d)u=i[l];else{const f=pt.getScale(d);
2u=new f({id:l,type:d,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(r,t)}),E(n,(a,r)=>{a||delete i[r]}),E(i,a=>{Fe.configure(this,a,a.options),Fe.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,o)=>n.index-o.index),i>e){for(let n=e;n<i;++n)this._destroyDatasetMeta(n);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Fi("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const o=e[i];let a=this.getDatasetMeta(i);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=r,a.indexAxis=o.indexAxis||Ms(r,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=pt.getController(r),{datasetElementType:c,dataElementType:d}=K.datasets[r];Object.assign(l,{dataElementType:pt.getElement(d),datasetElementType:c&&pt.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){E(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:u}=this.getDatasetMeta(c),f=!n&&o.indexOf(u)===-1;u.buildOrUpdateElements(f),a=Math.max(+u.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),n||E(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fi("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){E(this.scales,t=>{Fe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ks(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of e){const a=i==="_removeElements"?-o:o;Qh(t,n,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),n=i(0);for(let o=1;o<e;o++)if(!Ks(n,i(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Fe.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],E(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,$t(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(yt.has(this)?this.attached&&!yt.running(this)&&yt.start(this):(this.draw(),Ri({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,o;for(n=0,o=e.length;n<o;++n){const a=e[n];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=xd(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(n&&kn(e,n),t.controller.draw(),n&&Mn(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return wn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const o=Gd.modes[e];return typeof o=="function"?o(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=ee(null,{chart:this,type:"chart"}))}
2getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);ve(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(r=>r.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),yt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),oi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete He[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},n=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};E(this.options.events,o=>i(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){E(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},E(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[n+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!Ue(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const n=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),a=o(e,t),r=i?t:o(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,i,a),l=bc(t),c=Jh(t,this._lastEvent,i,l);i&&(this._lastEvent=null,U(o.onHover,[t,r,this],this),l&&U(o.onClick,[t,r,this],this));const d=!Ue(r,n);return(d||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=c,d}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}function zi(){return E(ye.instances,s=>s._plugins.invalidate())}function Un(s,t){const{x:e,y:i,base:n,width:o,height:a}=s.getProps(["x","y","base","width","height"],t);let r,l,c,d,u;return s.horizontal?(u=a/2,r=Math.min(e,n),l=Math.max(e,n),c=i-u,d=i+u):(u=o/2,r=e
2-u,l=e+u,c=Math.min(i,n),d=Math.max(i,n)),{left:r,top:c,right:l,bottom:d}}function Dt(s,t,e,i){return s?0:ft(t,e,i)}function tu(s,t,e){const i=s.options.borderWidth,n=s.borderSkipped,o=Tn(i);return{t:Dt(n.top,o.top,0,e),r:Dt(n.right,o.right,0,t),b:Dt(n.bottom,o.bottom,0,e),l:Dt(n.left,o.left,0,t)}}function eu(s,t,e){const{enableBorderRadius:i}=s.getProps(["enableBorderRadius"]),n=s.options.borderRadius,o=me(n),a=Math.min(t,e),r=s.borderSkipped,l=i||F(n);return{topLeft:Dt(!l||r.top||r.left,o.topLeft,0,a),topRight:Dt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Dt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Dt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function su(s){const t=Un(s),e=t.right-t.left,i=t.bottom-t.top,n=tu(s,e/2,i/2),o=eu(s,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:i-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function ms(s,t,e,i){const n=t===null,o=e===null,r=s&&!(n&&o)&&Un(s,i);return r&&(n||Zs(t,r.left,r.right))&&(o||Zs(e,r.top,r.bottom))}function iu(s){return s.topLeft||s.topRight||s.bottomLeft||s.bottomRight}function nu(s,t){s.rect(t.x,t.y,t.w,t.h)}function gs(s,t,e={}){const i=s.x!==e.x?-t:0,n=s.y!==e.y?-t:0,o=(s.x+s.w!==e.x+e.w?t:0)-i,a=(s.y+s.h!==e.y+e.h?t:0)-n;return{x:s.x+i,y:s.y+n,w:s.w+o,h:s.h+a,radius:s.radius}}class Yn extends ss{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:o,outer:a}=su(this),r=iu(a.radius)?ks:nu;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,gs(a,e,o)),t.clip(),r(t,gs(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,gs(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return ms(this,t,e,i)}inXRange(t,e){return ms(this,t,null,e)}inYRange(t,e){return ms(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?i:(i+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}const he={average(s){if(!s.length)return!1;let t,e,i=new Set,n=0,o=0;for(t=0,e=s.length;t<e;++t){const r=s[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();i.add(l.x),n+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((r,l)=>r+l)/i.size,y:n/o}},nearest(s,t){if(!s.length)return!1;let e=t.x,i=t.y,n=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=s.length;o<a;++o){const l=s[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=Tc(t,c);d<n&&(n=d,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function gt(s,t){return t&&(q(t)?Array.prototype.push.apply(s,t):s.push(t)),s}function wt(s){return(typeof s=="string"||s instanceof String)&&s.indexOf(` 3`)>-1?s.split(` 4`):s}function ou(s,t){const{element:e,datasetIndex:i,index:n}=t,o=s.getDatasetMeta(i).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:s,label:a,parsed:o.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function Vi(s,t){const e=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:a,boxHeight:r}=t,l=bt(t.bodyFont),c=bt(t.titleFont),d=bt(t.footerFont),u=o.length,f=n.length,m=i.length,v=Ft(t.padding);let p=v.height,g=0,b=i.reduce((S,M)=>S+M.before.length+M.lines.length+M.after.length,0);if(b+=s.beforeBody.length+s.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){const S=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;p+=m*S+(b-m)*l.lineHeight+(b-1)*t.bodySpacing}f&&(p+=t.footerMarginTop+f*d.lineHeight+(f-1)*t.footerSpacing);let y=0;
4const k=function(S){g=Math.max(g,e.measureText(S).width+y)};return e.save(),e.font=c.string,E(s.title,k),e.font=l.string,E(s.beforeBody.concat(s.afterBody),k),y=t.displayColors?a+2+t.boxPadding:0,E(i,S=>{E(S.before,k),E(S.lines,k),E(S.after,k)}),y=0,e.font=d.string,E(s.footer,k),e.restore(),g+=v.width,{width:g,height:p}}function au(s,t){const{y:e,height:i}=t;return e<i/2?"top":e>s.height-i/2?"bottom":"center"}function ru(s,t,e,i){const{x:n,width:o}=i,a=e.caretSize+e.caretPadding;if(s==="left"&&n+o+a>t.width||s==="right"&&n-o-a<0)return!0}function lu(s,t,e,i){const{x:n,width:o}=e,{width:a,chartArea:{left:r,right:l}}=s;let c="center";return i==="center"?c=n<=(r+l)/2?"left":"right":n<=o/2?c="left":n>=a-o/2&&(c="right"),ru(c,s,t,e)&&(c="center"),c}function Ni(s,t,e){const i=e.yAlign||t.yAlign||au(s,e);return{xAlign:e.xAlign||t.xAlign||lu(s,t,e,i),yAlign:i}}function cu(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function du(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function ji(s,t,e,i){const{caretSize:n,caretPadding:o,cornerRadius:a}=s,{xAlign:r,yAlign:l}=e,c=n+o,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:m}=me(a);let v=cu(t,r);const p=du(t,l,c);return l==="center"?r==="left"?v+=c:r==="right"&&(v-=c):r==="left"?v-=Math.max(d,f)+n:r==="right"&&(v+=Math.max(u,m)+n),{x:ft(v,0,i.width-t.width),y:ft(p,0,i.height-t.height)}}function Ve(s,t,e){const i=Ft(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function Wi(s){return gt([],wt(s))}function hu(s,t,e){return ee(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Hi(s,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}const Kn={beforeTitle:xt,title(s){if(s.length>0){const t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:xt,beforeBody:xt,beforeLabel:xt,label(s){if(this&&this.options&&this.options.mode==="dataset")return s.label+": "+s.formattedValue||s.formattedValue;let t=s.dataset.label||"";t&&(t+=": ");const e=s.formattedValue;return z(e)||(t+=e),t},labelColor(s){const e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(s){const e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:xt,afterBody:xt,beforeFooter:xt,footer:xt,afterFooter:xt};function st(s,t,e,i){const n=s[t].call(e,i);return typeof n>"u"?Kn[t].call(e,i):n}class Ui extends ss{static positioners=he;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,o=new In(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=hu(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=st(i,"beforeTitle",this,t),o=st(i,"title",this,t),a=st(i,"afterTitle",this,t);let r=[];return r=gt(r,wt(n)),r=gt(r,wt(o)),r=gt(r,wt(a)),r}getBeforeBody(t,e){return Wi(st(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return E(t,o=>{const a={before:[],lines:[],after:[]},r=Hi(i,o);gt(a.before,wt(st(r,"beforeLabel",this,o))),gt(a.lines,st(r,"label",this,o)),gt(a.after,wt(st(r,"afterLabel",this,o))),n.push(a)}),n}getAfterBody(t,e){return Wi(st(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=st(i,"beforeFooter",this,t),o=st(i,"footer",this,t),a=st(i,"afterFooter",this,t);let r=[];return r=gt(r,wt(n)),r=gt(r,wt(o)),r=gt(r,wt(a)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;l<c;++l)r.push(ou(this.chart,e[l]));return t.filter&&(r=r.filter((d,u,f)=>t.filter(d,u,f,i))),t.itemSort&&(r=r.sort((d,u)=>t.itemSort(d,u,i))),E(r,d=>{const u=Hi(t.callbacks,d);n.push(st(u,"labelColor",this,d)),o.push(st(u,"labelPointStyle",this,d)),a.push(st(u,"labelTextColor",this,d))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let o,a=[];if(!n.length)this.opacity!==0&&(o={opacity:0}
4);else{const r=he[i.position].call(this,n,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=Vi(this,i),c=Object.assign({},r,l),d=Ni(this.chart,i,c),u=ji(i,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const o=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=me(r),{x:f,y:m}=t,{width:v,height:p}=e;let g,b,y,k,S,M;return o==="center"?(S=m+p/2,n==="left"?(g=f,b=g-a,k=S+a,M=S-a):(g=f+v,b=g+a,k=S-a,M=S+a),y=g):(n==="left"?b=f+Math.max(l,d)+a:n==="right"?b=f+v-Math.max(c,u)-a:b=this.caretX,o==="top"?(k=m,S=k-a,g=b-a,y=b+a):(k=m+p,S=k+a,g=b+a,y=b-a),M=k),{x1:g,x2:b,x3:y,y1:k,y2:S,y3:M}}drawTitle(t,e,i){const n=this.title,o=n.length;let a,r,l;if(o){const c=rs(i.rtl,this.x,this.width);for(t.x=Ve(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=bt(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,n,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,d=bt(o.bodyFont),u=Ve(this,"left",o),f=n.x(u),m=l<d.lineHeight?(d.lineHeight-l)/2:0,v=e.y+m;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation},g=n.leftForLtr(f,c)+c/2,b=v+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ai(t,p,g,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ai(t,p,g,b)}else{t.lineWidth=F(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const p=n.leftForLtr(f,c),g=n.leftForLtr(n.xPlus(f,1),c-2),b=me(a.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ks(t,{x:p,y:v,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ks(t,{x:g,y:v+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,v,c,l),t.strokeRect(p,v,c,l),t.fillStyle=a.backgroundColor,t.fillRect(g,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:d}=i,u=bt(i.bodyFont);let f=u.lineHeight,m=0;const v=rs(i.rtl,this.x,this.width),p=function(D){e.fillText(D,v.x(t.x+m),t.y+f/2),t.y+=f+o},g=v.textAlign(a);let b,y,k,S,M,O,C;for(e.textAlign=a,e.textBaseline="middle",e.font=u.string,t.x=Ve(this,g,i),e.fillStyle=i.bodyColor,E(this.beforeBody,p),m=r&&g!=="right"?a==="center"?c/2+d:c+2+d:0,S=0,O=n.length;S<O;++S){for(b=n[S],y=this.labelTextColors[S],e.fillStyle=y,E(b.before,p),k=b.lines,r&&k.length&&(this._drawColorBox(e,t,S,v,i),f=Math.max(u.lineHeight,l)),M=0,C=k.length;M<C;++M)p(k[M]),f=u.lineHeight;E(b.after,p)}m=0,f=u.lineHeight,E(this.afterBody,p),t.y-=o}drawFooter(t,e,i){const n=this.footer,o=n.length;let a,r;if(o){const l=rs(i.rtl,this.x,this.width);for(t.x=Ve(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=bt(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(n[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:d}=i,{topLeft:u,topRight:f,bottomLeft:m,bottomRight:v}=me(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+u,l),a==="top"&&this.drawCaret(t,e,i,n),e.lineTo(r+c-f,l),e.quadraticCurveTo(r+c,l,r+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,e,i,n),e.lineTo(r+c,l+d-v),e.quadraticCurveTo(r+c,l+d,r+c-v,l+d),a==="bottom"&&this.drawCaret(t,e,i,n),e.lineTo(r+m,l+d),e.quadraticCurveTo(r,l+d,r,l+d-m),a==="center"&&o==="left"&&this.drawCaret(t,e,i,n),e.lineTo(r,l+u),e.quadraticCurveTo(r,l,r+u,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const a=he[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=Vi(this,t),l=Object.assign({},a,this._size),c=Ni(e,t,l),d=ji(t,l,c,e);(n._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Ft(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;
4e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),pd(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),bd(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!Ue(i,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,i),r=this._positionChanged(a,t),l=e||!Ue(a,o)||r;return l&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,a=he[o.position].call(this,t,e);return a!==!1&&(i!==a.x||n!==a.y)}}var Xn={id:"tooltip",_element:Ui,positioners:he,afterInit(s,t,e){e&&(s.tooltip=new Ui({chart:s,options:e}))},beforeUpdate(s,t,e){s.tooltip&&s.tooltip.initialize(e)},reset(s,t,e){s.tooltip&&s.tooltip.initialize(e)},afterDraw(s){const t=s.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(s.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",e)}},afterEvent(s,t){if(s.tooltip){const e=t.replay;s.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(s,t)=>t.bodyFont.size,boxWidth:(s,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Kn},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const uu=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function fu(s,t,e,i){const n=s.indexOf(t);if(n===-1)return uu(s,t,e,i);const o=s.lastIndexOf(t);return n!==o?e:n}const _u=(s,t)=>s===null?null:ft(Math.round(s),0,t);function Yi(s){const t=this.getLabels();return s>=0&&s<t.length?t[s]:s}class qn extends se{static id="category";static defaults={ticks:{callback:Yi}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:n,label:o}of e)i[n]===o&&i.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(z(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:fu(i,t,H(e,t),this._addedLabels),_u(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)n.push({value:a});return n}getLabelForValue(t){return Yi.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function mu(s,t){const e=[],{bounds:n,step:o,min:a,max:r,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:f}=s,m=o||1,v=d-1,{min:p,max:g}=t,b=!z(a),y=!z(r),k=!z(c),S=(g-p)/(u+1);let M=qs((g-p)/v/m)*m,O,C,D,I;if(M<1e-14&&!b&&!y)return[{value:p},{value:g}];I=Math.ceil(g/M)-Math.floor(p/M),I>
4v&&(M=qs(I*M/v/m)*m),z(l)||(O=Math.pow(10,l),M=Math.ceil(M*O)/O),n==="ticks"?(C=Math.floor(p/M)*M,D=Math.ceil(g/M)*M):(C=p,D=g),b&&y&&o&&wc((r-a)/o,M/1e3)?(I=Math.round(Math.min((r-a)/M,d)),M=(r-a)/I,C=a,D=r):k?(C=b?a:C,D=y?r:D,I=c-1,M=(D-C)/I):(I=(D-C)/M,je(I,Math.round(I),M/1e3)?I=Math.round(I):I=Math.ceil(I));const L=Math.max(Gs(M),Gs(C));O=Math.pow(10,z(l)?L:l),C=Math.round(C*O)/O,D=Math.round(D*O)/O;let A=0;for(b&&(f&&C!==a?(e.push({value:a}),C<a&&A++,je(Math.round((C+A*M)*O)/O,a,Ki(a,S,s))&&A++):C<a&&A++);A<I;++A){const B=Math.round((C+A*M)*O)/O;if(y&&B>r)break;e.push({value:B})}return y&&f&&D!==r?e.length&&je(e[e.length-1].value,r,Ki(r,S,s))?e[e.length-1].value=r:e.push({value:r}):(!y||D===r)&&e.push({value:D}),e}function Ki(s,t,{horizontal:e,minRotation:i}){const n=Yt(i),o=(e?Math.sin(n):Math.cos(n))||.001,a=.75*t*(""+s).length;return Math.min(t/o,a)}class gu extends se{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const a=l=>n=e?n:l,r=l=>o=i?o:l;if(t){const l=Bt(n),c=Bt(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=mu(n,o);return t.bounds==="ticks"&&kc(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return xn(t,this.chart.options.locale,this.options.ticks.format)}}class Gn extends gu{static id="linear";static defaults={ticks:{callback:yn.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=dt(t)?t:0,this.max=dt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Yt(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const is={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},it=Object.keys(is);function Xi(s,t){return s-t}function qi(s,t){if(z(t))return null;const e=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),dt(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(n&&(a=n==="week"&&(Xe(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,n)),+a)}function Gi(s,t,e,i){const n=it.length;for(let o=it.indexOf(s);o<n-1;++o){const a=is[it[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=i)return it[o]}return it[n-1]}function pu(s,t,e,i,n){for(let o=it.length-1;o>=it.indexOf(e);o--){const a=it[o];if(is[a].common&&s._adapter.diff(n,i,a)>=t-1)return a}return it[e?it.indexOf(e):0]}function bu(s){for(let t=it.indexOf(s)+1,e=it.length;t<e;++t)if(is[it[t]].common)return it[t]}function Zi(s,t,e){if(!e)s[t]=!0;else if(e.length){const{lo:i,hi:n}=Bs(e,t),o=e[i]>=t?e[i]:e[n];s[o]=!0}}function vu(s,t,e,i){const n=s._adapter,o=+n.startOf(t[0].value,i),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+n.add(r,1,i))l=e[r],l>=0&&(t[l].major=!0);return t}function Qi(s,t,e){const i=[],n={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],n[r]=a,i.push({value:r,major:!1});return o===0||!e?i:vu(s,i,n,e)}class Ji extends se{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}
4),n=this._adapter=new Ud._date(t.adapters.date);n.init(e),ue(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:qi(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=dt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),o=dt(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,a=this.max,r=Dc(n,o,a);return this._unit=e.unit||(i.autoSkip?Gi(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):pu(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:bu(this._unit),this.initOffsets(n),t.reverse&&r.reverse(),Qi(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=ft(e,0,a),i=ft(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,o=n.time,a=o.unit||Gi(o.minUnit,e,i,this._getLabelCapacity(e)),r=H(n.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Xe(l)||l===!0,d={};let u=e,f,m;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":a),t.diff(i,e,a)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+a);const v=n.ticks.source==="data"&&this.getDataTimestamps();for(f=u,m=0;f<i;f=+t.add(f,r,a),m++)Zi(d,f,v);return(f===i||n.bounds==="ticks"||m===1)&&Zi(d,f,v),Object.keys(d).sort(Xi).map(p=>+p)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,a=e||n[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,n){const o=this.options,a=o.ticks.callback;if(a)return U(a,[t,e,i],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&r[l],u=c&&r[c],f=i[e],m=c&&u&&f&&f.major;return this._adapter.format(t,n||(m?u:d))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=Yt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),a=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:i*o+r*a,h:i*a+r*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,Qi(this,[t],this._majorUnit),n),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e<i;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(qi(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gn(t.sort(Xi))}}function Ne(s,t,e){let i=0,n=s.length-1,o,a,r,l;e?(t>=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=ys(s,"pos",t)),{pos:o,time:r}=s[i],{pos:a,time:l}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=ys(s,"time",t)),{time:o,pos:r}=s[i],{time:a,pos:l}=s[n]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class p_ extends Ji{static id="timeseries";static defaults=Ji.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ne(e,this.min),this._tableRange=Ne(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],o=[];let a,r,l,c,d;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=i&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,r=n.length;a<r;++a)d=n[a+1],l=n[a-1],c=n[a],Math.round((d+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ne(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ne(this._table,i*this._tableRange+this._minPos,!0)}}const xu={class:"mc"},yu={class:"mc__head"},wu={class:"mc__title"},ku={class:"mc__sub"},Mu={class:"mc__legend"},Su={class:"mc__leg mc__leg--done"},Tu={class:"mc__leg mc__leg--future"},Cu={class:"mc__wrap"},Pu={class:"mc__footer"},Ou=Z({__name:"MiningChart",props:{dailyBtcRaw:{},miningDay:{},btcRate:{},expectedTotalBtc:{}},setup(s,{expose:t}){ye.register($n,Yn,qn,Gn,Xn);const e=s,{t:i}=ot(),n=j(null);let o=null;const a=()=>{const l=e.dailyBtcRaw,c=e.miningDay,d=Array.from({length:30},(p,g)=>`${g+1}`),u=p=>{const g=Math.sin(p*127.1+311.7)*43758.5;return g-Math.floor(g)},f=d.map((p,g)=>g>=c?0:+(l*(.98+u(g)*.04)).toFixed(9)),m=d.map((p,g)=>g<c?"#1570ef":"#e9ecf2"),v=d.map((p,g)=>g<c?"#1570ef":"#d0d5dd");return c-1>=0&&c-1<30&&(m[c-1]="#087443",v[c-1]="#087443"),{labels:d,values:f,backgrounds:m,borders:v}},r=()=>{if(!n.value)return;o&&(o.destroy(),o=null);const{labels:l,values:c,backgrounds:d,borders:u}=a();o=new ye(n.value,{type:"bar",data:{labels:l,datasets:[{data:c,backgroundColor:d,borderColor:u,borderWidth:0,borderRadius:3,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:600,easing:"easeOutCubic"}
4,plugins:{legend:{display:!1},tooltip:{filter:f=>f.raw>0,callbacks:{title:f=>i("tbb.chart_tooltip_day",{label:f[0]?.label??""}),label:f=>{const m=f.raw.toFixed(8),v=(f.raw*e.btcRate).toFixed(2);return[`${m} BTC`,`â $${v}`]}},backgroundColor:"#101828",titleColor:"#fff",bodyColor:"#d0d5dd",padding:10,cornerRadius:8,displayColors:!1}},scales:{x:{grid:{display:!1},border:{display:!1},ticks:{color:"#98a2b3",font:{size:9,family:"inherit"},maxTicksLimit:10}},y:{grid:{color:"#f2f4f7"},border:{display:!1,dash:[3,3]},ticks:{color:"#98a2b3",font:{size:9,family:"inherit"},maxTicksLimit:4,callback:f=>`${Number(f).toFixed(7)}`}}}}})};return t({init:r}),Lt(()=>Qt(r)),Kt([()=>e.dailyBtcRaw,()=>e.miningDay],()=>Qt(r)),we(()=>{o&&(o.destroy(),o=null)}),(l,c)=>(w(),T("div",xu,[h("div",yu,[h("div",null,[h("div",wu,x(_(i)("tbb.chart_title")),1),h("div",ku,x(_(i)("tbb.chart_sub")),1)]),h("div",Mu,[h("span",Su,x(_(i)("tbb.chart_leg_done")),1),h("span",Tu,x(_(i)("tbb.chart_leg_future")),1)])]),h("div",Cu,[h("canvas",{ref_key:"canvasEl",ref:n,class:"mc__canvas"},null,512)]),h("div",Pu,[h("span",null,[$(x(_(i)("tbb.chart_footer_total",{days:s.miningDay}))+" ",1),h("strong",null,x((s.dailyBtcRaw*s.miningDay).toFixed(7))+" BTC",1)]),h("span",null,[$(x(_(i)("tbb.chart_footer_cycle"))+" ",1),h("strong",null,x(s.expectedTotalBtc)+" BTC",1)])])]))}}),Du=Object.assign(J(Ou,[["__scopeId","data-v-33d92f7d"]]),{__name:"TBBMiningChart"}),Iu={class:"ms"},Au={class:"ms__row"},Bu={class:"ms__miner"},Lu={class:"ms__name"},$u={class:"ms__loc"},Fu={class:"ms__metrics"},Ru={key:0,class:"ms__metric"},Eu={key:1,class:"ms__metric"},zu={key:0,class:"ms__bars"},Vu={key:1,class:"ms__bars"},Nu=Z({__name:"MinerStatus",props:{showTodayStat:{type:Boolean}},setup(s){const{t}=ot(),e=j(Array.from({length:24},()=>40+Math.random()*60));let i=null;return Lt(()=>{i=ge(()=>{const n=Math.floor(Math.random()*e.value.length);e.value[n]=35+Math.random()*65},400)}),we(()=>{i&&clearInterval(i)}),(n,o)=>(w(),T("div",Iu,[h("div",Au,[h("div",Bu,[h("div",null,[h("div",Lu,x(_(t)("tbb.miner_name")),1),h("div",$u,x(_(t)("tbb.miner_loc_step2")),1)])]),h("div",Fu,[o[2]||(o[2]=h("div",{class:"ms__metric"},[h("span",{class:"ms__metric-val ms__metric-val--gr"},"270"),h("span",{class:"ms__metric-unit"},"TH/s")],-1)),o[3]||(o[3]=h("div",{class:"ms__sep"},null,-1)),s.showTodayStat?(w(),T("div",Ru,[...o[0]||(o[0]=[h("span",{class:"ms__metric-dot"},null,-1),h("span",{class:"ms__metric-lbl"},"Online",-1)])])):(w(),T("div",Eu,[...o[1]||(o[1]=[h("span",{class:"ms__metric-dot--offline"},null,-1),h("span",{class:"ms__metric-lbl"},"Offline",-1)])]))])]),s.showTodayStat?(w(),T("div",zu,[(w(!0),T(Y,null,rt(_(e),(a,r)=>(w(),T("div",{key:r,class:"ms__bar",style:It({height:a+"%",animationDelay:r*60+"ms"})},null,4))),128))])):(w(),T("div",Vu,[(w(!0),T(Y,null,rt(_(e),(a,r)=>(w(),T("div",{key:r,class:"ms__bar"}))),128))]))]))}}),ju=Object.assign(J(Nu,[["__scopeId","data-v-28829add"]]),{__name:"TBBMinerStatus"}),Wu={class:"wc"},Hu={class:"wc__head"},Uu={class:"wc__title"},Yu={class:"wc__meters"},Ku={class:"wc__meter"},Xu={class:"wc__meter-top"},qu={class:"wc__meter-lbl"},Gu={class:"wc__meter-val wc__meter-val--gr"},Zu={class:"wc__meter-lbl"},Qu={class:"wc__meter-val wc__meter-val--gr"},Ju={class:"wc__track"},tf=Z({__name:"WithdrawCard",props:{canWithdrawNum:{},canWithdrawUsd:{},withdrawalLimitNum:{},availablePct:{},isWithdrawing:{type:Boolean},minedBase:{}},emits:["withdraw"],setup(s,{emit:t}){const e=t,{t:i}=ot();return(n,o)=>{const a=Do,r=Je;return w(),T("div",Wu,[h("div",Hu,[h("div",Uu,x(_(i)("tbb.withdraw_title")),1)]),h("div",Yu,[h("div",Ku,[h("div",Xu,[h("span",qu,[$(x(_(i)("tbb.withdraw_available"))+": ",1),h("span",Gu,"$"+x(s.canWithdrawUsd),1)]),h("span",Zu,[$(x(_(i)("tbb.modal_available_label"))+": ",1),h("span",Qu,"$"+x(s.withdrawalLimitNum),1),W(a,{"tooltip-text":_(i)("tbb.withdraw_hint")},null,8,["tooltip-text"])])]),h("div",Ju,[h("div",{class:"wc__fill wc__fill--gr",style:It({width:s.availablePct+"%"})},null,4)])])]),s.canWithdrawNum>0?(w(),Q(r,{key:0,variant:"primary","is-load":s.isWithdrawing,disabled:s.minedBase===0,class:"wc__btn",onClick:o[0]||(o[0]=l=>e("withdraw"))},{default:ct(()=>[$(x(_(i)("tbb.withdraw_btn_amount",{amount:s.canWithdrawUsd})),1)]),_:1},8,["is-load","disabled"])):(w(),Q(r,{key:1,variant:"orange",disabled:s.minedBase===0,class:"wc__btn",onClick:o[1]||(o[1]=l=>e("withdraw"))},{default:ct(()=>[$(x(_(i)("tbb.withdraw_btn")),1)]),_:1},8,["disabled"]))])}}}),ef=Object.assign(J(tf,[["__scopeId","data-v-d3af0072"]]),{__name:"TBBWithdrawCard"}),sf={class:"tma"},nf={class:"tma__header"},of={class:"tma__header-left"},af={class:"tma__title"},rf={key:0,class:"tma__pill tma__pill--skeleton"},lf=Z({__name:"TrialMiningActive",setup(s){const t=Ze(),e=an(),i=on();Ps();const{t:n}=ot(),o=ko(),a=j(!1),r=j(!1),l=P(()=>t.data?.modal.banner),c=P(()=>t.data?.modal.popup),d=P(()=>t.withdrawalInfo),u=P(()=>t.data?.step??1),f=X=>{document.getElementById(X)?.scrollIntoView({behavior:"smooth"})},m=()=>{at.value=!1,nn(Se("go_to_cloud_contracts")),o.push("/mining-store/buy-cloud")},v=P(()=>i.fpps>0?i.fpps:parseFloat(t.data?.fpps??"0")||0),p=P(()=>e.wallet?.PromoBTC??null),g=P(()=>i.btcRate||95e3),b=P(()=>v.value*270),y=P(()=>b.value.toFixed(8)),k=P(()=>`$${(b.value*g.value).toFixed(2)}`),S=P(()=>+(p.value?.sum??0)||0),M=P(()=>S.value.toFixed(8)),O=P(()=>(S.value*g.value).toFixed(2)),C=P(()=>(b.value*30).toFixed(8)),D=P(()=>(b.value*30*g.value).toFixed(0)),I=P(()=>{const X=p.value?.activation_date;return X?Math.min(Math.max(Oo(new Date,vs(X))+1,1),30):1}),L=P(()=>Math.round(I.value/30*100)),A=P(()=>{const X=p.value?.activation_date;return X?Date.now()>=rn(ln(vs(X)),30).getTime():!1}),B=P(()=>!!p.value?.activation_date&&I.value>=23),G=P(()=>u.value===1?"tma__pill--blue":B.value?"tma__pill--red":"tma__pill--green"),_t=P(()=>u.value===1?n("tbb.pill_launch"):B.value?n("tbb.pill_final"):n("tbb.pill_mining")),V=P(()=>mo(d.value,Number(O.value))),N=P(()=>V.value.canWithdrawUsd),tt=P(()=>V.value.withdrawalLimitUsd),Rt=P(()=>N.value.toFixed(2)),Mt=P(()=>V.value.withdrawalLimitUsd),St=P(()=>Mt.value>0?Math.min(N.value/Mt.value*100,100):0),Et=P(()=>V.value.purchasedUsd),Tt=P(()=>Et.value.toFixed(0)),zt=P(()=>(N.value/g.value).toFixed(6)),at=j(!1),ht=j(!1),vt=async()=>
4{if(!ht.value){ht.value=!0;try{Ns("trial_mining_withdraw_start",Se("withdraw_start"));const X=await t.withdraw();at.value=!1,X?.success&&(Ns("trial_mining_withdraw_success",Se("withdraw_success")),await o.push("/?tbb_withdraw=success"))}finally{ht.value=!1}}},Me=j(null);Lt(()=>{sn(Se("active_view")),window.scrollTo({top:0}),i.loadMiningFarmInfo(),e.loadWalletList(),u.value===1&&!t.isLoad&&(c.value?(a.value=!0,r.value=!0):Qt(()=>Me.value?.run()))});function Se(X){return{productKey:"trial_mining_tbb",itemId:"try_before_buy",itemName:"Trial Mining TBB",price:0,value:N.value,quantity:1,itemParams:{trial_action:X,step:u.value,hashrate_th:270,duration_days:30,mining_day:I.value,mining_progress_percent:L.value,can_withdraw_usd:N.value,purchased_since_last_withdraw_usd:Et.value,entry_point:"cp_trial_mining_active"}}}return Kt([c,l],([X,et])=>{X&&(a.value=!0),et&&(r.value=!0)}),Kt(()=>t.isLoad,X=>{!X&&u.value===1&&(c.value?(a.value=!0,r.value=!0):Qt(()=>Me.value?.run()))}),Kt(a,(X,et)=>{!X&&et&&u.value===1&&Qt(()=>{Me.value?.run()})}),(X,et)=>{const Zn=_r,Qn=br,Jn=Ts,to=Jr,eo=il,so=kl,io=zl,no=Wl,oo=Du,ao=ju,ro=ef,lo=cn,co=_o;return w(),T("div",sf,[W(Zn,{"is-visible":_(a),"modal-step":_(c),"onUpdate:isVisible":et[0]||(et[0]=ie=>a.value=ie),onScrollToSection:f},null,8,["is-visible","modal-step"]),W(Qn,{"is-visible":_(r),"info-step":_(l),"onUpdate:isVisible":et[1]||(et[1]=ie=>r.value=ie)},null,8,["is-visible","info-step"]),h("div",nf,[h("div",of,[W(Jn),h("h1",af,x(_(n)("pages.tbb_trial_mining")),1)]),_(t).isLoad?(w(),T("span",rf)):(w(),T("span",{key:1,class:Qe(["tma__pill",_(G)])},[et[4]||(et[4]=h("span",{class:"tma__pill-dot"},null,-1)),$(" "+x(_(_t)),1)],2))]),_(u)===1&&!_(t).isLoad?(w(),Q(to,{key:0,ref_key:"launchRef",ref:Me,"btc-rate":_(g),"daily-btc-str":_(y),"expected-total-btc":_(C),"expected-total-usd":_(D),"promo-activation-date":_(p)?.activation_date??null},null,8,["btc-rate","daily-btc-str","expected-total-btc","expected-total-usd","promo-activation-date"])):R("",!0),_(t).isLoad&&_(u)!==1?(w(),Q(eo,{key:1})):R("",!0),_(u)!==1&&!_(t).isLoad?(w(),T(Y,{key:2},[_(B)&&_(p)?.activation_date?(w(),Q(so,{key:0,"activation-date":_(p).activation_date,"is-trial-expired":_(A)},null,8,["activation-date","is-trial-expired"])):R("",!0),W(io,{"live-btc":_(M),"live-usd":_(O),"daily-btc-str":_(y),"daily-usd-str":_(k),"mining-day":_(I),"mining-pct":_(L),"show-today-stat":!_(A)},null,8,["live-btc","live-usd","daily-btc-str","daily-usd-str","mining-day","mining-pct","show-today-stat"]),W(no,{"mining-pct":_(L)},null,8,["mining-pct"]),W(oo,{"daily-btc-raw":_(b),"mining-day":_(I),"btc-rate":_(g),"expected-total-btc":_(C)},null,8,["daily-btc-raw","mining-day","btc-rate","expected-total-btc"]),W(ao,{"show-today-stat":!_(A)},null,8,["show-today-stat"])],64)):R("",!0),_(d)?(w(),Q(ro,{key:3,"can-withdraw-num":_(N),"can-withdraw-usd":_(Rt),"withdrawal-limit-num":_(Mt),"available-pct":_(St),"is-withdrawing":_(ht),"mined-base":_(S),onWithdraw:et[2]||(et[2]=ie=>at.value=!0)},null,8,["can-withdraw-num","can-withdraw-usd","withdrawal-limit-num","available-pct","is-withdrawing","mined-base"])):R("",!0),W(lo,{onBuy:m}),W(co,{show:_(at),"can-withdraw-num":_(N),"can-withdraw-usd":_(Rt),"live-btc":_(M),"live-usd":_(O),"purchased-usd":_(Tt),"balance-withdraw-num":_(tt),"can-withdraw-btc":_(zt),"is-withdrawing":_(ht),onClose:et[3]||(et[3]=ie=>at.value=!1),onGoToContracts:m,onConfirm:vt},null,8,["show","can-withdraw-num","can-withdraw-usd","live-btc","live-usd","purchased-usd","balance-withdraw-num","can-withdraw-btc","is-withdrawing"])])}}}),cf=Object.assign(J(lf,[["__scopeId","data-v-4d761c3b"]]),{__name:"TBBTrialMiningActive"}),df={class:"tmd"},hf={class:"tmd__header"},uf={class:"tmd__header-left"},ff={class:"tmd__title"},_f={class:"tmd__hero-row"},mf={class:"tmd__hero-stat"},gf={class:"tmd__hero-stat-lbl"},pf={class:"tmd__hero-stat-val tmd__hero-stat-val--main"},bf={class:"tmd__live-ticker"},vf={class:"tmd__hero-stat-usd"},xf={class:"tmd__hero-stat"},yf={class:"tmd__hero-stat-lbl"},wf={class:"tmd__hero-stat-val"},kf={class:"tmd__hero-stat-usd"},Mf={class:"tmd__hero-stat"},Sf={class:"tmd__hero-stat-lbl"},Tf={class:"tmd__hero-stat-usd"},Cf={class:"tmd__prog-wrap"},Pf={class:"tmd__prog-track"},Of={class:"tmd__chart-card"},Df={class:"tmd__chart-card-head"},If={class:"tmd__chart-card-title"},Af={class:"tmd__chart-card-sub"},Bf={class:"tmd__chart-card-legend"},Lf={class:"tmd__chart-leg tmd__chart-leg--done"},$f={class:"tmd__chart-leg tmd__chart-leg--future"},Ff={class:"tmd__chart-wrap"},Rf={class:"tmd__chart-footer"},Ef={class:"tmd__status-card"},zf={class:"tmd__status-row"},Vf={class:"tmd__status-miner"},Nf={class:"tmd__miner-name"},jf={class:"tmd__miner-loc"},Wf={class:"tmd__hashrate-bars"},Hf={class:"tmd__cta-wrap"},Uf={class:"tmd__cta-text"},Ct=15,ps=50,Ht=971e-7,bs=95e3,Yf=Z({__name:"TrialMiningLiveDemo",emits:["activate"],setup(s,{emit:t}){const e=t;ye.register($n,Yn,qn,Gn,Xn);const{t:i}=ot(),n=P(()=>Ht.toFixed(7)),o=P(()=>`$${(Ht*bs).toFixed(2)}`),a=P(()=>
4(Ht*30).toFixed(6)),r=P(()=>(Ht*Ct).toFixed(7)),l=Ht*Ct,c=j(0),d=P(()=>l+c.value),u=P(()=>d.value.toFixed(8)),f=P(()=>(d.value*bs).toFixed(2));let m=null;const v=()=>{const O=Ht/86400;m=ge(()=>{c.value+=O*.7},700)},p=j(Array.from({length:24},()=>40+Math.random()*60));let g=null;const b=()=>{g=ge(()=>{const O=Math.floor(Math.random()*p.value.length);p.value[O]=35+Math.random()*65},400)},y=j(null);let k=null;const S=()=>{if(!y.value)return;k&&(k.destroy(),k=null);const O=Array.from({length:30},(A,B)=>`${B+1}`),C=A=>{const B=Math.sin(A*127.1+311.7)*43758.5;return B-Math.floor(B)},D=O.map((A,B)=>+(Ht*(.84+C(B)*.32)).toFixed(9)),I=O.map((A,B)=>B<Ct?"#1570ef":"#e9ecf2"),L=O.map((A,B)=>B<Ct?"#1570ef":"#d0d5dd");I[Ct-1]="#087443",L[Ct-1]="#087443",k=new ye(y.value,{type:"bar",data:{labels:O,datasets:[{data:D,backgroundColor:I,borderColor:L,borderWidth:0,borderRadius:3,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:600,easing:"easeOutCubic"},plugins:{legend:{display:!1},tooltip:{callbacks:{title:A=>`ÐÐµÐ½Ñ ${A[0]?.label??""}`,label:A=>{const B=A.raw.toFixed(8),G=(A.raw*bs).toFixed(2);return[`${B} BTC`,`â $${G}`]}},backgroundColor:"#101828",titleColor:"#fff",bodyColor:"#d0d5dd",padding:10,cornerRadius:8,displayColors:!1}},scales:{x:{grid:{display:!1},border:{display:!1},ticks:{color:"#98a2b3",font:{size:9,family:"inherit"},maxTicksLimit:10}},y:{grid:{color:"#f2f4f7"},border:{display:!1,dash:[3,3]},ticks:{color:"#98a2b3",font:{size:9,family:"inherit"},maxTicksLimit:4,callback:A=>`${Number(A).toFixed(7)}`}}}}})},M=()=>{e("activate")};return Lt(()=>{v(),b(),Qt(()=>{S()})}),we(()=>{m&&clearInterval(m),g&&clearInterval(g),k&&k.destroy()}),(O,C)=>{const D=Ts,I=Je;return w(),T("div",df,[h("div",hf,[h("div",uf,[W(D),h("h1",ff,x(_(i)("pages.tbb_trial_mining")),1)]),C[0]||(C[0]=h("span",{class:"tmd__pill tmd__pill--green"},[h("span",{class:"tmd__pill-dot"}),$(" ÐÐÐÐÐТ ")],-1))]),h("div",_f,[h("div",mf,[h("div",gf,x(_(i)("tbb.hero_accumulated_btc")),1),h("div",pf,[h("span",bf,x(_(u)),1),C[1]||(C[1]=h("span",{class:"tmd__hero-stat-unit"},"BTC",-1))]),h("div",vf,"â $"+x(_(f)),1)]),C[4]||(C[4]=h("div",{class:"tmd__hero-divider"},null,-1)),h("div",xf,[h("div",yf,[C[2]||(C[2]=h("span",{class:"tmd__live-badge"},"â LIVE",-1)),$(" "+x(_(i)("tbb.hero_today")),1)]),h("div",wf,x(_(n)),1),h("div",kf,x(_(o))+x(_(i)("tbb.per_day")),1)]),C[5]||(C[5]=h("div",{class:"tmd__hero-divider"},null,-1)),h("div",Mf,[h("div",Sf,x(_(i)("tbb.hero_day")),1),h("div",{class:"tmd__hero-stat-val"},[$(x(Ct)),C[3]||(C[3]=h("span",{class:"tmd__hero-stat-unit"},"/30",-1))]),h("div",Tf,x(ps)+"% "+x(_(i)("tbb.hero_completed")),1)])]),h("div",Cf,[h("div",Pf,[h("div",{class:"tmd__prog-fill",style:It({width:ps+"%"})},null,4),h("div",{class:"tmd__prog-marker",style:It({left:ps+"%"})},[...C[6]||(C[6]=[h("div",{class:"tmd__prog-marker-dot"},null,-1)])],4)]),C[7]||(C[7]=h("div",{class:"tmd__prog-ticks"},[h("span",null,"1"),h("span",null,"10"),h("span",null,"20"),h("span",null,"30")],-1))]),h("div",Of,[h("div",Df,[h("div",null,[h("div",If,x(_(i)("tbb.chart_title")),1),h("div",Af,x(_(i)("tbb.chart_sub")),1)]),h("div",Bf,[h("span",Lf,x(_(i)("tbb.chart_leg_done")),1),h("span",$f,x(_(i)("tbb.chart_leg_future")),1)])]),h("div",Ff,[h("canvas",{ref_key:"chartCanvas",ref:y,class:"tmd__chart-canvas"},null,512)]),h("div",Rf,[h("span",null,[$(x(_(i)("tbb.chart_footer_total",{days:Ct}))+" ",1),h("strong",null,x(_(r))+" BTC",1)]),h("span",null,[$(x(_(i)("tbb.chart_footer_cycle"))+" ",1),h("strong",null,x(_(a))+" BTC",1)])])]),h("div",Ef,[h("div",zf,[h("div",Vf,[h("div",null,[h("div",Nf,x(_(i)("tbb.miner_name")),1),h("div",jf,x(_(i)("tbb.miner_loc_step2")),1)])]),C[8]||(C[8]=Cs('<div class="tmd__status-metrics" data-v-bf7d1257><div class="tmd__status-metric" data-v-bf7d1257><span class="tmd__status-metric-val tmd__status-metric-val--gr" data-v-bf7d1257>270</span><span class="tmd__status-metric-unit" data-v-bf7d1257>TH/s</span></div><div class="tmd__status-sep" data-v-bf7d1257></div><div class="tmd__status-metric" data-v-bf7d1257><span class="tmd__status-metric-dot" data-v-bf7d1257></span><span class="tmd__status-metric-lbl" data-v-bf7d1257>Online</span></div></div>',1))]),h("div",Wf,[(w(!0),T(Y,null,rt(_(p),(L,A)=>(w(),T("div",{key:A,class:"tmd__hashrate-bar",style:It({height:L+"%",animationDelay:A*60+"ms"})},null,4))),128))])]),h("div",Hf,[h("div",Uf,[$(x(_(i)("tbb.cta_text_demo")),1),h("strong",null,x(_(i)("tbb.cta_text_bold_demo")),1)]),W(I,{variant:"orange",class:"tmd__cta-btn",onClick:M},{default:ct(()=>[$(x(_(i)("pages.tbb_activate")),1)]),_:1})])])}}}),Kf=Object.assign(J(Yf,[["__scopeId","data-v-bf7d1257"]]),{__name:"TBBTrialMiningLiveDemo"}),Xf={class:"trial-mining"}
4,qf=Z({__name:"TrialMiningWelcomeDemo",setup(s){const t=j(!1),e=()=>{t.value=!0};return(i,n)=>{const o=Io,a=Kf;return w(),T(Y,null,[W(o,{"is-visible":_(t),"onUpdate:isVisible":n[0]||(n[0]=r=>t.value=r)},null,8,["is-visible"]),h("div",Xf,[W(a,{onActivate:e})])],64)}}}),Gf=Object.assign(qf,{__name:"TBBTrialMiningWelcomeDemo"}),Zf={style:{position:"relative",width:"100%",height:"100%"}},b_=Z({__name:"trial-mining",setup(s){const t=Ps(),i=Mo().get("tbb_activate"),n=i!=null,o=j(n?i==="1":!1),a=j(n&&t.isAuthenticated);return Kt(()=>t.isLoad,r=>{!r&&t.isAuthenticated&&(o.value=t.activate,a.value=!0)},{immediate:!0}),(r,l)=>{const c=tr,d=cf,u=Gf;return w(),T("div",Zf,[_(a)?(w(),T(Y,{key:0},[_(o)!==!1?(w(),Q(c,{key:0})):(w(),Q(d,{key:1}))],64)):R("",!0),!_(t).isAuthenticated&&!_(t).isLoad?(w(),Q(u,{key:1})):R("",!0)])}}});export{b_ as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.