PageSourceSearch

https://xmacna.ai/_nuxt/bG5zjCEI.js

js xmacna.ai collected 2026-10-05 13:24:33 UTC 244,569 bytes, 18 lines download raw bytes

1var ro=Object.defineProperty;var lo=(s,t,e)=>t in s?ro(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var F=(s,t,e)=>lo(s,typeof t!="symbol"?t+"":t,e);import{_ as ns}from"./osqaVy29.js";import{_ as co}from"./DhvmxAeg.js";import{_ as ho}from"./BbcwGbeQ.js";import{_ as uo}from"./Dgs6hFTu.js";import{s as V,H as Jt,G as ie,k as X,R as ht,a as os,b as B,o as E,e as f,y as qs,f as zt,A as L,aa as fo,z as Y,t as z,n as it,F as ws,h as go,g as qt,w as po,ao as mo,d as dn,ap as hn,a2 as Ms,aq as bo,I as xo,a0 as Ss,ar as un,a1 as yo,Q as cs,v as _o,U as Te,B as ds}from"./Bcc8-a-q.js";import{u as ut}from"./_bZiThFm.js";import"./9pjYCGkJ.js";import"./CfUektVg.js";import"./CdE3OqS9.js";import"./BZqjWkfA.js";import"./oaYCrmSY.js";import"./D3ZPBIcn.js";import"./0TAyzOoh.js";function vo(s){console.log("useAllBotClients chamado com dateRange:",s);const t=V(s||{startDate:void 0,endDate:void 0}),e=V(50),i=V(1),n=V(!0),o=()=>{try{const p=new Date,m=p.getFullYear(),b=String(p.getMonth()+1).padStart(2,"0"),x=String(p.getDate()).padStart(2,"0");return`${m}-${b}-${x}`}catch(p){return console.error("Erro ao gerar data de hoje:",p),"2023-01-01"}},a=p=>p?/^\d{4}-\d{2}-\d{2}$/.test(p)?p:(console.error(`Data inválida: ${p}, usando data de hoje`),o()):o(),r=o(),l=V([]),c=V(!0),d=V(null),h=async(p,m=!0)=>{var P,C,S,v,y;c.value=!0,d.value=null,m&&(i.value=1,l.value=[]),p&&(t.value=p);const b=a((P=t.value)==null?void 0:P.startDate)||r,x=a((C=t.value)==null?void 0:C.endDate)||r;let w,D;(S=t.value)!=null&&S.formattedStartDate?w=t.value.formattedStartDate:w=`${b}T00:00:00`,(v=t.value)!=null&&v.formattedEndDate?D=t.value.formattedEndDate:D=`${x}T23:59:59.999`,console.log(`AllBotClients: Filtrando por período: ${b} até ${x}`),console.log(`AllBotClients com horários precisos: ${w} até ${D}`),console.log(`Página: ${i.value}, Limite: ${e.value}`);try{console.log("Buscando total geral de interações...");const M=await ut(ht("bo_interacao_botclient",{aggregate:{count:["*"]},filter:{created_at_brasilia:{_between:[w,D]}}}));if(M&&Array.isArray(M)&&M.length>0){const I=(y=M[0])==null?void 0:y.count;I&&console.log(`Total de interações no período: ${I}`)}console.log("Buscando total de interações por botclient...");const _=await ut(ht("bo_interacao_botclient",{aggregate:{count:["*"],sum:["char_count"]},filter:{created_at_brasilia:{_between:[w,D]}},groupBy:["bot_client_id"],fields:["bot_client_id"],sort:["-count"],limit:e.value,page:i.value}));console.log("Buscando total de chats por botclient...");const T=await ut(ht("bo_chat",{aggregate:{count:["*"]},filter:{date_created_brasilia:{_between:[w,D]}},groupBy:["bo_botclient_id"],fields:["bo_botclient_id"],sort:["-count"]})),k={};Array.isArray(T)&&T.length>0&&T.forEach(I=>{let A=null;typeof I.bo_botclient_id=="object"&&I.bo_botclient_id!==null?A=I.bo_botclient_id.id:typeof I.bo_botclient_id=="string"&&(A=I.bo_botclient_id);const $=I.count||0;A&&(k[A]=$)});const O=[];if(Array.isArray(_)&&_.length>0){console.log(`Encontradas ${_.length} entradas com interações.`),n.value=_.length===e.value;const I=_.map(A=>typeof A.bot_client_id=="object"&&A.bot_client_id!==null?A.bot_client_id.id:typeof A.bot_client_id=="string"?A.bot_client_id:null).filter(A=>A!==null);if(I.length>0){const A=await ut(ht("bo_botclient",{fields:["id","descricao","identificador","status"],filter:{id:{_in:I}}})),$={};if(Array.isArray(A)&&A.forEach(R=>{$[R.id]=R}),_.forEach(R=>{let q=null,dt=0,K=0;if(typeof R.bot_client_id=="object"&&R.bot_client_id!==null?q=R.bot_client_id.id:typeof R.bot_client_id=="string"&&(q=R.bot_client_id),R.count&&(dt=R.count),R.sum&&R.sum.char_count&&(K=R.sum.char_count),q&&$[q]){const G=$[q];O.push({id:G.id,descricao:G.descricao,identificador:G.identificador,status:G.status,interaction_count:dt,chat_count:k[q]||0,custo_por_interacao:.33,total_caracteres:K,ultima_interacao:null,cliente_id:null})}}),O.sort((R,q)=>q.interaction_count-R.interaction_count),O.length>0)try{const R=O.map(K=>K.id);console.log("Buscando últimas interações para cada botclient...");const q=R.map(async K=>{const G=await ut(ht("bo_interacao_botclient",{fields:["id","created_at_brasilia","client_id"],filter:{bot_client_id:{_eq:K},created_at_brasilia:{_between:[w,D]}}
1,sort:["-created_at_brasilia"],limit:1}));return Array.isArray(G)&&G.length>0?{botClientId:K,ultima_interacao:G[0].created_at_brasilia,cliente_id:G[0].client_id}:{botClientId:K,ultima_interacao:null,cliente_id:null}}),dt=await Promise.all(q);O.forEach(K=>{const G=dt.find(Mt=>Mt.botClientId===K.id);G&&(K.ultima_interacao=G.ultima_interacao,K.cliente_id=G.cliente_id)}),console.log("Dados adicionais de interações carregados com sucesso")}catch(R){console.error("Erro ao buscar dados adicionais de interações:",R)}}}else n.value=!1,console.log("Nenhuma interação encontrada.");if(m?l.value=O:l.value=[...l.value,...O],console.log(`Processamento concluído. ${l.value.length} botclients processados.`),i.value===1&&O.length===0){const I=await ut(ht("bo_botclient",{fields:["id","descricao","identificador","status"],sort:["descricao"],limit:e.value}));if(Array.isArray(I)&&I.length>0){const A=I.map($=>({...$,interaction_count:0,chat_count:k[$.id]||0,custo_por_interacao:.33,total_caracteres:0,ultima_interacao:null,cliente_id:null}));l.value=A,n.value=A.length===e.value,console.log(`Encontrados ${A.length} botclients sem interações.`)}}}catch(M){console.error("Erro ao buscar botclients e interações:",M),d.value=M,n.value=!1}finally{c.value=!1}},u=async()=>{n.value&&!c.value&&(i.value++,await h(t.value,!1))};Jt(()=>{h(s)}),s&&ie(()=>[s.startDate,s.endDate],()=>{console.log("dateRange mudou para:",s),h(s)},{deep:!0});const g=async()=>{await h(t.value)};return{data:X(()=>l.value),pending:X(()=>c.value),error:X(()=>d.value),hasMore:X(()=>n.value),loadMore:u,refresh:g}}const ko={class:"chart-card transform hover:-translate-y-1 transition-all duration-300"},wo={class:"mb-4"},Mo={class:"relative"},So={class:"absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none"},Do={key:0,class:"flex justify-center items-center py-6"},Co={key:1,class:"bg-red-50 dark:bg-red-900/20 p-4 rounded-xl text-red-600 dark:text-red-400 text-sm border border-red-200 dark:border-red-800"},Po={class:"flex items-center"},To={key:2,class:"empty-data-state flex flex-col items-center justify-center my-6 py-8"},Ao={class:"text-base text-gray-600 dark:text-gray-400 mb-2"},Oo={key:0,class:"text-sm text-amber-600 dark:text-amber-400 mb-4"},Io={class:"flex flex-wrap gap-3 mt-2"},Lo=["disabled"],Fo={key:0},Ro={key:1},$o={key:3,class:"card-content"}
1,zo={class:"overflow-x-auto custom-scrollbar rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm bg-white dark:bg-gray-800"},Bo={class:"min-w-full divide-y divide-gray-200 dark:divide-gray-700"},Eo={class:"bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-700"},Ho=["onClick"],jo={class:"px-3 py-4 whitespace-nowrap text-center text-sm font-bold text-amber-600 dark:text-amber-400"},No={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-200 font-medium"},Wo={class:"flex items-center"},Vo={class:"bg-amber-100 dark:bg-amber-900/30 p-2 rounded-lg mr-3"},Yo={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300"},Uo={class:"flex items-center"},Xo={class:"bg-indigo-100 dark:bg-indigo-900/30 p-2 rounded-lg mr-3"},Ko={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300"},qo={class:"flex items-center"},Go={class:"bg-emerald-100 dark:bg-emerald-900/30 p-2 rounded-lg mr-3"},Zo={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300"},Qo={class:"flex items-center font-medium"},Jo={class:"bg-green-100 dark:bg-green-900/30 p-2 rounded-lg mr-3"},ta={class:"text-green-600 dark:text-green-400"},ea={class:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-600 dark:text-gray-300"},sa=["onClick"],ia={class:"bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700"},na={colspan:"6",class:"px-6 py-4"},oa={class:"grid grid-cols-2 md:grid-cols-3 gap-4"},aa={class:"stat-card bg-white dark:bg-gray-700 p-4 rounded-xl shadow-sm border border-gray-200 dark:border-gray-600"},ra={class:"text-sm text-gray-800 dark:text-gray-200"},la={class:"stat-card bg-white dark:bg-gray-700 p-4 rounded-xl shadow-sm border border-gray-200 dark:border-gray-600"},ca={class:"text-sm text-gray-800 dark:text-gray-200"},da={class:"stat-card bg-white dark:bg-gray-700 p-4 rounded-xl shadow-sm border border-gray-200 dark:border-gray-600"},ha={class:"flex items-center space-x-2"},ua={class:"bg-blue-100 dark:bg-blue-900/30 p-1.5 rounded-lg"},fa={class:"text-sm text-blue-600 dark:text-blue-400 font-medium"},ga={class:"stat-card bg-white dark:bg-gray-700 p-4 rounded-xl shadow-sm border border-gray-200 dark:border-gray-600"},pa={class:"flex items-center space-x-2"},ma={class:"bg-indigo-100 dark:bg-indigo-900/30 p-1.5 rounded-lg"},ba={class:"text-sm text-indigo-600 dark:text-indigo-400 font-medium"},xa={class:"stat-card bg-white dark:bg-gray-700 p-4 rounded-xl shadow-sm border border-gray-200 dark:border-gray-600"},ya={class:"flex items-center space-x-2"},_a={class:"bg-green-100 dark:bg-green-900/30 p-1.5 rounded-lg"},va={class:"text-sm text-green-600 dark:text-green-400 font-medium"},ka={class:"stat-card bg-white dark:bg-gray-700 p-4 rounded-xl shadow-sm border border-gray-200 dark:border-gray-600"},wa={class:"flex items-center space-x-2"},Ma={class:"bg-purple-100 dark:bg-purple-900/30 p-1.5 rounded-lg"},Sa={class:"text-sm text-purple-600 dark:text-purple-400 font-medium"},Da={class:"stat-card bg-white dark:bg-gray-700 p-4 rounded-xl shadow-sm border border-gray-200 dark:border-gray-600"},Ca={class:"flex items-center space-x-2"},Pa={class:"bg-amber-100 dark:bg-amber-900/30 p-1.5 rounded-lg"},Ta={class:"text-sm text-amber-600 dark:text-amber-400 font-medium truncate"},Aa={class:"stat-card bg-white dark:bg-gray-700 p-4 rounded-xl shadow-sm border border-gray-200 dark:border-gray-600"},Oa={class:"flex items-center space-x-2"},Ia={class:"stat-card bg-white dark:bg-gray-700 p-4 rounded-xl shadow-sm border border-gray-200 dark:border-gray-600"},La={class:"flex items-center space-x-2"},Fa={class:"bg-cyan-100 dark:bg-cyan-900/30 p-1.5 rounded-lg"},Ra={class:"text-sm text-cyan-600 dark:text-cyan-400 font-medium"},$a={class:"flex justify-between items-center mt-4"},za={class:"text-xs text-gray-500 dark:text-gray-400"},Ba={class:"flex flex-wrap gap-3"},Ea=["disabled"],Ha={key:0},ja={key:1},Na={__name:"AllBotClientsTable",props:{dateRange:{type:Object,default:()=>({startDate:null,endDate:null})}},setup(s,{expose:t}){const e=s,i=V(null),n=v=>{console.log("Alternando linha:",v,"Estado atual:",i.value===v?"aberto":"fechado"),i.value===v?i.value=null:i.value=v,console.log("Novo estado:",i.value===v?"aberto":"fechado")},o=V(!1),a=V(""),r=V(null),l=X(()=>
1{if(!h.value||!h.value.length)return[];if(!a.value)return h.value;const v=a.value.toLowerCase().trim();return h.value.filter(y=>{const M=(y.descricao||"").toLowerCase(),_=(y.identificador||"").toLowerCase();return M.includes(v)||_.includes(v)})}),c=()=>{clearTimeout(r.value),r.value=setTimeout(()=>{i.value=null},300)},d=()=>{a.value="",i.value=null},{data:h,pending:u,error:g,hasMore:p,loadMore:m,refresh:b}=vo(e.dateRange),x=async()=>{if(!o.value&&p.value&&!u.value){o.value=!0,console.log("Carregando mais funcionários digitais...");try{await m(),console.log(`Carregados mais funcionários digitais. Total: ${h.length}`)}catch(v){console.error("Erro ao carregar mais funcionários digitais:",v)}finally{o.value=!1}}else console.log(`Não é possível carregar mais: loadingMore=${o.value}, hasMore=${p.value}, pending=${u.value}`)},w=v=>new Intl.NumberFormat("pt-BR").format(v),D=v=>{if(!v.chat_count||v.chat_count===0)return"0";const y=v.interaction_count/v.chat_count;return new Intl.NumberFormat("pt-BR",{minimumFractionDigits:1,maximumFractionDigits:1}).format(y)},P=v=>v==null?"R$ 0,00":new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL",minimumFractionDigits:2,maximumFractionDigits:2}).format(v),C=v=>{if(!v)return"Não disponível";try{const y=new Date(v);return new Intl.DateTimeFormat("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(y)}catch(y){return console.error("Erro ao formatar data:",y),"Formato inválido"}},S=v=>{if(!v.total_caracteres||!v.interaction_count||v.interaction_count===0)return"0";const y=v.total_caracteres/v.interaction_count;return new Intl.NumberFormat("pt-BR",{maximumFractionDigits:0}).format(y)};return t({refresh:b}),(v,y)=>{var _,T;const M=ns;return E(),B("div",ko,[y[19]||(y[19]=f("div",{class:"absolute top-0 left-0 w-full h-2 bg-gradient-to-r from-amber-400 via-amber-600 to-amber-500 opacity-80"},null,-1)),y[20]||(y[20]=f("div",{class:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-bl from-amber-500/20 to-transparent rounded-full transform -translate-y-1/2 translate-x-1/2 blur-xl"},null,-1)),y[21]||(y[21]=f("div",{class:"card-header mb-4"},[f("h2",{class:"text-xl font-bold text-gray-800 dark:text-gray-100"},"Funcionários Digitais")],-1)),f("div",wo,[f("div",Mo,[f("div",So,[L(M,{name:"i-heroicons-magnifying-glass",class:"w-5 h-5 text-gray-500 dark:text-gray-400"})]),qs(f("input",{type:"search","onUpdate:modelValue":y[0]||(y[0]=k=>a.value=k),class:"bg-gray-50 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 text-sm rounded-lg focus:ring-amber-500 focus:border-amber-500 block w-full ps-10 p-2.5",placeholder:"Buscar funcionário digital...",onInput:c},null,544),[[fo,a.value]]),a.value?(E(),B("button",{key:0,onClick:d,class:"absolute inset-y-0 end-0 flex items-center pe-3"},[L(M,{name:"i-heroicons-x-circle",class:"w-5 h-5 text-gray-500 dark:text-gray-400 hover:text-amber-500 dark:hover:text-amber-400"})])):zt("",!0)])]),Y(u)&&!((_=l.value)!=null&&_.length)?(E(),B("div",Do,y[3]||(y[3]=[f("div",{class:"typing-indicator mx-auto"},[f("span"),f("span"),f("span")],-1)]))):Y(g)?(E(),B("div",Co,[f("div",Po,[y[4]||(y[4]=f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5 mr-2 text-red-500"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})],-1)),f("p",null,z(Y(g).message),1)])])):(T=l.value)!=null&&T.length?(E(),B("div",$o,[f("div",zo,[f("table",Bo,[y[17]||(y[17]=f("thead",{class:"bg-gray-50 dark:bg-gray-800"},[f("tr",null,[f("th",{scope:"col",class:"px-3 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider w-12"},"#"),f("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"},"Funcionário Digital"),f("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"},"Total Interações"),f("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"},"Total Chats"),f("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"},"Custo Total"),f("th",{scope:"col",class:"px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider w-24"},"Detalhes")])],-1)),f("tbody",Eo,[(E(!0),B(ws,null,go(l.value,(k,O)=>(E(),B(ws,{key:k.id},[f("tr",{class:it({"hover:bg-gray-50 dark:hover:bg-gray-800 cursor-pointer transition-colors duration-150":!0,"bg-gray-50 dark:bg-gray-800":i.value===O}),onClick:I=>n(O)},[f("td",jo,z(O+1),1),f("td",No,[f("div",Wo,[f("div",Vo,[L(M,{name:"i-heroicons-user-circle",class:"w-5 h-5 text-amber-600 dar
1k:text-amber-400"})]),qt(" "+z(k.descricao||"Sem descrição"),1)])]),f("td",Yo,[f("div",Uo,[f("div",Xo,[L(M,{name:"i-heroicons-chat-bubble-left-right",class:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})]),qt(" "+z(w(k.interaction_count||0)),1)])]),f("td",Ko,[f("div",qo,[f("div",Go,[L(M,{name:"i-heroicons-chat-bubble-oval-left",class:"w-5 h-5 text-emerald-600 dark:text-emerald-400"})]),qt(" "+z(w(k.chat_count||0)),1)])]),f("td",Zo,[f("div",Qo,[f("div",Jo,[L(M,{name:"i-heroicons-banknotes",class:"w-5 h-5 text-green-600 dark:text-green-400"})]),f("span",ta,z(P(k.custo_por_interacao!==null?k.custo_por_interacao*k.interaction_count:null)),1)])]),f("td",ea,[f("button",{onClick:po(I=>n(O),["stop"]),class:"bg-gray-100 dark:bg-gray-700 hover:bg-amber-100 dark:hover:bg-amber-800/30 p-2 rounded-lg transition-colors duration-200"},[L(M,{name:i.value===O?"i-heroicons-chevron-up":"i-heroicons-chevron-down",class:"w-5 h-5 text-gray-600 dark:text-gray-300"},null,8,["name"])],8,sa)])],10,Ho),qs(f("tr",ia,[f("td",na,[f("div",oa,[f("div",aa,[y[8]||(y[8]=f("div",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1"},"ID",-1)),f("div",ra,z(k.id),1)]),f("div",la,[y[9]||(y[9]=f("div",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1"},"Identificador",-1)),f("div",ca,z(k.identificador||"Não definido"),1)]),f("div",da,[y[10]||(y[10]=f("div",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1"},"Última Interação",-1)),f("div",ha,[f("div",ua,[L(M,{name:"i-heroicons-clock",class:"w-4 h-4 text-blue-600 dark:text-blue-400"})]),f("div",fa,z(C(k.ultima_interacao)),1)])]),f("div",ga,[y[11]||(y[11]=f("div",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1"},"Interações por Chat",-1)),f("div",pa,[f("div",ma,[L(M,{name:"i-heroicons-calculator",class:"w-4 h-4 text-indigo-600 dark:text-indigo-400"})]),f("div",ba,z(D(k)),1)])]),f("div",xa,[y[12]||(y[12]=f("div",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1"},"Custo por Interação",-1)),f("div",ya,[f("div",_a,[L(M,{name:"i-heroicons-currency-dollar",class:"w-4 h-4 text-green-600 dark:text-green-400"})]),f("div",va,z(P(k.custo_por_interacao)),1)])]),f("div",ka,[y[13]||(y[13]=f("div",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1"},"Contagem de Caracteres",-1)),f("div",wa,[f("div",Ma,[L(M,{name:"i-heroicons-document-text",class:"w-4 h-4 text-purple-600 dark:text-purple-400"})]),f("div",Sa,z(w(k.total_caracteres||0)),1)])]),f("div",Da,[y[14]||(y[14]=f("div",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1"},"ID Cliente",-1)),f("div",Ca,[f("div",Pa,[L(M,{name:"i-heroicons-identification",class:"w-4 h-4 text-amber-600 dark:text-amber-400"})]),f("div",Ta,z(k.cliente_id||"Não identificado"),1)])]),f("div",Aa,[y[15]||(y[15]=f("div",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1"},"Status",-1)),f("div",Oa,[f("div",{class:it(`p-1.5 rounded-lg ${k.status==="Ativo"||!k.status?"bg-emerald-100 dark:bg-emerald-900/30":"bg-red-100 dark:bg-red-900/30"}`)},[L(M,{name:k.status==="Ativo"||!k.status?"i-heroicons-check-circle":"i-heroicons-x-circle",class:it(`w-4 h-4 ${k.status==="Ativo"||!k.status?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400"}`)},null,8,["name","class"])],2),f("div",{class:it(`text-sm font-medium ${k.status==="Ativo"||!k.status?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400"}`)},z(k.status||"Ativo"),3)])]),f("div",Ia,[y[16]||(y[16]=f("div",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1"},"Média de Caracteres",-1)),f("div",La,[f("div",Fa,[L(M,{name:"i-heroicons-chart-bar",class:"w-4 h-4 text-cyan-600 dark:text-cyan-400"})]),f("div",Ra,z(S(k)),1)])])])])],512),[[mo,i.value===O]])],64))),128))])])]),f("div",$a,[f("div",za," Mostrando "+z(l.value.length)+" "+z(a.value?"de "+Y(h).length:"")+" Funcionários Digitais ",1),f("div",Ba,[Y(p)?(E(),B("button",{key:0,onClick:x,disabled:o.value||Y(u),class:"px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors duration-200 flex items-center space-x-2"},[L(M,{name:o.value?"i-heroicons-arrow-path":"i-heroicons-plus",class:it(["w-4 h-4",{"animate-spin":o.value}])},null,8,["name","class"]),o.value?(E(),B("span",ja,"Carregando...")):(E(),B("span",Ha,"Carregar mais"))],8,Ea)):zt("",!0),f("button",{onClick:y[2]||(y[2]=(...k)=>Y(b)&&Y(b)(...k)),class:"px-4 py-2 bg-amber-600 hover:bg-amber-700 text-white rounded-lg text-sm transition-colors duration-200 flex items-center space-x-2"},[L(M,{name:"i-heroicons-arrow-path",class:"w-4 h-4 group-hover:rotate-180 transition-transform duration-300"}),y[18]||(y[18]=f("span",null,"Atualizar",-1))])])])])):(E(),B("div",To,[y[7]||(y[7]=f("div",{class:"empty-icon-container mb-3"},[f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-8 h-8 text-gray-500"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"})])],-1)),f("div",Ao,z(a.value?"Nenhum Funcionário Digital encontrado para sua busca":"Nenhum Funcionário Digital encontrado para o período selecionado"),1),a.value&&Y(h).length>0?(E(),B("div",Oo," Deseja expandir sua busca? Carregue mais funcionários digitais para ampliar os resultados. ")):zt("",!0),f("div",Io,[Y(p)?(E(),B("button",{key:0,onClick:x,disabled:o.value||Y(u),class:"px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors duration-200 flex items-center space-x-2"},[L(M,{name:o.value?"i-heroicons-arrow-path":"i-heroicons-plus",class:it(["w-4 h-4",{"animate-spin":o.value}])},null,8,["name","class"]),o.value?(E(),B("span",Ro,"Carregando...")):(E(),B("span",Fo,"Carregar mais funcionários"))],8,Lo)):zt("",!0),a.value?(E(),B("button",{key:1,onClick:d,class:"px-4 py-2 bg-amber-600 hover:bg-amber-700 text-white rounded-lg text-sm transition-colors duration-200 flex items-center space-x-2"},[L(M,{name:"i-heroicons-x-mark",class:"w-4 h-4"}),y[5]||(y[5]=f("span",null,"Limpar busca",-1))])):zt("",!0),a.value?zt("",!0):(E(),B("button",{key:2,onClick:y[1]||(y[1]=(...k)=>Y(b)&&Y(b)(...k)),class:"px-4 py-2 bg-amber-600 hover:bg-amber-700 text-white rounded-lg text-sm transition-colors duration-200 flex items-center space-x-2"},[L(M,{name:"i-heroicons-arrow-path",class:"w-4 h-4"}),y[6]||(y[6]=f("span",null,"Atualizar",-1))]))])]))])}}},Wa=os(Na,[["__scopeId","data-v-5059de2a"]]);/*!
2 * @kurkle/color v0.3.4
3 * https://github.com/kurkle/color#readme
4 * (c) 2024 Jukka Kurkela
5 * Released under the MIT License
6 */function Pe(s){return s+.5|0}const Ct=(s,t,e)=>Math.max(Math.min(s,e),t);function ue(s){return Ct(Pe(s*2.55),0,255)}function Tt(s){return Ct(Pe(s*255),0,255)}function wt(s){return Ct(Pe(s/2.55)/100,0,1)}function Gs(s){return Ct(Pe(s*100),0,100)}const at={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},Ds=[..."0123456789ABCDEF"],Va=s=>Ds[s&15],Ya=s=>Ds[(s&240)>>4]+Ds[s&15],Ae=s=>(s&240)>>4===(s&15),Ua=s=>Ae(s.r)&&Ae(s.g)&&Ae(s.b)&&Ae(s.a);function Xa(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&at[s[1]]*17,g:255&at[s[2]]*17,b:255&at[s[3]]*17,a:t===5?at[s[4]]*17:255}:(t===7||t===9)&&(e={r:at[s[1]]<<4|at[s[2]],g:at[s[3]]<<4|at[s[4]],b:at[s[5]]<<4|at[s[6]],a:t===9?at[s[7]]<<4|at[s[8]]:255})),e}const Ka=(s,t)=>s<255?t(s):"";function qa(s){var t=Ua(s)?Va:Ya;return s?"#"+t(s.r)+t(s.g)+t(s.b)+Ka(s.a,t):void 0}const Ga=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function fn(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 Za(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 Qa(s,t,e){const i=fn(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 Ja(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 Fs(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=Ja(e,i,n,d,o),l=l*60+.5),[l|0,c||0,r]}function Rs(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(Tt)}function $s(s,t,e){return Rs(fn,s,t,e)}function tr(s,t,e){return Rs(Qa,s,t,e)}function er(s,t,e){return Rs(Za,s,t,e)}function gn(s){return(s%360+360)%360}function sr(s){const t=Ga.exec(s);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?ue(+t[5]):Tt(+t[5]));const n=gn(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=tr(n,o,a):t[1]==="hsv"?i=er(n,o,a):i=$s(n,o,a),{r:i[0],g:i[1],b:i[2],a:e}}function ir(s,t){var e=Fs(s);e[0]=gn(e[0]+t),e=$s(e),s.r=e[0],s.g=e[1],s.b=e[2]}function nr(s){if(!s)return;const t=Fs(s),e=t[0],i=Gs(t[1]),n=Gs(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${wt(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}const Zs={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"},Qs={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",K
vendor: 5,183 bytes, lines 6-11
6ocTate:"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 or(){const s={},t=Object.keys(Qs),e=Object.keys(Zs);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,Zs[o]);o=parseInt(Qs[a],16),s[r]=[o>>16&255,o>>8&255,o&255]}return s}let Oe;function ar(s){Oe||(Oe=or(),Oe.transparent=[0,0,0,0]);const t=Oe[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const rr=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function lr(s){const t=rr.exec(s);let e=255,i,n,o;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?ue(a):Ct(a*255,0,255)}return i=+t[1],n=+t[3],o=+t[5],i=255&(t[2]?ue(i):Ct(i,0,255)),n=255&(t[4]?ue(n):Ct(n,0,255)),o=255&(t[6]?ue(o):Ct(o,0,255)),{r:i,g:n,b:o,a:e}}}function cr(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${wt(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}const hs=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,Xt=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function dr(s,t,e){const i=Xt(wt(s.r)),n=Xt(wt(s.g)),o=Xt(wt(s.b));return{r:Tt(hs(i+e*(Xt(wt(t.r))-i))),g:Tt(hs(n+e*(Xt(wt(t.g))-n))),b:Tt(hs(o+e*(Xt(wt(t.b))-o))),a:s.a+e*(t.a-s.a)}}function Ie(s,t,e){if(s){let i=Fs(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=$s(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function pn(s,t){return s&&Object.assign(t||{},s)}function Js(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=Tt(s[3]))):(t=pn(s,{r:0,g:0,b:0,a:1}),t.a=Tt(t.a)),t}function hr(s){return s.charAt(0)==="r"?lr(s):sr(s)}class ve{constructor(t){if(t instanceof ve)return t;const e=typeof t;let i;e==="object"?i=Js(t):e==="string"&&(i=Xa(t)||ar(t)||hr(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=pn(this._rgb);return t&&(t.a=wt(t.a)),t}set rgb(t){this._rgb=Js(t)}rgbString(){return this._valid?cr(this._rgb):void 0}hexString(){return this._valid?qa(this._rgb):void 0}hslString(){return this._valid?nr(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=dr(this._rgb,t._rgb,e)),this}clone(){return new ve(this.rgb)}alpha(t){return this._rgb.a=Tt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Pe(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 ir(this._rgb,t),this}}/*!
7 * Chart.js v4.5.0
8 * https://www.chartjs.org
9 * (c) 2025 Chart.js Contributors
10 * Released under the MIT License
11 */function _t(){}const ur=(()=>{let s=0;return()=>s++})();function N(s){return s==null}function Q(s){if(Array.isArray&&Array.isArray(s))return!0;const t=Object.prototype.toString.call(s);
vendor: 4,236 bytes, line 11
11return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function j(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}function lt(s){return(typeof s=="number"||s instanceof Number)&&isFinite(+s)}function gt(s,t){return lt(s)?s:t}function H(s,t){return typeof s>"u"?t:s}const fr=(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 W(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(j(s))for(a=Object.keys(s),o=a.length,n=0;n<o;n++)t.call(e,s[a[n]],a[n])}function qe(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 Ge(s){if(Q(s))return s.map(Ge);if(j(s)){const t=Object.create(null),e=Object.keys(s),i=e.length;let n=0;for(;n<i;++n)t[e[n]]=Ge(s[e[n]]);return t}return s}function mn(s){return["__proto__","prototype","constructor"].indexOf(s)===-1}function gr(s,t,e,i){if(!mn(s))return;const n=t[s],o=e[s];j(n)&&j(o)?ke(n,o,i):t[s]=Ge(o)}function ke(s,t,e){const i=Q(t)?t:[t],n=i.length;if(!j(s))return s;e=e||{};const o=e.merger||gr;let a;for(let r=0;r<n;++r){if(a=i[r],!j(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 me(s,t){return ke(s,t,{merger:pr})}function pr(s,t,e){if(!mn(s))return;const i=t[s],n=e[s];j(i)&&j(n)?me(i,n):Object.prototype.hasOwnProperty.call(t,s)||(t[s]=Ge(n))}const ti={"":s=>s,x:s=>s.x,y:s=>s.y};function mr(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 br(s){const t=mr(s);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function te(s,t){return(ti[t]||(ti[t]=br(t)))(s)}function zs(s){return s.charAt(0).toUpperCase()+s.slice(1)}const we=s=>typeof s<"u",At=s=>typeof s=="function",ei=(s,t)=>{if(s.size!==t.size)return!1;for(const e of s)if(!t.has(e))return!1;return!0};function xr(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}const J=Math.PI,bt=2*J,yr=bt+J,Ze=Number.POSITIVE_INFINITY,_r=J/180,ft=J/2,Lt=J/4,si=J*2/3,bn=Math.log10,xt=Math.sign;function be(s,t,e){return Math.abs(s-t)<e}function ii(s){const t=Math.round(s);s=be(s,t,s/1e3)?t:s;const e=Math.pow(10,Math.floor(bn(s))),i=s/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function vr(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 kr(s){return typeof s=="symbol"||typeof s=="object"&&s!==null&&!(Symbol.toPrimitive in s||"toString"in s||"valueOf"in s)}function Me(s){return!kr(s)&&!isNaN(parseFloat(s))&&isFinite(s)}function wr(s,t){const e=Math.round(s);return e-t<=s&&e+t>=s}function Mr(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 Ht(s){return s*(J/180)}function Sr(s){return s*(180/J)}function ni(s){if(!lt(s))return;let t=1,e=0;for(;Math.round(s*t)/t!==s;)t*=10,e++;return e}function Dr(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*J&&(o+=bt),{angle:o,distance:n}}function Cs(s,t){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function Cr(s,t){return(s-t+yr)%bt-J}function Dt(s){return(s%bt+bt)%bt}function xn(s,t,e,i){const n=Dt(s),o=Dt(t),a=Dt(e),r=Dt(o-n),l=Dt(a-n),c=Dt(n-o),d=Dt(n-a);return n===o||n===a||i&&o===a||r>l&&c<d}function ot(s,t,e){return Math.max(t,Math.min(e,s))}function Pr(s){return ot(s,-32768,32767)}function jt(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 Nt=(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),Tr=(s,t,e)=>Bs(s,e,i=>s[i][t]>=e);function Ar(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 yn=["push","pop","shift","splice","unshift"];function Or(s,t){if(s._chartjs){s._chartjs.listeners.push(t);return}Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}
vendor: 4,681 bytes, line 11
11),yn.forEach(e=>{const i="_onData"+zs(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 oi(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)&&(yn.forEach(o=>{delete s[o]}),delete s._chartjs)}function _n(s){const t=new Set(s);return t.size===s.length?s:Array.from(t)}const vn=(function(){return typeof window>"u"?function(s){return s()}:window.requestAnimationFrame})();function kn(s,t){let e=[],i=!1;return function(...n){e=n,i||(i=!0,vn.call(window,()=>{i=!1,s.apply(t,e)}))}}function Ir(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}const Es=s=>s==="start"?"left":s==="end"?"right":"center",tt=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,Lr=(s,t,e,i)=>s===(i?"left":"right")?e:s==="center"?(t+e)/2:t;function Fr(s,t,e){const i=t.length;let n=0,o=i;if(s._sorted){const{iScale:a,vScale:r,_parsed:l}=s,c=s.dataset&&s.dataset.options?s.dataset.options.spanGaps:null,d=a.axis,{min:h,max:u,minDefined:g,maxDefined:p}=a.getUserBounds();if(g){if(n=Math.min(Nt(l,d,h).lo,e?i:Nt(t,d,a.getPixelForValue(h)).lo),c){const m=l.slice(0,n+1).reverse().findIndex(b=>!N(b[r.axis]));n-=Math.max(0,m)}n=ot(n,0,i-1)}if(p){let m=Math.max(Nt(l,a.axis,u,!0).hi+1,e?0:Nt(t,d,a.getPixelForValue(u),!0).hi+1);if(c){const b=l.slice(m-1).findIndex(x=>!N(x[r.axis]));m+=Math.max(0,b)}o=ot(m,n,i)-n}else o=i-n}return{start:n,count:o}}function Rr(s){const{xScale:t,yScale:e,_scaleRanges:i}=s,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return s._scaleRanges=n,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,n),o}const Le=s=>s===0||s===1,ai=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*bt/e)),ri=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*bt/e)+1,xe={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*ft)+1,easeOutSine:s=>Math.sin(s*ft),easeInOutSine:s=>-.5*(Math.cos(J*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=>Le(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=>Le(s)?s:ai(s,.075,.3),easeOutElastic:s=>Le(s)?s:ri(s,.075,.3),easeInOutElastic(s){return Le(s)?s:s<.5?.5*ai(s*2,.1125,.45):.5+.5*ri(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-xe.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?xe.easeInBounce(s*2)*.5:xe.easeOutBounce(s*2-1)*.5+.5};function Hs(s){if(s&&typeof s=="object"){const t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function li(s){return Hs(s)?s:new ve(s)}function us(s){return Hs(s)?s:new ve(s).saturate(.5).darken(.1).hexString()}const $r=["x","y","borderWidth","radius","tension"],zr=["color","borderColor","backgroundColor"];function Br(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:zr},numbers:{type:"number",properties:$r}}),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 Er(s){s.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ci=new Map;function Hr(s,t){t=t||{};const e=s+JSON.stringify(t);let i=ci.get(e);
vendor: 48,781 bytes, lines 11-16
11return i||(i=new Intl.NumberFormat(s,t),ci.set(e,i)),i}function wn(s,t,e){return Hr(t,e).format(s)}const jr={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=Nr(s,e)}const a=bn(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),wn(s,i,l)}};function Nr(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 Mn={formatters:jr};function Wr(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:Mn.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 Yt=Object.create(null),Ps=Object.create(null);function ye(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 fs(s,t,e){return typeof t=="string"?ke(ye(s,t),e):ke(ye(s,""),t)}class Vr{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={},this.hoverBackgroundColor=(i,n)=>us(n.backgroundColor),this.hoverBorderColor=(i,n)=>us(n.borderColor),this.hoverColor=(i,n)=>us(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 fs(this,t,e)}get(t){return ye(this,t)}describe(t,e){return fs(Ps,t,e)}override(t,e){return fs(Yt,t,e)}route(t,e,i,n){const o=ye(this,t),a=ye(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 j(l)?Object.assign({},c,l):H(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var Z=new Vr({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Br,Er,Wr]);function Yr(s){return!s||N(s.size)||N(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function di(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 Ft(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 hi(s,t){!t&&!s||(t=t||s.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,s.width,s.height),t.restore())}function Ts(s,t,e,i){Sn(s,t,e,i,null)}function Sn(s,t,e,i,n){let o,a,r,l,c,d,h,u;const g=t.pointStyle,p=t.rotation,m=t.radius;let b=(p||0)*_r;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){s.save(),s.translate(e,i),s.rotate(b),s.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),s.restore();return}if(!(isNaN(m)||m<=0)){switch(s.beginPath(),g){default:n?s.ellipse(e,i,n/2,m,0,0,bt):s.arc(e,i,m,0,bt),s.closePath();break;case"triangle":d=n?n/2:m,s.moveTo(e+Math.sin(b)*d,i-Math.cos(b)*m),b+=si,s.lineTo(e+Math.sin(b)*d,i-Math.cos(b)*m),b+=si,s.lineTo(e+Math.sin(b)*d,i-Math.cos(b)*m),s.closePath();break;case"rectRounded":c=m*.516,l=m-c,a=Math.cos(b+Lt)*l,h=Math.cos(b+Lt)*(n?n/2-c:l),r=Math.sin(b+Lt)*l,u=Math.sin(b+Lt)*(n?n/2-c:l),s.arc(e-h,i-r,c,b-J,b-ft),s.arc(e+u,i-a,c,b-ft,b),s.arc(e+h,i+r,c,b,b+ft),s.arc(e-u,i+a,c,b+ft,b+J),s.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,d=n?n/2:l,s.rect(e-d,i-l,2*d,2*l);break}b+=Lt;case"rectRot":h=Math.cos(b)*(n?n/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),s.moveTo(e-h,i-r),s.lineTo(e+u,i-a),s.lineTo(e+h,i+r),s.lineTo(e-u,i+a),s.closePath();break;case"crossRot":b+=Lt;case"cross":h=Math.cos(b)*(n?n/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),s.moveTo(e-h,i-r),s.lineTo(e+h,i+r),s.moveTo(e+u,i-a),s.lineTo(e-u,i+a);break;case"star":h=Math.cos(b)*(n?n/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),s.moveTo(e-h,i-r),s.lineTo(e+h,i+r),s.moveTo(e+u,i-a),s.lineTo(e-u,i+a),b+=Lt,h=Math.cos(b)*(n?n/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),s.moveTo(e-h,i-r),s.lineTo(e+h,i+r),s.moveTo(e+u,i-a),s.lineTo(e-u,i+a);break;case"line":a=n?n/2:Math.cos(b)*m,r=Math.sin(b)*m,s.moveTo(e-a,i-r),s.lineTo(e+a,i+r);break;case"dash":s.moveTo(e,i),s.lineTo(e+Math.cos(b)*(n?n/2:m),i+Math.sin(b)*m);break;case!1:s.closePath();break}s.fill(),t.borderWidth>0&&s.stroke()}}function Se(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 js(s,t){s.save(),s.beginPath(),s.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),s.clip()}function Ns(s){s.restore()}function Ur(s,t,e,i,n){if(!t)return s.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;s.lineTo(o,t.y),s.lineTo(o,e.y)}else n==="after"!=!!i?s.lineTo(t.x,e.y):s.lineTo(e.x,t.y);s.lineTo(e.x,e.y)}function Xr(s,t,e,i){if(!t)return s.lineTo(e.x,e.y);s.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Kr(s,t){t.translation&&s.translate(t.translation[0],t.translation[1]),N(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 qr(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 Gr(s,t){const e=s.fillStyle;s.fillStyle=t.color,s.fillRect(t.left,t.top,t.width,t.height),s.fillStyle=e}function De(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,Kr(s,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&Gr(s,o.backdrop),r&&(o.strokeColor&&(s.strokeStyle=o.strokeColor),N(o.strokeWidth)||(s.lineWidth=o.strokeWidth),s.strokeText(c,e,i,o.maxWidth)),s.fillText(c,e,i,o.maxWidth),qr(s,e,i,c,o),i+=Number(n.lineHeight);s.restore()}function Qe(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*J,J,!0),s.lineTo(e,i+o-a.bottomLeft),s.arc(e+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,J,ft,!0),s.lineTo(e+n-a.bottomRight,i+o),s.arc(e+n-a.bottomRight,i+o-a.bottomRight,a.bottomRight,ft,0,!0),s.lineTo(e+n,i+a.topRight),s.arc(e+n-a.topRight,i+a.topRight,a.topRight,0,-ft,!0),s.lineTo(e+a.topLeft,i)}const Zr=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Qr=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Jr(s,t){const e=(""+s).match(Zr);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 tl=s=>+s||0;function Dn(s,t){const e={},i=j(t),n=i?Object.keys(t):t,o=j(s)?i?a=>H(s[a],s[t[a]]):a=>s[a]:()=>s;for(const a of n)e[a]=tl(o(a));return e}function Cn(s){return Dn(s,{top:"y",right:"x",bottom:"y",left:"x"})}function Gt(s){return Dn(s,["topLeft","topRight","bottomLeft","bottomRight"])}function ct(s){const t=Cn(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function et(s,t){s=s||{},t=t||Z.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(Qr)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const n={family:H(s.family,t.family),lineHeight:Jr(H(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:H(s.weight,t.weight),string:""};return n.string=Yr(n),n}function Fe(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 el(s,t,e){const{min:i,max:n}=s,o=fr(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 Ut(s,t){return Object.assign(Object.create(s),t)}function Ws(s,t=[""],e,i,n=()=>s[0]){const o=e||s;typeof i>"u"&&(i=On("_fallback",s));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:o,_fallback:i,_getTarget:n,override:r=>Ws([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 Tn(r,l,()=>cl(l,t,s,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(r,l){return fi(r).includes(l)},ownKeys(r){return fi(r)},set(r,l,c){const d=r._storage||(r._storage=n());return r[l]=d[l]=c,delete r._keys,!0}})}function ee(s,t,e,i){const n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:Pn(s,i),setContext:o=>ee(s,o,e,i),override:o=>ee(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 Tn(o,a,()=>il(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 Pn(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:At(e)?e:()=>e,isIndexable:At(i)?i:()=>i}}const sl=(s,t)=>s?s+zs(t):t,Vs=(s,t)=>j(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Tn(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t)||t==="constructor")return s[t];const i=e();return s[t]=i,i}function il(s,t,e){const{_proxy:i,_context:n,_subProxy:o,_descriptors:a}=s;let r=i[t];return At(r)&&a.isScriptable(t)&&(r=nl(t,r,s,e)),Q(r)&&r.length&&(r=ol(t,r,s,a.isIndexable)),Vs(t,r)&&(r=ee(r,n,o&&o[t],a)),r}function nl(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),Vs(s,l)&&(l=Ys(n._scopes,n,s,l)),l}function ol(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(j(t[0])){const l=t,c=n._scopes.filter(d=>d!==l);t=[];for(const d of l){const h=Ys(c,n,s,d);t.push(ee(h,o,a&&a[s],r))}}return t}function An(s,t,e){return At(s)?s(t,e):s}const al=(s,t)=>s===!0?t:typeof s=="string"?te(t,s):void 0;function rl(s,t,e,i,n){for(const o of t){const a=al(e,o);if(a){s.add(a);const r=An(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 Ys(s,t,e,i){const n=t._rootScopes,o=An(t._fallback,e,i),a=[...s,...n],r=new Set;r.add(i);let l=ui(r,a,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=ui(r,a,o,l,i),l===null)?!1:Ws(Array.from(r),[""],n,o,()=>ll(t,e,i))}function ui(s,t,e,i,n){for(;e;)e=rl(s,t,e,i,n);return e}function ll(s,t,e){const i=s._getTarget();t in i||(i[t]={});const n=i[t];return Q(n)&&j(e)?e:n||{}}function cl(s,t,e,i){let n;for(const o of t)if(n=On(sl(o,s),e),typeof n<"u")return Vs(s,n)?Ys(e,i,s,n):n}function On(s,t){for(const e of t){if(!e)continue;const i=e[s];if(typeof i<"u")return i}}function fi(s){let t=s._keys;return t||(t=s._keys=dl(s._scopes)),t}function dl(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)}const hl=Number.EPSILON||1e-14,se=(s,t)=>t<s.length&&!s[t].skip&&s[t],In=s=>s==="x"?"y":"x";function ul(s,t,e,i){const n=s.skip?t:s,o=t,a=e.skip?t:e,r=Cs(o,n),l=Cs(a,o);let c=r/(r+l),d=l/(r+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const h=i*c,u=i*d;return{previous:{x:o.x-h*(a.x-n.x),y:o.y-h*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function fl(s,t,e){const i=s.length;let n,o,a,r,l,c=se(s,0);for(let d=0;d<i-1;++d)if(l=c,c=se(s,d+1),!(!l||!c)){if(be(t[d],0,hl)){e[d]=e[d+1]=0;continue}n=e[d]/t[d],o=e[d+1]/t[d],r=Math.pow(n,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[d]=n*a*t[d],e[d+1]=o*a*t[d])}}function gl(s,t,e="x"){const i=In(e),n=s.length;let o,a,r,l=se(s,0);for(let c=0;c<n;++c){if(a=r,r=l,l=se(s,c+1),!r)continue;const d=r[e],h=r[i];a&&(o=(d-a[e])/3,r[`cp1${e}`]=d-o,r[`cp1${i}`]=h-o*t[c]),l&&(o=(l[e]-d)/3,r[`cp2${e}`]=d+o,r[`cp2${i}`]=h+o*t[c])}}function pl(s,t="x"){const e=In(t),i=s.length,n=Array(i).fill(0),o=Array(i);let a,r,l,c=se(s,0);for(a=0;a<i;++a)if(r=l,l=c,c=se(s,a+1),!!l){if(c){const d=c[t]-l[t];n[a]=d!==0?(c[e]-l[e])/d:0}o[a]=r?c?xt(n[a-1])!==xt(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}fl(s,n,o),gl(s,o,t)}function Re(s,t,e){return Math.max(Math.min(s,e),t)}function ml(s,t){let e,i,n,o,a,r=Se(s[0],t);for(e=0,i=s.length;e<i;++e)a=o,o=r,r=e<i-1&&Se(s[e+1],t),o&&(n=s[e],a&&(n.cp1x=Re(n.cp1x,t.left,t.right),n.cp1y=Re(n.cp1y,t.top,t.bottom)),r&&(n.cp2x=Re(n.cp2x,t.left,t.right),n.cp2y=Re(n.cp2y,t.top,t.bottom)))}function bl(s,t,e,i,n){let o,a,r,l;if(t.spanGaps&&(s=s.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")pl(s,n);else{let c=i?s[s.length-1]:s[0];for(o=0,a=s.length;o<a;++o)r=s[o],l=ul(c,r,s[Math.min(o+1,a-(i?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&ml(s,e)}function Us(){return typeof window<"u"&&typeof document<"u"}function Xs(s){let t=s.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Je(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 as=s=>s.ownerDocument.defaultView.getComputedStyle(s,null);function xl(s,t){return as(s).getPropertyValue(t)}const yl=["top","right","bottom","left"];function Wt(s,t,e){const i={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=yl[n];i[o]=parseFloat(s[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const _l=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function vl(s,t){const e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:o}=i;let a=!1,r,l;if(_l(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 Bt(s,t){if("native"in s)return s;const{canvas:e,currentDevicePixelRatio:i}=t,n=as(e),o=n.boxSizing==="border-box",a=Wt(n,"padding"),r=Wt(n,"border","width"),{x:l,y:c,box:d}=vl(s,e),h=a.left+(d&&r.left),u=a.top+(d&&r.top);let{width:g,height:p}=t;return o&&(g-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-h)/g*e.width/i),y:Math.round((c-u)/p*e.height/i)}}function kl(s,t,e){let i,n;if(t===void 0||e===void 0){const o=s&&Xs(s);if(!o)t=s.clientWidth,e=s.clientHeight;else{const a=o.getBoundingClientRect(),r=as(o),l=Wt(r,"border","width"),c=Wt(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,i=Je(r.maxWidth,o,"clientWidth"),n=Je(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||Ze,maxHeight:n||Ze}}const $e=s=>Math.round(s*10)/10;function wl(s,t,e,i){const n=as(s),o=Wt(n,"margin"),a=Je(n.maxWidth,s,"clientWidth")||Ze,r=Je(n.maxHeight,s,"clientHeight")||Ze,l=kl(s,t,e);let{width:c,height:d}=l;if(n.boxSizing==="content-box"){const u=Wt(n,"border","width"),g=Wt(n,"padding");c-=g.width+u.width,d-=g.height+u.height}return c=Math.max(0,c-o.width),d=Math.max(0,i?c/i:d-o.height),c=$e(Math.min(c,a,l.maxWidth)),d=$e(Math.min(d,r,l.maxHeight)),c&&!d&&(d=$e(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&d>l.height&&(d=l.height,c=$e(Math.floor(d*i))),{width:c,height:d}}function gi(s,t,e){const i=t||1,n=Math.floor(s.height*i),o=Math.floor(s.width*i);s.height=Math.floor(s.height),s.width=Math.floor(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 Ml=(function(){let s=!1;try{const t={get passive(){return s=!0,!1}};Us()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return s})();function pi(s,t){const e=xl(s,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Et(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:s.y+e*(t.y-s.y)}}function Sl(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:i==="middle"?e<.5?s.y:t.y:i==="after"?e<1?s.y:t.y:e>0?t.y:s.y}}function Dl(s,t,e,i){const n={x:s.cp2x,y:s.cp2y},o={x:t.cp1x,y:t.cp1y},a=Et(s,n,e),r=Et(n,o,e),l=Et(o,t,e),c=Et(a,r,e),d=Et(r,l,e);return Et(c,d,e)}const Cl=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}}},Pl=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,t){return s+t},leftForLtr(s,t){return s}}};function Zt(s,t,e){return s?Cl(t,e):Pl()}function Ln(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 Fn(s,t){t!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",t[0],t[1]))}function Rn(s){return s==="angle"?{between:xn,compare:Cr,normalize:Dt}:{between:jt,compare:(t,e)=>t-e,normalize:t=>t}}function mi({start:s,end:t,count:e,loop:i,style:n}){return{start:s%e,end:t%e,loop:i&&(t-s+1)%e===0,style:n}}function Tl(s,t,e){const{property:i,start:n,end:o}=e,{between:a,normalize:r}=Rn(i),l=t.length;let{start:c,end:d,loop:h}=s,u,g;if(h){for(c+=l,d+=l,u=0,g=l;u<g&&a(r(t[c%l][i]),n,o);++u)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:h,style:s.style}}function Al(s,t,e){if(!e)return[s];const{property:i,start:n,end:o}=e,a=t.length,{compare:r,between:l,normalize:c}=Rn(i),{start:d,end:h,loop:u,style:g}=Tl(s,t,e),p=[];let m=!1,b=null,x,w,D;const P=()=>l(n,D,x)&&r(n,D)!==0,C=()=>r(o,x)===0||l(o,D,x),S=()=>m||P(),v=()=>!m||C();for(let y=d,M=d;y<=h;++y)w=t[y%a],!w.skip&&(x=c(w[i]),x!==D&&(m=l(x,n,o),b===null&&S()&&(b=r(x,n)===0?y:M),b!==null&&v()&&(p.push(mi({start:b,end:y,loop:u,count:a,style:g})),b=null),M=y,D=x));return b!==null&&p.push(mi({start:b,end:h,loop:u,count:a,style:g})),p}function Ol(s,t){const e=[],i=s.segments;for(let n=0;n<i.length;n++){const o=Al(i[n],s.points,t);o.length&&e.push(...o)}return e}function Il(s,t,e,i){let n=0,o=t-1;if(e&&!i)for(;n<t&&!s[n].skip;)n++;for(;n<t&&s[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&s[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Ll(s,t,e,i){const n=s.length,o=[];let a=t,r=s[t],l;for(l=t+1;l<=e;++l){const c=s[l%n];c.skip||c.stop?r.skip||(i=!1,o.push({start:t%n,end:(l-1)%n,loop:i}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%n,end:a%n,loop:i}),o}function Fl(s,t){const e=s.points,i=s.options.spanGaps,n=e.length;if(!n)return[];const o=!!s._loop,{start:a,end:r}=Il(e,n,o,i);if(i===!0)return bi(s,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+n:r,c=!!s._fullLoop&&a===0&&r===n-1;return bi(s,Ll(e,a,l,c),e,t)}function bi(s,t,e,i){return!i||!i.setContext||!e?t:Rl(s,t,e,i)}function Rl(s,t,e,i){const n=s._chart.getContext(),o=xi(s.options),{_datasetIndex:a,options:{spanGaps:r}}=s,l=e.length,c=[];let d=o,h=t[0].start,u=h;function g(p,m,b,x){const w=r?-1:1;if(p!==m){for(p+=l;e[p%l].skip;)p-=w;for(;e[m%l].skip;)m+=w;p%l!==m%l&&(c.push({start:p%l,end:m%l,loop:b,style:x}),d=x,h=m%l)}}for(const p of t){h=r?h:p.start;let m=e[h%l],b;for(u=h+1;u<=p.end;u++){const x=e[u%l];b=xi(i.setContext(Ut(n,{type:"segment",p0:m,p1:x,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),$l(b,d)&&g(h,u-1,p.loop,d),m=x,d=b}h<u-1&&g(h,u-1,p.loop,d)}return c}function xi(s){return{backgroundColor:s.backgroundColor,borderCapStyle:s.borderCapStyle,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderJoinStyle:s.borderJoinStyle,borderWidth:s.borderWidth,borderColor:s.borderColor}}function $l(s,t){if(!t)return!1;const e=[],i=function(n,o){return Hs(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(s,i)!==JSON.stringify(t,i)}function ze(s,t,e){return s.options.clip?s[e]:t[e]}function zl(s,t){const{xScale:e,yScale:i}=s;return e&&i?{left:ze(e,t,"left"),right:ze(e,t,"right"),top:ze(i,t,"top"),bottom:ze(i,t,"bottom")}:t}function Bl(s,t){const e=t._clip;if(e.disabled)return!1;const i=zl(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)}}/*!
12 * Chart.js v4.5.0
13 * https://www.chartjs.org
14 * (c) 2025 Chart.js Contributors
15 * Released under the MIT License
16 */class El{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=vn.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 vt=new El;const yi="transparent",Hl={boolean(s,t,e){return e>.5?t:s},color(s,t,e){const i=li(s||yi),n=i.valid&&li(t||yi);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}};class jl{constructor(t,e,i,n){const o=e[i];n=Fe([t.to,n,o,t.from]);const a=Fe([t.from,o,n]);this._active=!0,this._fn=t.fn||Hl[t.type||typeof a],this._easing=xe[t.easing]||xe.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=Fe([t.to,e,n,t.from]),this._from=Fe([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 $n{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!j(t))return;const e=Object.keys(Z.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!j(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=Wl(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&Nl(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 h=o[c];const u=i.get(c);if(h)if(u&&h.active()){h.update(u,d,r);continue}else h.cancel();if(!u||!u.duration){t[c]=d;continue}o[c]=h=new jl(u,t,c,d),n.push(h)}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 vt.add(this._chart,i),!0}}function Nl(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 Wl(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 _i(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 Vl(s,t,e){if(e===!1)return!1;const i=_i(s,e),n=_i(t,e);return{top:n.end,right:i.end,bottom:n.start,left:i.start}}function Yl(s){let t,e,i,n;return j(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 zn(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 vi(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],lt(c)&&(o||t===0||xt(t)===xt(c))&&(t+=c)}return!d&&!i.all?0:t}function Ul(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 gs(s,t){const e=s&&s.options.stacked;return e||e===void 0&&t.stack!==void 0}function Xl(s,t,e){return`${s.id}.${t.id}.${e.stack||e.type}`}function Kl(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 ql(s,t,e){const i=s[t]||(s[t]={});return i[e]||(i[e]={})}function ki(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 wi(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=Xl(o,a,i),h=t.length;let u;for(let g=0;g<h;++g){const p=t[g],{[l]:m,[c]:b}=p,x=p._stacks||(p._stacks={});u=x[c]=ql(n,d,m),u[r]=b,u._top=ki(u,a,!0,i.type),u._bottom=ki(u,a,!1,i.type);const w=u._visualValues||(u._visualValues={});w[r]=b}}function ps(s,t){const e=s.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Gl(s,t){return Ut(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Zl(s,t,e){return Ut(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function re(s,t){const e=s.controller.index,i=s.vScale&&s.vScale.axis;if(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 ms=s=>s==="reset"||s==="none",Mi=(s,t)=>t?s:Object.assign({},s),Ql=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:zn(e,!0),values:null};class Qt{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=gs(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&&re(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(h,u,g,p)=>h==="x"?u:h==="r"?p:g,o=e.xAxisID=H(i.xAxisID,ps(t,"x")),a=e.yAxisID=H(i.yAxisID,ps(t,"y")),r=e.rAxisID=H(i.rAxisID,ps(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&&oi(this._data,this),t._stacked&&re(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(j(e)){const n=this._cachedMeta;this._data=Ul(e,n)}else if(i!==e){if(i){oi(i,this);const n=this._cachedMeta;re(n),n._parsed=[]}e&&Object.isExtensible(e)&&Or(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=gs(e.vScale,e),e.stack!==i.stack&&(n=!0,re(e),e.stack=i.stack),this._resyncElements(t),(n||o!==e._stacked)&&(wi(this,e._parsed),e._stacked=gs(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,h,u;if(this._parsing===!1)i._parsed=n,i._sorted=!0,u=n;else{Q(n[t])?u=this.parseArrayData(i,n,t,e):j(n[t])?u=this.parseObjectData(i,n,t,e):u=this.parsePrimitiveData(i,n,t,e);const g=()=>h[r]===null||c&&h[r]<c[r];for(d=0;d<e;++d)i._parsed[d+t]=h=u[d],l&&(g()&&(l=!1),c=h);i._sorted=l}a&&wi(this,u)}parsePrimitiveData(t,e,i,n){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),d=o===a,h=new Array(n);let u,g,p;for(u=0,g=n;u<g;++u)p=u+i,h[u]={[r]:d||o.parse(c[p],p),[l]:a.parse(e[p],p)};return h}parseArrayData(t,e,i,n){const{xScale:o,yScale:a}=t,r=new Array(n);let l,c,d,h;for(l=0,c=n;l<c;++l)d=l+i,h=e[d],r[l]={x:o.parse(h[0],d),y:a.parse(h[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,h,u,g;for(d=0,h=n;d<h;++d)u=d+i,g=e[u],c[d]={x:o.parse(te(g,r),u),y:a.parse(te(g,l),u)};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:zn(n,!0),values:e._stacks[t.axis]._visualValues};return vi(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=vi(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=Ql(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=Kl(r);let u,g;function p(){g=n[u];const m=g[r.axis];return!lt(g[t.axis])||d>m||h<m}for(u=0;u<a&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),o));++u);if(o){for(u=a-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(c,t,g,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],lt(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(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=Yl(H(this.options.clip,Vl(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 h=n[d];h.hidden||(h.active&&c?a.push(h):h.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=Zl(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=Gl(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&&we(i);if(r)return Mi(r,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),h=n?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),d),g=Object.keys(Z.elements[t]),p=()=>this.getContext(i,n,e),m=c.resolveNamedOptions(u,g,p,h);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(Mi(m,l))),m}_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,h=d.datasetAnimationScopeKeys(this._type,e),u=d.getOptionScopes(this.getDataset(),h);l=d.createResolver(u,this.getContext(t,i,e))}const c=new $n(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||ms(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){ms(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ms(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&&re(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])}}F(Qt,"defaults",{}),F(Qt,"datasetElementType",null),F(Qt,"dataElementType",null);function Jl(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=_n(i.sort((n,o)=>n-o))}return s._cache.$bar}function tc(s){const t=s.iScale,e=Jl(t,s.type);let i=t._length,n,o,a,r;const l=()=>{a===32767||a===-32768||(we(r)&&(i=Math.min(i,Math.abs(a-r)||i)),r=a)};for(n=0,o=e.length;n<o;++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 ec(s,t,e,i){const n=e.barThickness;let o,a;return N(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 sc(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 ic(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 Bn(s,t,e,i){return Q(s)?ic(s,t,e,i):t[e.axis]=e.parse(s,i),t}function Si(s,t,e,i){const n=s.iScale,o=s.vScale,a=n.getLabels(),r=n===o,l=[];let c,d,h,u;for(c=e,d=e+i;c<d;++c)u=t[c],h={},h[n.axis]=r||n.parse(a[c],c),l.push(Bn(u,h,o,c));return l}function bs(s){return s&&s.barStart!==void 0&&s.barEnd!==void 0}function nc(s,t,e){return s!==0?xt(s):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function oc(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 ac(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}=oc(s);n==="middle"&&e&&(s.enableBorderRadius=!0,(e._top||0)===i?n=c:(e._bottom||0)===i?n=d:(o[Di(d,a,r,l)]=!0,n=c)),o[Di(n,a,r,l)]=!0,s.borderSkipped=o}function Di(s,t,e,i){return i?(s=rc(s,t,e),s=Ci(s,e,t)):s=Ci(s,t,e),s}function rc(s,t,e){return s===t?e:s===e?t:s}function Ci(s,t,e){return s==="start"?t:s==="end"?e:s}function lc(s,{inflateAmount:t},e){s.inflateAmount=t==="auto"?e===1?.33:0:t}class Ve extends Qt{parsePrimitiveData(t,e,i,n){return Si(t,e,i,n)}parseArrayData(t,e,i,n){return Si(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,h=[];let u,g,p,m;for(u=i,g=i+n;u<g;++u)m=e[u],p={},p[o.axis]=o.parse(te(m,c),u),h.push(Bn(te(m,d),p,a,u));return h}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=bs(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:h,includeOptions:u}=this._getSharedOptions(e,n);for(let g=e;g<e+i;g++){const p=this.getParsed(g),m=o||N(p[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),b=this._calculateBarIndexPixels(g,d),x=(p._stacks||{})[r.axis],w={horizontal:c,base:m.base,enableBorderRadius:!x||bs(p._custom)||a===x._top||a===x._bottom,x:c?m.head:b.center,y:c?b.center:m.head,height:c?b.size:Math.abs(m.size),width:c?Math.abs(m.size):b.size};u&&(w.options=h||this.resolveDataElementOptions(g,t[g].active?"active":n));const D=w.options||t[g].options;ac(w,D,x,a),lc(w,D,d.ratio),this.updateElement(t[g],g,w,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 h=d._parsed.find(g=>g[i.axis]===l),u=h&&h[d.vScale.axis];if(N(u)||isNaN(u))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||tc(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=bs(c);let h=l[e.axis],u=0,g=i?this.applyStack(e,l,i):h,p,m;g!==h&&(u=g-h,g=h),d&&(h=c.barStart,g=c.barEnd-c.barStart,h!==0&&xt(h)!==xt(c.barEnd)&&(u=0),u+=h);const b=!N(o)&&!d?o:u;let x=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(u+g):p=x,m=p-x,Math.abs(m)<a){m=nc(m,e,r)*a,h===r&&(x-=m/2);const w=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),P=Math.min(w,D),C=Math.max(w,D);x=Math.max(Math.min(x,C),P),p=x+m,i&&!d&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(p)-e.getValueForPixel(x))}if(x===e.getPixelForValue(r)){const w=xt(m)*e.getLineWidthForValue(r)/2;x+=w,m-=w}return{size:m,base:x,head:p,center:p+m/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,h=n.barThickness==="flex"?sc(t,e,n,d*c):ec(t,e,n,d*c),u=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,g=this._getAxis().indexOf(H(u,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+g;r=h.start+h.chunk*p+h.chunk/2,l=Math.min(a,h.chunk*h.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)}}F(Ve,"id","bar"),F(Ve,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),F(Ve,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Ye extends Qt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=Fr(e,n,a);this._drawStart=r,this._drawCount=l,Rr(e)&&(r=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(n,r,l,t)}updateElements(t,e,i,n){const o=n==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:h}=this._getSharedOptions(e,n),u=a.axis,g=r.axis,{spanGaps:p,segment:m}=this.options,b=Me(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||n==="none",w=e+i,D=t.length;let P=e>0&&this.getParsed(e-1);for(let C=0;C<D;++C){const S=t[C],v=x?S:{};if(C<e||C>=w){v.skip=!0;continue}const y=this.getParsed(C),M=N(y[g]),_=v[u]=a.getPixelForValue(y[u],C),T=v[g]=o||M?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,y,l):y[g],C);v.skip=isNaN(_)||isNaN(T)||M,v.stop=C>0&&Math.abs(y[u]-P[u])>b,m&&(v.parsed=y,v.raw=c.data[C]),h&&(v.options=d||this.resolveDataElementOptions(C,S.active?"active":n)),x||this.updateElement(S,C,v,n),P=y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}F(Ye,"id","line"),F(Ye,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(Ye,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Rt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ks{constructor(t){F(this,"options");this.options=t||{}}static override(t){Object.assign(Ks.prototype,t)}init(){}formats(){return Rt()}parse(){return Rt()}format(){return Rt()}add(){return Rt()}diff(){return Rt()}startOf(){return Rt()}endOf(){return Rt()}}var cc={_date:Ks};function dc(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?Tr:Nt;if(i){if(n._sharedOptions){const d=o[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){const u=c(o,t,e-h),g=c(o,t,e+h);return{lo:u.lo,hi:g.hi}}}}else{const d=c(o,t,e);if(l){const{vScale:h}=n._cachedMeta,{_parsed:u}=s,g=u.slice(0,d.lo+1).reverse().findIndex(m=>!N(m[h.axis]));d.lo-=Math.max(0,g);const p=u.slice(d.hi).findIndex(m=>!N(m[h.axis]));d.hi+=Math.max(0,p)}return d}}return{lo:0,hi:o.length-1}}
vendor: 4,202 bytes, line 16
16function rs(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:h,hi:u}=dc(o[r],t,a,n);for(let g=h;g<=u;++g){const p=d[g];p.skip||i(p,c,g)}}}function hc(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 xs(s,t,e,i,n){const o=[];return!n&&!s.isPointInArea(t)||rs(s,e,t,function(r,l,c){!n&&!Se(r,s.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function uc(s,t,e,i){let n=[];function o(a,r,l){const{startAngle:c,endAngle:d}=a.getProps(["startAngle","endAngle"],i),{angle:h}=Dr(a,{x:t.x,y:t.y});xn(h,c,d)&&n.push({element:a,datasetIndex:r,index:l})}return rs(s,e,t,o),n}function fc(s,t,e,i,n,o){let a=[];const r=hc(e);let l=Number.POSITIVE_INFINITY;function c(d,h,u){const g=d.inRange(t.x,t.y,n);if(i&&!g)return;const p=d.getCenterPoint(n);if(!(!!o||s.isPointInArea(p))&&!g)return;const b=r(t,p);b<l?(a=[{element:d,datasetIndex:h,index:u}],l=b):b===l&&a.push({element:d,datasetIndex:h,index:u})}return rs(s,e,t,c),a}function ys(s,t,e,i,n,o){return!o&&!s.isPointInArea(t)?[]:e==="r"&&!i?uc(s,t,e,n):fc(s,t,e,i,n,o)}function Pi(s,t,e,i,n){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return rs(s,e,t,(l,c,d)=>{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 gc={modes:{index(s,t,e,i){const n=Bt(t,s),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?xs(s,n,o,i,a):ys(s,n,o,!1,i,a),l=[];return r.length?(s.getSortedVisibleDatasetMetas().forEach(c=>{const d=r[0].index,h=c.data[d];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:d})}),l):[]},dataset(s,t,e,i){const n=Bt(t,s),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?xs(s,n,o,i,a):ys(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=Bt(t,s),o=e.axis||"xy",a=e.includeInvisible||!1;return xs(s,n,o,i,a)},nearest(s,t,e,i){const n=Bt(t,s),o=e.axis||"xy",a=e.includeInvisible||!1;return ys(s,n,o,e.intersect,i,a)},x(s,t,e,i){const n=Bt(t,s);return Pi(s,n,"x",e.intersect,i)},y(s,t,e,i){const n=Bt(t,s);return Pi(s,n,"y",e.intersect,i)}}};const En=["left","top","right","bottom"];function le(s,t){return s.filter(e=>e.pos===t)}function Ti(s,t){return s.filter(e=>En.indexOf(e.pos)===-1&&e.box.axis===t)}function ce(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 pc(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 mc(s){const t={};for(const e of s){const{stack:i,pos:n,stackWeight:o}=e;if(!i||!En.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 bc(s,t){const e=mc(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 xc(s){const t=pc(s),e=ce(t.filter(c=>c.box.fullSize),!0),i=ce(le(t,"left"),!0),n=ce(le(t,"right")),o=ce(le(t,"top"),!0),a=ce(le(t,"bottom")),r=Ti(t,"x"),l=Ti(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:le(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}function Ai(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function Hn(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 yc(s,t,e,i){const{pos:n,box:o}=e,a=s.maxPadding;if(!j(n)){e.size&&(s[n]-=e.size);const h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?o.height:o.width),e.size=h.size/h.count,s[n]+=e.size}o.getPadding&&Hn(a,o.getPadding());
vendor: 90,742 bytes, lines 16-18
16const r=Math.max(0,t.outerWidth-Ai(a,s,"left","right")),l=Math.max(0,t.outerHeight-Ai(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 _c(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 vc(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 fe(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,vc(r.horizontal,t));const{same:h,other:u}=yc(t,e,r,i);c|=h&&n.length,d=d||u,l.fullSize||n.push(r)}return c&&fe(n,t,e,i)||d}function Be(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 Oi(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 h=t.w*d,u=c.size||l.height;we(c.start)&&(a=c.start),l.fullSize?Be(l,n.left,a,e.outerWidth-n.right-n.left,u):Be(l,t.left+c.placed,a,h,u),c.start=a,c.placed+=h,a=l.bottom}else{const h=t.h*d,u=c.size||l.width;we(c.start)&&(o=c.start),l.fullSize?Be(l,o,n.top,u,e.outerHeight-n.bottom-n.top):Be(l,o,t.top+c.placed,u,h),c.start=o,c.placed+=h,o=l.right}}t.x=o,t.y=a}var rt={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=ct(s.options.layout.padding),o=Math.max(t-n.width,0),a=Math.max(e-n.height,0),r=xc(s.boxes),l=r.vertical,c=r.horizontal;W(s.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const d=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),u=Object.assign({},n);Hn(u,ct(i));const g=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),p=bc(l.concat(c),h);fe(r.fullSize,g,h,p),fe(l,g,h,p),fe(c,g,h,p)&&fe(l,g,h,p),_c(g),Oi(r.leftAndTop,g,h,p),g.x+=g.w,g.y+=g.h,Oi(r.rightAndBottom,g,h,p),s.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},W(r.chartArea,m=>{const b=m.box;Object.assign(b,s.chartArea),b.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class jn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(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 kc extends jn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ue="$chartjs",wc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ii=s=>s===null||s==="";function Mc(s,t){const e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[Ue]={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",Ii(n)){const o=pi(s,"width");o!==void 0&&(s.width=o)}if(Ii(i))if(s.style.height==="")s.height=s.width/(t||2);else{const o=pi(s,"height");o!==void 0&&(s.height=o)}return s}const Nn=Ml?{passive:!0}:!1;function Sc(s,t,e){s&&s.addEventListener(t,e,Nn)}function Dc(s,t,e){s&&s.canvas&&s.canvas.removeEventListener(t,e,Nn)}function Cc(s,t){const e=wc[s.type]||s.type,{x:i,y:n}=Bt(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function ts(s,t){for(const e of s)if(e===t||e.contains(t))return!0}function Pc(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||ts(r.addedNodes,i),a=a&&!ts(r.removedNodes,i);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Tc(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||ts(r.removedNodes,i),a=a&&!ts(r.addedNodes,i);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Ce=new Map;let Li=0;function Wn(){const s=window.devicePixelRatio;s!==Li&&(Li=s,Ce.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function Ac(s,t){Ce.size||window.addEventListener("resize",Wn),Ce.set(s,t)}function Oc(s){Ce.delete(s),Ce.size||window.removeEventListener("resize",Wn)}function Ic(s,t,e){const i=s.canvas,n=i&&Xs(i);if(!n)return;const o=kn((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),Ac(s,o),a}function _s(s,t,e){e&&e.disconnect(),t==="resize"&&Oc(s)}function Lc(s,t,e){const i=s.canvas,n=kn(o=>{s.ctx!==null&&e(Cc(o,s))},s);return Sc(i,t,n),n}class Fc extends jn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Mc(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ue])return!1;const i=e[Ue].initial;["height","width"].forEach(o=>{const a=i[o];N(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[Ue],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:Pc,detach:Tc,resize:Ic}[e]||Lc;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]||Dc)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return wl(t,e,i,n)}isAttached(t){const e=t&&Xs(t);return!!(e&&e.isConnected)}}function Rc(s){return!Us()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?kc:Fc}class yt{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Me(this.x)&&Me(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}}F(yt,"defaults",{}),F(yt,"defaultRoutes");function $c(s,t){const e=s.options.ticks,i=zc(s),n=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Ec(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>n)return Hc(t,c,o,a/n),c;const d=Bc(o,t,n);if(a>0){let h,u;const g=a>1?Math.round((l-r)/(a-1)):null;for(Ee(t,c,d,N(g)?0:r-g,r),h=0,u=a-1;h<u;h++)Ee(t,c,d,o[h],o[h+1]);return Ee(t,c,d,l,N(g)?t.length:l+g),c}return Ee(t,c,d),c}function zc(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 Bc(s,t,e){const i=jc(s),n=t.length/e;if(!i)return Math.max(n,1);const o=vr(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 Ec(s){const t=[];let e,i;for(e=0,i=s.length;e<i;e++)s[e].major&&t.push(e);return t}function Hc(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 Ee(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 jc(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 Nc=s=>s==="left"?"right":s==="right"?"left":s,Fi=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,Ri=(s,t)=>Math.min(t||s,s);function $i(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 Wc(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 Vc(s,t){W(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 de(s){return s.drawTicks?s.tickLength:0}function zi(s,t){if(!s.display)return 0;const e=et(s.font,t),i=ct(s.padding);return(Q(s.text)?s.text.length:1)*e.lineHeight+i.height}function Yc(s,t){return Ut(s,{scale:t,type:"scale"})}function Uc(s,t,e){return Ut(s,{tick:e,index:t,type:"tick"})}function Xc(s,t,e){let i=Es(s);return(e&&t!=="right"||!e&&t==="right")&&(i=Nc(i)),i}function Kc(s,t,e,i){const{top:n,left:o,bottom:a,right:r,chart:l}=s,{chartArea:c,scales:d}=l;let h=0,u,g,p;const m=a-n,b=r-o;if(s.isHorizontal()){if(g=tt(i,o,r),j(e)){const x=Object.keys(e)[0],w=e[x];p=d[x].getPixelForValue(w)+m-t}else e==="center"?p=(c.bottom+c.top)/2+m-t:p=Fi(s,e,t);u=r-o}else{if(j(e)){const x=Object.keys(e)[0],w=e[x];g=d[x].getPixelForValue(w)-b+t}else e==="center"?g=(c.left+c.right)/2-b+t:g=Fi(s,e,t);p=tt(i,a,n),h=e==="left"?-ft:ft}return{titleX:g,titleY:p,maxWidth:u,rotation:h}}class ne extends yt{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=gt(t,Number.POSITIVE_INFINITY),e=gt(e,Number.NEGATIVE_INFINITY),i=gt(i,Number.POSITIVE_INFINITY),n=gt(n,Number.NEGATIVE_INFINITY),{min:gt(t,i),max:gt(e,n),minDefined:lt(t),maxDefined:lt(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;++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:gt(e,gt(i,e)),max:gt(i,gt(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=el(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?$i(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=$c(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=Ri(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(),h=d.widest.width,u=d.highest.height,g=ot(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/i:g/(i-1),h+6>r&&(r=g/(i-(t.offset?.5:1)),l=this.maxHeight-de(t.grid)-e.padding-zi(t.title,this.chart.options.font),c=Math.sqrt(h*h+u*u),a=Sr(Math.min(Math.asin(ot((d.highest.height+6)/r,-1,1)),Math.asin(ot(l/c,-1,1))-Math.asin(ot(u/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=zi(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=de(o)+l):(t.height=this.maxHeight,t.width=de(o)+l),i.display&&this.ticks.length){const{first:c,last:d,widest:h,highest:u}=this._getLabelSizes(),g=i.padding*2,p=Ht(this.labelRotation),m=Math.cos(p),b=Math.sin(p);if(r){const x=i.mirror?0:b*h.width+m*u.height;t.height=Math.min(this.maxHeight,t.height+x+g)}else{const x=i.mirror?0:m*h.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+x+g)}this._calculatePadding(c,d,b,m)}}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,h=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,g=0;l?c?(u=n*t.width,g=i*e.height):(u=i*t.height,g=n*e.width):o==="start"?g=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,g=e.width/2),this.paddingLeft=Math.max((u-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((g-h+a)*this.width/(this.width-h),0)}else{let d=e.height/2,h=t.height/2;o==="start"?(d=0,h=t.height):o==="end"&&(d=e.height,h=0),this.paddingTop=d+a,this.paddingBottom=h+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++)N(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=$i(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/Ri(e,i));let c=0,d=0,h,u,g,p,m,b,x,w,D,P,C;for(h=0;h<e;h+=l){if(p=t[h].label,m=this._resolveTickFontOptions(h),n.font=b=m.string,x=o[b]=o[b]||{data:{},gc:[]},w=m.lineHeight,D=P=0,!N(p)&&!Q(p))D=di(n,x.data,x.gc,D,p),P=w;else if(Q(p))for(u=0,g=p.length;u<g;++u)C=p[u],!N(C)&&!Q(C)&&(D=di(n,x.data,x.gc,D,C),P+=w);a.push(D),r.push(P),c=Math.max(D,c),d=Math.max(P,d)}Vc(o,e);const S=a.indexOf(c),v=r.indexOf(d),y=M=>({width:a[M]||0,height:r[M]||0});return{first:y(0),last:y(e-1),widest:y(S),highest:y(v),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 Pr(this._alignToPixels?Ft(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=Uc(this.getContext(),t,i))}return this.$context||(this.$context=Yc(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ht(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(),h=this.ticks.length+(l?1:0),u=de(o),g=[],p=r.setContext(this.getContext()),m=p.display?p.width:0,b=m/2,x=function($){return Ft(i,$,m)};let w,D,P,C,S,v,y,M,_,T,k,O;if(a==="top")w=x(this.bottom),v=this.bottom-u,M=w-b,T=x(t.top)+b,O=t.bottom;else if(a==="bottom")w=x(this.top),T=t.top,O=x(t.bottom)-b,v=w+b,M=this.top+u;else if(a==="left")w=x(this.right),S=this.right-u,y=w-b,_=x(t.left)+b,k=t.right;else if(a==="right")w=x(this.left),_=t.left,k=x(t.right)-b,S=w+b,y=this.left+u;else if(e==="x"){if(a==="center")w=x((t.top+t.bottom)/2+.5);else if(j(a)){const $=Object.keys(a)[0],R=a[$];w=x(this.chart.scales[$].getPixelForValue(R))}T=t.top,O=t.bottom,v=w+b,M=v+u}else if(e==="y"){if(a==="center")w=x((t.left+t.right)/2);else if(j(a)){const $=Object.keys(a)[0],R=a[$];w=x(this.chart.scales[$].getPixelForValue(R))}S=w-b,y=S-u,_=t.left,k=t.right}const I=H(n.ticks.maxTicksLimit,h),A=Math.max(1,Math.ceil(h/I));for(D=0;D<h;D+=A){const $=this.getContext(D),R=o.setContext($),q=r.setContext($),dt=R.lineWidth,K=R.color,G=q.dash||[],Mt=q.dashOffset,oe=R.tickWidth,Ot=R.tickColor,ae=R.tickBorderDash||[],It=R.tickBorderDashOffset;P=Wc(this,D,l),P!==void 0&&(C=Ft(i,P,dt),c?S=y=_=k=C:v=M=T=O=C,g.push({tx1:S,ty1:v,tx2:y,ty2:M,x1:_,y1:T,x2:k,y2:O,width:dt,color:K,borderDash:G,borderDashOffset:Mt,tickWidth:oe,tickColor:Ot,tickBorderDash:ae,tickBorderDashOffset:It}))}return this._ticksLength=h,this._borderValue=w,g}_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:h}=o,u=de(i.grid),g=u+d,p=h?-d:g,m=-Ht(this.labelRotation),b=[];let x,w,D,P,C,S,v,y,M,_,T,k,O="middle";if(n==="top")S=this.bottom-p,v=this._getXAxisLabelAlignment();else if(n==="bottom")S=this.top+p,v=this._getXAxisLabelAlignment();else if(n==="left"){const A=this._getYAxisLabelAlignment(u);v=A.textAlign,C=A.x}else if(n==="right"){const A=this._getYAxisLabelAlignment(u);v=A.textAlign,C=A.x}else if(e==="x"){if(n==="center")S=(t.top+t.bottom)/2+g;else if(j(n)){const A=Object.keys(n)[0],$=n[A];S=this.chart.scales[A].getPixelForValue($)+g}v=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")C=(t.left+t.right)/2-g;else if(j(n)){const A=Object.keys(n)[0],$=n[A];C=this.chart.scales[A].getPixelForValue($)}v=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?O="top":l==="end"&&(O="bottom"));const I=this._getLabelSizes();for(x=0,w=r.length;x<w;++x){D=r[x],P=D.label;const A=o.setContext(this.getContext(x));y=this.getPixelForTick(x)+o.labelOffset,M=this._resolveTickFontOptions(x),_=M.lineHeight,T=Q(P)?P.length:1;const $=T/2,R=A.color,q=A.textStrokeColor,dt=A.textStrokeWidth;let K=v;a?(C=y,v==="inner"&&(x===w-1?K=this.options.reverse?"left":"right":x===0?K=this.options.reverse?"right":"left":K="center"),n==="top"?c==="near"||m!==0?k=-T*_+_/2:c==="center"?k=-I.highest.height/2-$*_+_:k=-I.highest.height+_/2:c==="near"||m!==0?k=_/2:c==="center"?k=I.highest.height/2-$*_:k=I.highest.height-T*_,h&&(k*=-1),m!==0&&!A.showLabelBackdrop&&(C+=_/2*Math.sin(m))):(S=y,k=(1-T)*_/2);let G;if(A.showLabelBackdrop){const Mt=ct(A.backdropPadding),oe=I.heights[x],Ot=I.widths[x];let ae=k-Mt.top,It=0-Mt.left;switch(O){case"middle":ae-=oe/2;break;case"bottom":ae-=oe;break}switch(v){case"center":It-=Ot/2;break;case"right":It-=Ot;break;case"inner":x===w-1?It-=Ot:x>0&&(It-=Ot/2);break}G={left:It,top:ae,width:Ot+Mt.width,height:oe+Mt.height,color:A.backdropColor}}b.push({label:P,font:M,textOffset:k,options:{rotation:m,color:R,strokeColor:q,strokeWidth:dt,textAlign:K,textBaseline:O,translation:[C,S],backdrop:G}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ht(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};if(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,h,u;this.isHorizontal()?(c=Ft(t,this.left,a)-a/2,d=Ft(t,this.right,r)+r/2,h=u=l):(h=Ft(t,this.top,a)-a/2,u=Ft(t,this.bottom,r)+r/2,c=d=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,h),e.lineTo(d,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,n=this._computeLabelArea();n&&js(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;De(i,c,0,d,l,r)}n&&Ns(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=et(i.font),a=ct(i.padding),r=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||j(e)?(l+=a.bottom,Q(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:d,maxWidth:h,rotation:u}=Kc(this,l,e,r);De(t,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:u,textAlign:Xc(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!==ne.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 et(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class He{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;Zc(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,qc(t,a,i),this.override&&Z.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 Z[n]&&(delete Z[n][i],this.override&&delete Yt[i])}}function qc(s,t,e){const i=ke(Object.create(null),[e?Z.get(e):{},Z.get(t),s.defaults]);Z.set(t,i),s.defaultRoutes&&Gc(t,s.defaultRoutes),s.descriptors&&Z.describe(t,s.descriptors)}function Gc(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(".");Z.route(o,n,l,r)})}function Zc(s){return"id"in s&&"defaults"in s}class Qc{constructor(){this.controllers=new He(Qt,"datasets",!0),this.elements=new He(yt,"elements"),this.plugins=new He(Object,"plugins"),this.scales=new He(ne,"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")}removeControllers(...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):W(n,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,i){const n=zs(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 mt=new Qc;class Jc{constructor(){this._init=[]}notify(t,e,i,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));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")),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(){N(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=td(i);return n===!1&&!e?[]:sd(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 td(s){const t={},e=[],i=Object.keys(mt.plugins.items);for(let o=0;o<i.length;o++)e.push(mt.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 ed(s,t){return!t&&s===!1?null:s===!0?{}:s}function sd(s,{plugins:t,localIds:e},i,n){const o=[],a=s.getContext();for(const r of t){const l=r.id,c=ed(i[l],n);c!==null&&o.push({plugin:r,options:id(s.config,{plugin:r,local:e[l]},c,a)})}return o}function id(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 As(s,t){const e=Z.datasets[s]||{};return((t.datasets||{})[s]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function nd(s,t){let e=s;return s==="_index_"?e=t:s==="_value_"&&(e=t==="x"?"y":"x"),e}function od(s,t){return s===t?"_index_":"_value_"}function Bi(s){if(s==="x"||s==="y"||s==="r")return s}function ad(s){if(s==="top"||s==="bottom")return"x";if(s==="left"||s==="right")return"y"}function Os(s,...t){if(Bi(s))return s;for(const e of t){const i=e.axis||ad(e.position)||s.length>1&&Bi(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function Ei(s,t,e){if(e[t+"AxisID"]===s)return{axis:t}}function rd(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 Ei(s,"x",e[0])||Ei(s,"y",e[0])}return{}}function ld(s,t){const e=Yt[s.type]||{scales:{}},i=t.scales||{},n=As(s.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const r=i[a];if(!j(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=Os(a,r,rd(a,s),Z.scales[r.type]),c=od(l,n),d=e.scales||{};o[a]=me(Object.create(null),[{axis:l},r,d[l],d[c]])}),s.data.datasets.forEach(a=>{const r=a.type||s.type,l=a.indexAxis||As(r,t),d=(Yt[r]||{}).scales||{};Object.keys(d).forEach(h=>{const u=nd(h,l),g=a[u+"AxisID"]||u;o[g]=o[g]||Object.create(null),me(o[g],[{axis:u},i[g],d[h]])})}),Object.keys(o).forEach(a=>{const r=o[a];me(r,[Z.scales[r.type],Z.scale])}),o}function Vn(s){const t=s.options||(s.options={});t.plugins=H(t.plugins,{}),t.scales=ld(s,t)}function Yn(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function cd(s){return s=s||{},s.data=Yn(s.data),Vn(s),s}const Hi=new Map,Un=new Set;function je(s,t){let e=Hi.get(s);return e||(e=t(),Hi.set(s,e),Un.add(e)),e}const he=(s,t,e)=>{const i=te(t,e);i!==void 0&&s.add(i)};class dd{constructor(t){this._config=cd(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=Yn(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(),Vn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return je(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return je(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return je(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return je(`${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(h=>he(l,t,h))),d.forEach(h=>he(l,n,h)),d.forEach(h=>he(l,Yt[o]||{},h)),d.forEach(h=>he(l,Z,h)),d.forEach(h=>he(l,Ps,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Un.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Yt[e]||{},Z.datasets[e]||{},{type:e},Z,Ps]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=ji(this._resolverCache,t,n);let l=a;if(ud(a,e)){o.$shared=!1,i=At(i)?i():i;const c=this.createResolver(t,i,r);l=ee(a,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],n){const{resolver:o}=ji(this._resolverCache,t,i);return j(e)?ee(o,e,void 0,n):o}}function ji(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);return o||(o={resolver:Ws(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},i.set(n,o)),o}const hd=s=>j(s)&&Object.getOwnPropertyNames(s).some(t=>At(s[t]));function ud(s,t){const{isScriptable:e,isIndexable:i}=Pn(s);for(const n of t){const o=e(n),a=i(n),r=(a||o)&&s[n];if(o&&(At(r)||hd(r))||a&&Q(r))return!0}return!1}var fd="4.5.0";const gd=["top","bottom","left","right","chartArea"];function Ni(s,t){return s==="top"||s==="bottom"||gd.indexOf(s)===-1&&t==="x"}function Wi(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function Vi(s){const t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),U(e&&e.onComplete,[s],t)}function pd(s){const t=s.chart,e=t.options.animation;U(e&&e.onProgress,[s],t)}function Xn(s){return Us()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const Xe={},Yi=s=>{const t=Xn(s);return Object.values(Xe).filter(e=>e.canvas===t).pop()};function md(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 bd(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}var St;let Vt=(St=class{static register(...t){mt.add(...t),Ui()}static unregister(...t){mt.remove(...t),Ui()}constructor(t,e){const i=this.config=new dd(e),n=Xn(t),o=Yi(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||Rc(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=ur(),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 Jc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ir(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Xe[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}vt.listen(this,"complete",Vi),vt.listen(this,"progress",pd),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return N(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 mt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():gi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return hi(this.canvas,this.ctx),this}stop(){return vt.stop(this),this}resize(t,e){vt.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,gi(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||{};W(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=Os(a,r),c=l==="r",d=l==="x";return{options:r,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),W(o,a=>{const r=a.options,l=r.id,c=Os(l,r),d=H(r.type,a.dtype);(r.position===void 0||Ni(r.position,c)!==Ni(a.dposition))&&(r.position=a.dposition),n[l]=!0;let h=null;if(l in i&&i[l].type===d)h=i[l];else{const u=mt.getScale(d);h=new u({id:l,type:d,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(r,t)}),W(n,(a,r)=>{a||delete i[r]}),W(i,a=>{rt.configure(this,a,a.options),rt.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(Wi("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||As(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=mt.getController(r),{datasetElementType:c,dataElementType:d}=Z.datasets[r];Object.assign(l,{dataElementType:mt.getElement(d),datasetElementType:c&&mt.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){W(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:h}=this.getDatasetMeta(c),u=!n&&o.indexOf(h)===-1;h.buildOrUpdateElements(u),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),n||W(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Wi("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){W(this.scales,t=>{rt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!ei(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;md(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(!ei(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;rt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],W(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,At(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&&(vt.has(this)?this.attached&&!vt.running(this)&&vt.start(this):(this.draw(),Vi({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=Bl(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(n&&js(e,n),t.controller.draw(),n&&Ns(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Se(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const o=gc.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=Ut(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){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);we(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(),vt.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(),hi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Xe[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)};W(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(){W(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},W(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}});!qe(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(h=>d.datasetIndex===h.datasetIndex&&d.index===h.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=xr(t),c=bd(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=!qe(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)}},F(St,"defaults",Z),F(St,"instances",Xe),F(St,"overrides",Yt),F(St,"registry",mt),F(St,"version",fd),F(St,"getChart",Yi),St);function Ui(){return W(Vt.instances,s=>s._plugins.invalidate())}function Kn(s,t,e=t){s.lineCap=H(e.borderCapStyle,t.borderCapStyle),s.setLineDash(H(e.borderDash,t.borderDash)),s.lineDashOffset=H(e.borderDashOffset,t.borderDashOffset),s.lineJoin=H(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=H(e.borderWidth,t.borderWidth),s.strokeStyle=H(e.borderColor,t.borderColor)}function xd(s,t,e){s.lineTo(e.x,e.y)}function yd(s){return s.stepped?Ur:s.tension||s.cubicInterpolationMode==="monotone"?Xr:xd}function qn(s,t,e={}){const i=s.length,{start:n=0,end:o=i-1}=e,{start:a,end:r}=t,l=Math.max(n,a),c=Math.min(o,r),d=n<a&&o<a||n>r&&o>r;return{count:i,start:l,loop:t.loop,ilen:c<l&&!d?i+c-l:c-l}}function _d(s,t,e,i){const{points:n,options:o}=t,{count:a,start:r,loop:l,ilen:c}=qn(n,e,i),d=yd(o);let{move:h=!0,reverse:u}=i||{},g,p,m;for(g=0;g<=c;++g)p=n[(r+(u?c-g:g))%a],!p.skip&&(h?(s.moveTo(p.x,p.y),h=!1):d(s,m,p,u,o.stepped),m=p);return l&&(p=n[(r+(u?c:0))%a],d(s,m,p,u,o.stepped)),!!l}function vd(s,t,e,i){const n=t.points,{count:o,start:a,ilen:r}=qn(n,e,i),{move:l=!0,reverse:c}=i||{};let d=0,h=0,u,g,p,m,b,x;const w=P=>(a+(c?r-P:P))%o,D=()=>{m!==b&&(s.lineTo(d,b),s.lineTo(d,m),s.lineTo(d,x))};for(l&&(g=n[w(0)],s.moveTo(g.x,g.y)),u=0;u<=r;++u){if(g=n[w(u)],g.skip)continue;const P=g.x,C=g.y,S=P|0;S===p?(C<m?m=C:C>b&&(b=C),d=(h*d+P)/++h):(D(),s.lineTo(P,C),p=S,h=0,m=b=C),x=C}D()}function Is(s){const t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?vd:_d}function kd(s){return s.stepped?Sl:s.tension||s.cubicInterpolationMode==="monotone"?Dl:Et}function wd(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),Kn(s,t.options),s.stroke(n)}function Md(s,t,e,i){const{segments:n,options:o}=t,a=Is(t);for(const r of n)Kn(s,o,r.style),s.beginPath(),a(s,t,r,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}const Sd=typeof Path2D=="function";function Dd(s,t,e,i){Sd&&!t.options.segment?wd(s,t,e,i):Md(s,t,e,i)}class ge extends yt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;bl(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Fl(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,a=Ol(this,{property:e,start:n,end:n});if(!a.length)return;const r=[],l=kd(i);let c,d;for(c=0,d=a.length;c<d;++c){const{start:h,end:u}=a[c],g=o[h],p=o[u];if(g===p){r.push(g);continue}const m=Math.abs((n-g[e])/(p[e]-g[e])),b=l(g,p,m,i.stepped);b[e]=t[e],r.push(b)}return r.length===1?r[0]:r}pathSegment(t,e,i){return Is(this)(t,this,e,i)}path(t,e,i){const n=this.segments,o=Is(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const r of n)a&=o(t,this,r,{start:e,end:e+i-1});return!!a}draw(t,e,i,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Dd(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}F(ge,"id","line"),F(ge,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),F(ge,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),F(ge,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Xi(s,t,e,i){const n=s.options,{[e]:o}=s.getProps([e],i);return Math.abs(t-o)<n.radius+n.hitRadius}class Ke extends yt{constructor(e){super();F(this,"parsed");F(this,"skip");F(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,n){const o=this.options,{x:a,y:r}=this.getProps(["x","y"],n);return Math.pow(e-a,2)+Math.pow(i-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,i){return Xi(this,e,"x",i)}inYRange(e,i){return Xi(this,e,"y",i)}getCenterPoint(e){const{x:i,y:n}=this.getProps(["x","y"],e);return{x:i,y:n}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const n=i&&e.borderWidth||0;return(i+n)*2}draw(e,i){const n=this.options;this.skip||n.radius<.1||!Se(this,i,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Ts(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}F(Ke,"id","point"),F(Ke,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),F(Ke,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Gn(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,h;return s.horizontal?(h=a/2,r=Math.min(e,n),l=Math.max(e,n),c=i-h,d=i+h):(h=o/2,r=e-h,l=e+h,c=Math.min(i,n),d=Math.max(i,n)),{left:r,top:c,right:l,bottom:d}}function Pt(s,t,e,i){return s?0:ot(t,e,i)}function Cd(s,t,e){const i=s.options.borderWidth,n=s.borderSkipped,o=Cn(i);return{t:Pt(n.top,o.top,0,e),r:Pt(n.right,o.right,0,t),b:Pt(n.bottom,o.bottom,0,e),l:Pt(n.left,o.left,0,t)}}function Pd(s,t,e){const{enableBorderRadius:i}=s.getProps(["enableBorderRadius"]),n=s.options.borderRadius,o=Gt(n),a=Math.min(t,e),r=s.borderSkipped,l=i||j(n);return{topLeft:Pt(!l||r.top||r.left,o.topLeft,0,a),topRight:Pt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Pt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Pt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Td(s){const t=Gn(s),e=t.right-t.left,i=t.bottom-t.top,n=Cd(s,e/2,i/2),o=Pd(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 vs(s,t,e,i){const n=t===null,o=e===null,r=s&&!(n&&o)&&Gn(s,i);return r&&(n||jt(t,r.left,r.right))&&(o||jt(e,r.top,r.bottom))}function Ad(s){return s.topLeft||s.topRight||s.bottomLeft||s.bottomRight}function Od(s,t){s.rect(t.x,t.y,t.w,t.h)}function ks(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 _e extends yt{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}=Td(this),r=Ad(a.radius)?Qe:Od;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,ks(a,e,o)),t.clip(),r(t,ks(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,ks(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return vs(this,t,e,i)}inXRange(t,e){return vs(this,t,null,e)}inYRange(t,e){return vs(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}}F(_e,"id","bar"),F(_e,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),F(_e,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Ki=(s,t)=>{let{boxHeight:e=t,boxWidth:i=t}=s;return s.usePointStyle&&(e=Math.min(e,t),i=s.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Id=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index;class qi extends yt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=U(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,n)=>t.sort(i,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,n=et(i.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Ki(i,o);let c,d;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,o,r,l)+10):(d=this.maxHeight,c=this._fitCols(a,n,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=n+r;let h=t;o.textAlign="left",o.textBaseline="middle";let u=-1,g=-d;return this.legendItems.forEach((p,m)=>{const b=i+e/2+o.measureText(p.text).width;(m===0||c[c.length-1]+b+2*r>a)&&(h+=d,c[c.length-(m>0?0:1)]=0,g+=d,u++),l[m]={left:0,top:g,row:u,width:b,height:n},c[c.length-1]+=b+r}),h}_fitCols(t,e,i,n){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t;let h=r,u=0,g=0,p=0,m=0;return this.legendItems.forEach((b,x)=>{const{itemWidth:w,itemHeight:D}=Ld(i,e,o,b,n);x>0&&g+D+2*r>d&&(h+=u+r,c.push({width:u,height:g}),p+=u+r,m++,u=g=0),l[x]={left:p,top:g,col:m,width:w,height:D},u=Math.max(u,w),g+=D+r}),h+=u,c.push({width:u,height:g}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:o}}=this,a=Zt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=tt(i,this.left+n,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=tt(i,this.left+n,this.right-this.lineWidths[r])),c.top+=this.top+t+n,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+n}else{let r=0,l=tt(i,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=tt(i,this.top+t+n,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+n,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;js(t,this),this._draw(),Ns(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:o,labels:a}=t,r=Z.color,l=Zt(t.rtl,this.left,this.width),c=et(a.font),{padding:d}=a,h=c.size,u=h/2;let g;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=Ki(a,h),x=function(S,v,y){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;n.save();const M=H(y.lineWidth,1);if(n.fillStyle=H(y.fillStyle,r),n.lineCap=H(y.lineCap,"butt"),n.lineDashOffset=H(y.lineDashOffset,0),n.lineJoin=H(y.lineJoin,"miter"),n.lineWidth=M,n.strokeStyle=H(y.strokeStyle,r),n.setLineDash(H(y.lineDash,[])),a.usePointStyle){const _={radius:m*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:M},T=l.xPlus(S,p/2),k=v+u;Sn(n,_,T,k,a.pointStyleWidth&&p)}else{const _=v+Math.max((h-m)/2,0),T=l.leftForLtr(S,p),k=Gt(y.borderRadius);n.beginPath(),Object.values(k).some(O=>O!==0)?Qe(n,{x:T,y:_,w:p,h:m,radius:k}):n.rect(T,_,p,m),n.fill(),M!==0&&n.stroke()}n.restore()},w=function(S,v,y){De(n,y.text,S,v+b/2,c,{strikethrough:y.hidden,textAlign:l.textAlign(y.textAlign)})},D=this.isHorizontal(),P=this._computeTitleHeight();D?g={x:tt(o,this.left+d,this.right-i[0]),y:this.top+d+P,line:0}:g={x:this.left+d,y:tt(o,this.top+P+d,this.bottom-e[0].height),line:0},Ln(this.ctx,t.textDirection);const C=b+d;this.legendItems.forEach((S,v)=>{n.strokeStyle=S.fontColor,n.fillStyle=S.fontColor;const y=n.measureText(S.text).width,M=l.textAlign(S.textAlign||(S.textAlign=a.textAlign)),_=p+u+y;let T=g.x,k=g.y;l.setWidth(this.width),D?v>0&&T+_+d>this.right&&(k=g.y+=C,g.line++,T=g.x=tt(o,this.left+d,this.right-i[g.line])):v>0&&k+C>this.bottom&&(T=g.x=T+e[g.line].width+d,g.line++,k=g.y=tt(o,this.top+P+d,this.bottom-e[g.line].height));const O=l.x(T);if(x(O,k,S),T=Lr(M,T+p+u,D?T+_:this.right,t.rtl),w(l.x(T),k,S),D)g.x+=_+d;else if(typeof S.text!="string"){const I=c.lineHeight;g.y+=Zn(S,I)+d}else g.y+=C}),Fn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=et(e.font),n=ct(e.padding);if(!e.display)return;const o=Zt(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=i.size/2,c=n.top+l;let d,h=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),d=this.top+c,h=tt(t.align,h,this.right-u);else{const p=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);d=c+tt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=tt(r,h,h+u);a.textAlign=o.textAlign(Es(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,De(a,e.text,g,d,i)}_computeTitleHeight(){const t=this.options.title,e=et(t.font),i=ct(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,o;if(jt(t,this.left,this.right)&&jt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(n=o[i],jt(t,n.left,n.left+n.width)&&jt(e,n.top,n.top+n.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!$d(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=Id(n,i);n&&!o&&U(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!o&&U(e.onHover,[t,i,this],this)}else i&&U(e.onClick,[t,i,this],this)}}function Ld(s,t,e,i,n){const o=Fd(i,s,t,e),a=Rd(n,i,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Fd(s,t,e,i){let n=s.text;return n&&typeof n!="string"&&(n=n.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+i.measureText(n).width}function Rd(s,t,e){let i=s;return typeof t.text!="string"&&(i=Zn(t,e)),i}function Zn(s,t){const e=s.text?s.text.length:0;return t*e}function $d(s,t){return!!((s==="mousemove"||s==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(s==="click"||s==="mouseup"))}var Qn={id:"legend",_element:qi,start(s,t,e){const i=s.legend=new qi({ctx:s.ctx,options:e,chart:s});rt.configure(s,i,e),rt.addBox(s,i)},stop(s){rt.removeBox(s,s.legend),delete s.legend},beforeUpdate(s,t,e){const i=s.legend;rt.configure(s,i,e),i.options=e},afterUpdate(s){const t=s.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(s,t){t.replay||s.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(s,t,e){const i=t.datasetIndex,n=e.chart;n.isDatasetVisible(i)?(n.hide(i),t.hidden=!0):(n.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:s=>s.chart.options.color,boxWidth:40,padding:10,generateLabels(s){const t=s.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=s.legend.options;return s._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),d=ct(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}};class Jn extends yt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,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.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=Q(i.text)?i.text.length:1;this._padding=ct(i.padding);const o=n*et(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:n,right:o,options:a}=this,r=a.align;let l=0,c,d,h;return this.isHorizontal()?(d=tt(r,i,o),h=e+t,c=o-i):(a.position==="left"?(d=i+t,h=tt(r,n,e),l=J*-.5):(d=o-t,h=tt(r,e,n),l=J*.5),c=n-e),{titleX:d,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=et(e.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);De(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Es(e.align),textBaseline:"middle",translation:[a,r]})}}function zd(s,t){const e=new Jn({ctx:s.ctx,options:t,chart:s});rt.configure(s,e,t),rt.addBox(s,e),s.titleBlock=e}var to={id:"title",_element:Jn,start(s,t,e){zd(s,e)},stop(s){const t=s.titleBlock;rt.removeBox(s,t),delete s.titleBlock},beforeUpdate(s,t,e){const i=s.titleBlock;rt.configure(s,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const pe={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=Cs(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 pt(s,t){return t&&(Q(t)?Array.prototype.push.apply(s,t):s.push(t)),s}function kt(s){return(typeof s=="string"||s instanceof String)&&s.indexOf(`
17`)>-1?s.split(`
18`):s}function Bd(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 Gi(s,t){const e=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:a,boxHeight:r}=t,l=et(t.bodyFont),c=et(t.titleFont),d=et(t.footerFont),h=o.length,u=n.length,g=i.length,p=ct(t.padding);let m=p.height,b=0,x=i.reduce((P,C)=>P+C.before.length+C.lines.length+C.after.length,0);if(x+=s.beforeBody.length+s.afterBody.length,h&&(m+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),x){const P=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;m+=g*P+(x-g)*l.lineHeight+(x-1)*t.bodySpacing}u&&(m+=t.footerMarginTop+u*d.lineHeight+(u-1)*t.footerSpacing);let w=0;const D=function(P){b=Math.max(b,e.measureText(P).width+w)};return e.save(),e.font=c.string,W(s.title,D),e.font=l.string,W(s.beforeBody.concat(s.afterBody),D),w=t.displayColors?a+2+t.boxPadding:0,W(i,P=>{W(P.before,D),W(P.lines,D),W(P.after,D)}),w=0,e.font=d.string,W(s.footer,D),e.restore(),b+=p.width,{width:b,height:m}}function Ed(s,t){const{y:e,height:i}=t;return e<i/2?"top":e>s.height-i/2?"bottom":"center"}function Hd(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 jd(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"),Hd(c,s,t,e)&&(c="center"),c}function Zi(s,t,e){const i=e.yAlign||t.yAlign||Ed(s,e);return{xAlign:e.xAlign||t.xAlign||jd(s,t,e,i),yAlign:i}}function Nd(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Wd(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function Qi(s,t,e,i){const{caretSize:n,caretPadding:o,cornerRadius:a}=s,{xAlign:r,yAlign:l}=e,c=n+o,{topLeft:d,topRight:h,bottomLeft:u,bottomRight:g}=Gt(a);let p=Nd(t,r);const m=Wd(t,l,c);return l==="center"?r==="left"?p+=c:r==="right"&&(p-=c):r==="left"?p-=Math.max(d,u)+n:r==="right"&&(p+=Math.max(h,g)+n),{x:ot(p,0,i.width-t.width),y:ot(m,0,i.height-t.height)}}function Ne(s,t,e){const i=ct(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function Ji(s){return pt([],kt(s))}function Vd(s,t,e){return Ut(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function tn(s,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}const eo={beforeTitle:_t,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:_t,beforeBody:_t,beforeLabel:_t,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 N(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:_t,afterBody:_t,beforeFooter:_t,footer:_t,afterFooter:_t};function st(s,t,e,i){const n=s[t].call(e,i);return typeof n>"u"?eo[t].call(e,i):n}class Ls extends yt{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 $n(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Vd(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=pt(r,kt(n)),r=pt(r,kt(o)),r=pt(r,kt(a)),r}getBeforeBody(t,e){return Ji(st(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return W(t,o=>{const a={before:[],lines:[],after:[]},r=tn(i,o);pt(a.before,kt(st(r,"beforeLabel",this,o))),pt(a.lines,st(r,"label",this,o)),pt(a.after,kt(st(r,"afterLabel",this,o))),n.push(a)}),n}getAfterBody(t,e){return Ji(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=pt(r,kt(n)),r=pt(r,kt(o)),r=pt(r,kt(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(Bd(this.chart,e[l]));return t.filter&&(r=r.filter((d,h,u)=>t.filter(d,h,u,i))),t.itemSort&&(r=r.sort((d,h)=>t.itemSort(d,h,i))),W(r,d=>{const h=tn(t.callbacks,d);n.push(st(h,"labelColor",this,d)),o.push(st(h,"labelPointStyle",this,d)),a.push(st(h,"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});else{const r=pe[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=Gi(this,i),c=Object.assign({},r,l),d=Zi(this.chart,i,c),h=Qi(i,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:h.x,y:h.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:h}=Gt(r),{x:u,y:g}=t,{width:p,height:m}=e;let b,x,w,D,P,C;return o==="center"?(P=g+m/2,n==="left"?(b=u,x=b-a,D=P+a,C=P-a):(b=u+p,x=b+a,D=P-a,C=P+a),w=b):(n==="left"?x=u+Math.max(l,d)+a:n==="right"?x=u+p-Math.max(c,h)-a:x=this.caretX,o==="top"?(D=g,P=D-a,b=x-a,w=x+a):(D=g+m,P=D+a,b=x+a,w=x-a),C=D),{x1:b,x2:x,x3:w,y1:D,y2:P,y3:C}}drawTitle(t,e,i){const n=this.title,o=n.length;let a,r,l;if(o){const c=Zt(i.rtl,this.x,this.width);for(t.x=Ne(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=et(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=et(o.bodyFont),h=Ne(this,"left",o),u=n.x(h),g=l<d.lineHeight?(d.lineHeight-l)/2:0,p=e.y+g;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},b=n.leftForLtr(u,c)+c/2,x=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ts(t,m,b,x),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Ts(t,m,b,x)}else{t.lineWidth=j(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 m=n.leftForLtr(u,c),b=n.leftForLtr(n.xPlus(u,1),c-2),x=Gt(a.borderRadius);Object.values(x).some(w=>w!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Qe(t,{x:m,y:p,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Qe(t,{x:b,y:p+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(b,p+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,h=et(i.bodyFont);let u=h.lineHeight,g=0;const p=Zt(i.rtl,this.x,this.width),m=function(y){e.fillText(y,p.x(t.x+g),t.y+u/2),t.y+=u+o},b=p.textAlign(a);let x,w,D,P,C,S,v;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Ne(this,b,i),e.fillStyle=i.bodyColor,W(this.beforeBody,m),g=r&&b!=="right"?a==="center"?c/2+d:c+2+d:0,P=0,S=n.length;P<S;++P){for(x=n[P],w=this.labelTextColors[P],e.fillStyle=w,W(x.before,m),D=x.lines,r&&D.length&&(this._drawColorBox(e,t,P,p,i),u=Math.max(h.lineHeight,l)),C=0,v=D.length;C<v;++C)m(D[C]),u=h.lineHeight;W(x.after,m)}g=0,u=h.lineHeight,W(this.afterBody,m),t.y-=o}drawFooter(t,e,i){const n=this.footer,o=n.length;let a,r;if(o){const l=Zt(i.rtl,this.x,this.width);for(t.x=Ne(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=et(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:h,topRight:u,bottomLeft:g,bottomRight:p}=Gt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+h,l),a==="top"&&this.drawCaret(t,e,i,n),e.lineTo(r+c-u,l),e.quadraticCurveTo(r+c,l,r+c,l+u),a==="center"&&o==="right"&&this.drawCaret(t,e,i,n),e.lineTo(r+c,l+d-p),e.quadraticCurveTo(r+c,l+d,r+c-p,l+d),a==="bottom"&&this.drawCaret(t,e,i,n),e.lineTo(r+g,l+d),e.quadraticCurveTo(r,l+d,r,l+d-g),a==="center"&&o==="left"&&this.drawCaret(t,e,i,n),e.lineTo(r,l+h),e.quadraticCurveTo(r,l,r+h,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=pe[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=Gi(this,t),l=Object.assign({},a,this._size),c=Zi(e,t,l),d=Qi(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=ct(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),Ln(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Fn(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=!qe(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||!qe(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=pe[o.position].call(this,t,e);return a!==!1&&(i!==a.x||n!==a.y)}}F(Ls,"positioners",pe);var so={id:"tooltip",_element:Ls,positioners:pe,afterInit(s,t,e){e&&(s.tooltip=new Ls({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:eo},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 Yd=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Ud(s,t,e,i){const n=s.indexOf(t);if(n===-1)return Yd(s,t,e,i);const o=s.lastIndexOf(t);return n!==o?e:n}const Xd=(s,t)=>s===null?null:ot(Math.round(s),0,t);function en(s){const t=this.getLabels();return s>=0&&s<t.length?t[s]:s}class es extends ne{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(N(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Ud(i,t,H(e,t),this._addedLabels),Xd(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 en.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}}F(es,"id","category"),F(es,"defaults",{ticks:{callback:en}});function Kd(s,t){const e=[],{bounds:n,step:o,min:a,max:r,precision:l,count:c,maxTicks:d,maxDigits:h,includeBounds:u}=s,g=o||1,p=d-1,{min:m,max:b}=t,x=!N(a),w=!N(r),D=!N(c),P=(b-m)/(h+1);let C=ii((b-m)/p/g)*g,S,v,y,M;if(C<1e-14&&!x&&!w)return[{value:m},{value:b}];M=Math.ceil(b/C)-Math.floor(m/C),M>p&&(C=ii(M*C/p/g)*g),N(l)||(S=Math.pow(10,l),C=Math.ceil(C*S)/S),n==="ticks"?(v=Math.floor(m/C)*C,y=Math.ceil(b/C)*C):(v=m,y=b),x&&w&&o&&wr((r-a)/o,C/1e3)?(M=Math.round(Math.min((r-a)/C,d)),C=(r-a)/M,v=a,y=r):D?(v=x?a:v,y=w?r:y,M=c-1,C=(y-v)/M):(M=(y-v)/C,be(M,Math.round(M),C/1e3)?M=Math.round(M):M=Math.ceil(M));const _=Math.max(ni(C),ni(v));S=Math.pow(10,N(l)?_:l),v=Math.round(v*S)/S,y=Math.round(y*S)/S;let T=0;for(x&&(u&&v!==a?(e.push({value:a}),v<a&&T++,be(Math.round((v+T*C)*S)/S,a,sn(a,P,s))&&T++):v<a&&T++);T<M;++T){const k=Math.round((v+T*C)*S)/S;if(w&&k>r)break;e.push({value:k})}return w&&u&&y!==r?e.length&&be(e[e.length-1].value,r,sn(r,P,s))?e[e.length-1].value=r:e.push({value:r}):(!w||y===r)&&e.push({value:y}),e}function sn(s,t,{horizontal:e,minRotation:i}){const n=Ht(i),o=(e?Math.sin(n):Math.cos(n))||.001,a=.75*t*(""+s).length;return Math.min(t/o,a)}class qd extends ne{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 N(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=xt(n),c=xt(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=Kd(n,o);return t.bounds==="ticks"&&Mr(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 wn(t,this.chart.options.locale,this.options.ticks.format)}}class ss extends qd{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=lt(t)?t:0,this.max=lt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Ht(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}}F(ss,"id","linear"),F(ss,"defaults",{ticks:{callback:Mn.formatters.numeric}});const ls={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}},nt=Object.keys(ls);function nn(s,t){return s-t}function on(s,t){if(N(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)),lt(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(n&&(a=n==="week"&&(Me(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,n)),+a)}function an(s,t,e,i){const n=nt.length;for(let o=nt.indexOf(s);o<n-1;++o){const a=ls[nt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=i)return nt[o]}return nt[n-1]}function Gd(s,t,e,i,n){for(let o=nt.length-1;o>=nt.indexOf(e);o--){const a=nt[o];if(ls[a].common&&s._adapter.diff(n,i,a)>=t-1)return a}return nt[e?nt.indexOf(e):0]}function Zd(s){for(let t=nt.indexOf(s)+1,e=nt.length;t<e;++t)if(ls[nt[t]].common)return nt[t]}function rn(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 Qd(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 ln(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:Qd(s,i,n,e)}class is extends ne{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={}),n=this._adapter=new cc._date(t.adapters.date);n.init(e),me(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:on(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))}
vendor: 6,170 bytes, line 18
18(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=lt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),o=lt(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=Ar(n,o,a);return this._unit=e.unit||(i.autoSkip?an(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Gd(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Zd(this._unit),this.initOffsets(n),t.reverse&&r.reverse(),ln(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=ot(e,0,a),i=ot(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||an(o.minUnit,e,i,this._getLabelCapacity(e)),r=H(n.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Me(l)||l===!0,d={};let h=e,u,g;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,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 p=n.ticks.source==="data"&&this.getDataTimestamps();for(u=h,g=0;u<i;u=+t.add(u,r,a),g++)rn(d,u,p);return(u===i||n.bounds==="ticks"||g===1)&&rn(d,u,p),Object.keys(d).sort(nn).map(m=>+m)}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],h=c&&r[c],u=i[e],g=c&&h&&u&&u.major;return this._adapter.format(t,n||(g?h: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=Ht(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,ln(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(on(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return _n(t.sort(nn))}}F(is,"id","time"),F(is,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function We(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}=Nt(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}=Nt(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 cn extends is{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=We(e,this.min),this._tableRange=We(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(We(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return We(this._table,i*this._tableRange+this._minPos,!0)}}F(cn,"id","timeseries"),F(cn,"defaults",is.defaults);const io={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Jd={ariaLabel:{type:String},ariaDescribedby:{type:String}},th={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...io,...Jd},eh=bo[0]==="2"?(s,t)=>Object.assign(s,{attrs:t}):(s,t)=>Object.assign(s,t);
18function Kt(s){return un(s)?Ss(s):s}function sh(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;return un(t)?new Proxy(s,{}):s}function ih(s,t){const e=s.options;e&&t&&Object.assign(e,t)}function no(s,t){s.labels=t}function oo(s,t,e){const i=[];s.datasets=t.map(n=>{const o=s.datasets.find(a=>a[e]===n[e]);return!o||!n.data||i.includes(o)?{...n}:(i.push(o),Object.assign(o,n),o)})}function nh(s,t){const e={labels:[],datasets:[]};return no(e,s.labels),oo(e,s.datasets,t),e}const oh=dn({props:th,setup(s,t){let{expose:e,slots:i}=t;const n=V(null),o=hn(null);e({chart:o});const a=()=>{if(!n.value)return;const{type:c,data:d,options:h,plugins:u,datasetIdKey:g}=s,p=nh(d,g),m=sh(p,d);o.value=new Vt(n.value,{type:c,data:m,options:{...h},plugins:u})},r=()=>{const c=Ss(o.value);c&&(s.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},s.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(s.updateMode)};return Jt(a),xo(r),ie([()=>s.options,()=>s.data],(c,d)=>{let[h,u]=c,[g,p]=d;const m=Ss(o.value);if(!m)return;let b=!1;if(h){const x=Kt(h),w=Kt(g);x&&x!==w&&(ih(m,x),b=!0)}if(u){const x=Kt(u.labels),w=Kt(p.labels),D=Kt(u.datasets),P=Kt(p.datasets);x!==w&&(no(m.config.data,x),b=!0),D&&D!==P&&(oo(m.config.data,D,s.datasetIdKey),b=!0)}b&&yo(()=>{l(m)})},{deep:!0}),()=>Ms("canvas",{role:"img",ariaLabel:s.ariaLabel,ariaDescribedby:s.ariaDescribedby,ref:n},[Ms("p",{},[i.default?i.default():""])])}});function ah(s,t){return Vt.register(t),dn({props:io,setup(e,i){let{expose:n}=i;const o=hn(null),a=r=>{o.value=r==null?void 0:r.chart};return n({chart:o}),()=>Ms(oh,eh({ref:a},{type:s,...e}))}})}const ao=ah("bar",Ve),rh={class:"chart-card transform hover:-translate-y-1 transition-all duration-300"},lh={key:0,class:"flex justify-center items-center py-6"},ch={key:1,class:"bg-red-50 dark:bg-red-900/20 p-4 rounded-xl text-red-600 dark:text-red-400 text-sm border border-red-200 dark:border-red-800"},dh={class:"flex items-center"},hh={key:2,class:"card-content"},uh={class:"flex items-center justify-between mb-4"},fh={class:"text-sm text-gray-600 dark:text-gray-400 flex items-center"},gh={class:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4"},ph={class:"stat-card bg-gradient-to-br from-purple-50 to-indigo-100 dark:from-purple-900/30 dark:to-indigo-900/20 p-5 rounded-xl shadow-md border border-purple-200 dark:border-purple-800 transition-all duration-300 hover:shadow-lg transform hover:-translate-y-1"},mh={class:"flex items-start"},bh={class:"bg-purple-600 text-white p-3 rounded-xl shadow-md mr-4"},xh={class:"flex items-baseline"},yh={class:"text-4xl font-extrabold text-purple-600 dark:text-purple-400 shimmer-number"},_h={class:"text-xs text-purple-600/70 dark:text-purple-400/70 mt-1"},vh={class:"stat-card bg-gradient-to-br from-green-50 to-emerald-100 dark:from-green-900/30 dark:to-emerald-900/20 p-5 rounded-xl shadow-md border border-green-200 dark:border-green-800 transition-all duration-300 hover:shadow-lg transform hover:-translate-y-1"},kh={class:"flex items-start"},wh={class:"bg-green-600 text-white p-3 rounded-xl shadow-md mr-4"},Mh={class:"flex items-baseline"},Sh={class:"text-4xl font-extrabold text-green-600 dark:text-green-400 shimmer-number"},Dh={class:"text-xs text-green-600/70 dark:text-green-400/70 mt-1"},Ch={class:"mb-6 grid grid-cols-2 md:grid-cols-4 gap-4"},Ph={class:"stat-card bg-white dark:bg-gray-800 p-4 rounded-xl shadow-md border border-gray-200 dark:border-gray-700 transition-all duration-300 hover:shadow-lg hover:border-emerald-300 dark:hover:border-emerald-700"},Th={class:"flex justify-between items-start"},Ah={class:"text-2xl font-bold text-emerald-600 dark:text-emerald-400"},Oh={class:"bg-emerald-100 dark:bg-emerald-900/30 p-2 rounded-lg"},Ih={class:"stat-card bg-white dark:bg-gray-800 p-4 rounded-xl shadow-md border border-gray-200 dark:border-gray-700 transition-all duration-300 hover:shadow-lg hover:border-indigo-300 dark:hover:border-indigo-700"},Lh={class:"flex justify-between items-start"},Fh={class:"text-2xl font-bold text-indigo-600 dark:text-indigo-400"},Rh={class:"bg-indigo-100 dark:bg-indigo-900/30 p-2 rounded-lg"},$h={class:"stat-card bg-white dark:bg-gray-800 p-4 rounded-xl shadow-md border border-gray-200 dark:border-gray-700 transition-all duration-300 hover:shadow-lg hover:border-blue-300 dark:hover:border-blue-700"},zh={class:"flex justify-between items-start"}
18,Bh={class:"text-2xl font-bold text-blue-600 dark:text-blue-400"},Eh={class:"bg-blue-100 dark:bg-blue-900/30 p-2 rounded-lg"},Hh={class:"stat-card bg-white dark:bg-gray-800 p-4 rounded-xl shadow-md border border-gray-200 dark:border-gray-700 transition-all duration-300 hover:shadow-lg hover:border-green-300 dark:hover:border-green-700"},jh={class:"flex justify-between items-start"},Nh={class:"text-2xl font-bold text-green-600 dark:text-green-400"},Wh={class:"bg-green-100 dark:bg-green-900/30 p-2 rounded-lg"},Vh={key:0,class:"empty-data-state flex flex-col items-center justify-center my-6 py-8"},Yh={key:1,class:"chart-wrapper bg-white dark:bg-gray-800 p-4 rounded-xl border border-gray-200 dark:border-gray-700 shadow-md interactive-chart",style:{height:"400px",width:"100%"}},Uh={__name:"TotalPeriodoChart",props:{dateRange:{type:Object,default:()=>({startDate:null,endDate:null})}},setup(s,{expose:t}){Vt.register(es,ss,_e,to,so,Qn),Vt.defaults.set("plugins.tooltip",{enabled:!0,mode:"index",intersect:!1,position:"nearest"}),Vt.defaults.set("interaction",{mode:"index",intersect:!1});const e=S=>{console.log("Mouse sobre o gráfico TotalPeriodo")},i=s,n=V([]),o=V(.33),a=V(!0),r=V(""),l=X(()=>!n.value||n.value.length===0?0:n.value.reduce((S,v)=>S+v.interactionCount,0)),c=X(()=>!n.value||n.value.length===0?0:n.value.reduce((S,v)=>S+v.chatCount,0)),d=X(()=>!c.value||c.value===0?0:l.value/c.value),h=X(()=>Math.round(l.value*o.value*100)/100),u=X(()=>!n.value||n.value.length===0?0:Math.round(l.value/n.value.length)),g=X(()=>{var S,v;try{const y=(S=i.dateRange)!=null&&S.startDate?D(i.dateRange.startDate):"",M=(v=i.dateRange)!=null&&v.endDate?D(i.dateRange.endDate):"";return`${y} até ${M}`}catch(y){return console.error("Erro ao formatar datas:",y),""}}),p=X(()=>{if(!n.value||n.value.length===0)return{labels:[],datasets:[]};const S=[...n.value].sort((k,O)=>new Date(k.date)-new Date(O.date)),v=S.map(k=>D(k.date)),y=S.map(k=>k.interactionCount),M=S.map(k=>k.chatCount),_=S.map(k=>"rgba(124, 58, 237, 0.7)"),T=S.map(k=>"rgba(16, 185, 129, 0.7)");return{labels:v,datasets:[{label:"Interações",data:y,backgroundColor:_,borderColor:"rgba(124, 58, 237, 1)",borderWidth:1,borderRadius:6,maxBarThickness:30},{label:"Chats",data:M,backgroundColor:T,borderColor:"rgba(16, 185, 129, 1)",borderWidth:1,borderRadius:6,maxBarThickness:30}]}}),m=X(()=>({responsive:!0,maintainAspectRatio:!1,layout:{padding:{bottom:25}},plugins:{legend:{position:"top",labels:{font:{family:"'Inter', sans-serif",size:12},color:"#6b7280",usePointStyle:!0,pointStyle:"circle"}},tooltip:{backgroundColor:"rgba(255, 255, 255, 0.95)",titleColor:"#1f2937",bodyColor:"#4b5563",titleFont:{size:14,weight:"bold",family:"'Inter', sans-serif"},bodyFont:{size:13,family:"'Inter', sans-serif"},padding:12,boxPadding:6,usePointStyle:!0,borderColor:"rgba(226, 232, 240, 1)",borderWidth:1,callbacks:{title:function(S){return`Data: ${S[0].label}`},label:function(S){let v=b(S.raw||0),y=S.dataset.label||"";return y==="Interações"?`Interações: ${v}`:y==="Chats"?`Chats: ${v}`:`${y}: ${v}`},afterBody:function(S){if(S.length>=2){const v=S[0].raw||0,y=S[1].raw||0;let M=[];if(y>0){const T=v/y;M.push(`Interações por Chat: ${x(T)}`)}const _=v*o.value;return M.push(`Valor: ${w(_)}`),M}return[]}}}},scales:{x:{title:{display:!0,text:"Data",font:{family:"'Inter', sans-serif",size:13},color:"#6b7280"},ticks:{font:{family:"'Inter', sans-serif",size:12},color:"#6b7280",maxRotation:45,autoSkip:!0,maxTicksLimit:15},grid:{display:!1}},y:{title:{display:!0,text:"Quantidade",font:{family:"'Inter', sans-serif",size:13},color:"#6b7280"},ticks:{font:{family:"'Inter', sans-serif",size:12},color:"#6b7280",precision:0},grid:{color:"rgba(226, 232, 240, 0.5)"},beginAtZero:!0}},interaction:{intersect:!1,mode:"index",events:["mousemove","mouseout","click","touchstart","touchmove"],hoverBackgroundColor:"rgba(124, 58, 237, 0.8)",hoverBorderColor:"rgba(124, 58, 237, 1)"}})),b=S=>new Intl.NumberFormat("pt-BR").format(S),x=S=>new Intl.NumberFormat("pt-BR",{minimumFractionDigits:1,maximumFractionDigits:1}).format(S),w=S=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(S),D=S=>{if(!S)return"";try{const[v,y,M]=S.split("-");return`${M}/${y}/${v}`}catch(v){return console.error("Erro ao formatar data:",S,v),S}},P=async()=>{var S,v;if(console.log("TotalPeriodoChart: Buscando dados..."),!((S=i.dateRange)!=null&&S.startDate)||!((v=i.dateRange)!=null&&v.endDate)){console.log("TotalPeriodoChart: Datas não fornecidas");return}a.value=!0,r.value="";try{console.log(`TotalPeriodoChart: Período de ${i.dateRange.startDate} até ${i.dateRange.endDate}`);const y=`${i.dateRange.startDate}T00:00:00`,M=`${i.dateRange.endDate}T23:59:59.999`;console.log(`TotalPeriodoChart: Filtro de ${y} até ${M}`);const _=await ut(ht("bo_interacao_botclient",{aggregate:{count:["*"]},filter:{created_at_brasilia:{_between:[y,M]}},groupBy:["year(created_at_brasilia)","month(created_at_brasilia)","day(created_at_brasilia)"],sort:["year(created_at_brasilia)","month(created_at_brasilia)","day(created_at_brasilia)"]}));
18console.log("TotalPeriodoChart: Resposta interações agrupadas por dia:",_);const T=await ut(ht("bo_chat",{aggregate:{count:["*"]},filter:{date_created_brasilia:{_between:[y,M]}},groupBy:["year(date_created_brasilia)","month(date_created_brasilia)","day(date_created_brasilia)"],sort:["year(date_created_brasilia)","month(date_created_brasilia)","day(date_created_brasilia)"]}));console.log("TotalPeriodoChart: Resposta chats agrupados por dia:",T);const k=new Map;Array.isArray(_)&&_.length>0&&_.forEach(O=>{const I=O.created_at_brasilia_year,A=String(O.created_at_brasilia_month).padStart(2,"0"),$=String(O.created_at_brasilia_day).padStart(2,"0"),R=`${I}-${A}-${$}`;k.set(R,{date:R,interactionCount:parseInt(O.count,10)||0,chatCount:0,dailyCost:.33})}),Array.isArray(T)&&T.length>0&&T.forEach(O=>{const I=O.date_created_brasilia_year,A=String(O.date_created_brasilia_month).padStart(2,"0"),$=String(O.date_created_brasilia_day).padStart(2,"0"),R=`${I}-${A}-${$}`;if(k.has(R)){const q=k.get(R);q.chatCount=parseInt(O.count,10)||0,k.set(R,q)}else k.set(R,{date:R,interactionCount:0,chatCount:parseInt(O.count,10)||0})}),n.value=Array.from(k.values()),n.value.length===0?console.warn("TotalPeriodoChart: Nenhum dado encontrado para o período"):console.log(`TotalPeriodoChart: Processados ${n.value.length} dias de dados`),o.value=.33,console.log("TotalPeriodoChart: Usando custo padrão por interação"),console.log(`TotalPeriodoChart: Resultado: ${n.value.length} dias com dados`)}catch(y){console.error("TotalPeriodoChart: Erro ao buscar dados:",y),r.value="Erro ao carregar dados",n.value=[]}finally{a.value=!1}};ie(()=>{var S,v;return[(S=i.dateRange)==null?void 0:S.startDate,(v=i.dateRange)==null?void 0:v.endDate]},()=>{console.log("TotalPeriodoChart: dateRange mudou, atualizando..."),P()},{deep:!0,immediate:!1});const C=()=>{console.log("TotalPeriodoChart: Refresh chamado externamente"),P()};return Jt(()=>{console.log("TotalPeriodoChart: Componente montado"),P()}),t({refresh:C}),(S,v)=>{const y=ns;return E(),B("div",rh,[v[10]||(v[10]=f("div",{class:"absolute top-0 left-0 w-full h-2 bg-gradient-to-r from-purple-400 via-purple-600 to-purple-500 opacity-80"},null,-1)),v[11]||(v[11]=f("div",{class:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-bl from-purple-500/20 to-transparent rounded-full transform -translate-y-1/2 translate-x-1/2 blur-xl"},null,-1)),v[12]||(v[12]=f("div",{class:"card-header mb-4"},[f("h2",{class:"text-xl font-bold text-gray-800 dark:text-gray-100"},"Evolução de Desempenho")],-1)),a.value?(E(),B("div",lh,v[0]||(v[0]=[f("div",{class:"typing-indicator mx-auto"},[f("span"),f("span"),f("span")],-1)]))):r.value?(E(),B("div",ch,[f("div",dh,[v[1]||(v[1]=f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5 mr-2 text-red-500"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})],-1)),f("p",null,z(r.value),1)])])):(E(),B("div",hh,[f("div",uh,[f("div",fh,[v[2]||(v[2]=f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 mr-1 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),f("span",null,z(g.value),1)])]),f("div",gh,[f("div",ph,[f("div",mh,[f("div",bh,[L(y,{name:"i-heroicons-chat-bubble-left-right",class:"w-10 h-10"})]),f("div",null,[v[3]||(v[3]=f("h3",{class:"text-lg font-medium text-gray-700 dark:text-gray-300 mb-1"},"Total de Interações",-1)),f("div",xh,[f("span",yh,z(b(l.value)),1)]),f("p",_h,"Período: "+z(g.value),1)])])]),f("div",vh,[f("div",kh,[f("div",wh,[L(y,{name:"i-heroicons-banknotes",class:"w-10 h-10"})]),f("div",null,[v[4]||(v[4]=f("h3",{class:"text-lg font-medium text-gray-700 dark:text-gray-300 mb-1"},"Valor Total",-1)),f("div",Mh,[f("span",Sh,z(w(h.value)),1)]),f("p",Dh,z(b(l.value))+" × "+z(w(o.value))+" por interação",1)])])])]),f("div",Ch,[f("div",Ph,[f("div",Th,[f("div",null,[v[5]||
18(v[5]=f("div",{class:"text-sm text-gray-500 dark:text-gray-400"},"Total de Chats",-1)),f("div",Ah,z(b(c.value)),1)]),f("div",Oh,[L(y,{name:"i-heroicons-chat-bubble-oval-left",class:"w-5 h-5 text-emerald-600 dark:text-emerald-400"})])])]),f("div",Ih,[f("div",Lh,[f("div",null,[v[6]||(v[6]=f("div",{class:"text-sm text-gray-500 dark:text-gray-400"},"Interações por Chat",-1)),f("div",Fh,z(x(d.value)),1)]),f("div",Rh,[L(y,{name:"i-heroicons-calculator",class:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})])])]),f("div",$h,[f("div",zh,[f("div",null,[v[7]||(v[7]=f("div",{class:"text-sm text-gray-500 dark:text-gray-400"},"Interações Diárias",-1)),f("div",Bh,z(b(u.value)),1)]),f("div",Eh,[L(y,{name:"i-heroicons-bolt",class:"w-5 h-5 text-blue-600 dark:text-blue-400"})])])]),f("div",Hh,[f("div",jh,[f("div",null,[v[8]||(v[8]=f("div",{class:"text-sm text-gray-500 dark:text-gray-400"},"Valor Diário",-1)),f("div",Nh,z(w(u.value*o.value)),1)]),f("div",Wh,[L(y,{name:"i-heroicons-currency-dollar",class:"w-5 h-5 text-green-600 dark:text-green-400"})])])])]),n.value.length===0?(E(),B("div",Vh,v[9]||(v[9]=[f("div",{class:"empty-chart-icon-container mb-3"},[f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-8 h-8 text-gray-500"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3v11.25A2.25 2.25 0 006 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0118 16.5h-2.25m-7.5 0h7.5m-7.5 0l-1 3m8.5-3l1 3m0 0l.5 1.5m-.5-1.5h-9.5m0 0l-.5 1.5M9 11.25v1.5M12 9v3.75m3-6v6"})])],-1),f("div",{class:"text-base text-gray-600 dark:text-gray-400"},"Nenhum dado disponível para o período selecionado",-1)]))):(E(),B("div",Yh,[L(Y(ao),{data:p.value,options:m.value,class:"chart-canvas",onMousemove:e},null,8,["data","options"])]))]))])}}},Xh=os(Uh,[["__scopeId","data-v-2a89715d"]]),$t={adjustToUTC:(s,t=!1)=>{if(!s)return console.log("adjustToUTC: dateStr is empty"),"";console.log(`adjustToUTC: Processing dateStr=${s}, isEndOfDay=${t}`);try{const e=s.split("-");console.log("adjustToUTC: Date parts: ",e);const i=Number(e[0]),n=Number(e[1]),o=Number(e[2]);if(console.log(`adjustToUTC: Parsed values - year=${i}, month=${n}, day=${o}`),isNaN(i)||isNaN(n)||isNaN(o))return console.error(`adjustToUTC: Invalid date parts - year=${i}, month=${n}, day=${o}`),new Date().toISOString();const a=new Date(i,n-1,o);if(isNaN(a.getTime()))return console.error("adjustToUTC: Created date is invalid"),new Date().toISOString();t?a.setHours(23,59,59,999):a.setHours(0,0,0,0);const r=a.toISOString();return console.log(`adjustToUTC: Final result: ${r}`),r}catch(e){return console.error(`adjustToUTC: Error processing date ${s}:`,e),new Date().toISOString()}},calculateStartDate:(s,t)=>{if(!s)return"";const e=new Date(s);switch(t){case"week":e.setDate(e.getDate()-7);break;case"month":e.setDate(e.getDate()-30);break}const i=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0");return`${i}-${n}-${o}`},getYesterdayDate:s=>{try{const t=s.split("-"),e=Number(t[0]),i=Number(t[1]),n=Number(t[2]),o=new Date(Date.UTC(e,i-1,n));return o.setUTCDate(o.getUTCDate()-1),o.toISOString().split("T")[0]}catch(t){return console.error("Error getting yesterday's date:",t),s}},getLastWeekDate:s=>{try{const t=s.split("-"),e=Number(t[0]),i=Number(t[1]),n=Number(t[2]),o=new Date(Date.UTC(e,i-1,n));return o.setUTCDate(o.getUTCDate()-7),o.toISOString().split("T")[0]}catch(t){return console.error("Error getting last week's date:",t),s}},formatHourToBrasilia:s=>`${parseInt(String(s),10).toString().padStart(2,"0")}:00`,formatHour:s=>`${parseInt(String(s),10).toString().padStart(2,"0")}:00`,formatDateToBrasilia:s=>{if(!s)return"";try{const t=new Date(s),e={day:"2-digit",month:"2-digit",year:"numeric",timeZone:"America/Sao_Paulo"};return t.toLocaleDateString("pt-BR",e)}catch(t){return console.error(`Error formatting date: ${s}`,t),s}},formatDateShort:s=>{if(!s)return"";try{const[t,e,i]=s.split("-").map(Number);return`${String(i).padStart(2,"0")}/${String(e).padStart(2,"0")}`}catch(t){return console.error(`Error formatting short date ${s}:`,t),s}},formatNumber:s=>new Intl.NumberFormat("pt-BR").format(s)};function Kh(){const t=(()=>{try{const k=new Date,O=k.getFullYear(),I=String(k.getMonth()+1).padStart(2,"0"),A=String(k.getDate()).padStart(2,"0");return`${O}-${I}-${A}`}catch(k){return console.error("Error getting today in Brasilia:",k),new Date().toISOString().split("T")[0]}})(),e=$t.getYesterdayDate(t),i=$t.getLastWeekDate(t);console.log(`Data de hoje: ${t}`),console.log(`Data de ontem: ${e}`),console.log(`Data da semana passada: ${i}`);const n=`interactions-hourly-today-${t}-${Date.now()}`,o=`interactions-hourly-yesterday-${e}-${Date.now()}`,a=`interactions-hourly-lastweek-${i}-${Date.now()}`,r=V([]),l=V(!0),c=V(null),d=k=>{try{const O=k.includes("T")?k.split("T")[1].split(":")[0]:k.split(" ")[1].split(":")[0];return parseInt(O,10)}catch(O){return console.error("Erro ao extrair hora da data:",k,O),0}},h=k=>{const O=new Map;for(let I=0;I<24;I++)O.set(I,0);
18return k.forEach(I=>{if(I.created_at_brasilia){const A=d(I.created_at_brasilia);O.set(A,(O.get(A)||0)+1)}}),O},{data:u,pending:g,error:p,refresh:m}=cs(n,async()=>{try{console.log(`Buscando interações de hoje: ${t}`);const k=await ut(ht("bo_interacao_botclient",{fields:["id","created_at_brasilia"],filter:{created_at_brasilia:{_gte:`${t} 00:00:00`,_lte:`${t} 23:59:59`}},limit:-1}));return console.log(`Encontradas ${(k==null?void 0:k.length)||0} interações para hoje`),Array.isArray(k)?k:[]}catch(k){return console.error("Erro ao buscar interações de hoje:",k),[]}},{server:!1}),{data:b,pending:x,error:w,refresh:D}=cs(o,async()=>{try{console.log(`Buscando interações de ontem: ${e}`);const k=await ut(ht("bo_interacao_botclient",{fields:["id","created_at_brasilia"],filter:{created_at_brasilia:{_gte:`${e} 00:00:00`,_lte:`${e} 23:59:59`}},limit:-1}));return console.log(`Encontradas ${(k==null?void 0:k.length)||0} interações para ontem`),Array.isArray(k)?k:[]}catch(k){return console.error("Erro ao buscar interações de ontem:",k),[]}},{server:!1}),{data:P,pending:C,error:S,refresh:v}=cs(a,async()=>{try{console.log(`Buscando interações da semana passada: ${i}`);const k=await ut(ht("bo_interacao_botclient",{fields:["id","created_at_brasilia"],filter:{created_at_brasilia:{_gte:`${i} 00:00:00`,_lte:`${i} 23:59:59`}},limit:-1}));return console.log(`Encontradas ${(k==null?void 0:k.length)||0} interações para semana passada`),Array.isArray(k)?k:[]}catch(k){return console.error("Erro ao buscar interações da semana passada:",k),[]}},{server:!1}),y=()=>{var k,O,I;try{if(console.log("Processando dados de análise por hora..."),!u.value||!b.value||!P.value)return console.log("Dados incompletos:",{today:!!u.value,yesterday:!!b.value,lastWeek:!!P.value}),[];console.log("Dados brutos recebidos:",{today:((k=u.value)==null?void 0:k.length)||0,yesterday:((O=b.value)==null?void 0:O.length)||0,lastWeek:((I=P.value)==null?void 0:I.length)||0});const A=h(u.value),$=h(b.value),R=h(P.value),q=Array.from({length:24},(K,G)=>({hora:G,hoje:A.get(G)||0,ontem:$.get(G)||0,semana_anterior:R.get(G)||0}));console.log("Dados processados:",q);const dt=q.some(K=>K.hoje>0||K.ontem>0||K.semana_anterior>0);return console.log("Tem algum dado não-zero?",dt),q}catch(A){return console.error("Erro ao processar dados de análise por hora:",A),c.value=A instanceof Error?A:new Error(String(A)),[]}},M=()=>{var k,O,I;return console.log("Recalculando dados de hora em hora..."),g.value||x.value||C.value?(console.log("Aguardando carregamento de todos os dados..."),[]):(l.value=!1,p.value||w.value||S.value?(console.error("Erro em uma das solicitações:",{today:(k=p.value)==null?void 0:k.message,yesterday:(O=w.value)==null?void 0:O.message,lastWeek:(I=S.value)==null?void 0:I.message}),c.value=p.value||w.value||S.value,[]):(console.log("Todos os dados carregados, processando..."),y()))};r.value=[],ie([u,b,P,g,x,C],()=>{console.log("Dados ou estado de carregamento alterados, atualizando gráfico..."),r.value=M()},{immediate:!0,deep:!0});const _=()=>(console.log("Iniciando refresh de dados de análise por hora..."),l.value=!0,c.value=null,Promise.all([m(),D(),v()]).then(()=>{console.log("Todos os dados foram atualizados, processando..."),r.value=y(),l.value=!1;const k=r.value.reduce((A,$)=>A+$.hoje,0),O=r.value.reduce((A,$)=>A+$.ontem,0),I=r.value.reduce((A,$)=>A+$.semana_anterior,0);return console.log("Totais após processamento:",{hoje:k,ontem:O,semanaAnterior:I}),r.value}).catch(k=>(console.error("Erro ao atualizar dados de análise por hora:",k),c.value=k instanceof Error?k:new Error(String(k)),l.value=!1,[]))),T={hoje:$t.formatDateToBrasilia(t),ontem:$t.formatDateToBrasilia(e),semana_anterior:$t.formatDateToBrasilia(i)};return{data:r,pending:l,error:c,refresh:_,displayDates:T,formatDate:$t.formatDateToBrasilia,formatNumber:$t.formatNumber}}const qh=window.setInterval,Gh={class:"chart-card no-hover-transform"},Zh={key:0,class:"flex justify-center items-center py-6"},Qh={key:1,class:"bg-red-50 dark:bg-red-900/20 p-4 rounded-xl text-red-600 dark:text-red-400 text-sm border border-red-200 dark:border-red-800"},Jh={class:"flex items-center"},tu={key:2,class:"empty-data-state flex flex-col items-center justify-center my-6 py-8"},eu={key:3,class:"card-content"},su={class:"flex items-center justify-between mb-4"},iu={class:"text-sm text-gray-600 dark:text-gray-400 flex items-center"},nu={class:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4"},ou={class:"stat-card bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-blue-900/30 dark:to-indigo-900/20 p-5 rounded-xl shadow-md border border-blue-200 dark:border-blue-800 transition-all duration-300 hover:shadow-lg transform hover:-translate-y-1"},au={class:"flex items-start"},ru={class:"bg-blue-600 text-white p-3 rounded-xl shadow-md mr-4"},lu={class:"flex items-baseline"}
18,cu={class:"text-4xl font-extrabold text-blue-600 dark:text-blue-400 shimmer-number"},du={class:"mt-1 text-xs flex items-center"},hu={class:"stat-card bg-white dark:bg-gray-800 p-4 rounded-xl shadow-md border border-gray-200 dark:border-gray-700 transition-all duration-300 hover:shadow-lg hover:border-purple-300 dark:hover:border-purple-700"},uu={class:"flex justify-between items-start"},fu={class:"text-2xl font-bold text-purple-600 dark:text-purple-400"},gu={class:"bg-purple-100 dark:bg-purple-900/30 p-2 rounded-lg"},pu={class:"stat-card bg-white dark:bg-gray-800 p-4 rounded-xl shadow-md border border-gray-200 dark:border-gray-700 transition-all duration-300 hover:shadow-lg hover:border-green-300 dark:hover:border-green-700"},mu={class:"flex justify-between items-start"},bu={class:"text-2xl font-bold text-green-600 dark:text-green-400"},xu={class:"mt-1 text-xs"},yu={class:"bg-green-100 dark:bg-green-900/30 p-2 rounded-lg"},_u={class:"chart-wrapper bg-white dark:bg-gray-800 p-4 rounded-xl border border-gray-200 dark:border-gray-700 shadow-md interactive-chart",style:{height:"400px",width:"100%"}},vu={__name:"HourlyAnalysisChart",props:{dateRange:{type:Object,default:()=>({startDate:null,endDate:null})}},setup(s,{expose:t}){Vt.register(es,ss,_e,Ke,ge,Ye,to,so,Qn);const e=s,{data:i,pending:n,error:o,refresh:a,displayDates:r,formatNumber:l}=Kh();Jt(()=>{console.log("HourlyAnalysisChart montado, iniciando busca de dados..."),a()}),ie(()=>e.dateRange,()=>{console.log("HourlyAnalysisChart: dateRange alterado, atualizando dados..."),a()},{deep:!0});const c=V(new Date().getHours());Jt(()=>{qh(()=>{c.value=new Date().getHours()},6e4)});const d=X(()=>{var x;return((x=i.value)==null?void 0:x.reduce((w,D)=>w+D.hoje,0))||0}),h=X(()=>{var x;return((x=i.value)==null?void 0:x.reduce((w,D)=>w+D.ontem,0))||0}),u=X(()=>{var x;return((x=i.value)==null?void 0:x.reduce((w,D)=>w+D.semana_anterior,0))||0}),g=X(()=>h.value===0?0:((d.value-h.value)/h.value*100).toFixed(1)),p=X(()=>u.value===0?0:((d.value-u.value)/u.value*100).toFixed(1)),m=X(()=>{var w;return(w=i.value)!=null&&w.length?{labels:Array.from({length:24},(D,P)=>`${P.toString().padStart(2,"0")}:00`),datasets:[{type:"bar",label:"Hoje",backgroundColor:"#3b82f6",data:i.value.map(D=>D.hoje),borderRadius:4,maxBarThickness:40},{type:"line",label:"Ontem",borderColor:"#8b5cf6",borderWidth:2,pointBackgroun
18dColor:"#8b5cf6",pointRadius:4,pointHoverRadius:6,fill:!1,data:i.value.map(D=>D.ontem),tension:.1},{type:"line",label:"Semana Anterior",borderColor:"#10b981",borderWidth:2,borderDash:[5,5],pointBackgroundColor:"#10b981",pointRadius:4,pointHoverRadius:6,fill:!1,data:i.value.map(D=>D.semana_anterior),tension:.1}]}:{labels:[],datasets:[]}}),b=X(()=>({responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"top",labels:{font:{family:"'Inter', sans-serif",size:12},color:"#6b7280"}},tooltip:{backgroundColor:"rgba(255, 255, 255, 0.95)",titleColor:"#1f2937",bodyColor:"#4b5563",titleFont:{size:14,weight:"bold",family:"'Inter', sans-serif"},bodyFont:{size:13,family:"'Inter', sans-serif"},padding:12,boxPadding:6,usePointStyle:!0,borderColor:"rgba(226, 232, 240, 1)",borderWidth:1,callbacks:{title:function(x){return`Horário: ${x[0].label}`},label:function(x){const w=l(x.raw||0);return`${x.dataset.label}: ${w} interações`},afterBody:function(x){var w;if(x.length>=2){const D=x[0].raw||0,P=x[1].raw||0,C=((w=x[2])==null?void 0:w.raw)||0,S=D-P,v=P?(S/P*100).toFixed(1):0,y=D-C,M=C?(y/C*100).toFixed(1):0,_=[];if(P>0||D>0){const T=`vs Ontem: ${S>=0?"+":""}${S} (${v>=0?"+":""}${v}%)`;_.push(T)}if(C>0||D>0){const T=`vs Semana Anterior: ${y>=0?"+":""}${y} (${M>=0?"+":""}${M}%)`;_.push(T)}return _}return[]}}}},scales:{x:{title:{display:!0,text:"Horário",font:{family:"'Inter', sans-serif",size:13},color:"#6b7280"},ticks:{font:{family:"'Inter', sans-serif",size:12},color:x=>parseInt(x.tick.label.split(":")[0],10)===c.value?"#3b82f6":"#6b7280",maxRotation:45,autoSkip:!1},grid:{display:!1}},y:{title:{display:!0,text:"Interações",font:{family:"'Inter', sans-serif",size:13},color:"#6b7280"},ticks:{font:{family:"'Inter', sans-serif",size:12},color:"#6b7280",precision:0},grid:{color:"rgba(226, 232, 240, 0.5)"},beginAtZero:!0}}}));return t({refresh:a}),(x,w)=>{var P;const D=ns;return E(),B("div",Gh,[w[7]||(w[7]=f("div",{class:"absolute top-0 left-0 w-full h-2 bg-gradient-to-r from-blue-400 via-purple-600 to-green-500 opacity-80"},null,-1)),w[8]||(w[8]=f("div",{class:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-bl from-blue-500/20 to-transparent rounded-full transform -translate-y-1/2 translate-x-1/2 blur-xl"},null,-1)),w[9]||(w[9]=f("div",{class:"card-header mb-4"},[f("h2",{class:"text-xl font-bold text-gray-800 dark:text-gray-100"},"Análise Horária")],-1)),Y(n)?(E(),B("div",Zh,w[0]||(w[0]=[f("div",{class:"typing-indicator mx-auto"},[f("span"),f("span"),f("span")],-1)]))):Y(o)?(E(),B("div",Qh,[f("div",Jh,[w[1]||(w[1]=f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5 mr-2 text-red-500"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})],-1)),f("p",null,z(Y(o).message),1)])])):(P=Y(i))!=null&&P.length?(E(),B("div",eu,[f("div",su,[f("div",iu,[w[3]||(w[3]=f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 mr-1 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),f("span",null,"Comparação: Hoje ("+z(Y(r).hoje)+") vs Ontem ("+z(Y(r).ontem)+") vs "+z(Y(r).semana_anterior),1)])]),f("div",nu,[f("div",ou,[f("div",au,[f("div",ru,[L(D,{name:"i-heroicons-bolt",class:"w-10 h-10"})]),f("div",null,[w[4]||(w[4]=f("h3",{class:"text-lg font-medium text-gray-700 dark:text-gray-300 mb-1"},"Total Hoje",-1)),f("div",lu,[f("span",cu,z(Y(l)(d.value)),1)]),f("div",du,[f("span",{class:it([g.value>0?"text-green-600 dark:text-green-400":g.value<0?"text-red-600 dark:text-red-400":"text-gray-500"])},[L(D,{name:g.value>0?"i-heroicons-arrow-trending-up":g.value<0?"i-heroicons-arrow-trending-down":"i-heroicons-minus",class:"w-3 h-3 mr-1 inline-block"},null,8,["name"]),qt(" "+z(g.value>0?"+":"")+z(g.value)+"% vs ontem ",1)],2)])])])]),f("div",hu,[f("div",uu,[f("div",null,[w[5]||(w[5]=f("div",{class:"text-sm text-gray-500 dark:text-gray-400"},"Total Ontem",-1)),f("div",fu,z(Y(l)(h.value)),1)]),f("div",gu,[L(D,{name:"i-heroicons-clock",class:"w-5 h-5 text-purple-600 dar
18k:text-purple-400"})])])]),f("div",pu,[f("div",mu,[f("div",null,[w[6]||(w[6]=f("div",{class:"text-sm text-gray-500 dark:text-gray-400"},"Total Semana Anterior",-1)),f("div",bu,z(Y(l)(u.value)),1),f("div",xu,[f("span",{class:it([p.value>0?"text-green-500":p.value<0?"text-red-500":"text-gray-500"])},z(p.value>0?"+":"")+z(p.value)+"% vs semana anterior ",3)])]),f("div",yu,[L(D,{name:"i-heroicons-calendar",class:"w-5 h-5 text-green-600 dark:text-green-400"})])])])]),f("div",_u,[L(Y(ao),{data:m.value,options:b.value,class:"chart-canvas",onMousemove:x.onChartHover},null,8,["data","options","onMousemove"])])])):(E(),B("div",tu,w[2]||(w[2]=[f("div",{class:"empty-chart-icon-container mb-3"},[f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-8 h-8 text-gray-500"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3v11.25A2.25 2.25 0 006 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0118 16.5h-2.25m-7.5 0h7.5m-7.5 0l-1 3m8.5-3l1 3m0 0l.5 1.5m-.5-1.5h-9.5m0 0l-.5 1.5M9 11.25v1.5M12 9v3.75m3-6v6"})])],-1),f("div",{class:"text-base text-gray-600 dark:text-gray-400"},"Nenhum dado disponível para o período selecionado",-1)])))])}}},ku=os(vu,[["__scopeId","data-v-ff73c17b"]]),wu={class:"container py-6"},Mu={key:0,class:"w-full h-screen flex items-center justify-center"},Su={class:"w-full mb-6 bg-white dark:bg-gray-900 shadow-lg rounded-xl p-6 relative overflow-hidden filter-card transform transition-all duration-500 hover:shadow-2xl border border-gray-100 dark:border-gray-800"},Du={key:0,class:"absolute bottom-0 left-0 w-full h-1 bg-gray-200 dark:bg-gray-700"},Cu={class:"relative mb-10"},Pu={class:"relative z-10 mx-auto max-w-5xl transform hover:scale-[1.01] transition-all duration-500"},Tu={class:"relative rounded-2xl overflow-hidden backdrop-blur-sm border border-white/50 dark:border-gray-700/50 shadow-2xl bg-gradient-to-br from-white/80 to-white/60 dark:from-gray-800/80 dark:to-gray-800/60"},Au={class:"relative px-8 py-6 flex flex-col md:flex-row items-center md:items-start gap-6"},Ou={class:"flex-1 text-center md:text-left pt-2"},Iu={class:"flex items-center justify-center md:justify-start text-sm md:text-base text-gray-600 dark:text-gray-300 subtitle-animation"},Lu={class:"mr-3 p-1.5 bg-primary-100 dark:bg-primary-900/40 rounded-lg pulse-subtle"},Fu={class:"max-w-4xl mx-auto"},Ru={class:"mb-5 text-center"},$u={class:"inline-block px-5 py-2 bg-primary-50 dark:bg-primary-900/30 rounded-full text-primary-600 dark:text-primary-400 font-medium text-sm shadow-sm"},zu={class:"flex items-center space-x-2"},Bu={key:0},Eu={key:1},Hu={key:2},ju={key:3},Nu={key:4},Wu={class:"flex flex-wrap gap-3 mb-5 justify-center"},Vu={class:"grid grid-cols-1 md:grid-cols-2 gap-5 mb-6"},Yu={class:"relative fd-input-container"},Uu={class:"relative fd-input-container"},Xu={class:"action-button-container w-full mx-auto"},Ku={class:"flex items-center justify-center space-x-3"},qu={class:"text-base font-medium relative"},Gu={class:"mb-6"},Zu={class:"bg-white dark:bg-gray-900 shadow-lg rounded-xl p-6 relative overflow-hidden transform transition-all duration-500 hover:shadow-xl border border-gray-100 dark:border-gray-800"},Qu={class:"mb-6"},Ju={class:"bg-white dark:bg-gray-900 shadow-lg rounded-xl p-6 relative overflow-hidden transform transition-all duration-500 hover:shadow-xl border border-gray-100 dark:border-gray-800"},tf={class:"mb-6"},ef={class:"bg-white dark:bg-gray-900 shadow-lg rounded-xl p-6 relative overflow-hidden transform transition-all duration-500 hover:shadow-xl border border-gray-100 dark:border-gray-800"},sf={class:"flex items-center mb-4 group"},nf={class:"mt-2 flex items-center"},of={class:"inline-flex items-center px-3 py-1 bg-amber-50 dark:bg-amber-900/30 rounded-full text-amber-600 dark:text-amber-400 text-xs font-medium"},af={class:"ml-1 font-bold"},rf={__name:"painel-inteligente",setup(s){const t=V(!0),e=()=>{const M=new Date,_=M.getFullYear(),T=String(M.getMonth()+1).padStart(2,"0"),k=String(M.getDate()).padStart(2,"0");return`${_}-${T}-${k}`},i=e();console.log(`Data inicial configurada para hoje: ${i}`);const n=V(i),o=V(i),a=_o({startDate:n.value||i,endDate:o.value||i});ie([n,o],([M,_])=>{M&&(a.startDate=M),_&&(a.endDate=_)});const r=V(null),l=V(null),c=V(null),d=V(!1);function h(){console.log(`Aplicando filtros e atualizando dados: startDate=${n.value}, endDate=${o.value}`),d.value=!0;const M=document.querySelector("#shimmerBar");M&&M.classList.add("animate-shimmer");const _=n.value||i,T=o.value||i,k=/^\d{4}-\d{2}-\d{2}$/;(!k.test(_)||!k.test(T))&&(console.error("Formato de data inválido:",_,T),n.value=i,o.value=i),a.startDate=n.value,a.endDate=o.value,u()}function u(){console.log("Atualizando todos os componentes");const M=document.querySelector("#shimmerBar");M&&M.classList.add("animate-shimmer"),d.value=!0;let _=0;const T=3,k=()=>{_++,console.log(`Componente atualizado: ${_}/${T}`),_>=T&&setTimeout(()=>{const I=document.querySelector("#shimmerBar");I&&I.classList.remove("animate-shimmer"),d.value=!1},700)},O=(I,A)=>{if(I&&typeof I.refresh=="function"){console.log(`Atualizando ${A}`);try{const $=I.refresh();$&&typeof $.then=="function"?$.then(()=>{console.log(`${A} atualizado com sucesso`),k()}).catch(R=>{console.error(`Erro ao atualizar ${A}:`,R),k()}):(console.log(`${A} atualizado (sem Promise)`),k())}catch($){console.error(`Erro ao chamar refresh em ${A}:`,$),k()}}else console.warn(`${A} não está disponível ou não possui método refresh`),k()};try{O(r.value,"gráfico do Período"),O(l.value,"gráfico de análise por hora"),O(c.value,"tabela dos Funcionários Digitais")}catch(I){console.error("Erro ao atualizar componentes:",I);const A=document.querySelector("#shimmerBar");A&&A.classList.remove("animate-shimmer")}}function g(){const M=document.querySelector("#shimmerBar");M&&M.classList.add("animate-shimmer"),h(),setTimeout(()=>{const _=document.querySelector("#shimmerBar");_&&_.classList.remove("animate-shimmer")},5e3)}Jt(()=>{setTimeout(()=>{t.value=!1},300),g()});function p(){const M=e();n.value=M,o.value=M,h()}function m(){const M=new Date,_=new Date(M);_.setDate(M.getDate()-6),o.value=e(),n.value=w(_),h()}function b(){const M=new Date,_=new Date(M.getFullYear(),M.getMonth(),1);n.value=w(_),o.value=e(),h()}function x(){const M=new Date,_=new Date(M.getFullYear(),M.getMonth()-1,1),T=new Date(M.getFullYear(),M.getMonth(),0);n.value=w(_),o.value=w(T),h()}function w(M){const _=M.getFullYear(),T=String(M.getMonth()+1).padStart(2,"0"),k=String(M.getDate()).padStart(2,"0");return`${_}-${T}-${k}`}const D=X(()=>`${P(n.value)} — ${P(o.value)}`);function P(M){if(!M)return"";const _=M.split("-");return _.length!==3?M:`${_[2]}/${_[1]}/${_[0]}`}const C=X(()=>{const M=e();return n.value===M&&o.value===M}),S=X(()=>{const M=new Date,_=new Date(M);_.setDate(M.getDate()-6);const T=w(_),k=e();return n.value===T&&o.value===k}),v=X(()=>{const M=new Date,_=new Date(M.getFullYear(),M.getMonth(),1),T=w(_),k=e();return n.value===T&&o.value===k}),y=X(()=>{const M=new Date,_=new Date(M.getFullYear(),M.getMonth()-1,1),T=new Date(M.getFullYear(),M.getMonth(),0),k=w(_),O=w(T);return n.value===k&&o.value===O});return(M,_)=>{const T=ns,k=co,O=ho,I=uo;return E(),B("div",wu,[t.value?(E(),B("div",Mu,_[2]||(_[2]=[f("div",{class:"typing-indicator mx-auto"},[f("span"),f("span"),f("span")],-1)]))):(E(),B(ws,{key:1},[_[30]||(_[30]=Te('<div class="mb-8 pb-3 relative dashboard-title-container overflow-hidden" data-v-4187c9b8><div class="absolute top-0 right-0 w-64 h-64 bg-gradient-to-bl from-primary-300/10 to-transparent roun
18ded-full transform -translate-y-1/3 translate-x-1/4 blur-3xl" data-v-4187c9b8></div><div class="flex items-center space-x-3" data-v-4187c9b8><div class="dashboard-icon-container p-2 bg-gradient-to-br from-primary-500 to-primary-600 rounded-xl shadow-lg transform transition-all duration-500 hover:scale-105 hover:rotate-3" data-v-4187c9b8><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="w-8 h-8 text-white dashboard-icon" data-v-4187c9b8><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 3v11.25A2.25 2.25 0 006 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0118 16.5h-2.25m-7.5 0h7.5m-7.5 0l-1 3m8.5-3l1 3m0 0l.5 1.5m-.5-1.5h-9.5m0 0l-.5 1.5m.75-9l3-3 2.148 2.148A12.061 12.061 0 0116.5 7.605" data-v-4187c9b8></path></svg></div><div class="relative z-10" data-v-4187c9b8><h1 class="text-3xl md:text-4xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-primary-600 to-primary-400 tracking-tight dashboard-title" data-v-4187c9b8> Painel Inteligente </h1><p class="text-sm text-gray-500 dark:text-gray-400 mt-1 max-w-2xl dashboard-subtitle" data-v-4187c9b8><span data-v-4187c9b8>Monitoramento avançado e análise de desempenho dos seus Funcionários Digitais</span></p><div class="absolute -bottom-2 left-0 h-1 w-32 bg-gradient-to-r from-primary-500 to-primary-300 rounded-full dashboard-title-underline" data-v-4187c9b8></div></div></div></div>',1)),f("div",Su,[f("div",{id:"shimmerBar",class:it(["absolute top-0 left-0 w-full h-1.5 bg-gradient-to-r from-primary-400 via-primary-600 to-primary-300 opacity-80",{"animate-shimmer":d.value}])},null,2),_[22]||(_[22]=f("div",{class:"absolute top-0 right-0 w-40 h-40 bg-gradient-to-bl from-primary-500/10 to-transparent rounded-full transform -translate-y-1/2 translate-x-1/2 blur-2xl"},null,-1)),_[23]||(_[23]=f("div",{class:"absolute bottom-0 left-0 w-32 h-32 bg-gradient-to-tr from-primary-500/10 to-transparent rounded-full transform translate-y-1/2 -translate-x-1/3 blur-2xl"},null,-1)),d.value?(E(),B("div",Du,_[3]||(_[3]=[f("div",{class:"h-full bg-primary-500 animate-pulse-width"},null,-1)]))):zt("",!0),f("div",Cu,[_[11]||(_[11]=f("div",{class:"absolute -top-10 -left-10 w-48 h-48 bg-gradient-to-tr from-primary-400/30 via-amber-300/20 to-transparent rounded-full blur-xl opacity-80"},null,-1)),_[12]||(_[12]=f("div",{class:"absolute -bottom-10 -right-10 w-48 h-48 bg-gradient-to-bl from-primary-500/30 via-blue-400/20 to-transparent rounded-full blur-xl opacity-80"},null,-1)),_[13]||(_[13]=f("div",{class:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-full h-full bg-gradient-to-r from-primary-500/5 via-transparent to-primary-500/5 rounded-full blur-3xl"},null,-1)),f("div",Pu,[_[9]||(_[9]=f("div",{class:"absolute inset-0 bg-white/40 dark:bg-gray-800/40 rounded-2xl transform rotate-1 translate-x-1 translate-y-1 border border-white/20 dark:border-gray-700/20 blur-[2px]"},null,-1)),_[10]||(_[10]=f("div",{class:"absolute inset-0 bg-white/60 dark:bg-gray-800/60 rounded-2xl transform -rotate-1 -translate-x-1 -translate-y-1 border border-white/30 dark:border-gray-700/30 blur-[1px]"},null,-1)),f("div",Tu,[_[8]||(_[8]=f("div",{class:"absolute inset-0 bg-gradient-to-br from-primary-500/10 via-trans
18parent to-amber-500/10 dark:from-primary-600/20 dark:via-transparent dark:to-amber-600/20 animate-gradient-slow"},null,-1)),f("div",Au,[_[7]||(_[7]=Te('<div class="relative perspective-icon" data-v-4187c9b8><div class="w-24 h-24 bg-gradient-to-br from-primary-600 to-primary-800 rounded-2xl shadow-lg transform rotate-12 hover:rotate-6 transition-transform duration-500 overflow-hidden icon-3d" data-v-4187c9b8><div class="absolute inset-0 bg-gradient-to-tr from-transparent via-white/10 to-white/20" data-v-4187c9b8></div><div class="w-full h-full flex items-center justify-center relative" data-v-4187c9b8><div class="absolute w-full h-full" data-v-4187c9b8><div class="absolute w-3 h-3 rounded-full bg-white/80 top-2 left-1/2 transform -translate-x-1/2 orbit-animation-1" data-v-4187c9b8></div><div class="absolute w-2 h-2 rounded-full bg-white/60 top-1 right-3 orbit-animation-2" data-v-4187c9b8></div><div class="absolute w-1.5 h-1.5 rounded-full bg-white/40 bottom-3 left-3 orbit-animation-3" data-v-4187c9b8></div><div class="absolute w-1 h-1 rounded-full bg-white/30 bottom-2 right-2 orbit-animation-4" data-v-4187c9b8></div></div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" class="w-12 h-12 text-white transform transition-all duration-500 icon-pulse" data-v-4187c9b8><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5" data-v-4187c9b8></path></svg><div class="absolute inset-0 ring-ripple-container" data-v-4187c9b8><div class="ring-ripple ring-ripple-1" data-v-4187c9b8></div><div class="ring-ripple ring-ripple-2" data-v-4187c9b8></div><div class="ring-ripple ring-ripple-3" data-v-4187c9b8></div></div></div></div><div class="absolute -bottom-2 left-1/2 w-20 h-6 bg-black/20 dark:bg-black/40 blur-md rounded-full transform -translate-x-1/2 icon-shadow" data-v-4187c9b8></div></div>',1)),f("div",Ou,[_[5]||(_[5]=f("h3",{class:"text-3xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-primary-600 via-primary-500 to-primary-700 tracking-tight mb-3 transform transition-all duration-500 hover:scale-[1.01] title-shadow"}," Linha do Tempo de Interações ",-1)),_[6]||(_[6]=f("div",{class:"relative h-1 w-36 mx-auto md:mx-0 mb-4 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700"},[f("div",{class:"h-full w-full bg-gradient-to-r from-primary-600 via-primary-400 to-primary-600 animate-flowing-gradient rounded-full"})],-1)),f("div",Iu,[f("div",Lu,[L(T,{name:"i-heroicons-chart-bar",class:"w-5 h-5 text-primary-600 dark:text-primary-400"})]),_[4]||(_[4]=f("p",{class:"max-w-xl leading-relaxed"},[qt(" Configure o "),f("span",{class:"font-medium text-primary-700 dark:text-primary-400"},"intervalo temporal"),qt(" para análise de performance dos "),f("span",{class:"font-medium text-primary-700 dark:text-primary-400"},"Funcionários Digitais")],-1))])])])])])]),f("div",Fu,[f("div",Ru,[f("div",$u,[f("div",zu,[L(T,{name:"i-heroicons-calendar",class:"w-4 h-4"}),C.value?(E(),B("span",Bu,"Hoje")):S.value?(E(),B("span",Eu,"Últimos 7 dias")):v.value?(E(),B("span",Hu,"Este mês")):y.value?(E(),B("span",ju,"Mês anterior")):(E(),B("span",Nu,"Período personalizado: "+z(D.value),1))])])]),f("div",Wu,[f("button",{onClick:p,class:it(["px-4 py-2 border rounded-lg text-sm transition-colors duration-200 flex items-center justify-center space-x-2 shadow-sm hover:shadow w-full md:w-auto",C.value?"bg-primary-100 dark:bg-primary-800/40 border-primary-300 dark:border-primary-700 text-primary-700 dark:text-primary-300":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 text-gray-700 dark:text-gray-300 hover:bg-primary-50 dark:hover:bg-primary-900/30 hover:border-primary-200 dark:hover:border-primary-700"])},[L(T,{name:C.value?"i-heroicons-check-circle":"i-heroicons-calendar-days",class:"w-4 h-4 text-primary-600 dark:text-primary-400 flex-shrink-0"},null,8,["name"]),_[14]||(_[14]=f("span",null,"Hoje",-1))],2),f("button",{onClick:m,class:it(["px-4 py-2 border rounded-lg text-sm transition-colors duration-200 flex items-center justify-center space-x-2 shadow-sm hover:shadow w-full md:w-auto",S.value?"bg-primary-100 dark:bg-primary-800/40 border-primary-300 dark:border-primary-700 text-primary-700 dark:text-primary-300":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 text-gray-700 dark:text-gray-300 hover:bg-primary-50 dark:hover:bg-primary-900/30 hover:border-primary-200 dark:hover:border-primary-700"])},[L(T,{name:S.value?"i-heroicons-check-circle":"i-heroicons-calendar-days",class:"w-4 h-4 text-primary-600 dark:text-primary-400 flex-shrink-0"},null,8,["name"]),_[15]||(_[15]=f("span",null,"Últimos 7 dias",-1))],2),f("button",{onClick:b,class:it(["px-4 py-2 border rounded-lg text-sm transition-colors duration-200 flex items-center justify-center space-x-2 shadow-sm hover:shadow w-full md:w-auto",v.value?"bg-primary-100 dark:bg-primary-800/40 border-primary-300 dark:border-primary-700 text-primary-700 dark:text-primary-300":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 text-gray-700 dark:text-gray-300 hover:bg-primary-50 dark:hover:bg-primary-900/30 hover:border-primary-200 dark:hover:border-primary-700"])},[L(T,{name:v.value?"i-heroicons-check-circle":"i-heroicons-calendar-days",class:"w-4 h-4 text-primary-600 dark:text-primary-400 flex-shrink-0"},null,8,["name"]),_[16]||(_[16]=f("span",null,"Este mês",-1))],2),f("button",{onClick:x,class:it(["px-4 py-2 border rounded-lg text-sm transition-colors duration-200 flex items-center justify-center space-x-2 shadow-sm hover:shadow w-full md:w-auto",y.value?"bg-primary-100 dark:bg-primary-800/40 border-primary-300 dark:border-primary-700 text-primary-700 dark:text-primary-300":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 text-gray-700 dark:text-gray-300 hover:bg-primary-50 dark:hover:bg-primary-900/30 hover:border-primary-200 dark:hover:border-primary-700"])},[L(T,{name:y.value?"i-heroicons-check-circle":"i-heroicons-calendar-days",class:"w-4 h-4 text-primary-600 dark:text-primary-400 flex-shrink-0"},null,8,["name"]),_[17]||(_[17]=f("span",null,"Mês anterior",-1))],2)]),f("div",Vu,[L(O,{label:"Data Inicial",class:"space-y-1"},{default:ds(()=>[f("div",Yu,[L(k,{modelValue:n.value,"onUpdate:modelValue":_[0]||(_[0]=A=>n.value=A),type:"date",class:"focus-effect transition-all duration-300 hover:shadow-sm",size:"lg",icon:"i-heroicons-calendar",color:"primary",ui:{icon:{trailing:{pointer:""}},base:"relative w-full focus-within:ring-1",rounded:"rounded-xl"}},null,8,["modelValue"])])]),_:1}),L(O,{label:"Data Final",class:"space-y-1"},{default:ds(()=>[f("div",Uu,[L(k,{modelValue:o.value,"onUpdate:modelValue":_[1]||(_[1]=A=>o.value=A),type:"date",class:"focus-effect transition-all duration-300 hover:shadow-sm",size:"lg",icon:"i-heroicons-calendar",color:"primary",ui:{icon:{trailing:{pointer:""}},base:"relative w-full focus-within:ring-1",rounded:"rounded-xl"}},null,8,["modelValue"])])]),_:1})]),f("div",Xu,[L(I,{onClick:h,color:"primary",size:"lg",block:"",disabled:d.value,class:"action-button-primary transform transition-all duration-300 hover:scale-[1.01] hover:-translate-y-0.5 hover:shadow-lg group relative overflow-hidden",ui:{rounded:"rounded-xl",padding:{lg:"py-4 px-4"}}},{default:ds(()=>[f("div",Ku,[L(T,{name:"i-heroicons-bolt",class:"w-5 h-5 transition-transform duration-300 group-hover:scale-110"}),f("span",qu,z(d.value?"Carregando...":"Atualizar Dados"),1),L(T,{name:(d.value,"i-heroicons-arrow-path"),class:it(["w-5 h-5 transition-all duration-700 group-hover:rotate-180",{"animate-spin":d.value}])},null,8,["name","class"])]),_[18]||(_[18]=f("div",{class:"action-button-shine"},null,-1)),_[19]||(_[19]=f("div",{class:"confetti-container absolute inset-0 pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-300"},[f("div",{class:"confetti-piece left-1/4 top-0 bg-yellow-400"}),f("div",{class:"confetti-piece left-1/3 top-0 bg-primary-300"}),f("div",{class:"confetti-piece left-1/2 top-0 bg-green-400"}),f("div",{class:"confetti-piece left-2/3 top-0 bg-blue-400"}),f("div",{class:"confetti-piece left-3/4 top-0 bg-pink-400"})],-1)),_[20]||(_[20]=f("div",{class:"emoji-celebration absolute inset-0 pointer-events-none opacity-0 transition-opacity duration-300"},[f("span",{class:"emoji emoji-1"},"🎉"),f("span",{class:"emoji emoji-2"},"✨"),f("span",{class:"emoji emoji-3"},"🚀"),f("span",{class:"emoji emoji-4"},"🔄"),f("span",{class:"emoji emoji-5"},"💯")],-1)),_[21]||(_[21]=f("div",{class:"absolute inset-0 rounded-xl bg-gradient-to-tr from-primary-400/0 via-primary-300/5 to-primary-200/10 opacity-0 group-hover:opacity-100 transition-opacity duration-300"},null,-1))]),_:1,__:[18,19,20,21]},8,["disabled"])])])]),f("div",Gu,[f("div",Zu,[_[24]||(_[24]=Te('<div class="flex items-center mb-4 group" data-v-4187c9b8><div class="mr-3 p-2 bg-primary-50 dark:bg-primary-900/30 rounded-lg" data-v-4187c9b8><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" class="w-6 h-6 text-primary-600 dark:text-primary-400 transition-all duration-300 group-hover:scale-110 group-hover:rotate-3" data-v-4187c9b8><path stroke-linecap="round" stroke-linejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z" data-v-4187c9b8></path></svg></div><div data-v-4187c9b8><h2 class="text-xl font-bold text-gray-800 dark:text-gray-100 relative inline-block transition-all duration-300 group-hover:text-primary-600 dark:group-hover:text-primary-400" data-v-4187c9b8>
18 Produtividade Geral </h2><p class="text-sm text-gray-500 dark:text-gray-400" data-v-4187c9b8><span data-v-4187c9b8>Visualização gráfica da produtividade dos Funcionários Digitais ao longo do tempo</span></p></div></div>',1)),L(Xh,{ref_key:"totalPeriodoChart",ref:r,"date-range":a},null,8,["date-range"])])]),f("div",Qu,[f("div",Ju,[_[25]||(_[25]=Te('<div class="flex items-center mb-4 group" data-v-4187c9b8><div class="mr-3 p-2 bg-primary-50 dark:bg-primary-900/30 rounded-lg" data-v-4187c9b8><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" class="w-6 h-6 text-primary-600 dark:text-primary-400 transition-all duration-300 group-hover:scale-110 group-hover:rotate-3" data-v-4187c9b8><path stroke-linecap="round" stroke-linejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z" data-v-4187c9b8></path></svg></div><div data-v-4187c9b8><h2 class="text-xl font-bold text-gray-800 dark:text-gray-100 relative inline-block transition-all duration-300 group-hover:text-primary-600 dark:group-hover:text-primary-400" data-v-4187c9b8> Distribuição Horária </h2><p class="text-sm text-gray-500 dark:text-gray-400" data-v-4187c9b8><span data-v-4187c9b8>Comparativo de performance dos Funcionários Digitais em diferentes horários</span></p></div></div>',1)),L(ku,{ref_key:"hourlyComparisonChart",ref:l,"date-range":a},null,8,["date-range"])])]),f("div",tf,[f("div",ef,[f("div",sf,[_[29]||(_[29]=f("div",{class:"mr-3 p-2 bg-amber-50 dark:bg-amber-900/30 rounded-lg"},[f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",class:"w-6 h-6 text-amber-600 dark:text-amber-400 transition-all duration-300 group-hover:scale-110 group-hover:rotate-3"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})])],-1)),f("div",null,[_[27]||(_[27]=f("h2",{class:"text-xl font-bold text-gray-800 dark:text-gray-100 relative inline-block transition-all duration-300 group-hover:text-amber-600 dark:group-hover:text-amber-400"}," Recursos Humanos Virtuais ",-1)),_[28]||(_[28]=f("p",{class:"text-sm text-gray-500 dark:text-gray-400"},[f("span",null,"Soluções avançadas de IA para execução e simulação de tarefas humanas")],-1)),f("div",nf,[f("div",of,[L(T,{name:"i-heroicons-calendar",class:"w-3 h-3 mr-1.5 flex-shrink-0"}),_[26]||(_[26]=f("span",null,"Período analisado:",-1)),f("span",af,z(C.value?"Hoje":S.value?"Últimos 7 dias":v.value?"Este mês":y.value?"Mês anterior":D.value),1)])])])]),L(Wa,{ref_key:"allBotClientsTable",ref:c,"date-range":a},null,8,["date-range"])])])],64))])}}},wf=os(rf,[["__scopeId","data-v-4187c9b8"]]);export{wf 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.