oziko-ui-kit 0.0.54 → 0.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -46,7 +46,7 @@ function(t,e){const n=ni(t,e);return"production"!==process.env.NODE_ENV?(...e)=>
|
|
|
46
46
|
* https://www.chartjs.org
|
|
47
47
|
* (c) 2024 Chart.js Contributors
|
|
48
48
|
* Released under the MIT License
|
|
49
|
-
*/class Wu{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,r){const i=e.listeners[r],o=e.duration;i.forEach((r=>r({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=tc.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((n,r)=>{if(!n.running||!n.items.length)return;const i=n.items;let o,a=i.length-1,s=!1;for(;a>=0;--a)o=i[a],o._active?(o._total>n.duration&&(n.duration=o._total),o.tick(t),s=!0):(i[a]=i[i.length-1],i.pop());s&&(r.draw(),this._notify(r,n,t,"progress")),i.length||(n.running=!1,this._notify(r,n,t,"complete"),n.initial=!1),e+=i.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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(((t,e)=>Math.max(t,e._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 n=e.items;let r=n.length-1;for(;r>=0;--r)n[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Vu=new Wu;const Yu="transparent",Xu={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const r=dc(t||Yu),i=r.valid&&dc(e||Yu);return i&&i.valid?i.mix(r,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class qu{constructor(t,e,n,r){const i=e[n];r=Zc([t.to,r,i,t.from]);const o=Zc([t.from,i,r]);this._active=!0,this._fn=t.fn||Xu[t.type||typeof o],this._easing=cc[t.easing]||cc.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=n,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const r=this._target[this._prop],i=n-this._start,o=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=Zc([t.to,e,r,t.from]),this._from=Zc([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,r=this._prop,i=this._from,o=this._loop,a=this._to;let s;if(this._active=i!==a&&(o||e<n),!this._active)return this._target[r]=a,void this._notify(!0);e<0?this._target[r]=i:(s=e/n%2,s=o&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,a,s))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,n)=>{t.push({res:e,rej:n})}))}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t<n.length;t++)n[t][e]()}}class Uu{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!il(t))return;const e=Object.keys(kc.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach((r=>{const i=t[r];if(!il(i))return;const o={};for(const t of e)o[t]=i[t];(rl(i.properties)&&i.properties||[r]).forEach((t=>{t!==r&&n.has(t)||n.set(t,o)}))}))}_animateOptions(t,e){const n=e.options,r=function(t,e){if(!e)return;let n=t.options;if(!n)return void(t.options=e);n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(t,n);if(!r)return[];const i=this._createAnimations(r,n);return n.$shared&&function(t,e){const n=[],r=Object.keys(e);for(let e=0;e<r.length;e++){const i=t[r[e]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}(t.options.$animations,n).then((()=>{t.options=n}),(()=>{})),i}_createAnimations(t,e){const n=this._properties,r=[],i=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let s;for(s=o.length-1;s>=0;--s){const l=o[s];if("$"===l.charAt(0))continue;if("options"===l){r.push(...this._animateOptions(t,e));continue}const c=e[l];let u=i[l];const d=n.get(l);if(u){if(d&&u.active()){u.update(d,c,a);continue}u.cancel()}d&&d.duration?(i[l]=u=new qu(d,t,l,c),r.push(u)):t[l]=c}return r}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(Vu.add(this._chart,n),!0):void 0}}function Zu(t,e){const n=t&&t.options||{},r=n.reverse,i=void 0===n.min?e:0,o=void 0===n.max?e:0;return{start:r?o:i,end:r?i:o}}function Gu(t,e){const n=[],r=t._getSortedDatasetMetas(e);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function Ku(t,e,n,r={}){const i=t.keys,o="single"===r.mode;let a,s,l,c;if(null===e)return;let u=!1;for(a=0,s=i.length;a<s;++a){if(l=+i[a],l===n){if(u=!0,r.all)continue;break}c=t.values[l],ol(c)&&(o||0===e||Al(e)===Al(c))&&(e+=c)}return u||r.all?e:0}function Ju(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function Qu(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function td(t,e,n,r){for(const i of e.getMatchingVisibleMetas(r).reverse()){const e=t[i.index];if(n&&e>0||!n&&e<0)return i.index}return null}function ed(t,e){const{chart:n,_cachedMeta:r}=t,i=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:s}=r,l=o.axis,c=a.axis,u=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(o,a,r),d=e.length;let h;for(let t=0;t<d;++t){const n=e[t],{[l]:o,[c]:d}=n;h=(n._stacks||(n._stacks={}))[c]=Qu(i,u,o),h[s]=d,h._top=td(h,a,!0,r.type),h._bottom=td(h,a,!1,r.type);(h._visualValues||(h._visualValues={}))[s]=d}}function nd(t,e){const n=t.scales;return Object.keys(n).filter((t=>n[t].axis===e)).shift()}function rd(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[r]||void 0===e[r][n])return;delete e[r][n],void 0!==e[r]._visualValues&&void 0!==e[r]._visualValues[n]&&delete e[r]._visualValues[n]}}}const id=t=>"reset"===t||"none"===t,od=(t,e)=>e?t:Object.assign({},t);class ad{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ju(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&&rd(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),r=(t,e,n,r)=>"x"===t?e:"r"===t?r:n,i=e.xAxisID=sl(n.xAxisID,nd(t,"x")),o=e.yAxisID=sl(n.yAxisID,nd(t,"y")),a=e.rAxisID=sl(n.rAxisID,nd(t,"r")),s=e.indexAxis,l=e.iAxisID=r(s,i,o,a),c=e.vAxisID=r(s,o,i,a);e.xScale=this.getScaleForId(i),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}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&&Jl(this._data,this),t._stacked&&rd(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(il(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:n,vScale:r}=e,i="x"===n.axis?"x":"y",o="x"===r.axis?"x":"y",a=Object.keys(t),s=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],s[l]={[i]:u,[o]:t[u]};return s}(e,t)}else if(n!==e){if(n){Jl(n,this);const t=this._cachedMeta;rd(t),t._parsed=[]}e&&Object.isExtensible(e)&&function(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Kl.forEach((e=>{const n="_onData"+_l(e),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const i=r.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[n]&&t[n](...e)})),i}})})))}(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,n=this.getDataset();let r=!1;this._dataCheck();const i=e._stacked;e._stacked=Ju(e.vScale,e),e.stack!==n.stack&&(r=!0,rd(e),e.stack=n.stack),this._resyncElements(t),(r||i!==e._stacked)&&(ed(this,e._parsed),e._stacked=Ju(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:o}=n,a=i.axis;let s,l,c,u=0===t&&e===r.length||n._sorted,d=t>0&&n._parsed[t-1];if(!1===this._parsing)n._parsed=r,n._sorted=!0,c=r;else{c=rl(r[t])?this.parseArrayData(n,r,t,e):il(r[t])?this.parseObjectData(n,r,t,e):this.parsePrimitiveData(n,r,t,e);const i=()=>null===l[a]||d&&l[a]<d[a];for(s=0;s<e;++s)n._parsed[s+t]=l=c[s],u&&(i()&&(u=!1),d=l);n._sorted=u}o&&ed(this,c)}parsePrimitiveData(t,e,n,r){const{iScale:i,vScale:o}=t,a=i.axis,s=o.axis,l=i.getLabels(),c=i===o,u=new Array(r);let d,h,p;for(d=0,h=r;d<h;++d)p=d+n,u[d]={[a]:c||i.parse(l[p],p),[s]:o.parse(e[p],p)};return u}parseArrayData(t,e,n,r){const{xScale:i,yScale:o}=t,a=new Array(r);let s,l,c,u;for(s=0,l=r;s<l;++s)c=s+n,u=e[c],a[s]={x:i.parse(u[0],c),y:o.parse(u[1],c)};return a}parseObjectData(t,e,n,r){const{xScale:i,yScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(r);let c,u,d,h;for(c=0,u=r;c<u;++c)d=c+n,h=e[d],l[c]={x:i.parse(bl(h,a),d),y:o.parse(bl(h,s),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const r=this.chart,i=this._cachedMeta,o=e[t.axis];return Ku({keys:Gu(r,!0),values:e._stacks[t.axis]._visualValues},o,i.index,{mode:n})}updateRangeFromParsed(t,e,n,r){const i=n[e.axis];let o=null===i?NaN:i;const a=r&&n._stacks[e.axis];r&&a&&(r.values=a,o=Ku(r,i,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const n=this._cachedMeta,r=n._parsed,i=n._sorted&&t===n.iScale,o=r.length,a=this._getOtherScale(t),s=((t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Gu(n,!0),values:null})(e,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){const{min:e,max:n,minDefined:r,maxDefined:i}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}(a);let d,h;function p(){h=r[d];const e=h[a.axis];return!ol(h[t.axis])||c>e||u<e}for(d=0;d<o&&(p()||(this.updateRangeFromParsed(l,t,h,s),!i));++d);if(i)for(d=o-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(l,t,h,s);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let r,i,o;for(r=0,i=e.length;r<i;++r)o=e[r][t.axis],ol(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,r=e.vScale,i=this.getParsed(t);return{label:n?""+n.getLabelForValue(i[n.axis]):"",value:r?""+r.getLabelForValue(i[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,n,r,i;return il(t)?(e=t.top,n=t.right,r=t.bottom,i=t.left):e=n=r=i=t,{top:e,right:n,bottom:r,left:i,disabled:!1===t}}(sl(this.options.clip,function(t,e,n){if(!1===n)return!1;const r=Zu(t,n),i=Zu(e,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,r=n.data||[],i=e.chartArea,o=[],a=this._drawStart||0,s=this._drawCount||r.length-a,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(t,i,a,s),c=a;c<a+s;++c){const e=r[c];e.hidden||(e.active&&l?o.push(e):e.draw(t,i))}for(c=0;c<o.length;++c)o[c].draw(t,i)}getStyle(t,e){const n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const r=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];i=e.$context||(e.$context=function(t,e,n){return Gc(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),i.parsed=this.getParsed(t),i.raw=r.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=function(t,e){return Gc(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!e,i.mode=n,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const r="active"===e,i=this._cachedDataOpts,o=t+"-"+e,a=i[o],s=this.enableOptionSharing&&xl(n);if(a)return od(a,s);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),u=r?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),c),h=Object.keys(kc.elements[t]),p=l.resolveNamedOptions(d,h,(()=>this.getContext(n,r,e)),u);return p.$shared&&(p.$shared=s,i[o]=Object.freeze(od(p,s))),p}_resolveAnimations(t,e,n){const r=this.chart,i=this._cachedDataOpts,o=`animation-${e}`,a=i[o];if(a)return a;let s;if(!1!==r.options.animation){const r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,e),o=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(o,this.getContext(t,n,e))}const l=new Uu(r,s&&s.animations);return s&&s._cacheable&&(i[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||id(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),r=this._sharedOptions,i=this.getSharedOptions(n),o=this.includeOptions(e,i)||i!==r;return this.updateSharedOptions(i,e,n),{sharedOptions:i,includeOptions:o}}updateElement(t,e,n,r){id(r)?Object.assign(t,n):this._resolveAnimations(e,r).update(t,n)}updateSharedOptions(t,e,n){t&&!id(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,r){t.active=r;const i=this.getStyle(e,r);this._resolveAnimations(e,n,r).update(t,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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,n=this._cachedMeta.data;for(const[t,e,n]of this._syncList)this[t](e,n);this._syncList=[];const r=n.length,i=e.length,o=Math.min(i,r);o&&this.parse(0,o),i>r?this._insertElements(r,i-r,t):i<r&&this._removeElements(i,r-i)}_insertElements(t,e,n=!0){const r=this._cachedMeta,i=r.data,o=t+e;let a;const s=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(s(i),a=t;a<o;++a)i[a]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(t,e),n&&this.updateElements(i,t,e,"reset")}updateElements(t,e,n,r){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const r=n._parsed.splice(t,e);n._stacked&&rd(n,r)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,r]=t;this[e](n,r)}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 n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function sd(t){const e=t.iScale,n=function(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let r=[];for(let e=0,i=n.length;e<i;e++)r=r.concat(n[e].controller.getAllParsedValues(t));t._cache.$bar=Ql(r.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let r,i,o,a,s=e._length;const l=()=>{32767!==o&&-32768!==o&&(xl(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(r=0,i=n.length;r<i;++r)o=e.getPixelForValue(n[r]),l();for(a=void 0,r=0,i=e.ticks.length;r<i;++r)o=e.getPixelForTick(r),l();return s}function ld(t,e,n,r){return rl(t)?function(t,e,n,r){const i=n.parse(t[0],r),o=n.parse(t[1],r),a=Math.min(i,o),s=Math.max(i,o);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:i,end:o,min:a,max:s}}(t,e,n,r):e[n.axis]=n.parse(t,r),e}function cd(t,e,n,r){const i=t.iScale,o=t.vScale,a=i.getLabels(),s=i===o,l=[];let c,u,d,h;for(c=n,u=n+r;c<u;++c)h=e[c],d={},d[i.axis]=s||i.parse(a[c],c),l.push(ld(h,d,o,c));return l}function ud(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function dd(t,e,n,r){let i=e.borderSkipped;const o={};if(!i)return void(t.borderSkipped=o);if(!0===i)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:s,reverse:l,top:c,bottom:u}=function(t){let e,n,r,i,o;return t.horizontal?(e=t.base>t.x,n="left",r="right"):(e=t.base<t.y,n="bottom",r="top"),e?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:e,top:i,bottom:o}}(t);"middle"===i&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[hd(u,a,s,l)]=!0,i=c)),o[hd(i,a,s,l)]=!0,t.borderSkipped=o}function hd(t,e,n,r){var i,o,a;return r?(a=n,t=pd(t=(i=t)===(o=e)?a:i===a?o:i,n,e)):t=pd(t,e,n),t}function pd(t,e,n){return"start"===t?e:"end"===t?n:t}function fd(t,{inflateAmount:e},n){t.inflateAmount="auto"===e?1===n?.33:0:e}class md extends ad{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,n,r){return cd(t,e,n,r)}parseArrayData(t,e,n,r){return cd(t,e,n,r)}parseObjectData(t,e,n,r){const{iScale:i,vScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===i.axis?a:s,c="x"===o.axis?a:s,u=[];let d,h,p,f;for(d=n,h=n+r;d<h;++d)f=e[d],p={},p[i.axis]=i.parse(bl(f,l),d),u.push(ld(bl(f,c),p,o,d));return u}updateRangeFromParsed(t,e,n,r){super.updateRangeFromParsed(t,e,n,r);const i=n._custom;i&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:r}=e,i=this.getParsed(t),o=i._custom,a=ud(o)?"["+o.start+", "+o.end+"]":""+r.getLabelForValue(i[r.axis]);return{label:""+n.getLabelForValue(i[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,r){const i="reset"===r,{index:o,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r);for(let h=e;h<e+n;h++){const e=this.getParsed(h),n=i||nl(e[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(h),p=this._calculateBarIndexPixels(h,c),f=(e._stacks||{})[a.axis],m={horizontal:l,base:n.base,enableBorderRadius:!f||ud(e._custom)||o===f._top||o===f._bottom,x:l?n.head:p.center,y:l?p.center:n.head,height:l?p.size:Math.abs(n.size),width:l?Math.abs(n.size):p.size};d&&(m.options=u||this.resolveDataElementOptions(h,t[h].active?"active":r));const g=m.options||t[h].options;dd(m,g,f,o),fd(m,g,c.ratio),this.updateElement(t[h],h,m,r)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),i=n.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),s=a&&a[n.axis],l=t=>{const e=t._parsed.find((t=>t[n.axis]===s)),r=e&&e[t.vScale.axis];if(nl(r)||isNaN(r))return!0};for(const n of r)if((void 0===e||!l(n))&&((!1===i||-1===o.indexOf(n.stack)||void 0===i&&void 0===n.stack)&&o.push(n.stack),n.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const r=this._getStacks(t,n),i=void 0!==e?r.indexOf(e):-1;return-1===i?r.length-1:i}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,r=[];let i,o;for(i=0,o=e.data.length;i<o;++i)r.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));const a=t.barThickness;return{min:a||sd(e),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:r},options:{base:i,minBarLength:o}}=this,a=i||0,s=this.getParsed(t),l=s._custom,c=ud(l);let u,d,h=s[e.axis],p=0,f=n?this.applyStack(e,s,n):h;f!==h&&(p=f-h,f=h),c&&(h=l.barStart,f=l.barEnd-l.barStart,0!==h&&Al(h)!==Al(l.barEnd)&&(p=0),p+=h);const m=nl(i)||c?p:i;let g=e.getPixelForValue(m);if(u=this.chart.getDataVisibility(t)?e.getPixelForValue(p+f):g,d=u-g,Math.abs(d)<o){d=function(t,e,n){return 0!==t?Al(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}(d,e,a)*o,h===a&&(g-=d/2);const t=e.getPixelForDecimal(0),i=e.getPixelForDecimal(1),l=Math.min(t,i),p=Math.max(t,i);g=Math.max(Math.min(g,p),l),u=g+d,n&&!c&&(s._stacks[e.axis]._visualValues[r]=e.getValueForPixel(u)-e.getValueForPixel(g))}if(g===e.getPixelForValue(a)){const t=Al(d)*e.getLineWidthForValue(a)/2;g+=t,d-=t}return{size:d,base:g,head:u,center:u+d/2}}_calculateBarIndexPixels(t,e){const n=e.scale,r=this.options,i=r.skipNull,o=sl(r.maxBarThickness,1/0);let a,s;if(e.grouped){const n=i?this._getStackCount(t):e.stackCount,l="flex"===r.barThickness?function(t,e,n,r){const i=e.pixels,o=i[t];let a=t>0?i[t-1]:null,s=t<i.length-1?i[t+1]:null;const l=n.categoryPercentage;null===a&&(a=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-a);const c=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}(t,e,r,n):function(t,e,n,r){const i=n.barThickness;let o,a;return nl(i)?(o=e.min*n.categoryPercentage,a=n.barPercentage):(o=i*r,a=1),{chunk:o/r,ratio:a,start:e.pixels[t]-o/2}}(t,e,r,n),c=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=l.start+l.chunk*c+l.chunk/2,s=Math.min(o,l.chunk*l.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),s=Math.min(o,e.min*e.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,r=n.length;let i=0;for(;i<r;++i)null===this.getParsed(i)[e.axis]||n[i].hidden||n[i].draw(this._ctx)}}class gd extends ad{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:r}}=t.legend.options;return e.labels.map(((e,i)=>{const o=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:r,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,r=this._cachedMeta;if(!1===this._parsing)r._parsed=n;else{let i,o,a=t=>+n[t];if(il(n[t])){const{key:t="value"}=this._parsing;a=e=>+bl(n[e],t)}for(i=t,o=t+e;i<o;++i)r._parsed[i]=a(i)}}_getRotation(){return $l(this.options.rotation-90)}_getCircumference(){return $l(this.options.circumference)}_getRotationExtents(){let t=Cl,e=-Cl;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),o=r._getCircumference();t=Math.min(t,i),e=Math.max(e,i+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,r=this._cachedMeta,i=r.data,o=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-o)/2,0),s=Math.min((l=this.options.cutout,c=a,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const u=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:p,ratioY:f,offsetX:m,offsetY:g}=function(t,e,n){let r=1,i=1,o=0,a=0;if(e<Cl){const s=t,l=s+e,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),h=Math.sin(l),p=(t,e,r)=>Yl(t,s,l,!0)?1:Math.max(e,e*n,r,r*n),f=(t,e,r)=>Yl(t,s,l,!0)?-1:Math.min(e,e*n,r,r*n),m=p(0,c,d),g=p(Pl,u,h),v=f(kl,c,d),y=f(kl+Pl,u,h);r=(m-v)/2,i=(g-y)/2,o=-(m+v)/2,a=-(g+y)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:a}}(h,d,s),v=(n.width-o)/p,y=(n.height-o)/f,b=Math.max(Math.min(v,y)/2,0),_=ll(this.options.radius,b),x=(_-Math.max(_*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=g*_,r.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*u,0),this.updateElements(i,0,i.length,t)}_circumference(t,e){const n=this.options,r=this._cachedMeta,i=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===r._parsed[t]||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*i/Cl)}updateElements(t,e,n,r){const i="reset"===r,o=this.chart,a=o.chartArea,s=o.options.animation,l=(a.left+a.right)/2,c=(a.top+a.bottom)/2,u=i&&s.animateScale,d=u?0:this.innerRadius,h=u?0:this.outerRadius,{sharedOptions:p,includeOptions:f}=this._getSharedOptions(e,r);let m,g=this._getRotation();for(m=0;m<e;++m)g+=this._circumference(m,i);for(m=e;m<e+n;++m){const e=this._circumference(m,i),n=t[m],o={x:l+this.offsetX,y:c+this.offsetY,startAngle:g,endAngle:g+e,circumference:e,outerRadius:h,innerRadius:d};f&&(o.options=p||this.resolveDataElementOptions(m,n.active?"active":r)),g+=e,this.updateElement(n,m,o,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,r=0;for(n=0;n<e.length;n++){const i=t._parsed[n];null===i||isNaN(i)||!this.chart.getDataVisibility(n)||e[n].hidden||(r+=Math.abs(i))}return r}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Cl*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=gc(e._parsed[t],n.options.locale);return{label:r[t]||"",value:i}}getMaxBorderWidth(t){let e=0;const n=this.chart;let r,i,o,a,s;if(!t)for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){o=n.getDatasetMeta(r),t=o.data,a=o.controller;break}if(!t)return 0;for(r=0,i=t.length;r<i;++r)s=a.resolveDataElementOptions(r),"inner"!==s.borderAlign&&(e=Math.max(e,s.borderWidth||0,s.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,r=t.length;n<r;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(sl(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class vd extends ad{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:r}}=t.legend.options;return e.labels.map(((e,i)=>{const o=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:r,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=gc(e._parsed[t].r,n.options.locale);return{label:r[t]||"",value:i}}parseObjectData(t,e,n,r){return uu.bind(this)(t,e,n,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,n)=>{const r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),i=Math.max(r/2,0),o=(i-Math.max(n.cutoutPercentage?i/100*n.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=i-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,n,r){const i="reset"===r,o=this.chart,a=o.options.animation,s=this._cachedMeta.rScale,l=s.xCenter,c=s.yCenter,u=s.getIndexAngle(0)-.5*kl;let d,h=u;const p=360/this.countVisibleElements();for(d=0;d<e;++d)h+=this._computeAngle(d,r,p);for(d=e;d<e+n;d++){const e=t[d];let n=h,f=h+this._computeAngle(d,r,p),m=o.getDataVisibility(d)?s.getDistanceFromCenterForValue(this.getParsed(d).r):0;h=f,i&&(a.animateScale&&(m=0),a.animateRotate&&(n=f=u));const g={x:l,y:c,innerRadius:0,outerRadius:m,startAngle:n,endAngle:f,options:this.resolveDataElementOptions(d,e.active?"active":r)};this.updateElement(e,d,g,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++})),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?$l(this.resolveDataElementOptions(t,e).angle||n):0}}var yd=Object.freeze({__proto__:null,BarController:md,BubbleController:class extends ad{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,r){const i=super.parsePrimitiveData(t,e,n,r);for(let t=0;t<i.length;t++)i[t]._custom=this.resolveDataElementOptions(t+n).radius;return i}parseArrayData(t,e,n,r){const i=super.parseArrayData(t,e,n,r);for(let t=0;t<i.length;t++){const r=e[n+t];i[t]._custom=sl(r[2],this.resolveDataElementOptions(t+n).radius)}return i}parseObjectData(t,e,n,r){const i=super.parseObjectData(t,e,n,r);for(let t=0;t<i.length;t++){const r=e[n+t];i[t]._custom=sl(r&&r.r&&+r.r,this.resolveDataElementOptions(t+n).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=e,o=this.getParsed(t),a=r.getLabelForValue(o.x),s=i.getLabelForValue(o.y),l=o._custom;return{label:n[t]||"",value:"("+a+", "+s+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,r){const i="reset"===r,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(e,r),c=o.axis,u=a.axis;for(let d=e;d<e+n;d++){const e=t[d],n=!i&&this.getParsed(d),h={},p=h[c]=i?o.getPixelForDecimal(.5):o.getPixelForValue(n[c]),f=h[u]=i?a.getBasePixel():a.getPixelForValue(n[u]);h.skip=isNaN(p)||isNaN(f),l&&(h.options=s||this.resolveDataElementOptions(d,e.active?"active":r),i&&(h.options.radius=0)),this.updateElement(e,d,h,r)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const i=r.radius;return"active"!==e&&(r.radius=0),r.radius+=sl(n&&n._custom,i),r}},DoughnutController:gd,LineController:class extends ad{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=e,o=this.chart._animationsDisabled;let{start:a,count:s}=ic(e,r,o);this._drawStart=a,this._drawCount=s,oc(e)&&(a=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:l},t),this.updateElements(r,a,s,t)}updateElements(t,e,n,r){const i="reset"===r,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,r),d=o.axis,h=a.axis,{spanGaps:p,segment:f}=this.options,m=zl(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||i||"none"===r,v=e+n,y=t.length;let b=e>0&&this.getParsed(e-1);for(let n=0;n<y;++n){const p=t[n],y=g?p:{};if(n<e||n>=v){y.skip=!0;continue}const _=this.getParsed(n),x=nl(_[h]),w=y[d]=o.getPixelForValue(_[d],n),S=y[h]=i||x?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,_,s):_[h],n);y.skip=isNaN(w)||isNaN(S)||x,y.stop=n>0&&Math.abs(_[d]-b[d])>m,f&&(y.parsed=_,y.raw=l.data[n]),u&&(y.options=c||this.resolveDataElementOptions(n,p.active?"active":r)),g||this.updateElement(p,n,y,r),b=_}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return n;const i=r[0].size(this.resolveDataElementOptions(0)),o=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends gd{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:vd,RadarController:class extends ad{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,r){return uu.bind(this)(t,e,n,r)}update(t){const e=this._cachedMeta,n=e.dataset,r=e.data||[],i=e.iScale.getLabels();if(n.points=r,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:i.length===r.length,options:e};this.updateElement(n,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,n,r){const i=this._cachedMeta.rScale,o="reset"===r;for(let a=e;a<e+n;a++){const e=t[a],n=this.resolveDataElementOptions(a,e.active?"active":r),s=i.getPointPositionForValue(a,this.getParsed(a).r),l=o?i.xCenter:s.x,c=o?i.yCenter:s.y,u={x:l,y:c,angle:s.angle,skip:isNaN(l)||isNaN(c),options:n};this.updateElement(e,a,u,r)}}},ScatterController:class extends ad{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=e,o=this.getParsed(t),a=r.getLabelForValue(o.x),s=i.getLabelForValue(o.y);return{label:n[t]||"",value:"("+a+", "+s+")"}}update(t){const e=this._cachedMeta,{data:n=[]}=e,r=this.chart._animationsDisabled;let{start:i,count:o}=ic(e,n,r);if(this._drawStart=i,this._drawCount=o,oc(e)&&(i=0,o=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:i,_dataset:o}=e;i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const a=this.resolveDatasetElementOptions(t);a.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:a},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(n,i,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,n,r){const i="reset"===r,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,r),u=this.getSharedOptions(c),d=this.includeOptions(r,u),h=o.axis,p=a.axis,{spanGaps:f,segment:m}=this.options,g=zl(f)?f:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||i||"none"===r;let y=e>0&&this.getParsed(e-1);for(let c=e;c<e+n;++c){const e=t[c],n=this.getParsed(c),f=v?e:{},b=nl(n[p]),_=f[h]=o.getPixelForValue(n[h],c),x=f[p]=i||b?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,n,s):n[p],c);f.skip=isNaN(_)||isNaN(x)||b,f.stop=c>0&&Math.abs(n[h]-y[h])>g,m&&(f.parsed=n,f.raw=l.data[c]),d&&(f.options=u||this.resolveDataElementOptions(c,e.active?"active":r)),v||this.updateElement(e,c,f,r),y=n}this.updateSharedOptions(u,r,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}const n=t.dataset,r=n.options&&n.options.borderWidth||0;if(!e.length)return r;const i=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,i,o)/2}}});function bd(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class _d{static override(t){Object.assign(_d.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return bd()}parse(){return bd()}format(){return bd()}add(){return bd()}diff(){return bd()}startOf(){return bd()}endOf(){return bd()}}var xd={_date:_d};function wd(t,e,n,r){const{controller:i,data:o,_sorted:a}=t,s=i._cachedMeta.iScale;if(s&&e===s.axis&&"r"!==e&&a&&o.length){const t=s._reversePixels?Gl:Zl;if(!r)return t(o,e,n);if(i._sharedOptions){const r=o[0],i="function"==typeof r.getRange&&r.getRange(e);if(i){const r=t(o,e,n-i),a=t(o,e,n+i);return{lo:r.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function Sd(t,e,n,r,i){const o=t.getSortedVisibleDatasetMetas(),a=n[e];for(let t=0,n=o.length;t<n;++t){const{index:n,data:s}=o[t],{lo:l,hi:c}=wd(o[t],e,a,i);for(let t=l;t<=c;++t){const e=s[t];e.skip||r(e,n,t)}}}function kd(t,e,n,r,i){const o=[];if(!i&&!t.isPointInArea(e))return o;return Sd(t,n,e,(function(n,a,s){(i||Nc(n,t.chartArea,0))&&n.inRange(e.x,e.y,r)&&o.push({element:n,datasetIndex:a,index:s})}),!0),o}function Cd(t,e,n,r,i,o){let a=[];const s=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,r){const i=e?Math.abs(t.x-r.x):0,o=n?Math.abs(t.y-r.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}}(n);let l=Number.POSITIVE_INFINITY;return Sd(t,n,e,(function(n,c,u){const d=n.inRange(e.x,e.y,i);if(r&&!d)return;const h=n.getCenterPoint(i);if(!(!!o||t.isPointInArea(h))&&!d)return;const p=s(e,h);p<l?(a=[{element:n,datasetIndex:c,index:u}],l=p):p===l&&a.push({element:n,datasetIndex:c,index:u})})),a}function Ed(t,e,n,r,i,o){return o||t.isPointInArea(e)?"r"!==n||r?Cd(t,e,n,r,i,o):function(t,e,n,r){let i=[];return Sd(t,n,e,(function(t,n,o){const{startAngle:a,endAngle:s}=t.getProps(["startAngle","endAngle"],r),{angle:l}=Bl(t,{x:e.x,y:e.y});Yl(l,a,s)&&i.push({element:t,datasetIndex:n,index:o})})),i}(t,e,n,i):[]}function Md(t,e,n,r,i){const o=[],a="x"===n?"inXRange":"inYRange";let s=!1;return Sd(t,n,e,((t,r,l)=>{t[a]&&t[a](e[n],i)&&(o.push({element:t,datasetIndex:r,index:l}),s=s||t.inRange(e.x,e.y,i))})),r&&!s?[]:o}var Od={evaluateInteractionItems:Sd,modes:{index(t,e,n,r){const i=ku(e,t),o=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?kd(t,i,o,r,a):Ed(t,i,o,!1,r,a),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=s[0].index,n=t.data[e];n&&!n.skip&&l.push({element:n,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,n,r){const i=ku(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?kd(t,i,o,r,a):Ed(t,i,o,!1,r,a);if(s.length>0){const e=s[0].datasetIndex,n=t.getDatasetMeta(e).data;s=[];for(let t=0;t<n.length;++t)s.push({element:n[t],datasetIndex:e,index:t})}return s},point:(t,e,n,r)=>kd(t,ku(e,t),n.axis||"xy",r,n.includeInvisible||!1),nearest(t,e,n,r){const i=ku(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;return Ed(t,i,o,n.intersect,r,a)},x:(t,e,n,r)=>Md(t,ku(e,t),"x",n.intersect,r),y:(t,e,n,r)=>Md(t,ku(e,t),"y",n.intersect,r)}};const Pd=["left","top","right","bottom"];function Td(t,e){return t.filter((t=>t.pos===e))}function Nd(t,e){return t.filter((t=>-1===Pd.indexOf(t.pos)&&t.box.axis===e))}function Dd(t,e){return t.sort(((t,n)=>{const r=e?n:t,i=e?t:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight}))}function Ad(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:r,stackWeight:i}=n;if(!t||!Pd.includes(r))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=i}return e}(t),{vBoxMaxWidth:r,hBoxMaxHeight:i}=e;let o,a,s;for(o=0,a=t.length;o<a;++o){s=t[o];const{fullSize:a}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*r:a&&e.availableWidth,s.height=i):(s.width=r,s.height=c?c*i:a&&e.availableHeight)}return n}function Ld(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function Id(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function zd(t,e,n,r){const{pos:i,box:o}=n,a=t.maxPadding;if(!il(i)){n.size&&(t[i]-=n.size);const e=r[n.stack]||{size:0,count:1};e.size=Math.max(e.size,n.horizontal?o.height:o.width),n.size=e.size/e.count,t[i]+=n.size}o.getPadding&&Id(a,o.getPadding());const s=Math.max(0,e.outerWidth-Ld(a,t,"left","right")),l=Math.max(0,e.outerHeight-Ld(a,t,"top","bottom")),c=s!==t.w,u=l!==t.h;return t.w=s,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Rd(t,e){const n=e.maxPadding;function r(t){const r={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{r[t]=Math.max(e[t],n[t])})),r}return r(t?["left","right"]:["top","bottom"])}function $d(t,e,n,r){const i=[];let o,a,s,l,c,u;for(o=0,a=t.length,c=0;o<a;++o){s=t[o],l=s.box,l.update(s.width||e.w,s.height||e.h,Rd(s.horizontal,e));const{same:a,other:d}=zd(e,n,s,r);c|=a&&i.length,u=u||d,l.fullSize||i.push(s)}return c&&$d(i,e,n,r)||u}function Fd(t,e,n,r,i){t.top=n,t.left=e,t.right=e+r,t.bottom=n+i,t.width=r,t.height=i}function jd(t,e,n,r){const i=n.padding;let{x:o,y:a}=e;for(const s of t){const t=s.box,l=r[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const r=e.w*c,o=l.size||t.height;xl(l.start)&&(a=l.start),t.fullSize?Fd(t,i.left,a,n.outerWidth-i.right-i.left,o):Fd(t,e.left+l.placed,a,r,o),l.start=a,l.placed+=r,a=t.bottom}else{const r=e.h*c,a=l.size||t.width;xl(l.start)&&(o=l.start),t.fullSize?Fd(t,o,i.top,a,n.outerHeight-i.bottom-i.top):Fd(t,o,e.top+l.placed,a,r),l.start=o,l.placed+=r,o=t.right}}e.x=o,e.y=a}var Bd={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,r){if(!t)return;const i=qc(t.options.layout.padding),o=Math.max(e-i.width,0),a=Math.max(n-i.height,0),s=function(t){const e=function(t){const e=[];let n,r,i,o,a,s;for(n=0,r=(t||[]).length;n<r;++n)i=t[n],({position:o,options:{stack:a,stackWeight:s=1}}=i),e.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&o+a,stackWeight:s});return e}(t),n=Dd(e.filter((t=>t.box.fullSize)),!0),r=Dd(Td(e,"left"),!0),i=Dd(Td(e,"right")),o=Dd(Td(e,"top"),!0),a=Dd(Td(e,"bottom")),s=Nd(e,"x"),l=Nd(e,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:Td(e,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(a).concat(s)}}(t.boxes),l=s.vertical,c=s.horizontal;ul(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const u=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},i);Id(h,qc(r));const p=Object.assign({maxPadding:h,w:o,h:a,x:i.left,y:i.top},i),f=Ad(l.concat(c),d);$d(s.fullSize,p,d,f),$d(l,p,d,f),$d(c,p,d,f)&&$d(l,p,d,f),function(t){const e=t.maxPadding;function n(n){const r=Math.max(e[n]-t[n],0);return t[n]+=r,r}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(p),jd(s.leftAndTop,p,d,f),p.x+=p.w,p.y+=p.h,jd(s.rightAndBottom,p,d,f),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},ul(s.chartArea,(e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})}))}};class Hd{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,r){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):n)}}isAttached(t){return!0}updateConfig(t){}}class Wd extends Hd{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Vd="$chartjs",Yd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Xd=t=>null===t||""===t;const qd=!!Ou&&{passive:!0};function Ud(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,qd)}function Zd(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Gd(t,e,n){const r=t.canvas,i=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||Zd(n.addedNodes,r),e=e&&!Zd(n.removedNodes,r);e&&n()}));return i.observe(document,{childList:!0,subtree:!0}),i}function Kd(t,e,n){const r=t.canvas,i=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||Zd(n.removedNodes,r),e=e&&!Zd(n.addedNodes,r);e&&n()}));return i.observe(document,{childList:!0,subtree:!0}),i}const Jd=new Map;let Qd=0;function th(){const t=window.devicePixelRatio;t!==Qd&&(Qd=t,Jd.forEach(((e,n)=>{n.currentDevicePixelRatio!==t&&e()})))}function eh(t,e,n){const r=t.canvas,i=r&&bu(r);if(!i)return;const o=ec(((t,e)=>{const r=i.clientWidth;n(t,e),r<i.clientWidth&&n()}),window),a=new ResizeObserver((t=>{const e=t[0],n=e.contentRect.width,r=e.contentRect.height;0===n&&0===r||o(n,r)}));return a.observe(i),function(t,e){Jd.size||window.addEventListener("resize",th),Jd.set(t,e)}(t,o),a}function nh(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){Jd.delete(t),Jd.size||window.removeEventListener("resize",th)}(t)}function rh(t,e,n){const r=t.canvas,i=ec((e=>{null!==t.ctx&&n(function(t,e){const n=Yd[t.type]||t.type,{x:r,y:i}=ku(t,e);return{type:n,chart:e,native:t,x:void 0!==r?r:null,y:void 0!==i?i:null}}(e,t))}),t);return function(t,e,n){t&&t.addEventListener(e,n,qd)}(r,e,i),i}class ih extends Hd{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,r=t.getAttribute("height"),i=t.getAttribute("width");if(t[Vd]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Xd(i)){const e=Pu(t,"width");void 0!==e&&(t.width=e)}if(Xd(r))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Pu(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Vd])return!1;const n=e[Vd].initial;["height","width"].forEach((t=>{const r=n[t];nl(r)?e.removeAttribute(t):e.setAttribute(t,r)}));const r=n.style||{};return Object.keys(r).forEach((t=>{e.style[t]=r[t]})),e.width=e.width,delete e[Vd],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),i={attach:Gd,detach:Kd,resize:eh}[e]||rh;r[e]=i(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),r=n[e];if(!r)return;({attach:nh,detach:nh,resize:nh}[e]||Ud)(t,e,r),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,r){return Eu(t,e,n,r)}isAttached(t){const e=t&&bu(t);return!(!e||!e.isConnected)}}class oh{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return zl(this.x)&&zl(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const r={};return t.forEach((t=>{r[t]=n[t]&&n[t].active()?n[t]._to:this[t]})),r}}function ah(t,e){const n=t.options.ticks,r=function(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),i=t._maxLength/n;return Math.floor(Math.min(r,i))}(t),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?function(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}(e):[],a=o.length,s=o[0],l=o[a-1],c=[];if(a>i)return function(t,e,n,r){let i,o=0,a=n[0];for(r=Math.ceil(r),i=0;i<t.length;i++)i===a&&(e.push(t[i]),o++,a=n[o*r])}(e,c,o,a/i),c;const u=function(t,e,n){const r=function(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}(t),i=e.length/n;if(!r)return Math.max(i,1);const o=function(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r==0&&(e.push(r),e.push(t/r));return n===(0|n)&&e.push(n),e.sort(((t,e)=>t-e)).pop(),e}(r);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>i)return e}return Math.max(i,1)}(o,e,i);if(a>0){let t,n;const r=a>1?Math.round((l-s)/(a-1)):null;for(sh(e,c,u,nl(r)?0:s-r,s),t=0,n=a-1;t<n;t++)sh(e,c,u,o[t],o[t+1]);return sh(e,c,u,l,nl(r)?e.length:l+r),c}return sh(e,c,u),c}function sh(t,e,n,r,i){const o=sl(r,0),a=Math.min(sl(i,t.length),t.length);let s,l,c,u=0;for(n=Math.ceil(n),i&&(s=i-r,n=s/Math.floor(s/n)),c=o;c<0;)u++,c=Math.round(o+u*n);for(l=Math.max(o,0);l<a;l++)l===c&&(e.push(t[l]),u++,c=Math.round(o+u*n))}const lh=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n,ch=(t,e)=>Math.min(e||t,t);function uh(t,e){const n=[],r=t.length/e,i=t.length;let o=0;for(;o<i;o+=r)n.push(t[Math.floor(o)]);return n}function dh(t,e,n){const r=t.ticks.length,i=Math.min(e,r-1),o=t._startPixel,a=t._endPixel,s=1e-6;let l,c=t.getPixelForTick(i);if(!(n&&(l=1===r?Math.max(c-o,a-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(i-1))/2,c+=i<e?l:-l,c<o-s||c>a+s)))return c}function hh(t){return t.drawTicks?t.tickLength:0}function ph(t,e){if(!t.display)return 0;const n=Uc(t.font,e),r=qc(t.padding);return(rl(t.text)?t.text.length:1)*n.lineHeight+r.height}function fh(t,e,n){let r=nc(t);return(n&&"right"!==e||!n&&"right"===e)&&(r=(t=>"left"===t?"right":"right"===t?"left":t)(r)),r}class mh extends oh{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:n,_suggestedMax:r}=this;return t=al(t,Number.POSITIVE_INFINITY),e=al(e,Number.NEGATIVE_INFINITY),n=al(n,Number.POSITIVE_INFINITY),r=al(r,Number.NEGATIVE_INFINITY),{min:al(t,n),max:al(e,r),minDefined:ol(t),maxDefined:ol(e)}}getMinMax(t){let e,{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds();if(i&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)e=a[s].controller.getMinMax(this,t),i||(n=Math.min(n,e.min)),o||(r=Math.max(r,e.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:al(n,al(r,n)),max:al(r,al(n,r))}}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(){cl(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:r,grace:i,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,n){const{min:r,max:i}=t,o=ll(e,(i-r)/2),a=(t,e)=>n&&0===t?0:t+e;return{min:a(r,-Math.abs(o)),max:a(i,o)}}(this,i,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?uh(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=ah(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,n=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,n=!n),this._startPixel=t,this._endPixel=e,this._reversePixels=n,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){cl(this.options.afterUpdate,[this])}beforeSetDimensions(){cl(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(){cl(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),cl(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){cl(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,r,i;for(n=0,r=t.length;n<r;n++)i=t[n],i.label=cl(e.callback,[i.value,n,t],this)}afterTickToLabelConversion(){cl(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){cl(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=ch(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,i=e.maxRotation;let o,a,s,l=r;if(!this._isVisible()||!e.display||r>=i||n<=1||!this.isHorizontal())return void(this.labelRotation=r);const c=this._getLabelSizes(),u=c.widest.width,d=c.highest.height,h=Xl(this.chart.width-u,0,this.maxWidth);o=t.offset?this.maxWidth/n:h/(n-1),u+6>o&&(o=h/(n-(t.offset?.5:1)),a=this.maxHeight-hh(t.grid)-e.padding-ph(t.title,this.chart.options.font),s=Math.sqrt(u*u+d*d),l=Fl(Math.min(Math.asin(Xl((c.highest.height+6)/o,-1,1)),Math.asin(Xl(a/s,-1,1))-Math.asin(Xl(d/s,-1,1)))),l=Math.max(r,Math.min(i,l))),this.labelRotation=l}afterCalculateLabelRotation(){cl(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){cl(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:r,grid:i}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=ph(r,e.options.font);if(a?(t.width=this.maxWidth,t.height=hh(i)+o):(t.height=this.maxHeight,t.width=hh(i)+o),n.display&&this.ticks.length){const{first:e,last:r,widest:i,highest:o}=this._getLabelSizes(),s=2*n.padding,l=$l(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(a){const e=n.mirror?0:u*i.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+s)}else{const e=n.mirror?0:c*i.width+u*o.height;t.width=Math.min(this.maxWidth,t.width+e+s)}this._calculatePadding(e,r,u,c)}}this._handleMargins(),a?(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,n,r){const{ticks:{align:i,padding:o},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,d=0;s?l?(u=r*t.width,d=n*e.height):(u=n*t.height,d=r*e.width):"start"===i?d=e.width:"end"===i?u=t.width:"inner"!==i&&(u=t.width/2,d=e.width/2),this.paddingLeft=Math.max((u-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let n=e.height/2,r=t.height/2;"start"===i?(n=0,r=t.height):"end"===i&&(n=e.height,r=0),this.paddingTop=n+o,this.paddingBottom=r+o}}_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(){cl(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,n=t.length;e<n;e++)nl(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=uh(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:r,_longestTextCache:i}=this,o=[],a=[],s=Math.floor(e/ch(e,n));let l,c,u,d,h,p,f,m,g,v,y,b=0,_=0;for(l=0;l<e;l+=s){if(d=t[l].label,h=this._resolveTickFontOptions(l),r.font=p=h.string,f=i[p]=i[p]||{data:{},gc:[]},m=h.lineHeight,g=v=0,nl(d)||rl(d)){if(rl(d))for(c=0,u=d.length;c<u;++c)y=d[c],nl(y)||rl(y)||(g=Cc(r,f.data,f.gc,g,y),v+=m)}else g=Cc(r,f.data,f.gc,g,d),v=m;o.push(g),a.push(v),b=Math.max(g,b),_=Math.max(v,_)}!function(t,e){ul(t,(t=>{const n=t.gc,r=n.length/2;let i;if(r>e){for(i=0;i<r;++i)delete t.data[n[i]];n.splice(0,r)}}))}(i,e);const x=o.indexOf(b),w=a.indexOf(_),S=t=>({width:o[t]||0,height:a[t]||0});return{first:S(0),last:S(e-1),widest:S(x),highest:S(w),widths:o,heights:a}}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 Xl(this._alignToPixels?Mc(this.chart,e,0):e,-32768,32767)}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 n=e[t];return n.$context||(n.$context=function(t,e,n){return Gc(t,{tick:n,index:e,type:"tick"})}(this.getContext(),t,n))}return this.$context||(this.$context=Gc(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=$l(this.labelRotation),n=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),i=this._getLabelSizes(),o=t.autoSkipPadding||0,a=i?i.widest.width+o:0,s=i?i.highest.height+o:0;return this.isHorizontal()?s*n>a*r?a/n:s/r:s*r<a*n?s/n:a/r}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,r=this.options,{grid:i,position:o,border:a}=r,s=i.offset,l=this.isHorizontal(),c=this.ticks.length+(s?1:0),u=hh(i),d=[],h=a.setContext(this.getContext()),p=h.display?h.width:0,f=p/2,m=function(t){return Mc(n,t,p)};let g,v,y,b,_,x,w,S,k,C,E,M;if("top"===o)g=m(this.bottom),x=this.bottom-u,S=g-f,C=m(t.top)+f,M=t.bottom;else if("bottom"===o)g=m(this.top),C=t.top,M=m(t.bottom)-f,x=g+f,S=this.top+u;else if("left"===o)g=m(this.right),_=this.right-u,w=g-f,k=m(t.left)+f,E=t.right;else if("right"===o)g=m(this.left),k=t.left,E=m(t.right)-f,_=g+f,w=this.left+u;else if("x"===e){if("center"===o)g=m((t.top+t.bottom)/2+.5);else if(il(o)){const t=Object.keys(o)[0],e=o[t];g=m(this.chart.scales[t].getPixelForValue(e))}C=t.top,M=t.bottom,x=g+f,S=x+u}else if("y"===e){if("center"===o)g=m((t.left+t.right)/2);else if(il(o)){const t=Object.keys(o)[0],e=o[t];g=m(this.chart.scales[t].getPixelForValue(e))}_=g-f,w=_-u,k=t.left,E=t.right}const O=sl(r.ticks.maxTicksLimit,c),P=Math.max(1,Math.ceil(c/O));for(v=0;v<c;v+=P){const t=this.getContext(v),e=i.setContext(t),r=a.setContext(t),o=e.lineWidth,c=e.color,u=r.dash||[],h=r.dashOffset,p=e.tickWidth,f=e.tickColor,m=e.tickBorderDash||[],g=e.tickBorderDashOffset;y=dh(this,v,s),void 0!==y&&(b=Mc(n,y,o),l?_=w=k=E=b:x=S=C=M=b,d.push({tx1:_,ty1:x,tx2:w,ty2:S,x1:k,y1:C,x2:E,y2:M,width:o,color:c,borderDash:u,borderDashOffset:h,tickWidth:p,tickColor:f,tickBorderDash:m,tickBorderDashOffset:g}))}return this._ticksLength=c,this._borderValue=g,d}_computeLabelItems(t){const e=this.axis,n=this.options,{position:r,ticks:i}=n,o=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:l,padding:c,mirror:u}=i,d=hh(n.grid),h=d+c,p=u?-c:h,f=-$l(this.labelRotation),m=[];let g,v,y,b,_,x,w,S,k,C,E,M,O="middle";if("top"===r)x=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===r)x=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===r){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,_=t.x}else if("right"===r){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,_=t.x}else if("x"===e){if("center"===r)x=(t.top+t.bottom)/2+h;else if(il(r)){const t=Object.keys(r)[0],e=r[t];x=this.chart.scales[t].getPixelForValue(e)+h}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===r)_=(t.left+t.right)/2-h;else if(il(r)){const t=Object.keys(r)[0],e=r[t];_=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===e&&("start"===s?O="top":"end"===s&&(O="bottom"));const P=this._getLabelSizes();for(g=0,v=a.length;g<v;++g){y=a[g],b=y.label;const t=i.setContext(this.getContext(g));S=this.getPixelForTick(g)+i.labelOffset,k=this._resolveTickFontOptions(g),C=k.lineHeight,E=rl(b)?b.length:1;const e=E/2,n=t.color,s=t.textStrokeColor,c=t.textStrokeWidth;let d,h=w;if(o?(_=S,"inner"===w&&(h=g===v-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),M="top"===r?"near"===l||0!==f?-E*C+C/2:"center"===l?-P.highest.height/2-e*C+C:-P.highest.height+C/2:"near"===l||0!==f?C/2:"center"===l?P.highest.height/2-e*C:P.highest.height-E*C,u&&(M*=-1),0===f||t.showLabelBackdrop||(_+=C/2*Math.sin(f))):(x=S,M=(1-E)*C/2),t.showLabelBackdrop){const e=qc(t.backdropPadding),n=P.heights[g],r=P.widths[g];let i=M-e.top,o=0-e.left;switch(O){case"middle":i-=n/2;break;case"bottom":i-=n}switch(w){case"center":o-=r/2;break;case"right":o-=r;break;case"inner":g===v-1?o-=r:g>0&&(o-=r/2)}d={left:o,top:i,width:r+e.width,height:n+e.height,color:t.backdropColor}}m.push({label:b,font:k,textOffset:M,options:{rotation:f,color:n,strokeColor:s,strokeWidth:c,textAlign:h,textBaseline:O,translation:[_,x],backdrop:d}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$l(this.labelRotation))return"top"===t?"left":"right";let n="center";return"start"===e.align?n="left":"end"===e.align?n="right":"inner"===e.align&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,o=t+i,a=this._getLabelSizes().widest.width;let s,l;return"left"===e?r?(l=this.right+i,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l+=a)):(l=this.right-o,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l=this.left)):"right"===e?r?(l=this.left+i,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l-=a)):(l=this.left+o,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:r,width:i,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,r,i,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex((e=>e.value===t));if(n>=0){return e.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,n=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,o;const a=(t,e,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(e.display)for(i=0,o=r.length;i<o;++i){const t=r[i];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),o=n.display?i.width:0;if(!o)return;const a=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let l,c,u,d;this.isHorizontal()?(l=Mc(t,this.left,o)-o/2,c=Mc(t,this.right,a)+a/2,u=d=s):(u=Mc(t,this.top,o)-o/2,d=Mc(t,this.bottom,a)+a/2,l=c=s),e.save(),e.lineWidth=i.width,e.strokeStyle=i.color,e.beginPath(),e.moveTo(l,u),e.lineTo(c,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,n=this._computeLabelArea();n&&Dc(e,n);const r=this.getLabelItems(t);for(const t of r){const n=t.options,r=t.font;$c(e,t.label,0,t.textOffset,r,n)}n&&Ac(e)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:r}}=this;if(!n.display)return;const i=Uc(n.font),o=qc(n.padding),a=n.align;let s=i.lineHeight/2;"bottom"===e||"center"===e||il(e)?(s+=o.bottom,rl(n.text)&&(s+=i.lineHeight*(n.text.length-1))):s+=o.top;const{titleX:l,titleY:c,maxWidth:u,rotation:d}=function(t,e,n,r){const{top:i,left:o,bottom:a,right:s,chart:l}=t,{chartArea:c,scales:u}=l;let d,h,p,f=0;const m=a-i,g=s-o;if(t.isHorizontal()){if(h=rc(r,o,s),il(n)){const t=Object.keys(n)[0],r=n[t];p=u[t].getPixelForValue(r)+m-e}else p="center"===n?(c.bottom+c.top)/2+m-e:lh(t,n,e);d=s-o}else{if(il(n)){const t=Object.keys(n)[0],r=n[t];h=u[t].getPixelForValue(r)-g+e}else h="center"===n?(c.left+c.right)/2-g+e:lh(t,n,e);p=rc(r,a,i),f="left"===n?-Pl:Pl}return{titleX:h,titleY:p,maxWidth:d,rotation:f}}(this,s,e,a);$c(t,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:fh(a,e,r),textBaseline:"middle",translation:[l,c]})}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,n=sl(t.grid&&t.grid.z,-1),r=sl(t.border&&t.border.z,0);return this._isVisible()&&this.draw===mh.prototype.draw?[{z:n,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",r=[];let i,o;for(i=0,o=e.length;i<o;++i){const o=e[i];o[n]!==this.id||t&&o.type!==t||r.push(o)}return r}_resolveTickFontOptions(t){return Uc(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class gh{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,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 n;(function(t){return"id"in t&&"defaults"in t})(e)&&(n=this.register(e));const r=this.items,i=t.id,o=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in r||(r[i]=t,function(t,e,n){const r=ml(Object.create(null),[n?kc.get(n):{},kc.get(e),t.defaults]);kc.set(e,r),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((n=>{const r=n.split("."),i=r.pop(),o=[t].concat(r).join("."),a=e[n].split("."),s=a.pop(),l=a.join(".");kc.route(o,i,l,s)}))}(e,t.defaultRoutes);t.descriptors&&kc.describe(e,t.descriptors)}(t,o,n),this.override&&kc.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,r=this.scope;n in e&&delete e[n],r&&n in kc[r]&&(delete kc[r][n],this.override&&delete bc[n])}}class vh{constructor(){this.controllers=new gh(ad,"datasets",!0),this.elements=new gh(oh,"elements"),this.plugins=new gh(Object,"plugins"),this.scales=new gh(mh,"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,n){[...e].forEach((e=>{const r=n||this._getRegistryForType(e);n||r.isForType(e)||r===this.plugins&&e.id?this._exec(t,r,e):ul(e,(e=>{const r=n||this._getRegistryForType(e);this._exec(t,r,e)}))}))}_exec(t,e,n){const r=_l(t);cl(n["before"+r],[],n),e[t](n),cl(n["after"+r],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const r=e.get(t);if(void 0===r)throw new Error('"'+t+'" is not a registered '+n+".");return r}}var yh=new vh;class bh{constructor(){this._init=[]}notify(t,e,n,r){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const i=r?this._descriptors(t).filter(r):this._descriptors(t),o=this._notify(i,t,e,n);return"afterDestroy"===e&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,n,r){r=r||{};for(const i of t){const t=i.plugin;if(!1===cl(t[n],[e,r,i.options],t)&&r.cancelable)return!1}return!0}invalidate(){nl(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 n=t&&t.config,r=sl(n.options&&n.options.plugins,{}),i=function(t){const e={},n=[],r=Object.keys(yh.plugins.items);for(let t=0;t<r.length;t++)n.push(yh.getPlugin(r[t]));const i=t.plugins||[];for(let t=0;t<i.length;t++){const r=i[t];-1===n.indexOf(r)&&(n.push(r),e[r.id]=!0)}return{plugins:n,localIds:e}}(n);return!1!==r||e?function(t,{plugins:e,localIds:n},r,i){const o=[],a=t.getContext();for(const s of e){const e=s.id,l=_h(r[e],i);null!==l&&o.push({plugin:s,options:xh(t.config,{plugin:s,local:n[e]},l,a)})}return o}(t,i,r,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,r=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(r(e,n),t,"stop"),this._notify(r(n,e),t,"start")}}function _h(t,e){return e||!1!==t?!0===t?{}:t:null}function xh(t,{plugin:e,local:n},r,i){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(r,o);return n&&e.defaults&&a.push(e.defaults),t.createResolver(a,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function wh(t,e){const n=kc.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Sh(t){if("x"===t||"y"===t||"r"===t)return t}function kh(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Ch(t,...e){if(Sh(t))return t;for(const n of e){const e=n.axis||kh(n.position)||t.length>1&&Sh(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Eh(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function Mh(t,e){const n=bc[t.type]||{scales:{}},r=e.scales||{},i=wh(t.type,e),o=Object.create(null);return Object.keys(r).forEach((e=>{const a=r[e];if(!il(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const s=Ch(e,a,function(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(n.length)return Eh(t,"x",n[0])||Eh(t,"y",n[0])}return{}}(e,t),kc.scales[a.type]),l=function(t,e){return t===e?"_index_":"_value_"}(s,i),c=n.scales||{};o[e]=gl(Object.create(null),[{axis:s},a,c[s],c[l]])})),t.data.datasets.forEach((n=>{const i=n.type||t.type,a=n.indexAxis||wh(i,e),s=(bc[i]||{}).scales||{};Object.keys(s).forEach((t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,a),i=n[e+"AxisID"]||e;o[i]=o[i]||Object.create(null),gl(o[i],[{axis:e},r[i],s[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];gl(e,[kc.scales[e.type],kc.scale])})),o}function Oh(t){const e=t.options||(t.options={});e.plugins=sl(e.plugins,{}),e.scales=Mh(t,e)}function Ph(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Th=new Map,Nh=new Set;function Dh(t,e){let n=Th.get(t);return n||(n=e(),Th.set(t,n),Nh.add(n)),n}const Ah=(t,e,n)=>{const r=bl(e,n);void 0!==r&&t.add(r)};class Lh{constructor(t){this._config=function(t){return(t=t||{}).data=Ph(t.data),Oh(t),t}(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=Ph(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(),Oh(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Dh(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Dh(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Dh(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Dh(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const n=this._scopeCache;let r=n.get(t);return r&&!e||(r=new Map,n.set(t,r)),r}getOptionScopes(t,e,n){const{options:r,type:i}=this,o=this._cachedScopes(t,n),a=o.get(e);if(a)return a;const s=new Set;e.forEach((e=>{t&&(s.add(t),e.forEach((e=>Ah(s,t,e)))),e.forEach((t=>Ah(s,r,t))),e.forEach((t=>Ah(s,bc[i]||{},t))),e.forEach((t=>Ah(s,kc,t))),e.forEach((t=>Ah(s,_c,t)))}));const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),Nh.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,bc[e]||{},kc.datasets[e]||{},{type:e},kc,_c]}resolveNamedOptions(t,e,n,r=[""]){const i={$shared:!0},{resolver:o,subPrefixes:a}=Ih(this._resolverCache,t,r);let s=o;if(function(t,e){const{isScriptable:n,isIndexable:r}=Qc(t);for(const i of e){const e=n(i),o=r(i),a=(o||e)&&t[i];if(e&&(wl(a)||zh(a))||o&&rl(a))return!0}return!1}(o,e)){i.$shared=!1;s=Jc(o,n=wl(n)?n():n,this.createResolver(t,n,a))}for(const t of e)i[t]=s[t];return i}createResolver(t,e,n=[""],r){const{resolver:i}=Ih(this._resolverCache,t,n);return il(e)?Jc(i,e,void 0,r):i}}function Ih(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const i=n.join();let o=r.get(i);if(!o){o={resolver:Kc(e,n),subPrefixes:n.filter((t=>!t.toLowerCase().includes("hover")))},r.set(i,o)}return o}const zh=t=>il(t)&&Object.getOwnPropertyNames(t).some((e=>wl(t[e])));const Rh=["top","bottom","left","right","chartArea"];function $h(t,e){return"top"===t||"bottom"===t||-1===Rh.indexOf(t)&&"x"===e}function Fh(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function jh(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),cl(n&&n.onComplete,[t],e)}function Bh(t){const e=t.chart,n=e.options.animation;cl(n&&n.onProgress,[t],e)}function Hh(t){return yu()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Wh={},Vh=t=>{const e=Hh(t);return Object.values(Wh).filter((t=>t.canvas===e)).pop()};function Yh(t,e,n){const r=Object.keys(t);for(const i of r){const r=+i;if(r>=e){const o=t[i];delete t[i],(n>0||r>e)&&(t[r+n]=o)}}}function Xh(t,e,n){return t.options.clip?t[n]:e[n]}class qh{static defaults=kc;static instances=Wh;static overrides=bc;static registry=yh;static version="4.4.7";static getChart=Vh;static register(...t){yh.add(...t),Uh()}static unregister(...t){yh.remove(...t),Uh()}constructor(t,e){const n=this.config=new Lh(e),r=Hh(t),i=Vh(r);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(t){return!yu()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Wd:ih}(r)),this.platform.updateConfig(n);const a=this.platform.acquireContext(r,o.aspectRatio),s=a&&a.canvas,l=s&&s.height,c=s&&s.width;this.id=el(),this.ctx=a,this.canvas=s,this.width=c,this.height=l,this._options=o,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 bh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],Wh[this.id]=this,a&&s?(Vu.listen(this,"complete",jh),Vu.listen(this,"progress",Bh),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:r,_aspectRatio:i}=this;return nl(t)?e&&i?i:r?n/r: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 yh}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Mu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Oc(this.canvas,this.ctx),this}stop(){return Vu.stop(this),this}resize(t,e){Vu.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,t,e,i),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Mu(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),cl(n.onResize,[this,o],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){ul(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,r=Object.keys(n).reduce(((t,e)=>(t[e]=!1,t)),{});let i=[];e&&(i=i.concat(Object.keys(e).map((t=>{const n=e[t],r=Ch(t,n),i="r"===r,o="x"===r;return{options:n,dposition:i?"chartArea":o?"bottom":"left",dtype:i?"radialLinear":o?"category":"linear"}})))),ul(i,(e=>{const i=e.options,o=i.id,a=Ch(o,i),s=sl(i.type,e.dtype);void 0!==i.position&&$h(i.position,a)===$h(e.dposition)||(i.position=e.dposition),r[o]=!0;let l=null;if(o in n&&n[o].type===s)l=n[o];else{l=new(yh.getScale(s))({id:o,type:s,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(i,t)})),ul(r,((t,e)=>{t||delete n[e]})),ul(n,(t=>{Bd.configure(this,t,t.options),Bd.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort(((t,e)=>t.index-e.index)),n>e){for(let t=e;t<n;++t)this._destroyDatasetMeta(t);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(Fh("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,n)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(n)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,r;for(this._removeUnreferencedMetasets(),n=0,r=e.length;n<r;n++){const r=e[n];let i=this.getDatasetMeta(n);const o=r.type||this.config.type;if(i.type&&i.type!==o&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=o,i.indexAxis=r.indexAxis||wh(o,this.options),i.order=r.order||0,i.index=n,i.label=""+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{const e=yh.getController(o),{datasetElementType:r,dataElementType:a}=kc.datasets[o];Object.assign(e,{dataElementType:yh.getElement(a),datasetElementType:r&&yh.getElement(r)}),i.controller=new e(this,n),t.push(i.controller)}}return this._updateMetasets(),t}_resetElements(){ul(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 n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),n=!r&&-1===i.indexOf(e);e.buildOrUpdateElements(n),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),r||ul(i,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fh("z","_idx"));const{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ul(this.scales,(t=>{Bd.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);Sl(e,n)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:r,count:i}of e){Yh(t,r,"_removeElements"===n?-i:i)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),r=n(0);for(let t=1;t<e;t++)if(!Sl(r,n(t)))return;return Array.from(r).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Bd.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],ul(this.boxes,(t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,wl(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),r={meta:n,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",r)&&(n.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Vu.has(this)?this.attached&&!Vu.running(this)&&Vu.start(this):(this.draw(),jh({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))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,n=[];let r,i;for(r=0,i=e.length;r<i;++r){const i=e[r];t&&!i.visible||n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))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,n=t._clip,r=!n.disabled,i=function(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:Xh(n,e,"left"),right:Xh(n,e,"right"),top:Xh(r,e,"top"),bottom:Xh(r,e,"bottom")}:e}(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(r&&Dc(e,{left:!1===n.left?0:i.left-n.left,right:!1===n.right?this.width:i.right+n.right,top:!1===n.top?0:i.top-n.top,bottom:!1===n.bottom?this.height:i.bottom+n.bottom}),t.controller.draw(),r&&Ac(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Nc(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,r){const i=Od.modes[e];return"function"==typeof i?i(this,t,n,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let r=n.filter((t=>t&&t._dataset===e)).pop();return r||(r={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},n.push(r)),r}getContext(){return this.$context||(this.$context=Gc(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const r=n?"show":"hide",i=this.getDatasetMeta(t),o=i.controller._resolveAnimations(void 0,r);xl(e)?(i.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(i,{visible:n}),this.update((e=>e.datasetIndex===t?r: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(),Vu.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(),Oc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Wh[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,n=(n,r)=>{e.addEventListener(this,n,r),t[n]=r},r=(t,e,n)=>{t.offsetX=e,t.offsetY=n,this._eventHandler(t)};ul(this.options.events,(t=>n(t,r)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(n,r)=>{e.addEventListener(this,n,r),t[n]=r},r=(n,r)=>{t[n]&&(e.removeEventListener(this,n,r),delete t[n])},i=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{r("attach",a),this.attached=!0,this.resize(),n("resize",i),n("detach",o)};o=()=>{this.attached=!1,r("resize",i),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){ul(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},ul(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const r=n?"set":"remove";let i,o,a,s;for("dataset"===e&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+r+"DatasetHoverStyle"]()),a=0,s=t.length;a<s;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[r+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map((({datasetIndex:t,index:e})=>{const n=this.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}));!dl(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,n){const r=this.options.hover,i=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=i(e,t),a=n?t:i(t,e);o.length&&this.updateHoverStyle(o,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",n,r))return;const i=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,r),(i||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:r=[],options:i}=this,o=e,a=this._getActiveElements(t,r,n,o),s=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,n,r){return n&&"mouseout"!==t.type?r?e:t:null}(t,this._lastEvent,n,s);n&&(this._lastEvent=null,cl(i.onHover,[t,a,this],this),s&&cl(i.onClick,[t,a,this],this));const c=!dl(a,r);return(c||e)&&(this._active=a,this._updateHoverStyles(a,r,e)),this._lastEvent=l,c}_getActiveElements(t,e,n,r){if("mouseout"===t.type)return[];if(!n)return e;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,r)}}function Uh(){return ul(qh.instances,(t=>t._plugins.invalidate()))}function Zh(t,e,n,r){const i=Vc(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(n-e)/2,a=Math.min(o,r*e/2),s=t=>{const e=(n-Math.min(o,t))*r/2;return Xl(t,0,Math.min(o,e))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:Xl(i.innerStart,0,a),innerEnd:Xl(i.innerEnd,0,a)}}function Gh(t,e,n,r){return{x:n+t*Math.cos(e),y:r+t*Math.sin(e)}}function Kh(t,e,n,r,i,o){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=e,d=Math.max(e.outerRadius+r+n-c,0),h=u>0?u+r+n+c:0;let p=0;const f=i-l;if(r){const t=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(f-(0!==t?f*t/(t+r):f))/2}const m=(f-Math.max(.001,f*d-n/kl)/d)/2,g=l+m+p,v=i-m-p,{outerStart:y,outerEnd:b,innerStart:_,innerEnd:x}=Zh(e,h,d,v-g),w=d-y,S=d-b,k=g+y/w,C=v-b/S,E=h+_,M=h+x,O=g+_/E,P=v-x/M;if(t.beginPath(),o){const e=(k+C)/2;if(t.arc(a,s,d,k,e),t.arc(a,s,d,e,C),b>0){const e=Gh(S,C,a,s);t.arc(e.x,e.y,b,C,v+Pl)}const n=Gh(M,v,a,s);if(t.lineTo(n.x,n.y),x>0){const e=Gh(M,P,a,s);t.arc(e.x,e.y,x,v+Pl,P+Math.PI)}const r=(v-x/h+(g+_/h))/2;if(t.arc(a,s,h,v-x/h,r,!0),t.arc(a,s,h,r,g+_/h,!0),_>0){const e=Gh(E,O,a,s);t.arc(e.x,e.y,_,O+Math.PI,g-Pl)}const i=Gh(w,g,a,s);if(t.lineTo(i.x,i.y),y>0){const e=Gh(w,k,a,s);t.arc(e.x,e.y,y,g-Pl,k)}}else{t.moveTo(a,s);const e=Math.cos(k)*d+a,n=Math.sin(k)*d+s;t.lineTo(e,n);const r=Math.cos(C)*d+a,i=Math.sin(C)*d+s;t.lineTo(r,i)}t.closePath()}function Jh(t,e,n,r,i){const{fullCircles:o,startAngle:a,circumference:s,options:l}=e,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,p="inner"===l.borderAlign;if(!c)return;t.setLineDash(d||[]),t.lineDashOffset=h,p?(t.lineWidth=2*c,t.lineJoin=u||"round"):(t.lineWidth=c,t.lineJoin=u||"bevel");let f=e.endAngle;if(o){Kh(t,e,n,r,f,i);for(let e=0;e<o;++e)t.stroke();isNaN(s)||(f=a+(s%Cl||Cl))}p&&function(t,e,n){const{startAngle:r,pixelMargin:i,x:o,y:a,outerRadius:s,innerRadius:l}=e;let c=i/s;t.beginPath(),t.arc(o,a,s,r-c,n+c),l>i?(c=i/l,t.arc(o,a,l,n+c,r-c,!0)):t.arc(o,a,i,n+Pl,r-Pl),t.closePath(),t.clip()}(t,e,f),o||(Kh(t,e,n,r,f,i),t.stroke())}function Qh(t,e,n=e){t.lineCap=sl(n.borderCapStyle,e.borderCapStyle),t.setLineDash(sl(n.borderDash,e.borderDash)),t.lineDashOffset=sl(n.borderDashOffset,e.borderDashOffset),t.lineJoin=sl(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=sl(n.borderWidth,e.borderWidth),t.strokeStyle=sl(n.borderColor,e.borderColor)}function tp(t,e,n){t.lineTo(n.x,n.y)}function ep(t,e,n={}){const r=t.length,{start:i=0,end:o=r-1}=n,{start:a,end:s}=e,l=Math.max(i,a),c=Math.min(o,s),u=i<a&&o<a||i>s&&o>s;return{count:r,start:l,loop:e.loop,ilen:c<l&&!u?r+c-l:c-l}}function np(t,e,n,r){const{points:i,options:o}=e,{count:a,start:s,loop:l,ilen:c}=ep(i,n,r),u=function(t){return t.stepped?Lc:t.tension||"monotone"===t.cubicInterpolationMode?Ic:tp}(o);let d,h,p,{move:f=!0,reverse:m}=r||{};for(d=0;d<=c;++d)h=i[(s+(m?c-d:d))%a],h.skip||(f?(t.moveTo(h.x,h.y),f=!1):u(t,p,h,m,o.stepped),p=h);return l&&(h=i[(s+(m?c:0))%a],u(t,p,h,m,o.stepped)),!!l}function rp(t,e,n,r){const i=e.points,{count:o,start:a,ilen:s}=ep(i,n,r),{move:l=!0,reverse:c}=r||{};let u,d,h,p,f,m,g=0,v=0;const y=t=>(a+(c?s-t:t))%o,b=()=>{p!==f&&(t.lineTo(g,f),t.lineTo(g,p),t.lineTo(g,m))};for(l&&(d=i[y(0)],t.moveTo(d.x,d.y)),u=0;u<=s;++u){if(d=i[y(u)],d.skip)continue;const e=d.x,n=d.y,r=0|e;r===h?(n<p?p=n:n>f&&(f=n),g=(v*g+e)/++v):(b(),t.lineTo(e,n),h=r,v=0,p=f=n),m=n}b()}function ip(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n)?rp:np}const op="function"==typeof Path2D;function ap(t,e,n,r){op&&!e.options.segment?function(t,e,n,r){let i=e._path;i||(i=e._path=new Path2D,e.path(i,n,r)&&i.closePath()),Qh(t,e.options),t.stroke(i)}(t,e,n,r):function(t,e,n,r){const{segments:i,options:o}=e,a=ip(e);for(const s of i)Qh(t,o,s.style),t.beginPath(),a(t,e,s,{start:n,end:n+r-1})&&t.closePath(),t.stroke()}(t,e,n,r)}class sp extends oh{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};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 n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const r=n.spanGaps?this._loop:this._fullLoop;vu(this._points,n,t,r,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=function(t,e){const n=t.points,r=t.options.spanGaps,i=n.length;if(!i)return[];const o=!!t._loop,{start:a,end:s}=function(t,e,n,r){let i=0,o=e-1;if(n&&!r)for(;i<e&&!t[i].skip;)i++;for(;i<e&&t[i].skip;)i++;for(i%=e,n&&(o+=i);o>i&&t[o%e].skip;)o--;return o%=e,{start:i,end:o}}(n,i,o,r);return ju(t,!0===r?[{start:a,end:s,loop:o}]:function(t,e,n,r){const i=t.length,o=[];let a,s=e,l=t[e];for(a=e+1;a<=n;++a){const n=t[a%i];n.skip||n.stop?l.skip||(r=!1,o.push({start:e%i,end:(a-1)%i,loop:r}),e=s=n.stop?a:null):(s=a,l.skip&&(e=a)),l=n}return null!==s&&o.push({start:e%i,end:s%i,loop:r}),o}(n,a,s<a?s+i:s,!!t._fullLoop&&0===a&&s===i-1),n,e)}(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,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,r=t[e],i=this.points,o=Fu(this,{property:e,start:r,end:r});if(!o.length)return;const a=[],s=function(t){return t.stepped?Nu:t.tension||"monotone"===t.cubicInterpolationMode?Du:Tu}(n);let l,c;for(l=0,c=o.length;l<c;++l){const{start:c,end:u}=o[l],d=i[c],h=i[u];if(d===h){a.push(d);continue}const p=s(d,h,Math.abs((r-d[e])/(h[e]-d[e])),n.stepped);p[e]=t[e],a.push(p)}return 1===a.length?a[0]:a}pathSegment(t,e,n){return ip(this)(t,this,e,n)}path(t,e,n){const r=this.segments,i=ip(this);let o=this._loop;e=e||0,n=n||this.points.length-e;for(const a of r)o&=i(t,this,a,{start:e,end:e+n-1});return!!o}draw(t,e,n,r){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(t.save(),ap(t,this,n,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function lp(t,e,n,r){const i=t.options,{[n]:o}=t.getProps([n],r);return Math.abs(e-o)<i.radius+i.hitRadius}function cp(t,e){const{x:n,y:r,base:i,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let s,l,c,u,d;return t.horizontal?(d=a/2,s=Math.min(n,i),l=Math.max(n,i),c=r-d,u=r+d):(d=o/2,s=n-d,l=n+d,c=Math.min(r,i),u=Math.max(r,i)),{left:s,top:c,right:l,bottom:u}}function up(t,e,n,r){return t?0:Xl(e,n,r)}function dp(t){const e=cp(t),n=e.right-e.left,r=e.bottom-e.top,i=function(t,e,n){const r=t.options.borderWidth,i=t.borderSkipped,o=Yc(r);return{t:up(i.top,o.top,0,n),r:up(i.right,o.right,0,e),b:up(i.bottom,o.bottom,0,n),l:up(i.left,o.left,0,e)}}(t,n/2,r/2),o=function(t,e,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),i=t.options.borderRadius,o=Xc(i),a=Math.min(e,n),s=t.borderSkipped,l=r||il(i);return{topLeft:up(!l||s.top||s.left,o.topLeft,0,a),topRight:up(!l||s.top||s.right,o.topRight,0,a),bottomLeft:up(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:up(!l||s.bottom||s.right,o.bottomRight,0,a)}}(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:o},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function hp(t,e,n,r){const i=null===e,o=null===n,a=t&&!(i&&o)&&cp(t,r);return a&&(i||ql(e,a.left,a.right))&&(o||ql(n,a.top,a.bottom))}function pp(t,e){t.rect(e.x,e.y,e.w,e.h)}function fp(t,e,n={}){const r=t.x!==n.x?-e:0,i=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-r,a=(t.y+t.h!==n.y+n.h?e:0)-i;return{x:t.x+r,y:t.y+i,w:t.w+o,h:t.h+a,radius:t.radius}}class mp extends oh{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:n,backgroundColor:r}}=this,{inner:i,outer:o}=dp(this),a=(s=o.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?Fc:pp;var s;t.save(),o.w===i.w&&o.h===i.h||(t.beginPath(),a(t,fp(o,e,i)),t.clip(),a(t,fp(i,-e,o)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,fp(i,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,n){return hp(this,t,e,n)}inXRange(t,e){return hp(this,t,null,e)}inYRange(t,e){return hp(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:r,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(e+r)/2:e,y:i?n:(n+r)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}var gp=Object.freeze({__proto__:null,ArcElement:class extends oh{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const r=this.getProps(["x","y"],n),{angle:i,distance:o}=Bl(r,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=(this.options.spacing+this.options.borderWidth)/2,h=sl(u,s-a),p=Yl(i,a,s)&&a!==s,f=h>=Cl||p,m=ql(o,l+d,c+d);return f&&m}getCenterPoint(t){const{x:e,y:n,startAngle:r,endAngle:i,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:s,spacing:l}=this.options,c=(r+i)/2,u=(o+a+l+s)/2;return{x:e+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,r=(e.offset||0)/4,i=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=n>Cl?Math.floor(n/Cl):0,0===n||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*r,Math.sin(a)*r);const s=r*(1-Math.sin(Math.min(kl,n||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,n,r,i){const{fullCircles:o,startAngle:a,circumference:s}=e;let l=e.endAngle;if(o){Kh(t,e,n,r,l,i);for(let e=0;e<o;++e)t.fill();isNaN(s)||(l=a+(s%Cl||Cl))}Kh(t,e,n,r,l,i),t.fill()}(t,this,s,i,o),Jh(t,this,s,i,o),t.restore()}},BarElement:mp,LineElement:sp,PointElement:class extends oh{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const r=this.options,{x:i,y:o}=this.getProps(["x","y"],n);return Math.pow(t-i,2)+Math.pow(e-o,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return lp(this,t,"x",e)}inYRange(t,e){return lp(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const n=this.options;this.skip||n.radius<.1||!Nc(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,Pc(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}});const vp=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],yp=vp.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function bp(t){return vp[t%vp.length]}function _p(t){return yp[t%yp.length]}function xp(t){let e=0;return(n,r)=>{const i=t.getDatasetMeta(r).controller;i instanceof gd?e=function(t,e){return t.backgroundColor=t.data.map((()=>bp(e++))),e}(n,e):i instanceof vd?e=function(t,e){return t.backgroundColor=t.data.map((()=>_p(e++))),e}(n,e):i&&(e=function(t,e){return t.borderColor=bp(e),t.backgroundColor=_p(e),++e}(n,e))}}function wp(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Sp={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=t.config,{elements:o}=i,a=wp(r)||(s=i)&&(s.borderColor||s.backgroundColor)||o&&wp(o)||"rgba(0,0,0,0.1)"!==kc.borderColor||"rgba(0,0,0,0.1)"!==kc.backgroundColor;var s;if(!n.forceOverride&&a)return;const l=xp(t);r.forEach(l)}};function kp(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Cp(t){t.data.datasets.forEach((t=>{kp(t)}))}var Ep={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled)return void Cp(t);const r=t.width;t.data.datasets.forEach(((e,i)=>{const{_data:o,indexAxis:a}=e,s=t.getDatasetMeta(i),l=o||e.data;if("y"===Zc([a,t.options.indexAxis]))return;if(!s.controller.supportsDecimation)return;const c=t.scales[s.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:u,count:d}=function(t,e){const n=e.length;let r,i=0;const{iScale:o}=t,{min:a,max:s,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=Xl(Zl(e,o.axis,a).lo,0,n-1)),r=c?Xl(Zl(e,o.axis,s).hi+1,i,n)-i:n-i,{start:i,count:r}}(s,l);if(d<=(n.threshold||4*r))return void kp(e);let h;switch(nl(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),n.algorithm){case"lttb":h=function(t,e,n,r,i){const o=i.samples||r;if(o>=n)return t.slice(e,e+n);const a=[],s=(n-2)/(o-2);let l=0;const c=e+n-1;let u,d,h,p,f,m=e;for(a[l++]=t[m],u=0;u<o-2;u++){let r,i=0,o=0;const c=Math.floor((u+1)*s)+1+e,g=Math.min(Math.floor((u+2)*s)+1,n)+e,v=g-c;for(r=c;r<g;r++)i+=t[r].x,o+=t[r].y;i/=v,o/=v;const y=Math.floor(u*s)+1+e,b=Math.min(Math.floor((u+1)*s)+1,n)+e,{x:_,y:x}=t[m];for(h=p=-1,r=y;r<b;r++)p=.5*Math.abs((_-i)*(t[r].y-x)-(_-t[r].x)*(o-x)),p>h&&(h=p,d=t[r],f=r);a[l++]=d,m=f}return a[l++]=t[c],a}(l,u,d,r,n);break;case"min-max":h=function(t,e,n,r){let i,o,a,s,l,c,u,d,h,p,f=0,m=0;const g=[],v=e+n-1,y=t[e].x,b=t[v].x-y;for(i=e;i<e+n;++i){o=t[i],a=(o.x-y)/b*r,s=o.y;const e=0|a;if(e===l)s<h?(h=s,c=i):s>p&&(p=s,u=i),f=(m*f+o.x)/++m;else{const n=i-1;if(!nl(c)&&!nl(u)){const e=Math.min(c,u),r=Math.max(c,u);e!==d&&e!==n&&g.push({...t[e],x:f}),r!==d&&r!==n&&g.push({...t[r],x:f})}i>0&&n!==d&&g.push(t[n]),g.push(o),l=e,m=0,h=p=s,c=u=d=i}}return g}(l,u,d,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}e._decimated=h}))},destroy(t){Cp(t)}};function Mp(t,e,n,r){if(r)return;let i=e[t],o=n[t];return"angle"===t&&(i=Vl(i),o=Vl(o)),{property:t,start:i,end:o}}function Op(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Pp(t,e,n,r){return t&&e?r(t[n],e[n]):t?t[n]:e?e[n]:0}function Tp(t,e){let n=[],r=!1;return rl(t)?(r=!0,n=t):n=function(t,e){const{x:n=null,y:r=null}=t||{},i=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=Op(t,e,i);const a=i[t],s=i[e];null!==r?(o.push({x:a.x,y:r}),o.push({x:s.x,y:r})):null!==n&&(o.push({x:n,y:a.y}),o.push({x:n,y:s.y}))})),o}(t,e),n.length?new sp({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Np(t){return t&&!1!==t.fill}function Dp(t,e,n){let r=t[e].fill;const i=[e];let o;if(!n)return r;for(;!1!==r&&-1===i.indexOf(r);){if(!ol(r))return r;if(o=t[r],!o)return!1;if(o.visible)return r;i.push(r),r=o.fill}return!1}function Ap(t,e,n){const r=function(t){const e=t.options,n=e.fill;let r=sl(n&&n.target,n);void 0===r&&(r=!!e.backgroundColor);if(!1===r||null===r)return!1;if(!0===r)return"origin";return r}(t);if(il(r))return!isNaN(r.value)&&r;let i=parseFloat(r);return ol(i)&&Math.floor(i)===i?function(t,e,n,r){"-"!==t&&"+"!==t||(n=e+n);if(n===e||n<0||n>=r)return!1;return n}(r[0],e,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Lp(t,e,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:a,last:s,point:l}=Ip(o,e,"x");if(!(!l||a&&s))if(a)r.unshift(l);else if(t.push(l),!s)break}t.push(...r)}function Ip(t,e,n){const r=t.interpolate(e,n);if(!r)return{};const i=r[n],o=t.segments,a=t.points;let s=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],r=a[e.start][n],c=a[e.end][n];if(ql(i,r,c)){s=i===r,l=i===c;break}}return{first:s,last:l,point:r}}class zp{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:r,y:i,radius:o}=this;return e=e||{start:0,end:Cl},t.arc(r,i,o,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:r}=this,i=t.angle;return{x:e+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}}function Rp(t){const{chart:e,fill:n,line:r}=t;if(ol(n))return function(t,e){const n=t.getDatasetMeta(e),r=n&&t.isDatasetVisible(e);return r?n.dataset:null}(e,n);if("stack"===n)return function(t){const{scale:e,index:n,line:r}=t,i=[],o=r.segments,a=r.points,s=function(t,e){const n=[],r=t.getMatchingVisibleMetas("line");for(let t=0;t<r.length;t++){const i=r[t];if(i.index===e)break;i.hidden||n.unshift(i.dataset)}return n}(e,n);s.push(Tp({x:null,y:e.bottom},r));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)Lp(i,a[t],s)}return new sp({points:i,options:{}})}(t);if("shape"===n)return!0;const i=function(t){const e=t.scale||{};if(e.getPointPositionForValue)return function(t){const{scale:e,fill:n}=t,r=e.options,i=e.getLabels().length,o=r.reverse?e.max:e.min,a=function(t,e,n){let r;return r="start"===t?n:"end"===t?e.options.reverse?e.min:e.max:il(t)?t.value:e.getBaseValue(),r}(n,e,o),s=[];if(r.grid.circular){const t=e.getPointPositionForValue(0,o);return new zp({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(a)})}for(let t=0;t<i;++t)s.push(e.getPointPositionForValue(t,a));return s}(t);return function(t){const{scale:e={},fill:n}=t,r=function(t,e){let n=null;return"start"===t?n=e.bottom:"end"===t?n=e.top:il(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}(n,e);if(ol(r)){const t=e.isHorizontal();return{x:t?r:null,y:t?null:r}}return null}(t)}(t);return i instanceof zp?i:Tp(i,r)}function $p(t,e,n){const r=Rp(e),{line:i,scale:o,axis:a}=e,s=i.options,l=s.fill,c=s.backgroundColor,{above:u=c,below:d=c}=l||{};r&&i.points.length&&(Dc(t,n),function(t,e){const{line:n,target:r,above:i,below:o,area:a,scale:s}=e,l=n._loop?"angle":e.axis;t.save(),"x"===l&&o!==i&&(Fp(t,r,a.top),jp(t,{line:n,target:r,color:i,scale:s,property:l}),t.restore(),t.save(),Fp(t,r,a.bottom));jp(t,{line:n,target:r,color:o,scale:s,property:l}),t.restore()}(t,{line:i,target:r,above:u,below:d,area:n,scale:o,axis:a}),Ac(t))}function Fp(t,e,n){const{segments:r,points:i}=e;let o=!0,a=!1;t.beginPath();for(const s of r){const{start:r,end:l}=s,c=i[r],u=i[Op(r,l,i)];o?(t.moveTo(c.x,c.y),o=!1):(t.lineTo(c.x,n),t.lineTo(c.x,c.y)),a=!!e.pathSegment(t,s,{move:a}),a?t.closePath():t.lineTo(u.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function jp(t,e){const{line:n,target:r,property:i,color:o,scale:a}=e,s=function(t,e,n){const r=t.segments,i=t.points,o=e.points,a=[];for(const t of r){let{start:r,end:s}=t;s=Op(r,s,i);const l=Mp(n,i[r],i[s],t.loop);if(!e.segments){a.push({source:t,target:l,start:i[r],end:i[s]});continue}const c=Fu(e,l);for(const e of c){const r=Mp(n,o[e.start],o[e.end],e.loop),s=$u(t,i,r);for(const t of s)a.push({source:t,target:e,start:{[n]:Pp(l,r,"start",Math.max)},end:{[n]:Pp(l,r,"end",Math.min)}})}}return a}(n,r,i);for(const{source:e,target:l,start:c,end:u}of s){const{style:{backgroundColor:s=o}={}}=e,d=!0!==r;t.save(),t.fillStyle=s,Bp(t,a,d&&Mp(i,c,u)),t.beginPath();const h=!!n.pathSegment(t,e);let p;if(d){h?t.closePath():Hp(t,r,u,i);const e=!!r.pathSegment(t,l,{move:h,reverse:!0});p=h&&e,p||Hp(t,r,c,i)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function Bp(t,e,n){const{top:r,bottom:i}=e.chart.chartArea,{property:o,start:a,end:s}=n||{};"x"===o&&(t.beginPath(),t.rect(a,r,s-a,i-r),t.clip())}function Hp(t,e,n,r){const i=e.interpolate(n,r);i&&t.lineTo(i.x,i.y)}var Wp={id:"filler",afterDatasetsUpdate(t,e,n){const r=(t.data.datasets||[]).length,i=[];let o,a,s,l;for(a=0;a<r;++a)o=t.getDatasetMeta(a),s=o.dataset,l=null,s&&s.options&&s instanceof sp&&(l={visible:t.isDatasetVisible(a),index:a,fill:Ap(s,a,r),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:s}),o.$filler=l,i.push(l);for(a=0;a<r;++a)l=i[a],l&&!1!==l.fill&&(l.fill=Dp(i,a,n.propagate))},beforeDraw(t,e,n){const r="beforeDraw"===n.drawTime,i=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=i.length-1;e>=0;--e){const n=i[e].$filler;n&&(n.line.updateControlPoints(o,n.axis),r&&n.fill&&$p(t.ctx,n,o))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const r=t.getSortedVisibleDatasetMetas();for(let e=r.length-1;e>=0;--e){const n=r[e].$filler;Np(n)&&$p(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const r=e.meta.$filler;Np(r)&&"beforeDatasetDraw"===n.drawTime&&$p(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Vp=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}};class Yp extends oh{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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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=cl(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,n)=>t.sort(e,n,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const n=t.labels,r=Uc(n.font),i=r.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=Vp(n,i);let l,c;e.font=r.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,i,a,s)+10):(c=this.maxHeight,l=this._fitCols(o,r,a,s)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,r){const{ctx:i,maxWidth:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=r+a;let u=t;i.textAlign="left",i.textBaseline="middle";let d=-1,h=-c;return this.legendItems.forEach(((t,p)=>{const f=n+e/2+i.measureText(t.text).width;(0===p||l[l.length-1]+f+2*a>o)&&(u+=c,l[l.length-(p>0?0:1)]=0,h+=c,d++),s[p]={left:0,top:h,row:d,width:f,height:r},l[l.length-1]+=f+a})),u}_fitCols(t,e,n,r){const{ctx:i,maxHeight:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let u=a,d=0,h=0,p=0,f=0;return this.legendItems.forEach(((t,o)=>{const{itemWidth:m,itemHeight:g}=function(t,e,n,r,i){const o=function(t,e,n,r){let i=t.text;i&&"string"!=typeof i&&(i=i.reduce(((t,e)=>t.length>e.length?t:e)));return e+n.size/2+r.measureText(i).width}(r,t,e,n),a=function(t,e,n){let r=t;"string"!=typeof e.text&&(r=Xp(e,n));return r}(i,r,e.lineHeight);return{itemWidth:o,itemHeight:a}}(n,e,i,t,r);o>0&&h+g+2*a>c&&(u+=d+a,l.push({width:d,height:h}),p+=d+a,f++,d=h=0),s[o]={left:p,top:h,col:f,width:m,height:g},d=Math.max(d,m),h+=g+a})),u+=d,l.push({width:d,height:h}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:r},rtl:i}}=this,o=Au(i,this.left,this.width);if(this.isHorizontal()){let i=0,a=rc(n,this.left+r,this.right-this.lineWidths[i]);for(const s of e)i!==s.row&&(i=s.row,a=rc(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+t+r,s.left=o.leftForLtr(o.x(a),s.width),a+=s.width+r}else{let i=0,a=rc(n,this.top+t+r,this.bottom-this.columnSizes[i].height);for(const s of e)s.col!==i&&(i=s.col,a=rc(n,this.top+t+r,this.bottom-this.columnSizes[i].height)),s.top=a,s.left+=this.left+r,s.left=o.leftForLtr(o.x(s.left),s.width),a+=s.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Dc(t,this),this._draw(),Ac(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:r}=this,{align:i,labels:o}=t,a=kc.color,s=Au(t.rtl,this.left,this.width),l=Uc(o.font),{padding:c}=o,u=l.size,d=u/2;let h;this.drawTitle(),r.textAlign=s.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=l.string;const{boxWidth:p,boxHeight:f,itemHeight:m}=Vp(o,u),g=this.isHorizontal(),v=this._computeTitleHeight();h=g?{x:rc(i,this.left+c,this.right-n[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:rc(i,this.top+v+c,this.bottom-e[0].height),line:0},Lu(this.ctx,t.textDirection);const y=m+c;this.legendItems.forEach(((b,_)=>{r.strokeStyle=b.fontColor,r.fillStyle=b.fontColor;const x=r.measureText(b.text).width,w=s.textAlign(b.textAlign||(b.textAlign=o.textAlign)),S=p+d+x;let k=h.x,C=h.y;s.setWidth(this.width),g?_>0&&k+S+c>this.right&&(C=h.y+=y,h.line++,k=h.x=rc(i,this.left+c,this.right-n[h.line])):_>0&&C+y>this.bottom&&(k=h.x=k+e[h.line].width+c,h.line++,C=h.y=rc(i,this.top+v+c,this.bottom-e[h.line].height));if(function(t,e,n){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;r.save();const i=sl(n.lineWidth,1);if(r.fillStyle=sl(n.fillStyle,a),r.lineCap=sl(n.lineCap,"butt"),r.lineDashOffset=sl(n.lineDashOffset,0),r.lineJoin=sl(n.lineJoin,"miter"),r.lineWidth=i,r.strokeStyle=sl(n.strokeStyle,a),r.setLineDash(sl(n.lineDash,[])),o.usePointStyle){const a={radius:f*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},l=s.xPlus(t,p/2);Tc(r,a,l,e+d,o.pointStyleWidth&&p)}else{const o=e+Math.max((u-f)/2,0),a=s.leftForLtr(t,p),l=Xc(n.borderRadius);r.beginPath(),Object.values(l).some((t=>0!==t))?Fc(r,{x:a,y:o,w:p,h:f,radius:l}):r.rect(a,o,p,f),r.fill(),0!==i&&r.stroke()}r.restore()}(s.x(k),C,b),k=((t,e,n,r)=>t===(r?"left":"right")?n:"center"===t?(e+n)/2:e)(w,k+p+d,g?k+S:this.right,t.rtl),function(t,e,n){$c(r,n.text,t,e+m/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(k),C,b),g)h.x+=S+c;else if("string"!=typeof b.text){const t=l.lineHeight;h.y+=Xp(b,t)+c}else h.y+=y})),Iu(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=Uc(e.font),r=qc(e.padding);if(!e.display)return;const i=Au(t.rtl,this.left,this.width),o=this.ctx,a=e.position,s=n.size/2,l=r.top+s;let c,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,u=rc(t.align,u,this.right-d);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);c=l+rc(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const h=rc(a,u,u+d);o.textAlign=i.textAlign(nc(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=n.string,$c(o,e.text,h,c,n)}_computeTitleHeight(){const t=this.options.title,e=Uc(t.font),n=qc(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,r,i;if(ql(t,this.left,this.right)&&ql(e,this.top,this.bottom))for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],ql(t,r.left,r.left+r.width)&&ql(e,r.top,r.top+r.height))return this.legendItems[n];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const r=this._hoveredItem,i=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(r,n);r&&!i&&cl(e.onLeave,[t,r,this],this),this._hoveredItem=n,n&&!i&&cl(e.onHover,[t,n,this],this)}else n&&cl(e.onClick,[t,n,this],this)}}function Xp(t,e){return e*(t.text?t.text.length:0)}var qp={id:"legend",_element:Yp,start(t,e,n){const r=t.legend=new Yp({ctx:t.ctx,options:n,chart:t});Bd.configure(t,r,n),Bd.addBox(t,r)},stop(t){Bd.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;Bd.configure(t,r,n),r.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const r=e.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),e.hidden=!0):(i.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:a,borderRadius:s}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(n?0:void 0),c=qc(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:i||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Up extends oh{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 n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const r=rl(n.text)?n.text.length:1;this._padding=qc(n.padding);const i=r*Uc(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:n,bottom:r,right:i,options:o}=this,a=o.align;let s,l,c,u=0;return this.isHorizontal()?(l=rc(a,n,i),c=e+t,s=i-n):("left"===o.position?(l=n+t,c=rc(a,r,e),u=-.5*kl):(l=i-t,c=rc(a,e,r),u=.5*kl),s=r-e),{titleX:l,titleY:c,maxWidth:s,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=Uc(e.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:o,maxWidth:a,rotation:s}=this._drawArgs(r);$c(t,e.text,0,0,n,{color:e.color,maxWidth:a,rotation:s,textAlign:nc(e.align),textBaseline:"middle",translation:[i,o]})}}var Zp={id:"title",_element:Up,start(t,e,n){!function(t,e){const n=new Up({ctx:t.ctx,options:e,chart:t});Bd.configure(t,n,e),Bd.addBox(t,n),t.titleBlock=n}(t,n)},stop(t){const e=t.titleBlock;Bd.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const r=t.titleBlock;Bd.configure(t,r,n),r.options=n},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 Gp=new WeakMap;var Kp={id:"subtitle",start(t,e,n){const r=new Up({ctx:t.ctx,options:n,chart:t});Bd.configure(t,r,n),Bd.addBox(t,r),Gp.set(t,r)},stop(t){Bd.removeBox(t,Gp.get(t)),Gp.delete(t)},beforeUpdate(t,e,n){const r=Gp.get(t);Bd.configure(t,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Jp={average(t){if(!t.length)return!1;let e,n,r=new Set,i=0,o=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();r.add(t.x),i+=t.y,++o}}if(0===o||0===r.size)return!1;const a=[...r].reduce(((t,e)=>t+e))/r.size;return{x:a,y:i/o}},nearest(t,e){if(!t.length)return!1;let n,r,i,o=e.x,a=e.y,s=Number.POSITIVE_INFINITY;for(n=0,r=t.length;n<r;++n){const r=t[n].element;if(r&&r.hasValue()){const t=Hl(e,r.getCenterPoint());t<s&&(s=t,i=r)}}if(i){const t=i.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function Qp(t,e){return e&&(rl(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function tf(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function ef(t,e){const{element:n,datasetIndex:r,index:i}=e,o=t.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:t,label:a,parsed:o.getParsed(i),raw:t.data.datasets[r].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function nf(t,e){const n=t.chart.ctx,{body:r,footer:i,title:o}=t,{boxWidth:a,boxHeight:s}=e,l=Uc(e.bodyFont),c=Uc(e.titleFont),u=Uc(e.footerFont),d=o.length,h=i.length,p=r.length,f=qc(e.padding);let m=f.height,g=0,v=r.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(v+=t.beforeBody.length+t.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),v){m+=p*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(v-p)*l.lineHeight+(v-1)*e.bodySpacing}h&&(m+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let y=0;const b=function(t){g=Math.max(g,n.measureText(t).width+y)};return n.save(),n.font=c.string,ul(t.title,b),n.font=l.string,ul(t.beforeBody.concat(t.afterBody),b),y=e.displayColors?a+2+e.boxPadding:0,ul(r,(t=>{ul(t.before,b),ul(t.lines,b),ul(t.after,b)})),y=0,n.font=u.string,ul(t.footer,b),n.restore(),g+=f.width,{width:g,height:m}}function rf(t,e,n,r){const{x:i,width:o}=n,{width:a,chartArea:{left:s,right:l}}=t;let c="center";return"center"===r?c=i<=(s+l)/2?"left":"right":i<=o/2?c="left":i>=a-o/2&&(c="right"),function(t,e,n,r){const{x:i,width:o}=r,a=n.caretSize+n.caretPadding;return"left"===t&&i+o+a>e.width||"right"===t&&i-o-a<0||void 0}(c,t,e,n)&&(c="center"),c}function of(t,e,n){const r=n.yAlign||e.yAlign||function(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}(t,n);return{xAlign:n.xAlign||e.xAlign||rf(t,e,n,r),yAlign:r}}function af(t,e,n,r){const{caretSize:i,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=Xc(a);let f=function(t,e){let{x:n,width:r}=t;return"right"===e?n-=r:"center"===e&&(n-=r/2),n}(e,s);const m=function(t,e,n){let{y:r,height:i}=t;return"top"===e?r+=n:r-="bottom"===e?i+n:i/2,r}(e,l,c);return"center"===l?"left"===s?f+=c:"right"===s&&(f-=c):"left"===s?f-=Math.max(u,h)+i:"right"===s&&(f+=Math.max(d,p)+i),{x:Xl(f,0,r.width-e.width),y:Xl(m,0,r.height-e.height)}}function sf(t,e,n){const r=qc(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-r.right:t.x+r.left}function lf(t){return Qp([],tf(t))}function cf(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const uf={beforeTitle:tl,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:tl,beforeBody:tl,beforeLabel:tl,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return nl(n)||(e+=n),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.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(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:tl,afterBody:tl,beforeFooter:tl,footer:tl,afterFooter:tl};function df(t,e,n,r){const i=t[e].call(n,r);return void 0===i?uf[e].call(n,r):i}class hf extends oh{static positioners=Jp;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,n=this.options.setContext(this.getContext()),r=n.enabled&&e.options.animation&&n.animations,i=new Uu(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,n=this._tooltipItems,Gc(t,{tooltip:e,tooltipItems:n,type:"tooltip"})));var t,e,n}getTitle(t,e){const{callbacks:n}=e,r=df(n,"beforeTitle",this,t),i=df(n,"title",this,t),o=df(n,"afterTitle",this,t);let a=[];return a=Qp(a,tf(r)),a=Qp(a,tf(i)),a=Qp(a,tf(o)),a}getBeforeBody(t,e){return lf(df(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,r=[];return ul(t,(t=>{const e={before:[],lines:[],after:[]},i=cf(n,t);Qp(e.before,tf(df(i,"beforeLabel",this,t))),Qp(e.lines,df(i,"label",this,t)),Qp(e.after,tf(df(i,"afterLabel",this,t))),r.push(e)})),r}getAfterBody(t,e){return lf(df(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,r=df(n,"beforeFooter",this,t),i=df(n,"footer",this,t),o=df(n,"afterFooter",this,t);let a=[];return a=Qp(a,tf(r)),a=Qp(a,tf(i)),a=Qp(a,tf(o)),a}_createItems(t){const e=this._active,n=this.chart.data,r=[],i=[],o=[];let a,s,l=[];for(a=0,s=e.length;a<s;++a)l.push(ef(this.chart,e[a]));return t.filter&&(l=l.filter(((e,r,i)=>t.filter(e,r,i,n)))),t.itemSort&&(l=l.sort(((e,r)=>t.itemSort(e,r,n)))),ul(l,(e=>{const n=cf(t.callbacks,e);r.push(df(n,"labelColor",this,e)),i.push(df(n,"labelPointStyle",this,e)),o.push(df(n,"labelTextColor",this,e))})),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const n=this.options.setContext(this.getContext()),r=this._active;let i,o=[];if(r.length){const t=Jp[n.position].call(this,r,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const e=this._size=nf(this,n),a=Object.assign({},t,e),s=of(this.chart,n,a),l=af(n,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,r){const i=this.getCaretPosition(t,n,r);e.lineTo(i.x1,i.y1),e.lineTo(i.x2,i.y2),e.lineTo(i.x3,i.y3)}getCaretPosition(t,e,n){const{xAlign:r,yAlign:i}=this,{caretSize:o,cornerRadius:a}=n,{topLeft:s,topRight:l,bottomLeft:c,bottomRight:u}=Xc(a),{x:d,y:h}=t,{width:p,height:f}=e;let m,g,v,y,b,_;return"center"===i?(b=h+f/2,"left"===r?(m=d,g=m-o,y=b+o,_=b-o):(m=d+p,g=m+o,y=b-o,_=b+o),v=m):(g="left"===r?d+Math.max(s,c)+o:"right"===r?d+p-Math.max(l,u)-o:this.caretX,"top"===i?(y=h,b=y-o,m=g-o,v=g+o):(y=h+f,b=y+o,m=g+o,v=g-o),_=y),{x1:m,x2:g,x3:v,y1:y,y2:b,y3:_}}drawTitle(t,e,n){const r=this.title,i=r.length;let o,a,s;if(i){const l=Au(n.rtl,this.x,this.width);for(t.x=sf(this,n.titleAlign,n),e.textAlign=l.textAlign(n.titleAlign),e.textBaseline="middle",o=Uc(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=o.string,s=0;s<i;++s)e.fillText(r[s],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,s+1===i&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,r,i){const o=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:s,boxWidth:l}=i,c=Uc(i.bodyFont),u=sf(this,"left",i),d=r.x(u),h=s<c.lineHeight?(c.lineHeight-s)/2:0,p=e.y+h;if(i.usePointStyle){const e={radius:Math.min(l,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},n=r.leftForLtr(d,l)+l/2,c=p+s/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,Pc(t,e,n,c),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Pc(t,e,n,c)}else{t.lineWidth=il(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=r.leftForLtr(d,l),n=r.leftForLtr(r.xPlus(d,1),l-2),a=Xc(o.borderRadius);Object.values(a).some((t=>0!==t))?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Fc(t,{x:e,y:p,w:l,h:s,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Fc(t,{x:n,y:p+1,w:l-2,h:s-2,radius:a}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(e,p,l,s),t.strokeRect(e,p,l,s),t.fillStyle=o.backgroundColor,t.fillRect(n,p+1,l-2,s-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:r}=this,{bodySpacing:i,bodyAlign:o,displayColors:a,boxHeight:s,boxWidth:l,boxPadding:c}=n,u=Uc(n.bodyFont);let d=u.lineHeight,h=0;const p=Au(n.rtl,this.x,this.width),f=function(n){e.fillText(n,p.x(t.x+h),t.y+d/2),t.y+=d+i},m=p.textAlign(o);let g,v,y,b,_,x,w;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=sf(this,m,n),e.fillStyle=n.bodyColor,ul(this.beforeBody,f),h=a&&"right"!==m?"center"===o?l/2+c:l+2+c:0,b=0,x=r.length;b<x;++b){for(g=r[b],v=this.labelTextColors[b],e.fillStyle=v,ul(g.before,f),y=g.lines,a&&y.length&&(this._drawColorBox(e,t,b,p,n),d=Math.max(u.lineHeight,s)),_=0,w=y.length;_<w;++_)f(y[_]),d=u.lineHeight;ul(g.after,f)}h=0,d=u.lineHeight,ul(this.afterBody,f),t.y-=i}drawFooter(t,e,n){const r=this.footer,i=r.length;let o,a;if(i){const s=Au(n.rtl,this.x,this.width);for(t.x=sf(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=s.textAlign(n.footerAlign),e.textBaseline="middle",o=Uc(n.footerFont),e.fillStyle=n.footerColor,e.font=o.string,a=0;a<i;++a)e.fillText(r[a],s.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+n.footerSpacing}}drawBackground(t,e,n,r){const{xAlign:i,yAlign:o}=this,{x:a,y:s}=t,{width:l,height:c}=n,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=Xc(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(a+u,s),"top"===o&&this.drawCaret(t,e,n,r),e.lineTo(a+l-d,s),e.quadraticCurveTo(a+l,s,a+l,s+d),"center"===o&&"right"===i&&this.drawCaret(t,e,n,r),e.lineTo(a+l,s+c-p),e.quadraticCurveTo(a+l,s+c,a+l-p,s+c),"bottom"===o&&this.drawCaret(t,e,n,r),e.lineTo(a+h,s+c),e.quadraticCurveTo(a,s+c,a,s+c-h),"center"===o&&"left"===i&&this.drawCaret(t,e,n,r),e.lineTo(a,s+u),e.quadraticCurveTo(a,s,a+u,s),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){const n=Jp[t.position].call(this,this._active,this._eventPosition);if(!n)return;const o=this._size=nf(this,t),a=Object.assign({},n,this._size),s=of(e,t,a),l=af(t,a,s,e);r._to===l.x&&i._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=qc(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(i,t,r,e),Lu(t,e.textDirection),i.y+=o.top,this.drawTitle(i,t,e),this.drawBody(i,t,e),this.drawFooter(i,t,e),Iu(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,r=t.map((({datasetIndex:t,index:e})=>{const n=this.chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}})),i=!dl(n,r),o=this._positionChanged(r,e);(i||o)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,i=this._active||[],o=this._getActiveElements(t,i,e,n),a=this._positionChanged(o,t),s=e||!dl(o,i)||a;return s&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}_getActiveElements(t,e,n,r){const i=this.options;if("mouseout"===t.type)return[];if(!r)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const o=this.chart.getElementsAtEventForMode(t,i.mode,i,n);return i.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:n,caretY:r,options:i}=this,o=Jp[i.position].call(this,t,e);return!1!==o&&(n!==o.x||r!==o.y)}}var pf={id:"tooltip",_element:hf,positioners:Jp,afterInit(t,e,n){n&&(t.tooltip=new hf({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:uf},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ff=Object.freeze({__proto__:null,Colors:Sp,Decimation:Ep,Filler:Wp,Legend:qp,SubTitle:Kp,Title:Zp,Tooltip:pf});function mf(t,e,n,r){const i=t.indexOf(e);if(-1===i)return((t,e,n,r)=>("string"==typeof e?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n))(t,e,n,r);return i!==t.lastIndexOf(e)?n:i}function gf(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class vf extends mh{static id="category";static defaults={ticks:{callback:gf}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:n,label:r}of e)t[n]===r&&t.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(nl(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:Xl(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:mf(n,t,sl(e,t),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:r}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(n=0),e||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,r=[];let i=this.getLabels();i=0===t&&e===i.length-1?i:i.slice(t,e+1),this._valueRange=Math.max(i.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=t;n<=e;n++)r.push({value:n});return r}getLabelForValue(t){return gf.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function yf(t,e){const n=[],{bounds:r,step:i,min:o,max:a,precision:s,count:l,maxTicks:c,maxDigits:u,includeBounds:d}=t,h=i||1,p=c-1,{min:f,max:m}=e,g=!nl(o),v=!nl(a),y=!nl(l),b=(m-f)/(u+1);let _,x,w,S,k=Il((m-f)/p/h)*h;if(k<1e-14&&!g&&!v)return[{value:f},{value:m}];S=Math.ceil(m/k)-Math.floor(f/k),S>p&&(k=Il(S*k/p/h)*h),nl(s)||(_=Math.pow(10,s),k=Math.ceil(k*_)/_),"ticks"===r?(x=Math.floor(f/k)*k,w=Math.ceil(m/k)*k):(x=f,w=m),g&&v&&i&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((a-o)/i,k/1e3)?(S=Math.round(Math.min((a-o)/k,c)),k=(a-o)/S,x=o,w=a):y?(x=g?o:x,w=v?a:w,S=l-1,k=(w-x)/S):(S=(w-x)/k,S=Ll(S,Math.round(S),k/1e3)?Math.round(S):Math.ceil(S));const C=Math.max(jl(k),jl(x));_=Math.pow(10,nl(s)?C:s),x=Math.round(x*_)/_,w=Math.round(w*_)/_;let E=0;for(g&&(d&&x!==o?(n.push({value:o}),x<o&&E++,Ll(Math.round((x+E*k)*_)/_,o,bf(o,b,t))&&E++):x<o&&E++);E<S;++E){const t=Math.round((x+E*k)*_)/_;if(v&&t>a)break;n.push({value:t})}return v&&d&&w!==a?n.length&&Ll(n[n.length-1].value,a,bf(a,b,t))?n[n.length-1].value=a:n.push({value:a}):v&&w!==a||n.push({value:w}),n}function bf(t,e,{horizontal:n,minRotation:r}){const i=$l(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}class _f extends mh{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 nl(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this;const o=t=>r=e?r:t,a=t=>i=n?i:t;if(t){const t=Al(r),e=Al(i);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(r===i){let e=0===i?1:Math.abs(.05*i);a(i+e),t||o(r-e)}this.min=r,this.max=i}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:n,stepSize:r}=t;return r?(e=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const r=yf({maxTicks:n,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:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&Rl(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const r=(n-e)/Math.max(t.length-1,1)/2;e-=r,n+=r}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return gc(t,this.chart.options.locale,this.options.ticks.format)}}class xf extends _f{static id="linear";static defaults={ticks:{callback:yc.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ol(t)?t:0,this.max=ol(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=$l(this.options.ticks.minRotation),r=(t?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,i.lineHeight/r))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const wf=t=>Math.floor(Dl(t)),Sf=(t,e)=>Math.pow(10,wf(t)+e);function kf(t){return 1===t/Math.pow(10,wf(t))}function Cf(t,e,n){const r=Math.pow(10,n),i=Math.floor(t/r);return Math.ceil(e/r)-i}function Ef(t,{min:e,max:n}){e=al(t.min,e);const r=[],i=wf(e);let o=function(t,e){let n=wf(e-t);for(;Cf(t,e,n)>10;)n++;for(;Cf(t,e,n)<10;)n--;return Math.min(n,wf(t))}(e,n),a=o<0?Math.pow(10,Math.abs(o)):1;const s=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((e-l)*a)/a,u=Math.floor((e-l)/s/10)*s*10;let d=Math.floor((c-u)/Math.pow(10,o)),h=al(t.min,Math.round((l+u+d*Math.pow(10,o))*a)/a);for(;h<n;)r.push({value:h,major:kf(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,a=o>=0?1:a),h=Math.round((l+u+d*Math.pow(10,o))*a)/a;const p=al(t.max,h);return r.push({value:p,major:kf(p),significand:d}),r}class Mf extends mh{static id="logarithmic";static defaults={ticks:{callback:yc.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=_f.prototype.parse.apply(this,[t,e]);if(0!==n)return ol(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ol(t)?Math.max(0,t):null,this.max=ol(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ol(this._userMin)&&(this.min=t===Sf(this.min,0)?Sf(this.min,-1):Sf(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,r=this.max;const i=e=>n=t?n:e,o=t=>r=e?r:t;n===r&&(n<=0?(i(1),o(10)):(i(Sf(n,-1)),o(Sf(r,1)))),n<=0&&i(Sf(r,-1)),r<=0&&o(Sf(n,1)),this.min=n,this.max=r}buildTicks(){const t=this.options,e=Ef({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&Rl(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":gc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Dl(t),this._valueRange=Dl(this.max)-Dl(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Dl(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Of(t){const e=t.ticks;if(e.display&&t.display){const t=qc(e.backdropPadding);return sl(e.font&&e.font.size,kc.font.size)+t.height}return 0}function Pf(t,e,n,r,i){return t===r||t===i?{start:e-n/2,end:e+n/2}:t<r||t>i?{start:e-n,end:e}:{start:e,end:e+n}}function Tf(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),r=[],i=[],o=t._pointLabels.length,a=t.options.pointLabels,s=a.centerPointLabels?kl/o:0;for(let d=0;d<o;d++){const o=a.setContext(t.getPointLabelContext(d));i[d]=o.padding;const h=t.getPointPosition(d,t.drawingArea+i[d],s),p=Uc(o.font),f=(l=t.ctx,c=p,u=rl(u=t._pointLabels[d])?u:[u],{w:Ec(l,c.string,u),h:u.length*c.lineHeight});r[d]=f;const m=Vl(t.getIndexAngle(d)+s),g=Math.round(Fl(m));Nf(n,e,m,Pf(g,h.x,f.w,0,180),Pf(g,h.y,f.h,90,270))}var l,c,u;t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=function(t,e,n){const r=[],i=t._pointLabels.length,o=t.options,{centerPointLabels:a,display:s}=o.pointLabels,l={extra:Of(o)/2,additionalAngle:a?kl/i:0};let c;for(let o=0;o<i;o++){l.padding=n[o],l.size=e[o];const i=Df(t,o,l);r.push(i),"auto"===s&&(i.visible=Af(i,c),i.visible&&(c=i))}return r}(t,r,i)}function Nf(t,e,n,r,i){const o=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let s=0,l=0;r.start<e.l?(s=(e.l-r.start)/o,t.l=Math.min(t.l,e.l-s)):r.end>e.r&&(s=(r.end-e.r)/o,t.r=Math.max(t.r,e.r+s)),i.start<e.t?(l=(e.t-i.start)/a,t.t=Math.min(t.t,e.t-l)):i.end>e.b&&(l=(i.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function Df(t,e,n){const r=t.drawingArea,{extra:i,additionalAngle:o,padding:a,size:s}=n,l=t.getPointPosition(e,r+i+a,o),c=Math.round(Fl(Vl(l.angle+Pl))),u=function(t,e,n){90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e);return t}(l.y,s.h,c),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),h=function(t,e,n){"right"===n?t-=e:"center"===n&&(t-=e/2);return t}(l.x,s.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+s.w,bottom:u+s.h}}function Af(t,e){if(!e)return!0;const{left:n,top:r,right:i,bottom:o}=t;return!(Nc({x:n,y:r},e)||Nc({x:n,y:o},e)||Nc({x:i,y:r},e)||Nc({x:i,y:o},e))}function Lf(t,e,n){const{left:r,top:i,right:o,bottom:a}=n,{backdropColor:s}=e;if(!nl(s)){const n=Xc(e.borderRadius),l=qc(e.backdropPadding);t.fillStyle=s;const c=r-l.left,u=i-l.top,d=o-r+l.width,h=a-i+l.height;Object.values(n).some((t=>0!==t))?(t.beginPath(),Fc(t,{x:c,y:u,w:d,h:h,radius:n}),t.fill()):t.fillRect(c,u,d,h)}}function If(t,e,n,r){const{ctx:i}=t;if(n)i.arc(t.xCenter,t.yCenter,e,0,Cl);else{let n=t.getPointPosition(0,e);i.moveTo(n.x,n.y);for(let o=1;o<r;o++)n=t.getPointPosition(o,e),i.lineTo(n.x,n.y)}}class zf extends _f{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:yc.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=qc(Of(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ol(t)&&!isNaN(t)?t:0,this.max=ol(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Of(this.options))}generateTickLabels(t){_f.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const n=cl(this.options.pointLabels.callback,[t,e],this);return n||0===n?n:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?Tf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,r))}getIndexAngle(t){return Vl(t*(Cl/(this._pointLabels.length||1))+$l(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(nl(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(nl(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return function(t,e,n){return Gc(t,{label:n,index:e,type:"pointLabel"})}(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const r=this.getIndexAngle(t)-Pl+n;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:r,bottom:i}=this._pointLabelItems[t];return{left:e,top:n,right:r,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),If(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:r,border:i}=e,o=this._pointLabels.length;let a,s,l;if(e.pointLabels.display&&function(t,e){const{ctx:n,options:{pointLabels:r}}=t;for(let i=e-1;i>=0;i--){const e=t._pointLabelItems[i];if(!e.visible)continue;const o=r.setContext(t.getPointLabelContext(i));Lf(n,o,e);const a=Uc(o.font),{x:s,y:l,textAlign:c}=e;$c(n,t._pointLabels[i],s,l+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),r.display&&this.ticks.forEach(((t,e)=>{if(0!==e||0===e&&this.min<0){s=this.getDistanceFromCenterForValue(t.value);const n=this.getContext(e),a=r.setContext(n),l=i.setContext(n);!function(t,e,n,r,i){const o=t.ctx,a=e.circular,{color:s,lineWidth:l}=e;!a&&!r||!s||!l||n<0||(o.save(),o.strokeStyle=s,o.lineWidth=l,o.setLineDash(i.dash||[]),o.lineDashOffset=i.dashOffset,o.beginPath(),If(t,n,a,r),o.closePath(),o.stroke(),o.restore())}(this,a,s,o,l)}})),n.display){for(t.save(),a=o-1;a>=0;a--){const r=n.setContext(this.getPointLabelContext(a)),{color:i,lineWidth:o}=r;o&&i&&(t.lineWidth=o,t.strokeStyle=i,t.setLineDash(r.borderDash),t.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(a,s),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const r=this.getIndexAngle(0);let i,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((r,a)=>{if(0===a&&this.min>=0&&!e.reverse)return;const s=n.setContext(this.getContext(a)),l=Uc(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){t.font=l.string,o=t.measureText(r.label).width,t.fillStyle=s.backdropColor;const e=qc(s.backdropPadding);t.fillRect(-o/2-e.left,-i-l.size/2-e.top,o+e.width,l.size+e.height)}$c(t,r.label,0,-i,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})})),t.restore()}drawTitle(){}}const Rf={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}},$f=Object.keys(Rf);function Ff(t,e){return t-e}function jf(t,e){if(nl(e))return null;const n=t._adapter,{parser:r,round:i,isoWeekday:o}=t._parseOpts;let a=e;return"function"==typeof r&&(a=r(a)),ol(a)||(a="string"==typeof r?n.parse(a,r):n.parse(a)),null===a?null:(i&&(a="week"!==i||!zl(o)&&!0!==o?n.startOf(a,i):n.startOf(a,"isoWeek",o)),+a)}function Bf(t,e,n,r){const i=$f.length;for(let o=$f.indexOf(t);o<i-1;++o){const t=Rf[$f[o]],i=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((n-e)/(i*t.size))<=r)return $f[o]}return $f[i-1]}function Hf(t,e,n){if(n){if(n.length){const{lo:r,hi:i}=Ul(n,e);t[n[r]>=e?n[r]:n[i]]=!0}}else t[e]=!0}function Wf(t,e,n){const r=[],i={},o=e.length;let a,s;for(a=0;a<o;++a)s=e[a],i[s]=a,r.push({value:s,major:!1});return 0!==o&&n?function(t,e,n,r){const i=t._adapter,o=+i.startOf(e[0].value,r),a=e[e.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,r))l=n[s],l>=0&&(e[l].major=!0);return e}(t,r,i,n):r}class Vf extends mh{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const n=t.time||(t.time={}),r=this._adapter=new xd._date(t.adapters.date);r.init(e),gl(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:jf(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:r,max:i,minDefined:o,maxDefined:a}=this.getUserBounds();function s(t){o||isNaN(t.min)||(r=Math.min(r,t.min)),a||isNaN(t.max)||(i=Math.max(i,t.max))}o&&a||(s(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||s(this.getMinMax(!1))),r=ol(r)&&!isNaN(r)?r:+e.startOf(Date.now(),n),i=ol(i)&&!isNaN(i)?i:+e.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,r="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const i=this.min,o=function(t,e,n){let r=0,i=t.length;for(;r<i&&t[r]<e;)r++;for(;i>r&&t[i-1]>n;)i--;return r>0||i<t.length?t.slice(r,i):t}(r,i,this.max);return this._unit=e.unit||(n.autoSkip?Bf(e.minUnit,this.min,this.max,this._getLabelCapacity(i)):function(t,e,n,r,i){for(let o=$f.length-1;o>=$f.indexOf(n);o--){const n=$f[o];if(Rf[n].common&&t._adapter.diff(i,r,n)>=e-1)return n}return $f[n?$f.indexOf(n):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(t){for(let e=$f.indexOf(t)+1,n=$f.length;e<n;++e)if(Rf[$f[e]].common)return $f[e]}(this._unit):void 0,this.initOffsets(r),t.reverse&&o.reverse(),Wf(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t=[]){let e,n,r=0,i=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),r=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,n=this.getDecimalForValue(t[t.length-1]),i=1===t.length?n:(n-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;r=Xl(r,0,o),i=Xl(i,0,o),this._offsets={start:r,end:i,factor:1/(r+1+i)}}_generate(){const t=this._adapter,e=this.min,n=this.max,r=this.options,i=r.time,o=i.unit||Bf(i.minUnit,e,n,this._getLabelCapacity(e)),a=sl(r.ticks.stepSize,1),s="week"===o&&i.isoWeekday,l=zl(s)||!0===s,c={};let u,d,h=e;if(l&&(h=+t.startOf(h,"isoWeek",s)),h=+t.startOf(h,l?"day":o),t.diff(n,e,o)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+o);const p="data"===r.ticks.source&&this.getDataTimestamps();for(u=h,d=0;u<n;u=+t.add(u,a,o),d++)Hf(c,u,p);return u!==n&&"ticks"!==r.bounds&&1!==d||Hf(c,u,p),Object.keys(c).sort(Ff).map((t=>+t))}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,r=this._unit,i=e||n[r];return this._adapter.format(t,i)}_tickFormatFunction(t,e,n,r){const i=this.options,o=i.ticks.callback;if(o)return cl(o,[t,e,n],this);const a=i.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],u=l&&a[l],d=n[e],h=l&&u&&d&&d.major;return this._adapter.format(t,r||(h?u:c))}generateTickLabels(t){let e,n,r;for(e=0,n=t.length;e<n;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,r=$l(this.isHorizontal()?e.maxRotation:e.minRotation),i=Math.cos(r),o=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:n*i+a*o,h:n*o+a*i}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,r=n[e.unit]||n.millisecond,i=this._tickFormatFunction(t,0,Wf(this,[t],this._majorUnit),r),o=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,n=this._cache.data||[];if(n.length)return n;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,e=r.length;t<e;++t)n=n.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const r=this.getLabels();for(e=0,n=r.length;e<n;++e)t.push(jf(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ql(t.sort(Ff))}}function Yf(t,e,n){let r,i,o,a,s=0,l=t.length-1;n?(e>=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=Zl(t,"pos",e)),({pos:r,time:o}=t[s]),({pos:i,time:a}=t[l])):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=Zl(t,"time",e)),({time:r,pos:o}=t[s]),({time:i,pos:a}=t[l]));const c=i-r;return c?o+(a-o)*(e-r)/c:o}var Xf=Object.freeze({__proto__:null,CategoryScale:vf,LinearScale:xf,LogarithmicScale:Mf,RadialLinearScale:zf,TimeScale:Vf,TimeSeriesScale:class extends Vf{static id="timeseries";static defaults=Vf.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Yf(e,this.min),this._tableRange=Yf(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,r=[],i=[];let o,a,s,l,c;for(o=0,a=t.length;o<a;++o)l=t[o],l>=e&&l<=n&&r.push(l);if(r.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(o=0,a=r.length;o<a;++o)c=r[o+1],s=r[o-1],l=r[o],Math.round((c+s)/2)!==l&&i.push({time:l,pos:o/(a-1)});return i}_generate(){const t=this.min,e=this.max;let n=super.getDataTimestamps();return n.includes(t)&&n.length||n.splice(0,0,t),n.includes(e)&&1!==n.length||n.push(e),n.sort(((t,e)=>t-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return t=e.length&&n.length?this.normalize(e.concat(n)):e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Yf(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return Yf(this._table,n*this._tableRange+this._minPos,!0)}}});const qf=[yd,gp,ff,Xf];qh.register(...qf);const Uf=({type:e,data:n,options:r,className:i,style:o,plugins:a})=>{const c=s(null),u=s(null);return l((()=>{if(!c.current)return;const t=c.current.getContext("2d");return t?(u.current&&u.current.destroy(),u.current=new qh(t,{type:e,data:n,options:r||{},plugins:a||[]}),()=>{u.current&&(u.current.destroy(),u.current=null)}):void 0}),[e,n,r,a]),t("canvas",{ref:c,className:i,style:o})};var Zf="Checkbox-module_container__v4ouY",Gf="Checkbox-module_disabled__PAavY",Kf="Checkbox-module_checkbox__tiPi8",Jf="Checkbox-module_indeterminate__GxPm3";var Qf=a((({checked:n=!1,disabled:r=!1,label:i,indeterminate:o=!1,labelProps:a,onChange:c,id:u,...d})=>{const h=s(null),p=f();l((()=>{h.current&&(h.current.indeterminate=o)}),[o]);return t(H,{...d,onClick:t=>{r||c?.(t)},dimensionY:36,className:`${d.className} ${Zf} ${r&&Gf}`,prefix:{children:e("div",{className:`${Kf} ${o&&Jf}`,children:[t("input",{id:u??p,ref:h,type:"checkbox",checked:n,disabled:r,"aria-checked":o?"mixed":n,readOnly:!0}),t("label",{htmlFor:u??p,onClick:t=>t.stopPropagation()})]}),...d.prefix},root:{children:t(V,{...a,children:i}),...d.root}})})),tm={chip:"Chip-module_chip__DLgqh",outlined:"Chip-module_outlined__1seXI",filled:"Chip-module_filled__iKdFt",noButton:"Chip-module_noButton__nEh--",closeButton:"Chip-module_closeButton__83TVb"};var em=a((({label:e,variant:n="filled",icon:r,onDelete:i,suffixIcon:o,suffixOnClick:a,...s})=>t(H,{dimensionX:"hug",gap:8,prefix:{dimensionX:"hug",children:r?t(Za,{name:r}):void 0,...s.prefix},root:{children:e,...s.root},suffix:(o||i)&&{dimensionX:"hug",alignment:"center",children:t(_s,{className:tm.closeButton,shape:"circle",color:"transparent",onClick:o?a:i,children:t(Za,{name:o||"close"})}),...s.suffix},...s,className:`${s.className} ${tm.chip} ${tm[n]} ${i||o?"":tm.noButton}`}))),nm="Color-module_color__icl6l";var rm=a((({value:e="#000000",prefixProps:n,rootProps:r,onChange:i,...o})=>t(H,{dimensionY:36,prefix:{children:t("input",{type:"color",value:e,onChange:t=>{i?.(t.target.value)}}),...n},root:{children:e&&t(V,{children:e}),...r},...o,className:`${o?.className} ${nm}`}))),im={container:"DashboardItem-module_container__Cu2fp",settingButton:"DashboardItem-module_settingButton__EVb24",header:"DashboardItem-module_header__1Ltls",chartContainer:"DashboardItem-module_chartContainer__xibFh",chart:"DashboardItem-module_chart__a5kGE"},om="Section-module_sectionContainer__qECl2",am="Section-module_header__1oDhY",sm="Section-module_content__3PfOv",lm="Section-module_footer__KPdum";const cm=a((({children:e,...n})=>t(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${am} ${n.className}`,children:e}))),um=a((({children:e,...n})=>t(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${sm} ${n.className}`,children:e}))),dm=a((({children:e,...n})=>t(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${lm} ${n.className}`,children:e}))),hm=a((({children:e,...n})=>t(B,{dimensionX:"fill",dimensionY:"fill",direction:"vertical",gap:0,...n,className:`${n.className} ${om}`,children:e})));hm.Header=cm,hm.Content=um,hm.Footer=dm;const pm=({headerProps:n,chartProps:r})=>e(hm,{className:im.dashboardItem,children:[e(hm.Header,{children:[t(V,{children:n?.content}),n?.suffix||t(_s,{color:"transparent",shape:"circle",className:im.settingButton,children:t(Za,{name:"cog",className:im.settingIcon,size:"xs"})})]}),t(hm.Content,{children:t(Uf,{type:r?.type,data:r?.data,options:r?.options,className:im.chart})})]});var fm,mm={exports:{}};
|
|
49
|
+
*/class Wu{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,r){const i=e.listeners[r],o=e.duration;i.forEach((r=>r({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=tc.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((n,r)=>{if(!n.running||!n.items.length)return;const i=n.items;let o,a=i.length-1,s=!1;for(;a>=0;--a)o=i[a],o._active?(o._total>n.duration&&(n.duration=o._total),o.tick(t),s=!0):(i[a]=i[i.length-1],i.pop());s&&(r.draw(),this._notify(r,n,t,"progress")),i.length||(n.running=!1,this._notify(r,n,t,"complete"),n.initial=!1),e+=i.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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(((t,e)=>Math.max(t,e._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 n=e.items;let r=n.length-1;for(;r>=0;--r)n[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Vu=new Wu;const Yu="transparent",Xu={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const r=dc(t||Yu),i=r.valid&&dc(e||Yu);return i&&i.valid?i.mix(r,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class qu{constructor(t,e,n,r){const i=e[n];r=Zc([t.to,r,i,t.from]);const o=Zc([t.from,i,r]);this._active=!0,this._fn=t.fn||Xu[t.type||typeof o],this._easing=cc[t.easing]||cc.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=n,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const r=this._target[this._prop],i=n-this._start,o=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=Zc([t.to,e,r,t.from]),this._from=Zc([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,r=this._prop,i=this._from,o=this._loop,a=this._to;let s;if(this._active=i!==a&&(o||e<n),!this._active)return this._target[r]=a,void this._notify(!0);e<0?this._target[r]=i:(s=e/n%2,s=o&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,a,s))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,n)=>{t.push({res:e,rej:n})}))}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t<n.length;t++)n[t][e]()}}class Uu{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!il(t))return;const e=Object.keys(kc.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach((r=>{const i=t[r];if(!il(i))return;const o={};for(const t of e)o[t]=i[t];(rl(i.properties)&&i.properties||[r]).forEach((t=>{t!==r&&n.has(t)||n.set(t,o)}))}))}_animateOptions(t,e){const n=e.options,r=function(t,e){if(!e)return;let n=t.options;if(!n)return void(t.options=e);n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(t,n);if(!r)return[];const i=this._createAnimations(r,n);return n.$shared&&function(t,e){const n=[],r=Object.keys(e);for(let e=0;e<r.length;e++){const i=t[r[e]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}(t.options.$animations,n).then((()=>{t.options=n}),(()=>{})),i}_createAnimations(t,e){const n=this._properties,r=[],i=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let s;for(s=o.length-1;s>=0;--s){const l=o[s];if("$"===l.charAt(0))continue;if("options"===l){r.push(...this._animateOptions(t,e));continue}const c=e[l];let u=i[l];const d=n.get(l);if(u){if(d&&u.active()){u.update(d,c,a);continue}u.cancel()}d&&d.duration?(i[l]=u=new qu(d,t,l,c),r.push(u)):t[l]=c}return r}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(Vu.add(this._chart,n),!0):void 0}}function Zu(t,e){const n=t&&t.options||{},r=n.reverse,i=void 0===n.min?e:0,o=void 0===n.max?e:0;return{start:r?o:i,end:r?i:o}}function Gu(t,e){const n=[],r=t._getSortedDatasetMetas(e);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function Ku(t,e,n,r={}){const i=t.keys,o="single"===r.mode;let a,s,l,c;if(null===e)return;let u=!1;for(a=0,s=i.length;a<s;++a){if(l=+i[a],l===n){if(u=!0,r.all)continue;break}c=t.values[l],ol(c)&&(o||0===e||Al(e)===Al(c))&&(e+=c)}return u||r.all?e:0}function Ju(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function Qu(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function td(t,e,n,r){for(const i of e.getMatchingVisibleMetas(r).reverse()){const e=t[i.index];if(n&&e>0||!n&&e<0)return i.index}return null}function ed(t,e){const{chart:n,_cachedMeta:r}=t,i=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:s}=r,l=o.axis,c=a.axis,u=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(o,a,r),d=e.length;let h;for(let t=0;t<d;++t){const n=e[t],{[l]:o,[c]:d}=n;h=(n._stacks||(n._stacks={}))[c]=Qu(i,u,o),h[s]=d,h._top=td(h,a,!0,r.type),h._bottom=td(h,a,!1,r.type);(h._visualValues||(h._visualValues={}))[s]=d}}function nd(t,e){const n=t.scales;return Object.keys(n).filter((t=>n[t].axis===e)).shift()}function rd(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[r]||void 0===e[r][n])return;delete e[r][n],void 0!==e[r]._visualValues&&void 0!==e[r]._visualValues[n]&&delete e[r]._visualValues[n]}}}const id=t=>"reset"===t||"none"===t,od=(t,e)=>e?t:Object.assign({},t);class ad{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ju(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&&rd(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),r=(t,e,n,r)=>"x"===t?e:"r"===t?r:n,i=e.xAxisID=sl(n.xAxisID,nd(t,"x")),o=e.yAxisID=sl(n.yAxisID,nd(t,"y")),a=e.rAxisID=sl(n.rAxisID,nd(t,"r")),s=e.indexAxis,l=e.iAxisID=r(s,i,o,a),c=e.vAxisID=r(s,o,i,a);e.xScale=this.getScaleForId(i),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}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&&Jl(this._data,this),t._stacked&&rd(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(il(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:n,vScale:r}=e,i="x"===n.axis?"x":"y",o="x"===r.axis?"x":"y",a=Object.keys(t),s=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],s[l]={[i]:u,[o]:t[u]};return s}(e,t)}else if(n!==e){if(n){Jl(n,this);const t=this._cachedMeta;rd(t),t._parsed=[]}e&&Object.isExtensible(e)&&function(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Kl.forEach((e=>{const n="_onData"+_l(e),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const i=r.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[n]&&t[n](...e)})),i}})})))}(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,n=this.getDataset();let r=!1;this._dataCheck();const i=e._stacked;e._stacked=Ju(e.vScale,e),e.stack!==n.stack&&(r=!0,rd(e),e.stack=n.stack),this._resyncElements(t),(r||i!==e._stacked)&&(ed(this,e._parsed),e._stacked=Ju(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:o}=n,a=i.axis;let s,l,c,u=0===t&&e===r.length||n._sorted,d=t>0&&n._parsed[t-1];if(!1===this._parsing)n._parsed=r,n._sorted=!0,c=r;else{c=rl(r[t])?this.parseArrayData(n,r,t,e):il(r[t])?this.parseObjectData(n,r,t,e):this.parsePrimitiveData(n,r,t,e);const i=()=>null===l[a]||d&&l[a]<d[a];for(s=0;s<e;++s)n._parsed[s+t]=l=c[s],u&&(i()&&(u=!1),d=l);n._sorted=u}o&&ed(this,c)}parsePrimitiveData(t,e,n,r){const{iScale:i,vScale:o}=t,a=i.axis,s=o.axis,l=i.getLabels(),c=i===o,u=new Array(r);let d,h,p;for(d=0,h=r;d<h;++d)p=d+n,u[d]={[a]:c||i.parse(l[p],p),[s]:o.parse(e[p],p)};return u}parseArrayData(t,e,n,r){const{xScale:i,yScale:o}=t,a=new Array(r);let s,l,c,u;for(s=0,l=r;s<l;++s)c=s+n,u=e[c],a[s]={x:i.parse(u[0],c),y:o.parse(u[1],c)};return a}parseObjectData(t,e,n,r){const{xScale:i,yScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(r);let c,u,d,h;for(c=0,u=r;c<u;++c)d=c+n,h=e[d],l[c]={x:i.parse(bl(h,a),d),y:o.parse(bl(h,s),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const r=this.chart,i=this._cachedMeta,o=e[t.axis];return Ku({keys:Gu(r,!0),values:e._stacks[t.axis]._visualValues},o,i.index,{mode:n})}updateRangeFromParsed(t,e,n,r){const i=n[e.axis];let o=null===i?NaN:i;const a=r&&n._stacks[e.axis];r&&a&&(r.values=a,o=Ku(r,i,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const n=this._cachedMeta,r=n._parsed,i=n._sorted&&t===n.iScale,o=r.length,a=this._getOtherScale(t),s=((t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Gu(n,!0),values:null})(e,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){const{min:e,max:n,minDefined:r,maxDefined:i}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}(a);let d,h;function p(){h=r[d];const e=h[a.axis];return!ol(h[t.axis])||c>e||u<e}for(d=0;d<o&&(p()||(this.updateRangeFromParsed(l,t,h,s),!i));++d);if(i)for(d=o-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(l,t,h,s);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let r,i,o;for(r=0,i=e.length;r<i;++r)o=e[r][t.axis],ol(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,r=e.vScale,i=this.getParsed(t);return{label:n?""+n.getLabelForValue(i[n.axis]):"",value:r?""+r.getLabelForValue(i[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,n,r,i;return il(t)?(e=t.top,n=t.right,r=t.bottom,i=t.left):e=n=r=i=t,{top:e,right:n,bottom:r,left:i,disabled:!1===t}}(sl(this.options.clip,function(t,e,n){if(!1===n)return!1;const r=Zu(t,n),i=Zu(e,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,r=n.data||[],i=e.chartArea,o=[],a=this._drawStart||0,s=this._drawCount||r.length-a,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(t,i,a,s),c=a;c<a+s;++c){const e=r[c];e.hidden||(e.active&&l?o.push(e):e.draw(t,i))}for(c=0;c<o.length;++c)o[c].draw(t,i)}getStyle(t,e){const n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const r=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];i=e.$context||(e.$context=function(t,e,n){return Gc(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),i.parsed=this.getParsed(t),i.raw=r.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=function(t,e){return Gc(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!e,i.mode=n,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const r="active"===e,i=this._cachedDataOpts,o=t+"-"+e,a=i[o],s=this.enableOptionSharing&&xl(n);if(a)return od(a,s);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),u=r?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),c),h=Object.keys(kc.elements[t]),p=l.resolveNamedOptions(d,h,(()=>this.getContext(n,r,e)),u);return p.$shared&&(p.$shared=s,i[o]=Object.freeze(od(p,s))),p}_resolveAnimations(t,e,n){const r=this.chart,i=this._cachedDataOpts,o=`animation-${e}`,a=i[o];if(a)return a;let s;if(!1!==r.options.animation){const r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,e),o=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(o,this.getContext(t,n,e))}const l=new Uu(r,s&&s.animations);return s&&s._cacheable&&(i[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||id(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),r=this._sharedOptions,i=this.getSharedOptions(n),o=this.includeOptions(e,i)||i!==r;return this.updateSharedOptions(i,e,n),{sharedOptions:i,includeOptions:o}}updateElement(t,e,n,r){id(r)?Object.assign(t,n):this._resolveAnimations(e,r).update(t,n)}updateSharedOptions(t,e,n){t&&!id(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,r){t.active=r;const i=this.getStyle(e,r);this._resolveAnimations(e,n,r).update(t,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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,n=this._cachedMeta.data;for(const[t,e,n]of this._syncList)this[t](e,n);this._syncList=[];const r=n.length,i=e.length,o=Math.min(i,r);o&&this.parse(0,o),i>r?this._insertElements(r,i-r,t):i<r&&this._removeElements(i,r-i)}_insertElements(t,e,n=!0){const r=this._cachedMeta,i=r.data,o=t+e;let a;const s=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(s(i),a=t;a<o;++a)i[a]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(t,e),n&&this.updateElements(i,t,e,"reset")}updateElements(t,e,n,r){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const r=n._parsed.splice(t,e);n._stacked&&rd(n,r)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,r]=t;this[e](n,r)}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 n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function sd(t){const e=t.iScale,n=function(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let r=[];for(let e=0,i=n.length;e<i;e++)r=r.concat(n[e].controller.getAllParsedValues(t));t._cache.$bar=Ql(r.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let r,i,o,a,s=e._length;const l=()=>{32767!==o&&-32768!==o&&(xl(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(r=0,i=n.length;r<i;++r)o=e.getPixelForValue(n[r]),l();for(a=void 0,r=0,i=e.ticks.length;r<i;++r)o=e.getPixelForTick(r),l();return s}function ld(t,e,n,r){return rl(t)?function(t,e,n,r){const i=n.parse(t[0],r),o=n.parse(t[1],r),a=Math.min(i,o),s=Math.max(i,o);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:i,end:o,min:a,max:s}}(t,e,n,r):e[n.axis]=n.parse(t,r),e}function cd(t,e,n,r){const i=t.iScale,o=t.vScale,a=i.getLabels(),s=i===o,l=[];let c,u,d,h;for(c=n,u=n+r;c<u;++c)h=e[c],d={},d[i.axis]=s||i.parse(a[c],c),l.push(ld(h,d,o,c));return l}function ud(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function dd(t,e,n,r){let i=e.borderSkipped;const o={};if(!i)return void(t.borderSkipped=o);if(!0===i)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:s,reverse:l,top:c,bottom:u}=function(t){let e,n,r,i,o;return t.horizontal?(e=t.base>t.x,n="left",r="right"):(e=t.base<t.y,n="bottom",r="top"),e?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:e,top:i,bottom:o}}(t);"middle"===i&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[hd(u,a,s,l)]=!0,i=c)),o[hd(i,a,s,l)]=!0,t.borderSkipped=o}function hd(t,e,n,r){var i,o,a;return r?(a=n,t=pd(t=(i=t)===(o=e)?a:i===a?o:i,n,e)):t=pd(t,e,n),t}function pd(t,e,n){return"start"===t?e:"end"===t?n:t}function fd(t,{inflateAmount:e},n){t.inflateAmount="auto"===e?1===n?.33:0:e}class md extends ad{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,n,r){return cd(t,e,n,r)}parseArrayData(t,e,n,r){return cd(t,e,n,r)}parseObjectData(t,e,n,r){const{iScale:i,vScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===i.axis?a:s,c="x"===o.axis?a:s,u=[];let d,h,p,f;for(d=n,h=n+r;d<h;++d)f=e[d],p={},p[i.axis]=i.parse(bl(f,l),d),u.push(ld(bl(f,c),p,o,d));return u}updateRangeFromParsed(t,e,n,r){super.updateRangeFromParsed(t,e,n,r);const i=n._custom;i&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:r}=e,i=this.getParsed(t),o=i._custom,a=ud(o)?"["+o.start+", "+o.end+"]":""+r.getLabelForValue(i[r.axis]);return{label:""+n.getLabelForValue(i[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,r){const i="reset"===r,{index:o,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r);for(let h=e;h<e+n;h++){const e=this.getParsed(h),n=i||nl(e[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(h),p=this._calculateBarIndexPixels(h,c),f=(e._stacks||{})[a.axis],m={horizontal:l,base:n.base,enableBorderRadius:!f||ud(e._custom)||o===f._top||o===f._bottom,x:l?n.head:p.center,y:l?p.center:n.head,height:l?p.size:Math.abs(n.size),width:l?Math.abs(n.size):p.size};d&&(m.options=u||this.resolveDataElementOptions(h,t[h].active?"active":r));const g=m.options||t[h].options;dd(m,g,f,o),fd(m,g,c.ratio),this.updateElement(t[h],h,m,r)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),i=n.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),s=a&&a[n.axis],l=t=>{const e=t._parsed.find((t=>t[n.axis]===s)),r=e&&e[t.vScale.axis];if(nl(r)||isNaN(r))return!0};for(const n of r)if((void 0===e||!l(n))&&((!1===i||-1===o.indexOf(n.stack)||void 0===i&&void 0===n.stack)&&o.push(n.stack),n.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const r=this._getStacks(t,n),i=void 0!==e?r.indexOf(e):-1;return-1===i?r.length-1:i}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,r=[];let i,o;for(i=0,o=e.data.length;i<o;++i)r.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));const a=t.barThickness;return{min:a||sd(e),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:r},options:{base:i,minBarLength:o}}=this,a=i||0,s=this.getParsed(t),l=s._custom,c=ud(l);let u,d,h=s[e.axis],p=0,f=n?this.applyStack(e,s,n):h;f!==h&&(p=f-h,f=h),c&&(h=l.barStart,f=l.barEnd-l.barStart,0!==h&&Al(h)!==Al(l.barEnd)&&(p=0),p+=h);const m=nl(i)||c?p:i;let g=e.getPixelForValue(m);if(u=this.chart.getDataVisibility(t)?e.getPixelForValue(p+f):g,d=u-g,Math.abs(d)<o){d=function(t,e,n){return 0!==t?Al(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}(d,e,a)*o,h===a&&(g-=d/2);const t=e.getPixelForDecimal(0),i=e.getPixelForDecimal(1),l=Math.min(t,i),p=Math.max(t,i);g=Math.max(Math.min(g,p),l),u=g+d,n&&!c&&(s._stacks[e.axis]._visualValues[r]=e.getValueForPixel(u)-e.getValueForPixel(g))}if(g===e.getPixelForValue(a)){const t=Al(d)*e.getLineWidthForValue(a)/2;g+=t,d-=t}return{size:d,base:g,head:u,center:u+d/2}}_calculateBarIndexPixels(t,e){const n=e.scale,r=this.options,i=r.skipNull,o=sl(r.maxBarThickness,1/0);let a,s;if(e.grouped){const n=i?this._getStackCount(t):e.stackCount,l="flex"===r.barThickness?function(t,e,n,r){const i=e.pixels,o=i[t];let a=t>0?i[t-1]:null,s=t<i.length-1?i[t+1]:null;const l=n.categoryPercentage;null===a&&(a=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-a);const c=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}(t,e,r,n):function(t,e,n,r){const i=n.barThickness;let o,a;return nl(i)?(o=e.min*n.categoryPercentage,a=n.barPercentage):(o=i*r,a=1),{chunk:o/r,ratio:a,start:e.pixels[t]-o/2}}(t,e,r,n),c=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=l.start+l.chunk*c+l.chunk/2,s=Math.min(o,l.chunk*l.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),s=Math.min(o,e.min*e.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,r=n.length;let i=0;for(;i<r;++i)null===this.getParsed(i)[e.axis]||n[i].hidden||n[i].draw(this._ctx)}}class gd extends ad{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:r}}=t.legend.options;return e.labels.map(((e,i)=>{const o=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:r,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,r=this._cachedMeta;if(!1===this._parsing)r._parsed=n;else{let i,o,a=t=>+n[t];if(il(n[t])){const{key:t="value"}=this._parsing;a=e=>+bl(n[e],t)}for(i=t,o=t+e;i<o;++i)r._parsed[i]=a(i)}}_getRotation(){return $l(this.options.rotation-90)}_getCircumference(){return $l(this.options.circumference)}_getRotationExtents(){let t=Cl,e=-Cl;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),o=r._getCircumference();t=Math.min(t,i),e=Math.max(e,i+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,r=this._cachedMeta,i=r.data,o=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-o)/2,0),s=Math.min((l=this.options.cutout,c=a,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const u=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:p,ratioY:f,offsetX:m,offsetY:g}=function(t,e,n){let r=1,i=1,o=0,a=0;if(e<Cl){const s=t,l=s+e,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),h=Math.sin(l),p=(t,e,r)=>Yl(t,s,l,!0)?1:Math.max(e,e*n,r,r*n),f=(t,e,r)=>Yl(t,s,l,!0)?-1:Math.min(e,e*n,r,r*n),m=p(0,c,d),g=p(Pl,u,h),v=f(kl,c,d),y=f(kl+Pl,u,h);r=(m-v)/2,i=(g-y)/2,o=-(m+v)/2,a=-(g+y)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:a}}(h,d,s),v=(n.width-o)/p,y=(n.height-o)/f,b=Math.max(Math.min(v,y)/2,0),_=ll(this.options.radius,b),x=(_-Math.max(_*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=g*_,r.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*u,0),this.updateElements(i,0,i.length,t)}_circumference(t,e){const n=this.options,r=this._cachedMeta,i=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===r._parsed[t]||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*i/Cl)}updateElements(t,e,n,r){const i="reset"===r,o=this.chart,a=o.chartArea,s=o.options.animation,l=(a.left+a.right)/2,c=(a.top+a.bottom)/2,u=i&&s.animateScale,d=u?0:this.innerRadius,h=u?0:this.outerRadius,{sharedOptions:p,includeOptions:f}=this._getSharedOptions(e,r);let m,g=this._getRotation();for(m=0;m<e;++m)g+=this._circumference(m,i);for(m=e;m<e+n;++m){const e=this._circumference(m,i),n=t[m],o={x:l+this.offsetX,y:c+this.offsetY,startAngle:g,endAngle:g+e,circumference:e,outerRadius:h,innerRadius:d};f&&(o.options=p||this.resolveDataElementOptions(m,n.active?"active":r)),g+=e,this.updateElement(n,m,o,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,r=0;for(n=0;n<e.length;n++){const i=t._parsed[n];null===i||isNaN(i)||!this.chart.getDataVisibility(n)||e[n].hidden||(r+=Math.abs(i))}return r}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Cl*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=gc(e._parsed[t],n.options.locale);return{label:r[t]||"",value:i}}getMaxBorderWidth(t){let e=0;const n=this.chart;let r,i,o,a,s;if(!t)for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){o=n.getDatasetMeta(r),t=o.data,a=o.controller;break}if(!t)return 0;for(r=0,i=t.length;r<i;++r)s=a.resolveDataElementOptions(r),"inner"!==s.borderAlign&&(e=Math.max(e,s.borderWidth||0,s.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,r=t.length;n<r;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(sl(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class vd extends ad{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:r}}=t.legend.options;return e.labels.map(((e,i)=>{const o=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:r,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=gc(e._parsed[t].r,n.options.locale);return{label:r[t]||"",value:i}}parseObjectData(t,e,n,r){return uu.bind(this)(t,e,n,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,n)=>{const r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),i=Math.max(r/2,0),o=(i-Math.max(n.cutoutPercentage?i/100*n.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=i-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,n,r){const i="reset"===r,o=this.chart,a=o.options.animation,s=this._cachedMeta.rScale,l=s.xCenter,c=s.yCenter,u=s.getIndexAngle(0)-.5*kl;let d,h=u;const p=360/this.countVisibleElements();for(d=0;d<e;++d)h+=this._computeAngle(d,r,p);for(d=e;d<e+n;d++){const e=t[d];let n=h,f=h+this._computeAngle(d,r,p),m=o.getDataVisibility(d)?s.getDistanceFromCenterForValue(this.getParsed(d).r):0;h=f,i&&(a.animateScale&&(m=0),a.animateRotate&&(n=f=u));const g={x:l,y:c,innerRadius:0,outerRadius:m,startAngle:n,endAngle:f,options:this.resolveDataElementOptions(d,e.active?"active":r)};this.updateElement(e,d,g,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++})),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?$l(this.resolveDataElementOptions(t,e).angle||n):0}}var yd=Object.freeze({__proto__:null,BarController:md,BubbleController:class extends ad{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,r){const i=super.parsePrimitiveData(t,e,n,r);for(let t=0;t<i.length;t++)i[t]._custom=this.resolveDataElementOptions(t+n).radius;return i}parseArrayData(t,e,n,r){const i=super.parseArrayData(t,e,n,r);for(let t=0;t<i.length;t++){const r=e[n+t];i[t]._custom=sl(r[2],this.resolveDataElementOptions(t+n).radius)}return i}parseObjectData(t,e,n,r){const i=super.parseObjectData(t,e,n,r);for(let t=0;t<i.length;t++){const r=e[n+t];i[t]._custom=sl(r&&r.r&&+r.r,this.resolveDataElementOptions(t+n).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=e,o=this.getParsed(t),a=r.getLabelForValue(o.x),s=i.getLabelForValue(o.y),l=o._custom;return{label:n[t]||"",value:"("+a+", "+s+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,r){const i="reset"===r,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(e,r),c=o.axis,u=a.axis;for(let d=e;d<e+n;d++){const e=t[d],n=!i&&this.getParsed(d),h={},p=h[c]=i?o.getPixelForDecimal(.5):o.getPixelForValue(n[c]),f=h[u]=i?a.getBasePixel():a.getPixelForValue(n[u]);h.skip=isNaN(p)||isNaN(f),l&&(h.options=s||this.resolveDataElementOptions(d,e.active?"active":r),i&&(h.options.radius=0)),this.updateElement(e,d,h,r)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const i=r.radius;return"active"!==e&&(r.radius=0),r.radius+=sl(n&&n._custom,i),r}},DoughnutController:gd,LineController:class extends ad{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=e,o=this.chart._animationsDisabled;let{start:a,count:s}=ic(e,r,o);this._drawStart=a,this._drawCount=s,oc(e)&&(a=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:l},t),this.updateElements(r,a,s,t)}updateElements(t,e,n,r){const i="reset"===r,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,r),d=o.axis,h=a.axis,{spanGaps:p,segment:f}=this.options,m=zl(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||i||"none"===r,v=e+n,y=t.length;let b=e>0&&this.getParsed(e-1);for(let n=0;n<y;++n){const p=t[n],y=g?p:{};if(n<e||n>=v){y.skip=!0;continue}const _=this.getParsed(n),x=nl(_[h]),w=y[d]=o.getPixelForValue(_[d],n),S=y[h]=i||x?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,_,s):_[h],n);y.skip=isNaN(w)||isNaN(S)||x,y.stop=n>0&&Math.abs(_[d]-b[d])>m,f&&(y.parsed=_,y.raw=l.data[n]),u&&(y.options=c||this.resolveDataElementOptions(n,p.active?"active":r)),g||this.updateElement(p,n,y,r),b=_}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return n;const i=r[0].size(this.resolveDataElementOptions(0)),o=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends gd{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:vd,RadarController:class extends ad{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,r){return uu.bind(this)(t,e,n,r)}update(t){const e=this._cachedMeta,n=e.dataset,r=e.data||[],i=e.iScale.getLabels();if(n.points=r,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:i.length===r.length,options:e};this.updateElement(n,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,n,r){const i=this._cachedMeta.rScale,o="reset"===r;for(let a=e;a<e+n;a++){const e=t[a],n=this.resolveDataElementOptions(a,e.active?"active":r),s=i.getPointPositionForValue(a,this.getParsed(a).r),l=o?i.xCenter:s.x,c=o?i.yCenter:s.y,u={x:l,y:c,angle:s.angle,skip:isNaN(l)||isNaN(c),options:n};this.updateElement(e,a,u,r)}}},ScatterController:class extends ad{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=e,o=this.getParsed(t),a=r.getLabelForValue(o.x),s=i.getLabelForValue(o.y);return{label:n[t]||"",value:"("+a+", "+s+")"}}update(t){const e=this._cachedMeta,{data:n=[]}=e,r=this.chart._animationsDisabled;let{start:i,count:o}=ic(e,n,r);if(this._drawStart=i,this._drawCount=o,oc(e)&&(i=0,o=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:i,_dataset:o}=e;i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const a=this.resolveDatasetElementOptions(t);a.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:a},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(n,i,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,n,r){const i="reset"===r,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,r),u=this.getSharedOptions(c),d=this.includeOptions(r,u),h=o.axis,p=a.axis,{spanGaps:f,segment:m}=this.options,g=zl(f)?f:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||i||"none"===r;let y=e>0&&this.getParsed(e-1);for(let c=e;c<e+n;++c){const e=t[c],n=this.getParsed(c),f=v?e:{},b=nl(n[p]),_=f[h]=o.getPixelForValue(n[h],c),x=f[p]=i||b?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,n,s):n[p],c);f.skip=isNaN(_)||isNaN(x)||b,f.stop=c>0&&Math.abs(n[h]-y[h])>g,m&&(f.parsed=n,f.raw=l.data[c]),d&&(f.options=u||this.resolveDataElementOptions(c,e.active?"active":r)),v||this.updateElement(e,c,f,r),y=n}this.updateSharedOptions(u,r,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}const n=t.dataset,r=n.options&&n.options.borderWidth||0;if(!e.length)return r;const i=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,i,o)/2}}});function bd(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class _d{static override(t){Object.assign(_d.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return bd()}parse(){return bd()}format(){return bd()}add(){return bd()}diff(){return bd()}startOf(){return bd()}endOf(){return bd()}}var xd={_date:_d};function wd(t,e,n,r){const{controller:i,data:o,_sorted:a}=t,s=i._cachedMeta.iScale;if(s&&e===s.axis&&"r"!==e&&a&&o.length){const t=s._reversePixels?Gl:Zl;if(!r)return t(o,e,n);if(i._sharedOptions){const r=o[0],i="function"==typeof r.getRange&&r.getRange(e);if(i){const r=t(o,e,n-i),a=t(o,e,n+i);return{lo:r.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function Sd(t,e,n,r,i){const o=t.getSortedVisibleDatasetMetas(),a=n[e];for(let t=0,n=o.length;t<n;++t){const{index:n,data:s}=o[t],{lo:l,hi:c}=wd(o[t],e,a,i);for(let t=l;t<=c;++t){const e=s[t];e.skip||r(e,n,t)}}}function kd(t,e,n,r,i){const o=[];if(!i&&!t.isPointInArea(e))return o;return Sd(t,n,e,(function(n,a,s){(i||Nc(n,t.chartArea,0))&&n.inRange(e.x,e.y,r)&&o.push({element:n,datasetIndex:a,index:s})}),!0),o}function Cd(t,e,n,r,i,o){let a=[];const s=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,r){const i=e?Math.abs(t.x-r.x):0,o=n?Math.abs(t.y-r.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}}(n);let l=Number.POSITIVE_INFINITY;return Sd(t,n,e,(function(n,c,u){const d=n.inRange(e.x,e.y,i);if(r&&!d)return;const h=n.getCenterPoint(i);if(!(!!o||t.isPointInArea(h))&&!d)return;const p=s(e,h);p<l?(a=[{element:n,datasetIndex:c,index:u}],l=p):p===l&&a.push({element:n,datasetIndex:c,index:u})})),a}function Ed(t,e,n,r,i,o){return o||t.isPointInArea(e)?"r"!==n||r?Cd(t,e,n,r,i,o):function(t,e,n,r){let i=[];return Sd(t,n,e,(function(t,n,o){const{startAngle:a,endAngle:s}=t.getProps(["startAngle","endAngle"],r),{angle:l}=Bl(t,{x:e.x,y:e.y});Yl(l,a,s)&&i.push({element:t,datasetIndex:n,index:o})})),i}(t,e,n,i):[]}function Md(t,e,n,r,i){const o=[],a="x"===n?"inXRange":"inYRange";let s=!1;return Sd(t,n,e,((t,r,l)=>{t[a]&&t[a](e[n],i)&&(o.push({element:t,datasetIndex:r,index:l}),s=s||t.inRange(e.x,e.y,i))})),r&&!s?[]:o}var Od={evaluateInteractionItems:Sd,modes:{index(t,e,n,r){const i=ku(e,t),o=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?kd(t,i,o,r,a):Ed(t,i,o,!1,r,a),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=s[0].index,n=t.data[e];n&&!n.skip&&l.push({element:n,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,n,r){const i=ku(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?kd(t,i,o,r,a):Ed(t,i,o,!1,r,a);if(s.length>0){const e=s[0].datasetIndex,n=t.getDatasetMeta(e).data;s=[];for(let t=0;t<n.length;++t)s.push({element:n[t],datasetIndex:e,index:t})}return s},point:(t,e,n,r)=>kd(t,ku(e,t),n.axis||"xy",r,n.includeInvisible||!1),nearest(t,e,n,r){const i=ku(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;return Ed(t,i,o,n.intersect,r,a)},x:(t,e,n,r)=>Md(t,ku(e,t),"x",n.intersect,r),y:(t,e,n,r)=>Md(t,ku(e,t),"y",n.intersect,r)}};const Pd=["left","top","right","bottom"];function Td(t,e){return t.filter((t=>t.pos===e))}function Nd(t,e){return t.filter((t=>-1===Pd.indexOf(t.pos)&&t.box.axis===e))}function Dd(t,e){return t.sort(((t,n)=>{const r=e?n:t,i=e?t:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight}))}function Ad(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:r,stackWeight:i}=n;if(!t||!Pd.includes(r))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=i}return e}(t),{vBoxMaxWidth:r,hBoxMaxHeight:i}=e;let o,a,s;for(o=0,a=t.length;o<a;++o){s=t[o];const{fullSize:a}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*r:a&&e.availableWidth,s.height=i):(s.width=r,s.height=c?c*i:a&&e.availableHeight)}return n}function Ld(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function Id(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function zd(t,e,n,r){const{pos:i,box:o}=n,a=t.maxPadding;if(!il(i)){n.size&&(t[i]-=n.size);const e=r[n.stack]||{size:0,count:1};e.size=Math.max(e.size,n.horizontal?o.height:o.width),n.size=e.size/e.count,t[i]+=n.size}o.getPadding&&Id(a,o.getPadding());const s=Math.max(0,e.outerWidth-Ld(a,t,"left","right")),l=Math.max(0,e.outerHeight-Ld(a,t,"top","bottom")),c=s!==t.w,u=l!==t.h;return t.w=s,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Rd(t,e){const n=e.maxPadding;function r(t){const r={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{r[t]=Math.max(e[t],n[t])})),r}return r(t?["left","right"]:["top","bottom"])}function $d(t,e,n,r){const i=[];let o,a,s,l,c,u;for(o=0,a=t.length,c=0;o<a;++o){s=t[o],l=s.box,l.update(s.width||e.w,s.height||e.h,Rd(s.horizontal,e));const{same:a,other:d}=zd(e,n,s,r);c|=a&&i.length,u=u||d,l.fullSize||i.push(s)}return c&&$d(i,e,n,r)||u}function Fd(t,e,n,r,i){t.top=n,t.left=e,t.right=e+r,t.bottom=n+i,t.width=r,t.height=i}function jd(t,e,n,r){const i=n.padding;let{x:o,y:a}=e;for(const s of t){const t=s.box,l=r[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const r=e.w*c,o=l.size||t.height;xl(l.start)&&(a=l.start),t.fullSize?Fd(t,i.left,a,n.outerWidth-i.right-i.left,o):Fd(t,e.left+l.placed,a,r,o),l.start=a,l.placed+=r,a=t.bottom}else{const r=e.h*c,a=l.size||t.width;xl(l.start)&&(o=l.start),t.fullSize?Fd(t,o,i.top,a,n.outerHeight-i.bottom-i.top):Fd(t,o,e.top+l.placed,a,r),l.start=o,l.placed+=r,o=t.right}}e.x=o,e.y=a}var Bd={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,r){if(!t)return;const i=qc(t.options.layout.padding),o=Math.max(e-i.width,0),a=Math.max(n-i.height,0),s=function(t){const e=function(t){const e=[];let n,r,i,o,a,s;for(n=0,r=(t||[]).length;n<r;++n)i=t[n],({position:o,options:{stack:a,stackWeight:s=1}}=i),e.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&o+a,stackWeight:s});return e}(t),n=Dd(e.filter((t=>t.box.fullSize)),!0),r=Dd(Td(e,"left"),!0),i=Dd(Td(e,"right")),o=Dd(Td(e,"top"),!0),a=Dd(Td(e,"bottom")),s=Nd(e,"x"),l=Nd(e,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:Td(e,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(a).concat(s)}}(t.boxes),l=s.vertical,c=s.horizontal;ul(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const u=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},i);Id(h,qc(r));const p=Object.assign({maxPadding:h,w:o,h:a,x:i.left,y:i.top},i),f=Ad(l.concat(c),d);$d(s.fullSize,p,d,f),$d(l,p,d,f),$d(c,p,d,f)&&$d(l,p,d,f),function(t){const e=t.maxPadding;function n(n){const r=Math.max(e[n]-t[n],0);return t[n]+=r,r}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(p),jd(s.leftAndTop,p,d,f),p.x+=p.w,p.y+=p.h,jd(s.rightAndBottom,p,d,f),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},ul(s.chartArea,(e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})}))}};class Hd{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,r){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):n)}}isAttached(t){return!0}updateConfig(t){}}class Wd extends Hd{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Vd="$chartjs",Yd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Xd=t=>null===t||""===t;const qd=!!Ou&&{passive:!0};function Ud(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,qd)}function Zd(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Gd(t,e,n){const r=t.canvas,i=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||Zd(n.addedNodes,r),e=e&&!Zd(n.removedNodes,r);e&&n()}));return i.observe(document,{childList:!0,subtree:!0}),i}function Kd(t,e,n){const r=t.canvas,i=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||Zd(n.removedNodes,r),e=e&&!Zd(n.addedNodes,r);e&&n()}));return i.observe(document,{childList:!0,subtree:!0}),i}const Jd=new Map;let Qd=0;function th(){const t=window.devicePixelRatio;t!==Qd&&(Qd=t,Jd.forEach(((e,n)=>{n.currentDevicePixelRatio!==t&&e()})))}function eh(t,e,n){const r=t.canvas,i=r&&bu(r);if(!i)return;const o=ec(((t,e)=>{const r=i.clientWidth;n(t,e),r<i.clientWidth&&n()}),window),a=new ResizeObserver((t=>{const e=t[0],n=e.contentRect.width,r=e.contentRect.height;0===n&&0===r||o(n,r)}));return a.observe(i),function(t,e){Jd.size||window.addEventListener("resize",th),Jd.set(t,e)}(t,o),a}function nh(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){Jd.delete(t),Jd.size||window.removeEventListener("resize",th)}(t)}function rh(t,e,n){const r=t.canvas,i=ec((e=>{null!==t.ctx&&n(function(t,e){const n=Yd[t.type]||t.type,{x:r,y:i}=ku(t,e);return{type:n,chart:e,native:t,x:void 0!==r?r:null,y:void 0!==i?i:null}}(e,t))}),t);return function(t,e,n){t&&t.addEventListener(e,n,qd)}(r,e,i),i}class ih extends Hd{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,r=t.getAttribute("height"),i=t.getAttribute("width");if(t[Vd]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Xd(i)){const e=Pu(t,"width");void 0!==e&&(t.width=e)}if(Xd(r))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Pu(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Vd])return!1;const n=e[Vd].initial;["height","width"].forEach((t=>{const r=n[t];nl(r)?e.removeAttribute(t):e.setAttribute(t,r)}));const r=n.style||{};return Object.keys(r).forEach((t=>{e.style[t]=r[t]})),e.width=e.width,delete e[Vd],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),i={attach:Gd,detach:Kd,resize:eh}[e]||rh;r[e]=i(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),r=n[e];if(!r)return;({attach:nh,detach:nh,resize:nh}[e]||Ud)(t,e,r),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,r){return Eu(t,e,n,r)}isAttached(t){const e=t&&bu(t);return!(!e||!e.isConnected)}}class oh{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return zl(this.x)&&zl(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const r={};return t.forEach((t=>{r[t]=n[t]&&n[t].active()?n[t]._to:this[t]})),r}}function ah(t,e){const n=t.options.ticks,r=function(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),i=t._maxLength/n;return Math.floor(Math.min(r,i))}(t),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?function(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}(e):[],a=o.length,s=o[0],l=o[a-1],c=[];if(a>i)return function(t,e,n,r){let i,o=0,a=n[0];for(r=Math.ceil(r),i=0;i<t.length;i++)i===a&&(e.push(t[i]),o++,a=n[o*r])}(e,c,o,a/i),c;const u=function(t,e,n){const r=function(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}(t),i=e.length/n;if(!r)return Math.max(i,1);const o=function(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r==0&&(e.push(r),e.push(t/r));return n===(0|n)&&e.push(n),e.sort(((t,e)=>t-e)).pop(),e}(r);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>i)return e}return Math.max(i,1)}(o,e,i);if(a>0){let t,n;const r=a>1?Math.round((l-s)/(a-1)):null;for(sh(e,c,u,nl(r)?0:s-r,s),t=0,n=a-1;t<n;t++)sh(e,c,u,o[t],o[t+1]);return sh(e,c,u,l,nl(r)?e.length:l+r),c}return sh(e,c,u),c}function sh(t,e,n,r,i){const o=sl(r,0),a=Math.min(sl(i,t.length),t.length);let s,l,c,u=0;for(n=Math.ceil(n),i&&(s=i-r,n=s/Math.floor(s/n)),c=o;c<0;)u++,c=Math.round(o+u*n);for(l=Math.max(o,0);l<a;l++)l===c&&(e.push(t[l]),u++,c=Math.round(o+u*n))}const lh=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n,ch=(t,e)=>Math.min(e||t,t);function uh(t,e){const n=[],r=t.length/e,i=t.length;let o=0;for(;o<i;o+=r)n.push(t[Math.floor(o)]);return n}function dh(t,e,n){const r=t.ticks.length,i=Math.min(e,r-1),o=t._startPixel,a=t._endPixel,s=1e-6;let l,c=t.getPixelForTick(i);if(!(n&&(l=1===r?Math.max(c-o,a-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(i-1))/2,c+=i<e?l:-l,c<o-s||c>a+s)))return c}function hh(t){return t.drawTicks?t.tickLength:0}function ph(t,e){if(!t.display)return 0;const n=Uc(t.font,e),r=qc(t.padding);return(rl(t.text)?t.text.length:1)*n.lineHeight+r.height}function fh(t,e,n){let r=nc(t);return(n&&"right"!==e||!n&&"right"===e)&&(r=(t=>"left"===t?"right":"right"===t?"left":t)(r)),r}class mh extends oh{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:n,_suggestedMax:r}=this;return t=al(t,Number.POSITIVE_INFINITY),e=al(e,Number.NEGATIVE_INFINITY),n=al(n,Number.POSITIVE_INFINITY),r=al(r,Number.NEGATIVE_INFINITY),{min:al(t,n),max:al(e,r),minDefined:ol(t),maxDefined:ol(e)}}getMinMax(t){let e,{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds();if(i&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)e=a[s].controller.getMinMax(this,t),i||(n=Math.min(n,e.min)),o||(r=Math.max(r,e.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:al(n,al(r,n)),max:al(r,al(n,r))}}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(){cl(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:r,grace:i,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,n){const{min:r,max:i}=t,o=ll(e,(i-r)/2),a=(t,e)=>n&&0===t?0:t+e;return{min:a(r,-Math.abs(o)),max:a(i,o)}}(this,i,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?uh(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=ah(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,n=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,n=!n),this._startPixel=t,this._endPixel=e,this._reversePixels=n,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){cl(this.options.afterUpdate,[this])}beforeSetDimensions(){cl(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(){cl(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),cl(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){cl(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,r,i;for(n=0,r=t.length;n<r;n++)i=t[n],i.label=cl(e.callback,[i.value,n,t],this)}afterTickToLabelConversion(){cl(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){cl(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=ch(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,i=e.maxRotation;let o,a,s,l=r;if(!this._isVisible()||!e.display||r>=i||n<=1||!this.isHorizontal())return void(this.labelRotation=r);const c=this._getLabelSizes(),u=c.widest.width,d=c.highest.height,h=Xl(this.chart.width-u,0,this.maxWidth);o=t.offset?this.maxWidth/n:h/(n-1),u+6>o&&(o=h/(n-(t.offset?.5:1)),a=this.maxHeight-hh(t.grid)-e.padding-ph(t.title,this.chart.options.font),s=Math.sqrt(u*u+d*d),l=Fl(Math.min(Math.asin(Xl((c.highest.height+6)/o,-1,1)),Math.asin(Xl(a/s,-1,1))-Math.asin(Xl(d/s,-1,1)))),l=Math.max(r,Math.min(i,l))),this.labelRotation=l}afterCalculateLabelRotation(){cl(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){cl(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:r,grid:i}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=ph(r,e.options.font);if(a?(t.width=this.maxWidth,t.height=hh(i)+o):(t.height=this.maxHeight,t.width=hh(i)+o),n.display&&this.ticks.length){const{first:e,last:r,widest:i,highest:o}=this._getLabelSizes(),s=2*n.padding,l=$l(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(a){const e=n.mirror?0:u*i.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+s)}else{const e=n.mirror?0:c*i.width+u*o.height;t.width=Math.min(this.maxWidth,t.width+e+s)}this._calculatePadding(e,r,u,c)}}this._handleMargins(),a?(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,n,r){const{ticks:{align:i,padding:o},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,d=0;s?l?(u=r*t.width,d=n*e.height):(u=n*t.height,d=r*e.width):"start"===i?d=e.width:"end"===i?u=t.width:"inner"!==i&&(u=t.width/2,d=e.width/2),this.paddingLeft=Math.max((u-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let n=e.height/2,r=t.height/2;"start"===i?(n=0,r=t.height):"end"===i&&(n=e.height,r=0),this.paddingTop=n+o,this.paddingBottom=r+o}}_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(){cl(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,n=t.length;e<n;e++)nl(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=uh(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:r,_longestTextCache:i}=this,o=[],a=[],s=Math.floor(e/ch(e,n));let l,c,u,d,h,p,f,m,g,v,y,b=0,_=0;for(l=0;l<e;l+=s){if(d=t[l].label,h=this._resolveTickFontOptions(l),r.font=p=h.string,f=i[p]=i[p]||{data:{},gc:[]},m=h.lineHeight,g=v=0,nl(d)||rl(d)){if(rl(d))for(c=0,u=d.length;c<u;++c)y=d[c],nl(y)||rl(y)||(g=Cc(r,f.data,f.gc,g,y),v+=m)}else g=Cc(r,f.data,f.gc,g,d),v=m;o.push(g),a.push(v),b=Math.max(g,b),_=Math.max(v,_)}!function(t,e){ul(t,(t=>{const n=t.gc,r=n.length/2;let i;if(r>e){for(i=0;i<r;++i)delete t.data[n[i]];n.splice(0,r)}}))}(i,e);const x=o.indexOf(b),w=a.indexOf(_),S=t=>({width:o[t]||0,height:a[t]||0});return{first:S(0),last:S(e-1),widest:S(x),highest:S(w),widths:o,heights:a}}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 Xl(this._alignToPixels?Mc(this.chart,e,0):e,-32768,32767)}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 n=e[t];return n.$context||(n.$context=function(t,e,n){return Gc(t,{tick:n,index:e,type:"tick"})}(this.getContext(),t,n))}return this.$context||(this.$context=Gc(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=$l(this.labelRotation),n=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),i=this._getLabelSizes(),o=t.autoSkipPadding||0,a=i?i.widest.width+o:0,s=i?i.highest.height+o:0;return this.isHorizontal()?s*n>a*r?a/n:s/r:s*r<a*n?s/n:a/r}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,r=this.options,{grid:i,position:o,border:a}=r,s=i.offset,l=this.isHorizontal(),c=this.ticks.length+(s?1:0),u=hh(i),d=[],h=a.setContext(this.getContext()),p=h.display?h.width:0,f=p/2,m=function(t){return Mc(n,t,p)};let g,v,y,b,_,x,w,S,k,C,E,M;if("top"===o)g=m(this.bottom),x=this.bottom-u,S=g-f,C=m(t.top)+f,M=t.bottom;else if("bottom"===o)g=m(this.top),C=t.top,M=m(t.bottom)-f,x=g+f,S=this.top+u;else if("left"===o)g=m(this.right),_=this.right-u,w=g-f,k=m(t.left)+f,E=t.right;else if("right"===o)g=m(this.left),k=t.left,E=m(t.right)-f,_=g+f,w=this.left+u;else if("x"===e){if("center"===o)g=m((t.top+t.bottom)/2+.5);else if(il(o)){const t=Object.keys(o)[0],e=o[t];g=m(this.chart.scales[t].getPixelForValue(e))}C=t.top,M=t.bottom,x=g+f,S=x+u}else if("y"===e){if("center"===o)g=m((t.left+t.right)/2);else if(il(o)){const t=Object.keys(o)[0],e=o[t];g=m(this.chart.scales[t].getPixelForValue(e))}_=g-f,w=_-u,k=t.left,E=t.right}const O=sl(r.ticks.maxTicksLimit,c),P=Math.max(1,Math.ceil(c/O));for(v=0;v<c;v+=P){const t=this.getContext(v),e=i.setContext(t),r=a.setContext(t),o=e.lineWidth,c=e.color,u=r.dash||[],h=r.dashOffset,p=e.tickWidth,f=e.tickColor,m=e.tickBorderDash||[],g=e.tickBorderDashOffset;y=dh(this,v,s),void 0!==y&&(b=Mc(n,y,o),l?_=w=k=E=b:x=S=C=M=b,d.push({tx1:_,ty1:x,tx2:w,ty2:S,x1:k,y1:C,x2:E,y2:M,width:o,color:c,borderDash:u,borderDashOffset:h,tickWidth:p,tickColor:f,tickBorderDash:m,tickBorderDashOffset:g}))}return this._ticksLength=c,this._borderValue=g,d}_computeLabelItems(t){const e=this.axis,n=this.options,{position:r,ticks:i}=n,o=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:l,padding:c,mirror:u}=i,d=hh(n.grid),h=d+c,p=u?-c:h,f=-$l(this.labelRotation),m=[];let g,v,y,b,_,x,w,S,k,C,E,M,O="middle";if("top"===r)x=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===r)x=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===r){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,_=t.x}else if("right"===r){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,_=t.x}else if("x"===e){if("center"===r)x=(t.top+t.bottom)/2+h;else if(il(r)){const t=Object.keys(r)[0],e=r[t];x=this.chart.scales[t].getPixelForValue(e)+h}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===r)_=(t.left+t.right)/2-h;else if(il(r)){const t=Object.keys(r)[0],e=r[t];_=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===e&&("start"===s?O="top":"end"===s&&(O="bottom"));const P=this._getLabelSizes();for(g=0,v=a.length;g<v;++g){y=a[g],b=y.label;const t=i.setContext(this.getContext(g));S=this.getPixelForTick(g)+i.labelOffset,k=this._resolveTickFontOptions(g),C=k.lineHeight,E=rl(b)?b.length:1;const e=E/2,n=t.color,s=t.textStrokeColor,c=t.textStrokeWidth;let d,h=w;if(o?(_=S,"inner"===w&&(h=g===v-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),M="top"===r?"near"===l||0!==f?-E*C+C/2:"center"===l?-P.highest.height/2-e*C+C:-P.highest.height+C/2:"near"===l||0!==f?C/2:"center"===l?P.highest.height/2-e*C:P.highest.height-E*C,u&&(M*=-1),0===f||t.showLabelBackdrop||(_+=C/2*Math.sin(f))):(x=S,M=(1-E)*C/2),t.showLabelBackdrop){const e=qc(t.backdropPadding),n=P.heights[g],r=P.widths[g];let i=M-e.top,o=0-e.left;switch(O){case"middle":i-=n/2;break;case"bottom":i-=n}switch(w){case"center":o-=r/2;break;case"right":o-=r;break;case"inner":g===v-1?o-=r:g>0&&(o-=r/2)}d={left:o,top:i,width:r+e.width,height:n+e.height,color:t.backdropColor}}m.push({label:b,font:k,textOffset:M,options:{rotation:f,color:n,strokeColor:s,strokeWidth:c,textAlign:h,textBaseline:O,translation:[_,x],backdrop:d}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$l(this.labelRotation))return"top"===t?"left":"right";let n="center";return"start"===e.align?n="left":"end"===e.align?n="right":"inner"===e.align&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,o=t+i,a=this._getLabelSizes().widest.width;let s,l;return"left"===e?r?(l=this.right+i,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l+=a)):(l=this.right-o,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l=this.left)):"right"===e?r?(l=this.left+i,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l-=a)):(l=this.left+o,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:r,width:i,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,r,i,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex((e=>e.value===t));if(n>=0){return e.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,n=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,o;const a=(t,e,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(e.display)for(i=0,o=r.length;i<o;++i){const t=r[i];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),o=n.display?i.width:0;if(!o)return;const a=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let l,c,u,d;this.isHorizontal()?(l=Mc(t,this.left,o)-o/2,c=Mc(t,this.right,a)+a/2,u=d=s):(u=Mc(t,this.top,o)-o/2,d=Mc(t,this.bottom,a)+a/2,l=c=s),e.save(),e.lineWidth=i.width,e.strokeStyle=i.color,e.beginPath(),e.moveTo(l,u),e.lineTo(c,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,n=this._computeLabelArea();n&&Dc(e,n);const r=this.getLabelItems(t);for(const t of r){const n=t.options,r=t.font;$c(e,t.label,0,t.textOffset,r,n)}n&&Ac(e)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:r}}=this;if(!n.display)return;const i=Uc(n.font),o=qc(n.padding),a=n.align;let s=i.lineHeight/2;"bottom"===e||"center"===e||il(e)?(s+=o.bottom,rl(n.text)&&(s+=i.lineHeight*(n.text.length-1))):s+=o.top;const{titleX:l,titleY:c,maxWidth:u,rotation:d}=function(t,e,n,r){const{top:i,left:o,bottom:a,right:s,chart:l}=t,{chartArea:c,scales:u}=l;let d,h,p,f=0;const m=a-i,g=s-o;if(t.isHorizontal()){if(h=rc(r,o,s),il(n)){const t=Object.keys(n)[0],r=n[t];p=u[t].getPixelForValue(r)+m-e}else p="center"===n?(c.bottom+c.top)/2+m-e:lh(t,n,e);d=s-o}else{if(il(n)){const t=Object.keys(n)[0],r=n[t];h=u[t].getPixelForValue(r)-g+e}else h="center"===n?(c.left+c.right)/2-g+e:lh(t,n,e);p=rc(r,a,i),f="left"===n?-Pl:Pl}return{titleX:h,titleY:p,maxWidth:d,rotation:f}}(this,s,e,a);$c(t,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:fh(a,e,r),textBaseline:"middle",translation:[l,c]})}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,n=sl(t.grid&&t.grid.z,-1),r=sl(t.border&&t.border.z,0);return this._isVisible()&&this.draw===mh.prototype.draw?[{z:n,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",r=[];let i,o;for(i=0,o=e.length;i<o;++i){const o=e[i];o[n]!==this.id||t&&o.type!==t||r.push(o)}return r}_resolveTickFontOptions(t){return Uc(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class gh{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,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 n;(function(t){return"id"in t&&"defaults"in t})(e)&&(n=this.register(e));const r=this.items,i=t.id,o=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in r||(r[i]=t,function(t,e,n){const r=ml(Object.create(null),[n?kc.get(n):{},kc.get(e),t.defaults]);kc.set(e,r),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((n=>{const r=n.split("."),i=r.pop(),o=[t].concat(r).join("."),a=e[n].split("."),s=a.pop(),l=a.join(".");kc.route(o,i,l,s)}))}(e,t.defaultRoutes);t.descriptors&&kc.describe(e,t.descriptors)}(t,o,n),this.override&&kc.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,r=this.scope;n in e&&delete e[n],r&&n in kc[r]&&(delete kc[r][n],this.override&&delete bc[n])}}class vh{constructor(){this.controllers=new gh(ad,"datasets",!0),this.elements=new gh(oh,"elements"),this.plugins=new gh(Object,"plugins"),this.scales=new gh(mh,"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,n){[...e].forEach((e=>{const r=n||this._getRegistryForType(e);n||r.isForType(e)||r===this.plugins&&e.id?this._exec(t,r,e):ul(e,(e=>{const r=n||this._getRegistryForType(e);this._exec(t,r,e)}))}))}_exec(t,e,n){const r=_l(t);cl(n["before"+r],[],n),e[t](n),cl(n["after"+r],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const r=e.get(t);if(void 0===r)throw new Error('"'+t+'" is not a registered '+n+".");return r}}var yh=new vh;class bh{constructor(){this._init=[]}notify(t,e,n,r){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const i=r?this._descriptors(t).filter(r):this._descriptors(t),o=this._notify(i,t,e,n);return"afterDestroy"===e&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,n,r){r=r||{};for(const i of t){const t=i.plugin;if(!1===cl(t[n],[e,r,i.options],t)&&r.cancelable)return!1}return!0}invalidate(){nl(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 n=t&&t.config,r=sl(n.options&&n.options.plugins,{}),i=function(t){const e={},n=[],r=Object.keys(yh.plugins.items);for(let t=0;t<r.length;t++)n.push(yh.getPlugin(r[t]));const i=t.plugins||[];for(let t=0;t<i.length;t++){const r=i[t];-1===n.indexOf(r)&&(n.push(r),e[r.id]=!0)}return{plugins:n,localIds:e}}(n);return!1!==r||e?function(t,{plugins:e,localIds:n},r,i){const o=[],a=t.getContext();for(const s of e){const e=s.id,l=_h(r[e],i);null!==l&&o.push({plugin:s,options:xh(t.config,{plugin:s,local:n[e]},l,a)})}return o}(t,i,r,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,r=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(r(e,n),t,"stop"),this._notify(r(n,e),t,"start")}}function _h(t,e){return e||!1!==t?!0===t?{}:t:null}function xh(t,{plugin:e,local:n},r,i){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(r,o);return n&&e.defaults&&a.push(e.defaults),t.createResolver(a,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function wh(t,e){const n=kc.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Sh(t){if("x"===t||"y"===t||"r"===t)return t}function kh(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Ch(t,...e){if(Sh(t))return t;for(const n of e){const e=n.axis||kh(n.position)||t.length>1&&Sh(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Eh(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function Mh(t,e){const n=bc[t.type]||{scales:{}},r=e.scales||{},i=wh(t.type,e),o=Object.create(null);return Object.keys(r).forEach((e=>{const a=r[e];if(!il(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const s=Ch(e,a,function(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(n.length)return Eh(t,"x",n[0])||Eh(t,"y",n[0])}return{}}(e,t),kc.scales[a.type]),l=function(t,e){return t===e?"_index_":"_value_"}(s,i),c=n.scales||{};o[e]=gl(Object.create(null),[{axis:s},a,c[s],c[l]])})),t.data.datasets.forEach((n=>{const i=n.type||t.type,a=n.indexAxis||wh(i,e),s=(bc[i]||{}).scales||{};Object.keys(s).forEach((t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,a),i=n[e+"AxisID"]||e;o[i]=o[i]||Object.create(null),gl(o[i],[{axis:e},r[i],s[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];gl(e,[kc.scales[e.type],kc.scale])})),o}function Oh(t){const e=t.options||(t.options={});e.plugins=sl(e.plugins,{}),e.scales=Mh(t,e)}function Ph(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Th=new Map,Nh=new Set;function Dh(t,e){let n=Th.get(t);return n||(n=e(),Th.set(t,n),Nh.add(n)),n}const Ah=(t,e,n)=>{const r=bl(e,n);void 0!==r&&t.add(r)};class Lh{constructor(t){this._config=function(t){return(t=t||{}).data=Ph(t.data),Oh(t),t}(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=Ph(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(),Oh(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Dh(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Dh(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Dh(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Dh(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const n=this._scopeCache;let r=n.get(t);return r&&!e||(r=new Map,n.set(t,r)),r}getOptionScopes(t,e,n){const{options:r,type:i}=this,o=this._cachedScopes(t,n),a=o.get(e);if(a)return a;const s=new Set;e.forEach((e=>{t&&(s.add(t),e.forEach((e=>Ah(s,t,e)))),e.forEach((t=>Ah(s,r,t))),e.forEach((t=>Ah(s,bc[i]||{},t))),e.forEach((t=>Ah(s,kc,t))),e.forEach((t=>Ah(s,_c,t)))}));const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),Nh.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,bc[e]||{},kc.datasets[e]||{},{type:e},kc,_c]}resolveNamedOptions(t,e,n,r=[""]){const i={$shared:!0},{resolver:o,subPrefixes:a}=Ih(this._resolverCache,t,r);let s=o;if(function(t,e){const{isScriptable:n,isIndexable:r}=Qc(t);for(const i of e){const e=n(i),o=r(i),a=(o||e)&&t[i];if(e&&(wl(a)||zh(a))||o&&rl(a))return!0}return!1}(o,e)){i.$shared=!1;s=Jc(o,n=wl(n)?n():n,this.createResolver(t,n,a))}for(const t of e)i[t]=s[t];return i}createResolver(t,e,n=[""],r){const{resolver:i}=Ih(this._resolverCache,t,n);return il(e)?Jc(i,e,void 0,r):i}}function Ih(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const i=n.join();let o=r.get(i);if(!o){o={resolver:Kc(e,n),subPrefixes:n.filter((t=>!t.toLowerCase().includes("hover")))},r.set(i,o)}return o}const zh=t=>il(t)&&Object.getOwnPropertyNames(t).some((e=>wl(t[e])));const Rh=["top","bottom","left","right","chartArea"];function $h(t,e){return"top"===t||"bottom"===t||-1===Rh.indexOf(t)&&"x"===e}function Fh(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function jh(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),cl(n&&n.onComplete,[t],e)}function Bh(t){const e=t.chart,n=e.options.animation;cl(n&&n.onProgress,[t],e)}function Hh(t){return yu()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Wh={},Vh=t=>{const e=Hh(t);return Object.values(Wh).filter((t=>t.canvas===e)).pop()};function Yh(t,e,n){const r=Object.keys(t);for(const i of r){const r=+i;if(r>=e){const o=t[i];delete t[i],(n>0||r>e)&&(t[r+n]=o)}}}function Xh(t,e,n){return t.options.clip?t[n]:e[n]}class qh{static defaults=kc;static instances=Wh;static overrides=bc;static registry=yh;static version="4.4.7";static getChart=Vh;static register(...t){yh.add(...t),Uh()}static unregister(...t){yh.remove(...t),Uh()}constructor(t,e){const n=this.config=new Lh(e),r=Hh(t),i=Vh(r);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(t){return!yu()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Wd:ih}(r)),this.platform.updateConfig(n);const a=this.platform.acquireContext(r,o.aspectRatio),s=a&&a.canvas,l=s&&s.height,c=s&&s.width;this.id=el(),this.ctx=a,this.canvas=s,this.width=c,this.height=l,this._options=o,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 bh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],Wh[this.id]=this,a&&s?(Vu.listen(this,"complete",jh),Vu.listen(this,"progress",Bh),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:r,_aspectRatio:i}=this;return nl(t)?e&&i?i:r?n/r: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 yh}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Mu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Oc(this.canvas,this.ctx),this}stop(){return Vu.stop(this),this}resize(t,e){Vu.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,t,e,i),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Mu(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),cl(n.onResize,[this,o],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){ul(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,r=Object.keys(n).reduce(((t,e)=>(t[e]=!1,t)),{});let i=[];e&&(i=i.concat(Object.keys(e).map((t=>{const n=e[t],r=Ch(t,n),i="r"===r,o="x"===r;return{options:n,dposition:i?"chartArea":o?"bottom":"left",dtype:i?"radialLinear":o?"category":"linear"}})))),ul(i,(e=>{const i=e.options,o=i.id,a=Ch(o,i),s=sl(i.type,e.dtype);void 0!==i.position&&$h(i.position,a)===$h(e.dposition)||(i.position=e.dposition),r[o]=!0;let l=null;if(o in n&&n[o].type===s)l=n[o];else{l=new(yh.getScale(s))({id:o,type:s,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(i,t)})),ul(r,((t,e)=>{t||delete n[e]})),ul(n,(t=>{Bd.configure(this,t,t.options),Bd.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort(((t,e)=>t.index-e.index)),n>e){for(let t=e;t<n;++t)this._destroyDatasetMeta(t);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(Fh("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,n)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(n)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,r;for(this._removeUnreferencedMetasets(),n=0,r=e.length;n<r;n++){const r=e[n];let i=this.getDatasetMeta(n);const o=r.type||this.config.type;if(i.type&&i.type!==o&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=o,i.indexAxis=r.indexAxis||wh(o,this.options),i.order=r.order||0,i.index=n,i.label=""+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{const e=yh.getController(o),{datasetElementType:r,dataElementType:a}=kc.datasets[o];Object.assign(e,{dataElementType:yh.getElement(a),datasetElementType:r&&yh.getElement(r)}),i.controller=new e(this,n),t.push(i.controller)}}return this._updateMetasets(),t}_resetElements(){ul(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 n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),n=!r&&-1===i.indexOf(e);e.buildOrUpdateElements(n),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),r||ul(i,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fh("z","_idx"));const{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ul(this.scales,(t=>{Bd.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);Sl(e,n)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:r,count:i}of e){Yh(t,r,"_removeElements"===n?-i:i)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),r=n(0);for(let t=1;t<e;t++)if(!Sl(r,n(t)))return;return Array.from(r).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Bd.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],ul(this.boxes,(t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,wl(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),r={meta:n,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",r)&&(n.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Vu.has(this)?this.attached&&!Vu.running(this)&&Vu.start(this):(this.draw(),jh({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))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,n=[];let r,i;for(r=0,i=e.length;r<i;++r){const i=e[r];t&&!i.visible||n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))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,n=t._clip,r=!n.disabled,i=function(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:Xh(n,e,"left"),right:Xh(n,e,"right"),top:Xh(r,e,"top"),bottom:Xh(r,e,"bottom")}:e}(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(r&&Dc(e,{left:!1===n.left?0:i.left-n.left,right:!1===n.right?this.width:i.right+n.right,top:!1===n.top?0:i.top-n.top,bottom:!1===n.bottom?this.height:i.bottom+n.bottom}),t.controller.draw(),r&&Ac(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Nc(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,r){const i=Od.modes[e];return"function"==typeof i?i(this,t,n,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let r=n.filter((t=>t&&t._dataset===e)).pop();return r||(r={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},n.push(r)),r}getContext(){return this.$context||(this.$context=Gc(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const r=n?"show":"hide",i=this.getDatasetMeta(t),o=i.controller._resolveAnimations(void 0,r);xl(e)?(i.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(i,{visible:n}),this.update((e=>e.datasetIndex===t?r: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(),Vu.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(),Oc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Wh[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,n=(n,r)=>{e.addEventListener(this,n,r),t[n]=r},r=(t,e,n)=>{t.offsetX=e,t.offsetY=n,this._eventHandler(t)};ul(this.options.events,(t=>n(t,r)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(n,r)=>{e.addEventListener(this,n,r),t[n]=r},r=(n,r)=>{t[n]&&(e.removeEventListener(this,n,r),delete t[n])},i=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{r("attach",a),this.attached=!0,this.resize(),n("resize",i),n("detach",o)};o=()=>{this.attached=!1,r("resize",i),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){ul(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},ul(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const r=n?"set":"remove";let i,o,a,s;for("dataset"===e&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+r+"DatasetHoverStyle"]()),a=0,s=t.length;a<s;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[r+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map((({datasetIndex:t,index:e})=>{const n=this.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}));!dl(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,n){const r=this.options.hover,i=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=i(e,t),a=n?t:i(t,e);o.length&&this.updateHoverStyle(o,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",n,r))return;const i=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,r),(i||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:r=[],options:i}=this,o=e,a=this._getActiveElements(t,r,n,o),s=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,n,r){return n&&"mouseout"!==t.type?r?e:t:null}(t,this._lastEvent,n,s);n&&(this._lastEvent=null,cl(i.onHover,[t,a,this],this),s&&cl(i.onClick,[t,a,this],this));const c=!dl(a,r);return(c||e)&&(this._active=a,this._updateHoverStyles(a,r,e)),this._lastEvent=l,c}_getActiveElements(t,e,n,r){if("mouseout"===t.type)return[];if(!n)return e;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,r)}}function Uh(){return ul(qh.instances,(t=>t._plugins.invalidate()))}function Zh(t,e,n,r){const i=Vc(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(n-e)/2,a=Math.min(o,r*e/2),s=t=>{const e=(n-Math.min(o,t))*r/2;return Xl(t,0,Math.min(o,e))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:Xl(i.innerStart,0,a),innerEnd:Xl(i.innerEnd,0,a)}}function Gh(t,e,n,r){return{x:n+t*Math.cos(e),y:r+t*Math.sin(e)}}function Kh(t,e,n,r,i,o){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=e,d=Math.max(e.outerRadius+r+n-c,0),h=u>0?u+r+n+c:0;let p=0;const f=i-l;if(r){const t=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(f-(0!==t?f*t/(t+r):f))/2}const m=(f-Math.max(.001,f*d-n/kl)/d)/2,g=l+m+p,v=i-m-p,{outerStart:y,outerEnd:b,innerStart:_,innerEnd:x}=Zh(e,h,d,v-g),w=d-y,S=d-b,k=g+y/w,C=v-b/S,E=h+_,M=h+x,O=g+_/E,P=v-x/M;if(t.beginPath(),o){const e=(k+C)/2;if(t.arc(a,s,d,k,e),t.arc(a,s,d,e,C),b>0){const e=Gh(S,C,a,s);t.arc(e.x,e.y,b,C,v+Pl)}const n=Gh(M,v,a,s);if(t.lineTo(n.x,n.y),x>0){const e=Gh(M,P,a,s);t.arc(e.x,e.y,x,v+Pl,P+Math.PI)}const r=(v-x/h+(g+_/h))/2;if(t.arc(a,s,h,v-x/h,r,!0),t.arc(a,s,h,r,g+_/h,!0),_>0){const e=Gh(E,O,a,s);t.arc(e.x,e.y,_,O+Math.PI,g-Pl)}const i=Gh(w,g,a,s);if(t.lineTo(i.x,i.y),y>0){const e=Gh(w,k,a,s);t.arc(e.x,e.y,y,g-Pl,k)}}else{t.moveTo(a,s);const e=Math.cos(k)*d+a,n=Math.sin(k)*d+s;t.lineTo(e,n);const r=Math.cos(C)*d+a,i=Math.sin(C)*d+s;t.lineTo(r,i)}t.closePath()}function Jh(t,e,n,r,i){const{fullCircles:o,startAngle:a,circumference:s,options:l}=e,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,p="inner"===l.borderAlign;if(!c)return;t.setLineDash(d||[]),t.lineDashOffset=h,p?(t.lineWidth=2*c,t.lineJoin=u||"round"):(t.lineWidth=c,t.lineJoin=u||"bevel");let f=e.endAngle;if(o){Kh(t,e,n,r,f,i);for(let e=0;e<o;++e)t.stroke();isNaN(s)||(f=a+(s%Cl||Cl))}p&&function(t,e,n){const{startAngle:r,pixelMargin:i,x:o,y:a,outerRadius:s,innerRadius:l}=e;let c=i/s;t.beginPath(),t.arc(o,a,s,r-c,n+c),l>i?(c=i/l,t.arc(o,a,l,n+c,r-c,!0)):t.arc(o,a,i,n+Pl,r-Pl),t.closePath(),t.clip()}(t,e,f),o||(Kh(t,e,n,r,f,i),t.stroke())}function Qh(t,e,n=e){t.lineCap=sl(n.borderCapStyle,e.borderCapStyle),t.setLineDash(sl(n.borderDash,e.borderDash)),t.lineDashOffset=sl(n.borderDashOffset,e.borderDashOffset),t.lineJoin=sl(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=sl(n.borderWidth,e.borderWidth),t.strokeStyle=sl(n.borderColor,e.borderColor)}function tp(t,e,n){t.lineTo(n.x,n.y)}function ep(t,e,n={}){const r=t.length,{start:i=0,end:o=r-1}=n,{start:a,end:s}=e,l=Math.max(i,a),c=Math.min(o,s),u=i<a&&o<a||i>s&&o>s;return{count:r,start:l,loop:e.loop,ilen:c<l&&!u?r+c-l:c-l}}function np(t,e,n,r){const{points:i,options:o}=e,{count:a,start:s,loop:l,ilen:c}=ep(i,n,r),u=function(t){return t.stepped?Lc:t.tension||"monotone"===t.cubicInterpolationMode?Ic:tp}(o);let d,h,p,{move:f=!0,reverse:m}=r||{};for(d=0;d<=c;++d)h=i[(s+(m?c-d:d))%a],h.skip||(f?(t.moveTo(h.x,h.y),f=!1):u(t,p,h,m,o.stepped),p=h);return l&&(h=i[(s+(m?c:0))%a],u(t,p,h,m,o.stepped)),!!l}function rp(t,e,n,r){const i=e.points,{count:o,start:a,ilen:s}=ep(i,n,r),{move:l=!0,reverse:c}=r||{};let u,d,h,p,f,m,g=0,v=0;const y=t=>(a+(c?s-t:t))%o,b=()=>{p!==f&&(t.lineTo(g,f),t.lineTo(g,p),t.lineTo(g,m))};for(l&&(d=i[y(0)],t.moveTo(d.x,d.y)),u=0;u<=s;++u){if(d=i[y(u)],d.skip)continue;const e=d.x,n=d.y,r=0|e;r===h?(n<p?p=n:n>f&&(f=n),g=(v*g+e)/++v):(b(),t.lineTo(e,n),h=r,v=0,p=f=n),m=n}b()}function ip(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n)?rp:np}const op="function"==typeof Path2D;function ap(t,e,n,r){op&&!e.options.segment?function(t,e,n,r){let i=e._path;i||(i=e._path=new Path2D,e.path(i,n,r)&&i.closePath()),Qh(t,e.options),t.stroke(i)}(t,e,n,r):function(t,e,n,r){const{segments:i,options:o}=e,a=ip(e);for(const s of i)Qh(t,o,s.style),t.beginPath(),a(t,e,s,{start:n,end:n+r-1})&&t.closePath(),t.stroke()}(t,e,n,r)}class sp extends oh{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};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 n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const r=n.spanGaps?this._loop:this._fullLoop;vu(this._points,n,t,r,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=function(t,e){const n=t.points,r=t.options.spanGaps,i=n.length;if(!i)return[];const o=!!t._loop,{start:a,end:s}=function(t,e,n,r){let i=0,o=e-1;if(n&&!r)for(;i<e&&!t[i].skip;)i++;for(;i<e&&t[i].skip;)i++;for(i%=e,n&&(o+=i);o>i&&t[o%e].skip;)o--;return o%=e,{start:i,end:o}}(n,i,o,r);return ju(t,!0===r?[{start:a,end:s,loop:o}]:function(t,e,n,r){const i=t.length,o=[];let a,s=e,l=t[e];for(a=e+1;a<=n;++a){const n=t[a%i];n.skip||n.stop?l.skip||(r=!1,o.push({start:e%i,end:(a-1)%i,loop:r}),e=s=n.stop?a:null):(s=a,l.skip&&(e=a)),l=n}return null!==s&&o.push({start:e%i,end:s%i,loop:r}),o}(n,a,s<a?s+i:s,!!t._fullLoop&&0===a&&s===i-1),n,e)}(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,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,r=t[e],i=this.points,o=Fu(this,{property:e,start:r,end:r});if(!o.length)return;const a=[],s=function(t){return t.stepped?Nu:t.tension||"monotone"===t.cubicInterpolationMode?Du:Tu}(n);let l,c;for(l=0,c=o.length;l<c;++l){const{start:c,end:u}=o[l],d=i[c],h=i[u];if(d===h){a.push(d);continue}const p=s(d,h,Math.abs((r-d[e])/(h[e]-d[e])),n.stepped);p[e]=t[e],a.push(p)}return 1===a.length?a[0]:a}pathSegment(t,e,n){return ip(this)(t,this,e,n)}path(t,e,n){const r=this.segments,i=ip(this);let o=this._loop;e=e||0,n=n||this.points.length-e;for(const a of r)o&=i(t,this,a,{start:e,end:e+n-1});return!!o}draw(t,e,n,r){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(t.save(),ap(t,this,n,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function lp(t,e,n,r){const i=t.options,{[n]:o}=t.getProps([n],r);return Math.abs(e-o)<i.radius+i.hitRadius}function cp(t,e){const{x:n,y:r,base:i,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let s,l,c,u,d;return t.horizontal?(d=a/2,s=Math.min(n,i),l=Math.max(n,i),c=r-d,u=r+d):(d=o/2,s=n-d,l=n+d,c=Math.min(r,i),u=Math.max(r,i)),{left:s,top:c,right:l,bottom:u}}function up(t,e,n,r){return t?0:Xl(e,n,r)}function dp(t){const e=cp(t),n=e.right-e.left,r=e.bottom-e.top,i=function(t,e,n){const r=t.options.borderWidth,i=t.borderSkipped,o=Yc(r);return{t:up(i.top,o.top,0,n),r:up(i.right,o.right,0,e),b:up(i.bottom,o.bottom,0,n),l:up(i.left,o.left,0,e)}}(t,n/2,r/2),o=function(t,e,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),i=t.options.borderRadius,o=Xc(i),a=Math.min(e,n),s=t.borderSkipped,l=r||il(i);return{topLeft:up(!l||s.top||s.left,o.topLeft,0,a),topRight:up(!l||s.top||s.right,o.topRight,0,a),bottomLeft:up(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:up(!l||s.bottom||s.right,o.bottomRight,0,a)}}(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:o},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function hp(t,e,n,r){const i=null===e,o=null===n,a=t&&!(i&&o)&&cp(t,r);return a&&(i||ql(e,a.left,a.right))&&(o||ql(n,a.top,a.bottom))}function pp(t,e){t.rect(e.x,e.y,e.w,e.h)}function fp(t,e,n={}){const r=t.x!==n.x?-e:0,i=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-r,a=(t.y+t.h!==n.y+n.h?e:0)-i;return{x:t.x+r,y:t.y+i,w:t.w+o,h:t.h+a,radius:t.radius}}class mp extends oh{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:n,backgroundColor:r}}=this,{inner:i,outer:o}=dp(this),a=(s=o.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?Fc:pp;var s;t.save(),o.w===i.w&&o.h===i.h||(t.beginPath(),a(t,fp(o,e,i)),t.clip(),a(t,fp(i,-e,o)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,fp(i,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,n){return hp(this,t,e,n)}inXRange(t,e){return hp(this,t,null,e)}inYRange(t,e){return hp(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:r,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(e+r)/2:e,y:i?n:(n+r)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}var gp=Object.freeze({__proto__:null,ArcElement:class extends oh{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const r=this.getProps(["x","y"],n),{angle:i,distance:o}=Bl(r,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=(this.options.spacing+this.options.borderWidth)/2,h=sl(u,s-a),p=Yl(i,a,s)&&a!==s,f=h>=Cl||p,m=ql(o,l+d,c+d);return f&&m}getCenterPoint(t){const{x:e,y:n,startAngle:r,endAngle:i,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:s,spacing:l}=this.options,c=(r+i)/2,u=(o+a+l+s)/2;return{x:e+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,r=(e.offset||0)/4,i=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=n>Cl?Math.floor(n/Cl):0,0===n||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*r,Math.sin(a)*r);const s=r*(1-Math.sin(Math.min(kl,n||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,n,r,i){const{fullCircles:o,startAngle:a,circumference:s}=e;let l=e.endAngle;if(o){Kh(t,e,n,r,l,i);for(let e=0;e<o;++e)t.fill();isNaN(s)||(l=a+(s%Cl||Cl))}Kh(t,e,n,r,l,i),t.fill()}(t,this,s,i,o),Jh(t,this,s,i,o),t.restore()}},BarElement:mp,LineElement:sp,PointElement:class extends oh{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const r=this.options,{x:i,y:o}=this.getProps(["x","y"],n);return Math.pow(t-i,2)+Math.pow(e-o,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return lp(this,t,"x",e)}inYRange(t,e){return lp(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const n=this.options;this.skip||n.radius<.1||!Nc(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,Pc(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}});const vp=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],yp=vp.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function bp(t){return vp[t%vp.length]}function _p(t){return yp[t%yp.length]}function xp(t){let e=0;return(n,r)=>{const i=t.getDatasetMeta(r).controller;i instanceof gd?e=function(t,e){return t.backgroundColor=t.data.map((()=>bp(e++))),e}(n,e):i instanceof vd?e=function(t,e){return t.backgroundColor=t.data.map((()=>_p(e++))),e}(n,e):i&&(e=function(t,e){return t.borderColor=bp(e),t.backgroundColor=_p(e),++e}(n,e))}}function wp(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Sp={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=t.config,{elements:o}=i,a=wp(r)||(s=i)&&(s.borderColor||s.backgroundColor)||o&&wp(o)||"rgba(0,0,0,0.1)"!==kc.borderColor||"rgba(0,0,0,0.1)"!==kc.backgroundColor;var s;if(!n.forceOverride&&a)return;const l=xp(t);r.forEach(l)}};function kp(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Cp(t){t.data.datasets.forEach((t=>{kp(t)}))}var Ep={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled)return void Cp(t);const r=t.width;t.data.datasets.forEach(((e,i)=>{const{_data:o,indexAxis:a}=e,s=t.getDatasetMeta(i),l=o||e.data;if("y"===Zc([a,t.options.indexAxis]))return;if(!s.controller.supportsDecimation)return;const c=t.scales[s.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:u,count:d}=function(t,e){const n=e.length;let r,i=0;const{iScale:o}=t,{min:a,max:s,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=Xl(Zl(e,o.axis,a).lo,0,n-1)),r=c?Xl(Zl(e,o.axis,s).hi+1,i,n)-i:n-i,{start:i,count:r}}(s,l);if(d<=(n.threshold||4*r))return void kp(e);let h;switch(nl(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),n.algorithm){case"lttb":h=function(t,e,n,r,i){const o=i.samples||r;if(o>=n)return t.slice(e,e+n);const a=[],s=(n-2)/(o-2);let l=0;const c=e+n-1;let u,d,h,p,f,m=e;for(a[l++]=t[m],u=0;u<o-2;u++){let r,i=0,o=0;const c=Math.floor((u+1)*s)+1+e,g=Math.min(Math.floor((u+2)*s)+1,n)+e,v=g-c;for(r=c;r<g;r++)i+=t[r].x,o+=t[r].y;i/=v,o/=v;const y=Math.floor(u*s)+1+e,b=Math.min(Math.floor((u+1)*s)+1,n)+e,{x:_,y:x}=t[m];for(h=p=-1,r=y;r<b;r++)p=.5*Math.abs((_-i)*(t[r].y-x)-(_-t[r].x)*(o-x)),p>h&&(h=p,d=t[r],f=r);a[l++]=d,m=f}return a[l++]=t[c],a}(l,u,d,r,n);break;case"min-max":h=function(t,e,n,r){let i,o,a,s,l,c,u,d,h,p,f=0,m=0;const g=[],v=e+n-1,y=t[e].x,b=t[v].x-y;for(i=e;i<e+n;++i){o=t[i],a=(o.x-y)/b*r,s=o.y;const e=0|a;if(e===l)s<h?(h=s,c=i):s>p&&(p=s,u=i),f=(m*f+o.x)/++m;else{const n=i-1;if(!nl(c)&&!nl(u)){const e=Math.min(c,u),r=Math.max(c,u);e!==d&&e!==n&&g.push({...t[e],x:f}),r!==d&&r!==n&&g.push({...t[r],x:f})}i>0&&n!==d&&g.push(t[n]),g.push(o),l=e,m=0,h=p=s,c=u=d=i}}return g}(l,u,d,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}e._decimated=h}))},destroy(t){Cp(t)}};function Mp(t,e,n,r){if(r)return;let i=e[t],o=n[t];return"angle"===t&&(i=Vl(i),o=Vl(o)),{property:t,start:i,end:o}}function Op(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Pp(t,e,n,r){return t&&e?r(t[n],e[n]):t?t[n]:e?e[n]:0}function Tp(t,e){let n=[],r=!1;return rl(t)?(r=!0,n=t):n=function(t,e){const{x:n=null,y:r=null}=t||{},i=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=Op(t,e,i);const a=i[t],s=i[e];null!==r?(o.push({x:a.x,y:r}),o.push({x:s.x,y:r})):null!==n&&(o.push({x:n,y:a.y}),o.push({x:n,y:s.y}))})),o}(t,e),n.length?new sp({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Np(t){return t&&!1!==t.fill}function Dp(t,e,n){let r=t[e].fill;const i=[e];let o;if(!n)return r;for(;!1!==r&&-1===i.indexOf(r);){if(!ol(r))return r;if(o=t[r],!o)return!1;if(o.visible)return r;i.push(r),r=o.fill}return!1}function Ap(t,e,n){const r=function(t){const e=t.options,n=e.fill;let r=sl(n&&n.target,n);void 0===r&&(r=!!e.backgroundColor);if(!1===r||null===r)return!1;if(!0===r)return"origin";return r}(t);if(il(r))return!isNaN(r.value)&&r;let i=parseFloat(r);return ol(i)&&Math.floor(i)===i?function(t,e,n,r){"-"!==t&&"+"!==t||(n=e+n);if(n===e||n<0||n>=r)return!1;return n}(r[0],e,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Lp(t,e,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:a,last:s,point:l}=Ip(o,e,"x");if(!(!l||a&&s))if(a)r.unshift(l);else if(t.push(l),!s)break}t.push(...r)}function Ip(t,e,n){const r=t.interpolate(e,n);if(!r)return{};const i=r[n],o=t.segments,a=t.points;let s=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],r=a[e.start][n],c=a[e.end][n];if(ql(i,r,c)){s=i===r,l=i===c;break}}return{first:s,last:l,point:r}}class zp{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:r,y:i,radius:o}=this;return e=e||{start:0,end:Cl},t.arc(r,i,o,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:r}=this,i=t.angle;return{x:e+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}}function Rp(t){const{chart:e,fill:n,line:r}=t;if(ol(n))return function(t,e){const n=t.getDatasetMeta(e),r=n&&t.isDatasetVisible(e);return r?n.dataset:null}(e,n);if("stack"===n)return function(t){const{scale:e,index:n,line:r}=t,i=[],o=r.segments,a=r.points,s=function(t,e){const n=[],r=t.getMatchingVisibleMetas("line");for(let t=0;t<r.length;t++){const i=r[t];if(i.index===e)break;i.hidden||n.unshift(i.dataset)}return n}(e,n);s.push(Tp({x:null,y:e.bottom},r));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)Lp(i,a[t],s)}return new sp({points:i,options:{}})}(t);if("shape"===n)return!0;const i=function(t){const e=t.scale||{};if(e.getPointPositionForValue)return function(t){const{scale:e,fill:n}=t,r=e.options,i=e.getLabels().length,o=r.reverse?e.max:e.min,a=function(t,e,n){let r;return r="start"===t?n:"end"===t?e.options.reverse?e.min:e.max:il(t)?t.value:e.getBaseValue(),r}(n,e,o),s=[];if(r.grid.circular){const t=e.getPointPositionForValue(0,o);return new zp({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(a)})}for(let t=0;t<i;++t)s.push(e.getPointPositionForValue(t,a));return s}(t);return function(t){const{scale:e={},fill:n}=t,r=function(t,e){let n=null;return"start"===t?n=e.bottom:"end"===t?n=e.top:il(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}(n,e);if(ol(r)){const t=e.isHorizontal();return{x:t?r:null,y:t?null:r}}return null}(t)}(t);return i instanceof zp?i:Tp(i,r)}function $p(t,e,n){const r=Rp(e),{line:i,scale:o,axis:a}=e,s=i.options,l=s.fill,c=s.backgroundColor,{above:u=c,below:d=c}=l||{};r&&i.points.length&&(Dc(t,n),function(t,e){const{line:n,target:r,above:i,below:o,area:a,scale:s}=e,l=n._loop?"angle":e.axis;t.save(),"x"===l&&o!==i&&(Fp(t,r,a.top),jp(t,{line:n,target:r,color:i,scale:s,property:l}),t.restore(),t.save(),Fp(t,r,a.bottom));jp(t,{line:n,target:r,color:o,scale:s,property:l}),t.restore()}(t,{line:i,target:r,above:u,below:d,area:n,scale:o,axis:a}),Ac(t))}function Fp(t,e,n){const{segments:r,points:i}=e;let o=!0,a=!1;t.beginPath();for(const s of r){const{start:r,end:l}=s,c=i[r],u=i[Op(r,l,i)];o?(t.moveTo(c.x,c.y),o=!1):(t.lineTo(c.x,n),t.lineTo(c.x,c.y)),a=!!e.pathSegment(t,s,{move:a}),a?t.closePath():t.lineTo(u.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function jp(t,e){const{line:n,target:r,property:i,color:o,scale:a}=e,s=function(t,e,n){const r=t.segments,i=t.points,o=e.points,a=[];for(const t of r){let{start:r,end:s}=t;s=Op(r,s,i);const l=Mp(n,i[r],i[s],t.loop);if(!e.segments){a.push({source:t,target:l,start:i[r],end:i[s]});continue}const c=Fu(e,l);for(const e of c){const r=Mp(n,o[e.start],o[e.end],e.loop),s=$u(t,i,r);for(const t of s)a.push({source:t,target:e,start:{[n]:Pp(l,r,"start",Math.max)},end:{[n]:Pp(l,r,"end",Math.min)}})}}return a}(n,r,i);for(const{source:e,target:l,start:c,end:u}of s){const{style:{backgroundColor:s=o}={}}=e,d=!0!==r;t.save(),t.fillStyle=s,Bp(t,a,d&&Mp(i,c,u)),t.beginPath();const h=!!n.pathSegment(t,e);let p;if(d){h?t.closePath():Hp(t,r,u,i);const e=!!r.pathSegment(t,l,{move:h,reverse:!0});p=h&&e,p||Hp(t,r,c,i)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function Bp(t,e,n){const{top:r,bottom:i}=e.chart.chartArea,{property:o,start:a,end:s}=n||{};"x"===o&&(t.beginPath(),t.rect(a,r,s-a,i-r),t.clip())}function Hp(t,e,n,r){const i=e.interpolate(n,r);i&&t.lineTo(i.x,i.y)}var Wp={id:"filler",afterDatasetsUpdate(t,e,n){const r=(t.data.datasets||[]).length,i=[];let o,a,s,l;for(a=0;a<r;++a)o=t.getDatasetMeta(a),s=o.dataset,l=null,s&&s.options&&s instanceof sp&&(l={visible:t.isDatasetVisible(a),index:a,fill:Ap(s,a,r),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:s}),o.$filler=l,i.push(l);for(a=0;a<r;++a)l=i[a],l&&!1!==l.fill&&(l.fill=Dp(i,a,n.propagate))},beforeDraw(t,e,n){const r="beforeDraw"===n.drawTime,i=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=i.length-1;e>=0;--e){const n=i[e].$filler;n&&(n.line.updateControlPoints(o,n.axis),r&&n.fill&&$p(t.ctx,n,o))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const r=t.getSortedVisibleDatasetMetas();for(let e=r.length-1;e>=0;--e){const n=r[e].$filler;Np(n)&&$p(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const r=e.meta.$filler;Np(r)&&"beforeDatasetDraw"===n.drawTime&&$p(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Vp=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}};class Yp extends oh{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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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=cl(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,n)=>t.sort(e,n,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const n=t.labels,r=Uc(n.font),i=r.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=Vp(n,i);let l,c;e.font=r.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,i,a,s)+10):(c=this.maxHeight,l=this._fitCols(o,r,a,s)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,r){const{ctx:i,maxWidth:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=r+a;let u=t;i.textAlign="left",i.textBaseline="middle";let d=-1,h=-c;return this.legendItems.forEach(((t,p)=>{const f=n+e/2+i.measureText(t.text).width;(0===p||l[l.length-1]+f+2*a>o)&&(u+=c,l[l.length-(p>0?0:1)]=0,h+=c,d++),s[p]={left:0,top:h,row:d,width:f,height:r},l[l.length-1]+=f+a})),u}_fitCols(t,e,n,r){const{ctx:i,maxHeight:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let u=a,d=0,h=0,p=0,f=0;return this.legendItems.forEach(((t,o)=>{const{itemWidth:m,itemHeight:g}=function(t,e,n,r,i){const o=function(t,e,n,r){let i=t.text;i&&"string"!=typeof i&&(i=i.reduce(((t,e)=>t.length>e.length?t:e)));return e+n.size/2+r.measureText(i).width}(r,t,e,n),a=function(t,e,n){let r=t;"string"!=typeof e.text&&(r=Xp(e,n));return r}(i,r,e.lineHeight);return{itemWidth:o,itemHeight:a}}(n,e,i,t,r);o>0&&h+g+2*a>c&&(u+=d+a,l.push({width:d,height:h}),p+=d+a,f++,d=h=0),s[o]={left:p,top:h,col:f,width:m,height:g},d=Math.max(d,m),h+=g+a})),u+=d,l.push({width:d,height:h}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:r},rtl:i}}=this,o=Au(i,this.left,this.width);if(this.isHorizontal()){let i=0,a=rc(n,this.left+r,this.right-this.lineWidths[i]);for(const s of e)i!==s.row&&(i=s.row,a=rc(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+t+r,s.left=o.leftForLtr(o.x(a),s.width),a+=s.width+r}else{let i=0,a=rc(n,this.top+t+r,this.bottom-this.columnSizes[i].height);for(const s of e)s.col!==i&&(i=s.col,a=rc(n,this.top+t+r,this.bottom-this.columnSizes[i].height)),s.top=a,s.left+=this.left+r,s.left=o.leftForLtr(o.x(s.left),s.width),a+=s.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Dc(t,this),this._draw(),Ac(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:r}=this,{align:i,labels:o}=t,a=kc.color,s=Au(t.rtl,this.left,this.width),l=Uc(o.font),{padding:c}=o,u=l.size,d=u/2;let h;this.drawTitle(),r.textAlign=s.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=l.string;const{boxWidth:p,boxHeight:f,itemHeight:m}=Vp(o,u),g=this.isHorizontal(),v=this._computeTitleHeight();h=g?{x:rc(i,this.left+c,this.right-n[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:rc(i,this.top+v+c,this.bottom-e[0].height),line:0},Lu(this.ctx,t.textDirection);const y=m+c;this.legendItems.forEach(((b,_)=>{r.strokeStyle=b.fontColor,r.fillStyle=b.fontColor;const x=r.measureText(b.text).width,w=s.textAlign(b.textAlign||(b.textAlign=o.textAlign)),S=p+d+x;let k=h.x,C=h.y;s.setWidth(this.width),g?_>0&&k+S+c>this.right&&(C=h.y+=y,h.line++,k=h.x=rc(i,this.left+c,this.right-n[h.line])):_>0&&C+y>this.bottom&&(k=h.x=k+e[h.line].width+c,h.line++,C=h.y=rc(i,this.top+v+c,this.bottom-e[h.line].height));if(function(t,e,n){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;r.save();const i=sl(n.lineWidth,1);if(r.fillStyle=sl(n.fillStyle,a),r.lineCap=sl(n.lineCap,"butt"),r.lineDashOffset=sl(n.lineDashOffset,0),r.lineJoin=sl(n.lineJoin,"miter"),r.lineWidth=i,r.strokeStyle=sl(n.strokeStyle,a),r.setLineDash(sl(n.lineDash,[])),o.usePointStyle){const a={radius:f*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},l=s.xPlus(t,p/2);Tc(r,a,l,e+d,o.pointStyleWidth&&p)}else{const o=e+Math.max((u-f)/2,0),a=s.leftForLtr(t,p),l=Xc(n.borderRadius);r.beginPath(),Object.values(l).some((t=>0!==t))?Fc(r,{x:a,y:o,w:p,h:f,radius:l}):r.rect(a,o,p,f),r.fill(),0!==i&&r.stroke()}r.restore()}(s.x(k),C,b),k=((t,e,n,r)=>t===(r?"left":"right")?n:"center"===t?(e+n)/2:e)(w,k+p+d,g?k+S:this.right,t.rtl),function(t,e,n){$c(r,n.text,t,e+m/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(k),C,b),g)h.x+=S+c;else if("string"!=typeof b.text){const t=l.lineHeight;h.y+=Xp(b,t)+c}else h.y+=y})),Iu(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=Uc(e.font),r=qc(e.padding);if(!e.display)return;const i=Au(t.rtl,this.left,this.width),o=this.ctx,a=e.position,s=n.size/2,l=r.top+s;let c,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,u=rc(t.align,u,this.right-d);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);c=l+rc(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const h=rc(a,u,u+d);o.textAlign=i.textAlign(nc(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=n.string,$c(o,e.text,h,c,n)}_computeTitleHeight(){const t=this.options.title,e=Uc(t.font),n=qc(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,r,i;if(ql(t,this.left,this.right)&&ql(e,this.top,this.bottom))for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],ql(t,r.left,r.left+r.width)&&ql(e,r.top,r.top+r.height))return this.legendItems[n];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const r=this._hoveredItem,i=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(r,n);r&&!i&&cl(e.onLeave,[t,r,this],this),this._hoveredItem=n,n&&!i&&cl(e.onHover,[t,n,this],this)}else n&&cl(e.onClick,[t,n,this],this)}}function Xp(t,e){return e*(t.text?t.text.length:0)}var qp={id:"legend",_element:Yp,start(t,e,n){const r=t.legend=new Yp({ctx:t.ctx,options:n,chart:t});Bd.configure(t,r,n),Bd.addBox(t,r)},stop(t){Bd.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;Bd.configure(t,r,n),r.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const r=e.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),e.hidden=!0):(i.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:a,borderRadius:s}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(n?0:void 0),c=qc(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:i||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Up extends oh{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 n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const r=rl(n.text)?n.text.length:1;this._padding=qc(n.padding);const i=r*Uc(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:n,bottom:r,right:i,options:o}=this,a=o.align;let s,l,c,u=0;return this.isHorizontal()?(l=rc(a,n,i),c=e+t,s=i-n):("left"===o.position?(l=n+t,c=rc(a,r,e),u=-.5*kl):(l=i-t,c=rc(a,e,r),u=.5*kl),s=r-e),{titleX:l,titleY:c,maxWidth:s,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=Uc(e.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:o,maxWidth:a,rotation:s}=this._drawArgs(r);$c(t,e.text,0,0,n,{color:e.color,maxWidth:a,rotation:s,textAlign:nc(e.align),textBaseline:"middle",translation:[i,o]})}}var Zp={id:"title",_element:Up,start(t,e,n){!function(t,e){const n=new Up({ctx:t.ctx,options:e,chart:t});Bd.configure(t,n,e),Bd.addBox(t,n),t.titleBlock=n}(t,n)},stop(t){const e=t.titleBlock;Bd.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const r=t.titleBlock;Bd.configure(t,r,n),r.options=n},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 Gp=new WeakMap;var Kp={id:"subtitle",start(t,e,n){const r=new Up({ctx:t.ctx,options:n,chart:t});Bd.configure(t,r,n),Bd.addBox(t,r),Gp.set(t,r)},stop(t){Bd.removeBox(t,Gp.get(t)),Gp.delete(t)},beforeUpdate(t,e,n){const r=Gp.get(t);Bd.configure(t,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Jp={average(t){if(!t.length)return!1;let e,n,r=new Set,i=0,o=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();r.add(t.x),i+=t.y,++o}}if(0===o||0===r.size)return!1;const a=[...r].reduce(((t,e)=>t+e))/r.size;return{x:a,y:i/o}},nearest(t,e){if(!t.length)return!1;let n,r,i,o=e.x,a=e.y,s=Number.POSITIVE_INFINITY;for(n=0,r=t.length;n<r;++n){const r=t[n].element;if(r&&r.hasValue()){const t=Hl(e,r.getCenterPoint());t<s&&(s=t,i=r)}}if(i){const t=i.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function Qp(t,e){return e&&(rl(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function tf(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function ef(t,e){const{element:n,datasetIndex:r,index:i}=e,o=t.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:t,label:a,parsed:o.getParsed(i),raw:t.data.datasets[r].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function nf(t,e){const n=t.chart.ctx,{body:r,footer:i,title:o}=t,{boxWidth:a,boxHeight:s}=e,l=Uc(e.bodyFont),c=Uc(e.titleFont),u=Uc(e.footerFont),d=o.length,h=i.length,p=r.length,f=qc(e.padding);let m=f.height,g=0,v=r.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(v+=t.beforeBody.length+t.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),v){m+=p*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(v-p)*l.lineHeight+(v-1)*e.bodySpacing}h&&(m+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let y=0;const b=function(t){g=Math.max(g,n.measureText(t).width+y)};return n.save(),n.font=c.string,ul(t.title,b),n.font=l.string,ul(t.beforeBody.concat(t.afterBody),b),y=e.displayColors?a+2+e.boxPadding:0,ul(r,(t=>{ul(t.before,b),ul(t.lines,b),ul(t.after,b)})),y=0,n.font=u.string,ul(t.footer,b),n.restore(),g+=f.width,{width:g,height:m}}function rf(t,e,n,r){const{x:i,width:o}=n,{width:a,chartArea:{left:s,right:l}}=t;let c="center";return"center"===r?c=i<=(s+l)/2?"left":"right":i<=o/2?c="left":i>=a-o/2&&(c="right"),function(t,e,n,r){const{x:i,width:o}=r,a=n.caretSize+n.caretPadding;return"left"===t&&i+o+a>e.width||"right"===t&&i-o-a<0||void 0}(c,t,e,n)&&(c="center"),c}function of(t,e,n){const r=n.yAlign||e.yAlign||function(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}(t,n);return{xAlign:n.xAlign||e.xAlign||rf(t,e,n,r),yAlign:r}}function af(t,e,n,r){const{caretSize:i,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=Xc(a);let f=function(t,e){let{x:n,width:r}=t;return"right"===e?n-=r:"center"===e&&(n-=r/2),n}(e,s);const m=function(t,e,n){let{y:r,height:i}=t;return"top"===e?r+=n:r-="bottom"===e?i+n:i/2,r}(e,l,c);return"center"===l?"left"===s?f+=c:"right"===s&&(f-=c):"left"===s?f-=Math.max(u,h)+i:"right"===s&&(f+=Math.max(d,p)+i),{x:Xl(f,0,r.width-e.width),y:Xl(m,0,r.height-e.height)}}function sf(t,e,n){const r=qc(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-r.right:t.x+r.left}function lf(t){return Qp([],tf(t))}function cf(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const uf={beforeTitle:tl,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:tl,beforeBody:tl,beforeLabel:tl,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return nl(n)||(e+=n),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.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(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:tl,afterBody:tl,beforeFooter:tl,footer:tl,afterFooter:tl};function df(t,e,n,r){const i=t[e].call(n,r);return void 0===i?uf[e].call(n,r):i}class hf extends oh{static positioners=Jp;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,n=this.options.setContext(this.getContext()),r=n.enabled&&e.options.animation&&n.animations,i=new Uu(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,n=this._tooltipItems,Gc(t,{tooltip:e,tooltipItems:n,type:"tooltip"})));var t,e,n}getTitle(t,e){const{callbacks:n}=e,r=df(n,"beforeTitle",this,t),i=df(n,"title",this,t),o=df(n,"afterTitle",this,t);let a=[];return a=Qp(a,tf(r)),a=Qp(a,tf(i)),a=Qp(a,tf(o)),a}getBeforeBody(t,e){return lf(df(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,r=[];return ul(t,(t=>{const e={before:[],lines:[],after:[]},i=cf(n,t);Qp(e.before,tf(df(i,"beforeLabel",this,t))),Qp(e.lines,df(i,"label",this,t)),Qp(e.after,tf(df(i,"afterLabel",this,t))),r.push(e)})),r}getAfterBody(t,e){return lf(df(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,r=df(n,"beforeFooter",this,t),i=df(n,"footer",this,t),o=df(n,"afterFooter",this,t);let a=[];return a=Qp(a,tf(r)),a=Qp(a,tf(i)),a=Qp(a,tf(o)),a}_createItems(t){const e=this._active,n=this.chart.data,r=[],i=[],o=[];let a,s,l=[];for(a=0,s=e.length;a<s;++a)l.push(ef(this.chart,e[a]));return t.filter&&(l=l.filter(((e,r,i)=>t.filter(e,r,i,n)))),t.itemSort&&(l=l.sort(((e,r)=>t.itemSort(e,r,n)))),ul(l,(e=>{const n=cf(t.callbacks,e);r.push(df(n,"labelColor",this,e)),i.push(df(n,"labelPointStyle",this,e)),o.push(df(n,"labelTextColor",this,e))})),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const n=this.options.setContext(this.getContext()),r=this._active;let i,o=[];if(r.length){const t=Jp[n.position].call(this,r,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const e=this._size=nf(this,n),a=Object.assign({},t,e),s=of(this.chart,n,a),l=af(n,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,r){const i=this.getCaretPosition(t,n,r);e.lineTo(i.x1,i.y1),e.lineTo(i.x2,i.y2),e.lineTo(i.x3,i.y3)}getCaretPosition(t,e,n){const{xAlign:r,yAlign:i}=this,{caretSize:o,cornerRadius:a}=n,{topLeft:s,topRight:l,bottomLeft:c,bottomRight:u}=Xc(a),{x:d,y:h}=t,{width:p,height:f}=e;let m,g,v,y,b,_;return"center"===i?(b=h+f/2,"left"===r?(m=d,g=m-o,y=b+o,_=b-o):(m=d+p,g=m+o,y=b-o,_=b+o),v=m):(g="left"===r?d+Math.max(s,c)+o:"right"===r?d+p-Math.max(l,u)-o:this.caretX,"top"===i?(y=h,b=y-o,m=g-o,v=g+o):(y=h+f,b=y+o,m=g+o,v=g-o),_=y),{x1:m,x2:g,x3:v,y1:y,y2:b,y3:_}}drawTitle(t,e,n){const r=this.title,i=r.length;let o,a,s;if(i){const l=Au(n.rtl,this.x,this.width);for(t.x=sf(this,n.titleAlign,n),e.textAlign=l.textAlign(n.titleAlign),e.textBaseline="middle",o=Uc(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=o.string,s=0;s<i;++s)e.fillText(r[s],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,s+1===i&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,r,i){const o=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:s,boxWidth:l}=i,c=Uc(i.bodyFont),u=sf(this,"left",i),d=r.x(u),h=s<c.lineHeight?(c.lineHeight-s)/2:0,p=e.y+h;if(i.usePointStyle){const e={radius:Math.min(l,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},n=r.leftForLtr(d,l)+l/2,c=p+s/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,Pc(t,e,n,c),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Pc(t,e,n,c)}else{t.lineWidth=il(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=r.leftForLtr(d,l),n=r.leftForLtr(r.xPlus(d,1),l-2),a=Xc(o.borderRadius);Object.values(a).some((t=>0!==t))?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Fc(t,{x:e,y:p,w:l,h:s,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Fc(t,{x:n,y:p+1,w:l-2,h:s-2,radius:a}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(e,p,l,s),t.strokeRect(e,p,l,s),t.fillStyle=o.backgroundColor,t.fillRect(n,p+1,l-2,s-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:r}=this,{bodySpacing:i,bodyAlign:o,displayColors:a,boxHeight:s,boxWidth:l,boxPadding:c}=n,u=Uc(n.bodyFont);let d=u.lineHeight,h=0;const p=Au(n.rtl,this.x,this.width),f=function(n){e.fillText(n,p.x(t.x+h),t.y+d/2),t.y+=d+i},m=p.textAlign(o);let g,v,y,b,_,x,w;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=sf(this,m,n),e.fillStyle=n.bodyColor,ul(this.beforeBody,f),h=a&&"right"!==m?"center"===o?l/2+c:l+2+c:0,b=0,x=r.length;b<x;++b){for(g=r[b],v=this.labelTextColors[b],e.fillStyle=v,ul(g.before,f),y=g.lines,a&&y.length&&(this._drawColorBox(e,t,b,p,n),d=Math.max(u.lineHeight,s)),_=0,w=y.length;_<w;++_)f(y[_]),d=u.lineHeight;ul(g.after,f)}h=0,d=u.lineHeight,ul(this.afterBody,f),t.y-=i}drawFooter(t,e,n){const r=this.footer,i=r.length;let o,a;if(i){const s=Au(n.rtl,this.x,this.width);for(t.x=sf(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=s.textAlign(n.footerAlign),e.textBaseline="middle",o=Uc(n.footerFont),e.fillStyle=n.footerColor,e.font=o.string,a=0;a<i;++a)e.fillText(r[a],s.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+n.footerSpacing}}drawBackground(t,e,n,r){const{xAlign:i,yAlign:o}=this,{x:a,y:s}=t,{width:l,height:c}=n,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=Xc(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(a+u,s),"top"===o&&this.drawCaret(t,e,n,r),e.lineTo(a+l-d,s),e.quadraticCurveTo(a+l,s,a+l,s+d),"center"===o&&"right"===i&&this.drawCaret(t,e,n,r),e.lineTo(a+l,s+c-p),e.quadraticCurveTo(a+l,s+c,a+l-p,s+c),"bottom"===o&&this.drawCaret(t,e,n,r),e.lineTo(a+h,s+c),e.quadraticCurveTo(a,s+c,a,s+c-h),"center"===o&&"left"===i&&this.drawCaret(t,e,n,r),e.lineTo(a,s+u),e.quadraticCurveTo(a,s,a+u,s),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){const n=Jp[t.position].call(this,this._active,this._eventPosition);if(!n)return;const o=this._size=nf(this,t),a=Object.assign({},n,this._size),s=of(e,t,a),l=af(t,a,s,e);r._to===l.x&&i._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=qc(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(i,t,r,e),Lu(t,e.textDirection),i.y+=o.top,this.drawTitle(i,t,e),this.drawBody(i,t,e),this.drawFooter(i,t,e),Iu(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,r=t.map((({datasetIndex:t,index:e})=>{const n=this.chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}})),i=!dl(n,r),o=this._positionChanged(r,e);(i||o)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,i=this._active||[],o=this._getActiveElements(t,i,e,n),a=this._positionChanged(o,t),s=e||!dl(o,i)||a;return s&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}_getActiveElements(t,e,n,r){const i=this.options;if("mouseout"===t.type)return[];if(!r)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const o=this.chart.getElementsAtEventForMode(t,i.mode,i,n);return i.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:n,caretY:r,options:i}=this,o=Jp[i.position].call(this,t,e);return!1!==o&&(n!==o.x||r!==o.y)}}var pf={id:"tooltip",_element:hf,positioners:Jp,afterInit(t,e,n){n&&(t.tooltip=new hf({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:uf},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ff=Object.freeze({__proto__:null,Colors:Sp,Decimation:Ep,Filler:Wp,Legend:qp,SubTitle:Kp,Title:Zp,Tooltip:pf});function mf(t,e,n,r){const i=t.indexOf(e);if(-1===i)return((t,e,n,r)=>("string"==typeof e?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n))(t,e,n,r);return i!==t.lastIndexOf(e)?n:i}function gf(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class vf extends mh{static id="category";static defaults={ticks:{callback:gf}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:n,label:r}of e)t[n]===r&&t.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(nl(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:Xl(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:mf(n,t,sl(e,t),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:r}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(n=0),e||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,r=[];let i=this.getLabels();i=0===t&&e===i.length-1?i:i.slice(t,e+1),this._valueRange=Math.max(i.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=t;n<=e;n++)r.push({value:n});return r}getLabelForValue(t){return gf.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function yf(t,e){const n=[],{bounds:r,step:i,min:o,max:a,precision:s,count:l,maxTicks:c,maxDigits:u,includeBounds:d}=t,h=i||1,p=c-1,{min:f,max:m}=e,g=!nl(o),v=!nl(a),y=!nl(l),b=(m-f)/(u+1);let _,x,w,S,k=Il((m-f)/p/h)*h;if(k<1e-14&&!g&&!v)return[{value:f},{value:m}];S=Math.ceil(m/k)-Math.floor(f/k),S>p&&(k=Il(S*k/p/h)*h),nl(s)||(_=Math.pow(10,s),k=Math.ceil(k*_)/_),"ticks"===r?(x=Math.floor(f/k)*k,w=Math.ceil(m/k)*k):(x=f,w=m),g&&v&&i&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((a-o)/i,k/1e3)?(S=Math.round(Math.min((a-o)/k,c)),k=(a-o)/S,x=o,w=a):y?(x=g?o:x,w=v?a:w,S=l-1,k=(w-x)/S):(S=(w-x)/k,S=Ll(S,Math.round(S),k/1e3)?Math.round(S):Math.ceil(S));const C=Math.max(jl(k),jl(x));_=Math.pow(10,nl(s)?C:s),x=Math.round(x*_)/_,w=Math.round(w*_)/_;let E=0;for(g&&(d&&x!==o?(n.push({value:o}),x<o&&E++,Ll(Math.round((x+E*k)*_)/_,o,bf(o,b,t))&&E++):x<o&&E++);E<S;++E){const t=Math.round((x+E*k)*_)/_;if(v&&t>a)break;n.push({value:t})}return v&&d&&w!==a?n.length&&Ll(n[n.length-1].value,a,bf(a,b,t))?n[n.length-1].value=a:n.push({value:a}):v&&w!==a||n.push({value:w}),n}function bf(t,e,{horizontal:n,minRotation:r}){const i=$l(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}class _f extends mh{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 nl(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this;const o=t=>r=e?r:t,a=t=>i=n?i:t;if(t){const t=Al(r),e=Al(i);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(r===i){let e=0===i?1:Math.abs(.05*i);a(i+e),t||o(r-e)}this.min=r,this.max=i}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:n,stepSize:r}=t;return r?(e=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const r=yf({maxTicks:n,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:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&Rl(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const r=(n-e)/Math.max(t.length-1,1)/2;e-=r,n+=r}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return gc(t,this.chart.options.locale,this.options.ticks.format)}}class xf extends _f{static id="linear";static defaults={ticks:{callback:yc.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ol(t)?t:0,this.max=ol(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=$l(this.options.ticks.minRotation),r=(t?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,i.lineHeight/r))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const wf=t=>Math.floor(Dl(t)),Sf=(t,e)=>Math.pow(10,wf(t)+e);function kf(t){return 1===t/Math.pow(10,wf(t))}function Cf(t,e,n){const r=Math.pow(10,n),i=Math.floor(t/r);return Math.ceil(e/r)-i}function Ef(t,{min:e,max:n}){e=al(t.min,e);const r=[],i=wf(e);let o=function(t,e){let n=wf(e-t);for(;Cf(t,e,n)>10;)n++;for(;Cf(t,e,n)<10;)n--;return Math.min(n,wf(t))}(e,n),a=o<0?Math.pow(10,Math.abs(o)):1;const s=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((e-l)*a)/a,u=Math.floor((e-l)/s/10)*s*10;let d=Math.floor((c-u)/Math.pow(10,o)),h=al(t.min,Math.round((l+u+d*Math.pow(10,o))*a)/a);for(;h<n;)r.push({value:h,major:kf(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,a=o>=0?1:a),h=Math.round((l+u+d*Math.pow(10,o))*a)/a;const p=al(t.max,h);return r.push({value:p,major:kf(p),significand:d}),r}class Mf extends mh{static id="logarithmic";static defaults={ticks:{callback:yc.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=_f.prototype.parse.apply(this,[t,e]);if(0!==n)return ol(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ol(t)?Math.max(0,t):null,this.max=ol(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ol(this._userMin)&&(this.min=t===Sf(this.min,0)?Sf(this.min,-1):Sf(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,r=this.max;const i=e=>n=t?n:e,o=t=>r=e?r:t;n===r&&(n<=0?(i(1),o(10)):(i(Sf(n,-1)),o(Sf(r,1)))),n<=0&&i(Sf(r,-1)),r<=0&&o(Sf(n,1)),this.min=n,this.max=r}buildTicks(){const t=this.options,e=Ef({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&Rl(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":gc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Dl(t),this._valueRange=Dl(this.max)-Dl(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Dl(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Of(t){const e=t.ticks;if(e.display&&t.display){const t=qc(e.backdropPadding);return sl(e.font&&e.font.size,kc.font.size)+t.height}return 0}function Pf(t,e,n,r,i){return t===r||t===i?{start:e-n/2,end:e+n/2}:t<r||t>i?{start:e-n,end:e}:{start:e,end:e+n}}function Tf(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),r=[],i=[],o=t._pointLabels.length,a=t.options.pointLabels,s=a.centerPointLabels?kl/o:0;for(let d=0;d<o;d++){const o=a.setContext(t.getPointLabelContext(d));i[d]=o.padding;const h=t.getPointPosition(d,t.drawingArea+i[d],s),p=Uc(o.font),f=(l=t.ctx,c=p,u=rl(u=t._pointLabels[d])?u:[u],{w:Ec(l,c.string,u),h:u.length*c.lineHeight});r[d]=f;const m=Vl(t.getIndexAngle(d)+s),g=Math.round(Fl(m));Nf(n,e,m,Pf(g,h.x,f.w,0,180),Pf(g,h.y,f.h,90,270))}var l,c,u;t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=function(t,e,n){const r=[],i=t._pointLabels.length,o=t.options,{centerPointLabels:a,display:s}=o.pointLabels,l={extra:Of(o)/2,additionalAngle:a?kl/i:0};let c;for(let o=0;o<i;o++){l.padding=n[o],l.size=e[o];const i=Df(t,o,l);r.push(i),"auto"===s&&(i.visible=Af(i,c),i.visible&&(c=i))}return r}(t,r,i)}function Nf(t,e,n,r,i){const o=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let s=0,l=0;r.start<e.l?(s=(e.l-r.start)/o,t.l=Math.min(t.l,e.l-s)):r.end>e.r&&(s=(r.end-e.r)/o,t.r=Math.max(t.r,e.r+s)),i.start<e.t?(l=(e.t-i.start)/a,t.t=Math.min(t.t,e.t-l)):i.end>e.b&&(l=(i.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function Df(t,e,n){const r=t.drawingArea,{extra:i,additionalAngle:o,padding:a,size:s}=n,l=t.getPointPosition(e,r+i+a,o),c=Math.round(Fl(Vl(l.angle+Pl))),u=function(t,e,n){90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e);return t}(l.y,s.h,c),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),h=function(t,e,n){"right"===n?t-=e:"center"===n&&(t-=e/2);return t}(l.x,s.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+s.w,bottom:u+s.h}}function Af(t,e){if(!e)return!0;const{left:n,top:r,right:i,bottom:o}=t;return!(Nc({x:n,y:r},e)||Nc({x:n,y:o},e)||Nc({x:i,y:r},e)||Nc({x:i,y:o},e))}function Lf(t,e,n){const{left:r,top:i,right:o,bottom:a}=n,{backdropColor:s}=e;if(!nl(s)){const n=Xc(e.borderRadius),l=qc(e.backdropPadding);t.fillStyle=s;const c=r-l.left,u=i-l.top,d=o-r+l.width,h=a-i+l.height;Object.values(n).some((t=>0!==t))?(t.beginPath(),Fc(t,{x:c,y:u,w:d,h:h,radius:n}),t.fill()):t.fillRect(c,u,d,h)}}function If(t,e,n,r){const{ctx:i}=t;if(n)i.arc(t.xCenter,t.yCenter,e,0,Cl);else{let n=t.getPointPosition(0,e);i.moveTo(n.x,n.y);for(let o=1;o<r;o++)n=t.getPointPosition(o,e),i.lineTo(n.x,n.y)}}class zf extends _f{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:yc.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=qc(Of(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ol(t)&&!isNaN(t)?t:0,this.max=ol(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Of(this.options))}generateTickLabels(t){_f.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const n=cl(this.options.pointLabels.callback,[t,e],this);return n||0===n?n:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?Tf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,r))}getIndexAngle(t){return Vl(t*(Cl/(this._pointLabels.length||1))+$l(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(nl(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(nl(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return function(t,e,n){return Gc(t,{label:n,index:e,type:"pointLabel"})}(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const r=this.getIndexAngle(t)-Pl+n;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:r,bottom:i}=this._pointLabelItems[t];return{left:e,top:n,right:r,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),If(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:r,border:i}=e,o=this._pointLabels.length;let a,s,l;if(e.pointLabels.display&&function(t,e){const{ctx:n,options:{pointLabels:r}}=t;for(let i=e-1;i>=0;i--){const e=t._pointLabelItems[i];if(!e.visible)continue;const o=r.setContext(t.getPointLabelContext(i));Lf(n,o,e);const a=Uc(o.font),{x:s,y:l,textAlign:c}=e;$c(n,t._pointLabels[i],s,l+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),r.display&&this.ticks.forEach(((t,e)=>{if(0!==e||0===e&&this.min<0){s=this.getDistanceFromCenterForValue(t.value);const n=this.getContext(e),a=r.setContext(n),l=i.setContext(n);!function(t,e,n,r,i){const o=t.ctx,a=e.circular,{color:s,lineWidth:l}=e;!a&&!r||!s||!l||n<0||(o.save(),o.strokeStyle=s,o.lineWidth=l,o.setLineDash(i.dash||[]),o.lineDashOffset=i.dashOffset,o.beginPath(),If(t,n,a,r),o.closePath(),o.stroke(),o.restore())}(this,a,s,o,l)}})),n.display){for(t.save(),a=o-1;a>=0;a--){const r=n.setContext(this.getPointLabelContext(a)),{color:i,lineWidth:o}=r;o&&i&&(t.lineWidth=o,t.strokeStyle=i,t.setLineDash(r.borderDash),t.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(a,s),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const r=this.getIndexAngle(0);let i,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((r,a)=>{if(0===a&&this.min>=0&&!e.reverse)return;const s=n.setContext(this.getContext(a)),l=Uc(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){t.font=l.string,o=t.measureText(r.label).width,t.fillStyle=s.backdropColor;const e=qc(s.backdropPadding);t.fillRect(-o/2-e.left,-i-l.size/2-e.top,o+e.width,l.size+e.height)}$c(t,r.label,0,-i,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})})),t.restore()}drawTitle(){}}const Rf={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}},$f=Object.keys(Rf);function Ff(t,e){return t-e}function jf(t,e){if(nl(e))return null;const n=t._adapter,{parser:r,round:i,isoWeekday:o}=t._parseOpts;let a=e;return"function"==typeof r&&(a=r(a)),ol(a)||(a="string"==typeof r?n.parse(a,r):n.parse(a)),null===a?null:(i&&(a="week"!==i||!zl(o)&&!0!==o?n.startOf(a,i):n.startOf(a,"isoWeek",o)),+a)}function Bf(t,e,n,r){const i=$f.length;for(let o=$f.indexOf(t);o<i-1;++o){const t=Rf[$f[o]],i=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((n-e)/(i*t.size))<=r)return $f[o]}return $f[i-1]}function Hf(t,e,n){if(n){if(n.length){const{lo:r,hi:i}=Ul(n,e);t[n[r]>=e?n[r]:n[i]]=!0}}else t[e]=!0}function Wf(t,e,n){const r=[],i={},o=e.length;let a,s;for(a=0;a<o;++a)s=e[a],i[s]=a,r.push({value:s,major:!1});return 0!==o&&n?function(t,e,n,r){const i=t._adapter,o=+i.startOf(e[0].value,r),a=e[e.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,r))l=n[s],l>=0&&(e[l].major=!0);return e}(t,r,i,n):r}class Vf extends mh{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const n=t.time||(t.time={}),r=this._adapter=new xd._date(t.adapters.date);r.init(e),gl(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:jf(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:r,max:i,minDefined:o,maxDefined:a}=this.getUserBounds();function s(t){o||isNaN(t.min)||(r=Math.min(r,t.min)),a||isNaN(t.max)||(i=Math.max(i,t.max))}o&&a||(s(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||s(this.getMinMax(!1))),r=ol(r)&&!isNaN(r)?r:+e.startOf(Date.now(),n),i=ol(i)&&!isNaN(i)?i:+e.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,r="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const i=this.min,o=function(t,e,n){let r=0,i=t.length;for(;r<i&&t[r]<e;)r++;for(;i>r&&t[i-1]>n;)i--;return r>0||i<t.length?t.slice(r,i):t}(r,i,this.max);return this._unit=e.unit||(n.autoSkip?Bf(e.minUnit,this.min,this.max,this._getLabelCapacity(i)):function(t,e,n,r,i){for(let o=$f.length-1;o>=$f.indexOf(n);o--){const n=$f[o];if(Rf[n].common&&t._adapter.diff(i,r,n)>=e-1)return n}return $f[n?$f.indexOf(n):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(t){for(let e=$f.indexOf(t)+1,n=$f.length;e<n;++e)if(Rf[$f[e]].common)return $f[e]}(this._unit):void 0,this.initOffsets(r),t.reverse&&o.reverse(),Wf(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t=[]){let e,n,r=0,i=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),r=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,n=this.getDecimalForValue(t[t.length-1]),i=1===t.length?n:(n-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;r=Xl(r,0,o),i=Xl(i,0,o),this._offsets={start:r,end:i,factor:1/(r+1+i)}}_generate(){const t=this._adapter,e=this.min,n=this.max,r=this.options,i=r.time,o=i.unit||Bf(i.minUnit,e,n,this._getLabelCapacity(e)),a=sl(r.ticks.stepSize,1),s="week"===o&&i.isoWeekday,l=zl(s)||!0===s,c={};let u,d,h=e;if(l&&(h=+t.startOf(h,"isoWeek",s)),h=+t.startOf(h,l?"day":o),t.diff(n,e,o)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+o);const p="data"===r.ticks.source&&this.getDataTimestamps();for(u=h,d=0;u<n;u=+t.add(u,a,o),d++)Hf(c,u,p);return u!==n&&"ticks"!==r.bounds&&1!==d||Hf(c,u,p),Object.keys(c).sort(Ff).map((t=>+t))}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,r=this._unit,i=e||n[r];return this._adapter.format(t,i)}_tickFormatFunction(t,e,n,r){const i=this.options,o=i.ticks.callback;if(o)return cl(o,[t,e,n],this);const a=i.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],u=l&&a[l],d=n[e],h=l&&u&&d&&d.major;return this._adapter.format(t,r||(h?u:c))}generateTickLabels(t){let e,n,r;for(e=0,n=t.length;e<n;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,r=$l(this.isHorizontal()?e.maxRotation:e.minRotation),i=Math.cos(r),o=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:n*i+a*o,h:n*o+a*i}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,r=n[e.unit]||n.millisecond,i=this._tickFormatFunction(t,0,Wf(this,[t],this._majorUnit),r),o=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,n=this._cache.data||[];if(n.length)return n;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,e=r.length;t<e;++t)n=n.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const r=this.getLabels();for(e=0,n=r.length;e<n;++e)t.push(jf(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ql(t.sort(Ff))}}function Yf(t,e,n){let r,i,o,a,s=0,l=t.length-1;n?(e>=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=Zl(t,"pos",e)),({pos:r,time:o}=t[s]),({pos:i,time:a}=t[l])):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=Zl(t,"time",e)),({time:r,pos:o}=t[s]),({time:i,pos:a}=t[l]));const c=i-r;return c?o+(a-o)*(e-r)/c:o}var Xf=Object.freeze({__proto__:null,CategoryScale:vf,LinearScale:xf,LogarithmicScale:Mf,RadialLinearScale:zf,TimeScale:Vf,TimeSeriesScale:class extends Vf{static id="timeseries";static defaults=Vf.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Yf(e,this.min),this._tableRange=Yf(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,r=[],i=[];let o,a,s,l,c;for(o=0,a=t.length;o<a;++o)l=t[o],l>=e&&l<=n&&r.push(l);if(r.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(o=0,a=r.length;o<a;++o)c=r[o+1],s=r[o-1],l=r[o],Math.round((c+s)/2)!==l&&i.push({time:l,pos:o/(a-1)});return i}_generate(){const t=this.min,e=this.max;let n=super.getDataTimestamps();return n.includes(t)&&n.length||n.splice(0,0,t),n.includes(e)&&1!==n.length||n.push(e),n.sort(((t,e)=>t-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return t=e.length&&n.length?this.normalize(e.concat(n)):e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Yf(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return Yf(this._table,n*this._tableRange+this._minPos,!0)}}});const qf=[yd,gp,ff,Xf];qh.register(...qf);const Uf=({type:e,data:n,options:r,className:i,style:o,plugins:a})=>{const c=s(null),u=s(null);return l((()=>{if(!c.current)return;const t=c.current.getContext("2d");return t?(u.current&&u.current.destroy(),u.current=new qh(t,{type:e,data:n,options:r||{},plugins:a||[]}),()=>{u.current&&(u.current.destroy(),u.current=null)}):void 0}),[e,n,r,a]),t("canvas",{ref:c,className:i,style:o})};var Zf="Checkbox-module_container__v4ouY",Gf="Checkbox-module_disabled__PAavY",Kf="Checkbox-module_checkbox__tiPi8",Jf="Checkbox-module_indeterminate__GxPm3";var Qf=a((({checked:n=!1,disabled:r=!1,label:i,indeterminate:o=!1,labelProps:a,onChange:c,id:u,...d})=>{const h=s(null),p=s(null),m=f();l((()=>{h.current&&(h.current.indeterminate=o)}),[o]),l((()=>{if(!n||o)return;const t=p.current;if(!t)return;t.style.transform="translateZ(0)";const e=requestAnimationFrame((()=>{t.style.transform=""}));return()=>{cancelAnimationFrame(e),t&&(t.style.transform="")}}),[n,o]);return t(H,{...d,onClick:t=>{r||c?.(t)},dimensionY:36,className:`${d.className} ${Zf} ${r&&Gf}`,prefix:{children:e("div",{className:`${Kf} ${o&&Jf}`,children:[t("input",{id:u??m,ref:h,type:"checkbox",checked:n,disabled:r,"aria-checked":o?"mixed":n,readOnly:!0}),t("label",{ref:p,htmlFor:u??m,onClick:t=>t.stopPropagation()})]}),...d.prefix},root:{children:t(V,{...a,children:i}),...d.root}})})),tm={chip:"Chip-module_chip__DLgqh",outlined:"Chip-module_outlined__1seXI",filled:"Chip-module_filled__iKdFt",noButton:"Chip-module_noButton__nEh--",closeButton:"Chip-module_closeButton__83TVb"};var em=a((({label:e,variant:n="filled",icon:r,onDelete:i,suffixIcon:o,suffixOnClick:a,...s})=>t(H,{dimensionX:"hug",gap:8,prefix:{dimensionX:"hug",children:r?t(Za,{name:r}):void 0,...s.prefix},root:{children:e,...s.root},suffix:(o||i)&&{dimensionX:"hug",alignment:"center",children:t(_s,{className:tm.closeButton,shape:"circle",color:"transparent",onClick:o?a:i,children:t(Za,{name:o||"close"})}),...s.suffix},...s,className:`${s.className} ${tm.chip} ${tm[n]} ${i||o?"":tm.noButton}`}))),nm="Color-module_color__icl6l";var rm=a((({value:e="#000000",prefixProps:n,rootProps:r,onChange:i,...o})=>t(H,{dimensionY:36,prefix:{children:t("input",{type:"color",value:e,onChange:t=>{i?.(t.target.value)}}),...n},root:{children:e&&t(V,{children:e}),...r},...o,className:`${o?.className} ${nm}`}))),im={container:"DashboardItem-module_container__Cu2fp",settingButton:"DashboardItem-module_settingButton__EVb24",header:"DashboardItem-module_header__1Ltls",chartContainer:"DashboardItem-module_chartContainer__xibFh",chart:"DashboardItem-module_chart__a5kGE"},om="Section-module_sectionContainer__qECl2",am="Section-module_header__1oDhY",sm="Section-module_content__3PfOv",lm="Section-module_footer__KPdum";const cm=a((({children:e,...n})=>t(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${am} ${n.className}`,children:e}))),um=a((({children:e,...n})=>t(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${sm} ${n.className}`,children:e}))),dm=a((({children:e,...n})=>t(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${lm} ${n.className}`,children:e}))),hm=a((({children:e,...n})=>t(B,{dimensionX:"fill",dimensionY:"fill",direction:"vertical",gap:0,...n,className:`${n.className} ${om}`,children:e})));hm.Header=cm,hm.Content=um,hm.Footer=dm;const pm=({headerProps:n,chartProps:r})=>e(hm,{className:im.dashboardItem,children:[e(hm.Header,{children:[t(V,{children:n?.content}),n?.suffix||t(_s,{color:"transparent",shape:"circle",className:im.settingButton,children:t(Za,{name:"cog",className:im.settingIcon,size:"xs"})})]}),t(hm.Content,{children:t(Uf,{type:r?.type,data:r?.data,options:r?.options,className:im.chart})})]});var fm,mm={exports:{}};
|
|
50
50
|
/*!
|
|
51
51
|
Copyright (c) 2018 Jed Watson.
|
|
52
52
|
Licensed under the MIT License (MIT), see
|
|
@@ -96,5 +96,5 @@ const GR=t=>t&&t.enabled&&t.modifierKey,KR=(t,e)=>t&&e[t+"Key"],JR=(t,e)=>t&&!e[
|
|
|
96
96
|
* @author Lea Verou <https://lea.verou.me>
|
|
97
97
|
* @namespace
|
|
98
98
|
* @public
|
|
99
|
-
*/t.exports&&(t.exports=e),void 0!==vt&&(vt.Prism=e),e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",(function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))})),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var o={};o[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return t})),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(e),e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript,function(){if(void 0!==e&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var t={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},n="data-src-status",r="loading",i="loaded",o="pre[data-src]:not(["+n+'="'+i+'"]):not(['+n+'="'+r+'"])';e.hooks.add("before-highlightall",(function(t){t.selector+=", "+o})),e.hooks.add("before-sanity-check",(function(a){var s=a.element;if(s.matches(o)){a.code="",s.setAttribute(n,r);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=s.getAttribute("data-src"),u=a.language;if("none"===u){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=t[d]||d}e.util.setLanguage(l,u),e.util.setLanguage(s,u);var h=e.plugins.autoloader;h&&h.loadLanguages(u),function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?e(r.responseText):r.status>=400?n(function(t,e){return"✖ Error "+t+" while fetching file: "+e}(r.status,r.statusText)):n("✖ Error: File does not exist or is empty"))},r.send(null)}(c,(function(t){s.setAttribute(n,i);var r=function(t){var e=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(t||"");if(e){var n=Number(e[1]),r=e[2],i=e[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(s.getAttribute("data-range"));if(r){var o=t.split(/\r\n?|\n/g),a=r[0],c=null==r[1]?o.length:r[1];a<0&&(a+=o.length),a=Math.max(0,Math.min(a-1,o.length)),c<0&&(c+=o.length),c=Math.max(0,Math.min(c,o.length)),t=o.slice(a,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(a+1))}l.textContent=t,e.highlightElement(l)}),(function(t){s.setAttribute(n,"failed"),l.textContent=t}))}})),e.plugins.fileHighlight={highlight:function(t){for(var n,r=(t||document).querySelectorAll(o),i=0;n=r[i++];)e.highlightElement(n)}};var a=!1;e.fileHighlight=function(){a||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),a=!0),e.plugins.fileHighlight.highlight.apply(this,arguments)}}}()}(UQ)),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,e){var n={};n["language-"+e]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[e]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return t})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(t,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(t){return t=t.replace(/<inner>/g,(function(){return e})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+t+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(e){["url","bold","italic","strike","code-snippet"].forEach((function(n){e!==n&&(t.languages.markdown[e].inside.content.inside[n]=t.languages.markdown[n])}))})),t.hooks.add("after-tokenize",(function(t){"markdown"!==t.language&&"md"!==t.language||function t(e){if(e&&"string"!=typeof e)for(var n=0,r=e.length;n<r;n++){var i=e[n];if("code"===i.type){var o=i.content[1],a=i.content[3];if(o&&a&&"code-language"===o.type&&"code-block"===a.type&&"string"==typeof o.content){var s=o.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(s=(/[a-z][\w-]*/i.exec(s)||[""])[0].toLowerCase());a.alias?"string"==typeof a.alias?a.alias=[a.alias,l]:a.alias.push(l):a.alias=[l]}}else t(i.content)}}(t.tokens)})),t.hooks.add("wrap",(function(e){if("code-block"===e.type){for(var n="",r=0,i=e.classes.length;r<i;r++){var o=e.classes[r],c=/language-(.+)/.exec(o);if(c){n=c[1];break}}var u,d,h=t.languages[n];if(h)e.content=t.highlight((u=e.content,d=(d=u.replace(a,"")).replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(t,e){var n;if("#"===(e=e.toLowerCase())[0])return n="x"===e[1]?parseInt(e.slice(2),16):Number(e.slice(1)),l(n);var r=s[e];return r||t})),d),h,n);else if(n&&"none"!==n&&t.plugins.autoloader){var p="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());e.attributes.id=p,t.plugins.autoloader.loadLanguages(n,(function(){var e=document.getElementById(p);e&&(e.innerHTML=t.highlight(e.textContent,t.languages[n],n))}))}}}));var a=RegExp(t.languages.markup.tag.pattern.source,"gi"),s={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;t.languages.md=t.languages.markdown}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(t){var e=t.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}}(Prism);var ZQ;ZQ||(ZQ=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python);var GQ;GQ||(GQ=1,function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,(function(){return e}));e=e.replace(/<self>/g,(function(){return/[^\s\S]/.source})),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string}(Prism)),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(t){t.inside.interpolation.inside=Prism.languages.swift}));var KQ;KQ||(KQ=1,function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),t.languages.ts=t.languages.typescript}(Prism));var JQ;JQ||(JQ=1,function(t){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return e.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism));var QQ;QQ||(QQ=1,function(t){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return e.source}));t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return e.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}(Prism)),function(t){t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")&&t.default}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const t0=globalThis.Prism||window.Prism,e0=t=>{try{return!!t&&t0.languages.hasOwnProperty(t)}catch(t){return!1}};function n0(t,e){for(const n of t.childNodes){if(uG(n)&&n.tagName===e)return!0;n0(n,e)}return!1}const r0="data-language",i0="data-highlight-language";class o0 extends tQ{static getType(){return"code"}static clone(t){return new o0(t.__language,t.__key)}constructor(t,e){super(e),this.__language=t||void 0,this.__isSyntaxHighlightSupported=e0(t)}createDOM(t){const e=document.createElement("code");HQ(e,t.theme.code),e.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(e.setAttribute(r0,n),this.getIsSyntaxHighlightSupported()&&e.setAttribute(i0,n)),e}updateDOM(t,e,n){const r=this.__language,i=t.__language;return r?r!==i&&(e.setAttribute(r0,r),this.__isSyntaxHighlightSupported&&e.setAttribute(i0,r)):i&&(e.removeAttribute(r0),t.__isSyntaxHighlightSupported&&e.removeAttribute(i0)),!1}exportDOM(t){const e=document.createElement("pre");HQ(e,t._config.theme.code),e.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(e.setAttribute(r0,n),this.getIsSyntaxHighlightSupported()&&e.setAttribute(i0,n)),{element:e}}static importDOM(){return{code:t=>null!=t.textContent&&(/\r?\n/.test(t.textContent)||n0(t,"BR"))?{conversion:s0,priority:1}:null,div:()=>({conversion:l0,priority:1}),pre:()=>({conversion:s0,priority:0}),table:t=>h0(t)?{conversion:c0,priority:3}:null,td:t=>{const e=t,n=e.closest("table");return e.classList.contains("js-file-line")||n&&h0(n)?{conversion:u0,priority:3}:null},tr:t=>{const e=t.closest("table");return e&&h0(e)?{conversion:u0,priority:3}:null}}}static importJSON(t){return a0().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage()}}insertNewAfter(t,e=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const t=fQ();return this.insertAfter(t,e),t}const{anchor:i,focus:o}=t,a=(i.isBefore(o)?i:o).getNode();if(ZK(a)){let t=function(t){let e=t,n=t;for(;g0(n)||QK(n);)e=n,n=n.getPreviousSibling();return e}(a);const e=[];for(;;)if(QK(t))e.push(JK()),t=t.getNextSibling();else{if(!g0(t))break;{let n=0;const r=t.getTextContent(),i=t.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&e.push(m0(" ".repeat(n))),n!==i)break;t=t.getNextSibling()}}const n=a.splitText(i.offset)[0],r=0===i.offset?0:1,o=n.getIndexWithinParent()+r,s=a.getParentOrThrow(),l=[TK(),...e];s.splice(o,0,l);const c=e[e.length-1];c?c.select():0===i.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(function(t){return t instanceof o0}(a)){const{offset:e}=t.anchor;a.splice(e,0,[TK()]),a.select(e+1,e+1)}return null}canIndent(){return!1}collapseAtStart(){const t=fQ();return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}setLanguage(t){const e=this.getWritable();return e.__language=t||void 0,e.__isSyntaxHighlightSupported=e0(t),e}getLanguage(){return this.getLatest().__language}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}}function a0(t){return iG(new o0(t))}function s0(t){return{node:a0(t.getAttribute(r0))}}function l0(t){const e=t,n=d0(e);return n||function(t){let e=t.parentElement;for(;null!==e;){if(d0(e))return!0;e=e.parentElement}return!1}(e)?{node:n?a0():null}:{node:null}}function c0(){return{node:a0()}}function u0(){return{node:null}}function d0(t){return null!==t.style.fontFamily.match("monospace")}function h0(t){return t.classList.contains("js-file-line-container")}class p0 extends FK{constructor(t="",e,n){super(t,n),this.__highlightType=e}static getType(){return"code-highlight"}static clone(t){return new p0(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const e=this.getWritable();return e.__highlightType=t||void 0,e}canHaveFormat(){return!1}createDOM(t){const e=super.createDOM(t);return HQ(e,f0(t.theme,this.__highlightType)),e}updateDOM(t,e,n){const r=super.updateDOM(t,e,n),i=f0(n.theme,t.__highlightType),o=f0(n.theme,this.__highlightType);return i!==o&&(i&&WQ(e,i),o&&HQ(e,o)),r}static importJSON(t){return m0().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return a0()}}function f0(t,e){return e&&t&&t.codeHighlight&&t.codeHighlight[e]}function m0(t="",e){return iG(new p0(t,e))}function g0(t){return t instanceof p0}var v0=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function y0(t){return N0(t)&&$0(t.getFirstChild())}function b0(t){return T0().append(t)}function _0(t,e){t.splice(t.getChildrenSize(),0,e)}function x0(t,e){const n=t.getLastChild(),r=e.getFirstChild();n&&r&&y0(n)&&y0(r)&&(x0(n.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&t.append(...i),e.remove()}function w0(t){const e=new Set;if(y0(t)||e.has(t.getKey()))return;const n=t.getParent(),r=t.getNextSibling(),i=t.getPreviousSibling();if(y0(r)&&y0(i)){const n=i.getFirstChild();if($0(n)){n.append(t);const i=r.getFirstChild();$0(i)&&(_0(n,i.getChildren()),r.remove(),e.add(r.getKey()))}}else if(y0(r)){const e=r.getFirstChild();if($0(e)){const n=e.getFirstChild();null!==n&&n.insertBefore(t)}}else if(y0(i)){const e=i.getFirstChild();$0(e)&&e.append(t)}else if($0(n)){const e=T0(),o=R0(n.getListType());e.append(o),o.append(t),i?i.insertAfter(e):r?r.insertBefore(e):n.append(e)}}function S0(t){if(y0(t))return;const e=t.getParent(),n=e?e.getParent():void 0;if($0(n?n.getParent():void 0)&&N0(n)&&$0(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(t.is(r))n.insertBefore(t),e.isEmpty()&&n.remove();else if(t.is(i))n.insertAfter(t),e.isEmpty()&&n.remove();else{const r=e.getListType(),i=T0(),o=R0(r);i.append(o),t.getPreviousSiblings().forEach((t=>o.append(t)));const a=T0(),s=R0(r);a.append(s),_0(s,t.getNextSiblings()),n.insertBefore(i),n.insertAfter(a),n.replace(t)}}}function k0(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}class C0 extends tQ{static getType(){return"listitem"}static clone(t){return new C0(t.__value,t.__checked,t.__key)}constructor(t,e,n){super(n),this.__value=void 0===t?1:t,this.__checked=e}createDOM(t){const e=document.createElement("li"),n=this.getParent();return $0(n)&&"check"===n.getListType()&&M0(e,this,null),e.value=this.__value,E0(e,t.theme,this),e}updateDOM(t,e,n){const r=this.getParent();return $0(r)&&"check"===r.getListType()&&M0(e,this,t),e.value=this.__value,E0(e,n.theme,this),!1}static transform(){return t=>{if(N0(t)||v0(144),null==t.__checked)return;const e=t.getParent();$0(e)&&"check"!==e.getListType()&&null!=t.getChecked()&&t.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:O0,priority:0})}}static importJSON(t){return T0().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const e=this.createDOM(t._config);return e.style.textAlign=this.getFormatType(),{element:e}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let e=0;e<t.length;e++){const n=t[e];if(eQ(n)&&this.canMergeWith(n)){const t=n.getChildren();this.append(...t),n.remove()}else super.append(n)}return this}replace(t,e){if(N0(t))return super.replace(t);this.setIndent(0);const n=this.getParentOrThrow();if(!$0(n))return t;if(n.__first===this.getKey())n.insertBefore(t);else if(n.__last===this.getKey())n.insertAfter(t);else{const e=R0(n.getListType());let r=this.getNextSibling();for(;r;){const t=r;r=r.getNextSibling(),e.append(t)}n.insertAfter(t),t.insertAfter(e)}return e&&(eQ(t)||v0(139),this.getChildren().forEach((e=>{t.append(e)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),t}insertAfter(t,e=!0){const n=this.getParentOrThrow();if($0(n)||v0(39),N0(t))return super.insertAfter(t,e);const r=this.getNextSiblings();if(n.insertAfter(t,e),0!==r.length){const i=R0(n.getListType());r.forEach((t=>i.append(t))),t.insertAfter(i,e)}return t}remove(t){const e=this.getPreviousSibling(),n=this.getNextSibling();super.remove(t),e&&n&&y0(e)&&y0(n)&&(x0(e.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(t,e=!0){const n=T0().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,e),n}collapseAtStart(t){const e=fQ();this.getChildren().forEach((t=>e.append(t)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=N0(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(e),n.remove();const r=t.anchor,i=t.focus,o=e.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(o,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(o,i.offset,"element")}else n.insertBefore(e),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const e=this.getWritable();return e.__value=t,e}getChecked(){const t=this.getLatest();let e;const n=this.getParent();return $0(n)&&(e=n.getListType()),"check"===e?Boolean(t.__checked):void 0}setChecked(t){const e=this.getWritable();return e.__checked=t,e}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(null===t)return this.getLatest().__indent;let e=t.getParentOrThrow(),n=0;for(;N0(e);)e=e.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(t){"number"!=typeof t&&v0(117),(t=Math.floor(t))>=0||v0(199);let e=this.getIndent();for(;e!==t;)e<t?(w0(this),e++):(S0(this),e--);return this}canInsertAfter(t){return N0(t)}canReplaceWith(t){return N0(t)}canMergeWith(t){return N0(t)||mQ(t)}extractWithChild(t,e){if(!aJ(e))return!1;const n=e.anchor.getNode(),r=e.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===e.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return R0("bullet")}canMergeWhenEmpty(){return!0}}function E0(t,e,n){const r=[],i=[],o=e.list,a=o?o.listitem:void 0;let s;if(o&&o.nested&&(s=o.nested.listitem),void 0!==a&&r.push(...k0(a)),o){const t=n.getParent(),e=$0(t)&&"check"===t.getListType(),a=n.getChecked();e&&!a||i.push(o.listitemUnchecked),e&&a||i.push(o.listitemChecked),e&&r.push(a?o.listitemChecked:o.listitemUnchecked)}if(void 0!==s){const t=k0(s);n.getChildren().some((t=>$0(t)))?r.push(...t):i.push(...t)}i.length>0&&WQ(t,...i),r.length>0&&HQ(t,...r)}function M0(t,e,n,r){$0(e.getFirstChild())?(t.removeAttribute("role"),t.removeAttribute("tabIndex"),t.removeAttribute("aria-checked")):(t.setAttribute("role","checkbox"),t.setAttribute("tabIndex","-1"),n&&e.__checked===n.__checked||t.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function O0(t){if(t.classList.contains("task-list-item"))for(const e of t.children)if("INPUT"===e.tagName)return P0(e);const e=t.getAttribute("aria-checked");return{node:T0("true"===e||"false"!==e&&void 0)}}function P0(t){return"checkbox"!==t.getAttribute("type")?{node:null}:{node:T0(t.hasAttribute("checked"))}}function T0(t){return iG(new C0(void 0,t))}function N0(t){return t instanceof C0}class D0 extends tQ{static getType(){return"list"}static clone(t){const e=t.__listType||z0[t.__tag];return new D0(e,t.__start,t.__key)}constructor(t="number",e=1,n){super(n);const r=z0[t]||t;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=e}getTag(){return this.__tag}setListType(t){const e=this.getWritable();return e.__listType=t,e.__tag="number"===t?"ol":"ul",e}getListType(){return this.__listType}getStart(){return this.__start}setStart(t){const e=this.getWritable();return e.__start=t,e}createDOM(t,e){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,A0(r,t.theme,this),r}updateDOM(t,e,n){return t.__tag!==this.__tag||(A0(e,n.theme,this),!1)}static transform(){return t=>{$0(t)||v0(163),function(t){const e=t.getNextSibling();$0(e)&&t.getListType()===e.getListType()&&x0(t,e)}(t),function(t){const e="check"!==t.getListType();let n=t.getStart();for(const r of t.getChildren())N0(r)&&(r.getValue()!==n&&r.setValue(n),e&&null!=r.getLatest().__checked&&r.setChecked(void 0),$0(r.getFirstChild())||n++)}(t)}}static importDOM(){return{ol:()=>({conversion:I0,priority:0}),ul:()=>({conversion:I0,priority:0})}}static importJSON(t){return R0().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const e=this.createDOM(t._config,t);return uG(e)&&(1!==this.__start&&e.setAttribute("start",String(this.__start)),"check"===this.__listType&&e.setAttribute("__lexicalListType","check")),{element:e}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}append(...t){for(let e=0;e<t.length;e++){const n=t[e];if(N0(n))super.append(n);else{const t=T0();if($0(n))t.append(n);else if(eQ(n))if(n.isInline())t.append(n);else{const e=UK(n.getTextContent());t.append(e)}else t.append(n);super.append(t)}}return this}extractWithChild(t){return N0(t)}}function A0(t,e,n){const r=[],i=[],o=e.list;if(void 0!==o){const t=o[`${n.__tag}Depth`]||[],e=function(t){let e=1,n=t.getParent();for(;null!=n;){if(N0(n)){const t=n.getParent();if($0(t)){e++,n=t.getParent();continue}v0(40)}return e}return e}(n)-1,a=e%t.length,s=t[a],l=o[n.__tag];let c;const u=o.nested,d=o.checklist;if(void 0!==u&&u.list&&(c=u.list),void 0!==l&&r.push(l),void 0!==d&&"check"===n.__listType&&r.push(d),void 0!==s){r.push(...k0(s));for(let e=0;e<t.length;e++)e!==a&&i.push(n.__tag+e)}if(void 0!==c){const t=k0(c);e>1?r.push(...t):i.push(...t)}}i.length>0&&WQ(t,...i),r.length>0&&HQ(t,...r)}function L0(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(N0(r)){e.push(r);const t=r.getChildren();t.length>1&&t.forEach((t=>{$0(t)&&e.push(b0(t))}))}else e.push(b0(r))}return e}function I0(t){const e=t.nodeName.toLowerCase();let n=null;return"ol"===e?n=R0("number",t.start):"ul"===e&&(n=function(t){if("check"===t.getAttribute("__lexicallisttype")||t.classList.contains("contains-task-list"))return!0;for(const e of t.childNodes)if(uG(e)&&e.hasAttribute("aria-checked"))return!0;return!1}(t)?R0("check"):R0("bullet")),{after:L0,node:n}}const z0={ol:"number",ul:"bullet"};function R0(t="number",e=1){return iG(new D0(t,e))}function $0(t){return t instanceof D0}const F0={},j0={};function B0(t,e){const n=e.body?e.body.childNodes:[];let r=[];const i=[];for(let e=0;e<n.length;e++){const o=n[e];if(!V0.has(o.nodeName)){const e=Y0(o,t,i,!1);null!==e&&(r=r.concat(e))}}return function(t){for(const e of t)e.getNextSibling()instanceof dQ&&e.insertAfter(TK());for(const e of t){const t=e.getChildren();for(const n of t)e.insertBefore(n);e.remove()}}(i),r}function H0(t,e){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=EZ().getChildren();for(let i=0;i<r.length;i++)W0(t,r[i],n,e);return n.innerHTML}function W0(t,e,n,r=null){let i=null===r||e.isSelected(r);const o=eQ(e)&&e.excludeFromCopy("html");let a=e;if(null!==r){let t=_G(e);t=ZK(t)&&null!==r?CQ(r,t):t,a=t}const s=eQ(a)?a.getChildren():[],l=t._nodes.get(a.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(t,a):a.exportDOM(t);const{element:u,after:d}=c;if(!u)return!1;const h=document.createDocumentFragment();for(let n=0;n<s.length;n++){const o=s[n],a=W0(t,o,h,r);!i&&eQ(e)&&a&&e.extractWithChild(o,r,"html")&&(i=!0)}if(i&&!o){if((uG(u)||hG(u))&&u.append(h),n.append(u),d){const t=d.call(a,u);t&&(hG(u)?u.replaceChildren(t):u.replaceWith(t))}}else n.append(h);return i}const V0=new Set(["STYLE","SCRIPT"]);function Y0(t,e,n,r,i=new Map,o){let a=[];if(V0.has(t.nodeName))return a;let s=null;const l=function(t,e){const{nodeName:n}=t,r=e._htmlConversions.get(n.toLowerCase());let i=null;if(void 0!==r)for(const e of r){const n=e(t);null!==n&&(null===i||(i.priority||0)<=(n.priority||0))&&(i=n)}return null!==i?i.conversion:null}(t,e),c=l?l(t):null;let u=null;if(null!==c){u=c.after;const e=c.node;if(s=Array.isArray(e)?e[e.length-1]:e,null!==s){for(const[,t]of i)if(s=t(s,o),!s)break;s&&a.push(...Array.isArray(e)?e:[s])}null!=c.forChild&&i.set(t.nodeName,c.forChild)}const d=t.childNodes;let h=[];const p=(null==s||!rG(s))&&(null!=s&&gJ(s)||r);for(let t=0;t<d.length;t++)h.push(...Y0(d[t],e,n,p,new Map(i),s));return null!=u&&(h=u(h)),fG(t)&&(h=function(t,e,n){const r=t.style.textAlign,i=[];let o=[];for(let t=0;t<e.length;t++){const a=e[t];if(gJ(a))r&&!a.getFormat()&&a.setFormat(r),i.push(a);else if(o.push(a),t===e.length-1||t<e.length-1&&gJ(e[t+1])){const t=n();t.setFormat(r),t.append(...o),i.push(t),o=[]}}return i}(t,h,p?()=>{const t=new dQ;return n.push(t),t}:fQ)),null==s?h.length>0?a=a.concat(h):fG(t)&&function(t){return null!=t.nextSibling&&null!=t.previousSibling&&(pG(t.nextSibling)&&pG(t.previousSibling))}(t)&&(a=a.concat(TK())):eQ(s)&&s.append(...h),a}var X0=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function q0(t,e,n){const r=t.getData("application/x-lexical-editor");if(r)try{const t=JSON.parse(r);if(t.namespace===n._config.namespace&&Array.isArray(t.nodes))return U0(n,function(t){const e=[];for(let n=0;n<t.length;n++){const r=WJ(t[n]);ZK(r)&&MQ(r),e.push(r)}return e}(t.nodes),e)}catch(t){}const i=t.getData("text/html");if(i)try{return U0(n,B0(n,(new DOMParser).parseFromString(function(t){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:t=>t}).createHTML(t):t}(i),"text/html")),e)}catch(t){}const o=t.getData("text/plain")||t.getData("text/uri-list");if(null!=o)if(aJ(e)){const t=o.split(/(\r?\n|\t)/);""===t[t.length-1]&&t.pop();for(let e=0;e<t.length;e++){const n=_J();if(aJ(n)){const r=t[e];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([JK()]):n.insertText(r)}}}else e.insertRawText(o)}function U0(t,e,n){t.dispatchCommand(bq,{nodes:e,selection:n})||n.insertNodes(e)}function Z0(t,e,n,r=[]){let i=null===e||n.isSelected(e);const o=eQ(n)&&n.excludeFromCopy("html");let a=n;if(null!==e){let t=_G(n);t=ZK(t)&&null!==e?CQ(e,t):t,a=t}const s=eQ(a)?a.getChildren():[],l=function(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&X0(58,n.name),eQ(t)){const t=e.children;Array.isArray(t)||X0(59,n.name)}return e}(a);if(ZK(a)){const t=a.__text;t.length>0?l.text=t:i=!1}for(let r=0;r<s.length;r++){const o=s[r],a=Z0(t,e,o,l.children);!i&&eQ(n)&&a&&n.extractWithChild(o,e,"clone")&&(i=!0)}if(i&&!o)r.push(l);else if(Array.isArray(l.children))for(let t=0;t<l.children.length;t++){const e=l.children[t];r.push(e)}return i}let G0=null;async function K0(t,e,n){if(null!==G0)return!1;if(null!==e)return new Promise(((r,i)=>{t.update((()=>{r(J0(t,e,n))}))}));const r=t.getRootElement(),i=null==t._window?window.document:t._window.document,o=lG(t._window);if(null===r||null===o)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const s=new Range;return s.setStart(a,0),s.setEnd(a,1),o.removeAllRanges(),o.addRange(s),new Promise(((e,r)=>{const o=t.registerCommand(Qq,(r=>(YQ(r,ClipboardEvent)&&(o(),null!==G0&&(window.clearTimeout(G0),G0=null),e(J0(t,r,n))),!0)),4);G0=window.setTimeout((()=>{o(),G0=null,e(!1)}),50),i.execCommand("copy"),a.remove()}))}function J0(t,e,n){if(void 0===n){const e=lG(t._window);if(!e)return!1;const r=e.anchorNode,i=e.focusNode;if(null!==r&&null!==i&&!lZ(t,r,i))return!1;const o=_J();if(null===o)return!1;n=function(t=_J()){const e={"text/plain":t?t.getTextContent():""};if(t){const n=$J();for(const[r,i]of Q0){const o=i(n,t);null!==o&&(e[r]=o)}}return e}(o)}e.preventDefault();const r=e.clipboardData;return null!==r&&(function(t,e){for(const n in e){const r=e[n];void 0!==r&&t.setData(n,r)}}(r,n),!0)}const Q0=[["text/html",function(t,e=_J()){return null==e&&X0(166),aJ(e)&&e.isCollapsed()||0===e.getNodes().length?"":H0(t,e)}],["application/x-lexical-editor",function(t,e=_J()){return null==e&&X0(166),aJ(e)&&e.isCollapsed()||0===e.getNodes().length?null:JSON.stringify(function(t,e){const n=[],r=EZ().getChildren();for(let i=0;i<r.length;i++)Z0(t,e,r[i],n);return{namespace:t._config.namespace,nodes:n}}(t,e))}]];function t1(t,e){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(t,e);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(t,e);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const e1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,n1=e1&&"documentMode"in document?document.documentMode:null,r1=!(!e1||!("InputEvent"in window)||n1)&&"getTargetRanges"in new window.InputEvent("input"),i1=e1&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),o1=e1&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,a1=e1&&/^(?=.*Chrome).*/i.test(navigator.userAgent),s1=e1&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!a1,l1={};class c1 extends tQ{static getType(){return"quote"}static clone(t){return new c1(t.__key)}createDOM(t){const e=document.createElement("blockquote");return HQ(e,t.theme.quote),e}updateDOM(t,e){return!1}static importDOM(){return{blockquote:t=>({conversion:f1,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(uG(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){return u1().updateFromJSON(t)}insertNewAfter(t,e){const n=fQ(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){const t=fQ();return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}canMergeWhenEmpty(){return!0}}function u1(){return iG(new c1)}class d1 extends tQ{static getType(){return"heading"}static clone(t){return new d1(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t}getTag(){return this.__tag}setTag(t){const e=this.getWritable();return this.__tag=t,e}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){HQ(n,r[e])}return n}updateDOM(t,e,n){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:p1,priority:0}),h2:t=>({conversion:p1,priority:0}),h3:t=>({conversion:p1,priority:0}),h4:t=>({conversion:p1,priority:0}),h5:t=>({conversion:p1,priority:0}),h6:t=>({conversion:p1,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&h1(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>h1(t)?{conversion:t=>({node:m1("h1")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if(uG(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){return m1(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,e=!0){const n=t?t.anchor.offset:0,r=this.getLastDescendant(),i=!r||t&&t.anchor.key===r.getKey()&&n===r.getTextContentSize()||!t?fQ():m1(this.getTag()),o=this.getDirection();if(i.setDirection(o),this.insertAfter(i,e),0===n&&!this.isEmpty()&&t){const t=fQ();t.select(),this.replace(t,!0)}return i}collapseAtStart(){const t=this.isEmpty()?fQ():m1(this.getTag());return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}extractWithChild(){return!0}}function h1(t){return"span"===t.nodeName.toLowerCase()&&"26pt"===t.style.fontSize}function p1(t){const e=t.nodeName.toLowerCase();let n=null;return"h1"!==e&&"h2"!==e&&"h3"!==e&&"h4"!==e&&"h5"!==e&&"h6"!==e||(n=m1(e),null!==t.style&&(xG(t,n),n.setFormat(t.style.textAlign))),{node:n}}function f1(t){const e=u1();return null!==t.style&&(e.setFormat(t.style.textAlign),xG(t,e)),{node:e}}function m1(t="h1"){return iG(new d1(t))}function g1(t){let e=null;if(YQ(t,DragEvent)?e=t.dataTransfer:YQ(t,ClipboardEvent)&&(e=t.clipboardData),null===e)return[!1,[],!1];const n=e.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(e.files),i]}function v1(t){const e=_J();if(!aJ(e))return!1;const n=new Set,r=e.getNodes();for(let e=0;e<r.length;e++){const i=r[e],o=i.getKey();if(n.has(o))continue;const a=VQ(i,(t=>eQ(t)&&!t.isInline()));if(null===a)continue;const s=a.getKey();a.canIndent()&&!n.has(s)&&(n.add(s),t(a))}return n.size>0}function y1(t){return iQ(SZ(t))}function b1(t){for(const e of["lowercase","uppercase","capitalize"])t.hasFormat(e)&&t.toggleFormat(e)}function _1(t){return BQ(t.registerCommand(_q,(t=>{const e=_J();return!!lJ(e)&&(e.clear(),!0)}),0),t.registerCommand(xq,(t=>{const e=_J();return!!aJ(e)&&(e.deleteCharacter(t),!0)}),0),t.registerCommand(Mq,(t=>{const e=_J();return!!aJ(e)&&(e.deleteWord(t),!0)}),0),t.registerCommand(Oq,(t=>{const e=_J();return!!aJ(e)&&(e.deleteLine(t),!0)}),0),t.registerCommand(kq,(e=>{const n=_J();if("string"==typeof e)null!==n&&n.insertText(e);else{if(null===n)return!1;const r=e.dataTransfer;if(null!=r)q0(r,n,t);else if(aJ(n)){const t=e.data;return t&&n.insertText(t),!0}}return!0}),0),t.registerCommand(Eq,(()=>{const t=_J();return!!aJ(t)&&(t.removeText(),!0)}),0),t.registerCommand(Pq,(t=>{const e=_J();return!!aJ(e)&&(e.formatText(t),!0)}),0),t.registerCommand(Zq,(t=>{const e=_J();if(!aJ(e)&&!lJ(e))return!1;const n=e.getNodes();for(const e of n){const n=VQ(e,(t=>eQ(t)&&!t.isInline()));null!==n&&n.setFormat(t)}return!0}),0),t.registerCommand(wq,(t=>{const e=_J();return!!aJ(e)&&(e.insertLineBreak(t),!0)}),0),t.registerCommand(Sq,(()=>{const t=_J();return!!aJ(t)&&(t.insertParagraph(),!0)}),0),t.registerCommand(Yq,(()=>(function(t){let e=_J()||xJ();null===e&&(e=EZ().selectEnd()),e.insertNodes(t)}([JK()]),!0)),0),t.registerCommand(Xq,(()=>v1((t=>{const e=t.getIndent();t.setIndent(e+1)}))),0),t.registerCommand(qq,(()=>v1((t=>{const e=t.getIndent();e>0&&t.setIndent(e-1)}))),0),t.registerCommand(Rq,(t=>{const e=_J();if(lJ(e)&&!y1(t.target)){const t=e.getNodes();if(t.length>0)return t[0].selectPrevious(),!0}else if(aJ(e)){const n=qZ(e.focus,!0);if(!t.shiftKey&&iQ(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),t.preventDefault(),!0}return!1}),0),t.registerCommand($q,(t=>{const e=_J();if(lJ(e)){const t=e.getNodes();if(t.length>0)return t[0].selectNext(0,0),!0}else if(aJ(e)){if(function(t){const e=t.focus;return"root"===e.key&&e.offset===EZ().getChildrenSize()}(e))return t.preventDefault(),!0;const n=qZ(e.focus,!1);if(!t.shiftKey&&iQ(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),t.preventDefault(),!0}return!1}),0),t.registerCommand(Iq,(t=>{const e=_J();if(lJ(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectPrevious(),!0}if(!aJ(e))return!1;if(NQ(e,!0)){const n=t.shiftKey;return t.preventDefault(),DQ(e,n,!0),!0}return!1}),0),t.registerCommand(Aq,(t=>{const e=_J();if(lJ(e)&&!y1(t.target)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectNext(0,0),!0}if(!aJ(e))return!1;const n=t.shiftKey;return!!NQ(e,!1)&&(t.preventDefault(),DQ(e,n,!1),!0)}),0),t.registerCommand(Bq,(e=>{if(y1(e.target))return!1;const n=_J();if(!aJ(n))return!1;const{anchor:r}=n,i=r.getNode();return n.isCollapsed()&&0===r.offset&&!aQ(i)&&function(t){const e=VQ(t,(t=>eQ(t)&&!t.isInline()));return eQ(e)||zQ(4,t.__key),e}(i).getIndent()>0?(e.preventDefault(),t.dispatchCommand(qq,void 0)):(!o1||"ko-KR"!==navigator.language)&&(e.preventDefault(),t.dispatchCommand(xq,!0))}),0),t.registerCommand(Wq,(e=>{if(y1(e.target))return!1;return!!aJ(_J())&&(e.preventDefault(),t.dispatchCommand(xq,!1))}),0),t.registerCommand(Fq,(e=>{const n=_J();if(!aJ(n))return!1;if(b1(n),null!==e){if((o1||i1||s1)&&r1)return!1;if(e.preventDefault(),e.shiftKey)return t.dispatchCommand(wq,!1)}return t.dispatchCommand(Sq,void 0)}),0),t.registerCommand(Hq,(()=>!!aJ(_J())&&(t.blur(),!0)),0),t.registerCommand(Uq,(e=>{const[,n]=g1(e);if(n.length>0){const r=t1(e.clientX,e.clientY);if(null!==r){const{offset:e,node:i}=r,o=SZ(i);if(null!==o){const t=function(){const t=eJ("root",0,"element"),e=eJ("root",0,"element");return new sJ(t,e,0,"")}();if(ZK(o))t.anchor.set(o.getKey(),e,"text"),t.focus.set(o.getKey(),e,"text");else{const e=o.getParentOrThrow().getKey(),n=o.getIndexWithinParent()+1;t.anchor.set(e,n,"element"),t.focus.set(e,n,"element")}OZ(rZ(t))}t.dispatchCommand(l1,n)}return e.preventDefault(),!0}return!!aJ(_J())}),0),t.registerCommand(Gq,(t=>{const[e]=g1(t),n=_J();return!(e&&!aJ(n))}),0),t.registerCommand(Kq,(t=>{const[e]=g1(t),n=_J();if(e&&!aJ(n))return!1;const r=t1(t.clientX,t.clientY);if(null!==r){iQ(SZ(r.node))&&t.preventDefault()}return!0}),0),t.registerCommand(eU,(()=>(function(t){const e=EZ();if(aJ(t)){const e=t.anchor,n=t.focus,r=e.getNode().getTopLevelElementOrThrow().getParentOrThrow();return e.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),rZ(t),t}{const t=e.select(0,e.getChildrenSize());OZ(rZ(t))}}(),!0)),0),t.registerCommand(Qq,(e=>(K0(t,YQ(e,ClipboardEvent)?e:null),!0)),0),t.registerCommand(tU,(e=>(async function(t,e){await K0(e,YQ(t,ClipboardEvent)?t:null),e.update((()=>{const t=_J();aJ(t)?t.removeText():lJ(t)&&t.getNodes().forEach((t=>t.remove()))}))}(e,t),!0)),0),t.registerCommand(Cq,(e=>{const[,n,r]=g1(e);return n.length>0&&!r?(t.dispatchCommand(l1,n),!0):(!dG(e.target)||!sZ(e.target))&&(null!==_J()&&(function(t,e){t.preventDefault(),e.update((()=>{const n=_J(),r=YQ(t,InputEvent)||YQ(t,KeyboardEvent)?null:t.clipboardData;null!=r&&null!==n&&q0(r,n,e)}),{tag:"paste"})}(e,t),!0))}),0),t.registerCommand(jq,(t=>{const e=_J();return aJ(e)&&b1(e),!1}),0),t.registerCommand(Vq,(t=>{const e=_J();return aJ(e)&&b1(e),!1}),0))}var x1=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const w1=v(null);function S1(){const t=p(w1);return null==t&&x1(8),t}const k1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,C1=k1?d:l,E1={tag:"history-merge"};function M1({initialConfig:e,children:n}){const r=o((()=>{const{theme:t,namespace:n,nodes:r,onError:i,editorState:o,html:a}=e,s=function(t,e){let n=null;return null!=t&&(n=t[1]),{getTheme:function(){return null!=e?e:null!=n?n.getTheme():null}}}(null,t),l=vQ({editable:e.editable,html:a,namespace:n,nodes:r,onError:t=>i(t,l),theme:t});return function(t,e){if(null!==e)if(void 0===e)t.update((()=>{const e=EZ();if(e.isEmpty()){const n=fQ();e.append(n);const r=k1?document.activeElement:null;(null!==_J()||null!==r&&r===t.getRootElement())&&n.select()}}),E1);else if(null!==e)switch(typeof e){case"string":{const n=t.parseEditorState(e);t.setEditorState(n,E1);break}case"object":t.setEditorState(e,E1);break;case"function":t.update((()=>{EZ().isEmpty()&&e(t)}),E1)}}(l,o),[l,s]}),[]);return C1((()=>{const t=e.editable,[n]=r;n.setEditable(void 0===t||t)}),[]),t(w1.Provider,{value:r,children:n})}var O1="LexicalContent-module_editableContent__f69V7";function P1({defaultSelection:t}){const[e]=S1();return l((()=>{e.focus((()=>{const t=document.activeElement,n=e.getRootElement();null===n||null!==t&&n.contains(t)||n.focus({preventScroll:!0})}),{defaultSelection:t})}),[t,e]),null}const T1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;function N1(t){return{initialValueFn:()=>t.isEditable(),subscribe:e=>t.registerEditableListener(e)}}function D1(t,e=!0){if(t)return!1;let n=EZ().getTextContent();return e&&(n=n.trim()),""===n}function A1(t){return()=>function(t){if(!D1(t,!1))return!1;const e=EZ().getChildren(),n=e.length;if(n>1)return!1;for(let t=0;t<n;t++){const n=e[t];if(iQ(n))return!1;if(eQ(n)){if(!mQ(n))return!1;if(0!==n.__indent)return!1;const e=n.getChildren(),r=e.length;for(let n=0;n<r;n++)if(!ZK(e[t]))return!1}}return!0}(t)}!function(t){t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")&&t.default}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const L1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;function I1(t){return t.getEditorState().read(A1(t.isComposing()))}function z1({contentEditable:r,placeholder:i=null,ErrorBoundary:a}){const[s]=S1(),c=function(e,n){const[r,i]=u((()=>e.getDecorators()));return L1((()=>e.registerDecoratorListener((t=>{T((()=>{i(t)}))}))),[e]),l((()=>{i(e.getDecorators())}),[e]),o((()=>{const i=[],o=Object.keys(r);for(let a=0;a<o.length;a++){const s=o[a],l=t(n,{onError:t=>e._onError(t),children:t(C,{fallback:null,children:r[s]})}),c=e.getElementByKey(s);null!==c&&i.push(O(l,c,s))}return i}),[n,r,e])}(s,a);return function(t){L1((()=>BQ(_1(t),function(t){const e=window.location.origin,n=n=>{if(n.origin!==e)return;const r=t.getRootElement();if(document.activeElement!==r)return;const i=n.data;if("string"==typeof i){let e;try{e=JSON.parse(i)}catch(t){return}if(e&&"nuanria_messaging"===e.protocol&&"request"===e.type){const r=e.payload;if(r&&"makeChanges"===r.functionId){const e=r.args;if(e){const[r,i,o,a,s,l]=e;t.update((()=>{const t=_J();if(aJ(t)){const e=t.anchor;let l=e.getNode(),c=0,u=0;if(ZK(l)&&r>=0&&i>=0&&(c=r,u=r+i,t.setTextNodeRange(l,c,l,u)),c===u&&""===o||(t.insertRawText(o),l=e.getNode()),ZK(l)){c=a,u=a+s;const e=l.getTextContentSize();c=c>e?e:c,u=u>e?e:u,t.setTextNodeRange(l,c,l,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(t))),[t])}(s),e(n,{children:[r,t(R1,{content:i}),c]})}function R1({content:t}){const[e]=S1(),n=function(t){const[e,n]=u((()=>I1(t)));return L1((()=>{function e(){const e=I1(t);n(e)}return e(),BQ(t.registerUpdateListener((()=>{e()})),t.registerEditableListener((()=>{e()})))}),[t]),e}(e),r=function(t){const[e]=S1(),n=o((()=>t(e)),[e,t]),[r,i]=u((()=>n.initialValueFn())),a=s(r);return T1((()=>{const{initialValueFn:t,subscribe:e}=n,r=t();return a.current!==r&&(a.current=r,i(r)),e((t=>{a.current=t,i(t)}))}),[n,t]),r}(N1);return n?"function"==typeof t?t(r):t:null}const $1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;const F1=h((function({editor:e,ariaActiveDescendant:n,ariaAutoComplete:r,ariaControls:i,ariaDescribedBy:a,ariaErrorMessage:s,ariaExpanded:l,ariaInvalid:d,ariaLabel:h,ariaLabelledBy:p,ariaMultiline:f,ariaOwns:m,ariaRequired:g,autoCapitalize:v,className:y,id:b,role:_="textbox",spellCheck:x=!0,style:w,tabIndex:S,"data-testid":k,...C},E){const[M,O]=u(e.isEditable()),P=c((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),T=o((()=>function(...t){return e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}}(E,P)),[P,E]);return $1((()=>(O(e.isEditable()),e.registerEditableListener((t=>{O(t)})))),[e]),t("div",{"aria-activedescendant":M?n:void 0,"aria-autocomplete":M?r:"none","aria-controls":M?i:void 0,"aria-describedby":a,...null!=s?{"aria-errormessage":s}:{},"aria-expanded":M&&"combobox"===_?!!l:void 0,...null!=d?{"aria-invalid":d}:{},"aria-label":h,"aria-labelledby":p,"aria-multiline":f,"aria-owns":M?m:void 0,"aria-readonly":!M||void 0,"aria-required":g,autoCapitalize:v,className:y,contentEditable:M,"data-testid":k,id:b,ref:T,role:M?_:void 0,spellCheck:x,style:w,tabIndex:S,...C})}));function j1(t){return t.getEditorState().read(A1(t.isComposing()))}const B1=h((function(r,i){const{placeholder:o,...a}=r,[s]=S1();return e(n,{children:[t(F1,{editor:s,...a,ref:i}),null!=o&&t(H1,{editor:s,content:o})]})}));function H1({content:e,editor:n}){const r=function(t){const[e,n]=u((()=>j1(t)));return $1((()=>{function e(){const e=j1(t);n(e)}return e(),BQ(t.registerUpdateListener((()=>{e()})),t.registerEditableListener((()=>{e()})))}),[t]),e}(n),[i,o]=u(n.isEditable());if(d((()=>(o(n.isEditable()),n.registerEditableListener((t=>{o(t)})))),[n]),!r)return null;let a=null;return"function"==typeof e?a=e(i):null!==e&&(a=e),null===a?null:t("div",{"aria-hidden":!0,children:a})}function W1(t,e,n,r,i){if(null===t||0===n.size&&0===r.size&&!i)return 0;const o=e._selection,a=t._selection;if(i)return 1;if(!(aJ(o)&&aJ(a)&&a.isCollapsed()&&o.isCollapsed()))return 0;const s=function(t,e,n){const r=t._nodeMap,i=[];for(const t of e){const e=r.get(t);void 0!==e&&i.push(e)}for(const[t,e]of n){if(!e)continue;const n=r.get(t);void 0===n||aQ(n)||i.push(n)}return i}(e,n,r);if(0===s.length)return 0;if(s.length>1){const n=e._nodeMap,r=n.get(o.anchor.key),i=n.get(a.anchor.key);return r&&i&&!t._nodeMap.has(r.__key)&&ZK(r)&&1===r.__text.length&&1===o.anchor.offset?2:0}const l=s[0],c=t._nodeMap.get(l.__key);if(!ZK(c)||!ZK(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const h=o.anchor,p=a.anchor;if(h.key!==p.key||"text"!==h.type)return 0;const f=h.offset,m=p.offset,g=d.length-u.length;return 1===g&&m===f-1?2:-1===g&&m===f+1?3:-1===g&&m===f?4:0}function V1(t,e){let n=Date.now(),r=0;return(i,o,a,s,l,c)=>{const u=Date.now();if(c.has("historic"))return r=0,n=u,2;const d=W1(i,o,s,l,t.isComposing()),h=(()=>{const h=null===a||a.editor===t,p=c.has("history-push");if(!p&&h&&c.has("history-merge"))return 0;if(null===i)return 1;const f=o._selection;return s.size>0||l.size>0?!1===p&&0!==d&&d===r&&u<n+e&&h||1===s.size&&function(t,e,n){const r=e._nodeMap.get(t),i=n._nodeMap.get(t),o=e._selection,a=n._selection;return!(aJ(o)&&aJ(a)&&"element"===o.anchor.type&&"element"===o.focus.type&&"text"===a.anchor.type&&"text"===a.focus.type||!ZK(r)||!ZK(i)||r.__parent!==i.__parent)&&JSON.stringify(e.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>i.exportJSON())))}(Array.from(s)[0],i,o)?0:1:null!==f?0:2})();return n=u,r=d,h}}function Y1(t){t.undoStack=[],t.redoStack=[],t.current=null}function X1({delay:t,externalHistoryState:e}){const[n]=S1();return function(t,e,n=1e3){const r=o((()=>e||{current:null,redoStack:[],undoStack:[]}),[e]);l((()=>function(t,e,n){const r=V1(t,n),i=BQ(t.registerCommand(Tq,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==r.length){const i=e.current,o=r.pop();null!==i&&(n.push(i),t.dispatchCommand(iU,!0)),0===r.length&&t.dispatchCommand(oU,!1),e.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}}(t,e),!0)),0),t.registerCommand(Nq,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==n.length){const i=e.current;null!==i&&(r.push(i),t.dispatchCommand(oU,!0));const o=n.pop();0===n.length&&t.dispatchCommand(iU,!1),e.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}}(t,e),!0)),0),t.registerCommand(nU,(()=>(Y1(e),!1)),0),t.registerCommand(rU,(()=>(Y1(e),t.dispatchCommand(iU,!1),t.dispatchCommand(oU,!1),!0)),0),t.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:o,dirtyElements:a,tags:s})=>{const l=e.current,c=e.redoStack,u=e.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const h=r(i,n,l,o,a,s);if(1===h)0!==c.length&&(e.redoStack=[],t.dispatchCommand(iU,!1)),null!==l&&(u.push({...l}),t.dispatchCommand(oU,!0));else if(2===h)return;e.current={editor:t,editorState:n}})));return i}(t,r,n)),[n,t,r])}(n,e,t),null}function q1(t,e){return q1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},q1(t,e)}var U1={error:null},Z1=function(t){var e,n;function i(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).state=U1,e.resetErrorBoundary=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];null==e.props.onReset||(t=e.props).onReset.apply(t,r),e.reset()},e}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,q1(e,n),i.getDerivedStateFromError=function(t){return{error:t}};var o=i.prototype;return o.reset=function(){this.setState(U1)},o.componentDidCatch=function(t,e){var n,r;null==(n=(r=this.props).onError)||n.call(r,t,e)},o.componentDidUpdate=function(t,e){var n,r,i,o,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==e.error&&(void 0===(i=t.resetKeys)&&(i=[]),void 0===(o=s)&&(o=[]),i.length!==o.length||i.some((function(t,e){return!Object.is(t,o[e])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,t.resetKeys,s),this.reset())},o.render=function(){var t=this.state.error,e=this.props,n=e.fallbackRender,i=e.FallbackComponent,o=e.fallback;if(null!==t){var a={error:t,resetErrorBoundary:this.resetErrorBoundary};if(r.isValidElement(o))return o;if("function"==typeof n)return n(a);if(i)return r.createElement(i,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},i}(r.Component);function G1({children:e,onError:n}){return t(Z1,{fallback:t("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:n,children:e})}!function(t){t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")&&t.default}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const K1=new Set(["http:","https:","mailto:","sms:","tel:"]);class J1 extends tQ{static getType(){return"link"}static clone(t){return new J1(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",e={},n){super(n);const{target:r=null,rel:i=null,title:o=null}=e;this.__url=t,this.__target=r,this.__rel=i,this.__title=o}createDOM(t){const e=document.createElement("a");return e.href=this.sanitizeUrl(this.__url),null!==this.__target&&(e.target=this.__target),null!==this.__rel&&(e.rel=this.__rel),null!==this.__title&&(e.title=this.__title),HQ(e,t.theme.link),e}updateDOM(t,e,n){if(cG(e)){const n=this.__url,r=this.__target,i=this.__rel,o=this.__title;n!==t.__url&&(e.href=n),r!==t.__target&&(r?e.target=r:e.removeAttribute("target")),i!==t.__rel&&(i?e.rel=i:e.removeAttribute("rel")),o!==t.__title&&(o?e.title=o:e.removeAttribute("title"))}return!1}static importDOM(){return{a:t=>({conversion:Q1,priority:1})}}static importJSON(t){return t2().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){try{const e=new URL(t);if(!K1.has(e.protocol))return"about:blank"}catch(e){return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const e=this.getWritable();return e.__url=t,e}getTarget(){return this.getLatest().__target}setTarget(t){const e=this.getWritable();return e.__target=t,e}getRel(){return this.getLatest().__rel}setRel(t){const e=this.getWritable();return e.__rel=t,e}getTitle(){return this.getLatest().__title}setTitle(t){const e=this.getWritable();return e.__title=t,e}insertNewAfter(t,e=!0){const n=t2(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,e),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,e,n){if(!aJ(e))return!1;const r=e.anchor.getNode(),i=e.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&e.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Q1(t){let e=null;if(cG(t)){const n=t.textContent;(null!==n&&""!==n||t.children.length>0)&&(e=t2(t.getAttribute("href")||"",{rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")}))}return{node:e}}function t2(t="",e){return iG(new J1(t,e))}function e2(t){return t instanceof J1}function n2({label:n,value:r,onChange:i,placeholder:o="","data-test-id":a,type:s="text"}){return e("div",{className:"Input__wrapper",children:[t("label",{className:"Input__label",children:n}),t("input",{type:s,className:"Input__input",placeholder:o,value:r,onChange:t=>{i(t.target.value)},"data-test-id":a})]})}let r2=!1;const i2=["#d0021b","#f5a623","#f8e71c","#8b572a","#7ed321","#417505","#bd10e0","#9013fe","#4a90e2","#50e3c2","#b8e986","#000000","#4a4a4a","#9b9b9b","#ffffff"],o2=214;function a2({color:n,onChange:r}){const[i,a]=u(p2("hex",n)),[c,d]=u(n),h=s(null),p=o((()=>({x:i.hsv.s/100*o2,y:(100-i.hsv.v)/100*150})),[i.hsv.s,i.hsv.v]),f=o((()=>({x:i.hsv.h/360*o2})),[i.hsv]);return l((()=>{null!==h.current&&r&&(r(i.hex,r2),d(i.hex))}),[i,r]),l((()=>{if(void 0===n)return;const t=p2("hex",n);a(t),d(t.hex)}),[n]),e("div",{className:"color-picker-wrapper",style:{width:o2},ref:h,children:[t(n2,{label:"Hex",onChange:t=>{if(d(t),/^#[0-9A-Fa-f]{6}$/i.test(t)){const e=p2("hex",t);a(e)}},value:c}),t("div",{className:"color-picker-basic-color",children:i2.map((e=>t("button",{className:e===i.hex?" active":"",style:{backgroundColor:e},onClick:()=>{d(e),a(p2("hex",e))}},e)))}),t(s2,{className:"color-picker-saturation",style:{backgroundColor:`hsl(${i.hsv.h}, 100%, 50%)`},onChange:({x:t,y:e})=>{const n=p2("hsv",{...i.hsv,s:t/o2*100,v:100-e/150*100});a(n),d(n.hex)},children:t("div",{className:"color-picker-saturation_cursor",style:{backgroundColor:i.hex,left:p.x,top:p.y}})}),t(s2,{className:"color-picker-hue",onChange:({x:t})=>{const e=p2("hsv",{...i.hsv,h:t/o2*360});a(e),d(e.hex)},children:t("div",{className:"color-picker-hue_cursor",style:{backgroundColor:`hsl(${i.hsv.h}, 100%, 50%)`,left:f.x}})}),t("div",{className:"color-picker-color",style:{backgroundColor:i.hex}})]})}function s2({className:e,style:n,onChange:r,children:i}){const o=s(null),a=s(!1),l=t=>{if(o.current){const{current:e}=o,{width:n,height:i,left:a,top:s}=e.getBoundingClientRect(),l=function(t){let e=1;if(function(){if(void 0===XQ){const t=document.createElement("div");t.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(t);const e=t.getBoundingClientRect();t.style.setProperty("zoom","2"),XQ=t.getBoundingClientRect().width===e.width,document.body.removeChild(t)}return XQ}())for(;t;)e*=Number(window.getComputedStyle(t).getPropertyValue("zoom")),t=t.parentElement;return e}(e),c=l2(t.clientX/l-a,n,0),u=l2(t.clientY/l-s,i,0);r({x:c,y:u})}};return t("div",{ref:o,className:e,style:n,onMouseDown:t=>{if(0!==t.button)return;l(t);const e=t=>{a.current=!0,r2=!0,l(t)},n=t=>{a.current&&(r2=!1),document.removeEventListener("mousemove",e,!1),document.removeEventListener("mouseup",n,!1),l(t),a.current=!1};document.addEventListener("mousemove",e,!1),document.addEventListener("mouseup",n,!1)},children:i})}function l2(t,e,n){return t>e?e:t<n?n:t}function c2(t){if(!t.startsWith("#")){const e=document.createElement("canvas").getContext("2d");if(!e)throw new Error("2d context not supported or canvas already initialized");return e.fillStyle=t,e.fillStyle}return 4===t.length||5===t.length?(t=t.split("").map(((t,e)=>e?t+t:"#")).join(""),t):7===t.length||9===t.length?t:"#000000"}function u2(t){const e=(t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((t,e,n,r)=>"#"+e+e+n+n+r+r)).substring(1).match(/.{2}/g)||[]).map((t=>parseInt(t,16)));return{b:e[2],g:e[1],r:e[0]}}function d2({r:t,g:e,b:n}){t/=255,e/=255,n/=255;const r=Math.max(t,e,n),i=r-Math.min(t,e,n);return{h:i?60*(r===t?(e-n)/i+(e<n?6:0):r===e?2+(n-t)/i:4+(t-e)/i):0,s:r?i/r*100:0,v:100*r}}function h2({b:t,g:e,r:n}){return"#"+[n,e,t].map((t=>t.toString(16).padStart(2,"0"))).join("")}function p2(t,e){let n=c2("#121212"),r=u2(n),i=d2(r);if("hex"===t){n=c2(e),r=u2(n),i=d2(r)}else if("rgb"===t){r=e,n=h2(r),i=d2(r)}else if("hsv"===t){i=e,r=function({h:t,s:e,v:n}){const r=~~(t/60),i=t/60-r,o=(n/=100)*(1-(e/=100)),a=n*(1-e*i),s=n*(1-e*(1-i)),l=r%6,c=Math.round(255*[n,a,o,o,s,n][l]),u=Math.round(255*[s,n,n,a,o,o][l]);return{b:Math.round(255*[o,o,s,n,n,a][l]),g:u,r:c}}(i),n=h2(r)}return{hex:n,hsv:i,rgb:r}}const f2=r.createContext(null);function m2({children:e,className:n,onClick:i,title:o}){const a=s(null),c=r.useContext(f2);if(null===c)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:u}=c;return l((()=>{a&&a.current&&u(a)}),[a,u]),t("button",{className:`item ${n}`,onClick:i,ref:a,title:o,type:"button",children:e})}function g2({children:e,dropDownRef:n,onClose:r}){const[i,a]=u(),[s,d]=u(),h=c((t=>{a((e=>e?[...e,t]:[t]))}),[a]),p=o((()=>({registerItem:h})),[h]);return l((()=>{i&&!s&&d(i[0]),s&&s.current&&s.current.focus()}),[i,s]),t(f2.Provider,{value:p,children:t("div",{className:"dropdown",ref:n,onKeyDown:t=>{if(!i)return;const e=t.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(e)&&t.preventDefault(),"Escape"===e||"Tab"===e?r():"ArrowUp"===e?d((t=>{if(!t)return i[0];const e=i.indexOf(t)-1;return i[-1===e?i.length-1:e]})):"ArrowDown"===e&&d((t=>t?i[i.indexOf(t)+1]:i[0]))},children:e})})}function v2({colorPicker:r=!1,disabled:i=!1,buttonLabel:o,buttonAriaLabel:a,buttonClassName:c,buttonIconClassName:d,labelClassName:h,children:p,icon:f=t(Za,{name:"chevronDown"}),stopCloseOnClickSelf:m,buttonOnClick:g}){const v=s(null),y=s(null),[b,_]=u(!1);return l((()=>{const t=y.current,e=v.current;if(b&&null!==t&&null!==e){const{top:n,left:r}=t.getBoundingClientRect();e.style.top=`${n+t.offsetHeight+4}px`,e.style.left=`${Math.min(r,window.innerWidth-e.offsetWidth-20)}px`}}),[v,y,b]),l((()=>{const t=y.current;if(null!==t&&b){const e=e=>{const n=e.target;m&&v.current&&v.current.contains(n)||t.contains(n)||_(!1)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}}),[v,y,b,m]),l((()=>{const t=()=>{if(b){const t=y.current,e=v.current;if(null!==t&&null!==e){const{top:n}=t.getBoundingClientRect(),r=n+t.offsetHeight+4;r!==e.getBoundingClientRect().top&&(e.style.top=`${r}px`)}}};return document.addEventListener("scroll",t),()=>{document.removeEventListener("scroll",t)}}),[y,v,b]),e(n,{children:[e("button",{type:"button",disabled:i,"aria-label":a||o,className:`toolbar-item ${!r&&"dropdownButton"} ${c}`,onClick:()=>{_(!b),g&&g()},ref:y,children:[o&&t("div",{className:h,children:o}),!r&&f]}),b&&O(t(g2,{dropDownRef:v,onClose:()=>{_(!1),y&&y.current&&y.current.focus()},children:p}),document.body)]})}function y2({disabled:e=!1,stopCloseOnClickSelf:n=!0,color:r,onChange:i,...o}){return t(v2,{...o,colorPicker:!0,disabled:e,stopCloseOnClickSelf:n,children:t("div",{style:{position:"static",top:0,zIndex:99},children:t(a2,{color:r,onChange:i})})})}var b2;function _2({selectionFontSize:e,editor:n}){const[i,o]=r.useState(e),a=r.useCallback(((t,e)=>{const r=t=>(t||(t="15px"),`${t=t.slice(0,-2)}px`);n.update((()=>{if(n.isEditable()){const e=_J();null!==e&&PQ(e,{"font-size":t||r})}}))}),[n]);r.useEffect((()=>{o(e)}),[e]);return t(v2,{buttonOnClick:()=>{},buttonLabel:`${i}px`,children:[8,9,10,11,12,14,16,18,20,24,28,32,36,48,60,72].map((e=>t(m2,{onClick:()=>{a(String(e)+"px",null)},children:t("span",{className:"text",children:e})},e)))})}!function(t){t[t.increment=1]="increment",t[t.decrement=2]="decrement"}(b2||(b2={}));const x2={bullet:"Bulleted List",check:"Check List",code:"Code Block",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",number:"Numbered List",paragraph:"Normal",quote:"Quote"},w2=[["Arial","Arial"],["Courier New","Courier New"],["Georgia","Georgia"],["Times New Roman","Times New Roman"],["Trebuchet MS","Trebuchet MS"],["Verdana","Verdana"],["Roboto","Roboto"]],S2=[["10px","10px"],["11px","11px"],["12px","12px"],["13px","13px"],["14px","14px"],["15px","15px"],["16px","16px"],["17px","17px"],["18px","18px"],["19px","19px"],["20px","20px"]];function k2(t){return t?"active dropdown-item-active":""}function C2({editor:n,blockType:r,disabled:i=!1}){const o=()=>{n.update((()=>{const t=_J();aJ(t)&&TQ(t,(()=>fQ()))}))},a=t=>{r!==t&&n.update((()=>{TQ(_J(),(()=>m1(t)))}))};return e(v2,{disabled:i,buttonClassName:"toolbar-item block-controls",buttonIconClassName:"icon block-type "+r,buttonLabel:x2[r],buttonAriaLabel:"Formatting options for text style",children:[t(m2,{className:"item "+k2("paragraph"===r),onClick:o,children:t("span",{className:"text",children:"Normal"})}),t(m2,{className:"item "+k2("h1"===r),onClick:()=>a("h1"),children:t("span",{className:"text",children:"Heading 1"})}),t(m2,{className:"item "+k2("h2"===r),onClick:()=>a("h2"),children:t("span",{className:"text",children:"Heading 2"})}),t(m2,{className:"item "+k2("h3"===r),onClick:()=>a("h3"),children:t("span",{className:"text",children:"Heading 3"})}),t(m2,{className:"item "+k2("bullet"===r),onClick:()=>{"bullet"!==r?n.dispatchCommand(F0,void 0):o()},children:t("span",{className:"text",children:"Bullet List"})}),t(m2,{className:"item "+k2("number"===r),onClick:()=>{"number"!==r?n.dispatchCommand(j0,void 0):o()},children:t("span",{className:"text",children:"Numbered List"})}),t(m2,{className:"item "+k2("quote"===r),onClick:()=>{"quote"!==r&&n.update((()=>{TQ(_J(),(()=>u1()))}))},children:t("span",{className:"text",children:"Quote"})})]})}function E2({editor:e,value:n,style:r}){const i=c((t=>{e.update((()=>{const e=_J();null!==e&&PQ(e,{[r]:t})}))}),[e,r]);return t(v2,{buttonOnClick:()=>{e.dispatchCommand(aU,void 0)},buttonClassName:"toolbar-item "+r,buttonLabel:n,buttonIconClassName:"font-family"===r?"icon block-type font-family":"",buttonAriaLabel:"font-family"===r?"Formatting options for font family":"Formatting options for font size",children:("font-family"===r?w2:S2).map((([e,o])=>t(m2,{className:`item ${k2(n===e)} ${"font-size"===r?"fontsize-item":""}`,onClick:()=>i(e),children:t("span",{className:"text",children:e})},e)))})}function M2(){return t("div",{className:"divider"})}const O2=a((({editor:n})=>{const r=s(null),i=s(null),o=s(null),[a,d]=u("14px"),[h,p]=u("#000"),[f,m]=u("#fff"),[g,v]=u("Arial"),[y,b]=u("left"),[_,x]=u(!1),[w,S]=u(!1),[k,C]=u(!1),[E,M]=u(!1),[O,P]=u(!1),[T,N]=u(!1),[D,A]=u(!1),[L,I]=u(!1),[z,R]=u("paragraph"),[$,F]=u(null),j=c((()=>{const t=_J();if(aJ(t)){const e=t.anchor.getNode();let r="root"===e.getKey()?e:VQ(e,(t=>{const e=t.getParent();return null!==e&&rG(e)}));null===r&&(r=e.getTopLevelElementOrThrow());const i=r.getKey(),o=n.getElementByKey(i);C(t.hasFormat("code")),S(t.hasFormat("bold")),M(t.hasFormat("italic")),P(t.hasFormat("underline")),N(t.hasFormat("strikethrough"));const a=function(t){const e=t.anchor,n=t.focus,r=t.anchor.getNode(),i=t.focus.getNode();return r===i?r:t.isBackward()?EQ(n)?r:i:EQ(e)?r:i}(t),s=a.getParent();if(e2(s)||e2(a)?x(!0):x(!1),null!==o)if(F(i),$0(r)){const t=function(t,e){let n=t;for(;null!=n;){if(n instanceof e)return n;n=n.getParent()}return null}(e,D0),n=t?t.getListType():r.getListType();R(n)}else{const t=function(t){return t instanceof d1}(r)?r.getTag():r.getType();t in x2&&R(t)}let l;p(LQ(t,"color","#000")),m(LQ(t,"background-color","#fff")),v(LQ(t,"font-family","Arial")),e2(s)&&(l=VQ(a,(t=>eQ(t)&&!t.isInline()))),b(eQ(l)?l.getFormatType():eQ(a)?a.getFormatType():s?.getFormatType()||"left")}aJ(t)&&d(LQ(t,"font-size","14px"))}),[]);l((()=>BQ(n.registerUpdateListener((({editorState:t})=>{t.read((()=>{j()}))})),n.registerCommand(yq,((t,e)=>(j(),!1)),1),n.registerCommand(oU,(t=>(A(t),!1)),1),n.registerCommand(iU,(t=>(I(t),!1)),1))),[n,j]);const B=c(((t,e)=>{n.update((()=>{const e=_J();null!==e&&PQ(e,t)}),e?{tag:"historic"}:{})}),[n]),H=c(((t,e)=>{V(t),B({color:t},e)}),[B]),W=c(((t,e)=>{Y(t),B({"background-color":t},e)}),[B]);l((()=>{V("white")}),[i]),l((()=>{Y("white")}),[o]);const V=t=>{if(!t||!i.current)return;const e=i.current.querySelectorAll("path");e[5]&&e[5].setAttribute("fill",t)},Y=t=>{if(!t||!o.current)return;const e=o.current.querySelectorAll("path");e[0]&&e[0].setAttribute("fill",t)},X=c(((t,e)=>{n.dispatchCommand(t,e)}),[]);return e("div",{className:"toolbar",ref:r,onClick:()=>{n.dispatchCommand(aU,void 0)},children:[t("button",{disabled:!D,onClick:()=>{n.dispatchCommand(Tq,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:t(Za,{name:"undo"})}),t("button",{disabled:!L,onClick:()=>{n.dispatchCommand(Nq,void 0)},className:"toolbar-item","aria-label":"Redo",children:t(Za,{name:"redo"})}),t(M2,{}),t(C2,{blockType:z,editor:n}),t(M2,{}),t(E2,{style:"font-family",value:g,editor:n}),t(M2,{}),t(_2,{selectionFontSize:a.slice(0,-2),editor:n}),t(M2,{}),t("button",{onClick:()=>{X(Pq,"bold")},className:"toolbar-item spaced "+(w?"active":""),"aria-label":"Format Bold",children:t(Za,{name:"formatBold"})}),t("button",{onClick:()=>{X(Pq,"italic")},className:"toolbar-item spaced "+(E?"active":""),"aria-label":"Format Italics",children:t(Za,{name:"formatItalic"})}),t("button",{onClick:()=>{X(Pq,"underline")},className:"toolbar-item spaced "+(O?"active":""),"aria-label":"Format Underline",children:t(Za,{name:"formatUnderlined"})}),t("button",{onClick:()=>{X(Pq,"code")},className:"toolbar-item spaced "+(k?"active":""),"aria-label":"Format Underline",children:t(Za,{name:"codeTags"})}),t("button",{onClick:()=>{X(Pq,"strikethrough")},className:"toolbar-item spaced "+(T?"active":""),"aria-label":"Format Strikethrough",children:t(Za,{name:"strikethroughS"})}),t(M2,{}),t("button",{onClick:()=>{X(Zq,"left")},className:"toolbar-item spaced "+("left"==y?"active":""),"aria-label":"Left Align",children:t(Za,{name:"formatAlignLeft"})}),t("button",{onClick:()=>{X(Zq,"center")},className:"toolbar-item spaced "+("center"==y?"active":""),"aria-label":"Center Align",children:t(Za,{name:"formatAlignCenter"})}),t("button",{onClick:()=>{X(Zq,"right")},className:"toolbar-item spaced "+("right"==y?"active":""),"aria-label":"Right Align",children:t(Za,{name:"formatAlignRight"})}),t("button",{onClick:()=>{X(Zq,"justify")},className:"toolbar-item spaced "+("justify"==y?"active":""),"aria-label":"Justify Align",children:t(Za,{name:"formatAlignJustify"})}),t(M2,{}),t(y2,{buttonClassName:"toolbar-item",buttonAriaLabel:"Formatting text color",buttonLabel:t(Za,{name:"formatColorText"}),color:h,onChange:H,title:"text color"}),t(y2,{buttonClassName:"toolbar-item",buttonAriaLabel:"Formatting background color",buttonLabel:t(Za,{name:"formatColorFill"}),color:f,onChange:W,title:"bg color"})]})}));function P2({onChange:t}){const[e]=S1();return i.useEffect((()=>e.registerUpdateListener((({editorState:n})=>{t(n,e)}))),[e,t]),null}const T2=a((({onChange:r,...i})=>{const[o]=S1();return t(B,{direction:"vertical",dimensionX:"fill",dimensionY:472,alignment:"leftTop",...i,children:e(n,{children:[t(O2,{editor:o}),t(z1,{contentEditable:t(B1,{className:O1}),ErrorBoundary:G1}),t(P2,{onChange:r}),t(X1,{}),t(P1,{})]})})}));var N2=a((({className:n="",value:r="<p></p>",headerProps:i,description:o,onChange:a,contentProps:s})=>{const l=(t,e)=>(((t,e)=>{const n=EZ(),r=B0(t,(new DOMParser).parseFromString(e,"text/html"));n.clear();try{n.append(...r)}catch{const t=fQ();t.append(...r),n.append(t)}})(t,e),t),u={namespace:"RichTextInput",onError:t=>{console.error("Lexical Error:",t)},editorState:t=>l(t,r),nodes:[bQ,{replace:FK,with:t=>new bQ(t.__text)},D0,C0,d1,c1,o0,p0]},d=c(((t,e)=>{t.read((()=>{const t=H0(e,null);a?.(t)}))}),[a]);return e(B,{className:`${gq} ${n}`,dimensionX:"fill",direction:"vertical",children:[i&&t(ED,{prefix:{children:i?.icon&&t(Za,{name:i?.icon}),...i?.iconProps},root:{children:i?.label&&t(V,{children:i?.label}),...i?.labelProps},...i?.container}),t(M1,{initialConfig:u,children:t(T2,{...s,onChange:d})}),t(V,{size:"xsmall",className:`${vq}`,children:o})]})})),D2={container:"ObjectInput-module_container__JtW64",error:"ObjectInput-module_error__z1cTE",inputContainer:"ObjectInput-module_inputContainer__Kjm9k"};var A2=a((({value:n,properties:r,title:i,description:o,errorMessage:a,helperTextContainerProps:s,helperTextProps:l,onChange:c,errors:u,...d})=>{const h=I5({properties:r,value:n,onChange:c,error:u,errorClassName:D2.error,containerClassName:D2.inputContainer});return e(B,{gap:20,direction:"vertical",dimensionX:"fill",...d,className:`${d.className} ${D2.container}`,children:[i&&t(ED,{prefix:{children:t(Za,{name:"dataObject",className:D2.icon})},root:{children:t(V,{variant:"secondary",children:i})}}),h,t(at.HelperText,{alignment:"leftCenter",dimensionX:"fill",...s,className:`${D2.helperText} ${s?.className}`,children:t(V,{...l,size:"small",variant:a?"danger":"secondary",className:`${l?.className}`,children:a||o})})]})})),L2="ChipInput-module_chipInputContainer__wRY2y",I2="ChipInput-module_errorTextContainer__AQPXD",z2="ChipInput-module_errorText__Qw1NA";var R2,$2,F2,j2,B2,H2,W2,V2,Y2,X2,q2,U2,Z2,G2,K2,J2,Q2,t5,e5,n5,r5,i5,o5,a5,s5,l5,c5,u5,d5=a((({label:n,placeholder:r="Enter a value than press enter",onChange:i,value:o,allowDuplicateValues:a=!1,valueType:s="string",...c})=>{const[d,h]=u(""),[p,f]=u();l((()=>{f(void 0)}),[d]),l((()=>{let t=[];"number"===s?t=o.filter((t=>!isNaN(Number(t)))).map((t=>Number(t))):(t=o.map((t=>String(t))),f(void 0)),i(t)}),[s]);return e(B,{dimensionX:"fill",direction:"wrap",alignment:"leftCenter",...c,className:`${L2} ${c.className}`,children:[o.map(((e,n)=>t(em,{variant:"outlined",label:String(e),onDelete:()=>(t=>{const e=o.filter(((e,n)=>n!==t));i(e)})(n)},n))),t(G,{placeholder:r,value:d,onChange:t=>h(t.target.value),onKeyDown:t=>{if("Enter"===t.key&&""!==d.trim()){t.preventDefault();const e="number"===s?Number(d.trim()):d.trim();if("number"==typeof e&&isNaN(e))return void f("Value must be a valid number");if(!a&&o.includes(e))return;const n=[...o,e];i(n),h("")}}}),t("div",{className:I2,children:p&&t(V,{className:z2,variant:"danger",children:p})})," "]})})),h5="RelationInput-module_icon__folVL",p5="RelationInput-module_text__h8Gq5",f5="RelationInput-module_select__H7bRO",m5="RelationInput-module_baseInput__9cDeK",g5={container:"RelationSelect-module_container__nwkcp",disabled:"RelationSelect-module_disabled__37hiQ",displayer:"RelationSelect-module_displayer__-ispL",selectDropdown:"RelationSelect-module_selectDropdown__HAwgv",searchInputWrapper:"RelationSelect-module_searchInputWrapper__2XT5T",searchIcon:"RelationSelect-module_searchIcon__Wpvzz",searchInput:"RelationSelect-module_searchInput__Aihgm",deleteIcon:"RelationSelect-module_deleteIcon__l6plf"};function v5(){if($2)return R2;return $2=1,R2=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},R2}function y5(){if(H2)return B2;H2=1;var t=function(){if(j2)return F2;j2=1;var t="object"==typeof vt&&vt&&vt.Object===Object&&vt;return F2=t}(),e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return B2=n}function b5(){if(U2)return q2;U2=1;var t=function(){if(X2)return Y2;X2=1;var t=/\s/;return Y2=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n},Y2}(),e=/^\s+/;return q2=function(n){return n?n.slice(0,t(n)+1).replace(e,""):n},q2}function _5(){if(G2)return Z2;G2=1;var t=y5().Symbol;return Z2=t}function x5(){if(n5)return e5;n5=1;var t=_5(),e=function(){if(J2)return K2;J2=1;var t=_5(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,i=t?t.toStringTag:void 0;return K2=function(t){var e=n.call(t,i),o=t[i];try{t[i]=void 0;var a=!0}catch(t){}var s=r.call(t);return a&&(e?t[i]=o:delete t[i]),s}}(),n=function(){if(t5)return Q2;t5=1;var t=Object.prototype.toString;return Q2=function(e){return t.call(e)}}(),r=t?t.toStringTag:void 0;return e5=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":r&&r in Object(t)?e(t):n(t)}}function w5(){if(a5)return o5;a5=1;var t=x5(),e=i5?r5:(i5=1,r5=function(t){return null!=t&&"object"==typeof t});return o5=function(n){return"symbol"==typeof n||e(n)&&"[object Symbol]"==t(n)}}var S5=function(){if(u5)return c5;u5=1;var t=v5(),e=function(){if(V2)return W2;V2=1;var t=y5();return W2=function(){return t.Date.now()}}(),n=function(){if(l5)return s5;l5=1;var t=b5(),e=v5(),n=w5(),r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;return s5=function(s){if("number"==typeof s)return s;if(n(s))return NaN;if(e(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=e(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=t(s);var c=i.test(s);return c||o.test(s)?a(s.slice(2),c?2:8):r.test(s)?NaN:+s}}(),r=Math.max,i=Math.min;return c5=function(o,a,s){var l,c,u,d,h,p,f=0,m=!1,g=!1,v=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function y(t){var e=l,n=c;return l=c=void 0,f=t,d=o.apply(n,e)}function b(t){var e=t-p;return void 0===p||e>=a||e<0||g&&t-f>=u}function _(){var t=e();if(b(t))return x(t);h=setTimeout(_,function(t){var e=a-(t-p);return g?i(e,u-(t-f)):e}(t))}function x(t){return h=void 0,v&&l?y(t):(l=c=void 0,d)}function w(){var t=e(),n=b(t);if(l=arguments,c=this,p=t,n){if(void 0===h)return function(t){return f=t,h=setTimeout(_,a),m?y(t):d}(p);if(g)return clearTimeout(h),h=setTimeout(_,a),y(p)}return void 0===h&&(h=setTimeout(_,a)),d}return a=n(a)||0,t(s)&&(m=!!s.leading,u=(g="maxWait"in s)?r(n(s.maxWait)||0,a):u,v="trailing"in s?!!s.trailing:v),w.cancel=function(){void 0!==h&&clearTimeout(h),f=0,l=p=c=h=void 0},w.flush=function(){return void 0===h?d:x(e())},w},c5}(),k5=yt(S5),C5=function(t,e){return C5=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},C5(t,e)};var E5=function(){return E5=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},E5.apply(this,arguments)};var M5="Pixel",O5="Percent",P5={unit:O5,value:.8};function T5(t){return"number"==typeof t?{unit:O5,value:100*t}:"string"==typeof t?t.match(/^(\d*(\.\d+)?)px$/)?{unit:M5,value:parseFloat(t)}:t.match(/^(\d*(\.\d+)?)%$/)?{unit:O5,value:parseFloat(t)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),P5):(console.warn("scrollThreshold should be string or number"),P5)}var N5=function(t){function e(e){var n=t.call(this,e)||this;return n.lastScrollTop=0,n.actionTriggered=!1,n.startY=0,n.currentY=0,n.dragging=!1,n.maxPullDownDistance=0,n.getScrollableTarget=function(){return n.props.scrollableTarget instanceof HTMLElement?n.props.scrollableTarget:"string"==typeof n.props.scrollableTarget?document.getElementById(n.props.scrollableTarget):(null===n.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)},n.onStart=function(t){n.lastScrollTop||(n.dragging=!0,t instanceof MouseEvent?n.startY=t.pageY:t instanceof TouchEvent&&(n.startY=t.touches[0].pageY),n.currentY=n.startY,n._infScroll&&(n._infScroll.style.willChange="transform",n._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},n.onMove=function(t){n.dragging&&(t instanceof MouseEvent?n.currentY=t.pageY:t instanceof TouchEvent&&(n.currentY=t.touches[0].pageY),n.currentY<n.startY||(n.currentY-n.startY>=Number(n.props.pullDownToRefreshThreshold)&&n.setState({pullToRefreshThresholdBreached:!0}),n.currentY-n.startY>1.5*n.maxPullDownDistance||n._infScroll&&(n._infScroll.style.overflow="visible",n._infScroll.style.transform="translate3d(0px, "+(n.currentY-n.startY)+"px, 0px)")))},n.onEnd=function(){n.startY=0,n.currentY=0,n.dragging=!1,n.state.pullToRefreshThresholdBreached&&(n.props.refreshFunction&&n.props.refreshFunction(),n.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame((function(){n._infScroll&&(n._infScroll.style.overflow="auto",n._infScroll.style.transform="none",n._infScroll.style.willChange="unset")}))},n.onScrollListener=function(t){"function"==typeof n.props.onScroll&&setTimeout((function(){return n.props.onScroll&&n.props.onScroll(t)}),0);var e=n.props.height||n._scrollableNode?t.target:document.documentElement.scrollTop?document.documentElement:document.body;n.actionTriggered||((n.props.inverse?n.isElementAtTop(e,n.props.scrollThreshold):n.isElementAtBottom(e,n.props.scrollThreshold))&&n.props.hasMore&&(n.actionTriggered=!0,n.setState({showLoader:!0}),n.props.next&&n.props.next()),n.lastScrollTop=e.scrollTop)},n.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:e.dataLength},n.throttledOnScrollListener=function(t,e,n,r){var i,o=!1,a=0;function s(){i&&clearTimeout(i)}function l(){var l=this,c=Date.now()-a,u=arguments;function d(){a=Date.now(),n.apply(l,u)}o||(r&&!i&&d(),s(),void 0===r&&c>t?d():!0!==e&&(i=setTimeout(r?function(){i=void 0}:d,void 0===r?t-c:t)))}return"boolean"!=typeof e&&(r=n,n=e,e=void 0),l.cancel=function(){s(),o=!0},l}(150,n.onScrollListener).bind(n),n.onStart=n.onStart.bind(n),n.onMove=n.onMove.bind(n),n.onEnd=n.onEnd.bind(n),n}return function(t,e){function n(){this.constructor=t}C5(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},e.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},e.prototype.componentDidUpdate=function(t){this.props.dataLength!==t.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},e.getDerivedStateFromProps=function(t,e){return t.dataLength!==e.prevDataLength?E5(E5({},e),{prevDataLength:t.dataLength}):null},e.prototype.isElementAtTop=function(t,e){void 0===e&&(e=.8);var n=t===document.body||t===document.documentElement?window.screen.availHeight:t.clientHeight,r=T5(e);return r.unit===M5?t.scrollTop<=r.value+n-t.scrollHeight+1:t.scrollTop<=r.value/100+n-t.scrollHeight+1},e.prototype.isElementAtBottom=function(t,e){void 0===e&&(e=.8);var n=t===document.body||t===document.documentElement?window.screen.availHeight:t.clientHeight,r=T5(e);return r.unit===M5?t.scrollTop+n>=t.scrollHeight-r.value:t.scrollTop+n>=r.value/100*t.scrollHeight},e.prototype.render=function(){var t=this,e=E5({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),r=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return i.createElement("div",{style:r,className:"infinite-scroll-component__outerdiv"},i.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(e){return t._infScroll=e},style:e},this.props.pullDownToRefresh&&i.createElement("div",{style:{position:"relative"},ref:function(e){return t._pullDown=e}},i.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},e}(S);var D5=a((({options:r,placeholder:i="Select an option",placement:a="bottom",multiple:c=!1,disabled:h=!1,maxCount:p,popupClassName:m="",optionProps:g,selectRef:v,disableClick:y,onChange:_,loadMoreOptions:x,searchOptions:w,totalOptionsLength:S,selectedOption:k,setSelectedOption:C,dropDownRef:E,...M})=>{const[O,P]=u(0),[T,N]=u(!1),[D,A]=u(""),L=o((()=>k5((t=>{w(t)}),1e3)),[w]);l((()=>()=>{L.cancel()}),[L]),l((()=>{L(D)}),[D]);const I=s(null),z=()=>{y||N(!1)};J({targetElements:[I],onClickOutside:z});const{targetPosition:R,calculatePosition:$}=Q({containerRef:I,targetRef:E,initialPlacement:a});d((()=>{I.current&&P(I.current.offsetWidth-50)}),[]),d((()=>{T&&I.current&&E?.current&&$()}),[T,r,$]);const F=t=>{c?(()=>{if(!Array.isArray(k))return;const e=Boolean(k.find((e=>e.value===t.value&&e.label===t.label)))?k.filter((e=>e.value!==t.value)):[...k,t];C(e),_?.(e)})():(C(t),_?.(t),N(!1))};b(v,(()=>({toggleDropdown:W,clear:j})));const j=()=>{C([]),_?.([]),N(!1)},W=t=>{N(void 0===t?t=>!t:t)},Y=f();return e(n,{children:[t(H,{ref:I,onClick:()=>{h||y||W()},dimensionX:"fill",dimensionY:36,root:{children:t(V,{style:{maxWidth:O,...M.root?.style},className:`${M.root?.className} ${g5.displayer}`,children:(!c||Array.isArray(k)&&k.length)&&"object"==typeof r[0]?k?.map?.((e=>t(em,{variant:"outlined",label:e.label,onDelete:()=>F(e)},`${e.value}${e.label}`)))??k?.label??i:i}),dimensionX:"fill",alignment:"leftCenter"},suffix:{onClick:t=>{t.stopPropagation(),C(c?[]:null)},children:t(Za,{className:g5.deleteIcon,name:"delete",size:"sm"})},...M,className:`${M.className} ${g5.container} ${h&&g5.disabled}`}),T&&t(fD,{onClickOutside:z,children:t(B,{ref:E,style:{...R},className:`${m} ${g5.selectDropdown}`,direction:"vertical",alignment:"leftTop",gap:0,id:Y,children:e(N5,{dataLength:r.length,next:x,hasMore:S>r.length,loader:t(bs,{size:"small"}),scrollableTarget:Y,className:g5.infiniteScroll,children:[t("div",{className:g5.searchInputWrapper,children:t(K,{gap:10,dimensionX:400,prefix:{children:t(Za,{name:"magnify",className:g5.searchIcon})},inputProps:{placeholder:"Search",value:D,onChange:t=>A(t.target.value)},className:g5.searchInput})}),r.map((e=>{const n="object"==typeof e?e.value:e,r=c?Array.isArray(k)&&Boolean(k.find((t=>t.value===e.value&&t.label===e.label))):k===e,i=c&&!!p&&Array.isArray(k)&&k.length>=p&&!r;return t(dA,{disabled:i,dimensionX:I.current?.offsetWidth,multiple:c,option:e,selected:r,onClick:()=>F(e),...g},n.toString())}))]})})})]})}));var A5=a((({label:e,description:n,value:r,onChange:i,selectProps:o,inputContainerClassName:a,getOptions:c,loadMoreOptions:d,searchOptions:h,totalOptionsLength:p,multiple:f,...m})=>{const g=s(null),v=s(null),[y,b]=u([]),[_,x]=u((()=>r||(f?[]:null)));l((()=>{(r||0===r||""===r)&&x(r)}),[r]);l((()=>{c().then((t=>b(t)))}),[]);return t(ht,{dimensionX:"fill",description:n,dropDownRef:v,onFocusChange:t=>(t=>{g?.current?.toggleDropdown(t)})(t),labelProps:{dimensionX:"hug",divider:!0,prefix:{children:t(Za,{className:h5,name:"callMerge"})},root:{dimensionX:"hug",children:t(V,{className:p5,size:"medium",children:e})}},inputContainerProps:{className:`${m5} ${a}`},...m,children:t(D5,{totalOptionsLength:p,selectRef:g,disableClick:!0,options:y||[],placeholder:"",multiple:f,onChange:t=>{i?.(t)},...o,className:`${f5} ${o?.className}`,loadMoreOptions:()=>{d().then((t=>b([...y,...t])))},searchOptions:t=>{h(t).then((t=>{b(t)}))},selectedOption:_,setSelectedOption:x,dropDownRef:v})})}));const L5={string:e=>t($Y,{label:e.title,description:e.description,inputContainerClassName:e.className,value:e.value,options:e.enum,onChange:t=>{e.onChange?.({key:e.key,value:t})}}),number:e=>t(VY,{label:e.title,description:e.description,inputContainerClassName:e.className,value:e.value,options:e.enum,onChange:t=>e.onChange?.({key:e.key,value:t})}),textarea:e=>t(ZY,{title:e.title,titlePrefixProps:{children:t(Za,{name:"formatSize"})},containerProps:{className:e.className},value:e.value,onChange:t=>e.onChange?.({key:e.key,value:t.target.value})}),date:e=>t(GY,{label:e.title,description:e.description,inputContainerClassName:e.className,value:e.value,onChange:t=>e.onChange?.({key:e.key,value:t})}),boolean:e=>t(QY,{checked:e.value,label:e.title,description:e.description,containerProps:{dimensionX:"fill"},onChange:t=>e.onChange?.({key:e.key,value:t}),size:e.size}),color:e=>t(eX,{label:e.title,description:e.description,inputContainerClassName:e.className,value:e.value,onChange:t=>e.onChange?.({key:e.key,value:t})}),storage:e=>t(oq,{onUpload:()=>{},label:e.title,containerProps:{className:e.className}}),multiselect:e=>t(uq,{label:e.title,description:e.description,inputContainerClassName:e.className,value:e.value,options:e.enum,onChange:t=>e.onChange?.({key:e.key,value:t})}),location:e=>{if(mW.api.isTypeLocation(e.value)){const t=e?.value.coordinates;e.value={lat:t[1],lng:t[0]}}return t(mq,{title:e.title,dimensionX:"fill",coordinates:e.value,onChange:t=>{let n=t;mW.api.isTypeLocation(e.value)&&(n={type:"Point",coordinates:[t.lng,t.lng]}),e.onChange?.({key:e.key,value:n})}})},richtext:e=>t(N2,{headerProps:{label:e.title,icon:"formatAlignCenter"},value:e.value,onChange:t=>e.onChange?.({key:e.key,value:t})}),object:e=>t(A2,{properties:e.properties,title:e.title,description:e.description,value:e.value,onChange:t=>{e.onChange?.({key:e.key,value:t})},errors:e.errors}),array:e=>t(z5,{title:e.title,description:e.description,value:e.value,onChange:t=>e.onChange?.({key:e.title,value:t}),minItems:e.minItems,maxItems:e.maxItems,items:e.items,propertyKey:e.key,errors:e.errors}),chip:e=>t(d5,{value:e.value??[],onChange:t=>{e.onChange?.({key:e.key,value:t})},valueType:e.valueType}),relation:e=>t(A5,{value:e.value,onChange:t=>e.onChange?.({key:e.key,value:t}),label:e.title,getOptions:e.getOptions,loadMoreOptions:e.loadMoreOptions,searchOptions:e.searchOptions,totalOptionsLength:e.totalOptionsLength}),select:e=>t(YA,{options:e.enum,value:e.value,onChange:t=>{e.onChange?.({key:e.key,value:t})}})},I5=({properties:n,value:r,error:i,onChange:o,containerClassName:a,errorClassName:s})=>{const l=Boolean(a||s);return Object.entries(n).map((([n,c])=>{const u="object"==typeof r&&!Array.isArray(r);if(u&&c.renderCondition){const{field:t}=c.renderCondition,e=r[t],n=(t,n=!1)=>{if(!(t in c.renderCondition))return!1;const r=c.renderCondition[t],i=Array.isArray(r)?r.includes(e):e===r;return n?i:!i};if(n("notEquals",!0)||n("equals"))return null}const d=u?r[n]??r:r,h=i?.[n];return e("div",{style:l?void 0:{position:"relative",width:"100%"},className:a,id:c.id??void 0,children:[L5[c.type]({key:n,title:c.title,description:c.description,value:d,className:c.className,properties:c.properties,enum:c.enum??c.items?.enum,minItems:c.minItems,maxItems:c.maxItems,items:c.items,onChange:t=>(t=>{const e=structuredClone(r);e[t.key]=t.value,o?.(e)})(t),getOptions:c.getOptions,loadMoreOptions:c.loadMoreOptions,searchOptions:c.searchOptions,totalOptionsLength:c.totalOptionsLength,size:c.size,valueType:c.valueType,errors:"string"==typeof h?void 0:h}),h&&"string"==typeof h&&t(V,{className:s,style:l?void 0:{position:"absolute",bottom:0,left:0,pointerEvents:"none",whiteSpace:"nowrap"},size:"xsmall",variant:"danger",children:h})]},n)}))};var z5=a((({value:n,items:r,title:i,description:o,errorMessage:a,helperTextContainerProps:s,helperTextProps:l,maxItems:d,propertyKey:h,onChange:p,errors:f,minItems:m,...g})=>{const[v,y]=u(0),b=I5({properties:{[h]:r},value:{[h]:n?.[v]},onChange:t=>{const e=structuredClone(n);if(!e?.length)return n;e[v]=t[h],p?.(e)},error:f}),_=c(((t,e,n)=>{if(n&&n.length>0)return n[0];switch(t){case"string":case"textarea":case"richtext":case"color":case"storage":case"select":case"date":default:return"";case"multiselect":case"chip":case"relation":case"array":return[];case"number":return 0;case"boolean":return!1;case"location":return{lat:0,lng:0};case"object":if(!e)return{};const t={};return Object.entries(e).forEach((([e,n])=>{t[e]=void 0!==n.default?n.default:_(n.type,n.properties,n.enum)})),t}}),[]),x=c((()=>r?_(r.type,r.properties,r.enum):""),[r,_]);return e(B,{gap:20,direction:"vertical",dimensionX:"fill",...g,className:`${g.className} ${DY.container}`,children:[e("div",{className:DY.header,children:[i&&t(ED,{prefix:{children:t(Za,{name:"ballot",className:DY.icon})},root:{children:t(V,{variant:"secondary",children:i})}}),t(kD,{length:n?.length,active:v,maxItems:d,onChange:t=>{y(t)},onCreate:()=>{const t=[...n||[]];t?.push(n?.[v]||x()),p?.(t),y(t.length-1)},onDelete:t=>{const e=[...n||[]];e.splice(t,1),p?.(e),y(Math.max(0,t-1))}})]}),n?.length?b:"Create an element to see the fields",t(at.HelperText,{alignment:"leftCenter",dimensionX:"fill",...s,className:`${DY.helperText} ${s?.className}`,children:t(V,{...l,size:"small",variant:a?"danger":"secondary",className:`${l?.className}`,children:a||o})})]})}));const R5=({propertyKey:e,value:n,items:r,popoverProps:i,contentProps:o,...a})=>t(mD,{content:t(z5,{propertyKey:e,items:r,value:n,onChange:t=>a.onChange?.({key:a.key,value:t}),...o}),contentProps:{className:TY},containerProps:{dimensionX:"fill"},...i,children:t(B,{dimensionX:"fill",alignment:"leftCenter",dimensionY:36,...a,className:`${a.className} ${PY}`,children:t(V,{className:NY,children:JSON.stringify(n)})})});var $5=a((({checked:e,disabled:n=!1,containerProps:r,onChange:i})=>t(wA,{checked:e,disabled:n,...r,onChange:i}))),F5="ColorMinimized-module_colorMinimized__CnRpu",j5="ColorMinimized-module_closeIcon__SH3uo";const B5=({value:e="#000000",onClear:n,onChange:r,...i})=>{const[o,a]=u(e);return t(H,{alignment:"leftCenter",dimensionX:"fill",className:F5,...i,root:{dimensionX:"fill",alignment:"leftCenter",children:t(rm,{value:o||"#000000",onChange:t=>{a(t),r?.(t)}}),...i.root},suffix:{dimensionX:"hug",alignment:"center",children:t(_s,{children:t(Za,{name:"close"}),color:"transparent",onClick:t=>{t.preventDefault(),t.stopPropagation(),a(""),r?.(""),n?.()},className:j5}),...i.suffix}})};var H5="Date-module_minimizedDatePicker__ZIsQ7",W5="Date-module_clearButton__WMLse";const V5=({onChange:e,value:n,placeholder:r="",onClear:i,datePickerClassName:o,...a})=>t(H,{mode:"fill",dimensionX:"fill",gap:10,...a,className:`${H5} ${a.className}`,root:{alignment:"leftCenter",children:t(oD,{onChange:t=>{e?.(new Date(t))},value:n,placeholder:r,suffixIcon:null,allowClear:!1,className:o}),...a.root},suffix:{...a.suffix,children:t(_s,{variant:"text",className:W5,keepWidth:!1,onClick:i,children:t(Za,{name:"close"})})}});var Y5="Location-module_container__SbKlF";const X5=({contentProps:n,mapProps:r,icon:i,...o})=>t(mD,{content:t(ZD,{...r}),contentProps:n,containerProps:{dimensionX:"fill",alignment:"leftCenter",...o},children:t(H,{dimensionX:"fill",dimensionY:"fill",prefix:{children:i||t("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAStSURBVHgBNZXZblNXFIa/vc88+NiJDSEDbQCVAheFtmp7Gy6rSn2DCt4EeBLKG7TqZWmLVKnTRYWYKYiEEEicxLN9Jp+hK1HrC8vS2fv3Wv//rXUU/312Nx9uGOX0Bv7SlbmyW7b2QZdoDXmeQtylceI8tVLM0py86hIYJ+S5cW8WZ3fW1pa/PdLRR19v3nZvaEP/YoTLG4YVtOqqJi9SLMvCMCx6xiLa7ZDOC+bJmHI+J8JBGyazWm9MDPv2aDC4caSl9rf/ua6CpduHB29ZbjfI0plcblOWFVVV4jgO6XgHb/FDxsNXNO0BuXkRRSVnE6Iokg5y/EZAnGRXda7Da249YNHJMFVFXLnU6SF2+gZbxPKyxMgz4ne/49cz4omW50+xzJoojKAqjkV7ewcU2eCoUzbmuknlnqJyOijtYPonmCQlbtlDpT3Mk5cIVj6j4dr0sgbKWiGb9hjvP+Ggsnk2vkvXtuR8fkUXtke31JhOiJo+xCKlloY6731EYp2iNCrqKiOdxsTa4PTpBfG1RWNhjR3W8fM9DruXOa96cjdpaX/2F6eNXNT7TNOGpCfe1TCZTnDj54TBCvnoLWbyGNc9g22kFJNX9AcDLi7GmFLMpeaUF1NFXQ+PqOgwiAUDmkyjAwlkJh71cE3FVhxiJZuYhiJc/Zy0/4j9vRzHRAiwGcYllBkT3SF0FIV7BT1q+RSNV9jvDkjdEfs//UyjIW2l2zR1we4sIBTzi8Mn1NK+b045tN4nEYSWFlfpiWjW32IhOMVQyFDx+LB+Mv2R7laMvXyednOPTtLBitaxYxO7OGSSG6T+Kg1x94/9LT5ZXJaEHeQ+2bwWOiTsWjDKp+g98adSmtUPPLQK2f1tzNwLYWygLZ+tbJWWM6TtxMyLgqvtjNCV9mqDWe81kSN2yW872yEIIrEssvGtWgy1aHnPWPyiZC118X1P0jRZ05tgn4XZA3TRozaXUZl4rQyiwOegPwRTYLdOUo3fSBEJ7L8uhPIea/PzXDS/oT89IJ92mXc3qU4uSVtjDOsCDf0dOE10uI4pQ5taS2JCSDbSUrUWQhRq1N+p8/gxufqYTNKsy23aoSyB8XNs8bE/eSZXouMRHFVtPIF72uvRkJQzDEaNB0LFpzSLMVomSeeZhW+sYlYDOsU2C95ZOSZGuzvUkx9E6k9s3UfZDsXua8q8ZjP4ntL1sSUYZ3SBllHiWTliMdpTu8Ot+RC3tYIKOpTJSxw1ocjXwbNR5QYzfYZR4tE6u0JcxLjJ15LsRCDWMq4e+4WUIEi6koWudXg/8FpiiJibTlDmEv3cl5FzmeuvKKJz2FYkocnqqiMCqXSpesvr0V1I9jlhx6waM6Z5iXIX7mnZELeMapm/5y0m1iqW25Iqh7LzKvrDEVb2lJkcbmbPcPNNHFth2Gu0/S+Zy0zX6qjNNkoKGMTGHXW8rV/8elPbizfyiQhYEozhSJoRbVv+GZNhXdO0lmXBCsj9lwJ1QC5UmAJ4NRCULNmFur517v3LN9X/r4Cd7Z3rbmhfc73mxmzvEZl7lrDcoTQXZOUlx0h4ns8wS3D8JXQWY6hiWCSj+0Fr/dbCgnfvSOdfUypD2h2KlUYAAAAASUVORK5CYII=",alt:"location"})},root:{children:r?.coordinates&&e(V,{children:[r?.coordinates?.lat,", ",r?.coordinates?.lng," "]})},className:Y5})});var q5="MultiSelection-module_multiSelectionContainer__tUi2u",U5="MultiSelection-module_multiSelect__SA5u-";const Z5=({options:e,value:n,onChange:r,selectProps:i,...o})=>{const a=s(null);return t(H,{mode:"fill",dimensionX:"fill",root:{children:t(YA,{selectRef:a,prefix:{children:t(Za,{name:"chevronDown"})},suffix:{children:Array.isArray(n)&&n.length>0&&t(_s,{variant:"text",keepWidth:!1,onClick:t=>{t.preventDefault(),t.stopPropagation(),a?.current?.clear()},children:t(Za,{name:"close"})})},multiple:!0,options:e,value:n,onChange:t=>r?.(t),...i,className:U5})},...o,className:`${q5} ${o.className}`})};var G5="NumberMinimized-module_numberMinimized__o1ZAN",K5="NumberMinimized-module_select__yHQXe",J5="NumberMinimized-module_closeIcon__EgNTI";var Q5=a((({onClear:e,value:n,options:r,inputProps:i,onChange:o,...a})=>{const l=s(null),c=s(null);return t(H,{alignment:"leftCenter",dimensionX:"fill",className:G5,...a,root:{dimensionX:"fill",alignment:"leftCenter",children:r?t(YA,{selectRef:l,className:K5,placeholder:void 0!==n?String(n):"",value:n,options:r||[],onChange:t=>o?.(t)}):t(G,{ref:c,value:n??"",type:"number",...i,onChange:t=>o?.(Number(t.target.value))}),...a.root},suffix:{dimensionX:"hug",alignment:"center",children:t(_s,{children:t(Za,{name:"close"}),color:"transparent",onClick:t=>{t.preventDefault(),t.stopPropagation(),e?.(),l.current&&l.current.clear(),c.current&&(c.current.value="")},className:J5}),...a.suffix}})})),t3="Object-module_inputMinimized__JH1n-",e3="Object-module_contentContainer__y0Sfp",n3="Object-module_value__SJt70";const r3=({value:e,popoverProps:n,contentProps:r,properties:i,onChange:o,...a})=>t(mD,{content:t(A2,{properties:i,value:e,onChange:t=>o?.(t),...r}),contentProps:{className:e3},containerProps:{dimensionX:"fill"},...n,children:t(B,{dimensionX:"fill",alignment:"leftCenter",dimensionY:36,...a,className:`${a.className} ${t3}`,children:t(V,{className:n3,children:JSON.stringify(e)})})});var i3="RichText-module_richTextMinimized__LUAfH";const o3=({value:e,richTextProps:n,...r})=>t(mD,{content:t(N2,{value:e,contentProps:n}),containerProps:{dimensionX:"fill"},children:t(B,{dimensionX:"fill",alignment:"leftCenter",className:i3,...r,children:t(V,{children:e})})});var a3="StringMinimized-module_stringMinimized__m53JQ",s3="StringMinimized-module_select__uPgy-",l3="StringMinimized-module_closeIcon__N2ycP";var c3=a((({onClear:e,value:n,options:r,inputProps:i,enumOnChange:o,...a})=>t(H,{alignment:"leftCenter",dimensionX:"fill",className:a3,...a,root:{dimensionX:"fill",alignment:"leftCenter",children:r?t(YA,{className:s3,placeholder:n||" ",options:r||[],onChange:t=>o?.(String(t))}):t(G,{value:n,...i}),...a.root},suffix:{dimensionX:"hug",alignment:"center",children:t(_s,{children:t(Za,{name:"close"}),color:"transparent",onClick:e,className:l3}),...a.suffix}}))),u3="TextArea-module_textArea__VbAA6";const d3=({value:e,onClear:n,onChange:r,focusedRows:i=3,onFocus:o,onBlur:a,rows:s=1,cols:l=1,...c})=>{const[d,h]=u(!1);return t(H,{mode:"fill",dimensionX:"fill",root:{children:t("textarea",{value:e,onChange:t=>r?.(t.target.value),onFocus:()=>{h(!0),o?.(!0)},onBlur:()=>{h(!1),a?.(!1)},rows:d?i:s,cols:l})},suffix:{children:t(Za,{name:"close"})},...c,className:`${u3} ${c.className}`})};var h3=a((({selectClassName:e="",label:n="",options:r=[],onChange:i,...o})=>t(B,{...o,dimensionX:"fill",alignment:"leftCenter",children:t(YA,{className:e,placeholder:n,options:r,onChange:i||(()=>{})})}))),p3={drawerContainer:"Drawer-module_drawerContainer__ygAhi",contentContainer:"Drawer-module_contentContainer__Bku-Q",closeButton:"Drawer-module_closeButton__dw57X",leftPosition:"Drawer-module_leftPosition__kS7SQ",scrollableContent:"Drawer-module_scrollableContent__gAaIU",top:"Drawer-module_top__YhWtK",bottom:"Drawer-module_bottom__5nFWz",xs:"Drawer-module_xs__jAtGZ",sm:"Drawer-module_sm__Up7LN",md:"Drawer-module_md__cJcNU",lg:"Drawer-module_lg__c7C-6",xl:"Drawer-module_xl__r6s2-",full:"Drawer-module_full__maAwS",hug:"Drawer-module_hug__JzEGJ",left:"Drawer-module_left__NCP-V",right:"Drawer-module_right__X1qUr",leftToMiddle:"Drawer-module_leftToMiddle__UwTtm",slideFromLeft:"Drawer-module_slideFromLeft__PD3iU",rightToMiddle:"Drawer-module_rightToMiddle__-1zTg",slideFromRight:"Drawer-module_slideFromRight__y-9Lp",topToBottom:"Drawer-module_topToBottom__DlPXA",slideFromTop:"Drawer-module_slideFromTop__-c93O",bottomToTop:"Drawer-module_bottomToTop__b0ULm",slideFromBottom:"Drawer-module_slideFromBottom__uSm8d",shake:"Drawer-module_shake__pBbnG"};const f3=["xs","sm","md","lg","xl","full","hug"],m3=({placement:n,size:r="hug",children:i,showBackdrop:o=!0,backdropType:a="default",backdropClassName:s,backdropProps:c,showCloseButton:d=!0,isOpen:h=!1,onClose:p,portalClassName:f})=>{const[m,g]=u(h),[v,y]=u(!1),[b,_]=u(!1);l((()=>{g(h)}),[h]);const x=()=>{g(!1),p&&p()};if(!m)return null;const w={top:"topToBottom",right:"rightToMiddle",bottom:"bottomToTop",left:"leftToMiddle"}[n],S="number"==typeof r||"string"==typeof r&&!f3.includes(r),k=S?"left"===n||"right"===n?{width:"number"==typeof r?`${r}px`:r}:{height:"number"==typeof r?`${r}px`:r}:{};return t(fD,{className:f,children:e(B,{className:p3.drawerContainer,children:[t(oA,{showBackdrop:o,...c,className:s,onClick:()=>{"static"===a?(y(!0),_(!1),setTimeout((()=>{y(!1),_(!0)}),400)):x()}}),e("div",{className:`${p3.contentContainer} ${b?"":p3[w]} ${v?p3.shake:""} ${p3[n]} ${S?"":p3[r]}`,style:k,children:[d&&t(_s,{className:`${p3.closeButton} ${"right"===n?p3.leftPosition:p3.rightPosition}`,onClick:x,children:t(Za,{name:"close"}),variant:"icon"}),t("div",{className:p3.scrollableContent,children:i})]})]})})};var g3={container:"Tab-module_container__e6CN6",indicator:"Tab-module_indicator__UNCf0",item:"Tab-module_item__jpQZh",default:"Tab-module_default__qy-23",active:"Tab-module_active__687wz",underline:"Tab-module_underline__1gKBc",window:"Tab-module_window__vPuG0",root:"Tab-module_root__gGJhw"};var v3,y3=a((({type:n="default",items:r,indicatorClassName:i,indicatorMode:o="equal",value:a,onChange:c,...d})=>{const[h,p]=u(0),[f,m]=u([]),g=s(null),v=s([]);l((()=>{(a||0===a)&&p(a)}),[a]);l((()=>{const t=v.current.map((t=>(t?.offsetWidth||0)+("window"===n?5:20)));m(t)}),[r,o,n]);const y="fit"===o?f[h]||0:f[h]-2,b=f.slice(0,h).reduce(((t,e)=>t+e-5),0);return e(B,{ref:g,dimensionX:"fill",gap:"window"===n?0:20,...d,className:`${g3.container} ${g3[n]} ${d.className||""}`,children:["window"!==n&&t("div",{className:`${g3.indicator} ${i||""}`,style:{width:y,left:b}}),r.map(((e,r)=>t(H,{ref:t=>v.current[r]=t,dimensionX:"equal"===o?"fill":"hug",dimensionY:"fill",mode:"middle",prefix:{children:e.prefix?.children,...e.prefix,className:`${e.prefix?.className||""}`},root:{children:e.root?.children,...e.root,className:`${g3.root} ${e.root?.className||""}`},suffix:{children:e.suffix?.children,...e.suffix,className:`${e.suffix?.className||""}`},onClick:()=>(t=>{p(t),c?.(t)})(r),...e,className:`${g3.item} ${g3[n]} ${r===h?g3.active:""}`},r)))]})}));!function(t){t.camelToKebab=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),t.deepCopy=t=>JSON.parse(JSON.stringify(t)),t.capitalize=t=>t.charAt(0).toUpperCase()+t.slice(1)}(v3||(v3={}));const b3={light:{primary:"#1976d2",primaryLight:"#63a4ff",primaryDark:"#004ba0",danger:"#d32f2f",dangerLight:"#ff6659",dangerDark:"#9a0007",success:"#388e3c",successLight:"#6abf69",successDark:"#00600f",soft:"#f5f5f5",softLight:"#ffffff",softDark:"#c2c2c2",background:"#ffffff",menuBackground:"#f0f0f0",zebra:"#f9f9f9",border:"#e0e0e0",boxShadow:"rgba(0, 0, 0, 0.1)",fontPrimary:"#212121",fontSecondary:"#757575",inputBackground:"#ffffff",inputPlaceholder:"#9e9e9e",tonalOffset:.2},dark:{primary:"#90caf9",primaryLight:"#e3f2fd",primaryDark:"#42a5f5",danger:"#ef5350",dangerLight:"#ff867c",dangerDark:"#b61827",success:"#66bb6a",successLight:"#98ee99",successDark:"#338a3e",soft:"#121212",softLight:"#1e1e1e",softDark:"#000000",background:"#121212",menuBackground:"#1e1e1e",zebra:"#181818",border:"#333333",boxShadow:"rgba(0, 0, 0, 0.5)",fontPrimary:"#ffffff",fontSecondary:"#bdbdbd",inputBackground:"#333333",inputPlaceholder:"#757575",tonalOffset:.3}},_3={PRIMARY:"#1c1c50",BACKGROUND:"#f5f5f5",MENU_BACKGROUND:"#ffffff",ZEBRA:"f6f6f9",SUCCESS:"#21f412",DANGER:"#f41212",SOFT:"#f5f5f5",BORDER:"#d4d0d0",BOX_SHADOW:"#0000000d",FONT_PRIMARY:"#525252",FONT_SECONDARY:"#525252",INPUT_BACKGROUND:"#fafafa",INPUT_PLACEHOLDER:"#9b9b9b",TONAL_OFFSET:.2},x3=5,w3=10,S3=10,k3=16,C3="Inter",E3=t=>{v3.deepCopy(t);const e=M3(t.palette?.primary||_3.PRIMARY,t.palette?.tonalOffset),n=M3(t.palette?.success||_3.SUCCESS,t.palette?.tonalOffset),r=M3(t.palette?.danger||_3.DANGER,t.palette?.tonalOffset),i=M3(t.palette?.soft||_3.SOFT,t.palette?.tonalOffset),o=t.borderRadius?.base??x3,a=t.padding?.base??w3,s=t.gap?.base??S3,l=t.palette?.mode,c=l?b3[l]:void 0,u=(e,n)=>t.palette?.[e]||c?.[e]||n,d=(e,n)=>t.borderRadius?.[e]??o*n,h=(e,n)=>t.padding?.[e]??s*n,p=(e,n)=>t.gap?.[e]??a*n,f={palette:{primary:u("primary",e.base),primaryLight:u("primaryLight",e.light),primaryDark:u("primaryDark",e.dark),danger:u("danger",r.base),dangerLight:u("dangerLight",r.light),dangerDark:u("dangerDark",r.dark),success:u("success",n.base),successLight:u("successLight",n.light),successDark:u("successDark",n.dark),soft:u("soft",i.base),softLight:u("softLight",i.light),softDark:u("softDark",i.dark),background:u("background",_3.BACKGROUND),menuBackground:u("menuBackground",_3.MENU_BACKGROUND),zebra:u("zebra",_3.ZEBRA),border:u("border",_3.BORDER),boxShadow:u("boxShadow",_3.BOX_SHADOW),fontPrimary:u("fontPrimary",_3.FONT_PRIMARY),fontSecondary:u("fontSecondary",_3.FONT_SECONDARY),inputBackground:u("inputBackground",_3.INPUT_BACKGROUND),inputPlaceholder:u("inputPlaceholder",_3.INPUT_PLACEHOLDER),tonalOffset:u("tonalOffset",_3.TONAL_OFFSET)},borderRadius:{sm:d("sm",.6),md:d("md",1),lg:d("lg",2)},padding:{xs:h("xs",.25),sm:h("sm",.5),md:h("md",1),lg:h("lg",1.5),xl:h("xl",2)},gap:{xs:p("xs",.25),sm:p("sm",.5),md:p("md",1),lg:p("lg",1.5),xl:p("xl",2)},fontSize:t.fontSize||k3,fontFamily:t.fontFamily||C3};return(t=>{const e=document.documentElement,n=(t,n)=>{Object.entries(t).forEach((([t,r])=>{const i=v3.camelToKebab(t);if("string"==typeof r&&r.startsWith("#")){const t=mW.color.hexToRgb(r);e.style.setProperty(`--${n}-${i}-rgb`,t)}e.style.setProperty(`--${n}-${i}`,r)}))};n(t.palette,"color"),n(t.borderRadius,"border-radius"),n(t.padding,"padding"),n(t.gap,"gap"),e.style.setProperty("--oziko-font-size-base",`${t.fontSize}px`),e.style.setProperty("--oziko-font-family-base",t.fontFamily)})(f),f},M3=(t,e=.2)=>{const{h:n,s:r,l:i}=mW.color.hexToHSL(t),o="number"==typeof e?e:e.light,a="number"==typeof e?e:e.dark;return{base:t,light:mW.color.hslToHex(n,r,Math.min(1,i+o)),dark:mW.color.hslToHex(n,r,Math.max(0,i-a))}},O3=v(void 0),P3=()=>{const t=p(O3);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var T3,N3,D3;!function(t){t.isTypeLocation=t=>"object"==typeof t&&null!==t&&"string"==typeof t.type&&Array.isArray(t.coordinates)&&2===t.coordinates.length&&t.coordinates.every((t=>"number"==typeof t))}(T3||(T3={})),function(t){t.hexToHSL=t=>{let e=0,n=0,r=0;if(4===t.length)e=parseInt(t[1]+t[1],16),n=parseInt(t[2]+t[2],16),r=parseInt(t[3]+t[3],16);else{if(7!==t.length)throw new Error("Invalid HEX format");e=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16)}e/=255,n/=255,r/=255;const i=Math.max(e,n,r),o=Math.min(e,n,r);let a=0,s=0,l=(i+o)/2;if(i!==o){const t=i-o;switch(s=l>.5?t/(2-i-o):t/(i+o),i){case e:a=(n-r)/t+(n<r?6:0);break;case n:a=(r-e)/t+2;break;case r:a=(e-n)/t+4}a/=6}return{h:a,s:s,l:l}},t.hslToHex=(t,e,n)=>{const r=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t);let i,o,a;if(0===e)i=o=a=n;else{const s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;i=r(l,s,t+1/3),o=r(l,s,t),a=r(l,s,t-1/3)}return`#${Math.round(255*i).toString(16).padStart(2,"0")}${Math.round(255*o).toString(16).padStart(2,"0")}${Math.round(255*a).toString(16).padStart(2,"0")}`}}(N3||(N3={})),function(t){t.timeUnitsInSeconds={second:1,minute:60,hour:3600,day:86400,week:604800,month:2592e3,quarter:7776e3,year:31536e3},t.unitMapper=t=>t<=10?"second":t<=120?"minute":t<=2160?"hour":t<=43200?"day":t<=50400?"week":t<=1296e3?"month":t<=9331200?"quarter":"year",t.getDiffInMinutes=(t,e)=>Math.abs(e.getTime()-t.getTime())/6e4,t.formatDateToEnUs=t=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}).format(t)}(D3||(D3={}));export{RA as Accordion,z5 as ArrayInput,R5 as ArrayMinimizedInput,tt as Autocomplete,oA as Backdrop,ht as BaseInput,QY as BooleanInput,$5 as BooleanMinimizedInput,Qa as BucketFieldPopup,_s as Button,Uf as Chart,Qf as Checkbox,em as Chip,d5 as ChipInput,rm as Color,eX as ColorInput,B5 as ColorMinimizedInput,hY as Dashboard,pm as DashboardItem,GY as DateInput,V5 as DateMinimizedInput,oD as DatePicker,gD as Directory,m3 as Drawer,kD as DropList,h3 as EnumInput,B as FlexElement,H as FluidContainer,Za as Icon,G as Input,ED as InputHeader,K as InputWithIcon,OD as Json,Y as ListItem,ND as ListRow,mq as LocationInput,X5 as LocationMinimizedInput,ZD as Map,vY as MenuGroup,aA as Modal,uq as MultipleSelectionInput,Z5 as MultipleSelectionMinimizedInput,jA as NavigatorItem,VY as NumberInput,Q5 as NumberMinimizedInput,A2 as ObjectInput,r3 as ObjectMinimizedInput,mD as Popover,fD as Portal,A5 as RelationInput,N2 as RichTextInput,o3 as RichTextMinimizedInput,hm as Section,YA as Select,dA as SelectOption,bs as Spinner,GA as SsoButton,vA as StorageFileCard,NR as StorageFilter,oq as StorageInput,$Y as StringInput,c3 as StringMinimizedInput,wA as Switch,y3 as Tab,MY as Table,V as Text,ZY as TextAreaInput,d3 as TextAreaMinimizedInput,yW as Timeline,kA as Title,T3 as apiUtil,N3 as colorUtil,E3 as createTheme,v3 as helperUtils,D3 as timeUtil,Q as useAdaptivePosition,I5 as useInputRepresenter,dD as useKeyDown,J as useOnClickOutside,P3 as useTheme};
|
|
99
|
+
*/t.exports&&(t.exports=e),void 0!==vt&&(vt.Prism=e),e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",(function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))})),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var o={};o[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return t})),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(e),e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript,function(){if(void 0!==e&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var t={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},n="data-src-status",r="loading",i="loaded",o="pre[data-src]:not(["+n+'="'+i+'"]):not(['+n+'="'+r+'"])';e.hooks.add("before-highlightall",(function(t){t.selector+=", "+o})),e.hooks.add("before-sanity-check",(function(a){var s=a.element;if(s.matches(o)){a.code="",s.setAttribute(n,r);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=s.getAttribute("data-src"),u=a.language;if("none"===u){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=t[d]||d}e.util.setLanguage(l,u),e.util.setLanguage(s,u);var h=e.plugins.autoloader;h&&h.loadLanguages(u),function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?e(r.responseText):r.status>=400?n(function(t,e){return"✖ Error "+t+" while fetching file: "+e}(r.status,r.statusText)):n("✖ Error: File does not exist or is empty"))},r.send(null)}(c,(function(t){s.setAttribute(n,i);var r=function(t){var e=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(t||"");if(e){var n=Number(e[1]),r=e[2],i=e[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(s.getAttribute("data-range"));if(r){var o=t.split(/\r\n?|\n/g),a=r[0],c=null==r[1]?o.length:r[1];a<0&&(a+=o.length),a=Math.max(0,Math.min(a-1,o.length)),c<0&&(c+=o.length),c=Math.max(0,Math.min(c,o.length)),t=o.slice(a,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(a+1))}l.textContent=t,e.highlightElement(l)}),(function(t){s.setAttribute(n,"failed"),l.textContent=t}))}})),e.plugins.fileHighlight={highlight:function(t){for(var n,r=(t||document).querySelectorAll(o),i=0;n=r[i++];)e.highlightElement(n)}};var a=!1;e.fileHighlight=function(){a||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),a=!0),e.plugins.fileHighlight.highlight.apply(this,arguments)}}}()}(UQ)),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,e){var n={};n["language-"+e]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[e]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return t})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(t,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(t){return t=t.replace(/<inner>/g,(function(){return e})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+t+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(e){["url","bold","italic","strike","code-snippet"].forEach((function(n){e!==n&&(t.languages.markdown[e].inside.content.inside[n]=t.languages.markdown[n])}))})),t.hooks.add("after-tokenize",(function(t){"markdown"!==t.language&&"md"!==t.language||function t(e){if(e&&"string"!=typeof e)for(var n=0,r=e.length;n<r;n++){var i=e[n];if("code"===i.type){var o=i.content[1],a=i.content[3];if(o&&a&&"code-language"===o.type&&"code-block"===a.type&&"string"==typeof o.content){var s=o.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(s=(/[a-z][\w-]*/i.exec(s)||[""])[0].toLowerCase());a.alias?"string"==typeof a.alias?a.alias=[a.alias,l]:a.alias.push(l):a.alias=[l]}}else t(i.content)}}(t.tokens)})),t.hooks.add("wrap",(function(e){if("code-block"===e.type){for(var n="",r=0,i=e.classes.length;r<i;r++){var o=e.classes[r],c=/language-(.+)/.exec(o);if(c){n=c[1];break}}var u,d,h=t.languages[n];if(h)e.content=t.highlight((u=e.content,d=(d=u.replace(a,"")).replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(t,e){var n;if("#"===(e=e.toLowerCase())[0])return n="x"===e[1]?parseInt(e.slice(2),16):Number(e.slice(1)),l(n);var r=s[e];return r||t})),d),h,n);else if(n&&"none"!==n&&t.plugins.autoloader){var p="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());e.attributes.id=p,t.plugins.autoloader.loadLanguages(n,(function(){var e=document.getElementById(p);e&&(e.innerHTML=t.highlight(e.textContent,t.languages[n],n))}))}}}));var a=RegExp(t.languages.markup.tag.pattern.source,"gi"),s={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;t.languages.md=t.languages.markdown}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(t){var e=t.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}}(Prism);var ZQ;ZQ||(ZQ=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python);var GQ;GQ||(GQ=1,function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,(function(){return e}));e=e.replace(/<self>/g,(function(){return/[^\s\S]/.source})),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string}(Prism)),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(t){t.inside.interpolation.inside=Prism.languages.swift}));var KQ;KQ||(KQ=1,function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),t.languages.ts=t.languages.typescript}(Prism));var JQ;JQ||(JQ=1,function(t){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return e.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism));var QQ;QQ||(QQ=1,function(t){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return e.source}));t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return e.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}(Prism)),function(t){t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")&&t.default}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const t0=globalThis.Prism||window.Prism,e0=t=>{try{return!!t&&t0.languages.hasOwnProperty(t)}catch(t){return!1}};function n0(t,e){for(const n of t.childNodes){if(uG(n)&&n.tagName===e)return!0;n0(n,e)}return!1}const r0="data-language",i0="data-highlight-language";class o0 extends tQ{static getType(){return"code"}static clone(t){return new o0(t.__language,t.__key)}constructor(t,e){super(e),this.__language=t||void 0,this.__isSyntaxHighlightSupported=e0(t)}createDOM(t){const e=document.createElement("code");HQ(e,t.theme.code),e.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(e.setAttribute(r0,n),this.getIsSyntaxHighlightSupported()&&e.setAttribute(i0,n)),e}updateDOM(t,e,n){const r=this.__language,i=t.__language;return r?r!==i&&(e.setAttribute(r0,r),this.__isSyntaxHighlightSupported&&e.setAttribute(i0,r)):i&&(e.removeAttribute(r0),t.__isSyntaxHighlightSupported&&e.removeAttribute(i0)),!1}exportDOM(t){const e=document.createElement("pre");HQ(e,t._config.theme.code),e.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(e.setAttribute(r0,n),this.getIsSyntaxHighlightSupported()&&e.setAttribute(i0,n)),{element:e}}static importDOM(){return{code:t=>null!=t.textContent&&(/\r?\n/.test(t.textContent)||n0(t,"BR"))?{conversion:s0,priority:1}:null,div:()=>({conversion:l0,priority:1}),pre:()=>({conversion:s0,priority:0}),table:t=>h0(t)?{conversion:c0,priority:3}:null,td:t=>{const e=t,n=e.closest("table");return e.classList.contains("js-file-line")||n&&h0(n)?{conversion:u0,priority:3}:null},tr:t=>{const e=t.closest("table");return e&&h0(e)?{conversion:u0,priority:3}:null}}}static importJSON(t){return a0().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage()}}insertNewAfter(t,e=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const t=fQ();return this.insertAfter(t,e),t}const{anchor:i,focus:o}=t,a=(i.isBefore(o)?i:o).getNode();if(ZK(a)){let t=function(t){let e=t,n=t;for(;g0(n)||QK(n);)e=n,n=n.getPreviousSibling();return e}(a);const e=[];for(;;)if(QK(t))e.push(JK()),t=t.getNextSibling();else{if(!g0(t))break;{let n=0;const r=t.getTextContent(),i=t.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&e.push(m0(" ".repeat(n))),n!==i)break;t=t.getNextSibling()}}const n=a.splitText(i.offset)[0],r=0===i.offset?0:1,o=n.getIndexWithinParent()+r,s=a.getParentOrThrow(),l=[TK(),...e];s.splice(o,0,l);const c=e[e.length-1];c?c.select():0===i.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(function(t){return t instanceof o0}(a)){const{offset:e}=t.anchor;a.splice(e,0,[TK()]),a.select(e+1,e+1)}return null}canIndent(){return!1}collapseAtStart(){const t=fQ();return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}setLanguage(t){const e=this.getWritable();return e.__language=t||void 0,e.__isSyntaxHighlightSupported=e0(t),e}getLanguage(){return this.getLatest().__language}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}}function a0(t){return iG(new o0(t))}function s0(t){return{node:a0(t.getAttribute(r0))}}function l0(t){const e=t,n=d0(e);return n||function(t){let e=t.parentElement;for(;null!==e;){if(d0(e))return!0;e=e.parentElement}return!1}(e)?{node:n?a0():null}:{node:null}}function c0(){return{node:a0()}}function u0(){return{node:null}}function d0(t){return null!==t.style.fontFamily.match("monospace")}function h0(t){return t.classList.contains("js-file-line-container")}class p0 extends FK{constructor(t="",e,n){super(t,n),this.__highlightType=e}static getType(){return"code-highlight"}static clone(t){return new p0(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const e=this.getWritable();return e.__highlightType=t||void 0,e}canHaveFormat(){return!1}createDOM(t){const e=super.createDOM(t);return HQ(e,f0(t.theme,this.__highlightType)),e}updateDOM(t,e,n){const r=super.updateDOM(t,e,n),i=f0(n.theme,t.__highlightType),o=f0(n.theme,this.__highlightType);return i!==o&&(i&&WQ(e,i),o&&HQ(e,o)),r}static importJSON(t){return m0().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return a0()}}function f0(t,e){return e&&t&&t.codeHighlight&&t.codeHighlight[e]}function m0(t="",e){return iG(new p0(t,e))}function g0(t){return t instanceof p0}var v0=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function y0(t){return N0(t)&&$0(t.getFirstChild())}function b0(t){return T0().append(t)}function _0(t,e){t.splice(t.getChildrenSize(),0,e)}function x0(t,e){const n=t.getLastChild(),r=e.getFirstChild();n&&r&&y0(n)&&y0(r)&&(x0(n.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&t.append(...i),e.remove()}function w0(t){const e=new Set;if(y0(t)||e.has(t.getKey()))return;const n=t.getParent(),r=t.getNextSibling(),i=t.getPreviousSibling();if(y0(r)&&y0(i)){const n=i.getFirstChild();if($0(n)){n.append(t);const i=r.getFirstChild();$0(i)&&(_0(n,i.getChildren()),r.remove(),e.add(r.getKey()))}}else if(y0(r)){const e=r.getFirstChild();if($0(e)){const n=e.getFirstChild();null!==n&&n.insertBefore(t)}}else if(y0(i)){const e=i.getFirstChild();$0(e)&&e.append(t)}else if($0(n)){const e=T0(),o=R0(n.getListType());e.append(o),o.append(t),i?i.insertAfter(e):r?r.insertBefore(e):n.append(e)}}function S0(t){if(y0(t))return;const e=t.getParent(),n=e?e.getParent():void 0;if($0(n?n.getParent():void 0)&&N0(n)&&$0(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(t.is(r))n.insertBefore(t),e.isEmpty()&&n.remove();else if(t.is(i))n.insertAfter(t),e.isEmpty()&&n.remove();else{const r=e.getListType(),i=T0(),o=R0(r);i.append(o),t.getPreviousSiblings().forEach((t=>o.append(t)));const a=T0(),s=R0(r);a.append(s),_0(s,t.getNextSiblings()),n.insertBefore(i),n.insertAfter(a),n.replace(t)}}}function k0(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}class C0 extends tQ{static getType(){return"listitem"}static clone(t){return new C0(t.__value,t.__checked,t.__key)}constructor(t,e,n){super(n),this.__value=void 0===t?1:t,this.__checked=e}createDOM(t){const e=document.createElement("li"),n=this.getParent();return $0(n)&&"check"===n.getListType()&&M0(e,this,null),e.value=this.__value,E0(e,t.theme,this),e}updateDOM(t,e,n){const r=this.getParent();return $0(r)&&"check"===r.getListType()&&M0(e,this,t),e.value=this.__value,E0(e,n.theme,this),!1}static transform(){return t=>{if(N0(t)||v0(144),null==t.__checked)return;const e=t.getParent();$0(e)&&"check"!==e.getListType()&&null!=t.getChecked()&&t.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:O0,priority:0})}}static importJSON(t){return T0().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const e=this.createDOM(t._config);return e.style.textAlign=this.getFormatType(),{element:e}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let e=0;e<t.length;e++){const n=t[e];if(eQ(n)&&this.canMergeWith(n)){const t=n.getChildren();this.append(...t),n.remove()}else super.append(n)}return this}replace(t,e){if(N0(t))return super.replace(t);this.setIndent(0);const n=this.getParentOrThrow();if(!$0(n))return t;if(n.__first===this.getKey())n.insertBefore(t);else if(n.__last===this.getKey())n.insertAfter(t);else{const e=R0(n.getListType());let r=this.getNextSibling();for(;r;){const t=r;r=r.getNextSibling(),e.append(t)}n.insertAfter(t),t.insertAfter(e)}return e&&(eQ(t)||v0(139),this.getChildren().forEach((e=>{t.append(e)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),t}insertAfter(t,e=!0){const n=this.getParentOrThrow();if($0(n)||v0(39),N0(t))return super.insertAfter(t,e);const r=this.getNextSiblings();if(n.insertAfter(t,e),0!==r.length){const i=R0(n.getListType());r.forEach((t=>i.append(t))),t.insertAfter(i,e)}return t}remove(t){const e=this.getPreviousSibling(),n=this.getNextSibling();super.remove(t),e&&n&&y0(e)&&y0(n)&&(x0(e.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(t,e=!0){const n=T0().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,e),n}collapseAtStart(t){const e=fQ();this.getChildren().forEach((t=>e.append(t)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=N0(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(e),n.remove();const r=t.anchor,i=t.focus,o=e.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(o,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(o,i.offset,"element")}else n.insertBefore(e),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const e=this.getWritable();return e.__value=t,e}getChecked(){const t=this.getLatest();let e;const n=this.getParent();return $0(n)&&(e=n.getListType()),"check"===e?Boolean(t.__checked):void 0}setChecked(t){const e=this.getWritable();return e.__checked=t,e}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(null===t)return this.getLatest().__indent;let e=t.getParentOrThrow(),n=0;for(;N0(e);)e=e.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(t){"number"!=typeof t&&v0(117),(t=Math.floor(t))>=0||v0(199);let e=this.getIndent();for(;e!==t;)e<t?(w0(this),e++):(S0(this),e--);return this}canInsertAfter(t){return N0(t)}canReplaceWith(t){return N0(t)}canMergeWith(t){return N0(t)||mQ(t)}extractWithChild(t,e){if(!aJ(e))return!1;const n=e.anchor.getNode(),r=e.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===e.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return R0("bullet")}canMergeWhenEmpty(){return!0}}function E0(t,e,n){const r=[],i=[],o=e.list,a=o?o.listitem:void 0;let s;if(o&&o.nested&&(s=o.nested.listitem),void 0!==a&&r.push(...k0(a)),o){const t=n.getParent(),e=$0(t)&&"check"===t.getListType(),a=n.getChecked();e&&!a||i.push(o.listitemUnchecked),e&&a||i.push(o.listitemChecked),e&&r.push(a?o.listitemChecked:o.listitemUnchecked)}if(void 0!==s){const t=k0(s);n.getChildren().some((t=>$0(t)))?r.push(...t):i.push(...t)}i.length>0&&WQ(t,...i),r.length>0&&HQ(t,...r)}function M0(t,e,n,r){$0(e.getFirstChild())?(t.removeAttribute("role"),t.removeAttribute("tabIndex"),t.removeAttribute("aria-checked")):(t.setAttribute("role","checkbox"),t.setAttribute("tabIndex","-1"),n&&e.__checked===n.__checked||t.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function O0(t){if(t.classList.contains("task-list-item"))for(const e of t.children)if("INPUT"===e.tagName)return P0(e);const e=t.getAttribute("aria-checked");return{node:T0("true"===e||"false"!==e&&void 0)}}function P0(t){return"checkbox"!==t.getAttribute("type")?{node:null}:{node:T0(t.hasAttribute("checked"))}}function T0(t){return iG(new C0(void 0,t))}function N0(t){return t instanceof C0}class D0 extends tQ{static getType(){return"list"}static clone(t){const e=t.__listType||z0[t.__tag];return new D0(e,t.__start,t.__key)}constructor(t="number",e=1,n){super(n);const r=z0[t]||t;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=e}getTag(){return this.__tag}setListType(t){const e=this.getWritable();return e.__listType=t,e.__tag="number"===t?"ol":"ul",e}getListType(){return this.__listType}getStart(){return this.__start}setStart(t){const e=this.getWritable();return e.__start=t,e}createDOM(t,e){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,A0(r,t.theme,this),r}updateDOM(t,e,n){return t.__tag!==this.__tag||(A0(e,n.theme,this),!1)}static transform(){return t=>{$0(t)||v0(163),function(t){const e=t.getNextSibling();$0(e)&&t.getListType()===e.getListType()&&x0(t,e)}(t),function(t){const e="check"!==t.getListType();let n=t.getStart();for(const r of t.getChildren())N0(r)&&(r.getValue()!==n&&r.setValue(n),e&&null!=r.getLatest().__checked&&r.setChecked(void 0),$0(r.getFirstChild())||n++)}(t)}}static importDOM(){return{ol:()=>({conversion:I0,priority:0}),ul:()=>({conversion:I0,priority:0})}}static importJSON(t){return R0().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const e=this.createDOM(t._config,t);return uG(e)&&(1!==this.__start&&e.setAttribute("start",String(this.__start)),"check"===this.__listType&&e.setAttribute("__lexicalListType","check")),{element:e}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}append(...t){for(let e=0;e<t.length;e++){const n=t[e];if(N0(n))super.append(n);else{const t=T0();if($0(n))t.append(n);else if(eQ(n))if(n.isInline())t.append(n);else{const e=UK(n.getTextContent());t.append(e)}else t.append(n);super.append(t)}}return this}extractWithChild(t){return N0(t)}}function A0(t,e,n){const r=[],i=[],o=e.list;if(void 0!==o){const t=o[`${n.__tag}Depth`]||[],e=function(t){let e=1,n=t.getParent();for(;null!=n;){if(N0(n)){const t=n.getParent();if($0(t)){e++,n=t.getParent();continue}v0(40)}return e}return e}(n)-1,a=e%t.length,s=t[a],l=o[n.__tag];let c;const u=o.nested,d=o.checklist;if(void 0!==u&&u.list&&(c=u.list),void 0!==l&&r.push(l),void 0!==d&&"check"===n.__listType&&r.push(d),void 0!==s){r.push(...k0(s));for(let e=0;e<t.length;e++)e!==a&&i.push(n.__tag+e)}if(void 0!==c){const t=k0(c);e>1?r.push(...t):i.push(...t)}}i.length>0&&WQ(t,...i),r.length>0&&HQ(t,...r)}function L0(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(N0(r)){e.push(r);const t=r.getChildren();t.length>1&&t.forEach((t=>{$0(t)&&e.push(b0(t))}))}else e.push(b0(r))}return e}function I0(t){const e=t.nodeName.toLowerCase();let n=null;return"ol"===e?n=R0("number",t.start):"ul"===e&&(n=function(t){if("check"===t.getAttribute("__lexicallisttype")||t.classList.contains("contains-task-list"))return!0;for(const e of t.childNodes)if(uG(e)&&e.hasAttribute("aria-checked"))return!0;return!1}(t)?R0("check"):R0("bullet")),{after:L0,node:n}}const z0={ol:"number",ul:"bullet"};function R0(t="number",e=1){return iG(new D0(t,e))}function $0(t){return t instanceof D0}const F0={},j0={};function B0(t,e){const n=e.body?e.body.childNodes:[];let r=[];const i=[];for(let e=0;e<n.length;e++){const o=n[e];if(!V0.has(o.nodeName)){const e=Y0(o,t,i,!1);null!==e&&(r=r.concat(e))}}return function(t){for(const e of t)e.getNextSibling()instanceof dQ&&e.insertAfter(TK());for(const e of t){const t=e.getChildren();for(const n of t)e.insertBefore(n);e.remove()}}(i),r}function H0(t,e){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=EZ().getChildren();for(let i=0;i<r.length;i++)W0(t,r[i],n,e);return n.innerHTML}function W0(t,e,n,r=null){let i=null===r||e.isSelected(r);const o=eQ(e)&&e.excludeFromCopy("html");let a=e;if(null!==r){let t=_G(e);t=ZK(t)&&null!==r?CQ(r,t):t,a=t}const s=eQ(a)?a.getChildren():[],l=t._nodes.get(a.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(t,a):a.exportDOM(t);const{element:u,after:d}=c;if(!u)return!1;const h=document.createDocumentFragment();for(let n=0;n<s.length;n++){const o=s[n],a=W0(t,o,h,r);!i&&eQ(e)&&a&&e.extractWithChild(o,r,"html")&&(i=!0)}if(i&&!o){if((uG(u)||hG(u))&&u.append(h),n.append(u),d){const t=d.call(a,u);t&&(hG(u)?u.replaceChildren(t):u.replaceWith(t))}}else n.append(h);return i}const V0=new Set(["STYLE","SCRIPT"]);function Y0(t,e,n,r,i=new Map,o){let a=[];if(V0.has(t.nodeName))return a;let s=null;const l=function(t,e){const{nodeName:n}=t,r=e._htmlConversions.get(n.toLowerCase());let i=null;if(void 0!==r)for(const e of r){const n=e(t);null!==n&&(null===i||(i.priority||0)<=(n.priority||0))&&(i=n)}return null!==i?i.conversion:null}(t,e),c=l?l(t):null;let u=null;if(null!==c){u=c.after;const e=c.node;if(s=Array.isArray(e)?e[e.length-1]:e,null!==s){for(const[,t]of i)if(s=t(s,o),!s)break;s&&a.push(...Array.isArray(e)?e:[s])}null!=c.forChild&&i.set(t.nodeName,c.forChild)}const d=t.childNodes;let h=[];const p=(null==s||!rG(s))&&(null!=s&&gJ(s)||r);for(let t=0;t<d.length;t++)h.push(...Y0(d[t],e,n,p,new Map(i),s));return null!=u&&(h=u(h)),fG(t)&&(h=function(t,e,n){const r=t.style.textAlign,i=[];let o=[];for(let t=0;t<e.length;t++){const a=e[t];if(gJ(a))r&&!a.getFormat()&&a.setFormat(r),i.push(a);else if(o.push(a),t===e.length-1||t<e.length-1&&gJ(e[t+1])){const t=n();t.setFormat(r),t.append(...o),i.push(t),o=[]}}return i}(t,h,p?()=>{const t=new dQ;return n.push(t),t}:fQ)),null==s?h.length>0?a=a.concat(h):fG(t)&&function(t){return null!=t.nextSibling&&null!=t.previousSibling&&(pG(t.nextSibling)&&pG(t.previousSibling))}(t)&&(a=a.concat(TK())):eQ(s)&&s.append(...h),a}var X0=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function q0(t,e,n){const r=t.getData("application/x-lexical-editor");if(r)try{const t=JSON.parse(r);if(t.namespace===n._config.namespace&&Array.isArray(t.nodes))return U0(n,function(t){const e=[];for(let n=0;n<t.length;n++){const r=WJ(t[n]);ZK(r)&&MQ(r),e.push(r)}return e}(t.nodes),e)}catch(t){}const i=t.getData("text/html");if(i)try{return U0(n,B0(n,(new DOMParser).parseFromString(function(t){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:t=>t}).createHTML(t):t}(i),"text/html")),e)}catch(t){}const o=t.getData("text/plain")||t.getData("text/uri-list");if(null!=o)if(aJ(e)){const t=o.split(/(\r?\n|\t)/);""===t[t.length-1]&&t.pop();for(let e=0;e<t.length;e++){const n=_J();if(aJ(n)){const r=t[e];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([JK()]):n.insertText(r)}}}else e.insertRawText(o)}function U0(t,e,n){t.dispatchCommand(bq,{nodes:e,selection:n})||n.insertNodes(e)}function Z0(t,e,n,r=[]){let i=null===e||n.isSelected(e);const o=eQ(n)&&n.excludeFromCopy("html");let a=n;if(null!==e){let t=_G(n);t=ZK(t)&&null!==e?CQ(e,t):t,a=t}const s=eQ(a)?a.getChildren():[],l=function(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&X0(58,n.name),eQ(t)){const t=e.children;Array.isArray(t)||X0(59,n.name)}return e}(a);if(ZK(a)){const t=a.__text;t.length>0?l.text=t:i=!1}for(let r=0;r<s.length;r++){const o=s[r],a=Z0(t,e,o,l.children);!i&&eQ(n)&&a&&n.extractWithChild(o,e,"clone")&&(i=!0)}if(i&&!o)r.push(l);else if(Array.isArray(l.children))for(let t=0;t<l.children.length;t++){const e=l.children[t];r.push(e)}return i}let G0=null;async function K0(t,e,n){if(null!==G0)return!1;if(null!==e)return new Promise(((r,i)=>{t.update((()=>{r(J0(t,e,n))}))}));const r=t.getRootElement(),i=null==t._window?window.document:t._window.document,o=lG(t._window);if(null===r||null===o)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const s=new Range;return s.setStart(a,0),s.setEnd(a,1),o.removeAllRanges(),o.addRange(s),new Promise(((e,r)=>{const o=t.registerCommand(Qq,(r=>(YQ(r,ClipboardEvent)&&(o(),null!==G0&&(window.clearTimeout(G0),G0=null),e(J0(t,r,n))),!0)),4);G0=window.setTimeout((()=>{o(),G0=null,e(!1)}),50),i.execCommand("copy"),a.remove()}))}function J0(t,e,n){if(void 0===n){const e=lG(t._window);if(!e)return!1;const r=e.anchorNode,i=e.focusNode;if(null!==r&&null!==i&&!lZ(t,r,i))return!1;const o=_J();if(null===o)return!1;n=function(t=_J()){const e={"text/plain":t?t.getTextContent():""};if(t){const n=$J();for(const[r,i]of Q0){const o=i(n,t);null!==o&&(e[r]=o)}}return e}(o)}e.preventDefault();const r=e.clipboardData;return null!==r&&(function(t,e){for(const n in e){const r=e[n];void 0!==r&&t.setData(n,r)}}(r,n),!0)}const Q0=[["text/html",function(t,e=_J()){return null==e&&X0(166),aJ(e)&&e.isCollapsed()||0===e.getNodes().length?"":H0(t,e)}],["application/x-lexical-editor",function(t,e=_J()){return null==e&&X0(166),aJ(e)&&e.isCollapsed()||0===e.getNodes().length?null:JSON.stringify(function(t,e){const n=[],r=EZ().getChildren();for(let i=0;i<r.length;i++)Z0(t,e,r[i],n);return{namespace:t._config.namespace,nodes:n}}(t,e))}]];function t1(t,e){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(t,e);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(t,e);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const e1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,n1=e1&&"documentMode"in document?document.documentMode:null,r1=!(!e1||!("InputEvent"in window)||n1)&&"getTargetRanges"in new window.InputEvent("input"),i1=e1&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),o1=e1&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,a1=e1&&/^(?=.*Chrome).*/i.test(navigator.userAgent),s1=e1&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!a1,l1={};class c1 extends tQ{static getType(){return"quote"}static clone(t){return new c1(t.__key)}createDOM(t){const e=document.createElement("blockquote");return HQ(e,t.theme.quote),e}updateDOM(t,e){return!1}static importDOM(){return{blockquote:t=>({conversion:f1,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(uG(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){return u1().updateFromJSON(t)}insertNewAfter(t,e){const n=fQ(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){const t=fQ();return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}canMergeWhenEmpty(){return!0}}function u1(){return iG(new c1)}class d1 extends tQ{static getType(){return"heading"}static clone(t){return new d1(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t}getTag(){return this.__tag}setTag(t){const e=this.getWritable();return this.__tag=t,e}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){HQ(n,r[e])}return n}updateDOM(t,e,n){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:p1,priority:0}),h2:t=>({conversion:p1,priority:0}),h3:t=>({conversion:p1,priority:0}),h4:t=>({conversion:p1,priority:0}),h5:t=>({conversion:p1,priority:0}),h6:t=>({conversion:p1,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&h1(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>h1(t)?{conversion:t=>({node:m1("h1")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if(uG(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){return m1(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,e=!0){const n=t?t.anchor.offset:0,r=this.getLastDescendant(),i=!r||t&&t.anchor.key===r.getKey()&&n===r.getTextContentSize()||!t?fQ():m1(this.getTag()),o=this.getDirection();if(i.setDirection(o),this.insertAfter(i,e),0===n&&!this.isEmpty()&&t){const t=fQ();t.select(),this.replace(t,!0)}return i}collapseAtStart(){const t=this.isEmpty()?fQ():m1(this.getTag());return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}extractWithChild(){return!0}}function h1(t){return"span"===t.nodeName.toLowerCase()&&"26pt"===t.style.fontSize}function p1(t){const e=t.nodeName.toLowerCase();let n=null;return"h1"!==e&&"h2"!==e&&"h3"!==e&&"h4"!==e&&"h5"!==e&&"h6"!==e||(n=m1(e),null!==t.style&&(xG(t,n),n.setFormat(t.style.textAlign))),{node:n}}function f1(t){const e=u1();return null!==t.style&&(e.setFormat(t.style.textAlign),xG(t,e)),{node:e}}function m1(t="h1"){return iG(new d1(t))}function g1(t){let e=null;if(YQ(t,DragEvent)?e=t.dataTransfer:YQ(t,ClipboardEvent)&&(e=t.clipboardData),null===e)return[!1,[],!1];const n=e.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(e.files),i]}function v1(t){const e=_J();if(!aJ(e))return!1;const n=new Set,r=e.getNodes();for(let e=0;e<r.length;e++){const i=r[e],o=i.getKey();if(n.has(o))continue;const a=VQ(i,(t=>eQ(t)&&!t.isInline()));if(null===a)continue;const s=a.getKey();a.canIndent()&&!n.has(s)&&(n.add(s),t(a))}return n.size>0}function y1(t){return iQ(SZ(t))}function b1(t){for(const e of["lowercase","uppercase","capitalize"])t.hasFormat(e)&&t.toggleFormat(e)}function _1(t){return BQ(t.registerCommand(_q,(t=>{const e=_J();return!!lJ(e)&&(e.clear(),!0)}),0),t.registerCommand(xq,(t=>{const e=_J();return!!aJ(e)&&(e.deleteCharacter(t),!0)}),0),t.registerCommand(Mq,(t=>{const e=_J();return!!aJ(e)&&(e.deleteWord(t),!0)}),0),t.registerCommand(Oq,(t=>{const e=_J();return!!aJ(e)&&(e.deleteLine(t),!0)}),0),t.registerCommand(kq,(e=>{const n=_J();if("string"==typeof e)null!==n&&n.insertText(e);else{if(null===n)return!1;const r=e.dataTransfer;if(null!=r)q0(r,n,t);else if(aJ(n)){const t=e.data;return t&&n.insertText(t),!0}}return!0}),0),t.registerCommand(Eq,(()=>{const t=_J();return!!aJ(t)&&(t.removeText(),!0)}),0),t.registerCommand(Pq,(t=>{const e=_J();return!!aJ(e)&&(e.formatText(t),!0)}),0),t.registerCommand(Zq,(t=>{const e=_J();if(!aJ(e)&&!lJ(e))return!1;const n=e.getNodes();for(const e of n){const n=VQ(e,(t=>eQ(t)&&!t.isInline()));null!==n&&n.setFormat(t)}return!0}),0),t.registerCommand(wq,(t=>{const e=_J();return!!aJ(e)&&(e.insertLineBreak(t),!0)}),0),t.registerCommand(Sq,(()=>{const t=_J();return!!aJ(t)&&(t.insertParagraph(),!0)}),0),t.registerCommand(Yq,(()=>(function(t){let e=_J()||xJ();null===e&&(e=EZ().selectEnd()),e.insertNodes(t)}([JK()]),!0)),0),t.registerCommand(Xq,(()=>v1((t=>{const e=t.getIndent();t.setIndent(e+1)}))),0),t.registerCommand(qq,(()=>v1((t=>{const e=t.getIndent();e>0&&t.setIndent(e-1)}))),0),t.registerCommand(Rq,(t=>{const e=_J();if(lJ(e)&&!y1(t.target)){const t=e.getNodes();if(t.length>0)return t[0].selectPrevious(),!0}else if(aJ(e)){const n=qZ(e.focus,!0);if(!t.shiftKey&&iQ(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),t.preventDefault(),!0}return!1}),0),t.registerCommand($q,(t=>{const e=_J();if(lJ(e)){const t=e.getNodes();if(t.length>0)return t[0].selectNext(0,0),!0}else if(aJ(e)){if(function(t){const e=t.focus;return"root"===e.key&&e.offset===EZ().getChildrenSize()}(e))return t.preventDefault(),!0;const n=qZ(e.focus,!1);if(!t.shiftKey&&iQ(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),t.preventDefault(),!0}return!1}),0),t.registerCommand(Iq,(t=>{const e=_J();if(lJ(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectPrevious(),!0}if(!aJ(e))return!1;if(NQ(e,!0)){const n=t.shiftKey;return t.preventDefault(),DQ(e,n,!0),!0}return!1}),0),t.registerCommand(Aq,(t=>{const e=_J();if(lJ(e)&&!y1(t.target)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectNext(0,0),!0}if(!aJ(e))return!1;const n=t.shiftKey;return!!NQ(e,!1)&&(t.preventDefault(),DQ(e,n,!1),!0)}),0),t.registerCommand(Bq,(e=>{if(y1(e.target))return!1;const n=_J();if(!aJ(n))return!1;const{anchor:r}=n,i=r.getNode();return n.isCollapsed()&&0===r.offset&&!aQ(i)&&function(t){const e=VQ(t,(t=>eQ(t)&&!t.isInline()));return eQ(e)||zQ(4,t.__key),e}(i).getIndent()>0?(e.preventDefault(),t.dispatchCommand(qq,void 0)):(!o1||"ko-KR"!==navigator.language)&&(e.preventDefault(),t.dispatchCommand(xq,!0))}),0),t.registerCommand(Wq,(e=>{if(y1(e.target))return!1;return!!aJ(_J())&&(e.preventDefault(),t.dispatchCommand(xq,!1))}),0),t.registerCommand(Fq,(e=>{const n=_J();if(!aJ(n))return!1;if(b1(n),null!==e){if((o1||i1||s1)&&r1)return!1;if(e.preventDefault(),e.shiftKey)return t.dispatchCommand(wq,!1)}return t.dispatchCommand(Sq,void 0)}),0),t.registerCommand(Hq,(()=>!!aJ(_J())&&(t.blur(),!0)),0),t.registerCommand(Uq,(e=>{const[,n]=g1(e);if(n.length>0){const r=t1(e.clientX,e.clientY);if(null!==r){const{offset:e,node:i}=r,o=SZ(i);if(null!==o){const t=function(){const t=eJ("root",0,"element"),e=eJ("root",0,"element");return new sJ(t,e,0,"")}();if(ZK(o))t.anchor.set(o.getKey(),e,"text"),t.focus.set(o.getKey(),e,"text");else{const e=o.getParentOrThrow().getKey(),n=o.getIndexWithinParent()+1;t.anchor.set(e,n,"element"),t.focus.set(e,n,"element")}OZ(rZ(t))}t.dispatchCommand(l1,n)}return e.preventDefault(),!0}return!!aJ(_J())}),0),t.registerCommand(Gq,(t=>{const[e]=g1(t),n=_J();return!(e&&!aJ(n))}),0),t.registerCommand(Kq,(t=>{const[e]=g1(t),n=_J();if(e&&!aJ(n))return!1;const r=t1(t.clientX,t.clientY);if(null!==r){iQ(SZ(r.node))&&t.preventDefault()}return!0}),0),t.registerCommand(eU,(()=>(function(t){const e=EZ();if(aJ(t)){const e=t.anchor,n=t.focus,r=e.getNode().getTopLevelElementOrThrow().getParentOrThrow();return e.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),rZ(t),t}{const t=e.select(0,e.getChildrenSize());OZ(rZ(t))}}(),!0)),0),t.registerCommand(Qq,(e=>(K0(t,YQ(e,ClipboardEvent)?e:null),!0)),0),t.registerCommand(tU,(e=>(async function(t,e){await K0(e,YQ(t,ClipboardEvent)?t:null),e.update((()=>{const t=_J();aJ(t)?t.removeText():lJ(t)&&t.getNodes().forEach((t=>t.remove()))}))}(e,t),!0)),0),t.registerCommand(Cq,(e=>{const[,n,r]=g1(e);return n.length>0&&!r?(t.dispatchCommand(l1,n),!0):(!dG(e.target)||!sZ(e.target))&&(null!==_J()&&(function(t,e){t.preventDefault(),e.update((()=>{const n=_J(),r=YQ(t,InputEvent)||YQ(t,KeyboardEvent)?null:t.clipboardData;null!=r&&null!==n&&q0(r,n,e)}),{tag:"paste"})}(e,t),!0))}),0),t.registerCommand(jq,(t=>{const e=_J();return aJ(e)&&b1(e),!1}),0),t.registerCommand(Vq,(t=>{const e=_J();return aJ(e)&&b1(e),!1}),0))}var x1=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const w1=v(null);function S1(){const t=p(w1);return null==t&&x1(8),t}const k1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,C1=k1?d:l,E1={tag:"history-merge"};function M1({initialConfig:e,children:n}){const r=o((()=>{const{theme:t,namespace:n,nodes:r,onError:i,editorState:o,html:a}=e,s=function(t,e){let n=null;return null!=t&&(n=t[1]),{getTheme:function(){return null!=e?e:null!=n?n.getTheme():null}}}(null,t),l=vQ({editable:e.editable,html:a,namespace:n,nodes:r,onError:t=>i(t,l),theme:t});return function(t,e){if(null!==e)if(void 0===e)t.update((()=>{const e=EZ();if(e.isEmpty()){const n=fQ();e.append(n);const r=k1?document.activeElement:null;(null!==_J()||null!==r&&r===t.getRootElement())&&n.select()}}),E1);else if(null!==e)switch(typeof e){case"string":{const n=t.parseEditorState(e);t.setEditorState(n,E1);break}case"object":t.setEditorState(e,E1);break;case"function":t.update((()=>{EZ().isEmpty()&&e(t)}),E1)}}(l,o),[l,s]}),[]);return C1((()=>{const t=e.editable,[n]=r;n.setEditable(void 0===t||t)}),[]),t(w1.Provider,{value:r,children:n})}var O1="LexicalContent-module_editableContent__f69V7";function P1({defaultSelection:t}){const[e]=S1();return l((()=>{e.focus((()=>{const t=document.activeElement,n=e.getRootElement();null===n||null!==t&&n.contains(t)||n.focus({preventScroll:!0})}),{defaultSelection:t})}),[t,e]),null}const T1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;function N1(t){return{initialValueFn:()=>t.isEditable(),subscribe:e=>t.registerEditableListener(e)}}function D1(t,e=!0){if(t)return!1;let n=EZ().getTextContent();return e&&(n=n.trim()),""===n}function A1(t){return()=>function(t){if(!D1(t,!1))return!1;const e=EZ().getChildren(),n=e.length;if(n>1)return!1;for(let t=0;t<n;t++){const n=e[t];if(iQ(n))return!1;if(eQ(n)){if(!mQ(n))return!1;if(0!==n.__indent)return!1;const e=n.getChildren(),r=e.length;for(let n=0;n<r;n++)if(!ZK(e[t]))return!1}}return!0}(t)}!function(t){t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")&&t.default}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const L1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;function I1(t){return t.getEditorState().read(A1(t.isComposing()))}function z1({contentEditable:r,placeholder:i=null,ErrorBoundary:a}){const[s]=S1(),c=function(e,n){const[r,i]=u((()=>e.getDecorators()));return L1((()=>e.registerDecoratorListener((t=>{T((()=>{i(t)}))}))),[e]),l((()=>{i(e.getDecorators())}),[e]),o((()=>{const i=[],o=Object.keys(r);for(let a=0;a<o.length;a++){const s=o[a],l=t(n,{onError:t=>e._onError(t),children:t(C,{fallback:null,children:r[s]})}),c=e.getElementByKey(s);null!==c&&i.push(O(l,c,s))}return i}),[n,r,e])}(s,a);return function(t){L1((()=>BQ(_1(t),function(t){const e=window.location.origin,n=n=>{if(n.origin!==e)return;const r=t.getRootElement();if(document.activeElement!==r)return;const i=n.data;if("string"==typeof i){let e;try{e=JSON.parse(i)}catch(t){return}if(e&&"nuanria_messaging"===e.protocol&&"request"===e.type){const r=e.payload;if(r&&"makeChanges"===r.functionId){const e=r.args;if(e){const[r,i,o,a,s,l]=e;t.update((()=>{const t=_J();if(aJ(t)){const e=t.anchor;let l=e.getNode(),c=0,u=0;if(ZK(l)&&r>=0&&i>=0&&(c=r,u=r+i,t.setTextNodeRange(l,c,l,u)),c===u&&""===o||(t.insertRawText(o),l=e.getNode()),ZK(l)){c=a,u=a+s;const e=l.getTextContentSize();c=c>e?e:c,u=u>e?e:u,t.setTextNodeRange(l,c,l,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(t))),[t])}(s),e(n,{children:[r,t(R1,{content:i}),c]})}function R1({content:t}){const[e]=S1(),n=function(t){const[e,n]=u((()=>I1(t)));return L1((()=>{function e(){const e=I1(t);n(e)}return e(),BQ(t.registerUpdateListener((()=>{e()})),t.registerEditableListener((()=>{e()})))}),[t]),e}(e),r=function(t){const[e]=S1(),n=o((()=>t(e)),[e,t]),[r,i]=u((()=>n.initialValueFn())),a=s(r);return T1((()=>{const{initialValueFn:t,subscribe:e}=n,r=t();return a.current!==r&&(a.current=r,i(r)),e((t=>{a.current=t,i(t)}))}),[n,t]),r}(N1);return n?"function"==typeof t?t(r):t:null}const $1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;const F1=h((function({editor:e,ariaActiveDescendant:n,ariaAutoComplete:r,ariaControls:i,ariaDescribedBy:a,ariaErrorMessage:s,ariaExpanded:l,ariaInvalid:d,ariaLabel:h,ariaLabelledBy:p,ariaMultiline:f,ariaOwns:m,ariaRequired:g,autoCapitalize:v,className:y,id:b,role:_="textbox",spellCheck:x=!0,style:w,tabIndex:S,"data-testid":k,...C},E){const[M,O]=u(e.isEditable()),P=c((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),T=o((()=>function(...t){return e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}}(E,P)),[P,E]);return $1((()=>(O(e.isEditable()),e.registerEditableListener((t=>{O(t)})))),[e]),t("div",{"aria-activedescendant":M?n:void 0,"aria-autocomplete":M?r:"none","aria-controls":M?i:void 0,"aria-describedby":a,...null!=s?{"aria-errormessage":s}:{},"aria-expanded":M&&"combobox"===_?!!l:void 0,...null!=d?{"aria-invalid":d}:{},"aria-label":h,"aria-labelledby":p,"aria-multiline":f,"aria-owns":M?m:void 0,"aria-readonly":!M||void 0,"aria-required":g,autoCapitalize:v,className:y,contentEditable:M,"data-testid":k,id:b,ref:T,role:M?_:void 0,spellCheck:x,style:w,tabIndex:S,...C})}));function j1(t){return t.getEditorState().read(A1(t.isComposing()))}const B1=h((function(r,i){const{placeholder:o,...a}=r,[s]=S1();return e(n,{children:[t(F1,{editor:s,...a,ref:i}),null!=o&&t(H1,{editor:s,content:o})]})}));function H1({content:e,editor:n}){const r=function(t){const[e,n]=u((()=>j1(t)));return $1((()=>{function e(){const e=j1(t);n(e)}return e(),BQ(t.registerUpdateListener((()=>{e()})),t.registerEditableListener((()=>{e()})))}),[t]),e}(n),[i,o]=u(n.isEditable());if(d((()=>(o(n.isEditable()),n.registerEditableListener((t=>{o(t)})))),[n]),!r)return null;let a=null;return"function"==typeof e?a=e(i):null!==e&&(a=e),null===a?null:t("div",{"aria-hidden":!0,children:a})}function W1(t,e,n,r,i){if(null===t||0===n.size&&0===r.size&&!i)return 0;const o=e._selection,a=t._selection;if(i)return 1;if(!(aJ(o)&&aJ(a)&&a.isCollapsed()&&o.isCollapsed()))return 0;const s=function(t,e,n){const r=t._nodeMap,i=[];for(const t of e){const e=r.get(t);void 0!==e&&i.push(e)}for(const[t,e]of n){if(!e)continue;const n=r.get(t);void 0===n||aQ(n)||i.push(n)}return i}(e,n,r);if(0===s.length)return 0;if(s.length>1){const n=e._nodeMap,r=n.get(o.anchor.key),i=n.get(a.anchor.key);return r&&i&&!t._nodeMap.has(r.__key)&&ZK(r)&&1===r.__text.length&&1===o.anchor.offset?2:0}const l=s[0],c=t._nodeMap.get(l.__key);if(!ZK(c)||!ZK(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const h=o.anchor,p=a.anchor;if(h.key!==p.key||"text"!==h.type)return 0;const f=h.offset,m=p.offset,g=d.length-u.length;return 1===g&&m===f-1?2:-1===g&&m===f+1?3:-1===g&&m===f?4:0}function V1(t,e){let n=Date.now(),r=0;return(i,o,a,s,l,c)=>{const u=Date.now();if(c.has("historic"))return r=0,n=u,2;const d=W1(i,o,s,l,t.isComposing()),h=(()=>{const h=null===a||a.editor===t,p=c.has("history-push");if(!p&&h&&c.has("history-merge"))return 0;if(null===i)return 1;const f=o._selection;return s.size>0||l.size>0?!1===p&&0!==d&&d===r&&u<n+e&&h||1===s.size&&function(t,e,n){const r=e._nodeMap.get(t),i=n._nodeMap.get(t),o=e._selection,a=n._selection;return!(aJ(o)&&aJ(a)&&"element"===o.anchor.type&&"element"===o.focus.type&&"text"===a.anchor.type&&"text"===a.focus.type||!ZK(r)||!ZK(i)||r.__parent!==i.__parent)&&JSON.stringify(e.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>i.exportJSON())))}(Array.from(s)[0],i,o)?0:1:null!==f?0:2})();return n=u,r=d,h}}function Y1(t){t.undoStack=[],t.redoStack=[],t.current=null}function X1({delay:t,externalHistoryState:e}){const[n]=S1();return function(t,e,n=1e3){const r=o((()=>e||{current:null,redoStack:[],undoStack:[]}),[e]);l((()=>function(t,e,n){const r=V1(t,n),i=BQ(t.registerCommand(Tq,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==r.length){const i=e.current,o=r.pop();null!==i&&(n.push(i),t.dispatchCommand(iU,!0)),0===r.length&&t.dispatchCommand(oU,!1),e.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}}(t,e),!0)),0),t.registerCommand(Nq,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==n.length){const i=e.current;null!==i&&(r.push(i),t.dispatchCommand(oU,!0));const o=n.pop();0===n.length&&t.dispatchCommand(iU,!1),e.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}}(t,e),!0)),0),t.registerCommand(nU,(()=>(Y1(e),!1)),0),t.registerCommand(rU,(()=>(Y1(e),t.dispatchCommand(iU,!1),t.dispatchCommand(oU,!1),!0)),0),t.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:o,dirtyElements:a,tags:s})=>{const l=e.current,c=e.redoStack,u=e.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const h=r(i,n,l,o,a,s);if(1===h)0!==c.length&&(e.redoStack=[],t.dispatchCommand(iU,!1)),null!==l&&(u.push({...l}),t.dispatchCommand(oU,!0));else if(2===h)return;e.current={editor:t,editorState:n}})));return i}(t,r,n)),[n,t,r])}(n,e,t),null}function q1(t,e){return q1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},q1(t,e)}var U1={error:null},Z1=function(t){var e,n;function i(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).state=U1,e.resetErrorBoundary=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];null==e.props.onReset||(t=e.props).onReset.apply(t,r),e.reset()},e}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,q1(e,n),i.getDerivedStateFromError=function(t){return{error:t}};var o=i.prototype;return o.reset=function(){this.setState(U1)},o.componentDidCatch=function(t,e){var n,r;null==(n=(r=this.props).onError)||n.call(r,t,e)},o.componentDidUpdate=function(t,e){var n,r,i,o,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==e.error&&(void 0===(i=t.resetKeys)&&(i=[]),void 0===(o=s)&&(o=[]),i.length!==o.length||i.some((function(t,e){return!Object.is(t,o[e])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,t.resetKeys,s),this.reset())},o.render=function(){var t=this.state.error,e=this.props,n=e.fallbackRender,i=e.FallbackComponent,o=e.fallback;if(null!==t){var a={error:t,resetErrorBoundary:this.resetErrorBoundary};if(r.isValidElement(o))return o;if("function"==typeof n)return n(a);if(i)return r.createElement(i,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},i}(r.Component);function G1({children:e,onError:n}){return t(Z1,{fallback:t("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:n,children:e})}!function(t){t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")&&t.default}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const K1=new Set(["http:","https:","mailto:","sms:","tel:"]);class J1 extends tQ{static getType(){return"link"}static clone(t){return new J1(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",e={},n){super(n);const{target:r=null,rel:i=null,title:o=null}=e;this.__url=t,this.__target=r,this.__rel=i,this.__title=o}createDOM(t){const e=document.createElement("a");return e.href=this.sanitizeUrl(this.__url),null!==this.__target&&(e.target=this.__target),null!==this.__rel&&(e.rel=this.__rel),null!==this.__title&&(e.title=this.__title),HQ(e,t.theme.link),e}updateDOM(t,e,n){if(cG(e)){const n=this.__url,r=this.__target,i=this.__rel,o=this.__title;n!==t.__url&&(e.href=n),r!==t.__target&&(r?e.target=r:e.removeAttribute("target")),i!==t.__rel&&(i?e.rel=i:e.removeAttribute("rel")),o!==t.__title&&(o?e.title=o:e.removeAttribute("title"))}return!1}static importDOM(){return{a:t=>({conversion:Q1,priority:1})}}static importJSON(t){return t2().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){try{const e=new URL(t);if(!K1.has(e.protocol))return"about:blank"}catch(e){return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const e=this.getWritable();return e.__url=t,e}getTarget(){return this.getLatest().__target}setTarget(t){const e=this.getWritable();return e.__target=t,e}getRel(){return this.getLatest().__rel}setRel(t){const e=this.getWritable();return e.__rel=t,e}getTitle(){return this.getLatest().__title}setTitle(t){const e=this.getWritable();return e.__title=t,e}insertNewAfter(t,e=!0){const n=t2(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,e),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,e,n){if(!aJ(e))return!1;const r=e.anchor.getNode(),i=e.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&e.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Q1(t){let e=null;if(cG(t)){const n=t.textContent;(null!==n&&""!==n||t.children.length>0)&&(e=t2(t.getAttribute("href")||"",{rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")}))}return{node:e}}function t2(t="",e){return iG(new J1(t,e))}function e2(t){return t instanceof J1}function n2({label:n,value:r,onChange:i,placeholder:o="","data-test-id":a,type:s="text"}){return e("div",{className:"Input__wrapper",children:[t("label",{className:"Input__label",children:n}),t("input",{type:s,className:"Input__input",placeholder:o,value:r,onChange:t=>{i(t.target.value)},"data-test-id":a})]})}let r2=!1;const i2=["#d0021b","#f5a623","#f8e71c","#8b572a","#7ed321","#417505","#bd10e0","#9013fe","#4a90e2","#50e3c2","#b8e986","#000000","#4a4a4a","#9b9b9b","#ffffff"],o2=214;function a2({color:n,onChange:r}){const[i,a]=u(p2("hex",n)),[c,d]=u(n),h=s(null),p=o((()=>({x:i.hsv.s/100*o2,y:(100-i.hsv.v)/100*150})),[i.hsv.s,i.hsv.v]),f=o((()=>({x:i.hsv.h/360*o2})),[i.hsv]);return l((()=>{null!==h.current&&r&&(r(i.hex,r2),d(i.hex))}),[i,r]),l((()=>{if(void 0===n)return;const t=p2("hex",n);a(t),d(t.hex)}),[n]),e("div",{className:"color-picker-wrapper",style:{width:o2},ref:h,children:[t(n2,{label:"Hex",onChange:t=>{if(d(t),/^#[0-9A-Fa-f]{6}$/i.test(t)){const e=p2("hex",t);a(e)}},value:c}),t("div",{className:"color-picker-basic-color",children:i2.map((e=>t("button",{className:e===i.hex?" active":"",style:{backgroundColor:e},onClick:()=>{d(e),a(p2("hex",e))}},e)))}),t(s2,{className:"color-picker-saturation",style:{backgroundColor:`hsl(${i.hsv.h}, 100%, 50%)`},onChange:({x:t,y:e})=>{const n=p2("hsv",{...i.hsv,s:t/o2*100,v:100-e/150*100});a(n),d(n.hex)},children:t("div",{className:"color-picker-saturation_cursor",style:{backgroundColor:i.hex,left:p.x,top:p.y}})}),t(s2,{className:"color-picker-hue",onChange:({x:t})=>{const e=p2("hsv",{...i.hsv,h:t/o2*360});a(e),d(e.hex)},children:t("div",{className:"color-picker-hue_cursor",style:{backgroundColor:`hsl(${i.hsv.h}, 100%, 50%)`,left:f.x}})}),t("div",{className:"color-picker-color",style:{backgroundColor:i.hex}})]})}function s2({className:e,style:n,onChange:r,children:i}){const o=s(null),a=s(!1),l=t=>{if(o.current){const{current:e}=o,{width:n,height:i,left:a,top:s}=e.getBoundingClientRect(),l=function(t){let e=1;if(function(){if(void 0===XQ){const t=document.createElement("div");t.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(t);const e=t.getBoundingClientRect();t.style.setProperty("zoom","2"),XQ=t.getBoundingClientRect().width===e.width,document.body.removeChild(t)}return XQ}())for(;t;)e*=Number(window.getComputedStyle(t).getPropertyValue("zoom")),t=t.parentElement;return e}(e),c=l2(t.clientX/l-a,n,0),u=l2(t.clientY/l-s,i,0);r({x:c,y:u})}};return t("div",{ref:o,className:e,style:n,onMouseDown:t=>{if(0!==t.button)return;l(t);const e=t=>{a.current=!0,r2=!0,l(t)},n=t=>{a.current&&(r2=!1),document.removeEventListener("mousemove",e,!1),document.removeEventListener("mouseup",n,!1),l(t),a.current=!1};document.addEventListener("mousemove",e,!1),document.addEventListener("mouseup",n,!1)},children:i})}function l2(t,e,n){return t>e?e:t<n?n:t}function c2(t){if(!t.startsWith("#")){const e=document.createElement("canvas").getContext("2d");if(!e)throw new Error("2d context not supported or canvas already initialized");return e.fillStyle=t,e.fillStyle}return 4===t.length||5===t.length?(t=t.split("").map(((t,e)=>e?t+t:"#")).join(""),t):7===t.length||9===t.length?t:"#000000"}function u2(t){const e=(t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((t,e,n,r)=>"#"+e+e+n+n+r+r)).substring(1).match(/.{2}/g)||[]).map((t=>parseInt(t,16)));return{b:e[2],g:e[1],r:e[0]}}function d2({r:t,g:e,b:n}){t/=255,e/=255,n/=255;const r=Math.max(t,e,n),i=r-Math.min(t,e,n);return{h:i?60*(r===t?(e-n)/i+(e<n?6:0):r===e?2+(n-t)/i:4+(t-e)/i):0,s:r?i/r*100:0,v:100*r}}function h2({b:t,g:e,r:n}){return"#"+[n,e,t].map((t=>t.toString(16).padStart(2,"0"))).join("")}function p2(t,e){let n=c2("#121212"),r=u2(n),i=d2(r);if("hex"===t){n=c2(e),r=u2(n),i=d2(r)}else if("rgb"===t){r=e,n=h2(r),i=d2(r)}else if("hsv"===t){i=e,r=function({h:t,s:e,v:n}){const r=~~(t/60),i=t/60-r,o=(n/=100)*(1-(e/=100)),a=n*(1-e*i),s=n*(1-e*(1-i)),l=r%6,c=Math.round(255*[n,a,o,o,s,n][l]),u=Math.round(255*[s,n,n,a,o,o][l]);return{b:Math.round(255*[o,o,s,n,n,a][l]),g:u,r:c}}(i),n=h2(r)}return{hex:n,hsv:i,rgb:r}}const f2=r.createContext(null);function m2({children:e,className:n,onClick:i,title:o}){const a=s(null),c=r.useContext(f2);if(null===c)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:u}=c;return l((()=>{a&&a.current&&u(a)}),[a,u]),t("button",{className:`item ${n}`,onClick:i,ref:a,title:o,type:"button",children:e})}function g2({children:e,dropDownRef:n,onClose:r}){const[i,a]=u(),[s,d]=u(),h=c((t=>{a((e=>e?[...e,t]:[t]))}),[a]),p=o((()=>({registerItem:h})),[h]);return l((()=>{i&&!s&&d(i[0]),s&&s.current&&s.current.focus()}),[i,s]),t(f2.Provider,{value:p,children:t("div",{className:"dropdown",ref:n,onKeyDown:t=>{if(!i)return;const e=t.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(e)&&t.preventDefault(),"Escape"===e||"Tab"===e?r():"ArrowUp"===e?d((t=>{if(!t)return i[0];const e=i.indexOf(t)-1;return i[-1===e?i.length-1:e]})):"ArrowDown"===e&&d((t=>t?i[i.indexOf(t)+1]:i[0]))},children:e})})}function v2({colorPicker:r=!1,disabled:i=!1,buttonLabel:o,buttonAriaLabel:a,buttonClassName:c,buttonIconClassName:d,labelClassName:h,children:p,icon:f=t(Za,{name:"chevronDown"}),stopCloseOnClickSelf:m,buttonOnClick:g}){const v=s(null),y=s(null),[b,_]=u(!1);return l((()=>{const t=y.current,e=v.current;if(b&&null!==t&&null!==e){const{top:n,left:r}=t.getBoundingClientRect();e.style.top=`${n+t.offsetHeight+4}px`,e.style.left=`${Math.min(r,window.innerWidth-e.offsetWidth-20)}px`}}),[v,y,b]),l((()=>{const t=y.current;if(null!==t&&b){const e=e=>{const n=e.target;m&&v.current&&v.current.contains(n)||t.contains(n)||_(!1)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}}),[v,y,b,m]),l((()=>{const t=()=>{if(b){const t=y.current,e=v.current;if(null!==t&&null!==e){const{top:n}=t.getBoundingClientRect(),r=n+t.offsetHeight+4;r!==e.getBoundingClientRect().top&&(e.style.top=`${r}px`)}}};return document.addEventListener("scroll",t),()=>{document.removeEventListener("scroll",t)}}),[y,v,b]),e(n,{children:[e("button",{type:"button",disabled:i,"aria-label":a||o,className:`toolbar-item ${!r&&"dropdownButton"} ${c}`,onClick:()=>{_(!b),g&&g()},ref:y,children:[o&&t("div",{className:h,children:o}),!r&&f]}),b&&O(t(g2,{dropDownRef:v,onClose:()=>{_(!1),y&&y.current&&y.current.focus()},children:p}),document.body)]})}function y2({disabled:e=!1,stopCloseOnClickSelf:n=!0,color:r,onChange:i,...o}){return t(v2,{...o,colorPicker:!0,disabled:e,stopCloseOnClickSelf:n,children:t("div",{style:{position:"static",top:0,zIndex:99},children:t(a2,{color:r,onChange:i})})})}var b2;function _2({selectionFontSize:e,editor:n}){const[i,o]=r.useState(e),a=r.useCallback(((t,e)=>{const r=t=>(t||(t="15px"),`${t=t.slice(0,-2)}px`);n.update((()=>{if(n.isEditable()){const e=_J();null!==e&&PQ(e,{"font-size":t||r})}}))}),[n]);r.useEffect((()=>{o(e)}),[e]);return t(v2,{buttonOnClick:()=>{},buttonLabel:`${i}px`,children:[8,9,10,11,12,14,16,18,20,24,28,32,36,48,60,72].map((e=>t(m2,{onClick:()=>{a(String(e)+"px",null)},children:t("span",{className:"text",children:e})},e)))})}!function(t){t[t.increment=1]="increment",t[t.decrement=2]="decrement"}(b2||(b2={}));const x2={bullet:"Bulleted List",check:"Check List",code:"Code Block",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",number:"Numbered List",paragraph:"Normal",quote:"Quote"},w2=[["Arial","Arial"],["Courier New","Courier New"],["Georgia","Georgia"],["Times New Roman","Times New Roman"],["Trebuchet MS","Trebuchet MS"],["Verdana","Verdana"],["Roboto","Roboto"]],S2=[["10px","10px"],["11px","11px"],["12px","12px"],["13px","13px"],["14px","14px"],["15px","15px"],["16px","16px"],["17px","17px"],["18px","18px"],["19px","19px"],["20px","20px"]];function k2(t){return t?"active dropdown-item-active":""}function C2({editor:n,blockType:r,disabled:i=!1}){const o=()=>{n.update((()=>{const t=_J();aJ(t)&&TQ(t,(()=>fQ()))}))},a=t=>{r!==t&&n.update((()=>{TQ(_J(),(()=>m1(t)))}))};return e(v2,{disabled:i,buttonClassName:"toolbar-item block-controls",buttonIconClassName:"icon block-type "+r,buttonLabel:x2[r],buttonAriaLabel:"Formatting options for text style",children:[t(m2,{className:"item "+k2("paragraph"===r),onClick:o,children:t("span",{className:"text",children:"Normal"})}),t(m2,{className:"item "+k2("h1"===r),onClick:()=>a("h1"),children:t("span",{className:"text",children:"Heading 1"})}),t(m2,{className:"item "+k2("h2"===r),onClick:()=>a("h2"),children:t("span",{className:"text",children:"Heading 2"})}),t(m2,{className:"item "+k2("h3"===r),onClick:()=>a("h3"),children:t("span",{className:"text",children:"Heading 3"})}),t(m2,{className:"item "+k2("bullet"===r),onClick:()=>{"bullet"!==r?n.dispatchCommand(F0,void 0):o()},children:t("span",{className:"text",children:"Bullet List"})}),t(m2,{className:"item "+k2("number"===r),onClick:()=>{"number"!==r?n.dispatchCommand(j0,void 0):o()},children:t("span",{className:"text",children:"Numbered List"})}),t(m2,{className:"item "+k2("quote"===r),onClick:()=>{"quote"!==r&&n.update((()=>{TQ(_J(),(()=>u1()))}))},children:t("span",{className:"text",children:"Quote"})})]})}function E2({editor:e,value:n,style:r}){const i=c((t=>{e.update((()=>{const e=_J();null!==e&&PQ(e,{[r]:t})}))}),[e,r]);return t(v2,{buttonOnClick:()=>{e.dispatchCommand(aU,void 0)},buttonClassName:"toolbar-item "+r,buttonLabel:n,buttonIconClassName:"font-family"===r?"icon block-type font-family":"",buttonAriaLabel:"font-family"===r?"Formatting options for font family":"Formatting options for font size",children:("font-family"===r?w2:S2).map((([e,o])=>t(m2,{className:`item ${k2(n===e)} ${"font-size"===r?"fontsize-item":""}`,onClick:()=>i(e),children:t("span",{className:"text",children:e})},e)))})}function M2(){return t("div",{className:"divider"})}const O2=a((({editor:n})=>{const r=s(null),i=s(null),o=s(null),[a,d]=u("14px"),[h,p]=u("#000"),[f,m]=u("#fff"),[g,v]=u("Arial"),[y,b]=u("left"),[_,x]=u(!1),[w,S]=u(!1),[k,C]=u(!1),[E,M]=u(!1),[O,P]=u(!1),[T,N]=u(!1),[D,A]=u(!1),[L,I]=u(!1),[z,R]=u("paragraph"),[$,F]=u(null),j=c((()=>{const t=_J();if(aJ(t)){const e=t.anchor.getNode();let r="root"===e.getKey()?e:VQ(e,(t=>{const e=t.getParent();return null!==e&&rG(e)}));null===r&&(r=e.getTopLevelElementOrThrow());const i=r.getKey(),o=n.getElementByKey(i);C(t.hasFormat("code")),S(t.hasFormat("bold")),M(t.hasFormat("italic")),P(t.hasFormat("underline")),N(t.hasFormat("strikethrough"));const a=function(t){const e=t.anchor,n=t.focus,r=t.anchor.getNode(),i=t.focus.getNode();return r===i?r:t.isBackward()?EQ(n)?r:i:EQ(e)?r:i}(t),s=a.getParent();if(e2(s)||e2(a)?x(!0):x(!1),null!==o)if(F(i),$0(r)){const t=function(t,e){let n=t;for(;null!=n;){if(n instanceof e)return n;n=n.getParent()}return null}(e,D0),n=t?t.getListType():r.getListType();R(n)}else{const t=function(t){return t instanceof d1}(r)?r.getTag():r.getType();t in x2&&R(t)}let l;p(LQ(t,"color","#000")),m(LQ(t,"background-color","#fff")),v(LQ(t,"font-family","Arial")),e2(s)&&(l=VQ(a,(t=>eQ(t)&&!t.isInline()))),b(eQ(l)?l.getFormatType():eQ(a)?a.getFormatType():s?.getFormatType()||"left")}aJ(t)&&d(LQ(t,"font-size","14px"))}),[]);l((()=>BQ(n.registerUpdateListener((({editorState:t})=>{t.read((()=>{j()}))})),n.registerCommand(yq,((t,e)=>(j(),!1)),1),n.registerCommand(oU,(t=>(A(t),!1)),1),n.registerCommand(iU,(t=>(I(t),!1)),1))),[n,j]);const B=c(((t,e)=>{n.update((()=>{const e=_J();null!==e&&PQ(e,t)}),e?{tag:"historic"}:{})}),[n]),H=c(((t,e)=>{V(t),B({color:t},e)}),[B]),W=c(((t,e)=>{Y(t),B({"background-color":t},e)}),[B]);l((()=>{V("white")}),[i]),l((()=>{Y("white")}),[o]);const V=t=>{if(!t||!i.current)return;const e=i.current.querySelectorAll("path");e[5]&&e[5].setAttribute("fill",t)},Y=t=>{if(!t||!o.current)return;const e=o.current.querySelectorAll("path");e[0]&&e[0].setAttribute("fill",t)},X=c(((t,e)=>{n.dispatchCommand(t,e)}),[]);return e("div",{className:"toolbar",ref:r,onClick:()=>{n.dispatchCommand(aU,void 0)},children:[t("button",{disabled:!D,onClick:()=>{n.dispatchCommand(Tq,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:t(Za,{name:"undo"})}),t("button",{disabled:!L,onClick:()=>{n.dispatchCommand(Nq,void 0)},className:"toolbar-item","aria-label":"Redo",children:t(Za,{name:"redo"})}),t(M2,{}),t(C2,{blockType:z,editor:n}),t(M2,{}),t(E2,{style:"font-family",value:g,editor:n}),t(M2,{}),t(_2,{selectionFontSize:a.slice(0,-2),editor:n}),t(M2,{}),t("button",{onClick:()=>{X(Pq,"bold")},className:"toolbar-item spaced "+(w?"active":""),"aria-label":"Format Bold",children:t(Za,{name:"formatBold"})}),t("button",{onClick:()=>{X(Pq,"italic")},className:"toolbar-item spaced "+(E?"active":""),"aria-label":"Format Italics",children:t(Za,{name:"formatItalic"})}),t("button",{onClick:()=>{X(Pq,"underline")},className:"toolbar-item spaced "+(O?"active":""),"aria-label":"Format Underline",children:t(Za,{name:"formatUnderlined"})}),t("button",{onClick:()=>{X(Pq,"code")},className:"toolbar-item spaced "+(k?"active":""),"aria-label":"Format Underline",children:t(Za,{name:"codeTags"})}),t("button",{onClick:()=>{X(Pq,"strikethrough")},className:"toolbar-item spaced "+(T?"active":""),"aria-label":"Format Strikethrough",children:t(Za,{name:"strikethroughS"})}),t(M2,{}),t("button",{onClick:()=>{X(Zq,"left")},className:"toolbar-item spaced "+("left"==y?"active":""),"aria-label":"Left Align",children:t(Za,{name:"formatAlignLeft"})}),t("button",{onClick:()=>{X(Zq,"center")},className:"toolbar-item spaced "+("center"==y?"active":""),"aria-label":"Center Align",children:t(Za,{name:"formatAlignCenter"})}),t("button",{onClick:()=>{X(Zq,"right")},className:"toolbar-item spaced "+("right"==y?"active":""),"aria-label":"Right Align",children:t(Za,{name:"formatAlignRight"})}),t("button",{onClick:()=>{X(Zq,"justify")},className:"toolbar-item spaced "+("justify"==y?"active":""),"aria-label":"Justify Align",children:t(Za,{name:"formatAlignJustify"})}),t(M2,{}),t(y2,{buttonClassName:"toolbar-item",buttonAriaLabel:"Formatting text color",buttonLabel:t(Za,{name:"formatColorText"}),color:h,onChange:H,title:"text color"}),t(y2,{buttonClassName:"toolbar-item",buttonAriaLabel:"Formatting background color",buttonLabel:t(Za,{name:"formatColorFill"}),color:f,onChange:W,title:"bg color"})]})}));function P2({onChange:t}){const[e]=S1();return i.useEffect((()=>e.registerUpdateListener((({editorState:n})=>{t(n,e)}))),[e,t]),null}const T2=a((({onChange:r,...i})=>{const[o]=S1();return t(B,{direction:"vertical",dimensionX:"fill",dimensionY:472,alignment:"leftTop",...i,children:e(n,{children:[t(O2,{editor:o}),t(z1,{contentEditable:t(B1,{className:O1}),ErrorBoundary:G1}),t(P2,{onChange:r}),t(X1,{}),t(P1,{})]})})}));var N2=a((({className:n="",value:r="<p></p>",headerProps:i,description:o,onChange:a,contentProps:s})=>{const l=(t,e)=>(((t,e)=>{const n=EZ(),r=B0(t,(new DOMParser).parseFromString(e,"text/html"));n.clear();try{n.append(...r)}catch{const t=fQ();t.append(...r),n.append(t)}})(t,e),t),u={namespace:"RichTextInput",onError:t=>{console.error("Lexical Error:",t)},editorState:t=>l(t,r),nodes:[bQ,{replace:FK,with:t=>new bQ(t.__text)},D0,C0,d1,c1,o0,p0]},d=c(((t,e)=>{t.read((()=>{const t=H0(e,null);a?.(t)}))}),[a]);return e(B,{className:`${gq} ${n}`,dimensionX:"fill",direction:"vertical",children:[i&&t(ED,{prefix:{children:i?.icon&&t(Za,{name:i?.icon}),...i?.iconProps},root:{children:i?.label&&t(V,{children:i?.label}),...i?.labelProps},...i?.container}),t(M1,{initialConfig:u,children:t(T2,{...s,onChange:d})}),t(V,{size:"xsmall",className:`${vq}`,children:o})]})})),D2={container:"ObjectInput-module_container__JtW64",error:"ObjectInput-module_error__z1cTE",inputContainer:"ObjectInput-module_inputContainer__Kjm9k"};var A2=a((({value:n,properties:r,title:i,description:o,errorMessage:a,helperTextContainerProps:s,helperTextProps:l,onChange:c,errors:u,...d})=>{const h=I5({properties:r,value:n,onChange:c,error:u,errorClassName:D2.error,containerClassName:D2.inputContainer});return e(B,{gap:20,direction:"vertical",dimensionX:"fill",...d,className:`${d.className} ${D2.container}`,children:[i&&t(ED,{prefix:{children:t(Za,{name:"dataObject",className:D2.icon})},root:{children:t(V,{variant:"secondary",children:i})}}),h,t(at.HelperText,{alignment:"leftCenter",dimensionX:"fill",...s,className:`${D2.helperText} ${s?.className}`,children:t(V,{...l,size:"small",variant:a?"danger":"secondary",className:`${l?.className}`,children:a||o})})]})})),L2="ChipInput-module_chipInputContainer__wRY2y",I2="ChipInput-module_errorTextContainer__AQPXD",z2="ChipInput-module_errorText__Qw1NA";var R2,$2,F2,j2,B2,H2,W2,V2,Y2,X2,q2,U2,Z2,G2,K2,J2,Q2,t5,e5,n5,r5,i5,o5,a5,s5,l5,c5,u5,d5=a((({label:n,placeholder:r="Enter a value than press enter",onChange:i,value:o,allowDuplicateValues:a=!1,valueType:s="string",...c})=>{const[d,h]=u(""),[p,f]=u();l((()=>{f(void 0)}),[d]),l((()=>{let t=[];"number"===s?t=o.filter((t=>!isNaN(Number(t)))).map((t=>Number(t))):(t=o.map((t=>String(t))),f(void 0)),i(t)}),[s]);return e(B,{dimensionX:"fill",direction:"wrap",alignment:"leftCenter",...c,className:`${L2} ${c.className}`,children:[o.map(((e,n)=>t(em,{variant:"outlined",label:String(e),onDelete:()=>(t=>{const e=o.filter(((e,n)=>n!==t));i(e)})(n)},n))),t(G,{placeholder:r,value:d,onChange:t=>h(t.target.value),onKeyDown:t=>{if("Enter"===t.key&&""!==d.trim()){t.preventDefault();const e="number"===s?Number(d.trim()):d.trim();if("number"==typeof e&&isNaN(e))return void f("Value must be a valid number");if(!a&&o.includes(e))return;const n=[...o,e];i(n),h("")}}}),t("div",{className:I2,children:p&&t(V,{className:z2,variant:"danger",children:p})})," "]})})),h5="RelationInput-module_icon__folVL",p5="RelationInput-module_text__h8Gq5",f5="RelationInput-module_select__H7bRO",m5="RelationInput-module_baseInput__9cDeK",g5={container:"RelationSelect-module_container__nwkcp",disabled:"RelationSelect-module_disabled__37hiQ",displayer:"RelationSelect-module_displayer__-ispL",selectDropdown:"RelationSelect-module_selectDropdown__HAwgv",searchInputWrapper:"RelationSelect-module_searchInputWrapper__2XT5T",searchIcon:"RelationSelect-module_searchIcon__Wpvzz",searchInput:"RelationSelect-module_searchInput__Aihgm",deleteIcon:"RelationSelect-module_deleteIcon__l6plf"};function v5(){if($2)return R2;return $2=1,R2=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},R2}function y5(){if(H2)return B2;H2=1;var t=function(){if(j2)return F2;j2=1;var t="object"==typeof vt&&vt&&vt.Object===Object&&vt;return F2=t}(),e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return B2=n}function b5(){if(U2)return q2;U2=1;var t=function(){if(X2)return Y2;X2=1;var t=/\s/;return Y2=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n},Y2}(),e=/^\s+/;return q2=function(n){return n?n.slice(0,t(n)+1).replace(e,""):n},q2}function _5(){if(G2)return Z2;G2=1;var t=y5().Symbol;return Z2=t}function x5(){if(n5)return e5;n5=1;var t=_5(),e=function(){if(J2)return K2;J2=1;var t=_5(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,i=t?t.toStringTag:void 0;return K2=function(t){var e=n.call(t,i),o=t[i];try{t[i]=void 0;var a=!0}catch(t){}var s=r.call(t);return a&&(e?t[i]=o:delete t[i]),s}}(),n=function(){if(t5)return Q2;t5=1;var t=Object.prototype.toString;return Q2=function(e){return t.call(e)}}(),r=t?t.toStringTag:void 0;return e5=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":r&&r in Object(t)?e(t):n(t)}}function w5(){if(a5)return o5;a5=1;var t=x5(),e=i5?r5:(i5=1,r5=function(t){return null!=t&&"object"==typeof t});return o5=function(n){return"symbol"==typeof n||e(n)&&"[object Symbol]"==t(n)}}var S5=function(){if(u5)return c5;u5=1;var t=v5(),e=function(){if(V2)return W2;V2=1;var t=y5();return W2=function(){return t.Date.now()}}(),n=function(){if(l5)return s5;l5=1;var t=b5(),e=v5(),n=w5(),r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;return s5=function(s){if("number"==typeof s)return s;if(n(s))return NaN;if(e(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=e(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=t(s);var c=i.test(s);return c||o.test(s)?a(s.slice(2),c?2:8):r.test(s)?NaN:+s}}(),r=Math.max,i=Math.min;return c5=function(o,a,s){var l,c,u,d,h,p,f=0,m=!1,g=!1,v=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function y(t){var e=l,n=c;return l=c=void 0,f=t,d=o.apply(n,e)}function b(t){var e=t-p;return void 0===p||e>=a||e<0||g&&t-f>=u}function _(){var t=e();if(b(t))return x(t);h=setTimeout(_,function(t){var e=a-(t-p);return g?i(e,u-(t-f)):e}(t))}function x(t){return h=void 0,v&&l?y(t):(l=c=void 0,d)}function w(){var t=e(),n=b(t);if(l=arguments,c=this,p=t,n){if(void 0===h)return function(t){return f=t,h=setTimeout(_,a),m?y(t):d}(p);if(g)return clearTimeout(h),h=setTimeout(_,a),y(p)}return void 0===h&&(h=setTimeout(_,a)),d}return a=n(a)||0,t(s)&&(m=!!s.leading,u=(g="maxWait"in s)?r(n(s.maxWait)||0,a):u,v="trailing"in s?!!s.trailing:v),w.cancel=function(){void 0!==h&&clearTimeout(h),f=0,l=p=c=h=void 0},w.flush=function(){return void 0===h?d:x(e())},w},c5}(),k5=yt(S5),C5=function(t,e){return C5=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},C5(t,e)};var E5=function(){return E5=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},E5.apply(this,arguments)};var M5="Pixel",O5="Percent",P5={unit:O5,value:.8};function T5(t){return"number"==typeof t?{unit:O5,value:100*t}:"string"==typeof t?t.match(/^(\d*(\.\d+)?)px$/)?{unit:M5,value:parseFloat(t)}:t.match(/^(\d*(\.\d+)?)%$/)?{unit:O5,value:parseFloat(t)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),P5):(console.warn("scrollThreshold should be string or number"),P5)}var N5=function(t){function e(e){var n=t.call(this,e)||this;return n.lastScrollTop=0,n.actionTriggered=!1,n.startY=0,n.currentY=0,n.dragging=!1,n.maxPullDownDistance=0,n.getScrollableTarget=function(){return n.props.scrollableTarget instanceof HTMLElement?n.props.scrollableTarget:"string"==typeof n.props.scrollableTarget?document.getElementById(n.props.scrollableTarget):(null===n.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)},n.onStart=function(t){n.lastScrollTop||(n.dragging=!0,t instanceof MouseEvent?n.startY=t.pageY:t instanceof TouchEvent&&(n.startY=t.touches[0].pageY),n.currentY=n.startY,n._infScroll&&(n._infScroll.style.willChange="transform",n._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},n.onMove=function(t){n.dragging&&(t instanceof MouseEvent?n.currentY=t.pageY:t instanceof TouchEvent&&(n.currentY=t.touches[0].pageY),n.currentY<n.startY||(n.currentY-n.startY>=Number(n.props.pullDownToRefreshThreshold)&&n.setState({pullToRefreshThresholdBreached:!0}),n.currentY-n.startY>1.5*n.maxPullDownDistance||n._infScroll&&(n._infScroll.style.overflow="visible",n._infScroll.style.transform="translate3d(0px, "+(n.currentY-n.startY)+"px, 0px)")))},n.onEnd=function(){n.startY=0,n.currentY=0,n.dragging=!1,n.state.pullToRefreshThresholdBreached&&(n.props.refreshFunction&&n.props.refreshFunction(),n.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame((function(){n._infScroll&&(n._infScroll.style.overflow="auto",n._infScroll.style.transform="none",n._infScroll.style.willChange="unset")}))},n.onScrollListener=function(t){"function"==typeof n.props.onScroll&&setTimeout((function(){return n.props.onScroll&&n.props.onScroll(t)}),0);var e=n.props.height||n._scrollableNode?t.target:document.documentElement.scrollTop?document.documentElement:document.body;n.actionTriggered||((n.props.inverse?n.isElementAtTop(e,n.props.scrollThreshold):n.isElementAtBottom(e,n.props.scrollThreshold))&&n.props.hasMore&&(n.actionTriggered=!0,n.setState({showLoader:!0}),n.props.next&&n.props.next()),n.lastScrollTop=e.scrollTop)},n.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:e.dataLength},n.throttledOnScrollListener=function(t,e,n,r){var i,o=!1,a=0;function s(){i&&clearTimeout(i)}function l(){var l=this,c=Date.now()-a,u=arguments;function d(){a=Date.now(),n.apply(l,u)}o||(r&&!i&&d(),s(),void 0===r&&c>t?d():!0!==e&&(i=setTimeout(r?function(){i=void 0}:d,void 0===r?t-c:t)))}return"boolean"!=typeof e&&(r=n,n=e,e=void 0),l.cancel=function(){s(),o=!0},l}(150,n.onScrollListener).bind(n),n.onStart=n.onStart.bind(n),n.onMove=n.onMove.bind(n),n.onEnd=n.onEnd.bind(n),n}return function(t,e){function n(){this.constructor=t}C5(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},e.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},e.prototype.componentDidUpdate=function(t){this.props.dataLength!==t.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},e.getDerivedStateFromProps=function(t,e){return t.dataLength!==e.prevDataLength?E5(E5({},e),{prevDataLength:t.dataLength}):null},e.prototype.isElementAtTop=function(t,e){void 0===e&&(e=.8);var n=t===document.body||t===document.documentElement?window.screen.availHeight:t.clientHeight,r=T5(e);return r.unit===M5?t.scrollTop<=r.value+n-t.scrollHeight+1:t.scrollTop<=r.value/100+n-t.scrollHeight+1},e.prototype.isElementAtBottom=function(t,e){void 0===e&&(e=.8);var n=t===document.body||t===document.documentElement?window.screen.availHeight:t.clientHeight,r=T5(e);return r.unit===M5?t.scrollTop+n>=t.scrollHeight-r.value:t.scrollTop+n>=r.value/100*t.scrollHeight},e.prototype.render=function(){var t=this,e=E5({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),r=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return i.createElement("div",{style:r,className:"infinite-scroll-component__outerdiv"},i.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(e){return t._infScroll=e},style:e},this.props.pullDownToRefresh&&i.createElement("div",{style:{position:"relative"},ref:function(e){return t._pullDown=e}},i.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},e}(S);var D5=a((({options:r,placeholder:i="Select an option",placement:a="bottom",multiple:c=!1,disabled:h=!1,maxCount:p,popupClassName:m="",optionProps:g,selectRef:v,disableClick:y,onChange:_,loadMoreOptions:x,searchOptions:w,totalOptionsLength:S,selectedOption:k,setSelectedOption:C,dropDownRef:E,...M})=>{const[O,P]=u(0),[T,N]=u(!1),[D,A]=u(""),L=o((()=>k5((t=>{w(t)}),1e3)),[w]);l((()=>()=>{L.cancel()}),[L]),l((()=>{L(D)}),[D]);const I=s(null),z=()=>{y||N(!1)};J({targetElements:[I],onClickOutside:z});const{targetPosition:R,calculatePosition:$}=Q({containerRef:I,targetRef:E,initialPlacement:a});d((()=>{I.current&&P(I.current.offsetWidth-50)}),[]),d((()=>{T&&I.current&&E?.current&&$()}),[T,r,$]);const F=t=>{c?(()=>{if(!Array.isArray(k))return;const e=Boolean(k.find((e=>e.value===t.value&&e.label===t.label)))?k.filter((e=>e.value!==t.value)):[...k,t];C(e),_?.(e)})():(C(t),_?.(t),N(!1))};b(v,(()=>({toggleDropdown:W,clear:j})));const j=()=>{C([]),_?.([]),N(!1)},W=t=>{N(void 0===t?t=>!t:t)},Y=f();return e(n,{children:[t(H,{ref:I,onClick:()=>{h||y||W()},dimensionX:"fill",dimensionY:36,root:{children:t(V,{style:{maxWidth:O,...M.root?.style},className:`${M.root?.className} ${g5.displayer}`,children:(!c||Array.isArray(k)&&k.length)&&"object"==typeof r[0]?k?.map?.((e=>t(em,{variant:"outlined",label:e.label,onDelete:()=>F(e)},`${e.value}${e.label}`)))??k?.label??i:i}),dimensionX:"fill",alignment:"leftCenter"},suffix:{onClick:t=>{t.stopPropagation(),C(c?[]:null)},children:t(Za,{className:g5.deleteIcon,name:"delete",size:"sm"})},...M,className:`${M.className} ${g5.container} ${h&&g5.disabled}`}),T&&t(fD,{onClickOutside:z,children:t(B,{ref:E,style:{...R},className:`${m} ${g5.selectDropdown}`,direction:"vertical",alignment:"leftTop",gap:0,id:Y,children:e(N5,{dataLength:r.length,next:x,hasMore:S>r.length,loader:t(bs,{size:"small"}),scrollableTarget:Y,className:g5.infiniteScroll,children:[t("div",{className:g5.searchInputWrapper,children:t(K,{gap:10,dimensionX:400,prefix:{children:t(Za,{name:"magnify",className:g5.searchIcon})},inputProps:{placeholder:"Search",value:D,onChange:t=>A(t.target.value)},className:g5.searchInput})}),r.map((e=>{const n="object"==typeof e?e.value:e,r=c?Array.isArray(k)&&Boolean(k.find((t=>t.value===e.value&&t.label===e.label))):k===e,i=c&&!!p&&Array.isArray(k)&&k.length>=p&&!r;return t(dA,{disabled:i,dimensionX:I.current?.offsetWidth,multiple:c,option:e,selected:r,onClick:()=>F(e),...g},n.toString())}))]})})})]})}));var A5=a((({label:e,description:n,value:r,onChange:i,selectProps:o,inputContainerClassName:a,getOptions:c,loadMoreOptions:d,searchOptions:h,totalOptionsLength:p,multiple:f,...m})=>{const g=s(null),v=s(null),[y,b]=u([]),[_,x]=u((()=>r||(f?[]:null)));l((()=>{(r||0===r||""===r)&&x(r)}),[r]);l((()=>{c().then((t=>b(t)))}),[]);return t(ht,{dimensionX:"fill",description:n,dropDownRef:v,onFocusChange:t=>(t=>{g?.current?.toggleDropdown(t)})(t),labelProps:{dimensionX:"hug",divider:!0,prefix:{children:t(Za,{className:h5,name:"callMerge"})},root:{dimensionX:"hug",children:t(V,{className:p5,size:"medium",children:e})}},inputContainerProps:{className:`${m5} ${a}`},...m,children:t(D5,{totalOptionsLength:p,selectRef:g,disableClick:!0,options:y||[],placeholder:"",multiple:f,onChange:t=>{i?.(t)},...o,className:`${f5} ${o?.className}`,loadMoreOptions:()=>{d().then((t=>b([...y,...t])))},searchOptions:t=>{h(t).then((t=>{b(t)}))},selectedOption:_,setSelectedOption:x,dropDownRef:v})})}));const L5={string:e=>t($Y,{label:e.title,description:e.description,inputContainerClassName:e.className,value:e.value,options:e.enum,onChange:t=>{e.onChange?.({key:e.key,value:t})}}),number:e=>t(VY,{label:e.title,description:e.description,inputContainerClassName:e.className,value:e.value,options:e.enum,onChange:t=>e.onChange?.({key:e.key,value:t})}),textarea:e=>t(ZY,{title:e.title,titlePrefixProps:{children:t(Za,{name:"formatSize"})},containerProps:{className:e.className},value:e.value,onChange:t=>e.onChange?.({key:e.key,value:t.target.value})}),date:e=>t(GY,{label:e.title,description:e.description,inputContainerClassName:e.className,value:e.value,onChange:t=>e.onChange?.({key:e.key,value:t})}),boolean:e=>t(QY,{checked:e.value,label:e.title,description:e.description,containerProps:{dimensionX:"fill"},onChange:t=>e.onChange?.({key:e.key,value:t}),size:e.size}),color:e=>t(eX,{label:e.title,description:e.description,inputContainerClassName:e.className,value:e.value,onChange:t=>e.onChange?.({key:e.key,value:t})}),storage:e=>t(oq,{onUpload:()=>{},label:e.title,containerProps:{className:e.className}}),multiselect:e=>t(uq,{label:e.title,description:e.description,inputContainerClassName:e.className,value:e.value,options:e.enum,onChange:t=>e.onChange?.({key:e.key,value:t})}),location:e=>{if(mW.api.isTypeLocation(e.value)){const t=e?.value.coordinates;e.value={lat:t[1],lng:t[0]}}return t(mq,{title:e.title,dimensionX:"fill",coordinates:e.value,onChange:t=>{let n=t;mW.api.isTypeLocation(e.value)&&(n={type:"Point",coordinates:[t.lng,t.lng]}),e.onChange?.({key:e.key,value:n})}})},richtext:e=>t(N2,{headerProps:{label:e.title,icon:"formatAlignCenter"},value:e.value,onChange:t=>e.onChange?.({key:e.key,value:t})}),object:e=>t(A2,{properties:e.properties,title:e.title,description:e.description,value:e.value,onChange:t=>{e.onChange?.({key:e.key,value:t})},errors:e.errors,className:e.className}),array:e=>t(z5,{title:e.title,description:e.description,value:e.value,onChange:t=>e.onChange?.({key:e.title,value:t}),minItems:e.minItems,maxItems:e.maxItems,items:e.items,propertyKey:e.key,errors:e.errors}),chip:e=>t(d5,{value:e.value??[],onChange:t=>{e.onChange?.({key:e.key,value:t})},valueType:e.valueType}),relation:e=>t(A5,{value:e.value,onChange:t=>e.onChange?.({key:e.key,value:t}),label:e.title,getOptions:e.getOptions,loadMoreOptions:e.loadMoreOptions,searchOptions:e.searchOptions,totalOptionsLength:e.totalOptionsLength}),select:e=>t(YA,{options:e.enum,value:e.value,onChange:t=>{e.onChange?.({key:e.key,value:t})}})},I5=({properties:n,value:r,error:i,onChange:o,containerClassName:a,errorClassName:s})=>{const l=Boolean(a||s);return Object.entries(n).map((([n,c])=>{const u="object"==typeof r&&!Array.isArray(r);if(u&&c.renderCondition){const{field:t}=c.renderCondition,e=r[t],n=(t,n=!1)=>{if(!(t in c.renderCondition))return!1;const r=c.renderCondition[t],i=Array.isArray(r)?r.includes(e):e===r;return n?i:!i};if(n("notEquals",!0)||n("equals"))return null}const d=u?r[n]??r:r,h=i?.[n];return e("div",{style:l?void 0:{position:"relative",width:"100%"},className:a,id:c.id??void 0,children:[L5[c.type]({key:n,title:c.title,description:c.description,value:d,className:c.className,properties:c.properties,enum:c.enum??c.items?.enum,minItems:c.minItems,maxItems:c.maxItems,items:c.items,onChange:t=>(t=>{const e=structuredClone(r);e[t.key]=t.value,o?.(e)})(t),getOptions:c.getOptions,loadMoreOptions:c.loadMoreOptions,searchOptions:c.searchOptions,totalOptionsLength:c.totalOptionsLength,size:c.size,valueType:c.valueType,errors:"string"==typeof h?void 0:h}),h&&"string"==typeof h&&t(V,{className:s,style:l?void 0:{position:"absolute",bottom:0,left:0,pointerEvents:"none",whiteSpace:"nowrap"},size:"xsmall",variant:"danger",children:h})]},n)}))};var z5=a((({value:n,items:r,title:i,description:o,errorMessage:a,helperTextContainerProps:s,helperTextProps:l,maxItems:d,propertyKey:h,onChange:p,errors:f,minItems:m,...g})=>{const[v,y]=u(0),b=I5({properties:{[h]:r},value:{[h]:n?.[v]},onChange:t=>{const e=structuredClone(n);if(!e?.length)return n;e[v]=t[h],p?.(e)},error:f}),_=c(((t,e)=>{switch(t){case"string":case"textarea":case"richtext":case"color":case"storage":case"select":case"date":default:return"";case"multiselect":case"chip":case"relation":case"array":return[];case"number":return 0;case"boolean":return!1;case"location":return{lat:0,lng:0};case"object":if(!e)return{};const t={};return Object.entries(e).forEach((([e,n])=>{t[e]=void 0!==n.default?n.default:_(n.type,n.properties)})),t}}),[]),x=c((()=>r?_(r.type,r.properties):""),[r,_]);return e(B,{gap:20,direction:"vertical",dimensionX:"fill",...g,className:`${g.className} ${DY.container}`,children:[e("div",{className:DY.header,children:[i&&t(ED,{prefix:{children:t(Za,{name:"ballot",className:DY.icon})},root:{children:t(V,{variant:"secondary",children:i})}}),t(kD,{length:n?.length,active:v,maxItems:d,onChange:t=>{y(t)},onCreate:()=>{const t=[...n||[]];t?.push(n?.[v]||x()),p?.(t),y(t.length-1)},onDelete:t=>{const e=[...n||[]];e.splice(t,1),p?.(e),y(Math.max(0,t-1))}})]}),n?.length?b:"Create an element to see the fields",t(at.HelperText,{alignment:"leftCenter",dimensionX:"fill",...s,className:`${DY.helperText} ${s?.className}`,children:t(V,{...l,size:"small",variant:a?"danger":"secondary",className:`${l?.className}`,children:a||o})})]})}));const R5=({propertyKey:e,value:n,items:r,popoverProps:i,contentProps:o,...a})=>t(mD,{content:t(z5,{propertyKey:e,items:r,value:n,onChange:t=>a.onChange?.({key:a.key,value:t}),...o}),contentProps:{className:TY},containerProps:{dimensionX:"fill"},...i,children:t(B,{dimensionX:"fill",alignment:"leftCenter",dimensionY:36,...a,className:`${a.className} ${PY}`,children:t(V,{className:NY,children:JSON.stringify(n)})})});var $5=a((({checked:e,disabled:n=!1,containerProps:r,onChange:i})=>t(wA,{checked:e,disabled:n,...r,onChange:i}))),F5="ColorMinimized-module_colorMinimized__CnRpu",j5="ColorMinimized-module_closeIcon__SH3uo";const B5=({value:e="#000000",onClear:n,onChange:r,...i})=>{const[o,a]=u(e);return t(H,{alignment:"leftCenter",dimensionX:"fill",className:F5,...i,root:{dimensionX:"fill",alignment:"leftCenter",children:t(rm,{value:o||"#000000",onChange:t=>{a(t),r?.(t)}}),...i.root},suffix:{dimensionX:"hug",alignment:"center",children:t(_s,{children:t(Za,{name:"close"}),color:"transparent",onClick:t=>{t.preventDefault(),t.stopPropagation(),a(""),r?.(""),n?.()},className:j5}),...i.suffix}})};var H5="Date-module_minimizedDatePicker__ZIsQ7",W5="Date-module_clearButton__WMLse";const V5=({onChange:e,value:n,placeholder:r="",onClear:i,datePickerClassName:o,...a})=>t(H,{mode:"fill",dimensionX:"fill",gap:10,...a,className:`${H5} ${a.className}`,root:{alignment:"leftCenter",children:t(oD,{onChange:t=>{e?.(new Date(t))},value:n,placeholder:r,suffixIcon:null,allowClear:!1,className:o}),...a.root},suffix:{...a.suffix,children:t(_s,{variant:"text",className:W5,keepWidth:!1,onClick:i,children:t(Za,{name:"close"})})}});var Y5="Location-module_container__SbKlF";const X5=({contentProps:n,mapProps:r,icon:i,...o})=>t(mD,{content:t(ZD,{...r}),contentProps:n,containerProps:{dimensionX:"fill",alignment:"leftCenter",...o},children:t(H,{dimensionX:"fill",dimensionY:"fill",prefix:{children:i||t("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAStSURBVHgBNZXZblNXFIa/vc88+NiJDSEDbQCVAheFtmp7Gy6rSn2DCt4EeBLKG7TqZWmLVKnTRYWYKYiEEEicxLN9Jp+hK1HrC8vS2fv3Wv//rXUU/312Nx9uGOX0Bv7SlbmyW7b2QZdoDXmeQtylceI8tVLM0py86hIYJ+S5cW8WZ3fW1pa/PdLRR19v3nZvaEP/YoTLG4YVtOqqJi9SLMvCMCx6xiLa7ZDOC+bJmHI+J8JBGyazWm9MDPv2aDC4caSl9rf/ua6CpduHB29ZbjfI0plcblOWFVVV4jgO6XgHb/FDxsNXNO0BuXkRRSVnE6Iokg5y/EZAnGRXda7Da249YNHJMFVFXLnU6SF2+gZbxPKyxMgz4ne/49cz4omW50+xzJoojKAqjkV7ewcU2eCoUzbmuknlnqJyOijtYPonmCQlbtlDpT3Mk5cIVj6j4dr0sgbKWiGb9hjvP+Ggsnk2vkvXtuR8fkUXtke31JhOiJo+xCKlloY6731EYp2iNCrqKiOdxsTa4PTpBfG1RWNhjR3W8fM9DruXOa96cjdpaX/2F6eNXNT7TNOGpCfe1TCZTnDj54TBCvnoLWbyGNc9g22kFJNX9AcDLi7GmFLMpeaUF1NFXQ+PqOgwiAUDmkyjAwlkJh71cE3FVhxiJZuYhiJc/Zy0/4j9vRzHRAiwGcYllBkT3SF0FIV7BT1q+RSNV9jvDkjdEfs//UyjIW2l2zR1we4sIBTzi8Mn1NK+b045tN4nEYSWFlfpiWjW32IhOMVQyFDx+LB+Mv2R7laMvXyednOPTtLBitaxYxO7OGSSG6T+Kg1x94/9LT5ZXJaEHeQ+2bwWOiTsWjDKp+g98adSmtUPPLQK2f1tzNwLYWygLZ+tbJWWM6TtxMyLgqvtjNCV9mqDWe81kSN2yW872yEIIrEssvGtWgy1aHnPWPyiZC118X1P0jRZ05tgn4XZA3TRozaXUZl4rQyiwOegPwRTYLdOUo3fSBEJ7L8uhPIea/PzXDS/oT89IJ92mXc3qU4uSVtjDOsCDf0dOE10uI4pQ5taS2JCSDbSUrUWQhRq1N+p8/gxufqYTNKsy23aoSyB8XNs8bE/eSZXouMRHFVtPIF72uvRkJQzDEaNB0LFpzSLMVomSeeZhW+sYlYDOsU2C95ZOSZGuzvUkx9E6k9s3UfZDsXua8q8ZjP4ntL1sSUYZ3SBllHiWTliMdpTu8Ot+RC3tYIKOpTJSxw1ocjXwbNR5QYzfYZR4tE6u0JcxLjJ15LsRCDWMq4e+4WUIEi6koWudXg/8FpiiJibTlDmEv3cl5FzmeuvKKJz2FYkocnqqiMCqXSpesvr0V1I9jlhx6waM6Z5iXIX7mnZELeMapm/5y0m1iqW25Iqh7LzKvrDEVb2lJkcbmbPcPNNHFth2Gu0/S+Zy0zX6qjNNkoKGMTGHXW8rV/8elPbizfyiQhYEozhSJoRbVv+GZNhXdO0lmXBCsj9lwJ1QC5UmAJ4NRCULNmFur517v3LN9X/r4Cd7Z3rbmhfc73mxmzvEZl7lrDcoTQXZOUlx0h4ns8wS3D8JXQWY6hiWCSj+0Fr/dbCgnfvSOdfUypD2h2KlUYAAAAASUVORK5CYII=",alt:"location"})},root:{children:r?.coordinates&&e(V,{children:[r?.coordinates?.lat,", ",r?.coordinates?.lng," "]})},className:Y5})});var q5="MultiSelection-module_multiSelectionContainer__tUi2u",U5="MultiSelection-module_multiSelect__SA5u-";const Z5=({options:e,value:n,onChange:r,selectProps:i,...o})=>{const a=s(null);return t(H,{mode:"fill",dimensionX:"fill",root:{children:t(YA,{selectRef:a,prefix:{children:t(Za,{name:"chevronDown"})},suffix:{children:Array.isArray(n)&&n.length>0&&t(_s,{variant:"text",keepWidth:!1,onClick:t=>{t.preventDefault(),t.stopPropagation(),a?.current?.clear()},children:t(Za,{name:"close"})})},multiple:!0,options:e,value:n,onChange:t=>r?.(t),...i,className:U5})},...o,className:`${q5} ${o.className}`})};var G5="NumberMinimized-module_numberMinimized__o1ZAN",K5="NumberMinimized-module_select__yHQXe",J5="NumberMinimized-module_closeIcon__EgNTI";var Q5=a((({onClear:e,value:n,options:r,inputProps:i,onChange:o,...a})=>{const l=s(null),c=s(null);return t(H,{alignment:"leftCenter",dimensionX:"fill",className:G5,...a,root:{dimensionX:"fill",alignment:"leftCenter",children:r?t(YA,{selectRef:l,className:K5,placeholder:void 0!==n?String(n):"",value:n,options:r||[],onChange:t=>o?.(t)}):t(G,{ref:c,value:n??"",type:"number",...i,onChange:t=>o?.(Number(t.target.value))}),...a.root},suffix:{dimensionX:"hug",alignment:"center",children:t(_s,{children:t(Za,{name:"close"}),color:"transparent",onClick:t=>{t.preventDefault(),t.stopPropagation(),e?.(),l.current&&l.current.clear(),c.current&&(c.current.value="")},className:J5}),...a.suffix}})})),t3="Object-module_inputMinimized__JH1n-",e3="Object-module_contentContainer__y0Sfp",n3="Object-module_value__SJt70";const r3=({value:e,popoverProps:n,contentProps:r,properties:i,onChange:o,...a})=>t(mD,{content:t(A2,{properties:i,value:e,onChange:t=>o?.(t),...r}),contentProps:{className:e3},containerProps:{dimensionX:"fill"},...n,children:t(B,{dimensionX:"fill",alignment:"leftCenter",dimensionY:36,...a,className:`${a.className} ${t3}`,children:t(V,{className:n3,children:JSON.stringify(e)})})});var i3="RichText-module_richTextMinimized__LUAfH";const o3=({value:e,richTextProps:n,...r})=>t(mD,{content:t(N2,{value:e,contentProps:n}),containerProps:{dimensionX:"fill"},children:t(B,{dimensionX:"fill",alignment:"leftCenter",className:i3,...r,children:t(V,{children:e})})});var a3="StringMinimized-module_stringMinimized__m53JQ",s3="StringMinimized-module_select__uPgy-",l3="StringMinimized-module_closeIcon__N2ycP";var c3=a((({onClear:e,value:n,options:r,inputProps:i,enumOnChange:o,...a})=>t(H,{alignment:"leftCenter",dimensionX:"fill",className:a3,...a,root:{dimensionX:"fill",alignment:"leftCenter",children:r?t(YA,{className:s3,placeholder:n||" ",options:r||[],onChange:t=>o?.(String(t))}):t(G,{value:n,...i}),...a.root},suffix:{dimensionX:"hug",alignment:"center",children:t(_s,{children:t(Za,{name:"close"}),color:"transparent",onClick:e,className:l3}),...a.suffix}}))),u3="TextArea-module_textArea__VbAA6";const d3=({value:e,onClear:n,onChange:r,focusedRows:i=3,onFocus:o,onBlur:a,rows:s=1,cols:l=1,...c})=>{const[d,h]=u(!1);return t(H,{mode:"fill",dimensionX:"fill",root:{children:t("textarea",{value:e,onChange:t=>r?.(t.target.value),onFocus:()=>{h(!0),o?.(!0)},onBlur:()=>{h(!1),a?.(!1)},rows:d?i:s,cols:l})},suffix:{children:t(Za,{name:"close"})},...c,className:`${u3} ${c.className}`})};var h3=a((({selectClassName:e="",label:n="",options:r=[],onChange:i,...o})=>t(B,{...o,dimensionX:"fill",alignment:"leftCenter",children:t(YA,{className:e,placeholder:n,options:r,onChange:i||(()=>{})})}))),p3={drawerContainer:"Drawer-module_drawerContainer__ygAhi",contentContainer:"Drawer-module_contentContainer__Bku-Q",closeButton:"Drawer-module_closeButton__dw57X",leftPosition:"Drawer-module_leftPosition__kS7SQ",scrollableContent:"Drawer-module_scrollableContent__gAaIU",top:"Drawer-module_top__YhWtK",bottom:"Drawer-module_bottom__5nFWz",xs:"Drawer-module_xs__jAtGZ",sm:"Drawer-module_sm__Up7LN",md:"Drawer-module_md__cJcNU",lg:"Drawer-module_lg__c7C-6",xl:"Drawer-module_xl__r6s2-",full:"Drawer-module_full__maAwS",hug:"Drawer-module_hug__JzEGJ",left:"Drawer-module_left__NCP-V",right:"Drawer-module_right__X1qUr",leftToMiddle:"Drawer-module_leftToMiddle__UwTtm",slideFromLeft:"Drawer-module_slideFromLeft__PD3iU",rightToMiddle:"Drawer-module_rightToMiddle__-1zTg",slideFromRight:"Drawer-module_slideFromRight__y-9Lp",topToBottom:"Drawer-module_topToBottom__DlPXA",slideFromTop:"Drawer-module_slideFromTop__-c93O",bottomToTop:"Drawer-module_bottomToTop__b0ULm",slideFromBottom:"Drawer-module_slideFromBottom__uSm8d",shake:"Drawer-module_shake__pBbnG"};const f3=["xs","sm","md","lg","xl","full","hug"],m3=({placement:n,size:r="hug",children:i,showBackdrop:o=!0,backdropType:a="default",backdropClassName:s,backdropProps:c,showCloseButton:d=!0,isOpen:h=!1,onClose:p,portalClassName:f})=>{const[m,g]=u(h),[v,y]=u(!1),[b,_]=u(!1);l((()=>{g(h)}),[h]);const x=()=>{g(!1),p&&p()};if(!m)return null;const w={top:"topToBottom",right:"rightToMiddle",bottom:"bottomToTop",left:"leftToMiddle"}[n],S="number"==typeof r||"string"==typeof r&&!f3.includes(r),k=S?"left"===n||"right"===n?{width:"number"==typeof r?`${r}px`:r}:{height:"number"==typeof r?`${r}px`:r}:{};return t(fD,{className:f,children:e(B,{className:p3.drawerContainer,children:[t(oA,{showBackdrop:o,...c,className:s,onClick:()=>{"static"===a?(y(!0),_(!1),setTimeout((()=>{y(!1),_(!0)}),400)):x()}}),e("div",{className:`${p3.contentContainer} ${b?"":p3[w]} ${v?p3.shake:""} ${p3[n]} ${S?"":p3[r]}`,style:k,children:[d&&t(_s,{className:`${p3.closeButton} ${"right"===n?p3.leftPosition:p3.rightPosition}`,onClick:x,children:t(Za,{name:"close"}),variant:"icon"}),t("div",{className:p3.scrollableContent,children:i})]})]})})};var g3={container:"Tab-module_container__e6CN6",indicator:"Tab-module_indicator__UNCf0",item:"Tab-module_item__jpQZh",default:"Tab-module_default__qy-23",active:"Tab-module_active__687wz",underline:"Tab-module_underline__1gKBc",window:"Tab-module_window__vPuG0",root:"Tab-module_root__gGJhw"};var v3,y3=a((({type:n="default",items:r,indicatorClassName:i,indicatorMode:o="equal",value:a,onChange:c,...d})=>{const[h,p]=u(0),[f,m]=u([]),g=s(null),v=s([]);l((()=>{(a||0===a)&&p(a)}),[a]);l((()=>{const t=v.current.map((t=>(t?.offsetWidth||0)+("window"===n?5:20)));m(t)}),[r,o,n]);const y="fit"===o?f[h]||0:f[h]-2,b=f.slice(0,h).reduce(((t,e)=>t+e-5),0);return e(B,{ref:g,dimensionX:"fill",gap:"window"===n?0:20,...d,className:`${g3.container} ${g3[n]} ${d.className||""}`,children:["window"!==n&&t("div",{className:`${g3.indicator} ${i||""}`,style:{width:y,left:b}}),r.map(((e,r)=>t(H,{ref:t=>v.current[r]=t,dimensionX:"equal"===o?"fill":"hug",dimensionY:"fill",mode:"middle",prefix:{children:e.prefix?.children,...e.prefix,className:`${e.prefix?.className||""}`},root:{children:e.root?.children,...e.root,className:`${g3.root} ${e.root?.className||""}`},suffix:{children:e.suffix?.children,...e.suffix,className:`${e.suffix?.className||""}`},onClick:()=>(t=>{p(t),c?.(t)})(r),...e,className:`${g3.item} ${g3[n]} ${r===h?g3.active:""}`},r)))]})}));!function(t){t.camelToKebab=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),t.deepCopy=t=>JSON.parse(JSON.stringify(t)),t.capitalize=t=>t.charAt(0).toUpperCase()+t.slice(1)}(v3||(v3={}));const b3={light:{primary:"#1976d2",primaryLight:"#63a4ff",primaryDark:"#004ba0",danger:"#d32f2f",dangerLight:"#ff6659",dangerDark:"#9a0007",success:"#388e3c",successLight:"#6abf69",successDark:"#00600f",soft:"#f5f5f5",softLight:"#ffffff",softDark:"#c2c2c2",background:"#ffffff",menuBackground:"#f0f0f0",zebra:"#f9f9f9",border:"#e0e0e0",boxShadow:"rgba(0, 0, 0, 0.1)",fontPrimary:"#212121",fontSecondary:"#757575",inputBackground:"#ffffff",inputPlaceholder:"#9e9e9e",tonalOffset:.2},dark:{primary:"#90caf9",primaryLight:"#e3f2fd",primaryDark:"#42a5f5",danger:"#ef5350",dangerLight:"#ff867c",dangerDark:"#b61827",success:"#66bb6a",successLight:"#98ee99",successDark:"#338a3e",soft:"#121212",softLight:"#1e1e1e",softDark:"#000000",background:"#121212",menuBackground:"#1e1e1e",zebra:"#181818",border:"#333333",boxShadow:"rgba(0, 0, 0, 0.5)",fontPrimary:"#ffffff",fontSecondary:"#bdbdbd",inputBackground:"#333333",inputPlaceholder:"#757575",tonalOffset:.3}},_3={PRIMARY:"#1c1c50",BACKGROUND:"#f5f5f5",MENU_BACKGROUND:"#ffffff",ZEBRA:"f6f6f9",SUCCESS:"#21f412",DANGER:"#f41212",SOFT:"#f5f5f5",BORDER:"#d4d0d0",BOX_SHADOW:"#0000000d",FONT_PRIMARY:"#525252",FONT_SECONDARY:"#525252",INPUT_BACKGROUND:"#fafafa",INPUT_PLACEHOLDER:"#9b9b9b",TONAL_OFFSET:.2},x3=5,w3=10,S3=10,k3=16,C3="Inter",E3=t=>{v3.deepCopy(t);const e=M3(t.palette?.primary||_3.PRIMARY,t.palette?.tonalOffset),n=M3(t.palette?.success||_3.SUCCESS,t.palette?.tonalOffset),r=M3(t.palette?.danger||_3.DANGER,t.palette?.tonalOffset),i=M3(t.palette?.soft||_3.SOFT,t.palette?.tonalOffset),o=t.borderRadius?.base??x3,a=t.padding?.base??w3,s=t.gap?.base??S3,l=t.palette?.mode,c=l?b3[l]:void 0,u=(e,n)=>t.palette?.[e]||c?.[e]||n,d=(e,n)=>t.borderRadius?.[e]??o*n,h=(e,n)=>t.padding?.[e]??s*n,p=(e,n)=>t.gap?.[e]??a*n,f={palette:{primary:u("primary",e.base),primaryLight:u("primaryLight",e.light),primaryDark:u("primaryDark",e.dark),danger:u("danger",r.base),dangerLight:u("dangerLight",r.light),dangerDark:u("dangerDark",r.dark),success:u("success",n.base),successLight:u("successLight",n.light),successDark:u("successDark",n.dark),soft:u("soft",i.base),softLight:u("softLight",i.light),softDark:u("softDark",i.dark),background:u("background",_3.BACKGROUND),menuBackground:u("menuBackground",_3.MENU_BACKGROUND),zebra:u("zebra",_3.ZEBRA),border:u("border",_3.BORDER),boxShadow:u("boxShadow",_3.BOX_SHADOW),fontPrimary:u("fontPrimary",_3.FONT_PRIMARY),fontSecondary:u("fontSecondary",_3.FONT_SECONDARY),inputBackground:u("inputBackground",_3.INPUT_BACKGROUND),inputPlaceholder:u("inputPlaceholder",_3.INPUT_PLACEHOLDER),tonalOffset:u("tonalOffset",_3.TONAL_OFFSET)},borderRadius:{sm:d("sm",.6),md:d("md",1),lg:d("lg",2)},padding:{xs:h("xs",.25),sm:h("sm",.5),md:h("md",1),lg:h("lg",1.5),xl:h("xl",2)},gap:{xs:p("xs",.25),sm:p("sm",.5),md:p("md",1),lg:p("lg",1.5),xl:p("xl",2)},fontSize:t.fontSize||k3,fontFamily:t.fontFamily||C3};return(t=>{const e=document.documentElement,n=(t,n)=>{Object.entries(t).forEach((([t,r])=>{const i=v3.camelToKebab(t);if("string"==typeof r&&r.startsWith("#")){const t=mW.color.hexToRgb(r);e.style.setProperty(`--${n}-${i}-rgb`,t)}e.style.setProperty(`--${n}-${i}`,r)}))};n(t.palette,"color"),n(t.borderRadius,"border-radius"),n(t.padding,"padding"),n(t.gap,"gap"),e.style.setProperty("--oziko-font-size-base",`${t.fontSize}px`),e.style.setProperty("--oziko-font-family-base",t.fontFamily)})(f),f},M3=(t,e=.2)=>{const{h:n,s:r,l:i}=mW.color.hexToHSL(t),o="number"==typeof e?e:e.light,a="number"==typeof e?e:e.dark;return{base:t,light:mW.color.hslToHex(n,r,Math.min(1,i+o)),dark:mW.color.hslToHex(n,r,Math.max(0,i-a))}},O3=v(void 0),P3=()=>{const t=p(O3);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var T3,N3,D3;!function(t){t.isTypeLocation=t=>"object"==typeof t&&null!==t&&"string"==typeof t.type&&Array.isArray(t.coordinates)&&2===t.coordinates.length&&t.coordinates.every((t=>"number"==typeof t))}(T3||(T3={})),function(t){t.hexToHSL=t=>{let e=0,n=0,r=0;if(4===t.length)e=parseInt(t[1]+t[1],16),n=parseInt(t[2]+t[2],16),r=parseInt(t[3]+t[3],16);else{if(7!==t.length)throw new Error("Invalid HEX format");e=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16)}e/=255,n/=255,r/=255;const i=Math.max(e,n,r),o=Math.min(e,n,r);let a=0,s=0,l=(i+o)/2;if(i!==o){const t=i-o;switch(s=l>.5?t/(2-i-o):t/(i+o),i){case e:a=(n-r)/t+(n<r?6:0);break;case n:a=(r-e)/t+2;break;case r:a=(e-n)/t+4}a/=6}return{h:a,s:s,l:l}},t.hslToHex=(t,e,n)=>{const r=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t);let i,o,a;if(0===e)i=o=a=n;else{const s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;i=r(l,s,t+1/3),o=r(l,s,t),a=r(l,s,t-1/3)}return`#${Math.round(255*i).toString(16).padStart(2,"0")}${Math.round(255*o).toString(16).padStart(2,"0")}${Math.round(255*a).toString(16).padStart(2,"0")}`}}(N3||(N3={})),function(t){t.timeUnitsInSeconds={second:1,minute:60,hour:3600,day:86400,week:604800,month:2592e3,quarter:7776e3,year:31536e3},t.unitMapper=t=>t<=10?"second":t<=120?"minute":t<=2160?"hour":t<=43200?"day":t<=50400?"week":t<=1296e3?"month":t<=9331200?"quarter":"year",t.getDiffInMinutes=(t,e)=>Math.abs(e.getTime()-t.getTime())/6e4,t.formatDateToEnUs=t=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}).format(t)}(D3||(D3={}));export{RA as Accordion,z5 as ArrayInput,R5 as ArrayMinimizedInput,tt as Autocomplete,oA as Backdrop,ht as BaseInput,QY as BooleanInput,$5 as BooleanMinimizedInput,Qa as BucketFieldPopup,_s as Button,Uf as Chart,Qf as Checkbox,em as Chip,d5 as ChipInput,rm as Color,eX as ColorInput,B5 as ColorMinimizedInput,hY as Dashboard,pm as DashboardItem,GY as DateInput,V5 as DateMinimizedInput,oD as DatePicker,gD as Directory,m3 as Drawer,kD as DropList,h3 as EnumInput,B as FlexElement,H as FluidContainer,Za as Icon,G as Input,ED as InputHeader,K as InputWithIcon,OD as Json,Y as ListItem,ND as ListRow,mq as LocationInput,X5 as LocationMinimizedInput,ZD as Map,vY as MenuGroup,aA as Modal,uq as MultipleSelectionInput,Z5 as MultipleSelectionMinimizedInput,jA as NavigatorItem,VY as NumberInput,Q5 as NumberMinimizedInput,A2 as ObjectInput,r3 as ObjectMinimizedInput,mD as Popover,fD as Portal,A5 as RelationInput,N2 as RichTextInput,o3 as RichTextMinimizedInput,hm as Section,YA as Select,dA as SelectOption,bs as Spinner,GA as SsoButton,vA as StorageFileCard,NR as StorageFilter,oq as StorageInput,$Y as StringInput,c3 as StringMinimizedInput,wA as Switch,y3 as Tab,MY as Table,V as Text,ZY as TextAreaInput,d3 as TextAreaMinimizedInput,yW as Timeline,kA as Title,T3 as apiUtil,N3 as colorUtil,E3 as createTheme,v3 as helperUtils,D3 as timeUtil,Q as useAdaptivePosition,I5 as useInputRepresenter,dD as useKeyDown,J as useOnClickOutside,P3 as useTheme};
|
|
100
100
|
//# sourceMappingURL=index.mjs.map
|