WGDashboard/src/static/app/dist/assets/peerList-sufcRv0A.js

20 lines
218 KiB
JavaScript
Raw Normal View History

2024-12-06 01:27:15 +08:00
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/deleteConfiguration-BGwI_EOV.js","assets/index-DxaoJejr.js","assets/index-BdzpqjNP.css","assets/localeText-BJlnw_l3.js","assets/configurationBackupRestore-pXsKPuSV.js","assets/dayjs.min-NjG6GRhz.js","assets/configurationBackupRestore-BeBqyCqt.css","assets/selectPeers-D031tDhJ.js","assets/selectPeers-Wjnh8YUZ.css","assets/editConfiguration-Cx7Z78WG.js","assets/editConfiguration-Oqrarw_V.css","assets/peerShareLinkModal-ClLD06RJ.js","assets/vue-datepicker-0C1_Bl1E.js","assets/peerJobsLogsModal-ChTwBii5.js","assets/peerJobsAllModal-CqOOb5H8.js","assets/schedulePeerJob-DqCUoh1f.js","assets/schedulePeerJob--V7cpve7.css","assets/peerJobs-Btaxqu4M.js","assets/peerJobs-voXURBEt.css","assets/peerCreate-FC1rN8TR.js","assets/peerCreate-BpTNoL68.css","assets/peerQRCode-C78lqRw3.js","assets/browser-CjSdxGTc.js","assets/peerConfigurationFile-yoEwyygD.js","assets/peerConfigurationFile-CNB9RKjb.css","assets/peerSettings-DJI9OWL8.js","assets/peerSettings-DCod994Y.css"])))=>i.map(i=>d[i]);
import{_ as Kt,D as Ni,W as Wi,G as ft,y as xe,g as ke,a as D,c as E,b as g,d as C,t as B,F as Zt,h as ki,e as W,j as H,J as Uo,K as Yo,C as Ko,H as On,r as Ut,n as Ct,w as X,T as J,f as Dt,i as V,L as Tn,M as An,N as Pi,O as Xo,o as Ln,P as Go,Q as Mi,R as Jo,U as Rn,p as In,V as En,m as Fn,z as Qo,X as ot,v as qo,k as Zo,Y as rt}from"./index-DxaoJejr.js";import{L as oe}from"./localeText-BJlnw_l3.js";import{d as rs}from"./dayjs.min-NjG6GRhz.js";import{_ as tr}from"./protocolBadge-P6gbBYF5.js";const er={name:"peerSearch",components:{LocaleText:oe},setup(){const i=Ni(),t=Wi();return{store:i,wireguardConfigurationStore:t}},props:{configuration:Object},data(){return{sort:{status:ft("Status"),name:ft("Name"),allowed_ip:ft("Allowed IPs"),restricted:ft("Restricted")},interval:{5e3:ft("5 Seconds"),1e4:ft("10 Seconds"),3e4:ft("30 Seconds"),6e4:ft("1 Minutes")},searchString:"",searchStringTimeout:void 0,showDisplaySettings:!1,showMoreSettings:!1}},methods:{debounce(){this.searchStringTimeout?(clearTimeout(this.searchStringTimeout),this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)):this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)},updateSort(i){xe("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_sort",value:i},t=>{t.status&&this.store.getConfiguration()})},updateRefreshInterval(i){xe("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_refresh_interval",value:i},t=>{t.status&&this.store.getConfiguration()})},downloadAllPeer(){ke(`/api/downloadAllPeers/${this.configuration.Name}`,{},i=>{console.log(i),window.wireguard.generateZipFiles(i,this.configuration.Name)})}},computed:{searchBarPlaceholder(){return ft("Search Peers...")}}},ir={class:"d-flex flex-column gap-2 my-4"},sr={class:"d-flex gap-2 peerSearchContainer"},nr={class:"dropdown"},or={"data-bs-toggle":"dropdown",class:"btn w-100 btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},rr={class:"badge text-bg-primary ms-2"},ar={class:"dropdown-menu rounded-3"},lr=["onClick"],cr={class:"ms-auto"},hr={key:0,class:"bi bi-check-circle-fill"},dr={class:"dropdown"},ur={"data-bs-toggle":"dropdown",class:"btn btn-sm w-100 text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},fr={class:"badge text-bg-primary ms-2"},gr={class:"dropdown-menu rounded-3"},pr=["onClick"],mr={class:"ms-auto"},br={key:0,class:"bi bi-check-circle-fill"};function _r(i,t,e,s,n,o){const r=H("LocaleText");return D(),E("div",ir,[g("div",sr,[g("div",nr,[g("button",or,[t[4]||(t[4]=g("i",{class:"bi bi-sort-up me-2"},null,-1)),C(r,{t:"Sort By"}),g("span",rr,B(this.sort[s.store.Configuration.Server.dashboard_sort]),1)]),g("ul",ar,[(D(!0),E(Zt,null,ki(this.sort,(a,l)=>(D(),E("li",null,[g("button",{class:"dropdown-item d-flex align-items-center",onClick:c=>this.updateSort(l)},[g("small",null,B(a),1),g("small",cr,[s.store.Configuration.Server.dashboard_sort===l?(D(),E("i",hr)):W("",!0)])],8,lr)]))),256))])]),g("div",dr,[g("button",ur,[t[5]||(t[5]=g("i",{class:"bi bi-arrow-repeat me-2"},null,-1)),C(r,{t:"Refresh Interval"}),g("span",fr,B(this.interval[s.store.Configuration.Server.dashboard_refresh_interval]),1)]),g("ul",gr,[(D(!0),E(Zt,null,ki(this.interval,(a,l)=>(D(),E("li",null,[g("button",{class:"dropdown-item d-flex align-items-center",onClick:c=>this.updateRefreshInterval(l)},[g("small",null,B(a),1),g("small",mr,[s.store.Configuration.Server.dashboard_refresh_interval===l?(D(),E("i",br)):W("",!0)])],8,pr)]))),256))])]),g("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle ms-lg-auto",onClick:t[0]||(t[0]=a=>this.$emit("search"))},[t[6]||(t[6]=g("i",{class:"bi bi-search me-2"},null,-1)),C(r,{t:"Search"})]),g("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[1]||(t[1]=a=>this.downloadAllPeer())},[t[7]||(t[7]=g("i",{class:"bi bi-downl
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/function Le(i){return i+.5|0}const Pt=(i,t,e)=>Math.max(Math.min(i,e),t);function me(i){return Pt(Le(i*2.55),0,255)}function Ot(i){return Pt(Le(i*255),0,255)}function St(i){return Pt(Le(i/2.55)/100,0,1)}function ls(i){return Pt(Le(i*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},Ci=[..."0123456789ABCDEF"],ca=i=>Ci[i&15],ha=i=>Ci[(i&240)>>4]+Ci[i&15],Be=i=>(i&240)>>4===(i&15),da=i=>Be(i.r)&&Be(i.g)&&Be(i.b)&&Be(i.a);function ua(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&at[i[1]]*17,g:255&at[i[2]]*17,b:255&at[i[3]]*17,a:t===5?at[i[4]]*17:255}:(t===7||t===9)&&(e={r:at[i[1]]<<4|at[i[2]],g:at[i[3]]<<4|at[i[4]],b:at[i[5]]<<4|at[i[6]],a:t===9?at[i[7]]<<4|at[i[8]]:255})),e}const fa=(i,t)=>i<255?t(i):"";function ga(i){var t=da(i)?ca:ha;return i?"#"+t(i.r)+t(i.g)+t(i.b)+fa(i.a,t):void 0}const pa=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Wn(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function ma(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function ba(i,t,e){const s=Wn(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function _a(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function Vi(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),r=Math.min(e,s,n),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=_a(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function ji(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(Ot)}function Ui(i,t,e){return ji(Wn,i,t,e)}function xa(i,t,e){return ji(ba,i,t,e)}function ya(i,t,e){return ji(ma,i,t,e)}function Vn(i){return(i%360+360)%360}function va(i){const t=pa.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?me(+t[5]):Ot(+t[5]));const n=Vn(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=xa(n,o,r):t[1]==="hsv"?s=ya(n,o,r):s=Ui(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function Sa(i,t){var e=Vi(i);e[0]=Vn(e[0]+t),e=Ui(e),i.r=e[0],i.g=e[1],i.b=e[2]}function wa(i){if(!i)return;const t=Vi(i),e=t[0],s=ls(t[1]),n=ls(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${St(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const cs={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},hs={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
* Chart.js v4.4.4
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/function xt(){}const Aa=(()=>{let i=0;return()=>i++})();function $(i){return i===null||typeof i>"u"}function K(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function I(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function ct(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function ut(i,t){return ct(i)?i:t}function R(i,t){return typeof i>"u"?t:i}const La=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function N(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function F(i,t,e,s){let n,o,r;if(K(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(I(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function ei(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function ii(i){if(K(i))return i.map(ii);if(I(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=ii(i[e[n]]);return t}return i}function Un(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Ra(i,t,e,s){if(!Un(i))return;const n=t[i],o=e[i];I(n)&&I(o)?Me(n,o,s):t[i]=ii(o)}function Me(i,t,e){const s=K(t)?t:[t],n=s.length;if(!I(i))return i;e=e||{};const o=e.merger||Ra;let r;for(let a=0;a<n;++a){if(r=s[a],!I(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function ye(i,t){return Me(i,t,{merger:Ia})}function Ia(i,t,e){if(!Un(i))return;const s=t[i],n=e[i];I(s)&&I(n)?ye(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=ii(n))}const us={"":i=>i,x:i=>i.x,y:i=>i.y};function Ea(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Fa(i){const t=Ea(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function ie(i,t){return(us[t]||(us[t]=Fa(t)))(i)}function Yi(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Ce=i=>typeof i<"u",Tt=i=>typeof i=="function",fs=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Ba(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const G=Math.PI,bt=2*G,za=bt+G,si=Number.POSITIVE_INFINITY,$a=G/180,dt=G/2,Et=G/4,gs=G*2/3,Di=Math.log10,_t=Math.sign;function ve(i,t,e){return Math.abs(i-t)<e}function ps(i){const t=Math.round(i);i=ve(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Di(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Ha(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function De(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Na(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Wa(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Nt(i){return i*(G/180)}function Va(i){return i*(180/G)}function ms(i){if(!ct(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function ja(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*G&&(o+=bt),{angle:o,distance:n}}function Oi(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Ua(i,t){return(i-t+za)%bt-G}function kt(i){return(i%bt+bt)%bt}function Yn(i,t,e,s){const n=kt(i),o=kt(t),r=kt(e),a=kt(o-n),l=kt(r-n),c=kt(n-o),h=kt(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function st(i,t,e){return Math.max(t,Math.min(e,i))}function Ya(i){return st(i,-32768,32767)}function Wt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Ki(i,t,e){e=e||(r=>i[r]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const Vt=(i,t,e,s)=>Ki(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),Ka=(i,t,e)=>Ki(i,e,s=>i[s][t]>=e);function Xa(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}c
* Chart.js v4.4.4
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/class tc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Gn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}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((s,n)=>Math.max(s,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 s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yt=new tc;const As="transparent",ec={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=ys(i||As),n=s.valid&&ys(t||As);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class ic{constructor(t,e,s,n){const o=e[s];n=Ne([t.to,n,o,t.from]);const r=Ne([t.from,o,n]);this._active=!0,this._fn=t.fn||ec[t.type||typeof r],this._easing=Se[t.easing]||Se.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=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ne([t.to,e,n,t.from]),this._from=Ne([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<s),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class uo{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!I(t))return;const e=Object.keys(U.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!I(o))return;const r={};for(const a of e)r[a]=o[a];(K(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=nc(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&sc(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new ic(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0
`)>-1?i.split(`
`):i}function od(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function hn(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=q(t.bodyFont),c=q(t.titleFont),h=q(t.footerFont),d=o.length,u=n.length,f=s.length,p=ht(t.padding);let m=p.height,b=0,_=s.reduce((P,y)=>P+y.before.length+y.lines.length+y.after.length,0);if(_+=i.beforeBody.length+i.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){const P=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*P+(_-f)*l.lineHeight+(_-1)*t.bodySpacing}u&&(m+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let x=0;const v=function(P){b=Math.max(b,e.measureText(P).width+x)};return e.save(),e.font=c.string,F(i.title,v),e.font=l.string,F(i.beforeBody.concat(i.afterBody),v),x=t.displayColors?r+2+t.boxPadding:0,F(s,P=>{F(P.before,v),F(P.lines,v),F(P.after,v)}),x=0,e.font=h.string,F(i.footer,v),e.restore(),b+=p.width,{width:b,height:m}}function rd(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function ad(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function ld(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),ad(c,i,t,e)&&(c="center"),c}function dn(i,t,e){const s=e.yAlign||t.yAlign||rd(i,e);return{xAlign:e.xAlign||t.xAlign||ld(i,t,e,s),yAlign:s}}function cd(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function hd(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function un(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=te(r);let p=cd(t,a);const m=hd(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,u)+n:a==="right"&&(p+=Math.max(d,f)+n),{x:st(p,0,s.width-t.width),y:st(m,0,s.height-t.height)}}function Ge(i,t,e){const s=ht(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function fn(i){return gt([],vt(i))}function dd(i,t,e){return Xt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function gn(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Ao={beforeTitle:xt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:xt,beforeBody:xt,beforeLabel:xt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return $(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.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(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:xt,afterBody:xt,beforeFooter:xt,footer:xt,afterFooter:xt};function tt(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?Ao[t].call(e,s):n}class pn extends At{static positioners=_e;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.afte