2 lines
3.6 MiB
2 lines
3.6 MiB
/*! For license information please see vendors.98288b227c064e6a107f.js.LICENSE.txt */
|
||
(self.webpackChunkarchitectui_html_pro=self.webpackChunkarchitectui_html_pro||[]).push([[96],{119:function(e,t,i){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},i={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,i){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,function(e){return i[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(i(5093))},134:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>r}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(271);function r(e){var t=(0,n.A)(e),i=t.overflow,r=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+r)}},158:function(e,t,i){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],i=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:i,weekdaysShort:i,weekdaysMin:i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,i){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(i(5093))},172:(e,t,i)=>{"use strict";i.d(t,{FK:()=>x,Ob:()=>W,Qv:()=>V,XX:()=>j,_3:()=>v,fF:()=>r,n:()=>_,q6:()=>U,uA:()=>k,v2:()=>P,zO:()=>o});var n,r,s,o,a,l,c,h,d,u={},f=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function m(e,t){for(var i in t)e[i]=t[i];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function _(e,t,i){var r,s,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?s=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return y(e,a,r,s,null)}function y(e,t,i,n,o){var a={type:e,props:t,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++s:o};return null==o&&null!=r.vnode&&r.vnode(a),a}function v(){return{current:null}}function x(e){return e.children}function b(e,t,i){"-"===t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||p.test(t)?i:i+"px"}function w(e,t,i,n,r){var s;e:if("style"===t)if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)i&&t in i||b(e.style,t,"");if(i)for(t in i)n&&i[t]===n[t]||b(e.style,t,i[t])}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=i,i?n||e.addEventListener(t,s?T:S,s):e.removeEventListener(t,s?T:S,s);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,i))}}function S(e){a=!0;try{return this.l[e.type+!1](r.event?r.event(e):e)}finally{a=!1}}function T(e){a=!0;try{return this.l[e.type+!0](r.event?r.event(e):e)}finally{a=!1}}function k(e,t){this.props=e,this.context=t}function M(e,t){if(null==t)return e.__?M(e.__,e.__.__k.indexOf(e)+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?M(e):null}function A(e){var t,i;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e){e.__e=e.__c.base=i.__e;break}return A(e)}}function C(e){a?setTimeout(e):h(e)}function D(e){(!e.__d&&(e.__d=!0)&&l.push(e)&&!L.__r++||c!==r.debounceRendering)&&((c=r.debounceRendering)||C)(L)}function L(){var e,t,i,n,r,s,o,a;for(l.sort(function(e,t){return e.__v.__b-t.__v.__b});e=l.shift();)e.__d&&(t=l.length,n=void 0,r=void 0,o=(s=(i=e).__v).__e,(a=i.__P)&&(n=[],(r=m({},s)).__v=s.__v+1,z(a,s,r,i.__n,void 0!==a.ownerSVGElement,null!=s.__h?[o]:null,n,null==o?M(s):o,s.__h),F(n,s),s.__e!=o&&A(s)),l.length>t&&l.sort(function(e,t){return e.__v.__b-t.__v.__b}));L.__r=0}function E(e,t,i,n,r,s,o,a,l,c){var h,d,p,m,g,_,v,b=n&&n.__k||f,w=b.length;for(i.__k=[],h=0;h<t.length;h++)if(null!=(m=i.__k[h]=null==(m=t[h])||"boolean"==typeof m?null:"string"==typeof m||"number"==typeof m||"bigint"==typeof m?y(null,m,null,null,m):Array.isArray(m)?y(x,{children:m},null,null,null):m.__b>0?y(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)){if(m.__=i,m.__b=i.__b+1,null===(p=b[h])||p&&m.key==p.key&&m.type===p.type)b[h]=void 0;else for(d=0;d<w;d++){if((p=b[d])&&m.key==p.key&&m.type===p.type){b[d]=void 0;break}p=null}z(e,m,p=p||u,r,s,o,a,l,c),g=m.__e,(d=m.ref)&&p.ref!=d&&(v||(v=[]),p.ref&&v.push(p.ref,null,m),v.push(d,m.__c||g,m)),null!=g?(null==_&&(_=g),"function"==typeof m.type&&m.__k===p.__k?m.__d=l=I(m,l,e):l=R(e,m,p,b,g,l),"function"==typeof i.type&&(i.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=M(p))}for(i.__e=_,h=w;h--;)null!=b[h]&&("function"==typeof i.type&&null!=b[h].__e&&b[h].__e==i.__d&&(i.__d=O(n).nextSibling),B(b[h],b[h]));if(v)for(h=0;h<v.length;h++)Y(v[h],v[++h],v[++h])}function I(e,t,i){for(var n,r=e.__k,s=0;r&&s<r.length;s++)(n=r[s])&&(n.__=e,t="function"==typeof n.type?I(n,t,i):R(i,n,n,r,n.__e,t));return t}function P(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some(function(e){P(e,t)}):t.push(e)),t}function R(e,t,i,n,r,s){var o,a,l;if(void 0!==t.__d)o=t.__d,t.__d=void 0;else if(null==i||r!=s||null==r.parentNode)e:if(null==s||s.parentNode!==e)e.appendChild(r),o=null;else{for(a=s,l=0;(a=a.nextSibling)&&l<n.length;l+=1)if(a==r)break e;e.insertBefore(r,s),o=s}return void 0!==o?o:r.nextSibling}function O(e){var t,i,n;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((i=e.__k[t])&&(n=O(i)))return n;return null}function z(e,t,i,n,s,o,a,l,c){var h,d,u,f,p,g,_,y,v,b,w,S,T,M,A,C=t.type;if(void 0!==t.constructor)return null;null!=i.__h&&(c=i.__h,l=t.__e=i.__e,t.__h=null,o=[l]),(h=r.__b)&&h(t);try{e:if("function"==typeof C){if(y=t.props,v=(h=C.contextType)&&n[h.__c],b=h?v?v.props.value:h.__:n,i.__c?_=(d=t.__c=i.__c).__=d.__E:("prototype"in C&&C.prototype.render?t.__c=d=new C(y,b):(t.__c=d=new k(y,b),d.constructor=C,d.render=H),v&&v.sub(d),d.props=y,d.state||(d.state={}),d.context=b,d.__n=n,u=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=m({},d.__s)),m(d.__s,C.getDerivedStateFromProps(y,d.__s))),f=d.props,p=d.state,d.__v=t,u)null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==C.getDerivedStateFromProps&&y!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,b),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,b)||t.__v===i.__v){for(t.__v!==i.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.forEach(function(e){e&&(e.__=t)}),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,b),null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(f,p,g)})}if(d.context=b,d.props=y,d.__P=e,S=r.__r,T=0,"prototype"in C&&C.prototype.render){for(d.state=d.__s,d.__d=!1,S&&S(t),h=d.render(d.props,d.state,d.context),M=0;M<d._sb.length;M++)d.__h.push(d._sb[M]);d._sb=[]}else do{d.__d=!1,S&&S(t),h=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++T<25);d.state=d.__s,null!=d.getChildContext&&(n=m(m({},n),d.getChildContext())),u||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(f,p)),A=null!=h&&h.type===x&&null==h.key?h.props.children:h,E(e,Array.isArray(A)?A:[A],t,i,n,s,o,a,l,c),d.base=t.__e,t.__h=null,d.__h.length&&a.push(d),_&&(d.__E=d.__=null),d.__e=!1}else null==o&&t.__v===i.__v?(t.__k=i.__k,t.__e=i.__e):t.__e=N(i.__e,t,i,n,s,o,a,c);(h=r.diffed)&&h(t)}catch(e){t.__v=null,(c||null!=o)&&(t.__e=l,t.__h=!!c,o[o.indexOf(l)]=null),r.__e(e,t,i)}}function F(e,t){r.__c&&r.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){r.__e(e,t.__v)}})}function N(e,t,i,r,s,o,a,l){var c,h,d,f=i.props,p=t.props,m=t.type,_=0;if("svg"===m&&(s=!0),null!=o)for(;_<o.length;_++)if((c=o[_])&&"setAttribute"in c==!!m&&(m?c.localName===m:3===c.nodeType)){e=c,o[_]=null;break}if(null==e){if(null===m)return document.createTextNode(p);e=s?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,p.is&&p),o=null,l=!1}if(null===m)f===p||l&&e.data===p||(e.data=p);else{if(o=o&&n.call(e.childNodes),h=(f=i.props||u).dangerouslySetInnerHTML,d=p.dangerouslySetInnerHTML,!l){if(null!=o)for(f={},_=0;_<e.attributes.length;_++)f[e.attributes[_].name]=e.attributes[_].value;(d||h)&&(d&&(h&&d.__html==h.__html||d.__html===e.innerHTML)||(e.innerHTML=d&&d.__html||""))}if(function(e,t,i,n,r){var s;for(s in i)"children"===s||"key"===s||s in t||w(e,s,null,i[s],n);for(s in t)r&&"function"!=typeof t[s]||"children"===s||"key"===s||"value"===s||"checked"===s||i[s]===t[s]||w(e,s,t[s],i[s],n)}(e,p,f,s,l),d)t.__k=[];else if(_=t.props.children,E(e,Array.isArray(_)?_:[_],t,i,r,s&&"foreignObject"!==m,o,a,o?o[0]:i.__k&&M(i,0),l),null!=o)for(_=o.length;_--;)null!=o[_]&&g(o[_]);l||("value"in p&&void 0!==(_=p.value)&&(_!==e.value||"progress"===m&&!_||"option"===m&&_!==f.value)&&w(e,"value",_,f.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==e.checked&&w(e,"checked",_,f.checked,!1))}return e}function Y(e,t,i){try{"function"==typeof e?e(t):e.current=t}catch(e){r.__e(e,i)}}function B(e,t,i){var n,s;if(r.unmount&&r.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Y(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){r.__e(e,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&&B(n[s],t,i||"function"!=typeof e.type);i||null==e.__e||g(e.__e),e.__=e.__e=e.__d=void 0}function H(e,t,i){return this.constructor(e,i)}function j(e,t,i){var s,o,a;r.__&&r.__(e,t),o=(s="function"==typeof i)?null:i&&i.__k||t.__k,a=[],z(t,e=(!s&&i||t).__k=_(x,null,[e]),o||u,u,void 0!==t.ownerSVGElement,!s&&i?[i]:o?null:t.firstChild?n.call(t.childNodes):null,a,!s&&i?i:o?o.__e:t.firstChild,s),F(a,e)}function V(e,t){j(e,t,V)}function W(e,t,i){var r,s,o,a=m({},e.props);for(o in t)"key"==o?r=t[o]:"ref"==o?s=t[o]:a[o]=t[o];return arguments.length>2&&(a.children=arguments.length>3?n.call(arguments,2):i),y(e.type,a,r||e.key,s||e.ref,null)}function U(e,t){var i={__c:t="__cC"+d++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var i,n;return this.getChildContext||(i=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&i.some(function(e){e.__e=!0,D(e)})},this.sub=function(e){i.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){i.splice(i.indexOf(e),1),t&&t.call(e)}}),e.children}};return i.Provider.__=i.Consumer.contextType=i}n=f.slice,r={__e:function(e,t,i,n){for(var r,s,o;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&null!=s.getDerivedStateFromError&&(r.setState(s.getDerivedStateFromError(e)),o=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,n||{}),o=r.__d),o)return r.__E=r}catch(t){e=t}throw e}},s=0,o=function(e){return null!=e&&void 0===e.constructor},a=!1,k.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(m({},i),this.props)),e&&m(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),D(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),D(this))},k.prototype.render=x,l=[],h="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,L.__r=0,d=0},192:(e,t,i)=>{"use strict";i.d(t,{A:()=>f});var n=i(4278),r=i(2632),s=i(9703),o=i(6523),a=i(6979),l=i(5128),c=i(9913),h=i(8101),d=i(7364),u=i(6906);const f={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,f=e.name,p=i.mainAxis,m=void 0===p||p,g=i.altAxis,_=void 0!==g&&g,y=i.boundary,v=i.rootBoundary,x=i.altBoundary,b=i.padding,w=i.tether,S=void 0===w||w,T=i.tetherOffset,k=void 0===T?0:T,M=(0,c.A)(t,{boundary:y,rootBoundary:v,padding:b,altBoundary:x}),A=(0,r.A)(t.placement),C=(0,h.A)(t.placement),D=!C,L=(0,s.A)(A),E="x"===L?"y":"x",I=t.modifiersData.popperOffsets,P=t.rects.reference,R=t.rects.popper,O="function"==typeof k?k(Object.assign({},t.rects,{placement:t.placement})):k,z="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),F=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(I){if(m){var Y,B="y"===L?n.Mn:n.kb,H="y"===L?n.sQ:n.pG,j="y"===L?"height":"width",V=I[L],W=V+M[B],U=V-M[H],$=S?-R[j]/2:0,G=C===n.ni?P[j]:R[j],X=C===n.ni?-R[j]:-P[j],q=t.elements.arrow,Z=S&&q?(0,a.A)(q):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:(0,d.A)(),K=J[B],Q=J[H],ee=(0,o.u)(0,P[j],Z[j]),te=D?P[j]/2-$-ee-K-z.mainAxis:G-ee-K-z.mainAxis,ie=D?-P[j]/2+$+ee+Q+z.mainAxis:X+ee+Q+z.mainAxis,ne=t.elements.arrow&&(0,l.A)(t.elements.arrow),re=ne?"y"===L?ne.clientTop||0:ne.clientLeft||0:0,se=null!=(Y=null==F?void 0:F[L])?Y:0,oe=V+te-se-re,ae=V+ie-se,le=(0,o.u)(S?(0,u.jk)(W,oe):W,V,S?(0,u.T9)(U,ae):U);I[L]=le,N[L]=le-V}if(_){var ce,he="x"===L?n.Mn:n.kb,de="x"===L?n.sQ:n.pG,ue=I[E],fe="y"===E?"height":"width",pe=ue+M[he],me=ue-M[de],ge=-1!==[n.Mn,n.kb].indexOf(A),_e=null!=(ce=null==F?void 0:F[E])?ce:0,ye=ge?pe:ue-P[fe]-R[fe]-_e+z.altAxis,ve=ge?ue+P[fe]+R[fe]-_e-z.altAxis:me,xe=S&&ge?(0,o.P)(ye,ue,ve):(0,o.u)(S?ye:pe,ue,S?ve:me);I[E]=xe,N[E]=xe-ue}t.modifiersData[f]=N}},requiresIfExists:["offset"]}},217:function(e,t,i){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(i(5093))},222:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>r}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(8979);function r(e){var t=(0,n.A)(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}},232:(e,t,i)=>{"use strict";var n,r,s;function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}r=[i(4692)],void 0===(s="function"==typeof(n=function(e){var t={selected:0,theme:"basic",justified:!0,autoAdjustHeight:!0,backButtonSupport:!0,enableUrlHash:!0,transition:{animation:"none",speed:"400",easing:"",prefixCss:"",fwdShowCss:"",fwdHideCss:"",bckShowCss:"",bckHideCss:""},toolbar:{position:"bottom",showNextButton:!0,showPreviousButton:!0,extraHtml:""},anchor:{enableNavigation:!0,enableNavigationAlways:!1,enableDoneState:!0,markPreviousStepsAsDone:!0,unDoneOnBackNavigation:!1,enableDoneStateNavigation:!0},keyboard:{keyNavigation:!0,keyLeft:[37],keyRight:[39]},lang:{next:"Next",previous:"Previous"},style:{mainCss:"sw",navCss:"nav",navLinkCss:"nav-link",contentCss:"tab-content",contentPanelCss:"tab-pane",themePrefixCss:"sw-theme-",anchorDefaultCss:"default",anchorDoneCss:"done",anchorActiveCss:"active",anchorDisabledCss:"disabled",anchorHiddenCss:"hidden",anchorErrorCss:"error",anchorWarningCss:"warning",justifiedCss:"sw-justified",btnCss:"sw-btn",btnNextCss:"sw-btn-next",btnPrevCss:"sw-btn-prev",loaderCss:"sw-loading",progressCss:"progress",progressBarCss:"progress-bar",toolbarCss:"toolbar",toolbarPrefixCss:"toolbar-"},disabledSteps:[],errorSteps:[],warningSteps:[],hiddenSteps:[],getContent:null},i=function(){function i(n,r){var s=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.options=e.extend(!0,{},t,r),this.main=e(n),this.nav=this._getFirstDescendant("."+this.options.style.navCss),this.container=this._getFirstDescendant("."+this.options.style.contentCss),this.steps=this.nav.find("."+this.options.style.navLinkCss),this.pages=this.container.children("."+this.options.style.contentPanelCss),this.progressbar=this.main.find("."+this.options.style.progressCss),this.dir=this._getDir(),this.current_index=-1,this.is_init=!1,this._init(),setTimeout(function(){s._load()},0)}var n,r;return n=i,(r=[{key:"_init",value:function(){if(this._setElements(),this._setToolbar(),!0===this.is_init)return!0;this._setEvents(),this.is_init=!0,this._triggerEvent("initialized")}},{key:"_load",value:function(){this.pages.hide(),this.steps.removeClass([this.options.style.anchorDoneCss,this.options.style.anchorActiveCss]),this.current_index=-1;var e=this._getURLHashIndex();e=!1!==e?e:this.options.selected;var t=this._getShowable(e-1,"forward");(e=null===t&&e>0?this._getShowable(-1,"forward"):t)>0&&this.options.anchor.enableDoneState&&this.options.anchor.markPreviousStepsAsDone&&this.steps.slice(0,e).addClass(this.options.style.anchorDoneCss),this._showStep(e),this._triggerEvent("loaded")}},{key:"_getFirstDescendant",value:function(t){var i=this.main.children(t);return i.length>0?i:(this.main.children().each(function(n,r){var s=e(r).children(t);if(s.length>0)return i=s,!1}),i.length>0?i:(this._showError("Element not found "+t),!1))}},{key:"_getDir",value:function(){var e=this.main.prop("dir");return 0===e.length&&(e=document.documentElement.dir,this.main.prop("dir",e)),e}},{key:"_setElements",value:function(){var t=this;this.main.removeClass(function(e,i){return(i.match(new RegExp("(^|\\s)"+t.options.style.themePrefixCss+"\\S+","g"))||[]).join(" ")}).addClass(this.options.style.mainCss+" "+this.options.style.themePrefixCss+this.options.theme),this.main.toggleClass(this.options.style.justifiedCss,this.options.justified),!0===this.options.anchor.enableNavigationAlways&&!0===this.options.anchor.enableNavigation||this.steps.addClass(this.options.style.anchorDefaultCss),e.each(this.options.disabledSteps,function(e,i){t.steps.eq(i).addClass(t.options.style.anchorDisabledCss)}),e.each(this.options.errorSteps,function(e,i){t.steps.eq(i).addClass(t.options.style.anchorErrorCss)}),e.each(this.options.warningSteps,function(e,i){t.steps.eq(i).addClass(t.options.style.anchorWarningCss)}),e.each(this.options.hiddenSteps,function(e,i){t.steps.eq(i).addClass(t.options.style.anchorHiddenCss)})}},{key:"_setEvents",value:function(){var t=this;this.steps.on("click",function(i){if(i.preventDefault(),!0===t.options.anchor.enableNavigation){var n=e(i.currentTarget);t._isShowable(n)&&t._showStep(t.steps.index(n))}}),this.main.on("click",function(i){e(i.target).hasClass(t.options.style.btnNextCss)?(i.preventDefault(),t._navigate("next")):e(i.target).hasClass(t.options.style.btnPrevCss)&&(i.preventDefault(),t._navigate("prev"))}),e(document).keyup(function(e){t._keyNav(e)}),e(window).on("hashchange",function(e){if(!0===t.options.backButtonSupport){var i=t._getURLHashIndex();!1!==i&&t._isShowable(t.steps.eq(i))&&(e.preventDefault(),t._showStep(i))}}),e(window).on("resize",function(e){t._fixHeight(t.current_index)})}},{key:"_setToolbar",value:function(){this.main.find(".sw-toolbar-elm").remove();var e=this.options.toolbar.position;"none"!==e&&("both"==e?(this.container.before(this._createToolbar("top")),this.container.after(this._createToolbar("bottom"))):"top"==e?this.container.before(this._createToolbar("top")):this.container.after(this._createToolbar("bottom")))}},{key:"_createToolbar",value:function(t){var i=e("<div></div>").addClass("sw-toolbar-elm "+this.options.style.toolbarCss+" "+this.options.style.toolbarPrefixCss+t).attr("role","toolbar"),n=!1!==this.options.toolbar.showNextButton?e("<button></button>").text(this.options.lang.next).addClass("btn "+this.options.style.btnNextCss+" "+this.options.style.btnCss).attr("type","button"):null,r=!1!==this.options.toolbar.showPreviousButton?e("<button></button>").text(this.options.lang.previous).addClass("btn "+this.options.style.btnPrevCss+" "+this.options.style.btnCss).attr("type","button"):null;return i.append(r,n,this.options.toolbar.extraHtml)}},{key:"_navigate",value:function(e){this._showStep(this._getShowable(this.current_index,e))}},{key:"_showStep",value:function(e){var t=this;if(-1===e||null===e)return!1;if(e==this.current_index)return!1;if(!this.steps.eq(e))return!1;if(!this._isEnabled(this.steps.eq(e)))return!1;var i=this._getStepDirection(e);if(-1!==this.current_index&&!1===this._triggerEvent("leaveStep",[this._getStepAnchor(this.current_index),this.current_index,e,i]))return!1;this._loadContent(e,function(){var n=t._getStepAnchor(e);t._setURLHash(n.attr("href")),t._setAnchor(e);var r=t._getStepPage(t.current_index),s=t._getStepPage(e);t._transit(s,r,i,function(){t._fixHeight(e),t._triggerEvent("showStep",[n,e,i,t._getStepPosition(e)])}),t.current_index=e,t._setButtons(e),t._setProgressbar(e)})}},{key:"_getShowable",value:function(t,i){var n=this,r=null;return("prev"==i?e(this.steps.slice(0,t).get().reverse()):this.steps.slice(t+1)).each(function(s,o){if(n._isEnabled(e(o)))return r="prev"==i?t-(s+1):s+t+1,!1}),r}},{key:"_isShowable",value:function(e){if(!this._isEnabled(e))return!1;var t=e.hasClass(this.options.style.anchorDoneCss);return!(!1===this.options.anchor.enableDoneStateNavigation&&t||!1===this.options.anchor.enableNavigationAlways&&!t)}},{key:"_isEnabled",value:function(e){return!e.hasClass(this.options.style.anchorDisabledCss)&&!e.hasClass(this.options.style.anchorHiddenCss)}},{key:"_getStepDirection",value:function(e){return this.current_index<e?"forward":"backward"}},{key:"_getStepPosition",value:function(e){return 0===e?"first":e===this.steps.length-1?"last":"middle"}},{key:"_getStepAnchor",value:function(e){return null==e||-1==e?null:this.steps.eq(e)}},{key:"_getStepPage",value:function(e){return null==e||-1==e?null:this.pages.eq(e)}},{key:"_loadContent",value:function(t,i){if(e.isFunction(this.options.getContent)){var n=this._getStepPage(t);if(n){var r=this._getStepDirection(t),s=this._getStepPosition(t),o=this._getStepAnchor(t);this.options.getContent(t,r,s,o,function(e){e&&n.html(e),i()})}else i()}else i()}},{key:"_transit",value:function(t,i,n,r){var s=e.fn.smartWizard.transitions[this.options.transition.animation];this._stopAnimations(),e.isFunction(s)?s(t,i,n,this,function(e){!1===e&&(null!==i&&i.hide(),t.show()),r()}):(null!==i&&i.hide(),t.show(),r())}},{key:"_stopAnimations",value:function(){e.isFunction(this.container.finish)&&(this.pages.finish(),this.container.finish())}},{key:"_fixHeight",value:function(t){if(!1!==this.options.autoAdjustHeight){var i=this._getStepPage(t).outerHeight();e.isFunction(this.container.finish)&&e.isFunction(this.container.animate)&&i>0?this.container.finish().animate({height:i},this.options.transition.speed):this.container.css({height:i>0?i:"auto"})}}},{key:"_setAnchor",value:function(e){if(null!==this.current_index&&this.current_index>=0){var t=this.options.style.anchorActiveCss,i="";!1!==this.options.anchor.enableDoneState&&(i+=this.options.style.anchorDoneCss,!1!==this.options.anchor.unDoneOnBackNavigation&&"backward"===this._getStepDirection(e)&&(t+=" "+this.options.style.anchorDoneCss)),this.steps.eq(this.current_index).addClass(i).removeClass(t)}this.steps.eq(e).removeClass(this.options.style.anchorDoneCss).addClass(this.options.style.anchorActiveCss)}},{key:"_setButtons",value:function(e){this.main.find("."+this.options.style.btnNextCss+", ."+this.options.style.btnPrevCss).removeClass(this.options.style.anchorDisabledCss);var t=this._getStepPosition(e);if("first"===t||"last"===t){var i="first"===t?"."+this.options.style.btnPrevCss:"."+this.options.style.btnNextCss;this.main.find(i).addClass(this.options.style.anchorDisabledCss)}else null===this._getShowable(e,"next")&&this.main.find("."+this.options.style.btnNextCss).addClass(this.options.style.anchorDisabledCss),null===this._getShowable(e,"prev")&&this.main.find("."+this.options.style.btnPrevCss).addClass(this.options.style.anchorDisabledCss)}},{key:"_setProgressbar",value:function(e){var t=this.nav.width(),i=t/this.steps.length*(e+1)/t*100;document.documentElement.style.setProperty("--sw-progress-width",i+"%"),this.progressbar.length>0&&this.progressbar.find("."+this.options.style.progressBarCss).css("width",i+"%")}},{key:"_keyNav",value:function(t){if(this.options.keyboard.keyNavigation)if(e.inArray(t.which,this.options.keyboard.keyLeft)>-1)this._navigate("prev"),t.preventDefault();else{if(!(e.inArray(t.which,this.options.keyboard.keyRight)>-1))return;this._navigate("next"),t.preventDefault()}}},{key:"_triggerEvent",value:function(t,i){var n=e.Event(t);return this.main.trigger(n,i),!n.isDefaultPrevented()&&n.result}},{key:"_setURLHash",value:function(e){this.options.enableUrlHash&&window.location.hash!==e&&history.pushState(null,null,e)}},{key:"_getURLHashIndex",value:function(){if(this.options.enableUrlHash){var e=window.location.hash;if(e.length>0){var t=this.nav.find("a[href*='"+e+"']");if(t.length>0)return this.steps.index(t)}}return!1}},{key:"_showError",value:function(e){console.error(e)}},{key:"_changeState",value:function(t,i,n){var r=this;n=!1!==n;var s="";"default"==i?s=this.options.style.anchorDefaultCss:"active"==i?s=this.options.style.anchorActiveCss:"done"==i?s=this.options.style.anchorDoneCss:"disable"==i?s=this.options.style.anchorDisabledCss:"hidden"==i?s=this.options.style.anchorHiddenCss:"error"==i?s=this.options.style.anchorErrorCss:"warning"==i&&(s=this.options.style.anchorWarningCss),e.each(t,function(e,t){r.steps.eq(t).toggleClass(s,n)})}},{key:"goToStep",value:function(e,t){(1==(t=!1!==t)||this._isShowable(this.steps.eq(e)))&&(!0===t&&e>0&&this.options.anchor.enableDoneState&&this.options.anchor.markPreviousStepsAsDone&&this.steps.slice(0,e).addClass(this.options.style.anchorDoneCss),this._showStep(e))}},{key:"next",value:function(){this._navigate("next")}},{key:"prev",value:function(){this._navigate("prev")}},{key:"reset",value:function(){this.steps.removeClass([this.options.style.anchorDoneCss,this.options.style.anchorActiveCss,this.options.style.anchorErrorCss,this.options.style.anchorWarningCss]),this._setURLHash("#"),this._init(),this._load()}},{key:"setState",value:function(e,t){this._changeState(e,t,!0)}},{key:"unsetState",value:function(e,t){this._changeState(e,t,!1)}},{key:"setOptions",value:function(t){this.options=e.extend(!0,{},this.options,t),this._init()}},{key:"getOptions",value:function(){return this.options}},{key:"getStepInfo",value:function(){return{currentStep:this.current_index?this.current_index:0,totalSteps:this.steps?this.steps.length:0}}},{key:"loader",value:function(e){this.main.toggleClass(this.options.style.loaderCss,"show"===e)}},{key:"fixHeight",value:function(){this._fixHeight(this.current_index)}}])&&o(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),i}();e.fn.smartWizard=function(t){if(void 0===t||"object"===a(t))return this.each(function(){e.data(this,"smartWizard")||e.data(this,"smartWizard",new i(this,t))});if("string"==typeof t&&"_"!==t[0]&&"init"!==t){var n=e.data(this[0],"smartWizard");return"destroy"===t&&e.data(this,"smartWizard",null),n instanceof i&&"function"==typeof n[t]?n[t].apply(n,Array.prototype.slice.call(arguments,1)):this}},e.fn.smartWizard.transitions={fade:function(t,i,n,r,s){e.isFunction(t.fadeOut)?i?i.fadeOut(r.options.transition.speed,r.options.transition.easing,function(){t.fadeIn(r.options.transition.speed,r.options.transition.easing,function(){s()})}):t.fadeIn(r.options.transition.speed,r.options.transition.easing,function(){s()}):s(!1)},slideSwing:function(t,i,n,r,s){e.isFunction(t.slideDown)?i?i.slideUp(r.options.transition.speed,r.options.transition.easing,function(){t.slideDown(r.options.transition.speed,r.options.transition.easing,function(){s()})}):t.slideDown(r.options.transition.speed,r.options.transition.easing,function(){s()}):s(!1)},slideHorizontal:function(t,i,n,r,s){if(e.isFunction(t.animate)){var o=function(e,t,i,n){e.css({position:"absolute",left:t}).show().animate({left:i},r.options.transition.speed,r.options.transition.easing,n)};-1==r.current_index&&r.container.height(t.outerHeight());var a=r.container.width();if(i){var l=i.css(["position","left"]);o(i,0,a*("backward"==n?1:-1),function(){i.hide().css(l)})}var c=t.css(["position"]);o(t,a*("backward"==n?-2:1),0,function(){t.css(c),s()})}else s(!1)},slideVertical:function(t,i,n,r,s){if(e.isFunction(t.animate)){var o=function(e,t,i,n){e.css({position:"absolute",top:t}).show().animate({top:i},r.options.transition.speed,r.options.transition.easing,n)};-1==r.current_index&&r.container.height(t.outerHeight());var a=r.container.height();if(i){var l=i.css(["position","top"]);o(i,0,a*("backward"==n?-1:1),function(){i.hide().css(l)})}var c=t.css(["position"]);o(t,a*("backward"==n?1:-2),0,function(){t.css(c),s()})}else s(!1)},css:function(t,i,n,r,s){if(0!=r.options.transition.fwdHideCss.length&&0!=r.options.transition.bckHideCss.length){var o=function(t,i,n){i&&0!=i.length||n(),t.addClass(i).one("animationend",function(t){e(t.currentTarget).removeClass(i),n()}),t.addClass(i).one("animationcancel",function(t){e(t.currentTarget).removeClass(i),n("cancel")})},a=r.options.transition.prefixCss+" "+("backward"==n?r.options.transition.bckShowCss:r.options.transition.fwdShowCss);if(i){var l=r.options.transition.prefixCss+" "+("backward"==n?r.options.transition.bckHideCss:r.options.transition.fwdHideCss);o(i,l,function(){i.hide(),o(t,a,function(){s()}),t.show()})}else o(t,a,function(){s()}),t.show()}else s(!1)}}})?n.apply(t,r):n)||(e.exports=s)},271:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>r}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(8979);function r(e){return(0,n.A)(e).getComputedStyle(e)}},304:function(e,t,i){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,i){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(i(5093))},306:function(e,t,i){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,i=e%100;return 0===e?e+"-ев":0===i?e+"-ен":i>10&&i<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(i(5093))},527:function(e,t,i){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),i=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function n(e,n,r,s){var o="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":o=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":o=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":o=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":o=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":o=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":o=s?"vuoden":"vuotta"}return function(e,n){return e<10?n?i[e]:t[e]:e}(e,s)+" "+o}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},571:(e,t,i)=>{"use strict";function n(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}i.d(t,{A:()=>n})},609:function(e,t,i){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function i(e,t,i,n){var r=e;switch(i){case"s":return n||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(n||t)?" másodperc":" másodperce";case"m":return"egy"+(n||t?" perc":" perce");case"mm":return r+(n||t?" perc":" perce");case"h":return"egy"+(n||t?" óra":" órája");case"hh":return r+(n||t?" óra":" órája");case"d":return"egy"+(n||t?" nap":" napja");case"dd":return r+(n||t?" nap":" napja");case"M":return"egy"+(n||t?" hónap":" hónapja");case"MM":return r+(n||t?" hónap":" hónapja");case"y":return"egy"+(n||t?" év":" éve");case"yy":return r+(n||t?" év":" éve")}return""}function n(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,i){return e<12?!0===i?"de":"DE":!0===i?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return n.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return n.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:i,ss:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},644:(e,t,i)=>{"use strict";i.d(t,{A:()=>d});var n={left:"right",right:"left",bottom:"top",top:"bottom"};function r(e){return e.replace(/left|right|bottom|top/g,function(e){return n[e]})}var s=i(2632),o={start:"end",end:"start"};function a(e){return e.replace(/start|end/g,function(e){return o[e]})}var l=i(9913),c=i(8101),h=i(4278);const d={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=i.mainAxis,d=void 0===o||o,u=i.altAxis,f=void 0===u||u,p=i.fallbackPlacements,m=i.padding,g=i.boundary,_=i.rootBoundary,y=i.altBoundary,v=i.flipVariations,x=void 0===v||v,b=i.allowedAutoPlacements,w=t.options.placement,S=(0,s.A)(w),T=p||(S!==w&&x?function(e){if((0,s.A)(e)===h.qZ)return[];var t=r(e);return[a(e),t,a(t)]}(w):[r(w)]),k=[w].concat(T).reduce(function(e,i){return e.concat((0,s.A)(i)===h.qZ?function(e,t){void 0===t&&(t={});var i=t,n=i.placement,r=i.boundary,o=i.rootBoundary,a=i.padding,d=i.flipVariations,u=i.allowedAutoPlacements,f=void 0===u?h.DD:u,p=(0,c.A)(n),m=p?d?h.Ol:h.Ol.filter(function(e){return(0,c.A)(e)===p}):h.OM,g=m.filter(function(e){return f.indexOf(e)>=0});0===g.length&&(g=m);var _=g.reduce(function(t,i){return t[i]=(0,l.A)(e,{placement:i,boundary:r,rootBoundary:o,padding:a})[(0,s.A)(i)],t},{});return Object.keys(_).sort(function(e,t){return _[e]-_[t]})}(t,{placement:i,boundary:g,rootBoundary:_,padding:m,flipVariations:x,allowedAutoPlacements:b}):i)},[]),M=t.rects.reference,A=t.rects.popper,C=new Map,D=!0,L=k[0],E=0;E<k.length;E++){var I=k[E],P=(0,s.A)(I),R=(0,c.A)(I)===h.ni,O=[h.Mn,h.sQ].indexOf(P)>=0,z=O?"width":"height",F=(0,l.A)(t,{placement:I,boundary:g,rootBoundary:_,altBoundary:y,padding:m}),N=O?R?h.pG:h.kb:R?h.sQ:h.Mn;M[z]>A[z]&&(N=r(N));var Y=r(N),B=[];if(d&&B.push(F[P]<=0),f&&B.push(F[N]<=0,F[Y]<=0),B.every(function(e){return e})){L=I,D=!1;break}C.set(I,B)}if(D)for(var H=function(e){var t=k.find(function(t){var i=C.get(t);if(i)return i.slice(0,e).every(function(e){return e})});if(t)return L=t,"break"},j=x?3:1;j>0&&"break"!==H(j);j--);t.placement!==L&&(t.modifiersData[n]._skip=!0,t.placement=L,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}}},666:(e,t,i)=>{"use strict";i.d(t,{A:()=>j});var n=i(7363),r=i(9174),s=i(172),o=i(8817);class a extends r.aW{getKeyInfo(){return{allDay:{},timed:{}}}getKeysForDateSpan(e){return e.allDay?["allDay"]:["timed"]}getKeysForEventDef(e){return e.allDay?(0,r.bN)(e)?["timed","allDay"]:["allDay"]:["timed"]}}const l=(0,r.x)({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"});function c(e){let t=["fc-timegrid-slot","fc-timegrid-slot-label",e.isLabeled?"fc-scrollgrid-shrink":"fc-timegrid-slot-minor"];return(0,s.n)(r.V.Consumer,null,i=>{if(!e.isLabeled)return(0,s.n)("td",{className:t.join(" "),"data-time":e.isoTimeStr});let{dateEnv:n,options:o,viewApi:a}=i,c=null==o.slotLabelFormat?l:Array.isArray(o.slotLabelFormat)?(0,r.x)(o.slotLabelFormat[0]):(0,r.x)(o.slotLabelFormat),d={level:0,time:e.time,date:n.toDate(e.date),view:a,text:n.format(e.date,c)};return(0,s.n)(r.C,{elTag:"td",elClasses:t,elAttrs:{"data-time":e.isoTimeStr},renderProps:d,generatorName:"slotLabelContent",customGenerator:o.slotLabelContent,defaultGenerator:h,classNameGenerator:o.slotLabelClassNames,didMount:o.slotLabelDidMount,willUnmount:o.slotLabelWillUnmount},e=>(0,s.n)("div",{className:"fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame"},(0,s.n)(e,{elTag:"div",elClasses:["fc-timegrid-slot-label-cushion","fc-scrollgrid-shrink-cushion"]})))})}function h(e){return e.text}class d extends r.B{render(){return this.props.slatMetas.map(e=>(0,s.n)("tr",{key:e.key},(0,s.n)(c,Object.assign({},e))))}}const u=(0,r.x)({week:"short"});class f extends r.bc{constructor(){super(...arguments),this.allDaySplitter=new a,this.headerElRef=(0,s._3)(),this.rootElRef=(0,s._3)(),this.scrollerElRef=(0,s._3)(),this.state={slatCoords:null},this.handleScrollTopRequest=e=>{let t=this.scrollerElRef.current;t&&(t.scrollTop=e)},this.renderHeadAxis=(e,t="")=>{let{options:i}=this.context,{dateProfile:n}=this.props,o=n.renderRange,a=1===(0,r.bj)(o.start,o.end)?(0,r.a_)(this.context,o.start,"week"):{};return i.weekNumbers&&"day"===e?(0,s.n)(r.cn,{elTag:"th",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},date:o.start,defaultFormat:u},e=>(0,s.n)("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame","fc-timegrid-axis-frame-liquid"].join(" "),style:{height:t}},(0,s.n)(e,{elTag:"a",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"],elAttrs:a}))):(0,s.n)("th",{"aria-hidden":!0,className:"fc-timegrid-axis"},(0,s.n)("div",{className:"fc-timegrid-axis-frame",style:{height:t}}))},this.renderTableRowAxis=e=>{let{options:t,viewApi:i}=this.context,n={text:t.allDayText,view:i};return(0,s.n)(r.C,{elTag:"td",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},renderProps:n,generatorName:"allDayContent",customGenerator:t.allDayContent,defaultGenerator:p,classNameGenerator:t.allDayClassNames,didMount:t.allDayDidMount,willUnmount:t.allDayWillUnmount},t=>(0,s.n)("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame",null==e?" fc-timegrid-axis-frame-liquid":""].join(" "),style:{height:e}},(0,s.n)(t,{elTag:"span",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"]})))},this.handleSlatCoords=e=>{this.setState({slatCoords:e})}}renderSimpleLayout(e,t,i){let{context:n,props:o}=this,a=[],l=(0,r.ca)(n.options);return e&&a.push({type:"header",key:"header",isSticky:l,chunk:{elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}}),t&&(a.push({type:"body",key:"all-day",chunk:{content:t}}),a.push({type:"body",key:"all-day-divider",outerContent:(0,s.n)("tr",{role:"presentation",className:"fc-scrollgrid-section"},(0,s.n)("td",{className:"fc-timegrid-divider "+n.theme.getClass("tableCellShaded")}))})),a.push({type:"body",key:"body",liquid:!0,expandRows:Boolean(n.options.expandRows),chunk:{scrollerElRef:this.scrollerElRef,content:i}}),(0,s.n)(r.cq,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:n.viewSpec},(0,s.n)(r.bZ,{liquid:!o.isHeightAuto&&!o.forPrint,collapsibleWidth:o.forPrint,cols:[{width:"shrink"}],sections:a}))}renderHScrollLayout(e,t,i,n,o,a,l){let c=this.context.pluginHooks.scrollGridImpl;if(!c)throw new Error("No ScrollGrid implementation");let{context:h,props:u}=this,f=!u.forPrint&&(0,r.ca)(h.options),p=!u.forPrint&&(0,r.c9)(h.options),m=[];e&&m.push({type:"header",key:"header",isSticky:f,syncRowHeights:!0,chunks:[{key:"axis",rowContent:e=>(0,s.n)("tr",{role:"presentation"},this.renderHeadAxis("day",e.rowSyncHeights[0]))},{key:"cols",elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}]}),t&&(m.push({type:"body",key:"all-day",syncRowHeights:!0,chunks:[{key:"axis",rowContent:e=>(0,s.n)("tr",{role:"presentation"},this.renderTableRowAxis(e.rowSyncHeights[0]))},{key:"cols",content:t}]}),m.push({key:"all-day-divider",type:"body",outerContent:(0,s.n)("tr",{role:"presentation",className:"fc-scrollgrid-section"},(0,s.n)("td",{colSpan:2,className:"fc-timegrid-divider "+h.theme.getClass("tableCellShaded")}))}));let g=h.options.nowIndicator;return m.push({type:"body",key:"body",liquid:!0,expandRows:Boolean(h.options.expandRows),chunks:[{key:"axis",content:e=>(0,s.n)("div",{className:"fc-timegrid-axis-chunk"},(0,s.n)("table",{"aria-hidden":!0,style:{height:e.expandRows?e.clientHeight:""}},e.tableColGroupNode,(0,s.n)("tbody",null,(0,s.n)(d,{slatMetas:a}))),(0,s.n)("div",{className:"fc-timegrid-now-indicator-container"},(0,s.n)(r.a6,{unit:g?"minute":"day"},e=>{let t=g&&l&&l.safeComputeTop(e);return"number"==typeof t?(0,s.n)(r.ch,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:t},isAxis:!0,date:e}):null})))},{key:"cols",scrollerElRef:this.scrollerElRef,content:i}]}),p&&m.push({key:"footer",type:"footer",isSticky:!0,chunks:[{key:"axis",content:r.c8},{key:"cols",content:r.c8}]}),(0,s.n)(r.cq,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:h.viewSpec},(0,s.n)(c,{liquid:!u.isHeightAuto&&!u.forPrint,forPrint:u.forPrint,collapsibleWidth:!1,colGroups:[{width:"shrink",cols:[{width:"shrink"}]},{cols:[{span:n,minWidth:o}]}],sections:m}))}getAllDayMaxEventProps(){let{dayMaxEvents:e,dayMaxEventRows:t}=this.context.options;return!0!==e&&!0!==t||(e=void 0,t=5),{dayMaxEvents:e,dayMaxEventRows:t}}}function p(e){return e.text}class m{constructor(e,t,i){this.positions=e,this.dateProfile=t,this.slotDuration=i}safeComputeTop(e){let{dateProfile:t}=this;if((0,r.G)(t.currentRange,e)){let i=(0,r.q)(e),n=e.valueOf()-i.valueOf();if(n>=(0,r.bq)(t.slotMinTime)&&n<(0,r.bq)(t.slotMaxTime))return this.computeTimeTop((0,r.d)(n))}return null}computeDateTop(e,t){return t||(t=(0,r.q)(e)),this.computeTimeTop((0,r.d)(e.valueOf()-t.valueOf()))}computeTimeTop(e){let t,i,{positions:n,dateProfile:s}=this,o=n.els.length,a=(e.milliseconds-(0,r.bq)(s.slotMinTime))/(0,r.bq)(this.slotDuration);return a=Math.max(0,a),a=Math.min(o,a),t=Math.floor(a),t=Math.min(t,o-1),i=a-t,n.tops[t]+n.getHeight(t)*i}}class g extends r.B{render(){let{props:e,context:t}=this,{options:i}=t,{slatElRefs:n}=e;return(0,s.n)("tbody",null,e.slatMetas.map((o,a)=>{let l={time:o.time,date:t.dateEnv.toDate(o.date),view:t.viewApi};return(0,s.n)("tr",{key:o.key,ref:n.createRef(o.key)},e.axis&&(0,s.n)(c,Object.assign({},o)),(0,s.n)(r.C,{elTag:"td",elClasses:["fc-timegrid-slot","fc-timegrid-slot-lane",!o.isLabeled&&"fc-timegrid-slot-minor"],elAttrs:{"data-time":o.isoTimeStr},renderProps:l,generatorName:"slotLaneContent",customGenerator:i.slotLaneContent,classNameGenerator:i.slotLaneClassNames,didMount:i.slotLaneDidMount,willUnmount:i.slotLaneWillUnmount}))}))}}class _ extends r.B{constructor(){super(...arguments),this.rootElRef=(0,s._3)(),this.slatElRefs=new r.cd}render(){let{props:e,context:t}=this;return(0,s.n)("div",{ref:this.rootElRef,className:"fc-timegrid-slots"},(0,s.n)("table",{"aria-hidden":!0,className:t.theme.getClass("table"),style:{minWidth:e.tableMinWidth,width:e.clientWidth,height:e.minHeight}},e.tableColGroupNode,(0,s.n)(g,{slatElRefs:this.slatElRefs,axis:e.axis,slatMetas:e.slatMetas})))}componentDidMount(){this.updateSizing()}componentDidUpdate(){this.updateSizing()}componentWillUnmount(){this.props.onCoords&&this.props.onCoords(null)}updateSizing(){let{context:e,props:t}=this;var i;t.onCoords&&null!==t.clientWidth&&this.rootElRef.current.offsetHeight&&t.onCoords(new m(new r.b8(this.rootElRef.current,(i=this.slatElRefs.currentMap,t.slatMetas.map(e=>i[e.key])),!1,!0),this.props.dateProfile,e.options.slotDuration))}}function y(e,t){let i,n=[];for(i=0;i<t;i+=1)n.push([]);if(e)for(i=0;i<e.length;i+=1)n[e[i].col].push(e[i]);return n}function v(e,t){let i=[];if(e){for(let n=0;n<t;n+=1)i[n]={affectedInstances:e.affectedInstances,isEvent:e.isEvent,segs:[]};for(let t of e.segs)i[t.col].segs.push(t)}else for(let e=0;e<t;e+=1)i[e]=null;return i}class x extends r.B{render(){let{props:e}=this;return(0,s.n)(r.co,{elClasses:["fc-timegrid-more-link"],elStyle:{top:e.top,bottom:e.bottom},allDayDate:null,moreCnt:e.hiddenSegs.length,allSegs:e.hiddenSegs,hiddenSegs:e.hiddenSegs,extraDateSpan:e.extraDateSpan,dateProfile:e.dateProfile,todayRange:e.todayRange,popoverContent:()=>L(e.hiddenSegs,e),defaultGenerator:b,forceTimed:!0},e=>(0,s.n)(e,{elTag:"div",elClasses:["fc-timegrid-more-link-inner","fc-sticky"]}))}}function b(e){return e.shortText}function w(e,t){if(!e)return[[],0];let{level:i,lateralStart:n,lateralEnd:r}=e,s=n,o=[];for(;s<r;)o.push(t(i,s)),s+=1;return o.sort(S),[o.map(T),o[0][1]]}function S(e,t){return t[1]-e[1]}function T(e){return e[0]}function k(e,t){const i={};return(...n)=>{let r=e(...n);return r in i?i[r]:i[r]=t(...n)}}function M(e,t,i=null,n=0){let r=[];if(i)for(let s=0;s<e.length;s+=1){let o=e[s],a=i.computeDateTop(o.start,t),l=Math.max(a+(n||0),i.computeDateTop(o.end,t));r.push({start:Math.round(a),end:Math.round(l)})}return r}const A=(0,r.x)({hour:"numeric",minute:"2-digit",meridiem:!1});class C extends r.B{render(){return(0,s.n)(r.cg,Object.assign({},this.props,{elClasses:["fc-timegrid-event","fc-v-event",this.props.isShort&&"fc-timegrid-event-short"],defaultTimeFormat:A}))}}class D extends r.B{constructor(){super(...arguments),this.sortEventSegs=(0,r.z)(r.bP)}render(){let{props:e,context:t}=this,{options:i}=t,n=i.selectMirror,o=e.eventDrag&&e.eventDrag.segs||e.eventResize&&e.eventResize.segs||n&&e.dateSelectionSegs||[],a=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{},l=this.sortEventSegs(e.fgEventSegs,i.eventOrder);return(0,s.n)(r.ci,{elTag:"td",elRef:e.elRef,elClasses:["fc-timegrid-col",...e.extraClassNames||[]],elAttrs:Object.assign({role:"gridcell"},e.extraDataAttrs),date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,extraRenderProps:e.extraRenderProps},t=>(0,s.n)("div",{className:"fc-timegrid-col-frame"},(0,s.n)("div",{className:"fc-timegrid-col-bg"},this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(e.dateSelectionSegs,"highlight")),(0,s.n)("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(l,a,!1,!1,!1)),(0,s.n)("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(o,{},Boolean(e.eventDrag),Boolean(e.eventResize),Boolean(n),"mirror")),(0,s.n)("div",{className:"fc-timegrid-now-indicator-container"},this.renderNowIndicator(e.nowIndicatorSegs)),(0,r.cj)(i)&&(0,s.n)(t,{elTag:"div",elClasses:["fc-timegrid-col-misc"]})))}renderFgSegs(e,t,i,n,r,s){let{props:o}=this;return o.forPrint?L(e,o):this.renderPositionedFgSegs(e,t,i,n,r,s)}renderPositionedFgSegs(e,t,i,n,o,a){let{eventMaxStack:l,eventShortHeight:c,eventOrderStrict:h,eventMinHeight:d}=this.context.options,{date:u,slatCoords:f,eventSelection:p,todayRange:m,nowDate:g}=this.props,_=i||n||o,y=M(e,u,f,d),{segPlacements:v,hiddenGroups:x}=function(e,t,i,n){let s=[],o=[];for(let i=0;i<e.length;i+=1){let n=t[i];n?s.push({index:i,thickness:1,span:n}):o.push(e[i])}let{segRects:a,hiddenGroups:l}=function(e,t,i){let n=new r.by;null!=t&&(n.strictOrder=t),null!=i&&(n.maxStackCnt=i);let s=n.addSegs(e),o=(0,r.bC)(s),a=function(e){const{entriesByLevel:t}=e,i=k((e,t)=>e+":"+t,(n,s)=>{let o=function(e,t,i){let{levelCoords:n,entriesByLevel:s}=e,o=s[t][i],a=n[t]+o.thickness,l=n.length,c=t;for(;c<l&&n[c]<a;c+=1);for(;c<l;c+=1){let e,t=s[c],i=(0,r.bB)(t,o.span.start,r.bA),n=i[0]+i[1],a=n;for(;(e=t[a])&&e.span.start<o.span.end;)a+=1;if(n<a)return{level:c,lateralStart:n,lateralEnd:a}}return null}(e,n,s),a=w(o,i),l=t[n][s];return[Object.assign(Object.assign({},l),{nextLevelNodes:a[0]}),l.thickness+a[1]]});return w(t.length?{level:0,lateralStart:0,lateralEnd:t[0].length}:null,i)[0]}(n);return a=function(e){const t=k((e,t,i)=>(0,r.bz)(e),(e,i,n)=>{let r,{nextLevelNodes:s,thickness:o}=e,a=o+n,l=o/a,c=[];if(s.length)for(let e of s)if(void 0===r){let n=t(e,i,a);r=n[0],c.push(n[1])}else{let i=t(e,r,0);c.push(i[1])}else r=1;let h=(r-i)*l;return[r-h,Object.assign(Object.assign({},e),{thickness:h,nextLevelNodes:c})]});return e.map(e=>t(e,0,0)[1])}(a),{segRects:function(e){let t=[];const i=k((e,t,i)=>(0,r.bz)(e),(e,i,r)=>{let s=Object.assign(Object.assign({},e),{levelCoord:i,stackDepth:r,stackForward:0});return t.push(s),s.stackForward=n(e.nextLevelNodes,i+e.thickness,r+1)+1});function n(e,t,n){let r=0;for(let s of e)r=Math.max(i(s,t,n),r);return r}return n(e,0,0),t}(a),hiddenGroups:o}}(s,i,n),c=[];for(let t of a)c.push({seg:e[t.index],rect:t});for(let e of o)c.push({seg:e,rect:null});return{segPlacements:c,hiddenGroups:l}}(e,y,h,l);return(0,s.n)(s.FK,null,this.renderHiddenGroups(x,e),v.map(e=>{let{seg:l,rect:h}=e,d=l.eventRange.instance.instanceId,u=_||Boolean(!t[d]&&h),f=E(h&&h.span),y=!_&&h?this.computeSegHStyle(h):{left:0,right:0},v=Boolean(h)&&h.stackForward>0,x=Boolean(h)&&h.span.end-h.span.start<c;return(0,s.n)("div",{className:"fc-timegrid-event-harness"+(v?" fc-timegrid-event-harness-inset":""),key:a||d,style:Object.assign(Object.assign({visibility:u?"":"hidden"},f),y)},(0,s.n)(C,Object.assign({seg:l,isDragging:i,isResizing:n,isDateSelecting:o,isSelected:d===p,isShort:x},(0,r.bQ)(l,m,g))))}))}renderHiddenGroups(e,t){let{extraDateSpan:i,dateProfile:n,todayRange:o,nowDate:a,eventSelection:l,eventDrag:c,eventResize:h}=this.props;return(0,s.n)(s.FK,null,e.map(e=>{let d=E(e.span),u=(f=e.entries,p=t,f.map(e=>p[e.index]));var f,p;return(0,s.n)(x,{key:(0,r.bu)((0,r.cp)(u)),hiddenSegs:u,top:d.top,bottom:d.bottom,extraDateSpan:i,dateProfile:n,todayRange:o,nowDate:a,eventSelection:l,eventDrag:c,eventResize:h})}))}renderFillSegs(e,t){let{props:i,context:n}=this,o=M(e,i.date,i.slatCoords,n.options.eventMinHeight).map((n,o)=>{let a=e[o];return(0,s.n)("div",{key:(0,r.bR)(a.eventRange),className:"fc-timegrid-bg-harness",style:E(n)},"bg-event"===t?(0,s.n)(r.cm,Object.assign({seg:a},(0,r.bQ)(a,i.todayRange,i.nowDate))):(0,r.cl)(t))});return(0,s.n)(s.FK,null,o)}renderNowIndicator(e){let{slatCoords:t,date:i}=this.props;return t?e.map((e,n)=>(0,s.n)(r.ch,{key:n,elClasses:["fc-timegrid-now-indicator-line"],elStyle:{top:t.computeDateTop(e.start,i)},isAxis:!1,date:i})):null}computeSegHStyle(e){let t,i,{isRtl:n,options:r}=this.context,s=r.slotEventOverlap,o=e.levelCoord,a=e.levelCoord+e.thickness;s&&(a=Math.min(1,o+2*(a-o))),n?(t=1-a,i=o):(t=o,i=1-a);let l={zIndex:e.stackDepth+1,left:100*t+"%",right:100*i+"%"};return s&&!e.stackForward&&(l[n?"marginLeft":"marginRight"]=20),l}}function L(e,{todayRange:t,nowDate:i,eventSelection:n,eventDrag:o,eventResize:a}){let l=(o?o.affectedInstances:null)||(a?a.affectedInstances:null)||{};return(0,s.n)(s.FK,null,e.map(e=>{let o=e.eventRange.instance.instanceId;return(0,s.n)("div",{key:o,style:{visibility:l[o]?"hidden":""}},(0,s.n)(C,Object.assign({seg:e,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:o===n,isShort:!1},(0,r.bQ)(e,t,i))))}))}function E(e){return e?{top:e.start,bottom:-e.end}:{top:"",bottom:""}}class I extends r.B{constructor(){super(...arguments),this.splitFgEventSegs=(0,r.z)(y),this.splitBgEventSegs=(0,r.z)(y),this.splitBusinessHourSegs=(0,r.z)(y),this.splitNowIndicatorSegs=(0,r.z)(y),this.splitDateSelectionSegs=(0,r.z)(y),this.splitEventDrag=(0,r.z)(v),this.splitEventResize=(0,r.z)(v),this.rootElRef=(0,s._3)(),this.cellElRefs=new r.cd}render(){let{props:e,context:t}=this,i=t.options.nowIndicator&&e.slatCoords&&e.slatCoords.safeComputeTop(e.nowDate),n=e.cells.length,o=this.splitFgEventSegs(e.fgEventSegs,n),a=this.splitBgEventSegs(e.bgEventSegs,n),l=this.splitBusinessHourSegs(e.businessHourSegs,n),c=this.splitNowIndicatorSegs(e.nowIndicatorSegs,n),h=this.splitDateSelectionSegs(e.dateSelectionSegs,n),d=this.splitEventDrag(e.eventDrag,n),u=this.splitEventResize(e.eventResize,n);return(0,s.n)("div",{className:"fc-timegrid-cols",ref:this.rootElRef},(0,s.n)("table",{role:"presentation",style:{minWidth:e.tableMinWidth,width:e.clientWidth}},e.tableColGroupNode,(0,s.n)("tbody",{role:"presentation"},(0,s.n)("tr",{role:"row"},e.axis&&(0,s.n)("td",{"aria-hidden":!0,className:"fc-timegrid-col fc-timegrid-axis"},(0,s.n)("div",{className:"fc-timegrid-col-frame"},(0,s.n)("div",{className:"fc-timegrid-now-indicator-container"},"number"==typeof i&&(0,s.n)(r.ch,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:i},isAxis:!0,date:e.nowDate})))),e.cells.map((t,i)=>(0,s.n)(D,{key:t.key,elRef:this.cellElRefs.createRef(t.key),dateProfile:e.dateProfile,date:t.date,nowDate:e.nowDate,todayRange:e.todayRange,extraRenderProps:t.extraRenderProps,extraDataAttrs:t.extraDataAttrs,extraClassNames:t.extraClassNames,extraDateSpan:t.extraDateSpan,fgEventSegs:o[i],bgEventSegs:a[i],businessHourSegs:l[i],nowIndicatorSegs:c[i],dateSelectionSegs:h[i],eventDrag:d[i],eventResize:u[i],slatCoords:e.slatCoords,eventSelection:e.eventSelection,forPrint:e.forPrint}))))))}componentDidMount(){this.updateCoords()}componentDidUpdate(){this.updateCoords()}updateCoords(){let{props:e}=this;var t;e.onColCoords&&null!==e.clientWidth&&e.onColCoords(new r.b8(this.rootElRef.current,(t=this.cellElRefs.currentMap,e.cells.map(e=>t[e.key])),!0,!1))}}class P extends r.bc{constructor(){super(...arguments),this.processSlotOptions=(0,r.z)(R),this.state={slatCoords:null},this.handleRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)},this.handleScrollRequest=e=>{let{onScrollTopRequest:t}=this.props,{slatCoords:i}=this.state;if(t&&i){if(e.time){let n=i.computeTimeTop(e.time);n=Math.ceil(n),n&&(n+=1),t(n)}return!0}return!1},this.handleColCoords=e=>{this.colCoords=e},this.handleSlatCoords=e=>{this.setState({slatCoords:e}),this.props.onSlatCoords&&this.props.onSlatCoords(e)}}render(){let{props:e,state:t}=this;return(0,s.n)("div",{className:"fc-timegrid-body",ref:this.handleRootEl,style:{width:e.clientWidth,minWidth:e.tableMinWidth}},(0,s.n)(_,{axis:e.axis,dateProfile:e.dateProfile,slatMetas:e.slatMetas,clientWidth:e.clientWidth,minHeight:e.expandRows?e.clientHeight:"",tableMinWidth:e.tableMinWidth,tableColGroupNode:e.axis?e.tableColGroupNode:null,onCoords:this.handleSlatCoords}),(0,s.n)(I,{cells:e.cells,axis:e.axis,dateProfile:e.dateProfile,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,todayRange:e.todayRange,nowDate:e.nowDate,nowIndicatorSegs:e.nowIndicatorSegs,clientWidth:e.clientWidth,tableMinWidth:e.tableMinWidth,tableColGroupNode:e.tableColGroupNode,slatCoords:t.slatCoords,onColCoords:this.handleColCoords,forPrint:e.forPrint}))}componentDidMount(){this.scrollResponder=this.context.createScrollResponder(this.handleScrollRequest)}componentDidUpdate(e){this.scrollResponder.update(e.dateProfile!==this.props.dateProfile)}componentWillUnmount(){this.scrollResponder.detach()}queryHit(e,t){let{dateEnv:i,options:n}=this.context,{colCoords:s}=this,{dateProfile:o}=this.props,{slatCoords:a}=this.state,{snapDuration:l,snapsPerSlot:c}=this.processSlotOptions(this.props.slotDuration,n.snapDuration),h=s.leftToIndex(e),d=a.positions.topToIndex(t);if(null!=h&&null!=d){let e=this.props.cells[h],n=a.positions.tops[d],u=a.positions.getHeight(d),f=(t-n)/u,p=d*c+Math.floor(f*c),m=this.props.cells[h].date,g=(0,r.bn)(o.slotMinTime,(0,r.bm)(l,p)),_=i.add(m,g),y=i.add(_,l);return{dateProfile:o,dateSpan:Object.assign({range:{start:_,end:y},allDay:!1},e.extraDateSpan),dayEl:s.els[h],rect:{left:s.lefts[h],right:s.rights[h],top:n,bottom:n+u},layer:0}}return null}}function R(e,t){let i=t||e,n=(0,r.br)(e,i);return null===n&&(i=e,n=1),{snapDuration:i,snapsPerSlot:n}}class O extends r.bU{sliceRange(e,t){let i=[];for(let n=0;n<t.length;n+=1){let s=(0,r.o)(e,t[n]);s&&i.push({start:s.start,end:s.end,isStart:s.start.valueOf()===e.start.valueOf(),isEnd:s.end.valueOf()===e.end.valueOf(),col:n})}return i}}class z extends r.bc{constructor(){super(...arguments),this.buildDayRanges=(0,r.z)(F),this.slicer=new O,this.timeColsRef=(0,s._3)()}render(){let{props:e,context:t}=this,{dateProfile:i,dayTableModel:n}=e,{nowIndicator:o,nextDayThreshold:a}=t.options,l=this.buildDayRanges(n,i,t.dateEnv);return(0,s.n)(r.a6,{unit:o?"minute":"day"},(r,c)=>(0,s.n)(P,Object.assign({ref:this.timeColsRef},this.slicer.sliceProps(e,i,null,t,l),{forPrint:e.forPrint,axis:e.axis,dateProfile:i,slatMetas:e.slatMetas,slotDuration:e.slotDuration,cells:n.cells[0],tableColGroupNode:e.tableColGroupNode,tableMinWidth:e.tableMinWidth,clientWidth:e.clientWidth,clientHeight:e.clientHeight,expandRows:e.expandRows,nowDate:r,nowIndicatorSegs:o&&this.slicer.sliceNowDate(r,i,a,t,l),todayRange:c,onScrollTopRequest:e.onScrollTopRequest,onSlatCoords:e.onSlatCoords})))}}function F(e,t,i){let n=[];for(let r of e.headerDates)n.push({start:i.add(r,t.slotMinTime),end:i.add(r,t.slotMaxTime)});return n}const N=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];function Y(e,t,i,n,s){let o=new Date(0),a=e,l=(0,r.d)(0),c=i||function(e){let t,i,n;for(t=N.length-1;t>=0;t-=1)if(i=(0,r.d)(N[t]),n=(0,r.br)(i,e),null!==n&&n>1)return i;return e}(n),h=[];for(;(0,r.bq)(a)<(0,r.bq)(t);){let e=s.add(o,a),t=null!==(0,r.br)(l,c);h.push({date:e,time:a,key:e.toISOString(),isoTimeStr:(0,r.bs)(e),isLabeled:t}),a=(0,r.bn)(a,n),l=(0,r.bn)(l,n)}return h}function B(e,t){let i=new r.bM(e.renderRange,t);return new r.bT(i,!1)}(0,r.ct)('.fc-v-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-v-event .fc-event-main{color:var(--fc-event-text-color);height:100%}.fc-v-event .fc-event-main-frame{display:flex;flex-direction:column;height:100%}.fc-v-event .fc-event-time{flex-grow:0;flex-shrink:0;max-height:100%;overflow:hidden}.fc-v-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-height:0}.fc-v-event .fc-event-title{bottom:0;max-height:100%;overflow:hidden;top:0}.fc-v-event:not(.fc-event-start){border-top-left-radius:0;border-top-right-radius:0;border-top-width:0}.fc-v-event:not(.fc-event-end){border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-width:0}.fc-v-event.fc-event-selected:before{left:-10px;right:-10px}.fc-v-event .fc-event-resizer-start{cursor:n-resize}.fc-v-event .fc-event-resizer-end{cursor:s-resize}.fc-v-event:not(.fc-event-selected) .fc-event-resizer{height:var(--fc-event-resizer-thickness);left:0;right:0}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-start{top:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer{left:50%;margin-left:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-start{top:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc .fc-timegrid .fc-daygrid-body{z-index:2}.fc .fc-timegrid-divider{padding:0 0 2px}.fc .fc-timegrid-body{min-height:100%;position:relative;z-index:1}.fc .fc-timegrid-axis-chunk{position:relative}.fc .fc-timegrid-axis-chunk>table,.fc .fc-timegrid-slots{position:relative;z-index:1}.fc .fc-timegrid-slot{border-bottom:0;height:1.5em}.fc .fc-timegrid-slot:empty:before{content:"\\00a0"}.fc .fc-timegrid-slot-minor{border-top-style:dotted}.fc .fc-timegrid-slot-label-cushion{display:inline-block;white-space:nowrap}.fc .fc-timegrid-slot-label{vertical-align:middle}.fc .fc-timegrid-axis-cushion,.fc .fc-timegrid-slot-label-cushion{padding:0 4px}.fc .fc-timegrid-axis-frame-liquid{height:100%}.fc .fc-timegrid-axis-frame{align-items:center;display:flex;justify-content:flex-end;overflow:hidden}.fc .fc-timegrid-axis-cushion{flex-shrink:0;max-width:60px}.fc-direction-ltr .fc-timegrid-slot-label-frame{text-align:right}.fc-direction-rtl .fc-timegrid-slot-label-frame{text-align:left}.fc-liquid-hack .fc-timegrid-axis-frame-liquid{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-timegrid-col-frame{min-height:100%;position:relative}.fc-media-screen.fc-liquid-hack .fc-timegrid-col-frame{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols{bottom:0;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols>table{height:100%}.fc-media-screen .fc-timegrid-col-bg,.fc-media-screen .fc-timegrid-col-events,.fc-media-screen .fc-timegrid-now-indicator-container{left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col-bg{z-index:2}.fc .fc-timegrid-col-bg .fc-non-business{z-index:1}.fc .fc-timegrid-col-bg .fc-bg-event{z-index:2}.fc .fc-timegrid-col-bg .fc-highlight{z-index:3}.fc .fc-timegrid-bg-harness{left:0;position:absolute;right:0}.fc .fc-timegrid-col-events{z-index:3}.fc .fc-timegrid-now-indicator-container{bottom:0;overflow:hidden}.fc-direction-ltr .fc-timegrid-col-events{margin:0 2.5% 0 2px}.fc-direction-rtl .fc-timegrid-col-events{margin:0 2px 0 2.5%}.fc-timegrid-event-harness{position:absolute}.fc-timegrid-event-harness>.fc-timegrid-event{bottom:0;left:0;position:absolute;right:0;top:0}.fc-timegrid-event-harness-inset .fc-timegrid-event,.fc-timegrid-event.fc-event-mirror,.fc-timegrid-more-link{box-shadow:0 0 0 1px var(--fc-page-bg-color)}.fc-timegrid-event,.fc-timegrid-more-link{border-radius:3px;font-size:var(--fc-small-font-size)}.fc-timegrid-event{margin-bottom:1px}.fc-timegrid-event .fc-event-main{padding:1px 1px 0}.fc-timegrid-event .fc-event-time{font-size:var(--fc-small-font-size);margin-bottom:1px;white-space:nowrap}.fc-timegrid-event-short .fc-event-main-frame{flex-direction:row;overflow:hidden}.fc-timegrid-event-short .fc-event-time:after{content:"\\00a0-\\00a0"}.fc-timegrid-event-short .fc-event-title{font-size:var(--fc-small-font-size)}.fc-timegrid-more-link{background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;margin-bottom:1px;position:absolute;z-index:9999}.fc-timegrid-more-link-inner{padding:3px 2px;top:0}.fc-direction-ltr .fc-timegrid-more-link{right:0}.fc-direction-rtl .fc-timegrid-more-link{left:0}.fc .fc-timegrid-now-indicator-arrow,.fc .fc-timegrid-now-indicator-line{pointer-events:none}.fc .fc-timegrid-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;border-width:1px 0 0;left:0;position:absolute;right:0;z-index:4}.fc .fc-timegrid-now-indicator-arrow{border-color:var(--fc-now-indicator-color);border-style:solid;margin-top:-5px;position:absolute;z-index:4}.fc-direction-ltr .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 0 5px 6px;left:0}.fc-direction-rtl .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 6px 5px 0;right:0}');const H={allDaySlot:Boolean};var j=(0,n.i1)({name:"@fullcalendar/timegrid",initialView:"timeGridWeek",optionRefiners:H,views:{timeGrid:{component:class extends f{constructor(){super(...arguments),this.buildTimeColsModel=(0,r.z)(B),this.buildSlatMetas=(0,r.z)(Y)}render(){let{options:e,dateEnv:t,dateProfileGenerator:i}=this.context,{props:n}=this,{dateProfile:a}=n,l=this.buildTimeColsModel(a,i),c=this.allDaySplitter.splitProps(n),h=this.buildSlatMetas(a.slotMinTime,a.slotMaxTime,e.slotLabelInterval,e.slotDuration,t),{dayMinWidth:d}=e,u=!d,f=d,p=e.dayHeaders&&(0,s.n)(r.bI,{dates:l.headerDates,dateProfile:a,datesRepDistinctDays:!0,renderIntro:u?this.renderHeadAxis:null}),m=!1!==e.allDaySlot&&(t=>(0,s.n)(o.t7,Object.assign({},c.allDay,{dateProfile:a,dayTableModel:l,nextDayThreshold:e.nextDayThreshold,tableMinWidth:t.tableMinWidth,colGroupNode:t.tableColGroupNode,renderRowIntro:u?this.renderTableRowAxis:null,showWeekNumbers:!1,expandRows:!1,headerAlignElRef:this.headerElRef,clientWidth:t.clientWidth,clientHeight:t.clientHeight,forPrint:n.forPrint},this.getAllDayMaxEventProps()))),g=t=>(0,s.n)(z,Object.assign({},c.timed,{dayTableModel:l,dateProfile:a,axis:u,slotDuration:e.slotDuration,slatMetas:h,forPrint:n.forPrint,tableColGroupNode:t.tableColGroupNode,tableMinWidth:t.tableMinWidth,clientWidth:t.clientWidth,clientHeight:t.clientHeight,onSlatCoords:this.handleSlatCoords,expandRows:t.expandRows,onScrollTopRequest:this.handleScrollTopRequest}));return f?this.renderHScrollLayout(p,m,g,l.colCnt,d,h,this.state.slatCoords):this.renderSimpleLayout(p,m,g)}},usesMinMaxTime:!0,allDaySlot:!0,slotDuration:"00:30:00",slotEventOverlap:!0},timeGridDay:{type:"timeGrid",duration:{days:1}},timeGridWeek:{type:"timeGrid",duration:{weeks:1}}}})},708:function(e,t,i){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],i=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:i,weekdaysShort:i,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,i){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(i(5093))},748:function(e,t,i){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(i(5093))},793:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>o}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(6354);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(9760);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(222);function o(e){return(0,n.A)((0,r.A)(e)).left+(0,s.A)(e).scrollLeft}},838:function(e,t,i){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),i="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),n=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,n){return e?/-MMM-/.test(n)?i[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(i(5093))},842:function(e){e.exports=function(){"use strict";var e,t,i;function n(n,r){if(e)if(t){var s="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",o={};e(o),i=r(o),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(i.workerUrl=window.URL.createObjectURL(new Blob([s],{type:"text/javascript"})))}else t=r;else e=r}return n(0,function(e){var t=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array;function n(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=i*s-r*n;return o?(e[0]=s*(o=1/o),e[1]=-n*o,e[2]=-r*o,e[3]=i*o,e):null}function r(){var e=new i(9);return i!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function s(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8];return e[0]=o*h-a*c,e[1]=r*c-n*h,e[2]=n*a-r*o,e[3]=a*l-s*h,e[4]=i*h-r*l,e[5]=r*s-i*a,e[6]=s*c-o*l,e[7]=n*l-i*c,e[8]=i*o-n*s,e}function o(e,t,i){var n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],d=t[8],u=i[0],f=i[1],p=i[2],m=i[3],g=i[4],_=i[5],y=i[6],v=i[7],x=i[8];return e[0]=u*n+f*o+p*c,e[1]=u*r+f*a+p*h,e[2]=u*s+f*l+p*d,e[3]=m*n+g*o+_*c,e[4]=m*r+g*a+_*h,e[5]=m*s+g*l+_*d,e[6]=y*n+v*o+x*c,e[7]=y*r+v*a+x*h,e[8]=y*s+v*l+x*d,e}function a(){var e=new i(16);return i!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function l(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function c(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],d=t[9],u=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],y=i*a-n*o,v=i*l-r*o,x=i*c-s*o,b=n*l-r*a,w=n*c-s*a,S=r*c-s*l,T=h*m-d*p,k=h*g-u*p,M=h*_-f*p,A=d*g-u*m,C=d*_-f*m,D=u*_-f*g,L=y*D-v*C+x*A+b*M-w*k+S*T;return L?(e[0]=(a*D-l*C+c*A)*(L=1/L),e[1]=(r*C-n*D-s*A)*L,e[2]=(m*S-g*w+_*b)*L,e[3]=(u*w-d*S-f*b)*L,e[4]=(l*M-o*D-c*k)*L,e[5]=(i*D-r*M+s*k)*L,e[6]=(g*x-p*S-_*v)*L,e[7]=(h*S-u*x+f*v)*L,e[8]=(o*C-a*M+c*T)*L,e[9]=(n*M-i*C-s*T)*L,e[10]=(p*w-m*x+_*y)*L,e[11]=(d*x-h*w-f*y)*L,e[12]=(a*k-o*A-l*T)*L,e[13]=(i*A-n*k+r*T)*L,e[14]=(m*v-p*b-g*y)*L,e[15]=(h*b-d*v+u*y)*L,e):null}function h(e,t,i){var n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],d=t[8],u=t[9],f=t[10],p=t[11],m=t[12],g=t[13],_=t[14],y=t[15],v=i[0],x=i[1],b=i[2],w=i[3];return e[0]=v*n+x*a+b*d+w*m,e[1]=v*r+x*l+b*u+w*g,e[2]=v*s+x*c+b*f+w*_,e[3]=v*o+x*h+b*p+w*y,e[4]=(v=i[4])*n+(x=i[5])*a+(b=i[6])*d+(w=i[7])*m,e[5]=v*r+x*l+b*u+w*g,e[6]=v*s+x*c+b*f+w*_,e[7]=v*o+x*h+b*p+w*y,e[8]=(v=i[8])*n+(x=i[9])*a+(b=i[10])*d+(w=i[11])*m,e[9]=v*r+x*l+b*u+w*g,e[10]=v*s+x*c+b*f+w*_,e[11]=v*o+x*h+b*p+w*y,e[12]=(v=i[12])*n+(x=i[13])*a+(b=i[14])*d+(w=i[15])*m,e[13]=v*r+x*l+b*u+w*g,e[14]=v*s+x*c+b*f+w*_,e[15]=v*o+x*h+b*p+w*y,e}function d(e,t,i){var n,r,s,o,a,l,c,h,d,u,f,p,m=i[0],g=i[1],_=i[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*_+t[12],e[13]=t[1]*m+t[5]*g+t[9]*_+t[13],e[14]=t[2]*m+t[6]*g+t[10]*_+t[14],e[15]=t[3]*m+t[7]*g+t[11]*_+t[15]):(r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],d=t[8],u=t[9],f=t[10],p=t[11],e[0]=n=t[0],e[1]=r,e[2]=s,e[3]=o,e[4]=a,e[5]=l,e[6]=c,e[7]=h,e[8]=d,e[9]=u,e[10]=f,e[11]=p,e[12]=n*m+a*g+d*_+t[12],e[13]=r*m+l*g+u*_+t[13],e[14]=s*m+c*g+f*_+t[14],e[15]=o*m+h*g+p*_+t[15]),e}function u(e,t,i){var n=i[0],r=i[1],s=i[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11]*s,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function f(e,t,i){var n=Math.sin(i),r=Math.cos(i),s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],h=t[9],d=t[10],u=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=s*r+c*n,e[5]=o*r+h*n,e[6]=a*r+d*n,e[7]=l*r+u*n,e[8]=c*r-s*n,e[9]=h*r-o*n,e[10]=d*r-a*n,e[11]=u*r-l*n,e}function p(e,t,i){var n=Math.sin(i),r=Math.cos(i),s=t[0],o=t[1],a=t[2],l=t[3],c=t[8],h=t[9],d=t[10],u=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=s*r-c*n,e[1]=o*r-h*n,e[2]=a*r-d*n,e[3]=l*r-u*n,e[8]=s*n+c*r,e[9]=o*n+h*r,e[10]=a*n+d*r,e[11]=l*n+u*r,e}function m(e,t,i){var n=Math.sin(i),r=Math.cos(i),s=t[0],o=t[1],a=t[2],l=t[3],c=t[4],h=t[5],d=t[6],u=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=s*r+c*n,e[1]=o*r+h*n,e[2]=a*r+d*n,e[3]=l*r+u*n,e[4]=c*r-s*n,e[5]=h*r-o*n,e[6]=d*r-a*n,e[7]=u*r-l*n,e}function g(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _(e,i,n){var r,s,o,a=n[0],l=n[1],c=n[2],h=Math.hypot(a,l,c);return h<t?null:(a*=h=1/h,l*=h,c*=h,r=Math.sin(i),s=Math.cos(i),e[0]=a*a*(o=1-s)+s,e[1]=l*a*o+c*r,e[2]=c*a*o-l*r,e[3]=0,e[4]=a*l*o-c*r,e[5]=l*l*o+s,e[6]=c*l*o+a*r,e[7]=0,e[8]=a*c*o+l*r,e[9]=l*c*o-a*r,e[10]=c*c*o+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function y(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=i+i,a=n+n,l=r+r,c=i*o,h=n*o,d=n*a,u=r*o,f=r*a,p=r*l,m=s*o,g=s*a,_=s*l;return e[0]=1-d-p,e[1]=h+_,e[2]=u-g,e[3]=0,e[4]=h-_,e[5]=1-c-p,e[6]=f+m,e[7]=0,e[8]=u+g,e[9]=f-m,e[10]=1-c-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var v=h;function x(){var e=new i(3);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function b(e){var t=new i(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function w(e){return Math.hypot(e[0],e[1],e[2])}function S(e,t,n){var r=new i(3);return r[0]=e,r[1]=t,r[2]=n,r}function T(e,t,i,n){return e[0]=t,e[1]=i,e[2]=n,e}function k(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e}function M(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function A(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e}function C(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e}function D(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e}function L(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function E(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e[2]=t[2]+i[2]*n,e}function I(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2];return i*i+n*n+r*r}function P(e){var t=e[0],i=e[1],n=e[2];return t*t+i*i+n*n}function R(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function O(e,t){var i=t[0],n=t[1],r=t[2],s=i*i+n*n+r*r;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function z(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function F(e,t,i){var n=t[0],r=t[1],s=t[2],o=i[0],a=i[1],l=i[2];return e[0]=r*l-s*a,e[1]=s*o-n*l,e[2]=n*a-r*o,e}function N(e,t,i,n){var r=t[0],s=t[1],o=t[2];return e[0]=r+n*(i[0]-r),e[1]=s+n*(i[1]-s),e[2]=o+n*(i[2]-o),e}function Y(e,t,i){var n=t[0],r=t[1],s=t[2],o=i[3]*n+i[7]*r+i[11]*s+i[15];return e[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/(o=o||1),e[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/o,e[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/o,e}function B(e,t,i){var n=t[0],r=t[1],s=t[2];return e[0]=n*i[0]+r*i[3]+s*i[6],e[1]=n*i[1]+r*i[4]+s*i[7],e[2]=n*i[2]+r*i[5]+s*i[8],e}function H(e,t,i){var n=i[0],r=i[1],s=i[2],o=t[0],a=t[1],l=t[2],c=r*l-s*a,h=s*o-n*l,d=n*a-r*o,u=r*d-s*h,f=s*c-n*d,p=n*h-r*c,m=2*i[3];return h*=m,d*=m,f*=2,p*=2,e[0]=o+(c*=m)+(u*=2),e[1]=a+h+f,e[2]=l+d+p,e}function j(e){return e[0]=0,e[1]=0,e[2]=0,e}function V(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}var W=M,U=A,$=w;function G(){var e=new i(4);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function X(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e}function q(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=i*i+n*n+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),e[0]=i*o,e[1]=n*o,e[2]=r*o,e[3]=s*o,e}function Z(e,t,i){var n=t[0],r=t[1],s=t[2],o=t[3];return e[0]=i[0]*n+i[4]*r+i[8]*s+i[12]*o,e[1]=i[1]*n+i[5]*r+i[9]*s+i[13]*o,e[2]=i[2]*n+i[6]*r+i[10]*s+i[14]*o,e[3]=i[3]*n+i[7]*r+i[11]*s+i[15]*o,e}function J(){var e=new i(4);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function K(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Q(e,t,i){i*=.5;var n=t[0],r=t[1],s=t[2],o=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=n*l+o*a,e[1]=r*l+s*a,e[2]=s*l-r*a,e[3]=o*l-n*a,e}function ee(e,t,i){i*=.5;var n=t[0],r=t[1],s=t[2],o=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=n*l-s*a,e[1]=r*l+o*a,e[2]=s*l+n*a,e[3]=o*l-r*a,e}x(),G();var te,ie,ne,re=q,se=(te=x(),ie=S(1,0,0),ne=S(0,1,0),function(e,t,i){var n=z(t,i);return n<-.999999?(F(te,ie,t),$(te)<1e-6&&F(te,ne,t),O(te,te),function(e,t,i){i*=.5;var n=Math.sin(i);e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i)}(e,te,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(F(te,t,i),e[0]=te[0],e[1]=te[1],e[2]=te[2],e[3]=1+n,re(e,e))});function oe(){var e=new i(2);return i!=Float32Array&&(e[0]=0,e[1]=0),e}function ae(e,t){var n=new i(2);return n[0]=e,n[1]=t,n}function le(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function ce(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function he(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function de(e){return Math.hypot(e[0],e[1])}function ue(e,t){var i=t[0],n=t[1],r=i*i+n*n;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}function fe(e,t){return e[0]*t[0]+e[1]*t[1]}J(),J(),r();var pe,me,ge=ce;function _e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}oe();var ye=function(){if(me)return pe;function e(e,t,i,n){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=i,this.p2y=n}return me=1,pe=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var i=e,n=0;n<8;n++){var r=this.sampleCurveX(i)-e;if(Math.abs(r)<t)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=r/s}var o=0,a=1;for(i=e,n=0;n<20&&(r=this.sampleCurveX(i),!(Math.abs(r-e)<t));n++)e>r?o=i:a=i,i=.5*(a-o)+o;return i},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},pe}(),ve=_e(ye);function xe(e,t){this.x=e,this.y=t}function be(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!be(e[i],t[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!be(e[i],t[i]))return!1;return!0}return e===t}xe.prototype={clone(){return new xe(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){const t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){const t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){const e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){const t=Math.cos(e),i=Math.sin(e),n=i*this.x+t*this.y;return this.x=t*this.x-i*this.y,this.y=n,this},_rotateAround(e,t){const i=Math.cos(e),n=Math.sin(e),r=t.y+n*(this.x-t.x)+i*(this.y-t.y);return this.x=t.x+i*(this.x-t.x)-n*(this.y-t.y),this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:xe},xe.convert=function(e){if(e instanceof xe)return e;if(Array.isArray(e))return new xe(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new xe(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};const we=Math.PI/180,Se=180/Math.PI;function Te(e){return e*we}function ke(e){return e*Se}const Me=[[0,0],[1,0],[1,1],[0,1]];function Ae(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,i=t*e;return 4*(e<.5?i:3*(e-t)+i-.75)}function Ce(e,t,i,n){const r=new ve(e,t,i,n);return function(e){return r.solve(e)}}const De=Ce(.25,.1,.25,1);function Le(e,t,i){return Math.min(i,Math.max(t,e))}function Ee(e,t,i){return(i=Le((i-e)/(t-e),0,1))*i*(3-2*i)}function Ie(e,t,i){const n=i-t,r=((e-t)%n+n)%n+t;return r===t?i:r}function Pe(e,t,i){if(!e.length)return i(null,[]);let n=e.length;const r=new Array(e.length);let s=null;e.forEach((e,o)=>{t(e,(e,t)=>{e&&(s=e),r[o]=t,0==--n&&i(s,r)})})}function Re(e,...t){for(const i of t)for(const t in i)e[t]=i[t];return e}let Oe=1;function ze(){return Oe++}function Fe(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function Ne(e,t){e.forEach(e=>{t[e]&&(t[e]=t[e].bind(t))})}function Ye(e,t,i){const n={};for(const i in e)n[i]=t.call(this,e[i],i,e);return n}function Be(e,t,i){const n={};for(const i in e)t.call(this,e[i],i,e)&&(n[i]=e[i]);return n}function He(e){return Array.isArray(e)?e.map(He):"object"==typeof e&&e?Ye(e,He):e}function je(e,t){for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>=0)return!0;return!1}const Ve={};function We(e){Ve[e]||("undefined"!=typeof console&&console.warn(e),Ve[e]=!0)}function Ue(e,t,i){return(i.y-e.y)*(t.x-e.x)>(t.y-e.y)*(i.x-e.x)}function $e(e){let t=0;for(let i,n,r=0,s=e.length,o=s-1;r<s;o=r++)i=e[r],n=e[o],t+=(n.x-i.x)*(i.y+n.y);return t}function Ge([e,t,i]){const n=Te(t+90),r=Te(i);return{x:e*Math.cos(n)*Math.sin(r),y:e*Math.sin(n)*Math.sin(r),z:e*Math.cos(r),azimuthal:t,polar:i}}function Xe(e){return("undefined"!=typeof self||void 0!==e)&&"undefined"!=typeof WorkerGlobalScope&&(void 0!==e?e:self)instanceof WorkerGlobalScope}function qe(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(e,i,n,r)=>{const s=n||r;return t[i]=!s||s.toLowerCase(),""}),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let Ze=null;function Je(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function Ke(e,t,i,n){for(;t<i;){const r=t+i>>1;e[r]<n?t=r+1:i=r}return t}function Qe(e,t,i,n){for(;t<i;){const r=t+i>>1;e[r]<=n?t=r+1:i=r}return t}function et(e){return e>0?1/(1.001-e):1+e}function tt(e){return e>0?1-1/(1.001-e):-e}function it(e,t,i){return(e-t.min)*(i.max-i.min)/(t.max-t.min)+i.min}const nt={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!nt.API_URL)return null;try{const e=new URL(nt.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",BUILDING_GEN_URL:"https://api.mapbox.com/mapbox-gl-js/building-gen/building_gen_v1.2.1.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function rt(e){return nt.API_URL_REGEX.test(e)}function st(e){return nt.API_SPRITE_REGEX.test(e)}let ot,at,lt,ct,ht,dt;function ut(){return null==ot&&(ot=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ot}const ft={now:()=>void 0!==ct?ct:performance.now(),setNow(e){ct=e},restoreNow(){ct=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:i,height:n}=e;ht||(ht=document.createElement("canvas"));const r=ht.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return(i>ht.width||n>ht.height)&&(ht.width=i,ht.height=n),r.clearRect(-t,-t,i+2*t,n+2*t),r.drawImage(e,0,0,i,n),r.getImageData(-t,-t,i+2*t,n+2*t)},resolveURL:e=>(at||(at=document.createElement("a")),at.href=e,at.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==lt&&(lt=window.matchMedia("(prefers-reduced-motion: reduce)")),lt.matches)},hasCanvasFingerprintNoise(){if(void 0!==dt)return dt;if(!ut())return dt=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let i=0;for(let n=0;n<e.width;++n)t.fillStyle=`rgba(${i++},${i++},${i++}, 255)`,t.fillRect(n,0,1,1);const n=t.getImageData(0,0,e.width,e.height);i=0;for(let e=0;e<n.data.length;++e)if(e%4!=3&&i++!==n.data[e])return dt=!0,!0;return dt=!1,!1}};function pt(e,t){const i=e.indexOf("?");if(i<0)return`${e}?${new URLSearchParams(t).toString()}`;const n=new URLSearchParams(e.slice(i));for(const e in t)n.set(e,t[e]);return`${e.slice(0,i)}?${n.toString()}`}function mt(e,t={persistentParams:[]}){const i=e.indexOf("?");if(i<0)return e;const n=new URLSearchParams,r=new URLSearchParams(e.slice(i));for(const e of t.persistentParams){const t=r.get(e);t&&n.set(e,t)}const s=n.toString();return`${e.slice(0,i)}${s.length>0?`?${s}`:""}`}const gt="mapbox-tiles";let _t=500,yt=50;const vt=["language","worldview","jobid"];let xt,bt;function wt(){try{return caches}catch(e){}}function St(){const e=wt();e&&null==xt&&(xt=e.open(gt))}let Tt=1/0;const kt={supported:!1,testSupport:function(e){!Ct&&At&&(Dt?Et(e):Mt=e)}};let Mt,At,Ct=!1,Dt=!1;const Lt="undefined"!=typeof self?self:{};function Et(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,At),e.isContextLost())return;kt.supported=!0}catch(e){}e.deleteTexture(t),Ct=!0}Lt.document&&(At=Lt.document.createElement("img"),At.onload=function(){Mt&&Et(Mt),Mt=null,Dt=!0},At.onerror=function(){Ct=!0,Mt=null},At.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const It={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(It);class Pt extends Error{constructor(e,t,i){401===t&&rt(i)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=i}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const Rt=Xe()?()=>self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,Ot=function(e,t){if(!(/^file:/.test(i=e.url)||/^file:/.test(Rt())&&!/^\w+:/.test(i))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(e,t){const i=new AbortController,n=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:Rt(),referrerPolicy:e.referrerPolicy,signal:i.signal});let r=!1,s=!1;const o=(a=n.url).indexOf("sku=")>0&&rt(a);var a;"json"===e.type&&n.headers.set("Accept","application/json");const l=(i,r,a)=>{if(s)return;if(i&&"SecurityError"!==i.message&&We(i.toString()),r&&a)return c(r);const l=Date.now();fetch(n).then(i=>{if(i.ok){const e=o?i.clone():null;return c(i,e,l)}return t(new Pt(i.statusText,i.status,e.url))}).catch(i=>{"AbortError"!==i.name&&t(new Error(`${i.message} ${e.url}`))})},c=(i,o,a)=>{("arrayBuffer"===e.type?i.arrayBuffer():"json"===e.type?i.json():i.text()).then(e=>{s||(o&&a&&function(e,t,i){if(St(),null==xt)return;const n=qe(t.headers.get("Cache-Control")||"");if(n["no-store"])return;const r={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach((e,t)=>r.headers.set(t,e)),n["max-age"]&&r.headers.set("Expires",new Date(i+1e3*n["max-age"]).toUTCString());const s=r.headers.get("Expires");if(!s)return;if(new Date(s).getTime()-i<42e4)return;let o=mt(e.url,{persistentParams:vt});if(206===t.status){const t=e.headers.get("Range");if(!t)return;r.status=200,o=pt(o,{range:t})}!function(e,t){if(void 0===bt)try{new Response(new ReadableStream),bt=!0}catch(e){bt=!1}bt?t(e.body):e.blob().then(t).catch(e=>We(e.message))}(t,e=>{const i=new Response(200!==(n=t.status)&&404!==n&&[101,103,204,205,304].includes(n)?null:e,r);var n;St(),null!=xt&&xt.then(e=>e.put(o,i)).catch(e=>We(e.message))})}(n,o,a),r=!0,t(null,e,i.headers.get("Cache-Control"),i.headers.get("Expires")))}).catch(e=>{s||t(new Error(e.message))})};return o?function(e,t){if(St(),null==xt)return t(null);xt.then(i=>{let n=mt(e.url,{persistentParams:vt});const r=e.headers.get("Range");r&&(n=pt(n,{range:r})),i.match(n).then(e=>{const r=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),i=qe(e.headers.get("Cache-Control")||"");return Number(t)>Date.now()&&!i["no-cache"]}(e);i.delete(n).catch(t),r&&i.put(n,e.clone()).catch(t),t(null,e,r)}).catch(t)}).catch(t)}(n,l):l(null,null),{cancel:()=>{s=!0,r||i.abort()}}}(e,t);if(Xe(self)&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var i;return function(e,t){const i=new XMLHttpRequest;i.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(i.responseType="arraybuffer");for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===e.credentials,i.onerror=()=>{t(new Error(i.statusText))},i.onload=()=>{if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let n=i.response;if("json"===e.type)try{n=JSON.parse(i.response)}catch(e){return t(e)}t(null,n,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else t(new Pt(i.statusText,i.status,e.url))},i.send(e.body),{cancel:()=>i.abort()}}(e,t)},zt=function(e,t){return Ot(Re(e,{type:"arrayBuffer"}),t)};function Ft(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}const Nt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let Yt,Bt;Yt=[],Bt=0;const Ht=function(e,t){if(kt.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),Bt>=nt.MAX_PARALLEL_IMAGE_REQUESTS){const i={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return Yt.push(i),i}Bt++;let i=!1;const n=()=>{if(!i)for(i=!0,Bt--;Yt.length&&Bt<nt.MAX_PARALLEL_IMAGE_REQUESTS;){const e=Yt.shift(),{requestParameters:t,callback:i,cancelled:n}=e;n||(e.cancel=Ht(t,i).cancel)}},r=zt(e,(e,i,r,s)=>{n(),e?t(e):i&&(self.createImageBitmap?function(e,t){const i=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(i).then(e=>{t(null,e)}).catch(e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(i,(e,i)=>t(e,i,r,s)):function(e,t){const i=new Image;i.onload=()=>{t(null,i),URL.revokeObjectURL(i.src),i.onload=null,requestAnimationFrame(()=>{i.src=Nt})},i.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const n=new Blob([new Uint8Array(e)],{type:"image/png"});i.src=e.byteLength?URL.createObjectURL(n):Nt}(i,(e,i)=>t(e,i,r,s)))});return{cancel:()=>{r.cancel(),n()}}};var jt,Vt,Wt,Ut={exports:{}},$t={exports:{}},Gt={exports:{}},Xt=function(){if(Wt)return Ut.exports;Wt=1;var e=(jt||(jt=1,$t.exports=function(e,t){var i,n,r,s,o,a,l,c;for(n=e.length-(i=3&e.length),r=t,o=3432918353,a=461845907,c=0;c<n;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,r=27492+(65535&(s=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(s>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=e.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0}),$t.exports),t=(Vt||(Vt=1,Gt.exports=function(e,t){for(var i,n=e.length,r=t^n,s=0;n>=4;)i=1540483477*(65535&(i=255&e.charCodeAt(s)|(255&e.charCodeAt(++s))<<8|(255&e.charCodeAt(++s))<<16|(255&e.charCodeAt(++s))<<24))+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++s;switch(n){case 3:r^=(255&e.charCodeAt(s+2))<<16;case 2:r^=(255&e.charCodeAt(s+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(s)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}),Gt.exports);return Ut.exports=e,Ut.exports.murmur3=e,Ut.exports.murmur2=t,Ut.exports}(),qt=_e(Xt);class Zt{constructor(e,...t){Re(this,t[0]||{}),this.type=e}}class Jt extends Zt{constructor(e,t={}){super("error",Re({error:e},t))}}function Kt(e,t,i){i[e]&&-1!==i[e].indexOf(t)||(i[e]=i[e]||[],i[e].push(t))}function Qt(e,t,i){if(i&&i[e]){const n=i[e].indexOf(t);-1!==n&&i[e].splice(n,1)}}class ei{on(e,t){return this._listeners=this._listeners||{},Kt(e,t,this._listeners),this}off(e,t){return Qt(e,t,this._listeners),Qt(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},Kt(e,t,this._oneTimeListeners),this):new Promise(t=>{this.once(e,t)})}fire(e,t){const i="string"==typeof e?new Zt(e,t):e,n=i.type;if(this.listens(n)){i.target=this;const e=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const t of e)t.call(this,i);const t=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const e of t)Qt(n,e,this._oneTimeListeners),e.call(this,i);const r=this._eventedParent;r&&(Re(i,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),r.fire(i))}else i instanceof Jt&&console.error(i.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}class ti{constructor(e){"string"==typeof e?this.name=e:(this.name=e.name,this.iconsetId=e.iconsetId)}static from(e){return new ti(e)}static toString(e){return e.iconsetId?`${e.name}${e.iconsetId}`:e.name}static parse(e){const[t,i]=e.split("");return new ti({name:t,iconsetId:i})}static isEqual(e,t){return e.name===t.name&&e.iconsetId===t.iconsetId}toString(){return ti.toString(this)}serialize(){return{name:this.name,iconsetId:this.iconsetId}}}var ii,ni={},ri=function(){if(ii)return ni;ii=1;var e={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function t(e){return(e=Math.round(e))<0?0:e>255?255:e}function i(e){return t("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function n(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function r(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}try{ni.parseCSSColor=function(s){var o,a=s.replace(/ /g,"").toLowerCase();if(a in e)return e[a].slice();if("#"===a[0])return 4===a.length?(o=parseInt(a.substr(1),16))>=0&&o<=4095?[(3840&o)>>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,1]:null:7===a.length&&(o=parseInt(a.substr(1),16))>=0&&o<=16777215?[(16711680&o)>>16,(65280&o)>>8,255&o,1]:null;var l=a.indexOf("("),c=a.indexOf(")");if(-1!==l&&c+1===a.length){var h=a.substr(0,l),d=a.substr(l+1,c-(l+1)).split(","),u=1;switch(h){case"rgba":if(4!==d.length)return null;u=n(d.pop());case"rgb":return 3!==d.length?null:[i(d[0]),i(d[1]),i(d[2]),u];case"hsla":if(4!==d.length)return null;u=n(d.pop());case"hsl":if(3!==d.length)return null;var f=(parseFloat(d[0])%360+360)%360/360,p=n(d[1]),m=n(d[2]),g=m<=.5?m*(p+1):m+p-m*p,_=2*m-g;return[t(255*r(_,g,f+1/3)),t(255*r(_,g,f)),t(255*r(_,g,f-1/3)),u];default:return null}}return null}}catch(e){}return ni}();class si{constructor(e,t,i,n=1){this.r=e,this.g=t,this.b=i,this.a=n}static parse(e){if(!e)return;if(e instanceof si)return e;if("string"!=typeof e)return;const t=ri.parseCSSColor(e);return t?new si(t[0]/255,t[1]/255,t[2]/255,t[3]):void 0}toString(){const[e,t,i,n]=[this.r,this.g,this.b,this.a];return`rgba(${Math.round(255*e)},${Math.round(255*t)},${Math.round(255*i)},${n})`}toNonPremultipliedRenderColor(e){const{r:t,g:i,b:n,a:r}=this;return new ai(e,t,i,n,r)}toPremultipliedRenderColor(e){const{r:t,g:i,b:n,a:r}=this;return new li(e,t*r,i*r,n*r,r)}clone(){return new si(this.r,this.g,this.b,this.a)}}class oi{constructor(e,t,i,n,r,s=!1){if(this.premultiplied=!1,this.premultiplied=s,e){const s=e.image.height,o=s*s;this.premultiplied?(t=0===r?0:t/r*(s-1),i=0===r?0:i/r*(s-1),n=0===r?0:n/r*(s-1)):(t*=s-1,i*=s-1,n*=s-1);const a=Math.floor(t),l=Math.floor(i),c=Math.floor(n),h=Math.ceil(t),d=Math.ceil(i),u=Math.ceil(n),f=t-a,p=i-l,m=n-c,g=e.image.data,_=4*(a+l*o+c*s),y=4*(a+l*o+u*s),v=4*(a+d*o+c*s),x=4*(a+d*o+u*s),b=4*(h+l*o+c*s),w=4*(h+l*o+u*s),S=4*(h+d*o+c*s),T=4*(h+d*o+u*s);if(_<0||T>=g.length)throw new Error("out of range");this.r=ci(ci(ci(g[_],g[y],m),ci(g[v],g[x],m),p),ci(ci(g[b],g[w],m),ci(g[S],g[T],m),p),f)/255*(this.premultiplied?r:1),this.g=ci(ci(ci(g[_+1],g[y+1],m),ci(g[v+1],g[x+1],m),p),ci(ci(g[b+1],g[w+1],m),ci(g[S+1],g[T+1],m),p),f)/255*(this.premultiplied?r:1),this.b=ci(ci(ci(g[_+2],g[y+2],m),ci(g[v+2],g[x+2],m),p),ci(ci(g[b+2],g[w+2],m),ci(g[S+2],g[T+2],m),p),f)/255*(this.premultiplied?r:1),this.a=r}else this.r=t,this.g=i,this.b=n,this.a=r}toArray(){const{r:e,g:t,b:i,a:n}=this;return[255*e,255*t,255*i,n]}toHslaArray(){let{r:e,g:t,b:i,a:n}=this;if(this.premultiplied){if(0===n)return[0,0,0,0];e/=n,t/=n,i/=n}const r=Math.min(Math.max(e,0),1),s=Math.min(Math.max(t,0),1),o=Math.min(Math.max(i,0),1),a=Math.min(r,s,o),l=Math.max(r,s,o),c=(a+l)/2;if(a===l)return[0,0,100*c,n];const h=l-a,d=c>.5?h/(2-l-a):h/(l+a);let u=0;return l===r?u=(s-o)/h+(s<o?6:0):l===s?u=(o-r)/h+2:l===o&&(u=(r-s)/h+4),u*=60,[Math.min(Math.max(u,0),360),Math.min(Math.max(100*d,0),100),Math.min(Math.max(100*c,0),100),n]}toArray01(){const{r:e,g:t,b:i,a:n}=this;return[e,t,i,n]}toArray01Scaled(e){const{r:t,g:i,b:n}=this;return[t*e,i*e,n*e]}toArray01Linear(){const{r:e,g:t,b:i,a:n}=this;return[Math.pow(e,2.2),Math.pow(t,2.2),Math.pow(i,2.2),n]}}class ai extends oi{constructor(e,t,i,n,r){super(e,t,i,n,r,!1)}}class li extends oi{constructor(e,t,i,n,r){super(e,t,i,n,r,!0)}}function ci(e,t,i){return e*(1-i)+t*i}function hi(e,t,i){return e.map((e,n)=>ci(e,t[n],i))}si.black=new si(0,0,0,1),si.white=new si(1,1,1,1),si.transparent=new si(0,0,0,0),si.red=new si(1,0,0,1),si.blue=new si(0,0,1,1);var di=Object.freeze({__proto__:null,array:hi,color:function(e,t,i){return new si(ci(e.r,t.r,i),ci(e.g,t.g,i),ci(e.b,t.b,i),ci(e.a,t.a,i))},number:ci});function ui(e,...t){for(const i of t)for(const t in i)e[t]=i[t];return e}class fi extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class pi{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,i]of t)this.bindings[e]=i}concat(e){return new pi(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const mi={kind:"null"},gi={kind:"number"},_i={kind:"string"},yi={kind:"boolean"},vi={kind:"color"},xi={kind:"object"},bi={kind:"value"},wi={kind:"collator"},Si={kind:"formatted"},Ti={kind:"resolvedImage"};function ki(e,t){return{kind:"array",itemType:e,N:t}}function Mi(e){if("array"===e.kind){const t=Mi(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Ai=[mi,gi,_i,yi,vi,Si,xi,ki(bi),Ti];function Ci(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Ci(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of Ai)if(!Ci(e,t))return null}return`Expected ${Mi(e)} but found ${Mi(t)} instead.`}function Di(e,t){return t.some(t=>t.kind===e.kind)}function Li(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function Ei(e,t){return"array"===e.kind&&"array"===t.kind?e.N===t.N&&Ei(e.itemType,t.itemType):e.kind===t.kind}class Ii{constructor(e,t,i){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Pi{constructor(e,t,i,n,r){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=i,this.fontStack=n,this.textColor=r}}class Ri{constructor(e){this.sections=e}static fromString(e){return new Ri([new Pi(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||!!e.image&&e.image.hasPrimary())}static factory(e){return e instanceof Ri?e:Ri.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){const i=t.image.getPrimary().id.toString();e.push(["image",i]);continue}e.push(t.text);const i={};t.fontStack&&(i["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(i["font-scale"]=t.scale),t.textColor&&(i["text-color"]=["rgba"].concat(t.textColor.toNonPremultipliedRenderColor(null).toArray())),e.push(i)}return e}}class Oi{constructor(e,t={}){if(this.id=ti.from(e),this.options=Object.assign({},t),t.transform){const{a:e,b:i,c:n,d:r,e:s,f:o}=t.transform;this.options.transform=new DOMMatrix([e,i,n,r,s,o])}else this.options.transform=new DOMMatrix([1,0,0,1,0,0])}toString(){const{a:e,b:t,c:i,d:n,e:r,f:s}=this.options.transform;return JSON.stringify({name:this.id.name,iconsetId:this.id.iconsetId,params:this.options.params,transform:{a:e,b:t,c:i,d:n,e:r,f:s}})}static parse(e){let t,i,n,r;try{({name:t,iconsetId:i,params:n,transform:r}=JSON.parse(e)||{})}catch(e){return null}if(!t)return null;const{a:s,b:o,c:a,d:l,e:c,f:h}=r||{};return new Oi({name:t,iconsetId:i},{params:n,transform:new DOMMatrix([s,o,a,l,c,h])})}scaleSelf(e,t){return this.options.transform.scaleSelf(e,t),this}}class zi{constructor(e,t,i,n,r=!1){this.primaryId=ti.from(e),this.primaryOptions=t,i&&(this.secondaryId=ti.from(i)),this.secondaryOptions=n,this.available=r}toString(){return this.primaryId&&this.secondaryId?`[${this.primaryId.name},${this.secondaryId.name}]`:this.primaryId.name}hasPrimary(){return!!this.primaryId}getPrimary(){return new Oi(this.primaryId,this.primaryOptions)}hasSecondary(){return!!this.secondaryId}getSecondary(){return this.secondaryId?new Oi(this.secondaryId,this.secondaryOptions):null}static from(e){return"string"==typeof e?zi.build({name:e}):e}static build(e,t,i,n){return!e||"object"==typeof e&&!("name"in e)?null:new zi(e,i,t,n)}}function Fi(e,t,i,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,i,n]:[e,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ni(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof si)return!0;if(e instanceof Ii)return!0;if(e instanceof Ri)return!0;if(e instanceof zi)return!0;if(Array.isArray(e)){for(const t of e)if(!Ni(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!Ni(e[t]))return!1;return!0}return!1}function Yi(e){if(null===e)return mi;if("string"==typeof e)return _i;if("boolean"==typeof e)return yi;if("number"==typeof e)return gi;if(e instanceof si)return vi;if(e instanceof Ii)return wi;if(e instanceof Ri)return Si;if(e instanceof zi)return Ti;if(Array.isArray(e)){const t=e.length;let i;for(const t of e){const e=Yi(t);if(i){if(i===e)continue;i=bi;break}i=e}return ki(i||bi,t)}return xi}function Bi(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Ri||e instanceof zi||e instanceof si?e.toString():JSON.stringify(e)}class Hi{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Ni(e[1]))return t.error("invalid value");const i=e[1];let n=Yi(i);const r=t.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new Hi(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof si?["rgba"].concat(this.value.toNonPremultipliedRenderColor(null).toArray()):this.value instanceof Ri?this.value.serialize():this.value}}class ji{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Vi={string:_i,number:gi,boolean:yi,object:xi};class Wi{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i,n=1;const r=e[0];if("array"===r){let r,s;if(e.length>2){const i=e[1];if("string"!=typeof i||!(i in Vi)||"object"===i)return t.error('The item type argument of "array" must be one of string, number, boolean',1);r=Vi[i],n++}else r=bi;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);s=e[2],n++}i=ki(r,s)}else i=Vi[r];const s=[];for(;n<e.length;n++){const i=t.parse(e[n],n,bi);if(!i)return null;s.push(i)}return new Wi(i,s)}evaluate(e){for(let t=0;t<this.args.length;t++){const i=this.args[t].evaluate(e);if(!Ci(this.type,Yi(i)))return i;if(t===this.args.length-1)throw new ji(`The expression ${JSON.stringify(this.args[t].serialize())} evaluated to ${Mi(Yi(i))} but was expected to be of type ${Mi(this.type)}.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const i=e.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){t.push(i.kind);const n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map(e=>e.serialize()))}}class Ui{constructor(e){this.type=Si,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[1];if(!Array.isArray(i)&&"object"==typeof i)return t.error("First argument must be an image or text section.");const n=[];let r=!1;for(let i=1;i<=e.length-1;++i){const s=e[i];if(r&&"object"==typeof s&&!Array.isArray(s)){r=!1;let e=null;if(s["font-scale"]&&(e=t.parseObjectValue(s["font-scale"],i,"font-scale",gi),!e))return null;let o=null;if(s["text-font"]&&(o=t.parseObjectValue(s["text-font"],i,"text-font",ki(_i)),!o))return null;let a=null;if(s["text-color"]&&(a=t.parseObjectValue(s["text-color"],i,"text-color",vi),!a))return null;const l=n[n.length-1];l.scale=e,l.font=o,l.textColor=a}else{const s=t.parse(e[i],i,bi);if(!s)return null;const o=s.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:s,scale:null,font:null,textColor:null})}}return new Ui(n)}evaluate(e){return new Ri(this.sections.map(t=>{const i=t.content.evaluate(e);return Ei(Yi(i),Ti)?new Pi("",i,null,null,null):new Pi(Bi(i),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const i={};t.scale&&(i["font-scale"]=t.scale.serialize()),t.font&&(i["text-font"]=t.font.serialize()),t.textColor&&(i["text-color"]=t.textColor.serialize()),e.push(i)}return e}}class $i{constructor(e,t,i,n){this._imageWarnHistory={},this.type=Ti,this.namePrimary=e,this.nameSecondary=t,i&&(this.paramsPrimary=i.params,this.iconsetIdPrimary=i.iconset?i.iconset.id:void 0),n&&(this.paramsSecondary=n.params,this.iconsetIdSecondary=n.iconset?n.iconset.id:void 0)}static parse(e,t){if(e.length<2)return t.error("Expected two or more arguments.");let i=1;const n=[];function r(){if(i<e.length){const r=t.parse(e[i],i++,_i);return r?(n.push({image:r,options:{}}),!0):(t.error(n.length?"Secondary image variant is not a string.":"No image name provided."),!1)}return!0}function s(){if(i<e.length){const s=e[i];if(null===(r=s)||"object"!=typeof r||Array.isArray(r))return!0;const o=s.params,a=s.iconset,l=t.concat(i);if(!o&&!a)return i++,!0;if(o){if("object"!=typeof o||o.constructor!==Object)return l.error('Image options "params" should be an object'),!1;const e={},t=l.concat(void 0,"params");for(const i in o){if(!i)return t.error("Image parameter name should be non-empty"),!1;const n=t.concat(void 0,i).parse(o[i],void 0,vi,void 0,{typeAnnotation:"coerce"});if(!n)return!1;e[i]=n}n[n.length-1].options.params=e}if(a){if("object"!=typeof a||a.constructor!==Object)return l.error('Image options "iconset" should be an object'),!1;if(!a.id)return l.error('Image options "iconset" should have an "id" property'),!1;n[n.length-1].options.iconset=a}return i++,!0}var r;return!0}for(let e=0;e<2;e++)if(!r()||!s())return;return new $i(n[0].image,n[1]?n[1].image:void 0,n[0].options,n[1]?n[1].options:void 0)}evaluateParams(e,t){const i={};if(t){for(const n in t)if(t[n])try{i[n]=t[n].evaluate(e)}catch(e){continue}if(0!==Object.keys(i).length)return{params:i}}}evaluate(e){const t={name:this.namePrimary.evaluate(e),iconsetId:this.iconsetIdPrimary},i=this.nameSecondary?{name:this.nameSecondary.evaluate(e),iconsetId:this.iconsetIdSecondary}:void 0,n=zi.build(t,i,this.paramsPrimary?this.evaluateParams(e,this.paramsPrimary):void 0,this.paramsSecondary?this.evaluateParams(e,this.paramsSecondary):void 0);if(n&&e.availableImages){const t=n.getPrimary().id;if(n.available=e.availableImages.some(e=>ti.isEqual(e,t)),n.available){const t=n.getSecondary()?n.getSecondary().id:null;t&&(n.available=e.availableImages.some(e=>ti.isEqual(e,t)))}}return n}eachChild(e){if(e(this.namePrimary),this.paramsPrimary)for(const t in this.paramsPrimary)this.paramsPrimary[t]&&e(this.paramsPrimary[t]);if(this.nameSecondary&&(e(this.nameSecondary),this.paramsSecondary))for(const t in this.paramsSecondary)this.paramsSecondary[t]&&e(this.paramsSecondary[t])}outputDefined(){return!1}serializeOptions(e,t){const i={};if(t&&(i.iconset={id:t}),e){i.params={};for(const t in e)e[t]&&(i.params[t]=e[t].serialize())}return Object.keys(i).length>0?i:void 0}serialize(){const e=["image",this.namePrimary.serialize()];if(this.paramsPrimary||this.iconsetIdPrimary){const t=this.serializeOptions(this.paramsPrimary,this.iconsetIdPrimary);t&&e.push(t)}if(this.nameSecondary&&(e.push(this.nameSecondary.serialize()),this.paramsSecondary||this.iconsetIdSecondary)){const t=this.serializeOptions(this.paramsSecondary,this.iconsetIdSecondary);t&&e.push(t)}return e}}function Gi(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}const Xi={"to-boolean":yi,"to-color":vi,"to-number":gi,"to-string":_i};class qi{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[0],n=[];let r=mi;if("to-array"===i){if(!Array.isArray(e[1]))return null;const i=e[1].length;if(t.expectedType){if("array"!==t.expectedType.kind)return t.error(`Expected ${t.expectedType.kind} but found array.`);r=ki(t.expectedType.itemType,i)}else{if(!(i>0&&Ni(e[1][0])))return null;r=ki(Yi(e[1][0]),i)}for(let s=0;s<i;s++){const i=e[1][s];let o;if("array"===Gi(i))o=t.parse(i,void 0,r.itemType);else{const e=Gi(i);if(e!==r.itemType.kind)return t.error(`Expected ${r.itemType.kind} but found ${e}.`);o=t.registry.literal.parse(["literal",void 0===i?null:i],t)}if(!o)return null;n.push(o)}}else{if(("to-boolean"===i||"to-string"===i)&&2!==e.length)return t.error("Expected one argument.");r=Xi[i];for(let i=1;i<e.length;i++){const r=t.parse(e[i],i,bi);if(!r)return null;n.push(r)}}return new qi(r,n)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,i;for(const n of this.args){if(t=n.evaluate(e),i=null,t instanceof si)return t;if("string"==typeof t){const i=e.parseColor(t);if(i)return i}else if(Array.isArray(t)&&(i=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Fi(t[0],t[1],t[2],t[3]),!i))return new si(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new ji(i||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const i of this.args){if(t=i.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new ji(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?Ri.fromString(Bi(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?zi.build(Bi(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map(t=>t.evaluate(e)):Bi(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if("formatted"===this.type.kind)return new Ui([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new $i(this.args[0]).serialize();const e="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild(t=>{e.push(t.serialize())}),e}}const Zi=["Unknown","Point","LineString","Polygon"];class Ji{constructor(e,t){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=t}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Zi[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*t-e[0])+this.featureDistanceData.bearing[1]*(n*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=si.parse(e)),t}getConfig(e){return this.options?this.options.get(e):null}}class Ki{constructor(e,t,i,n,r){this.name=e,this.type=t,this._evaluate=i,this.args=n,this._overloadIndex=r}evaluate(e){if(!this._evaluate){const e=Ki.definitions[this.name];this._evaluate=Array.isArray(e)?e[2]:e.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,t){const i=e[0],n=Ki.definitions[i];if(!n)return t.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=[];let a=null,l=-1;for(const[n,c]of s){if(Array.isArray(n)&&n.length!==e.length-1)continue;o.push(n),l++,a=new yr(t.registry,t.path,null,t.scope,void 0,t._scope,t.options);const s=[];let h=!1;for(let t=1;t<e.length;t++){const i=e[t],r=Array.isArray(n)?n[t-1]:n.type,o=a.parse(i,1+s.length,r);if(!o){h=!0;break}s.push(o)}if(!h)if(Array.isArray(n)&&n.length!==s.length)a.error(`Expected ${n.length} arguments, but found ${s.length} instead.`);else{for(let e=0;e<s.length;e++){const t=Array.isArray(n)?n[e]:n.type,i=s[e];a.concat(e+1).checkSubtype(t,i.type)}if(0===a.errors.length)return new Ki(i,r,c,s,l)}}if(1===o.length)t.errors.push(...a.errors);else{const i=(o.length?o:s.map(([e])=>e)).map(Qi).join(" | "),n=[];for(let i=1;i<e.length;i++){const r=t.parse(e[i],1+n.length);if(!r)return null;n.push(Mi(r.type))}t.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Ki.definitions=t;for(const i in t)e[i]=Ki}}function Qi(e){return Array.isArray(e)?`(${e.map(Mi).join(", ")})`:`(${Mi(e.type)}...)`}class en{constructor(e,t,i){this.type=wi,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const i=e[1];if("object"!=typeof i||Array.isArray(i))return t.error("Collator options argument must be an object.");const n=void 0===i["case-sensitive"]?t.parse(!1,1,yi):t.parseObjectValue(i["case-sensitive"],1,"case-sensitive",yi);if(!n)return null;const r=void 0===i["diacritic-sensitive"]?t.parse(!1,1,yi):t.parseObjectValue(i["diacritic-sensitive"],1,"diacritic-sensitive",yi);if(!r)return null;let s=null;return i.locale&&(s=t.parseObjectValue(i.locale,1,"locale",_i),!s)?null:new en(n,r,s)}evaluate(e){return new Ii(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}function tn(e,t,i=0,n=e.length-1,r=rn){for(;n>i;){if(n-i>600){const s=n-i+1,o=t-i+1,a=Math.log(s),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(s-l)/s)*(o-s/2<0?-1:1);tn(e,t,Math.max(i,Math.floor(t-o*l/s+c)),Math.min(n,Math.floor(t+(s-o)*l/s+c)),r)}const s=e[t];let o=i,a=n;for(nn(e,i,t),r(e[n],s)>0&&nn(e,i,n);o<a;){for(nn(e,o,a),o++,a--;r(e[o],s)<0;)o++;for(;r(e[a],s)>0;)a--}0===r(e[i],s)?nn(e,i,a):(a++,nn(e,a,n)),a<=t&&(i=a+1),t<=a&&(n=a-1)}}function nn(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function rn(e,t){return e<t?-1:e>t?1:0}function sn(e){let t=0;for(let i,n,r=0,s=e.length,o=s-1;r<s;o=r++)i=e[r],n=e[o],t+=(n.x-i.x)*(i.y+n.y);return t}function on(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function an(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function ln(e,t,i){const n=e[0]-t[0],r=e[1]-t[1],s=e[0]-i[0],o=e[1]-i[1];return n*o-s*r==0&&n*s<=0&&r*o<=0}function cn(e,t,i=!1){let n=!1;for(let a=0,l=t.length;a<l;a++){const l=t[a];for(let t=0,a=l.length,c=a-1;t<a;c=t++){const a=l[c],h=l[t];if(ln(e,a,h))return i;(s=a)[1]>(r=e)[1]!=(o=h)[1]>r[1]&&r[0]<(o[0]-s[0])*(r[1]-s[1])/(o[1]-s[1])+s[0]&&(n=!n)}}var r,s,o;return n}function hn(e,t,i,n){const r=n[0]-i[0],s=n[1]-i[1],o=(e[0]-i[0])*s-r*(e[1]-i[1]),a=(t[0]-i[0])*s-r*(t[1]-i[1]);return o>0&&a<0||o<0&&a>0}function dn(e,t,i,n){return 0!=(r=[n[0]-i[0],n[1]-i[1]])[0]*(s=[t[0]-e[0],t[1]-e[1]])[1]-r[1]*s[0]&&!(!hn(e,t,i,n)||!hn(i,n,e,t));var r,s}function un(e){const t=new xe(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),i=new xe(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const n of e[0])t.x>n.x&&(t.x=n.x),t.y>n.y&&(t.y=n.y),i.x<n.x&&(i.x=n.x),i.y<n.y&&(i.y=n.y);return{min:t,max:i}}const fn=8192;function pn(e,t){const i=(180+e[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,r=Math.pow(2,t.z);return[Math.round(i*r*fn),Math.round(n*r*fn)]}function mn(e,t){for(let i=0;i<t.length;i++)if(cn(e,t[i]))return!0;return!1}function gn(e,t,i){for(const n of i)for(let i=0,r=n.length,s=r-1;i<r;s=i++)if(dn(e,t,n[s],n[i]))return!0;return!1}function _n(e,t){for(let i=0;i<e.length;++i)if(!cn(e[i],t))return!1;for(let i=0;i<e.length-1;++i)if(gn(e[i],e[i+1],t))return!1;return!0}function yn(e,t){for(let i=0;i<t.length;i++)if(_n(e,t[i]))return!0;return!1}function vn(e,t,i){const n=[];for(let r=0;r<e.length;r++){const s=[];for(let n=0;n<e[r].length;n++){const o=pn(e[r][n],i);on(t,o),s.push(o)}n.push(s)}return n}function xn(e,t,i){const n=[];for(let r=0;r<e.length;r++){const s=vn(e[r],t,i);n.push(s)}return n}function bn(e,t,i,n){if(e[0]<i[0]||e[0]>i[2]){const t=.5*n;let r=e[0]-i[0]>t?-n:i[0]-e[0]>t?n:0;0===r&&(r=e[0]-i[2]>t?-n:i[2]-e[0]>t?n:0),e[0]+=r}on(t,e)}function wn(e,t,i,n){const r=Math.pow(2,n.z)*fn,s=[n.x*fn,n.y*fn],o=[];if(!e)return o;for(const n of e)for(const e of n){const n=[e.x+s[0],e.y+s[1]];bn(n,t,i,r),o.push(n)}return o}function Sn(e,t,i,n){const r=Math.pow(2,n.z)*fn,s=[n.x*fn,n.y*fn],o=[];if(!e)return o;for(const i of e){const e=[];for(const n of i){const i=[n.x+s[0],n.y+s[1]];on(t,i),e.push(i)}o.push(e)}if(t[2]-t[0]<=r/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const e of o)for(const n of e)bn(n,t,i,r)}var a;return o}class Tn{constructor(e,t){this.type=yi,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Ni(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const i=t.features[e].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Tn(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new Tn(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new Tn(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=e.canonicalID();if(!r)return!1;if("Polygon"===t.type){const s=vn(t.coordinates,n,r),o=wn(e.geometry(),i,n,r);if(!an(i,n))return!1;for(const e of o)if(!cn(e,s))return!1}if("MultiPolygon"===t.type){const s=xn(t.coordinates,n,r),o=wn(e.geometry(),i,n,r);if(!an(i,n))return!1;for(const e of o)if(!mn(e,s))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=e.canonicalID();if(!r)return!1;if("Polygon"===t.type){const s=vn(t.coordinates,n,r),o=Sn(e.geometry(),i,n,r);if(!an(i,n))return!1;for(const e of o)if(!_n(e,s))return!1}if("MultiPolygon"===t.type){const s=xn(t.coordinates,n,r),o=Sn(e.geometry(),i,n,r);if(!an(i,n))return!1;for(const e of o)if(!yn(e,s))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}const kn={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},Mn=1/298.257223563,An=Mn*(2-Mn),Cn=Math.PI/180;class Dn{static fromTile(e,t,i){const n=Math.PI*(1-2*(e+.5)/Math.pow(2,t)),r=Math.atan(.5*(Math.exp(n)-Math.exp(-n)))/Cn;return new Dn(r,i)}static get units(){return kn}constructor(e,t){if(void 0===e)throw new Error("No latitude given.");if(t&&!kn[t])throw new Error(`Unknown unit ${t}. Use one of: ${Object.keys(kn).join(", ")}`);const i=6378.137*Cn*(t?kn[t]:1),n=Math.cos(e*Cn),r=1/(1-An*(1-n*n)),s=Math.sqrt(r);this.kx=i*s*n,this.ky=i*s*r*(1-An)}distance(e,t){const i=In(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(i*i+n*n)}bearing(e,t){const i=In(t[0]-e[0])*this.kx;return Math.atan2(i,(t[1]-e[1])*this.ky)/Cn}destination(e,t,i){const n=i*Cn;return this.offset(e,Math.sin(n)*t,Math.cos(n)*t)}offset(e,t,i){return[e[0]+t/this.kx,e[1]+i/this.ky]}lineDistance(e){let t=0;for(let i=0;i<e.length-1;i++)t+=this.distance(e[i],e[i+1]);return t}area(e){let t=0;for(let i=0;i<e.length;i++){const n=e[i];for(let e=0,r=n.length,s=r-1;e<r;s=e++)t+=In(n[e][0]-n[s][0])*(n[e][1]+n[s][1])*(i?-1:1)}return Math.abs(t)/2*this.kx*this.ky}along(e,t){let i=0;if(t<=0)return e[0];for(let n=0;n<e.length-1;n++){const r=e[n],s=e[n+1],o=this.distance(r,s);if(i+=o,i>t)return En(r,s,(t-(i-o))/o)}return e[e.length-1]}pointToSegmentDistance(e,t,i){let[n,r]=t,s=In(i[0]-n)*this.kx,o=(i[1]-r)*this.ky;if(0!==s||0!==o){const t=(In(e[0]-n)*this.kx*s+(e[1]-r)*this.ky*o)/(s*s+o*o);t>1?(n=i[0],r=i[1]):t>0&&(n+=s/this.kx*t,r+=o/this.ky*t)}return s=In(e[0]-n)*this.kx,o=(e[1]-r)*this.ky,Math.sqrt(s*s+o*o)}pointOnLine(e,t){let i=1/0,n=e[0][0],r=e[0][1],s=0,o=0;for(let a=0;a<e.length-1;a++){let l=e[a][0],c=e[a][1],h=In(e[a+1][0]-l)*this.kx,d=(e[a+1][1]-c)*this.ky,u=0;0===h&&0===d||(u=(In(t[0]-l)*this.kx*h+(t[1]-c)*this.ky*d)/(h*h+d*d),u>1?(l=e[a+1][0],c=e[a+1][1]):u>0&&(l+=h/this.kx*u,c+=d/this.ky*u)),h=In(t[0]-l)*this.kx,d=(t[1]-c)*this.ky;const f=h*h+d*d;f<i&&(i=f,n=l,r=c,s=a,o=u)}return{point:[n,r],index:s,t:Math.max(0,Math.min(1,o))}}lineSlice(e,t,i){let n=this.pointOnLine(i,e),r=this.pointOnLine(i,t);if(n.index>r.index||n.index===r.index&&n.t>r.t){const e=n;n=r,r=e}const s=[n.point],o=n.index+1,a=r.index;!Ln(i[o],s[0])&&o<=a&&s.push(i[o]);for(let e=o+1;e<=a;e++)s.push(i[e]);return Ln(i[a],r.point)||s.push(r.point),s}lineSliceAlong(e,t,i){let n=0;const r=[];for(let s=0;s<i.length-1;s++){const o=i[s],a=i[s+1],l=this.distance(o,a);if(n+=l,n>e&&0===r.length&&r.push(En(o,a,(e-(n-l))/l)),n>=t)return r.push(En(o,a,(t-(n-l))/l)),r;n>e&&r.push(a)}return r}bufferPoint(e,t){const i=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-i,e[0]+n,e[1]+i]}bufferBBox(e,t){const i=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-i,e[2]+n,e[3]+i]}insideBBox(e,t){return In(e[0]-t[0])>=0&&In(e[0]-t[2])<=0&&e[1]>=t[1]&&e[1]<=t[3]}}function Ln(e,t){return e[0]===t[0]&&e[1]===t[1]}function En(e,t,i){const n=In(t[0]-e[0]);return[e[0]+n*i,e[1]+(t[1]-e[1])*i]}function In(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}class Pn{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:i}=this,n=t[e];for(;e>0;){const r=e-1>>1,s=t[r];if(i(n,s)>=0)break;t[e]=s,e=r}t[e]=n}_down(e){const{data:t,compare:i}=this,n=this.length>>1,r=t[e];for(;e<n;){let n=1+(e<<1);const s=n+1;if(s<this.length&&i(t[s],t[n])<0&&(n=s),i(t[n],r)>=0)break;t[e]=t[n],e=n}t[e]=r}}var Rn=8192;function On(e,t){return t.dist-e.dist}function zn(e){const t=[1/0,1/0,-1/0,-1/0];if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function Fn(e){return e[1]-e[0]+1}function Nn(e,t){const i=e[1]>=e[0]&&e[1]<t;return i||console.warn("Distance Expression: Index is out of range"),i}function Yn(e,t){if(e[0]>e[1])return[null,null];const i=Fn(e);if(t){if(2===i)return[e,null];const t=Math.floor(i/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}{if(1===i)return[e,null];const t=Math.floor(i/2)-1;return[[e[0],e[0]+t],[e[0]+t+1,e[1]]]}}function Bn(e,t){const i=[1/0,1/0,-1/0,-1/0];if(!Nn(t,e.length))return i;for(let n=t[0];n<=t[1];++n)on(i,e[n]);return i}function Hn(e){const t=[1/0,1/0,-1/0,-1/0];for(let i=0;i<e.length;++i)for(let n=0;n<e[i].length;++n)on(t,e[i][n]);return t}function jn(e,t,i){if(zn(e)||zn(t))return NaN;let n=0,r=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(r=e[1]-t[3]),e[3]<t[1]&&(r=t[1]-e[3]),i.distance([0,0],[n,r])}function Vn(e){return 360*e-180}function Wn(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function Un(e,t){const i=Math.pow(2,t.z),n=(e.y/Rn+t.y)/i;return[Vn((e.x/Rn+t.x)/i),Wn(n)]}function $n(e,t){const i=[];for(let n=0;n<e.length;++n)i.push(Un(e[n],t));return i}function Gn(e,t,i){const n=i.pointOnLine(t,e).point;return i.distance(e,n)}function Xn(e,t,i,n,r){const s=i.slice(n[0],n[1]+1);let o=1/0;for(let i=t[0];i<=t[1];++i)if(0===(o=Math.min(o,Gn(e[i],s,r))))return 0;return o}function qn(e,t,i,n,r){const s=Math.min(r.pointToSegmentDistance(e,i,n),r.pointToSegmentDistance(t,i,n)),o=Math.min(r.pointToSegmentDistance(i,e,t),r.pointToSegmentDistance(n,e,t));return Math.min(s,o)}function Zn(e,t,i,n,r){if(!Nn(t,e.length)||!Nn(n,i.length))return NaN;let s=1/0;for(let o=t[0];o<t[1];++o)for(let t=n[0];t<n[1];++t){if(dn(e[o],e[o+1],i[t],i[t+1]))return 0;s=Math.min(s,qn(e[o],e[o+1],i[t],i[t+1],r))}return s}function Jn(e,t,i,n,r){if(!Nn(t,e.length)||!Nn(n,i.length))return NaN;let s=1/0;for(let o=t[0];o<=t[1];++o)for(let t=n[0];t<=n[1];++t)if(0===(s=Math.min(s,r.distance(e[o],i[t]))))return s;return s}function Kn(e,t,i){if(cn(e,t,!0))return 0;let n=1/0;for(const r of t){const t=r.length;if(t<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(r[0]!==r[t-1]&&0===(n=Math.min(n,i.pointToSegmentDistance(e,r[t-1],r[0]))))return n;if(0===(n=Math.min(n,Gn(e,r,i))))return n}return n}function Qn(e,t,i,n){if(!Nn(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(cn(e[n],i,!0))return 0;let r=1/0;for(let s=t[0];s<t[1];++s)for(const t of i)for(let i=0,o=t.length,a=o-1;i<o;a=i++){if(dn(e[s],e[s+1],t[a],t[i]))return 0;r=Math.min(r,qn(e[s],e[s+1],t[a],t[i],n))}return r}function er(e,t){for(const i of e)for(let e=0;e<=i.length-1;++e)if(cn(i[e],t,!0))return!0;return!1}function tr(e,t,i,n=1/0){const r=Hn(e),s=Hn(t);if(n!==1/0&&jn(r,s,i)>=n)return n;if(an(r,s)){if(er(e,t))return 0}else if(er(t,e))return 0;let o=n;for(const n of e)for(let e=0,r=n.length,s=r-1;e<r;s=e++)for(const r of t)for(let t=0,a=r.length,l=a-1;t<a;l=t++){if(dn(n[s],n[e],r[l],r[t]))return 0;o=Math.min(o,qn(n[s],n[e],r[l],r[t],i))}return o}function ir(e,t,i,n,r,s,o){if(null===s||null===o)return;const a=jn(Bn(n,s),Bn(r,o),i);a<t&&e.push({dist:a,range1:s,range2:o})}function nr(e,t,i,n,r=1/0){let s=Math.min(n.distance(e[0],i[0][0]),r);if(0===s)return s;const o=new Pn([{dist:0,range1:[0,e.length-1],range2:[0,0]}],On),a=t?50:100,l=Hn(i);for(;o.length;){const r=o.pop();if(r.dist>=s)continue;const c=r.range1;if(Fn(c)<=a){if(!Nn(c,e.length))return NaN;if(t){const t=Qn(e,c,i,n);if(0===(s=Math.min(s,t)))return s}else for(let t=c[0];t<=c[1];++t){const r=Kn(e[t],i,n);if(0===(s=Math.min(s,r)))return s}}else{const i=Yn(c,t);if(null!==i[0]){const t=jn(Bn(e,i[0]),l,n);t<s&&o.push({dist:t,range1:i[0],range2:[0,0]})}if(null!==i[1]){const t=jn(Bn(e,i[1]),l,n);t<s&&o.push({dist:t,range1:i[1],range2:[0,0]})}}}return s}function rr(e,t,i,n,r,s=1/0){let o=Math.min(s,r.distance(e[0],i[0]));if(0===o)return o;const a=new Pn([{dist:0,range1:[0,e.length-1],range2:[0,i.length-1]}],On),l=t?50:100,c=n?50:100;for(;a.length;){const s=a.pop();if(s.dist>=o)continue;const h=s.range1,d=s.range2;if(Fn(h)<=l&&Fn(d)<=c){if(!Nn(h,e.length)||!Nn(d,i.length))return NaN;if(t&&n?o=Math.min(o,Zn(e,h,i,d,r)):t||n?t&&!n?o=Math.min(o,Xn(i,d,e,h,r)):!t&&n&&(o=Math.min(o,Xn(e,h,i,d,r))):o=Math.min(o,Jn(e,h,i,d,r)),0===o)return o}else{const s=Yn(h,t),l=Yn(d,n);ir(a,o,r,e,i,s[0],l[0]),ir(a,o,r,e,i,s[0],l[1]),ir(a,o,r,e,i,s[1],l[0]),ir(a,o,r,e,i,s[1],l[1])}}return o}function sr(e,t,i,n,r=1/0){let s=r;const o=Bn(e,[0,e.length-1]);for(const r of i)if(!(s!==1/0&&jn(o,Bn(r,[0,r.length-1]),n)>=s)&&(s=Math.min(s,rr(e,t,r,!0,n,s)),0===s))return s;return s}function or(e,t,i,n,r=1/0){let s=r;const o=Bn(e,[0,e.length-1]);for(const r of i){if(s!==1/0&&jn(o,Hn(r),n)>=s)continue;const i=nr(e,t,r,n,s);if(isNaN(i))return i;if(0===(s=Math.min(s,i)))return s}return s}function ar(e){return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}class lr{constructor(e,t){this.type=gi,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(Ni(e[1])){const t=e[1];if("FeatureCollection"===t.type){for(let e=0;e<t.features.length;++e)if(ar(t.features[e].geometry.type))return new lr(t,t.features[e].geometry)}else if("Feature"===t.type){if(ar(t.geometry.type))return new lr(t,t.geometry)}else if(ar(t.type))return new lr(t,t)}return t.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(e){const t=e.geometry(),i=e.canonicalID();if(null!=t&&null!=i){if("Point"===e.geometryType())return function(e,t,i){const n=[];for(const i of e)for(const e of i)n.push(Un(e,t));const r=new Dn(n[0][1],"meters");return"Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type?rr(n,!1,"Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,r):"MultiLineString"===i.type?sr(n,!1,i.coordinates,r):"Polygon"===i.type||"MultiPolygon"===i.type?or(n,!1,"Polygon"===i.type?[i.coordinates]:i.coordinates,r):null}(t,i,this.geometries);if("LineString"===e.geometryType())return function(e,t,i){const n=[];for(const i of e){const e=[];for(const n of i)e.push(Un(n,t));n.push(e)}const r=new Dn(n[0][0][1],"meters");if("Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type)return sr("Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,n,r);if("MultiLineString"===i.type){let e=1/0;for(let t=0;t<i.coordinates.length;t++){const s=sr(i.coordinates[t],!0,n,r,e);if(isNaN(s))return s;if(0===(e=Math.min(e,s)))return e}return e}if("Polygon"===i.type||"MultiPolygon"===i.type){let e=1/0;for(let t=0;t<n.length;t++){const s=or(n[t],!0,"Polygon"===i.type?[i.coordinates]:i.coordinates,r,e);if(isNaN(s))return s;if(0===(e=Math.min(e,s)))return e}return e}return null}(t,i,this.geometries);if("Polygon"===e.geometryType())return function(e,t,i){const n=[];for(const i of function(e){const t=e.length;if(t<=1)return[e];const i=[];let n,r;for(let s=0;s<t;s++){const t=sn(e[s]);0!==t&&(e[s].area=Math.abs(t),void 0===r&&(r=t<0),r===t<0?(n&&i.push(n),n=[e[s]]):n.push(e[s]))}return n&&i.push(n),i}(e)){const e=[];for(let n=0;n<i.length;++n)e.push($n(i[n],t));n.push(e)}const r=new Dn(n[0][0][0][1],"meters");if("Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type)return or("Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,n,r);if("MultiLineString"===i.type){let e=1/0;for(let t=0;t<i.coordinates.length;t++){const s=or(i.coordinates[t],!0,n,r,e);if(isNaN(s))return s;if(0===(e=Math.min(e,s)))return e}return e}return"Polygon"===i.type||"MultiPolygon"===i.type?function(e,t,i){let n=1/0;for(const r of e)for(const e of t){const t=tr(r,e,i,n);if(isNaN(t))return t;if(0===(n=Math.min(n,t)))return n}return n}("Polygon"===i.type?[i.coordinates]:i.coordinates,n,r):null}(t,i,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function cr(e){if(e instanceof Ki){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Tn)return!1;if(e instanceof lr)return!1;if(e instanceof gr)return e.featureConstant;let t=!0;return e.eachChild(e=>{t&&!cr(e)&&(t=!1)}),t}function hr(e){if(e instanceof Ki&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!hr(e)&&(t=!1)}),t}function dr(e){if(e instanceof gr)return new Set([e.key]);let t=new Set;return e.eachChild(e=>{t=new Set([...t,...dr(e)])}),t}function ur(e,t){if(e instanceof Ki&&t.indexOf(e.name)>=0)return!1;let i=!0;return e.eachChild(e=>{i&&!ur(e,t)&&(i=!1)}),i}function fr(e,t,i){return[e,t,i].filter(Boolean).join("")}function pr(e,t){switch(e){case"string":return Bi(t);case"number":return+t;case"boolean":return!!t;case"color":return si.parse(t);case"formatted":return Ri.fromString(Bi(t));case"resolvedImage":return zi.build(Bi(t))}return t}function mr(e,t,i,n){return void 0!==n&&(e=n*Math.round(e/n)),void 0!==t&&e<t&&(e=t),void 0!==i&&e>i&&(e=i),e}class gr{constructor(e,t,i,n=!1){this.type=e,this.key=t,this.scope=i,this.featureConstant=n}static parse(e,t){let i=t.expectedType;if(null==i&&(i=bi),e.length<2||e.length>3)return t.error("Invalid number of arguments for 'config' expression.");const n=t.parse(e[1],1);if(!(n instanceof Hi))return t.error("Key name of 'config' expression must be a string literal.");let r,s=!0;const o=Bi(n.value);if(e.length>=3){const i=t.parse(e[2],2);if(!(i instanceof Hi))return t.error("Scope of 'config' expression must be a string literal.");r=Bi(i.value)}if(t.options){const e=fr(o,r,t._scope),i=t.options.get(e);i&&(s=cr(i.value||i.default))}return new gr(i,o,r,s)}evaluate(e){const t=fr(this.key,this.scope,e.scope),i=e.getConfig(t);if(!i)return null;const{type:n,value:r,values:s,minValue:o,maxValue:a,stepValue:l}=i,c=i.default.evaluate(e);let h=c;if(r){const t=e.scope;e.scope=(t||"").split("").slice(1).join(""),h=r.evaluate(e),e.scope=t}return n&&(h=pr(n,h)),void 0===h||void 0===o&&void 0===a&&void 0===l||("number"==typeof h?h=mr(h,o,a,l):Array.isArray(h)&&(h=h.map(e=>"number"==typeof e?mr(e,o,a,l):e))),void 0!==r&&void 0!==h&&s&&!s.includes(h)&&(h=c,n&&(h=pr(n,h))),(n&&n!==this.type||void 0!==h&&!Ei(Yi(h),this.type))&&(h=pr(this.type.kind,h)),h}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.scope),e}}class _r{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const i=e[1];return t.scope.has(i)?new _r(i,t.scope.get(i)):t.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class yr{constructor(e,t=[],i,n=new pi,r=[],s,o){this.registry=e,this.path=t,this.key=t.map(e=>"string"==typeof e?`['${e}']`:`[${e}]`).join(""),this.scope=n,this.errors=r,this.expectedType=i,this._scope=s,this.options=o}parse(e,t,i,n,r={}){return t||i?this.concat(t,null,i,n)._parse(e,r):this._parse(e,r)}parseObjectValue(e,t,i,n,r,s={}){return this.concat(t,i,n,r)._parse(e,s)}_parse(e,t){function i(e,t,i){return"assert"===i?new Wi(t,[e]):"coerce"===i?new qi(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n="string"==typeof e[0]?this.registry[e[0]]:void 0;if(n){let r=n.parse(e,this);if(!r)return null;if(this.expectedType){const e=this.expectedType,n=r.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(e,n))return null}else r=i(r,e,t.typeAnnotation||"coerce");else r=i(r,e,t.typeAnnotation||"assert")}if(!(r instanceof Hi)&&"resolvedImage"!==r.type.kind&&vr(r)){const t=new Ji(this._scope,this.options);try{r=new Hi(r.type,r.evaluate(t))}catch(e){return this.error(e.message),null}}return r}return qi.parse(["to-array",e],this)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,i,n){let r="number"==typeof e?this.path.concat(e):this.path;r="string"==typeof t?r.concat(t):r;const s=n?this.scope.concat(n):this.scope;return new yr(this.registry,r,i||null,s,this.errors,this._scope,this.options)}error(e,...t){const i=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new fi(i,e))}checkSubtype(e,t){const i=Ci(e,t);return i&&this.error(i),i}}function vr(e){if(e instanceof _r)return vr(e.boundExpression);if(e instanceof Ki&&"error"===e.name)return!1;if(e instanceof en)return!1;if(e instanceof Tn)return!1;if(e instanceof lr)return!1;if(e instanceof gr)return!1;const t=e instanceof qi||e instanceof Wi;let i=!0;return e.eachChild(e=>{i=t?i&&vr(e):i&&e instanceof Hi}),!!i&&cr(e)&&ur(e,["zoom","heatmap-density","worldview","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function xr(e,t){const i=e.length-1;let n,r,s=0,o=i,a=0;for(;s<=o;)if(a=Math.floor((s+o)/2),n=e[a],r=e[a+1],n<=t){if(a===i||t<r)return a;s=a+1}else{if(!(n>t))throw new ji("Input is not a number.");o=a-1}return 0}class br{constructor(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of i)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const i=t.parse(e[1],1,gi);if(!i)return null;const n=[];let r=null;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(let i=1;i<e.length;i+=2){const s=1===i?-1/0:e[i],o=e[i+1],a=i,l=i+1;if("number"!=typeof s)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=s)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=t.parse(o,l,r);if(!c)return null;r=r||c.type,n.push([s,c])}return new br(r,i,n)}evaluate(e){const t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return i[0].evaluate(e);const r=t.length;return n>=t[r-1]?i[r-1].evaluate(e):i[xr(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}const wr=.95047,Sr=1.08883,Tr=4/29,kr=6/29,Mr=3*kr*kr,Ar=kr*kr*kr,Cr=Math.PI/180,Dr=180/Math.PI;function Lr(e){return e>Ar?Math.pow(e,1/3):e/Mr+Tr}function Er(e){return e>kr?e*e*e:Mr*(e-Tr)}function Ir(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Pr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Rr(e){const t=Pr(e.r),i=Pr(e.g),n=Pr(e.b),r=Lr((.4124564*t+.3575761*i+.1804375*n)/wr),s=Lr((.2126729*t+.7151522*i+.072175*n)/1);return{l:116*s-16,a:500*(r-s),b:200*(s-Lr((.0193339*t+.119192*i+.9503041*n)/Sr)),alpha:e.a}}function Or(e){let t=(e.l+16)/116,i=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*Er(t),i=wr*Er(i),n=Sr*Er(n),new si(Ir(3.2404542*i-1.5371385*t-.4985314*n),Ir(-.969266*i+1.8760108*t+.041556*n),Ir(.0556434*i-.2040259*t+1.0572252*n),e.alpha)}function zr(e,t,i){const n=t-e;return e+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const Fr={forward:Rr,reverse:Or,interpolate:function(e,t,i){return{l:ci(e.l,t.l,i),a:ci(e.a,t.a,i),b:ci(e.b,t.b,i),alpha:ci(e.alpha,t.alpha,i)}}},Nr={forward:function(e){const{l:t,a:i,b:n}=Rr(e),r=Math.atan2(n,i)*Dr;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:t,alpha:e.a}},reverse:function(e){const t=e.h*Cr,i=e.c;return Or({l:e.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:e.alpha})},interpolate:function(e,t,i){return{h:zr(e.h,t.h,i),c:ci(e.c,t.c,i),l:ci(e.l,t.l,i),alpha:ci(e.alpha,t.alpha,i)}}};var Yr=Object.freeze({__proto__:null,hcl:Nr,lab:Fr});class Br{constructor(e,t,i,n,r){this.type=e,this.operator=t,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,i,n){let r=0;if("exponential"===e.name)r=Hr(t,e.base,i,n);else if("linear"===e.name)r=Hr(t,1,i,n);else if("cubic-bezier"===e.name){const s=e.controlPoints;r=new ve(s[0],s[1],s[2],s[3]).solve(Hr(t,1,i,n))}return r}static parse(e,t){let[i,n,r,...s]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length-1>3&&(e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(r=t.parse(r,2,gi),!r)return null;const o=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=vi:t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(let e=0;e<s.length;e+=2){const i=s[e],n=s[e+1],r=e+3,l=e+4;if("number"!=typeof i)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',r);if(o.length&&o[o.length-1][0]>=i)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',r);const c=t.parse(n,l,a);if(!c)return null;a=a||c.type,o.push([i,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new Br(a,i,n,r,o):t.error(`Type ${Mi(a)} is not interpolatable.`)}evaluate(e){const t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return i[0].evaluate(e);const r=t.length;if(n>=t[r-1])return i[r-1].evaluate(e);const s=xr(t,n),o=Br.interpolationFactor(this.interpolation,n,t[s],t[s+1]),a=i[s].evaluate(e),l=i[s+1].evaluate(e);return"interpolate"===this.operator?di[this.type.kind.toLowerCase()](a,l,o):"interpolate-hcl"===this.operator?Nr.reverse(Nr.interpolate(Nr.forward(a),Nr.forward(l),o)):Fr.reverse(Fr.interpolate(Fr.forward(a),Fr.forward(l),o))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier",...this.interpolation.controlPoints];const t=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t}}function Hr(e,t,i,n){const r=n-i,s=e-i;return 0===r?0:1===t?s/r:(Math.pow(t,s)-1)/(Math.pow(t,r)-1)}class jr{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let i=null;const n=t.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const n of e.slice(1)){const e=t.parse(n,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!e)return null;i=i||e.type,r.push(e)}const s=n&&r.some(e=>Ci(n,e.type));return new jr(s?bi:i,r)}evaluate(e){let t,i=null,n=0;for(const r of this.args){if(n++,i=r.evaluate(e),i&&i instanceof zi&&!i.available&&(t||(t=i),i=null,n===this.args.length))return t;if(null!==i)break}return i}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(t=>{e.push(t.serialize())}),e}}class Vr{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const i=[];for(let n=1;n<e.length-1;n+=2){const r=e[n];if("string"!=typeof r)return t.error(`Expected string, but found ${typeof r} instead.`,n);if(/[^a-zA-Z0-9_]/.test(r))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const s=t.parse(e[n+1],n+1);if(!s)return null;i.push([r,s])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return n?new Vr(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,i]of this.bindings)e.push(t,i.serialize());return e.push(this.result.serialize()),e}}class Wr{constructor(e,t,i){this.type=e,this.index=t,this.input=i}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,gi),n=t.parse(e[2],2,ki(t.expectedType||bi));return i&&n?new Wr(n.type.itemType,i,n):null}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new ji(`Array index out of bounds: ${t} < 0.`);if(t>=i.length)throw new ji(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t!==Math.floor(t))throw new ji(`Array index must be an integer, but found ${t} instead. Use at-interpolated to retrieve interpolated result with a fractional index.`);return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Ur{constructor(e,t,i){this.type=e,this.index=t,this.input=i}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,gi),n=t.parse(e[2],2,ki(t.expectedType||bi));return i&&n?new Ur(n.type.itemType,i,n):null}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new ji(`Array index out of bounds: ${t} < 0.`);if(t>i.length-1)throw new ji(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t===Math.floor(t))return i[t];const n=Math.floor(t),r=Math.ceil(t),s=i[n],o=i[r];if("number"!=typeof s||"number"!=typeof o)throw new ji(`Cannot interpolate between non-number values at index ${t}.`);const a=t-n;return s*(1-a)+o*a}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at-interpolated",this.index.serialize(),this.input.serialize()]}}class $r{constructor(e,t){this.type=yi,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,bi),n=t.parse(e[2],2,bi);return i&&n?Di(i.type,[yi,_i,gi,mi,bi])?new $r(i,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Mi(i.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(null==i)return!1;if(!Li(t,["boolean","string","number","null"]))throw new ji(`Expected first argument to be of type boolean, string, number or null, but found ${Mi(Yi(t))} instead.`);if(!Li(i,["string","array"]))throw new ji(`Expected second argument to be of type array or string, but found ${Mi(Yi(i))} instead.`);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class Gr{constructor(e,t,i){this.type=gi,this.needle=e,this.haystack=t,this.fromIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,bi),n=t.parse(e[2],2,bi);if(!i||!n)return null;if(!Di(i.type,[yi,_i,gi,mi,bi]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Mi(i.type)} instead`);if(4===e.length){const r=t.parse(e[3],3,gi);return r?new Gr(i,n,r):null}return new Gr(i,n)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!Li(t,["boolean","string","number","null"]))throw new ji(`Expected first argument to be of type boolean, string, number or null, but found ${Mi(Yi(t))} instead.`);if(!Li(i,["string","array"]))throw new ji(`Expected second argument to be of type array or string, but found ${Mi(Yi(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(e);return i.indexOf(t,n)}return i.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class Xr{constructor(e,t,i,n,r,s){this.inputType=e,this.type=t,this.input=i,this.cases=n,this.outputs=r,this.otherwise=s}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let i,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const r={},s=[];for(let o=2;o<e.length-1;o+=2){let a=e[o];const l=e[o+1];Array.isArray(a)||(a=[a]);const c=t.concat(o);if(0===a.length)return c.error("Expected at least one branch label.");for(const e of a){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,Yi(e)))return null}else i=Yi(e);if(void 0!==r[String(e)])return c.error("Branch labels must be unique.");r[String(e)]=s.length}const h=t.parse(l,o,n);if(!h)return null;n=n||h.type,s.push(h)}const o=t.parse(e[1],1,bi);if(!o)return null;const a=t.parse(e[e.length-1],e.length-1,n);return a?"value"!==o.type.kind&&t.concat(1).checkSubtype(i,o.type)?null:new Xr(i,n,o,r,s,a):null}evaluate(e){const t=this.input.evaluate(e);return(Ei(Yi(t),this.inputType)&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),i=[],n={};for(const e of t){const t=n[this.cases[e]];void 0===t?(n[this.cases[e]]=i.length,i.push([this.cases[e],[e]])):i[t][1].push(e)}const r=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,n]of i)e.push(1===n.length?r(n[0]):n.map(r)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}class qr{constructor(e,t,i){this.type=e,this.branches=t,this.otherwise=i}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);const n=[];for(let r=1;r<e.length-1;r+=2){const s=t.parse(e[r],r,yi);if(!s)return null;const o=t.parse(e[r+1],r+1,i);if(!o)return null;n.push([s,o]),i=i||o.type}const r=t.parse(e[e.length-1],e.length-1,i);return r?new qr(i,n,r):null}evaluate(e){for(const[t,i]of this.branches)if(t.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,i]of this.branches)e(t),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(t=>{e.push(t.serialize())}),e}}class Zr{constructor(e,t,i,n){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,bi),n=t.parse(e[2],2,gi);if(!i||!n)return null;if(!Di(i.type,[ki(bi),_i,bi]))return t.error(`Expected first argument to be of type array or string, but found ${Mi(i.type)} instead`);if(4===e.length){const r=t.parse(e[3],3,gi);return r?new Zr(i.type,i,n,r):null}return new Zr(i.type,i,n)}evaluate(e){const t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(!Li(t,["string","array"]))throw new ji(`Expected first argument to be of type array or string, but found ${Mi(Yi(t))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(e);return t.slice(i,n)}return t.slice(i)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}class Jr{constructor(e,t){this.type=ki(_i),this.str=e,this.delimiter=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,_i),n=t.parse(e[2],2,_i);return i&&n?new Jr(i,n):void 0}evaluate(e){const t=this.str.evaluate(e),i=this.delimiter.evaluate(e);return t.split(i)}eachChild(e){e(this.str),e(this.delimiter)}outputDefined(){return!1}serialize(){return["split",this.str.serialize(),this.delimiter.serialize()]}}function Kr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Qr(e,t,i,n){return 0===n.compare(t,i)}function es(e,t,i){const n="=="!==e&&"!="!==e;return class r{constructor(e,t,i){this.type=yi,this.lhs=e,this.rhs=t,this.collator=i,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const i=e[0];let s=t.parse(e[1],1,bi);if(!s)return null;if(!Kr(i,s.type))return t.concat(1).error(`"${i}" comparisons are not supported for type '${Mi(s.type)}'.`);let o=t.parse(e[2],2,bi);if(!o)return null;if(!Kr(i,o.type))return t.concat(2).error(`"${i}" comparisons are not supported for type '${Mi(o.type)}'.`);if(s.type.kind!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return t.error(`Cannot compare types '${Mi(s.type)}' and '${Mi(o.type)}'.`);n&&("value"===s.type.kind&&"value"!==o.type.kind?s=new Wi(o.type,[s]):"value"!==s.type.kind&&"value"===o.type.kind&&(o=new Wi(s.type,[o])));let a=null;if(4===e.length){if("string"!==s.type.kind&&"string"!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(a=t.parse(e[3],3,wi),!a)return null}return new r(s,o,a)}evaluate(r){const s=this.lhs.evaluate(r),o=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const t=Yi(s),i=Yi(o);if(t.kind!==i.kind||"string"!==t.kind&&"number"!==t.kind)throw new ji(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=Yi(s),i=Yi(o);if("string"!==e.kind||"string"!==i.kind)return t(r,s,o)}return this.collator?i(r,s,o,this.collator.evaluate(r)):t(r,s,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild(e=>{t.push(e.serialize())}),t}}}const ts=es("==",function(e,t,i){return t===i},Qr),is=es("!=",function(e,t,i){return t!==i},function(e,t,i,n){return!Qr(0,t,i,n)}),ns=es("<",function(e,t,i){return t<i},function(e,t,i,n){return n.compare(t,i)<0}),rs=es(">",function(e,t,i){return t>i},function(e,t,i,n){return n.compare(t,i)>0}),ss=es("<=",function(e,t,i){return t<=i},function(e,t,i,n){return n.compare(t,i)<=0}),os=es(">=",function(e,t,i){return t>=i},function(e,t,i,n){return n.compare(t,i)>=0});class as{constructor(e,t,i,n,r,s){this.type=_i,this.number=e,this.locale=t,this.currency=i,this.unit=n,this.minFractionDigits=r,this.maxFractionDigits=s}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const i=t.parse(e[1],1,gi);if(!i)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=t.parseObjectValue(n.locale,2,"locale",_i),!r))return null;let s=null;if(n.currency&&(s=t.parseObjectValue(n.currency,2,"currency",_i),!s))return null;let o=null;if(n.unit&&(o=t.parseObjectValue(n.unit,2,"unit",_i),!o))return null;let a=null;if(n["min-fraction-digits"]&&(a=t.parseObjectValue(n["min-fraction-digits"],2,"min-fraction-digits",gi),!a))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parseObjectValue(n["max-fraction-digits"],2,"max-fraction-digits",gi),!l)?null:new as(i,r,s,o,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class ls{constructor(e){this.type=gi,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const i=t.parse(e[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?t.error(`Expected argument of type string or array, but found ${Mi(i.type)} instead.`):new ls(i):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new ji(`Expected value to be of type string or array, but found ${Mi(Yi(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(t=>{e.push(t.serialize())}),e}}function cs(e){return function(){e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const hs={"==":ts,"!=":is,">":rs,"<":ns,">=":os,"<=":ss,array:Wi,at:Wr,"at-interpolated":Ur,boolean:Wi,case:qr,coalesce:jr,collator:en,format:Ui,image:$i,in:$r,"index-of":Gr,interpolate:Br,"interpolate-hcl":Br,"interpolate-lab":Br,length:ls,let:Vr,literal:Hi,match:Xr,number:Wi,"number-format":as,object:Wi,slice:Zr,step:br,string:Wi,"to-boolean":qi,"to-color":qi,"to-number":qi,"to-string":qi,var:_r,within:Tn,distance:lr,config:gr,split:Jr};function ds(e,[t,i,n,r]){t=t.evaluate(e),i=i.evaluate(e),n=n.evaluate(e);const s=r?r.evaluate(e):1,o=Fi(t,i,n,s);if(o)throw new ji(o);return new si(t/255,i/255,n/255,s)}function us(e,[t,i,n,r]){t=t.evaluate(e),i=i.evaluate(e),n=n.evaluate(e);const s=r?r.evaluate(e):1,o=function(e,t,i,n){return"number"==typeof e&&e>=0&&e<=360?"number"==typeof t&&t>=0&&t<=100&&"number"==typeof i&&i>=0&&i<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid hsla value [${[e,t,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof n?[e,t,i,n]:[e,t,i]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof n?[e,t,i,n]:[e,t,i]).join(", ")}]: 'h' must be between 0 and 360.`}(t,i,n,s);if(o)throw new ji(o);const a=`hsla(${t}, ${i}%, ${n}%, ${s})`,l=si.parse(a);if(!l)throw new ji(`Failed to parse HSLA color: ${a}`);return l}function fs(e,t){return e in t}function ps(e,t){const i=t[e];return void 0===i?null:i}function ms(e){return{type:e}}function gs(e){return{result:"success",value:e}}function _s(e){return{result:"error",value:e}}function ys(e,t){return!!e&&!!e.parameters&&e.parameters.indexOf(t)>-1}function vs(e){return"data-driven"===e["property-type"]}function xs(e){return ys(e.expression,"measure-light")}function bs(e){return ys(e.expression,"zoom")}function ws(e){return!!e.expression&&e.expression.interpolated}function Ss(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Ts(e){return e}function ks(e,t){const i="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],r=n||!(n||void 0!==e.property),s=e.type||(ws(t)?"exponential":"interval");if(i&&((e=ui({},e)).stops&&(e.stops=e.stops.map(e=>[e[0],si.parse(e[1])])),e.default=si.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Yr[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let o,a,l;if("exponential"===s)o=Ds;else if("interval"===s)o=Cs;else if("categorical"===s){o=As,a=Object.create(null);for(const t of e.stops)a[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==s)throw new Error(`Unknown function type "${s}"`);o=Ls}if(n){const i={},n=[];for(let t=0;t<e.stops.length;t++){const r=e.stops[t],s=r[0].zoom;void 0===i[s]&&(i[s]={zoom:s,type:e.type,property:e.property,default:e.default,stops:[]},n.push(s)),i[s].stops.push([r[0].value,r[1]])}const r=[];for(const e of n)r.push([i[e].zoom,ks(i[e],t)]);const s={name:"linear"};return{kind:"composite",interpolationType:s,interpolationFactor:Br.interpolationFactor.bind(void 0,s),zoomStops:r.map(e=>e[0]),evaluate:({zoom:i},n)=>Ds({stops:r,base:e.base},t,i).evaluate(i,n)}}if(r){const i="exponential"===s?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:Br.interpolationFactor.bind(void 0,i),zoomStops:e.stops.map(e=>e[0]),evaluate:({zoom:i})=>o(e,t,i,a,l)}}return{kind:"source",evaluate(i,n){const r=n&&n.properties?n.properties[e.property]:void 0;return void 0===r?Ms(e.default,t.default):o(e,t,r,a,l)}}}function Ms(e,t,i){return void 0!==e?e:void 0!==t?t:void 0!==i?i:void 0}function As(e,t,i,n,r){return Ms(typeof i===r?n[i]:void 0,e.default,t.default)}function Cs(e,t,i){if("number"!==Gi(i))return Ms(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[n-1][0])return e.stops[n-1][1];const r=xr(e.stops.map(e=>e[0]),i);return e.stops[r][1]}function Ds(e,t,i){const n=void 0!==e.base?e.base:1;if("number"!==Gi(i))return Ms(e.default,t.default);const r=e.stops.length;if(1===r)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[r-1][0])return e.stops[r-1][1];const s=xr(e.stops.map(e=>e[0]),i),o=function(e,t,i,n){const r=n-i,s=e-i;return 0===r?0:1===t?s/r:(Math.pow(t,s)-1)/(Math.pow(t,r)-1)}(i,n,e.stops[s][0],e.stops[s+1][0]),a=e.stops[s][1],l=e.stops[s+1][1];let c=di[t.type]||Ts;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=Yr[e.colorSpace];c=(e,i)=>t.reverse(t.interpolate(t.forward(e),t.forward(i),o))}return"function"==typeof a.evaluate?{evaluate(...e){const t=a.evaluate.apply(void 0,e),i=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==i)return c(t,i,o)}}:c(a,l,o)}function Ls(e,t,i){return"color"===t.type?i=si.parse(i):"formatted"===t.type?i=Ri.fromString(i.toString()):"resolvedImage"===t.type?i=zi.build(i.toString()):Gi(i)===t.type||"enum"===t.type&&t.values[i]||(i=void 0),Ms(i,e.default,t.default)}Ki.register(hs,{error:[{kind:"error"},[_i],(e,[t])=>{throw new ji(t.evaluate(e))}],typeof:[_i,[bi],(e,[t])=>Mi(Yi(t.evaluate(e)))],"to-rgba":[ki(gi,4),[vi],(e,[t])=>t.evaluate(e).toNonPremultipliedRenderColor(null).toArray()],"to-hsla":[ki(gi,4),[vi],(e,[t])=>t.evaluate(e).toNonPremultipliedRenderColor(null).toHslaArray()],rgb:[vi,[gi,gi,gi],ds],rgba:[vi,[gi,gi,gi,gi],ds],hsl:[vi,[gi,gi,gi],us],hsla:[vi,[gi,gi,gi,gi],us],has:{type:yi,overloads:[[[_i],(e,[t])=>fs(t.evaluate(e),e.properties())],[[_i,xi],(e,[t,i])=>fs(t.evaluate(e),i.evaluate(e))]]},get:{type:bi,overloads:[[[_i],(e,[t])=>ps(t.evaluate(e),e.properties())],[[_i,xi],(e,[t,i])=>ps(t.evaluate(e),i.evaluate(e))]]},"feature-state":[bi,[_i],(e,[t])=>ps(t.evaluate(e),e.featureState||{})],properties:[xi,[],e=>e.properties()],"geometry-type":[_i,[],e=>e.geometryType()],worldview:[_i,[],e=>e.globals.worldview||""],id:[bi,[],e=>e.id()],zoom:[gi,[],e=>e.globals.zoom],pitch:[gi,[],e=>e.globals.pitch||0],"distance-from-center":[gi,[],e=>e.distanceFromCenter()],"measure-light":[gi,[_i],(e,[t])=>e.measureLight(t.evaluate(e))],"heatmap-density":[gi,[],e=>e.globals.heatmapDensity||0],"line-progress":[gi,[],e=>e.globals.lineProgress||0],"raster-value":[gi,[],e=>e.globals.rasterValue||0],"raster-particle-speed":[gi,[],e=>e.globals.rasterParticleSpeed||0],"sky-radial-progress":[gi,[],e=>e.globals.skyRadialProgress||0],accumulated:[bi,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[gi,ms(gi),(e,t)=>{let i=0;for(const n of t)i+=n.evaluate(e);return i}],"*":[gi,ms(gi),(e,t)=>{let i=1;for(const n of t)i*=n.evaluate(e);return i}],"-":{type:gi,overloads:[[[gi,gi],(e,[t,i])=>t.evaluate(e)-i.evaluate(e)],[[gi],(e,[t])=>-t.evaluate(e)]]},"/":[gi,[gi,gi],(e,[t,i])=>t.evaluate(e)/i.evaluate(e)],"%":[gi,[gi,gi],(e,[t,i])=>t.evaluate(e)%i.evaluate(e)],ln2:[gi,[],()=>Math.LN2],pi:[gi,[],()=>Math.PI],e:[gi,[],()=>Math.E],"^":[gi,[gi,gi],(e,[t,i])=>Math.pow(t.evaluate(e),i.evaluate(e))],sqrt:[gi,[gi],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[gi,[gi],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[gi,[gi],(e,[t])=>Math.log(t.evaluate(e))],log2:[gi,[gi],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[gi,[gi],(e,[t])=>Math.sin(t.evaluate(e))],cos:[gi,[gi],(e,[t])=>Math.cos(t.evaluate(e))],tan:[gi,[gi],(e,[t])=>Math.tan(t.evaluate(e))],asin:[gi,[gi],(e,[t])=>Math.asin(t.evaluate(e))],acos:[gi,[gi],(e,[t])=>Math.acos(t.evaluate(e))],atan:[gi,[gi],(e,[t])=>Math.atan(t.evaluate(e))],min:[gi,ms(gi),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[gi,ms(gi),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[gi,[gi],(e,[t])=>Math.abs(t.evaluate(e))],round:[gi,[gi],(e,[t])=>{const i=t.evaluate(e);return i<0?-Math.round(-i):Math.round(i)}],floor:[gi,[gi],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[gi,[gi],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[yi,[_i,bi],(e,[t,i])=>e.properties()[t.value]===i.value],"filter-id-==":[yi,[bi],(e,[t])=>e.id()===t.value],"filter-type-==":[yi,[_i],(e,[t])=>e.geometryType()===t.value],"filter-<":[yi,[_i,bi],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[yi,[bi],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i<n}],"filter->":[yi,[_i,bi],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[yi,[bi],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i>n}],"filter-<=":[yi,[_i,bi],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[yi,[bi],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i<=n}],"filter->=":[yi,[_i,bi],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[yi,[bi],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i>=n}],"filter-has":[yi,[bi],(e,[t])=>t.value in e.properties()],"filter-has-id":[yi,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[yi,[ki(_i)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[yi,[ki(bi)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[yi,[_i,ki(bi)],(e,[t,i])=>i.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[yi,[_i,ki(bi)],(e,[t,i])=>function(e,t,i,n){for(;i<=n;){const r=i+n>>1;if(t[r]===e)return!0;t[r]>e?n=r-1:i=r+1}return!1}(e.properties()[t.value],i.value,0,i.value.length-1)],all:{type:yi,overloads:[[[yi,yi],(e,[t,i])=>t.evaluate(e)&&i.evaluate(e)],[ms(yi),(e,t)=>{for(const i of t)if(!i.evaluate(e))return!1;return!0}]]},any:{type:yi,overloads:[[[yi,yi],(e,[t,i])=>t.evaluate(e)||i.evaluate(e)],[ms(yi),(e,t)=>{for(const i of t)if(i.evaluate(e))return!0;return!1}]]},"!":[yi,[yi],(e,[t])=>!t.evaluate(e)],"is-supported-script":[yi,[_i],(e,[t])=>{const i=e.globals&&e.globals.isSupportedScript;return!i||i(t.evaluate(e))}],upcase:[_i,[_i],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[_i,[_i],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[_i,ms(bi),(e,t)=>t.map(t=>Bi(t.evaluate(e))).join("")],"resolved-locale":[_i,[wi],(e,[t])=>t.evaluate(e).resolvedLocale()],random:[gi,[gi,gi,bi],(e,t)=>{const[i,n,r]=t.map(t=>t.evaluate(e));if(i>n)return i;if(i===n)return i;let s;if("string"==typeof r)s=function(e){let t=0;if(0===e.length)return t;for(let i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t|=0;return t}(r);else{if("number"!=typeof r)throw new ji(`Invalid seed input: ${r}`);s=r}return i+cs(s)()*(n-i)}]});class Es{constructor(e,t,i,n){this.expression=e,this._warningHistory={},this._evaluator=new Ji(i,n),this._defaultValue=t?function(e){return"color"===e.type&&(Ss(e.default)||Array.isArray(e.default))?new si(0,0,0,0):"color"===e.type?si.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this.configDependencies=dr(e)}evaluateWithoutErrorHandling(e,t,i,n,r,s,o,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.canonical=n||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=s,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,i,n,r,s,o,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=s||null,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new ji(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${e.message}`)),this._defaultValue}}}function Is(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in hs}function Ps(e,t,i,n){const r=new yr(hs,[],t?function(e){const t={color:vi,string:_i,number:gi,enum:_i,boolean:yi,formatted:Si,resolvedImage:Ti};return"array"===e.type?ki(t[e.value]||bi,e.length):t[e.type]}(t):void 0,void 0,void 0,i,n),s=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return s?gs(new Es(s,t,i,n)):_s(r.errors)}class Rs{constructor(e,t,i,n){this.kind=e,this._styleExpression=t,this.isLightConstant=i,this.isLineProgressConstant=n,this.isStateDependent="constant"!==e&&!hr(t.expression),this.configDependencies=dr(t.expression)}evaluateWithoutErrorHandling(e,t,i,n,r,s){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,n,r,s)}evaluate(e,t,i,n,r,s){return this._styleExpression.evaluate(e,t,i,n,r,s)}}class Os{constructor(e,t,i,n,r,s){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent="camera"!==e&&!hr(t.expression),this.isLightConstant=r,this.isLineProgressConstant=s,this.configDependencies=dr(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,i,n,r,s){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,n,r,s)}evaluate(e,t,i,n,r,s){return this._styleExpression.evaluate(e,t,i,n,r,s)}interpolationFactor(e,t,i){return this.interpolationType?Br.interpolationFactor(this.interpolationType,e,t,i):0}}function zs(e,t,i,n){if("error"===(e=Ps(e,t,i,n)).result)return e;const r=e.value.expression,s=cr(r);if(!s&&!vs(t))return _s([new fi("","data expressions not supported")]);const o=ur(r,["zoom","pitch","distance-from-center"]);if(!o&&!bs(t))return _s([new fi("","zoom expressions not supported")]);const a=ur(r,["measure-light"]);if(!a&&!xs(t))return _s([new fi("","measure-light expression not supported")]);const l=ur(r,["line-progress"]);if(!l&&!function(e){return ys(e.expression,"line-progress")}(t))return _s([new fi("","line-progress expression not supported")]);const c=t.expression&&t.expression.relaxZoomRestriction,h=Ns(r);return h||o||c?h instanceof fi?_s([h]):h instanceof Br&&!ws(t)?_s([new fi("",'"interpolate" expressions cannot be used with this property')]):gs(h?new Os(s&&l?"camera":"composite",e.value,h.labels,h instanceof Br?h.interpolation:void 0,a,l):new Rs(s&&l?"constant":"source",e.value,a,l)):_s([new fi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class Fs{constructor(e,t){this._parameters=e,this._specification=t,ui(this,ks(this._parameters,this._specification))}static deserialize(e){return new Fs(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Ns(e){let t=null;if(e instanceof Vr)t=Ns(e.result);else if(e instanceof jr){for(const i of e.args)if(t=Ns(i),t)break}else(e instanceof br||e instanceof Br)&&e.input instanceof Ki&&"zoom"===e.input.name&&(t=e);return t instanceof fi||e.eachChild(e=>{const i=Ns(e);i instanceof fi?t=i:t&&i&&t!==i&&(t=new fi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}var Ys,Bs,Hs=function(){if(Bs)return Ys;Bs=1,Ys=t;var e=3;function t(t,i,n){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var s=new Int32Array(this.arrayBuffer);t=s[0],this.d=(i=s[1])+2*(n=s[2]);for(var o=0;o<this.d*this.d;o++){var a=s[e+o],l=s[e+o+1];r.push(a===l?null:s.subarray(a,l))}var c=s[e+r.length+1];this.keys=s.subarray(s[e+r.length],c),this.bboxes=s.subarray(c),this.insert=this._insertReadonly}else{this.d=i+2*n;for(var h=0;h<this.d*this.d;h++)r.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=t,this.padding=n,this.scale=i/t,this.uid=0;var d=n/i*t;this.min=-d,this.max=t+d}return t.prototype.insert=function(e,t,i,n,r){this._forEachCell(t,i,n,r,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)},t.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},t.prototype._insertCell=function(e,t,i,n,r,s){this.cells[r].push(s)},t.prototype.query=function(e,t,i,n,r){var s=this.min,o=this.max;if(e<=s&&t<=s&&o<=i&&o<=n&&!r)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(e,t,i,n,this._queryCell,a,{},r),a},t.prototype._queryCell=function(e,t,i,n,r,s,o,a){var l=this.cells[r];if(null!==l)for(var c=this.keys,h=this.bboxes,d=0;d<l.length;d++){var u=l[d];if(void 0===o[u]){var f=4*u;(a?a(h[f+0],h[f+1],h[f+2],h[f+3]):e<=h[f+2]&&t<=h[f+3]&&i>=h[f+0]&&n>=h[f+1])?(o[u]=!0,s.push(c[u])):o[u]=!1}}},t.prototype._forEachCell=function(e,t,i,n,r,s,o,a){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),h=this._convertToCellCoord(i),d=this._convertToCellCoord(n),u=l;u<=h;u++)for(var f=c;f<=d;f++){var p=this.d*f+u;if((!a||a(this._convertFromCellCoord(u),this._convertFromCellCoord(f),this._convertFromCellCoord(u+1),this._convertFromCellCoord(f+1)))&&r.call(this,e,t,i,n,p,s,o,a))return}},t.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},t.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},t.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,i=e+this.cells.length+1+1,n=0,r=0;r<this.cells.length;r++)n+=this.cells[r].length;var s=new Int32Array(i+n+this.keys.length+this.bboxes.length);s[0]=this.extent,s[1]=this.n,s[2]=this.padding;for(var o=i,a=0;a<t.length;a++){var l=t[a];s[e+a]=o,s.set(l,o),o+=l.length}return s[e+t.length]=o,s.set(this.keys,o),s[e+t.length+1]=o+=this.keys.length,s.set(this.bboxes,o),o+=this.bboxes.length,s.buffer},Ys}(),js=_e(Hs);const Vs={};function Ws(e,t,i={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writable:!1}),Vs[t]={klass:e,omit:i.omit||[]}}Ws(Object,"Object"),js.serialize=function(e,t){const i=e.toArrayBuffer();return t&&t.add(i),{buffer:i}},js.deserialize=function(e){return new js(e.buffer)},Object.defineProperty(js,"name",{value:"Grid"}),Ws(js,"Grid"),delete xe.prototype.constructor,"undefined"!=typeof DOMMatrix&&Ws(DOMMatrix,"DOMMatrix"),Ws(si,"Color"),Ws(Error,"Error"),Ws(Ri,"Formatted"),Ws(Pi,"FormattedSection"),Ws(Pt,"AJAXError"),Ws(zi,"ResolvedImage"),Ws(Fs,"StylePropertyFunction"),Ws(Es,"StyleExpression",{omit:["_evaluator"]}),Ws(ti,"ImageId"),Ws(Oi,"ImageVariant"),Ws(Os,"ZoomDependentExpression"),Ws(Rs,"ZoomConstantExpression"),Ws(Ki,"CompoundExpression",{omit:["_evaluate"]});for(const e in hs)Vs[hs[e]._classRegistryKey]||Ws(hs[e],`Expression${e}`);function Us(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function $s(e){return self.ImageBitmap&&e instanceof ImageBitmap}function Gs(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(Us(e)||$s(e))return t&&t.add(e),e;if(ArrayBuffer.isView(e))return t&&t.add(e.buffer),e;if(e instanceof ImageData)return t&&t.add(e.data.buffer),e;if(Array.isArray(e)){const i=[];for(const n of e)i.push(Gs(n,t));return i}if(e instanceof Map){const i={$name:"Map",entries:[]};for(const[n,r]of e.entries())i.entries.push(Gs(n),Gs(r,t));return i}if(e instanceof Set){const t={$name:"Set"};let i=0;for(const n of e.values())t[++i]=Gs(n);return t}if(e instanceof DOMMatrix){const t={$name:"DOMMatrix"},i=["is2D","m11","m12","m13","m14","m21","m22","m23","m24","m31","m32","m33","m34","m41","m42","m43","m44","a","b","c","d","e","f"];for(const n of i)t[n]=e[n];return t}if("bigint"==typeof e)return{$name:"BigInt",value:e.toString()};if("object"==typeof e){const i=e.constructor,n=i._classRegistryKey;if(!n)throw new Error(`Can't serialize object of unregistered class "${i.name}".`);const r=i.serialize?i.serialize(e,t):{};if(!i.serialize){for(const i in e)e.hasOwnProperty(i)&&(Vs[n].omit.indexOf(i)>=0||(r[i]=Gs(e[i],t)));e instanceof Error&&(r.message=e.message)}if(r.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==n&&(r.$name=n),r}throw new Error("can't serialize object of type "+typeof e)}function Xs(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||Us(e)||$s(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(Xs);if("object"==typeof e){const t=e.$name||"Object";if("Map"===t){const t=e.entries||[],i=new Map;for(let e=0;e<t.length;e+=2)i.set(Xs(t[e]),Xs(t[e+1]));return i}if("Set"===t){const t=new Set;for(const i of Object.keys(e))"$name"!==i&&t.add(Xs(e[i]));return t}if("DOMMatrix"===t){let t;return t=e.is2D?[e.a,e.b,e.c,e.d,e.e,e.f]:[e.m11,e.m12,e.m13,e.m14,e.m21,e.m22,e.m23,e.m24,e.m31,e.m32,e.m33,e.m34,e.m41,e.m42,e.m43,e.m44],new DOMMatrix(t)}if("BigInt"===t)return BigInt(e.value);const{klass:i}=Vs[t];if(!i)throw new Error(`Can't deserialize unregistered class "${t}".`);if(i.deserialize)return i.deserialize(e);const n=Object.create(i.prototype);for(const t of Object.keys(e))"$name"!==t&&(n[t]=Xs(e[t]));return n}throw new Error("can't deserialize object of type "+typeof e)}const qs=e=>e>=128&&e<=255,Zs=e=>e>=1536&&e<=1791,Js=e=>e>=1872&&e<=1919,Ks=e=>e>=2208&&e<=2303,Qs=e=>e>=4352&&e<=4607,eo=e=>e>=5120&&e<=5759,to=e=>e>=6016&&e<=6143,io=e=>e>=6320&&e<=6399,no=e=>e>=8192&&e<=8303,ro=e=>e>=8448&&e<=8527,so=e=>e>=8528&&e<=8591,oo=e=>e>=8960&&e<=9215,ao=e=>e>=9216&&e<=9279,lo=e=>e>=9280&&e<=9311,co=e=>e>=9312&&e<=9471,ho=e=>e>=9632&&e<=9727,uo=e=>e>=9728&&e<=9983,fo=e=>e>=11008&&e<=11263,po=e=>e>=11904&&e<=12031,mo=e=>e>=12032&&e<=12255,go=e=>e>=12272&&e<=12287,_o=e=>e>=12288&&e<=12351,yo=e=>e>=12352&&e<=12447,vo=e=>e>=12448&&e<=12543,xo=e=>e>=12544&&e<=12591,bo=e=>e>=12592&&e<=12687,wo=e=>e>=12688&&e<=12703,So=e=>e>=12704&&e<=12735,To=e=>e>=12736&&e<=12783,ko=e=>e>=12784&&e<=12799,Mo=e=>e>=12800&&e<=13055,Ao=e=>e>=13056&&e<=13311,Co=e=>e>=13312&&e<=19903,Do=e=>e>=19904&&e<=19967,Lo=e=>e>=19968&&e<=40959,Eo=e=>e>=40960&&e<=42127,Io=e=>e>=42128&&e<=42191,Po=e=>e>=43360&&e<=43391,Ro=e=>e>=44032&&e<=55215,Oo=e=>e>=55216&&e<=55295,zo=e=>e>=57344&&e<=63743,Fo=e=>e>=63744&&e<=64255,No=e=>e>=64336&&e<=65023,Yo=e=>e>=65040&&e<=65055,Bo=e=>e>=65072&&e<=65103,Ho=e=>e>=65104&&e<=65135,jo=e=>e>=65136&&e<=65279,Vo=e=>e>=65280&&e<=65519,Wo=e=>e>=66736&&e<=66815,Uo=e=>e>=131072&&e<=173791;function $o(e){for(const t of e)if(qo(t.charCodeAt(0)))return!0;return!1}function Go(e){for(const t of e)if(!Xo(t.charCodeAt(0)))return!1;return!0}function Xo(e){return!(Zs(e)||Js(e)||Ks(e)||No(e)||jo(e))}function qo(e){return!(746!==e&&747!==e&&(e<4352||!(So(e)||xo(e)||Bo(e)&&!(e>=65097&&e<=65103)||Fo(e)||Ao(e)||po(e)||To(e)||!(!_o(e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||Co(e)||Lo(e)||Mo(e)||bo(e)||Po(e)||Oo(e)||Qs(e)||Ro(e)||yo(e)||go(e)||wo(e)||mo(e)||ko(e)||vo(e)&&12540!==e||!(!Vo(e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!Ho(e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||eo(e)||io(e)||Yo(e)||Do(e)||Eo(e)||Io(e))))}function Zo(e){return!(qo(e)||function(e){return!!(qs(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||no(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||ro(e)||so(e)||oo(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||ao(e)&&9251!==e||lo(e)||co(e)||ho(e)||uo(e)&&!(e>=9754&&e<=9759)||fo(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||_o(e)||vo(e)||zo(e)||Bo(e)||Ho(e)||Vo(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function Jo(e){return Zs(e)||Js(e)||Ks(e)||No(e)||jo(e)}function Ko(e){return e>=1424&&e<=2303||No(e)||jo(e)}function Qo(e,t){return!(!t&&Ko(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||to(e))}function ea(e){for(const t of e)if(Ko(t.charCodeAt(0)))return!0;return!1}const ta={unavailable:"unavailable",deferred:"deferred",loading:"loading",parsing:"parsing",parsed:"parsed",loaded:"loaded",error:"error"};let ia=null,na=ta.unavailable,ra=null;const sa=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(na=ta.error),ia&&ia(e)};function oa(){aa.fire(new Zt("pluginStateChange",{pluginStatus:na,pluginURL:ra}))}const aa=new ei,la=function(){return na},ca=function(){if(na!==ta.deferred||!ra)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");na=ta.loading,oa(),ra&&zt({url:ra},e=>{e?sa(e):(na=ta.loaded,oa())})},ha={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>na===ta.loaded||null!=ha.applyArabicShaping,isLoading:()=>na===ta.loading,setState(e){na=e.pluginStatus,ra=e.pluginURL},isParsing:()=>na===ta.parsing,isParsed:()=>na===ta.parsed,getPluginURL:()=>ra};class da{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch,this.brightness=t.brightness,this.worldview=t.worldview):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(e,t){for(const i of e)if(!Qo(i.charCodeAt(0),t))return!1;return!0}(e,ha.isLoaded())}}class ua{constructor(e,t,i,n){this.property=e,this.value=t,this.expression=function(e,t,i,n){if(Ss(e))return new Fs(e,t);if(Is(e)||Array.isArray(e)&&e.length>0){const r=zs(e,t,i,n);if("error"===r.result)throw new Error(r.value.map(e=>`${e.key}: ${e.message}`).join(", "));return r.value}{let i=e;return"string"==typeof e&&"color"===t.type&&(i=si.parse(e)),{kind:"constant",configDependencies:new Set,evaluate:()=>i}}}(void 0===t?e.specification.default:t,e.specification,i,n)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,i){return this.property.possiblyEvaluate(this,e,t,i)}}class fa{constructor(e,t,i){this.property=e,this.value=new ua(e,void 0,t,i)}transitioned(e,t){return new ma(this.property,this.value,t,Re({},e.transition,this.transition),e.now)}untransitioned(){return new ma(this.property,this.value,null,{},0)}}class pa{constructor(e,t,i){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=t,this._options=i,this.configDependencies=new Set}getValue(e){return He(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new fa(this._values[e].property,this._scope,this._options)),this._values[e].value=new ua(this._values[e].property,null===t?void 0:He(t),this._scope,this._options),this._values[e].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].value.expression.configDependencies]))}setTransitionOrValue(e,t){t&&(this._options=t);const i=this._properties.properties;if(e)for(const t in e){const n=e[t];if(t.endsWith("-transition")){const e=t.slice(0,-11);i[e]&&this.setTransition(e,n)}else i.hasOwnProperty(t)&&this.setValue(t,n)}}getTransition(e){return He(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new fa(this._values[e].property)),this._values[e].transition=He(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const i=this.getValue(t);void 0!==i&&(e[t]=i);const n=this.getTransition(t);void 0!==n&&(e[`${t}-transition`]=n)}return e}transitioned(e,t){const i=new ga(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].transitioned(e,t._values[n]);return i}untransitioned(){const e=new ga(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class ma{constructor(e,t,i,n,r){const s=n.delay||0,o=n.duration||0;r=r||0,this.property=e,this.value=t,this.begin=r+s,this.end=this.begin+o,e.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}possiblyEvaluate(e,t,i){const n=e.now||0,r=this.value.possiblyEvaluate(e,t,i),s=this.prior;if(s){if(n>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(n<this.begin)return s.possiblyEvaluate(e,t,i);{const o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(s.possiblyEvaluate(e,t,i),r,Ae(o))}}return r}}class ga{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,i){const n=new va(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].possiblyEvaluate(e,t,i);return n}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class _a{constructor(e,t,i){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._scope=t,this._options=i,this.configDependencies=new Set}getValue(e){return He(this._values[e].value)}setValue(e,t){this._values[e]=new ua(this._values[e].property,null===t?void 0:He(t),this._scope,this._options),this._values[e].expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].expression.configDependencies]))}serialize(){const e={};for(const t of Object.keys(this._values)){const i=this.getValue(t);void 0!==i&&(e[t]=i)}return e}possiblyEvaluate(e,t,i){const n=new va(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].possiblyEvaluate(e,t,i);return n}}class ya{constructor(e,t,i){this.property=e,this.value=t,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,i,n){return this.property.evaluate(this.value,this.parameters,e,t,i,n)}}class va{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class xa{constructor(e){this.specification=e}possiblyEvaluate(e,t){return e.expression.evaluate(t)}interpolate(e,t,i){const n=di[this.specification.type];return n?n(e,t,i):e}}class ba{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,i,n){return new ya(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},i,n)}:e.expression,t)}interpolate(e,t,i){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new ya(this,{kind:"constant",value:void 0},e.parameters);const n=di[this.specification.type];return n?new ya(this,{kind:"constant",value:n(e.value.value,t.value.value,i)},e.parameters):e}evaluate(e,t,i,n,r,s){return"constant"===e.kind?e.value:e.evaluate(t,i,n,r,s)}}class wa{constructor(e){this.specification=e}possiblyEvaluate(e,t,i,n){return!!e.expression.evaluate(t,null,{},i,n)}interpolate(){return!1}}class Sa{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const t=new da(0,{});for(const i in e){const n=e[i];n.specification.overridable&&this.overridableProperties.push(i);const r=this.defaultPropertyValues[i]=new ua(n,void 0),s=this.defaultTransitionablePropertyValues[i]=new fa(n);this.defaultTransitioningPropertyValues[i]=s.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=r.possiblyEvaluate(t)}}}Ws(ba,"DataDrivenProperty"),Ws(xa,"DataConstantProperty"),Ws(wa,"ColorRampProperty");var Ta=JSON.parse('{"$version":8,"$root":{"version":{"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"snow":{"type":"snow"},"rain":{"type":"rain"},"camera":{"type":"camera"},"color-theme":{"type":"colorTheme"},"indoor":{"type":"indoor"},"imports":{"type":"array","value":"import"},"iconsets":{"type":"iconsets"},"schema":{"type":"schema"},"sources":{"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"type":"array","value":"layer"},"models":{"type":"models"},"featuresets":{"type":"featuresets"}},"featuresets":{"*":{"type":"featureset"}},"featureset":{"metadata":{"type":"*"},"selectors":{"type":"array","value":"selector"}},"selector":{"layer":{"type":"string"},"properties":{"type":"selectorProperty"},"featureNamespace":{"type":"string"},"_uniqueFeatureID":{"type":"boolean"}},"selectorProperty":{"*":{"type":"*"}},"model":{"type":"string"},"import":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"config"},"data":{"type":"$root"},"color-theme":{"type":"colorTheme","optional":true}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","expression":{}},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"id":{"type":"string"},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false},"shadow-quality":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"parameters":["zoom"]}},"shadow-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_ambient":{"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"iconsets":{"*":{"type":"iconset"}},"iconset":["iconset_sprite","iconset_source"],"iconset_sprite":{"type":{"type":"enum","values":{"sprite":1}},"url":{"type":"string"}},"iconset_source":{"type":{"type":"enum","values":{"source":1}},"source":{"type":"string"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"type":"enum","values":{"vector":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"type":"enum","values":{"raster":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"type":"enum","values":{"raster-dem":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"type":"enum","values":{"raster-array":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"type":"enum","values":{"video":1}},"urls":{"type":"array","value":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"type":"enum","values":{"image":1}},"url":{"type":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_model":{"type":{"type":"enum","values":{"model":1,"batched-model":1}},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"}},"layer":{"id":{"type":"string"},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"building":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{},"clip":{}}},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"},"appearances":{"type":"array","value":"appearance","supported-layer-types":["symbol"]}},"appearance":{"condition":{"type":"expression"},"name":{"type":"string"},"properties":{"type":"*"}},"layout":["layout_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_building","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}}},"layout_clip":{"clip-layer-types":{"type":"array","value":"enum","values":{"model":1,"symbol":1},"default":[],"expression":{}},"clip-layer-scope":{"type":"array","value":"string","default":[],"expression":{}}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"fill-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-base":1,"hd-road-markup":1},"default":"none","expression":{}},"fill-construct-bridge-guard-rail":{"type":"boolean","default":"true","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"circle-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-markup":1},"default":"none","expression":{}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"fill-extrusion-edge-radius":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}}},"layout_building":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"building-facade":{"type":"boolean","default":false,"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-facade-floors":{"type":"number","minimum":1,"maximum":200,"default":3,"property-type":"data-driven","expression":{"parameters":["feature"]}},"building-facade-window":{"type":"array","length":2,"value":"number","minimum":0.1,"maximum":1,"default":[0.9,0.9],"property-type":"data-driven","expression":{"parameters":["feature"]}},"building-roof-shape":{"type":"enum","values":{"flat":1,"hipped":1,"gabled":1,"parapet":1,"mansard":1,"skillion":1,"pyramidal":1},"default":"flat","expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{},"property-type":"data-driven"},"building-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{},"property-type":"data-driven"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-z-offset":{"type":"number","default":0,"expression":{"parameters":["zoom","feature","line-progress"]},"property-type":"data-driven"},"line-elevation-reference":{"type":"enum","values":{"none":1,"sea":1,"ground":1,"hd-road-markup":1},"default":"none","expression":{}},"line-cross-slope":{"type":"number","expression":{}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"line-width-unit":{"type":"enum","values":{"pixels":1,"meters":1},"default":"pixels","expression":{"parameters":["zoom"]}}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]}},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]}},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]}},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1,"hd-road-markup":1},"default":"ground","expression":{"parameters":["zoom"]}},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"icon-size":{"type":"number","default":1,"minimum":0,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":0.1,"maximum":10,"expression":{}},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"appearance":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":0.1,"maximum":10,"expression":{}},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]}},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]}},"text-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_hillshade":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster-particle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_clip":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_model":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_building":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*"}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"high-color":{"type":"color","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"space-color":{"type":"color","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"horizon-blend":{"type":"number","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"snow":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"center-thinning":{"type":"number","default":0.4,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"flake-size":{"type":"number","default":0.71,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"rain":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"opacity":{"type":"number","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"center-thinning":{"type":"number","default":0.57,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"distortion-strength":{"type":"number","default":0.7,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective"}},"colorTheme":{"data":{"type":"string","expression":{}}},"indoor":{"floorplanFeaturesetId":{"type":"string","expression":{}},"buildingFeaturesetId":{"type":"string","expression":{}}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator"},"center":{"type":"array","length":2,"value":"number","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string"},"exaggeration":{"type":"number","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_building","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-bridge-guard-rail-color":{"type":"color","default":"rgba(241, 236, 225, 255)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"},"fill-tunnel-structure-color":{"type":"color","default":"rgba(241, 236, 225, 255)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","values":{"terrain":1,"flat":1},"default":"flat"},"fill-extrusion-base-alignment":{"type":"enum","values":{"terrain":1,"flat":1},"default":"terrain"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"type":"color","default":"#ffffff","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true}},"paint_building":{"building-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"parameters":[]},"transition":true},"building-ambient-occlusion-ground-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"building-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"building-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-vertical-scale":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-cast-shadows":{"type":"boolean","default":true},"building-color":{"type":"color","default":"rgba(193, 154, 127, 1)","use-theme":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"},"building-emissive-strength":{"type":"number","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"},"building-facade-emissive-chance":{"type":"number","default":0.35,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["measure-light","zoom"]}},"building-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light","line-progress"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-gradient":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["line-progress"]}},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1]},"line-trim-fade-range":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-trim-color":{"type":"color","default":"transparent","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-border-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]}},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"use-theme":true,"expression":{"interpolated":true,"parameters":["heatmap-density"]}},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"icon-image-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{}},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{}},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{}},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["raster-value"]}},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]}},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"raster-array-band":{"type":"string"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string"},"raster-particle-count":{"type":"number","default":512,"minimum":1},"raster-particle-color":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["raster-particle-speed"]}},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]}},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]}},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"hillshade-shadow-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-accent-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_background":{"background-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":[]}},"background-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]}},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]}},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]}},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]}},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]}},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"use-theme":true,"expression":{"interpolated":true,"parameters":["sky-radial-progress"]}},"sky-atmosphere-halo-color":{"type":"color","default":"white","use-theme":true},"sky-atmosphere-color":{"type":"color","default":"white","use-theme":true},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"property-type":"data-driven"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"use-theme":true,"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d"},"model-cast-shadows":{"type":"boolean","default":true},"model-receive-shadows":{"type":"boolean","default":true},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"model-front-cutoff":{"type":"array","value":"number","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"promoteId":{"*":{"type":"*"}}}');function ka(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Ma(e){if(Array.isArray(e))return e.map(Ma);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const i in e)t[i]=Ma(e[i]);return t}return ka(e)}function Aa(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!Aa(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function Ca(e,t="",i=null,n="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Aa(e)||(e=Oa(e));const r=e;let s=!0;try{s=function(e){if(!Ea(e))return e;let t=Ma(e);return La(t),t=Da(t),t}(r)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}let o=null,a=null;if("background"!==n&&"sky"!==n&&"slot"!==n){a=Ta[`filter_${n}`];const e=Ps(s,a,t,i);if("error"===e.result)throw new Error(e.value.map(e=>`${e.key}: ${e.message}`).join(", "));o=(t,i,n)=>e.value.evaluate(t,i,{},n)}let l=null,c=null;if(s!==r){const e=Ps(r,a,t,i);if("error"===e.result)throw new Error(e.value.map(e=>`${e.key}: ${e.message}`).join(", "));l=(t,i,n,r,s)=>e.value.evaluate(t,i,{},n,void 0,void 0,r,s),c=!cr(e.value.expression)}return{filter:o,dynamicFilter:l||void 0,needGeometry:Ra(s),needFeature:!!c}}function Da(e){if(!Array.isArray(e))return e;const t=function(e){if(Ia.has(e[0]))for(let t=1;t<e.length;t++)if(Ea(e[t]))return!0;return e}(e);return!0===t?t:t.map(e=>Da(e))}function La(e){let t=!1;const i=[];if("case"===e[0]){for(let n=1;n<e.length-1;n+=2)t=t||Ea(e[n]),i.push(e[n+1]);i.push(e[e.length-1])}else if("match"===e[0]){t=t||Ea(e[1]);for(let t=2;t<e.length-1;t+=2)i.push(e[t+1]);i.push(e[e.length-1])}else if("step"===e[0]){t=t||Ea(e[1]);for(let t=1;t<e.length-1;t+=2)i.push(e[t+1])}t&&(e.length=0,e.push("any",...i));for(let t=1;t<e.length;t++)La(e[t])}function Ea(e){if(!Array.isArray(e))return!1;if("pitch"===(t=e[0])||"distance-from-center"===t)return!0;var t;for(let t=1;t<e.length;t++)if(Ea(e[t]))return!0;return!1}const Ia=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Pa(e,t){return e<t?-1:e>t?1:0}function Ra(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(Ra(e[t]))return!0;return!1}function Oa(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?za(e[1],e[2],"=="):"!="===t?Ya(za(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?za(e[1],e[2],t):"any"===t?(i=e.slice(1),["any"].concat(i.map(Oa))):"all"===t?["all"].concat(e.slice(1).map(Oa)):"none"===t?["all"].concat(e.slice(1).map(Oa).map(Ya)):"in"===t?Fa(e[1],e.slice(2)):"!in"===t?Ya(Fa(e[1],e.slice(2))):"has"===t?Na(e[1]):"!has"!==t||Ya(Na(e[1]));var i}function za(e,t,i){switch(e){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,e,t]}}function Fa(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?["filter-in-large",e,["literal",t.sort(Pa)]]:["filter-in-small",e,["literal",t]]}}function Na(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Ya(e){return["!",e]}const Ba="";function Ha(e,t){return t?`${e}${Ba}${t}`:e}const ja="-transition",Va=new Set(["fill","line","background","hillshade","raster"]);class Wa extends ei{constructor(e,t,i,n,r){if(super(),this.id=e.id,this.fqid=Ha(this.id,i),this.type=e.type,this.scope=i,this.lut=n,this.options=r,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.configDependencies=new Set,"custom"!==e.type){if(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type&&"background"!==e.type&&"sky"!==e.type&&"slot"!==e.type){this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter;const t=Ps(this.filter,Ta[`filter_${e.type}`]);"error"!==t.result&&(this.configDependencies=new Set([...this.configDependencies,...t.value.configDependencies]))}if(e.slot&&(this.slot=e.slot),t.layout&&(this._unevaluatedLayout=new _a(t.layout,this.scope,r),this.configDependencies=new Set([...this.configDependencies,...this._unevaluatedLayout.configDependencies])),t.paint){this._transitionablePaint=new pa(t.paint,this.scope,r);for(const t in e.paint)this.setPaintProperty(t,e.paint[t]);for(const t in e.layout)this.setLayoutProperty(t,e.layout[t]);this.configDependencies=new Set([...this.configDependencies,...this._transitionablePaint.configDependencies]),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new va(t.paint)}}}onAdd(e){}onRemove(e){}isDraped(e){return!this.is3D(!0)&&Va.has(this.type)}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){if("custom"===this.type&&"visibility"===e)return void(this.visibility=t);const i=this._unevaluatedLayout;i._properties.properties[e]&&(i.setValue(e,t),this.configDependencies=new Set([...this.configDependencies,...i.configDependencies]),"visibility"===e&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}))}getPaintProperty(e){return e.endsWith(ja)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t){const i=this._transitionablePaint,n=i._properties.properties;if(e.endsWith(ja)){const r=e.slice(0,-11);return n[r]&&i.setTransition(r,t||void 0),!1}if(!n[e])return!1;const r=i._values[e],s=r.value.isDataDriven(),o=r.value;i.setValue(e,t),this.configDependencies=new Set([...this.configDependencies,...i.configDependencies]),this._handleSpecialPaintPropertyUpdate(e);const a=i._values[e].value,l=a.isDataDriven(),c=e.endsWith("pattern")||"line-dasharray"===e;return l||s||c||this._handleOverridablePaintPropertyUpdate(e,o,a)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,t,i){return null}_handleOverridablePaintPropertyUpdate(e,t,i){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){return Be({id:this.id,type:this.type,slot:this.slot,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()},(e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length))}is3D(e){return!1}hasElevation(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}_clear(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof ya&&vs(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}compileFilter(e){this._filterCompiled||(this._featureFilter=Ca(this.filter,this.scope,e),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&("shadow"===e.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(e){}queryIntersectsFeature(e,t,i,n,r,s,o,a,l){}}const Ua={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class $a{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ga{constructor(){this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&t.add(e.arrayBuffer),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...e){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...e){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function Xa(e,t=1){let i=0,n=0;return{members:e.map(e=>{const r=Ua[e.type].BYTES_PER_ELEMENT,s=i=qa(i,Math.max(t,r)),o=e.components||1;return n=Math.max(n,r),i+=r*o,{name:e.name,type:e.type,components:o,offset:s}}),size:qa(i,Math.max(n,t)),alignment:t}}function qa(e,t){return Math.ceil(e/t)*t}class Za extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const n=2*e;return this.int16[n+0]=t,this.int16[n+1]=i,e}}Za.prototype.bytesPerElement=4,Ws(Za,"StructArrayLayout2i4");class Ja extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=3*e;return this.int16[r+0]=t,this.int16[r+1]=i,this.int16[r+2]=n,e}}Ja.prototype.bytesPerElement=6,Ws(Ja,"StructArrayLayout3i6");class Ka extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const s=4*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.int16[s+2]=n,this.int16[s+3]=r,e}}Ka.prototype.bytesPerElement=8,Ws(Ka,"StructArrayLayout4i8");class Qa extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}Qa.prototype.bytesPerElement=4,Ws(Qa,"StructArrayLayout1f4");class el extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=4*e,s=2*e;return this.int16[r+0]=t,this.int16[r+1]=i,this.float32[s+1]=n,e}}el.prototype.bytesPerElement=8,Ws(el,"StructArrayLayout2i1f8");class tl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=4*e;return this.int16[r+0]=t,this.int16[r+1]=i,this.int16[r+2]=n,e}}tl.prototype.bytesPerElement=8,Ws(tl,"StructArrayLayout3i8");class il extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r)}emplace(e,t,i,n,r,s){const o=5*e;return this.int16[o+0]=t,this.int16[o+1]=i,this.int16[o+2]=n,this.int16[o+3]=r,this.int16[o+4]=s,e}}il.prototype.bytesPerElement=10,Ws(il,"StructArrayLayout5i10");class nl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,n,r,s,o)}emplace(e,t,i,n,r,s,o,a){const l=6*e,c=12*e,h=3*e;return this.int16[l+0]=t,this.int16[l+1]=i,this.uint8[c+4]=n,this.uint8[c+5]=r,this.uint8[c+6]=s,this.uint8[c+7]=o,this.float32[h+2]=a,e}}nl.prototype.bytesPerElement=12,Ws(nl,"StructArrayLayout2i4ub1f12");class rl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=3*e;return this.float32[r+0]=t,this.float32[r+1]=i,this.float32[r+2]=n,e}}rl.prototype.bytesPerElement=12,Ws(rl,"StructArrayLayout3f12");class sl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r)}emplace(e,t,i,n,r,s){const o=6*e,a=3*e;return this.uint16[o+0]=t,this.uint16[o+1]=i,this.uint16[o+2]=n,this.uint16[o+3]=r,this.float32[a+2]=s,e}}sl.prototype.bytesPerElement=12,Ws(sl,"StructArrayLayout4ui1f12");class ol extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const s=4*e;return this.uint16[s+0]=t,this.uint16[s+1]=i,this.uint16[s+2]=n,this.uint16[s+3]=r,e}}ol.prototype.bytesPerElement=8,Ws(ol,"StructArrayLayout4ui8");class al extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r,s)}emplace(e,t,i,n,r,s,o){const a=6*e;return this.int16[a+0]=t,this.int16[a+1]=i,this.int16[a+2]=n,this.int16[a+3]=r,this.int16[a+4]=s,this.int16[a+5]=o,e}}al.prototype.bytesPerElement=12,Ws(al,"StructArrayLayout6i12");class ll extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s,o,a,l,c,h,d){const u=this.length;return this.resize(u+1),this.emplace(u,e,t,i,n,r,s,o,a,l,c,h,d)}emplace(e,t,i,n,r,s,o,a,l,c,h,d,u){const f=12*e;return this.int16[f+0]=t,this.int16[f+1]=i,this.int16[f+2]=n,this.int16[f+3]=r,this.uint16[f+4]=s,this.uint16[f+5]=o,this.uint16[f+6]=a,this.uint16[f+7]=l,this.int16[f+8]=c,this.int16[f+9]=h,this.int16[f+10]=d,this.int16[f+11]=u,e}}ll.prototype.bytesPerElement=24,Ws(ll,"StructArrayLayout4i4ui4i24");class cl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r,s)}emplace(e,t,i,n,r,s,o){const a=10*e,l=5*e;return this.int16[a+0]=t,this.int16[a+1]=i,this.int16[a+2]=n,this.float32[l+2]=r,this.float32[l+3]=s,this.float32[l+4]=o,e}}cl.prototype.bytesPerElement=20,Ws(cl,"StructArrayLayout3i3f20");class hl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const s=4*e;return this.float32[s+0]=t,this.float32[s+1]=i,this.float32[s+2]=n,this.float32[s+3]=r,e}}hl.prototype.bytesPerElement=16,Ws(hl,"StructArrayLayout4f16");class dl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}dl.prototype.bytesPerElement=4,Ws(dl,"StructArrayLayout1ul4");class ul extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=i,e}}ul.prototype.bytesPerElement=4,Ws(ul,"StructArrayLayout2ui4");class fl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s,o,a,l,c,h,d,u){const f=this.length;return this.resize(f+1),this.emplace(f,e,t,i,n,r,s,o,a,l,c,h,d,u)}emplace(e,t,i,n,r,s,o,a,l,c,h,d,u,f){const p=20*e,m=10*e;return this.int16[p+0]=t,this.int16[p+1]=i,this.int16[p+2]=n,this.int16[p+3]=r,this.int16[p+4]=s,this.float32[m+3]=o,this.float32[m+4]=a,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[p+14]=h,this.uint32[m+8]=d,this.uint16[p+18]=u,this.uint16[p+19]=f,e}}fl.prototype.bytesPerElement=40,Ws(fl,"StructArrayLayout5i4f1i1ul2ui40");class pl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,n,r,s,o)}emplace(e,t,i,n,r,s,o,a){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=i,this.int16[l+2]=n,this.int16[l+4]=r,this.int16[l+5]=s,this.int16[l+6]=o,this.int16[l+7]=a,e}}pl.prototype.bytesPerElement=16,Ws(pl,"StructArrayLayout3i2i2i16");class ml extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r)}emplace(e,t,i,n,r,s){const o=4*e,a=8*e;return this.float32[o+0]=t,this.float32[o+1]=i,this.float32[o+2]=n,this.int16[a+6]=r,this.int16[a+7]=s,e}}ml.prototype.bytesPerElement=16,Ws(ml,"StructArrayLayout2f1f2i16");class gl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r,s)}emplace(e,t,i,n,r,s,o){const a=20*e,l=5*e;return this.uint8[a+0]=t,this.uint8[a+1]=i,this.float32[l+1]=n,this.float32[l+2]=r,this.float32[l+3]=s,this.float32[l+4]=o,e}}gl.prototype.bytesPerElement=20,Ws(gl,"StructArrayLayout2ub4f20");class _l extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=3*e;return this.uint16[r+0]=t,this.uint16[r+1]=i,this.uint16[r+2]=n,e}}_l.prototype.bytesPerElement=6,Ws(_l,"StructArrayLayout3ui6");class yl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x){const b=this.length;return this.resize(b+1),this.emplace(b,e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x)}emplace(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x,b){const w=30*e,S=15*e,T=60*e;return this.int16[w+0]=t,this.int16[w+1]=i,this.int16[w+2]=n,this.float32[S+2]=r,this.float32[S+3]=s,this.uint16[w+8]=o,this.uint16[w+9]=a,this.uint32[S+5]=l,this.uint32[S+6]=c,this.uint32[S+7]=h,this.uint16[w+16]=d,this.uint16[w+17]=u,this.uint16[w+18]=f,this.float32[S+10]=p,this.float32[S+11]=m,this.uint8[T+48]=g,this.uint8[T+49]=_,this.uint8[T+50]=y,this.uint32[S+13]=v,this.int16[w+28]=x,this.uint8[T+58]=b,e}}yl.prototype.bytesPerElement=60,Ws(yl,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class vl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x,b,w,S,T,k,M,A,C,D,L,E,I){const P=this.length;return this.resize(P+1),this.emplace(P,e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x,b,w,S,T,k,M,A,C,D,L,E,I)}emplace(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x,b,w,S,T,k,M,A,C,D,L,E,I,P){const R=20*e,O=40*e,z=80*e;return this.float32[R+0]=t,this.float32[R+1]=i,this.int16[O+4]=n,this.int16[O+5]=r,this.int16[O+6]=s,this.int16[O+7]=o,this.int16[O+8]=a,this.int16[O+9]=l,this.int16[O+10]=c,this.int16[O+11]=h,this.int16[O+12]=d,this.uint16[O+13]=u,this.uint16[O+14]=f,this.uint16[O+15]=p,this.uint16[O+16]=m,this.uint16[O+17]=g,this.uint16[O+18]=_,this.uint16[O+19]=y,this.uint16[O+20]=v,this.uint16[O+21]=x,this.uint16[O+22]=b,this.uint16[O+23]=w,this.uint16[O+24]=S,this.uint16[O+25]=T,this.uint16[O+26]=k,this.uint16[O+27]=M,this.uint32[R+14]=A,this.float32[R+15]=C,this.float32[R+16]=D,this.float32[R+17]=L,this.float32[R+18]=E,this.uint8[z+76]=I,this.uint16[O+39]=P,e}}vl.prototype.bytesPerElement=80,Ws(vl,"StructArrayLayout2f9i15ui1ul4f1ub1ui80");class xl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r,s)}emplace(e,t,i,n,r,s,o){const a=6*e;return this.float32[a+0]=t,this.float32[a+1]=i,this.float32[a+2]=n,this.float32[a+3]=r,this.float32[a+4]=s,this.float32[a+5]=o,e}}xl.prototype.bytesPerElement=24,Ws(xl,"StructArrayLayout6f24");class bl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r)}emplace(e,t,i,n,r,s){const o=5*e;return this.float32[o+0]=t,this.float32[o+1]=i,this.float32[o+2]=n,this.float32[o+3]=r,this.float32[o+4]=s,e}}bl.prototype.bytesPerElement=20,Ws(bl,"StructArrayLayout5f20");class wl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,n,r,s,o)}emplace(e,t,i,n,r,s,o,a){const l=7*e;return this.float32[l+0]=t,this.float32[l+1]=i,this.float32[l+2]=n,this.float32[l+3]=r,this.float32[l+4]=s,this.float32[l+5]=o,this.float32[l+6]=a,e}}wl.prototype.bytesPerElement=28,Ws(wl,"StructArrayLayout7f28");class Sl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s,o,a,l,c,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,i,n,r,s,o,a,l,c,h)}emplace(e,t,i,n,r,s,o,a,l,c,h,d){const u=11*e;return this.float32[u+0]=t,this.float32[u+1]=i,this.float32[u+2]=n,this.float32[u+3]=r,this.float32[u+4]=s,this.float32[u+5]=o,this.float32[u+6]=a,this.float32[u+7]=l,this.float32[u+8]=c,this.float32[u+9]=h,this.float32[u+10]=d,e}}Sl.prototype.bytesPerElement=44,Ws(Sl,"StructArrayLayout11f44");class Tl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s,o,a,l){const c=this.length;return this.resize(c+1),this.emplace(c,e,t,i,n,r,s,o,a,l)}emplace(e,t,i,n,r,s,o,a,l,c){const h=9*e;return this.float32[h+0]=t,this.float32[h+1]=i,this.float32[h+2]=n,this.float32[h+3]=r,this.float32[h+4]=s,this.float32[h+5]=o,this.float32[h+6]=a,this.float32[h+7]=l,this.float32[h+8]=c,e}}Tl.prototype.bytesPerElement=36,Ws(Tl,"StructArrayLayout9f36");class kl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const n=2*e;return this.float32[n+0]=t,this.float32[n+1]=i,e}}kl.prototype.bytesPerElement=8,Ws(kl,"StructArrayLayout2f8");class Ml extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const s=6*e;return this.uint32[3*e+0]=t,this.uint16[s+2]=i,this.uint16[s+3]=n,this.uint16[s+4]=r,e}}Ml.prototype.bytesPerElement=12,Ws(Ml,"StructArrayLayout1ul3ui12");class Al extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}Al.prototype.bytesPerElement=2,Ws(Al,"StructArrayLayout1ui2");class Cl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m)}emplace(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g){const _=16*e;return this.float32[_+0]=t,this.float32[_+1]=i,this.float32[_+2]=n,this.float32[_+3]=r,this.float32[_+4]=s,this.float32[_+5]=o,this.float32[_+6]=a,this.float32[_+7]=l,this.float32[_+8]=c,this.float32[_+9]=h,this.float32[_+10]=d,this.float32[_+11]=u,this.float32[_+12]=f,this.float32[_+13]=p,this.float32[_+14]=m,this.float32[_+15]=g,e}}Cl.prototype.bytesPerElement=64,Ws(Cl,"StructArrayLayout16f64");class Dl extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,s,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,n,r,s,o)}emplace(e,t,i,n,r,s,o,a){const l=10*e,c=5*e;return this.uint16[l+0]=t,this.uint16[l+1]=i,this.uint16[l+2]=n,this.uint16[l+3]=r,this.float32[c+2]=s,this.float32[c+3]=o,this.float32[c+4]=a,e}}Dl.prototype.bytesPerElement=20,Ws(Dl,"StructArrayLayout4ui3f20");class Ll extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.int16[1*e+0]=t,e}}Ll.prototype.bytesPerElement=2,Ws(Ll,"StructArrayLayout1i2");class El extends Ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint8[1*e+0]=t,e}}El.prototype.bytesPerElement=1,Ws(El,"StructArrayLayout1ub1");class Il extends $a{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Il.prototype.size=40;class Pl extends fl{get(e){return new Il(this,e)}}Ws(Pl,"CollisionBoxArray");class Rl extends $a{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}Rl.prototype.size=60;class Ol extends yl{get(e){return new Rl(this,e)}}Ws(Ol,"PlacedSymbolArray");class zl extends $a{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}get elevationFeatureIndex(){return this._structArray.uint16[this._pos2+39]}}zl.prototype.size=80;class Fl extends vl{get(e){return new zl(this,e)}}Ws(Fl,"SymbolInstanceArray");class Nl extends Qa{getoffsetX(e){return this.float32[1*e+0]}}Ws(Nl,"GlyphOffsetArray");class Yl extends Za{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Ws(Yl,"SymbolLineVertexArray");class Bl extends $a{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Bl.prototype.size=12;class Hl extends Ml{get(e){return new Bl(this,e)}}Ws(Hl,"FeatureIndexArray");class jl extends ul{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Ws(jl,"FillExtrusionCentroidArray");class Vl extends $a{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}Vl.prototype.size=6;class Wl extends Ja{get(e){return new Vl(this,e)}}Ws(Wl,"FillExtrusionWallArray");const Ul=Xa([{name:"a_pos",components:2,type:"Int16"}],4),$l=Xa([{name:"a_circle_z_offset",components:1,type:"Float32"}],4),Gl=Xa([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class Xl{constructor(e=[]){this.segments=e}_prepareSegment(e,t,i,n){let r=this.segments[this.segments.length-1];return e>Xl.MAX_VERTEX_ARRAY_LENGTH&&We(`Max vertices per segment is ${Xl.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!r||r.vertexLength+e>Xl.MAX_VERTEX_ARRAY_LENGTH||r.sortKey!==n)&&(r={vertexOffset:t,primitiveOffset:i,vertexLength:0,primitiveLength:0},void 0!==n&&(r.sortKey=n),this.segments.push(r)),r}prepareSegment(e,t,i,n){return this._prepareSegment(e,t.length,i.length,n)}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,i,n){return new Xl([{vertexOffset:e,primitiveOffset:t,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}}function ql(e,t){return 256*(e=Le(Math.floor(e),0,255))+Le(Math.floor(t),0,255)}Xl.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ws(Xl,"SegmentVector");const Zl=Xa([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Jl=Xa([{name:"a_pattern_b",components:4,type:"Uint16"}]),Kl=Xa([{name:"a_dash",components:4,type:"Uint16"}]);class Ql{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,t,i,n){this.ids.push(ec(e)),this.positions.push(t,i,n)}eachPosition(e,t){const i=ec(e);let n=0,r=this.ids.length-1;for(;n<r;){const e=n+r>>1;this.ids[e]>=i?r=e:n=e+1}for(;this.ids[n]===i;)t(this.positions[3*n],this.positions[3*n+1],this.positions[3*n+2]),n++}static serialize(e,t){const i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return tc(i,n,0,i.length-1),t&&(t.add(i.buffer),t.add(n.buffer)),{ids:i,positions:n}}static deserialize(e){const t=new Ql;let i;t.ids=e.ids,t.positions=e.positions;for(const e of t.ids)e!==i&&t.uniqueIds.push(e),i=e;return t.indexed=!0,t}}function ec(e){const t=+e;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:qt(String(e))}function tc(e,t,i,n){for(;i<n;){const r=e[i+n>>1];let s=i-1,o=n+1;for(;;){do{s++}while(e[s]<r);do{o--}while(e[o]>r);if(s>=o)break;ic(e,s,o),ic(t,3*s,3*o),ic(t,3*s+1,3*o+1),ic(t,3*s+2,3*o+2)}o-i<n-o?(tc(e,t,i,o),i=o+1):(tc(e,t,o+1,n),n=o)}}function ic(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}Ws(Ql,"FeaturePositionMap");class nc{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,t){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,t),this.initialized=!0),!!this.location}set(e,t,i){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class rc extends nc{constructor(e){super(e),this.current=0}set(e,t,i){this.fetchUniformLocation(e,t)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}}class sc extends nc{constructor(e){super(e),this.current=0}set(e,t,i){this.fetchUniformLocation(e,t)&&this.current!==i&&(this.current=i,this.gl.uniform1f(this.location,i))}}class oc extends nc{constructor(e){super(e),this.current=[0,0]}set(e,t,i){this.fetchUniformLocation(e,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}}class ac extends nc{constructor(e){super(e),this.current=[0,0,0]}set(e,t,i){this.fetchUniformLocation(e,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}}class lc extends nc{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,i){this.fetchUniformLocation(e,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]&&i[3]===this.current[3]||(this.current=i,this.gl.uniform4f(this.location,i[0],i[1],i[2],i[3])))}}class cc extends nc{constructor(e){super(e),this.current=si.transparent.toPremultipliedRenderColor(null)}set(e,t,i){this.fetchUniformLocation(e,t)&&(i.r===this.current.r&&i.g===this.current.g&&i.b===this.current.b&&i.a===this.current.a||(this.current=i,this.gl.uniform4f(this.location,i.r,i.g,i.b,i.a)))}}const hc=new Float32Array(16);class dc extends nc{constructor(e){super(e),this.current=hc}set(e,t,i){if(this.fetchUniformLocation(e,t)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}}const uc=new Float32Array(9),fc=new Float32Array(4);class pc extends nc{constructor(e){super(e),this.current=fc}set(e,t,i){if(this.fetchUniformLocation(e,t))for(let e=0;e<4;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}function mc(e){return[ql(255*e.r,255*e.g),ql(255*e.b,255*e.a)]}class gc{constructor(e,t,i,n){this.value=e,this.uniformNames=t.map(e=>`u_${e}`),this.type=i,this.context=n}setUniform(e,t,i,n,r){const s=n.constantOr(this.value);t.set(e,r,s instanceof si?s.toPremultipliedRenderColor(this.lutExpression&&"none"===this.lutExpression.value?null:this.context.lut):s)}getBinding(e,t){return"color"===this.type?new cc(e):new sc(e)}}class _c{constructor(e,t){this.uniformNames=t.map(e=>`u_${e}`),this.pattern=null,this.patternTransition=null,this.pixelRatio=1}setConstantPatternPositions(e,t){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br),this.patternTransition=t?t.tl.concat(t.br):this.pattern}setUniform(e,t,i,n,r){let s=null;"u_pattern"!==r&&"u_dash"!==r||(s=this.pattern),"u_pattern_b"===r&&(s=this.patternTransition),"u_pixel_ratio"===r&&(s=this.pixelRatio),s&&t.set(e,r,s)}getBinding(e,t){return"u_pattern"===t||"u_pattern_b"===t||"u_dash"===t?new lc(e):new sc(e)}}class yc{constructor(e,t,i,n){this.expression=e,this.type=i,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===i?2:1,offset:0})),this.paintVertexArray=new n}populatePaintArray(e,t,i,n,r,s,o,a){const l=this.paintVertexArray.length,c="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate(new da(0,{brightness:s,worldview:a}),t,{},r,n,o):"constant"===this.expression.kind&&this.expression.value,h=!!this.lutExpression&&"none"===("composite"===this.lutExpression.kind||"source"===this.lutExpression.kind?this.lutExpression.evaluate(new da(0,{brightness:s,worldview:a}),t,{},r,n,o):this.lutExpression.value);this.paintVertexArray.resize(e),this._setPaintValue(l,e,c,h?null:this.context.lut)}updatePaintArray(e,t,i,n,r,s,o,a){const l="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate({zoom:0,brightness:o,worldview:a},i,n,void 0,r):"constant"===this.expression.kind&&this.expression.value,c=!!this.lutExpression&&"none"===("composite"===this.lutExpression.kind||"source"===this.lutExpression.kind?this.lutExpression.evaluate(new da(0,{brightness:o,worldview:a}),i,n,void 0,r):this.lutExpression.value);this._setPaintValue(e,t,l,c?null:this.context.lut)}_setPaintValue(e,t,i,n){if("color"===this.type){const r=mc(i.toPremultipliedRenderColor(n));for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r[0],r[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.lutExpression&&"constant"!==this.lutExpression.kind&&(this.lutExpression.isStateDependent||!this.lutExpression.isLightConstant)||"constant"!==this.expression.kind&&(this.expression.isStateDependent||!this.expression.isLightConstant)))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class vc{constructor(e,t,i,n,r,s){this.expression=e,this.uniformNames=t.map(e=>`u_${e}_t`),this.type=i,this.useIntegerZoom=n,this.context=r,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===i?4:2,offset:0})),this.paintVertexArray=new s}populatePaintArray(e,t,i,n,r,s,o,a){const l=this.expression.evaluate(new da(this.context.zoom,{brightness:s,worldview:a}),t,{},r,n,o),c=this.expression.evaluate(new da(this.context.zoom+1,{brightness:s,worldview:a}),t,{},r,n,o),h=!!this.lutExpression&&"none"===("composite"===this.lutExpression.kind||"source"===this.lutExpression.kind?this.lutExpression.evaluate(new da(0,{brightness:s,worldview:a}),t,{},r,n,o):this.lutExpression.value),d=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(d,e,l,c,h?null:this.context.lut)}updatePaintArray(e,t,i,n,r,s,o,a){const l=this.expression.evaluate({zoom:this.context.zoom,brightness:o,worldview:a},i,n,void 0,r),c=this.expression.evaluate({zoom:this.context.zoom+1,brightness:o,worldview:a},i,n,void 0,r),h=!!this.lutExpression&&"none"===("composite"===this.lutExpression.kind||"source"===this.lutExpression.kind?this.lutExpression.evaluate(new da(0,{brightness:o,worldview:a}),i,n,void 0,r):this.lutExpression.value);this._setPaintValue(e,t,l,c,h?null:this.context.lut)}_setPaintValue(e,t,i,n,r){if("color"===this.type){const n=mc(i.toPremultipliedRenderColor(r)),s=mc(i.toPremultipliedRenderColor(r));for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,n[0],n[1],s[0],s[1])}else{for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i,n);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t,i,n,r){const s=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,o=Le(this.expression.interpolationFactor(s,this.context.zoom,this.context.zoom+1),0,1);t.set(e,r,o)}getBinding(e,t){return new sc(e)}}class xc{constructor(e,t,i,n,r){this.expression=e,this.layerId=r,this.paintVertexAttributes=("array"===i?Kl:Zl).members;for(let e=0;e<t.length;++e);this.paintVertexArray=new n,this.paintTransitionVertexArray=new ol}populatePaintArray(e,t,i,n){const r=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(r,e,t.patterns&&t.patterns[this.layerId],i)}updatePaintArray(e,t,i,n,r,s,o){this._setPaintValues(e,t,i.patterns&&i.patterns[this.layerId],s)}_setPaintValues(e,t,i,n){if(!n||!i)return;const r=n[i[0]],s=n[i[1]];if(r){if(r){const{tl:i,br:n,pixelRatio:s}=r;for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1],n[0],n[1],s)}if(s){this.paintTransitionVertexArray.resize(this.paintVertexArray.length);const{tl:i,br:n}=s;for(let r=e;r<t;r++)this.paintTransitionVertexArray.emplace(r,i[0],i[1],n[0],n[1])}}}upload(e){const t=this.expression.isStateDependent||!this.expression.isLightConstant;this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,t)),this.paintTransitionVertexArray&&this.paintTransitionVertexArray.length&&(this.paintTransitionVertexBuffer=e.createVertexBuffer(this.paintTransitionVertexArray,Jl.members,t))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy(),this.paintTransitionVertexBuffer&&this.paintTransitionVertexBuffer.destroy()}}class bc{constructor(e,t,i=()=>!0){this.binders={},this._buffers=[],this.context=t;const n=[];for(const r in e.paint._values){const s=e.paint.get(r);if(r.endsWith("-use-theme"))continue;if(!i(r))continue;if(!(s instanceof ya&&vs(s.property.specification)))continue;const o=Tc(r,e.type),a=s.value,l=s.property.specification.type,c=!!s.property.useIntegerZoom,h="line-dasharray"===r||r.endsWith("pattern"),d=e.paint.get(`${r}-use-theme`),u="line-dasharray"===r&&"constant"!==e.layout.get("line-cap").value.kind||d&&"constant"!==d.value.kind;if("constant"!==a.kind||u)if("source"===a.kind||u||h){const t=Ac(r,l,"source");this.binders[r]=h?new xc(a,o,l,t,e.id):new yc(a,o,l,t),n.push(`/a_${r}`)}else{const e=Ac(r,l,"composite");this.binders[r]=new vc(a,o,l,c,t,e),n.push(`/z_${r}`)}else this.binders[r]=h?new _c(a.value,o):new gc(a.value,o,l,t),n.push(`/u_${r}`);d&&(this.binders[r].lutExpression=d.value)}this.cacheKey=n.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof yc||t instanceof vc?t.maxValue:0}populatePaintArrays(e,t,i,n,r,s,o,a){for(const l in this.binders){const c=this.binders[l];c.context=this.context,(c instanceof yc||c instanceof vc||c instanceof xc)&&c.populatePaintArray(e,t,i,n,r,s,o,a)}}setConstantPatternPositions(e,t){for(const i in this.binders){const n=this.binders[i];n instanceof _c&&n.setConstantPatternPositions(e,t)}}getPatternTransitionVertexBuffer(e){const t=this.binders[e];return t instanceof xc?t.paintTransitionVertexBuffer:null}updatePaintArrays(e,t,i,n,r,s,o,a,l,c){let h=!1;const d=Object.keys(e),u=0!==d.length&&!a,f=u?d:t.uniqueIds;this.context.lut=r.lut;for(const a in this.binders){const d=this.binders[a];if(d.context=this.context,(d instanceof yc||d instanceof vc||d instanceof xc)&&d.expression&&d.expression.kind&&"constant"!==d.expression.kind&&(!0===d.expression.isStateDependent||!1===d.expression.isLightConstant)){const p=r.paint.get(a);d.expression=p.value;for(const i of f){const r=e[i.toString()];t.eachPosition(i,(e,t,i)=>{const a=n.feature(e);d.updatePaintArray(t,i,a,r,s,o,l,c)})}if(!u)for(const t of i.uniqueIds){const r=e[t.toString()];i.eachPosition(t,(e,t,i)=>{const a=n.feature(e);d.updatePaintArray(t,i,a,r,s,o,l,c)})}h=!0}}return h}defines(){const e=[];for(const t in this.binders){const i=this.binders[t];(i instanceof gc||i instanceof _c)&&e.push(...i.uniformNames.map(e=>`#define HAS_UNIFORM_${e}`))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const i=this.binders[t];if(i instanceof yc||i instanceof vc||i instanceof xc)for(let t=0;t<i.paintVertexAttributes.length;t++)e.push(i.paintVertexAttributes[t].name);if(i instanceof xc)for(let t=0;t<Jl.members.length;t++)e.push(Jl.members[t].name)}return e}getBinderUniforms(){const e=[];for(const t in this.binders){const i=this.binders[t];if(i instanceof gc||i instanceof _c||i instanceof vc)for(const t of i.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const t=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof gc||n instanceof _c||n instanceof vc)for(const r of n.uniformNames)t.push({name:r,property:i,binding:n.getBinding(e,r)})}return t}setUniforms(e,t,i,n,r){for(const{name:t,property:s,binding:o}of i)this.binders[s].setUniform(e,o,r,n.get(s),t)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const t=this.binders[e];(t instanceof yc||t instanceof vc||t instanceof xc)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer),t instanceof xc&&t.paintTransitionVertexBuffer&&this._buffers.push(t.paintTransitionVertexBuffer)}}upload(e){for(const t in this.binders){const i=this.binders[t];(i instanceof yc||i instanceof vc||i instanceof xc)&&i.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof yc||t instanceof vc||t instanceof xc)&&t.destroy()}}}class wc{constructor(e,t,i=()=>!0){this.programConfigurations={};for(const n of e)this.programConfigurations[n.id]=new bc(n,t,i);this.needsUpload=!1,this._featureMap=new Ql,this._featureMapWithoutIds=new Ql,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,t,i,n,r,s,o,a,l){for(const i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(e,t,n,r,s,o,a,l);void 0!==t.id?this._featureMap.add(t.id,i,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,i,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,i,n,r,s,o,a){for(const l of i)this.needsUpload=this.programConfigurations[l.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,t,l,n,r,s,o||0,a)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Sc={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"symbol-z-offset":["z_offset"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio","pattern_b"],"fill-pattern":["pattern","pixel_ratio","pattern_b"],"fill-extrusion-pattern":["pattern","pixel_ratio","pattern_b"],"line-dasharray":["dash"],"fill-bridge-guard-rail-color":["structure_color"],"fill-tunnel-structure-color":["structure_color"]};function Tc(e,t){return Sc[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const kc={"line-pattern":{source:sl,composite:sl},"fill-pattern":{source:sl,composite:sl},"fill-extrusion-pattern":{source:sl,composite:sl},"line-dasharray":{source:ol,composite:ol}},Mc={color:{source:kl,composite:hl},number:{source:Qa,composite:kl}};function Ac(e,t,i){const n=kc[e];return n&&n[i]||Mc[t][i]}Ws(gc,"ConstantBinder"),Ws(_c,"PatternConstantBinder"),Ws(yc,"SourceExpressionBinder"),Ws(xc,"PatternCompositeBinder"),Ws(vc,"CompositeExpressionBinder"),Ws(bc,"ProgramConfiguration",{omit:["_buffers"]}),Ws(wc,"ProgramConfigurationSet");const Cc=Rn/Math.PI/2,Dc=64,Lc=[Dc,32,16],Ec=-Cc,Ic=Cc;function Pc(e,t,i,n=Cc){return i=Te(i),[e*Math.sin(i)*n,-t*n,e*Math.cos(i)*n]}function Rc(e,t,i){return Pc(Math.cos(Te(e)),Math.sin(Te(e)),t,i)}const Oc=6371008.8,zc=2*Math.PI*Oc;class Fc{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Fc(Ie(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,i=this.lat*t,n=e.lat*t,r=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return Oc*Math.acos(Math.min(r,1))}toBounds(e=0){const t=360*e/40075017,i=t/Math.cos(Math.PI/180*this.lat);return new Nc({lng:this.lng-i,lat:this.lat-t},{lng:this.lng+i,lat:this.lat+t})}toEcef(e){return Rc(this.lat,this.lng,Cc+e*Cc/Oc)}static convert(e){if(e instanceof Fc)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Fc(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Fc(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class Nc{constructor(e,t){if(e)if(t)this.setSouthWest(e).setNorthEast(t);else if(4===e.length){const t=e;this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]])}else{const t=e;this.setSouthWest(t[0]).setNorthEast(t[1])}}setNorthEast(e){return this._ne=e instanceof Fc?new Fc(e.lng,e.lat):Fc.convert(e),this}setSouthWest(e){return this._sw=e instanceof Fc?new Fc(e.lng,e.lat):Fc.convert(e),this}extend(e){const t=this._sw,i=this._ne;let n,r;if(e instanceof Fc)n=e,r=e;else{if(!(e instanceof Nc))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(Nc.convert(e)):this.extend(Fc.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(Fc.convert(e)):this;if(n=e._sw,r=e._ne,!n||!r)return this}return t||i?(t.lng=Math.min(n.lng,t.lng),t.lat=Math.min(n.lat,t.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Fc(n.lng,n.lat),this._ne=new Fc(r.lng,r.lat)),this}getCenter(){return new Fc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Fc(this.getWest(),this.getNorth())}getSouthEast(){return new Fc(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:i}=Fc.convert(e);let n=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n}static convert(e){if(e)return e instanceof Nc?e:new Nc(e)}}function Yc(e){return zc*Math.cos(e*Math.PI/180)}function Bc(e){return(180+e)/360}function Hc(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function jc(e,t){return e/Yc(t)}function Vc(e){return 360*e-180}function Wc(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function Uc(e,t){return e*Yc(Wc(t))}const $c=85.051129;function Gc(e){return Math.cos(Te(Le(e,-$c,$c)))}function Xc(e,t){const i=Le(t,0,25.5),n=Math.pow(2,i);return Gc(e)*zc/(512*n)}function qc(e){return 1/Math.cos(e*Math.PI/180)}function Zc(e,t=0){const i=Math.exp(Math.PI*(1-(e.y+t/Rn)/(1<<e.z)*2));return 80150034*i/(i*i+1)/Rn/(1<<e.z)}class Jc{constructor(e,t,i=0){this.x=+e,this.y=+t,this.z=+i}static fromLngLat(e,t=0){const i=Fc.convert(e);return new Jc(Bc(i.lng),Hc(i.lat),jc(t,i.lat))}toLngLat(){return new Fc(Vc(this.x),Wc(this.y))}toAltitude(){return Uc(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/zc*qc(Wc(this.y))}}function Kc(e,t,i,n,r,s,o,a,l){const c=(t+n)/2,h=(i+r)/2,d=new xe(c,h);a(d),function(e,t,i,n,r,s){const o=i-r,a=n-s;return Math.abs((n-t)*o-(i-e)*a)/Math.hypot(o,a)}(d.x,d.y,s.x,s.y,o.x,o.y)>=l?(Kc(e,t,i,c,h,s,d,a,l),Kc(e,c,h,n,r,d,o,a,l)):e.push(o)}function Qc(e,t,i){let n=e[0],r=n.x,s=n.y;t(n);const o=[n];for(let a=1;a<e.length;a++){const l=e[a],{x:c,y:h}=l;t(l),Kc(o,r,s,c,h,n,l,t,i),r=c,s=h,n=l}return o}function eh(e,t,i,n){if(n(t,i)){const r=t.add(i)._mult(.5);eh(e,t,r,n),eh(e,r,i,n)}else e.push(i)}function th(e,t){let i=e[0];const n=[i];for(let r=1;r<e.length;r++){const s=e[r];eh(n,i,s,t),i=s}return n}const ih=Math.pow(2,14)-1,nh=-ih-1;function rh(e,t){const i=Math.round(e.x*t),n=Math.round(e.y*t);return e.x=Le(i,nh,ih),e.y=Le(n,nh,ih),(i<e.x||i>e.x+1||n<e.y||n>e.y+1)&&We("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function sh(e,t,i){const n=e.loadGeometry(),r=e.extent,s=Rn/r;if(t&&i&&i.projection.isReprojectedInTileSpace){const s=1<<t.z,{scale:o,x:a,y:l,projection:c}=i,h=e=>{const i=Vc((t.x+e.x/r)/s),n=Wc((t.y+e.y/r)/s),h=c.project(i,n);e.x=(h.x*o-a)*r,e.y=(h.y*o-l)*r};for(let t=0;t<n.length;t++)if(1!==e.type)n[t]=Qc(n[t],h,1);else{const e=[];for(const i of n[t])i.x<0||i.x>=r||i.y<0||i.y>=r||(h(i),e.push(i));n[t]=e}}for(const e of n)for(const t of e)rh(t,s);return n}function oh(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?sh(e):[]}}class ah{constructor(e,t,i,n,r){this.properties={},this.extent=i,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=r,e.readFields(lh,this,t)}loadGeometry(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos,i=[];let n,r=1,s=0,o=0,a=0;for(;e.pos<t;){if(s<=0){const t=e.readVarint();r=7&t,s=t>>3}if(s--,1===r||2===r)o+=e.readSVarint(),a+=e.readSVarint(),1===r&&(n&&i.push(n),n=[]),n&&n.push(new xe(o,a));else{if(7!==r)throw new Error(`unknown command ${r}`);n&&n.push(n[0].clone())}}return n&&i.push(n),i}bbox(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let i=1,n=0,r=0,s=0,o=1/0,a=-1/0,l=1/0,c=-1/0;for(;e.pos<t;){if(n<=0){const t=e.readVarint();i=7&t,n=t>>3}if(n--,1===i||2===i)r+=e.readSVarint(),s+=e.readSVarint(),r<o&&(o=r),r>a&&(a=r),s<l&&(l=s),s>c&&(c=s);else if(7!==i)throw new Error(`unknown command ${i}`)}return[o,l,a,c]}toGeoJSON(e,t,i){const n=this.extent*Math.pow(2,i),r=this.extent*e,s=this.extent*t,o=this.loadGeometry();function a(e){return[360*(e.x+r)/n-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+s)/n)*Math.PI))-90]}function l(e){return e.map(a)}let c;if(1===this.type){const e=[];for(const t of o)e.push(t[0]);const t=l(e);c=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){const e=o.map(l);c=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else{if(3!==this.type)throw new Error("unknown feature type");{const e=function(e){const t=e.length;if(t<=1)return[e];const i=[];let n,r;for(let s=0;s<t;s++){const t=ch(e[s]);0!==t&&(void 0===r&&(r=t<0),r===t<0?(n&&i.push(n),n=[e[s]]):n&&n.push(e[s]))}return n&&i.push(n),i}(o),t=[];for(const i of e)t.push(i.map(l));c=1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}}const h={type:"Feature",geometry:c,properties:this.properties};return null!=this.id&&(h.id=this.id),h}}function lh(e,t,i){1===e?t.id=i.readVarint():2===e?function(e,t){const i=e.readVarint()+e.pos;for(;e.pos<i;){const i=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[i]=n}}(i,t):3===e?t.type=i.readVarint():4===e&&(t._geometry=i.pos)}function ch(e){let t=0;for(let i,n,r=0,s=e.length,o=s-1;r<s;o=r++)i=e[r],n=e[o],t+=(n.x-i.x)*(i.y+n.y);return t}ah.types=["Unknown","Point","LineString","Polygon"];class hh{constructor(e,t){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(dh,this,t),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const t=this._pbf.readVarint()+this._pbf.pos;return new ah(this._pbf,t,this.extent,this._keys,this._values)}}function dh(e,t,i){15===e?t.version=i.readVarint():1===e?t.name=i.readString():5===e?t.extent=i.readVarint():2===e?t._features.push(i.pos):3===e?t._keys.push(i.readString()):4===e&&t._values.push(function(e){let t=null;const i=e.readVarint()+e.pos;for(;e.pos<i;){const i=e.readVarint()>>3;t=1===i?e.readString():2===i?e.readFloat():3===i?e.readDouble():4===i?e.readVarint64():5===i?e.readVarint():6===i?e.readSVarint():7===i?e.readBoolean():null}if(null==t)throw new Error("unknown feature value");return t}(i))}class uh{constructor(e,t){this.layers=e.readFields(fh,{},t)}}function fh(e,t,i){if(3===e){const e=new hh(i,i.readVarint()+i.pos);e.length&&(t[e.name]=e)}}const ph="3d_elevation_id",mh="level";class gh{constructor(){this._valid=!1}reset(e){return this.feature=e,this._valid=!0,this._geometry=e.loadGeometry(),0!==this._geometry.length&&0!==this._geometry[0].length||(this._valid=!1),this}geometry(e,t){return this._valid&&e(t(this._geometry)),this}require(e,t,i){return this.get(e,!0,t,i)}optional(e,t,i){return this.get(e,!1,t,i)}success(){return this._valid}get(e,t,i,n){const r=this.feature.properties.hasOwnProperty(e)?+this.feature.properties[e]:void 0;return this._valid&&void 0!==r&&!Number.isNaN(r)?i(n?n(r):r):t&&(this._valid=!1),this}}class _h{constructor(e,t){this.featureFunc=e,this.vertexFunc=t}parseFeature(e,t,i){return this.featureFunc(e,t,i)}parseVertex(e,t,i){return this.vertexFunc(e,t,i)}}const yh=new _h((e,t,i)=>e.reset(t).require(ph,e=>{i.id=e}).optional("fixed_height_relative",e=>{i.constantHeight=e},xh.decodeRelativeHeight).geometry(e=>{i.bounds=e},un).success(),(e,t,i)=>e.reset(t).require(ph,e=>{i.id=e}).require("elevation_idx",e=>{i.idx=e}).require("extent",e=>{i.extent=e}).require("height_relative",e=>{i.height=e},xh.decodeRelativeHeight).geometry(e=>{i.position=e},xh.getPoint).success()),vh=new _h((e,t,i)=>e.reset(t).require(ph,e=>{i.id=e}).optional("fixed_height",e=>{i.constantHeight=e},xh.decodeMetricHeight).geometry(e=>{i.bounds=e},un).success(),(e,t,i)=>e.reset(t).require(ph,e=>{i.id=e}).require("elevation_idx",e=>{i.idx=e}).require("extent",e=>{i.extent=e}).require("height",e=>{i.height=e},xh.decodeMetricHeight).geometry(e=>{i.position=e},xh.getPoint).success());class xh{static getPoint(e){return ae(e[0][0].x,e[0][0].y)}static decodeRelativeHeight(e){return 1e-4*e*5}static decodeMetricHeight(e){return 1e-4*e}static parse(e){const t=[],i=[],n=e.length,r=new gh;for(let o=0;o<n;o++){const n=e.feature(o),a=n.properties.version,l=(s=a)?"1.0.1"===s?vh:void 0:yh;if(void 0===l){We(`Unknown elevation feature version number ${a||"(unknown)"}`);continue}const c=n.properties.hasOwnProperty("type")?n.properties.type:void 0;if(c)if("Point"===ah.types[n.type]&&"curve_point"===c){const e={};l.parseVertex(r,n,e)&&t.push(e)}else if("Polygon"===ah.types[n.type]&&"curve_meta"===c){const e={};l.parseFeature(r,n,e)&&i.push(e)}}var s;return{vertices:t,features:i}}}class bh{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(e,t,i){const n=fe(t,this.dir);if(Math.abs(n)<1e-6)return!1;const r=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1])/n;return i[0]=this.pos[0]+this.dir[0]*r,i[1]=this.pos[1]+this.dir[1]*r,!0}}class wh{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(e,t,i){const n=z(t,this.dir);if(Math.abs(n)<1e-6)return!1;const r=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1]+(e[2]-this.pos[2])*t[2])/n;return i[0]=this.pos[0]+this.dir[0]*r,i[1]=this.pos[1]+this.dir[1]*r,i[2]=this.pos[2]+this.dir[2]*r,!0}closestPointOnSphere(e,i,n){if(function(e,i){var n=e[0],r=e[1],s=e[2],o=i[0],a=i[1],l=i[2];return Math.abs(n-o)<=t*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=t*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(s-l)<=t*Math.max(1,Math.abs(s),Math.abs(l))}(this.pos,e)||0===i)return n[0]=n[1]=n[2]=0,!1;const[r,s,o]=this.dir,a=this.pos[0]-e[0],l=this.pos[1]-e[1],c=this.pos[2]-e[2],h=r*r+s*s+o*o,d=2*(a*r+l*s+c*o),u=d*d-4*h*(a*a+l*l+c*c-i*i);if(u<0){const e=Math.max(-d/2,0),t=a+r*e,h=l+s*e,u=c+o*e,f=Math.hypot(t,h,u);return n[0]=t*i/f,n[1]=h*i/f,n[2]=u*i/f,!1}{const e=(-d-Math.sqrt(u))/(2*h);if(e<0){const e=Math.hypot(a,l,c);return n[0]=a*i/e,n[1]=l*i/e,n[2]=c*i/e,!1}return n[0]=a+r*e,n[1]=l+s*e,n[2]=c+o*e,!0}}}class Sh{constructor(e,t,i,n,r){this.TL=e,this.TR=t,this.BR=i,this.BL=n,this.horizon=r}static fromInvProjectionMatrix(e,t,i){const n=[-1,1,1],r=[1,1,1],s=[1,-1,1],o=[-1,-1,1],a=Y(n,n,e),l=Y(r,r,e),c=Y(s,s,e),h=Y(o,o,e);return new Sh(a,l,c,h,t/i)}}function Th(e,t,i){let n=1/0,r=-1/0;const s=[];for(const o of e){W(s,o,t);const e=z(s,i);n=Math.min(n,e),r=Math.max(r,e)}return[n,r]}function kh(e,t){let i=!0;for(let n=0;n<e.planes.length;n++){const r=e.planes[n];let s=0;for(let e=0;e<t.length;e++)s+=z(r,t[e])+r[3]>=0;if(0===s)return 0;s!==t.length&&(i=!1)}return i?2:1}function Mh(e,t){for(const i of e.projections){const n=Th(t,e.points[0],i.axis);if(i.projection[1]<n[0]||i.projection[0]>n[1])return 0}return 1}function Ah(e,t){let i=0;const n=[0,0,0,0];for(let o=0;o<e.length;o++)n[0]=e[o][0],n[1]=e[o][1],n[2]=e[o][2],n[3]=1,(r=n)[0]*(s=t)[0]+r[1]*s[1]+r[2]*s[2]+r[3]*s[3]>=0&&i++;var r,s;return i}class Ch{constructor(e,t){this.points=e||new Array(8).fill([0,0,0]),this.planes=t||new Array(6).fill([0,0,0,0]),this.bounds=Dh.fromPoints(this.points),this.projections=[],this.frustumEdges=[W([],this.points[2],this.points[3]),W([],this.points[0],this.points[3]),W([],this.points[4],this.points[0]),W([],this.points[5],this.points[1]),W([],this.points[6],this.points[2]),W([],this.points[7],this.points[3])];for(const e of this.frustumEdges){const t=[0,-e[2],e[1]],i=[e[2],0,-e[0]];this.projections.push({axis:t,projection:Th(this.points,this.points[0],t)}),this.projections.push({axis:i,projection:Th(this.points,this.points[0],i)})}}static fromInvProjectionMatrix(e,t,i,n){const r=Math.pow(2,i),s=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(i=>{const s=Z([],i,e),o=1/s[3]/t*r;return(a=s)[0]=(l=s)[0]*(c=[o,o,n?1/s[3]:o,o])[0],a[1]=l[1]*c[1],a[2]=l[2]*c[2],a[3]=l[3]*c[3],a;var a,l,c}),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(e=>{const t=O([],F([],W([],s[e[0]],s[e[1]]),W([],s[e[2]],s[e[1]]))),i=-z(t,s[e[1]]);return t.concat(i)}),a=[];for(let e=0;e<s.length;e++)a.push([s[e][0],s[e][1],s[e][2]]);return new Ch(a,o)}intersectsPrecise(e,t,i){for(let i=0;i<t.length;i++)if(!Ah(e,t[i]))return 0;for(let t=0;t<this.planes.length;t++)if(!Ah(e,this.planes[t]))return 0;for(const t of i)for(const i of this.frustumEdges){const n=F([],t,i),r=w(n);if(0===r)continue;L(n,n,1/r);const s=Th(this.points,this.points[0],n),o=Th(e,this.points[0],n);if(s[0]>o[1]||o[0]>s[1])return 0}return 1}containsPoint(e){for(const t of this.planes){const i=t[3];if(z([t[0],t[1],t[2]],e)+i<0)return!1}return!0}}class Dh{static fromPoints(e){const t=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];for(const n of e)C(t,t,n),D(i,i,n);return new Dh(t,i)}static fromTileIdAndHeight(e,t,i){const n=1<<e.canonical.z,r=e.canonical.x,s=e.canonical.y;return new Dh([r/n,s/n,t],[(r+1)/n,(s+1)/n,i])}static applyTransform(e,t){const i=e.getCorners();for(let e=0;e<i.length;++e)Y(i[e],i[e],t);return Dh.fromPoints(i)}static applyTransformFast(e,t){const i=[t[12],t[13],t[14]],n=[...i];for(let r=0;r<3;r++)for(let s=0;s<3;s++){const o=t[4*s+r],a=o*e.min[s],l=o*e.max[s];i[r]+=Math.min(a,l),n[r]+=Math.max(a,l)}return new Dh(i,n)}static projectAabbCorners(e,t){const i=e.getCorners();for(let e=0;e<i.length;++e)Y(i[e],i[e],t);return i}constructor(e,t){this.min=e,this.max=t,this.center=L([],k([],this.min,this.max),.5)}quadrant(e){const t=[e%2==0,e<2],i=b(this.min),n=b(this.max);for(let e=0;e<t.length;e++)i[e]=t[e]?this.min[e]:this.center[e],n[e]=t[e]?this.center[e]:this.max[e];return n[2]=this.max[2],new Dh(i,n)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,t=this.max;return[[e[0],e[1],e[2]],[t[0],e[1],e[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],t[2]],[e[0],t[1],t[2]]]}intersects(e){return this.intersectsAabb(e.bounds)?kh(e,this.getCorners()):0}intersectsFlat(e){return this.intersectsAabb(e.bounds)?kh(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(e,t){return t||this.intersects(e)?Mh(e,this.getCorners()):0}intersectsPreciseFlat(e,t){return t||this.intersectsFlat(e)?Mh(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(e){for(let t=0;t<3;++t)if(this.min[t]>e.max[t]||e.min[t]>this.max[t])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e.min[t]),this.max[t]=Math.max(this.max[t],e.max[t])}encapsulatePoint(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e[t]),this.max[t]=Math.max(this.max[t],e[t])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}Ws(Dh,"Aabb");class Lh{constructor(e,t){this.feature=e,this.metersToTile=t,this.index=0}get(){const e=this.feature.vertices[this.index],t=this.feature.vertexProps[this.index].dir,i=t[1],n=-t[0],r=(e.extent+1)*this.metersToTile;return[new xe(Math.trunc(e.position[0]+i*r),Math.trunc(e.position[1]+n*r)),new xe(Math.trunc(e.position[0]-i*r),Math.trunc(e.position[1]-n*r))]}next(){this.index++}valid(){return this.index<this.feature.vertices.length}}class Eh{constructor(e,t,i,n,r,s){if(this.vertices=new Array,this.vertexProps=new Array,this.edges=new Array,this.edgeProps=new Array,this.id=e,this.heightRange={min:i,max:i},this.safeArea=t,this.constantHeight=i,null==this.constantHeight&&(null!=this.constantHeight||0!==n.length)){this.vertices=n,this.edges=r,this.edges=this.edges.filter(e=>{return e.a<this.vertices.length&&e.b<this.vertices.length&&!((t=this.vertices[e.a].position)[0]===(i=this.vertices[e.b].position)[0]&&t[1]===i[1]);var t,i}),this.heightRange={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};for(const e of this.vertices)this.vertexProps.push({dir:ae(0,0)}),this.heightRange.min=Math.min(this.heightRange.min,e.height),this.heightRange.max=Math.max(this.heightRange.max,e.height);for(const e of this.edges){const t=this.vertices[e.a].position,i=this.vertices[e.b].position,n=ce(oe(),i,t),r=de(n),s=he(oe(),n,1/r);this.edgeProps.push({vec:n,dir:s,len:r});const o=this.vertexProps[e.a].dir,a=this.vertexProps[e.b].dir;le(o,o,s),le(a,a,s)}for(const e of this.vertexProps)0===e.dir[0]&&0===e.dir[1]||ue(e.dir,e.dir);this.tessellate(s)}}pointElevation(e){if(null!=this.constantHeight)return this.constantHeight;const t=this.getClosestEdge(e);if(null==t)return 0;const[i,n]=t;return ci(this.vertices[this.edges[i].a].height,this.vertices[this.edges[i].b].height,n)}computeSlopeNormal(e,t){const i=this.getClosestEdge(e);if(!i)return S(0,0,1);const n=i[0],r=this.edges[n],s=this.edgeProps[n].vec,o=S(s[0],s[1],(this.vertices[r.b].height-this.vertices[r.a].height)*t),a=S(o[1],-o[0],0);F(a,a,o);const l=w(a);return l>0?L(a,a,1/l):S(0,0,1)}getSafeArea(){return this.safeArea}isTunnel(){return this.heightRange.max<=-5}getClosestEdge(e){if(0===this.edges.length)return;let t=0,i=Number.POSITIVE_INFINITY,n=0;const r=ae(e.x,e.y);for(let e=0;e<this.edges.length;e++){const s=this.edges[e],o=this.edgeProps[e].dir,a=new bh(r,this.edgeProps[e].dir),l=this.vertices[s.a].position,c=this.vertices[s.b].position,h=oe(),d=oe(),u=a.intersectsPlane(l,this.vertexProps[s.a].dir,h),f=a.intersectsPlane(c,this.vertexProps[s.b].dir,d);if(!u||!f)continue;const p=ce(oe(),d,h),m=ce(oe(),r,h),g=fe(p,p),_=g>0?fe(m,p)/g:0,y=Le(_,0,1),v=Math.abs((_-y)*this.edgeProps[e].len),x=ce(oe(),r,l),b=v+Math.abs(fe(x,ae(o[1],-o[0])));b<i&&(t=e,i=b,n=y)}return[t,n]}tessellate(e){for(let t=this.edges.length-1;t>=0;--t){const i=this.edges[t].a,n=this.edges[t].b,{position:r,height:s,extent:o}=this.vertices[i],{position:a,height:l,extent:c}=this.vertices[n],h=this.vertexProps[i].dir,d=this.vertexProps[n].dir,u=S(r[0]/e,r[1]/e,s),f=S(a[0]/e,a[1]/e,l),p=S(h[1],-h[0],0);L(p,p,o);const m=S(d[1],-d[0],0);if(L(m,m,c),this.distSqLines(S(u[0]+.5*p[0],u[1]+.5*p[1],u[2]+.5*p[2]),S(f[0]-.5*m[0],f[1]-.5*m[1],f[2]-.5*m[2]),S(u[0]-.5*p[0],u[1]-.5*p[1],u[2]-.5*p[2]),S(f[0]+.5*m[0],f[1]+.5*m[1],f[2]+.5*m[2]))<=.0025000000000000005)continue;const g=this.vertices.length,_=le(oe(),r,a);this.vertices.push({position:he(_,_,.5),height:.5*(s+l),extent:.5*(o+c)});const y=le(oe(),h,d);this.vertexProps.push({dir:ue(y,y)}),this.edges.splice(t,1),this.edgeProps.splice(t,1),this.edges.push({a:i,b:g}),this.edges.push({a:g,b:n});const v=ce(oe(),this.vertices[g].position,r),x=de(v),b={vec:v,dir:he(oe(),v,1/x),len:x};this.edgeProps.push(b),this.edgeProps.push(b)}}distSqLines(e,t,i,n){const r=M(x(),t,e),s=M(x(),n,i),o=M(x(),e,i),a=z(r,r),l=z(r,s),c=z(r,o),h=z(s,s),d=z(s,o),u=a*h-l*l;if(0===u){const t=z(o,s)/z(s,s);return I(N(x(),i,n,t),e)}const f=(l*d-c*h)/u,p=(a*d-l*c)/u;return I(N(x(),e,t,f),N(x(),i,n,p))}}class Ih{static parseFrom(e,t){const i=xh.parse(e);if(!i)return[];let{vertices:n,features:r}=i;const s=1/Zc(t);r.sort((e,t)=>e.id-t.id),n.sort((e,t)=>e.id-t.id||e.idx-t.idx),n=n.filter((e,t,i)=>t===i.findIndex(t=>t.id===e.id&&t.idx===e.idx));const o=new Array;let a=0;const l=n.length;for(const e of r){if(e.constantHeight){o.push(new Eh(e.id,e.bounds,e.constantHeight));continue}for(;a!==l&&n[a].id<e.id;)a++;if(a===l||n[a].id!==e.id)continue;const t=new Array,i=new Array,r=a;for(;a!==l&&n[a].id===e.id;){const e=n[a];if(t.push({position:e.position,height:e.height,extent:e.extent}),a!==r&&n[a-1].idx===e.idx-1){const e=a-r;i.push({a:e-1,b:e})}a++}o.push(new Eh(e.id,e.bounds,void 0,t,i,s))}return o}static getElevationFeature(e,t){if(!t)return;const i=+e.properties[ph];return Number.isNaN(i)?void 0:t.find(e=>e.id===i)}}class Ph{constructor(e,t){this.zScale=1,this.xOffset=0,this.yOffset=0,e.equals(t)||(this.zScale=Math.pow(2,t.z-e.z),this.xOffset=(e.x*this.zScale-t.x)*Rn,this.yOffset=(e.y*this.zScale-t.y)*Rn)}constantElevation(e,t){if(null!=e.constantHeight)return this.computeBiasedHeight(e.constantHeight,t)}pointElevation(e,t,i){const n=this.constantElevation(t,i);return null!=n?n:(e.x=e.x*this.zScale+this.xOffset,e.y=e.y*this.zScale+this.yOffset,this.computeBiasedHeight(t.pointElevation(e),i))}computeBiasedHeight(e,t){return t<=0?e:e+t*Ee(0,t,e>=0?e:Math.abs(.5*e))}}Ws(Eh,"ElevationFeature");class Rh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Za,this.indexArray=new _l,this.segments=new Xl,this.programConfigurations=new wc(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.elevationMode=this.layers[0].layout.get("circle-elevation-reference"),this.hasElevation=!1,"none"!==this.elevationMode&&(this.elevatedLayoutVertexArray=new Qa),this.worldview=e.worldview}updateFootprints(e,t){}populate(e,t,i,n){const r=this.layers[0],s=[];let o=null;"circle"===r.type&&(o=r.layout.get("circle-sort-key"));for(const{feature:t,id:r,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=oh(t,e);if(!this.layers[0]._featureFilter.filter(new da(this.zoom,{worldview:this.worldview}),c,i))continue;const h=o?o.evaluate(c,{},i):void 0,d={id:r,properties:t.properties,type:t.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:sh(t,i,n),patterns:{},sortKey:h};s.push(d)}o&&s.sort((e,t)=>e.sortKey-t.sortKey);let a=null;"globe"===n.projection.name&&(this.globeExtVertexArray=new al,a=n.projection);for(const n of s){const{geometry:r,index:s,sourceLayerIndex:o}=n,l=e[s].feature;this.addFeature(n,r,s,t.availableImages,i,a,t.brightness,t.elevationFeatures),t.featureIndex.insert(l,r,s,o,this.index)}this.hasElevation||(this.elevatedLayoutVertexArray=void 0)}update(e,t,i,n,r,s,o){this.programConfigurations.updatePaintArrays(e,t,r,i,n,s,o,this.worldview)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ul.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Gl.members)),this.elevatedLayoutVertexArray&&(this.elevatedLayoutVertexBuffer=e.createVertexBuffer(this.elevatedLayoutVertexArray,$l.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy())}addFeature(e,t,i,n,r,s,o,a){let l;"none"!==this.elevationMode&&(l=Ih.getElevationFeature(e,a));for(const i of t)for(const t of i){const i=t.x,n=t.y;if(i<0||i>=Rn||n<0||n>=Rn)continue;if(s){const e=s.projectTilePoint(i,n,r),t=s.upVector(r,i,n);this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t)}const o=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=o.vertexLength;if(this.addCircleVertex(i,n,-1,-1),this.addCircleVertex(i,n,1,-1),this.addCircleVertex(i,n,1,1),this.addCircleVertex(i,n,-1,1),"none"!==this.elevationMode){const e=l?l.pointElevation(new xe(i,n)):0;this.hasElevation=this.hasElevation||0!==e;for(let t=0;t<4;t++)this.elevatedLayoutVertexArray.emplaceBack(e)}this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+2,a+3),o.vertexLength+=4,o.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{},n,r,o,void 0,this.worldview)}addCircleVertex(e,t,i,n){this.layoutVertexArray.emplaceBack(2*e+(i+1)/2,2*t+(n+1)/2)}addGlobeExtVertex(e,t){const i=16384;this.globeExtVertexArray.emplaceBack(e.x,e.y,e.z,t[0]*i,t[1]*i,t[2]*i)}}function Oh(e,t){for(let i=0;i<e.length;i++)if($h(t,e[i]))return!0;for(let i=0;i<t.length;i++)if($h(e,t[i]))return!0;return!!Yh(e,t)}function zh(e,t,i){return!!$h(e,t)||!!Vh(t,e,i)}function Fh(e,t){if(1===e.length)return Uh(t,e[0]);for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<n.length;t++)if($h(e,n[t]))return!0}for(let i=0;i<e.length;i++)if(Uh(t,e[i]))return!0;for(let i=0;i<t.length;i++)if(Yh(e,t[i]))return!0;return!1}function Nh(e,t,i){if(e.length>1){if(Yh(e,t))return!0;for(let n=0;n<t.length;n++)if(Vh(t[n],e,i))return!0}for(let n=0;n<e.length;n++)if(Vh(e[n],t,i))return!0;return!1}function Yh(e,t){if(0===e.length||0===t.length)return!1;for(let i=0;i<e.length-1;i++){const n=e[i],r=e[i+1];for(let e=0;e<t.length-1;e++)if(Bh(n,r,t[e],t[e+1]))return!0}return!1}function Bh(e,t,i,n){return Ue(e,i,n)!==Ue(t,i,n)&&Ue(e,t,i)!==Ue(e,t,n)}function Hh(e,t,i){return(e.x-i.x)*(t.y-i.y)-(e.y-i.y)*(t.x-i.x)}function jh(e,t,i,n){const r=Hh(e,t,n),s=Hh(e,t,i);if(Math.sign(r)===Math.sign(s))return;const o=Hh(i,n,e),a=o+s-r;return Math.sign(o)!==Math.sign(a)?[o/(o-a),s/(s-r)]:void 0}function Vh(e,t,i){const n=i*i;if(1===t.length)return e.distSqr(t[0])<n;for(let i=1;i<t.length;i++)if(Wh(e,t[i-1],t[i])<n)return!0;return!1}function Wh(e,t,i){const n=t.distSqr(i);if(0===n)return e.distSqr(t);const r=((e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y))/n;return e.distSqr(r<0?t:r>1?i:i.sub(t)._mult(r)._add(t))}function Uh(e,t){let i,n,r,s=!1;for(let o=0;o<e.length;o++){i=e[o];for(let e=0,o=i.length-1;e<i.length;o=e++)n=i[e],r=i[o],n.y>t.y!=r.y>t.y&&t.x<(r.x-n.x)*(t.y-n.y)/(r.y-n.y)+n.x&&(s=!s)}return s}function $h(e,t){let i=!1;for(let n=0,r=e.length-1;n<e.length;r=n++){const s=e[n],o=e[r];s.y>t.y!=o.y>t.y&&t.x<(o.x-s.x)*(t.y-s.y)/(o.y-s.y)+s.x&&(i=!i)}return i}function Gh(e,t,i,n,r){for(const s of e)if(t<=s.x&&i<=s.y&&n>=s.x&&r>=s.y)return!0;const s=[new xe(t,i),new xe(t,r),new xe(n,r),new xe(n,i)];if(e.length>2)for(const t of s)if($h(e,t))return!0;for(let t=0;t<e.length-1;t++)if(Xh(e[t],e[t+1],s))return!0;return!1}function Xh(e,t,i){const n=i[0],r=i[2];if(e.x<n.x&&t.x<n.x||e.x>r.x&&t.x>r.x||e.y<n.y&&t.y<n.y||e.y>r.y&&t.y>r.y)return!1;const s=Ue(e,t,i[0]);return s!==Ue(e,t,i[1])||s!==Ue(e,t,i[2])||s!==Ue(e,t,i[3])}function qh(e,t,i,n,r,s){let o=t.y-e.y,a=e.x-t.x;if(s=s||0){const e=o*o+a*a;if(0===e)return!0;const t=Math.sqrt(e);o/=t,a/=t}return!((i.x-e.x)*o+(i.y-e.y)*a-s<0||(n.x-e.x)*o+(n.y-e.y)*a-s<0||(r.x-e.x)*o+(r.y-e.y)*a-s<0)}function Zh(e,t,i,n,r,s,o){return!(qh(e,t,n,r,s,o)||qh(t,i,n,r,s,o)||qh(i,e,n,r,s,o)||qh(n,r,e,t,i,o)||qh(r,s,e,t,i,o)||qh(s,n,e,t,i,o))}function Jh(e,t,i){const n=t.paint.get(e).value;return"constant"===n.kind?n.value:i.programConfigurations.get(t.id).getMaxValue(e)}function Kh(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Qh(e,t,i,n,r){if(!t[0]&&!t[1])return e;const s=xe.convert(t)._mult(r);"viewport"===i&&s._rotate(-n);const o=[];for(let t=0;t<e.length;t++)o.push(e[t].sub(s));return o}function ed(e,t,i,n){const r=xe.convert(e)._mult(n);return"viewport"===t&&r._rotate(-i),r}let td,id;function nd(e,t,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}Ws(Rh,"CircleBucket",{omit:["layers"]});class rd{constructor(e,t,i){this.z=e,this.x=t,this.y=i,this.key=ad(0,e,e,t,i)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}isChildOf(e){const t=this.z-e.z;return 0===e.z||e.z<this.z&&e.x===this.x>>t&&e.y===this.y>>t}url(e,t){const i=function(e,t,i){var n=nd(256*e,256*(t=Math.pow(2,i)-t-1),i),r=nd(256*(e+1),256*(t+1),i);return n[0]+","+n[1]+","+r[0]+","+r[1]}(this.x,this.y,this.z),n=function(e,t,i){let n,r="";for(let s=e;s>0;s--)n=1<<s-1,r+=(t&n?1:0)+(i&n?2:0);return r}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",i)}toString(){return`${this.z}/${this.x}/${this.y}`}}class sd{constructor(e,t){this.wrap=e,this.canonical=t,this.key=ad(e,t.z,t.z,t.x,t.y)}}class od{constructor(e,t,i,n,r){this.overscaledZ=e,this.wrap=t,this.canonical=new rd(i,+n,+r),this.key=0===t&&e===i?this.canonical.key:ad(t,e,i,n,r)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const t=this.canonical.z-e;return e>this.canonical.z?new od(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new od(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return ad(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const i=this.canonical.z-e;return ad(this.wrap*+t,e,e,this.canonical.x>>i,this.canonical.y>>i)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.z<this.canonical.z&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new od(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new od(t,this.wrap,t,i,n),new od(t,this.wrap,t,i+1,n),new od(t,this.wrap,t,i,n+1),new od(t,this.wrap,t,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new od(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new od(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new sd(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function ad(e,t,i,n,r){const s=1<<Math.min(i,22);let o=s*(r%s)+n%s;return e&&i<22&&(o+=s*s*((e<0?-2*e-1:2*e)%(1<<2*(22-i)))),16*(32*o+i)+(t-i)}const ld=[e=>{let t=e.canonical.x-1,i=e.wrap;return t<0&&(t=(1<<e.canonical.z)-1,i--),new od(e.overscaledZ,i,e.canonical.z,t,e.canonical.y)},e=>{let t=e.canonical.x+1,i=e.wrap;return t===1<<e.canonical.z&&(t=0,i++),new od(e.overscaledZ,i,e.canonical.z,t,e.canonical.y)},e=>new od(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<<e.canonical.z:e.canonical.y)-1),e=>new od(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<<e.canonical.z)-1?0:e.canonical.y+1)];Ws(rd,"CanonicalTileID"),Ws(od,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const cd=Xa([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:hd}=cd,dd=Xa([{name:"a_pos_3",components:3,type:"Int16"}]);var ud=Xa([{name:"a_pos",type:"Int16",components:2}]);function fd(e){return e*Cc/Oc}const pd=[new Dh([Ec,Ec,Ec],[Ic,Ic,Ic]),new Dh([Ec,Ec,Ec],[0,0,Ic]),new Dh([0,Ec,Ec],[Ic,0,Ic]),new Dh([Ec,0,Ec],[0,Ic,Ic]),new Dh([0,0,Ec],[Ic,Ic,Ic])];function md(e,t,i,n=!0){const r=L([],e._camera.position,e.worldSize),s=[t,i,1,1];Z(s,s,e.pixelMatrixInverse),X(s,s,1/s[3]);const o=O([],W([],s,r)),a=e.globeMatrix,l=[a[12],a[13],a[14]],c=W([],l,r),h=w(c),d=O([],c),u=e.worldSize/(2*Math.PI),f=z(d,o),p=Math.asin(u/h);if(p<Math.acos(f)){if(!n)return null;const e=[],t=[];L(e,o,h/f),O(t,W(t,e,c)),O(o,k(o,c,L(o,t,Math.tan(p)*h)))}const m=[];new wh(r,o).closestPointOnSphere(l,u,m);const g=O([],Je(a,0)),_=O([],Je(a,1)),y=O([],Je(a,2)),v=z(g,m),x=z(_,m),b=z(y,m),S=ke(Math.asin(-x/u));let T=ke(Math.atan2(v,b));T=e.center.lng+function(e,t){const i=(t-e+180)%360-180;return i<-180?i+360:i}(e.center.lng,T);const M=Bc(T),A=Le(Hc(S),0,1);return new Jc(M,A)}class gd{constructor(e,t,i){this.a=W([],e,i),this.b=W([],t,i),this.center=i;const n=O([],this.a),r=O([],this.b);this.angle=Math.acos(z(n,r))}}function _d(e,t){if(0===e.angle)return null;let i;return i=0===e.a[t]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[t]/e.a[t]/Math.sin(e.angle)-1/Math.tan(e.angle)),i<0||i>1?null:function(e,t,i,n){const r=Math.sin(i);return e*(Math.sin((1-n)*i)/r)+t*(Math.sin(n*i)/r)}(e.a[t],e.b[t],e.angle,Le(i,0,1))+e.center[t]}function yd(e){if(e.z<=1)return pd[e.z+2*e.y+e.x];const t=Sd(wd(e));return Dh.fromPoints(t)}function vd(e,t,i){return L(e,e,1-i),E(e,e,t,i)}function xd(e,t,i){for(const n of e)Y(n,n,t),L(n,n,i)}function bd(e,t,i,n){const r=t/e.worldSize,s=e.globeMatrix;if(i.z<=1){const e=yd(i).getCorners();return xd(e,s,r),Dh.fromPoints(e)}const o=wd(i,n),a=Sd(o,Cc+fd(e._tileCoverLift));xd(a,s,r);const l=Number.MAX_VALUE,c=[-l,-l,-l],h=[l,l,l];if(o.contains(e.center)){for(const e of a)C(h,h,e),D(c,c,e);c[2]=0;const t=e.point,i=[t.x*r,t.y*r,0];return C(h,h,i),D(c,c,i),new Dh(h,c)}if(e._tileCoverLift>0){for(const e of a)C(h,h,e),D(c,c,e);return new Dh(h,c)}const d=[s[12]*r,s[13]*r,s[14]*r],u=o.getCenter(),f=Le(e.center.lat,-$c,$c),p=Le(u.lat,-$c,$c),m=Bc(e.center.lng),g=Hc(f);let _=m-Bc(u.lng);const y=g-Hc(p);_>.5?_-=1:_<-.5&&(_+=1);let v=0;Math.abs(_)>Math.abs(y)?v=_>=0?1:3:(v=y>=0?0:2,E(d,d,[s[4]*r,s[5]*r,s[6]*r],-Math.sin(Te(y>=0?o.getSouth():o.getNorth()))*Cc));const x=a[v],b=a[(v+1)%4],w=new gd(x,b,d),S=[_d(w,0)||x[0],_d(w,1)||x[1],_d(w,2)||x[2]],T=Id(e.zoom);if(T>0){const n=function({x:e,y:t,z:i},n,r,s,o){const a=1/(1<<i);let l=e*a,c=l+a,h=t*a,d=h+a,u=0;const f=(l+c)/2-s;return f>.5?u=-1:f<-.5&&(u=1),l=((l+u)*n-(s*=n))*r+s,c=((c+u)*n-s)*r+s,h=(h*n-(o*=n))*r+o,d=(d*n-o)*r+o,[[l,d,0],[c,d,0],[c,h,0],[l,h,0]]}(i,t,e._pixelsPerMercatorPixel,m,g);for(let e=0;e<a.length;e++)vd(a[e],n[e],T);const r=k([],n[v],n[(v+1)%4]);L(r,r,.5),vd(S,r,T)}for(const e of a)C(h,h,e),D(c,c,e);return h[2]=Math.min(x[2],b[2]),C(h,h,S),D(c,c,S),new Dh(h,c)}function wd({x:e,y:t,z:i},n=!1){const r=1/(1<<i),s=new Fc(Vc(e*r),t===(1<<i)-1&&n?-90:Wc((t+1)*r)),o=new Fc(Vc((e+1)*r),0===t&&n?90:Wc(t*r));return new Nc(s,o)}function Sd(e,t=Cc){const i=Te(e.getNorth()),n=Te(e.getSouth()),r=Math.cos(i),s=Math.cos(n),o=Math.sin(i),a=Math.sin(n),l=e.getWest(),c=e.getEast();return[Pc(s,a,l,t),Pc(s,a,c,t),Pc(r,o,c,t),Pc(r,o,l,t)]}function Td(e,t,i,n){const r=1<<i.z,s=(e/Rn+i.x)/r;return Rc(Wc((t/Rn+i.y)/r),Vc(s),n)}function kd({min:e,max:t}){return 16383/Math.max(t[0]-e[0],t[1]-e[1],t[2]-e[2])}const Md=new Float64Array(16);function Ad(e){const t=kd(e),i=g(Md,[t,t,t]);return d(i,i,R([],e.min))}function Cd(e){const t=(n=e.min,(i=Md)[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=n[0],i[13]=n[1],i[14]=n[2],i[15]=1,i);var i,n;const r=1/kd(e);return u(t,t,[r,r,r])}function Dd(e){const t=Rn/(2*Math.PI);return e/(2*Math.PI)/t}function Ld(e,t){return Rn/(512*Math.pow(2,e))*kd(yd(t))}function Ed(e,t,i,n,r){const s=Dd(i),o=[e,t,-i/(2*Math.PI)],a=l(new Float64Array(16));return d(a,a,o),u(a,a,[s,s,s]),f(a,a,Te(-r)),p(a,a,Te(-n)),a}function Id(e){return Ee(5,6,e)}function Pd(e,t){const i=Rc(t.lat,t.lng),n=function(e){const t=Rc(e._center.lat,e._center.lng);let i=F([],S(0,1,0),t);const n=_([],-e.angle,t);i=Y(i,i,n),_(n,-e._pitch,i);const r=O([],t);return L(r,r,fd(e.cameraToCenterDistance/e.pixelsPerMeter)),Y(r,r,n),k([],t,r)}(e);return o=(r=M([],n,i))[0],a=r[1],l=r[2],c=(s=i)[0],h=s[1],d=s[2],f=(u=Math.sqrt(o*o+a*a+l*l)*Math.sqrt(c*c+h*h+d*d))&&z(r,s)/u,Math.acos(Math.min(Math.max(f,-1),1));var r,s,o,a,l,c,h,d,u,f}function Rd(e,t){return Pd(e,t)>Math.PI/2*1.01}const Od=Te(85),zd=Math.cos(Od),Fd=Math.sin(Od),Nd=a(),Yd=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t};function Bd(e,t,i,n,r,s,o,a,l){if(s&&e.queryGeometry.isAboveHorizon)return!1;s&&(l*=e.pixelToTileUnitsFactor);const c=e.tileID.canonical,h=i.projection.upVectorScale(c,i.center.lat,i.worldSize).metersToTile;for(const d of t)for(const t of d){const d=t.add(a),u=r&&i.elevation?i.elevation.exaggeration()*r.getElevationAt(d.x,d.y,!0):0,f=i.projection.projectTilePoint(d.x,d.y,c);if(u>0){const e=i.projection.upVector(c,d.x,d.y);f.x+=e[0]*h*u,f.y+=e[1]*h*u,f.z+=e[2]*h*u}const p=s?d:Hd(f.x,f.y,f.z,n),m=s?e.tilespaceRays.map(e=>Wd(e,u)):e.queryGeometry.screenGeometry,g=Z([],[f.x,f.y,f.z,1],n);if(!o&&s?l*=g[3]/i.cameraToCenterDistance:o&&!s&&(l*=i.cameraToCenterDistance/g[3]),s){const e=Wc((t.y/Rn+c.y)/(1<<c.z));l/=i.projection.pixelsPerMeter(e,1)/jc(1,e)}if(zh(m,p,l))return!0}return!1}function Hd(e,t,i,n){const r=Z([],[e,t,i,1],n);return new xe(r[0]/r[3],r[1]/r[3])}const jd=S(0,0,0),Vd=S(0,0,1);function Wd(e,t){const i=x();return jd[2]=t,e.intersectsPlane(jd,Vd,i),new xe(i[0],i[1])}class Ud extends Rh{}let $d,Gd,Xd,qd;function Zd(e,{width:t,height:i},n,r){if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==t*i*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(t*i*n);return e.width=t,e.height=i,e.data=r,e}function Jd(e,t,i){const{width:n,height:r}=t;n===e.width&&r===e.height||(Kd(e,t,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,r)},i,null),e.width=n,e.height=r,e.data=t.data)}function Kd(e,t,i,n,r,s,o,a){if(0===r.width||0===r.height)return t;if(r.width>e.width||r.height>e.height||i.x>e.width-r.width||i.y>e.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>t.width||r.height>t.height||n.x>t.width-r.width||n.y>t.height-r.height)throw new RangeError("out of range destination coordinates for image copy");const l=e.data,c=t.data,h=4===s&&a;for(let a=0;a<r.height;a++){const d=((i.y+a)*e.width+i.x)*s,u=((n.y+a)*t.width+n.x)*s;if(h)for(let e=0;e<r.width;e++){const t=d+e*s+3,i=u+e*s;c[i+0]=255,c[i+1]=255,c[i+2]=255,c[i+3]=l[t]}else if(o)for(let e=0;e<r.width;e++){const t=d+e*s,i=u+e*s,n=new si(l[t+0]/255,l[t+1]/255,l[t+2]/255,l[t+3]).toNonPremultipliedRenderColor(o).toArray();c[i+0]=n[0],c[i+1]=n[1],c[i+2]=n[2],c[i+3]=n[3]}else for(let e=0;e<r.width*s;e++)c[u+e]=l[d+e]}return t}Ws(Ud,"HeatmapBucket",{omit:["layers"]});class Qd{constructor(e,t){Zd(this,e,1,t)}resize(e){Jd(this,new Qd(e),1)}clone(){return new Qd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,i,n,r){Kd(e,t,i,n,r,1,null)}}class eu{constructor(e,t){Zd(this,e,4,t)}resize(e){Jd(this,new eu(e),4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new eu({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,i,n,r,s,o){Kd(e,t,i,n,r,4,s,o)}}class tu{constructor(e,t){this.width=e.width,this.height=e.height,this.data=t instanceof Uint8Array?new Float32Array(t.buffer):t}}function iu(e){const t={},i=e.resolution||256,n=e.clips?e.clips.length:1,r=e.image||new eu({width:i,height:n}),s=(i,n,s)=>{t[e.evaluationKey]=s;const o=e.expression.evaluate(t),a=o?o.toNonPremultipliedRenderColor(null):null;a&&(r.data[i+n+0]=Math.floor(255*a.r),r.data[i+n+1]=Math.floor(255*a.g),r.data[i+n+2]=Math.floor(255*a.b),r.data[i+n+3]=Math.floor(255*a.a))};if(e.clips)for(let t=0,r=0;t<n;++t,r+=4*i)for(let n=0,o=0;n<i;n++,o+=4){const a=n/(i-1),{start:l,end:c}=e.clips[t];s(r,o,l*(1-a)+c*a)}else for(let e=0,t=0;e<i;e++,t+=4)s(0,t,e/(i-1));return r}Ws(Qd,"AlphaImage"),Ws(eu,"RGBAImage");const nu=Xa([{name:"a_pos",components:2,type:"Int16"}],4),ru=Xa([{name:"a_road_z_offset",components:1,type:"Float32"}],4),su=Xa([{name:"a_pos",components:2,type:"Int16"},{name:"a_height",components:1,type:"Float32"}],4),ou=Xa([{name:"a_pos_normal_3",components:3,type:"Int16"}],4);function au(e,t,i=2){const n=t&&t.length,r=n?t[0]*i:e.length;let s=lu(e,0,r,i,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c;if(n&&(s=function(e,t,i,n){const r=[];for(let i=0,s=t.length;i<s;i++){const o=lu(e,t[i]*n,i<s-1?t[i+1]*n:e.length,n,!1);o===o.next&&(o.steiner=!0),r.push(vu(o))}r.sort(mu);for(let e=0;e<r.length;e++)i=gu(r[e],i);return i}(e,t,s,i)),e.length>80*i){a=e[0],l=e[1];let t=a,n=l;for(let s=i;s<r;s+=i){const i=e[s],r=e[s+1];i<a&&(a=i),r<l&&(l=r),i>t&&(t=i),r>n&&(n=r)}c=Math.max(t-a,n-l),c=0!==c?32767/c:0}return hu(s,o,i,a,l,c,0),o}function lu(e,t,i,n,r){let s;if(r===function(e,t,i,n){let r=0;for(let s=t,o=i-n;s<i;s+=n)r+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return r}(e,t,i,n)>0)for(let r=t;r<i;r+=n)s=Lu(r/n|0,e[r],e[r+1],s);else for(let r=i-n;r>=t;r-=n)s=Lu(r/n|0,e[r],e[r+1],s);return s&&Tu(s,s.next)&&(Eu(s),s=s.next),s}function cu(e,t){if(!e)return e;t||(t=e);let i,n=e;do{if(i=!1,n.steiner||!Tu(n,n.next)&&0!==Su(n.prev,n,n.next))n=n.next;else{if(Eu(n),n=t=n.prev,n===n.next)break;i=!0}}while(i||n!==t);return t}function hu(e,t,i,n,r,s,o){if(!e)return;!o&&s&&function(e,t,i,n){let r=e;do{0===r.z&&(r.z=yu(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,i=1;do{let n,r=e;e=null;let s=null;for(t=0;r;){t++;let o=r,a=0;for(let e=0;e<i&&(a++,o=o.nextZ,o);e++);let l=i;for(;a>0||l>0&&o;)0!==a&&(0===l||!o||r.z<=o.z)?(n=r,r=r.nextZ,a--):(n=o,o=o.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;r=o}s.nextZ=null,i*=2}while(t>1)}(r)}(e,n,r,s);let a=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(s?uu(e,n,r,s):du(e))t.push(l.i,e.i,c.i),Eu(e),e=c.next,a=c.next;else if((e=c)===a){o?1===o?hu(e=fu(cu(e),t),t,i,n,r,s,2):2===o&&pu(e,t,i,n,r,s):hu(cu(e),t,i,n,r,s,1);break}}}function du(e){const t=e.prev,i=e,n=e.next;if(Su(t,i,n)>=0)return!1;const r=t.x,s=i.x,o=n.x,a=t.y,l=i.y,c=n.y,h=Math.min(r,s,o),d=Math.min(a,l,c),u=Math.max(r,s,o),f=Math.max(a,l,c);let p=n.next;for(;p!==t;){if(p.x>=h&&p.x<=u&&p.y>=d&&p.y<=f&&bu(r,a,s,l,o,c,p.x,p.y)&&Su(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function uu(e,t,i,n){const r=e.prev,s=e,o=e.next;if(Su(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,h=r.y,d=s.y,u=o.y,f=Math.min(a,l,c),p=Math.min(h,d,u),m=Math.max(a,l,c),g=Math.max(h,d,u),_=yu(f,p,t,i,n),y=yu(m,g,t,i,n);let v=e.prevZ,x=e.nextZ;for(;v&&v.z>=_&&x&&x.z<=y;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==r&&v!==o&&bu(a,h,l,d,c,u,v.x,v.y)&&Su(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==r&&x!==o&&bu(a,h,l,d,c,u,x.x,x.y)&&Su(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=_;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==r&&v!==o&&bu(a,h,l,d,c,u,v.x,v.y)&&Su(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==r&&x!==o&&bu(a,h,l,d,c,u,x.x,x.y)&&Su(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function fu(e,t){let i=e;do{const n=i.prev,r=i.next.next;!Tu(n,r)&&ku(n,i,i.next,r)&&Cu(n,r)&&Cu(r,n)&&(t.push(n.i,i.i,r.i),Eu(i),Eu(i.next),i=e=r),i=i.next}while(i!==e);return cu(i)}function pu(e,t,i,n,r,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&wu(o,e)){let a=Du(o,e);return o=cu(o,o.next),a=cu(a,a.next),hu(o,t,i,n,r,s,0),void hu(a,t,i,n,r,s,0)}e=e.next}o=o.next}while(o!==e)}function mu(e,t){let i=e.x-t.x;return 0===i&&(i=e.y-t.y,0===i)&&(i=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),i}function gu(e,t){const i=function(e,t){let i=t;const n=e.x,r=e.y;let s,o=-1/0;if(Tu(e,i))return i;do{if(Tu(e,i.next))return i.next;if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const e=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=n&&e>o&&(o=e,s=i.x<i.next.x?i:i.next,e===n))return s}i=i.next}while(i!==t);if(!s)return null;const a=s,l=s.x,c=s.y;let h=1/0;i=s;do{if(n>=i.x&&i.x>=l&&n!==i.x&&xu(r<c?n:o,r,l,c,r<c?o:n,r,i.x,i.y)){const t=Math.abs(r-i.y)/(n-i.x);Cu(i,e)&&(t<h||t===h&&(i.x>s.x||i.x===s.x&&_u(s,i)))&&(s=i,h=t)}i=i.next}while(i!==a);return s}(e,t);if(!i)return t;const n=Du(i,e);return cu(n,n.next),cu(i,i.next)}function _u(e,t){return Su(e.prev,e,t.prev)<0&&Su(t.next,e,e.next)<0}function yu(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function vu(e){let t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function xu(e,t,i,n,r,s,o,a){return(r-o)*(t-a)>=(e-o)*(s-a)&&(e-o)*(n-a)>=(i-o)*(t-a)&&(i-o)*(s-a)>=(r-o)*(n-a)}function bu(e,t,i,n,r,s,o,a){return!(e===o&&t===a)&&xu(e,t,i,n,r,s,o,a)}function wu(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&ku(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(Cu(e,t)&&Cu(t,e)&&function(e,t){let i=e,n=!1;const r=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(Su(e.prev,e,t.prev)||Su(e,t.prev,t))||Tu(e,t)&&Su(e.prev,e,e.next)>0&&Su(t.prev,t,t.next)>0)}function Su(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function Tu(e,t){return e.x===t.x&&e.y===t.y}function ku(e,t,i,n){const r=Au(Su(e,t,i)),s=Au(Su(e,t,n)),o=Au(Su(i,n,e)),a=Au(Su(i,n,t));return r!==s&&o!==a||!(0!==r||!Mu(e,i,t))||!(0!==s||!Mu(e,n,t))||!(0!==o||!Mu(i,e,n))||!(0!==a||!Mu(i,t,n))}function Mu(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function Au(e){return e>0?1:e<0?-1:0}function Cu(e,t){return Su(e.prev,e,e.next)<0?Su(e,t,e.next)>=0&&Su(e,e.prev,t)>=0:Su(e,t,e.prev)<0||Su(e,e.next,t)<0}function Du(e,t){const i=Iu(e.i,e.x,e.y),n=Iu(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function Lu(e,t,i,n){const r=Iu(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Eu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Iu(e,t,i){return{i:e,x:t,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Pu(e,t){const i=e.length;if(i<=1)return[e];const n=[];let r,s;for(let t=0;t<i;t++){const i=$e(e[t]);0!==i&&(e[t].area=Math.abs(i),void 0===s&&(s=i<0),s===i<0?(r&&n.push(r),r=[e[t]]):r.push(e[t]))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(tn(n[e],t,1,n[e].length-1,Ru),n[e]=n[e].slice(0,t));return n}function Ru(e,t){return t.area-e.area}function Ou(e,t,i=1){if(!e)return null;const n="string"==typeof e?zi.from(e).getPrimary():e.getPrimary(),r="string"==typeof e?null:e.getSecondary();for(const e of[n,r]){if(!e)continue;const n=e.id.toString();t.has(n)||t.set(n,[]),e.scaleSelf(i),t.get(n).push(e)}return{primary:n.toString(),secondary:r?r.toString():null}}function zu(e,t,i,n){const r=n.patternDependencies;let s=!1;for(const n of t){const t=n.paint.get(`${e}-pattern`);t.isConstant()||(s=!0),Ou(t.constantOr(null),r,i)&&(s=!0)}return s}function Fu(e,t,i,n,r,s){const o=s.patternDependencies;for(const a of t){const t=a.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:n},i,{},s.availableImages);e=e&&e.name?e.name:e;const l=Ou(e,o,r);if(!l)continue;const{primary:c,secondary:h}=l;c&&(i.patterns[a.id]=[c,h].filter(Boolean))}}return i}class Nu{constructor(){this.polygons=new Map}add(e,...t){this.polygons.has(e)?this.polygons.get(e).push(...t):this.polygons.set(e,t)}merge(e){for(const[t,i]of e.polygons)this.add(t,...i)}}class Yu{constructor(){this.portals=[]}static evaluate(e){if(0===e.length)return new Yu;let t=[];for(const i of e)t.push(...i.portals);if(0===t.length)return new Yu;const i=(e,t)=>e<=0&&t<=0||e>=Rn&&t>=Rn;for(const e of t){const t=e.va,n=e.vb;(i(t.x,n.x)||i(t.y,n.y))&&(e.type="border")}const n=t.filter(e=>"unevaluated"!==e.type),r=t.filter(e=>"unevaluated"===e.type);if(0===r.length)return new Yu;r.sort((e,t)=>e.hash===t.hash?e.isTunnel===t.isTunnel?0:e.isTunnel?-1:1:e.hash<t.hash?1:-1),t=n.concat(r);let s=n.length,o=s,a=s;do{if(o++,o===t.length||t[s].hash!==t[o].hash){if(o-s==2){a<s&&(t[a]=t[s],t[s]=null);const e=t[a],i=t[o-1];e.type=e.isTunnel!==i.isTunnel?"tunnel":"polygon",e.connection={a:e.connection.a,b:i.connection.a},a++}s=o}}while(s!==t.length);return t.splice(a),t.sort((e,t)=>e.hash<t.hash?1:-1),{portals:t}}}Ws(Yu,"ElevationPortalGraph"),Ws(Nu,"ElevationPolygons");class Bu{constructor(e,t,i){this.outPositions=e,this.outNormals=t,this.outIndices=i,this.vertexLookup=new Map,this.buffer=new ArrayBuffer(4),this.view=new DataView(this.buffer)}addVertex(e,t,i){let n=e[2];null!=i&&(n*=i);const r=this.getVec3Bits(e)<<96n|this.getVec3Bits(t),s=this.vertexLookup.get(r);if(null!=s)return s;const o=this.outPositions.length;this.vertexLookup.set(r,o);const a=Math.trunc(16384*t[0]),l=Math.trunc(16384*t[1]),c=Math.trunc(16384*t[2]);return this.outPositions.emplaceBack(e[0],e[1],n),this.outNormals.emplaceBack(a,l,c),o}addTriangle(e,t,i){this.outIndices.emplaceBack(e,t,i)}addTriangles(e,t,i){if(0===e.length)return;const n=1===i.length,r=x(),s=x();for(let o=0;o<e.length;o+=3){const a=t[e[o+0]],l=t[e[o+1]],c=t[e[o+2]],h=n?i[0]:i[e[o+1]],d=n?i[0]:i[e[o+2]];T(r,a.x,a.y,n?i[0]:i[e[o+0]]);const u=this.addVertex(r,s);T(r,l.x,l.y,h);const f=this.addVertex(r,s);T(r,c.x,c.y,d);const p=this.addVertex(r,s);this.outIndices.emplaceBack(u,f,p)}}addQuad(e,t,i,n,r,s){const o=this.addVertex(e,r,s),a=this.addVertex(t,r,s),l=this.addVertex(i,r,s),c=this.addVertex(n,r,s);this.addTriangle(o,a,l),this.addTriangle(l,c,o)}getVertexCount(){return this.outPositions.length}clearVertexLookup(){this.vertexLookup.clear()}getBits(e){return this.view.setFloat32(0,e),BigInt(this.view.getUint32(0))}getVec3Bits(e){return this.getBits(e[0])<<64n|this.getBits(e[1])<<32n|this.getBits(e[2])}}class Hu{constructor(e,t,i,n){this.unevaluatedPortals=new Yu,this.portalPolygons=new Nu,this.bridgeFeatureSections=[],this.tunnelFeatureSections=[],this.vertexHashLookup=new Map,this.unevalVertices=[],this.unevalHeights=[],this.unevalTriangles=[],this.unevalTunnelTriangles=[],this.unevalEdges=[],this.vertexPositions=new el,this.vertexNormals=new tl,this.indexArray=new _l,this.tileToMeters=Zc(e),this.bridgeProgramConfigurations=new wc(t,{zoom:i,lut:n},e=>"fill-tunnel-structure-color"!==e),this.tunnelProgramConfigurations=new wc(t,{zoom:i,lut:n},e=>"fill-bridge-guard-rail-color"!==e)}addVertices(e,t){const i=this.unevalVertices.length;for(let i=0;i<e.length;i++)this.unevalVertices.push(e[i]),this.unevalHeights.push(t[i]);return i}addTriangles(e,t,i){const n=i?this.unevalTunnelTriangles:this.unevalTriangles;for(const i of e)n.push(i+t)}addRenderableRing(e,t,i,n,r,s){const o=[new xe(r.min.x,r.min.y),new xe(r.max.x,r.min.y),new xe(r.max.x,r.max.y),new xe(r.min.x,r.max.y)];for(let a=0;a<i-1;a++){const i=t+a,l=i+1,c=this.unevalVertices[i],h=this.unevalVertices[l];if(!(c.x>=r.min.x&&c.x<=r.max.x&&c.y>=r.min.y&&c.y<=r.max.y||h.x>=r.min.x&&h.x<=r.max.x&&h.y>=r.min.y&&h.y<=r.max.y||Xh(c,h,o)))continue;if(this.isOnBorder(c.x,h.x)||this.isOnBorder(c.y,h.y))continue;const d=Hu.computeEdgeHash(this.unevalVertices[i],this.unevalVertices[l]);let u,f=this.vertexHashLookup.get(Hu.computePosHash(c));null!=f?u=f.next:(f=this.vertexHashLookup.get(Hu.computePosHash(h)),u=null!=f?f.prev:d),this.unevalEdges.push({polygonIdx:e,a:i,b:l,hash:d,portalHash:u,isTunnel:n,type:"unevaluated",featureInfo:s})}}addPortalCandidates(e,t,i,n,r){if(0===t.length)return;this.portalPolygons.add(e,{geometry:t,zLevel:r});const s=t[0];this.vertexHashLookup.clear();let o=Hu.computeEdgeHash(s[s.length-2],s[s.length-1]);for(let t=0;t<s.length-1;t++){const r=s[t+0],a=s[t+1],l=ae(a.x-r.x,a.y-r.y),c=de(l);if(0===c)continue;let h="unevaluated";const d=n.pointElevation(r),u=n.pointElevation(a);Math.abs(d)<.01&&Math.abs(u)<.01?h="entrance":(this.isOnBorder(r.x,a.x)||this.isOnBorder(r.y,a.y))&&(h="border");const f=Hu.computeEdgeHash(r,a);this.unevaluatedPortals.portals.push({connection:{a:e,b:void 0},va:r,vb:a,vab:l,length:c,hash:f,isTunnel:i,type:h});const p=Hu.computePosHash(r);this.vertexHashLookup.set(p,{prev:o,next:f}),o=f}}construct(e){if(0===this.unevalVertices.length)return;const t=()=>({vertexOffset:0,primitiveOffset:this.indexArray.length}),i=e=>{e.primitiveLength=this.indexArray.length-e.primitiveOffset},n=new Bu(this.vertexPositions,this.vertexNormals,this.indexArray);this.prepareEdges(e.portals,this.unevalEdges);const r=t(),s=t(),o=t(),a=(e,t)=>{e.sort((e,i)=>e.type===t&&i.type!==t?-1:e.type!==t&&i.type===t?1:0);const i=e.findIndex(e=>e.type!==t);return i>=0?i:e.length};let l=0;this.unevalEdges.length>0&&(l=a(this.unevalEdges,"none"),this.constructBridgeStructures(n,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:l},this.tileToMeters)),i(o);const c=t(),h=t();if(this.unevalEdges.length>0){const e=this.unevalEdges.splice(l),t=a(e,"tunnel")+l;this.unevalEdges.push(...e),this.constructTunnelStructures(n,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:l},{min:l,max:t})}i(c),n.addTriangles(this.unevalTriangles,this.unevalVertices,this.unevalHeights),i(h),n.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights),i(s),n.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,[-.1]),i(r),this.maskSegments=Xl.simpleSegment(0,h.primitiveOffset,0,h.primitiveLength),this.depthSegments=Xl.simpleSegment(0,s.primitiveOffset,0,s.primitiveLength),this.renderableBridgeSegments=Xl.simpleSegment(0,o.primitiveOffset,0,o.primitiveLength),this.renderableTunnelSegments=Xl.simpleSegment(0,c.primitiveOffset,0,c.primitiveLength),this.shadowCasterSegments=Xl.simpleSegment(0,r.primitiveOffset,0,r.primitiveLength)}update(e,t,i,n,r,s,o,a){this.bridgeProgramConfigurations.updatePaintArrays(e,t,r,i,n,s,o,a),this.tunnelProgramConfigurations.updatePaintArrays(e,t,r,i,n,s,o,a)}upload(e){this.vertexBuffer||0===this.vertexPositions.length||0===this.vertexNormals.length||0===this.indexArray.length||(this.vertexBuffer=e.createVertexBuffer(this.vertexPositions,su.members),this.vertexBufferNormal=e.createVertexBuffer(this.vertexNormals,ou.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.bridgeProgramConfigurations.upload(e),this.tunnelProgramConfigurations.upload(e))}destroy(){this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBufferNormal.destroy(),this.indexBuffer.destroy()),this.maskSegments&&(this.maskSegments.destroy(),this.depthSegments.destroy(),this.renderableBridgeSegments.destroy(),this.renderableTunnelSegments.destroy(),this.shadowCasterSegments.destroy()),this.bridgeProgramConfigurations.destroy(),this.tunnelProgramConfigurations.destroy()}populatePaintArrays(e,t,i,n,r){const s=(s,o)=>{for(let a=0;a<o.length-1;a++){const l=o[a].featureIndex,c=o[a+1].vertexStart,h=e.feature(l);s.populatePaintArrays(c,h,l,{},i,t,n,void 0,r)}};s(this.bridgeProgramConfigurations,this.bridgeFeatureSections),s(this.tunnelProgramConfigurations,this.tunnelFeatureSections)}computeVertexConnections(e,t,i,n,r){const s=new Map;for(let o=n;o<r;o++){const n=i[o],r=n.a,a=n.b,l=Hu.computePosHash(e[r]),c=Hu.computePosHash(e[a]);let h=s.get(l);h||(h={},s.set(l,h));let d=s.get(c);d||(d={},s.set(c,d)),t[r]<=0&&t[a]<=0||(h.to=a,d.from=r)}return s}isTerminalVertex(e,t){const i=Hu.computePosHash(this.unevalVertices[e]),n=t.get(i);return!n||!n.from||!n.to}constructBridgeStructures(e,t,i,n,r,s){e.clearVertexLookup();const o=this.computeVertexConnections(t,i,n,r.min,r.max),a=1/s,l=.5*a,c=(e,n)=>T(e,t[n].x,t[n].y,i[n]*a),h=x(),d=x(),u=x(),f=x(),p=x(),m=(e,i)=>{const n=o.get(Hu.computePosHash(t[i])),r=n.from,s=n.to;if(!r||!s)return;c(h,r),c(d,i),c(u,s),j(f),V(h,d)||(W(p,d,h),O(f,p)),V(u,d)||(W(p,u,d),k(f,f,O(p,p)));const a=$(f);return a>0?L(e,f,1/a):void 0};let g=Number.POSITIVE_INFINITY;this.sortSubarray(n,r.min,r.max,(e,t)=>e.featureInfo.featureIndex-t.featureInfo.featureIndex);const _=x(),y=x(),v=x(),b=x(),w=x(),S=x(),M=x(),A=x(),C=x(),D=[x(),x(),x(),x()],E=[x(),x(),x(),x()],I=[{coord:new xe(0,0),height:0},{coord:new xe(0,0),height:0}],P=(e,t)=>e>t;for(let c=r.min;c<r.max;c++){const r=n[c];if(!r.featureInfo.guardRailEnabled)continue;if(!this.prepareEdgePoints(I,t,i,r,P))continue;const[h,d]=I;if(T(_,h.coord.x,h.coord.y,a*h.height),T(y,d.coord.x,d.coord.y,a*d.height),V(_,y))continue;W(v,y,_),O(v,v);const u=m(A,r.a)||v,f=m(C,r.b)||v;T(b,u[1],-u[0],0),O(b,b),T(w,f[1],-f[0],0),O(w,w),F(A,b,u),O(S,A),F(A,w,f),O(M,A),k(D[0],_,L(A,W(A,b,S),l)),k(D[1],_,L(A,k(A,b,S),l)),k(D[2],_,L(A,S,l)),D[3]=_,k(E[0],y,L(A,W(A,w,M),l)),k(E[1],y,L(A,k(A,w,M),l)),k(E[2],y,L(A,M,l)),E[3]=y,g=this.addFeatureSection(r.featureInfo.featureIndex,g,this.bridgeFeatureSections,e);const p=e.addVertex(D[0],b,s),x=e.addVertex(D[1],b,s),z=e.addVertex(E[0],w,s),N=e.addVertex(E[1],w,s);e.addTriangle(p,x,z),e.addTriangle(x,N,z);const Y=e.addVertex(D[1],S,s),B=e.addVertex(D[2],S,s),H=e.addVertex(E[1],M,s),j=e.addVertex(E[2],M,s);e.addTriangle(Y,B,H),e.addTriangle(B,j,H),R(b,b),R(w,w);const U=e.addVertex(D[2],b,s),$=e.addVertex(D[3],b,s),G=e.addVertex(E[2],w,s),X=e.addVertex(E[3],w,s);e.addTriangle(U,$,G),e.addTriangle($,X,G);const q=this.isTerminalVertex(r.a,o),Z=this.isTerminalVertex(r.b,o);h.height<.01&&q&&e.addQuad(D[3],D[2],D[1],D[0],R(u,u),s),d.height<.01&&Z&&e.addQuad(E[0],E[1],E[2],E[3],f,s)}this.bridgeFeatureSections.push({featureIndex:Number.POSITIVE_INFINITY,vertexStart:e.getVertexCount()})}constructTunnelStructures(e,t,i,n,r,s){e.clearVertexLookup();let o=Number.POSITIVE_INFINITY;const a=(e,t)=>e.featureInfo.featureIndex-t.featureInfo.featureIndex;this.sortSubarray(n,r.min,r.max,a),this.sortSubarray(n,s.min,s.max,a);const l=e=>O(e,e),c=[{coord:new xe(0,0),height:0},{coord:new xe(0,0),height:0}],h=(e,t)=>e<t,d=x(),u=x(),f=x(),p=x(),m=x();for(let s=r.min;s<r.max;s++){if(!this.prepareEdgePoints(c,t,i,n[s],h))continue;const[r,a]=c,g=l(T(m,-(a.coord.y-r.coord.y),a.coord.x-r.coord.x,0));o=this.addFeatureSection(n[s].featureInfo.featureIndex,o,this.tunnelFeatureSections,e),e.addQuad(T(d,r.coord.x,r.coord.y,r.height),T(u,a.coord.x,a.coord.y,a.height),T(f,a.coord.x,a.coord.y,n[s].isTunnel?-.1:0),T(p,r.coord.x,r.coord.y,n[s].isTunnel?-.1:0),g)}for(let r=s.min;r<s.max;r++){const s=n[r];s.isTunnel&&([s.a,s.b]=[s.b,s.a]);const a=t[s.a],c=t[s.b],h=l(T(m,-(c.y-a.y),c.x-a.x,0));o=this.addFeatureSection(s.featureInfo.featureIndex,o,this.tunnelFeatureSections,e),e.addQuad(T(d,c.x,c.y,0),T(u,a.x,a.y,0),T(f,a.x,a.y,i[s.a]+4),T(p,c.x,c.y,i[s.b]+4),h),e.addQuad(T(d,a.x,a.y,0),T(u,c.x,c.y,0),T(f,c.x,c.y,i[s.b]+4),T(p,a.x,a.y,i[s.a]+4),h)}this.tunnelFeatureSections.push({featureIndex:Number.POSITIVE_INFINITY,vertexStart:e.getVertexCount()})}setElevatedPoint(e,t,i,n){e.coord.x=t,e.coord.y=i,e.height=n}prepareEdgePoints(e,t,i,n,r){let s=t[n.a].x,o=t[n.a].y,a=t[n.b].x,l=t[n.b].y,c=i[n.a],h=i[n.b];const d=r(c,0),u=r(h,0);if(d&&u)return this.setElevatedPoint(e[0],s,o,c),this.setElevatedPoint(e[1],a,l,h),!0;if(!d&&!u)return!1;if(d){if(!u){const e=h/(h-c);a=ci(a,s,e),l=ci(l,o,e),h=ci(h,c,e)}}else{const e=c/(c-h);s=ci(s,a,e),o=ci(o,l,e),c=ci(c,h,e)}return this.setElevatedPoint(e[0],s,o,c),this.setElevatedPoint(e[1],a,l,h),!0}prepareEdges(e,t){if(0===t.length)return;t.sort((e,t)=>e.hash===t.hash?t.polygonIdx-e.polygonIdx:t.hash>e.hash?1:-1);let i=0,n=0,r=0,s=t[i].polygonIdx;do{n++,(n===t.length||t[i].hash!==t[n].hash)&&((1==n-i||t[n-1].polygonIdx!==s)&&(r<i&&(t[r]=t[i],t[i]=null),t[r].type="none",r++),i=n,i!==t.length&&(s=t[i].polygonIdx))}while(i!==t.length);if(t.splice(r),0!==t.length&&0!==e.length){t.sort((e,t)=>e.portalHash<t.portalHash?1:-1);let i=0,n=0;for(;i!==t.length&&n!==e.length;){const r=t[i],s=e[n];r.portalHash>s.hash?i++:s.hash>r.portalHash?n++:(r.type=s.type,i++)}}}isOnBorder(e,t){return e<=0&&t<=0||e>=Rn&&t>=Rn}addFeatureSection(e,t,i,n){return e!==t&&(t=e,i.push({featureIndex:e,vertexStart:n.getVertexCount()}),n.clearVertexLookup()),t}sortSubarray(e,t,i,n){const r=e.slice(t,i);r.sort(n),e.splice(t,r.length,...r)}static computeEdgeHash(e,t){return(e.y===t.y&&e.x>t.x||e.y>t.y)&&([e,t]=[t,e]),BigInt(Hu.computePosHash(e))<<32n|BigInt(Hu.computePosHash(t))}static computePosHash(e){return((65535&e.x)<<16|65535&e.y)>>>0}}var ju,Vu={exports:{}},Wu=(ju||(ju=1,function(e,t){!function(e){function t(e,t){return e>t?1:e<t?-1:0}var i=function(e,i){void 0===e&&(e=t),void 0===i&&(i=!1),this._compare=e,this._root=null,this._size=0,this._noDuplicates=!!i},n={size:{configurable:!0}};function r(e,t,i,n,s){var o=s-n;if(o>0){var a=n+Math.floor(o/2),l={key:t[a],data:i[a],parent:e};return l.left=r(l,t,i,n,a),l.right=r(l,t,i,a+1,s),l}return null}function s(e,t,i,n,r){if(!(i>=n)){for(var o=e[i+n>>1],a=i-1,l=n+1;;){do{a++}while(r(e[a],o)<0);do{l--}while(r(e[l],o)>0);if(a>=l)break;var c=e[a];e[a]=e[l],e[l]=c,c=t[a],t[a]=t[l],t[l]=c}s(e,t,i,l,r),s(e,t,l+1,n,r)}}i.prototype.rotateLeft=function(e){var t=e.right;t&&(e.right=t.left,t.left&&(t.left.parent=e),t.parent=e.parent),e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.left=e),e.parent=t},i.prototype.rotateRight=function(e){var t=e.left;t&&(e.left=t.right,t.right&&(t.right.parent=e),t.parent=e.parent),e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.right=e),e.parent=t},i.prototype._splay=function(e){for(;e.parent;){var t=e.parent;t.parent?t.left===e&&t.parent.left===t?(this.rotateRight(t.parent),this.rotateRight(t)):t.right===e&&t.parent.right===t?(this.rotateLeft(t.parent),this.rotateLeft(t)):t.left===e&&t.parent.right===t?(this.rotateRight(t),this.rotateLeft(t)):(this.rotateLeft(t),this.rotateRight(t)):t.left===e?this.rotateRight(t):this.rotateLeft(t)}},i.prototype.splay=function(e){for(var t,i,n,r,s;e.parent;)(i=(t=e.parent).parent)&&i.parent?((n=i.parent).left===i?n.left=e:n.right=e,e.parent=n):(e.parent=null,this._root=e),r=e.left,s=e.right,e===t.left?(i&&(i.left===t?(t.right?(i.left=t.right,i.left.parent=i):i.left=null,t.right=i,i.parent=t):(r?(i.right=r,r.parent=i):i.right=null,e.left=i,i.parent=e)),s?(t.left=s,s.parent=t):t.left=null,e.right=t,t.parent=e):(i&&(i.right===t?(t.left?(i.right=t.left,i.right.parent=i):i.right=null,t.left=i,i.parent=t):(s?(i.left=s,s.parent=i):i.left=null,e.right=i,i.parent=e)),r?(t.right=r,r.parent=t):t.right=null,e.left=t,t.parent=e)},i.prototype.replace=function(e,t){e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.parent=e.parent)},i.prototype.minNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.left;)e=e.left;return e},i.prototype.maxNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.right;)e=e.right;return e},i.prototype.insert=function(e,t){var i=this._root,n=null,r=this._compare;if(this._noDuplicates)for(;i;){if(n=i,0===r(i.key,e))return;i=r(i.key,e)<0?i.right:i.left}else for(;i;)n=i,i=r(i.key,e)<0?i.right:i.left;return i={key:e,data:t,left:null,right:null,parent:n},n?r(n.key,i.key)<0?n.right=i:n.left=i:this._root=i,this.splay(i),this._size++,i},i.prototype.find=function(e){for(var t=this._root,i=this._compare;t;){var n=i(t.key,e);if(n<0)t=t.right;else{if(!(n>0))return t;t=t.left}}return null},i.prototype.contains=function(e){for(var t=this._root,i=this._compare;t;){var n=i(e,t.key);if(0===n)return!0;t=n<0?t.left:t.right}return!1},i.prototype.remove=function(e){var t=this.find(e);if(!t)return!1;if(this.splay(t),t.left)if(t.right){var i=this.minNode(t.right);i.parent!==t&&(this.replace(i,i.right),i.right=t.right,i.right.parent=i),this.replace(t,i),i.left=t.left,i.left.parent=i}else this.replace(t,t.left);else this.replace(t,t.right);return this._size--,!0},i.prototype.removeNode=function(e){if(!e)return!1;if(this.splay(e),e.left)if(e.right){var t=this.minNode(e.right);t.parent!==e&&(this.replace(t,t.right),t.right=e.right,t.right.parent=t),this.replace(e,t),t.left=e.left,t.left.parent=t}else this.replace(e,e.left);else this.replace(e,e.right);return this._size--,!0},i.prototype.erase=function(e){var t=this.find(e);if(t){this.splay(t);var i=t.left,n=t.right,r=null;i&&(i.parent=null,r=this.maxNode(i),this.splay(r),this._root=r),n&&(i?r.right=n:this._root=n,n.parent=r),this._size--}},i.prototype.pop=function(){var e=this._root,t=null;if(e){for(;e.left;)e=e.left;t={key:e.key,data:e.data},this.remove(e.key)}return t},i.prototype.next=function(e){var t=e;if(t)if(t.right)for(t=t.right;t&&t.left;)t=t.left;else for(t=e.parent;t&&t.right===e;)e=t,t=t.parent;return t},i.prototype.prev=function(e){var t=e;if(t)if(t.left)for(t=t.left;t&&t.right;)t=t.right;else for(t=e.parent;t&&t.left===e;)e=t,t=t.parent;return t},i.prototype.forEach=function(e){for(var t=this._root,i=[],n=!1,r=0;!n;)t?(i.push(t),t=t.left):i.length>0?(e(t=i.pop(),r++),t=t.right):n=!0;return this},i.prototype.range=function(e,t,i,n){for(var r=[],s=this._compare,o=this._root;0!==r.length||o;)if(o)r.push(o),o=o.left;else{if(s((o=r.pop()).key,t)>0)break;if(s(o.key,e)>=0&&i.call(n,o))return this;o=o.right}return this},i.prototype.keys=function(){for(var e=this._root,t=[],i=[],n=!1;!n;)e?(t.push(e),e=e.left):t.length>0?(e=t.pop(),i.push(e.key),e=e.right):n=!0;return i},i.prototype.values=function(){for(var e=this._root,t=[],i=[],n=!1;!n;)e?(t.push(e),e=e.left):t.length>0?(e=t.pop(),i.push(e.data),e=e.right):n=!0;return i},i.prototype.at=function(e){for(var t=this._root,i=[],n=!1,r=0;!n;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},i.prototype.load=function(e,t,i){if(void 0===e&&(e=[]),void 0===t&&(t=[]),void 0===i&&(i=!1),0!==this._size)throw new Error("bulk-load: tree is not empty");var n=e.length;return i&&s(e,t,0,n-1,this._compare),this._root=r(null,e,t,0,n),this._size=n,this},i.prototype.min=function(){var e=this.minNode(this._root);return e?e.key:null},i.prototype.max=function(){var e=this.maxNode(this._root);return e?e.key:null},i.prototype.isEmpty=function(){return null===this._root},n.size.get=function(){return this._size},i.createTree=function(e,t,n,r,s){return new i(n,s).load(e,t,r)},Object.defineProperties(i.prototype,n);function o(e,t,i){null===t?(e.inOut=!1,e.otherInOut=!0):(e.isSubject===t.isSubject?(e.inOut=!t.inOut,e.otherInOut=t.otherInOut):(e.inOut=!t.otherInOut,e.otherInOut=t.isVertical()?!t.inOut:t.inOut),t&&(e.prevInResult=!a(t,i)||t.isVertical()?t.prevInResult:t));var n=a(e,i);e.resultTransition=n?function(e,t){var i,n=!e.inOut,r=!e.otherInOut;switch(t){case 0:i=n&&r;break;case 1:i=n||r;break;case 3:i=n^r;break;case 2:i=e.isSubject?n&&!r:r&&!n}return i?1:-1}(e,i):0}function a(e,t){switch(e.type){case 0:switch(t){case 0:return!e.otherInOut;case 1:return e.otherInOut;case 2:return e.isSubject&&e.otherInOut||!e.isSubject&&!e.otherInOut;case 3:return!0}break;case 2:return 0===t||1===t;case 3:return 2===t;case 1:return!1}return!1}var l=function(e,t,i,n,r){this.left=t,this.point=e,this.otherEvent=i,this.isSubject=n,this.type=r||0,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.resultTransition=0,this.otherPos=-1,this.outputContourId=-1,this.isExteriorRing=!0},c={inResult:{configurable:!0}};function h(e,t){return e[0]===t[0]&&e[1]===t[1]}l.prototype.isBelow=function(e){var t=this.point,i=this.otherEvent.point;return this.left?(t[0]-e[0])*(i[1]-e[1])-(i[0]-e[0])*(t[1]-e[1])>0:(i[0]-e[0])*(t[1]-e[1])-(t[0]-e[0])*(i[1]-e[1])>0},l.prototype.isAbove=function(e){return!this.isBelow(e)},l.prototype.isVertical=function(){return this.point[0]===this.otherEvent.point[0]},c.inResult.get=function(){return 0!==this.resultTransition},l.prototype.clone=function(){var e=new l(this.point,this.left,this.otherEvent,this.isSubject,this.type);return e.contourId=this.contourId,e.resultTransition=this.resultTransition,e.prevInResult=this.prevInResult,e.isExteriorRing=this.isExteriorRing,e.inOut=this.inOut,e.otherInOut=this.otherInOut,e},Object.defineProperties(l.prototype,c);var d=11102230246251565e-32,u=134217729,f=(3+8*d)*d;function p(e,t,i,n,r){var s,o,a,l,c=t[0],h=n[0],d=0,u=0;h>c==h>-c?(s=c,c=t[++d]):(s=h,h=n[++u]);var f=0;if(d<e&&u<i)for(h>c==h>-c?(a=s-((o=c+s)-c),c=t[++d]):(a=s-((o=h+s)-h),h=n[++u]),s=o,0!==a&&(r[f++]=a);d<e&&u<i;)h>c==h>-c?(a=s-((o=s+c)-(l=o-s))+(c-l),c=t[++d]):(a=s-((o=s+h)-(l=o-s))+(h-l),h=n[++u]),s=o,0!==a&&(r[f++]=a);for(;d<e;)a=s-((o=s+c)-(l=o-s))+(c-l),c=t[++d],s=o,0!==a&&(r[f++]=a);for(;u<i;)a=s-((o=s+h)-(l=o-s))+(h-l),h=n[++u],s=o,0!==a&&(r[f++]=a);return 0===s&&0!==f||(r[f++]=s),f}function m(e){return new Float64Array(e)}var g=m(4),_=m(8),y=m(12),v=m(16),x=m(4);function b(e,t,i){var n=function(e,t,i,n,r,s){var o=(t-s)*(i-r),a=(e-r)*(n-s),l=o-a;if(0===o||0===a||o>0!=a>0)return l;var c=Math.abs(o+a);return Math.abs(l)>=33306690738754716e-32*c?l:-function(e,t,i,n,r,s,o){var a,l,c,h,d,m,b,w,S,T,k,M,A,C,D,L,E,I,P=e-r,R=i-r,O=t-s,z=n-s;g[0]=(D=(w=P-(b=(m=u*P)-(m-P)))*(T=z-(S=(m=u*z)-(m-z)))-((C=P*z)-b*S-w*S-b*T))-((k=D-(E=(w=O-(b=(m=u*O)-(m-O)))*(T=R-(S=(m=u*R)-(m-R)))-((L=O*R)-b*S-w*S-b*T)))+(d=D-k))+(d-E),g[1]=(A=C-((M=C+k)-(d=M-C))+(k-d))-((k=A-L)+(d=A-k))+(d-L),g[2]=M-((I=M+k)-(d=I-M))+(k-d),g[3]=I;var F=function(e,t){for(var i=t[0],n=1;n<4;n++)i+=t[n];return i}(0,g),N=22204460492503146e-32*o;if(F>=N||-F>=N)return F;if(a=e-(P+(d=e-P))+(d-r),c=i-(R+(d=i-R))+(d-r),l=t-(O+(d=t-O))+(d-s),h=n-(z+(d=n-z))+(d-s),0===a&&0===l&&0===c&&0===h)return F;if(N=11093356479670487e-47*o+f*Math.abs(F),(F+=P*h+z*a-(O*c+R*l))>=N||-F>=N)return F;x[0]=(D=(w=a-(b=(m=u*a)-(m-a)))*(T=z-(S=(m=u*z)-(m-z)))-((C=a*z)-b*S-w*S-b*T))-((k=D-(E=(w=l-(b=(m=u*l)-(m-l)))*(T=R-(S=(m=u*R)-(m-R)))-((L=l*R)-b*S-w*S-b*T)))+(d=D-k))+(d-E),x[1]=(A=C-((M=C+k)-(d=M-C))+(k-d))-((k=A-L)+(d=A-k))+(d-L),x[2]=M-((I=M+k)-(d=I-M))+(k-d),x[3]=I;var Y=p(4,g,4,x,_);x[0]=(D=(w=P-(b=(m=u*P)-(m-P)))*(T=h-(S=(m=u*h)-(m-h)))-((C=P*h)-b*S-w*S-b*T))-((k=D-(E=(w=O-(b=(m=u*O)-(m-O)))*(T=c-(S=(m=u*c)-(m-c)))-((L=O*c)-b*S-w*S-b*T)))+(d=D-k))+(d-E),x[1]=(A=C-((M=C+k)-(d=M-C))+(k-d))-((k=A-L)+(d=A-k))+(d-L),x[2]=M-((I=M+k)-(d=I-M))+(k-d),x[3]=I;var B=p(Y,_,4,x,y);x[0]=(D=(w=a-(b=(m=u*a)-(m-a)))*(T=h-(S=(m=u*h)-(m-h)))-((C=a*h)-b*S-w*S-b*T))-((k=D-(E=(w=l-(b=(m=u*l)-(m-l)))*(T=c-(S=(m=u*c)-(m-c)))-((L=l*c)-b*S-w*S-b*T)))+(d=D-k))+(d-E),x[1]=(A=C-((M=C+k)-(d=M-C))+(k-d))-((k=A-L)+(d=A-k))+(d-L),x[2]=M-((I=M+k)-(d=I-M))+(k-d),x[3]=I;var H=p(B,y,4,x,v);return v[H-1]}(e,t,i,n,r,s,c)}(e[0],e[1],t[0],t[1],i[0],i[1]);return n>0?-1:n<0?1:0}function w(e,t){var i=e.point,n=t.point;return i[0]>n[0]?1:i[0]<n[0]?-1:i[1]!==n[1]?i[1]>n[1]?1:-1:function(e,t,i){return e.left!==t.left?e.left?1:-1:0!==b(i,e.otherEvent.point,t.otherEvent.point)?e.isBelow(t.otherEvent.point)?-1:1:!e.isSubject&&t.isSubject?1:-1}(e,t,i)}function S(e,t,i){var n=new l(t,!1,e,e.isSubject),r=new l(t,!0,e.otherEvent,e.isSubject);return h(e.point,e.otherEvent.point)&&console.warn("what is that, a collapsed segment?",e),n.contourId=r.contourId=e.contourId,w(r,e.otherEvent)>0&&(e.otherEvent.left=!0,r.left=!1),e.otherEvent.otherEvent=r,e.otherEvent=n,i.push(r),i.push(n),i}function T(e,t){return e[0]*t[1]-e[1]*t[0]}function k(e,t){return e[0]*t[0]+e[1]*t[1]}function M(e,t,i){var n=function(e,t,i,n){var r=[t[0]-e[0],t[1]-e[1]],s=[n[0]-i[0],n[1]-i[1]];function o(e,t,i){return[e[0]+t*i[0],e[1]+t*i[1]]}var a=[i[0]-e[0],i[1]-e[1]],l=T(r,s),c=l*l,h=k(r,r);if(c>0){var d=T(a,s)/l;if(d<0||d>1)return null;var u=T(a,r)/l;return u<0||u>1?null:0===d||1===d?[o(e,d,r)]:0===u||1===u?[o(i,u,s)]:[o(e,d,r)]}if((c=(l=T(a,r))*l)>0)return null;var f=k(r,a)/h,p=f+k(r,s)/h,m=Math.min(f,p),g=Math.max(f,p);return m<=1&&g>=0?1===m?[o(e,m>0?m:0,r)]:0===g?[o(e,g<1?g:1,r)]:[o(e,m>0?m:0,r),o(e,g<1?g:1,r)]:null}(e.point,e.otherEvent.point,t.point,t.otherEvent.point),r=n?n.length:0;if(0===r)return 0;if(1===r&&(h(e.point,t.point)||h(e.otherEvent.point,t.otherEvent.point)))return 0;if(2===r&&e.isSubject===t.isSubject)return 0;if(1===r)return h(e.point,n[0])||h(e.otherEvent.point,n[0])||S(e,n[0],i),h(t.point,n[0])||h(t.otherEvent.point,n[0])||S(t,n[0],i),1;var s=[],o=!1,a=!1;return h(e.point,t.point)?o=!0:1===w(e,t)?s.push(t,e):s.push(e,t),h(e.otherEvent.point,t.otherEvent.point)?a=!0:1===w(e.otherEvent,t.otherEvent)?s.push(t.otherEvent,e.otherEvent):s.push(e.otherEvent,t.otherEvent),o&&a||o?(t.type=1,e.type=t.inOut===e.inOut?2:3,o&&!a&&S(s[1].otherEvent,s[0].point,i),2):a?(S(s[0],s[1].point,i),3):s[0]!==s[3].otherEvent?(S(s[0],s[1].point,i),S(s[1],s[2].point,i),3):(S(s[0],s[1].point,i),S(s[3].otherEvent,s[2].point,i),3)}function A(e,t){if(e===t)return 0;if(0!==b(e.point,e.otherEvent.point,t.point)||0!==b(e.point,e.otherEvent.point,t.otherEvent.point))return h(e.point,t.point)?e.isBelow(t.otherEvent.point)?-1:1:e.point[0]===t.point[0]?e.point[1]<t.point[1]?-1:1:1===w(e,t)?t.isAbove(e.point)?-1:1:e.isBelow(t.point)?-1:1;if(e.isSubject!==t.isSubject)return e.isSubject?-1:1;var i=e.point,n=t.point;return i[0]===n[0]&&i[1]===n[1]?(i=e.otherEvent.point)[0]===(n=t.otherEvent.point)[0]&&i[1]===n[1]?0:e.contourId>t.contourId?1:-1:1===w(e,t)?1:-1}var C=function(){this.points=[],this.holeIds=[],this.holeOf=null,this.depth=null};function D(e,t,i,n){var r,s=e+1,o=t[e].point,a=t.length;for(s<a&&(r=t[s].point);s<a&&r[0]===o[0]&&r[1]===o[1];){if(!i[s])return s;++s<a&&(r=t[s].point)}for(s=e-1;i[s]&&s>n;)s--;return s}C.prototype.isExterior=function(){return null==this.holeOf};var L=I,E=I;function I(e,t){if(!(this instanceof I))return new I(e,t);if(this.data=e||[],this.length=this.data.length,this.compare=t||P,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)}function P(e,t){return e<t?-1:e>t?1:0}I.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){for(var t=this.data,i=this.compare,n=t[e];e>0;){var r=e-1>>1,s=t[r];if(i(n,s)>=0)break;t[e]=s,e=r}t[e]=n},_down:function(e){for(var t=this.data,i=this.compare,n=this.length>>1,r=t[e];e<n;){var s=1+(e<<1),o=s+1,a=t[s];if(o<this.length&&i(t[o],a)<0&&(s=o,a=t[o]),i(a,r)>=0)break;t[e]=a,e=s}t[e]=r}},L.default=E;var R=Math.max,O=Math.min,z=0;function F(e,t,i,n,r,s){var o,a,c,h,d,u;for(o=0,a=e.length-1;o<a;o++)if(h=e[o+1],d=new l(c=e[o],!1,void 0,t),u=new l(h,!1,d,t),d.otherEvent=u,c[0]!==h[0]||c[1]!==h[1]){d.contourId=u.contourId=i,s||(d.isExteriorRing=!1,u.isExteriorRing=!1),w(d,u)>0?u.left=!0:d.left=!0;var f=c[0],p=c[1];r[0]=O(r[0],f),r[1]=O(r[1],p),r[2]=R(r[2],f),r[3]=R(r[3],p),n.push(d),n.push(u)}}var N=[];function Y(e,t,n){"number"==typeof e[0][0][0]&&(e=[e]),"number"==typeof t[0][0][0]&&(t=[t]);var r=function(e,t,i){var n=null;return e.length*t.length==0&&(0===i?n=N:2===i?n=e:1!==i&&3!==i||(n=0===e.length?t:e)),n}(e,t,n);if(r)return r===N?null:r;var s=[1/0,1/0,-1/0,-1/0],a=[1/0,1/0,-1/0,-1/0],l=function(e,t,i,n,r){var s,o,a,l,c,h,d=new L(null,w);for(a=0,l=e.length;a<l;a++)for(c=0,h=(s=e[a]).length;c<h;c++)(o=0===c)&&z++,F(s[c],!0,z,d,i,o);for(a=0,l=t.length;a<l;a++)for(c=0,h=(s=t[a]).length;c<h;c++)o=0===c,2===r&&(o=!1),o&&z++,F(s[c],!1,z,d,n,o);return d}(e,t,s,a,n);if(r=function(e,t,i,n,r){var s=null;return(i[0]>n[2]||n[0]>i[2]||i[1]>n[3]||n[1]>i[3])&&(0===r?s=N:2===r?s=e:1!==r&&3!==r||(s=e.concat(t))),s}(e,t,s,a,n))return r===N?null:r;for(var c=function(e){var t,i,n=function(e){var t,i,n,r,s=[];for(i=0,n=e.length;i<n;i++)((t=e[i]).left&&t.inResult||!t.left&&t.otherEvent.inResult)&&s.push(t);for(var o=!1;!o;)for(o=!0,i=0,n=s.length;i<n;i++)i+1<n&&1===w(s[i],s[i+1])&&(r=s[i],s[i]=s[i+1],s[i+1]=r,o=!1);for(i=0,n=s.length;i<n;i++)(t=s[i]).otherPos=i;for(i=0,n=s.length;i<n;i++)(t=s[i]).left||(r=t.otherPos,t.otherPos=t.otherEvent.otherPos,t.otherEvent.otherPos=r);return s}(e),r={},s=[],o=function(){if(!r[t]){var e=s.length,i=function(e,t,i){var n=new C;if(null!=e.prevInResult){var r=e.prevInResult,s=r.outputContourId;if(r.resultTransition>0){var o=t[s];if(null!=o.holeOf){var a=o.holeOf;t[a].holeIds.push(i),n.holeOf=a,n.depth=t[s].depth}else t[s].holeIds.push(i),n.holeOf=s,n.depth=t[s].depth+1}else n.holeOf=null,n.depth=t[s].depth}else n.holeOf=null,n.depth=0;return n}(n[t],s,e),o=function(t){r[t]=!0,t<n.length&&n[t]&&(n[t].outputContourId=e)},a=t,l=t;for(i.points.push(n[t].point);o(a),o(a=n[a].otherPos),i.points.push(n[a].point),!((a=D(a,n,r,l))==l||a>=n.length)&&n[a];);s.push(i)}};for(t=0,i=n.length;t<i;t++)o();return s}(function(e,t,n,r,s,a){for(var l,c,h,d=new i(A),u=[],f=Math.min(r[2],s[2]);0!==e.length;){var p=e.pop();if(u.push(p),0===a&&p.point[0]>f||2===a&&p.point[0]>r[2])break;if(p.left){c=l=d.insert(p),l=l!==(h=d.minNode())?d.prev(l):null,c=d.next(c);var m=l?l.key:null;if(o(p,m,a),c&&2===M(p,c.key,e)&&(o(p,m,a),o(c.key,p,a)),l&&2===M(l.key,p,e)){var g=l;o(m,(g=g!==h?d.prev(g):null)?g.key:null,a),o(p,m,a)}}else c=l=d.find(p=p.otherEvent),l&&c&&(l=l!==h?d.prev(l):null,c=d.next(c),d.remove(p),c&&l&&M(l.key,c.key,e))}return u}(l,0,0,s,a,n)),h=[],d=0;d<c.length;d++){var u=c[d];if(u.isExterior()){for(var f=[u.points],p=0;p<u.holeIds.length;p++)f.push(c[u.holeIds[p]].points);h.push(f)}}return h}var B={UNION:1,DIFFERENCE:2,INTERSECTION:0,XOR:3};e.diff=function(e,t){return Y(e,t,2)},e.intersection=function(e,t){return Y(e,t,0)},e.operations=B,e.union=function(e,t){return Y(e,t,1)},e.xor=function(e,t){return Y(e,t,3)},Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,Vu.exports)),Vu.exports);function Uu(e,t,i,n){const r=[],s=0===n?(e,t,i,n,r,s)=>{e.push(new xe(s,i+(s-t)/(n-t)*(r-i)))}:(e,t,i,n,r,s)=>{e.push(new xe(t+(s-i)/(r-i)*(n-t),s))};for(const o of e){const e=[];for(const r of o){if(r.length<=2)continue;const o=[];for(let e=0;e<r.length-1;e++){const a=r[e].x,l=r[e].y,c=r[e+1].x,h=r[e+1].y,d=0===n?a:l,u=0===n?c:h;d<t?u>t&&s(o,a,l,c,h,t):d>i?u<i&&s(o,a,l,c,h,i):o.push(r[e]),u<t&&d>=t&&s(o,a,l,c,h,t),u>i&&d<=i&&s(o,a,l,c,h,i)}let a=r[r.length-1];const l=0===n?a.x:a.y;l>=t&&l<=i&&o.push(a),o.length&&(a=o[o.length-1],o[0].x===a.x&&o[0].y===a.y||o.push(o[0]),e.push(o))}e.length&&r.push(e)}return r}function $u(e,t){const i=Xu(e),n=Xu([t]),r=Wu.intersection(i,n);return null==r?[]:qu(r)}function Gu(e,t){const i=65536;let n=Xu(e,i);for(;t.valid();t.next()){const[e,r]=t.get(),s=e.x*i,o=e.y*i,a=r.x*i,l=r.y*i,c=a-s,h=l-o,d=Math.hypot(c,h),u=Math.trunc(h/d*3),f=-Math.trunc(c/d*3);n=Wu.diff(n,[[[s,o],[a,l],[a+u,l+f],[s+u,o+f],[s,o]]])}return qu(n,1/i)}function Xu(e,t=1){return[e.map(e=>e.map(e=>[e.x*t,e.y*t]))]}function qu(e,t=1){return e.map(e=>e.map((e,i)=>{const n=e.map(e=>new xe(e[0]*t,e[1]*t).round());return i>0&&n.reverse(),n}))}class Zu{constructor(e,t){this.layoutVertexArray=new Za,this.indexArray=new _l,this.lineIndexArray=new ul,this.triangleSegments=new Xl,this.lineSegments=new Xl,this.programConfigurations=new wc(e.layers,{zoom:e.zoom,lut:e.lut}),this.uploaded=!1,t&&(this.elevatedLayoutVertexArray=new Qa)}update(e,t,i,n,r,s,o,a){this.programConfigurations.updatePaintArrays(e,t,r,i,n,s,o,a)}isEmpty(){return 0===this.layoutVertexArray.length}needsUpload(){return this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,nu.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.lineIndexBuffer=e.createIndexBuffer(this.lineIndexArray),this.elevatedLayoutVertexArray&&this.elevatedLayoutVertexArray.length>0&&(this.elevatedLayoutVertexBuffer=e.createVertexBuffer(this.elevatedLayoutVertexArray,ru.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.lineIndexBuffer.destroy(),this.programConfigurations.destroy(),this.triangleSegments.destroy(),this.lineSegments.destroy())}populatePaintArrays(e,t,i,n,r,s,o){this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,t,i,n,r,s,void 0,o)}}class Ju{constructor(e){this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lut=e.lut,this.bufferData=new Zu(e,!1),this.elevationBufferData=new Zu(e,!0),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.projection=e.projection,this.elevationMode=this.layers[0].layout.get("fill-elevation-reference"),this.sourceLayerIndex=e.sourceLayerIndex,this.worldview=e.worldview}updateFootprints(e,t){}populate(e,t,i,n){this.hasPattern=zu("fill",this.layers,this.pixelRatio,t);const r=this.layers[0].layout.get("fill-sort-key"),s=[];for(const{feature:o,id:a,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,h=oh(o,e);if(!this.layers[0]._featureFilter.filter(new da(this.zoom,{worldview:this.worldview}),h,i))continue;const d=r?r.evaluate(h,{},i,t.availableImages):void 0,u={id:a,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:e?h.geometry:sh(o,i,n),patterns:{},sortKey:d};s.push(u)}r&&s.sort((e,t)=>e.sortKey-t.sortKey);for(const n of s){const{geometry:r,index:s,sourceLayerIndex:o}=n;if(this.hasPattern){const e=Fu("fill",this.layers,n,this.zoom,this.pixelRatio,t);this.patternFeatures.push(e)}else this.addFeature(n,r,s,i,{},t.availableImages,t.brightness,t.elevationFeatures);t.featureIndex.insert(e[s].feature,r,s,o,this.index)}}update(e,t,i,n,r,s,o){this.bufferData.update(e,t,i,n,r,s,o,this.worldview),this.elevationBufferData.update(e,t,i,n,r,s,o,this.worldview),this.elevatedStructures&&this.elevatedStructures.update(e,t,i,n,r,s,o,this.worldview)}addFeatures(e,t,i,n,r,s){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,t,i,n,s,e.elevationFeatures)}isEmpty(){return this.bufferData.isEmpty()&&this.elevationBufferData.isEmpty()}uploadPending(){return!this.uploaded||this.bufferData.needsUpload()||this.elevationBufferData.needsUpload()}upload(e){this.bufferData.upload(e),this.elevationBufferData.upload(e),this.elevatedStructures&&this.elevatedStructures.upload(e)}destroy(){this.bufferData.destroy(),this.elevationBufferData.destroy(),this.elevatedStructures&&this.elevatedStructures.destroy()}addFeature(e,t,i,n,r,s=[],o,a){const l=Pu(t,500);"none"!==this.elevationMode?this.addElevatedRoadFeature(e,l,n,i,a):this.addGeometry(l,this.bufferData),this.bufferData.populatePaintArrays(e,i,r,s,n,o,this.worldview),this.elevationBufferData.populatePaintArrays(e,i,r,s,n,o,this.worldview)}getUnevaluatedPortalGraph(){return this.elevatedStructures?this.elevatedStructures.unevaluatedPortals:void 0}getElevationPolygons(){return this.elevatedStructures?this.elevatedStructures.portalPolygons:void 0}setEvaluatedPortalGraph(e,t,i,n,r){this.elevatedStructures&&(this.elevatedStructures.construct(e),this.elevatedStructures.populatePaintArrays(t,i,n,r,this.worldview))}addElevatedRoadFeature(e,t,i,n,r){const s=new Array,o=Ih.getElevationFeature(e,r);if(!o)return void this.addGeometry(t,this.bufferData);{const e=this.clipPolygonsToTile(t,1);e.length>0&&s.push({polygons:e,elevationFeature:o,elevationTileID:i})}const a={guardRailEnabled:this.layers[0].layout.get("fill-construct-bridge-guard-rail").evaluate(e,{},i),featureIndex:n};for(const t of s)if(t.elevationFeature){if("hd-road-base"===this.elevationMode){this.elevatedStructures||(this.elevatedStructures=new Hu(t.elevationTileID,this.layers,this.zoom,this.lut));const i=t.elevationFeature.isTunnel();let n=0;e.properties.hasOwnProperty(mh)&&(n=+e.properties[mh]);for(const e of t.polygons)this.elevatedStructures.addPortalCandidates(t.elevationFeature.id,e,i,t.elevationFeature,n)}null==t.elevationFeature.constantHeight&&(t.polygons=this.prepareElevatedPolygons(t.polygons,t.elevationFeature,t.elevationTileID));const r=new Ph(i,t.elevationTileID);this.addElevatedGeometry(t.polygons,r,t.elevationFeature,"hd-road-base"===this.elevationMode?0:.05,n,a)}}addElevatedGeometry(e,t,i,n,r,s){const o={elevation:i,elevationSampler:t,bias:n,index:r,featureInfo:s},[a,l]=this.addGeometry(e,this.elevationBufferData,o);null==this.elevationBufferData.heightRange?this.elevationBufferData.heightRange={min:a,max:l}:(this.elevationBufferData.heightRange.min=Math.min(this.elevationBufferData.heightRange.min,a),this.elevationBufferData.heightRange.max=Math.max(this.elevationBufferData.heightRange.max,l))}addGeometry(e,t,i){let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=null;i&&(s=i.elevationSampler.constantElevation(i.elevation,i.bias),null!=s&&(n=s,r=s));const o=(e,o,a)=>{if(null!=i)if(o.push(e),null!=s)t.elevatedLayoutVertexArray.emplaceBack(s),a.push(s);else{const s=i.elevationSampler.pointElevation(e,i.elevation,i.bias);t.elevatedLayoutVertexArray.emplaceBack(s),a.push(s),n=Math.min(n,s),r=Math.max(r,s)}};for(const n of e){let e=0;for(const t of n)e+=t.length;const r=t.triangleSegments.prepareSegment(e,t.layoutVertexArray,t.indexArray),s=r.vertexLength,a=[],l=[],c=[],h=[],d=[],u=t.layoutVertexArray.length;for(const e of n){if(0===e.length)continue;e!==n[0]&&l.push(a.length/2);const r=t.lineSegments.prepareSegment(e.length,t.layoutVertexArray,t.lineIndexArray),s=r.vertexLength;i&&d.push(t.layoutVertexArray.length-u),o(e[0],c,h),t.layoutVertexArray.emplaceBack(e[0].x,e[0].y),t.lineIndexArray.emplaceBack(s+e.length-1,s),a.push(e[0].x),a.push(e[0].y);for(let i=1;i<e.length;i++)o(e[i],c,h),t.layoutVertexArray.emplaceBack(e[i].x,e[i].y),t.lineIndexArray.emplaceBack(s+i-1,s+i),a.push(e[i].x),a.push(e[i].y);r.vertexLength+=e.length,r.primitiveLength+=e.length}const f=au(a,l);for(let e=0;e<f.length;e+=3)t.indexArray.emplaceBack(s+f[e],s+f[e+1],s+f[e+2]);if(f.length>0&&i&&"hd-road-base"===this.elevationMode){const e=i.elevation.isTunnel(),t=i.elevation.safeArea,n=this.elevatedStructures.addVertices(c,h);this.elevatedStructures.addTriangles(f,n,e);const r=d.length;if(r>0){for(let s=0;s<r-1;s++)this.elevatedStructures.addRenderableRing(i.index,d[s]+n,d[s+1]-d[s],e,t,i.featureInfo);this.elevatedStructures.addRenderableRing(i.index,d[r-1]+n,c.length-d[r-1],e,t,i.featureInfo)}}r.vertexLength+=e,r.primitiveLength+=f.length/3}return[n,r]}prepareElevatedPolygons(e,t,i){const n=1/Zc(i),r=[];for(const i of e){const e=Gu(i,new Lh(t,n));r.push(...e)}return r}clipPolygonsToTile(e,t){const i=-t,n=-t,r=Rn+t,s=Rn+t;let o=0;const a=[],l=[];for(;o<e.length;o++){const t=e[o],c=un(t);(c.min.x>=i&&c.max.x<=r&&c.min.y>=n&&c.max.y<=s?a:l).push(t)}if(a.length===e.length)return e;const c=[new xe(i,n),new xe(r,n),new xe(r,s),new xe(i,s),new xe(i,n)],h=a;for(const e of l)h.push(...$u(e,c));return h}}let Ku,Qu,ef,tf;Ws(Ju,"FillBucket",{omit:["layers","patternFeatures"]}),Ws(Zu,"FillBufferData"),Ws(Hu,"ElevatedStructures");class nf{constructor(e,t,i,n){if(this.triangleCount=t.length/3,this.min=new xe(0,0),this.max=new xe(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],0===this.triangleCount||0===e.length)return;const[r,s]=[e[0].clone(),e[0].clone()];for(let t=1;t<e.length;++t){const i=e[t];r.x=Math.min(r.x,i.x),r.y=Math.min(r.y,i.y),s.x=Math.max(s.x,i.x),s.y=Math.max(s.y,i.y)}if(n){const e=Math.ceil(Math.max(s.x-r.x,s.y-r.y)/n);i=Math.max(i,e)}if(0===i)return;this.min=r,this.max=s;const o=this.max.sub(this.min);o.x=Math.max(o.x,1),o.y=Math.max(o.y,1);const a=Math.max(o.x,o.y)/i;this.cellsX=Math.max(1,Math.ceil(o.x/a)),this.cellsY=Math.max(1,Math.ceil(o.y/a)),this.xScale=1/a,this.yScale=1/a;const l=[];for(let i=0;i<this.triangleCount;i++){const n=e[t[3*i+0]].sub(this.min),r=e[t[3*i+1]].sub(this.min),s=e[t[3*i+2]].sub(this.min),o=rf(Math.floor(Math.min(n.x,r.x,s.x)),this.xScale,this.cellsX),c=rf(Math.floor(Math.max(n.x,r.x,s.x)),this.xScale,this.cellsX),h=rf(Math.floor(Math.min(n.y,r.y,s.y)),this.yScale,this.cellsY),d=rf(Math.floor(Math.max(n.y,r.y,s.y)),this.yScale,this.cellsY),u=new xe(0,0),f=new xe(0,0),p=new xe(0,0),m=new xe(0,0);for(let e=h;e<=d;++e){u.y=f.y=e*a,p.y=m.y=(e+1)*a;for(let t=o;t<=c;++t)u.x=p.x=t*a,f.x=m.x=(t+1)*a,(Zh(n,r,s,u,f,m)||Zh(n,r,s,u,m,p))&&l.push({cellIdx:e*this.cellsX+t,triIdx:i})}}if(0===l.length)return;l.sort((e,t)=>e.cellIdx-t.cellIdx||e.triIdx-t.triIdx);let c=0;for(;c<l.length;){const e=l[c].cellIdx,t={start:this.payload.length,len:0};for(;c<l.length&&l[c].cellIdx===e;)++t.len,this.payload.push(l[c++].triIdx);this.cells[e]=t}}_lazyInitLookup(){this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8))),this.lookup.fill(0)}queryPoint(e,t){if(0===this.triangleCount||0===this.cells.length)return;if(e.x>this.max.x||this.min.x>e.x||e.y>this.max.y||this.min.y>e.y)return;const i=rf(e.x-this.min.x,this.xScale,this.cellsX),n=rf(e.y-this.min.y,this.yScale,this.cellsY),r=this.cells[n*this.cellsX+i];if(r){this._lazyInitLookup();for(let e=0;e<r.len;e++){const i=this.payload[r.start+e],n=Math.floor(i/8),s=1<<i%8;if(!(this.lookup[n]&s)&&(this.lookup[n]|=s,t.push(i),t.length===this.triangleCount))return}}}query(e,t,i){if(0===this.triangleCount||0===this.cells.length)return;if(e.x>this.max.x||this.min.x>t.x)return;if(e.y>this.max.y||this.min.y>t.y)return;this._lazyInitLookup();const n=rf(e.x-this.min.x,this.xScale,this.cellsX),r=rf(t.x-this.min.x,this.xScale,this.cellsX),s=rf(e.y-this.min.y,this.yScale,this.cellsY),o=rf(t.y-this.min.y,this.yScale,this.cellsY);for(let e=s;e<=o;e++)for(let t=n;t<=r;t++){const n=this.cells[e*this.cellsX+t];if(n)for(let e=0;e<n.len;e++){const t=this.payload[n.start+e],r=Math.floor(t/8),s=1<<t%8;if(!(this.lookup[r]&s)&&(this.lookup[r]|=s,i.push(t),i.length===this.triangleCount))return}}}}function rf(e,t,i){return Math.max(0,Math.min(i-1,Math.floor(e*t)))}Ws(nf,"TriangleGridIndex");class sf{constructor(e){this.zoom=e.zoom,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.footprints=[],this.worldview=e.worldview}updateFootprints(e,t){for(const i of this.footprints)t.push({footprint:i,id:e})}populate(e,t,i,n){const r=[];for(const{feature:t,id:s,index:o,sourceLayerIndex:a}of e){const e=this.layers[0]._featureFilter.needGeometry,l=oh(t,e);if(!this.layers[0]._featureFilter.filter(new da(this.zoom,{worldview:this.worldview}),l,i))continue;const c={id:s,properties:t.properties,type:t.type,sourceLayerIndex:a,index:o,geometry:e?l.geometry:sh(t,i,n),patterns:{}};r.push(c)}for(const n of r){const{geometry:r,index:s,sourceLayerIndex:o}=n;this.addFeature(n,r,s,i,{},t.availableImages,t.brightness),t.featureIndex.insert(e[s].feature,r,s,o,this.index)}}isEmpty(){return 0===this.footprints.length}uploadPending(){return!1}upload(e){}update(e,t,i,n,r,s,o){}destroy(){}addFeature(e,t,i,n,r,s=[],o){for(const e of Pu(t,2)){const t=[],i=[],n=[],r=new xe(1/0,1/0),s=new xe(-1/0,-1/0);for(const o of e)if(0!==o.length){o!==e[0]&&n.push(i.length/2);for(let e=0;e<o.length;e++)i.push(o[e].x),i.push(o[e].y),t.push(o[e]),r.x=Math.min(r.x,o[e].x),r.y=Math.min(r.y,o[e].y),s.x=Math.max(s.x,o[e].x),s.y=Math.max(s.y,o[e].y)}const o=au(i,n),a=new nf(t,o,8,256);this.footprints.push({vertices:t,indices:o,grid:a,min:r,max:s})}}}Ws(sf,"ClipBucket",{omit:["layers"]});const of=Xa([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),af=Xa([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),lf=Xa([{name:"a_centroid_pos",components:2,type:"Uint16"}]),cf=Xa([{name:"a_join_normal_inside",components:3,type:"Int16"}]),hf=Xa([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),df=Xa([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:uf}=of,ff=Number.MAX_SAFE_INTEGER,pf=ff-1;function mf(e,t,i,n){return e.order<t||e.order===ff||!(e.clipMask&i)||function(e,t){return 0!==t.length&&void 0===t.find(t=>t===e)}(n,e.clipScope)}function gf(e,t){return e.x-t.x||e.y-t.y}function _f(e,t){return 0===gf(e.min,t.min)&&0===gf(e.max,t.max)}function yf(e,t){return!(e.min.x>t.max.x||e.max.x<t.min.x||e.min.y>t.max.y||e.max.y<t.min.y)}function vf(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i].sourceId!==t[i].sourceId||!_f(e[i],t[i])||e[i].order!==t[i].order||e[i].clipMask!==t[i].clipMask||!be(e[i].clipScope,t[i].clipScope))return!1;return!0}function xf(e,t,i){const n=1/Rn,r=1/(1<<i.canonical.z),s=(t.x*n+i.canonical.x)*r+i.wrap,o=(t.y*n+i.canonical.y)*r;return{min:new xe((e.x*n+i.canonical.x)*r+i.wrap,(e.y*n+i.canonical.y)*r),max:new xe(s,o)}}function bf(e,t,i){const n=1<<i.canonical.z,r=((t.x-i.wrap)*n-i.canonical.x)*Rn,s=(t.y*n-i.canonical.y)*Rn;return{min:new xe(((e.x-i.wrap)*n-i.canonical.x)*Rn,(e.y*n-i.canonical.y)*Rn),max:new xe(r,s)}}function wf(e,t,i,n,r,s,o){const a=e.indices,l=e.vertices,c=[];for(let h=n;h<n+r;h+=3){const n=t[i[h+0]+s],r=t[i[h+1]+s],d=t[i[h+2]+s],u=Math.min(n.x,r.x,d.x),f=Math.max(n.x,r.x,d.x),p=Math.min(n.y,r.y,d.y),m=Math.max(n.y,r.y,d.y);c.length=0,e.grid.query(new xe(u,p),new xe(f,m),c);for(let e=0;e<c.length;e++){const t=c[e];if(Zh(l[a[3*t+0]],l[a[3*t+1]],l[a[3*t+2]],n,r,d,o))return!0}}return!1}function Sf(e,t,i,n){if(!e||!i)return!1;let r=e.vertices;if(!t.canonical.equals(n.canonical)||t.wrap!==n.wrap){if(i.vertices.length<e.vertices.length)return Sf(i,n,e,t);const s=t.canonical,o=n.canonical,a=Math.pow(2,o.z-s.z);r=e.vertices.map(e=>new xe((e.x+s.x*Rn)*a-o.x*Rn,(e.y+s.y*Rn)*a-o.y*Rn))}return wf(i,r,e.indices,0,e.indices.length,0,0)}function Tf(e,t,i,n){const r=Math.pow(2,n.z-i.z);return new xe((e+i.x*Rn)*r-n.x*Rn,(t+i.y*Rn)*r-n.y*Rn)}function kf(e,t){const i=[];t.grid.queryPoint(e,i);const n=t.indices,r=t.vertices;for(let t=0;t<i.length;t++){const s=i[t];if($h([r[n[3*s+0]],r[n[3*s+1]],r[n[3*s+2]]],e))return!0}return!1}const Mf=[new xe(0,0),new xe(Rn,0),new xe(Rn,Rn),new xe(0,Rn)];function Af(e,t){const i=[];let n=[];if(!t||e.length<2)return[e];if(2===e.length)return Xh(e[0],e[1],Mf)?[e]:[];for(let t=0;t<e.length+2;t++){const r=e[t%e.length],s=e[(t+1)%e.length],o=Xh(0===t?e[e.length-1]:e[(t-1)%e.length],r,Mf),a=Xh(r,s,Mf),l=o||a;l&&n.push(r),l&&a||n.length>0&&(n.length>1&&i.push(n),n=[])}return n.length>1&&i.push(n),i}const Cf=ah.types,Df=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],Lf=["fill-extrusion-flood-light-ground-radius"],Ef=Math.pow(2,13),If=Math.pow(2,15)-1,Pf=new xe(0,1),Rf=2147483648;function Of(e,t,i,n,r,s,o,a){e.emplaceBack((t<<1)+o,(i<<1)+s,(Math.floor(n*Ef)<<1)+r,Math.round(a))}function zf(e,t,i){e.emplaceBack(t.x*Rn,t.y*Rn,i?1:0)}function Ff(e,t,i,n,r,s){e.emplaceBack(t.x,t.y,(i.x<<1)+n,(i.y<<1)+r,s)}function Nf(e,t,i){const n=16384;e.emplaceBack(t.x,t.y,t.z,i[0]*n,i[1]*n,i[2]*n)}class Yf{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class Bf{constructor(){this.centroidXY=new xe(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new xe(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new xe(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0,this.buildingId=0}span(){return new xe(this.max.x-this.min.x,this.max.y-this.min.y)}}class Hf{constructor(){this.acc=new xe(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,t){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=t.x,e.min.y=e.max.y=t.y)}appendEdge(e,t,i){this.accCount++,this.acc._add(t);let n=!!this.borders;t.x<e.min.x?(e.min.x=t.x,n=!0):t.x>e.max.x&&(e.max.x=t.x,n=!0),t.y<e.min.y?(e.min.y=t.y,n=!0):t.y>e.max.y&&(e.max.y=t.y,n=!0),((0===t.x||t.x===Rn)&&t.x===i.x)!=((0===t.y||t.y===Rn)&&t.y===i.y)&&this.processBorderOverlap(t,i),n&&this.checkBorderIntersection(t,i)}checkBorderIntersection(e,t){t.x<0!=e.x<0&&this.addBorderIntersection(0,ci(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>Rn!=e.x>Rn&&this.addBorderIntersection(1,ci(t.y,e.y,(Rn-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,ci(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>Rn!=e.y>Rn&&this.addBorderIntersection(3,ci(t.x,e.x,(Rn-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const i=this.borders[e];t<i[0]&&(i[0]=t),t>i[1]&&(i[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const i=0===e.x?0:1;this.addBorderIntersection(i,t.y),this.addBorderIntersection(i,e.y)}else{const i=0===e.y?2:3;this.addBorderIntersection(i,t.x),this.addBorderIntersection(i,e.x)}}centroid(){return 0===this.accCount?new xe(0,0):new xe(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce((e,t)=>e+ +(t[0]!==Number.MAX_VALUE),0):0}}function jf(e,t){const i=e.add(t)._unit(),n=Le(e.x*i.x+e.y*i.y,-1,1);var r,s,o;return r=Math.acos(n),Math.min(4,Math.max(-4,Math.tan(r)))/4*If*((s=e).x*(o=t).y-s.y*o.x<0?-1:1)}const Vf=[e=>e.x<0,e=>e.x>Rn,e=>e.y<0,e=>e.y>Rn];function Wf(e,t,i,n){const r=[4];if(0===n)return r;i._mult(n);const s=e.sub(i),o=t.sub(i),a=[e,t,s,o];for(let e=0;e<4;e++)for(const t of a)if(Vf[e](t)){r.push(e);break}return r}class Uf{constructor(e){this.vertexArray=new il,this.indexArray=new _l,this.programConfigurations=new wc(e.layers,{zoom:e.zoom,lut:e.lut},e=>Lf.includes(e)),this._segments=new Xl,this.hiddenByLandmarkVertexArray=new El,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new Xl}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(e,t,i,n=!1){const r=e.length;if(r>2){let s=Math.max(0,this._segments.get().length-1);const o=this._segments._prepareSegment(4*r,this.vertexArray.length,2*this._segmentToGroundQuads[s].length);let a;s!==this._segments.get().length-1&&(s++,this._segmentToGroundQuads[s]=[],this._segmentToRegionTriCounts[s]=[0,0,0,0,0]);{const t=e[0],i=e[1];a=jf(t.sub(e[r-1])._perp()._unit(),i.sub(t)._perp()._unit())}for(let l=0;l<r;l++){const c=l===r-1?0:l+1,h=e[l],d=e[c],u=e[c===r-1?0:c+1],f=d.sub(h)._perp()._unit(),p=jf(f,u.sub(d)._perp()._unit()),m=a,g=p;if(Zf(h,d,t)||n&&Jf(h,t)&&Jf(d,t)){a=p;continue}const _=o.vertexLength;Ff(this.vertexArray,h,d,1,1,m),Ff(this.vertexArray,h,d,1,0,m),Ff(this.vertexArray,h,d,0,1,g),Ff(this.vertexArray,h,d,0,0,g),o.vertexLength+=4;const y=Wf(h,d,f,i);for(const e of y)this._segmentToGroundQuads[s].push({id:_,region:e}),this._segmentToRegionTriCounts[s][e]+=2,o.primitiveLength+=2;a=p}}}prepareBorderSegments(){if(!this.hasData())return;const e=this._segments.get(),t=e.length;for(let e=0;e<t;e++)this._segmentToGroundQuads[e].sort((e,t)=>e.region-t.region);for(let i=0;i<t;i++){const t=this._segmentToGroundQuads[i],n=e[i],r=this._segmentToRegionTriCounts[i];r.reduce((e,t)=>e+t,0);let s=0;for(let e=0;e<=4;e++){const t=r[e];if(0!==t){let i=this.regionSegments[e];i||(i=this.regionSegments[e]=new Xl);const r={vertexOffset:n.vertexOffset,primitiveOffset:n.primitiveOffset+s,vertexLength:n.vertexLength,primitiveLength:t};i.get().push(r)}s+=t}for(let e=0;e<t.length;e++){const i=t[e].id;this.indexArray.emplaceBack(i,i+1,i+3),this.indexArray.emplaceBack(i,i+3,i+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(e,t,i,n,r,s,o){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,e,t,i,n,r,s,void 0,o)}upload(e){this.hasData()&&(this.vertexBuffer=e.createVertexBuffer(this.vertexArray,af.members),this.indexBuffer=e.createIndexBuffer(this.indexArray))}uploadPaintProperties(e){this.hasData()&&this.programConfigurations.upload(e)}update(e,t,i,n,r,s,o,a){this.hasData()&&this.programConfigurations.updatePaintArrays(e,t,i,n,r,s,o,a)}updateHiddenByLandmark(e){this.updateHiddenByLandmarkRange(e.groundVertexArrayOffset,e.groundVertexCount,!!(e.flags&Rf))}updateHiddenByLandmarkRange(e,t,i){if(!this.hasData())return;const n=t+e;if(0!==t){for(let t=e;t<n;++t)this.hiddenByLandmarkVertexArray.emplace(t,i?1:0);this._needsHiddenByLandmarkUpdate=!0}}uploadHiddenByLandmark(e){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,hf.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const t=this.regionSegments[e];t&&t.destroy()}}}}class $f{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.pixelRatio=e.pixelRatio,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new _l,this.footprintVertices=new Za,this.footprintSegments=[],this.layoutVertexArray=new Ka,this.centroidVertexArray=new jl,this.wallVertexArray=new Wl,this.indexArray=new _l,this.programConfigurations=new wc(e.layers,{zoom:e.zoom,lut:e.lut},e=>Df.includes(e)),this.segments=new Xl,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.groundEffect=new Uf(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[],this.worldview=e.worldview}updateFootprints(e,t){}populate(e,t,i,n){this.features=[],this.hasPattern=zu("fill-extrusion",this.layers,this.pixelRatio,t),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.selfDEMTileTimestamp=Number.MAX_VALUE,this.borderDEMTileTimestamp=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this.tileToMeter=Zc(i),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=0!==this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1);for(const{feature:r,id:s,index:o,sourceLayerIndex:a}of e){const e=this.layers[0]._featureFilter.needGeometry,l=oh(r,e);if(!this.layers[0]._featureFilter.filter(new da(this.zoom,{worldview:this.worldview}),l,i))continue;const c={id:s,sourceLayerIndex:a,index:o,geometry:e?l.geometry:sh(r,i,n),properties:r.properties,type:r.type,patterns:{}},h=this.layoutVertexArray.length,d="Polygon"===Cf[c.type];if(this.hasPattern)this.features.push({featureId:r.id,feature:Fu("fill-extrusion",this.layers,c,this.zoom,this.pixelRatio,t)});else if(this.wallMode)for(const e of c.geometry)for(const s of Af(e,d))this.addFeature(r.id,c,[s],o,i,{},t.availableImages,n,t.brightness);else this.addFeature(r.id,c,c.geometry,o,i,{},t.availableImages,n,t.brightness);t.featureIndex.insert(r,c.geometry,o,a,this.index,h)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,t,i,n,r,s){for(const{featureId:e,feature:o}of this.features){const a="Polygon"===Cf[o.type],{geometry:l}=o;if(this.wallMode)for(const c of l)for(const l of Af(c,a))this.addFeature(e,o,[l],o.index,t,i,n,r,s);else this.addFeature(e,o,l,o.index,t,i,n,r,s)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(e,t,i,n,r,s,o){this.programConfigurations.updatePaintArrays(e,t,r,i,n,s,o,this.worldview),this.groundEffect.update(e,t,r,i,n,s,o,this.worldview)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,uf),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.wallVertexBuffer=e.createVertexBuffer(this.wallVertexArray,cf.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,df.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,lf.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,i,n,r,s,o,a,l){const c=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(t,{})/this.tileToMeter,h=[new xe(0,0),new xe(Rn,Rn)],d=a.projection,u="globe"===d.name,f=this.wallMode||"Polygon"===Cf[t.type],p=new Hf;p.centroidDataIndex=this.centroidData.length;const m=new Bf;m.buildingId=e,t.properties&&t.properties.hasOwnProperty("building_id")&&(m.buildingId=t.properties.building_id);const g=this.layers[0].paint.get("fill-extrusion-base").evaluate(t,{},r)<=0,_=this.layers[0].paint.get("fill-extrusion-height").evaluate(t,{},r);let y;if(m.height=_,m.vertexArrayOffset=this.layoutVertexArray.length,m.groundVertexArrayOffset=this.groundEffect.vertexArray.length,u&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new al),this.wallMode){if(u)return void We("Non zero fill-extrusion-line-width is not yet supported on globe.");if(1!==i.length)return;y=function(e){const t=e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y,i=function(e){let t=0;const i=e.length;for(let n=0;n<i;n++)t+=(e[(n+1)%i].x-e[n].x)*(e[(n+1)%i].y+e[n].y);return t>=0}(e);i||(e=e.reverse());const n={geometry:[],joinNormals:[],indices:[]},r=[],s=[],o=[];let a=e.length;for(;a>=2&&e[a-1].equals(e[a-2]);)a--;if(a<(t?3:2))return n;let l,c,h,d,u,f=0;for(;f<a-1&&e[f].equals(e[f+1]);)f++;t&&(l=e[a-2],u=e[f].sub(l)._unit()._perp());for(let i=f;i<a;i++){if(h=i===a-1?t?e[f+1]:void 0:e[i+1],h&&e[i].equals(h))continue;u&&(d=u),l&&(c=l),l=e[i],u=h?h.sub(l)._unit()._perp():d,d=d||u;let n=d.add(u);0===n.x&&0===n.y||n._unit();const p=n.x*u.x+n.y*u.y,m=0!==p?1/p:1/0,g=d.x*u.y-d.y*u.x>0;let _="miter";const y=2;"miter"===_&&m>y&&(_="bevel"),"bevel"===_&&(m>100&&(_="flipbevel"),m<y&&(_="miter"));const v=(e,t,i,n)=>{const a=new xe(e.x,e.y),l=new xe(e.x,e.y);a.x+=t.x*n,a.y+=t.y*n,l.x-=t.x*Math.max(i,1),l.y-=t.y*Math.max(i,1),o.push(t),r.push(a),s.push(l)};if("miter"===_)n._mult(m),v(l,n,0,0);else if("flipbevel"===_)n=u.mult(-1),v(l,n,0,0),v(l,n.mult(-1),0,0);else{const e=-Math.sqrt(m*m-1),t=g?e:0,i=g?0:e;c&&v(l,d,t,i),h&&v(l,u,t,i)}}n.geometry=[...r,...s.reverse(),r[0]],n.joinNormals=[...o,...o.reverse(),o[o.length-1]];const p=n.geometry.length-1;for(let e=0;e<p/2;e++)if(e+1<p/2){let t=e,i=e+1,r=p-1-e,s=p-2-e;t=0===t?p-1:t-1,i=0===i?p-1:i-1,r=0===r?p-1:r-1,s=0===s?p-1:s-1,n.indices.push(r),n.indices.push(i),n.indices.push(t),n.indices.push(r),n.indices.push(s),n.indices.push(i)}return n}(i[0]),i=[y.geometry]}const v=(e,t)=>e<(t.length-1)/2||e===t.length-1,x=this.wallMode?[i]:Pu(i,500);for(let e=x.length-1;e>=0;e--){const t=x[e];(0===t.length||(b=t[0]).every(e=>e.x<=0)||b.every(e=>e.x>=Rn)||b.every(e=>e.y<=0)||b.every(e=>e.y>=Rn))&&x.splice(e,1)}var b;let w;if(u)w=tp(x,h,r);else{w=[];for(const e of x)w.push({polygon:e,bounds:h})}const S=f?this.edgeRadius:0,T=S>0&&this.zoom<17,k=(e,t)=>{if(0===e.length)return!1;const i=e[e.length-1];return t.x===i.x&&t.y===i.y};for(const{polygon:e,bounds:t}of w){let i=0,n=0;for(const t of e)f&&!t[0].equals(t[t.length-1])&&t.push(t[0]),n+=f?t.length-1:t.length;const s=this.segments.prepareSegment((f?5:4)*n,this.layoutVertexArray,this.indexArray);m.footprintSegIdx<0&&(m.footprintSegIdx=this.footprintSegments.length),m.polygonSegIdx<0&&(m.polygonSegIdx=this.polygonSegments.length);const o={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},a=new Yf;if(a.vertexOffset=this.footprintVertices.length,a.indexOffset=3*this.footprintIndices.length,a.ringIndices=[],f){const n=[],o=[];i=s.vertexLength;for(let i=0;i<e.length;i++){const l=e[i];l.length&&0!==i&&o.push(n.length/2);const h=[];let f,p;f=l[1].sub(l[0])._perp()._unit(),a.ringIndices.push(l.length-1);for(let e=1;e<l.length;e++){const t=l[e],i=l[e===l.length-1?1:e+1],o=t.clone();if(S){p=i.sub(t)._perp()._unit();const e=f.add(p)._unit(),n=S*Math.min(4,1/(f.x*e.x+f.y*e.y));o.x+=n*e.x,o.y+=n*e.y,o.x=Math.round(o.x),o.y=Math.round(o.y),f=p}if(!g||0!==S&&!T||k(h,o)||h.push(o),Of(this.layoutVertexArray,o.x,o.y,0,0,1,1,0),this.wallMode){const t=v(e,l);zf(this.wallVertexArray,y.joinNormals[e],!t)}s.vertexLength++,this.footprintVertices.emplaceBack(t.x,t.y),n.push(t.x,t.y),u&&Nf(this.layoutVertexExtArray,d.projectTilePoint(o.x,o.y,r),d.upVector(r,o.x,o.y))}g&&(0===S||T)&&(0!==h.length&&k(h,h[0])&&h.pop(),this.groundEffect.addData(h,t,c))}const l=this.wallMode?y.indices:au(n,o);for(let e=0;e<l.length;e+=3)this.footprintIndices.emplaceBack(a.vertexOffset+l[e+0],a.vertexOffset+l[e+1],a.vertexOffset+l[e+2]),this.indexArray.emplaceBack(i+l[e],i+l[e+2],i+l[e+1]),s.primitiveLength++;a.indexCount+=l.length,a.vertexCount+=this.footprintVertices.length-a.vertexOffset}for(let n=0;n<e.length;n++){const o=e[n];p.startRing(m,o[0]);let a=o.length>4&&Kf(o[o.length-2],o[0],o[1]),l=S?Xf(o[o.length-2],o[0],o[1],S):0;const h=[];let _,x,b;x=o[1].sub(o[0])._perp()._unit();let w=!0;for(let e=1,n=0;e<o.length;e++){let c=o[e-1],f=o[e];const T=o[e===o.length-1?1:e+1];if(p.appendEdge(m,f,c),Zf(f,c,t)){S&&(x=T.sub(f)._perp()._unit(),w=!w);continue}const M=f.sub(c)._perp(),A=M.x/(Math.abs(M.x)+Math.abs(M.y)),C=M.y>0?1:0,D=c.dist(f);if(n+D>32768&&(n=0),S){b=T.sub(f)._perp()._unit();let e=qf(c,f,T,Gf(x,b),S);isNaN(e)&&(e=0);const t=f.sub(c)._unit();c=c.add(t.mult(l))._round(),f=f.add(t.mult(-e))._round(),l=e,x=b,g&&this.zoom>=17&&(k(h,c)||h.push(c),k(h,f)||h.push(f))}const L=s.vertexLength,E=o.length>4&&Kf(c,f,T);let I=Qf(n,a,w);if(Of(this.layoutVertexArray,c.x,c.y,A,C,0,0,I),Of(this.layoutVertexArray,c.x,c.y,A,C,0,1,I),this.wallMode){const t=v(e-1,o),i=y.joinNormals[e-1];zf(this.wallVertexArray,i,t),zf(this.wallVertexArray,i,t)}if(n+=D,I=Qf(n,E,!w),a=E,Of(this.layoutVertexArray,f.x,f.y,A,C,0,0,I),Of(this.layoutVertexArray,f.x,f.y,A,C,0,1,I),this.wallMode){const t=v(e,o),i=y.joinNormals[e];zf(this.wallVertexArray,i,t),zf(this.wallVertexArray,i,t)}if(s.vertexLength+=4,this.indexArray.emplaceBack(L+0,L+1,L+2),this.indexArray.emplaceBack(L+1,L+3,L+2),s.primitiveLength+=2,S){const n=i+(1===e?o.length-2:e-2),r=1===e?i:n+1;if(this.indexArray.emplaceBack(L+1,n,L+3),this.indexArray.emplaceBack(n,r,L+3),s.primitiveLength+=2,void 0===_&&(_=L),!Zf(T,o[e],t)){const t=e===o.length-1?_:s.vertexLength;this.indexArray.emplaceBack(L+2,L+3,t),this.indexArray.emplaceBack(L+3,t+1,t),this.indexArray.emplaceBack(L+3,r,t+1),s.primitiveLength+=3}w=!w}if(u){const e=this.layoutVertexExtArray,t=d.projectTilePoint(c.x,c.y,r),i=d.projectTilePoint(f.x,f.y,r),n=d.upVector(r,c.x,c.y),s=d.upVector(r,f.x,f.y);Nf(e,t,n),Nf(e,t,n),Nf(e,i,s),Nf(e,i,s)}}f&&(i+=o.length-1),g&&S&&this.zoom>=17&&(0!==h.length&&k(h,h[0])&&h.pop(),this.groundEffect.addData(h,t,c,S>0))}this.footprintSegments.push(a),o.triangleCount=this.indexArray.length-o.triangleArrayOffset,this.polygonSegments.push(o),++m.footprintSegLen,++m.polygonSegLen}if(m.vertexCount=this.layoutVertexArray.length-m.vertexArrayOffset,m.groundVertexCount=this.groundEffect.vertexArray.length-m.groundVertexArrayOffset,0!==m.vertexCount){if(m.centroidXY=p.borders?Pf:this.encodeCentroid(p,m),this.centroidData.push(m),p.borders){this.featuresOnBorder.push(p);const e=this.featuresOnBorder.length-1;for(let t=0;t<p.borders.length;t++)p.borders[t][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[t].push(e)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,s,o,r,l,void 0,this.worldview),this.groundEffect.addPaintPropertiesData(t,n,s,o,r,l,this.worldview),this.maxHeight=Math.max(this.maxHeight,_)}}sortBorders(){for(let e=0;e<this.borderFeatureIndices.length;e++)this.borderFeatureIndices[e].sort((t,i)=>this.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[i].borders[e][0])}splitToSubtiles(){const e=[];for(let t=0;t<this.centroidData.length;t++){const i=this.centroidData[t],n=+(i.min.y+i.max.y>Rn),r=2*n+(+(i.min.x+i.max.x>Rn)^n);for(let n=0;n<i.polygonSegLen;n++){const s=i.polygonSegIdx+n;e.push({centroidIdx:t,subtile:r,polygonSegmentIdx:s,triangleSegmentIdx:this.polygonSegments[s].triangleSegIdx})}}const t=new _l;e.sort((e,t)=>e.triangleSegmentIdx===t.triangleSegmentIdx?e.subtile-t.subtile:e.triangleSegmentIdx-t.triangleSegmentIdx);let i=0,n=0,r=0;for(const t of e){if(t.triangleSegmentIdx!==i)break;r++}const s=e.length;for(;n!==e.length;){i=e[n].triangleSegmentIdx;let o=0,a=n,l=n;for(let t=a;t<r&&e[t].subtile===o;t++)l++;for(;a!==r;){const n=e[a];o=n.subtile;const s=this.centroidData[n.centroidIdx].min.clone(),c=this.centroidData[n.centroidIdx].max.clone(),h={vertexOffset:this.segments.segments[i].vertexOffset,primitiveOffset:t.length,vertexLength:this.segments.segments[i].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let i=a;i<l;i++){const n=e[i],r=this.polygonSegments[n.polygonSegmentIdx],o=this.centroidData[n.centroidIdx].min,a=this.centroidData[n.centroidIdx].max,l=this.indexArray.uint16;for(let e=r.triangleArrayOffset;e<r.triangleArrayOffset+r.triangleCount;e++)t.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);h.primitiveLength+=r.triangleCount,s.x=Math.min(s.x,o.x),s.y=Math.min(s.y,o.y),c.x=Math.max(c.x,a.x),c.y=Math.max(c.y,a.y)}h.primitiveLength>0&&this.triangleSubSegments.push({segment:h,min:s,max:c}),a=l;for(let t=a;t<r&&e[t].subtile===e[a].subtile;t++)l++}n=r;for(let t=n;t<s&&e[t].triangleSegmentIdx===e[n].triangleSegmentIdx;t++)r++}t._trim(),this.indexArray=t}getVisibleSegments(e,t,i){const n=new Xl;if(this.wallMode){for(const e of this.triangleSubSegments)n.segments.push(e.segment);return n}let r=0,s=0;const o=1<<e.canonical.z;if(t){const i=t.getMinMaxForTile(e);i&&(r=i.min,s=i.max)}s+=this.maxHeight;const a=e.toUnwrapped();let l;const c=[a.canonical.x/o+a.wrap,a.canonical.y/o],h=[(a.canonical.x+1)/o+a.wrap,(a.canonical.y+1)/o],d=(e,t,i)=>[e[0]*(1-i[0])+t[0]*i[0],e[1]*(1-i[1])+t[1]*i[1]],u=[],f=[];for(const e of this.triangleSubSegments){u[0]=e.min.x/Rn,u[1]=e.min.y/Rn,f[0]=e.max.x/Rn,f[1]=e.max.y/Rn;const t=d(c,h,u),o=d(c,h,f);if(0===new Dh([t[0],t[1],r],[o[0],o[1],s]).intersectsPrecise(i)){l&&(n.segments.push(l),l=void 0);continue}const a=e.segment;l&&l.vertexOffset!==a.vertexOffset&&(n.segments.push(l),l=void 0),l?(l.vertexLength+=a.vertexLength,l.primitiveLength+=a.primitiveLength):l={vertexOffset:a.vertexOffset,primitiveLength:a.primitiveLength,vertexLength:a.vertexLength,primitiveOffset:a.primitiveOffset,sortKey:void 0,vaos:{}}}return l&&n.segments.push(l),n}encodeCentroid(e,t){const i=e.centroid(),n=t.span(),r=Math.min(7,Math.round(n.x*this.tileToMeter/10)),s=Math.min(7,Math.round(n.y*this.tileToMeter/10));return new xe(Le(i.x,1,8191)<<3|r,Le(i.y,1,8191)<<3|s)}encodeBorderCentroid(e){if(!e.borders)return new xe(0,0);const t=e.borders,i=Number.MAX_VALUE;if(t[0][0]!==i||t[1][0]!==i){const e=t[0][0]!==i?0:1;return new xe(6|(t[0][0]!==i?0:65528),(t[e][0]+t[e][1])/2<<3|6)}{const e=t[2][0]!==i?2:3;return new xe((t[e][0]+t[e][1])/2<<3|6,6|(t[2][0]!==i?0:65528))}}showCentroid(e){const t=this.centroidData[e.centroidDataIndex];t.flags&=2147483647,t.centroidXY.x=0,t.centroidXY.y=0,this.writeCentroidToBuffer(t)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const t=e.vertexArrayOffset,i=e.vertexCount+e.vertexArrayOffset,n=e.flags&Rf?Pf:e.centroidXY,r=this.centroidVertexArray.geta_centroid_pos0(t);if(this.centroidVertexArray.geta_centroid_pos1(t)!==n.y||r!==n.x){for(let e=t;e<i;++e)this.centroidVertexArray.emplace(e,n.x,n.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.centroidData)this.writeCentroidToBuffer(e)}updateReplacement(e,t,i){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const n=t.getReplacementRegionsForTile(e.toUnwrapped());if(vf(this.activeReplacements,n))return;if(this.activeReplacements=n,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(const e of this.centroidData)e.flags&=2147483647;const r=[];for(const t of this.activeReplacements){if(t.order<i)continue;const n=Math.max(1,Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z));if(t.footprint.buildingId){const e=t.footprint.buildingId;for(const t of this.centroidData)t.buildingId===e&&(t.flags|=Rf)}else for(const i of this.centroidData)if(!(i.flags&Rf||t.min.x>i.max.x||i.min.x>t.max.x||t.min.y>i.max.y||i.min.y>t.max.y))for(let s=0;s<i.footprintSegLen;s++){const o=this.footprintSegments[i.footprintSegIdx+s];if(r.length=0,ip(this.footprintVertices,o.vertexOffset,o.vertexCount,t.footprintTileId.canonical,e.canonical,r),wf(t.footprint,r,this.footprintIndices.uint16,o.indexOffset,o.indexCount,-o.vertexOffset,-n)){i.flags|=Rf;break}}}for(const e of this.centroidData)this.writeCentroidToBuffer(e);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(e,t,i){let n=!1;for(let r=0;r<i.footprintSegLen;r++){const s=this.footprintSegments[i.footprintSegIdx+r];let o=0;for(const i of s.ringIndices){for(let r=o,a=i+o-1;r<i+o;a=r++){const i=this.footprintVertices.int16[2*(r+s.vertexOffset)+0],o=this.footprintVertices.int16[2*(r+s.vertexOffset)+1],l=this.footprintVertices.int16[2*(a+s.vertexOffset)+1];o>t!=l>t&&e<(this.footprintVertices.int16[2*(a+s.vertexOffset)+0]-i)*(t-o)/(l-o)+i&&(n=!n)}o=i}}return n}getHeightAtTileCoord(e,t){let i=Number.NEGATIVE_INFINITY,n=!0;const r=4*(e+Rn)*Rn+(t+Rn);if(this.partLookup.hasOwnProperty(r)){const e=this.partLookup[r];return e?{height:e.height,hidden:!!(e.flags&Rf)}:void 0}for(const s of this.centroidData)e>s.max.x||s.min.x>e||t>s.max.y||s.min.y>t||s.height<=i||this.footprintContainsPoint(e,t,s)&&(i=s.height,this.partLookup[r]=s,n=!!(s.flags&Rf));if(i!==Number.NEGATIVE_INFINITY)return{height:i,hidden:n};this.partLookup[r]=void 0}}function Gf(e,t){const i=e.add(t)._unit();return e.x*i.x+e.y*i.y}function Xf(e,t,i,n){const r=t.sub(e)._perp()._unit(),s=i.sub(t)._perp()._unit();return qf(e,t,i,Gf(r,s),n)}function qf(e,t,i,n,r){const s=Math.sqrt(1-n*n);return Math.min(e.dist(t)/3,t.dist(i)/3,r*s/n)}function Zf(e,t,i){return e.x<i[0].x&&t.x<i[0].x||e.x>i[1].x&&t.x>i[1].x||e.y<i[0].y&&t.y<i[0].y||e.y>i[1].y&&t.y>i[1].y}function Jf(e,t){return e.x<t[0].x||e.x>t[1].x||e.y<t[0].y||e.y>t[1].y}function Kf(e,t,i){if(e.x<0||e.x>=Rn||t.x<0||t.x>=Rn||i.x<0||i.x>=Rn)return!1;const n=i.sub(t),r=n.perp(),s=e.sub(t);return(n.x*s.x+n.y*s.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(s.x*s.x+s.y*s.y))>-.866&&r.x*s.x+r.y*s.y<0}function Qf(e,t,i){const n=t?2|e:-3&e;return i?1|n:-2&n}function ep(){const e=Math.PI/32,t=Math.tan(e),i=Oc;return i*Math.sqrt(1+2*t*t)-i}function tp(e,t,i){const n=1<<i.z,r=Vc(i.x/n),s=Vc((i.x+1)/n),o=Wc(i.y/n),a=Wc((i.y+1)/n);return function(e,t,i,n,r=0,s){const o=[];if(!e.length||!i||!n)return o;const a=(e,t)=>{for(const i of e)o.push({polygon:i,bounds:t})},l=Math.ceil(Math.log2(i)),c=Math.ceil(Math.log2(n)),h=l-c,d=[];for(let e=0;e<Math.abs(h);e++)d.push(h>0?0:1);for(let e=0;e<Math.min(l,c);e++)d.push(0),d.push(1);let u=e;if(u=Uu(u,t[0].y-r,t[1].y+r,1),u=Uu(u,t[0].x-r,t[1].x+r,0),!u.length)return o;const f=[];for(d.length?f.push({polygons:u,bounds:t,depth:0}):a(u,t);f.length;){const e=f.pop(),t=e.depth,i=d[t],n=e.bounds[0],o=e.bounds[1],l=0===i?n.x:n.y,c=0===i?o.x:o.y,h=s?s(i,l,c):.5*(l+c),u=Uu(e.polygons,l-r,h+r,i),p=Uu(e.polygons,h-r,c+r,i);if(u.length){const e=[n,new xe(0===i?h:o.x,1===i?h:o.y)];d.length>t+1?f.push({polygons:u,bounds:e,depth:t+1}):a(u,e)}if(p.length){const e=[new xe(0===i?h:n.x,1===i?h:n.y),o];d.length>t+1?f.push({polygons:p,bounds:e,depth:t+1}):a(p,e)}}return o}(e,t,Math.ceil((s-r)/11.25),Math.ceil((o-a)/11.25),1,(e,t,r)=>{if(0===e)return.5*(t+r);{const e=Wc((i.y+t/Rn)/n);return(Hc(.5*(Wc((i.y+r/Rn)/n)+e))*n-i.y)*Rn}})}function ip(e,t,i,n,r,s){const o=Math.pow(2,n.z-r.z);for(let a=0;a<i;a++){let i=e.int16[2*(a+t)+0],l=e.int16[2*(a+t)+1];i=(i+r.x*Rn)*o-n.x*Rn,l=(l+r.y*Rn)*o-n.y*Rn,s.push(new xe(i,l))}}let np,rp;Ws($f,"FillExtrusionBucket",{omit:["layers","features"]}),Ws(Bf,"PartData"),Ws(Yf,"FootprintSegment"),Ws(Hf,"BorderCentroidData"),Ws(Uf,"GroundEffect");class sp extends xe{constructor(e,t,i){super(e,t),this.z=i}}class op extends sp{constructor(e,t,i,n){super(e,t,i),this.w=n}}function ap(e,t,i,n){const r="x"===i?"y":"x",s=(n-e[i])/(t[i]-e[i]);e[r]=Math.round(e[r]+(t[r]-e[r])*s),e[i]=n,e.hasOwnProperty("z")&&(e.z=ci(e.z,t.z,s)),e.hasOwnProperty("w")&&(e.w=ci(e.w,t.w,s))}function lp(e,t,i,n){const r=i,s=n;for(const i of["x","y"]){let n=e,o=t;n[i]>=o[i]&&(n=t,o=e),n[i]<r&&o[i]>r&&ap(n,o,i,r),n[i]<s&&o[i]>s&&ap(o,n,i,s)}}function cp(e,t,i,n,r,s){const o=[];for(let a=0;a<e.length;a++){const l=e[a];let c;const h=o.length;let d=0;for(let e=0;e<l.length-1;e++){let h=l[e],u=l[e+1],f=0;const p=d;let m,g;s&&(f=Math.hypot(u.x-h.x,u.y-h.y),d+=f,m=h,g=u),h.x<t&&u.x<t||(h.x<t?h=new xe(t,h.y+(t-h.x)/(u.x-h.x)*(u.y-h.y))._round():u.x<t&&(u=new xe(t,h.y+(t-h.x)/(u.x-h.x)*(u.y-h.y))._round()),h.y<i&&u.y<i||(h.y<i?h=new xe(h.x+(i-h.y)/(u.y-h.y)*(u.x-h.x),i)._round():u.y<i&&(u=new xe(h.x+(i-h.y)/(u.y-h.y)*(u.x-h.x),i)._round()),h.x>=n&&u.x>=n||(h.x>=n?h=new xe(n,h.y+(n-h.x)/(u.x-h.x)*(u.y-h.y))._round():u.x>=n&&(u=new xe(n,h.y+(n-h.x)/(u.x-h.x)*(u.y-h.y))._round()),h.y>=r&&u.y>=r||(h.y>=r?h=new xe(h.x+(r-h.y)/(u.y-h.y)*(u.x-h.x),r)._round():u.y>=r&&(u=new xe(h.x+(r-h.y)/(u.y-h.y)*(u.x-h.x),r)._round()),c&&h.equals(c[c.length-1])||(c=[h],o.push(c),s&&s.push({progress:{min:p+dp(m,g,h)*f,max:1},parentIndex:a,prevPoint:m,nextPoint:g})),c.push(u),s&&(s[s.length-1].progress.max=p+dp(m,g,u)*f,s[s.length-1].nextPoint=g)))))}if(s&&d>0)for(let e=h;e<o.length;e++)s[e].progress.min/=d,s[e].progress.max/=d}return o}function hp(e,t,i,n,r){if(e.length<2)return void n.push(e);const s=[];for(;t.valid();){const[i,n]=t.get();for(let t=0;t<e.length-1;t++){const r=e[t],o=e[t+1],a=jh(r,o,i,n);if(a){const[e]=a,i=new xe(ci(r.x,o.x,e),ci(r.y,o.y,e));s.push({t:t+e,distance:0,point:i})}}t.next()}if(0===s.length)return void n.push(e);s.sort((e,t)=>e.t-t.t);let o=0,a=0,l=[];for(n.push(l);o!==e.length;){if(a===s.length){for(;o!==e.length;)0!==l.length&&l[l.length-1].equals(e[o])||l.push(e[o]),o++;break}s[a].t<=o?(0!==l.length&&l[l.length-1].equals(s[a].point)||l.push(s[a].point),Math.trunc(s[a].t),a++):(0!==l.length&&l[l.length-1].equals(e[o])||l.push(e[o]),o++)}}function dp(e,t,i){return e.x!==t.x?(i.x-e.x)/(t.x-e.x):e.y!==t.y?(i.y-e.y)/(t.y-e.y):0}function up(e,t){return e.x*t.x+e.y*t.y}function fp(e,t){if(1===e.length){let i=0;const n=t[i++];let r;for(;!r||n.equals(r);)if(r=t[i++],!r)return 1/0;for(;i<t.length;i++){const s=t[i],o=e[0],a=r.sub(n),l=s.sub(n),c=o.sub(n),h=up(a,a),d=up(a,l),u=up(l,l),f=up(c,a),p=up(c,l),m=h*u-d*d,g=(u*f-d*p)/m,_=(h*p-d*f)/m,y=n.z*(1-g-_)+r.z*g+s.z*_;if(isFinite(y))return y}return 1/0}{let e=1/0;for(const i of t)e=Math.min(e,i.z);return e}}function pp(e,t,i,n,r,s,o,a){const l=o*r.getElevationAt(e,t,!0,!0),c=0!==s[0],h=c?0===s[1]?o*(s[0]/7-450):o*function(e,t,i){const n=Math.floor(t[0]/8),r=Math.floor(t[1]/8),s=10*(t[0]-8*n),o=10*(t[1]-8*r),a=e.getElevationAt(n,r,!0,!0),l=e.getMeterToDEM(i),c=Math.floor(.5*(s*l-1)),h=Math.floor(.5*(o*l-1)),d=e.tileCoordToPixel(n,r),u=2*c+1,f=2*h+1,p=function(e,t,i,n,r){return[e.getElevationAtPixel(t,i,!0),e.getElevationAtPixel(t+r,i,!0),e.getElevationAtPixel(t,i+r,!0),e.getElevationAtPixel(t+n,i+r,!0)]}(e,d.x-c,d.y-h,u,f),m=Math.abs(p[0]-p[1]),g=Math.abs(p[2]-p[3]),_=Math.abs(p[0]-p[2])+Math.abs(p[1]-p[3]),y=Math.min(.25,.5*l*(m+g)/u),v=Math.min(.25,.5*l*_/f);return a+Math.max(y*s,v*o)}(r,s,a):l;return{base:l+(0===i?-1:i),top:c?Math.max(h+n,l+i+2):l+n}}class mp{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class gp{constructor(){this.tasks={},this.taskQueue=[],Ne(["process"],this),this.invoker=new mp(this.process),this.nextId=0}add(e,t){const i=this.nextId++,n=function({type:e,isSymbolTile:t,zoom:i}){return i=i||0,"message"===e?0:"maybePrepare"!==e||t?"parseTile"!==e||t?"parseTile"===e&&t?300-i:"maybePrepare"===e&&t?400-i:500:200-i:100-i}(t);if(0===n){try{e()}finally{}return null}return this.tasks[i]={fn:e,metadata:t,priority:n,id:i},this.taskQueue.push(i),this.invoker.trigger(),{cancel:()=>{delete this.tasks[i]}}}process(){try{if(this.taskQueue=this.taskQueue.filter(e=>!!this.tasks[e]),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!t)return;t.fn()}finally{}}pick(){let e=null,t=1/0;for(let i=0;i<this.taskQueue.length;i++){const n=this.tasks[this.taskQueue[i]];n.priority<t&&(t=n.priority,e=i)}if(null===e)return null;const i=this.taskQueue[e];return this.taskQueue.splice(e,1),i}remove(){this.invoker.remove()}}class _p{constructor(e,t,i){this.target=e,this.parent=t,this.mapId=i,this.callbacks={},this.cancelCallbacks={},Ne(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler=new gp}send(e,t,i,n,r=!1,s){const o=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=s,this.callbacks[o]=i);const a=new Set;return this.target.postMessage({id:o,type:e,hasCallback:!!i,targetMapId:n,mustQueue:r,sourceMapId:this.mapId,data:Gs(t,a)},a),{cancel:()=>{i&&delete this.callbacks[o],this.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId})}}}receive(e){const t=e.data;if(!t)return;const i=t.id;if(i&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){const e=this.cancelCallbacks[i];delete this.cancelCallbacks[i],e&&e.cancel()}else if(t.mustQueue||Xe(self)){const e=this.callbacks[i],n=this.scheduler.add(()=>this.processTask(i,t),e&&e.metadata||{type:"message"});n&&(this.cancelCallbacks[i]=n)}else this.processTask(i,t)}processTask(e,t){if(delete this.cancelCallbacks[e],"<response>"===t.type){const i=this.callbacks[e];delete this.callbacks[e],i&&(t.error?i(Xs(t.error)):i(null,Xs(t.data)))}else{const i=new Set,n=t.hasCallback?(t,n)=>{this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?Gs(t):null,data:Gs(n,i)},i)}:()=>{},r=Xs(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,r,n);else if(this.parent.getWorkerSource){const e=t.type.split("."),{source:i,scope:s}=r;this.parent.getWorkerSource(t.sourceMapId,e[0],i,s)[e[1]](r,n)}else n(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}var yp={workerUrl:"",workerClass:null,workerParams:void 0};const vp="mapboxgl_preloaded_worker_pool";class xp{constructor(){this.active={}}acquire(e,t=xp.workerCount){if(!this.workers)for(this.workers=[];this.workers.length<t;)this.workers.push(null!=yp.workerClass?new yp.workerClass:new self.Worker(yp.workerUrl,yp.workerParams));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.workers&&0===this.numActive()&&(this.workers.forEach(e=>{e.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[vp]}numActive(){return Object.keys(this.active).length}}xp.workerCount=2;class bp{constructor(e,t,i="Worker",n=xp.workerCount){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=ze();const r=this.workerPool.acquire(this.id,n);for(let e=0;e<r.length;e++){const n=new bp.Actor(r[e],t,this.id);n.name=`${i} ${e}`,this.actors.push(n)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(e,t,i){Pe(this.actors,(i,n)=>{i.send(e,t,n)},i=i||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(e=>{e.remove()}),this.actors=[],this.workerPool.release(this.id)}}let wp,Sp;function Tp(){return wp||(wp=new xp),wp}bp.Actor=_p;class kp{constructor(e){this.module=e}createIntArray(e){const t=new Int32Array(e),i=this.module.malloc(t.length*t.BYTES_PER_ELEMENT);return this.module.heap32.set(t,i/t.BYTES_PER_ELEMENT),i}createFloatArray(e){const t=new Float32Array(e),i=this.module.malloc(t.length*t.BYTES_PER_ELEMENT);return this.module.heapF32.set(t,i/t.BYTES_PER_ELEMENT),i}createStringBuffer(e){const t=this.module.malloc(e.length+1);for(let i=0;i<e.length;++i)this.module.heapU8[t+i]=e.charCodeAt(i);return this.module.heapU8[t+e.length]=0,t}readStringBuffer(e){let t="";for(;0!==this.module.heapU8[e];)t+=String.fromCharCode(this.module.heapU8[e]),++e;return t}setStyle(e){const t=e.entranceColorRgb,i=e.facadeGlazingColorRgb,n=e.roofColorRgb,r=e.wallColorRgb,s=e.normalScale;this.module.setStyle(t[0],t[1],t[2],i[0],i[1],i[2],n[0],n[1],n[2],r[0],r[1],r[2],s[0],s[1],s[2],e.tileToMeters)}setAOOptions(e,t){this.module.setAOOptions(e?1:0,t)}setMetricOptions(e,t){this.module.setMetricOptions(e?1:0,t)}setStructuralOptions(e){this.module.setStructuralOptions(e?1:0)}setFacadeOptions(e,t){this.module.setFacadeOptions(e,t?1:0)}setFauxFacadeOptions(e,t,i){this.module.setFauxFacadeOptions(e?1:0,t?1:0,i)}setFacadeClassifierOptions(e){this.module.setFacadeClassifierOptions(e)}generateMesh(e,t){for(const t of e){const e=this.createStringBuffer(t.roofType),i=[0],n=[];for(const e of t.coordinates)if(Array.isArray(e)){for(const t of e)n.push(t.x),n.push(t.y);i.push(n.length)}const r=this.createIntArray(i),s=this.createFloatArray(n);this.module.addFeature(t.id,t.sourceId,t.minHeight,t.height,e,t.roofType.length,s,r,i.length-1),this.module.free(e),this.module.free(r),this.module.free(s)}for(const e of t){let t;t=e.entrances?JSON.parse(e.entrances):[];const i=this.createFloatArray(t),n=[];for(const t of e.coordinates)n.push(t.x),n.push(t.y);const r=this.createFloatArray(n);this.module.addFacade(e.sourceId,e.crossPerc,e.distanceToRoad,i,t.length,r,n.length),this.module.free(i),this.module.free(r)}if(!this.module.generateMesh()){const e=this.module.getLastError();return this.readStringBuffer(e)}const i=this.module.getMeshCount(),n=new Array(i);for(let e=0;e<i;e++){const t=this.module.getPositionsPtr(e),i=this.module.getPositionsLength(e),r=new Float32Array(this.module.heapF32.buffer,t,i),s=this.module.getNormalsPtr(e),o=this.module.getNormalsLength(e),a=new Float32Array(this.module.heapF32.buffer,s,o),l=this.module.getColorsPtr(e),c=this.module.getColorsLength(e),h=new Uint8Array(this.module.heapU8.buffer,l,c),d=this.module.getAOPtr(e),u=this.module.getAOLength(e),f=new Float32Array(this.module.heapF32.buffer,d,u),p=this.module.getUVPtr(e),m=this.module.getUVLength(e),g=new Float32Array(this.module.heapF32.buffer,p,m),_=this.module.getFauxFacadePtr(e),y=this.module.getFauxFacadeLength(e),v=new Uint8Array(this.module.heapU8.buffer,_,y),x=this.module.getIndicesPtr(e),b=this.module.getIndicesLength(e),w=new Int32Array(this.module.heap32.buffer,x,b),S=this.module.getBuildingPart(e),T=this.readStringBuffer(S);n[e]={positions:r,normals:a,colors:h,ao:f,uv:g,isFauxFacade:v,indices:w,buildingPart:T}}const r=this.module.getRingCount(),s=[];for(let e=0;e<r;e++){const t=this.module.getRingPtr(e),i=this.module.getRingLength(e),n=new Float32Array(this.module.heapF32.buffer,t,i);s.push(n)}return{meshes:n,modifiedPolygonRings:s}}}let Mp,Ap,Cp,Dp,Lp,Ep=null,Ip=null,Pp=null,Rp=null;function Op(){return Xe(self)&&self.worker.dracoUrl?self.worker.dracoUrl:Ap||nt.DRACO_URL}function zp(){if(Xe(self)&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(Dp)return Dp;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return Dp=WebAssembly.validate(e)?nt.MESHOPT_SIMD_URL:nt.MESHOPT_URL,Dp}const Fp={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Np={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},Yp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function Bp(e,t,i){const n=i.json.bufferViews.length,r=i.buffers.length;t.bufferView=n,i.json.bufferViews[n]={buffer:r,byteLength:e.byteLength},i.buffers[r]=e}const Hp="KHR_draco_mesh_compression";function jp(e,t){const i=e.extensions&&e.extensions[Hp];if(!i)return;const n=new Cp.Decoder,r=qp(t,i.bufferView),s=new Cp.Mesh;if(!n.DecodeArrayToMesh(r,r.byteLength,s))throw new Error("Failed to decode Draco mesh");const o=t.json.accessors[e.indices],a=Fp[o.componentType],l=o.count*a.BYTES_PER_ELEMENT,c=Cp._malloc(l);a===Uint16Array?n.GetTrianglesUInt16Array(s,l,c):n.GetTrianglesUInt32Array(s,l,c),Bp(Cp.memory.buffer.slice(c,c+l),o,t),Cp._free(c);for(const r of Object.keys(i.attributes)){const o=n.GetAttributeByUniqueId(s,i.attributes[r]),a=t.json.accessors[e.attributes[r]],l=Np[a.componentType],c=a.count*Yp[a.type]*Fp[a.componentType].BYTES_PER_ELEMENT,h=Cp._malloc(c);n.GetAttributeDataArrayForAllPoints(s,o,Cp[l],c,h),Bp(Cp.memory.buffer.slice(h,h+c),a,t),Cp._free(h)}n.destroy(),s.destroy(),delete e.extensions[Hp]}const Vp="EXT_meshopt_compression";function Wp(e,t){if(!e.extensions||!e.extensions[Vp])return;const i=e.extensions[Vp],n=new Uint8Array(t.buffers[i.buffer],i.byteOffset||0,i.byteLength||0),r=new Uint8Array(i.count*i.byteStride);Lp.decodeGltfBuffer(r,i.count,i.byteStride,n,i.mode,i.filter),e.buffer=t.buffers.length,e.byteOffset=0,t.buffers[e.buffer]=r.buffer,delete e.extensions[Vp]}const Up=1179937895,$p=new TextDecoder("utf8");function Gp(e,t){return new URL(e,t).href}function Xp(e,t,i,n){return fetch(Gp(e.uri,n)).then(e=>e.arrayBuffer()).then(e=>{t.buffers[i]=e})}function qp(e,t){const i=e.json.bufferViews[t];return new Uint8Array(e.buffers[i.buffer],i.byteOffset||0,i.byteLength)}function Zp(e,t,i,n){if(e.uri){const r=Gp(e.uri,n);return fetch(r).then(e=>e.blob()).then(e=>createImageBitmap(e)).then(e=>{t.images[i]=e})}if(void 0!==e.bufferView){const n=qp(t,e.bufferView),r=new Blob([n],{type:e.mimeType});return createImageBitmap(r).then(e=>{t.images[i]=e})}}function Jp(e,t=0,i){const n={json:null,images:[],buffers:[]};if(new Uint32Array(e,t,1)[0]===Up){const i=new Uint32Array(e,t);let r=2;const s=(i[r++]>>2)-3,o=i[r++]>>2;if(r++,n.json=JSON.parse($p.decode(i.subarray(r,r+o))),r+=o,r<s){const s=i[r++];r++;const o=t+(r<<2);n.buffers[0]=e.slice(o,o+s)}}else n.json=JSON.parse($p.decode(new Uint8Array(e,t)));const{buffers:r,images:s,meshes:o,extensionsUsed:a,bufferViews:l}=n.json;let c=Promise.resolve();if(r){const e=[];for(let t=0;t<r.length;t++){const s=r[t];s.uri?e.push(Xp(s,n,t,i)):n.buffers[t]||(n.buffers[t]=null)}c=Promise.all(e)}return c.then(()=>{const e=[],t=a&&a.includes(Hp),r=a&&a.includes(Vp);if(t&&e.push(function(){if(!Cp)return null!=Mp?Mp:(Mp=function(e){let t,i=null;function n(){t=new Uint8Array(i.buffer)}function r(){throw new Error("Unexpected Draco error.")}const s={a:{a:r,d:function(e,i,n){return t.copyWithin(e,i,i+n)},c:function(e){const r=t.length,s=Math.max(e>>>0,Math.ceil(1.2*r)),o=Math.ceil((s-r)/65536);try{return i.grow(o),n(),!0}catch(e){return!1}},b:r}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,s):e.then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,s))).then(e=>{const{Rb:r,Qb:s,P:o,T:a,X:l,Ja:c,La:h,Qa:d,Va:u,Wa:f,eb:p,jb:m,f:g,e:_,yb:y,zb:v,Ab:x,Bb:b,Db:w,Gb:S}=e.instance.exports;i=_;const T=(()=>{let e=0,i=0,n=0,o=0;return a=>{n&&(r(o),r(e),i+=n,n=e=0),e||(i+=128,e=s(i));const l=a.length+7&-8;let c=e;l>=i&&(n=l,c=o=s(l));for(let e=0;e<a.length;e++)t[c+e]=a[e];return c}})();return n(),g(),{memory:_,_free:r,_malloc:s,Mesh:class{constructor(){this.ptr=o()}destroy(){a(this.ptr)}},Decoder:class{constructor(){this.ptr=c()}destroy(){m(this.ptr)}DecodeArrayToMesh(e,t,i){const n=T(e),r=h(this.ptr,n,t,i.ptr);return!!l(r)}GetAttributeByUniqueId(e,t){return{ptr:d(this.ptr,e.ptr,t)}}GetTrianglesUInt16Array(e,t,i){u(this.ptr,e.ptr,t,i)}GetTrianglesUInt32Array(e,t,i){f(this.ptr,e.ptr,t,i)}GetAttributeDataArrayForAllPoints(e,t,i,n,r){p(this.ptr,e.ptr,t.ptr,i,n,r)}},DT_INT8:y(),DT_UINT8:v(),DT_INT16:x(),DT_UINT16:b(),DT_UINT32:w(),DT_FLOAT32:S()}})}(fetch(Op())),Mp.then(e=>{Cp=e,Mp=void 0}))}()),r&&e.push(function(){if(Lp)return;const e=function(e){let t;const i=WebAssembly.instantiateStreaming(e,{}).then(e=>{t=e.instance,t.exports.__wasm_call_ctors()}),n={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},r={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:i,supported:!0,decodeGltfBuffer(e,i,s,o,a,l){!function(e,t,i,n,r,s,o){const a=e.exports.sbrk,l=n+3&-4,c=a(l*r),h=a(s.length),d=new Uint8Array(e.exports.memory.buffer);d.set(s,h);const u=t(c,n,r,h,s.length);if(0===u&&o&&o(c,l,r),i.set(d.subarray(c,c+n*r)),a(c-a(0)),0!==u)throw new Error(`Malformed buffer data: ${u}`)}(t,t.exports[r[a]],e,i,s,o,t.exports[n[l]])}}}(fetch(zp()));return e.ready.then(()=>{Lp=e})}()),s)for(let t=0;t<s.length;t++)e.push(Zp(s[t],n,t,i));return(e.length?Promise.all(e):Promise.resolve()).then(()=>{if(t&&o)for(const{primitives:e}of o)for(const t of e)jp(t,n);if(r&&o&&l)for(const e of l)Wp(e,n);return n})})}function Kp(e){switch(e){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.RGBA;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.DEPTH_COMPONENT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.DEPTH_STENCIL;case WebGL2RenderingContext.R8:case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.RED}}function Qp(e){switch(e){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.UNSIGNED_SHORT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.UNSIGNED_INT_24_8;case WebGL2RenderingContext.R8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.FLOAT}}class em{constructor(e,t,i,n){this.context=e,this.format=i,this.useMipmap=n&&n.useMipmap,this.texture=e.gl.createTexture(),this.update(t,{premultiply:n&&n.premultiply})}update(e,t){const i=e&&e instanceof HTMLVideoElement&&0===e.width?e.videoWidth:e.width,n=e&&e instanceof HTMLVideoElement&&0===e.height?e.videoHeight:e.height,{context:r}=this,{gl:s}=r,{x:o,y:a}=t&&t.position?t.position:{x:0,y:0},l=o+i,c=a+n;!this.size||this.size[0]===l&&this.size[1]===c||(s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(this.texture),this.texture=s.createTexture(),this.size=null),s.bindTexture(s.TEXTURE_2D,this.texture),r.pixelStoreUnpackFlipY.set(!1),r.pixelStoreUnpack.set(1),r.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA8&&(!t||!1!==t.premultiply));const h=e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap;if(!this.size&&l>0&&c>0){const e=this.useMipmap?Math.floor(Math.log2(Math.max(l,c)))+1:1;s.texStorage2D(s.TEXTURE_2D,e,this.format,l,c),this.size=[l,c]}if(this.size)if(h)s.texSubImage2D(s.TEXTURE_2D,0,o,a,Kp(this.format),Qp(this.format),e);else{const t=e.data;t&&s.texSubImage2D(s.TEXTURE_2D,0,o,a,i,n,Kp(this.format),Qp(this.format),t)}this.useMipmap&&s.generateMipmap(s.TEXTURE_2D)}bind(e,t,i=!1){const{context:n}=this,{gl:r}=n;r.bindTexture(r.TEXTURE_2D,this.texture),e!==this.minFilter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.useMipmap&&!i?e===r.NEAREST?r.NEAREST_MIPMAP_NEAREST:r.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),t!==this.wrapS&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,t),this.wrapS=t)}bindExtraParam(e,t,i,n,r){const{context:s}=this,{gl:o}=s;o.bindTexture(o.TEXTURE_2D,this.texture),t!==this.magFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,t),this.magFilter=t),e!==this.minFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,this.useMipmap?e===o.NEAREST?o.NEAREST_MIPMAP_NEAREST:o.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),i!==this.wrapS&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,i),this.wrapS=i),n!==this.wrapT&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,n),this.wrapT=n),r!==this.compareMode&&(r?(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_MODE,o.COMPARE_REF_TO_TEXTURE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_FUNC,r)):o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_MODE,o.NONE),this.compareMode=r)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class tm{constructor(e,t){this.context=e,this.texture=t}bind(e,t){const{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_2D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrapS=t)}}const im=Xa([{name:"a_pos_3f",components:3,type:"Float32"}]),nm=Xa([{name:"a_color_3f",components:3,type:"Float32"}]),rm=Xa([{name:"a_color_4f",components:4,type:"Float32"}]),sm=Xa([{name:"a_uv_2f",components:2,type:"Float32"}]),om=Xa([{name:"a_normal_3f",components:3,type:"Float32"}]),am=Xa([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),lm=Xa([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]);function cm(e,t){const i=dm(e.projection,e.zoom,e.width,e.height),n=function(e,t,i,n,r){const s=new Fc(i.lng-180*um,i.lat),o=new Fc(i.lng+180*um,i.lat),a=e.project(s.lng,s.lat),c=e.project(o.lng,o.lat),d=-Math.atan2(c.y-a.y,c.x-a.x),f=Jc.fromLngLat(i);f.y=Le(f.y,-1+um,1-um);const p=f.toLngLat(),g=e.project(p.lng,p.lat),_=Jc.fromLngLat(p);_.x+=um;const y=_.toLngLat(),v=e.project(y.lng,y.lat),x=pm(v.x-g.x,v.y-g.y,d),b=Jc.fromLngLat(p);b.y+=um;const w=b.toLngLat(),S=e.project(w.lng,w.lat),T=pm(S.x-g.x,S.y-g.y,d),k=Math.abs(x.x)/Math.abs(T.y),M=l([]);m(M,M,-d*(1-(r?0:n)));const A=l([]);return u(A,A,[1,1-(1-k)*n,1]),A[4]=-T.x/T.y*n,m(A,A,d),h(A,M,A),A}(e.projection,0,e.center,i,t),r=hm(e);return u(n,n,[r,r,1]),n}function hm(e){const t=e.projection,i=dm(e.projection,e.zoom,e.width,e.height),n=fm(t,e.center),r=fm(t,Fc.convert(t.center));return Math.pow(2,n*i+(1-i)*r)}function dm(e,t,i,n,r=1/0){const s=e.range;if(!s)return 0;const o=Math.min(r,Math.max(i,n)),a=Math.log(o/1024)/Math.LN2;return Ee(s[0]+a,s[1]+a,t)}const um=1/4e4;function fm(e,t){const i=Le(t.lat,-$c,$c),n=new Fc(t.lng-180*um,i),r=new Fc(t.lng+180*um,i),s=e.project(n.lng,i),o=e.project(r.lng,i),a=Jc.fromLngLat(n),l=Jc.fromLngLat(r),c=o.x-s.x,h=o.y-s.y,d=l.x-a.x,u=l.y-a.y,f=Math.sqrt((d*d+u*u)/(c*c+h*h));return Math.log(f)/Math.LN2}function pm(e,t,i){const n=Math.cos(i),r=Math.sin(i);return{x:e*n-t*r,y:e*r+t*n}}function mm(e,t,i){l(e),m(e,e,Te(t[2])),f(e,e,Te(t[0])),p(e,e,Te(t[1])),u(e,e,i),h(e,e,[1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1])}function gm(e,t,i,n,r,s,o,a){const l=[i[0]-t[0],i[1]-t[1],0],c=[n[0]-t[0],n[1]-t[1],0];if(w(l)<1e-12||w(c)<1e-12)return K(e);const h=F([],l,c);O(h,h),M(c,n,t),l[2]=(s-r)*a,c[2]=(o-r)*a;const d=l;return F(d,l,c),O(d,d),se(e,h,d)}function _m(e,t,i=!1){const n=Id(t.zoom),r=function(e,t,i){const n=t.worldSize,r=[e[12],e[13],e[14]],s=Wc(r[1]/n),o=Vc(r[0]/n),a=l([]),c=jc(1,s)*n,f=jc(1,0)*n*Xc(s,t.zoom),p=1/Dd(n);let m=f*p;if(i){const e=dm(t.projection,t.zoom,t.width,t.height,1024);m=p*t.projection.pixelSpaceConversion(t.center.lat,n,e)}const g=Rc(s,o);k(g,g,L([],O([],g),c*m*r[2]));const _=function(e){const t=[e[0],e[1],e[2]];let i=[0,1,0];const n=F([],i,t);return F(i,t,n),0===P(i)&&(i=[0,1,0],F(n,t,i)),O(n,n),O(i,i),O(t,t),[n[0],n[1],n[2],0,i[0],i[1],i[2],0,t[0],t[1],t[2],0,e[0],e[1],e[2],1]}(g);u(a,a,[m,m,m*c]),d(a,a,[-r[0],-r[1],-r[2]]);const y=h([],t.globeMatrix,_);return h(y,y,a),h(y,y,e),y}(e,t,i);if(n>0){const i=function(e,t){const i=t.worldSize,n=jc(1,0)*i*Xc(t.center.lat,t.zoom)/Dd(i),r=jc(1,t.center.lat)*i,s=l([]);return p(s,s,Te(t.center.lng)),f(s,s,Te(t.center.lat)),d(s,s,[0,0,Cc]),u(s,s,[n,n,n*r]),d(s,s,[t.point.x-.5*i,t.point.y-.5*i,0]),h(s,s,e),h(s,t.globeMatrix,s)}(e,t);return function(e,t,i){const n=(e,t,i)=>{const n=w(e),r=w(t),s=vd(e,t,i);return L(s,s,1/w(s)*ci(n,r,i))},r=n([e[0],e[1],e[2]],[t[0],t[1],t[2]],i),s=n([e[4],e[5],e[6]],[t[4],t[5],t[6]],i),o=n([e[8],e[9],e[10]],[t[8],t[9],t[10]],i),a=vd([e[12],e[13],e[14]],[t[12],t[13],t[14]],i);return[r[0],r[1],r[2],0,s[0],s[1],s[2],0,o[0],o[1],o[2],0,a[0],a[1],a[2],1]}(r,i,n)}return r}function ym(e,t,i,n){const r=Dh.projectAabbCorners(n,i);let s=Number.MAX_VALUE,o=-1;for(let e=0;e<r.length;++e){const i=r[e];i[0]=(.5*i[0]+.5)*t.width,i[1]=(.5-.5*i[1])*t.height,i[2]<s&&(o=e,s=i[2])}const a=e=>new xe(r[e][0],r[e][1]);let l;switch(o){case 0:case 6:l=[a(1),a(5),a(4),a(7),a(3),a(2),a(1)];break;case 1:case 7:l=[a(0),a(4),a(5),a(6),a(2),a(3),a(0)];break;case 3:case 5:l=[a(1),a(0),a(4),a(7),a(6),a(2),a(1)];break;default:l=[a(1),a(5),a(6),a(7),a(3),a(0),a(1)]}if(Oh(e,l))return s}const vm=64,xm={CoordinateSpaceTile:1,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function bm(e,t,i,n,r,s,o,a,c,f=!1){const p=i.zoom,m=i.project(n),g=Xc(n.lat,p),_=1/g;l(e),d(e,e,[m.x+o[0]*_,m.y+o[1]*_,o[2]]);let v=1,x=1;const b=i.worldSize;if(f){if("mercator"===i.projection.name){let e=0;i.elevation&&(e=i.elevation.getAtPointOrZero(new Jc(m.x/b,m.y/b),0));const t=Z([],[m.x,m.y,e,1],i.projMatrix)[3]/i.cameraToCenterDistance;v=t,x=t*Xc(i.center.lat,p)}else if("globe"===i.projection.name){const t=_m(e,i),r=[0,0,0,1];Z(r,r,h([],i.projMatrix,t));const s=r[3]/i.cameraToCenterDistance,o=Id(p),a=i.projection.pixelsPerMeter(n.lat,b)*Xc(n.lat,p),l=i.projection.pixelsPerMeter(i.center.lat,b)*Xc(i.center.lat,p);v=s/ci(a,Gc(i.center.lat),o),x=s*g/a,v*=l,x*=l}}else v=_;u(e,e,[v,v,x]);const w=[...e],S=t.orientation,T=[];if(mm(T,[S[0]+r[0],S[1]+r[1],S[2]+r[2]],s),h(e,w,T),a&&i.elevation){let r=0;const s=[];if(c&&i.elevation){r=function(e,t,i,n,r){const s=t.elevation;if(!s)return 0;const o=Dh.projectAabbCorners(i,n),a=jc(1,r.lat)*t.worldSize,l=function(e,t){const i=[0,0,1],n=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const r of n){const n=e[r.corners[0]],s=e[r.corners[1]],o=e[r.corners[2]],a=[s[0]-n[0],s[1]-n[1],t*(s[2]-n[2])],l=F(a,a,[o[0]-n[0],o[1]-n[1],t*(o[2]-n[2])]);O(l,l),r.dotProductWithUp=z(l,i)}return n.sort((e,t)=>e.dotProductWithUp-t.dotProductWithUp),n[0].corners}(o,a),c=o[l[0]],h=o[l[1]],d=o[l[2]],u=o[l[3]],f=s.getAtPointOrZero(new Jc(c[0]/t.worldSize,c[1]/t.worldSize),0),p=s.getAtPointOrZero(new Jc(h[0]/t.worldSize,h[1]/t.worldSize),0),m=s.getAtPointOrZero(new Jc(d[0]/t.worldSize,d[1]/t.worldSize),0),g=s.getAtPointOrZero(new Jc(u[0]/t.worldSize,u[1]/t.worldSize),0),_=(f+g)/2,y=(p+m)/2;return _>y?p<m?gm(e,h,u,c,p,g,f,a):gm(e,d,c,u,m,f,g,a):f<g?gm(e,c,h,d,f,p,m,a):gm(e,u,d,h,g,m,p,a),Math.max(_,y)}(s,i,t.aabb,e,n);const o=h([],y([],s),T);h(e,w,o)}else r=i.elevation.getAtPointOrZero(new Jc(m.x/b,m.y/b),0);0!==r&&(e[14]+=r)}}function wm(e,t,i=!1){e.uploaded||(e.gfxTexture=new em(t,e.image,i?t.gl.R8:t.gl.RGBA8,{useMipmap:e.sampler.minFilter>=t.gl.NEAREST_MIPMAP_NEAREST}),e.uploaded=!0,e.image=null)}function Sm(e,t,i){e.indexBuffer=t.createIndexBuffer(e.indexArray,!1,!0),e.vertexBuffer=t.createVertexBuffer(e.vertexArray,im.members,!1,!0),e.normalArray&&(e.normalBuffer=t.createVertexBuffer(e.normalArray,om.members,!1,!0)),e.texcoordArray&&(e.texcoordBuffer=t.createVertexBuffer(e.texcoordArray,sm.members,!1,!0)),e.colorArray&&(e.colorBuffer=t.createVertexBuffer(e.colorArray,(12===e.colorArray.bytesPerElement?nm:rm).members,!1,!0)),e.featureArray&&(e.pbrBuffer=t.createVertexBuffer(e.featureArray,lm.members,!0)),e.segments=Xl.simpleSegment(0,0,e.vertexArray.length,e.indexArray.length);const n=e.material;n.pbrMetallicRoughness.baseColorTexture&&wm(n.pbrMetallicRoughness.baseColorTexture,t),n.pbrMetallicRoughness.metallicRoughnessTexture&&wm(n.pbrMetallicRoughness.metallicRoughnessTexture,t),n.normalTexture&&wm(n.normalTexture,t),n.occlusionTexture&&wm(n.occlusionTexture,t,i),n.emissionTexture&&wm(n.emissionTexture,t)}function Tm(e,t,i){if(e.meshes)for(const n of e.meshes)Sm(n,t,i);if(e.children)for(const n of e.children)Tm(n,t,i)}function km(e){if(e.meshes)for(const t of e.meshes)t.indexArray.destroy(),t.vertexArray.destroy(),t.colorArray&&t.colorArray.destroy(),t.normalArray&&t.normalArray.destroy(),t.texcoordArray&&t.texcoordArray.destroy(),t.featureArray&&t.featureArray.destroy();if(e.children)for(const t of e.children)km(t)}function Mm(e){if(e.meshes)for(const i of e.meshes)i.vertexBuffer&&(i.vertexBuffer.destroy(),i.indexBuffer.destroy(),i.normalBuffer&&i.normalBuffer.destroy(),i.texcoordBuffer&&i.texcoordBuffer.destroy(),i.colorBuffer&&i.colorBuffer.destroy(),i.pbrBuffer&&i.pbrBuffer.destroy(),i.segments.destroy(),i.material&&((t=i.material).pbrMetallicRoughness.baseColorTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),t.pbrMetallicRoughness.metallicRoughnessTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),t.normalTexture&&t.normalTexture.gfxTexture&&t.normalTexture.gfxTexture.destroy(),t.emissionTexture&&t.emissionTexture.gfxTexture&&t.emissionTexture.gfxTexture.destroy(),t.occlusionTexture&&t.occlusionTexture.gfxTexture&&t.occlusionTexture.gfxTexture.destroy()));var t;if(e.children)for(const t of e.children)Mm(t)}function Am(e,t){const i=e.json.bufferViews[t.bufferView],n=Fp[t.componentType];return new n(e.buffers[i.buffer],(t.byteOffset||0)+(i.byteOffset||0),t.count*(i.byteStride&&i.byteStride!==Yp[t.type]*n.BYTES_PER_ELEMENT?i.byteStride/n.BYTES_PER_ELEMENT:Yp[t.type]))}function Cm(e,t,i,n){const r=Fp[t.componentType],s=function(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(r),o=e.json.bufferViews[t.bufferView],a=o.byteStride?o.byteStride/r.BYTES_PER_ELEMENT:Yp[t.type],l=i.float32,c=l.length/i.capacity;for(let e=0,i=0;e<t.count*a;e+=a,i+=c)for(let t=0;t<c;t++)l[i+t]=n[e+t]*s;i._trim()}function Dm(e,t,i){const n=e.indices,r=e.attributes,s={};s.indexArray=new _l;const o=t.json.accessors[n],a=o.count/3;s.indexArray.reserve(a);const l=Am(t,o);for(let e=0;e<a;e++)s.indexArray.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);s.indexArray._trim(),s.vertexArray=new rl;const c=t.json.accessors[r.POSITION];s.vertexArray.reserve(c.count);const h=Am(t,c);for(let e=0;e<c.count;e++)s.vertexArray.emplaceBack(h[3*e],h[3*e+1],h[3*e+2]);if(s.vertexArray._trim(),s.aabb=new Dh(c.min,c.max),s.centroid=function(e,t){const i=[0,0,0],n=e.length;if(n>0){for(let r=0;r<n;r++){const n=3*e[r];i[0]+=t[n],i[1]+=t[n+1],i[2]+=t[n+2]}i[0]/=n,i[1]/=n,i[2]/=n}return i}(l,h),void 0!==r.COLOR_0){const e=t.json.accessors[r.COLOR_0],i=Yp[e.type],n=Am(t,e);s.colorArray=3===i?new rl:new hl,s.colorArray.resize(e.count),Cm(t,e,s.colorArray,n)}if(void 0!==r.NORMAL){s.normalArray=new rl;const e=t.json.accessors[r.NORMAL];s.normalArray.resize(e.count);const i=Am(t,e);Cm(t,e,s.normalArray,i)}if(void 0!==r.TEXCOORD_0&&i.length>0){s.texcoordArray=new kl;const e=t.json.accessors[r.TEXCOORD_0];s.texcoordArray.resize(e.count);const i=Am(t,e);Cm(t,e,s.texcoordArray,i)}if(void 0!==r._FEATURE_ID_RGBA4444){const e=t.json.accessors[r._FEATURE_ID_RGBA4444];t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression")&&(s.featureData=Am(t,e))}void 0!==r._FEATURE_RGBA4444&&(s.featureData=new Uint32Array(Am(t,t.json.accessors[r._FEATURE_RGBA4444]).buffer));const d=e.material;return s.material=function(e,t){const{emissiveFactor:i=[0,0,0],alphaMode:n="OPAQUE",alphaCutoff:r=.5,normalTexture:s,occlusionTexture:o,emissiveTexture:a,doubleSided:l}=e,{baseColorFactor:c=[1,1,1,1],metallicFactor:h=1,roughnessFactor:d=1,baseColorTexture:u,metallicRoughnessTexture:f}=e.pbrMetallicRoughness||{},p=o?t[o.index]:void 0;if(o&&o.extensions&&o.extensions.KHR_texture_transform&&p){const e=o.extensions.KHR_texture_transform;p.offsetScale=[e.offset[0],e.offset[1],e.scale[0],e.scale[1]]}return{pbrMetallicRoughness:{baseColorFactor:new si(...c),metallicFactor:h,roughnessFactor:d,baseColorTexture:u?t[u.index]:void 0,metallicRoughnessTexture:f?t[f.index]:void 0},doubleSided:l,emissiveFactor:new si(...i),alphaMode:n,alphaCutoff:r,normalTexture:s?t[s.index]:void 0,occlusionTexture:p,emissionTexture:a?t[a.index]:void 0,defined:void 0===e.defined}}(void 0!==d?t.json.materials[d]:{defined:!1},i),s}function Lm(e,t,i){const{matrix:n,rotation:r,translation:s,scale:o,mesh:a,extras:l,children:c}=e,h={};if(h.matrix=n||function(e,t,i,n){var r=t[0],s=t[1],o=t[2],a=t[3],l=r+r,c=s+s,h=o+o,d=r*l,u=r*c,f=r*h,p=s*c,m=s*h,g=o*h,_=a*l,y=a*c,v=a*h,x=n[0],b=n[1],w=n[2];return e[0]=(1-(p+g))*x,e[1]=(u+v)*x,e[2]=(f-y)*x,e[3]=0,e[4]=(u-v)*b,e[5]=(1-(d+g))*b,e[6]=(m+_)*b,e[7]=0,e[8]=(f+y)*w,e[9]=(m-_)*w,e[10]=(1-(d+p))*w,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}([],r||[0,0,0,1],s||[0,0,0],o||[1,1,1]),void 0!==a){h.meshes=i[a];const e=h.anchor=[0,0];for(const t of h.meshes){const{min:i,max:n}=t.aabb;e[0]+=i[0]+n[0],e[1]+=i[1]+n[1]}e[0]=Math.floor(e[0]/h.meshes.length/2),e[1]=Math.floor(e[1]/h.meshes.length/2)}if(l&&(l.id&&(h.id=l.id),l.lights&&(h.lights=function(e){if(!e.length)return[];const t=function(e){const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.codePointAt(e);return i}(e),i=[],n=t.length/24,r=new Uint16Array(t.buffer),s=new Float32Array(t.buffer);for(let e=0;e<n;e++){const t=r[2*e*6]/30,n=r[2*e*6+1]/30,o=r[2*e*6+10]/100,a=s[6*e+1],l=s[6*e+2],c=s[6*e+3],h=s[6*e+4],d=c-a,u=h-l,f=Math.hypot(d,u);i.push({pos:[a+.5*d,l+.5*u,n],normal:[u/f,-d/f,0],width:f,height:t,depth:o,points:[a,l,c,h]})}return i}(l.lights))),c){const e=[];for(const n of c)e.push(Lm(t.json.nodes[n],t,i));h.children=e}return h}function Em(e){if(0===e.vertices.length||0===e.indices.length)return null;const t=new nf(e.vertices,e.indices,8,256),[i,n]=[t.min.clone(),t.max.clone()];return{vertices:e.vertices,indices:e.indices,grid:t,min:i,max:n}}function Im(e){if(!e.extras||!e.extras.ground)return null;const t=e.extras.ground;if(!t||!Array.isArray(t)||0===t.length)return null;const i=t[0];if(!i||!Array.isArray(i)||0===i.length)return null;const n=[];for(const e of i){if(!Array.isArray(e)||2!==e.length)continue;const t=e[0],i=e[1];"number"==typeof t&&"number"==typeof i&&n.push(new xe(t,i))}if(n.length<3)return null;n.length>1&&n[n.length-1].equals(n[0])&&n.pop();let r=0;for(let e=0;e<n.length;e++){const t=n[e],i=n[(e+1)%n.length],s=n[(e+2)%n.length];r+=(t.x-i.x)*(s.y-i.y)-(s.x-i.x)*(t.y-i.y)}r>0&&n.reverse();const s=au(n.flatMap(e=>[e.x,e.y]),[]);return 0===s.length?null:{vertices:n,indices:s}}function Pm(e,t){const i=[],n=[];let r=0;const s=[];for(const o of e){r=i.length;const e=o.vertexArray.float32,a=o.indexArray.uint16;for(let n=0;n<o.vertexArray.length;n++)s[0]=e[3*n+0],s[1]=e[3*n+1],s[2]=e[3*n+2],Y(s,s,t),i.push(new xe(s[0],s[1]));for(let e=0;e<3*o.indexArray.length;e++)n.push(a[e]+r)}if(n.length%3!=0)return null;for(let e=0;e<n.length;e+=3){const t=i[n[e+0]],r=i[n[e+1]],s=i[n[e+2]];(t.x-r.x)*(s.y-r.y)-(s.x-r.x)*(t.y-r.y)>0&&([n[e+1],n[e+2]]=[n[e+2],n[e+1]])}return{vertices:i,indices:n}}function Rm(e){const t=function(e,t){const i=[],n=WebGL2RenderingContext;if(e.json.textures)for(const r of e.json.textures){const s={magFilter:n.LINEAR,minFilter:n.NEAREST,wrapS:n.REPEAT,wrapT:n.REPEAT};void 0!==r.sampler&&Object.assign(s,e.json.samplers[r.sampler]),i.push({image:t[r.source],sampler:s,uploaded:!1})}return i}(e,e.images),i=function(e,t){const i=[];for(const n of e.json.meshes){const r=[];for(const i of n.primitives)r.push(Dm(i,e,t));i.push(r)}return i}(e,t),{scenes:n,scene:r,nodes:s}=e.json,o=n?n[r||0].nodes:s,a=[];for(const t of o)a.push(Lm(s[t],e,i));return function(e,t,i){const n={},r=new Set;for(let s=0;s<e.length;s++){const e=i[t[s]];if(!e.extras)continue;const o=e.extras["mapbox:footprint:version"],a=e.extras["mapbox:footprint:id"];(o||a)&&r.add(s),"1.0.0"===o&&a&&(n[a]=s)}for(let s=0;s<e.length;s++){if(r.has(s))continue;const o=e[s],a=i[t[s]];if(!a.extras)continue;let l=null;o.id in n&&(l=Pm(e[n[o.id]].meshes,o.matrix)),l||(l=Im(a)),l&&(o.footprint=Em(l))}if(r.size>0){const t=Array.from(r.values()).sort((e,t)=>e-t);for(let i=t.length-1;i>=0;i--)e.splice(t[i],1)}}(a,o,e.json.nodes),a}function Om(e){e.heightmap=new Float32Array(4096),e.heightmap.fill(-1);const t=e.vertexArray.float32,i=e.aabb.min[0]-1,n=e.aabb.min[1]-1,r=vm/(e.aabb.max[0]-i+2),s=vm/(e.aabb.max[1]-n+2);for(let o=0;o<t.length;o+=3){const a=t[o+2],l=(t[o+0]-i)*r|0,c=(t[o+1]-n)*s|0;a>e.heightmap[c*vm+l]&&(e.heightmap[c*vm+l]=a)}}function zm(e,t,i,n,r){i.reserve(i.length+4*e.length),n.reserve(n.length+10*e.length),r.reserve(r.length+10*e.length);let s=n.length;for(const o of e){const e=Math.min(10,Math.max(4,1.3*o.height))*t,a=[-o.normal[1],o.normal[0],0],l=Math.min(.29,.1*o.width/o.depth),c=o.width-2*o.depth*t*(l+.01),h=E([],o.pos,a,c/2),d=E([],o.pos,a,-c/2),u=[h[0],h[1],h[2]+o.height],f=[d[0],d[1],d[2]+o.height],p=E([],o.normal,a,l);L(p,p,e);const m=E([],o.normal,a,-l);L(m,m,e),k(p,h,p),k(m,d,m),h[2]+=.1,d[2]+=.1,n.emplaceBack(p[0],p[1],p[2]),n.emplaceBack(m[0],m[1],m[2]),n.emplaceBack(h[0],h[1],h[2]),n.emplaceBack(d[0],d[1],d[2]),n.emplaceBack(u[0],u[1],u[2]),n.emplaceBack(f[0],f[1],f[2]),n.emplaceBack(h[0],h[1],h[2]),n.emplaceBack(d[0],d[1],d[2]),n.emplaceBack(p[0],p[1],p[2]),n.emplaceBack(m[0],m[1],m[2]);const g=c/e/2;r.emplaceBack(-g-l,-1,g,.8),r.emplaceBack(g+l,-1,g,.8),r.emplaceBack(-g,0,g,1.3),r.emplaceBack(g,0,g,1.3),r.emplaceBack(g+l,-.8,g,.7),r.emplaceBack(g+l,-.8,g,.7),r.emplaceBack(0,0,g,1.3),r.emplaceBack(0,0,g,1.3),r.emplaceBack(g+l,-1.2,g,.8),r.emplaceBack(g+l,-1.2,g,.8),i.emplaceBack(6+s,4+s,8+s),i.emplaceBack(7+s,9+s,5+s),i.emplaceBack(0+s,1+s,2+s),i.emplaceBack(1+s,3+s,2+s),s+=10}}function Fm(e,t){const i={};i.indexArray=new _l,i.vertexArray=new rl,i.colorArray=new hl,zm(e,t,i.indexArray,i.vertexArray,i.colorArray);const n={defined:!0};n.emissiveFactor=si.black;const r={};return r.baseColorFactor=si.white,n.pbrMetallicRoughness=r,i.material=n,i.aabb=new Dh([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),i}const Nm=Xa([{name:"a_pos_3f",components:3,type:"Float32"}]),Ym=Xa([{name:"a_normal_3",components:3,type:"Int16"}]),Bm=Xa([{name:"a_part_color_emissive",components:2,type:"Uint16"}]),Hm=Xa([{name:"a_bloom_attenuation",components:4,type:"Float32"}]),jm=ah.types,Vm=32767;function Wm(e,t){const i=Rn+t;for(const n of e)for(const e of n)if(e.x<-t||e.x>i||e.y<-t||e.y>i)return!1;return!0}class Um{constructor(e){this.layoutAOArray=[],this.indexArrayForConflationUploaded=!1,this.maxHeight=0,this.replacementUpdateTime=0,this.activeReplacements=[],this.footprints=[],this.featuresOnBorder=[],this.buildingFeatures=[],this.footprintLookup={},this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.worldview=e.worldview,this.layoutVertexArray=new rl,this.layoutNormalArray=new Ja,this.layoutColorArray=new ul,this.indexArray=new _l,this.indexArrayForConflation=new _l,this.entranceBloom={layoutVertexArray:new rl,layoutVertexBuffer:null,layoutAttenuationArray:new hl,layoutAttenuationBuffer:null,layoutColorArray:new ul,layoutColorBuffer:null,indexArray:new _l,indexArrayForConflation:new _l,indexBuffer:null,segmentsBucket:new Xl},this.programConfigurations=new wc(e.layers,{zoom:e.zoom,lut:e.lut}),this.segmentsBucket=new Xl,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.projection=e.projection,this.groundEffect=new Uf(e)}get segments(){return this.segmentsBucket}get bloomGeometry(){return this.entranceBloom}updateFootprints(e,t){for(const i of this.footprints)t.push({footprint:i,id:e})}prepare(){return function(){if(null!=Rp||null!=Pp)return null;if(null!=Ip)return Ip;const e=fetch(nt.BUILDING_GEN_URL);return Ip=function(e){let t,i,n,r;function s(){t=new Uint8Array(r.buffer),i=new Int32Array(r.buffer),n=new Float32Array(r.buffer)}function o(){throw new Error("Unexpected BuildingGen error.")}const a=()=>{},l={a:{a:o,f:function(e){const i=t.length,n=Math.max(e>>>0,Math.ceil(1.2*i)),o=Math.ceil((n-i)/65536);try{return r.grow(o),s(),!0}catch(e){return!1}},g:o,b:a,c:a,d:a,e:a}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,l):e.then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,l))).then(e=>{const o=e.instance.exports;return(0,o.g)(),r=o.f,s(),new kp({setStyle:o.h,setAOOptions:o.i,setMetricOptions:o.j,setStructuralOptions:o.k,setFacadeOptions:o.l,setFauxFacadeOptions:o.m,setFacadeClassifierOptions:o.n,addFeature:o.o,addFacade:o.p,generateMesh:o.q,getLastError:o.r,getMeshCount:o.s,getPositionsPtr:o.t,getPositionsLength:o.u,getNormalsPtr:o.v,getNormalsLength:o.w,getColorsPtr:o.x,getColorsLength:o.y,getAOPtr:o.z,getAOLength:o.A,getUVPtr:o.B,getUVLength:o.C,getFauxFacadePtr:o.D,getFauxFacadeLength:o.E,getIndicesPtr:o.F,getIndicesLength:o.G,getBuildingPart:o.H,getRingCount:o.I,getRingPtr:o.J,getRingLength:o.K,free:o.L,malloc:o.M,heapU8:t,heap32:i,heapF32:n})})}(e).then(e=>(Ip=null,Rp=e,Rp)).catch(e=>{We("Could not load building-gen"),Ip=null,Pp=e}),Ip}()}populate(e,t,i,n){const r=Rp;if(!r)return;const s=Zc(i);this.tileToMeter=s,this.brightness=t.brightness,r.setStyle({convertToMeters:!1,entranceColorRgb:[1,1,1],facadeGlazingColorRgb:[.5607843137254902,.6745098039215687,.7215686274509804],normalScale:[1,-1,s],ridgeHeight:3,roofColorRgb:[.886274516,.784313738,.713725507],tileToMeters:s,tileZoom:16,wallColorRgb:[.988235294,.933333337,.811764717]}),r.setAOOptions(!1,.3),r.setMetricOptions(!1,16),r.setStructuralOptions(!0),r.setFacadeOptions(4,!0),r.setFauxFacadeOptions(!1,!1,1),r.setFacadeClassifierOptions(3);const o=new Map;for(const{feature:t}of e){if("LineString"!==jm[t.type])continue;const e=this.layers[0]._featureFilter.needGeometry,r=oh(t,e);if(!this.layers[0]._featureFilter.filter(new da(this.zoom),r,i))continue;const s=e?r.geometry:sh(t,i,n),a=[];for(const e of s)for(const t of e)a.push({x:t.x,y:t.y});const l={coordinates:a,crossPerc:t.properties.cross_perc,distanceToRoad:t.properties.distance_to_road,entrances:t.properties.entrances,sourceId:0},c=t.properties.source_id;let h=o.get(c);h||(h=[],o.set(c,h)),h.push(l)}this.maxHeight=0;for(const{feature:s,index:a}of e){if("LineString"===jm[s.type])continue;const e=this.layers[0]._featureFilter.needGeometry,l=oh(s,e);if(!this.layers[0]._featureFilter.filter(new da(this.zoom),l,i))continue;const c=e?l.geometry:sh(s,i,n),h=Pu(c,500);if(!Wm(c,163))continue;const d=this.layers[0],u=d.layout.get("building-base").evaluate(s,{},i),f=d.layout.get("building-height").evaluate(s,{},i),p=d.layout.get("building-roof-shape").evaluate(s,{},i),m=d.paint.get("building-ambient-occlusion-intensity"),g=d.paint.get("building-ambient-occlusion-ground-radius")/this.tileToMeter;if("flat"===p)continue;const _=s.properties.source_id;let y;y=o.has(_)?o.get(_):[];const v=[],x=new xe(1/0,1/0),b=new xe(-1/0,-1/0);for(const e of h)if(e.length>0){const t=[];for(const i of e){const e=[];for(let t=i.length-1;t>=0;t--){const n=i[t];e.push({x:n.x,y:n.y}),x.x=Math.min(x.x,n.x),x.y=Math.min(x.y,n.y),b.x=Math.max(b.x,n.x),b.y=Math.max(b.y,n.y)}t.push(e)}v.push({id:s.id,height:f,minHeight:u,sourceId:0,roofType:p,coordinates:t})}const w=r.generateMesh(v,y);if("string"==typeof w)continue;if(0===w.meshes.length||0===w.modifiedPolygonRings.length)continue;let S=0;for(const e of w.meshes)S+=e.positions.length/3;const T=this.segmentsBucket.prepareSegment(S,this.layoutVertexArray,this.indexArray),k=[];let M=null,A=0,C=-1;const D=this.indexArray.length;let L=0;for(const e of w.meshes){const t=this.layoutVertexArray.length;if("entrance"===e.buildingPart){const t=new Array;for(let i=0;i<e.indices.length;i+=12){const n=e.positions[i+0],r=e.positions[i+1],s=e.positions[i+3],o=e.positions[i+4],a=e.positions[i+2],l=e.positions[i+8]-a,c=1,h=s-n,d=o-r,u=Math.hypot(h,d);t.push({pos:[n+.5*h,r+.5*d,a],normal:[d/u,-h/u,0],width:u,height:l,depth:c,points:[n,r,s,o]})}const i=this.entranceBloom.segmentsBucket.prepareSegment(10*t.length,this.entranceBloom.layoutVertexArray,this.entranceBloom.indexArray),n=this.entranceBloom.layoutVertexArray.length;A=this.entranceBloom.indexArray.length,zm(t,.5/this.tileToMeter,this.entranceBloom.indexArray,this.entranceBloom.layoutVertexArray,this.entranceBloom.layoutAttenuationArray);const r=this.entranceBloom.layoutVertexArray.length-n;C=this.entranceBloom.indexArray.length-A;for(let e=0;e<r;e++){const e=65535;this.entranceBloom.layoutColorArray.emplaceBack(e,e)}i.vertexLength+=r,i.primitiveLength+=C,M={part:e.buildingPart,vertexOffset:n,vertexLength:r}}for(let t=0;t<e.positions.length;t+=3)L=Math.max(L,e.positions[t+2]),this.layoutVertexArray.emplaceBack(e.positions[t],e.positions[t+1],e.positions[t+2]);for(let t=0;t<e.normals.length;t+=3)this.layoutNormalArray.emplaceBack(e.normals[t+0]*Vm,e.normals[t+1]*Vm,e.normals[t+2]*Vm);for(let t=0;t<e.ao.length;t++)this.layoutAOArray.push(e.ao[t]);for(let t=0;t<e.colors.length;t+=3){const i=1+(e.ao[t/3]-1)*m;this.layoutColorArray.emplaceBack(e.colors[t]*i<<8|e.colors[t+1]*i,e.colors[t+2]*i<<8)}const i=T.vertexLength;for(let t=0;t<e.indices.length;t+=3)this.indexArray.emplaceBack(i+e.indices[t],i+e.indices[t+1],i+e.indices[t+2]);T.vertexLength+=e.positions.length/3,T.primitiveLength+=e.indices.length/3,("roof"===e.buildingPart||"wall"===e.buildingPart||"facade_glazing"===e.buildingPart||"entrance"===e.buildingPart)&&k.push({part:e.buildingPart,vertexOffset:t,vertexLength:e.positions.length/3})}this.maxHeight=Math.max(this.maxHeight,L),this.buildingFeatures.push({feature:l,segment:T,parts:k,buildingBloom:M});const E=this.indexArray.length-D,I=[],P=[],R=new xe(1/0,1/0),O=new xe(-1/0,-1/0),z=this.groundEffect.vertexArray.length;for(const e of w.modifiedPolygonRings){const t=[],i=new xe(1/0,1/0),n=new xe(-1/0,-1/0);for(let r=0;r<e.length;r+=2){const s=e.length-r-2;i.x=Math.min(i.x,e[s]),i.y=Math.min(i.y,e[s+1]),n.x=Math.max(n.x,e[s]),n.y=Math.max(n.y,e[s+1]);const o=new xe(e[s],e[s+1]);t.push(o),I.push(o.x,o.y),P.push(o.clone())}R.x=Math.min(R.x,i.x),R.y=Math.min(R.y,i.y),O.x=Math.max(O.x,n.x),O.y=Math.max(O.y,n.y),this.groundEffect.addData(t,[i,n],g)}const F=this.groundEffect.vertexArray.length-z;(x.x<0||b.x>Rn||x.y<0||b.y>Rn)&&this.featuresOnBorder.push({featureId:s.id,footprintIndex:this.footprints.length});{const e=au(I,null,2),t=new nf(P,e,8,256);let i=s.id;s.properties&&s.properties.hasOwnProperty("building_id")&&(i=s.properties.building_id),this.footprints.push({vertices:P,indices:e,grid:t,min:R,max:O,buildingId:i,hiddenFlags:0,indicesOffset:D,indicesLength:E,bloomIndicesOffset:A,bloomIndicesLength:C,groundEffectVertexOffset:z,groundEffectVertexLength:F,segment:T,height:L})}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,a,{},t.availableImages,i,t.brightness),this.groundEffect.addPaintPropertiesData(s,a,{},t.availableImages,i,t.brightness)}this.groundEffect.prepareBorderSegments(),this.evaluate(this.layers[0])}update(e,t,i,n,r,s,o){this.programConfigurations.updatePaintArrays(e,t,r,i,n,s,o),this.groundEffect.update(e,t,r,i,n,s,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Nm.members),this.layoutNormalBuffer=e.createVertexBuffer(this.layoutNormalArray,Ym.members),this.entranceBloom.layoutVertexBuffer=e.createVertexBuffer(this.entranceBloom.layoutVertexArray,Nm.members),this.entranceBloom.layoutAttenuationBuffer=e.createVertexBuffer(this.entranceBloom.layoutAttenuationArray,Hm.members),this.uploadUpdatedColorBuffer(e),this.uploadUpdatedIndexBuffer(e),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.layoutNormalBuffer.destroy(),this.layoutColorBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segmentsBucket.destroy(),this.entranceBloom.layoutVertexBuffer.destroy(),this.entranceBloom.layoutColorBuffer.destroy(),this.entranceBloom.layoutAttenuationBuffer.destroy(),this.entranceBloom.indexBuffer.destroy(),this.entranceBloom.segmentsBucket.destroy())}updateFootprintHiddenFlags(e,t,i=!0){let n=!1;const r=i?t:0,s=0|(i?-1:~t);0===this.groundEffect.hiddenByLandmarkVertexArray.length&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const t of e){const e=this.footprints[t],i=e.hiddenFlags&s|r;e.hiddenFlags!==i&&(e.hiddenFlags=i,n=!0,this.groundEffect.updateHiddenByLandmarkRange(e.groundEffectVertexOffset,e.groundEffectVertexLength,0!==e.hiddenFlags))}return n&&(this.indexArrayForConflationUploaded=!1),n}uploadUpdatedIndexBuffer(e){if(this.groundEffect.uploadHiddenByLandmark(e),!this.indexArrayForConflationUploaded&&0!==this.indexArray.length){this.indexArrayForConflation.resize(this.indexArray.length),this.indexArrayForConflation.uint16.set(this.indexArray.uint16),this.entranceBloom.indexArrayForConflation.resize(this.entranceBloom.indexArray.length),this.entranceBloom.indexArrayForConflation.uint16.set(this.entranceBloom.indexArray.uint16);for(const e of this.footprints){const t=e.indicesOffset+e.indicesLength;if(0!==e.hiddenFlags){for(let i=e.indicesOffset;i<t;i++)this.indexArrayForConflation.uint16[3*i+0]=0,this.indexArrayForConflation.uint16[3*i+1]=0,this.indexArrayForConflation.uint16[3*i+2]=0;const i=e.bloomIndicesOffset+e.bloomIndicesLength;for(let t=e.bloomIndicesOffset;t<i;t++)this.entranceBloom.indexArrayForConflation.uint16[3*t+0]=0,this.entranceBloom.indexArrayForConflation.uint16[3*t+1]=0,this.entranceBloom.indexArrayForConflation.uint16[3*t+2]=0}}this.indexBuffer?this.indexBuffer.updateData(this.indexArrayForConflation):this.indexBuffer=e.createIndexBuffer(this.indexArrayForConflation,!0),this.entranceBloom.indexBuffer?this.entranceBloom.indexBuffer.updateData(this.entranceBloom.indexArrayForConflation):this.entranceBloom.indexBuffer=e.createIndexBuffer(this.entranceBloom.indexArrayForConflation,!0),this.indexArrayForConflationUploaded=!0}}uploadUpdatedColorBuffer(e){this.layoutColorBuffer?this.layoutColorBuffer.updateData(this.layoutColorArray):this.layoutColorBuffer=e.createVertexBuffer(this.layoutColorArray,Bm.members,!0),this.entranceBloom.layoutColorBuffer?this.entranceBloom.layoutColorBuffer.updateData(this.entranceBloom.layoutColorArray):this.entranceBloom.layoutColorBuffer=e.createVertexBuffer(this.entranceBloom.layoutColorArray,Bm.members,!0)}evaluate(e){const t=e.paint.get("building-ambient-occlusion-intensity");for(const i of this.buildingFeatures){const n=i.feature;n.properties["building-part"]="roof";const r=e.paint.get("building-color").evaluate(n,{},this.canonical),s=e.paint.get("building-emissive-strength").evaluate(n,{},this.canonical);n.properties["building-part"]="wall";const o=e.paint.get("building-color").evaluate(n,{},this.canonical),a=e.paint.get("building-emissive-strength").evaluate(n,{},this.canonical);n.properties["building-part"]="window";const l=e.paint.get("building-color").evaluate(n,{},this.canonical),c=e.paint.get("building-emissive-strength").evaluate(n,{},this.canonical);n.properties["building-part"]="door";const h=e.paint.get("building-color").evaluate(n,{},this.canonical),d=e.paint.get("building-emissive-strength").evaluate(n,{},this.canonical);for(const e of i.parts){let i,n=r;"roof"===e.part?(n=r,i=s):"wall"===e.part?(n=o,i=a):"facade_glazing"===e.part?(n=l,i=c):"entrance"===e.part&&(n=h,i=d),i=Le(i,0,1);for(let r=0;r<e.vertexLength;r++){const s=e.vertexOffset+r,o=1+(this.layoutAOArray[s]-1)*t;this.layoutColorArray.emplace(s,n.r*o*255<<8|n.g*o*255,n.b*o*255<<8|255*i)}}const u=i.buildingBloom;if(u)for(let e=0;e<u.vertexLength;e++)this.bloomGeometry.layoutColorArray.emplace(u.vertexOffset+e,255*h.r<<8|255*h.g,255*h.b<<8|51*d)}}needsEvaluation(e,t){const i=e.transform.projectionOptions,n=e.style.getBrightness();return!(this.uploaded&&i.name===this.projection.name&&this.brightness===n||(this.projection=i,this.brightness=n,0))}updateReplacement(e,t,i){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const n=t.getReplacementRegionsForTile(e.toUnwrapped());if(vf(this.activeReplacements,n))return;this.activeReplacements=n;for(const e of this.footprints)e.hiddenFlags&=-2;const r=[];for(const t of this.activeReplacements){if(t.order<=pf)continue;const i=Math.max(1,Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z));for(const n of this.footprints)n.min.x>t.max.x||n.max.x<t.min.x||n.min.y>t.max.y||n.max.y<t.min.y||(r.length=0,$m(n.vertices,0,n.vertices.length,t.footprintTileId.canonical,e.canonical,r),wf(t.footprint,r,n.indices,0,n.indices.length,0,-i)&&(n.hiddenFlags|=1))}0===this.groundEffect.hiddenByLandmarkVertexArray.length&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.footprints)this.groundEffect.updateHiddenByLandmarkRange(e.groundEffectVertexOffset,e.groundEffectVertexLength,0!==e.hiddenFlags);this.indexArrayForConflationUploaded=!1}getHeightAtTileCoord(e,t){let i=Number.NEGATIVE_INFINITY,n=!0;const r=4*(e+Rn)*Rn+(t+Rn);if(this.footprintLookup.hasOwnProperty(r)){const e=this.footprintLookup[r];return e?{height:e.height,hidden:0!==e.hiddenFlags}:void 0}const s=new xe(e,t);for(const o of this.footprints)e>o.max.x||o.min.x>e||t>o.max.y||o.min.y>t||o.height<=i||kf(s,o)&&(i=o.height,this.footprintLookup[r]=o,n=0!==o.hiddenFlags);if(i!==Number.NEGATIVE_INFINITY)return{height:i,hidden:n};this.footprintLookup[r]=void 0}}function $m(e,t,i,n,r,s){const o=Math.pow(2,n.z-r.z);for(let a=0;a<i;a++){let i=e[a+t].x,l=e[a+t].y;i=(i+r.x*Rn)*o-n.x*Rn,l=(l+r.y*Rn)*o-n.y*Rn,s.push(new xe(i,l))}}let Gm,Xm;Ws(Um,"BuildingBucket",{omit:["layers"]});const qm=Xa([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),Zm=Xa([{name:"a_z_offset_width",components:3,type:"Float32"}],4),{members:Jm}=qm,Km=Xa([{name:"a_packed",components:3,type:"Float32"}]),{members:Qm}=Km,eg=Xa([{name:"a_pattern_data",components:3,type:"Float32"}]),{members:tg}=eg;class ig{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.image=new Qd({width:e,height:t}),this.positions={},this.uploaded=!1}getDash(e,t){const i=this.getKey(e,t);return this.positions[i]}trim(){const e=this.width,t=this.height=Fe(this.nextRow);this.image.resize({width:e,height:t})}getKey(e,t){return e.join(",")+t}getDashRanges(e,t,i){const n=[];let r=e.length%2==1?-e[e.length-1]*i:0,s=e[0]*i,o=!0;n.push({left:r,right:s,isDash:o,zeroLength:0===e[0]});let a=e[0];for(let t=1;t<e.length;t++){o=!o;const l=e[t];r=a*i,a+=l,s=a*i,n.push({left:r,right:s,isDash:o,zeroLength:0===l})}return n}addRoundDash(e,t,i){const n=t/2;for(let t=-i;t<=i;t++){const r=this.width*(this.nextRow+i+t);let s=0,o=e[s];for(let a=0;a<this.width;a++){a/o.right>1&&(o=e[++s]);const l=Math.abs(a-o.left),c=Math.abs(a-o.right),h=Math.min(l,c);let d;const u=t/i*(n+1);if(o.isDash){const e=n-Math.abs(u);d=Math.sqrt(h*h+e*e)}else d=n-Math.sqrt(h*h+u*u);this.image.data[r+a]=Math.max(0,Math.min(255,d+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const i=e[t],n=e[t+1];i.zeroLength?e.splice(t,1):n&&n.isDash===i.isDash&&(n.left=i.left,e.splice(t,1))}const i=e[0],n=e[e.length-1];i.isDash===n.isDash&&(i.left=n.left-this.width,n.right=i.right+this.width);const r=this.width*this.nextRow;let s=0,o=e[s];for(let i=0;i<this.width;i++){i/o.right>1&&(o=e[++s]);const n=Math.abs(i-o.left),a=Math.abs(i-o.right),l=Math.min(n,a);this.image.data[r+i]=Math.max(0,Math.min(255,(o.isDash?l:-l)+t+128))}}addDash(e,t){const i=this.getKey(e,t);if(this.positions[i])return this.positions[i];const n="round"===t,r=n?7:0,s=2*r+1;if(this.nextRow+s>this.height)return We("LineAtlas out of space"),null;0===e.length&&e.push(1);let o=0;for(let t=0;t<e.length;t++)e[t]<0&&(We("Negative value is found in line dasharray, replacing values with 0"),e[t]=0),o+=e[t];if(0!==o){const i=this.width/o,s=this.getDashRanges(e,this.width,i);n?this.addRoundDash(s,i,r):this.addRegularDash(s,"square"===t?.5*i:0)}const a=this.nextRow+r;this.nextRow+=s;const l={tl:[a,r],br:[o,0]};return this.positions[i]=l,l}}Ws(ig,"LineAtlas");const ng=ah.types,rg=Math.cos(Math.PI/180*37.5),sg=Math.cos(Math.PI/180*5);class og{constructor(e){this.evaluationGlobals={zoom:0,lineProgress:void 0},this.elevationType="none",this.zoom=e.zoom,this.evaluationGlobals.zoom=this.zoom,this.overscaling=e.overscaling,this.pixelRatio=e.pixelRatio,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.hasCrossSlope=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(e=>{this.gradients[e.id]={}}),this.layoutVertexArray=new nl,this.layoutVertexArray2=new rl,this.patternVertexArray=new rl,this.indexArray=new _l,this.programConfigurations=new wc(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new Xl,this.maxLineLength=0,this.zOffsetVertexArray=new rl,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.tessellationStep=e.tessellationStep?e.tessellationStep:128,this.worldview=e.worldview}updateFootprints(e,t){}populate(e,t,i,n){this.hasPattern=zu("line",this.layers,this.pixelRatio,t);const r=this.layers[0].layout.get("line-sort-key");this.tileToMeter=Zc(i);const s=this.layers[0].layout.get("line-elevation-reference");if("hd-road-markup"===s)this.elevationType="road";else{const e=this.layers[0].layout.get("line-z-offset"),t=e.isConstant()&&!e.constantOr(0);this.elevationType="sea"!==s&&"ground"!==s&&t?"none":"offset","offset"===this.elevationType&&"none"===s&&We(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`)}const o=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope="offset"===this.elevationType&&void 0!==o;const a=[];for(const{feature:t,id:s,index:o,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=oh(t,e);if(!this.layers[0]._featureFilter.filter(new da(this.zoom,{worldview:this.worldview}),c,i))continue;const h=r?r.evaluate(c,{},i):void 0,d={id:s,properties:t.properties,type:t.type,sourceLayerIndex:l,index:o,geometry:e?c.geometry:sh(t,i,n),patterns:{},sortKey:h};a.push(d)}r&&a.sort((e,t)=>e.sortKey-t.sortKey);const{lineAtlas:l,featureIndex:c}=t,h=this.addConstantDashes(l);for(const n of a){const{geometry:r,index:s,sourceLayerIndex:o}=n;if(h&&this.addFeatureDashes(n,l),this.hasPattern){const e=Fu("line",this.layers,n,this.zoom,this.pixelRatio,t);this.patternFeatures.push(e)}else this.addFeature(n,r,s,i,l.positions,t.availableImages,t.brightness,t.elevationFeatures);c.insert(e[s].feature,r,s,o,this.index)}}addConstantDashes(e){let t=!1;for(const i of this.layers){const n=i.paint.get("line-dasharray").value,r=i.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==r.kind)t=!0;else{const t=r.value,i=n.value;if(!i)continue;e.addDash(i,t)}}return t}addFeatureDashes(e,t){const i=this.zoom;for(const n of this.layers){const r=n.paint.get("line-dasharray").value,s=n.layout.get("line-cap").value;if("constant"===r.kind&&"constant"===s.kind)continue;let o,a;if("constant"===r.kind){if(o=r.value,!o)continue}else o=r.evaluate({zoom:i},e);a="constant"===s.kind?s.value:s.evaluate({zoom:i},e),t.addDash(o,a),e.patterns[n.id]=[t.getKey(o,a)]}}update(e,t,i,n,r,s,o,a){this.programConfigurations.updatePaintArrays(e,t,r,i,n,s,o,a)}addFeatures(e,t,i,n,r,s){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,i,n,s)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Qm)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,tg)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Zm.members,!0)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Jm),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,i,n,r,s,o,a){const l=this.layers[0].layout,c=l.get("line-join").evaluate(e,{}),h=l.get("line-cap").evaluate(e,{}),d=l.get("line-miter-limit"),u=l.get("line-round-limit");this.lineClips=this.lineFeatureClips(e),this.lineFeature=e,this.zOffsetValue=l.get("line-z-offset").value;const f=this.layers[0].paint.get("line-width").value;if("constant"!==f.kind&&!1===f.isLineProgressConstant&&(this.variableWidthValue=f),"road"===this.elevationType){const i=this.layoutVertexArray.length;if(!this.addElevatedRoadFeature(e,t,n,a,c,h,d,u)){const[r,s]=this.clipRuntimeLinesToTile(t,1);for(let t=0;t<r.length;t++){const i=r[t],o=s[t],a={progress:{min:o.progress.min,max:o.progress.max},nextDir:this.computeSegNextDir(o,i),prevDir:this.computeSegPrevDir(o,i)};this.addLine(i,e,n,c,h,d,u,a)}this.fillNonElevatedRoadSegment(i)}}else for(const i of t)this.addLine(i,e,n,c,h,d,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,r,s,n,o,void 0,this.worldview)}computeSegNextDir(e,t){return e.nextPoint.sub(t.at(-2)).unit()}computeSegPrevDir(e,t){return t[1].sub(e.prevPoint).unit()}clipLinesToTile(e,t){return cp(e,-t,-t,Rn+t,Rn+t)}clipRuntimeLinesToTile(e,t){const i=[];return[cp(e,-t,-t,Rn+t,Rn+t,i),i]}addElevatedRoadFeature(e,t,i,n,r,s,o,a){const l=[],c=Ih.getElevationFeature(e,n);if(c){const e=this.clipLinesToTile(t,1),n=this.prepareElevatedLines(e,c,i);for(const e of n)l.push({geometry:e,elevation:c,elevationTileID:i,segment:{progress:{min:0,max:1},nextDir:void 0,prevDir:void 0}})}if(0===l.length)return!1;for(const t of l){const n=this.layoutVertexArray.length;this.addLine(t.geometry,e,i,r,s,o,a);const l=new Ph(i,t.elevationTileID);if(t.elevation)for(let e=n;e<this.layoutVertexArray.length;e++){const i=new xe(this.layoutVertexArray.int16[6*e]>>1,this.layoutVertexArray.int16[6*e+1]>>1),n=l.pointElevation(i,t.elevation,.05);this.updateHeightRange(n),this.zOffsetVertexArray.emplaceBack(n,0,0)}else this.fillNonElevatedRoadSegment(n)}return!0}prepareElevatedLines(e,t,i){if(null!=t.constantHeight)return e;const n=[],r=1/Zc(i);for(const i of e)hp(i,new Lh(t,r),0,n);return n}fillNonElevatedRoadSegment(e){for(let t=e;t<this.layoutVertexArray.length;t++)this.zOffsetVertexArray.emplaceBack(0,0,0)}updateHeightRange(e){this.heightRange?(this.heightRange.min=Math.min(this.heightRange.min,e),this.heightRange.max=Math.max(this.heightRange.max,e)):this.heightRange={min:e,max:e}}addLine(e,t,i,n,r,s,o,a){this.distance=0,this.prevDistance=0,this.scaledDistance=0,this.totalDistance=0,this.totalFeatureLength=0,this.lineSoFar=0,this.currentVertex=void 0;const l="none"===n;this.patternJoinNone=this.hasPattern&&l,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[];const c=a&&a.progress.min>0,h=a&&a.progress.max<1;if(this.lineClips){let i={min:this.lineClips.start,max:this.lineClips.end},n=1;if(a){const e=this.lineClips.end-this.lineClips.start;i=function(e,t,i){return{min:it(e.min,t,i),max:it(e.max,t,i)}}(a.progress,{min:0,max:1},i),e>0&&(n=(i.max-i.min)/e)}const r=+t.properties.mapbox_clip_feature_len,s=+t.properties.mapbox_clip_seg_len;if(Number.isNaN(r)||Number.isNaN(s)){for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);const t=this.totalDistance/(i.max-i.min);this.totalFeatureLength=Number.isFinite(t)?t:0,this.lineClips.start=i.min,this.lineClips.end=i.max,this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}else this.totalFeatureLength=r,this.distance=s*n,this.lineClips.start=i.min,this.lineClips.end=i.max,this.maxLineLength=Math.max(this.maxLineLength,this.distance);this.lineClipsArray.push(this.lineClips),this.updateScaledDistance()}const d="Polygon"===ng[t.type];let u=e.length;for(;u>=2&&e[u-1].equals(e[u-2]);)u--;let f=0;for(;f<u-1&&e[f].equals(e[f+1]);)f++;if(u<(d?3:2))return;"bevel"===n&&(s=1.05);const p=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray);let m,g,_,y,v,x,b,w;a&&a.prevDir&&(x=a.prevDir.perp()),a&&a.nextDir&&(b=a.nextDir.perp()),this.e1=this.e2=-1,d&&(m=e[u-2],v=e[f].sub(m)._unit()._perp());for(let t=f;t<u;t++){if(_=t===u-1?d?e[f+1]:void 0:e[t+1],_&&e[t].equals(_))continue;v&&(y=v),m&&(g=m),m=e[t],w=this.evaluateLineProgressFeatures(g?g.dist(m):0),v=_?_.sub(m)._unit()._perp():y,y=y||v;const i=g&&_;let a=i?n:d||l?"butt":r;const S=y.x*v.x+y.y*v.y;if(l){const e=function(e){if(e.patternJoinNone){const t=e.segmentPoints.length/2,i=e.lineSoFar-e.segmentStart;for(let n=0;n<t;++n){const t=e.segmentPoints[2*n+1],r=Math.round(e.segmentPoints[2*n])+.5+.25*t;e.patternVertexArray.emplaceBack(r,i,e.segmentStart),e.patternVertexArray.emplaceBack(r,i,e.segmentStart)}e.segmentPoints.length=0}e.e1=e.e2=-1};if(i&&S<sg){this.updateDistance(g,m),this.addCurrentVertex(m,y,1,1,p,w),e(this),this.addCurrentVertex(m,v,-1,-1,p,w);continue}if(g){if(!_){this.updateDistance(g,m),this.addCurrentVertex(m,y,1,1,p,w),e(this);continue}a="miter"}}let T=y.add(v);0===T.x&&0===T.y||T._unit();const k=T.x*v.x+T.y*v.y,M=0!==k?1/k:1/0,A=2*Math.sqrt(2-2*k),C=k<rg&&g&&_,D=y.x*v.y-y.y*v.x>0,L=this.overscaling<=16?15*Rn/(512*this.overscaling):0;if(i&&"round"===a)if(M<o)a="miter";else if(M<=2){const e=ag(m,-10,8202);a="offset"===this.elevationType&&(e||this.hasCrossSlope)?"miter":"fakeround"}if("miter"===a&&M>s&&(a="bevel"),"bevel"===a&&(M>2&&(a="flipbevel"),M<s&&(a="miter")),g&&!("miter"===a&&C)&&this.updateDistance(g,m),"miter"===a)if(C){const e=m.dist(g);if(e>2*L){const t=m.sub(m.sub(g)._mult(L/e)._round());this.updateDistance(g,t),this.addCurrentVertex(t,y,0,0,p,w),g=t}this.updateDistance(g,m),T._mult(M),this.addCurrentVertex(m,T,0,0,p,w);const t=m.dist(_);if(t>2*L){const e=m.add(_.sub(m)._mult(L/t)._round());this.updateDistance(m,e),this.addCurrentVertex(e,v,0,0,p,w),m=e}}else T._mult(M),this.addCurrentVertex(m,T,0,0,p,w);else if("flipbevel"===a){if(M>100)T=v.mult(-1);else{const e=M*y.add(v).mag()/y.sub(v).mag();T._perp()._mult(e*(D?-1:1))}this.addCurrentVertex(m,T,0,0,p,w),this.addCurrentVertex(m,T.mult(-1),0,0,p,w)}else if("bevel"===a||"fakeround"===a){null!=w&&g&&this.addCurrentVertex(m,b||y,-1,-1,p,w);const e=m.dist(g)<=2*L&&"bevel"!==a,t=T.mult(D?1:-1);t._mult(M);const i=v.mult(D?-1:1),n=y.mult(D?-1:1),r=this.evaluateLineProgressFeatures(this.distance);if(null==w&&(this.addHalfVertex(m,t.x,t.y,!1,!D,0,p,r),e||this.addHalfVertex(m,t.x+2*n.x,t.y+2*n.y,!1,D,0,p,r)),"fakeround"===a){const e=Math.round(180*A/Math.PI/20);this.addHalfVertex(m,n.x,n.y,!1,D,0,p,r);for(let t=0;t<e;t++){let s=t/e;if(.5!==s){const e=s-.5;s+=s*e*(s-1)*((1.0904+S*(S*(3.55645-1.43519*S)-3.2452))*e*e+(.848013+S*(.215638*S-1.06021)))}const o=i.sub(n)._mult(s)._add(n)._unit();this.addHalfVertex(m,o.x,o.y,!1,D,0,p,r)}this.addHalfVertex(m,i.x,i.y,!1,D,0,p,r)}e||null!=w||this.addHalfVertex(m,t.x+2*i.x,t.y+2*i.y,!1,D,0,p,r),null!=w&&_&&this.addCurrentVertex(m,x||v,1,1,p,w)}else if("butt"===a)this.addCurrentVertex(m,T,0,0,p,w);else if("square"===a){if(!g){const e=c?0:-1;this.addCurrentVertex(m,T,e,e,p,w)}if(this.addCurrentVertex(m,T,0,0,p,w),g){const e=h?0:1;this.addCurrentVertex(m,T,e,e,p,w)}}else if("round"===a){if(g){const e=!i&&b?b:y;this.addCurrentVertex(m,e,0,0,p,w),!i&&h||this.addCurrentVertex(m,e,1,1,p,w,!0)}if(_){const e=!i&&x?x:v;!i&&c||this.addCurrentVertex(m,e,-1,-1,p,w,!0),this.addCurrentVertex(m,e,0,0,p,w)}}}}addVerticesTo(e,t,i,n,r,s,o,a,l,c){const h=(t.w-e.w)/this.tessellationStep|0;let d=0;const u=this.scaledDistance;if(h>1){this.lineSoFar=e.w;const u=(t.x-e.x)/h,f=(t.y-e.y)/h,p=(t.z-e.z)/h,m=(t.w-e.w)/h;for(let t=1;t<h;++t){e.x+=u,e.y+=f,e.z+=p,this.lineSoFar+=m,d+=m;const t=this.evaluateLineProgressFeatures(this.prevDistance+d);this.scaledDistance=(this.prevDistance+d)/this.totalDistance,this.addHalfVertex(e,i,n,c,!1,o,l,t),this.addHalfVertex(e,r,s,c,!0,-a,l,t)}}this.lineSoFar=t.w,this.scaledDistance=u;const f=this.evaluateLineProgressFeatures(this.distance);this.addHalfVertex(t,i,n,c,!1,o,l,f),this.addHalfVertex(t,r,s,c,!0,-a,l,f)}evaluateLineProgressFeatures(e){if(!this.variableWidthValue&&"offset"!==this.elevationType)return null;this.evaluationGlobals.lineProgress=0,this.lineClips?this.evaluationGlobals.lineProgress=Math.min(1,(this.totalFeatureLength*this.lineClips.start+e)/this.totalFeatureLength):We(`line-progress evaluation for ${this.layerIds[0]} requires enabling 'lineMetrics' for the source.`);let t=0;return this.variableWidthValue&&"constant"!==this.variableWidthValue.kind&&(t=this.variableWidthValue.evaluate(this.evaluationGlobals,this.lineFeature)||0),"offset"!==this.elevationType?{zOffset:0,variableWidth:t}:"constant"===this.zOffsetValue.kind?{zOffset:this.zOffsetValue.value,variableWidth:t}:{zOffset:this.zOffsetValue.evaluate(this.evaluationGlobals,this.lineFeature)||0,variableWidth:t}}addCurrentVertex(e,t,i,n,r,s,o=!1){const a=t.x+t.y*i,l=t.y-t.x*i,c=t.y*n-t.x,h=-t.y-t.x*n;if(null!=s){const t="offset"===this.elevationType,d=-10,u=8202,f=s.zOffset,p=new op(e.x,e.y,f,this.lineSoFar),m=!!t&&ag(e,d,u),g=this.lineSoFar,_=this.distance;if(this.currentVertex)if(m){const t=this.currentVertexIsOutside,s=this.currentVertex,m=new op(e.x,e.y,f,this.lineSoFar);if(lp(s,m,d,u),!ag(m,d,u)){if(t){this.e1=this.e2=-1,this.distance-=s.dist(p),this.lineSoFar=s.w;const e=this.evaluateLineProgressFeatures(s.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(s,a,l,o,!1,i,r,e),this.addHalfVertex(s,c,h,o,!0,-n,r,e),this.prevDistance=this.distance}this.distance=this.prevDistance+s.dist(m),this.scaledDistance=this.distance/this.totalDistance,this.addVerticesTo(s,m,a,l,c,h,i,n,r,o),this.distance=_,this.scaledDistance=this.distance/this.totalDistance}}else{const e=this.currentVertex;if(this.currentVertexIsOutside){lp(e,p,d,u),this.e1=this.e2=-1,this.distance-=e.dist(p),this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e.w;const t=this.evaluateLineProgressFeatures(e.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(e,a,l,o,!1,i,r,t),this.addHalfVertex(e,c,h,o,!0,-n,r,t),this.prevDistance=this.distance,this.distance=_,this.scaledDistance=this.distance/this.totalDistance}this.addVerticesTo(e,p,a,l,c,h,i,n,r,o)}else m||(this.addHalfVertex(e,a,l,o,!1,i,r,s),this.addHalfVertex(e,c,h,o,!0,-n,r,s));this.currentVertex=p,this.currentVertexIsOutside=m,this.lineSoFar=g}else this.addHalfVertex(e,a,l,o,!1,i,r,s),this.addHalfVertex(e,c,h,o,!0,-n,r,s)}addHalfVertex({x:e,y:t},i,n,r,s,o,a,l){if(this.patternJoinNone&&(0===this.segmentPoints.length&&(this.segmentStart=this.lineSoFar,this.segmentStartf32=Math.fround(this.lineSoFar)),s||this.segmentPoints.push(this.lineSoFar-this.segmentStart,o)),this.layoutVertexArray.emplaceBack((e<<1)+(r?1:0),(t<<1)+(s?1:0),Math.round(63*i)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1),0,this.lineSoFar-this.segmentStartf32),this.lineClips){const e=ci(this.lineClips.start,this.lineClips.end,this.scaledDistance);this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,e)}const c=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),a.primitiveLength++),s?this.e2=c:this.e1=c,null!=l&&this.zOffsetVertexArray.emplaceBack(l.zOffset,l.variableWidth,l.variableWidth)}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance}updateDistance(e,t){this.prevDistance=this.distance,this.distance+=e.dist(t),this.updateScaledDistance()}}function ag(e,t,i){return e.x<t||e.x>i||e.y<t||e.y>i}let lg,cg;function hg(e,t,i){return t*(Rn/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ)))}Ws(og,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const dg=(e,t,i)=>(1-i)*e+i*t;function ug(e,t){return 1/hg(e,1,t.tileZoom)}function fg(e,t,i,n){return e.translatePosMatrix(n||t.tileID.projMatrix,t,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}const pg=e=>{const t=[];mg(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const i=e.paint.get("line-trim-offset");0===i[0]&&0===i[1]||t.push("RENDER_LINE_TRIM_OFFSET"),0!==e.paint.get("line-border-width").constantOr(1)&&t.push("RENDER_LINE_BORDER");const n="none"===e.layout.get("line-join").constantOr("miter"),r=!!e.paint.get("line-pattern").constantOr(1);return n&&r&&t.push("LINE_JOIN_NONE"),t};function mg(e){const t=e.paint.get("line-dasharray").value;return t.value||"constant"!==t.kind}let gg;const _g=()=>gg||(gg={layout:lg||(lg=new Sa({"line-cap":new ba(Ta.layout_line["line-cap"]),"line-join":new ba(Ta.layout_line["line-join"]),"line-miter-limit":new xa(Ta.layout_line["line-miter-limit"]),"line-round-limit":new xa(Ta.layout_line["line-round-limit"]),"line-sort-key":new ba(Ta.layout_line["line-sort-key"]),"line-z-offset":new ba(Ta.layout_line["line-z-offset"]),"line-elevation-reference":new xa(Ta.layout_line["line-elevation-reference"]),"line-cross-slope":new xa(Ta.layout_line["line-cross-slope"]),visibility:new xa(Ta.layout_line.visibility),"line-width-unit":new xa(Ta.layout_line["line-width-unit"])})),paint:cg||(cg=new Sa({"line-opacity":new ba(Ta.paint_line["line-opacity"]),"line-color":new ba(Ta.paint_line["line-color"]),"line-translate":new xa(Ta.paint_line["line-translate"]),"line-translate-anchor":new xa(Ta.paint_line["line-translate-anchor"]),"line-width":new ba(Ta.paint_line["line-width"]),"line-gap-width":new ba(Ta.paint_line["line-gap-width"]),"line-offset":new ba(Ta.paint_line["line-offset"]),"line-blur":new ba(Ta.paint_line["line-blur"]),"line-dasharray":new ba(Ta.paint_line["line-dasharray"]),"line-pattern":new ba(Ta.paint_line["line-pattern"]),"line-pattern-cross-fade":new xa(Ta.paint_line["line-pattern-cross-fade"]),"line-gradient":new wa(Ta.paint_line["line-gradient"]),"line-trim-offset":new xa(Ta.paint_line["line-trim-offset"]),"line-trim-fade-range":new xa(Ta.paint_line["line-trim-fade-range"]),"line-trim-color":new xa(Ta.paint_line["line-trim-color"]),"line-emissive-strength":new xa(Ta.paint_line["line-emissive-strength"]),"line-border-width":new ba(Ta.paint_line["line-border-width"]),"line-border-color":new ba(Ta.paint_line["line-border-color"]),"line-occlusion-opacity":new xa(Ta.paint_line["line-occlusion-opacity"]),"line-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"line-gradient-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},gg);class yg extends ba{possiblyEvaluate(e,t){return t=new da(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition,worldview:t.worldview}),super.possiblyEvaluate(e,t)}evaluate(e,t,i,n){return t=Re({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,i,n)}}let vg;function xg(e,t){return t>0?t+2*e:e}const bg=Xa([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),wg=Xa([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),Sg=Xa([{name:"a_projected_pos",components:4,type:"Float32"}],4);Xa([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Tg=Xa([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),kg=Xa([{name:"a_x_axis",components:3,type:"Float32"},{name:"a_y_axis",components:3,type:"Float32"}]),Mg=Xa([{name:"a_texb",components:2,type:"Uint16"}]),Ag=Xa([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),Cg=Xa([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);Xa([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Dg=Xa([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Lg=Xa([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Xa([{name:"triangle",components:3,type:"Uint16"}]),Xa([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),Xa([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"},{type:"Uint16",name:"elevationFeatureIndex"}]),Xa([{type:"Float32",name:"offsetX"}]),Xa([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Eg=24;function Ig(e,t,i){return e.sections.forEach(e=>{e.text=function(e,t,i){const n=t.layout.get("text-transform").evaluate(i,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),ha.applyArabicShaping&&(e=ha.applyArabicShaping(e)),e}(e.text,t,i)}),e}const Pg={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function Rg(e){return"︶"===e||"﹈"===e||"︸"===e||"﹄"===e||"﹂"===e||"︾"===e||"︼"===e||"︺"===e||"︘"===e||"﹀"===e||"︐"===e||"︓"===e||"︔"===e||"`"===e||" ̄"===e||"︑"===e||"︒"===e}function Og(e){return"︵"===e||"﹇"===e||"︷"===e||"﹃"===e||"﹁"===e||"︽"===e||"︻"===e||"︹"===e||"︗"===e||"︿"===e}const zg=4294967296,Fg=1/zg,Ng="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");let Yg=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,i=this.length){for(;this.pos<i;){const i=this.readVarint(),n=i>>3,r=this.pos;this.type=7&i,e(n,t,this),this.pos===r&&this.skip(i)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*zg;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*zg;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf;let i,n;return n=t[this.pos++],i=127&n,n<128?i:(n=t[this.pos++],i|=(127&n)<<7,n<128?i:(n=t[this.pos++],i|=(127&n)<<14,n<128?i:(n=t[this.pos++],i|=(127&n)<<21,n<128?i:(n=t[this.pos],i|=(15&n)<<28,function(e,t,i){const n=i.buf;let r,s;if(s=n[i.pos++],r=(112&s)>>4,s<128)return Bg(e,r,t);if(s=n[i.pos++],r|=(127&s)<<3,s<128)return Bg(e,r,t);if(s=n[i.pos++],r|=(127&s)<<10,s<128)return Bg(e,r,t);if(s=n[i.pos++],r|=(127&s)<<17,s<128)return Bg(e,r,t);if(s=n[i.pos++],r|=(127&s)<<24,s<128)return Bg(e,r,t);if(s=n[i.pos++],r|=(1&s)<<31,s<128)return Bg(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(i,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return Boolean(this.readVarint())}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Ng?Ng.decode(this.buf.subarray(t,e)):function(e,t,i){let n="",r=t;for(;r<i;){const t=e[r];let s,o,a,l=null,c=t>239?4:t>223?3:t>191?2:1;if(r+c>i)break;1===c?t<128&&(l=t):2===c?(s=e[r+1],128==(192&s)&&(l=(31&t)<<6|63&s,l<=127&&(l=null))):3===c?(s=e[r+1],o=e[r+2],128==(192&s)&&128==(192&o)&&(l=(15&t)<<12|(63&s)<<6|63&o,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(s=e[r+1],o=e[r+2],a=e[r+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&t)<<18|(63&s)<<12|(63&o)<<6|63&a,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),r+=c}return n}(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}skip(e){const t=7&e;if(0===t)for(;this.buf[this.pos++]>127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else{if(1!==t)throw new Error(`Unimplemented type: ${t}`);this.pos+=8}}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){const e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.dataView=new DataView(e.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Fg),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Fg),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?function(e,t){let i,n;if(e>=0?(i=e%4294967296|0,n=e/4294967296|0):(i=~(-e%4294967296),n=~(-e/4294967296),4294967295^i?i=i+1|0:(i=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,i.buf[i.pos]=127&(e>>>=7)}(i,0,t),function(e,t){const i=(7&e)<<4;t.buf[t.pos++]|=i|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;const t=this.pos;this.pos=function(e,t,i){for(let n,r,s=0;s<t.length;s++){if(n=t.charCodeAt(s),n>55295&&n<57344){if(!r){n>56319||s+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):r=n;continue}if(n<56320){e[i++]=239,e[i++]=191,e[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(e[i++]=239,e[i++]=191,e[i++]=189,r=null);n<128?e[i++]=n:(n<2048?e[i++]=n>>6|192:(n<65536?e[i++]=n>>12|224:(e[i++]=n>>18|240,e[i++]=n>>12&63|128),e[i++]=n>>6&63|128),e[i++]=63&n|128)}return i}(this.buf,e,this.pos);const i=this.pos-t;i>=128&&Hg(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t);for(let i=0;i<t;i++)this.buf[this.pos++]=e[i]}writeRawMessage(e,t){this.pos++;const i=this.pos;e(t,this);const n=this.pos-i;n>=128&&Hg(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n}writeMessage(e,t,i){this.writeTag(e,2),this.writeRawMessage(t,i)}writePackedVarint(e,t){t.length&&this.writeMessage(e,jg,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,Vg,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,$g,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,Wg,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,Ug,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,Gg,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Xg,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,qg,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Zg,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}};function Bg(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Hg(e,t,i){const n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(n);for(let t=i.pos-1;t>=e;t--)i.buf[t+n]=i.buf[t]}function jg(e,t){for(let i=0;i<e.length;i++)t.writeVarint(e[i])}function Vg(e,t){for(let i=0;i<e.length;i++)t.writeSVarint(e[i])}function Wg(e,t){for(let i=0;i<e.length;i++)t.writeFloat(e[i])}function Ug(e,t){for(let i=0;i<e.length;i++)t.writeDouble(e[i])}function $g(e,t){for(let i=0;i<e.length;i++)t.writeBoolean(e[i])}function Gg(e,t){for(let i=0;i<e.length;i++)t.writeFixed32(e[i])}function Xg(e,t){for(let i=0;i<e.length;i++)t.writeSFixed32(e[i])}function qg(e,t){for(let i=0;i<e.length;i++)t.writeFixed64(e[i])}function Zg(e,t){for(let i=0;i<e.length;i++)t.writeSFixed64(e[i])}function Jg(e,t,i){t.glyphs=[],1===e&&i.readMessage(Kg,t)}function Kg(e,t,i){if(3===e){const{id:e,bitmap:n,width:r,height:s,left:o,top:a,advance:l}=i.readMessage(Qg,{});t.glyphs.push({id:e,bitmap:new Qd({width:r+6,height:s+6},n),metrics:{width:r,height:s,left:o,top:a,advance:l}})}else 4===e?t.ascender=i.readSVarint():5===e&&(t.descender=i.readSVarint())}function Qg(e,t,i){1===e?t.id=i.readVarint():2===e?t.bitmap=i.readBytes():3===e?t.width=i.readVarint():4===e?t.height=i.readVarint():5===e?t.left=i.readSVarint():6===e?t.top=i.readSVarint():7===e&&(t.advance=i.readVarint())}const e_={horizontal:1,vertical:2,horizontalOnly:3};class t_{constructor(){this.scale=1,this.fontStack="",this.image=null}static forText(e,t){const i=new t_;return i.scale=e||1,i.fontStack=t,i}static forImage(e){const t=new t_;return t.image=e,t}}class i_{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t,i){const n=new i_;for(let r=0;r<e.sections.length;r++){const s=e.sections[r];s.image?n.addImageSection(s,i):n.addTextSection(s,t)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCodePoint(e){return this.text.codePointAt(e)}verticalizePunctuation(e){this.text=function(e,t){let i="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n+1)||null,s=e.charCodeAt(n-1)||null;i+=!t&&(r&&Zo(r)&&!Pg[e[n+1]]||s&&Zo(s)&&!Pg[e[n-1]])||!Pg[e[n]]?e[n]:Pg[e[n]]}return i}(this.text,e)}trim(){let e=0;for(let t=0;t<this.text.length&&r_[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let i=this.text.length-1;i>=0&&i>=e&&r_[this.text.charCodeAt(i)];i--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const i=new i_;return i.text=this.text.substring(e,t),i.sectionIndex=this.sectionIndex.slice(e,t),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,t)=>Math.max(e,this.sections[t].scale),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(t_.forText(e.scale,e.fontStack||t));const i=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(i)}addImageSection(e,t){const i=e.image?e.image.getPrimary():null;if(!i)return void We("Can't add FormattedSection with an empty image.");i.scaleSelf(t);const n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCodePoint(n),this.sections.push(t_.forImage(i)),this.sectionIndex.push(this.sections.length-1)):We("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function n_(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m=1){const g=i_.fromFeature(e,r,m);d===e_.vertical&&g.verticalizePunctuation(u);let _=[];const y=function(e,t,i,n,r,s){if(!e)return[];const o=[],a=function(e,t,i,n,r,s){let o=0;for(let i=0;i<e.length();i++){const a=e.getSection(i);o+=o_(e.getCodePoint(i),a,n,r,t,s)}return o/Math.max(1,Math.ceil(o/i))}(e,t,i,n,r,s),l=e.text.indexOf("")>=0;let c=0;for(let i=0;i<e.length();i++){const d=e.getSection(i),u=e.getCodePoint(i);if(r_[u]||(c+=o_(u,d,n,r,t,s)),i<e.length()-1){const t=!((h=u)<11904||!(So(h)||xo(h)||Bo(h)||Fo(h)||Ao(h)||po(h)||To(h)||_o(h)||Co(h)||Lo(h)||Mo(h)||Vo(h)||yo(h)||go(h)||mo(h)||ko(h)||vo(h)||Yo(h)||Io(h)||Eo(h)));(s_[u]||t||d.image)&&o.push(c_(i+1,c,a,o,l_(u,e.getCodePoint(i+1),t&&l),!1))}}var h;return h_(c_(e.length(),c,a,o,0,!0))}(g,c,s,t,n,f),{processBidirectionalText:v,processStyledBidirectionalText:x}=ha;if(v&&1===g.sections.length){const e=v(g.toString(),y);for(const t of e){const e=new i_;e.text=t,e.sections=g.sections;for(let i=0;i<t.length;i++)e.sectionIndex.push(0);_.push(e)}}else if(x){const e=x(g.text,g.sectionIndex,y);for(const t of e){const e=new i_;e.text=t[0],e.sectionIndex=t[1],e.sections=g.sections,_.push(e)}}else _=function(e,t){const i=[],n=e.text;let r=0;for(const n of t)i.push(e.substring(r,n)),r=n;return r<n.length&&i.push(e.substring(r,n.length)),i}(g,y);const b=[],w={positionedLines:b,text:g.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:d,iconsInText:!1,verticalizable:!1,hasBaseline:!1};if(function(e,t,i,n,r,s,o,a,l,c,h,d){let u=0,f=0,p=0;const m="right"===a?1:"left"===a?0:.5;let g=!1;for(const e of r){const i=e.getSections();for(const e of i){if(e.image)continue;const i=t[e.fontStack];if(i&&(g=void 0!==i.ascender&&void 0!==i.descender,!g))break}if(!g)break}let _=0;for(const o of r){o.trim();const r=o.getMaxScale(),a=(r-1)*Eg,v={positionedGlyphs:[],lineOffset:0};e.positionedLines[_]=v;const x=v.positionedGlyphs;let b=0;if(!o.length()){f+=s,++_;continue}let w=0,S=0;for(let s=0;s<o.length();s++){const a=o.getSection(s),p=o.getSectionIndex(s),m=o.getCodePoint(s);let _=a.scale,v=null,T=null,k=null,M=Eg,A=0,C=l;C===e_.vertical&&(12312===(y=m)||12313===y||12316===y||12540===y||12448===y)&&(C=e_.horizontal);const D=!(C===e_.horizontal||!h&&!qo(m)||h&&(r_[m]||Jo(m)));if(a.image){const t=n.get(a.image.toString());if(!t)continue;k=a.image,e.iconsInText=e.iconsInText||!0,T=t.paddedRect;const i=t.displaySize;_=_*Eg/d,v={width:i[0],height:i[1],left:0,top:-3,advance:D?i[1]:i[0],localGlyph:!1},A=g?-v.height*_:r*Eg-17-i[1]*_,M=v.advance;const s=(D?i[0]:i[1])*_-Eg*r;s>0&&s>b&&(b=s)}else{const e=i[a.fontStack];if(!e)continue;e[m]&&(T=e[m]);const n=t[a.fontStack];if(!n)continue;const s=n.glyphs[m];if(!s)continue;if(v=s.metrics,M=8203!==m?Eg:0,g){const e=void 0!==n.ascender?Math.abs(n.ascender):0,t=void 0!==n.descender?Math.abs(n.descender):0,i=(e+t)*_;w<i&&(w=i,S=(e-t)/2*_),A=-e*_}else A=(r-_)*Eg-17}D?(e.verticalizable=!0,x.push({glyph:m,image:k,x:u,y:f+A,vertical:D,scale:_,localGlyph:v.localGlyph,fontStack:a.fontStack,sectionIndex:p,metrics:v,rect:T}),u+=M*_+c):(x.push({glyph:m,image:k,x:u,y:f+A,vertical:D,scale:_,localGlyph:v.localGlyph,fontStack:a.fontStack,sectionIndex:p,metrics:v,rect:T}),u+=v.advance*_+c)}0!==x.length&&(p=Math.max(u-c,p),g?u_(x,m,b,S,s*r/2):u_(x,m,b,0,s/2)),u=0;const T=s*r+b;v.lineOffset=Math.max(b,a),f+=T,++_}var y;const v=f,{horizontalAlign:x,verticalAlign:b}=d_(o);(function(e,t,i,n,r,s){const o=(t-i)*r,a=-s*n;for(const t of e)for(const e of t.positionedGlyphs)e.x+=o,e.y+=a})(e.positionedLines,m,x,b,p,v),e.top+=-b*v,e.bottom=e.top+v,e.left+=-x*p,e.right=e.left+p,e.hasBaseline=g}(w,t,i,n,_,o,a,l,d,c,u,p),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(b))return w}const r_={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},s_={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function o_(e,t,i,n,r,s){if(t.image){const e=n.get(t.image.toString());return e?e.displaySize[0]*t.scale*Eg/s+r:0}{const n=i[t.fontStack],s=n&&n.glyphs[e];return s?s.metrics.advance*t.scale+r:0}}function a_(e,t,i,n){const r=Math.pow(e-t,2);return n?e<t?r/2:2*r:r+Math.abs(i)*i}function l_(e,t,i){let n=0;return 10===e&&(n-=1e4),i&&(n+=150),40!==e&&65288!==e||(n+=50),41!==t&&65289!==t||(n+=50),n}function c_(e,t,i,n,r,s){let o=null,a=a_(t,i,r,s);for(const e of n){const n=a_(t-e.x,i,r,s)+e.badness;n<=a&&(o=e,a=n)}return{index:e,x:t,priorBreak:o,badness:a}}function h_(e){return e?h_(e.priorBreak).concat(e.index):[]}function d_(e){let t=.5,i=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:t,verticalAlign:i}}function u_(e,t,i,n,r){if(!(t||i||n||r))return;const s=e.length-1,o=e[s],a=(o.x+o.metrics.advance*o.scale)*t;for(let t=0;t<=s;t++)e[t].x-=a,e[t].y+=i+n+r}function f_(e){return void 0!==e.imagePrimary&&void 0!==e.top&&void 0!==e.bottom&&void 0!==e.left&&void 0!==e.right}function p_(e,t,i,n){const{horizontalAlign:r,verticalAlign:s}=d_(n),o=i[0]-e.displaySize[0]*r,a=i[1]-e.displaySize[1]*s;return{imagePrimary:e,imageSecondary:t,top:a,bottom:a+e.displaySize[1],left:o,right:o+e.displaySize[0]}}function m_(e,t,i,n,r,s){const o=e.imagePrimary;let a;if(o.content){const e=o.content,t=o.pixelRatio||1;a=[e[0]/t,e[1]/t,o.displaySize[0]-e[2]/t,o.displaySize[1]-e[3]/t]}const l=t.left*s,c=t.right*s;let h,d,u,f;"width"===i||"both"===i?(f=r[0]+l-n[3],d=r[0]+c+n[1]):(f=r[0]+(l+c-o.displaySize[0])/2,d=f+o.displaySize[0]);const p=t.top*s,m=t.bottom*s;return"height"===i||"both"===i?(h=r[1]+p-n[0],u=r[1]+m+n[2]):(h=r[1]+(p+m-o.displaySize[1])/2,u=h+o.displaySize[1]),{imagePrimary:o,imageSecondary:void 0,top:h,right:d,bottom:u,left:f,collisionPadding:a}}function g_(e){return!e.imagePrimary.stretchX}function __(e){return!e.imagePrimary.stretchY}function y_(e){return{width:e.right-e.left,height:e.bottom-e.top}}const v_=128;function x_(e,t,i){const{expression:n}=t;if("constant"===n.kind)return{kind:"constant",layoutSize:n.evaluate(new da(e+1,{worldview:i}))};if("source"===n.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:r}=n;let s=0;for(;s<t.length&&t[s]<=e;)s++;s=Math.max(0,s-1);let o=s;for(;o<t.length&&t[o]<e+1;)o++;o=Math.min(t.length-1,o);const a=t[s],l=t[o];return"composite"===n.kind?{kind:"composite",minZoom:a,maxZoom:l,interpolationType:r}:{kind:"camera",minZoom:a,maxZoom:l,minSize:n.evaluate(new da(a,{worldview:i})),maxSize:n.evaluate(new da(l,{worldview:i})),interpolationType:r}}}function b_(e,{uSize:t,uSizeT:i},{lowerSize:n,upperSize:r}){return"source"===e.kind?n/v_:"composite"===e.kind?ci(n/v_,r/v_,i):t}function w_(e,t,i=1){let n=0,r=0;if("constant"===e.kind)r=e.layoutSize*i;else if("source"!==e.kind){const{interpolationType:s,minZoom:o,maxZoom:a}=e,l=s?Le(Br.interpolationFactor(s,t,o,a),0,1):0;"camera"===e.kind?r=ci(e.minSize,e.maxSize,l)*i:n=l*i}return{uSizeT:n,uSize:r}}class S_ extends xe{constructor(e,t,i,n,r){super(e,t),this.angle=n,this.z=i,void 0!==r&&(this.segment=r)}clone(){return new S_(this.x,this.y,this.z,this.angle,this.segment)}}function T_(e,t,i,n,r){if(void 0===t.segment)return!0;let s=t,o=t.segment+1,a=0;for(;a>-i/2;){if(o--,o<0)return!1;a-=e[o].dist(s),s=e[o]}a+=e[o].dist(e[o+1]),o++;const l=[];let c=0;for(;a<i/2;){const t=e[o],i=e[o+1];if(!i)return!1;let s=e[o-1].angleTo(t)-t.angleTo(i);for(s=Math.abs((s+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:s}),c+=s;a-l[0].distance>n;)c-=l.shift().angleDelta;if(c>r)return!1;o++,a+=t.dist(i)}return!0}function k_(e){let t=0;for(let i=0;i<e.length-1;i++)t+=e[i].dist(e[i+1]);return t}function M_(e,t,i){return e?.6*t*i:0}function A_(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function C_(e,t,i,n,r,s){const o=M_(i,r,s),a=A_(i,n)*s;let l=0;const c=k_(e)/2;for(let i=0;i<e.length-1;i++){const n=e[i],r=e[i+1],s=n.dist(r);if(l+s>c){const h=(c-l)/s,d=ci(n.x,r.x,h),u=ci(n.y,r.y,h),f=new S_(d,u,0,r.angleTo(n),i);return!o||T_(e,f,a,o,t)?f:void 0}l+=s}}function D_(e,t,i,n,r,s,o,a,l){const c=M_(n,s,o),h=A_(n,r),d=h*o,u=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-d<t/4&&(t=d+t/4),L_(e,u?t/2*a%t:(h/2+2*s)*o*a%t,t,c,i,d,u,!1,l)}function L_(e,t,i,n,r,s,o,a,l){const c=s/2,h=k_(e);let d=0,u=t-i,f=[];for(let t=0;t<e.length-1;t++){const o=e[t],a=e[t+1],p=o.dist(a),m=a.angleTo(o);for(;u+i<d+p;){u+=i;const g=(u-d)/p,_=ci(o.x,a.x,g),y=ci(o.y,a.y,g);if(_>=0&&_<l&&y>=0&&y<l&&u-c>=0&&u+c<=h){const i=new S_(_,y,0,m,t);n&&!T_(e,i,s,n,r)||f.push(i)}}d+=p}return a||f.length||o||(f=L_(e,d/2,i,n,r,s,o,!0,l)),f}function E_(e){let t=0,i=0;for(const n of e)t+=n.w*n.h,i=Math.max(i,n.w);e.sort((e,t)=>t.h-e.h);const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let r=0,s=0;for(const t of e)for(let e=n.length-1;e>=0;e--){const i=n[e];if(!(t.w>i.w||t.h>i.h)){if(t.x=i.x,t.y=i.y,s=Math.max(s,t.y+t.h),r=Math.max(r,t.x+t.w),t.w===i.w&&t.h===i.h){const t=n.pop();t&&e<n.length&&(n[e]=t)}else t.h===i.h?(i.x+=t.w,i.w-=t.w):t.w===i.w?(i.y+=t.h,i.h-=t.h):(n.push({x:i.x+t.w,y:i.y,w:i.w-t.w,h:t.h}),i.y+=t.h,i.h-=t.h);break}}return{w:r,h:s,fill:t/(r*s)||0}}Ws(S_,"Anchor");class I_{static getImagePositionScale(e,t,i){if(t&&e&&e.options&&e.options.transform){const t=e.options.transform;return{x:t.a,y:t.d}}return{x:i,y:i}}constructor(e,t,i,n){this.paddedRect=e;const{pixelRatio:r,version:s,stretchX:o,stretchY:a,content:l,sdf:c,usvg:h}=t;this.pixelRatio=r,this.stretchX=o,this.stretchY=a,this.content=l,this.version=s,this.padding=i,this.sdf=c,this.usvg=h,this.scale=I_.getImagePositionScale(n,h,r)}get tl(){return[this.paddedRect.x+this.padding,this.paddedRect.y+this.padding]}get br(){return[this.paddedRect.x+this.paddedRect.w-this.padding,this.paddedRect.y+this.paddedRect.h-this.padding]}get displaySize(){return[(this.paddedRect.w-2*this.padding)/this.scale.x,(this.paddedRect.h-2*this.padding)/this.scale.y]}}function P_(e,t,i){const n=Oi.parse(e),r=function(e,t,i=[1,1]){return{x:0,y:0,w:(e.data?e.data.width:e.width*i[0])+2*t,h:(e.data?e.data.height:e.height*i[1])+2*t}}(t,i,[n.options.transform.a,n.options.transform.d]);return{bin:r,imagePosition:new I_(r,t,i,n),imageVariant:n}}class R_{constructor(e,t,i){const n=new Map,r=new Map;this.haveRenderCallbacks=[];const s=[];this.addImages(e,n,1,s),this.addImages(t,r,2,s);const{w:o,h:a}=E_(s),l=new eu({width:o||1,height:a||1});for(const[t,r]of e.entries()){const e=n.get(t).paddedRect;eu.copy(r.data,l,{x:0,y:0},{x:e.x+1,y:e.y+1},r.data,i,r.sdf)}for(const[e,n]of t.entries()){const t=r.get(e),s=t.paddedRect;let o=t.padding;const a=s.x+o,c=s.y+o,h=n.data.width,d=n.data.height;o=o>1?o-1:o,eu.copy(n.data,l,{x:0,y:0},{x:a,y:c},n.data,i),eu.copy(n.data,l,{x:0,y:d-o},{x:a,y:c-o},{width:h,height:o},i),eu.copy(n.data,l,{x:0,y:0},{x:a,y:c+d},{width:h,height:o},i),eu.copy(n.data,l,{x:h-o,y:0},{x:a-o,y:c},{width:o,height:d},i),eu.copy(n.data,l,{x:0,y:0},{x:a+h,y:c},{width:o,height:d},i),eu.copy(n.data,l,{x:h-o,y:d-o},{x:a-o,y:c-o},{width:o,height:o},i),eu.copy(n.data,l,{x:0,y:d-o},{x:a+h,y:c-o},{width:o,height:o},i),eu.copy(n.data,l,{x:0,y:0},{x:a+h,y:c+d},{width:o,height:o},i),eu.copy(n.data,l,{x:h-o,y:0},{x:a-o,y:c+d},{width:o,height:o},i)}this.lut=i,this.image=l,this.iconPositions=n,this.patternPositions=r}addImages(e,t,i,n){for(const[r,s]of e.entries()){const{bin:e,imagePosition:o,imageVariant:a}=P_(r,s,i);t.set(r,o),n.push(e),s.hasRenderCallback&&this.haveRenderCallbacks.push(a.id)}}patchUpdatedImages(e,t,i){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(t=>e.hasImage(t,i)),e.dispatchRenderCallbacks(this.haveRenderCallbacks,i);for(const n of e.getUpdatedImages(i)){for(const r of this.iconPositions.keys()){const s=Oi.parse(r);if(ti.isEqual(s.id,n)){const s=e.getImage(n,i);this.patchUpdatedImage(this.iconPositions.get(r),s,t)}}for(const r of this.patternPositions.keys()){const s=Oi.parse(r);if(ti.isEqual(s.id,n)){const s=e.getImage(n,i);this.patchUpdatedImage(this.patternPositions.get(r),s,t)}}}}patchUpdatedImage(e,t,i){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[n,r]=e.tl,s=e.sdf;if(this.lut||s){const e={width:t.data.width,height:t.data.height},o=new eu(e);eu.copy(t.data,o,{x:0,y:0},{x:0,y:0},e,this.lut,s),i.update(o,{position:{x:n,y:r}})}else i.update(t.data,{position:{x:n,y:r}})}}Ws(I_,"ImagePosition"),Ws(R_,"ImageAtlas");const O_=1e20;function z_(e,t,i,n,r,s,o,a,l){for(let c=t;c<t+n;c++)F_(e,i*s+c,s,r,o,a,l);for(let c=i;c<i+r;c++)F_(e,c*s+t,1,n,o,a,l)}function F_(e,t,i,n,r,s,o){s[0]=0,o[0]=-O_,o[1]=O_,r[0]=e[t];for(let a=1,l=0,c=0;a<n;a++){r[a]=e[t+a*i];const n=a*a;do{const e=s[l];c=(r[a]-r[e]+n-e*e)/(a-e)/2}while(c<=o[l]&&--l>-1);l++,s[l]=a,o[l]=c,o[l+1]=O_}for(let a=0,l=0;a<n;a++){for(;o[l+1]<a;)l++;const n=s[l],c=a-n;e[t+a*i]=r[n]+c*c}}const N_={none:0,ideographs:1,all:2};class Y_{constructor(e,t,i){this.requestManager=e,this.localGlyphMode=t,this.localFontFamily=i,this.url="",this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e){this.url=e}getGlyphs(e,t){const i=[],n=this.url||nt.GLYPHS_URL;for(const t in e)for(const n of e[t])i.push({stack:t,id:n});Pe(i,({stack:e,id:t},i)=>{let r=this.entries[e];r||(r=this.entries[e]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let s=r.glyphs[t];if(void 0!==s)return void i(null,{stack:e,id:t,glyph:s});if(s=this._tinySDF(r,e,t),s)return r.glyphs[t]=s,void i(null,{stack:e,id:t,glyph:s});const o=Math.floor(t/256);if(256*o>65535)return We("glyphs > 65535 not supported"),void i(null,{stack:e,id:t,glyph:s});if(r.ranges[o])return void i(null,{stack:e,id:t,glyph:s});let a=r.requests[o];a||(a=r.requests[o]=[],Y_.loadGlyphRange(e,o,n,this.requestManager,(e,t)=>{if(t){r.ascender=t.ascender,r.descender=t.descender;for(const e in t.glyphs)this._doesCharSupportLocalGlyph(+e)||(r.glyphs[+e]=t.glyphs[+e]);r.ranges[o]=!0}for(const i of a)i(e,t);delete r.requests[o]})),a.push((n,r)=>{n?i(n):r&&i(null,{stack:e,id:t,glyph:r.glyphs[t]||null})})},(e,i)=>{if(e)t(e);else if(i){const e={};for(const{stack:t,id:n,glyph:r}of i)void 0===e[t]&&(e[t]={}),void 0===e[t].glyphs&&(e[t].glyphs={}),e[t].glyphs[n]=r&&{id:r.id,bitmap:r.bitmap.clone(),metrics:r.metrics},e[t].ascender=this.entries[t].ascender,e[t].descender=this.entries[t].descender;t(null,e)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==N_.none&&(this.localGlyphMode===N_.all?!!this.localFontFamily:!!this.localFontFamily&&(Lo(e)||Ro(e)||yo(e)||vo(e)||_o(e)||Co(e)||Uo(e)||Wo(e)))}_tinySDF(e,t,i){const n=this.localFontFamily;if(!n||!this._doesCharSupportLocalGlyph(i))return;let r=e.tinySDF;if(!r){let i="400";/bold/i.test(t)?i="900":/medium/i.test(t)?i="500":/light/i.test(t)&&(i="200"),r=e.tinySDF=new Y_.TinySDF({fontFamily:n,fontWeight:i,fontSize:48,buffer:6,radius:16}),r.fontWeight=i}if(this.localGlyphs[r.fontWeight][i])return this.localGlyphs[r.fontWeight][i];const s=String.fromCodePoint(i),{data:o,width:a,height:l,glyphWidth:c,glyphHeight:h,glyphLeft:d,glyphTop:u,glyphAdvance:f}=r.draw(s);return this.localGlyphs[r.fontWeight][i]={id:i,bitmap:new Qd({width:a,height:l},o),metrics:{width:c/2,height:h/2,left:d/2,top:u/2-27,advance:f/2,localGlyph:!0}}}}Y_.loadGlyphRange=function(e,t,i,n,r){const s=256*t,o=s+255,a=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",`${s}-${o}`),It.Glyphs);zt(a,(e,t)=>{if(e)r(e);else if(t){const e={},i=function(e){return new Yg(e).readFields(Jg,{})}(t);for(const t of i.glyphs)e[t.id]=t;r(null,{glyphs:e,ascender:i.ascender,descender:i.descender})}})},Y_.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:i=8,cutoff:n=.25,fontFamily:r="sans-serif",fontWeight:s="normal",fontStyle:o="normal"}={}){this.buffer=t,this.cutoff=n,this.radius=i;const a=this.size=e+4*t,l=this._createCanvas(a),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${o} ${s} ${e}px ${r}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:r,actualBoundingBoxRight:s}=this.ctx.measureText(e),o=Math.ceil(i),a=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(s-r))),l=Math.min(this.size-this.buffer,o+Math.ceil(n)),c=a+2*this.buffer,h=l+2*this.buffer,d=Math.max(c*h,0),u=new Uint8ClampedArray(d),f={data:u,width:c,height:h,glyphWidth:a,glyphHeight:l,glyphTop:o,glyphLeft:0,glyphAdvance:t};if(0===a||0===l)return f;const{ctx:p,buffer:m,gridInner:g,gridOuter:_}=this;p.clearRect(m,m,a,l),p.fillText(e,m,m+o);const y=p.getImageData(m,m,a,l);_.fill(O_,0,d),g.fill(0,0,d);for(let e=0;e<l;e++)for(let t=0;t<a;t++){const i=y.data[4*(e*a+t)+3]/255;if(0===i)continue;const n=(e+m)*c+t+m;if(1===i)_[n]=0,g[n]=O_;else{const e=.5-i;_[n]=e>0?e*e:0,g[n]=e<0?e*e:0}}z_(_,0,0,c,h,c,this.f,this.v,this.z),z_(g,m,m,a,l,c,this.f,this.v,this.z);for(let e=0;e<d;e++){const t=Math.sqrt(_[e])-Math.sqrt(g[e]);u[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return f}};function B_(e,t){return e+t[1]-t[0]}function H_(e,t,i,n,r=1){const s=[],o=e.imagePrimary,a=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,h=(e.right-e.left)*r,d=(e.bottom-e.top)*r,u=o.stretchX||[[0,l]],f=o.stretchY||[[0,c]],p=u.reduce(B_,0),m=f.reduce(B_,0),g=l-p,_=c-m;let y=0,v=p,x=0,b=m,w=0,S=g,T=0,k=_;if(o.content&&n){const e=o.content;y=j_(u,0,e[0]),x=j_(f,0,e[1]),v=j_(u,e[0],e[2]),b=j_(f,e[1],e[3]),w=e[0]-y,T=e[1]-x,S=e[2]-e[0]-v,k=e[3]-e[1]-b}const M=(n,s,l,c)=>{const u=W_(n.stretch-y,v,h,e.left*r),f=U_(n.fixed-w,S,n.stretch,p),g=W_(s.stretch-x,b,d,e.top*r),_=U_(s.fixed-T,k,s.stretch,m),M=W_(l.stretch-y,v,h,e.left*r),A=U_(l.fixed-w,S,l.stretch,p),C=W_(c.stretch-x,b,d,e.top*r),D=U_(c.fixed-T,k,c.stretch,m),L=new xe(u,g),E=new xe(M,g),I=new xe(M,C),P=new xe(u,C),R=new xe(f/a,_/a),O=new xe(A/a,D/a),z=t*Math.PI/180;if(z){const e=Math.sin(z),t=Math.cos(z),i=[t,-e,e,t];L._matMult(i),E._matMult(i),P._matMult(i),I._matMult(i)}const F=n.stretch+n.fixed,N=l.stretch+l.fixed,Y=s.stretch+s.fixed,B=c.stretch+c.fixed,H=e.imageSecondary;return{tl:L,tr:E,bl:P,br:I,texPrimary:{x:o.paddedRect.x+1+F,y:o.paddedRect.y+1+Y,w:N-F,h:B-Y},texSecondary:H?{x:H.paddedRect.x+1+F,y:H.paddedRect.y+1+Y,w:N-F,h:B-Y}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:O,minFontScaleX:S/a/h,minFontScaleY:k/a/d,isSDF:i}};if(n&&(o.stretchX||o.stretchY)){const e=V_(u,g,p),t=V_(f,_,m);for(let i=0;i<e.length-1;i++){const n=e[i],r=e[i+1];for(let e=0;e<t.length-1;e++)s.push(M(n,t[e],r,t[e+1]))}}else s.push(M({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return s}function j_(e,t,i){let n=0;for(const r of e)n+=Math.max(t,Math.min(i,r[1]))-Math.max(t,Math.min(i,r[0]));return n}function V_(e,t,i){const n=[{fixed:-1,stretch:0}];for(const[t,i]of e){const e=n[n.length-1];n.push({fixed:t-e.stretch,stretch:e.stretch}),n.push({fixed:t-e.stretch,stretch:e.stretch+(i-t)})}return n.push({fixed:t+1,stretch:i}),n}function W_(e,t,i,n){return e/t*i+n}function U_(e,t,i,n){return e-t*i/n}function $_(e,t,i,n){const r=t+e.positionedLines[n].lineOffset;return 0===n?i+r/2:i+(r+(t+e.positionedLines[n-1].lineOffset))/2}function G_(e,t=1,i=!1){let n=1/0,r=1/0,s=-1/0,o=-1/0;const a=e[0];for(let e=0;e<a.length;e++){const t=a[e];(!e||t.x<n)&&(n=t.x),(!e||t.y<r)&&(r=t.y),(!e||t.x>s)&&(s=t.x),(!e||t.y>o)&&(o=t.y)}const l=Math.min(s-n,o-r);let c=l/2;const h=new Pn([],X_);if(0===l)return new xe(n,r);for(let t=n;t<s;t+=l)for(let i=r;i<o;i+=l)h.push(new q_(t+c,i+c,c,e));let d=function(e){let t=0,i=0,n=0;const r=e[0];for(let e=0,s=r.length,o=s-1;e<s;o=e++){const s=r[e],a=r[o],l=s.x*a.y-a.x*s.y;i+=(s.x+a.x)*l,n+=(s.y+a.y)*l,t+=3*l}return new q_(i/t,n/t,0,e)}(e),u=h.length;for(;h.length;){const n=h.pop();(n.d>d.d||!d.d)&&(d=n,i&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,u)),n.max-d.d<=t||(c=n.h/2,h.push(new q_(n.p.x-c,n.p.y-c,c,e)),h.push(new q_(n.p.x+c,n.p.y-c,c,e)),h.push(new q_(n.p.x-c,n.p.y+c,c,e)),h.push(new q_(n.p.x+c,n.p.y+c,c,e)),u+=4)}return i&&(console.log(`num probes: ${u}`),console.log(`best distance: ${d.d}`)),d.p}function X_(e,t){return t.max-e.max}class q_{constructor(e,t,i,n){this.p=new xe(e,t),this.h=i,this.d=function(e,t){let i=!1,n=1/0;for(let r=0;r<t.length;r++){const s=t[r];for(let t=0,r=s.length,o=r-1;t<r;o=t++){const r=s[t],a=s[o];r.y>e.y!=a.y>e.y&&e.x<(a.x-r.x)*(e.y-r.y)/(a.y-r.y)+r.x&&(i=!i),n=Math.min(n,Wh(e,r,a))}}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}}const Z_=Object.keys,J_=Number.POSITIVE_INFINITY,K_=Math.sqrt(2);function Q_(e,[t,i]){let n=0,r=0;if(i===J_){t<0&&(t=0);const i=t/K_;switch(e){case"top-right":case"top-left":r=i-7;break;case"bottom-right":case"bottom-left":r=7-i;break;case"bottom":r=7-t;break;case"top":r=t-7}switch(e){case"top-right":case"bottom-right":n=-i;break;case"top-left":case"bottom-left":n=i;break;case"left":n=t;break;case"right":n=-t}}else{switch(t=Math.abs(t),i=Math.abs(i),e){case"top-right":case"top-left":case"top":r=i-7;break;case"bottom-right":case"bottom-left":case"bottom":r=7-i}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}}return[n,r]}function ey(e,t,i,n,r,s,o,a,l){if(!t||!t.usvg)return;const c=y_(n),h=y_(r),d="both"!==s&&"width"!==s||!g_(n)?1:h.width/c.width,u="both"!==s&&"height"!==s||!__(n)?1:h.height/c.height;i.scaleSelf(d,u);const f=i.toString();o.set(f,i),a.set(f,t);const{imagePosition:p}=P_(f,t,1);l.set(f,p)}function ty(e,t,i,n,r,s,o,a,l){if(!e)return;const c=function(e,t,i,n,r,s){if("camera"===e.kind)return e.maxSize;if("composite"===e.kind){const n=t.possiblyEvaluate(new da(e.maxZoom,{worldview:s}),i).evaluate(r,{},i),o=t.possiblyEvaluate(new da(e.minZoom,{worldview:s}),i).evaluate(r,{},i);return Math.max(n,o)}return t.possiblyEvaluate(new da(n,{worldview:s})).evaluate(r,{},i)}(t,i,n,r,s,l);return e.scaleSelf(c*a*o)}function iy(e,t,i,n,r,s,o,a,l){return{iconPrimary:ty(e.getPrimary(),t,i,n,r,s,o,a,l),iconSecondary:ty(e.getSecondary(),t,i,n,r,s,o,a,l)}}function ny(e,t,i){if(!t)return;const n=i.get(e.toString()),r=i.get(t.toString());r&&(n.paddedRect.w===r.paddedRect.w&&n.paddedRect.h===r.paddedRect.h||We(`Mismatch in icon variant sizes: ${e.toString()} and ${t.toString()}`),n.usvg!==r.usvg&&We(`Mismatch in icon variant image types: ${e.id} and ${t.id}`))}function ry(e,t,i,n){if(!e)return;const r=t.get(i.toString());if(e.imagePrimary=r,n){const i=t.get(n.toString());e.imageSecondary=i}}function sy(e,t){for(const i in e.horizontal)oy(e.horizontal[i],t);oy(e.vertical,t)}function oy(e,t){if(e)for(const i of e.positionedLines)for(const e of i.positionedGlyphs)if(null!==e.image){const i=e.image.toString();e.rect=t.get(i).paddedRect}}function ay(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function ly(e,t,i,n,r,s,o,a,l){const c=fy(s.horizontal)||s.vertical,h=i.get("icon-text-fit-padding").evaluate(n,{},r);let d,u=t;return t&&"none"!==l&&(e.allowVerticalPlacement&&s.vertical&&(d=m_(t,s.vertical,l,h,a,o)),c&&(u=m_(t,c,l,h,a,o))),{defaultShapedIcon:u,verticallyShapedIcon:d}}function cy(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v){let x=o.textMaxSize.evaluate(t,{},u);void 0===x?x=a*o.textScaleFactor:x*=o.textScaleFactor;const b=e.layers[0].layout,w=fy(i.horizontal)||i.vertical,S="globe"===f.name,T=e.tilePixelRatio*x/24,k=(E=e.overscaling,e.zoom>18&&E>2&&(E>>=1),Math.max(Rn/(512*E),1)*b.get("symbol-spacing")),M=b.get("text-padding")*e.tilePixelRatio,A=b.get("icon-padding")*e.tilePixelRatio,C=Te(b.get("text-max-angle")),D="map"===b.get("icon-rotation-alignment")&&"point"!==v,L=k/2;var E;!1===e.hasAnyIconTextFit&&"none"!==g&&(e.hasAnyIconTextFit=!0);const I=t.properties?+t.properties[ph]:null,P=I&&e.elevationFeatureIdToIndex?e.elevationFeatureIdToIndex.get(I):65535,R=(a,l,v)=>{if(l.x<0||l.x>=Rn||l.y<0||l.y>=Rn)return;let x=null;if(S){const{x:e,y:t,z:i}=f.projectTilePoint(l.x,l.y,v);x={anchor:new S_(e,t,i,0,void 0),up:f.upVector(v,l.x,l.y)}}!function(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x,b,w,S,T,k,M,A,C){const D=e.addToLineVertexArray(t,n);let L,E,I,P,R,O,z,F=0,N=0,Y=0,B=0,H=-1,j=-1;const V={};let W=qt("");const U=i?i.anchor:t,$="none"!==A;let G=0,X=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")){const e=l.layout.get("text-offset").evaluate(x,{},T);G=e[0]*Eg,X=e[1]*Eg}else G=l.layout.get("text-radial-offset").evaluate(x,{},T)*Eg,X=J_;if(e.allowVerticalPlacement&&r.vertical){const e=r.vertical;if(p)O=my(e),a&&(z=my(a));else{const i=l.layout.get("text-rotate").evaluate(x,{},T)+90;I=py(c,U,t,h,d,u,e,f,i,m),a&&(P=py(c,U,t,h,d,u,a,_,i))}}if(s){const n=e.iconSizeData,r=l.layout.get("icon-rotate").evaluate(x,{},T),o=H_(s,r,w,$,b.iconScaleFactor),f=a?H_(a,r,w,$,b.iconScaleFactor):void 0;E=py(c,U,t,h,d,u,s,_,r,null),F=4*o.length;let p=null;"source"===n.kind?(p=[v_*l.layout.get("icon-size").evaluate(x,{},T)*b.iconScaleFactor],p[0]>dy&&We(`${e.layerIds[0]}: Value for "icon-size" is >= ${hy}. Reduce your "icon-size".`)):"composite"===n.kind&&(p=[v_*b.compositeIconSizes[0].evaluate(x,{},T)*b.iconScaleFactor,v_*b.compositeIconSizes[1].evaluate(x,{},T)*b.iconScaleFactor],(p[0]>dy||p[1]>dy)&&We(`${e.layerIds[0]}: Value for "icon-size" is >= ${hy}. Reduce your "icon-size".`)),e.addSymbols(e.icon,o,p,v,y,x,void 0,i,t,D.lineStartIndex,D.lineLength,-1,S,T,k,M),H=e.icon.placedSymbolArray.length-1,f&&(N=4*f.length,e.addSymbols(e.icon,f,p,v,y,x,e_.vertical,i,t,D.lineStartIndex,D.lineLength,-1,S,T,k,M),j=e.icon.placedSymbolArray.length-1)}for(const n in r.horizontal){const s=n,a=r.horizontal[s];L||(W=qt(a.text),p?R=my(a):L=py(c,U,t,h,d,u,a,f,l.layout.get("text-rotate").evaluate(x,{},T),m));const g=1===a.positionedLines.length;if(Y+=uy(e,i,t,a,o,l,p,x,m,D,r.vertical?e_.horizontal:e_.horizontalOnly,g?Z_(r.horizontal):[s],V,H,b,S,T,k),g)break}r.vertical&&(B+=uy(e,i,t,r.vertical,o,l,p,x,m,D,e_.vertical,["vertical"],V,j,b,S,T,k));let q=-1;const Z=(e,t)=>e?Math.max(e,t):t;q=Z(R,q),q=Z(O,q),q=Z(z,q);const J=q>-1?1:0;e.glyphOffsetArray.length>=65535&&We("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,x.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,U.x,U.y,U.z,V.right>=0?V.right:-1,V.center>=0?V.center:-1,V.left>=0?V.left:-1,V.vertical>=0?V.vertical:-1,H,j,W,void 0!==L?L:e.collisionBoxArray.length,void 0!==L?L+1:e.collisionBoxArray.length,void 0!==I?I:e.collisionBoxArray.length,void 0!==I?I+1:e.collisionBoxArray.length,void 0!==E?E:e.collisionBoxArray.length,void 0!==E?E+1:e.collisionBoxArray.length,P||e.collisionBoxArray.length,P?P+1:e.collisionBoxArray.length,h,Y,B,F,N,J,0,G,X,q,0,$?1:0,C)}(e,l,x,a,i,n,s,r,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,M,y,c,0,A,D,_,t,o,h,d,u,p,m,g,P)};if("line"===v)for(const r of cp(t.geometry,0,0,Rn,Rn)){const t=D_(r,k,C,i.vertical||w,n,24,T,e.overscaling,Rn);for(const i of t)w&&gy(e,w.text,L,i)||R(r,i,u)}else if("line-center"===v){for(const e of t.geometry)if(e.length>1){const t=C_(e,C,i.vertical||w,n,24,T);t&&R(e,t,u)}}else if("Polygon"===t.type)for(const e of Pu(t.geometry,0)){const t=G_(e,16);R(e[0],new S_(t.x,t.y,0,0,void 0),u)}else if("LineString"===t.type)for(const e of t.geometry)R(e,new S_(e[0].x,e[0].y,0,0,void 0),u);else if("Point"===t.type)for(const e of t.geometry)for(const t of e)R([t],new S_(t.x,t.y,0,0,void 0),u)}const hy=255,dy=hy*v_;function uy(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_){const y=function(e,t,i,n,r,s,o,a){const l=[];if(0===t.positionedLines.length)return l;const c=n.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,h=function(e){const t=e[0],i=e[1],n=t*i;return n>0?[t,-i]:n<0?[-t,i]:0===t?[i,t]:[i,-t]}(i);let d=Math.abs(t.top-t.bottom);for(const e of t.positionedLines)d-=e.lineOffset;const u=t.positionedLines.length,f=d/u;let p=t.top-i[1];for(let e=0;e<u;++e){const n=t.positionedLines[e];p=$_(t,f,p,e);for(const e of n.positionedGlyphs){if(!e.rect)continue;const n=e.rect||{};let s=4,d=!0,u=1,f=0;if(e.image){const t=o.get(e.image.toString());if(!t)continue;if(t.sdf){We("SDF images are not supported in formatted text and will be ignored.");continue}d=!1,u=t.pixelRatio,s=1/u}const m=(r||a)&&e.vertical,g=e.metrics.advance*e.scale/2,_=e.metrics,y=e.rect;if(null===y)continue;a&&t.verticalizable&&(f=e.image?g-e.metrics.width*e.scale/2:0);const v=r?[e.x+g,e.y]:[0,0];let x=[0,0],b=[0,0],w=!1;r||(m?(b=[e.x+g+h[0],e.y+h[1]-f],w=!0):x=[e.x+g+i[0],e.y+i[1]-f]);const S=y.w*e.scale/(u*(e.localGlyph?2:1)),T=y.h*e.scale/(u*(e.localGlyph?2:1));let k,M,A,C;if(m){const t=e.y-p,i=new xe(-g,g-t),n=-Math.PI/2,r=new xe(...b);k=new xe(-g+x[0],x[1]),k._rotateAround(n,i)._add(r),k.x+=-t+g,k.y-=(_.left-s)*e.scale;const o=e.image?_.advance*e.scale:Eg*e.scale,a=String.fromCodePoint(e.glyph);Rg(a)?k.x+=(1-s)*e.scale:Og(a)?k.x+=o-_.height*e.scale+(-s-1)*e.scale:k.x+=e.image||_.width+2*s===y.w&&_.height+2*s===y.h?(o-T)/2:(o-(_.height+2*s)*e.scale)/2,M=new xe(k.x,k.y-S),A=new xe(k.x+T,k.y),C=new xe(k.x+T,k.y-S)}else{const t=(_.left-s)*e.scale-g+x[0],i=(-_.top-s)*e.scale+x[1],n=t+S,r=i+T;k=new xe(t,i),M=new xe(n,i),A=new xe(t,r),C=new xe(n,r)}if(c){let e;e=r?new xe(0,0):w?new xe(h[0],h[1]):new xe(i[0],i[1]),k._rotateAround(c,e),M._rotateAround(c,e),A._rotateAround(c,e),C._rotateAround(c,e)}const D=new xe(0,0),L=new xe(0,0);l.push({tl:k,tr:M,bl:A,br:C,texPrimary:n,texSecondary:void 0,writingMode:t.writingMode,glyphOffset:v,sectionIndex:e.sectionIndex,isSDF:d,pixelOffsetTL:D,pixelOffsetBR:L,minFontScaleX:0,minFontScaleY:0})}}return l}(0,n,l,s,o,a,r,e.allowVerticalPlacement),v=e.textSizeData;let x=null;"source"===v.kind?(x=[v_*s.layout.get("text-size").evaluate(a,{},g)*p.textScaleFactor],x[0]>dy&&We(`${e.layerIds[0]}: Value for "text-size" is >= ${hy}. Reduce your "text-size".`)):"composite"===v.kind&&(x=[v_*p.compositeTextSizes[0].evaluate(a,{},g)*p.textScaleFactor,v_*p.compositeTextSizes[1].evaluate(a,{},g)*p.textScaleFactor],(x[0]>dy||x[1]>dy)&&We(`${e.layerIds[0]}: Value for "text-size" is >= ${hy}. Reduce your "text-size".`)),e.addSymbols(e.text,y,x,l,o,a,h,t,i,c.lineStartIndex,c.lineLength,f,m,g,_,!1);for(const t of d)u[t]=e.text.placedSymbolArray.length-1;return 4*y.length}function fy(e){for(const t in e)return e[t];return null}function py(e,t,i,n,r,s,o,a,l,c){let h=o.top,d=o.bottom,u=o.left,f=o.right;if(f_(o)&&o.collisionPadding){const e=o.collisionPadding;u-=e[0],h-=e[1],f+=e[2],d+=e[3]}if(l){const e=new xe(u,h),t=new xe(f,h),i=new xe(u,d),n=new xe(f,d),r=Te(l);let s=new xe(0,0);c&&(s=new xe(c[0],c[1])),e._rotateAround(r,s),t._rotateAround(r,s),i._rotateAround(r,s),n._rotateAround(r,s),u=Math.min(e.x,t.x,i.x,n.x),f=Math.max(e.x,t.x,i.x,n.x),h=Math.min(e.y,t.y,i.y,n.y),d=Math.max(e.y,t.y,i.y,n.y)}return e.emplaceBack(t.x,t.y,t.z,i.x,i.y,u,h,f,d,a,n,r,s),e.length-1}function my(e){f_(e)&&e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);const t=e.bottom-e.top;return t>0?Math.max(10,t):null}function gy(e,t,i,n){const r=e.compareText;if(t in r){const e=r[t];for(let t=e.length-1;t>=0;t--)if(n.dist(e[t])<i)return!0}else r[t]=[];return r[t].push(n),!1}function _y(e,t){const i=e.fovAboveCenter,n=e.elevation?e.elevation.getMinElevationBelowMSL()*t:0,r=(e._camera.position[2]*e.worldSize-n)/Math.cos(e._pitch),s=Math.sin(i)*r/Math.sin(Math.max(Math.PI/2-e._pitch-i,.01));let o=Math.sin(e._pitch)*s+r;const a=r*(1/e._horizonShift);if(!e.elevation||0===e.elevation.exaggeration()){let t=Math.max(e.zoom-17,0);e.isOrthographic&&(t/=10),o*=1+t}return Math.min(1.01*o,a)}function yy(e,t){if(!t.isReprojectedInTileSpace)return{scale:1<<e.z,x:e.x,y:e.y,x2:e.x+1,y2:e.y+1,projection:t};const i=Math.pow(2,-e.z),n=e.x*i,r=(e.x+1)*i,s=e.y*i,o=(e.y+1)*i,a=Vc(n),l=Vc(r),c=Wc(s),h=Wc(o),d=t.project(a,c),u=t.project(l,c),f=t.project(l,h),p=t.project(a,h);let m=Math.min(d.x,u.x,f.x,p.x),g=Math.min(d.y,u.y,f.y,p.y),_=Math.max(d.x,u.x,f.x,p.x),y=Math.max(d.y,u.y,f.y,p.y);const v=i/16;function x(e,i,n,r,s,o){const a=(n+s)/2,l=(r+o)/2,c=t.project(Vc(a),Wc(l)),h=Math.max(0,m-c.x,g-c.y,c.x-_,c.y-y);m=Math.min(m,c.x),_=Math.max(_,c.x),g=Math.min(g,c.y),y=Math.max(y,c.y),h>v&&(x(e,c,n,r,a,l),x(c,i,a,l,s,o))}x(d,u,n,s,r,s),x(u,f,r,s,r,o),x(f,p,r,o,n,o),x(p,d,n,o,n,s),m-=v,g-=v,_+=v,y+=v;const b=1/Math.max(_-m,y-g);return{scale:b,x:m*b,y:g*b,x2:_*b,y2:y*b,projection:t}}function vy(e,{x:t,y:i},n=0){return new xe(((t-n)*e.scale-e.x)*Rn,(i*e.scale-e.y)*Rn)}const xy=l(new Float32Array(16));class by{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,t){return{x:0,y:0,z:0}}unproject(e,t){return new Fc(0,0)}projectTilePoint(e,t,i){return{x:e,y:t,z:0}}locationPoint(e,t,i,n=!0){return e._coordinatePoint(e.locationCoordinate(t,i),n)}pixelsPerMeter(e,t){return jc(1,e)*t}pixelSpaceConversion(e,t,i){return 1}farthestPixelDistance(e){return _y(e,e.pixelsPerMeter)}pointCoordinate(e,t,i,n){const r=e.horizonLineFromTop(!1),s=new xe(t,Math.max(r,i));return e.rayIntersectionCoordinate(e.pointRayIntersection(s,n))}pointCoordinate3D(e,t,i){const n=new xe(t,i);if(e.elevation)return e.elevation.pointCoordinate(n);{const t=this.pointCoordinate(e,n.x,n.y,0);return[t.x,t.y,t.z]}}isPointAboveHorizon(e,t){if(e.elevation&&e.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(e,t.x,t.y);const i=e.horizonLineFromTop();return t.y<i}createInversionMatrix(e,t){return xy}createTileMatrix(e,t,i){let n,r,s;const o=i.canonical,a=l(new Float64Array(16));if(this.isReprojectedInTileSpace){const l=yy(o,this);n=1,r=l.x+i.wrap*l.scale,s=l.y,u(a,a,[n/l.scale,n/l.scale,e.pixelsPerMeter/t])}else n=t/e.zoomScale(o.z),r=(o.x+Math.pow(2,o.z)*i.wrap)*n,s=o.y*n;return d(a,a,[r,s,0]),u(a,a,[n/Rn,n/Rn,1]),a}upVector(e,t,i){return[0,0,1]}upVectorScale(e,t,i){return{metersToTile:1}}}class wy extends by{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[t,i]=this.parallels=e.parallels||[29.5,45.5],n=Math.sin(Te(t));this.n=(n+Math.sin(Te(i)))/2,this.c=1+n*(2*this.n-n),this.r0=Math.sqrt(this.c)/this.n}project(e,t){const{n:i,c:n,r0:r}=this,s=Te(e-this.center[0]),o=Te(t),a=Math.sqrt(n-2*i*Math.sin(o))/i;return{x:a*Math.sin(s*i),y:a*Math.cos(s*i)-r,z:0}}unproject(e,t){const{n:i,c:n,r0:r}=this,s=r+t;let o=Math.atan2(e,Math.abs(s))*Math.sign(s);s*i<0&&(o-=Math.PI*Math.sign(e)*Math.sign(s));const a=Te(this.center[0])*i;o=Ie(o,-Math.PI-a,Math.PI-a);const l=Le(ke(o/i)+this.center[0],-180,180),c=Math.asin(Le((n-(e*e+s*s)*i*i)/(2*i),-1,1)),h=Le(ke(c),-$c,$c);return new Fc(l,h)}}const Sy=1.340264,Ty=-.081106,ky=893e-6,My=.003796,Ay=Math.sqrt(3)/2;class Cy extends by{project(e,t){t=t/180*Math.PI,e=e/180*Math.PI;const i=Math.asin(Ay*Math.sin(t)),n=i*i,r=n*n*n;return{x:.5*(e*Math.cos(i)/(Ay*(Sy+3*Ty*n+r*(7*ky+9*My*n)))/Math.PI+.5),y:1-.5*(i*(Sy+Ty*n+r*(ky+My*n))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let i=t=(2*(1-t)-1)*Math.PI,n=i*i,r=n*n*n;for(let e,s,o,a=0;a<12&&(s=i*(Sy+Ty*n+r*(ky+My*n))-t,o=Sy+3*Ty*n+r*(7*ky+9*My*n),e=s/o,i=Le(i-e,-Math.PI/3,Math.PI/3),n=i*i,r=n*n*n,!(Math.abs(e)<1e-12));++a);const s=Ay*e*(Sy+3*Ty*n+r*(7*ky+9*My*n))/Math.cos(i),o=Math.asin(Math.sin(i)/Ay),a=Le(180*s/Math.PI,-180,180),l=Le(180*o/Math.PI,-$c,$c);return new Fc(a,l)}}class Dy extends by{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){return{x:.5+e/360,y:.5-t/360,z:0}}unproject(e,t){const i=360*(e-.5),n=Le(360*(.5-t),-$c,$c);return new Fc(i,n)}}const Ly=Math.PI/2;function Ey(e){return Math.tan((Ly+e)/2)}class Iy extends by{constructor(e){super(e),this.center=e.center||[0,30];const[t,i]=this.parallels=e.parallels||[30,30];let n=Te(t),r=Te(i);this.southernCenter=n+r<0,this.southernCenter&&(n=-n,r=-r);const s=Math.cos(n),o=Ey(n);this.n=n===r?Math.sin(n):Math.log(s/Math.cos(r))/Math.log(Ey(r)/o),this.f=s*Math.pow(Ey(n),this.n)/this.n}project(e,t){t=Te(t),this.southernCenter&&(t=-t),e=Te(e-this.center[0]);const i=1e-6,{n,f:r}=this;r>0?t<-Ly+i&&(t=-Ly+i):t>Ly-i&&(t=Ly-i);const s=r/Math.pow(Ey(t),n);let o=s*Math.sin(n*e),a=r-s*Math.cos(n*e);return o=.5*(o/Math.PI+.5),a=.5*(a/Math.PI+.5),{x:o,y:this.southernCenter?a:1-a,z:0}}unproject(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;const{n:i,f:n}=this,r=n-t,s=Math.sign(r),o=Math.sign(i)*Math.sqrt(e*e+r*r);let a=Math.atan2(e,Math.abs(r))*s;r*i<0&&(a-=Math.PI*Math.sign(e)*s);const l=Le(ke(a/i)+this.center[0],-180,180),c=Le(ke(2*Math.atan(Math.pow(n/o,1/i))-Ly),-$c,$c);return new Fc(l,this.southernCenter?-c:c)}}class Py extends by{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,t){return{x:Bc(e),y:Hc(t),z:0}}unproject(e,t){const i=Vc(e),n=Wc(t);return new Fc(i,n)}}const Ry=Te($c);class Oy extends by{project(e,t){const i=(t=Te(t))*t,n=i*i;return{x:.5*((e=Te(e))*(.8707-.131979*i+n*(n*(.003971*i-.001529*n)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+i*(.015085+n*(.028874*i-.044475-.005916*n)))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let i=t=(2*(1-t)-1)*Math.PI,n=25,r=0,s=i*i;do{s=i*i;const e=s*s;r=(i*(1.007226+s*(.015085+e*(.028874*s-.044475-.005916*e)))-t)/(1.007226+s*(.045255+e*(.259866*s-.311325-.005916*11*e))),i=Le(i-r,-Ry,Ry)}while(Math.abs(r)>1e-6&&--n>0);s=i*i;const o=Le(ke(e/(.8707+s*(s*(s*s*s*(.003971-.001529*s)-.013791)-.131979))),-180,180),a=ke(i);return new Fc(o,a)}}const zy=Te($c);class Fy extends by{project(e,t){t=Te(t),e=Te(e);const i=Math.cos(t),n=2/Math.PI,r=Math.acos(i*Math.cos(e/2)),s=Math.sin(r)/r,o=.5*(e*n+2*i*Math.sin(e/2)/s)||0,a=.5*(t+Math.sin(t)/s)||0;return{x:.5*(o/Math.PI+.5),y:1-.5*(a/Math.PI+1),z:0}}unproject(e,t){let i=e=(2*e-.5)*Math.PI,n=t=(2*(1-t)-1)*Math.PI,r=25;const s=1e-6;let o=0,a=0;do{const r=Math.cos(n),s=Math.sin(n),l=2*s*r,c=s*s,h=r*r,d=Math.cos(i/2),u=Math.sin(i/2),f=2*d*u,p=u*u,m=1-h*d*d,g=m?1/m:0,_=m?Math.acos(r*d)*Math.sqrt(1/m):0,y=.5*(2*_*r*u+2*i/Math.PI)-e,v=.5*(_*s+n)-t,x=.5*g*(h*p+_*r*d*c)+1/Math.PI,b=g*(f*l/4-_*s*u),w=.125*g*(l*u-_*s*h*f),S=.5*g*(c*d+_*p*r)+.5,T=b*w-S*x;o=(v*b-y*S)/T,a=(y*w-v*x)/T,i=Le(i-o,-Math.PI,Math.PI),n=Le(n-a,-zy,zy)}while((Math.abs(o)>s||Math.abs(a)>s)&&--r>0);return new Fc(ke(i),ke(n))}}class Ny extends by{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Te(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){const{scale:i,cosPhi:n}=this;return{x:Te(e)*n*i+.5,y:-Math.sin(Te(t))/n*i+.5,z:0}}unproject(e,t){const{scale:i,cosPhi:n}=this,r=-(t-.5)/i,s=Le(ke((e-.5)/i)/n,-180,180),o=Math.asin(Le(r*n,-1,1)),a=Le(ke(o),-$c,$c);return new Fc(s,a)}}class Yy extends Py{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,t,i){const n=Td(e,t,i);return Y(n,n,Ad(yd(i))),{x:n[0],y:n[1],z:n[2]}}locationPoint(e,t,i){const n=Rc(t.lat,t.lng),r=O([],n),s=i?e._centerAltitude+i:e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(t),e._centerAltitude):e._centerAltitude;E(n,n,r,jc(1,0)*Rn*s);const o=l(new Float64Array(16));return h(o,e.pixelMatrix,e.globeMatrix),Y(n,n,o),new xe(n[0],n[1])}pixelsPerMeter(e,t){return jc(1,0)*t}pixelSpaceConversion(e,t,i){const n=jc(1,e)*t,r=ci(jc(1,45)*t,n,i);return this.pixelsPerMeter(e,t)/r}createTileMatrix(e,t,i){const n=Cd(yd(i.canonical));return h(new Float64Array(16),e.globeMatrix,n)}createInversionMatrix(e,t){const{center:i}=e,n=Ad(yd(t));return p(n,n,Te(i.lng)),f(n,n,Te(i.lat)),u(n,n,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(n)}pointCoordinate(e,t,i,n){return md(e,t,i,!0)||new Jc(0,0)}pointCoordinate3D(e,t,i){const n=this.pointCoordinate(e,t,i,0);return[n.x,n.y,n.z]}isPointAboveHorizon(e,t){return!md(e,t.x,t.y,!1)}farthestPixelDistance(e){const t=function(e,t){const i=e.cameraToCenterDistance,n=e._centerAltitude*t,r=e._camera,s=e._camera.forward(),o=k([],L([],s,-i),[0,0,n]),a=e.worldSize/(2*Math.PI),l=[0,0,-a],c=e.width/e.height,h=Math.tan(e.fovAboveCenter),d=L([],r.up(),h),u=L([],r.right(),h*c),f=O([],k([],k([],s,d),u)),p=[];let m;if(new wh(o,f).closestPointOnSphere(l,a,p)){const t=k([],p,l),i=W([],t,o);m=Math.cos(e.fovAboveCenter)*w(i)}else{const e=W([],o,l),t=W([],l,o);O(t,t);const i=w(e)-a;m=Math.sqrt(i*(i+2*a));const n=Math.acos(m/(a+i))-Math.acos(z(s,t));m*=Math.cos(n)}return 1.01*m}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),i=Id(e.zoom);if(i>0){const n=_y(e,jc(1,e.center.lat)*e.worldSize),r=e.worldSize/(2*Math.PI),s=Math.max(e.width,e.height)/e.worldSize*Math.PI;return ci(t,n+r*(1-Math.cos(s)),Math.pow(i,10))}return t}upVector(e,t,i){return Td(t,i,e,1)}upVectorScale(e){return{metersToTile:fd(kd(yd(e)))}}}function By(e){const t=e.parallels,i=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new Py(e);case"equirectangular":return new Dy(e);case"naturalEarth":return new Oy(e);case"equalEarth":return new Cy(e);case"winkelTripel":return new Fy(e);case"albers":return i?new Ny(e):new wy(e);case"lambertConformalConic":return i?new Ny(e):new Iy(e);case"globe":return new Yy(e)}throw new Error(`Invalid projection name: ${e.name}`)}const Hy=ah.types,jy=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Vy(e,t,i,n,r,s,o,a,l,c,h,d,u){const f=a?Math.min(dy,Math.round(a[0])):0,p=a?Math.min(dy,Math.round(a[1])):0;e.emplaceBack(t,i,Math.round(32*n),Math.round(32*r),s,o,(f<<1)+(l?1:0),p,16*c,16*h,256*d,256*u)}function Wy(e,t,i){e.emplaceBack(t,i)}function Uy(e,t,i,n,r,s,o){e.emplaceBack(t,i,n,r,s,o)}const $y=(e,t,i,n)=>{for(let r=0;r<t;r++)e.emplaceBack(i[0],i[1],i[2],n[0],n[1],n[2])};function Gy(e,t,i,n,r){e.emplaceBack(t,i,n,r),e.emplaceBack(t,i,n,r),e.emplaceBack(t,i,n,r),e.emplaceBack(t,i,n,r)}function Xy(e){for(const t of e.sections)if(ea(t.text))return!0;return!1}class qy{constructor(e){this.layoutVertexArray=new ll,this.indexArray=new _l,this.programConfigurations=e,this.segments=new Xl,this.dynamicLayoutVertexArray=new hl,this.opacityVertexArray=new dl,this.placedSymbolArray=new Ol,this.iconTransitioningVertexArray=new ul,this.globeExtVertexArray=new cl,this.zOffsetVertexArray=new Qa,this.orientationVertexArray=new xl}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}upload(e,t,i,n,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,bg.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Sg.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,jy,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,Mg.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,wg.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||r)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Tg.members,!0)),!this.orientationVertexBuffer&&this.orientationVertexArray&&this.orientationVertexArray.length>0&&(this.orientationVertexBuffer=e.createVertexBuffer(this.orientationVertexArray,kg.members,!0)),this.opacityVertexBuffer.itemSize=1),(i||n)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.orientationVertexBuffer&&this.orientationVertexBuffer.destroy())}}Ws(qy,"SymbolBuffers");class Zy{constructor(e,t,i){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new i,this.segments=new Xl,this.collisionVertexArray=new gl,this.collisionVertexArrayExt=new hl}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Ag.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Cg.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}Ws(Zy,"CollisionBuffers");class Jy{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.lut=e.lut,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=l([]),this.placementViewportMatrix=l([]);const t=this.layers[0]._unevaluatedLayout._values;this.worldview=e.worldview,this.textSizeData=x_(this.zoom,t["text-size"],this.worldview),this.iconSizeData=x_(this.zoom,t["icon-size"],this.worldview);const i=this.layers[0].layout,n=i.get("symbol-sort-key"),r=i.get("symbol-z-order");this.canOverlap=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==r&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===r||"auto"===r&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=i.get("text-writing-mode").map(e=>e_[e]),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.sourceID=e.sourceID,this.projection=e.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=!1,this.elevationType="none",this.elevationStateComplete=!1,this.activeReplacements=[],this.replacementUpdateTime=0,this.hasAnySecondaryIcon=!1}createArrays(){this.text=new qy(new wc(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("text")||e.startsWith("symbol"))),this.icon=new qy(new wc(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("icon")||e.startsWith("symbol"))),this.glyphOffsetArray=new Nl,this.lineVertexArray=new Yl,this.symbolInstances=new Fl}calculateGlyphDependencies(e,t,i,n,r){for(const i of e){const e=i.codePointAt(0);if(void 0===e)break;if(t[e]=!0,n&&r&&e<=65535){const e=Pg[i];e&&(t[e.charCodeAt(0)]=!0)}}}updateFootprints(e,t){}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=t.updateTime;const i=t.getReplacementRegionsForTile(e.toUnwrapped(),!0);return!vf(this.activeReplacements,i)&&(this.activeReplacements=i,!0)}populate(e,t,i,n){const r=this.layers[0],s=r.layout,o="globe"===this.projection.name,a=s.get("text-font"),l=s.get("text-field"),c=s.get("icon-image"),[h,d]=s.get("icon-size-scale-range"),u=Le(t.scaleFactor||1,h,d),f=("constant"!==l.value.kind||l.value.value instanceof Ri&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),p="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,m=s.get("symbol-sort-key");if(this.features=[],!f&&!p)return;const g=t.iconDependencies,_=t.glyphDependencies,y=t.availableImages,v=new da(this.zoom,{worldview:this.worldview});for(const{feature:t,id:l,index:c,sourceLayerIndex:h}of e){const e=r._featureFilter.needGeometry,d=oh(t,e);if(!r._featureFilter.filter(v,d,i))continue;if(e||(d.geometry=sh(t,i,n)),o&&1!==t.type&&i.z<=5){const e=d.geometry,t=.98078528056,n=(e,n)=>z(Td(e.x,e.y,i,1),Td(n.x,n.y,i,1))<t;for(let t=0;t<e.length;t++)e[t]=th(e[t],n)}let x,b;if(f){const e=r.getValueAndResolveTokens("text-field",d,i,y),t=Ri.factory(e);Xy(t)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===la()||this.hasRTLText&&ha.isParsed())&&(x=Ig(t,r,d))}if(p){const e=r.getValueAndResolveTokens("icon-image",d,i,y);b="string"==typeof e?zi.build(e):e}if(!x&&!b)continue;const w=this.sortFeaturesByKey?m.evaluate(d,{},i):void 0,S={id:l,text:x,icon:b,index:c,sourceLayerIndex:h,geometry:d.geometry,properties:t.properties,type:Hy[t.type],sortKey:w};if(this.features.push(S),b){const e=this.layers[0]._unevaluatedLayout._values,{iconPrimary:t,iconSecondary:n}=iy(b,this.iconSizeData,e["icon-size"],i,this.zoom,S,this.pixelRatio,u,this.worldview),r=t.id.toString();if(g.has(r)?g.get(r).push(t):g.set(r,[t]),n){this.hasAnySecondaryIcon=!0;const e=n.id.toString();g.has(e)?g.get(e).push(n):g.set(e,[n])}}if(x){const e=a.evaluate(d,{},i).join(","),t="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e_.vertical)>=0;for(const i of x.sections)if(i.image){const e=i.image.getPrimary().scaleSelf(this.pixelRatio),t=e.id.toString(),n=g.get(t)||[];n.push(e),g.set(t,n)}else{const n=$o(x.toString()),r=i.fontStack||e,s=_[r]=_[r]||{};this.calculateGlyphDependencies(i.text,s,t,this.allowVerticalPlacement,n)}}}if("line"===s.get("symbol-placement")&&(this.features=function(e){const t={},i={},n=[];let r=0;function s(t){n.push(e[t]),r++}function o(e,t,r){const s=i[e];return delete i[e],i[t]=s,n[s].geometry[0].pop(),n[s].geometry[0]=n[s].geometry[0].concat(r[0]),s}function a(e,i,r){const s=t[i];return delete t[i],t[e]=s,n[s].geometry[0].shift(),n[s].geometry[0]=r[0].concat(n[s].geometry[0]),s}function l(e,t,i){const n=i?t[0][t[0].length-1]:t[0][0];return`${e}:${n.x}:${n.y}`}for(let c=0;c<e.length;c++){const h=e[c],d=h.geometry,u=h.text?h.text.toString():null;if(!u){s(c);continue}const f=l(u,d),p=l(u,d,!0);if(f in i&&p in t&&i[f]!==t[p]){const e=a(f,p,d),r=o(f,p,n[e].geometry);delete t[f],delete i[p],i[l(u,n[r].geometry,!0)]=r,n[e].geometry=null}else f in i?o(f,p,d):p in t?a(f,p,d):(s(c),t[f]=r-1,i[p]=r-1)}return n.filter(e=>e.geometry)}(this.features)),"hd-road-markup"===s.get("symbol-elevation-reference")){if(this.elevationType="road",t.elevationFeatures){!this.elevationFeatures&&t.elevationFeatures.length>0&&(this.elevationFeatures=[],this.elevationFeatureIdToIndex=new Map);for(const e of t.elevationFeatures)this.elevationFeatureIdToIndex.set(e.id,this.elevationFeatures.length),this.elevationFeatures.push(e)}}else s.get("symbol-z-elevate")&&(this.elevationType="offset");"none"!==this.elevationType&&(this.zOffsetBuffersNeedUpload=!0),this.sortFeaturesByKey&&this.features.sort((e,t)=>e.sortKey-t.sortKey)}update(e,t,i,n,r,s,o){this.text.programConfigurations.updatePaintArrays(e,t,r,i,n,s,o,this.worldview),this.icon.programConfigurations.updatePaintArrays(e,t,r,i,n,s,o,this.worldview)}updateRoadElevation(e){if("road"!==this.elevationType||!this.elevationFeatures)return;if(this.elevationStateComplete)return;this.elevationStateComplete=!0,this.hasAnyZOffset=!1;let t=!1;const i=Zc(e),n=1/i;let r=!1,s=!1;for(let e=0;e<this.symbolInstances.length;e++){const o=this.symbolInstances.get(e),a=S(1,0,0),l=S(0,1,0),{numHorizontalGlyphVertices:c,numVerticalGlyphVertices:h,numIconVertices:d,numVerticalIconVertices:u}=o,f=c>0||h>0,p=d>0,m=this.elevationFeatures[o.elevationFeatureIndex];if(m){const e=new xe(o.tileAnchorX,o.tileAnchorY),c=.075+m.pointElevation(e);o.zOffset!==c&&(t=!0,o.zOffset=c);const h=m.computeSlopeNormal(e,n),d=se(J(),S(0,0,1),h);H(a,a,d),H(l,l,d),a[2]*=i,l[2]*=i,1===a[0]&&0===a[1]&&0===a[2]&&0===l[0]&&1===l[1]&&0===l[2]||(r=r||f,s=s||p)}if(f&&($y(this.text.orientationVertexArray,c,a,l),$y(this.text.orientationVertexArray,h,a,l)),p){const{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:t}=o;e>=0&&$y(this.icon.orientationVertexArray,d,a,l),t>=0&&$y(this.icon.orientationVertexArray,u,a,l)}}r||(this.text.orientationVertexArray=void 0),s||(this.icon.orientationVertexArray=void 0),t&&(this.zOffsetBuffersNeedUpload=!0,this.zOffsetSortDirty=!0)}updateZOffset(){const e=(e,t,n)=>{i+=t,i>e.length&&e.resize(i);for(let r=-t;r<0;r++)e.emplace(r+i,n)},t=(e,t,i)=>{n+=t,n>e.length&&e.resize(n);for(let r=-t;r<0;r++)e.emplace(r+n,i)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let i=0,n=0;for(let i=0;i<this.symbolInstances.length;i++){const n=this.symbolInstances.get(i),{numHorizontalGlyphVertices:r,numVerticalGlyphVertices:s,numIconVertices:o}=n,a=n.zOffset,l=o>0;if((r>0||s>0)&&(e(this.text.zOffsetVertexArray,r,a),e(this.text.zOffsetVertexArray,s,a)),l){const{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:i}=n;e>=0&&t(this.icon.zOffsetVertexArray,o,a),i>=0&&t(this.icon.zOffsetVertexArray,n.numVerticalIconVertices,a)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=By(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const i=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:e,y:i}of t)this.lineVertexArray.emplaceBack(e,i);return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m){const g=e.indexArray,_=e.layoutVertexArray,y=e.globeExtVertexArray,v=e.segments.prepareSegment(4*t.length,_,g,this.canOverlap?s.sortKey:void 0),x=this.glyphOffsetArray.length,b=v.vertexLength,w=this.allowVerticalPlacement&&o===e_.vertical?Math.PI/2:0,S=s.text&&s.text.sections;for(let n=0;n<t.length;n++){const{tl:r,tr:o,bl:c,br:h,texPrimary:d,texSecondary:x,pixelOffsetTL:b,pixelOffsetBR:T,minFontScaleX:k,minFontScaleY:M,glyphOffset:A,isSDF:C,sectionIndex:D}=t[n],L=v.vertexLength,E=A[1];if(Vy(_,l.x,l.y,r.x,E+r.y,d.x,d.y,i,C,b.x,b.y,k,M),Vy(_,l.x,l.y,o.x,E+o.y,d.x+d.w,d.y,i,C,T.x,b.y,k,M),Vy(_,l.x,l.y,c.x,E+c.y,d.x,d.y+d.h,i,C,b.x,T.y,k,M),Vy(_,l.x,l.y,h.x,E+h.y,d.x+d.w,d.y+d.h,i,C,T.x,T.y,k,M),a){const{x:t,y:i,z:n}=a.anchor,[r,s,o]=a.up;Uy(y,t,i,n,r,s,o),Uy(y,t,i,n,r,s,o),Uy(y,t,i,n,r,s,o),Uy(y,t,i,n,r,s,o),Gy(e.dynamicLayoutVertexArray,t,i,n,w)}else Gy(e.dynamicLayoutVertexArray,l.x,l.y,l.z,w);if(m){const t=x||d;Wy(e.iconTransitioningVertexArray,t.x,t.y),Wy(e.iconTransitioningVertexArray,t.x+t.w,t.y),Wy(e.iconTransitioningVertexArray,t.x,t.y+t.h),Wy(e.iconTransitioningVertexArray,t.x+t.w,t.y+t.h)}g.emplaceBack(L,L+1,L+2),g.emplaceBack(L+1,L+2,L+3),v.vertexLength+=4,v.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(A[0]),n!==t.length-1&&D===t[n+1].sectionIndex||e.programConfigurations.populatePaintArrays(_.length,s,s.index,{},u,f,p,S&&S[D],this.worldview)}const T=a?a.anchor:l;e.placedSymbolArray.emplaceBack(T.x,T.y,T.z,l.x,l.y,x,this.glyphOffsetArray.length-x,b,c,h,l.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],o,0,0,0,d,0)}_commitLayoutVertex(e,t,i,n,r,s,o){e.emplaceBack(t,i,n,r,s,Math.round(o.x),Math.round(o.y))}_addCollisionDebugVertices(e,t,i,n,r,s,o){const a=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=a.vertexLength,c=o.tileAnchorX,h=o.tileAnchorY;for(let e=0;e<4;e++)i.collisionVertexArray.emplaceBack(0,0,0,0,0,0);this._commitDebugCollisionVertexUpdate(i.collisionVertexArrayExt,t,e.padding,o.zOffset),this._commitLayoutVertex(i.layoutVertexArray,n,r,s,c,h,new xe(e.x1,e.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,r,s,c,h,new xe(e.x2,e.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,r,s,c,h,new xe(e.x2,e.y2)),this._commitLayoutVertex(i.layoutVertexArray,n,r,s,c,h,new xe(e.x1,e.y2)),a.vertexLength+=4;const d=i.indexArray;d.emplaceBack(l,l+1),d.emplaceBack(l+1,l+2),d.emplaceBack(l+2,l+3),d.emplaceBack(l+3,l),a.primitiveLength+=4}_addTextDebugCollisionBoxes(e,t,i,n,r,s){for(let o=n;o<r;o++){const n=i.get(o),r=this.getSymbolInstanceTextSize(e,s,t,o);this._addCollisionDebugVertices(n,r,this.textCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,s)}}_addIconDebugCollisionBoxes(e,t,i,n,r,s){for(let o=n;o<r;o++){const n=i.get(o),r=this.getSymbolInstanceIconSize(e,t,s.placedIconSymbolIndex);this._addCollisionDebugVertices(n,r,this.iconCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,s)}}generateCollisionDebugBuffers(e,t,i){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Zy(pl,Dg.members,ul),this.iconCollisionBox=new Zy(pl,Dg.members,ul);const n=w_(this.iconSizeData,e),r=w_(this.textSizeData,e,i);for(let i=0;i<this.symbolInstances.length;i++){const s=this.symbolInstances.get(i);this._addTextDebugCollisionBoxes(r,e,t,s.textBoxStartIndex,s.textBoxEndIndex,s),this._addTextDebugCollisionBoxes(r,e,t,s.verticalTextBoxStartIndex,s.verticalTextBoxEndIndex,s),this._addIconDebugCollisionBoxes(n,e,t,s.iconBoxStartIndex,s.iconBoxEndIndex,s),this._addIconDebugCollisionBoxes(n,e,t,s.verticalIconBoxStartIndex,s.verticalIconBoxEndIndex,s)}}getSymbolInstanceTextSize(e,t,i,n){const r=this.text.placedSymbolArray.get(t.rightJustifiedTextSymbolIndex>=0?t.rightJustifiedTextSymbolIndex:t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.leftJustifiedTextSymbolIndex>=0?t.leftJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex>=0?t.verticalPlacedTextSymbolIndex:n),s=b_(this.textSizeData,e,r)/Eg;return this.tilePixelRatio*s}getSymbolInstanceIconSize(e,t,i){const n=this.icon.placedSymbolArray.get(i),r=b_(this.iconSizeData,e,n);return this.tilePixelRatio*r}_commitDebugCollisionVertexUpdate(e,t,i,n){e.emplaceBack(t,-i,-i,n),e.emplaceBack(t,i,-i,n),e.emplaceBack(t,i,i,n),e.emplaceBack(t,-i,i,n)}_updateTextDebugCollisionBoxes(e,t,i,n,r,s,o){for(let o=n;o<r;o++){const n=i.get(o),r=this.getSymbolInstanceTextSize(e,s,t,o);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,r,n.padding,s.zOffset)}}_updateIconDebugCollisionBoxes(e,t,i,n,r,s,o){for(let o=n;o<r;o++){const n=i.get(o),r=this.getSymbolInstanceIconSize(e,t,s.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,r,n.padding,s.zOffset)}}updateCollisionDebugBuffers(e,t,i,n){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const r=w_(this.iconSizeData,e,n),s=w_(this.textSizeData,e,i);for(let o=0;o<this.symbolInstances.length;o++){const a=this.symbolInstances.get(o);this._updateTextDebugCollisionBoxes(s,e,t,a.textBoxStartIndex,a.textBoxEndIndex,a,i),this._updateTextDebugCollisionBoxes(s,e,t,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a,i),this._updateIconDebugCollisionBoxes(r,e,t,a.iconBoxStartIndex,a.iconBoxEndIndex,a,n),this._updateIconDebugCollisionBoxes(r,e,t,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex,a,n)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,t,i,n,r,s,o,a,l){const c={};if(t<i){const{x1:i,y1:n,x2:r,y2:s,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:d,tileAnchorY:u,featureIndex:f}=e.get(t);c.textBox={x1:i,y1:n,x2:r,y2:s,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:d,tileAnchorY:u},c.textFeatureIndex=f}if(n<r){const{x1:t,y1:i,x2:r,y2:s,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:d,tileAnchorY:u,featureIndex:f}=e.get(n);c.verticalTextBox={x1:t,y1:i,x2:r,y2:s,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:d,tileAnchorY:u},c.verticalTextFeatureIndex=f}if(s<o){const{x1:t,y1:i,x2:n,y2:r,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:d,tileAnchorY:u,featureIndex:f}=e.get(s);c.iconBox={x1:t,y1:i,x2:n,y2:r,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:d,tileAnchorY:u},c.iconFeatureIndex=f}if(a<l){const{x1:t,y1:i,x2:n,y2:r,padding:s,projectedAnchorX:o,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:d,tileAnchorY:u,featureIndex:f}=e.get(a);c.verticalIconBox={x1:t,y1:i,x2:n,y2:r,padding:s,projectedAnchorX:o,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:d,tileAnchorY:u},c.verticalIconFeatureIndex=f}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){const i=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(e,t){const i=e.placedSymbolArray.get(t),n=i.vertexStartIndex+4*i.numGlyphs;for(let t=i.vertexStartIndex;t<n;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),i=Math.cos(e),n=[],r=[],s=[];for(let e=0;e<this.symbolInstances.length;++e){s.push(e);const o=this.symbolInstances.get(e);n.push(0|Math.round(t*o.tileAnchorX+i*o.tileAnchorY)),r.push(o.featureIndex)}return s.sort((e,t)=>n[e]-n[t]||r[t]-r[e]),s}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let e=0;e<this.symbolInstances.length;++e)this.symbolInstanceIndexesSortedZOffset.push(e)}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort((e,t)=>this.symbolInstances.get(t).zOffset-this.symbolInstances.get(e).zOffset)}addToSortKeyRanges(e,t){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===t?i.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);const{rightJustifiedTextSymbolIndex:i,centerJustifiedTextSymbolIndex:n,leftJustifiedTextSymbolIndex:r,verticalPlacedTextSymbolIndex:s,placedIconSymbolIndex:o,verticalPlacedIconSymbolIndex:a}=t;i>=0&&this.addIndicesForPlacedSymbol(this.text,i),n>=0&&n!==i&&this.addIndicesForPlacedSymbol(this.text,n),r>=0&&r!==n&&r!==i&&this.addIndicesForPlacedSymbol(this.text,r),s>=0&&this.addIndicesForPlacedSymbol(this.text,s),o>=0&&this.addIndicesForPlacedSymbol(this.icon,o),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Ky,Qy,ev;Ws(Jy,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),Jy.addDynamicAttributes=Gy;class tv{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:mi,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ws(tv,"FormatSectionOverride",{omit:["defaultValue"]});const iv=()=>ev||(ev={layout:Ky||(Ky=new Sa({"symbol-placement":new xa(Ta.layout_symbol["symbol-placement"]),"symbol-spacing":new xa(Ta.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new xa(Ta.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ba(Ta.layout_symbol["symbol-sort-key"]),"symbol-z-order":new xa(Ta.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new xa(Ta.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new xa(Ta.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new xa(Ta.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new xa(Ta.layout_symbol["icon-ignore-placement"]),"icon-optional":new xa(Ta.layout_symbol["icon-optional"]),"icon-rotation-alignment":new xa(Ta.layout_symbol["icon-rotation-alignment"]),"icon-size":new ba(Ta.layout_symbol["icon-size"]),"icon-size-scale-range":new xa(Ta.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new ba(Ta.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ba(Ta.layout_symbol["icon-text-fit-padding"]),"icon-image":new ba(Ta.layout_symbol["icon-image"]),"icon-rotate":new ba(Ta.layout_symbol["icon-rotate"]),"icon-padding":new xa(Ta.layout_symbol["icon-padding"]),"icon-keep-upright":new xa(Ta.layout_symbol["icon-keep-upright"]),"icon-offset":new ba(Ta.layout_symbol["icon-offset"]),"icon-anchor":new ba(Ta.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new xa(Ta.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new xa(Ta.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new xa(Ta.layout_symbol["text-rotation-alignment"]),"text-field":new ba(Ta.layout_symbol["text-field"]),"text-font":new ba(Ta.layout_symbol["text-font"]),"text-size":new ba(Ta.layout_symbol["text-size"]),"text-size-scale-range":new xa(Ta.layout_symbol["text-size-scale-range"]),"text-max-width":new ba(Ta.layout_symbol["text-max-width"]),"text-line-height":new ba(Ta.layout_symbol["text-line-height"]),"text-letter-spacing":new ba(Ta.layout_symbol["text-letter-spacing"]),"text-justify":new ba(Ta.layout_symbol["text-justify"]),"text-radial-offset":new ba(Ta.layout_symbol["text-radial-offset"]),"text-variable-anchor":new xa(Ta.layout_symbol["text-variable-anchor"]),"text-anchor":new ba(Ta.layout_symbol["text-anchor"]),"text-max-angle":new xa(Ta.layout_symbol["text-max-angle"]),"text-writing-mode":new xa(Ta.layout_symbol["text-writing-mode"]),"text-rotate":new ba(Ta.layout_symbol["text-rotate"]),"text-padding":new xa(Ta.layout_symbol["text-padding"]),"text-keep-upright":new xa(Ta.layout_symbol["text-keep-upright"]),"text-transform":new ba(Ta.layout_symbol["text-transform"]),"text-offset":new ba(Ta.layout_symbol["text-offset"]),"text-allow-overlap":new xa(Ta.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new xa(Ta.layout_symbol["text-ignore-placement"]),"text-optional":new xa(Ta.layout_symbol["text-optional"]),visibility:new xa(Ta.layout_symbol.visibility)})),paint:Qy||(Qy=new Sa({"icon-opacity":new ba(Ta.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new ba(Ta.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new ba(Ta.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new ba(Ta.paint_symbol["text-emissive-strength"]),"icon-color":new ba(Ta.paint_symbol["icon-color"]),"icon-halo-color":new ba(Ta.paint_symbol["icon-halo-color"]),"icon-halo-width":new ba(Ta.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ba(Ta.paint_symbol["icon-halo-blur"]),"icon-translate":new xa(Ta.paint_symbol["icon-translate"]),"icon-translate-anchor":new xa(Ta.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new xa(Ta.paint_symbol["icon-image-cross-fade"]),"text-opacity":new ba(Ta.paint_symbol["text-opacity"]),"text-occlusion-opacity":new ba(Ta.paint_symbol["text-occlusion-opacity"]),"text-color":new ba(Ta.paint_symbol["text-color"],{runtimeType:vi,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new ba(Ta.paint_symbol["text-halo-color"]),"text-halo-width":new ba(Ta.paint_symbol["text-halo-width"]),"text-halo-blur":new ba(Ta.paint_symbol["text-halo-blur"]),"text-translate":new xa(Ta.paint_symbol["text-translate"]),"text-translate-anchor":new xa(Ta.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new xa(Ta.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new xa(Ta.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new xa(Ta.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new xa(Ta.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new ba(Ta.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},ev);class nv extends Wa{constructor(e,t,i,n){super(e,iv(),t,i,n),this._colorAdjustmentMatrix=l([]),this.hasInitialOcclusionOpacityProperties=void 0!==e.paint&&("icon-occlusion-opacity"in e.paint||"text-occlusion-opacity"in e.paint)}recalculate(e,t){super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const i=this.layout.get("text-writing-mode");if(i){const e=[];for(const t of i)e.indexOf(t)<0&&e.push(t);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(e,t,i,n){return this._saturation===e&&this._contrast===t&&this._brightnessMin===i&&this._brightnessMax===n||(this._colorAdjustmentMatrix=function(e,t,i,n){e=tt(e),t=et(t);const r=a(),s=e/3,o=1-2*s,l=[o,s,s,0,s,o,s,0,s,s,o,0,0,0,0,1],c=.5-.5*t,d=n-i;return h(r,[d,0,0,0,0,d,0,0,0,0,d,0,i,i,i,1],[t,0,0,0,0,t,0,0,0,0,t,0,c,c,c,1]),h(r,r,l),r}(e,t,i,n),this._saturation=e,this._contrast=t,this._brightnessMin=i,this._brightnessMax=n),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,t,i,n){const r=this.layout.get(e).evaluate(t,{},i,n),s=this._unevaluatedLayout._values[e];return s.isDataDriven()||Is(s.value)||!r?r:function(e,t){return t.replace(/{([^{}]+)}/g,(t,i)=>i in e?String(e[i]):"")}(t.properties,r)}createBucket(e){return new Jy(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of iv().paint.overridableProperties){if(!nv.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),i=new tv(t),n=new Es(i,t.property.specification,this.scope,this.options);let r=null;r="constant"===t.value.kind||"source"===t.value.kind?new Rs("source",n):new Os("composite",n,t.value.zoomStops,t.value.interpolationType),this.paint._values[e]=new ya(t.property,r,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,i){return!(!this.layout||t.isDataDriven()||i.isDataDriven())&&nv.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const i=e.get("text-field"),n=iv().paint.properties[t];let r=!1;const s=e=>{for(const t of e)if(n.overrides&&n.overrides.hasOverride(t))return void(r=!0)};if("constant"===i.value.kind&&i.value.value instanceof Ri)s(i.value.value.sections);else if("source"===i.value.kind){const e=t=>{r||(t instanceof Hi&&Yi(t.value)===Si?s(t.value.sections):t instanceof Ui?s(t.sections):t.eachChild(e))},t=i.value;t._styleExpression&&e(t._styleExpression.expression)}return r}getProgramIds(){return["symbol"]}getDefaultProgramParams(e,t,i){return{config:new bc(this,{zoom:t,lut:i}),overrideFog:!1}}hasElevation(){return this.layout&&"hd-road-markup"===this.layout.get("symbol-elevation-reference")}}let rv,sv,ov,av;var lv=Xa([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);function cv(e,t,i,n,r,a,l,c){const h=[e,t,1,i,n,1,r,a,1],d=[l,c,1],u=s([],h),[f,p,m]=B(d,d,u);return o(h,h,[f,0,0,0,p,0,0,0,m])}function hv(e,t,i,n,r,a,l,c){const h=function(e,t,i,n,r,a,l,c){const h=cv(0,0,1,0,1,1,0,1),d=cv(e,t,i,n,r,a,l,c);return o(d,d,s([],h))}(e,t,i,n,r,a,l,c);return[h[2]/h[8]/Rn,h[5]/h[8]/Rn]}function dv(e){return[e[0],Math.min(Math.max(e[1],-$c),$c)]}class uv extends ei{constructor(e,t,i,n){super(),this.id=e,this.dispatcher=i,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(n),this.options=t,this._dirty=!1}load(e,t){if(this._loaded=t||!1,this.fire(new Zt("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return e&&(this.coordinates=e),this._loaded=!0,void this._finishLoading();this._imageRequest=Ht(this.map._requestManager.transformRequest(this.url,It.Image),(t,i)=>{this._imageRequest=null,this._loaded=!0,t?this.fire(new Jt(t)):i&&(this.image=i instanceof HTMLImageElement?ft.getImageData(i):i,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading())})}loaded(){return this._loaded}updateImage(e){return e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}setTexture(e){if(!(e.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new tm(this.map.painter.context,e.handle),this.width=e.dimensions[0],this.height=e.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new Zt("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(e){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof tm||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(e){if(this.coordinates=e,this._boundsArray=void 0,this._unsupportedCoords=!1,!e.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let t=e[0][1],i=e[0][1];for(const n of e)n[1]>i&&(i=n[1]),n[1]<t&&(t=n[1]);const n=(i+t)/2;if(n>$c?this.onNorthPole=!0:n<-$c&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const t=e.map(Jc.fromLngLat);this.tileID=function(e){let t=1/0,i=1/0,n=-1/0,r=-1/0;for(const s of e)t=Math.min(t,s.x),i=Math.min(i,s.y),n=Math.max(n,s.x),r=Math.max(r,s.y);const s=Math.max(n-t,r-i),o=Math.max(0,Math.floor(-Math.log(s)/Math.LN2)),a=Math.pow(2,o);let l=Math.floor((t+n)/2*a);return l>1&&(l-=1),new rd(o,l,Math.floor((i+r)/2*a))}(t),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new Zt("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){!this.texture||this.texture instanceof tm||(this.texture.destroy(),this._dirty=!0),this.texture=null,this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(e){for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const t=yy(new rd(0,0,0),this.map.transform.projection),i=[t.projection.project(this.coordinates[0][0],this.coordinates[0][1]),t.projection.project(this.coordinates[1][0],this.coordinates[1][1]),t.projection.project(this.coordinates[2][0],this.coordinates[2][1]),t.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(e){const t=e[1].x-e[0].x,i=e[1].y-e[0].y,n=e[2].x-e[1].x,r=e[2].y-e[1].y,s=e[3].x-e[2].x,o=e[3].y-e[2].y,a=e[0].x-e[3].x,l=e[0].y-e[3].y,c=t*r-n*i,h=n*o-s*r,d=s*l-a*o,u=a*i-t*l;return c>0&&h>0&&d>0&&u>0||c<0&&h<0&&d<0&&u<0}(i))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const n=yy(this.tileID,this.map.transform.projection),[r,a,l,c]=this.coordinates.map(e=>{const t=n.projection.project(e[0],e[1]);return vy(n,t)._round()});this.perspectiveTransform=hv(r.x,r.y,a.x,a.y,l.x,l.y,c.x,c.y);const h=this._boundsArray=new Ka;h.emplaceBack(r.x,r.y,0,0),h.emplaceBack(a.x,a.y,Rn,0),h.emplaceBack(c.x,c.y,0,Rn),h.emplaceBack(l.x,l.y,Rn,Rn),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=e.createVertexBuffer(h,lv.members),this.boundsSegments=Xl.simpleSegment(0,0,4,2);const d=[],u=[dv((f=this.coordinates)[0]),dv(f[1]),dv(f[2]),dv(f[3])];var f;const[p,m,g,_]=function(e){let t=e[0][0],i=t,n=e[0][1],r=n;for(let s=1;s<e.length;s++)e[s][0]<t?t=e[s][0]:e[s][0]>i&&(i=e[s][0]),e[s][1]<n?n=e[s][1]:e[s][1]>r&&(r=e[s][1]);return[t,n,i-t,r-n]}(u);{const n=new Ka,[r,a,l,c]=function(e){let t=e[0].x,i=t,n=e[0].y,r=n;for(let s=1;s<e.length;s++)e[s].x<t?t=e[s].x:e[s].x>i&&(i=e[s].x),e[s].y<n?n=e[s].y:e[s].y>r&&(r=e[s].y);return[t,n,i-t,r-n]}(i),h=e=>[(e.x-r)/l,(e.y-a)/c],[u,f,y,v]=i.map(h),x=function(e,t,i,n,r,a,l,c){const h=cv(0,0,1,0,1,1,0,1);return o(h,h,s([],cv(e,t,i,n,r,a,l,c)))}(u[0],u[1],f[0],f[1],y[0],y[1],v[0],v[1]);this.elevatedGlobePerspectiveTransform=hv(u[0],u[1],f[0],f[1],y[0],y[1],v[0],v[1]);const b=(e,t)=>{d.push(e.lng);const i=Math.round((e.lng-p)/g*Rn),r=Math.round((e.lat-m)/_*Rn),s=h(t),o=B([],[s[0],s[1],1],x),a=Math.round(o[0]/o[2]*Rn),l=Math.round(o[1]/o[2]*Rn);n.emplaceBack(i,r,a,l)},w=i[3].x-i[0].x,S=i[3].y-i[0].y,T=i[2].x-i[1].x,k=i[2].y-i[1].y;for(let e=0;e<65;e++){const n=e/64,r=[i[0].x+n*w,i[0].y+n*S],s=[i[1].x+n*T,i[1].y+n*k],o=s[0]-r[0],a=s[1]-r[1];for(let e=0;e<65;e++){const i=e/64,n={x:r[0]+o*i,y:r[1]+a*i};b(t.projection.unproject(n.x,n.y),n)}}this.elevatedGlobeVertexBuffer=e.createVertexBuffer(n,lv.members)}{this.maxLongitudeTriangleSize=0;let t=[],i=new _l;const n=(e,n,r)=>{i.emplaceBack(e,n,r);const s=d[e],o=d[n],a=d[r],l=Math.min(Math.min(s,o),a),c=Math.max(Math.max(s,o),a)-l;c>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=c),t.push(l+c/2)};for(let e=0;e<64;e++)for(let t=0;t<64;t++){const i=65*e+t,r=i+1,s=i+65,o=s+1;n(i,s,r),n(r,s,o)}[t,i]=function(e,t){const i=Array.from({length:e.length},(e,t)=>t);i.sort((t,i)=>e[t]-e[i]);const n=[],r=new _l;for(let s=0;s<i.length;s++){const o=i[s];n.push(e[o]);const a=3*o,l=a+1;r.emplaceBack(t.uint16[a],t.uint16[l],t.uint16[l+1])}return[n,r]}(t,i),this.elevatedGlobeTrianglesCenterLongitudes=t,this.elevatedGlobeIndexBuffer=e.createIndexBuffer(i)}this.elevatedGlobeSegments=Xl.simpleSegment(0,0,4225,8192),this.elevatedGlobeGridMatrix=new Float32Array([0,g/Rn,0,_/Rn,0,0,m,p,0])}prepare(){const e=0!==Object.keys(this.tiles).length;if(this.tileID&&!e)return;const t=this.map.painter.context,i=t.gl;!this._dirty||this.texture instanceof tm||(this.texture?this.texture.update(this.image):(this.texture=new em(t,this.image,i.RGBA8),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this._dirty=!1),e&&this._prepareData(t)}loadTile(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}getSegmentsForLongitude(e){const t=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!t)return null;const i=this.elevatedGlobeTrianglesCenterLongitudes;let n=(r=e+180)+360*Math.round((i[0]-r)/360);var r;const s=new Xl,o=(e,i)=>{s.segments.push({vertexOffset:0,primitiveOffset:e,vertexLength:t.segments[0].vertexLength,primitiveLength:i,sortKey:void 0,vaos:{}})},a=.51*this.maxLongitudeTriangleSize;if(Math.abs(i[0]-n)<=a){const e=Qe(i,0,i.length,n+a);return e===i.length||o(e,Ke(i,e+1,i.length,n+360-a)-e),s}n<i[0]&&(n+=360);const l=Ke(i,0,i.length,n-a);if(l===i.length)return o(0,i.length),s;o(0,l-0);const c=Qe(i,l+1,i.length,n+a);return c!==i.length&&o(c,i.length-c),s}}const fv=(Math.pow(256,2)-1)/16907520;class pv extends Wa{constructor(e,t,i,n){super(e,{layout:ov||(ov=new Sa({visibility:new xa(Ta.layout_raster.visibility)})),paint:av||(av=new Sa({"raster-opacity":new xa(Ta.paint_raster["raster-opacity"]),"raster-color":new wa(Ta.paint_raster["raster-color"]),"raster-color-mix":new xa(Ta.paint_raster["raster-color-mix"]),"raster-color-range":new xa(Ta.paint_raster["raster-color-range"]),"raster-hue-rotate":new xa(Ta.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new xa(Ta.paint_raster["raster-brightness-min"]),"raster-brightness-max":new xa(Ta.paint_raster["raster-brightness-max"]),"raster-saturation":new xa(Ta.paint_raster["raster-saturation"]),"raster-contrast":new xa(Ta.paint_raster["raster-contrast"]),"raster-resampling":new xa(Ta.paint_raster["raster-resampling"]),"raster-fade-duration":new xa(Ta.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new xa(Ta.paint_raster["raster-emissive-strength"]),"raster-array-band":new xa(Ta.paint_raster["raster-array-band"]),"raster-elevation":new xa(Ta.paint_raster["raster-elevation"]),"raster-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this.updateColorRamp(),this._curRampRange=[NaN,NaN]}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(e){return!(e&&e._source instanceof uv&&(e._source.onNorthPole||e._source.onSouthPole))&&0===this.paint.get("raster-elevation")}_handleSpecialPaintPropertyUpdate(e){"raster-color"!==e&&"raster-color-range"!==e||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}updateColorRamp(e){if(!this.hasColorMap())return;if(!this._curRampRange)return;const t=this._transitionablePaint._values["raster-color"].value.expression,[i,n]=e||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(i)&&isNaN(n)||i===this._curRampRange[0]&&n===this._curRampRange[1]||(this.colorRamp=iu({expression:t,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:i,end:n}],resolution:256}),this.colorRampTexture=null,this._curRampRange=[i,n])}}let mv,gv,_v,yv,vv;class xv extends Wa{constructor(e,t,i,n){super(e,{layout:mv||(mv=new Sa({visibility:new xa(Ta["layout_raster-particle"].visibility)})),paint:gv||(gv=new Sa({"raster-particle-array-band":new xa(Ta["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new xa(Ta["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new wa(Ta["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new xa(Ta["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new xa(Ta["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new xa(Ta["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new xa(Ta["paint_raster-particle"]["raster-particle-reset-rate-factor"]),"raster-particle-elevation":new xa(Ta["paint_raster-particle"]["raster-particle-elevation"]),"raster-particle-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._updateColorRamp(),this.lastInvalidatedAt=ft.now()}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this.tileFramebuffer&&(this.tileFramebuffer.destroy(),this.tileFramebuffer=null),this.particleFramebuffer&&(this.particleFramebuffer.destroy(),this.particleFramebuffer=null)}onRemove(e){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy()}hasColorMap(){return!!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return["rasterParticle"]}hasOffscreenPass(){return"none"!==this.visibility}isDraped(e){return!1}_handleSpecialPaintPropertyUpdate(e){"raster-particle-color"!==e&&"raster-particle-max-speed"!==e||(this._updateColorRamp(),this._invalidateAnimationState()),"raster-particle-count"===e&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;const e=this._transitionablePaint._values["raster-particle-color"].value.expression,t=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=iu({expression:e,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:t}],resolution:256}),this.colorRampTexture=null}_invalidateAnimationState(){this.lastInvalidatedAt=ft.now()}tileCoverLift(){return this.paint.get("raster-particle-elevation")}}class bv extends Wa{constructor(e,t){super(e,{},t,null),this.implementation=e,e.slot&&(this.slot=e.slot)}is3D(e){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isDraped(e){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}function wv(e,t,i){const n=[0,0,1],r=K([]);return ee(r,r,i?-Te(e)+Math.PI:Te(e)),Q(r,r,-Te(t)),H(n,n,r),O(n,n)}const Sv={None:0,Model:1,Symbol:2,FillExtrusion:4};class Tv{constructor(e,t,i,n){this.message=(e?`${e}: `:"")+i,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)}}function kv(e,t){const i=-1===e.indexOf("://");try{return new URL(e,i&&t?"http://example.com":void 0),!0}catch(e){return!1}}class Mv{constructor(e,t){this.feature=e,this.instancedDataOffset=t,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class Av{constructor(){this.instancedDataArray=new Cl,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}}class Cv{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.projection=e.projection,this.index=e.index,this.worldview=e.worldview,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0,this.styleDefinedModelURLs=e.styleDefinedModelURLs}updateFootprints(e,t){}populate(e,t,i,n){this.tileToMeter=Zc(i);const r=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:s,id:o,index:a,sourceLayerIndex:l}of e){const e=null!=o?o:s.properties&&s.properties.hasOwnProperty("id")?s.properties.id:void 0,c=oh(s,r);if(!this.layers[0]._featureFilter.filter(new da(this.zoom,{worldview:this.worldview}),c,i))continue;const h={id:e,sourceLayerIndex:l,index:a,geometry:r?c.geometry:sh(s,i,n),properties:s.properties,type:s.type,patterns:{}},d=this.addFeature(h,h.geometry,c);d&&t.featureIndex.insert(s,h.geometry,a,l,this.index,this.instancesPerModel[d].instancedDataArray.length,256)}this.lookup=null}update(e,t,i,n){for(const t in this.instancesPerModel){const i=this.instancesPerModel[t];for(const t in e)i.idToFeaturesIndex.hasOwnProperty(t)&&(this.evaluate(i.features[i.idToFeaturesIndex[t]],e[t],i,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let e=!1;for(const t in this.instancesPerModel){const i=this.instancesPerModel[t];for(const t of i.features){const n=this.layers[0],r=t.feature,s=this.canonical,o=n.paint.get("model-rotation").evaluate(r,{},s),a=n.paint.get("model-scale").evaluate(r,{},s),l=n.paint.get("model-translation").evaluate(r,{},s);V(t.rotation,o)&&V(t.scale,a)&&V(t.translation,l)||(this.evaluate(t,t.featureStates,i,!0),e=!0)}}return e}updateReplacement(e,t,i,n){if(t.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=t.updateTime;const r=t.getReplacementRegionsForTile(e.toUnwrapped(),!0);if(vf(this.activeReplacements,r))return!1;this.activeReplacements=r;let s=!1;for(const t in this.instancesPerModel){const r=this.instancesPerModel[t],o=r.instancedDataArray;for(const t of r.features){const r=t.instancedDataOffset,a=t.instancedDataCount;for(let t=0;t<a;t++){const a=16*(t+r);let l=o.float32[a+0];const c=l>Rn;l=c?l-Rn:l;const h=Math.floor(l),d=o.float32[a+1];let u=!1;for(const t of this.activeReplacements)if(!mf(t,i,Sv.Model,n)&&!(t.min.x>h||h>t.max.x||t.min.y>d||d>t.max.y)&&(u=kf(Tf(h,d,e.canonical,t.footprintTileId.canonical),t.footprint),u))break;o.float32[a]=u?l+Rn:l,s=s||u!==c}}}return s}isEmpty(){for(const e in this.instancesPerModel)if(0!==this.instancesPerModel[e].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(const t in this.instancesPerModel){const i=this.instancesPerModel[t];i.instancedDataArray.length<0||0===i.instancedDataArray.length||(i.instancedDataBuffer?i.instancedDataBuffer.updateData(i.instancedDataArray):i.instancedDataBuffer=e.createVertexBuffer(i.instancedDataArray,am.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(){for(const e in this.instancesPerModel){const t=this.instancesPerModel[e];0!==t.instancedDataArray.length&&t.instancedDataBuffer&&t.instancedDataBuffer.destroy()}const e=this.layers[0].modelManager;if(e&&this.modelUris&&this.modelsRequested)for(const t of this.modelUris)e.removeModel(t,"",!0)}addFeature(e,t,i){const n=this.layers[0],r=n.layout.get("model-id").evaluate(i,{},this.canonical);if(!r)return We(`modelId is not evaluated for layer ${n.id} and it is not going to get rendered.`),r;(kv(r,!1)||void 0!==this.styleDefinedModelURLs[r])&&(this.modelUris.includes(r)||this.modelUris.push(r)),this.instancesPerModel[r]||(this.instancesPerModel[r]=new Av);const s=this.instancesPerModel[r],o=s.instancedDataArray,a=new Mv(i,o.length);for(const e of t)for(const t of e){if(t.x<0||t.x>=Rn||t.y<0||t.y>=Rn)continue;const e=(this.lookupDim-1)/Rn,i=this.lookupDim*(t.y*e|0)+t.x*e|0;if(this.lookup){if(0!==this.lookup[i])continue;this.lookup[i]=1}this.instanceCount++;const n=o.length;o.resize(n+1),s.instancesEvaluatedElevation.push(0),o.float32[16*n]=t.x,o.float32[16*n+1]=t.y}return a.instancedDataCount=s.instancedDataArray.length-a.instancedDataOffset,a.instancedDataCount>0&&(e.id&&(s.idToFeaturesIndex[e.id]=s.features.length),s.features.push(a),this.evaluate(a,{},s,!1)),r}getModelUris(){return this.modelUris}evaluate(e,t,i,n){const r=this.layers[0],s=e.feature,o=this.canonical,a=e.rotation=r.paint.get("model-rotation").evaluate(s,t,o),l=e.scale=r.paint.get("model-scale").evaluate(s,t,o),c=e.translation=r.paint.get("model-translation").evaluate(s,t,o),h=r.paint.get("model-color").evaluate(s,t,o);h.a=r.paint.get("model-color-mix-intensity").evaluate(s,t,o);const d=[];this.maxVerticalOffset<c[2]&&(this.maxVerticalOffset=c[2]),this.maxScale=Math.max(Math.max(this.maxScale,l[0]),Math.max(l[1],l[2])),mm(d,a,l);const u=Math.round(100*h.a)+h.b/1.05;for(let t=0;t<e.instancedDataCount;++t){const r=e.instancedDataOffset+t,s=16*r,a=i.instancedDataArray.float32;let l=0;n&&(l=a[s+6]-i.instancesEvaluatedElevation[r]);const f=0|a[s+1];a[s]=(0|a[s])+h.r/1.05,a[s+1]=f+h.g/1.05,a[s+2]=u,a[s+3]=1/(o.z>10?this.tileToMeter:Zc(o,f)),a[s+4]=c[0],a[s+5]=c[1],a[s+6]=c[2]+l,a[s+7]=d[0],a[s+8]=d[1],a[s+9]=d[2],a[s+10]=d[4],a[s+11]=d[5],a[s+12]=d[6],a[s+13]=d[8],a[s+14]=d[9],a[s+15]=d[10],i.instancesEvaluatedElevation[r]=c[2]}}}let Dv,Lv;Ws(Cv,"ModelBucket",{omit:["layers"]}),Ws(Av,"PerModelAttributes"),Ws(Mv,"ModelFeature");class Ev{constructor(e,t,i){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=i}static create(e,t,i){const n=i||e.findDEMTileFor(t);if(!n||!n.dem)return;const r=n.dem,s=n.tileID,o=1<<t.canonical.z-s.canonical.z;return new Ev(n,r.dim/Rn/o,[(t.canonical.x/o-s.canonical.x)*r.dim,(t.canonical.y/o-s.canonical.y)*r.dim])}tileCoordToPixel(e,t){const i=t*this._scale+this._offset[1];return new xe(Math.floor(e*this._scale+this._offset[0]),Math.floor(i))}getElevationAt(e,t,i,n){const r=e*this._scale+this._offset[0],s=t*this._scale+this._offset[1],o=Math.floor(r),a=Math.floor(s),l=this._dem;return n=!!n,i?ci(ci(l.get(o,a,n),l.get(o,a+1,n),s-a),ci(l.get(o+1,a,n),l.get(o+1,a+1,n),s-a),r-o):l.get(o,a,n)}getElevationAtPixel(e,t,i){return this._dem.get(e,t,!!i)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*jc(1,e)*this._dem.stride}}const Iv=new Float32Array(262144),Pv=new Uint8Array(262144);function Rv(e){let t=0;if(e.meshes)for(const i of e.meshes)t=Math.max(t,i.aabb.max[2]);if(e.children)for(const i of e.children)t=Math.max(t,Rv(i));return t}function Ov(e,t,i){if(e.meshes)for(const n of e.meshes){if(n.aabb.min[0]===1/0)continue;const r=Dh.applyTransform(n.aabb,e.matrix);i.insert(t,r.min[0],r.min[1],r.max[0],r.max[1])}if(e.children)for(const n of e.children)Ov(n,t,i)}const zv=["","wall","door","roof","window","lamp","logo"];class Fv{constructor(e){this.node=e,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedTranslation=[0,0,0],this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.cameraCollisionOpacity=1,this.feature={type:"Point",id:e.id,geometry:[],properties:{height:Rv(e)}},this.aabb=this._getLocalBounds(),this.state=null}_getLocalBounds(){if(!this.node.meshes)return new Dh([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let e=0;const t=new Dh([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const i of this.node.meshes)this.node.lightMeshIndex!==e&&(i.transformedAabb=Dh.applyTransformFast(i.aabb,this.node.matrix),t.encapsulate(i.transformedAabb)),e++;this.aabb=t}return this.aabb}}class Nv{constructor(e,t,i,n,r,s,o,a){this.id=i,this.layers=e,this.layerIds=this.layers.map(e=>e.fqid),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.modelTraits|=xm.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,n&&(this.modelTraits|=xm.HasMapboxMeshFeatures),r&&(this.modelTraits|=xm.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=s,this.worldview=a,this.dirty=!0,this.needsUpload=!1,this.filter=null,this.nodesInfo=[];for(const e of t)this.nodesInfo.push(new Fv(e)),Ov(e,o.featureIndexArray.length,o.grid),o.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,o.bucketLayerIDs.length-1,0);this.states={}}updateFootprints(e,t){for(const i of this.getNodesInfo()){const n=i.node;n.footprint&&t.push({footprint:n.footprint,id:e})}}update(e){const t=0!==Object.keys(e).length;if(t&&!this.stateDependentLayers.length)return;const i=t?this.stateDependentLayers:this.layers;if(!be(e,this.states))for(const t of i)this.evaluate(t,e);this.states=structuredClone(e)}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(e){if(!this.needsUpload)return;const t=this.getNodesInfo();for(const i of t){const t=i.node;this.uploaded?this.updatePbrBuffer(t):Tm(t,e,!0)}for(const e of t)km(e.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(e){let t=!1;if(!e.meshes)return t;for(const i of e.meshes)i.pbrBuffer&&(i.pbrBuffer.updateData(i.featureArray),t=!0);return t}needsReEvaluation(e,t,i){const n=e.transform.projectionOptions,r=e.style.getBrightness(),s=this.brightness!==r;if(!this.uploaded||this.dirty||n.name!==this.projection.name||Yv(i.paint.get("model-color").value,s)||Yv(i.paint.get("model-color-mix-intensity").value,s)||Yv(i.paint.get("model-roughness").value,s)||Yv(i.paint.get("model-emissive-strength").value,s)||Yv(i.paint.get("model-height-based-emissive-strength-multiplier").value,s)){this.projection=n,this.brightness=r;const e=this.getNodesInfo();for(const t of e)t.state=null;return!0}return!1}evaluateTransform(e,t){if(e.transform.zoom===this.zoom)return;this.zoom=e.transform.zoom;const i=this.getNodesInfo(),n=this.id.canonical;for(const e of i){const i=e.feature;e.evaluatedTranslation=t.paint.get("model-translation").evaluate(i,{},n),e.evaluatedScale=t.paint.get("model-scale").evaluate(i,{},n)}}evaluate(e,t){const i=this.getNodesInfo();for(const n of i){if(!n.node.meshes)continue;const i=n.feature,r=t&&t[i.id];if(be(r,n.state))continue;n.state=structuredClone(r);const s=n.node.meshes&&n.node.meshes[0].featureData,o=n.evaluatedColor[2],a=n.evaluatedRMEA[2],l=this.id.canonical;if(n.hasTranslucentParts=!1,s){for(let t=0;t<zv.length;t++){const s=zv[t];s.length&&(i.properties.part=s);const o=e.paint.get("model-color").evaluate(i,r,l).toPremultipliedRenderColor(null),a=e.paint.get("model-color-mix-intensity").evaluate(i,r,l);n.evaluatedColor[t]=[o.r,o.g,o.b,a],n.evaluatedRMEA[t][0]=e.paint.get("model-roughness").evaluate(i,r,l),n.evaluatedRMEA[t][2]=e.paint.get("model-emissive-strength").evaluate(i,r,l),n.evaluatedRMEA[t][3]=o.a,n.emissionHeightBasedParams[t]=e.paint.get("model-height-based-emissive-strength-multiplier").evaluate(i,r,l),!n.hasTranslucentParts&&o.a<1&&(n.hasTranslucentParts=!0)}delete i.properties.part,Hv(n,o!==n.evaluatedColor[2]||a!==n.evaluatedRMEA[2],this.modelTraits)}else n.evaluatedRMEA[0][2]=e.paint.get("model-emissive-strength").evaluate(i,r,l);n.evaluatedTranslation=e.paint.get("model-translation").evaluate(i,r,l),n.evaluatedScale=e.paint.get("model-scale").evaluate(i,r,l),this.updatePbrBuffer(n.node)||(this.needsUpload=!0)}this.dirty=!1}elevationUpdate(e,t,i,n){const r=e.findDEMTileFor(i);if(r&&(r.tileID.canonical!==this.terrainTile||t!==this.terrainExaggeration)){if(r.dem&&r.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=r.tileID.overscaledZ;const t=Ev.create(e,i,r);if(!t)return;this.modelTraits&xm.HasMapboxMeshFeatures&&this.updateDEM(e,t,i,n);for(const e of this.getNodesInfo()){const i=e.node;if(!i.footprint||!i.footprint.vertices||!i.footprint.vertices.length)continue;const n=i.footprint.vertices;let r=t.getElevationAt(n[0].x,n[0].y,!0,!0);for(let e=1;e<n.length;e++)r=Math.min(r,t.getElevationAt(n[e].x,n[e].y,!0,!0));i.elevation=r}}this.terrainTile=r.tileID.canonical,this.terrainExaggeration=t}}updateDEM(e,t,i,n){let r=t._dem._modifiedForSources[n];if(void 0===r&&(t._dem._modifiedForSources[n]=[],r=t._dem._modifiedForSources[n]),r.includes(i.canonical))return;const s=t._dem.dim;r.push(i.canonical);let o=!1;for(const e of this.getNodesInfo()){const i=e.node;if(!i.footprint||!i.footprint.grid)continue;const n=i.footprint.grid,r=t.tileCoordToPixel(n.min.x,n.min.y),a=t.tileCoordToPixel(n.max.x,n.max.y),l=Math.min(Math.min(s-a.y,r.x),Math.min(r.y,s-a.x));if(l<0)continue;const c=Le(l,2,5);let h=Math.max(0,r.x-c),d=Math.max(0,r.y-c),u=Math.min(a.x+c,s-1),f=Math.min(a.y+c,s-1);for(let e=d;e<=f;++e)for(let t=h;t<=u;++t)Pv[e*s+t]=255;let p=0,m=0;for(let e=0;e<n.cellsY;++e)for(let i=0;i<n.cellsX;++i){if(!n.cells[e*n.cellsX+i])continue;const r=t.tileCoordToPixel(n.min.x+i/n.xScale,n.min.y+e/n.yScale),o=t.tileCoordToPixel(n.min.x+(i+1)/n.xScale,n.min.y+(e+1)/n.yScale);for(let e=r.y;e<=Math.min(o.y+1,s-1);++e)for(let i=r.x;i<=Math.min(o.x+1,s-1);++i)255===Pv[e*s+i]&&(Pv[e*s+i]=0,p+=t.getElevationAtPixel(i,e),m++)}const g=p/m;h=Math.max(1,r.x-c),d=Math.max(1,r.y-c),u=Math.min(a.x+c,s-2),f=Math.min(a.y+c,s-2),o=!0;for(let e=d;e<=f;++e)for(let i=h;i<=u;++i)0===Pv[e*s+i]&&(Iv[e*s+i]=t._dem.set(i,e,g));for(let e=1;e<c;++e){h=Math.max(1,r.x-e),d=Math.max(1,r.y-e),u=Math.min(a.x+e,s-2),f=Math.min(a.y+e,s-2);for(let i=d;i<=f;++i)for(let n=h;n<=u;++n){const r=i*s+n;if(255===Pv[r]){let o=0,a=0,l=-1,h=-1;for(let t=-1;t<=1;++t)for(let r=-1;r<=1;++r){const c=(i+t)*s+n+r;if(Pv[c]>=e)continue;const d=Iv[c],u=Math.abs(d);u>a&&(o=d,a=u,l=r,h=t)}if(a>.1){const s=1-(e+.5*Math.abs(l*h))/c;let a=t._dem.get(n,i)+o*s;const d=t._dem.get(n+l,i+h),u=t._dem.get(n-l,i-h,!0);(a-d)*(a-u)>0&&(a=(d+u)/2),Iv[r]=t._dem.set(n,i,a),Pv[r]=e}}}}}o&&(t._demTile.needsDEMTextureUpload=!0,t._dem._timestamp=ft.now())}setFilter(e){this.filter=e?Ca(e):null}getNodesInfo(){return this.filter?this.nodesInfo.filter(e=>this.filter.filter(new da(this.id.overscaledZ,{worldview:this.worldview}),e.feature,this.id.canonical)):this.nodesInfo}destroy(){const e=this.getNodesInfo();for(const t of e)km(t.node),Mm(t.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const i=t.getReplacementRegionsForTile(e.toUnwrapped());for(const e of this.getNodesInfo()){const t=e.node.footprint;e.hiddenByReplacement=!!t&&!i.find(e=>e.footprint===t)}}getHeightAtTileCoord(e,t){const i=[],n=[0,0,0],r=l([]);for(const s of this.getNodesInfo()){const o=s.node.meshes[0],a=o.transformedAabb;if(e<a.min[0]||t<a.min[1]||e>a.max[0]||t>a.max[1])continue;if(!0===s.node.hidden)return{height:1/0,maxHeight:s.feature.properties.height,hidden:!1,verticalScale:s.evaluatedScale[2]};c(r,s.node.matrix),n[0]=e,n[1]=t,Y(n,n,r);const l=(n[0]-o.aabb.min[0])/(o.aabb.max[0]-o.aabb.min[0])*vm|0,h=Math.min(63,(n[1]-o.aabb.min[1])/(o.aabb.max[1]-o.aabb.min[1])*vm|0)*vm+Math.min(63,l),d=o.heightmap[h];if(!(d<0&&s.node.footprint)){if(s.hiddenByReplacement)return;return{height:d,maxHeight:s.feature.properties.height,hidden:!1,verticalScale:s.evaluatedScale[2]}}if(s.node.footprint.grid.query(new xe(e,t),new xe(e,t),i),i.length>0)return{height:void 0,maxHeight:s.feature.properties.height,hidden:s.hiddenByReplacement,verticalScale:s.evaluatedScale[2]}}}}function Yv(e,t){return e instanceof Rs&&!e.isLightConstant&&t}function Bv(e,t,i,n,r,s,o,a){let l=(61440&t|(61440&t)>>4)>>8,c=(3840&t|(3840&t)>>4)>>4,h=240&t|(240&t)>>4;i[3]>0&&(l=ci(l,255*i[0],i[3]),c=ci(c,255*i[1],i[3]),h=ci(h,255*i[2],i[3]));const d=l<<8|c,u=h<<8|Math.floor(255*n[3]),f=function(e){const t=Le(e,0,2);return Math.min(Math.round(.5*t*255),255)}(n[2])<<8|15*n[0]<<4|15*n[1],p=Le(r[0],0,1),m=Le(r[1],0,1),g=Le(r[2],0,1),_=Le(r[3],0,1);let y,v,x,b;if(p!==m&&o!==s&&m!==p){const e=o-s;v=1/(e*(m-p)),x=-(s+e*p)/(e*(m-p));const t=Le(r[4],-1,1);b=Math.pow(10,t),y=255*g<<8|255*_}else y=65535,v=0,x=1,b=1;if(e.emplaceBack(d,u,f,y,v,x,b),a){const e=a.length;a.clear();for(let t=0;t<e;t++)a.emplaceBack(d,u,f,y,v,x,b)}}function Hv(e,t,i){const n=e.node;let r=0;const s=i&xm.HasMeshoptCompression;for(const i of n.meshes){if(n.lights&&n.lightMeshIndex===r)continue;if(!i.featureData)continue;i.featureArray=new Dl,i.featureArray.reserve(i.featureData.length);let o=t;for(const t of i.featureData){const r=s?65535&t:t>>16&65535,a=s?t>>16&65535:65535&t,l=(15&a)<8?15&a:0,c=e.evaluatedRMEA[l],h=e.evaluatedColor[l],d=e.emissionHeightBasedParams[l];let u;if(o&&2===l&&n.lights&&(u=new Dl,u.resize(10*n.lights.length)),Bv(i.featureArray,r,h,c,d,i.aabb.min[2],i.aabb.max[2],u),u&&o){o=!1;const e=n.meshes[n.lightMeshIndex];e.featureArray=u,e.featureArray._trim()}}i.featureArray._trim(),r++}}function jv(e,t,i,n){const r=1<<e.z;t.lat=Wc((n/Rn+e.y)/r),t.lng=Vc((i/Rn+e.x)/r)}function Vv(e,t,i,n){const r=e.getNodesInfo()[t];if(!r||r.hiddenByReplacement||!r.node.meshes)return;let s=Number.MAX_VALUE;const o=r.node,a=i.tile,l=n.calculatePosMatrix(a.tileID.toUnwrapped(),n.worldSize),c=r.evaluatedScale;let f=0;n.elevation&&o.elevation&&(f=o.elevation*n.elevation.exaggeration()),d(l,l,[(o.anchor?o.anchor[0]:0)*(c[0]-1),(o.anchor?o.anchor[1]:0)*(c[1]-1),f]),u(l,l,c);const p=i.queryGeometry,m=p.isPointQuery()?p.screenBounds:p.screenGeometry,g=function(e){const t=h([],l,e.matrix);h(t,n.expandedFarZProjMatrix,t);for(let i=0;i<e.meshes.length;++i){const r=e.meshes[i];if(i===e.lightMeshIndex)continue;const o=ym(m,n,t,r.aabb);null!=o&&(s=Math.min(o,s))}if(e.children)for(const t of e.children)g(t)};if(g(o),s===Number.MAX_VALUE)return;const _=new Fc(0,0);return jv(a.tileID.canonical,_,r.node.anchor[0],r.node.anchor[1]),{intersectionZ:s,position:_,feature:r.feature}}Ws(Nv,"Tiled3dModelBucket",{omit:["layers"]}),Ws(Fv,"Tiled3dModelFeature");const Wv={circle:class extends Wa{constructor(e,t,i,n){super(e,{layout:td||(td=new Sa({"circle-sort-key":new ba(Ta.layout_circle["circle-sort-key"]),"circle-elevation-reference":new xa(Ta.layout_circle["circle-elevation-reference"]),visibility:new xa(Ta.layout_circle.visibility)})),paint:id||(id=new Sa({"circle-radius":new ba(Ta.paint_circle["circle-radius"]),"circle-color":new ba(Ta.paint_circle["circle-color"]),"circle-blur":new ba(Ta.paint_circle["circle-blur"]),"circle-opacity":new ba(Ta.paint_circle["circle-opacity"]),"circle-translate":new xa(Ta.paint_circle["circle-translate"]),"circle-translate-anchor":new xa(Ta.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new xa(Ta.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new xa(Ta.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ba(Ta.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ba(Ta.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ba(Ta.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new xa(Ta.paint_circle["circle-emissive-strength"]),"circle-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"circle-stroke-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}createBucket(e){return new Rh(e)}queryRadius(e){const t=e;return Jh("circle-radius",this,t)+Jh("circle-stroke-width",this,t)+Kh(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,i,n,r,s,o,a){const l=ed(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),s.angle,e.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(t,i)+this.paint.get("circle-stroke-width").evaluate(t,i);return Bd(e,n,s,o,a,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getDefaultProgramParams(e,t,i){const n=Yd(this);return{config:new bc(this,{zoom:t,lut:i}),defines:n,overrideFog:!1}}is3D(e){return!e&&!!this.layout&&"none"!==this.layout.get("circle-elevation-reference")}hasElevation(){return this.layout&&"none"!==this.layout.get("circle-elevation-reference")}},heatmap:class extends Wa{createBucket(e){return new Ud(e)}constructor(e,t,i,n){super(e,{layout:$d||($d=new Sa({visibility:new xa(Ta.layout_heatmap.visibility)})),paint:Gd||(Gd=new Sa({"heatmap-radius":new ba(Ta.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ba(Ta.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new xa(Ta.paint_heatmap["heatmap-intensity"]),"heatmap-color":new wa(Ta.paint_heatmap["heatmap-color"]),"heatmap-opacity":new xa(Ta.paint_heatmap["heatmap-opacity"]),"heatmap-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=iu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}_clear(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}queryRadius(e){return Jh("heatmap-radius",this,e)}queryIntersectsFeature(e,t,i,n,r,s,o,a){const l=this.paint.get("heatmap-radius").evaluate(t,i);return Bd(e,n,s,o,a,!0,!0,new xe(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(e,t,i){return"heatmap"===e?{config:new bc(this,{zoom:t,lut:i}),overrideFog:!1}:{}}},hillshade:class extends Wa{constructor(e,t,i,n){super(e,{layout:Xd||(Xd=new Sa({visibility:new xa(Ta.layout_hillshade.visibility)})),paint:qd||(qd=new Sa({"hillshade-illumination-direction":new xa(Ta.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new xa(Ta.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new xa(Ta.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new xa(Ta.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new xa(Ta.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new xa(Ta.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new xa(Ta.paint_hillshade["hillshade-emissive-strength"]),"hillshade-shadow-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"hillshade-highlight-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"hillshade-accent-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}shouldRedrape(){return this.hasOffscreenPass()&&"viewport"===this.paint.get("hillshade-illumination-anchor")}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(e,t,i){return{overrideFog:!1}}},fill:class extends Wa{constructor(e,t,i,n){super(e,{layout:Ku||(Ku=new Sa({"fill-sort-key":new ba(Ta.layout_fill["fill-sort-key"]),visibility:new xa(Ta.layout_fill.visibility),"fill-elevation-reference":new xa(Ta.layout_fill["fill-elevation-reference"]),"fill-construct-bridge-guard-rail":new ba(Ta.layout_fill["fill-construct-bridge-guard-rail"])})),paint:Qu||(Qu=new Sa({"fill-antialias":new xa(Ta.paint_fill["fill-antialias"]),"fill-opacity":new ba(Ta.paint_fill["fill-opacity"]),"fill-color":new ba(Ta.paint_fill["fill-color"]),"fill-outline-color":new ba(Ta.paint_fill["fill-outline-color"]),"fill-translate":new xa(Ta.paint_fill["fill-translate"]),"fill-translate-anchor":new xa(Ta.paint_fill["fill-translate-anchor"]),"fill-pattern":new ba(Ta.paint_fill["fill-pattern"]),"fill-pattern-cross-fade":new xa(Ta.paint_fill["fill-pattern-cross-fade"]),"fill-emissive-strength":new xa(Ta.paint_fill["fill-emissive-strength"]),"fill-z-offset":new ba(Ta.paint_fill["fill-z-offset"]),"fill-bridge-guard-rail-color":new ba(Ta.paint_fill["fill-bridge-guard-rail-color"]),"fill-tunnel-structure-color":new ba(Ta.paint_fill["fill-tunnel-structure-color"]),"fill-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"fill-outline-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"fill-bridge-guard-rail-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"fill-tunnel-structure-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}getProgramIds(){const e=this.paint.get("fill-pattern"),t=e&&e.constantOr(1),i=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getDefaultProgramParams(e,t,i){return{config:new bc(this,{zoom:t,lut:i}),overrideFog:!1}}recalculate(e,t){super.recalculate(e,t);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Ju(e)}queryRadius(){return Kh(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,i,n,r,s){return!e.queryGeometry.isAboveHorizon&&Fh(Qh(e.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),s.angle,e.pixelToTileUnitsFactor),n)}isTileClipped(){return 0===this.paint.get("fill-z-offset").constantOr(1)}is3D(e){if(0!==this.paint.get("fill-z-offset").constantOr(1))return!0;const t=this.layout&&"none"!==this.layout.get("fill-elevation-reference");return null!=e?t&&!e:t}hasElevation(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}hasShadowPass(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}},"fill-extrusion":class extends Wa{constructor(e,t,i,n){super(e,{layout:np||(np=new Sa({visibility:new xa(Ta["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new xa(Ta["layout_fill-extrusion"]["fill-extrusion-edge-radius"])})),paint:rp||(rp=new Sa({"fill-extrusion-opacity":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ba(Ta["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ba(Ta["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-pattern-cross-fade":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-pattern-cross-fade"]),"fill-extrusion-height":new ba(Ta["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ba(Ta["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-height-alignment":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-height-alignment"]),"fill-extrusion-base-alignment":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-base-alignment"]),"fill-extrusion-vertical-gradient":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new ba(Ta["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new ba(Ta["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new ba(Ta["paint_fill-extrusion"]["fill-extrusion-emissive-strength"]),"fill-extrusion-line-width":new ba(Ta["paint_fill-extrusion"]["fill-extrusion-line-width"]),"fill-extrusion-cast-shadows":new xa(Ta["paint_fill-extrusion"]["fill-extrusion-cast-shadows"]),"fill-extrusion-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"fill-extrusion-flood-light-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new $f(e)}queryRadius(){return Kh(this.paint.get("fill-extrusion-translate"))}is3D(e){return!0}hasShadowPass(){return this.paint.get("fill-extrusion-cast-shadows")}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(e,t,i,n,r,s,o,a,l){const c=ed(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,e.pixelToTileUnitsFactor),h=this.paint.get("fill-extrusion-height").evaluate(t,i),d=this.paint.get("fill-extrusion-base").evaluate(t,i),u=[0,0],f=a&&s.elevation,p=s.elevation?s.elevation.exaggeration():1,m=e.tile.getBucket(this);if(f&&m instanceof $f){const e=m.centroidVertexArray,t=l+1;t<e.length&&(u[0]=e.geta_centroid_pos0(t),u[1]=e.geta_centroid_pos1(t))}if(0===u[0]&&1===u[1])return!1;"globe"===s.projection.name&&(n=tp([n],[new xe(0,0),new xe(Rn,Rn)],e.tileID.canonical).map(e=>e.polygon).flat());const g=f?a:null,[_,y]=function(e,t,i,n,r,s,o,a,l,c,h){return"globe"===e.projection.name?function(e,t,i,n,r,s,o,a,l,c,h){const d=[],u=[],f=e.projection.upVectorScale(h,e.center.lat,e.worldSize).metersToTile,p=[0,0,0,1],m=[0,0,0,1],g=(e,t,i,n)=>{e[0]=t,e[1]=i,e[2]=n,e[3]=1},_=ep();i>0&&(i+=_),n+=_;for(const _ of t){const t=[],y=[];for(const d of _){const u=d.x+r.x,_=d.y+r.y,v=e.projection.projectTilePoint(u,_,h),x=e.projection.upVector(h,d.x,d.y);let b=i,w=n;if(o){const e=pp(u,_,i,n,o,a,l,c);b+=e.base,w+=e.top}0!==i?g(p,v.x+x[0]*f*b,v.y+x[1]*f*b,v.z+x[2]*f*b):g(p,v.x,v.y,v.z),g(m,v.x+x[0]*f*w,v.y+x[1]*f*w,v.z+x[2]*f*w),Y(p,p,s),Y(m,m,s),t.push(new sp(p[0],p[1],p[2])),y.push(new sp(m[0],m[1],m[2]))}d.push(t),u.push(y)}return[d,u]}(e,t,i,n,r,s,o,a,l,c,h):o?function(e,t,i,n,r,s,o,a,l){const c=[],h=[],d=[0,0,0,1];for(const u of e){const e=[],f=[];for(const c of u){const h=c.x+n.x,u=c.y+n.y,p=pp(h,u,t,i,s,o,a,l);d[0]=h,d[1]=u,d[2]=p.base,d[3]=1,Z(d,d,r),d[3]=Math.max(d[3],1e-5);const m=new sp(d[0]/d[3],d[1]/d[3],d[2]/d[3]);d[0]=h,d[1]=u,d[2]=p.top,d[3]=1,Z(d,d,r),d[3]=Math.max(d[3],1e-5);const g=new sp(d[0]/d[3],d[1]/d[3],d[2]/d[3]);e.push(m),f.push(g)}c.push(e),h.push(f)}return[c,h]}(t,i,n,r,s,o,a,l,c):function(e,t,i,n,r){const s=[],o=[],a=r[8]*t,l=r[9]*t,c=r[10]*t,h=r[11]*t,d=r[8]*i,u=r[9]*i,f=r[10]*i,p=r[11]*i;for(const t of e){const e=[],i=[];for(const s of t){const t=s.x+n.x,o=s.y+n.y,m=r[0]*t+r[4]*o+r[12],g=r[1]*t+r[5]*o+r[13],_=r[2]*t+r[6]*o+r[14],y=r[3]*t+r[7]*o+r[15],v=m+a,x=g+l,b=_+c,w=Math.max(y+h,1e-5),S=m+d,T=g+u,k=_+f,M=Math.max(y+p,1e-5);e.push(new sp(v/w,x/w,b/w)),i.push(new sp(S/M,T/M,k/M))}s.push(e),o.push(i)}return[s,o]}(t,i,n,r,s)}(s,n,d,h,c,o,g,u,p,s.center.lat,e.tileID.canonical),v=e.queryGeometry;return function(e,t,i){let n=1/0;Fh(i,t)&&(n=fp(i,t[0]));for(let r=0;r<t.length;r++){const s=t[r],o=e[r];for(let e=0;e<s.length-1;e++){const t=s[e],r=[t,s[e+1],o[e+1],o[e],t];Oh(i,r)&&(n=Math.min(n,fp(i,r)))}}return n!==1/0&&n}(_,y,v.isPointQuery()?v.screenBounds:v.screenGeometry)}},building:class extends Wa{constructor(e,t,i,n){super(e,{layout:Gm||(Gm=new Sa({visibility:new xa(Ta.layout_building.visibility),"building-facade":new ba(Ta.layout_building["building-facade"]),"building-facade-floors":new ba(Ta.layout_building["building-facade-floors"]),"building-facade-window":new ba(Ta.layout_building["building-facade-window"]),"building-roof-shape":new ba(Ta.layout_building["building-roof-shape"]),"building-height":new ba(Ta.layout_building["building-height"]),"building-base":new ba(Ta.layout_building["building-base"])})),paint:Xm||(Xm=new Sa({"building-opacity":new xa(Ta.paint_building["building-opacity"]),"building-ambient-occlusion-intensity":new xa(Ta.paint_building["building-ambient-occlusion-intensity"]),"building-ambient-occlusion-ground-intensity":new xa(Ta.paint_building["building-ambient-occlusion-ground-intensity"]),"building-ambient-occlusion-ground-radius":new xa(Ta.paint_building["building-ambient-occlusion-ground-radius"]),"building-ambient-occlusion-ground-attenuation":new xa(Ta.paint_building["building-ambient-occlusion-ground-attenuation"]),"building-vertical-scale":new xa(Ta.paint_building["building-vertical-scale"]),"building-cast-shadows":new xa(Ta.paint_building["building-cast-shadows"]),"building-color":new ba(Ta.paint_building["building-color"]),"building-emissive-strength":new ba(Ta.paint_building["building-emissive-strength"]),"building-facade-emissive-chance":new xa(Ta.paint_building["building-facade-emissive-chance"]),"building-cutoff-fade-range":new xa(Ta.paint_building["building-cutoff-fade-range"]),"building-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new Um(e)}hasShadowPass(){return this.paint.get("building-cast-shadows")}hasLightBeamPass(){return!0}canCastShadows(){return!0}is3D(e){return!0}},line:class extends Wa{constructor(e,t,i,n){const r=_g();super(e,r,t,i,n),r.layout&&(this.layout=new va(r.layout)),this.gradientVersion=0,this.hasElevatedBuckets=!1,this.hasNonElevatedBuckets=!1}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof br,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=(()=>{if(vg)return vg;const e=_g();return vg=new yg(e.paint.properties["line-width"].specification),vg.useIntegerZoom=!0,vg})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new og(e)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(e,t,i){const n=pg(this);return{config:new bc(this,{zoom:t,lut:i}),defines:n,overrideFog:!1}}queryRadius(e){const t=e,i=xg(Jh("line-width",this,t),Jh("line-gap-width",this,t)),n=Jh("line-offset",this,t);return i/2+Math.abs(n)+Kh(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,i,n,r,s){if(e.queryGeometry.isAboveHorizon)return!1;const o=Qh(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,e.pixelToTileUnitsFactor),a=e.pixelToTileUnitsFactor/2*xg(this.paint.get("line-width").evaluate(t,i),this.paint.get("line-gap-width").evaluate(t,i)),l=this.paint.get("line-offset").evaluate(t,i);return l&&(n=function(e,t){const i=[],n=new xe(0,0);for(let r=0;r<e.length;r++){const s=e[r],o=[];for(let e=0;e<s.length;e++){const i=s[e],r=s[e+1],a=0===e?n:i.sub(s[e-1])._unit()._perp(),l=e===s.length-1?n:r.sub(i)._unit()._perp(),c=a._add(l)._unit();c._mult(1/(c.x*l.x+c.y*l.y)),o.push(c._mult(t)._add(i))}i.push(o)}return i}(n,l*e.pixelToTileUnitsFactor)),function(e,t,i){for(let n=0;n<t.length;n++){const r=t[n];if(e.length>=3)for(let t=0;t<r.length;t++)if($h(e,r[t]))return!0;if(Nh(e,r,i))return!0}return!1}(o,n,a)}isTileClipped(){return this.hasNonElevatedBuckets}isDraped(e){return!this.hasElevatedBuckets||this.layout&&"hd-road-markup"===this.layout.get("line-elevation-reference")}hasElevation(){return this.layout&&"none"!==this.layout.get("line-elevation-reference")}},symbol:nv,background:class extends Wa{constructor(e,t,i,n){super(e,{layout:rv||(rv=new Sa({visibility:new xa(Ta.layout_background.visibility)})),paint:sv||(sv=new Sa({"background-pitch-alignment":new xa(Ta.paint_background["background-pitch-alignment"]),"background-color":new xa(Ta.paint_background["background-color"]),"background-pattern":new xa(Ta.paint_background["background-pattern"]),"background-opacity":new xa(Ta.paint_background["background-opacity"]),"background-emissive-strength":new xa(Ta.paint_background["background-emissive-strength"]),"background-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(e,t,i){return{overrideFog:!1}}is3D(e){return"viewport"===this.paint.get("background-pitch-alignment")}},raster:pv,"raster-particle":xv,sky:class extends Wa{constructor(e,t,i,n){super(e,{layout:_v||(_v=new Sa({visibility:new xa(Ta.layout_sky.visibility)})),paint:yv||(yv=new Sa({"sky-type":new xa(Ta.paint_sky["sky-type"]),"sky-atmosphere-sun":new xa(Ta.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new xa(Ta.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new xa(Ta.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new xa(Ta.paint_sky["sky-gradient-radius"]),"sky-gradient":new wa(Ta.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new xa(Ta.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new xa(Ta.paint_sky["sky-atmosphere-color"]),"sky-opacity":new xa(Ta.paint_sky["sky-opacity"]),"sky-gradient-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-halo-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._updateColorRamp()}_clear(){this.skyboxFbo&&(this.skyboxFbo.destroy(),this.skyboxFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this._skyboxInvalidated=!0}_handleSpecialPaintPropertyUpdate(e){"sky-gradient"===e?this._updateColorRamp():"sky-atmosphere-sun"!==e&&"sky-atmosphere-halo-color"!==e&&"sky-atmosphere-color"!==e&&"sky-atmosphere-sun-intensity"!==e||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=iu({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(e){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const t=e.style.light.properties.get("position");return this._lightPosition.azimuthal!==t.azimuthal||this._lightPosition.polar!==t.polar}return!1}getCenter(e,t){if("atmosphere"===this.paint.get("sky-type")){const i=this.paint.get("sky-atmosphere-sun"),n=!i,r=e.style.light,s=r.properties.get("position");return n&&"viewport"===r.properties.get("anchor")&&We("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),n?wv(s.azimuthal,90-s.polar,t):wv(i[0],90-i[1],t)}const i=this.paint.get("sky-gradient-center");return wv(i[0],90-i[1],t)}isSky(){return!0}markSkyboxValid(e){this._skyboxInvalidated=!1,this._lightPosition=e.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const e=this.paint.get("sky-type");return"atmosphere"===e?["skyboxCapture","skybox"]:"gradient"===e?["skyboxGradient"]:null}},slot:class extends Wa{constructor(e,t,i,n){super(e,{paint:vv||(vv=new Sa({}))},t,null)}},model:class extends Wa{constructor(e,t,i,n){super(e,{layout:Dv||(Dv=new Sa({visibility:new xa(Ta.layout_model.visibility),"model-id":new ba(Ta.layout_model["model-id"])})),paint:Lv||(Lv=new Sa({"model-opacity":new ba(Ta.paint_model["model-opacity"]),"model-rotation":new ba(Ta.paint_model["model-rotation"]),"model-scale":new ba(Ta.paint_model["model-scale"]),"model-translation":new ba(Ta.paint_model["model-translation"]),"model-color":new ba(Ta.paint_model["model-color"]),"model-color-mix-intensity":new ba(Ta.paint_model["model-color-mix-intensity"]),"model-type":new xa(Ta.paint_model["model-type"]),"model-cast-shadows":new xa(Ta.paint_model["model-cast-shadows"]),"model-receive-shadows":new xa(Ta.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new xa(Ta.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new ba(Ta.paint_model["model-emissive-strength"]),"model-roughness":new ba(Ta.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new ba(Ta.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new xa(Ta.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new xa(Ta.paint_model["model-front-cutoff"]),"model-color-use-theme":new ba({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new Cv(e)}getProgramIds(){return["model"]}is3D(e){return!0}hasShadowPass(){return!0}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(e){return e instanceof Nv?8191:0}queryIntersectsFeature(e,t,i,n,r,s){if(!this.modelManager)return!1;const o=this.modelManager,l=e.tile.getBucket(this);if(!(l&&l instanceof Cv))return!1;for(const i in l.instancesPerModel){const n=l.instancesPerModel[i],r=void 0!==t.id?t.id:t.properties&&t.properties.hasOwnProperty("id")?t.properties.id:void 0;if(n.idToFeaturesIndex.hasOwnProperty(r)){const t=n.features[n.idToFeaturesIndex[r]],c=o.getModel(i,this.scope);if(!c)return!1;let d=a();const u=new Fc(0,0),f=l.canonical;let p=Number.MAX_VALUE;for(let i=0;i<t.instancedDataCount;++i){const r=16*(t.instancedDataOffset+i),o=n.instancedDataArray.float32,a=[o[r+4],o[r+5],o[r+6]];jv(f,u,o[r],0|o[r+1]),bm(d,c,s,u,t.rotation,t.scale,a,!1,!1,!1),"globe"===s.projection.name&&(d=_m(d,s));const l=h([],s.projMatrix,d),m=e.queryGeometry,g=ym(m.isPointQuery()?m.screenBounds:m.screenGeometry,s,l,c.aabb);null!=g&&(p=Math.min(g,p))}return p!==Number.MAX_VALUE&&p}}return!1}_handleOverridablePaintPropertyUpdate(e,t,i){return!(!this.layout||t.isDataDriven()||i.isDataDriven()||"model-color"!==e&&"model-color-mix-intensity"!==e&&"model-rotation"!==e&&"model-scale"!==e&&"model-translation"!==e&&"model-emissive-strength"!==e)}_isPropertyZoomDependent(e){const t=this._transitionablePaint._values[e];return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof Os}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}},clip:class extends Wa{constructor(e,t,i,n){super(e,{layout:ef||(ef=new Sa({"clip-layer-types":new xa(Ta.layout_clip["clip-layer-types"]),"clip-layer-scope":new xa(Ta.layout_clip["clip-layer-scope"])})),paint:tf||(tf=new Sa({}))},t,i,n)}recalculate(e,t){super.recalculate(e,t)}createBucket(e){return new sf(e)}is3D(e){return!0}}},Uv=new si(0,0,0),$v=1,Gv=2,Xv=1,qv=2,Zv=3,Jv=1,Kv=2,Qv=3,ex=4,tx=1,ix=1,nx=2,rx=3,sx=4,ox=5,ax=1;function lx(e,t,i){1===e&&t.icons.push(function(e,t){return function(e){if(e.usvg_tree.height||(e.usvg_tree.height=e.usvg_tree.width),!e.metadata)return e;const{metadata:t}=e;if(t.content_area){const{content_area:i}=t;null==i.top&&(i.top=i.left),null==i.width&&(i.width=e.usvg_tree.width),null==i.height&&(i.height=i.width)}return t.stretch_x&&t.stretch_x.length&&cx(t,"x"),t.stretch_y&&t.stretch_y.length&&cx(t,"y"),e}(e.readFields(hx,{name:void 0},t))}(i,i.readVarint()+i.pos))}function cx(e,t){const i=[],n=e[`stretch_${t}`];let r=null;for(let e=0;e<n.length;e++)null===r?r=0===i.length?n[0]:i[i.length-1][1]+n[e]:(i.push([r,r+n[e]]),r=null);e[`stretch_${t}_areas`]=i}function hx(e,t,i){1===e?t.name=i.readString():2===e?t.metadata=function(e,t){return e.readFields(dx,{stretch_x:null,stretch_y:null,stretch_x_areas:null,stretch_y_areas:null,variables:[]},t)}(i,i.readVarint()+i.pos):3===e&&(t.usvg_tree=function(e,t){return e.readFields(px,{width:20,children:[],linear_gradients:[],radial_gradients:[],clip_paths:[],masks:[]},t)}(i,i.readVarint()+i.pos),t.data="usvg_tree")}function dx(e,t,i){1===e?t.stretch_x=i.readPackedVarint():2===e?t.stretch_y=i.readPackedVarint():3===e?t.content_area=function(e,t){return e.readFields(ux,{left:0},t)}(i,i.readVarint()+i.pos):4===e&&t.variables.push(function(e,t){return e.readFields(fx,{name:void 0},t)}(i,i.readVarint()+i.pos))}function ux(e,t,i){1===e?t.left=i.readVarint():2===e?t.width=i.readVarint():3===e?t.top=i.readVarint():4===e&&(t.height=i.readVarint())}function fx(e,t,i){1===e?t.name=i.readString():2===e&&(t.rgb_color=wx(i.readVarint()),t.value="rgb_color")}function px(e,t,i){1===e?t.width=t.height=i.readVarint():2===e?t.height=i.readVarint():3===e?t.children.push(mx(i,i.readVarint()+i.pos)):4===e?t.linear_gradients.push(function(e,t){return e.readFields(Tx,{spread_method:1,stops:[],x1:0,y1:0,x2:1,y2:0},t)}(i,i.readVarint()+i.pos)):5===e?t.radial_gradients.push(function(e,t){return e.readFields(Ax,{spread_method:1,stops:[],cx:.5,cy:.5,r:.5,fx:.5,fy:.5,fr:0},t)}(i,i.readVarint()+i.pos)):7===e?t.clip_paths.push(function(e,t){return e.readFields(Cx,{children:[]},t)}(i,i.readVarint()+i.pos)):8===e&&t.masks.push(function(e,t){const i=e.readFields(Dx,{left:0,width:20,mask_type:ax,children:[]},t);return null==i.height&&(i.height=i.width),null==i.top&&(i.top=i.left),i}(i,i.readVarint()+i.pos))}function mx(e,t){return e.readFields(gx,{},t)}function gx(e,t,i){1===e?(t.group=function(e,t){return e.readFields(_x,{opacity:255,children:[]},t)}(i,i.readVarint()+i.pos),t.node="group"):2===e&&(t.path=function(e,t){return e.readFields(xx,{paint_order:1,commands:[],step:1,diffs:[],rule:$v},t)}(i,i.readVarint()+i.pos),t.node="path")}function _x(e,t,i){1===e?t.transform=yx(i,i.readVarint()+i.pos):2===e?t.opacity=i.readVarint():5===e?t.clip_path_idx=i.readVarint():6===e?t.mask_idx=i.readVarint():7===e&&t.children.push(mx(i,i.readVarint()+i.pos))}function yx(e,t){return e.readFields(vx,{sx:1,ky:0,kx:0,sy:1,tx:0,ty:0},t)}function vx(e,t,i){1===e?t.sx=i.readFloat():2===e?t.ky=i.readFloat():3===e?t.kx=i.readFloat():4===e?t.sy=i.readFloat():5===e?t.tx=i.readFloat():6===e&&(t.ty=i.readFloat())}function xx(e,t,i){1===e?t.fill=function(e,t){return e.readFields(bx,{rgb_color:Uv,paint:"rgb_color",opacity:255},t)}(i,i.readVarint()+i.pos):2===e?t.stroke=function(e,t){return e.readFields(Sx,{rgb_color:Uv,paint:"rgb_color",dasharray:[],dashoffset:0,miterlimit:4,opacity:255,width:1,linecap:1,linejoin:1},t)}(i,i.readVarint()+i.pos):3===e?t.paint_order=i.readVarint():5===e?i.readPackedVarint(t.commands):6===e?t.step=i.readFloat():7===e?i.readPackedSVarint(t.diffs):8===e&&(t.rule=i.readVarint())}function bx(e,t,i){1===e?(t.rgb_color=wx(i.readVarint()),t.paint="rgb_color"):2===e?(t.linear_gradient_idx=i.readVarint(),t.paint="linear_gradient_idx"):3===e?(t.radial_gradient_idx=i.readVarint(),t.paint="radial_gradient_idx"):5===e&&(t.opacity=i.readVarint())}function wx(e){return new si((e>>16&255)/255,(e>>8&255)/255,(255&e)/255,1)}function Sx(e,t,i){1===e?(t.rgb_color=wx(i.readVarint()),t.paint="rgb_color"):2===e?(t.linear_gradient_idx=i.readVarint(),t.paint="linear_gradient_idx"):3===e?(t.radial_gradient_idx=i.readVarint(),t.paint="radial_gradient_idx"):5===e?i.readPackedFloat(t.dasharray):6===e?t.dashoffset=i.readFloat():7===e?t.miterlimit=i.readFloat():8===e?t.opacity=i.readVarint():9===e?t.width=i.readFloat():10===e?t.linecap=i.readVarint():11===e&&(t.linejoin=i.readVarint())}function Tx(e,t,i){1===e?t.transform=yx(i,i.readVarint()+i.pos):2===e?t.spread_method=i.readVarint():3===e?t.stops.push(kx(i,i.readVarint()+i.pos)):4===e?t.x1=i.readFloat():5===e?t.y1=i.readFloat():6===e?t.x2=i.readFloat():7===e&&(t.y2=i.readFloat())}function kx(e,t){return e.readFields(Mx,{offset:0,opacity:255,rgb_color:Uv},t)}function Mx(e,t,i){1===e?t.offset=i.readFloat():2===e?t.opacity=i.readVarint():3===e&&(t.rgb_color=wx(i.readVarint()))}function Ax(e,t,i){1===e?t.transform=yx(i,i.readVarint()+i.pos):2===e?t.spread_method=i.readVarint():3===e?t.stops.push(kx(i,i.readVarint()+i.pos)):4===e?t.cx=i.readFloat():5===e?t.cy=i.readFloat():6===e?t.r=i.readFloat():7===e?t.fx=i.readFloat():8===e?t.fy=i.readFloat():9===e&&(t.fr=i.readFloat())}function Cx(e,t,i){1===e?t.transform=yx(i,i.readVarint()+i.pos):2===e?t.clip_path_idx=i.readVarint():3===e&&t.children.push(mx(i,i.readVarint()+i.pos))}function Dx(e,t,i){1===e?t.left=t.top=i.readFloat():2===e?t.width=t.height=i.readFloat():3===e?t.top=i.readFloat():4===e?t.height=i.readFloat():5===e?t.mask_type=i.readVarint():6===e?t.mask_idx=i.readVarint():7===e&&t.children.push(mx(i,i.readVarint()+i.pos))}class Lx{static calculate(e={},t=[]){const i=new Map,n=new Map;if(0===Object.keys(e).length)return i;t.forEach(e=>{n.set(e.name,e.rgb_color||new si(0,0,0))});for(const[t,r]of Object.entries(e))n.has(t)?i.set(n.get(t).toString(),r):console.warn(`Ignoring unknown image variable "${t}"`);return i}}function Ex(e,t=255,i){const n=t/255,r=e.toString(),s=i.has(r)?i.get(r).clone():e.clone();return s.a*=n,s.toString()}function Ix(e,t){if(!ut()){const i=document.createElement("canvas");return i.width=e,i.height=t,i}return new OffscreenCanvas(e,t)}function Px(e,t){const i=Lx.calculate(t.params,e.metadata?e.metadata.variables:[]),n=e.usvg_tree,r=n.width,s=n.height,o=t.transform?t.transform:new DOMMatrix,a=Math.max(1,Math.round(r*o.a)),l=Math.max(1,Math.round(s*o.d)),c=new DOMMatrix([a/r,0,0,l/s,0,0]),h=Ix(a,l).getContext("2d");return Rx(h,c,n,n,i),h.getImageData(0,0,a,l)}function Rx(e,t,i,n,r){for(const s of n.children)Ox(e,t,i,s,r)}function Ox(e,t,i,n,r){n.group?(e.save(),function(e,t,i,n,r){const s=null!=n.mask_idx?i.masks[n.mask_idx]:null,o=null!=n.clip_path_idx?i.clip_paths[n.clip_path_idx]:null;if(n.transform&&(t=Wx(n.transform).preMultiplySelf(t)),!function(e,t,i){return 255!==e.opacity||t||i}(n,null!=o,null!=s))return void Rx(e,t,i,n,r);const a=Ix(e.canvas.width,e.canvas.height),l=a.getContext("2d");Rx(l,t,i,n,r),o&&jx(l,t,i,o),s&&Vx(l,t,i,s,r),e.globalAlpha=n.opacity/255,e.drawImage(a,0,0)}(e,t,i,n.group,r),e.restore()):n.path&&(e.save(),function(e,t,i,n,r){e.setTransform(t),n.paint_order===tx?(zx(e,i,n,r),Nx(e,i,n,r)):(Nx(e,i,n,r),zx(e,i,n,r))}(e,t,i,n.path,r),e.restore())}function zx(e,t,i,n){const r=i.fill;if(!r)return;const s=r.opacity/255;switch(e.save(),e.beginPath(),Ux(i,e),r.paint){case"rgb_color":e.fillStyle=Ex(r.rgb_color,r.opacity,n);break;case"linear_gradient_idx":{const i=t.linear_gradients[r.linear_gradient_idx];i.transform&&e.setTransform(Wx(i.transform).preMultiplySelf(e.getTransform())),e.fillStyle=Yx(e,i,s,n);break}case"radial_gradient_idx":{const i=t.radial_gradients[r.radial_gradient_idx];i.transform&&e.setTransform(Wx(i.transform).preMultiplySelf(e.getTransform())),e.fillStyle=Bx(e,i,s,n)}}e.fill(Fx(i)),e.restore()}function Fx(e){return e.rule===$v?"nonzero":e.rule===Gv?"evenodd":void 0}function Nx(e,t,i,n){const r=i.stroke;if(!r)return;const s=$x(i);e.lineWidth=r.width,e.miterLimit=r.miterlimit,e.setLineDash(r.dasharray),e.lineDashOffset=r.dashoffset;const o=r.opacity/255;switch(r.paint){case"rgb_color":e.strokeStyle=Ex(r.rgb_color,r.opacity,n);break;case"linear_gradient_idx":e.strokeStyle=Yx(e,t.linear_gradients[r.linear_gradient_idx],o,n,!0);break;case"radial_gradient_idx":e.strokeStyle=Bx(e,t.radial_gradients[r.radial_gradient_idx],o,n,!0)}switch(r.linejoin){case Kv:case Jv:e.lineJoin="miter";break;case Qv:e.lineJoin="round";break;case ex:e.lineJoin="bevel"}switch(r.linecap){case Xv:e.lineCap="butt";break;case qv:e.lineCap="round";break;case Zv:e.lineCap="square"}e.stroke(s)}function Yx(e,t,i,n,r=!1){if(1===t.stops.length){const e=t.stops[0];return Ex(e.rgb_color,e.opacity*i,n)}const{x1:s,y1:o,x2:a,y2:l}=t;let c=new DOMPoint(s,o),h=new DOMPoint(a,l);if(r){const e=Wx(t.transform);c=e.transformPoint(c),h=e.transformPoint(h)}const d=e.createLinearGradient(c.x,c.y,h.x,h.y);for(const e of t.stops)d.addColorStop(e.offset,Ex(e.rgb_color,e.opacity*i,n));return d}function Bx(e,t,i,n,r=!1){if(1===t.stops.length){const e=t.stops[0];return Ex(e.rgb_color,e.opacity*i,n)}const s=Wx(t.transform),{fx:o,fy:a,fr:l,cx:c,cy:h,r:d}=t;let u=new DOMPoint(o,a),f=new DOMPoint(c,h),p=l,m=d;if(r){u=s.transformPoint(u),f=s.transformPoint(f);const e=(s.a+s.d)/2;p=l*e,m=t.r*e}const g=e.createRadialGradient(u.x,u.y,p,f.x,f.y,m);for(const e of t.stops)g.addColorStop(e.offset,Ex(e.rgb_color,e.opacity*i,n));return g}function Hx(e,t,i,n){const r=n.transform?Wx(n.transform).preMultiplySelf(t):t,s=Ix(e.canvas.width,e.canvas.height),o=s.getContext("2d");for(const e of n.children)if(e.group)Hx(o,r,i,e.group);else if(e.path){const t=e.path,i=new Path2D;i.addPath($x(t),r),o.fill(i,Fx(t))}const a=null!=n.clip_path_idx?i.clip_paths[n.clip_path_idx]:null;a&&jx(o,r,i,a),e.globalCompositeOperation="source-over",e.drawImage(s,0,0)}function jx(e,t,i,n){const r=Ix(e.canvas.width,e.canvas.height);Hx(r.getContext("2d"),t,i,n),e.globalCompositeOperation="destination-in",e.drawImage(r,0,0)}function Vx(e,t,i,n,r){if(0===n.children.length)return;const s=null!=n.mask_idx?i.masks[n.mask_idx]:null;s&&Vx(e,t,i,s,r);const o=e.canvas.width,a=e.canvas.height,l=Ix(o,a),c=l.getContext("2d"),h=n.width,d=n.height,u=n.left,f=n.top,p=new Path2D,m=new Path2D;m.rect(u,f,h,d),p.addPath(m,t),c.clip(p);for(const e of n.children)Ox(c,t,i,e,r);const g=c.getImageData(0,0,o,a),_=g.data;if(n.mask_type===ax)for(let e=0;e<_.length;e+=4)_[e+3]=_[e+3]/255*(.2126*_[e]+.7152*_[e+1]+.0722*_[e+2]);c.putImageData(g,0,0),e.globalCompositeOperation="destination-in",e.drawImage(l,0,0)}function Wx(e){return e?new DOMMatrix([e.sx,e.ky,e.kx,e.sy,e.tx,e.ty]):new DOMMatrix}function Ux(e,t){const i=e.step;let n=e.diffs[0]*i,r=e.diffs[1]*i;t.moveTo(n,r);for(let s=0,o=2;s<e.commands.length;s++)switch(e.commands[s]){case ix:n+=e.diffs[o++]*i,r+=e.diffs[o++]*i,t.moveTo(n,r);break;case nx:n+=e.diffs[o++]*i,r+=e.diffs[o++]*i,t.lineTo(n,r);break;case rx:{const s=n+e.diffs[o++]*i,a=r+e.diffs[o++]*i;n=s+e.diffs[o++]*i,r=a+e.diffs[o++]*i,t.quadraticCurveTo(s,a,n,r);break}case sx:{const s=n+e.diffs[o++]*i,a=r+e.diffs[o++]*i,l=s+e.diffs[o++]*i,c=a+e.diffs[o++]*i;n=l+e.diffs[o++]*i,r=c+e.diffs[o++]*i,t.bezierCurveTo(s,a,l,c,n,r);break}case ox:t.closePath()}return t}function $x(e){return Ux(e,new Path2D)}class Gx{constructor(e){this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}put(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size===this.capacity&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,t)}delete(e){this.cache.delete(e)}}Ws(Gx,"LRUCache");class Xx{constructor(){this.cacheMap=new Map,this.cacheDependenciesMap=new Map}static _getImage(e){return new eu(e,e.data)}getFromCache(e,t,i){return this.cacheMap.has(i)||this.cacheMap.set(i,new Gx(150)),this.cacheMap.get(i).get(Ha(e.toString(),t))}setInCache(e,t,i,n){this.cacheDependenciesMap.has(n)||this.cacheDependenciesMap.set(n,new Map),this.cacheMap.has(n)||this.cacheMap.set(n,new Gx(150));const r=this.cacheDependenciesMap.get(n),s=Ha(e.id.toString(),i);r.get(s)||r.set(s,new Set);const o=this.cacheMap.get(n),a=e.toString();r.get(s).add(a),o.put(Ha(e.toString(),i),t)}removeImagesFromCacheByIds(e,t,i=0){if(!this.cacheMap.has(i)||!this.cacheDependenciesMap.has(i))return;const n=this.cacheMap.get(i),r=this.cacheDependenciesMap.get(i);for(const i of e){const e=Ha(i.toString(),t);if(r.has(e)){for(const t of r.get(e))n.delete(t);r.delete(e)}}}rasterize(e,t,i,n,r=Px){const s=this.getFromCache(e,i,n);if(s)return s.clone();const o=r(t.icon,e.options),a=Xx._getImage(o);return this.setInCache(e,a,i,n),a.clone()}}class qx{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const i=this.toIdx(e,t);return{min:this.minimums[i],max:this.maximums[i]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function Zx(e,t,i,n){let r=0,s=Number.MAX_VALUE;for(let o=0;o<3;o++)if(Math.abs(n[o])<1e-15){if(i[o]<e[o]||i[o]>t[o])return null}else{const a=1/n[o];let l=(e[o]-i[o])*a,c=(t[o]-i[o])*a;if(l>c){const e=l;l=c,c=e}if(l>r&&(r=l),c<s&&(s=c),r>s)return null}return r}function Jx(e,t,i,n,r,s,o,a,l,c,h){const d=n-e,u=r-t,f=s-i,p=o-e,m=a-t,g=l-i,_=h[1]*g-h[2]*m,y=h[2]*p-h[0]*g,v=h[0]*m-h[1]*p,x=d*_+u*y+f*v;if(Math.abs(x)<1e-15)return null;const b=1/x,w=c[0]-e,S=c[1]-t,T=c[2]-i,k=(w*_+S*y+T*v)*b;if(k<0||k>1)return null;const M=S*f-T*u,A=T*d-w*f,C=w*u-S*d,D=(h[0]*M+h[1]*A+h[2]*C)*b;return D<0||k+D>1?null:(p*M+m*A+g*C)*b}function Kx(e,t,i){return(e-t)/(i-t)}function Qx(e,t,i,n,r,s,o,a,l){const c=1<<i,h=s-n,d=o-r,u=(e+1)/c*h+n,f=(t+0)/c*d+r,p=(t+1)/c*d+r;a[0]=(e+0)/c*h+n,a[1]=f,l[0]=u,l[1]=p}class eb{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const t=function(e){const t=Math.ceil(Math.log2(e.dim/8)),i=[];let n=Math.ceil(Math.pow(2,t));const r=1/n,s=(e,t,i,n,r)=>{const s=n?1:0,o=(e+1)*i-s,a=t*i,l=(t+1)*i-s;r[0]=e*i,r[1]=a,r[2]=o,r[3]=l};let o=new qx(n);const a=[];for(let t=0;t<n*n;t++){s(t%n,Math.floor(t/n),r,!1,a);const i=ib(a[0],a[1],e),l=ib(a[2],a[1],e),c=ib(a[2],a[3],e),h=ib(a[0],a[3],e);o.minimums.push(Math.min(i,l,c,h)),o.maximums.push(Math.max(i,l,c,h)),o.leaves.push(1)}for(i.push(o),n/=2;n>=1;n/=2){const e=i[i.length-1];o=new qx(n);for(let t=0;t<n*n;t++){s(t%n,Math.floor(t/n),2,!0,a);const i=e.getElevation(a[0],a[1]),r=e.getElevation(a[2],a[1]),l=e.getElevation(a[2],a[3]),c=e.getElevation(a[0],a[3]),h=e.isLeaf(a[0],a[1]),d=e.isLeaf(a[2],a[1]),u=e.isLeaf(a[2],a[3]),f=e.isLeaf(a[0],a[3]),p=Math.min(i.min,r.min,l.min,c.min),m=Math.max(i.max,r.max,l.max,c.max),g=h&&d&&u&&f;o.maximums.push(m),o.minimums.push(p),o.leaves.push(m-p<=5&&g?1:0)}i.push(o)}return i}(this.dem),i=t.length-1,n=t[i];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(t,0,0,i,0)}raycastRoot(e,t,i,n,r,s,o=1){return Zx([e,t,-100],[i,n,this.maximums[0]*o],r,s)}raycast(e,t,i,n,r,s,o=1){if(!this.nodeCount)return null;const a=this.raycastRoot(e,t,i,n,r,s,o);if(null==a)return null;const l=[],c=[],h=[],d=[],u=[{idx:0,t:a,nodex:0,nodey:0,depth:0}];for(;u.length>0;){const{idx:a,t:f,nodex:p,nodey:m,depth:g}=u.pop();if(this.leaves[a]){Qx(p,m,g,e,t,i,n,h,d);const a=1<<g,l=(p+0)/a,c=(p+1)/a,u=(m+0)/a,_=(m+1)/a,y=ib(l,u,this.dem)*o,v=ib(c,u,this.dem)*o,x=ib(c,_,this.dem)*o,b=ib(l,_,this.dem)*o,w=Jx(h[0],h[1],y,d[0],h[1],v,d[0],d[1],x,r,s),S=Jx(d[0],d[1],x,h[0],d[1],b,h[0],h[1],y,r,s),T=Math.min(null!==w?w:Number.MAX_VALUE,null!==S?S:Number.MAX_VALUE);if(T!==Number.MAX_VALUE)return T;{const e=E([],r,s,f);if(tb(y,v,b,x,Kx(e[0],h[0],d[0]),Kx(e[1],h[1],d[1]))>=e[2])return f}continue}let _=0;for(let u=0;u<this._siblingOffset.length;u++){Qx((p<<1)+this._siblingOffset[u][0],(m<<1)+this._siblingOffset[u][1],g+1,e,t,i,n,h,d),h[2]=-100,d[2]=this.maximums[this.childOffsets[a]+u]*o;const f=Zx(h,d,r,s);if(null!=f){const e=f;l[u]=e;let t=!1;for(let i=0;i<_&&!t;i++)e>=l[c[i]]&&(c.splice(i,0,u),t=!0);t||(c[_]=u),_++}}for(let e=0;e<_;e++){const t=c[e];u.push({idx:this.childOffsets[a]+t,t:l[t],nodex:(p<<1)+this._siblingOffset[t][0],nodey:(m<<1)+this._siblingOffset[t][1],depth:g+1})}}return null}_addNode(e,t,i){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(i),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,i,n,r){if(1===e[n].isLeaf(t,i))return;this.childOffsets[r]||(this.childOffsets[r]=this.nodeCount);const s=n-1,o=e[s];let a=0,l=0;for(let e=0;e<this._siblingOffset.length;e++){const n=2*t+this._siblingOffset[e][0],r=2*i+this._siblingOffset[e][1],s=o.getElevation(n,r),c=o.isLeaf(n,r),h=this._addNode(s.min,s.max,c);c&&(a|=1<<e),l||(l=h)}for(let n=0;n<this._siblingOffset.length;n++)a&1<<n||this._construct(e,2*t+this._siblingOffset[n][0],2*i+this._siblingOffset[n][1],s,l+n)}}function tb(e,t,i,n,r,s){return ci(ci(e,i,s),ci(t,n,s),r)}function ib(e,t,i){const n=i.dim,r=Le(e*n-.5,0,n-1),s=Le(t*n-.5,0,n-1),o=Math.floor(r),a=Math.floor(s),l=Math.min(o+1,n-1),c=Math.min(a+1,n-1);return tb(i.get(o,a),i.get(l,a),i.get(o,c),i.get(l,c),r-o,s-a)}const nb={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function rb(e,t,i){return(256*e*256+256*t+i)/10-1e4}function sb(e,t,i){return 256*e+t+i/256-32768}class ob{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,t,i,n=!1){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return void We(`"${i}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const r=this.dim=t.height-2,s=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.floatView=new Float32Array(t.data.buffer),this.borderReady=n,this._modifiedForSources={},!n){for(let e=0;e<r;e++)s[this._idx(-1,e)]=s[this._idx(0,e)],s[this._idx(r,e)]=s[this._idx(r-1,e)],s[this._idx(e,-1)]=s[this._idx(e,0)],s[this._idx(e,r)]=s[this._idx(e,r-1)];s[this._idx(-1,-1)]=s[this._idx(0,0)],s[this._idx(r,-1)]=s[this._idx(r-1,0)],s[this._idx(-1,r)]=s[this._idx(0,r-1)],s[this._idx(r,r)]=s[this._idx(r-1,r-1)]}const o="terrarium"===i?sb:rb;for(let e=0;e<s.length;++e){const t=4*e;this.floatView[e]=o(this.pixels[t],this.pixels[t+1],this.pixels[t+2])}this._timestamp=ft.now()}_buildQuadTree(){this._tree=new eb(this)}get(e,t,i=!1){i&&(e=Le(e,-1,this.dim),t=Le(t,-1,this.dim));const n=this._idx(e,t);return this.floatView[n]}set(e,t,i){const n=this._idx(e,t),r=this.floatView[n];return this.floatView[n]=i,i-r}static getUnpackVector(e){return nb[e]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const i=[0,0,0,0],n=ob.getUnpackVector(t);let r=Math.floor((e+n[3])/n[2]);return i[2]=r%256,r=Math.floor(r/256),i[1]=r%256,r=Math.floor(r/256),i[0]=r,i}getPixels(){return new tu({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,i){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=t*this.dim,r=t*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(t){case-1:n=r-1;break;case 1:r=n+1}switch(i){case-1:s=o-1;break;case 1:o=s+1}const a=-t*this.dim,l=-i*this.dim;for(let t=s;t<o;t++)for(let i=n;i<r;i++){const n=4*this._idx(i,t),r=4*this._idx(i+a,t+l);this.pixels[n+0]=e.pixels[r+0],this.pixels[n+1]=e.pixels[r+1],this.pixels[n+2]=e.pixels[r+2],this.pixels[n+3]=e.pixels[r+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}function ab(e,t,i){1===e?t.headerLength=i.readFixed32():2===e?t.x=i.readVarint():3===e?t.y=i.readVarint():4===e?t.z=i.readVarint():5===e&&t.layers.push(function(e,t){return e.readFields(ub,{version:0,name:"",units:"",tileSize:0,buffer:0,pixelFormat:0,dataIndex:[]},t)}(i,i.readVarint()+i.pos))}function lb(e,t,i){1===e?(t.delta_filter=function(e,t){return e.readFields(cb,{blockSize:0},t)}(i,i.readVarint()+i.pos),t.filter="delta_filter"):2===e?(i.readVarint(),t.filter="zigzag_filter"):3===e?(i.readVarint(),t.filter="bitshuffle_filter"):4===e&&(i.readVarint(),t.filter="byteshuffle_filter")}function cb(e,t,i){1===e&&(t.blockSize=i.readVarint())}function hb(e,t,i){1===e?(i.readVarint(),t.codec="gzip_data"):2===e?(i.readVarint(),t.codec="jpeg_image"):3===e?(i.readVarint(),t.codec="webp_image"):4===e&&(i.readVarint(),t.codec="png_image")}function db(e,t,i){let n=0,r=0;1===e?t.firstByte=i.readFixed64():2===e?t.lastByte=i.readFixed64():3===e?t.filters.push(function(e,t){return e.readFields(lb,{},t)}(i,i.readVarint()+i.pos)):4===e?t.codec=function(e,t){return e.readFields(hb,{},t)}(i,i.readVarint()+i.pos):5===e?r=i.readFloat():6===e?n=i.readFloat():7===e?t.bands.push(i.readString()):8===e?t.offset=i.readDouble():9===e&&(t.scale=i.readDouble()),0===t.offset&&(t.offset=r),0===t.scale&&(t.scale=n)}function ub(e,t,i){1===e?t.version=i.readVarint():2===e?t.name=i.readString():3===e?t.units=i.readString():4===e?t.tileSize=i.readVarint():5===e?t.buffer=i.readVarint():6===e?t.pixelFormat=i.readVarint():7===e&&t.dataIndex.push(function(e,t){return e.readFields(db,{firstByte:0,lastByte:0,filters:[],codec:null,offset:0,scale:0,bands:[]},t)}(i,i.readVarint()+i.pos))}function fb(e,t,i){if(2===e)!function(e,t,i){e.readFields(pb,i,t)}(i,i.readVarint()+i.pos,t);else if(3===e)throw new Error("Not implemented")}function pb(e,t,i){if(1===e){let e=0;const n=i.readVarint()+i.pos;for(;i.pos<n;)t[e++]=i.readVarint()}}function mb(e,t){if(4!==t.length)throw new Error(`Expected data of dimension 4 but got ${t.length}.`);let i=t[3];for(let n=2;n>=1;n--){const r=1===n?1:0,s=2===n?1:0;for(let n=0;n<t[0];n++){const o=t[1]*n;for(let n=r;n<t[1];n++){const r=t[2]*(n+o);for(let n=s;n<t[2];n++){const s=t[3]*(n+r);for(let n=0;n<t[3];n++){const t=s+n;e[t]+=e[t-i]}}}}i*=t[n]}return e}function gb(e){for(let t=0,i=e.length;t<i;t++)e[t]=e[t]>>>1^-(1&e[t]);return e}function _b(e,t){switch(t){case"uint32":return e;case"uint16":for(let t=0;t<e.length;t+=2){const i=e[t],n=e[t+1];e[t]=(240&i)>>4|(61440&i)>>8|(240&n)<<4|61440&n,e[t+1]=15&i|(3840&i)>>4|(15&n)<<8|(3840&n)<<4}return e;case"uint8":for(let t=0;t<e.length;t+=4){const i=e[t],n=e[t+1],r=e[t+2],s=e[t+3];e[t+0]=(192&i)>>6|(192&n)>>4|(192&r)>>2|192&s,e[t+1]=(48&i)>>4|(48&n)>>2|48&r|(48&s)<<2,e[t+2]=(12&i)>>2|12&n|(12&r)<<2|(12&s)<<4,e[t+3]=3&i|(3&n)<<2|(3&r)<<4|(3&s)<<6}return e;default:throw new Error(`Invalid pixel format, "${t}"`)}}Ws(ob,"DEMData"),Ws(eb,"DemMinMaxQuadTree",{omit:["dem"]});var yb=Uint8Array,vb=Uint16Array,xb=Int32Array,bb=new yb([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),wb=new yb([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Sb=new yb([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tb=function(e,t){for(var i=new vb(31),n=0;n<31;++n)i[n]=t+=1<<e[n-1];var r=new xb(i[30]);for(n=1;n<30;++n)for(var s=i[n];s<i[n+1];++s)r[s]=s-i[n]<<5|n;return{b:i,r}},kb=Tb(bb,2),Mb=kb.b,Ab=kb.r;Mb[28]=258,Ab[258]=28;for(var Cb=Tb(wb,0).b,Db=new vb(32768),Lb=0;Lb<32768;++Lb){var Eb=(43690&Lb)>>1|(21845&Lb)<<1;Db[Lb]=((65280&(Eb=(61680&(Eb=(52428&Eb)>>2|(13107&Eb)<<2))>>4|(3855&Eb)<<4))>>8|(255&Eb)<<8)>>1}var Ib=function(e,t,i){for(var n=e.length,r=0,s=new vb(t);r<n;++r)e[r]&&++s[e[r]-1];var o,a=new vb(t);for(r=1;r<t;++r)a[r]=a[r-1]+s[r-1]<<1;o=new vb(1<<t);var l=15-t;for(r=0;r<n;++r)if(e[r])for(var c=r<<4|e[r],h=t-e[r],d=a[e[r]-1]++<<h,u=d|(1<<h)-1;d<=u;++d)o[Db[d]>>l]=c;return o},Pb=new yb(288);for(Lb=0;Lb<144;++Lb)Pb[Lb]=8;for(Lb=144;Lb<256;++Lb)Pb[Lb]=9;for(Lb=256;Lb<280;++Lb)Pb[Lb]=7;for(Lb=280;Lb<288;++Lb)Pb[Lb]=8;var Rb=new yb(32);for(Lb=0;Lb<32;++Lb)Rb[Lb]=5;var Ob=Ib(Pb,9),zb=Ib(Rb,5),Fb=function(e){for(var t=e[0],i=1;i<e.length;++i)e[i]>t&&(t=e[i]);return t},Nb=function(e,t,i){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&i},Yb=function(e,t){var i=t/8|0;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&t)},Bb=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Hb=function(e,t,i){var n=new Error(t||Bb[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Hb),!i)throw n;return n},jb=new yb(0),Vb="undefined"!=typeof TextDecoder&&new TextDecoder;try{Vb.decode(jb,{stream:!0})}catch(e){}const Wb={gzip_data:"gzip"};class Ub extends Error{constructor(e){super(e),this.name="MRTError"}}const $b={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},Gb={uint32:1,uint16:2,uint8:4},Xb={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let qb;class Zb{constructor(e=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=e}getLayer(e){const t=this.layers[e];if(!t)throw new Ub(`Layer '${e}' not found`);return t}getHeaderLength(e){const t=new Uint8Array(e),i=new DataView(e);if(13!==t[0])throw new Ub("File is not a valid MRT.");return i.getUint32(1,!0)}parseHeader(e){const t=new Uint8Array(e),i=this.getHeaderLength(e);if(t.length<i)throw new Ub(`Expected header with length >= ${i} but got buffer of length ${t.length}`);const n=new qb(t.subarray(0,i)).readFields(ab,{headerLength:0,x:0,y:0,z:0,layers:[]},void 0);if(!isNaN(this.x)&&(this.x!==n.x||this.y!==n.y||this.z!==n.z))throw new Ub(`Invalid attempt to parse header ${n.z}/${n.x}/${n.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=n.x,this.y=n.y,this.z=n.z;for(const e of n.layers)this.layers[e.name]=new Jb(e,{cacheSize:this._cacheSize});return this}createDecodingTask(e){const t=[],i=this.getLayer(e.layerName);for(let n of e.blockIndices){const r=i.dataIndex[n],s=r.firstByte-e.firstByte,o=r.lastByte-e.firstByte;if(i._blocksInProgress.has(n))continue;const a={layerName:i.name,firstByte:s,lastByte:o,pixelFormat:i.pixelFormat,blockIndex:n,blockShape:[r.bands.length].concat(i.bandShape),buffer:i.buffer,codec:r.codec.codec,filters:r.filters.map(e=>e.filter)};i._blocksInProgress.add(n),t.push(a)}return new Kb(t,()=>{t.forEach(e=>i._blocksInProgress.delete(e.blockIndex))},(e,n)=>{if(t.forEach(e=>i._blocksInProgress.delete(e.blockIndex)),e)throw e;n.forEach(e=>{this.getLayer(e.layerName).processDecodedData(e)})})}}class Jb{constructor({version:e,name:t,units:i,tileSize:n,pixelFormat:r,buffer:s,dataIndex:o},a){if(this.version=e,1!==this.version)throw new Ub(`Cannot parse raster layer encoded with MRT version ${e}`);this.name=t,this.units=i,this.tileSize=n,this.buffer=s,this.pixelFormat=$b[r],this.dataIndex=o,this.bandShape=[n+2*s,n+2*s,Gb[this.pixelFormat]],this._decodedBlocks=new Gx(a?a.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return Gb[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map(({bands:e})=>e).flat()}processDecodedData(e){const t=e.blockIndex.toString();this._decodedBlocks.get(t)||this._decodedBlocks.put(t,e.data)}getBlockForBand(e){let t=0;switch(typeof e){case"string":for(const[i,n]of this.dataIndex.entries()){for(const[r,s]of n.bands.entries())if(s===e)return{bandIndex:t+r,blockIndex:i,blockBandIndex:r};t+=n.bands.length}break;case"number":for(const[i,n]of this.dataIndex.entries()){if(e>=t&&e<t+n.bands.length)return{bandIndex:e,blockIndex:i,blockBandIndex:e-t};t+=n.bands.length}break;default:throw new Ub(`Invalid band \`${JSON.stringify(e)}\`. Expected string or integer.`)}return{blockIndex:-1,blockBandIndex:-1}}getDataRange(e){let t=1/0,i=-1/0;const n=[],r=new Set;for(const s of e){const{blockIndex:e}=this.getBlockForBand(s);if(e<0)throw new Ub(`Invalid band: ${JSON.stringify(s)}`);const o=this.dataIndex[e];n.includes(e)||n.push(e),r.add(e),t=Math.min(t,o.firstByte),i=Math.max(i,o.lastByte)}if(r.size>this.cacheSize)throw new Ub(`Number of blocks to decode (${r.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:t,lastByte:i,blockIndices:n}}hasBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0}hasDataForBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0&&!!this._decodedBlocks.get(t.toString())}getBandView(e){const{blockIndex:t,blockBandIndex:i}=this.getBlockForBand(e);if(t<0)throw new Ub(`Band not found: ${JSON.stringify(e)}`);const n=this._decodedBlocks.get(t.toString());if(!n)throw new Ub(`Data for band ${JSON.stringify(e)} of layer "${this.name}" not decoded.`);const r=this.dataIndex[t],s=this.bandShape.reduce((e,t)=>e*t,1),o=i*s,a=n.subarray(o,o+s);return{data:a,bytes:new Uint8Array(a.buffer).subarray(a.byteOffset,a.byteOffset+a.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:r.offset,scale:r.scale}}}Zb.setPbf=function(e){qb=e};class Kb{constructor(e,t,i){this.tasks=e,this._onCancel=t,this._onComplete=i,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(e,t){this._finalized||(this._onComplete(e,t),this._finalized=!0)}}Zb.performDecoding=function(e,t){const i=new Uint8Array(e);return Promise.all(t.tasks.map(e=>{const{layerName:t,firstByte:n,lastByte:r,pixelFormat:s,blockShape:o,blockIndex:a,filters:l,codec:c}=e,h=i.subarray(n,r+1),d=new Uint32Array(o[0]*o[1]*o[2]);let u;if("gzip_data"!==c)throw new Ub(`Unhandled codec: ${c}`);return u=function(e,t){if(!globalThis.DecompressionStream&&"gzip_data"===t)return Promise.resolve(((s=function(e){31==e[0]&&139==e[1]&&8==e[2]||Hb(6,"invalid gzip data");var t=e[3],i=10;4&t&&(i+=2+(e[10]|e[11]<<8));for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!e[i++]);return i+(2&t)}(r=e))+8>r.length&&Hb(6,"invalid gzip data"),function(e,t,i){var n=e.length;if(!n||t.f&&!t.l)return i||new yb(0);var r=!i,s=r||2!=t.i,o=t.i;r&&(i=new yb(3*n));var a,l,c=function(e){var t=i.length;if(e>t){var n=new yb(Math.max(2*t,e));n.set(i),i=n}},h=t.f||0,d=t.p||0,u=t.b||0,f=t.l,p=t.d,m=t.m,g=t.n,_=8*n;do{if(!f){h=Nb(e,d,1);var y=Nb(e,d+1,3);if(d+=3,!y){var v=e[(L=4+((d+7)/8|0))-4]|e[L-3]<<8,x=L+v;if(x>n){o&&Hb(0);break}s&&c(u+v),i.set(e.subarray(L,x),u),t.b=u+=v,t.p=d=8*x,t.f=h;continue}if(1==y)f=Ob,p=zb,m=9,g=5;else if(2==y){var b=Nb(e,d,31)+257,w=Nb(e,d+10,15)+4,S=b+Nb(e,d+5,31)+1;d+=14;for(var T=new yb(S),k=new yb(19),M=0;M<w;++M)k[Sb[M]]=Nb(e,d+3*M,7);d+=3*w;var A=Fb(k),C=(1<<A)-1,D=Ib(k,A);for(M=0;M<S;){var L,E=D[Nb(e,d,C)];if(d+=15&E,(L=E>>4)<16)T[M++]=L;else{var I=0,P=0;for(16==L?(P=3+Nb(e,d,3),d+=2,I=T[M-1]):17==L?(P=3+Nb(e,d,7),d+=3):18==L&&(P=11+Nb(e,d,127),d+=7);P--;)T[M++]=I}}var R=T.subarray(0,b),O=T.subarray(b);m=Fb(R),g=Fb(O),f=Ib(R,m),p=Ib(O,g)}else Hb(1);if(d>_){o&&Hb(0);break}}s&&c(u+131072);for(var z=(1<<m)-1,F=(1<<g)-1,N=d;;N=d){var Y=(I=f[Yb(e,d)&z])>>4;if((d+=15&I)>_){o&&Hb(0);break}if(I||Hb(2),Y<256)i[u++]=Y;else{if(256==Y){N=d,f=null;break}var B=Y-254;Y>264&&(B=Nb(e,d,(1<<(V=bb[M=Y-257]))-1)+Mb[M],d+=V);var H=p[Yb(e,d)&F],j=H>>4;if(H||Hb(3),d+=15&H,O=Cb[j],j>3){var V=wb[j];O+=Yb(e,d)&(1<<V)-1,d+=V}if(d>_){o&&Hb(0);break}s&&c(u+131072);var W=u+B;if(u<O){var U=0-O,$=Math.min(O,W);for(U+u<0&&Hb(3);u<$;++u)i[u]=(void 0)[U+u]}for(;u<W;++u)i[u]=i[u-O]}}t.l=f,t.p=N,t.b=u,t.f=h,f&&(h=1,t.m=m,t.d=p,t.n=g)}while(!h);return u!=i.length&&r?(a=i,(null==(l=u)||l>a.length)&&(l=a.length),new yb(a.subarray(0,l))):i.subarray(0,u)}(r.subarray(s,-8),{i:2},new yb(((i=r)[(n=i.length)-4]|i[n-3]<<8|i[n-2]<<16|i[n-1]<<24)>>>0))));var i,n,r,s;const o=Wb[t];if(!o)throw new Error(`Unhandled codec: ${t}`);const a=new globalThis.DecompressionStream(o);return new Response(new Blob([e]).stream().pipeThrough(a)).arrayBuffer().then(e=>new Uint8Array(e))}(h,c).then(e=>(function(e,t){e.readFields(fb,t)}(new qb(e),d),new(0,Xb[s])(d.buffer))),u.then(e=>{for(let t=l.length-1;t>=0;t--)switch(l[t]){case"delta_filter":mb(e,o);break;case"zigzag_filter":gb(e);break;case"bitshuffle_filter":_b(e,s);break;default:throw new Ub(`Unhandled filter "${l[t]}"`)}return{layerName:t,blockIndex:a,data:e}}).catch(e=>{throw e})}))},Ws(Kb,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]}),Ws(Zb,"MapboxRasterTile"),Ws(Jb,"MapboxRasterLayer",{omit:["_blocksInProgress"]});class Qb{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){const i=e[t];this._stringToNumber[i]=t,this._numberToString[t]=i}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const ew=["id","tile","layer","source","sourceLayer","state"];class tw{constructor(e,t,i,n,r){this.type="Feature",this._vectorTileFeature=e,this._z=t,this._x=i,this._y=n,this.properties=e.properties,this.id=r}clone(){const e=new tw(this._vectorTileFeature,this._z,this._x,this._y,this.id);return this.state&&(e.state=Object.assign({},this.state)),this.layer&&(e.layer=Object.assign({},this.layer)),this.source&&(e.source=this.source),this.sourceLayer&&(e.sourceLayer=this.sourceLayer),e}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};for(const t of ew)void 0!==this[t]&&(e[t]=this[t]);return e}}class iw{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new js(Rn,16,0),this.featureIndexArray=new Hl,this.promoteId=t,this.is3DTile=!1,this.serializedLayersCache=new Map}insert(e,t,i,n,r,s=0,o=0){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,r,s);const l=this.grid;for(let e=0;e<t.length;e++){const i=t[e],n=[1/0,1/0,-1/0,-1/0];for(let e=0;e<i.length;e++){const t=i[e];n[0]=Math.min(n[0],t.x),n[1]=Math.min(n[1],t.y),n[2]=Math.max(n[2],t.x),n[3]=Math.max(n[3],t.y)}0!==o&&(n[0]-=o,n[1]-=o,n[2]+=o,n[3]+=o),n[0]<Rn&&n[1]<Rn&&n[2]>=0&&n[3]>=0&&l.insert(a,n[0],n[1],n[2],n[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new uh(new Yg(this.rawTileData)).layers,this.sourceLayerCoder=new Qb(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,t){const{tilespaceGeometry:i,transform:n,tileTransform:r,pixelPosMatrix:s,availableImages:o,worldview:a}=t;this.loadVTLayers(),this.serializedLayersCache.clear();const l=i.bufferedTilespaceBounds,c=this.grid.query(l.min.x,l.min.y,l.max.x,l.max.y,(e,t,n,r)=>Gh(i.bufferedTilespaceGeometry,e,t,n,r));c.sort(rw);let h=null;n.elevation&&c.length>0&&(h=Ev.create(n.elevation,this.tileID));const d={};let u;for(let t=0;t<c.length;t++){const l=c[t];if(l===u)continue;u=l;const f=this.featureIndexArray.get(l);let p=null;this.is3DTile?this.loadMatchingModelFeature(d,f,e,i,n,a):this.loadMatchingFeature(d,f,e,o,a,(e,t,o,a=0)=>(p||(p=sh(e,this.tileID.canonical,r)),t.queryIntersectsFeature(i,e,o,p,this.z,n,s,h,a)))}return d}loadMatchingFeature(e,t,i,n,r,s){const{featureIndex:o,bucketIndex:a,sourceLayerIndex:l,layoutVertexArrayOffset:c}=t,h=this.bucketLayerIDs[a],d=i.layers,u=Object.keys(d);if(u.length&&!je(u,h))return;const f=i.sourceCache,p=this.sourceLayerCoder.decode(l),m=this.vtLayers[p].feature(o),g=this.getId(m,p);for(let t=0;t<h.length;t++){const i=h[t];if(!d[i])continue;const{styleLayer:a,targets:l}=d[i];let u={};void 0!==g&&(u=f.getFeatureState(a.sourceLayer,g));const p=!s||s(m,a,u,c);if(!p)continue;const _=new tw(m,this.z,this.x,this.y,g);_.tile=this.tileID.canonical,_.state=u;let y=this.serializedLayersCache.get(i);y||(y=a.serialize(),y.id=i,this.serializedLayersCache.set(i,y)),_.source=y.source,_.sourceLayer=y["source-layer"],_.layer=Re({},y),_.layer.paint=nw(y.paint,a.paint,m,u,n),_.layer.layout=nw(y.layout,a.layout,m,u,n);let v=!1;for(const e of l){this.updateFeatureProperties(_,e);const{filter:t}=e;if(t)if(m.properties=_.properties,t.needGeometry){const e=oh(m,!0);if(!t.filter(new da(this.tileID.overscaledZ,{worldview:r}),e,this.tileID.canonical))continue}else if(!t.filter(new da(this.tileID.overscaledZ,{worldview:r}),m))continue;v=!0,e.targetId&&this.addFeatureVariant(_,e)}v&&this.appendToResult(e,i,o,_,p)}}loadMatchingModelFeature(e,t,i,n,r,s){const{featureIndex:o,bucketIndex:a}=t,l=this.bucketLayerIDs[a],c=i.layers,h=Object.keys(c);if(!h.length||je(h,l))for(let t=0;t<l.length;t++){const a=l[t],{styleLayer:h,targets:d}=c[a];if("model"!==h.type)continue;const u=n.tile,f=u.getBucket(h);if(!(f&&f instanceof Nv))continue;const p=Vv(f,o,n,r);if(!p)continue;const{z:m,x:g,y:_}=u.tileID.canonical,{feature:y,intersectionZ:v,position:x}=p;let b={};void 0!==y.id&&(b=i.sourceCache.getFeatureState(h.sourceLayer,y.id));const w=new tw({},m,g,_,y.id);w.tile=this.tileID.canonical,w.state=b,w.properties=y.properties,w.geometry={type:"Point",coordinates:[x.lng,x.lat]};let S=this.serializedLayersCache.get(a);S||(S=h.serialize(),S.id=a,this.serializedLayersCache.set(a,S)),w.source=S.source,w.sourceLayer=S["source-layer"],w.layer=Re({},S);let T=!1;for(const e of d){this.updateFeatureProperties(w,e);const{filter:t}=e;if(t)if(y.properties=w.properties,t.needGeometry){if(!t.filter(new da(this.tileID.overscaledZ,{worldview:s}),y,this.tileID.canonical))continue}else if(!t.filter(new da(this.tileID.overscaledZ,{worldview:s}),y))continue;T=!0,e.targetId&&this.addFeatureVariant(w,e)}T&&this.appendToResult(e,a,o,w,v)}}updateFeatureProperties(e,t,i){if(t.properties){const n={};for(const r in t.properties){const s=t.properties[r].evaluate({zoom:this.z},e._vectorTileFeature,e.state,e.tile,i);null!=s&&(n[r]=s)}e.properties=n}}addFeatureVariant(e,t,i){const n={target:t.target,namespace:t.namespace,uniqueFeatureID:t.uniqueFeatureID};t.properties&&(n.properties=e.properties),e.variants=e.variants||{},e.variants[t.targetId]=e.variants[t.targetId]||[],e.variants[t.targetId].push(n)}appendToResult(e,t,i,n,r){let s=e[t];void 0===s&&(s=e[t]=[]),s.push({featureIndex:i,feature:n,intersectionZ:r})}lookupSymbolFeatures(e,t,i,n,r,s){const o={};this.loadVTLayers();for(const a of e)this.loadMatchingFeature(o,{bucketIndex:t,sourceLayerIndex:i,featureIndex:a,layoutVertexArrayOffset:0},n,r,s);return o}loadFeature(e){const{featureIndex:t,sourceLayerIndex:i}=e;this.loadVTLayers();const n=this.sourceLayerCoder.decode(i),r=this.vtFeatures[n];if(r[t])return r[t];const s=this.vtLayers[n].feature(t);return r[t]=s,s}hasLayer(e){for(const t of this.bucketLayerIDs)for(const i of t)if(e===i)return!0;return!1}getId(e,t){let i=e.id;if(this.promoteId){const n=Array.isArray(this.promoteId)||"object"!=typeof this.promoteId?this.promoteId:this.promoteId[t];if(null!=n)if(Array.isArray(n)){if(!this.promoteIdExpression){const e=Ps(n);if("success"!==e.result)return void We(`Failed to create expression for promoteId: ${e.value.map(e=>`${e.key}: ${e.message}`).join(", ")}`);this.promoteIdExpression=e.value}this.promoteIdExpression._evaluator||(this.promoteIdExpression._evaluator=new Ji),i=this.promoteIdExpression.evaluate({zoom:0},e)}else i=e.properties[n];"boolean"==typeof i&&(i=Number(i))}return i}}function nw(e,t,i,n,r){return Ye(e,(e,s)=>{const o=t instanceof va?t.get(s):null;return o&&o.evaluate?o.evaluate(i,n,void 0,r):o})}function rw(e,t){return t-e}Ws(iw,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const sw=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class ow{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,i]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");const n=i>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const r=sw[15&i];if(!r)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new ow(o,s,r,e)}constructor(e,t=64,i=Float64Array,n){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const r=sw.indexOf(this.ArrayType),s=2*e*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-o%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+a,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+s+o+a),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+a,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+r]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=t,i}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return aw(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:s,nodeSize:o}=this,a=[0,r.length-1,0],l=[];for(;a.length;){const c=a.pop()||0,h=a.pop()||0,d=a.pop()||0;if(h-d<=o){for(let o=d;o<=h;o++){const a=s[2*o],c=s[2*o+1];a>=e&&a<=i&&c>=t&&c<=n&&l.push(r[o])}continue}const u=d+h>>1,f=s[2*u],p=s[2*u+1];f>=e&&f<=i&&p>=t&&p<=n&&l.push(r[u]),(0===c?e<=f:t<=p)&&(a.push(d),a.push(u-1),a.push(1-c)),(0===c?i>=f:n>=p)&&(a.push(u+1),a.push(h),a.push(1-c))}return l}within(e,t,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:r,nodeSize:s}=this,o=[0,n.length-1,0],a=[],l=i*i;for(;o.length;){const c=o.pop()||0,h=o.pop()||0,d=o.pop()||0;if(h-d<=s){for(let i=d;i<=h;i++)dw(r[2*i],r[2*i+1],e,t)<=l&&a.push(n[i]);continue}const u=d+h>>1,f=r[2*u],p=r[2*u+1];dw(f,p,e,t)<=l&&a.push(n[u]),(0===c?e-i<=f:t-i<=p)&&(o.push(d),o.push(u-1),o.push(1-c)),(0===c?e+i>=f:t+i>=p)&&(o.push(u+1),o.push(h),o.push(1-c))}return a}}function aw(e,t,i,n,r,s){if(r-n<=i)return;const o=n+r>>1;lw(e,t,o,n,r,s),aw(e,t,i,n,o-1,1-s),aw(e,t,i,o+1,r,1-s)}function lw(e,t,i,n,r,s){for(;r>n;){if(r-n>600){const o=r-n+1,a=i-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(o-c)/o)*(a-o/2<0?-1:1);lw(e,t,i,Math.max(n,Math.floor(i-a*c/o+h)),Math.min(r,Math.floor(i+(o-a)*c/o+h)),s)}const o=t[2*i+s];let a=n,l=r;for(cw(e,t,n,i),t[2*r+s]>o&&cw(e,t,n,r);a<l;){for(cw(e,t,a,l),a++,l--;t[2*a+s]<o;)a++;for(;t[2*l+s]>o;)l--}t[2*n+s]===o?cw(e,t,n,l):(l++,cw(e,t,l,r)),l<=i&&(n=l+1),i<=l&&(r=l-1)}}function cw(e,t,i,n){hw(e,i,n),hw(t,2*i,2*n),hw(t,2*i+1,2*n+1)}function hw(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function dw(e,t,i,n){const r=e-i,s=t-n;return r*r+s*s}e.$=Ki,e.A=Zt,e.B=Oi,e.C=Ha,e.D=bp,e.E=ei,e.F=2,e.G=I_,e.H=E_,e.I=ti,e.J=Gi,e.K=class extends Tv{},e.L=ui,e.M=ka,e.N=ws,e.O=vs,e.P=xe,e.Q=bs,e.R=It,e.S=Is,e.T=em,e.U=Ma,e.V=Tv,e.W=zs,e.X=Ps,e.Y=hr,e.Z=ur,e._=cr,e.a=function(e){return nt.API_CDN_URL_REGEX.test(e)},e.a$=ze,e.a0=ri,e.a1=Aa,e.a2=Ss,e.a3=xs,e.a4=function(e){const t=e.value;let i=[];if(!t)return i;const n=Gi(t);return"string"!==n?(i=i.concat([new Tv(e.key,t,`string expected, "${n}" found`)]),i):(kv(t,!0)||(i=i.concat([new Tv(e.key,t,`invalid url "${t}"`)])),i)},e.a5=Ta,e.a6=pa,e.a7=Sa,e.a8=xa,e.a9=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return Ge(e.expression.evaluate(t))}interpolate(e,t,i){return{x:ci(e.x,t.x,i),y:ci(e.y,t.y,i),z:ci(e.z,t.z,i),azimuthal:ci(e.azimuthal,t.azimuthal,i),polar:ci(e.polar,t.polar,i)}}},e.aA=Z,e.aB=Cc,e.aC=$h,e.aD=Bc,e.aE=Qc,e.aF=function(e,t){const i={};for(let n=0;n<t.length;n++){const r=t[n];r in e&&(i[r]=e[r])}return i},e.aG=Nc,e.aH=Hc,e.aI=class{constructor(e){this.entries={},this.scheduler=e}request(e,t,i,n){const r=this.entries[e]=this.entries[e]||{callbacks:[]};if(r.result){const[e,i]=r.result;return this.scheduler?this.scheduler.add(()=>{n(e,i)},t):n(e,i),()=>{}}return r.callbacks.push(n),r.cancel||(r.cancel=i((i,n)=>{r.result=[i,n];for(const e of r.callbacks)this.scheduler?this.scheduler.add(()=>{e(i,n)},t):e(i,n);setTimeout(()=>delete this.entries[e],3e3)})),()=>{r.result||(r.callbacks=r.callbacks.filter(e=>e!==n),r.callbacks.length||(r.cancel(),delete this.entries[e]))}}},e.aJ=function(e,t,i){const n=JSON.stringify(e.request);return e.data&&(this.deduped.entries[n]={result:[null,e.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom},t=>{const n=zt(e.request,(e,n,r,s)=>{e?t(e):n&&t(null,{vectorTile:i?void 0:new uh(new Yg(n)),rawData:n,cacheControl:r,expires:s})});return()=>{n.cancel(),t()}},t)},e.aK=function(e){Tt++,Tt>yt&&(e.getActor().send("enforceCacheSizeLimit",_t),Tt=0)},e.aL=function(e){return e<=1?1:Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},e.aM=od,e.aN=pv,e.aO=xv,e.aP=uv,e.aQ=function(e,t){const i=document.createElement("video");i.muted=!0,i.onloadstart=function(){t(null,i)};for(let t=0;t<e.length;t++){const n=document.createElement("source");Ft(e[t])||(i.crossOrigin="Anonymous"),n.src=e[t],i.appendChild(n)}return{cancel:()=>{}}},e.aR=tm,e.aS=function(e){return fetch(e).then(e=>e.arrayBuffer()).then(t=>Jp(t,0,e))},e.aT=Rm,e.aU=class{constructor(e,t,i,n){this.id=e,this.position=null!=t?new Fc(t[0],t[1]):new Fc(0,0),this.orientation=null!=i?i:[0,0,0],this.nodes=n,this.uploaded=!1,this.aabb=new Dh([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(e,t){if(h(e.matrix,t,e.matrix),e.meshes)for(const t of e.meshes){const i=Dh.applyTransformFast(t.aabb,e.matrix);this.aabb.encapsulate(i)}if(e.children)for(const t of e.children)this._applyTransformations(t,e.matrix)}computeBoundsAndApplyParent(){const e=l([]);for(const t of this.nodes)this._applyTransformations(t,e)}computeModelMatrix(e,t,i,n,r,s,o=!1){bm(this.matrix,this,e.transform,this.position,t,i,n,r,s,o)}upload(e){if(!this.uploaded){for(const t of this.nodes)Tm(t,e);for(const e of this.nodes)km(e);this.uploaded=!0}}destroy(){for(const e of this.nodes)Mm(e)}},e.aV=Ne,e.aW=yy,e.aX=Vc,e.aY=Wc,e.aZ=Ka,e.a_=_l,e.aa=da,e.ab=Os,e.ac=Jc,e.ad=Y,e.ae=w,e.af=Ee,e.ag=va,e.ah=Id,e.ai=ci,e.aj=Rn,e.ak=hi,e.al=Te,e.am=si,e.an=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return function([e,t]){const i=Ge([1,e,t]);return{x:i.x,y:i.y,z:i.z}}(e.expression.evaluate(t))}interpolate(e,t,i){return{x:ci(e.x,t.x,i),y:ci(e.y,t.y,i),z:ci(e.z,t.z,i)}}},e.ao=function(e,t,i=0,n=!0){const r=new xe(i,i),s=e.sub(r),o=t.add(r),a=[s,new xe(o.x,s.y),o,new xe(s.x,o.y)];return n&&a.push(s.clone()),a},e.ap=function(e,t){const i=[];for(let n=0;n<e.length;n++){const r=Ie(n-1,-1,e.length-1),s=Ie(n+1,-1,e.length-1),o=e[n],a=e[s],l=e[r].sub(o).unit(),c=a.sub(o).unit(),h=c.angleWithSep(l.x,l.y),d=l.add(c).unit().mult(-1*t/Math.sin(h/2));i.push(o.add(d))}return i},e.aq=vy,e.ar=Gh,e.as=function(e,t,i=0){return S(((t.x-i)*e.scale-e.x)*Rn,(t.y*e.scale-e.y)*Rn,Uc(t.z,t.y))},e.at=W,e.au=O,e.av=wh,e.aw=hg,e.ax=function(e){let t=1/0,i=1/0,n=-1/0,r=-1/0;for(const s of e)t=Math.min(t,s.x),i=Math.min(i,s.y),n=Math.max(n,s.x),r=Math.max(r,s.y);return{min:new xe(t,i),max:new xe(n,r)}},e.ay=Le,e.az=h,e.b=function(e){return nt.API_FONTS_REGEX.test(e)},e.b$=ay,e.b0=Pl,e.b1=Jy,e.b2=function(){ha.isLoading()||ha.isLoaded()||"deferred"!==la()||ca()},e.b3=Ca,e.b4=oh,e.b5=tw,e.b6=qe,e.b7=og,e.b8=Ju,e.b9=sh,e.bA=function(e,t){const{x:i,y:n}=e.point,r=Ed(i,n,e.worldSize/e._pixelsPerMercatorPixel,0,0);return h(r,r,Cd(yd(t)))},e.bB=n,e.bC=j,e.bD=function(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])},e.bE=E,e.bF=F,e.bG=z,e.bH=w_,e.bI=e_,e.bJ=b_,e.bK=function(e,t,i,n,r){const s=5*t+2;e.float32[s+0]=i,e.float32[s+1]=n,e.float32[s+2]=r},e.bL=Gy,e.bM=ae,e.bN=he,e.bO=le,e.bP=ge,e.bQ=Ie,e.bR=function(e,t,n,r){var s=new i(4);return s[0]=e,s[1]=t,s[2]=n,s[3]=r,s},e.bS=cp,e.bT=Oh,e.bU=Eg,e.bV=mf,e.bW=Sv,e.bX=Tf,e.bY=kf,e.bZ=d_,e.b_=Q_,e.ba=Za,e.bb=Al,e.bc=ud,e.bd=Xl,e.be=au,e.bf=lv,e.bg=function(e,t){const i=Id(t.zoom);if(0===i)return yd(e);const n=wd(e),r=Sd(n),s=Bc(n.getWest())*t.worldSize,o=Bc(n.getEast())*t.worldSize,a=Hc(n.getNorth())*t.worldSize,l=Hc(n.getSouth())*t.worldSize,h=[s,a,0],d=[o,a,0],u=[s,l,0],f=[o,l,0],p=c([],t.globeMatrix);return Y(h,h,p),Y(d,d,p),Y(u,u,p),Y(f,f,p),r[0]=vd(r[0],u,i),r[1]=vd(r[1],f,i),r[2]=vd(r[2],d,i),r[3]=vd(r[3],h,i),Dh.fromPoints(r)},e.bh=Ad,e.bi=c,e.bj=Td,e.bk=vd,e.bl=Ja,e.bm=dd,e.bn=g,e.bo=d,e.bp=Zb,e.bq=Yg,e.br=zt,e.bs=function(e,t){const i=[];for(const n in e)n in t||i.push(n);return i},e.bt=Pe,e.bu=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.bv=be,e.bw=function(e){var t=new i(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.bx=l,e.by=m,e.bz=a,e.c=st,e.c$=45,e.c0=ow,e.c1=L,e.c2=$,e.c3=K,e.c4=function(e,t,i){i*=.5;var n=t[0],r=t[1],s=t[2],o=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=n*l+r*a,e[1]=r*l-n*a,e[2]=s*l+o*a,e[3]=o*l-s*a,e},e.c5=Q,e.c6=Je,e.c7=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},e.c8=y,e.c9=function(e,t,i,n,r){var s,o=1/Math.tan(t/2);return e[0]=o/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=r&&r!==1/0?(e[10]=(r+n)*(s=1/(n-r)),e[14]=2*r*n*s):(e[10]=-1,e[14]=-2*n),e},e.cA=rd,e.cB=bd,e.cC=function(e,t,i,n,r,s,o,a,l){if("globe"===l.name)return bd(e,t,new rd(i,n,r),!1);const c=yy({z:i,x:n,y:r},l);return new Dh([(s+c.x/c.scale)*t,t*(c.y/c.scale),o],[(s+c.x2/c.scale)*t,t*(c.y2/c.scale),a])},e.cD=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e[3]=Math.min(t[3],i[3]),e},e.cE=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e[3]=Math.max(t[3],i[3]),e},e.cF=function(e){const t=Math.round((e+45+360)%360/90)%4;return Me[t]},e.cG=$c,e.cH=X,e.cI=6,e.cJ=function(e){const t=l(new Float64Array(16));h(t,e.pixelMatrix,e.globeMatrix);const i=[0,Ec,0],n=[0,Ic,0];return Y(i,i,t),Y(n,n,t),[i[0]>0&&i[0]<=e.width&&i[1]>0&&i[1]<=e.height&&!Rd(e,new Fc(e.center.lat,90)),n[0]>0&&n[0]<=e.width&&n[1]>0&&n[1]<=e.height&&!Rd(e,new Fc(e.center.lat,-90))]},e.cK=function(e,t){const{scale:i}=e.tileTransform,n=i*Rn/(e.tileSize*Math.pow(2,t.zoom-e.tileID.overscaledZ+e.tileID.canonical.z));return function(e,t,i){var n=t[1],r=t[2],s=t[3],o=i[0],a=i[1];return e[0]=t[0]*o,e[1]=n*o,e[2]=r*a,e[3]=s*a,e}(new Float32Array(4),t.inverseAdjustmentMatrix,[n,n])},e.cL=dm,e.cM=v,e.cN=cm,e.cO=function(e){const t=cm(e,!0);return n([],[t[0],t[1],t[4],t[5]])},e.cP=u,e.cQ=Sh,e.cR=f,e.cS=function(e){const{x:t,y:i}=e.point,{lng:n,lat:r}=e._center;return Ed(t,i,e.worldSize,n,r)},e.cT=A,e.cU=ke,e.cV=ad,e.cW=Xh,e.cX=5,e.cY=function(e,t,i){let n=0;for(let i=0;i<2;++i){const r=0;e[i]>r&&(n+=(e[i]-r)*(e[i]-r)),t[i]<r&&(n+=(r-t[i])*(r-t[i]))}return n},e.cZ=function(e){return e*e*e*e*e},e.c_=Yc,e.ca=function(e,t,i,n,r,s,o){var a=1/(t-i),l=1/(n-r),c=1/(s-o);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+i)*a,e[13]=(r+n)*l,e[14]=(o+s)*c,e[15]=1,e},e.cb=jc,e.cc=function(e,t,i){e[4*t+0]=i[0],e[4*t+1]=i[1],e[4*t+2]=i[2],e[4*t+3]=i[3]},e.cd=rc,e.ce=ac,e.cf=sc,e.cg=oc,e.ch=dc,e.ci=Fc,e.cj=By,e.ck=function(){var e=new i(4);return i!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},e.cl=function(e,t,i){var n=t[0],r=t[1],s=t[2],o=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=n*l+s*a,e[1]=r*l+o*a,e[2]=n*-a+s*l,e[3]=r*-a+o*l,e},e.cm=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},e.cn=V,e.co=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},e.cp=re,e.cq=H,e.cr=sd,e.cs=3,e.ct=2,e.cu=7,e.cv=6,e.cw=N,e.cx=x,e.cy=Ch,e.cz=hm,e.d=function(e){return nt.API_TILEJSON_REGEX.test(e)},e.d$=(e,t,i,n,r,s,o,a,l,c)=>{const h=e.transform,d=h.calculatePixelsToTileUnitsMatrix(t),u="none"===i.paint.get("line-trim-color-use-theme").constantOr("default"),f=h.pitch<15?dg(.07,.7,Le((14-h.zoom)/5,0,1)):.07;return{u_matrix:fg(e,t,i,n),u_pixels_to_tile_units:d,u_device_pixel_ratio:s,u_width_scale:o,u_floor_width_scale:a,u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:r,u_texsize:mg(i)&&t.lineAtlasTexture?t.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:ug(t,e.transform),u_alpha_discard_threshold:0,u_trim_offset:l,u_trim_fade_range:i.paint.get("line-trim-fade-range"),u_trim_color:i.paint.get("line-trim-color").toPremultipliedRenderColor(u?null:i.lut).toArray01(),u_emissive_strength:i.paint.get("line-emissive-strength"),u_zbias_factor:f,u_tile_to_meter:Zc(t.tileID.canonical,0),u_ground_shadow_factor:c}},e.d0=lc,e.d1=function(e,t,i){const n=Math.sqrt(e*e+t*t+i*i),r=n>0?Math.acos(i/n)*Se:0;let s=0!==e||0!==t?Math.atan2(-t,-e)*Se+90:0;return s<0&&(s+=360),[n,s,r]},e.d2=S,e.d3=Ge,e.d4=Zc,e.d5=k,e.d6=Dh,e.d7=M,e.d8=function(e){return[Math.pow(e[0],1/2.2),Math.pow(e[1],1/2.2),Math.pow(e[2],1/2.2)]},e.d9=kv,e.dA=wd,e.dB=function(e){const t=$c-5;e=Le(e,-t,t)/t*90;const i=Math.pow(Math.abs(Math.sin(Te(e))),3);return Math.round(i*(Lc.length-1))},e.dC=function(e,t,i,n){const r=t.getNorth(),s=t.getSouth(),a=t.getWest(),l=t.getEast(),c=1<<e.z,h=l-a,d=r-s,u=h/Dc,f=-d/Lc[i],p=[0,u,0,f,0,0,r,a,0];if(e.z>0){const e=180/n;o(p,p,[e/h+1,0,0,0,e/d+1,0,-.5*e/u,.5*e/f,1])}return p[2]=c,p[5]=e.x,p[8]=e.y,p},e.dD=yd,e.dE=function(e,t,i){const n=l(new Float64Array(16)),r=(t/(1<<e)-.5)*Math.PI*2;return p(n,i.globeMatrix,r),Float32Array.from(n)},e.dF=class{isDataAvailableAtPoint(e){const t=this._source();if(this.isUsingMockSource()||!t||e.y<0||e.y>1)return!1;const i=t.getSource().maxzoom,n=1<<i,r=Math.floor(e.x),s=Math.floor((e.x-r)*n),o=Math.floor(e.y*n),a=this.findDEMTileFor(new od(i,r,i,s,o));return!(!a||!a.dem)}getAtPointOrZero(e,t=0){return this.getAtPoint(e,t)||0}getAtPoint(e,t,i=!0){if(this.isUsingMockSource())return null;null==t&&(t=null);const n=this._source();if(!n)return t;if(e.y<0||e.y>1)return t;const r=n.getSource().maxzoom,s=1<<r,o=Math.floor(e.x),a=e.x-o,l=new od(r,o,r,Math.floor(a*s),Math.floor(e.y*s)),c=this.findDEMTileFor(l);if(!c||!c.dem)return t;const h=c.dem,d=1<<c.tileID.canonical.z,u=(a*d-c.tileID.canonical.x)*h.dim,f=(e.y*d-c.tileID.canonical.y)*h.dim,p=Math.floor(u),m=Math.floor(f);return(i?this.exaggeration():1)*ci(ci(h.get(p,m),h.get(p,m+1),f-m),ci(h.get(p+1,m),h.get(p+1,m+1),f-m),u-p)}getAtTileOffset(e,t,i){const n=1<<e.canonical.z;return this.getAtPointOrZero(new Jc(e.wrap+(e.canonical.x+t/Rn)/n,(e.canonical.y+i/Rn)/n))}getAtTileOffsetFunc(e,t,i,n){return r=>{const s=this.getAtTileOffset(e,r.x,r.y),o=n.upVector(e.canonical,r.x,r.y);return L(o,o,s*n.upVectorScale(e.canonical,t,i).metersToTile),o}}getForTilePoints(e,t,i,n){if(this.isUsingMockSource())return!1;const r=Ev.create(this,e,n);return!!r&&(t.forEach(e=>{e[2]=this.exaggeration()*r.getElevationAt(e[0],e[1],i)}),!0)}getMinMaxForTile(e){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(e);if(!t||!t.dem)return null;const i=t.dem.tree,n=t.tileID,r=1<<e.canonical.z-n.canonical.z;let s=e.canonical.x/r-n.canonical.x,o=e.canonical.y/r-n.canonical.y,a=0;for(let t=0;t<e.canonical.z-n.canonical.z&&!i.leaves[a];t++){s*=2,o*=2;const e=2*Math.floor(o)+Math.floor(s);a=i.childOffsets[a]+e,s%=1,o%=1}return{min:this.exaggeration()*i.minimums[a],max:this.exaggeration()*i.maximums[a]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(e,t,i){throw new Error("Pure virtual method called.")}pointCoordinate(e){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(e){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}getMinMaxForVisibleTiles(){const e=this.visibleDemTiles;if(0===e.length)return null;let t=!1,i=Number.MAX_VALUE,n=Number.MIN_VALUE;for(const r of e){const e=this.getMinMaxForTile(r.tileID);e&&(i=Math.min(i,e.min),n=Math.max(n,e.max),t=!0)}return t?{min:i,max:n}:null}},e.dG=tu,e.dH=fd,e.dI=function(e,t){return[Math.pow(e[0],2.2)*t,Math.pow(e[1],2.2)*t,Math.pow(e[2],2.2)*t]},e.dJ=r,e.dK=function(e,t){var i=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.dL=B,e.dM=Ld,e.dN=et,e.dO=tt,e.dP=256,e.dQ=function(e,t){const i=[0,0,0];return Y(i,i,Ad(yd(t.canonical))),Y(i,i,e),i},e.dR=e=>({u_matrix:new dc(e),u_texsize:new oc(e),u_pixels_to_tile_units:new pc(e),u_device_pixel_ratio:new sc(e),u_width_scale:new sc(e),u_floor_width_scale:new sc(e),u_image:new rc(e),u_units_to_pixels:new oc(e),u_tile_units_to_pixels:new sc(e),u_alpha_discard_threshold:new sc(e),u_trim_offset:new oc(e),u_trim_fade_range:new oc(e),u_trim_color:new lc(e),u_emissive_strength:new sc(e),u_zbias_factor:new sc(e),u_tile_to_meter:new sc(e),u_ground_shadow_factor:new ac(e),u_pattern_transition:new sc(e)}),e.dS=e=>({u_matrix:new dc(e),u_pixels_to_tile_units:new pc(e),u_device_pixel_ratio:new sc(e),u_width_scale:new sc(e),u_floor_width_scale:new sc(e),u_units_to_pixels:new oc(e),u_dash_image:new rc(e),u_gradient_image:new rc(e),u_image_height:new sc(e),u_texsize:new oc(e),u_tile_units_to_pixels:new sc(e),u_alpha_discard_threshold:new sc(e),u_trim_offset:new oc(e),u_trim_fade_range:new oc(e),u_trim_color:new lc(e),u_emissive_strength:new sc(e),u_zbias_factor:new sc(e),u_tile_to_meter:new sc(e),u_ground_shadow_factor:new ac(e)}),e.dT=e=>({u_camera_to_center_distance:new sc(e),u_extrude_scale:new pc(e),u_device_pixel_ratio:new sc(e),u_matrix:new dc(e),u_inv_rot_matrix:new dc(e),u_merc_center:new oc(e),u_tile_id:new ac(e),u_zoom_transition:new sc(e),u_up_dir:new ac(e),u_emissive_strength:new sc(e)}),e.dU=ml,e.dV=Lg,e.dW=Yd,e.dX=(e,t,i,n,r,s)=>{const o=e.transform,a="globe"===o.projection.name;let l;if("map"===s.paint.get("circle-pitch-alignment"))if(a){const e=Ld(o.zoom,t.canonical)*o._pixelsPerMercatorPixel;l=Float32Array.from([e,0,0,e])}else l=o.calculatePixelsToTileUnitsMatrix(i);else l=new Float32Array([o.pixelsToGLUnits[0],0,0,o.pixelsToGLUnits[1]]);const c={u_camera_to_center_distance:e.transform.getCameraToCenterDistance(o.projection),u_matrix:e.translatePosMatrix(t.projMatrix,i,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_device_pixel_ratio:ft.devicePixelRatio,u_extrude_scale:l,u_inv_rot_matrix:Nd,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:s.paint.get("circle-emissive-strength")};if(a){c.u_inv_rot_matrix=n,c.u_merc_center=r,c.u_tile_id=[t.canonical.x,t.canonical.y,1<<t.canonical.z],c.u_zoom_transition=Id(o.zoom);const e=r[0]*Rn,i=r[1]*Rn;c.u_up_dir=o.projection.upVector(new rd(0,0,0),e,i)}return c},e.dY=pg,e.dZ=zi,e.d_=(e,t,i,n,r,s,o,a,l,c)=>{const h=e.transform,d=h.pitch<15?dg(.07,.7,Le((14-h.zoom)/5,0,1)):.07,u="none"===i.paint.get("line-trim-color-use-theme").constantOr("default");return{u_matrix:fg(e,t,i,n),u_texsize:t.imageAtlasTexture?t.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:h.calculatePixelsToTileUnitsMatrix(t),u_device_pixel_ratio:r,u_width_scale:s,u_floor_width_scale:o,u_image:0,u_tile_units_to_pixels:ug(t,h),u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:a,u_trim_fade_range:i.paint.get("line-trim-fade-range"),u_trim_color:i.paint.get("line-trim-color").toPremultipliedRenderColor(u?null:i.lut).toArray01(),u_emissive_strength:i.paint.get("line-emissive-strength"),u_zbias_factor:d,u_tile_to_meter:Zc(t.tileID.canonical,0),u_ground_shadow_factor:l,u_pattern_transition:c}},e.da=function(e,t){return e.readFields(lx,{icons:[]},t)},e.db=Tp,e.dc=Y_,e.dd=N_,e.de=Rt,e.df=sa,e.dg=mt,e.dh=qt,e.di=He,e.dj=function(e){const t=e.indexOf(Ba);return t>=0?e.slice(0,t):e},e.dk=function(e){return e.indexOf(Ba)>=0},e.dl=function(e){const t=e.lastIndexOf(Ba);return t>=0?e.slice(t+1):""},e.dm=function(e){const t=[],i=e.id;return void 0===i&&t.push({message:`layers.${i}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${i}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),t},e.dn=function(e,t,i,n){return"custom"===e.type?new bv(e,t):new Wv[e.type](e,t,i,n)},e.dp=Be,e.dq=function(e){const t=e.indexOf(Ba);return t>=0?e.slice(t+1):""},e.dr=class extends tw{constructor(e,t){super(e._vectorTileFeature,e._z,e._x,e._y,e.id),e.state&&(this.state=Object.assign({},e.state)),this.target=t.target,this.namespace=t.namespace,t.properties&&(this.properties=t.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=e.source,this.sourceLayer=e.sourceLayer,this.layer=e.layer)}toJSON(){const e=super.toJSON();return e.target=this.target,e.namespace=this.namespace,e}},e.ds=aa,e.dt=Ot,e.du=function(e){return e({pluginStatus:na,pluginURL:ra}),aa.on("pluginStateChange",e),e},e.dv=cc,e.dw=class extends nc{constructor(e){super(e),this.current=uc}set(e,t,i){if(this.fetchUniformLocation(e,t))for(let e=0;e<9;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}},e.dx=Ae,e.dy=function(e,t,i){const n=Id(i.zoom),r=e.style.map._antialias,s=e.terrain&&e.terrain.exaggeration()>0;return 0===n&&!r&&!s},e.dz=function(e){const t=e.pixelsPerMeter,i=t/jc(1,e.center.lat),n=l(new Float64Array(16));return d(n,n,[e.point.x,e.point.y,0]),u(n,n,[i,i,t]),Float32Array.from(n)},e.e=nt,e.e$=la,e.e0=Fe,e.e1=iu,e.e2=Uc,e.e3=ld,e.e4=$f,e.e5=ep,e.e6=Rf,e.e7=450,e.e8=7,e.e9=Xc,e.eA=function(e,t,n,r,s,o,a,l,c,h,d,u,f,p,m,g){var _=new i(16);return _[0]=e,_[1]=t,_[2]=n,_[3]=r,_[4]=s,_[5]=o,_[6]=a,_[7]=l,_[8]=c,_[9]=h,_[10]=d,_[11]=u,_[12]=f,_[13]=p,_[14]=m,_[15]=g,_},e.eB=Oc,e.eC=Tl,e.eD=Sl,e.eE=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new xe(1/0,1/0),max:new xe(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(e,t=!1){const i=xf(new xe(0,0),new xe(Rn,Rn),e),n=[];if(t&&!yf(i,this._globalClipBounds))return n;for(const t of this._activeRegions){if(t.hiddenByOverlap)continue;if(!yf(i,t))continue;const r=bf(t.min,t.max,e);n.push({min:r.min,max:r.max,sourceId:this._sourceIds[t.priority],footprint:t.footprint,footprintTileId:t.tileId,order:t.order,clipMask:t.clipMask,clipScope:t.clipScope})}return n}setSources(e){this._setSources(e.map(e=>({getSourceId:()=>e.cache.id,getFootprints:()=>{const t=[];for(const i of e.cache.getVisibleCoordinates()){const n=e.cache.getTile(i).buckets[e.layer];n&&n.updateFootprints(i.toUnwrapped(),t)}return t},getOrder:()=>e.order,getClipMask:()=>e.clipMask,getClipScope:()=>e.clipScope})))}_addSource(e){const t=e.getFootprints();if(0===t.length)return;const i=e.getOrder(),n=e.getClipMask(),r=e.getClipScope();for(const e of t){if(!e.footprint)continue;const t=xf(e.footprint.min,e.footprint.max,e.id);this._activeRegions.push({min:t.min,max:t.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:e.id,footprint:e.footprint,order:i,clipMask:n,clipScope:r})}this._sourceIds.push(e.getSourceId())}_computeReplacement(){this._activeRegions.sort((e,t)=>e.priority-t.priority||gf(e.min,t.min)||gf(e.max,t.max)||e.order-t.order||e.clipMask-t.clipMask||function(e,t){const i=(e,t)=>e+t;return e.length-t.length||e.reduce(i,"").localeCompare(t.reduce(i,""))}(e.clipScope,t.clipScope));let e=this._activeRegions.length!==this._prevRegions.length;if(!e){let t=0;for(;!e&&t!==this._activeRegions.length;){const i=this._activeRegions[t],n=this._prevRegions[t];e=i.priority!==n.priority||!_f(i,n)||i.order!==n.order||i.clipMask!==n.clipMask||!be(i.clipScope,n.clipScope),++t}}if(e){++this._updateTime;for(const e of this._activeRegions)e.order!==ff&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,e.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,e.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,e.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,e.max.y));const e=e=>{const t=this._activeRegions;if(e>=t.length)return e;const i=t[e].priority;for(;e<t.length&&t[e].priority===i;)++e;return e};if(this._sourceIds.length>1){let t=0,i=e(t);for(;t!==i;){let n=t;const r=t;for(;n!==i;){const e=this._activeRegions[n];e.hiddenByOverlap=!1;for(let t=0;t<r;t++){const i=this._activeRegions[t];if(!i.hiddenByOverlap&&e.order===ff&&yf(e,i)&&(e.hiddenByOverlap=Sf(e.footprint,e.tileId,i.footprint,i.tileId),e.hiddenByOverlap))break}++n}t=i,i=e(t)}}}}_setSources(e){[this._prevRegions,this._activeRegions]=[this._activeRegions,[]],this._sourceIds=[];for(let t=e.length-1;t>=0;t--)this._addSource(e[t]);this._computeReplacement()}},e.eF=ff,e.eG=class{constructor(e){this._createGrid(e),this._createPoles(e)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const e of this._poleSegments)e.destroy();for(const e of this._gridSegments)e.withSkirts.destroy(),e.withoutSkirts.destroy()}_fillGridMeshWithLods(e,t){const i=new Za,n=new _l,r=[],s=e+1+2,o=t[0]+1,a=t[0]+1+(1+t.length),l=(e,t,i)=>{let n=e===s-1?e-2:0===e?e:e-1;return n+=i?24575:0,[n,t]};for(let e=0;e<s;++e)i.emplaceBack(...l(e,0,!0));for(let e=0;e<o;++e)for(let t=0;t<s;++t)i.emplaceBack(...l(t,e,(0===t||t===s-1)&&!0));for(let e=0;e<t.length;++e){const n=t[e];for(let e=0;e<s;++e)i.emplaceBack(...l(e,n,!0))}for(let e=0;e<t.length;++e){const o=n.length,l=t[e]+1+2,c=new _l;for(let i=0;i<l-1;i++){const r=i===l-2,o=r?s*(a-t.length+e-i):s;for(let e=0;e<s-1;e++){const t=i*s+e;0===i||r||0===e||e===s-2?(c.emplaceBack(t+1,t,t+o),c.emplaceBack(t+o,t+o+1,t+1)):(n.emplaceBack(t+1,t,t+o),n.emplaceBack(t+o,t+o+1,t+1))}}const h=Xl.simpleSegment(0,o,i.length,n.length-o);for(let e=0;e<c.uint16.length;e+=3)n.emplaceBack(c.uint16[e],c.uint16[e+1],c.uint16[e+2]);const d=Xl.simpleSegment(0,o,i.length,n.length-o);r.push({withoutSkirts:h,withSkirts:d})}return{vertices:i,indices:n,segments:r}}_createGrid(e){const t=this._fillGridMeshWithLods(Dc,Lc);this._gridSegments=t.segments,this._gridBuffer=e.createVertexBuffer(t.vertices,ud.members),this._gridIndexBuffer=e.createIndexBuffer(t.indices,!0)}_createPoles(e){const t=new _l;for(let e=0;e<=Dc;e++)t.emplaceBack(0,e+1,e+2);this._poleIndexBuffer=e.createIndexBuffer(t,!0);const i=new bl,n=new bl,r=new bl,s=new bl;this._poleSegments=[];for(let e=0,t=0;e<5;e++){const o=360/(1<<e);i.emplaceBack(0,-Cc,0,.5,0),n.emplaceBack(0,-Cc,0,.5,1),r.emplaceBack(0,-Cc,0,.5,.5),s.emplaceBack(0,-Cc,0,.5,.5);for(let e=0;e<=Dc;e++){let t=e/Dc,a=0;const l=ci(0,o,t),[c,h,d]=Pc(zd,Fd,l,Cc);i.emplaceBack(c,h,d,t,a),n.emplaceBack(c,h,d,t,1-a);const u=Te(l);t=.5+.5*Math.sin(u),a=.5+.5*Math.cos(u),r.emplaceBack(c,h,d,t,a),s.emplaceBack(c,h,d,t,1-a)}this._poleSegments.push(Xl.simpleSegment(t,0,66,64)),t+=66}this._poleNorthVertexBuffer=e.createVertexBuffer(i,hd,!1),this._poleSouthVertexBuffer=e.createVertexBuffer(n,hd,!1),this._texturedPoleNorthVertexBuffer=e.createVertexBuffer(r,hd,!1),this._texturedPoleSouthVertexBuffer=e.createVertexBuffer(s,hd,!1)}getGridBuffers(e,t){return[this._gridBuffer,this._gridIndexBuffer,t?this._gridSegments[e].withSkirts:this._gridSegments[e].withoutSkirts]}getPoleBuffers(e,t){return[t?this._texturedPoleNorthVertexBuffer:this._poleNorthVertexBuffer,t?this._texturedPoleSouthVertexBuffer:this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[e]]}},e.eH=pf,e.eI=Ce,e.eJ=function(){return!!document.fullscreenElement||!!document.webkitFullscreenElement},e.eK=De,e.eL=qc,e.eM=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e},e.eN=U,e.eO=Rc,e.eP=P,e.eQ=T,e.eR=function([e,t,i]){const n=Math.hypot(e,t,i),r=Math.atan2(e,i),s=.5*Math.PI-Math.acos(-t/n);return new Fc(ke(r),ke(s))},e.eS=q,e.eT=fm,e.eU=function(e){const t=e.navigator?e.navigator.userAgent:null;return!!function(e){if(null==Ze){const t=e.navigator?e.navigator.userAgent:null;Ze=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Ze}(e)&&!(!t||!(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/)))},e.eV=function(e,t){_t=e,yt=t},e.eW=Rd,e.eX=Pd,e.eY=function(e){const t=[0,0,0],i=l(new Float64Array(16));return h(i,e.pixelMatrix,e.globeMatrix),Y(t,t,i),new xe(t[0],t[1])},e.eZ=function(){const e=wp;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(vp),wp=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.e_=function(){Tp().acquire(vp)},e.ea=function(e,t){if(e===t){var i=t[1],n=t[2],r=t[3],s=t[6],o=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=s,e[11]=t[14],e[12]=r,e[13]=o,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},e.eb=fv,e.ec=Xa,e.ed=Ll,e.ee=256,e.ef=Cd,e.eg=rl,e.eh=p,e.ei=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},e.ej=bl,e.ek=wl,e.el=cs,e.em=function(e,t,i,n,r){return Le((e-t)/(i-t)*(r-n)+n,n,r)},e.en=ee,e.eo=function(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],d=h*o-a*c,u=-h*s+a*l,f=c*s-o*l,p=i*d+n*u+r*f;return p?(e[0]=d*(p=1/p),e[1]=(-h*n+r*c)*p,e[2]=(a*n-r*o)*p,e[3]=u*p,e[4]=(h*i-r*l)*p,e[5]=(-a*i+r*s)*p,e[6]=f*p,e[7]=(-c*i+n*l)*p,e[8]=(o*i-n*s)*p,e):null},e.ep=2,e.eq=R,e.er=_m,e.es=[1,1,1],e.et=class{constructor(e,t,i,n){this.context=e,this.format=n,this.size=i,this.texture=e.gl.createTexture();const[r,s,o]=this.size,{gl:a}=e;a.bindTexture(a.TEXTURE_3D,this.texture),e.pixelStoreUnpackFlipY.set(!1),e.pixelStoreUnpack.set(1),e.pixelStoreUnpackPremultiplyAlpha.set(!1),a.texImage3D(a.TEXTURE_3D,0,this.format,r,s,o,0,Kp(this.format),Qp(this.format),t.data)}bind(e,t){const{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_3D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_3D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_3D,n.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(n.texParameteri(n.TEXTURE_3D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_3D,n.TEXTURE_WRAP_T,t),this.wrapS=t)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}},e.eu=Ev,e.ev=G,e.ew=function(e,t,i,n){var r=t[0],s=t[1],o=t[2],a=t[3];return e[0]=r+n*(i[0]-r),e[1]=s+n*(i[1]-s),e[2]=o+n*(i[2]-o),e[3]=a+n*(i[3]-a),e},e.ex=xm,e.ey=ul,e.ez=kl,e.f=function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(Number("0x"+t))))},e.f0=function(e,t,i=!1){if(na===ta.deferred||na===ta.loading||na===ta.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");ra=ft.resolveURL(e),na=ta.deferred,ia=t,oa(),i||ca()},e.f1=function(e){Dp=ft.resolveURL(e),Ep||(Ep=new bp(Tp(),new ei)),Ep.broadcast("setMeshoptUrl",Dp)},e.f2=zp,e.f3=function(e){Ap=ft.resolveURL(e),Ep||(Ep=new bp(Tp(),new ei)),Ep.broadcast("setDracoUrl",Ap)},e.f4=Op,e.f5=yp,e.f6=function(e){const t=wt();if(!t)return;const i=t.delete(gt);e&&i.then(()=>e()).catch(e)},e.f7=xp,e.f8=Ws,e.f9=Qd,e.fa=2,e.fb=Qb,e.fc=iw,e.fd=ig,e.fe=ph,e.ff="hd_road_elevation",e.fg=Ih,e.fh=Ye,e.fi=Yu,e.fj=P_,e.fk=1,e.fl=function(e,t,i,n,r,s,o,a=1,l,c,h){e.createArrays(),e.tilePixelRatio=Rn/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;const d=e.layers[0].layout,u=e.layers[0]._unevaluatedLayout._values,f={};f.scaleFactor=a,f.textSizeScaleRange=d.get("text-size-scale-range"),f.iconSizeScaleRange=d.get("icon-size-scale-range");const[p,m]=f.textSizeScaleRange,[g,_]=f.iconSizeScaleRange;f.textScaleFactor=Le(f.scaleFactor,p,m),f.iconScaleFactor=Le(f.scaleFactor,g,_);const y=u["text-size"],v=u["icon-size"];if("composite"===e.textSizeData.kind){const{minZoom:t,maxZoom:i}=e.textSizeData;f.compositeTextSizes=[y.possiblyEvaluate(new da(t,{worldview:h}),s),y.possiblyEvaluate(new da(i,{worldview:h}),s)]}if("composite"===e.iconSizeData.kind){const{minZoom:t,maxZoom:i}=e.iconSizeData;f.compositeIconSizes=[v.possiblyEvaluate(new da(t,{worldview:h}),s),v.possiblyEvaluate(new da(i,{worldview:h}),s)]}f.layoutTextSize=y.possiblyEvaluate(new da(o+1,{worldview:h}),s),f.layoutIconSize=v.possiblyEvaluate(new da(o+1,{worldview:h}),s),f.textMaxSize=y.possiblyEvaluate(new da(18,{worldview:h}),s);const x=d.get("symbol-placement"),b="map"===d.get("text-rotation-alignment")&&"point"!==x,w=d.get("text-size");let S=!1;const T=[];for(const o of e.features){const a=d.get("text-font").evaluate(o,{},s).join(","),p=w.evaluate(o,{},s)*f.textScaleFactor,m=f.layoutTextSize.evaluate(o,{},s)*f.textScaleFactor,g=f.layoutIconSize.evaluate(o,{},s)*f.iconScaleFactor,_={horizontal:{},vertical:void 0},y=o.text;let v,k=[0,0];if(y){const n=y.toString(),c=d.get("text-letter-spacing").evaluate(o,{},s)*Eg,h=d.get("text-line-height").evaluate(o,{},s)*Eg,u=Go(n)?c:0,f=d.get("text-anchor").evaluate(o,{},s),g=d.get("text-variable-anchor");if(!g){const e=d.get("text-radial-offset").evaluate(o,{},s);if(e)k=Q_(f,[e*Eg,J_]);else{const e=d.get("text-offset").evaluate(o,{},s);k=[e[0]*Eg,e[1]*Eg]}}let v=b?"center":d.get("text-justify").evaluate(o,{},s);const w="point"===x,S=w?d.get("text-max-width").evaluate(o,{},s)*Eg:1/0,T=s=>{e.allowVerticalPlacement&&$o(n)&&(_.vertical=n_(y,t,i,r,a,S,h,f,s,u,k,e_.vertical,!0,m,p,l))};if(!b&&g){const e="auto"===v?g.map(e=>ay(e)):[v];let n=!1;for(let s=0;s<e.length;s++){const o=e[s];if(!_.horizontal[o])if(n)_.horizontal[o]=_.horizontal[0];else{const e=n_(y,t,i,r,a,S,h,"center",o,u,k,e_.horizontal,!1,m,p,l);e&&(_.horizontal[o]=e,n=1===e.positionedLines.length)}}T("left")}else{if("auto"===v&&(v=ay(f)),w||d.get("text-writing-mode").indexOf("horizontal")>=0||!$o(n)){const e=n_(y,t,i,r,a,S,h,f,v,u,k,e_.horizontal,!1,m,p,l);e&&(_.horizontal[v]=e)}T(w?"left":v)}}let M,A,C,D,L,E,I=!1;const P=d.get("icon-text-fit").evaluate(o,{},s);if(o.icon&&o.icon.hasPrimary()){const t=iy(o.icon,e.iconSizeData,u["icon-size"],s,e.zoom,o,l,f.iconScaleFactor,h);M=t.iconPrimary,C=t.iconSecondary;const i=M.toString();if(A=n.get(i),A&&(L=d.get("icon-offset").evaluate(o,{},s),E=d.get("icon-anchor").evaluate(o,{},s),v=p_(r.get(i),C?r.get(C.toString()):void 0,L,E),I=A.sdf,void 0===e.sdfIcons?e.sdfIcons=A.sdf:e.sdfIcons!==A.sdf&&We("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(A.pixelRatio!==e.pixelRatio||0!==d.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0)),C){const e=C.toString();D=n.get(e)}}S=S||!(!o.icon||!o.icon.hasSecondary());const R=fy(_.horizontal)||_.vertical;e.iconsInText||(e.iconsInText=!!R&&R.iconsInText);const O=m*f.textScaleFactor/Eg,{defaultShapedIcon:z,verticallyShapedIcon:F}=ly(e,v,d,o,s,_,O,L,P);"none"!==P&&v&&(g_(v)||__(v))&&(ey(0,A,M,v,z,P,c,n,r),ey(0,D,C,v,z,P,c,n,r),F&&(ey(0,A,M,v,F,P,c,n,r),ey(0,D,C,v,F,P,c,n,r))),v=z,T.push({feature:o,shapedTextOrientations:_,shapedText:R,shapedIcon:v,iconPrimary:M,iconSecondary:C,iconOffset:L,iconAnchor:E,verticallyShapedIcon:F,layoutTextSize:m,layoutIconSize:g,textOffset:k,isSDFIcon:I,iconTextFit:P})}return{featureData:T,sizes:f,hasAnySecondaryIcon:S,textAlongLine:b,symbolPlacement:x}},e.fm=R_,e.fn=function(e,t,i,n,r,s,o,a,l,c){const{featureData:h,hasAnySecondaryIcon:d,sizes:u,textAlongLine:f,symbolPlacement:p}=t;for(const t of h){const{shapedIcon:i,verticallyShapedIcon:s,feature:h,shapedTextOrientations:m,shapedText:g,layoutTextSize:_,textOffset:y,isSDFIcon:v,iconPrimary:x,iconSecondary:b,iconTextFit:w,iconOffset:S}=t;ry(i,c.iconPositions,x,b),ry(s,c.iconPositions,x,b),sy(m,c.iconPositions),ny(x,b,c.iconPositions),(g||i)&&cy(e,h,m,i,s,l,u,_,0,y,v,n,r,o,a,d,w,S,f,p)}i&&e.generateCollisionDebugBuffers(s,e.collisionBoxArray,u.textScaleFactor)},e.fo=uh,e.fp=ob,e.fq=ah,e.fr=function(e){let t=0;if(new Uint32Array(e,0,1)[0]!==Up){const i=new Uint32Array(e,0,7),[,,n,r,s,o]=i;t=i.byteLength+r+s+o+s,(n!==e.byteLength||t>=e.byteLength)&&We("Invalid b3dm header information.")}return Jp(e,t)},e.fs=function(e,t){const i=Rm(e);for(const e of i){for(const t of e.meshes)Om(t);e.lights&&(e.lightMeshIndex=e.meshes.length,e.meshes.push(Fm(e.lights,t)))}return i},e.ft=Nv,e.fu=Xe,e.fv=_p,e.fw=ha,e.fx=ta,e.fy=function(e){St(),null!=xt&&xt.then(t=>{t.keys().then(i=>{for(let n=0;n<i.length-e;n++)t.delete(i[n]).catch(e=>We(e.message))}).catch(e=>We(e.message))}).catch(e=>We(e.message))},e.g=function(e,t){return Ot(Re(e,{method:"GET"}),t)},e.h=Re,e.i=function(e){return nt.API_STYLE_REGEX.test(e)&&!st(e)},e.j=function(e){return 0===e.indexOf("mapbox:")},e.k=rt,e.l=kt,e.m=function(e){return decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))},e.n=function(e,t){return Ot(Re(e,{type:"json"}),t)},e.o=Ht,e.p=function(e,t){return Ot(Re(e,{method:"POST"}),t)},e.q=ft,e.r=eu,e.s=function(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}},e.t=ut,e.u=function(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()},e.v=function(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e.w=We,e.x=function(){return Sp||(Sp=new xp),Sp},e.y=Xx,e.z=Jt}),n(0,function(e){function t(e){const t=e?e.url.toString():void 0;return t?performance.getEntriesByName(t):[]}function i(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(const n of e)t+=`${i(n)},`;return`${t}]`}let t="{";for(const n of Object.keys(e).sort())t+=`${n}:${i(e[n])},`;return`${t}}`}function n(t){let n="";for(const r of e.bu)n+=`/${i(t[r])}`;return n}class r{constructor(e){this.keyCache={},this._layers={},this._layerConfigs={},e&&this.replace(e)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(t,r,s){this._options=s;for(const i of t)this._layerConfigs[i.id]=i,(this._layers[i.id]=e.dn(i,this.scope,null,this._options)).compileFilter(s),this.keyCache[i.id]&&delete this.keyCache[i.id];for(const e of r)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const o=function(e,t){const r={};for(let s=0;s<e.length;s++){const o=e[s];let a=t&&t[o.id];a||("symbol"===o.type?a=o.id:(a=n(o),"line"===o.type&&o.paint&&function e(t){return"string"==typeof t&&"line-progress"===t||(Array.isArray(t)?t.some(e):!(!t||"object"!=typeof t)&&Object.values(t).some(e))}(o.paint["line-width"])&&(a+=`/${i(o.paint["line-width"])}`))),t&&(t[o.id]=a);let l=r[a];l||(l=r[a]=[]),l.push(o)}const s=[];for(const e in r)s.push(r[e]);return s}(Object.values(this._layerConfigs),this.keyCache);for(const e of o){const t=e.map(e=>this._layers[e.id]),i=t[0];if("none"===i.visibility)continue;const n=i.source||"";let r=this.familiesBySource[n];r||(r=this.familiesBySource[n]={});const s=i.sourceLayer||"_geojsonTileLayer";let o=r[s];o||(o=r[s]=[]),o.push(t)}}}const s=1*e.fa;class o{constructor(t){const i={},n=[];for(const e in t){const r=t[e],o=i[e]={};for(const e in r.glyphs){const t=r.glyphs[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const i=t.metrics.localGlyph?s:1,a={x:0,y:0,w:t.bitmap.width+2*i,h:t.bitmap.height+2*i};n.push(a),o[e]=a}}const{w:r,h:o}=e.H(n),a=new e.f9({width:r||1,height:o||1});for(const n in t){const r=t[n];for(const t in r.glyphs){const o=r.glyphs[+t];if(!o||0===o.bitmap.width||0===o.bitmap.height)continue;const l=i[n][t],c=o.metrics.localGlyph?s:1;e.f9.copy(o.bitmap,a,{x:0,y:0},{x:l.x+c,y:l.y+c},o.bitmap)}}this.image=a,this.positions=i}}e.f8(o,"GlyphAtlas");class a{constructor(t){this.tileID=new e.aM(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.lut=t.lut,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.scope=t.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.request&&t.request.collectResourceTiming,this.promoteId=t.promoteId,this.isSymbolTile=t.isSymbolTile,this.tileTransform=e.aW(t.tileID.canonical,t.projection),this.projection=t.projection,this.worldview=t.worldview,this.localizableLayerIds=t.localizableLayerIds,this.brightness=t.brightness,this.extraShadowCaster=!!t.extraShadowCaster,this.tessellationStep=t.tessellationStep,this.scaleFactor=t.scaleFactor,this.worldview=t.worldview}parse(t,i,n,r,s,a){this.status="parsing",this.data=t,this.collisionBoxArray=new e.b0;const c=new e.fb(Object.keys(t.layers).sort()),h=new e.fc(this.tileID,this.promoteId);h.bucketLayerIDs=[];const d={},u=new e.fd(256,256),f={featureIndex:h,iconDependencies:new Map,patternDependencies:new Map,glyphDependencies:{},lineAtlas:u,availableImages:n,brightness:this.brightness,scaleFactor:this.scaleFactor,elevationFeatures:void 0},p=[],m=i.familiesBySource[this.source];for(const i in m){const s=t.layers[i];if(!s)continue;let o=!1,a=!1,u=!1;for(const e of m[i])"symbol"===e[0].type?o=!0:a=!0,e[0].is3D()&&"model"!==e[0].type&&(u=!0);if(this.extraShadowCaster&&!u)continue;if(!0===this.isSymbolTile&&!o)continue;if(!1===this.isSymbolTile&&!a)continue;1===s.version&&e.w(`Vector tile source "${this.source}" layer "${i}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const g=c.encode(i),_=[];let y=!1;for(let t=0,n=0;t<s.length;t++){const r=s.feature(t),o=h.getId(r,i);if(this.localizableLayerIds&&this.localizableLayerIds.has(i)){const e=r.properties?r.properties.worldview:null;if(this.worldview&&"string"==typeof e)if("all"===e)r.properties.$localized=!0;else{if(!e.split(",").includes(this.worldview))continue;r.properties.$localized=!0,r.properties.worldview=this.worldview}}!y&&r.properties&&r.properties.hasOwnProperty(e.fe)&&(y=!0),_.push({feature:r,id:o,index:n,sourceLayerIndex:g}),n++}y&&!f.elevationFeatures&&t.layers.hasOwnProperty(e.ff)&&(f.elevationFeatures=e.fg.parseFrom(t.layers[e.ff],this.canonical));for(const t of m[i]){const i=t[0];if(this.extraShadowCaster&&(!i.is3D()||"model"===i.type))continue;if(void 0!==this.isSymbolTile&&"symbol"===i.type!==this.isSymbolTile)continue;if(i.minzoom&&this.zoom<Math.floor(i.minzoom))continue;if(i.maxzoom&&this.zoom>=i.maxzoom)continue;if("none"===i.visibility)continue;l(t,this.zoom,f.brightness,n,this.worldview);const s=d[i.id]=i.createBucket({index:h.bucketLayerIDs.length,layers:t,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:g,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep,styleDefinedModelURLs:r,worldview:this.worldview});h.bucketLayerIDs.push(t.map(t=>e.C(t.id,t.scope)));let o=s.prepare?s.prepare():null;null!=o?(o=o.then(()=>s.populate(_,f,this.tileID.canonical,this.tileTransform)),p.push(o)):s.populate(_,f,this.tileID.canonical,this.tileTransform)}}const g=()=>{let i,r,p,m,g,_;u.trim();const y={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},v=()=>{if(i)return this.status="done",a(i);if(this.extraShadowCaster)this.status="done",a(null,{buckets:Object.values(d).filter(e=>!e.isEmpty()),featureIndex:h,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:f.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(r&&p&&m){const t=new o(r),i=new Map;for(const[t,n]of p.entries()){const{imagePosition:r}=e.fj(t,n,e.fk);i.set(t,r)}const a={};for(const s in d){const o=d[s];o instanceof e.b1&&(l(o.layers,this.zoom,f.brightness,n,this.worldview),a[s]=e.fl(o,r,t.positions,p,i,this.tileID.canonical,this.tileZoom,this.scaleFactor,this.pixelRatio,g,this.worldview))}const c={iconsPending:!0,patternsPending:!0};this.rasterizeIfNeeded(s,p,g,()=>{c.iconsPending=!1,x(a,t,c)}),this.rasterizeIfNeeded(s,m,_,()=>{c.patternsPending=!1,x(a,t,c)})}},x=(t,i,r,s)=>{if(r.iconsPending||r.patternsPending)return;const o=new e.fm(p,m,this.lut);for(const i in d){const r=d[i];if(i in t)e.fn(r,t[i],this.showCollisionBoxes,n,this.tileID.canonical,this.tileZoom,this.projection,this.brightness,p,o);else if(r.hasPattern&&(r instanceof e.b7||r instanceof e.b8||r instanceof e.e4)){l(r.layers,this.zoom,f.brightness,n,this.worldview);const e=Object.fromEntries(o.patternPositions);r.addFeatures(f,this.tileID.canonical,e,n,this.tileTransform,this.brightness)}}this.status="done",a(null,{buckets:Object.values(d).filter(e=>!e.isEmpty()),featureIndex:h,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:i.image,lineAtlas:u,imageAtlas:o,brightness:f.brightness})};if(!this.extraShadowCaster){const t=e.fh(f.glyphDependencies,e=>Object.keys(e).map(Number));Object.keys(t).length?s.send("getGlyphs",{uid:this.uid,stacks:t},(e,t)=>{i||(i=e,r=t,v())},void 0,!1,y):r={};const n=Array.from(f.iconDependencies.keys()).map(t=>e.I.parse(t));n.length?s.send("getImages",{images:n,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},(e,t)=>{i||(i=e,p=new Map,g=this.updateImageMapAndGetImageTaskQueue(p,t,f.iconDependencies),v())},void 0,!1,y):(p=new Map,g=new Map);const o=Array.from(f.patternDependencies.keys()).map(t=>e.I.parse(t));o.length?s.send("getImages",{images:o,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},(e,t)=>{i||(i=e,m=new Map,_=this.updateImageMapAndGetImageTaskQueue(m,t,f.patternDependencies),v())},void 0,!1,y):(m=new Map,_=new Map)}if(f.elevationFeatures&&f.elevationFeatures.length>0){const i=[];for(const t of Object.values(d))if(t instanceof e.b8){const e=t.getUnevaluatedPortalGraph();e&&i.push(e)}const n=e.fi.evaluate(i);for(const i of Object.values(d))if(i instanceof e.b8){const e=t.layers[c.decode(i.sourceLayerIndex)];i.setEvaluatedPortalGraph(n,e,this.tileID.canonical,f.availableImages,f.brightness)}}v()};p.length>0?Promise.allSettled(p).then(g).catch(a):g()}rasterizeIfNeeded(e,t,i,n){Array.from(t.values()).some(e=>e.usvg)?this.rasterize(e,t,i,n):n()}updateImageMapAndGetImageTaskQueue(e,t,i){const n=new Map;for(const r of t.keys()){const s=i.get(r)||[];for(const i of s){const r=i.toString(),s=t.get(i.id.toString());s.usvg?n.has(r)||(n.set(r,i),e.set(r,Object.assign({},s))):e.set(r,s)}}return n}rasterize(e,t,i,n){this.rasterizeTask=e.send("rasterizeImages",{scope:this.scope,tasks:i},(e,i)=>{if(!e)for(const[e,n]of i.entries()){const i=Object.assign(t.get(e),{data:n});t.set(e,i)}n()})}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.cancel()}}function l(t,i,n,r,s){const o=new e.aa(i,{brightness:n,worldview:s});for(const e of t)e.recalculate(o,r)}class c extends e.E{constructor(t,i,n,r,s,o,a){super(),this.actor=t,this.layerIndex=i,this.availableImages=n,this.availableModels=r,this.loadVectorData=o||e.aJ,this.loading={},this.loaded={},this.deduped=new e.aI(t.scheduler),this.isSpriteLoaded=s,this.scheduler=t.scheduler,this.brightness=a}loadTile(i,n){const r=i.uid,s=i&&i.request,o=s&&s.collectResourceTiming,l=this.loading[r]=new a(i);l.abort=this.loadVectorData(i,(a,c)=>{const h=!this.loading[r];if(delete this.loading[r],l.cancelRasterize(),h||a||!c)return l.status="done",h||(this.loaded[r]=l),n(a);const d=c.rawData,u={};c.expires&&(u.expires=c.expires),c.cacheControl&&(u.cacheControl=c.cacheControl),l.vectorTile=c.vectorTile||new e.fo(new e.bq(d));const f=()=>{l.parse(l.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,(i,r)=>{if(i||!r)return n(i);const a={};if(o){const e=t(s);e.length>0&&(a.resourceTiming=JSON.parse(JSON.stringify(e)))}n(null,e.h({rawTileData:d.slice(0)},r,u,a))})};this.isSpriteLoaded?f():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(f,{type:"parseTile",isSymbolTile:i.isSymbolTile,zoom:i.tileZoom}):f()}),this.loaded=this.loaded||{},this.loaded[r]=l})}reloadTile(t,i){const n=this.loaded,r=t.uid;if(n&&n[r]){const s=n[r];s.scaleFactor=t.scaleFactor,s.showCollisionBoxes=t.showCollisionBoxes,s.projection=t.projection,s.brightness=t.brightness,s.tileTransform=e.aW(t.tileID.canonical,t.projection),s.extraShadowCaster=t.extraShadowCaster,s.lut=t.lut,s.worldview=t.worldview;const o=(e,t)=>{const n=s.reloadCallback;n&&(delete s.reloadCallback,s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,n)),i(e,t)};"parsing"===s.status?s.reloadCallback=o:"done"===s.status&&(s.vectorTile?s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,o):o())}else i(null,void 0)}abortTile(e,t){const i=e.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),t()}removeTile(e,t){const i=this.loaded,n=e.uid;i&&i[n]&&delete i[n],t()}}class h{loadTile(t,i){const{uid:n,encoding:r,rawImageData:s,padding:o}=t,a=ImageBitmap&&s instanceof ImageBitmap?this.getImageData(s,o):s;i(null,new e.fp(n,a,r,o<1))}reloadTile(e,t){t(null,null)}abortTile(e,t){t()}removeTile(e,t){t()}getImageData(e,t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);const i=this.offscreenCanvasContext.getImageData(-t,-t,e.width+2*t,e.height+2*t);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),i}}e.bp.setPbf(e.bq);class d{constructor(t){this._mrt=new e.bp(t.partial?30:1/0),this._isHeaderLoaded=!1,this.uid=t.uid,this.tileID=t.tileID,this.source=t.source}parse(t,i){const n=this._mrt;this.status="parsing",this._entireBuffer=t;try{n.parseHeader(t),this._isHeaderLoaded=!0;const r=[];for(const i in n.layers){const s=n.getLayer(i),o=s.getDataRange(s.getBandList()),a=n.createDecodingTask(o),l=t.slice(o.firstByte,o.lastByte+1),c=e.bp.performDecoding(l,a).then(e=>a.complete(null,e)).catch(e=>a.complete(e,null));r.push(c)}Promise.allSettled(r).then(()=>i(null,n)).catch(e=>i(e))}catch(e){i(e)}}}class u{constructor(e){this.actor=e,this.loading={},this.loaded={}}loadTile(t,i){const n=t.uid,r=t.request,s=this.loading[n]=new d(t),{cancel:o}=e.br(r,(e,t,r,o)=>{const a=!this.loading[n];if(delete this.loading[n],a||e||!t)return s.status="done",a||(this.loaded[n]=s),i(e);s.parse(t,(e,t)=>{if(e||!t)return i(e);i(null,t,r,o)}),this.loaded[n]=s});s.abort=o}reloadTile(e,t){t(null,void 0)}abortTile(e,t){const i=e.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),t()}removeTile(e,t){const i=e.uid;this.loaded[i]&&delete this.loaded[i],t()}decodeRasterArray(t,i){e.bp.performDecoding(t.buffer,t.task).then(e=>i(null,e)).catch(e=>i(e))}}const f=e.fq.prototype.toGeoJSON;class p{constructor(t){this._feature=t,this.extent=e.aj,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){const t=[];for(const i of this._feature.geometry)t.push([new e.P(i[0],i[1])]);return t}{const t=[];for(const i of this._feature.geometry){const n=[];for(const t of i)n.push(new e.P(t[0],t[1]));t.push(n)}return t}}toGeoJSON(e,t,i){return f.call(this,e,t,i)}}class m{constructor(t,i){this.name=t,this.extent=e.aj,this.length=i.length,this._jsonFeatures=i}feature(e){return new p(this._jsonFeatures[e])}}class g{constructor(t){this.layers={},this.extent=e.aj;for(const e of Object.keys(t))this.layers[e]=new m(e,t[e])}}const _=64/4096;class y{constructor(){this.features=new Map}clear(){this.features.clear()}load(e=[],t){for(const i of e){const e=i.id;if(null==e)continue;let n=this.features.get(e);n&&this.updateCache(n,t),i.geometry?(n=x(i),this.updateCache(n,t),this.features.set(e,n)):this.features.delete(e),this.updateCache(n,t)}}updateCache(e,t){for(const{canonical:i,uid:n}of Object.values(t)){const{z:r,x:s,y:o}=i;v(e,Math.pow(2,r),s,o)&&delete t[n]}}getTile(e,t,i){const n=Math.pow(2,e),r=[];for(const e of this.features.values())v(e,n,t,i)&&r.push(T(e,n,t,i));return{features:r}}getFeatures(){return[...this.features.values()]}}function v({minX:e,minY:t,maxX:i,maxY:n},r,s,o){return e<(s+1+_)/r&&t<(o+1+_)/r&&i>(s-_)/r&&n>(o-_)/r}function x(e){const{id:t,geometry:i,properties:n}=e;if(!i)return;if("GeometryCollection"===i.type)throw new Error("GeometryCollection not supported in dynamic mode.");const{type:r,coordinates:s}=i,o={id:t,type:1,geometry:[],tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},a=o.geometry;if("Point"===r)b(s,a,o);else if("MultiPoint"===r)for(const e of s)b(e,a,o);else if("LineString"===r)o.type=2,w(s,a,o);else if("MultiLineString"===r)o.type=2,S(s,a,o);else if("Polygon"===r)o.type=3,S(s,a,o,!0);else{if("MultiPolygon"!==r)throw new Error("Input data is not a valid GeoJSON object.");o.type=3;for(const e of s)S(e,a,o,!0)}return o}function b([t,i],n,r){const s=e.aD(t);let o=e.aH(i);o=o<0?0:o>1?1:o,n.push(s,o),r.minX=Math.min(r.minX,s),r.minY=Math.min(r.minY,o),r.maxX=Math.max(r.maxX,s),r.maxY=Math.max(r.maxY,o)}function w(e,t,i,n=!1,r=!1){const s=[];for(const t of e)b(t,s,i);t.push(s),n&&function(e,t){let i=0;for(let t=0,n=e.length,r=n-2;t<n;r=t,t+=2)i+=(e[t]-e[r])*(e[t+1]+e[r+1]);if(i>0===t)for(let t=0,i=e.length;t<i/2;t+=2){const n=e[t],r=e[t+1];e[t]=e[i-2-t],e[t+1]=e[i-1-t],e[i-2-t]=n,e[i-1-t]=r}}(s,r)}function S(e,t,i,n=!1){for(let r=0;r<e.length;r++)w(e[r],t,i,n,0===r)}function T(t,i,n,r){const{id:s,type:o,geometry:a,tags:l}=t,c=[];if(1===o)!function(t,i,n,r,s){for(let o=0;o<t.length;o+=2){const a=Math.round(e.aj*(t[o+0]*i-n)),l=Math.round(e.aj*(t[o+1]*i-r));s.push([a,l])}}(a,i,n,r,c);else for(const e of a)k(e,i,n,r,c);return{id:s,type:o,geometry:c,tags:l}}function k(t,i,n,r,s){const o=-128,a=e.aj+128;let l;for(let c=0;c<t.length-2;c+=2){let h=Math.round(e.aj*(t[c+0]*i-n)),d=Math.round(e.aj*(t[c+1]*i-r)),u=Math.round(e.aj*(t[c+2]*i-n)),f=Math.round(e.aj*(t[c+3]*i-r));const p=u-h,m=f-d;h<o&&u<o||(h<o?(d+=Math.round(m*((o-h)/p)),h=o):u<o&&(f=d+Math.round(m*((o-h)/p)),u=o),d<o&&f<o||(d<o?(h+=Math.round(p*((o-d)/m)),d=o):f<o&&(u=h+Math.round(p*((o-d)/m)),f=o),h>=a&&u>=a||(h>=a?(d+=Math.round(m*((a-h)/p)),h=a):u>=a&&(f=d+Math.round(m*((a-h)/p)),u=a),d>=a&&f>=a||(d>=a?(h+=Math.round(p*((a-d)/m)),d=a):f>=a&&(u=h+Math.round(p*((a-d)/m)),f=a),l&&h===l[l.length-1][0]&&d===l[l.length-1][1]||(l=[[h,d]],s.push(l)),l.push([u,f])))))}}function M({name:t,features:i},n){n.writeStringField(1,t),n.writeVarintField(5,e.aj);const r=new Map,s=new Map,o={keys:r,values:s,feature:null};for(const e of i)o.feature=e,n.writeMessage(2,A,o);for(const e of r.keys())n.writeStringField(3,e);for(const e of s.keys())n.writeMessage(4,I,e)}function A(e,t){const i=e.feature;void 0===i.id||isNaN(+i.id)||t.writeVarintField(1,+i.id),i.tags&&t.writeMessage(2,C,e),t.writeVarintField(3,i.type),t.writeMessage(4,E,i)}function C({keys:e,values:t,feature:i},n){for(const r of Object.keys(i.tags)){let s=i.tags[r];if(null===s)continue;let o=e.get(r);void 0===o&&(o=e.size,e.set(r,o)),n.writeVarint(o);const a=typeof s;"string"!==a&&"boolean"!==a&&"number"!==a&&(s=JSON.stringify(s));let l=t.get(s);void 0===l&&(l=t.size,t.set(s,l)),n.writeVarint(l)}}function D(e,t){return(t<<3)+(7&e)}function L(e){return e<<1^e>>31}function E(e,t){const{geometry:i,type:n}=e;let r=0,s=0;if(1===n){t.writeVarint(D(1,i.length));for(const e of i){const i=e[0]-r,n=e[1]-s;t.writeVarint(L(i)),t.writeVarint(L(n)),r+=i,s+=n}}else for(const e of i){t.writeVarint(D(1,1));const i=e.length-(3===n?1:0);for(let n=0;n<i;n++){1===n&&t.writeVarint(D(2,i-1));const o=e[n][0]-r,a=e[n][1]-s;t.writeVarint(L(o)),t.writeVarint(L(a)),r+=o,s+=a}3===n&&t.writeVarint(D(7,1))}}function I(e,t){const i=typeof e;"string"===i?t.writeStringField(1,e):"boolean"===i?t.writeBooleanField(7,e):"number"===i&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}const P={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},R=Math.fround||(O=new Float32Array(1),e=>(O[0]=+e,O[0]));var O;class z{constructor(e){this.options=Object.assign(Object.create(P),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:i,maxZoom:n}=this.options;t&&console.time("total time");const r=`prepare ${e.length} points`;t&&console.time(r),this.points=e;const s=[];for(let t=0;t<e.length;t++){const i=e[t];if(!i.geometry)continue;const[n,r]=i.geometry.coordinates,o=R(Y(n)),a=R(B(r));s.push(o,a,1/0,t,-1,1),this.options.reduce&&s.push(0)}let o=this.trees[n+1]=this._createTree(s);t&&console.timeEnd(r);for(let e=n;e>=i;e--){const i=+Date.now();o=this.trees[e]=this._createTree(this._cluster(o,e)),t&&console.log("z%d: %d clusters in %dms",e,o.numItems,+Date.now()-i)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let i=((e[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[1]));let r=180===e[2]?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)i=-180,r=180;else if(i>r){const e=this.getClusters([i,n,180,s],t),o=this.getClusters([-180,n,r,s],t);return e.concat(o)}const o=this.trees[this._limitZoom(t)],a=o.range(Y(i),B(s),Y(r),B(n)),l=o.data,c=[];for(const e of a){const t=this.stride*e;c.push(l[t+5]>1?F(l,t,this.clusterProps):this.points[l[t+3]])}return c}getChildren(e){const t=this._getOriginId(e),i=this._getOriginZoom(e),n="No cluster with the specified id.",r=this.trees[i];if(!r)throw new Error(n);const s=r.data;if(t*this.stride>=s.length)throw new Error(n);const o=this.options.radius/(this.options.extent*Math.pow(2,i-1)),a=r.within(s[t*this.stride],s[t*this.stride+1],o),l=[];for(const t of a){const i=t*this.stride;s[i+4]===e&&l.push(s[i+5]>1?F(s,i,this.clusterProps):this.points[s[i+3]])}if(0===l.length)throw new Error(n);return l}getLeaves(e,t,i){const n=[];return this._appendLeaves(n,e,t=t||10,i=i||0,0),n}getTile(e,t,i){const n=this.trees[this._limitZoom(e)],r=Math.pow(2,e),{extent:s,radius:o}=this.options,a=o/s,l=(i-a)/r,c=(i+1+a)/r,h={features:[]};return this._addTileFeatures(n.range((t-a)/r,l,(t+1+a)/r,c),n.data,t,i,r,h),0===t&&this._addTileFeatures(n.range(1-a/r,l,1,c),n.data,r,i,r,h),t===r-1&&this._addTileFeatures(n.range(0,l,a/r,c),n.data,-1,i,r,h),h.features.length?h:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const i=this.getChildren(e);if(t++,1!==i.length)break;e=i[0].properties.cluster_id}return t}_appendLeaves(e,t,i,n,r){const s=this.getChildren(t);for(const t of s){const s=t.properties;if(s&&s.cluster?r+s.point_count<=n?r+=s.point_count:r=this._appendLeaves(e,s.cluster_id,i,n,r):r<n?r++:e.push(t),e.length===i)break}return r}_createTree(t){const i=new e.c0(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let e=0;e<t.length;e+=this.stride)i.add(t[e],t[e+1]);return i.finish(),i.data=t,i}_addTileFeatures(e,t,i,n,r,s){for(const o of e){const e=o*this.stride,a=t[e+5]>1;let l,c,h;if(a)l=N(t,e,this.clusterProps),c=t[e],h=t[e+1];else{const i=this.points[t[e+3]];l=i.properties;const[n,r]=i.geometry.coordinates;c=Y(n),h=B(r)}const d={type:1,geometry:[[Math.round(this.options.extent*(c*r-i)),Math.round(this.options.extent*(h*r-n))]],tags:l};let u;u=a||this.options.generateId?t[e+3]:this.points[t[e+3]].id,void 0!==u&&(d.id=u),s.features.push(d)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:i,extent:n,reduce:r,minPoints:s}=this.options,o=i/(n*Math.pow(2,t)),a=e.data,l=[],c=this.stride;for(let i=0;i<a.length;i+=c){if(a[i+2]<=t)continue;a[i+2]=t;const n=a[i],h=a[i+1],d=e.within(a[i],a[i+1],o),u=a[i+5];let f=u;for(const e of d){const i=e*c;a[i+2]>t&&(f+=a[i+5])}if(f>u&&f>=s){let e,s=n*u,o=h*u,p=-1;const m=(i/c<<5)+(t+1)+this.points.length;for(const n of d){const l=n*c;if(a[l+2]<=t)continue;a[l+2]=t;const h=a[l+5];s+=a[l]*h,o+=a[l+1]*h,a[l+4]=m,r&&(e||(e=this._map(a,i,!0),p=this.clusterProps.length,this.clusterProps.push(e)),r(e,this._map(a,l)))}a[i+4]=m,l.push(s/f,o/f,1/0,m,-1,f),r&&l.push(p)}else{for(let e=0;e<c;e++)l.push(a[i+e]);if(f>1)for(const e of d){const i=e*c;if(!(a[i+2]<=t)){a[i+2]=t;for(let e=0;e<c;e++)l.push(a[i+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,i){if(e[t+5]>1){const n=this.clusterProps[e[t+6]];return i?Object.assign({},n):n}const n=this.points[e[t+3]].properties,r=this.options.map(n);return i&&r===n?Object.assign({},r):r}}function F(e,t,i){return{type:"Feature",id:e[t+3],properties:N(e,t,i),geometry:{type:"Point",coordinates:[(n=e[t],360*(n-.5)),H(e[t+1])]}};var n}function N(e,t,i){const n=e[t+5],r=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,s=e[t+6],o=-1===s?{}:Object.assign({},i[s]);return Object.assign(o,{cluster:!0,cluster_id:e[t+3],point_count:n,point_count_abbreviated:r})}function Y(e){return e/360+.5}function B(e){const t=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return i<0?0:i>1?1:i}function H(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function j(e,t,i,n){let r=n;const s=t+(i-t>>1);let o,a=i-t;const l=e[t],c=e[t+1],h=e[i],d=e[i+1];for(let n=t+3;n<i;n+=3){const t=V(e[n],e[n+1],l,c,h,d);if(t>r)o=n,r=t;else if(t===r){const e=Math.abs(n-s);e<a&&(o=n,a=e)}}r>n&&(o-t>3&&j(e,t,o,n),e[o+2]=r,i-o>3&&j(e,o,i,n))}function V(e,t,i,n,r,s){let o=r-i,a=s-n;if(0!==o||0!==a){const l=((e-i)*o+(t-n)*a)/(o*o+a*a);l>1?(i=r,n=s):l>0&&(i+=o*l,n+=a*l)}return o=e-i,a=t-n,o*o+a*a}function W(e,t,i,n){const r={id:e??null,type:t,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)U(r,i);else if("Polygon"===t)U(r,i[0]);else if("MultiLineString"===t)for(const e of i)U(r,e);else if("MultiPolygon"===t)for(const e of i)U(r,e[0]);return r}function U(e,t){for(let i=0;i<t.length;i+=3)e.minX=Math.min(e.minX,t[i]),e.minY=Math.min(e.minY,t[i+1]),e.maxX=Math.max(e.maxX,t[i]),e.maxY=Math.max(e.maxY,t[i+1])}function $(e,t,i,n){if(!t.geometry)return;const r=t.geometry.coordinates;if(r&&0===r.length)return;const s=t.geometry.type,o=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);let a=[],l=t.id;if(i.promoteId?l=t.properties[i.promoteId]:i.generateId&&(l=n||0),"Point"===s)G(r,a);else if("MultiPoint"===s)for(const e of r)G(e,a);else if("LineString"===s)X(r,a,o,!1);else if("MultiLineString"===s){if(i.lineMetrics){for(const i of r)a=[],X(i,a,o,!1),e.push(W(l,"LineString",a,t.properties));return}q(r,a,o,!1)}else if("Polygon"===s)q(r,a,o,!0);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(const r of t.geometry.geometries)$(e,{id:l,geometry:r,properties:t.properties},i,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const e of r){const t=[];q(e,t,o,!0),a.push(t)}}e.push(W(l,s,a,t.properties))}function G(e,t){t.push(Z(e[0]),J(e[1]),0)}function X(e,t,i,n){let r,s,o=0;for(let i=0;i<e.length;i++){const a=Z(e[i][0]),l=J(e[i][1]);t.push(a,l,0),i>0&&(o+=n?(r*l-a*s)/2:Math.sqrt(Math.pow(a-r,2)+Math.pow(l-s,2))),r=a,s=l}const a=t.length-3;t[2]=1,j(t,0,a,i),t[a+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function q(e,t,i,n){for(let r=0;r<e.length;r++){const s=[];X(e[r],s,i,n),t.push(s)}}function Z(e){return e/360+.5}function J(e){const t=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return i<0?0:i>1?1:i}function K(e,t,i,n,r,s,o,a){if(n/=t,s>=(i/=t)&&o<n)return e;if(o<i||s>=n)return null;const l=[];for(const t of e){const e=t.geometry;let s=t.type;const o=0===r?t.minX:t.minY,c=0===r?t.maxX:t.maxY;if(o>=i&&c<n){l.push(t);continue}if(c<i||o>=n)continue;let h=[];if("Point"===s||"MultiPoint"===s)Q(e,h,i,n,r);else if("LineString"===s)ee(e,h,i,n,r,!1,a.lineMetrics);else if("MultiLineString"===s)ie(e,h,i,n,r,!1);else if("Polygon"===s)ie(e,h,i,n,r,!0);else if("MultiPolygon"===s)for(const t of e){const e=[];ie(t,e,i,n,r,!0),e.length&&h.push(e)}if(h.length){if(a.lineMetrics&&"LineString"===s){for(const e of h)l.push(W(t.id,s,e,t.tags));continue}"LineString"!==s&&"MultiLineString"!==s||(1===h.length?(s="LineString",h=h[0]):s="MultiLineString"),"Point"!==s&&"MultiPoint"!==s||(s=3===h.length?"Point":"MultiPoint"),l.push(W(t.id,s,h,t.tags))}}return l.length?l:null}function Q(e,t,i,n,r){for(let s=0;s<e.length;s+=3){const o=e[s+r];o>=i&&o<=n&&ne(t,e[s],e[s+1],e[s+2])}}function ee(e,t,i,n,r,s,o){let a=te(e);const l=0===r?re:se;let c,h,d=e.start;for(let u=0;u<e.length-3;u+=3){const f=e[u],p=e[u+1],m=e[u+2],g=e[u+3],_=e[u+4],y=0===r?f:p,v=0===r?g:_;let x=!1;o&&(c=Math.sqrt(Math.pow(f-g,2)+Math.pow(p-_,2))),y<i?v>i&&(h=l(a,f,p,g,_,i),o&&(a.start=d+c*h)):y>n?v<n&&(h=l(a,f,p,g,_,n),o&&(a.start=d+c*h)):ne(a,f,p,m),v<i&&y>=i&&(h=l(a,f,p,g,_,i),x=!0),v>n&&y<=n&&(h=l(a,f,p,g,_,n),x=!0),!s&&x&&(o&&(a.end=d+c*h),t.push(a),a=te(e)),o&&(d+=c)}let u=e.length-3;const f=e[u],p=e[u+1],m=0===r?f:p;m>=i&&m<=n&&ne(a,f,p,e[u+2]),u=a.length-3,s&&u>=3&&(a[u]!==a[0]||a[u+1]!==a[1])&&ne(a,a[0],a[1],a[2]),a.length&&t.push(a)}function te(e){const t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ie(e,t,i,n,r,s){for(const o of e)ee(o,t,i,n,r,s,!1)}function ne(e,t,i,n){e.push(t,i,n)}function re(e,t,i,n,r,s){const o=(s-t)/(n-t);return ne(e,s,i+(r-i)*o,1),o}function se(e,t,i,n,r,s){const o=(s-i)/(r-i);return ne(e,t+(n-t)*o,s,1),o}function oe(e,t){const i=[];for(let n=0;n<e.length;n++){const r=e[n],s=r.type;let o;if("Point"===s||"MultiPoint"===s||"LineString"===s)o=ae(r.geometry,t);else if("MultiLineString"===s||"Polygon"===s){o=[];for(const e of r.geometry)o.push(ae(e,t))}else if("MultiPolygon"===s){o=[];for(const e of r.geometry){const i=[];for(const n of e)i.push(ae(n,t));o.push(i)}}i.push(W(r.id,s,o,r.tags))}return i}function ae(e,t){const i=[];i.size=e.size,void 0!==e.start&&(i.start=e.start,i.end=e.end);for(let n=0;n<e.length;n+=3)i.push(e[n]+t,e[n+1],e[n+2]);return i}function le(e,t){if(e.transformed)return e;const i=1<<e.z,n=e.x,r=e.y;for(const s of e.features){const e=s.geometry,o=s.type;if(s.geometry=[],1===o)for(let o=0;o<e.length;o+=2)s.geometry.push(ce(e[o],e[o+1],t,i,n,r));else for(let o=0;o<e.length;o++){const a=[];for(let s=0;s<e[o].length;s+=2)a.push(ce(e[o][s],e[o][s+1],t,i,n,r));s.geometry.push(a)}}return e.transformed=!0,e}function ce(e,t,i,n,r,s){return[Math.round(i*(e*n-r)),Math.round(i*(t*n-s))]}function he(e,t,i,n,r){const s=t===r.maxZoom?0:r.tolerance/((1<<t)*r.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:e.length,source:null,x:i,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const t of e)de(o,t,s,r);return o}function de(e,t,i,n){const r=t.geometry,s=t.type,o=[];if(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),"Point"===s||"MultiPoint"===s)for(let t=0;t<r.length;t+=3)o.push(r[t],r[t+1]),e.numPoints++,e.numSimplified++;else if("LineString"===s)ue(o,r,e,i,!1,!1);else if("MultiLineString"===s||"Polygon"===s)for(let t=0;t<r.length;t++)ue(o,r[t],e,i,"Polygon"===s,0===t);else if("MultiPolygon"===s)for(let t=0;t<r.length;t++){const n=r[t];for(let t=0;t<n.length;t++)ue(o,n[t],e,i,!0,0===t)}if(o.length){let i=t.tags||null;if("LineString"===s&&n.lineMetrics){i={};for(const e in t.tags)i[e]=t.tags[e];i.mapbox_clip_start=r.start/r.size,i.mapbox_clip_end=r.end/r.size}const a={geometry:o,type:"Polygon"===s||"MultiPolygon"===s?3:"LineString"===s||"MultiLineString"===s?2:1,tags:i};null!==t.id&&(a.id=t.id),e.features.push(a)}}function ue(e,t,i,n,r,s){const o=n*n;if(n>0&&t.size<(r?o:n))return void(i.numPoints+=t.length/3);const a=[];for(let e=0;e<t.length;e+=3)(0===n||t[e+2]>o)&&(i.numSimplified++,a.push(t[e],t[e+1])),i.numPoints++;r&&function(e,t){let i=0;for(let t=0,n=e.length,r=n-2;t<n;r=t,t+=2)i+=(e[t]-e[r])*(e[t+1]+e[r+1]);if(i>0===t)for(let t=0,i=e.length;t<i/2;t+=2){const n=e[t],r=e[t+1];e[t]=e[i-2-t],e[t+1]=e[i-1-t],e[i-2-t]=n,e[i-1-t]=r}}(a,s),e.push(a)}const fe={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class pe{constructor(e,t){const i=(t=this.options=function(e,t){for(const i in t)e[i]=t[i];return e}(Object.create(fe),t)).debug;if(i&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(e,t){const i=[];if("FeatureCollection"===e.type)for(let n=0;n<e.features.length;n++)$(i,e.features[n],t,n);else $(i,"Feature"===e.type?e:{geometry:e},t);return i}(e,t);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(e,t){const i=t.buffer/t.extent;let n=e;const r=K(e,1,-1-i,i,0,-1,2,t),s=K(e,1,1-i,2+i,0,-1,2,t);return(r||s)&&(n=K(e,1,-i,1+i,0,-1,2,t)||[],r&&(n=oe(r,1).concat(n)),s&&(n=n.concat(oe(s,-1)))),n}(n,t),n.length&&this.splitTile(n,0,0,0),i&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(e,t,i,n,r,s,o){const a=[e,t,i,n],l=this.options,c=l.debug;for(;a.length;){n=a.pop(),i=a.pop(),t=a.pop(),e=a.pop();const h=1<<t,d=me(t,i,n);let u=this.tiles[d];if(!u&&(c>1&&console.time("creation"),u=this.tiles[d]=he(e,t,i,n,l),this.tileCoords.push({z:t,x:i,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,i,n,u.numFeatures,u.numPoints,u.numSimplified),console.timeEnd("creation"));const e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(u.source=e,null==r){if(t===l.indexMaxZoom||u.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===r)continue;if(null!=r){const e=r-t;if(i!==s>>e||n!==o>>e)continue}}if(u.source=null,0===e.length)continue;c>1&&console.time("clipping");const f=.5*l.buffer/l.extent,p=.5-f,m=.5+f,g=1+f;let _=null,y=null,v=null,x=null,b=K(e,h,i-f,i+m,0,u.minX,u.maxX,l),w=K(e,h,i+p,i+g,0,u.minX,u.maxX,l);e=null,b&&(_=K(b,h,n-f,n+m,1,u.minY,u.maxY,l),y=K(b,h,n+p,n+g,1,u.minY,u.maxY,l),b=null),w&&(v=K(w,h,n-f,n+m,1,u.minY,u.maxY,l),x=K(w,h,n+p,n+g,1,u.minY,u.maxY,l),w=null),c>1&&console.timeEnd("clipping"),a.push(_||[],t+1,2*i,2*n),a.push(y||[],t+1,2*i,2*n+1),a.push(v||[],t+1,2*i+1,2*n),a.push(x||[],t+1,2*i+1,2*n+1)}}getTile(e,t,i){e=+e,t=+t,i=+i;const n=this.options,{extent:r,debug:s}=n;if(e<0||e>24)return null;const o=1<<e,a=me(e,t=t+o&o-1,i);if(this.tiles[a])return le(this.tiles[a],r);s>1&&console.log("drilling down to z%d-%d-%d",e,t,i);let l,c=e,h=t,d=i;for(;!l&&c>0;)c--,h>>=1,d>>=1,l=this.tiles[me(c,h,d)];return l&&l.source?(s>1&&(console.log("found parent tile z%d-%d-%d",c,h,d),console.time("drilling down")),this.splitTile(l.source,c,h,d,e,t,i),s>1&&console.timeEnd("drilling down"),this.tiles[a]?le(this.tiles[a],r):null):null}}function me(e,t,i){return 32*((1<<e)*i+t)+e}function ge(t,i){const n=t.tileID.canonical;if(!this._geoJSONIndex)return void i(null,null);const r=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!r)return void i(null,null);const s=e=>e.tags&&"3d_elevation_id"in e.tags&&"source"in e.tags&&"elevation"===e.tags.source,o=r.features.filter(e=>s(e));let a={_geojsonTileLayer:r.features};o.length>0&&(a={_geojsonTileLayer:r.features.filter(e=>!s(e)),hd_road_elevation:o});const l=new g(a),c=function(t){const i=new e.bq;for(const e of Object.keys(t))i.writeMessage(3,M,{name:e,features:t[e]});return i.finish()}(a).buffer;i(null,{vectorTile:l,rawData:c})}class _e extends c{constructor(e,t,i,n,r,s,o){super(e,t,i,n,r,ge,o),s&&(this.loadGeoJSON=s),this._dynamicIndex=new y}loadData(i,n){const r=i&&i.request,s=r&&r.collectResourceTiming;this._geoJSONIndex=null,this.loadGeoJSON(i,(o,a)=>{if(o||!a)return n(o);if("object"!=typeof a)return n(new Error(`Input data given to '${i.source}' is not a valid GeoJSON object.`));{try{if(i.filter){const t=e.X(i.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===t.result)throw new Error(t.value.map(e=>`${e.key}: ${e.message}`).join(", "));a.features=a.features.filter(e=>t.value.evaluate({zoom:0},e))}i.dynamic?("Feature"===a.type&&(a={type:"FeatureCollection",features:[a]}),i.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(a.features,this.loaded),i.cluster&&(a.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=i.cluster?new z(function({superclusterOptions:t,clusterProperties:i}){if(!i||!t)return t;const n={},r={},s={accumulated:null,zoom:0},o={properties:null},a=Object.keys(i);for(const t of a){const[s,o]=i[t],a=e.X(o),l=e.X("string"==typeof s?[s,["accumulated"],["get",t]]:s);n[t]=a.value,r[t]=l.value}return t.map=e=>{o.properties=e;const t={};for(const e of a)t[e]=n[e].evaluate(s,o);return t},t.reduce=(e,t)=>{o.properties=t;for(const t of a)s.accumulated=e[t],e[t]=r[t].evaluate(s,o)},t}(i)).load(a.features):i.dynamic?this._dynamicIndex:function(e,t){return new pe(e,t)}(a,i.geojsonVtOptions)}catch(e){return n(e)}const o={};if(s){const e=t(r);e&&(o.resourceTiming={},o.resourceTiming[i.source]=JSON.parse(JSON.stringify(e)))}n(null,o)}})}reloadTile(e,t){const i=this.loaded;return i&&i[e.uid]?e.partial?t(null,void 0):super.reloadTile(e,t):this.loadTile(e,t)}loadGeoJSON(t,i){if(t.request)e.n(t.request,i);else{if("string"!=typeof t.data)return i(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));setTimeout(()=>{try{return i(null,JSON.parse(t.data))}catch(e){return i(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`))}},0)}}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}}class ye{constructor(t,i,n){this.tileID=new e.aM(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=t.projection,this.brightness=i,this.worldview=n}parse(t,i,n,r){this.status="parsing";const s=new e.aM(n.tileID.overscaledZ,n.tileID.wrap,n.tileID.canonical.z,n.tileID.canonical.x,n.tileID.canonical.y),o=[],a=i.familiesBySource[n.source],l=new e.fc(s,n.promoteId);l.bucketLayerIDs=[],l.is3DTile=!0,e.fr(t).then(t=>{if(!t)return r(new Error("Could not parse tile"));const i=t.json.extensionsUsed&&t.json.extensionsUsed.includes("MAPBOX_mesh_features")||t.json.asset.extras&&t.json.asset.extras.MAPBOX_mesh_features,c=t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression"),h=new e.aa(this.zoom,{brightness:this.brightness,worldview:this.worldview});for(const r in a)for(const d of a[r]){const r=d[0];l.bucketLayerIDs.push(d.map(t=>e.C(t.id,t.scope))),r.recalculate(h,[]);const a=e.fs(t,1/e.d4(n.tileID.canonical)),u=new e.ft(d,a,s,i,c,this.brightness,l,this.worldview);i||(u.needsUpload=!0),o.push(u),u.evaluate(r)}this.status="done",r(null,{buckets:o,featureIndex:l,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null})}).catch(e=>r(new Error(e.message)))}}class ve{constructor(e,t,i,n,r,s,o,a){this.actor=e,this.layerIndex=t,this.availableImages=i,this.availableModels=n,this.brightness=o,this.loading={},this.loaded={},this.worldview=a}loadTile(t,i){const n=t.uid,r=this.loading[n]=new ye(t,this.brightness,this.worldview);e.br(t.request,(e,s)=>{const o=!this.loading[n];return delete this.loading[n],o||e?(r.status="done",o||(this.loaded[n]=r),i(e)):s&&0!==s.byteLength?void r.parse(s,this.layerIndex,t,(e,t)=>{r.status="done",this.loaded=this.loaded||{},this.loaded[n]=r,e||!t?i(e):i(null,t)}):(r.status="done",this.loaded[n]=r,i())})}reloadTile(e,t){const i=this.loaded,n=e.uid;if(i&&i[n]){const r=i[n];r.projection=e.projection,r.brightness=e.brightness;const s=(i,n)=>{r.reloadCallback&&(delete r.reloadCallback,this.loadTile(e,t)),t(i,n)};"parsing"===r.status?r.reloadCallback=s:"done"===r.status&&this.loadTile(e,t)}}abortTile(e,t){const i=e.uid;this.loading[i]&&delete this.loading[i],t()}removeTile(e,t){const i=this.loaded,n=e.uid;i&&i[n]&&delete i[n],t()}}class xe{constructor(t){this.self=t,this.actor=new e.fv(t,this),this.layerIndexes={},this.availableImages={},this.availableModels={},this.isSpriteLoaded={},this.imageRasterizer=new e.y,this.rtlPluginParsingListeners=[],this.projections={},this.defaultProjection=e.cj({name:"mercator"}),this.workerSourceTypes={vector:c,geojson:_e,"raster-dem":h,"raster-array":u,"batched-model":ve},this.workerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=t=>{if(e.fw.isParsed())throw new Error("RTL text plugin already registered.");e.fw.setState({pluginStatus:e.fx.parsed,pluginURL:e.fw.getPluginURL()}),e.fw.applyArabicShaping=t.applyArabicShaping,e.fw.processBidirectionalText=t.processBidirectionalText,e.fw.processStyledBidirectionalText=t.processStyledBidirectionalText;for(const e of this.rtlPluginParsingListeners)e(null,!0);this.rtlPluginParsingListeners=[]}}clearCaches(e,t,i){delete this.layerIndexes[e],delete this.availableImages[e],delete this.availableModels[e],delete this.workerSources[e],i()}checkIfReady(e,t,i){i()}setReferrer(e,t){this.referrer=t}spriteLoaded(t,i){this.isSpriteLoaded[t]||(this.isSpriteLoaded[t]={});const{scope:n,isLoaded:r}=i;if(this.isSpriteLoaded[t][n]=r,this.workerSources[t]&&this.workerSources[t][n])for(const i in this.workerSources[t][n]){const s=this.workerSources[t][n][i];for(const t in s){const i=s[t];i instanceof c&&(i.isSpriteLoaded=r,i.fire(new e.A("isSpriteLoaded")))}}}setImages(e,t,i){this.availableImages[e]||(this.availableImages[e]={});const{scope:n,images:r}=t;if(this.availableImages[e][n]=r,this.workerSources[e]&&this.workerSources[e][n]){for(const t in this.workerSources[e][n]){const i=this.workerSources[e][n][t];for(const e in i)i[e].availableImages=r}i()}else i()}setModels(e,{scope:t,models:i},n){if(this.availableModels[e]||(this.availableModels[e]={}),this.availableModels[e][t]=i,this.workerSources[e]&&this.workerSources[e][t]){for(const n in this.workerSources[e][t]){const r=this.workerSources[e][t][n];for(const e in r)r[e].availableModels=i}n()}else n()}setProjection(t,i){this.projections[t]=e.cj(i)}setBrightness(e,t,i){this.brightness=t,i()}setWorldview(e,t,i){this.worldview=t,i()}setLayers(e,t,i){this.getLayerIndex(e,t.scope).replace(t.layers,t.options),i()}updateLayers(e,t,i){this.getLayerIndex(e,t.scope).update(t.layers,t.removedIds,t.options),i()}loadTile(e,t,i){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).loadTile(t,i)}decodeRasterArray(e,t,i){this.getWorkerSource(e,t.type,t.source,t.scope).decodeRasterArray(t,i)}reloadTile(e,t,i){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).reloadTile(t,i)}abortTile(e,t,i){this.getWorkerSource(e,t.type,t.source,t.scope).abortTile(t,i)}removeTile(e,t,i){this.getWorkerSource(e,t.type,t.source,t.scope).removeTile(t,i)}removeSource(e,t,i){if(!(this.workerSources[e]&&this.workerSources[e][t.scope]&&this.workerSources[e][t.scope][t.type]&&this.workerSources[e][t.scope][t.type][t.source]))return;const n=this.workerSources[e][t.scope][t.type][t.source];delete this.workerSources[e][t.scope][t.type][t.source],void 0!==n.removeSource?n.removeSource(t,i):i()}loadWorkerSource(e,t,i){try{this.self.importScripts(t.url),i()}catch(e){i(e.toString())}}syncRTLPluginState(t,i,n){if(e.fw.isParsed())n(null,!0);else if(e.fw.isParsing())this.rtlPluginParsingListeners.push(n);else try{e.fw.setState(i);const t=e.fw.getPluginURL();!e.fw.isLoaded()||e.fw.isParsed()||e.fw.isParsing()||null==t||(e.fw.setState({pluginStatus:e.fx.parsing,pluginURL:e.fw.getPluginURL()}),this.self.importScripts(t),e.fw.isParsed()?n(null,!0):this.rtlPluginParsingListeners.push(n))}catch(e){n(e.toString())}}setDracoUrl(e,t){this.dracoUrl=t}getAvailableImages(e,t){this.availableImages[e]||(this.availableImages[e]={});let i=this.availableImages[e][t];return i||(i=[]),i}getAvailableModels(e,t){this.availableModels[e]||(this.availableModels[e]={});let i=this.availableModels[e][t];return i||(i={}),i}getLayerIndex(e,t){this.layerIndexes[e]||(this.layerIndexes[e]={});let i=this.layerIndexes[e][t];return i||(i=this.layerIndexes[e][t]=new r,i.scope=t),i}getWorkerSource(e,t,i,n){const r=this.workerSources;return r[e]||(r[e]={}),r[e][n]||(r[e][n]={}),r[e][n][t]||(r[e][n][t]={}),this.isSpriteLoaded[e]||(this.isSpriteLoaded[e]={}),r[e][n][t][i]||(r[e][n][t][i]=new this.workerSourceTypes[t]({send:(t,i,n,r,s,o)=>this.actor.send(t,i,n,e,s,o),scheduler:this.actor.scheduler},this.getLayerIndex(e,n),this.getAvailableImages(e,n),this.getAvailableModels(e,n),this.isSpriteLoaded[e][n],void 0,this.brightness,this.worldview)),r[e][n][t][i]}rasterizeImagesWorker(e,t,i){const n=new Map;for(const[i,{image:r,imageVariant:s}]of t.tasks.entries()){const o=this.imageRasterizer.rasterize(s,r,t.scope,e);n.set(i,o)}i(void 0,n)}removeRasterizedImages(e,t,i){this.imageRasterizer.removeImagesFromCacheByIds(t.imageIds,t.scope,e),i()}enforceCacheSizeLimit(t,i){e.fy(i)}getWorkerPerformanceMetrics(e,t,i){i(void 0,void 0)}}return e.fu(self)&&(self.worker=new xe(self)),xe}),n(0,function(e){var t="3.14.0";const i={create:"create",load:"load",fullLoad:"fullLoad"},n={mark(e){performance.mark(e)},measure(e,t,i){performance.measure(e,t,i)}};function r(t){const i=t.name.split("?")[0];return e.a(i)&&i.includes("mapbox-gl.js")?"javascript":e.a(i)&&i.includes("mapbox-gl.css")?"css":e.b(i)?"fontRange":e.c(i)?"sprite":e.i(i)?"style":e.d(i)?"tilejson":"other"}var s,o={},a=function(){if(s)return o;function e(e){return!t(e)}function t(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,i=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(i);try{t=new Worker(n),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(n),e}()?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var i=t.getImageData(0,0,1,1);return i&&i.width===e.width}()?(void 0===i[n=t&&t.failIfMajorPerformanceCaveat]&&(i[n]=function(t){var i,n=function(t){var i=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,i.getContext("webgl2",n)}(t);if(!n)return!1;try{i=n.createShader(n.VERTEX_SHADER)}catch(e){return!1}return!(!i||n.isContextLost())&&(n.shaderSource(i,"void main() {}"),n.compileShader(i),!0===n.getShaderParameter(i,n.COMPILE_STATUS))}(n)),i[n]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var n}s=1,o.supported=e,o.notSupportedReason=t;var i={};return e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0},o}();function l(e,t,i){const n=document.createElement(e);return null!=t&&(n.className=t),i&&i.appendChild(n),n}function c(e,t,i){const n=document.createElementNS("http://www.w3.org/2000/svg",e);for(const e of Object.keys(t))n.setAttributeNS(null,e,String(t[e]));return i&&i.appendChild(n),n}const h="undefined"!=typeof document?document.documentElement&&document.documentElement.style:null,d=h&&void 0!==h.userSelect?"userSelect":"WebkitUserSelect";let u;function f(){h&&d&&(u=h[d],h[d]="none")}function p(){h&&d&&(h[d]=u)}function m(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",m,!0)}function g(){window.addEventListener("click",m,!0),window.setTimeout(()=>{window.removeEventListener("click",m,!0)},0)}function _(e,t){const i=e.getBoundingClientRect();return x(e,i,t)}function y(e,t){const i=e.getBoundingClientRect(),n=[];for(let r=0;r<t.length;r++)n.push(x(e,i,t[r]));return n}function v(e){return/firefox/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)&&2===e.button&&e.ctrlKey?0:e.button}function x(t,i,n){const r=t.offsetWidth===i.width?1:t.offsetWidth/i.width;return new e.P((n.clientX-i.left)*r,(n.clientY-i.top)*r)}const b="01",w="NO_ACCESS_TOKEN";class S{constructor(e,t,i){this._transformRequestFn=e,this._customAccessToken=t,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){const e=function(){let e="";for(let t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",b,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}normalizeStyleURL(i,n){if(!e.j(i))return i;const r=k(i);return r.params.push(`sdk=js-${t}`),r.path=`/styles/v1${r.path}`,this._makeAPIURL(r,this._customAccessToken||n)}normalizeGlyphsURL(t,i){if(!e.j(t))return t;const n=k(t);return n.path=`/fonts/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||i)}normalizeModelURL(t,i){if(!e.j(t))return t;const n=k(t);return n.path=`/models/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||i)}normalizeSourceURL(t,i,n,r){if(!e.j(t))return t;const s=k(t);return s.path=`/v4/${s.authority}.json`,s.params.push("secure"),n&&s.params.push(`language=${n}`),r&&s.params.push(`worldview=${r}`),this._makeAPIURL(s,this._customAccessToken||i)}normalizeIconsetURL(t,i){const n=k(t);return e.j(t)?(n.path=`/styles/v1${n.path}/iconset.pbf`,this._makeAPIURL(n,this._customAccessToken||i)):M(n)}normalizeSpriteURL(t,i,n,r){const s=k(t);return e.j(t)?(s.path=`/styles/v1${s.path}/sprite${i}${n}`,this._makeAPIURL(s,this._customAccessToken||r)):(s.path+=`${i}${n}`,M(s))}normalizeTileURL(t,i,n){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!e.j(t))return t;const r=k(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${i||n&&"raster"!==r.authority&&512===n?"@2x":""}${e.l.supported?".webp":"$1"}`),"raster"===r.authority?r.path=`/${e.e.RASTER_URL_PREFIX}${r.path}`:"rasterarrays"===r.authority?r.path=`/${e.e.RASTERARRAYS_URL_PREFIX}${r.path}`:"3dtiles"===r.authority?r.path=`/${e.e.TILES3D_URL_PREFIX}${r.path}`:(r.path=r.path.replace(/^.+\/v4\//,"/"),r.path=`/${e.e.TILE_URL_VERSION}${r.path}`);const s=this._customAccessToken||function(e){for(const t of e){const e=t.match(/^access_token=(.*)$/);if(e)return e[1]}return null}(r.params)||e.e.ACCESS_TOKEN;return e.e.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&r.params.push(`sku=${this._skuToken}`),this._makeAPIURL(r,s)}canonicalizeTileURL(t,i){const n=k(t);if(!n.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!n.path.match(/\.[\w]+$/))return t;let r="mapbox://";n.path.match(/^\/raster\/v1\//)?r+=`raster/${n.path.replace(`/${e.e.RASTER_URL_PREFIX}/`,"")}`:n.path.match(/^\/rasterarrays\/v1\//)?r+=`rasterarrays/${n.path.replace(`/${e.e.RASTERARRAYS_URL_PREFIX}/`,"")}`:r+=`tiles/${n.path.replace(`/${e.e.TILE_URL_VERSION}/`,"")}`;let s=n.params;return i&&(s=s.filter(e=>!e.match(/^access_token=/))),s.length&&(r+=`?${s.join("&")}`),r}canonicalizeTileset(t,i){const n=!!i&&e.j(i),r=[];for(const i of t.tiles||[])e.k(i)?r.push(this.canonicalizeTileURL(i,n)):r.push(i);return r}_makeAPIURL(t,i){const n="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",r=k(e.e.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==r.path&&(t.path=`${r.path}${t.path}`),!e.e.REQUIRE_ACCESS_TOKEN)return M(t);if(i=i||e.e.ACCESS_TOKEN,!this._silenceAuthErrors){if(!i)throw new Error(`An API access token is required to use Mapbox GL. ${n}`);if("s"===i[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${n}`)}return t.params=t.params.filter(e=>-1===e.indexOf("access_token")),t.params.push(`access_token=${i||""}`),M(t)}}const T=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function k(e){const t=e.match(T);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function M(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const A="mapbox.eventData";function C(t){if(!t)return null;const i=t.split(".");if(!i||3!==i.length)return null;try{return JSON.parse(e.m(i[1]))}catch(e){return null}}class D{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const i=C(e.e.ACCESS_TOKEN);let n="";return n=i&&i.u?e.f(i.u):e.e.ACCESS_TOKEN||"",t?`${A}.${t}:${n}`:`${A}:${n}`}fetchEventData(){const t=e.s("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{const e=localStorage.getItem(i);e&&(this.eventData=JSON.parse(e));const t=localStorage.getItem(n);t&&(this.anonId=t)}catch(t){e.w("Unable to read from LocalStorage")}}saveEventData(){const t=e.s("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid"),r=this.anonId;if(t&&r)try{localStorage.setItem(n,r),Object.keys(this.eventData).length>=1&&localStorage.setItem(i,JSON.stringify(this.eventData))}catch(t){e.w("Unable to write to LocalStorage")}}processRequests(e){}postEvent(t,i,n,r){if(!e.e.EVENTS_URL)return;const s=k(e.e.EVENTS_URL);s.params.push(`access_token=${r||e.e.ACCESS_TOKEN||""}`);const o={event:this.type,created:new Date(t).toISOString()},a=i?e.h(o,i):o,l={url:M(s),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=e.p(l,e=>{this.pendingRequest=null,n(e),this.saveEventData(),this.processRequests(r)})}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}const L=new class extends D{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(t,i){e.e.EVENTS_URL&&e.e.ACCESS_TOKEN&&Array.isArray(t)&&t.some(t=>e.j(t)||e.k(t))&&this.queueRequest(Date.now(),i)}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const n=C(e.e.ACCESS_TOKEN),r=n?n.u:e.e.ACCESS_TOKEN;let s=r!==this.eventData.tokenU;e.v(this.anonId)||(this.anonId=e.u(),s=!0);const o=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(o),i=(o-this.eventData.lastSuccess)/864e5;s=s||i>=1||i<-1||e.getDate()!==t.getDate()}else s=!0;s?this.postEvent(o,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:b,"enabled.telemetry":!1,userId:this.anonId},e=>{e||(this.eventData.lastSuccess=o,this.eventData.tokenU=r)},i):this.processRequests()}},E=L.postTurnstileEvent.bind(L),I=new class extends D{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,i,n,r){this.skuToken=i,this.errorCb=r,e.e.EVENTS_URL&&(n||e.e.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},n):this.errorCb(new Error(w)))}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;const{id:n,timestamp:r}=this.queue.shift();n&&this.success[n]||(this.anonId||this.fetchEventData(),e.v(this.anonId)||(this.anonId=e.u()),this.postEvent(r,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:b,skuToken:this.skuToken,userId:this.anonId},e=>{e?this.errorCb(e):n&&(this.success[n]=!0)},i))}remove(){this.errorCb=null}},P=I.postMapLoadEvent.bind(I),R=new class extends D{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(t){let i=this.mapInstanceIdMap.get(t);return i||(i=e.u(),this.mapInstanceIdMap.set(t,i)),i}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(t,i){const{map:n,style:r,importedStyles:s}=i;if(!e.e.EVENTS_URL||!t&&!e.e.ACCESS_TOKEN)return;const o=this.getMapInstanceId(n),a={mapInstanceId:o,eventId:this.getEventId(o),style:r};s.length&&(a.importedStyles=s),this.queueRequest({timestamp:Date.now(),payload:a},t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:i}=this.queue.shift();this.postEvent(t,i,()=>{},e)}},O=R.postStyleLoadEvent.bind(R),z=new class extends D{constructor(){super("gljs.performance")}postPerformanceEvent(t,i){e.e.EVENTS_URL&&(t||e.e.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:i},t)}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:s,performanceData:o}=this.queue.shift(),a=function(n){const s=performance.getEntriesByType("resource"),o=performance.getEntriesByType("mark"),a=function(e){const t={};if(e)for(const i in e)if("other"!==i)for(const n of e[i]){const e=`${i}ResolveRangeMin`,r=`${i}ResolveRangeMax`,s=`${i}RequestCount`,o=`${i}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,n.startTime),t[r]=Math.max(t[r]||-1/0,n.responseEnd);const a=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==n.transferSize&&0===n.transferSize&&a(o),a(s)}return t}(function(e,t){const i={};if(e)for(const n of e){const e=t(n);void 0===i[e]&&(i[e]=[]),i[e].push(n)}return i}(s,r)),l=window.devicePixelRatio,c=navigator.connection||navigator.mozConnection||navigator.webkitConnection,h=c?c.effectiveType:void 0,d={counters:[],metadata:[],attributes:[]},u=(e,t,i)=>{null!=i&&e.push({name:t,value:i.toString()})};for(const e in a)u(d.counters,e,a[e]);if(n.interactionRange[0]!==1/0&&n.interactionRange[1]!==-1/0&&(u(d.counters,"interactionRangeMin",n.interactionRange[0]),u(d.counters,"interactionRangeMax",n.interactionRange[1])),o)for(const e of Object.keys(i)){const t=i[e],n=o.find(e=>e.name===t);n&&u(d.counters,t,n.startTime)}return u(d.counters,"visibilityHidden",n.visibilityHidden),u(d.attributes,"style",function(t){if(t)for(const i of t){const t=i.name.split("?")[0];if(e.i(t)){const e=t.split("/").slice(-2);if(2===e.length)return`mapbox://styles/${e[0]}/${e[1]}`}}}(s)),u(d.attributes,"terrainEnabled",n.terrainEnabled?"true":"false"),u(d.attributes,"fogEnabled",n.fogEnabled?"true":"false"),u(d.attributes,"projection",n.projection),u(d.attributes,"zoom",n.zoom),u(d.metadata,"devicePixelRatio",l),u(d.metadata,"connectionEffectiveType",h),u(d.metadata,"navigatorUserAgent",navigator.userAgent),u(d.metadata,"screenWidth",window.screen.width),u(d.metadata,"screenHeight",window.screen.height),u(d.metadata,"windowWidth",window.innerWidth),u(d.metadata,"windowHeight",window.innerHeight),u(d.metadata,"mapWidth",n.width/l),u(d.metadata,"mapHeight",n.height/l),u(d.metadata,"webglRenderer",n.renderer),u(d.metadata,"webglVendor",n.vendor),u(d.metadata,"sdkVersion",t),u(d.metadata,"sdkIdentifier","mapbox-gl-js"),d}(o);for(const e of a.metadata);for(const e of a.counters);for(const e of a.attributes);this.postEvent(s,a,()=>{},n)}},F=z.postPerformanceEvent.bind(z),N=new class extends D{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,i,n,r){if(!e.e.API_URL||!e.e.SESSION_PATH)return;const s=k(e.e.API_URL+e.e.SESSION_PATH);s.params.push(`sku=${i||""}`),s.params.push(`access_token=${r||e.e.ACCESS_TOKEN||""}`);const o={url:M(s),headers:{"Content-Type":"text/plain"}};this.pendingRequest=e.g(o,e=>{this.pendingRequest=null,n(e),this.saveEventData(),this.processRequests(r)})}getSessionAPI(t,i,n,r){this.skuToken=i,this.errorCb=r,e.e.SESSION_PATH&&e.e.API_URL&&(n||e.e.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},n):this.errorCb(new Error(w)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||this.getSession(i,this.skuToken,e=>{e?this.errorCb(e):t&&(this.success[t]=!0)},e)}remove(){this.errorCb=null}},Y=N.getSessionAPI.bind(N),B=new Set;function H(e,t){t?B.add(e):B.delete(e)}class j{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages={}}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(e,t){this._updatedSourceCaches[e]=t,this.setDirty()}discardSourceCacheUpdate(e){delete this._updatedSourceCaches[e]}updateLayer(e){const t=e.scope;this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._updatedLayers[t].add(e.id),this.setDirty()}removeLayer(e){const t=e.scope;this._removedLayers[t]=this._removedLayers[t]||{},this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._removedLayers[t][e.id]=e,this._updatedLayers[t].delete(e.id),this._updatedPaintProps.delete(e.fqid),this.setDirty()}getRemovedLayer(e){return this._removedLayers[e.scope]?this._removedLayers[e.scope][e.id]:null}discardLayerRemoval(e){this._removedLayers[e.scope]&&delete this._removedLayers[e.scope][e.id]}getLayerUpdatesByScope(){const e={};for(const t in this._updatedLayers)e[t]=e[t]||{},e[t].updatedIds=Array.from(this._updatedLayers[t].values());for(const t in this._removedLayers)e[t]=e[t]||{},e[t].removedIds=Object.keys(this._removedLayers[t]);return e}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(e){this._updatedPaintProps.add(e.fqid),this.setDirty()}getUpdatedImages(e){return this._updatedImages[e]?Array.from(this._updatedImages[e].values()):[]}updateImage(t,i){this._updatedImages[i]=this._updatedImages[i]||new Set,this._updatedImages[i].add(e.I.toString(t)),this.setDirty()}resetUpdatedImages(e){this._updatedImages[e]&&this._updatedImages[e].clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages={}}}function V(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class W extends e.E{constructor(t){super(),this.imageProviders=new Map,this.images=new Map,this.updatedImages=new Map,this.callbackDispatchedThisFrame=new Map,this.loaded=new Map,this.requestors=[],this.patterns=new Map,this.patternsInFlight=new Set,this.atlasImage=new Map,this.atlasTexture=new Map,this.dirty=!0,this.spriteFormat=t,"raster"!==t&&e.t()&&(this.imageRasterizerDispatcher=new e.D(e.x(),this,"Image Rasterizer Worker",1))}addScope(t){this.loaded.set(t,!1),this.imageProviders.set(t,new Map),this.images.set(t,new Map),this.updatedImages.set(t,new Set),this.callbackDispatchedThisFrame.set(t,new Set),this.patterns.set(t,new Map),this.atlasImage.set(t,new e.r({width:1,height:1}))}removeScope(e){this.loaded.delete(e),this.imageProviders.delete(e),this.images.delete(e),this.updatedImages.delete(e),this.callbackDispatchedThisFrame.delete(e),this.patterns.delete(e),this.atlasImage.delete(e);const t=this.atlasTexture.get(e);t&&(t.destroy(),this.atlasTexture.delete(e))}addImageProvider(e,t){this.imageProviders.has(t)||this.imageProviders.set(t,new Map),this.imageProviders.get(t).set(e.id,e)}removeImageProvider(e,t){this.imageProviders.has(t)&&this.imageProviders.get(t).delete(e)}getPendingImageProviders(){const e=[];for(const t of this.imageProviders.values())for(const i of t.values())i.hasPendingRequests()&&e.push(i);return e}get imageRasterizer(){return this._imageRasterizer||(this._imageRasterizer=new e.y),this._imageRasterizer}isLoaded(){for(const e of this.loaded.keys())if(!this.loaded.get(e))return!1;return!0}setLoaded(e,t){if(this.loaded.get(t)!==e&&(this.loaded.set(t,e),e)){for(const{ids:e,callback:i}of this.requestors)this._notify(e,t,i);this.requestors=[]}}hasImage(e,t){return!!this.getImage(e,t)}getImage(e,t){return this.images.get(t).get(e.toString())}addImage(e,t,i){this._validate(e,i)&&this.images.get(t).set(e.toString(),i)}_validate(t,i){let n=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new e.z(new Error(`Image "${t.name}" has invalid "stretchX" value`))),n=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new e.z(new Error(`Image "${t.name}" has invalid "stretchY" value`))),n=!1),this._validateContent(i.content,i)||(this.fire(new e.z(new Error(`Image "${t.name}" has invalid "content" value`))),n=!1),n}_validateStretch(e,t){if(!e)return!0;let i=0;for(const n of e){if(n[0]<i||n[1]<n[0]||t<n[1])return!1;i=n[1]}return!0}_validateContent(e,t){if(!e)return!0;if(4!==e.length)return!1;if(!t.usvg){if(e[0]<0||t.data.width<e[0])return!1;if(e[1]<0||t.data.height<e[1])return!1;if(e[2]<0||t.data.width<e[2])return!1;if(e[3]<0||t.data.height<e[3])return!1}return!(e[2]<e[0]||e[3]<e[1])}updateImage(e,t,i){const n=this.images.get(t).get(e.toString());i.version=n.version+1,this.images.get(t).set(e.toString(),i),this.updatedImages.get(t).add(e),this.removeFromImageRasterizerCache(e,t)}clearUpdatedImages(e){this.updatedImages.get(e).clear()}removeFromImageRasterizerCache(t,i){"raster"!==this.spriteFormat&&(e.t()?this.imageRasterizerDispatcher.getActor().send("removeRasterizedImages",{imageIds:[t],scope:i}):this.imageRasterizer.removeImagesFromCacheByIds([t],i))}removeImage(e,t){const i=this.images.get(t),n=i.get(e.toString());i.delete(e.toString()),this.patterns.get(t).delete(e.toString()),this.removeFromImageRasterizerCache(e,t),n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(t){return Array.from(this.images.get(t).keys()).map(t=>e.I.from(t))}getImages(e,t,i){const n=[],r=[],s=this.imageProviders.get(t);for(const i of e){if(!i.iconsetId){n.push(i);continue}const e=s.get(i.iconsetId);e&&(this.getImage(i,t)?r.push(i):e.addPendingRequest(i))}if(0===n.length)return void this._notify(r,t,i);let o=!0;const a=!!this.loaded.get(t),l=this.images.get(t);if(!a)for(const e of n)l.has(e.toString())||(o=!1);a||o?this._notify(n,t,i):this.requestors.push({ids:n,scope:t,callback:i})}rasterizeImages(e,t){const i=new Map,{tasks:n,scope:r}=e;for(const[e,t]of n.entries()){const n=this.getImage(t.id,r);n&&i.set(e,{image:n,imageVariant:t})}this._rasterizeImages(r,i,t)}_rasterizeImages(t,i,n){if(e.t())this.imageRasterizerDispatcher.getActor().send("rasterizeImagesWorker",{tasks:i,scope:t},n);else{const e=new Map;for(const[n,{image:r,imageVariant:s}]of i.entries())e.set(n,this.imageRasterizer.rasterize(s,r,t,0));n(void 0,e)}}getUpdatedImages(e){return this.updatedImages.get(e)||new Set}_notify(t,i,n){const r=this.images.get(i),s=new Map;for(const i of t){if(!r.get(i.toString())){if(i.iconsetId)continue;this.fire(new e.A("styleimagemissing",{id:i.name}))}const t=r.get(i.toString());if(!t){e.w(`Image "${i.name}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`);continue}const n={data:t.usvg?null:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,usvg:t.usvg,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)};t.usvg&&Object.assign(n,{width:t.icon.usvg_tree.width,height:t.icon.usvg_tree.height}),s.set(e.I.toString(i),n)}n(null,s)}getPixelSize(e){const{width:t,height:i}=this.atlasImage.get(e);return{width:t,height:i}}getPattern(t,i,n){const r=t.toString(),s=this.patterns.get(i),o=s.get(r),a=this.getImage(t,i);if(!a)return null;if(o){if(o.position.version===a.version)return o.position;o.position.version=a.version}else{if(a.usvg&&!a.data){const s=this.getPatternInFlightId(r,i);if(this.patternsInFlight.has(s))return null;this.patternsInFlight.add(s);const o=new e.B(t).scaleSelf(e.q.devicePixelRatio),l=new Map([[o.toString(),{image:a,imageVariant:o}]]);return this._rasterizeImages(i,l,(e,t)=>this.storePatternImage(o,i,a,n,t)),null}this.storePattern(t,i,a)}return this._updatePatternAtlas(i,n),s.get(r).position}getPatternInFlightId(t,i){return e.C(t,i)}hasPatternsInFlight(){return 0!==this.patternsInFlight.size}storePatternImage(e,t,i,n,r){const s=e.toString(),o=r?r.get(s):void 0;o&&(i.data=o,this.storePattern(e.id,t,i),this._updatePatternAtlas(t,n),this.patternsInFlight.delete(this.getPatternInFlightId(e.id.toString(),t)))}storePattern(t,i,n){const r={w:n.data.width+2*e.F,h:n.data.height+2*e.F,x:0,y:0},s=new e.G(r,n,e.F);this.patterns.get(i).set(t.toString(),{bin:r,position:s})}destroyAtlasTextures(){for(const e of this.atlasTexture.values())e&&e.destroy();this.atlasTexture.clear()}bind(t,i){const n=t.gl;let r=this.atlasTexture.get(i);r?this.dirty&&(r.update(this.atlasImage.get(i)),this.dirty=!1):(r=new e.T(t,this.atlasImage.get(i),n.RGBA8),this.atlasTexture.set(i,r)),r.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(t,i){const n=this.patterns.get(t),r=Array.from(n.values()).map(({bin:e})=>e),{w:s,h:o}=e.H(r),a=this.atlasImage.get(t);a.resize({width:s||1,height:o||1});const l=this.images.get(t);for(const[t,{bin:r,position:s}]of n.entries()){let n=s.padding;const o=r.x+n,c=r.y+n,h=l.get(t).data,d=h.width,u=h.height;n=n>1?n-1:n,e.r.copy(h,a,{x:0,y:0},{x:o,y:c},{width:d,height:u},i),e.r.copy(h,a,{x:0,y:u-n},{x:o,y:c-n},{width:d,height:n},i),e.r.copy(h,a,{x:0,y:0},{x:o,y:c+u},{width:d,height:n},i),e.r.copy(h,a,{x:d-n,y:0},{x:o-n,y:c},{width:n,height:u},i),e.r.copy(h,a,{x:0,y:0},{x:o+d,y:c},{width:n,height:u},i),e.r.copy(h,a,{x:d-n,y:u-n},{x:o-n,y:c-n},{width:n,height:n},i),e.r.copy(h,a,{x:0,y:u-n},{x:o+d,y:c-n},{width:n,height:n},i),e.r.copy(h,a,{x:0,y:0},{x:o+d,y:c+u},{width:n,height:n},i),e.r.copy(h,a,{x:d-n,y:0},{x:o-n,y:c+u},{width:n,height:n},i)}this.dirty=!0}beginFrame(){for(const e of this.images.keys())this.callbackDispatchedThisFrame.set(e,new Set)}dispatchRenderCallbacks(e,t){const i=this.images.get(t);for(const n of e){if(this.callbackDispatchedThisFrame.get(t).has(n.toString()))continue;this.callbackDispatchedThisFrame.get(t).add(n.toString());const e=i.get(n.toString());V(e)&&this.updateImage(n,t,e)}}destroy(){this.imageRasterizerDispatcher&&this.imageRasterizerDispatcher.remove()}}function U(t){const i=t.key,n=t.value,r=t.valueSpec||{},s=t.objectElementValidators||{},o=t.style,a=t.styleSpec;let l=[];const c=e.J(n);if("object"!==c)return[new e.V(i,n,`object expected, ${c} found`)];for(const t in n){const c=t.split(".")[0];let h;s[c]?h=s[c]:r[c]?h=fe:s["*"]?h=s["*"]:r["*"]&&(h=fe),h?l=l.concat(h({key:(i?`${i}.`:i)+t,value:n[t],valueSpec:r[c]||r["*"],style:o,styleSpec:a,object:n,objectKey:t},n)):l.push(new e.K(i,n[t],`unknown property "${t}"`))}for(const t in r)s[t]||r[t].required&&void 0===r[t].default&&void 0===n[t]&&l.push(new e.V(i,n,`missing required property "${t}"`));return l}function $(t){const i=t.value,n=t.valueSpec,r=t.style,s=t.styleSpec,o=t.key,a=t.arrayElementValidator||fe;if("array"!==e.J(i))return[new e.V(o,i,`array expected, ${e.J(i)} found`)];if(n.length&&i.length!==n.length)return[new e.V(o,i,`array length ${n.length} expected, length ${i.length} found`)];if(n["min-length"]&&i.length<n["min-length"])return[new e.V(o,i,`array length at least ${n["min-length"]} expected, length ${i.length} found`)];let l={type:n.value,values:n.values,minimum:n.minimum,maximum:n.maximum,function:void 0};s.$version<7&&(l.function=n.function),"object"===e.J(n.value)&&(l=n.value);let c=[];for(let e=0;e<i.length;e++)c=c.concat(a({array:i,arrayIndex:e,value:i[e],valueSpec:l,style:r,styleSpec:s,key:`${o}[${e}]`},!0));return c}function G(t){const i=t.key,n=t.value,r=t.valueSpec;let s=e.J(n);if("number"===s&&n!=n&&(s="NaN"),"number"!==s)return[new e.V(i,n,`number expected, ${s} found`)];if("minimum"in r){let s=r.minimum;if("array"===e.J(r.minimum)&&(s=r.minimum[t.arrayIndex]),n<s)return[new e.V(i,n,`${n} is less than the minimum value ${s}`)]}if("maximum"in r){let s=r.maximum;if("array"===e.J(r.maximum)&&(s=r.maximum[t.arrayIndex]),n>s)return[new e.V(i,n,`${n} is greater than the maximum value ${s}`)]}return[]}function X(t){const i=t.valueSpec,n=e.M(t.value.type);let r,s,o,a={};const l="categorical"!==n&&void 0===t.value.property,c=!l,h="array"===e.J(t.value.stops)&&"array"===e.J(t.value.stops[0])&&"object"===e.J(t.value.stops[0][0]),d=U({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===n)return[new e.V(t.key,t.value,'identity function may not have a "stops" property')];let i=[];const r=t.value;return i=i.concat($({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:u})),"array"===e.J(r)&&0===r.length&&i.push(new e.V(t.key,r,"array must have at least one stop")),i},default:function(e){return fe({key:e.key,value:e.value,valueSpec:i,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===n&&l&&d.push(new e.V(t.key,t.value,'missing required property "property"')),"identity"===n||t.value.stops||d.push(new e.V(t.key,t.value,'missing required property "stops"')),"exponential"===n&&t.valueSpec.expression&&!e.N(t.valueSpec)&&d.push(new e.V(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(c&&!e.O(t.valueSpec)?d.push(new e.V(t.key,t.value,"property functions not supported")):l&&!e.Q(t.valueSpec)&&d.push(new e.V(t.key,t.value,"zoom functions not supported"))),"categorical"!==n&&!h||void 0!==t.value.property||d.push(new e.V(t.key,t.value,'"property" property is required')),d;function u(t){let n=[];const r=t.value,l=t.key;if("array"!==e.J(r))return[new e.V(l,r,`array expected, ${e.J(r)} found`)];if(2!==r.length)return[new e.V(l,r,`array length 2 expected, length ${r.length} found`)];if(h){if("object"!==e.J(r[0]))return[new e.V(l,r,`object expected, ${e.J(r[0])} found`)];if(void 0===r[0].zoom)return[new e.V(l,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new e.V(l,r,"object stop key must have value")];const i=e.M(r[0].zoom);if("number"!=typeof i)return[new e.V(l,r[0].zoom,"stop zoom values must be numbers")];if(o&&o>i)return[new e.V(l,r[0].zoom,"stop zoom values must appear in ascending order")];i!==o&&(o=i,s=void 0,a={}),n=n.concat(U({key:`${l}[0]`,value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:G,value:f}}))}else n=n.concat(f({key:`${l}[0]`,value:r[0],style:t.style,styleSpec:t.styleSpec},r));return e.S(e.U(r[1]))?n.concat([new e.V(`${l}[1]`,r[1],"expressions are not allowed in function stops.")]):n.concat(fe({key:`${l}[1]`,value:r[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,o){const l=e.J(t.value),c=e.M(t.value),h=null!==t.value?t.value:o;if(r){if(l!==r)return[new e.V(t.key,h,`${l} stop domain type must match previous stop domain type ${r}`)]}else r=l;if("number"!==l&&"string"!==l&&"boolean"!==l&&"number"!=typeof c&&"string"!=typeof c&&"boolean"!=typeof c)return[new e.V(t.key,h,"stop domain value must be a number, string, or boolean")];if("number"!==l&&"categorical"!==n){let r=`number expected, ${l} found`;return e.O(i)&&void 0===n&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new e.V(t.key,h,r)]}return"categorical"!==n||"number"!==l||"number"==typeof c&&isFinite(c)&&Math.floor(c)===c?"categorical"!==n&&"number"===l&&"number"==typeof c&&"number"==typeof s&&void 0!==s&&c<s?[new e.V(t.key,h,"stop domain values must appear in ascending order")]:(s=c,"categorical"===n&&c in a?[new e.V(t.key,h,"stop domain values must be unique")]:(a[c]=!0,[])):[new e.V(t.key,h,`integer expected, found ${String(c)}`)]}}function q(t){const i=("property"===t.expressionContext?e.W:e.X)(e.U(t.value),t.valueSpec);if("error"===i.result)return i.value.map(i=>new e.V(`${t.key}${i.key}`,t.value,i.message));const n=i.value.expression||i.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!n.outputDefined())return[new e.V(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!e.Y(n))return[new e.V(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext)return Z(n,t);if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!e.Z(n,["zoom","feature-state"]))return[new e.V(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!e._(n))return[new e.V(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Z(t,i){const n=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(i.valueSpec&&i.valueSpec.expression)for(const e of i.valueSpec.expression.parameters)n.delete(e);if(0===n.size)return[];const r=[];return t instanceof e.$&&n.has(t.name)?[new e.V(i.key,i.value,`["${t.name}"] expression is not supported in a filter for a ${i.object.type} layer with id: ${i.object.id}`)]:(t.eachChild(e=>{r.push(...Z(e,i))}),r)}function J(t){const i=t.key,n=t.value,r=t.valueSpec,s=[];return Array.isArray(r.values)?-1===r.values.indexOf(e.M(n))&&s.push(new e.V(i,n,`expected one of [${r.values.join(", ")}], ${JSON.stringify(n)} found`)):-1===Object.keys(r.values).indexOf(e.M(n))&&s.push(new e.V(i,n,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(n)} found`)),s}function K(t){return e.a1(e.U(t.value))?q(e.L({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):Q(t)}function Q(t){const i=t.value,n=t.key;if("array"!==e.J(i))return[new e.V(n,i,`array expected, ${e.J(i)} found`)];const r=t.styleSpec;let s,o=[];if(i.length<1)return[new e.V(n,i,"filter array must have at least 1 element")];switch(o=o.concat(J({key:`${n}[0]`,value:i[0],valueSpec:r.filter_operator,style:t.style,styleSpec:t.styleSpec})),e.M(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===e.M(i[1])&&o.push(new e.V(n,i,`"$type" cannot be use with operator "${i[0]}"`));case"==":case"!=":3!==i.length&&o.push(new e.V(n,i,`filter array for operator "${i[0]}" must have 3 elements`));case"in":case"!in":i.length>=2&&(s=e.J(i[1]),"string"!==s&&o.push(new e.V(`${n}[1]`,i[1],`string expected, ${s} found`)));for(let a=2;a<i.length;a++)s=e.J(i[a]),"$type"===e.M(i[1])?o=o.concat(J({key:`${n}[${a}]`,value:i[a],valueSpec:r.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==s&&"number"!==s&&"boolean"!==s&&o.push(new e.V(`${n}[${a}]`,i[a],`string, number, or boolean expected, ${s} found`));break;case"any":case"all":case"none":for(let e=1;e<i.length;e++)o=o.concat(Q({key:`${n}[${e}]`,value:i[e],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":s=e.J(i[1]),2!==i.length?o.push(new e.V(n,i,`filter array for "${i[0]}" operator must have 2 elements`)):"string"!==s&&o.push(new e.V(`${n}[1]`,i[1],`string expected, ${s} found`))}return o}function ee(t,i){const n=t.key,r=t.style,s=t.layer,o=t.styleSpec,a=t.value,l=t.objectKey,c=o[`${i}_${t.layerType}`];if(!c)return[];const h=l.match(/^(.*)-use-theme$/);if("paint"===i&&h&&c[h[1]])return e.S(a)?[].concat(fe({key:t.key,value:a,valueSpec:{type:"string",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},style:r,styleSpec:o,expressionContext:"property",propertyType:i,propertyKey:l})):fe({key:n,value:a,valueSpec:{type:"string"},style:r,styleSpec:o});const d=l.match(/^(.*)-transition$/);if("paint"===i&&d&&c[d[1]]&&c[d[1]].transition)return fe({key:n,value:a,valueSpec:o.transition,style:r,styleSpec:o});const u=t.valueSpec||c[l];if(!u)return[new e.K(n,a,`unknown property "${l}"`)];let f;if("string"===e.J(a)&&e.O(u)&&!u.tokens&&(f=/^{([^}]+)}$/.exec(a))){const t=`\`{ "type": "identity", "property": ${f?JSON.stringify(f[1]):'"_"'} }\``;return[new e.V(n,a,`"${l}" does not support interpolation syntax\nUse an identity property function instead: ${t}.`)]}const p=[];if("symbol"===t.layerType)"text-field"!==l||!r||r.glyphs||r.imports||p.push(new e.V(n,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===l&&e.a2(e.U(a))&&"identity"===e.M(a.type)&&p.push(new e.V(n,a,'"text-font" does not support identity functions'));else if("model"===t.layerType&&"paint"===i&&s&&s.layout&&s.layout.hasOwnProperty("model-id")&&e.O(u)&&(e.a3(u)||e.Q(u))){const t=e.W(e.U(a),u),i=t.value.expression||t.value._styleExpression.expression;i&&!e.Z(i,["measure-light"])&&("model-emissive-strength"===l&&e._(i)&&e.Y(i)||p.push(new e.V(n,a,`${l} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`)))}return p.concat(fe({key:t.key,value:a,valueSpec:u,style:r,styleSpec:o,expressionContext:"property",propertyType:i,propertyKey:l}))}function te(e){return ee(e,"paint")}function ie(e){return ee(e,"layout")}function ne(t){let i=[];const n=t.value,r=t.key,s=t.style,o=t.styleSpec;n.type||n.ref||i.push(new e.V(r,n,'either "type" or "ref" is required'));let a=e.M(n.type);const l=e.M(n.ref);if(n.id){const o=e.M(n.id);for(let a=0;a<t.arrayIndex;a++){const t=s.layers[a];e.M(t.id)===o&&i.push(new e.V(r,n.id,`duplicate layer id "${n.id}", previously used at line ${t.id.__line__}`))}}if("ref"in n){let t;["type","source","source-layer","filter","layout"].forEach(t=>{t in n&&i.push(new e.V(r,n[t],`"${t}" is prohibited for ref layers`))}),s.layers.forEach(i=>{e.M(i.id)===l&&(t=i)}),t?t.ref?i.push(new e.V(r,n.ref,"ref cannot reference another ref layer")):a=e.M(t.type):"string"==typeof l&&i.push(new e.V(r,n.ref,`ref layer "${l}" not found`))}else if("background"!==a&&"sky"!==a&&"slot"!==a)if(n.source){const t=s.sources&&s.sources[n.source],o=t&&e.M(t.type);t?"vector"===o&&"raster"===a?i.push(new e.V(r,n.source,`layer "${n.id}" requires a raster source`)):"raster"===o&&"raster"!==a?i.push(new e.V(r,n.source,`layer "${n.id}" requires a vector source`)):"vector"!==o||n["source-layer"]?"raster-dem"===o&&"hillshade"!==a?i.push(new e.V(r,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"raster-array"!==o||["raster","raster-particle"].includes(a)?"line"===a&&n.paint&&(n.paint["line-gradient"]||n.paint["line-trim-offset"])&&"geojson"===o&&!t.lineMetrics?i.push(new e.V(r,n,`layer "${n.id}" specifies a line-gradient, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):"raster-particle"===a&&"raster-array"!==o&&i.push(new e.V(r,n.source,`layer "${n.id}" requires a 'raster-array' source.`)):i.push(new e.V(r,n.source,"raster-array source can only be used with layer type 'raster'.")):i.push(new e.V(r,n,`layer "${n.id}" must specify a "source-layer"`)):i.push(new e.V(r,n.source,`source "${n.source}" not found`))}else i.push(new e.V(r,n,'missing required property "source"'));return i=i.concat(U({key:r,value:n,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>fe({key:`${r}.type`,value:n.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"}),filter:t=>K(e.L({layerType:a},t)),layout:t=>U({layer:n,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>ie(e.L({layerType:a},t))}}),paint:t=>U({layer:n,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>te(e.L({layerType:a,layer:n},t))}})}})),i}function re(t){const i=t.value,n=t.key,r=e.J(i);return"string"!==r?[new e.V(n,i,`string expected, ${r} found`)]:[]}const se={promoteId:function t({key:i,value:n}){if("string"===e.J(n))return re({key:i,value:n});if(Array.isArray(n)){const t=[],r=e.U(n),s=e.X(r);return"error"===s.result&&s.value.forEach(n=>{t.push(new e.V(`${i}${n.key}`,null,`${n.message}`))}),e.Z(s.value.expression,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])||t.push(new e.V(`${i}`,null,"promoteId expression should be only feature dependent")),t}{const e=[];for(const r in n)e.push(...t({key:`${i}.${r}`,value:n[r]}));return e}}};function oe(t){const i=t.value,n=t.key,r=t.styleSpec,s=t.style;if(!i.type)return[new e.V(n,i,'"type" is required')];const o=e.M(i.type);let a=[];switch(["vector","raster","raster-dem","raster-array"].includes(o)&&(i.url||i.tiles||a.push(new e.K(n,i,'Either "url" or "tiles" is required.'))),o){case"vector":case"raster":case"raster-dem":case"raster-array":return a=a.concat(U({key:n,value:i,valueSpec:r[`source_${o.replace("-","_")}`],style:t.style,styleSpec:r,objectElementValidators:se})),a;case"geojson":if(a=U({key:n,value:i,valueSpec:r.source_geojson,style:s,styleSpec:r,objectElementValidators:se}),i.cluster)for(const e in i.clusterProperties){const[t,r]=i.clusterProperties[e],s="string"==typeof t?[t,["accumulated"],["get",e]]:t;a.push(...q({key:`${n}.${e}.map`,value:r,expressionContext:"cluster-map"})),a.push(...q({key:`${n}.${e}.reduce`,value:s,expressionContext:"cluster-reduce"}))}return a;case"video":return U({key:n,value:i,valueSpec:r.source_video,style:s,styleSpec:r});case"image":return U({key:n,value:i,valueSpec:r.source_image,style:s,styleSpec:r});case"canvas":return[new e.V(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return J({key:`${n}.type`,value:i.type,valueSpec:{values:ae(r)}})}}function ae(e){return e.source.reduce((t,i)=>{const n=e[i];return"enum"===n.type.type&&(t=t.concat(Object.keys(n.type.values))),t},[])}function le(t){const i=t.value,n=t.styleSpec,r=n.light,s=t.style;let o=[];const a=e.J(i);if(void 0===i)return o;if("object"!==a)return o=o.concat([new e.V("light",i,`object expected, ${a} found`)]),o;for(const t in i){const a=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);o=o.concat(l&&r[l[1]]?fe({key:t,value:i[t],valueSpec:{type:"string"},style:s,styleSpec:n}):a&&r[a[1]]&&r[a[1]].transition?fe({key:t,value:i[t],valueSpec:n.transition,style:s,styleSpec:n}):r[t]?fe({key:t,value:i[t],valueSpec:r[t],style:s,styleSpec:n}):[new e.V(t,i[t],`unknown property "${t}"`)])}return o}function ce(t){const i=t.value;let n=[];if(!i)return n;const r=e.J(i);if("object"!==r)return n=n.concat([new e.V("light-3d",i,`object expected, ${r} found`)]),n;const s=t.styleSpec,o=s["light-3d"],a=t.key,l=t.style,c=t.style.lights;for(const t of["type","id"])if(!(t in i))return n=n.concat([new e.V("light-3d",i,`missing property ${t} on light`)]),n;if(i.type&&c)for(let r=0;r<t.arrayIndex;r++){const t=e.M(i.type),s=c[r];e.M(s.type)===t&&n.push(new e.V(a,i.id,`duplicate light type "${i.type}", previously defined at line ${s.id.__line__}`))}const h=`properties_light_${i.type}`;if(!(h in s))return n=n.concat([new e.V("light-3d",i,`Invalid light type ${i.type}`)]),n;const d=s[h];for(const r in i)if("properties"===r){const o=i[r],a=e.J(o);if("object"!==a)return n=n.concat([new e.V("properties",o,`object expected, ${a} found`)]),n;for(const a in o){const c=a.match(/^(.*)-transition$/),h=a.match(/^(.*)-use-theme$/);n=n.concat(h&&d[h[1]]?fe({key:r,value:o[a],valueSpec:{type:"string"},style:l,styleSpec:s}):c&&d[c[1]]&&d[c[1]].transition?fe({key:r,value:i[r],valueSpec:s.transition,style:l,styleSpec:s}):d[a]?fe({key:a,value:o[a],valueSpec:d[a],style:l,styleSpec:s}):[new e.K(t.key,o[a],`unknown property "${a}"`)])}}else n=n.concat(o[r]?fe({key:r,value:i[r],valueSpec:o[r],style:l,styleSpec:s}):[new e.K(r,i[r],`unknown property "${r}"`)]);return n}function he(t){const i=t.value,n=t.key,r=t.style,s=t.styleSpec,o=s.terrain;let a=[];const l=e.J(i);if(void 0===i)return a;if("null"===l)return a;if("object"!==l)return a=a.concat([new e.V("terrain",i,`object expected, ${l} found`)]),a;for(const t in i){const n=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);a=a.concat(l&&o[l[1]]?fe({key:t,value:i[t],valueSpec:{type:"string"},style:r,styleSpec:s}):n&&o[n[1]]&&o[n[1]].transition?fe({key:t,value:i[t],valueSpec:s.transition,style:r,styleSpec:s}):o[t]?fe({key:t,value:i[t],valueSpec:o[t],style:r,styleSpec:s}):[new e.K(t,i[t],`unknown property "${t}"`)])}if(i.source){const t=r.sources&&r.sources[i.source],s=t&&e.M(t.type);t?"raster-dem"!==s&&a.push(new e.V(n,i.source,`terrain cannot be used with a source of type ${String(s)}, it only be used with a "raster-dem" source type`)):a.push(new e.V(n,i.source,`source "${i.source}" not found`))}else a.push(new e.V(n,i,'terrain is missing required property "source"'));return a}function de(t){const i=t.value,n=t.style,r=t.styleSpec,s=r.fog;let o=[];const a=e.J(i);if(void 0===i)return o;if("object"!==a)return o=o.concat([new e.V("fog",i,`object expected, ${a} found`)]),o;for(const t in i){const a=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);o=o.concat(l&&s[l[1]]?fe({key:t,value:i[t],valueSpec:{type:"string"},style:n,styleSpec:r}):a&&s[a[1]]&&s[a[1]].transition?fe({key:t,value:i[t],valueSpec:r.transition,style:n,styleSpec:r}):s[t]?fe({key:t,value:i[t],valueSpec:s[t],style:n,styleSpec:r}):[new e.K(t,i[t],`unknown property "${t}"`)])}return o}const ue={"*":()=>[],array:$,boolean:function(t){const i=t.value,n=t.key,r=e.J(i);return"boolean"!==r?[new e.V(n,i,`boolean expected, ${r} found`)]:[]},number:G,color:function(t){const i=t.key,n=t.value,r=e.J(n);return"string"!==r?[new e.V(i,n,`color expected, ${r} found`)]:null===e.a0.parseCSSColor(n)?[new e.V(i,n,`color expected, "${n}" found`)]:[]},enum:J,filter:K,function:X,layer:ne,object:U,source:oe,model:e.a4,light:le,"light-3d":ce,terrain:he,fog:de,string:re,formatted:function(e){return 0===re(e).length?[]:q(e)},resolvedImage:function(e){return 0===re(e).length?[]:q(e)},projection:function(t){const i=t.value,n=t.styleSpec,r=n.projection,s=t.style;let o=[];const a=e.J(i);if("object"===a)for(const e in i)o=o.concat(fe({key:e,value:i[e],valueSpec:r[e],style:s,styleSpec:n}));else"string"!==a&&(o=o.concat([new e.V("projection",i,`object or string expected, ${a} found`)]));return o},import:function(t){const{value:i,styleSpec:n}=t,{data:r,...s}=i;Object.defineProperty(s,"__line__",{value:i.__line__,enumerable:!1});let o=U(e.L({},t,{value:s,valueSpec:n.import}));return""===e.M(s.id)&&o.push(new e.V(`${t.key}.id`,s,"import id can't be an empty string")),r&&(o=o.concat(me(r,n,{key:`${t.key}.data`}))),o},iconset:function(t){const i=t.value,n=t.key,r=t.styleSpec,s=t.style;if(!i.type)return[new e.V(n,i,'"type" is required')];const o=e.M(i.type);let a=[];if(a=a.concat(U({key:n,value:i,valueSpec:r[`iconset_${o}`],style:s,styleSpec:r})),"source"===o&&i.source){const t=s.sources&&s.sources[i.source],r=t&&e.M(t.type);t?"raster-array"!==r&&a.push(new e.V(n,i.source,`iconset cannot be used with a source of type ${String(r)}, it only be used with a "raster-array" source type`)):a.push(new e.V(n,i.source,`source "${i.source}" not found`))}return a}};function fe(t,i=!1){const n=t.value,r=t.valueSpec,s=t.styleSpec;if(r.expression&&e.a2(e.M(n)))return X(t);if(r.expression&&e.S(e.U(n)))return q(t);if(r.type&&ue[r.type]){const n=ue[r.type](t);return!0===i&&n.length>0&&"array"===e.J(t.value)?q(t):n}return U(e.L({},t,{valueSpec:r.type?s[r.type]:r}))}function pe(t){const i=t.value,n=t.key,r=re(t);return r.length||(-1===i.indexOf("{fontstack}")&&r.push(new e.V(n,i,'"glyphs" url must include a "{fontstack}" token')),-1===i.indexOf("{range}")&&r.push(new e.V(n,i,'"glyphs" url must include a "{range}" token'))),r}function me(t,i=e.a5,n={}){return fe({key:n.key||"",value:t,valueSpec:i.$root,styleSpec:i,style:t,objectElementValidators:{glyphs:pe,"*":()=>[]}})}function ge(t,i=e.a5){return De(me(t,i))}const _e=e=>De(oe(e)),ye=e=>De(le(e)),ve=e=>De(ce(e)),xe=e=>De(he(e)),be=e=>De(de(e)),we=t=>De(function(t){const i=t.value,n=t.style,r=t.styleSpec,s=r.snow;let o=[];const a=e.J(i);if(void 0===i)return o;if("object"!==a)return o=o.concat([new e.V("snow",i,`object expected, ${a} found`)]),o;for(const t in i){const a=t.match(/^(.*)-transition$/);o=o.concat(a&&s[a[1]]&&s[a[1]].transition?fe({key:t,value:i[t],valueSpec:r.transition,style:n,styleSpec:r}):s[t]?fe({key:t,value:i[t],valueSpec:s[t],style:n,styleSpec:r}):[new e.K(t,i[t],`unknown property "${t}"`)])}return o}(t)),Se=t=>De(function(t){const i=t.value,n=t.style,r=t.styleSpec,s=r.rain;let o=[];const a=e.J(i);if(void 0===i)return o;if("object"!==a)return o=o.concat([new e.V("rain",i,`object expected, ${a} found`)]),o;for(const t in i){const a=t.match(/^(.*)-transition$/);o=o.concat(a&&s[a[1]]&&s[a[1]].transition?fe({key:t,value:i[t],valueSpec:r.transition,style:n,styleSpec:r}):s[t]?fe({key:t,value:i[t],valueSpec:s[t],style:n,styleSpec:r}):[new e.K(t,i[t],`unknown property "${t}"`)])}return o}(t)),Te=e=>De(ne(e)),ke=e=>De(K(e)),Me=e=>De(te(e)),Ae=e=>De(ie(e)),Ce=t=>De(e.a4(t));function De(e){return e.slice().sort((e,t)=>e.line&&t.line?e.line-t.line:0)}function Le(t,i){let n=!1;if(i&&i.length)for(const r of i)r instanceof e.K?e.w(r.message):(t.fire(new e.z(new Error(r.message))),n=!0);return n}let Ee;class Ie extends e.E{constructor(t,i="flat"){super(),this._transitionable=new e.a6(Ee||(Ee=new e.a7({anchor:new e.a8(e.a5.light.anchor),position:new e.a9(e.a5.light.position),color:new e.a8(e.a5.light.color),intensity:new e.a8(e.a5.light.intensity)}))),this.setLight(t,i),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,t,i={}){this._validate(ye,e,i)||(this._transitionable.setTransitionOrValue(e),this.id=t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&Le(this,t.call(ge,e.h({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a5})))}}let Pe=class extends e.E{constructor(t,i,n,r,s){super(),this.scope=n,this._transitionable=new e.a6(new e.a7({source:new e.a8(e.a5.terrain.source),exaggeration:new e.a8(e.a5.terrain.exaggeration)}),n,r),this._transitionable.setTransitionOrValue(t,r),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=i,this.worldview=s}get(){return this._transitionable.serialize()}set(e,t){this._transitionable.setTransitionOrValue(e,t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}getExaggeration(t){return this._transitioning.possiblyEvaluate(new e.aa(t,{worldview:this.worldview})).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;const t=this._transitionable._values.exaggeration;if(!t)return null;const i=t.value.expression;if(!i)return null;let n=-1,r=-1,s=1;for(const t of i.zoomStops)s=i.evaluate(new e.aa(t,{worldview:this.worldview})),s>.01?(n=t,r=-1):r=t;return s<.01&&n>0&&r>n?[n,r]:null}isZoomDependent(){const t=this._transitionable._values.exaggeration;return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof e.ab}};const Re=.05;function Oe(t,i,n,r){const s=e.af(45,65,n),[o,a]=ze(t,r);let l=1-Math.min(1,Math.exp((i-o)/(a-o)*-6));return l*=l*l,l=Math.min(1,1.00747*l),l*s*t.alpha}function ze(e,t){const i=.5/Math.tan(.5*t);return[e.range[0]+i,e.range[1]+i]}function Fe(t,i,n,r,s){const o=e.ad([],[i,n,r],s.mercatorFogMatrix);return Oe(t,e.ae(o),s.pitch,s._fov)}function Ne(t,i,n,r,s,o,a){const l=[[n,r,0],[s,r,0],[s,o,0],[n,o,0]];let c=Number.MAX_VALUE,h=-Number.MAX_VALUE;for(const t of l){const n=e.ad([],t,i),r=e.ae(n);c=Math.min(c,r),h=Math.max(h,r)}return[Oe(t,c,a.pitch,a._fov),Oe(t,h,a.pitch,a._fov)]}class Ye extends e.E{constructor(t,i,n,r){super();const s=new e.a7({range:new e.a8(e.a5.fog.range),color:new e.a8(e.a5.fog.color),"color-use-theme":new e.a8({type:"string","property-type":"data-constant",default:"default"}),"high-color":new e.a8(e.a5.fog["high-color"]),"high-color-use-theme":new e.a8({type:"string","property-type":"data-constant",default:"default"}),"space-color":new e.a8(e.a5.fog["space-color"]),"space-color-use-theme":new e.a8({type:"string","property-type":"data-constant",default:"default"}),"horizon-blend":new e.a8(e.a5.fog["horizon-blend"]),"star-intensity":new e.a8(e.a5.fog["star-intensity"]),"vertical-range":new e.a8(e.a5.fog["vertical-range"])});this._transitionable=new e.a6(s,n,new Map(r)),this.set(t,r),this._transitioning=this._transitionable.untransitioned(),this._transform=i,this.properties=new e.ag(s),this.scope=n}get state(){const t=this._transform,i="globe"===t.projection.name,n=e.ah(t.zoom),r=this.properties.get("range"),s=[.5,3];return{range:i?[e.ai(s[0],r[0],n),e.ai(s[1],r[1],n)]:r,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(t,i,n={}){if(this._validate(be,t,n))return;const r=e.h({},t);for(const t of Object.keys(e.a5.fog))void 0===r[t]&&(r[t]=e.a5.fog[t].default);this._options=r,this._transitionable.setTransitionOrValue(this._options,i)}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const i=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:e.af(45,65,t))*i.a}getOpacityAtLatLng(t,i){return this._transform.projection.supportsFog?function(t,i,n){const r=e.ac.fromLngLat(i),s=n.elevation?n.elevation.getAtPointOrZero(r):0;return Fe(t,r.x,r.y,s,n)}(this.state,t,i):0}getOpacityForTile(t){if(!this._transform.projection.supportsFog)return[1,1];const i=this._transform.calculateFogTileMatrix(t.toUnwrapped());return Ne(this.state,i,0,0,e.aj,e.aj,this._transform)}getOpacityForBounds(e,t,i,n,r){return this._transform.projection.supportsFog?Ne(this.state,e,t,i,n,r,this._transform):[1,1]}getFovAdjustedRange(e){return this._transform.projection.supportsFog?ze(this.state,e):[0,1]}isVisibleOnFrustum(t){if(!this._transform.projection.supportsFog)return!1;const i=[4,5,6,7];for(const n of i){const i=t.points[n];let r;if(i[2]>=0)r=i;else{const s=t.points[n-4];r=e.ak(s,i,s[2]/(s[2]-i[2]))}if(Fe(this.state,r[0],r[1],0,this._transform)>=Re)return!0}return!1}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&Le(this,t.call(ge,e.h({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a5})))}}let Be,He,je,Ve,We=class extends e.E{constructor(t,i,n,r){super();const s=Be||(Be=new e.a7({density:new e.a8(e.a5.snow.density),intensity:new e.a8(e.a5.snow.intensity),color:new e.a8(e.a5.snow.color),opacity:new e.a8(e.a5.snow.opacity),vignette:new e.a8(e.a5.snow.vignette),"vignette-color":new e.a8(e.a5.snow["vignette-color"]),"center-thinning":new e.a8(e.a5.snow["center-thinning"]),direction:new e.a8(e.a5.snow.direction),"flake-size":new e.a8(e.a5.snow["flake-size"])}));this._transitionable=new e.a6(s,n,new Map(r)),this.set(t,r),this._transitioning=this._transitionable.untransitioned(),this.properties=new e.ag(s),this.scope=n}get state(){const t=this.properties.get("opacity"),i=this.properties.get("color"),n=this.properties.get("direction"),r=e.al(n[0]),s=-Math.max(e.al(n[1]),.01),o=[Math.cos(r)*Math.cos(s),Math.sin(r)*Math.cos(s),Math.sin(s)],a=this.properties.get("vignette"),l=this.properties.get("vignette-color");return l.a=a,{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new e.am(i.r,i.g,i.b,i.a*t),direction:o,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:l}}get(){return this._transitionable.serialize()}set(t,i,n={}){if(this._validate(we,t,n))return;const r=e.h({},t);for(const t of Object.keys(e.a5.snow))void 0===r[t]&&(r[t]=e.a5.snow[t].default);this._options=r,this._transitionable.setTransitionOrValue(this._options,i)}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&Le(this,t.call(ge,e.h({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a5})))}},Ue=class extends e.E{constructor(t,i,n,r){super();const s=He||(He=new e.a7({density:new e.a8(e.a5.rain.density),intensity:new e.a8(e.a5.rain.intensity),color:new e.a8(e.a5.rain.color),opacity:new e.a8(e.a5.rain.opacity),vignette:new e.a8(e.a5.rain.vignette),"vignette-color":new e.a8(e.a5.rain["vignette-color"]),"center-thinning":new e.a8(e.a5.rain["center-thinning"]),direction:new e.a8(e.a5.rain.direction),"droplet-size":new e.a8(e.a5.rain["droplet-size"]),"distortion-strength":new e.a8(e.a5.rain["distortion-strength"])}));this._transitionable=new e.a6(s,n,new Map(r)),this.set(t,r),this._transitioning=this._transitionable.untransitioned(),this.properties=new e.ag(s),this.scope=n}get state(){const t=this.properties.get("opacity"),i=this.properties.get("color"),n=this.properties.get("direction"),r=e.al(n[0]),s=-Math.max(e.al(n[1]),.01),o=[Math.cos(r)*Math.cos(s),Math.sin(r)*Math.cos(s),Math.sin(s)],a=this.properties.get("vignette-color");return a.a=this.properties.get("vignette"),{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new e.am(i.r,i.g,i.b,i.a*t),direction:o,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:a}}get(){return this._transitionable.serialize()}set(t,i,n={}){if(this._validate(Se,t,n))return;const r=e.h({},t);for(const t of Object.keys(e.a5.rain))void 0===r[t]&&(r[t]=e.a5.rain[t].default);this._options=r,this._transitionable.setTransitionOrValue(this._options,i)}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&Le(this,t.call(ge,e.h({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a5})))}};class $e extends e.E{constructor(t,i,n,r){super(),this.scope=n,this._options=t,this.properties=new e.ag(i),this._transitionable=new e.a6(i,n,new Map(r)),this._transitionable.setTransitionOrValue(t.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(e){this._transitionable.setTransitionOrValue(this._options.properties,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(e,t){this._options=e,this._transitionable.setTransitionOrValue(e.properties,t)}shadowsEnabled(){return!!this.properties&&!0===this.properties.get("cast-shadows")}}class Ge{constructor(e,t,i){this.screenBounds=e,this.cameraPoint=i.getCameraPoint(),this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=t,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,i)}static createFromScreenPoints(t,i){let n,r;if(t instanceof e.P||"number"==typeof t[0]){const s=e.P.convert(t);n=[s],r=i.isPointAboveHorizon(s)}else{const s=e.P.convert(t[0]),o=e.P.convert(t[1]),a=s.add(o)._div(2);n=[s,o],r=e.ao(s,o).every(e=>i.isPointAboveHorizon(e))&&i.isPointAboveHorizon(a)}return new Ge(n,r,i)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(t){return e.ao(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],r=e.ao(i,n,0,!1);return this.cameraPoint.y>n.y&&(this.cameraPoint.x>i.x&&this.cameraPoint.x<n.x?r.splice(3,0,this.cameraPoint):this.cameraPoint.x>=n.x?r[2]=this.cameraPoint:this.cameraPoint.x<=i.x&&(r[3]=this.cameraPoint)),e.ap(r,t)}bufferedCameraGeometryGlobe(t){const i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],r=e.ao(i,n,t),s=this.cameraPoint.clone();switch(3*((s.y>i.y)+(s.y>n.y))+((s.x>i.x)+(s.x>n.x))){case 0:r[0]=s,r[4]=s.clone();break;case 1:r.splice(1,0,s);break;case 2:r[1]=s;break;case 3:r.splice(4,0,s);break;case 5:r.splice(2,0,s);break;case 6:r[3]=s;break;case 7:r.splice(3,0,s);break;case 8:r[2]=s}return r}containsTile(t,i,n,r=0){const s=t.queryPadding/i._pixelsPerMercatorPixel+1,o=n?this._bufferedCameraMercator(s,i):this._bufferedScreenMercator(s,i);let a=t.tileID.wrap+(o.unwrapped?r:0);const l=o.polygon.map(i=>e.aq(t.tileTransform,i,a));if(!e.ar(l,0,0,e.aj,e.aj))return;a=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?r:0);const c=this.screenGeometryMercator.polygon.map(i=>e.as(t.tileTransform,i,a)),h=c.map(t=>new e.P(t[0],t[1])),d=i.getFreeCameraOptions().position||new e.ac(0,0,0),u=e.as(t.tileTransform,d,a),f=c.map(t=>{const i=e.at(t,t,u);return e.au(i,i),new e.av(u,i)}),p=e.aw(t,1,i.zoom)*i._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:h,tilespaceRays:f,bufferedTilespaceGeometry:l,bufferedTilespaceBounds:(m=e.ax(l),m.min.x=e.ay(m.min.x,0,e.aj),m.min.y=e.ay(m.min.y,0,e.aj),m.max.x=e.ay(m.max.x,0,e.aj),m.max.y=e.ay(m.max.y,0,e.aj),m),tile:t,tileID:t.tileID,pixelToTileUnitsFactor:p};var m}_bufferedScreenMercator(e,t){const i=Ze(e);if(this._screenRaycastCache[i])return this._screenRaycastCache[i];{let n;return n="globe"===t.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),t):{polygon:this.bufferedScreenGeometry(e).map(e=>t.pointCoordinate3D(e)),unwrapped:!0},this._screenRaycastCache[i]=n,n}}_bufferedCameraMercator(e,t){const i=Ze(e);if(this._cameraRaycastCache[i])return this._cameraRaycastCache[i];{let n;return n="globe"===t.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),t):{polygon:this.bufferedCameraGeometry(e).map(e=>t.pointCoordinate3D(e)),unwrapped:!0},this._cameraRaycastCache[i]=n,n}}_projectAndResample(t,i){const n=function(t,i){const n=e.az([],i.pixelMatrix,i.globeMatrix),r=[0,-e.aB,0,1],s=[0,e.aB,0,1],o=[0,0,0,1];e.aA(r,r,n),e.aA(s,s,n),e.aA(o,o,n);const a=new e.P(r[0]/r[3],r[1]/r[3]),l=new e.P(s[0]/s[3],s[1]/s[3]),c=e.aC(t,a)&&r[3]<o[3],h=e.aC(t,l)&&s[3]<o[3];if(!c&&!h)return null;const d=function(e,t,i){for(let n=1;n<e.length;n++){const r=qe(t.pointCoordinate3D(e[n-1]).x),s=qe(t.pointCoordinate3D(e[n]).x);if(i<0){if(r<s)return{idx:n,t:-r/(s-1-r)}}else if(s<r)return{idx:n,t:(1-r)/(s+1-r)}}return null}(t,i,c?-1:1);if(!d)return null;const{idx:u,t:f}=d;let p=u>1?Xe(t.slice(0,u),i):[],m=u<t.length?Xe(t.slice(u),i):[];p=p.map(t=>new e.P(qe(t.x),t.y)),m=m.map(t=>new e.P(qe(t.x),t.y));const g=[...p];0===g.length&&g.push(m[m.length-1]);const _=e.ai(g[g.length-1].y,(0===m.length?p[0]:m[0]).y,f);let y;return y=c?[new e.P(0,_),new e.P(0,0),new e.P(1,0),new e.P(1,_)]:[new e.P(1,_),new e.P(1,1),new e.P(0,1),new e.P(0,_)],g.push(...y),0===m.length?g.push(p[0]):g.push(...m),{polygon:g.map(t=>new e.ac(t.x,t.y)),unwrapped:!1}}(t,i);if(n)return n;const r=function(t,i){let n=!1,r=-1/0,s=0;for(let e=0;e<t.length-1;e++)t[e].x>r&&(r=t[e].x,s=e);for(let e=0;e<t.length-1;e++){const i=(s+e)%(t.length-1),r=t[i],o=t[i+1];Math.abs(r.x-o.x)>.5&&(r.x<o.x?(r.x+=1,0===i&&(t[t.length-1].x+=1)):(o.x+=1,i+1===t.length-1&&(t[0].x+=1)),n=!0)}const o=e.aD(i.center.lng);return n&&o<Math.abs(o-1)&&t.forEach(e=>{e.x-=1}),{polygon:t,unwrapped:n}}(Xe(t,i).map(t=>new e.P(qe(t.x),t.y)),i);return{polygon:r.polygon.map(t=>new e.ac(t.x,t.y)),unwrapped:r.unwrapped}}}function Xe(t,i){return e.aE(t,e=>{const t=i.pointCoordinate3D(e);e.x=t.x,e.y=t.y},1/256)}function qe(e){return e<0?1+e%1:e%1}function Ze(e){return 100*e|0}function Je(t,i,n,r,s){const o=function(n,r){if(n)return s(n);if(r){if(t.url&&r.tiles&&t.tiles&&delete t.tiles,r.variants){if(!Array.isArray(r.variants))return s(new Error("variants must be an array"));for(const t of r.variants){if(null==t||"object"!=typeof t||t.constructor!==Object)return s(new Error("variant must be an object"));if(!Array.isArray(t.capabilities))return s(new Error("capabilities must be an array"));if(1===t.capabilities.length&&"meshopt"===t.capabilities[0]){r=e.h(r,t);break}}}const n=e.aF(e.h({},r,t),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","extra_bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);n.tiles=i.canonicalizeTileset(n,t.url),s(null,n)}},a=function(e,t,i){if(!e)return null;if(!t&&!i)return e;i=i||e.worldview_default;const n=Object.values(e.language||{});if(0===n.length)return null;const r=Object.values(e.worldview||{});if(0===r.length)return null;const s=n.every(e=>e===t),o=r.every(e=>e===i);return s&&o?e:t in(e.language_options||{})||i in(e.worldview_options||{})?null:e.language_options&&e.worldview_options?e:null}(t.data,n,r);return a?e.q.frame(()=>o(null,a)):t.url?e.n(i.transformRequest(i.normalizeSourceURL(t.url,null,n,r),e.R.Source),o):e.q.frame(()=>{const{data:e,...i}=t;o(null,i)})}function Ke(t,i){const n=Math.pow(2,i.z),r=Math.floor(e.aD(t.getWest())*n),s=Math.floor(e.aH(t.getNorth())*n),o=Math.ceil(e.aD(t.getEast())*n),a=Math.ceil(e.aH(t.getSouth())*n);return i.x>=r&&i.x<o&&i.y>=s&&i.y<a}class Qe{constructor(t,i,n){this.bounds=t?e.aG.convert(this.validateBounds(t)):null,this.minzoom=i||0,this.maxzoom=n||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}addExtraBounds(t){if(t){this.extraBounds||(this.extraBounds=[]);for(const i of t)this.extraBounds.push(e.aG.convert(this.validateBounds(i)))}}contains(e){if(e.z>this.maxzoom||e.z<this.minzoom)return!1;if(this.bounds&&!Ke(this.bounds,e))return!1;if(!this.extraBounds)return!0;for(const t of this.extraBounds)if(Ke(t,e))return!0;return!1}static fromTileJSON(e){if(!e.bounds&&!e.extra_bounds)return null;const t=new Qe(e.bounds,e.minzoom,e.maxzoom);return t.addExtraBounds(e.extra_bounds),t}}class et extends e.E{constructor(t,i,n,r){if(super(),this.id=t,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.h(this,e.aF(i,["url","scheme","tileSize","promoteId"])),this._options=e.h({type:"vector"},i),this._collectResourceTiming=!!i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r),this._tileWorkers={},this._deduped=new e.aI}load(t){this._loaded=!1,this.fire(new e.A("dataloading",{dataType:"source"}));const i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,n=this.map.getWorldview();this._tileJSONRequest=Je(this._options,this.map._requestManager,i,n,(r,s)=>{if(this._tileJSONRequest=null,this._loaded=!0,r)i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),n&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${n}`),this.fire(new e.z(r));else if(s){if(e.h(this,s),this.hasWorldviews=!!s.worldview_options,s.worldview_default&&(this.worldviewDefault=s.worldview_default),s.vector_layers){this.vectorLayers=s.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set;for(const e of s.vector_layers)this.vectorLayerIds.push(e.id),s.worldview&&s.worldview[e.source]&&this.localizableLayerIds.add(e.id)}this.tileBounds=Qe.fromTileJSON(s),E(s.tiles,this.map._requestManager._customAccessToken),this.fire(new e.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.A("data",{dataType:"source",sourceDataType:"content"}))}t&&t(r)})}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.C(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return e.h({},this._options)}loadTile(t,i){const n=t.tileID.canonical.url(this.tiles,this.scheme),r=this.map._requestManager.normalizeTileURL(n),s=this.map._requestManager.transformRequest(r,e.R.Tile),o=this.map.style?this.map.style.getLut(this.scope):null,a=o?{image:o.image.clone()}:null,l={request:s,data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,lut:a,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,pixelRatio:e.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor(),worldview:this.map.getWorldview()||this.worldviewDefault};if(this.hasWorldviews&&e.j(n)&&(l.localizableLayerIds=this.localizableLayerIds),l.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state)"loading"===t.state?t.reloadCallback=i:t.request=t.actor.send("reloadTile",l,c.bind(this));else if(t.actor=this._tileWorkers[r]=this._tileWorkers[r]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",l,c.bind(this),void 0,!0);else{const i=e.aJ.call({deduped:this._deduped},l,(e,i)=>{e||!i?c.call(this,e):(l.data={cacheControl:i.cacheControl,expires:i.expires,rawData:i.rawData.slice(0)},t.actor&&t.actor.send("loadTile",l,c.bind(this),void 0,!0))},!0);t.request={cancel:i}}function c(n,r){return delete t.request,t.aborted?i(null):n&&404!==n.status?i(n):(r&&r.resourceTiming&&(t.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&t.setExpiryData(r),t.loadVectorData(r,this.map.painter),e.aK(this.dispatcher),i(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(e,t){e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class tt extends e.E{constructor(t,i,n,r){super(),this.id=t,this.dispatcher=n,this.setEventedParent(r),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.h({type:"raster"},i),e.h(this,e.aF(i,["url","scheme","tileSize"]))}load(t){this._loaded=!1,this.fire(new e.A("dataloading",{dataType:"source"}));const i=this.map.getWorldview();this._tileJSONRequest=Je(this._options,this.map._requestManager,null,i,(i,n)=>{this._tileJSONRequest=null,this._loaded=!0,i?this.fire(new e.z(i)):n&&(e.h(this,n),n.raster_layers&&(this.rasterLayers=n.raster_layers,this.rasterLayerIds=this.rasterLayers.map(e=>e.id)),this.tileBounds=Qe.fromTileJSON(n),E(n.tiles),this.fire(new e.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.A("data",{dataType:"source",sourceDataType:"content"}))),t&&t(i)})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.C(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return e.h({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,i){const n=e.q.devicePixelRatio>=2,r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),n,this.tileSize);t.request=e.o(this.map._requestManager.transformRequest(r,e.R.Tile),(n,r,s,o)=>(delete t.request,t.aborted?(t.state="unloaded",i(null)):n?(t.state="errored",i(n)):r?(this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:s,expires:o}),t.setTexture(r,this.map.painter),t.state="loaded",e.aK(this.dispatcher),void i(null)):i(null)))}abortTile(e,t){e.request&&(e.request.cancel(),delete e.request),t&&t()}unloadTile(t,i){t.texture&&t.texture instanceof e.T?(t.destroy(!0),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),i&&i()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class it extends tt{constructor(t,i,n,r){super(t,i,n,r),this.type="raster-array",this.maxzoom=22,this.partial=!0,this._options=e.h({type:"raster-array"},i)}triggerRepaint(e){const t=this.map.painter._terrain,i=this.map.style.getSourceCache(this.id);t&&t.enabled&&i&&t._clearRenderCacheForTile(i.id,e.tileID),this.map.triggerRepaint()}loadTile(t,i){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),r=this.map._requestManager.transformRequest(n,e.R.Tile),s={request:r,uid:t.uid,tileID:t.tileID,type:this.type,source:this.id,scope:this.scope,partial:this.partial};t.source=this.id,t.scope=this.scope,t.requestParams=r,t.actor||(t.actor=this.dispatcher.getActor());const o=(e,n,r,s)=>{if(delete t.request,t.aborted)return t.state="unloaded",i(null);if(e){if("AbortError"===e.name)return;return t.state="errored",i(e)}if(this.map._refreshExpiredTiles&&n&&t.setExpiryData({cacheControl:r,expires:s}),this.partial)t.state="empty";else{if(!n)return i(null);t.state="loaded",t._isHeaderLoaded=!0,t._mrt=n}i(null)};t.request=this.partial?t.fetchHeader(void 0,o.bind(this)):t.actor.send("loadTile",s,o.bind(this),void 0,!0)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(e,t){const i=e.texturePerLayer;if(e.flushAllQueues(),i.size){e.destroy(!0);for(const e of i.values())this.map.painter.saveTileTexture(e)}else e.destroy()}prepareTile(t,i,n,r){t._isHeaderLoaded&&("empty"!==t.state&&(t.state="reloading"),t.fetchBand(i,n,r,(i,r)=>{if(i)return t.state="errored",this.fire(new e.z(i)),void this.triggerRepaint(t);r&&(t._isHeaderLoaded=!0,t.setTexturePerLayer(n,r,this.map.painter),t.state="loaded",this.triggerRepaint(t))}))}getInitialBand(e){if(!this.rasterLayers)return 0;const t=this.rasterLayers.find(({id:t})=>t===e),i=t&&t.fields,n=i&&i.bands&&i.bands;return n?n[0]:0}getTextureDescriptor(t,i,n){if(!t)return;const r=i.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!r)return;let s=null;i instanceof e.aN?s=i.paint.get("raster-array-band"):i instanceof e.aO&&(s=i.paint.get("raster-particle-array-band"));const o=s||this.getInitialBand(r);if(null==o)return;if(!t.textureDescriptorPerLayer.get(i.id))return void this.prepareTile(t,r,i.id,o);if(t.updateNeeded(i.id,o)&&!n)return;const a=t.textureDescriptorPerLayer.get(i.id);return Object.assign({},a,{texture:t.texturePerLayer.get(i.id)})}getImages(t,i){const n=new Map;for(const r of t)for(const t of i){const[i,s]=t.split("/"),o=r.getLayer(i);if(!o)continue;if(!o.hasBand(s)||!o.hasDataForBand(s))continue;const{bytes:a,tileSize:l,buffer:c}=o.getBandView(s),h=l+2*c,d={data:new e.r({width:h,height:h},a),pixelRatio:2,sdf:!1,usvg:!1,version:0};n.set(t,d)}return n}}const nt={vector:et,raster:tt,"raster-dem":class extends tt{constructor(t,i,n,r){super(t,i,n,r),this.type="raster-dem",this.maxzoom=22,this._options=e.h({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}loadTile(t,i){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function r(e,n){e&&(t.state="errored",i(e)),n&&(t.dem=n,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0,t.state="loaded",i(null))}t.request=e.o(this.map._requestManager.transformRequest(n,e.R.Tile),function(n,s,o,a){if(delete t.request,t.aborted)t.state="unloaded",i(null);else if(n)t.state="errored",i(n);else if(s){this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:o,expires:a});const i=ImageBitmap&&s instanceof ImageBitmap&&e.t(),n=1-(s.width-e.aL(s.width))/2;n<1||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID));const l=i?s:e.q.getImageData(s,n),c={uid:t.uid,tileID:t.tileID,source:this.id,type:this.type,scope:this.scope,rawImageData:l,encoding:this.encoding,padding:n};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadTile",c,r.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(t){const i=t.canonical,n=Math.pow(2,i.z),r=(i.x-1+n)%n,s=0===i.x?t.wrap-1:t.wrap,o=(i.x+1+n)%n,a=i.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.aM(t.overscaledZ,s,i.z,r,i.y).key]={backfilled:!1},l[new e.aM(t.overscaledZ,a,i.z,o,i.y).key]={backfilled:!1},i.y>0&&(l[new e.aM(t.overscaledZ,s,i.z,r,i.y-1).key]={backfilled:!1},l[new e.aM(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new e.aM(t.overscaledZ,a,i.z,o,i.y-1).key]={backfilled:!1}),i.y+1<n&&(l[new e.aM(t.overscaledZ,s,i.z,r,i.y+1).key]={backfilled:!1},l[new e.aM(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new e.aM(t.overscaledZ,a,i.z,o,i.y+1).key]={backfilled:!1}),l}},"raster-array":it,geojson:class extends e.E{constructor(t,i,n,r){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=n.getActor(),this.setEventedParent(r),this._data=i.data,this._options=e.h({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),void 0!==i.minzoom&&(this.minzoom=i.minzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const s=e.aj/this.tileSize;this.workerOptions=e.h({source:this.id,scope:this.scope,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*s,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*s,extent:e.aj,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.aj,radius:(void 0!==i.clusterRadius?i.clusterRadius:50)*s,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter,dynamic:i.dynamic},i.workerOptions)}onAdd(e){this.map=e,this.setData(this._data)}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(t){if(!this._options.dynamic)return this.fire(new e.z(new Error("Can't call updateData on a GeoJSON source with dynamic set to false.")));if("string"!=typeof t&&("Feature"===t.type&&(t={type:"FeatureCollection",features:[t]}),"FeatureCollection"!==t.type))return this.fire(new e.z(new Error("Data to update should be a feature or a feature collection.")));if(this._coalesce&&"string"!=typeof t&&"string"!=typeof this._data&&"FeatureCollection"===this._data.type){const e=new Map;for(const t of this._data.features)e.set(t.id,t);for(const i of t.features)e.set(i.id,i);this._data.features=[...e.values()]}else this._data=t;return this._updateWorkerData(!0),this}getClusterExpansionZoom(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id,scope:this.scope},t),this}getClusterChildren(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id,scope:this.scope},t),this}getClusterLeaves(e,t,i,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:e,limit:t,offset:i},n),this}_updateWorkerData(t=!1){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new e.A("dataloading",{dataType:"source"})),this._loaded=!1;const i=e.h({append:t},this.workerOptions);i.scope=this.scope;const n=this._data;"string"==typeof n?(i.request=this.map._requestManager.transformRequest(e.q.resolveURL(n),e.R.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(n),this._pendingLoad=this.actor.send(`${this.type}.loadData`,i,(i,n)=>{if(this._loaded=!0,this._pendingLoad=null,i)this.fire(new e.z(i));else{const i={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&n&&n.resourceTiming&&n.resourceTiming[this.id]&&(i.resourceTiming=n.resourceTiming[this.id]),t&&(this._partialReload=!0),this.fire(new e.A("data",i)),this._partialReload=!1,this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(t),this._coalesce=!1)})}loaded(){return this._loaded}reload(){const t=e.C(this.id,this.scope);this.map.style.clearSource(t),this._updateWorkerData()}loadTile(t,i){const n=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const r=this.map.style?this.map.style.getLut(this.scope):null,s=r?{image:r.image.clone()}:null,o=this._partialReload,a={type:this.type,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:s,scope:this.scope,pixelRatio:e.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,scaleFactor:this.map.getScaleFactor(),partial:o,worldview:this.map.getWorldview()};t.request=this.actor.send(n,a,(e,r)=>o&&!r?(t.state="loaded",i(null)):(delete t.request,t.destroy(),t.aborted?i(null):e?i(e):(t.loadVectorData(r,this.map.painter,"reloadTile"===n),i(null))),void 0,"loadTile"===n)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e,t){this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy()}onRemove(e){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return e.h({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends e.aP{constructor(e,t,i,n){super(e,t,i,n),this.roundZoom=!0,this.type="video",this.options=t}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const i of t.urls)this.urls.push(this.map._requestManager.transformRequest(i,e.R.Source).url);e.aQ(this.urls,(t,i)=>{this._loaded=!0,t?this.fire(new e.z(t)):i&&(this.video=i,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const i=this.video.seekable;t<i.start(0)||t>i.end(0)?this.fire(new e.z(new e.V(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,i=t.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new e.T(t,this.video,i.RGBA8),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(t)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:e.aP,model:class extends e.E{constructor(e,t,i,n){super(),this.id=e,this.type="model",this.models=[],this._loaded=!1,this._options=t}load(){const t=[];for(const i in this._options.models){const n=this._options.models[i],r=e.aS(this.map._requestManager.transformRequest(n.uri,e.R.Model).url).then(t=>{if(!t)return;const r=e.aT(t),s=new e.aU(i,n.position,n.orientation,r);s.computeBoundsAndApplyParent(),this.models.push(s)}).catch(t=>{this.fire(new e.z(new Error(`Could not load model ${i} from ${n.uri}: ${t.message}`)))});t.push(r)}Promise.allSettled(t).then(()=>{this._loaded=!0,this.fire(new e.A("data",{dataType:"source",sourceDataType:"metadata"}))}).catch(t=>{this._loaded=!0,this.fire(new e.z(new Error(`Could not load models: ${t.message}`)))})}onAdd(e){this.map=e,this.load()}hasTransition(){return!1}loaded(){return this._loaded}getModels(){return this.models}loadTile(e,t){}serialize(){return this._options}},"batched-model":class extends e.E{constructor(e,t,i,n){super(),this.type="batched-model",this.id=e,this.tileSize=512,this._options=t,this.tiles=this._options.tiles,this.maxzoom=t.maxzoom||19,this.minzoom=t.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=i,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(n)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.C(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}load(t){this._loaded=!1,this.fire(new e.A("dataloading",{dataType:"source"}));const i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,n=this.map.getWorldview();this._tileJSONRequest=Je(this._options,this.map._requestManager,i,n,(r,s)=>{this._tileJSONRequest=null,this._loaded=!0,r?(i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),n&&2!==n.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${n}`),this.fire(new e.z(r))):s&&(e.h(this,s),s.bounds&&(this.tileBounds=new Qe(s.bounds,this.minzoom,this.maxzoom)),E(s.tiles,this.map._requestManager._customAccessToken),this.fire(new e.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.A("data",{dataType:"source",sourceDataType:"content"}))),t&&t(r)})}hasTransition(){return!1}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loaded(){return this._loaded}loadTile(t,i){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),r={request:this.map._requestManager.transformRequest(n,e.R.Tile),data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,pixelRatio:e.q.devicePixelRatio,promoteId:this.promoteId};if(t.actor&&"expired"!==t.state)if("loading"===t.state)t.reloadCallback=i;else{if(t.buckets){const e=Object.values(t.buckets);for(const t of e)t.dirty=!0;return void(t.state="loaded")}t.request=t.actor.send("reloadTile",r,s.bind(this))}else t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",r,s.bind(this),void 0,!0);function s(e,n){return t.aborted?i(null):e&&404!==e.status?i(e):(this.map._refreshExpiredTiles&&n&&t.setExpiryData(n),t.loadModelData(n,this.map.painter),t.state="loaded",void i(null))}}serialize(){return e.h({},this._options)}},canvas:class extends e.aP{constructor(t,i,n,r){super(t,i,n,r),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some(e=>!Array.isArray(e)||2!==e.length||e.some(e=>"number"!=typeof e))||this.fire(new e.z(new e.V(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.z(new e.V(`sources.${t}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new e.z(new e.V(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new e.z(new e.V(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.z(new e.V(`sources.${t}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.z(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(e){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context;this.texture?!t&&!this._playing||this.texture instanceof e.aR||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.T(i,this.canvas,i.gl.RGBA8,{premultiply:!0}),this._prepareData(i)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},custom:class extends e.E{constructor(t,i,n,r){super(),this.id=t,this.type="custom",this._dataType="raster",this._dispatcher=n,this._implementation=i,this.setEventedParent(r),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new e.z(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new e.z(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new Qe(this._implementation.bounds,this.minzoom,this.maxzoom)),i.update=this._update.bind(this),i.clearTiles=this._clearTiles.bind(this),i.coveringTiles=this._coveringTiles.bind(this),e.h(this,e.aF(i,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return e.aF(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new e.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.A("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(t){this.map=t,this._loaded=!1,this.fire(new e.A("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(t),this.load()}onRemove(e){this._implementation.onRemove&&this._implementation.onRemove(e)}hasTile(e){if(this._implementation.hasTile){const{x:t,y:i,z:n}=e.canonical;return this._implementation.hasTile({x:t,y:i,z:n})}return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e,t){const{x:i,y:n,z:r}=e.tileID.canonical,s=new AbortController;e.request=Promise.resolve(this._implementation.loadTile({x:i,y:n,z:r},{signal:s.signal})).then(function(i){return delete e.request,e.aborted?(e.state="unloaded",t(null)):void 0===i?(e.state="errored",t(null)):null===i?(this.loadTileData(e,{width:this.tileSize,height:this.tileSize,data:null}),e.state="loaded",t(null)):function(e){return e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof ImageBitmap||e instanceof HTMLImageElement}(i)?(this.loadTileData(e,i),e.state="loaded",void t(null)):(e.state="errored",t(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}.bind(this)).catch(i=>{"AbortError"!==i.name&&(e.state="errored",t(i))}),e.request.cancel=()=>s.abort()}loadTileData(e,t){e.setTexture(t,this.map.painter)}unloadTile(t,i){if(t.texture&&t.texture instanceof e.T?(t.destroy(!0),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),this._implementation.unloadTile){const{x:e,y:i,z:n}=t.tileID.canonical;this._implementation.unloadTile({x:e,y:i,z:n})}i&&i()}abortTile(e,t){e.request&&e.request.cancel&&(e.request.cancel(),delete e.request),t&&t()}hasTransition(){return!1}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(e=>({x:e.canonical.x,y:e.canonical.y,z:e.canonical.z}))}_clearTiles(){const t=e.C(this.id,this.scope);this.map.style.clearSource(t)}_update(){this.fire(new e.A("data",{dataType:"source",sourceDataType:"content"}))}}},rt=function(t,i,n,r){const s=new nt[i.type](t,i,n,r);if(s.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${s.id}`);return e.aV(["load","abort","unload","serialize","prepare"],s),s};function st(e,t,i=""){return`${i}:${t.id||""}:${t.layer.id}:${function(e){if("layerId"in e)return`layer:${e.layerId}`;{const{featuresetId:t,importId:i}=e;return`featureset:${t}${i?`:import:${i}`:""}`}}(e.target)}`}function ot(e,t,i,n=""){if(e.uniqueFeatureID){const r=st(e,t,n);if(i.has(r))return!0;i.add(r)}return!1}function at(e,t,i,n,r=!1){const s=t.sourceCache.transform,o=t.sourceCache.tilesIn(e,t.has3DLayers,r);o.sort(ht);const a=[];for(const e of o){const o=e.tile.queryRenderedFeatures(t,e,i,n,s,r);Object.keys(o).length&&a.push({wrappedTileID:e.tile.tileID.wrapped().key,queryResults:o})}return 0===a.length?{}:function(e){const t={},i={};for(const n of e){const e=n.queryResults,r=n.wrappedTileID,s=i[r]=i[r]||{};for(const i in e){const n=e[i],r=s[i]=s[i]||{},o=t[i]=t[i]||[];for(const e of n)r[e.featureIndex]||(r[e.featureIndex]=!0,o.push(e))}}return t}(a)}function lt(e,t,i,n,r,s){const o={},a=n.queryRenderedSymbols(e),l=[];for(const e of Object.keys(a).map(Number))l.push(r[e]);l.sort(ht);for(const e of l){const n=e.featureIndex.lookupSymbolFeatures(a[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,t,i,s);for(const t in n){const i=o[t]=o[t]||[],r=n[t];r.sort((t,i)=>{const n=e.featureSortOrder;if(n){const e=n.indexOf(t.featureIndex);return n.indexOf(i.featureIndex)-e}return i.featureIndex-t.featureIndex});for(const e of r)i.push(e)}}return o}function ct(e,t){const i=e.getRenderableIds().map(t=>e.getTileByID(t)),n=[],r={};for(let e=0;e<i.length;e++){const s=i[e],o=s.tileID.canonical.key;r[o]||(r[o]=!0,s.querySourceFeatures(n,t))}return n}function ht(e,t){const i=e.tileID,n=t.tileID;return i.overscaledZ-n.overscaledZ||i.canonical.y-n.canonical.y||i.wrap-n.wrap||i.canonical.x-n.canonical.x}function dt(e,t){const i={};if(!t)return i;for(const n of e){const e=n.layerIds.map(e=>t.getLayer(e)).filter(Boolean);if(0!==e.length){n.layers=e,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map(t=>e.filter(e=>e.id===t)[0]));for(const t of e)i[t.fqid]=n}}return i}const ut=32,ft=33,pt=new Uint16Array(8184);for(let e=0;e<2046;e++){let t=e+2,i=0,n=0,r=0,s=0,o=0,a=0;for(1&t?r=s=o=ut:i=n=a=ut;(t>>=1)>1;){const e=i+r>>1,l=n+s>>1;1&t?(r=i,s=n,i=o,n=a):(i=r,n=s,r=o,s=a),o=e,a=l}const l=4*e;pt[l+0]=i,pt[l+1]=n,pt[l+2]=r,pt[l+3]=s}const mt=new Uint16Array(2178),gt=new Uint8Array(1089),_t=new Uint16Array(1089);function yt(e){return 0===e?-.03125:32===e?.03125:0}const vt={type:2,extent:e.aj,loadGeometry:()=>[[new e.P(0,0),new e.P(e.aj+1,0),new e.P(e.aj+1,e.aj+1),new e.P(0,e.aj+1),new e.P(0,0)]]};class xt{constructor(t,i,n,r,s,o){this.tileID=t,this.uid=e.a$(),this.uses=0,this.tileSize=i,this.tileZoom=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=s,r&&r.style&&(this._lastUpdatedBrightness=r.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",r&&r.transform&&(this.projection=r.transform.projection),this.worldview=o}registerFadeDuration(t){const i=t+this.timeAdded;i<e.q.now()||this.fadeEndTime&&i<this.fadeEndTime||(this.fadeEndTime=i)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=e.aW(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(t,i,n){if(this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=dt(t.buckets,i.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.b1){if(this.hasSymbolBuckets=!0,!n)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.b1&&i.hasRTLText){this.hasRTLText=!0,e.b2();break}}this.queryPadding=0;for(const e in this.buckets){const t=this.buckets[e],n=i.style.getOwnLayer(e);if(!n)continue;const r=n.queryRadius(t);this.queryPadding=Math.max(this.queryPadding,r)}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas),this._lastUpdatedBrightness=t.brightness}else this.collisionBoxArray=new e.b0}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}loadModelData(e,t,i){e&&(e.resourceTiming&&(this.resourceTiming=e.resourceTiming),this.buckets=Object.assign({},this.buckets,dt(e.buckets,t.style)),e.featureIndex&&(this.latestFeatureIndex=e.featureIndex))}getBucket(e){return this.buckets[e.fqid]}upload(t){for(const e in this.buckets){const i=this.buckets[e];i.uploadPending()&&i.upload(t)}const i=t.gl,n=this.imageAtlas;n&&!n.uploaded&&(this.imageAtlasTexture=new e.T(t,n.image,i.RGBA8,{useMipmap:!!n.patternPositions.size}),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new e.T(t,this.glyphAtlasImage,i.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new e.T(t,this.lineAtlas.image,i.R8),this.lineAtlas.uploaded=!0)}prepare(e,t,i){if(this.imageAtlas&&this.imageAtlasTexture&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture,i),!t||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const n=t.style.getBrightness();(this._lastUpdatedBrightness||n)&&(this._lastUpdatedBrightness&&n&&Math.abs(this._lastUpdatedBrightness-n)<.001||(this.updateBuckets(t,this._lastUpdatedBrightness!==n),this._lastUpdatedBrightness=n))}queryRenderedFeatures(t,i,n,r,s,o){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile)return{};const a=function(t,i){const n=e.bn([],[.5*t.width,.5*-t.height,1]);return e.bo(n,n,[1,-1,0]),e.az(n,n,t.calculateProjMatrix(i.toUnwrapped())),Float32Array.from(n)}(s,this.tileID);return this.latestFeatureIndex.query(t,{tilespaceGeometry:i,pixelPosMatrix:a,transform:r,availableImages:n,tileTransform:this.tileTransform,worldview:this.worldview})}querySourceFeatures(t,i){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const r=n.loadVTLayers(),s=i?i.sourceLayer:"",o=r._geojsonTileLayer||r[s];if(!o)return;const a=e.b3(i&&i.filter),{z:l,x:c,y:h}=this.tileID.canonical,d={z:l,x:c,y:h};for(let i=0;i<o.length;i++){const r=o.feature(i);if(a.needGeometry){const t=e.b4(r,!0);if(!a.filter(new e.aa(this.tileID.overscaledZ,{worldview:this.worldview}),t,this.tileID.canonical))continue}else if(!a.filter(new e.aa(this.tileID.overscaledZ,{worldview:this.worldview}),r))continue;const u=n.getId(r,s),f=new e.b5(r,l,c,h,u);f.tile=d,t.push(f)}}loaded(){return"loaded"===this.state||"errored"===this.state}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!this.imageAtlas.patternPositions.size}setExpiryData(t){const i=this.expirationTime;if(t.cacheControl){const i=e.b6(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const e=Date.now();let t=!1;if(this.expirationTime>e)t=!1;else if(i)if(this.expirationTime<i)t=!0;else{const n=this.expirationTime-i;n?this.expirationTime=e+Math.max(n,3e4):t=!0}else t=!0;t?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}refreshFeatureState(e){this.latestFeatureIndex&&(this.latestFeatureIndex.rawTileData||this.latestFeatureIndex.is3DTile)&&e&&this.updateBuckets(e)}updateBuckets(t,i){if(!this.latestFeatureIndex)return;if(!t.style)return;const n=this.latestFeatureIndex.loadVTLayers(),r=t.style.listImages(),s=t.style.getBrightness();for(const o in this.buckets){if(!t.style.hasLayer(o))continue;const a=this.buckets[o],l=a.layers[0],c=l.sourceLayer||"_geojsonTileLayer",h=n[c],d=t.style.getLayerSourceCache(l);let u={};d&&(u=d._state.getState(c,void 0));const f=this.imageAtlas?Object.fromEntries(this.imageAtlas.patternPositions):{},p=Object.keys(u).length>0&&!i;p&&!a.stateDependentLayers.length&&!i||a.update(u,h,r,f,p?a.stateDependentLayers:a.layers,i,s),(a instanceof e.b7||a instanceof e.b8)&&t._terrain&&t._terrain.enabled&&d&&a.uploadPending()&&t._terrain._clearRenderCacheForTile(d.id,this.tileID);const m=t&&t.style&&t.style.getOwnLayer(o);m&&(this.queryPadding=Math.max(this.queryPadding,m.queryRadius(a)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<e.q.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=e.q.now()+t}setTexture(t,i){const n=i.context,r=n.gl;this.texture=this.texture||i.getTileTexture(t.width),this.texture&&this.texture instanceof e.T?this.texture.update(t):(this.texture=new e.T(n,t,r.RGBA8,{useMipmap:!0}),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE))}setDependencies(e,t){const i={};for(const e of t)i[e]=!0;this.dependencies[e]=i}hasDependency(e,t){for(const i of e){const e=this.dependencies[i];if(e)for(const i of t)if(e[i])return!0}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(t,i){if(!i||"mercator"===i.name||this._tileDebugBuffer)return;const n=e.b9(vt,this.tileID.canonical,this.tileTransform)[0],r=new e.ba,s=new e.bb;for(let e=0;e<n.length;e++){const{x:t,y:i}=n[e];r.emplaceBack(t,i),s.emplaceBack(e)}s.emplaceBack(0),this._tileDebugIndexBuffer=t.createIndexBuffer(s),this._tileDebugBuffer=t.createVertexBuffer(r,e.bc.members),this._tileDebugSegments=e.bd.simpleSegment(0,0,r.length,s.length)}_makeTileBoundsBuffers(t,i){if(this._tileBoundsBuffer||!i||"mercator"===i.name)return;const n=e.b9(vt,this.tileID.canonical,this.tileTransform)[0];let r,s;if(this.isRaster){const t=function(t,i){const n=e.aW(t,i),r=Math.pow(2,t.z);for(let s=0;s<ft;s++)for(let o=0;o<ft;o++){const a=e.aX((t.x+(o+yt(o))/ut)/r),l=e.aY((t.y+(s+yt(s))/ut)/r),c=i.project(a,l),h=s*ft+o;mt[2*h+0]=Math.round((c.x*n.scale-n.x)*e.aj),mt[2*h+1]=Math.round((c.y*n.scale-n.y)*e.aj)}gt.fill(0),_t.fill(0);for(let e=2045;e>=0;e--){const t=4*e,i=pt[t+0],n=pt[t+1],r=pt[t+2],s=pt[t+3],o=i+r>>1,a=n+s>>1,l=o+a-n,c=a+i-o,h=n*ft+i,d=s*ft+r,u=a*ft+o,f=Math.hypot((mt[2*h+0]+mt[2*d+0])/2-mt[2*u+0],(mt[2*h+1]+mt[2*d+1])/2-mt[2*u+1])>=16;gt[u]=gt[u]||(f?1:0),e<1022&&(gt[u]=gt[u]||gt[(n+c>>1)*ft+(i+l>>1)]||gt[(s+c>>1)*ft+(r+l>>1)])}const s=new e.aZ,o=new e.a_;let a=0;function l(t,i){const n=i*ft+t;return 0===_t[n]&&(s.emplaceBack(mt[2*n+0],mt[2*n+1],t*e.aj/ut,i*e.aj/ut),_t[n]=++a),_t[n]-1}function c(e,t,i,n,r,s){const a=e+i>>1,h=t+n>>1;if(Math.abs(e-r)+Math.abs(t-s)>1&>[h*ft+a])c(r,s,e,t,a,h),c(i,n,r,s,a,h);else{const a=l(e,t),c=l(i,n),h=l(r,s);o.emplaceBack(a,c,h)}}return c(0,0,ut,ut,ut,0),c(ut,ut,0,0,0,ut),{vertices:s,indices:o}}(this.tileID.canonical,i);r=t.vertices,s=t.indices}else{r=new e.aZ,s=new e.a_;for(const{x:e,y:t}of n)r.emplaceBack(e,t,0,0);const t=e.be(r.int16.subarray(0,4*r.length),void 0,4);for(let e=0;e<t.length;e+=3)s.emplaceBack(t[e],t[e+1],t[e+2])}this._tileBoundsBuffer=t.createVertexBuffer(r,e.bf.members),this._tileBoundsIndexBuffer=t.createIndexBuffer(s),this._tileBoundsSegments=e.bd.simpleSegment(0,0,r.length,s.length)}_makeGlobeTileDebugBuffers(t,i){const n=i.projection;if(!n||"globe"!==n.name||i.freezeTileCoverage)return;const r=this.tileID.canonical,s=e.bg(r,i),o=e.bh(s),a=e.ah(i.zoom);let l;a>0&&(l=e.bi(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,r,i,o,l,a),this._makeGlobeTileDebugTextBuffer(t,r,i,o,l,a)}_globePoint(t,i,n,r,s,o,a){let l=e.bj(t,i,n);if(o){const s=1<<n.z,c=e.aD(r.center.lng),h=e.aH(r.center.lat),d=(n.x+.5)/s-c;let u=0;d>.5?u=-1:d<-.5&&(u=1);let f=(t/e.aj+n.x)/s+u,p=(i/e.aj+n.y)/s;f=(f-c)*r._pixelsPerMercatorPixel+c,p=(p-h)*r._pixelsPerMercatorPixel+h;const m=[f*r.worldSize,p*r.worldSize,0];e.ad(m,m,o),l=e.bk(l,m,a)}return e.ad(l,l,s)}_makeGlobeTileDebugBorderBuffer(t,i,n,r,s,o){const a=new e.ba,l=new e.bb,c=new e.bl,h=(e,t,h,d,u)=>{const f=(h-e)/(u-1),p=(d-t)/(u-1),m=a.length;for(let h=0;h<u;h++){const d=e+h*f,u=t+h*p;a.emplaceBack(d,u);const g=this._globePoint(d,u,i,n,r,s,o);c.emplaceBack(g[0],g[1],g[2]),l.emplaceBack(m+h)}},d=e.aj;h(0,0,d,0,16),h(d,0,d,d,16),h(d,d,0,d,16),h(0,d,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(l),this._tileDebugBuffer=t.createVertexBuffer(a,e.bc.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(c,e.bm.members),this._tileDebugSegments=e.bd.simpleSegment(0,0,a.length,l.length)}_makeGlobeTileDebugTextBuffer(t,i,n,r,s,o){const a=e.aj/4,l=new e.ba,c=new e.a_,h=new e.bl,d=25;c.reserve(32),l.reserve(d),h.reserve(d);const u=(e,t)=>d*e+t;for(let e=0;e<d;e++){const t=e*a;for(let e=0;e<d;e++){const c=e*a;l.emplaceBack(c,t);const d=this._globePoint(c,t,i,n,r,s,o);h.emplaceBack(d[0],d[1],d[2])}}for(let e=0;e<4;e++)for(let t=0;t<4;t++){const i=u(e,t),n=u(e,t+1),r=u(e+1,t),s=u(e+1,t+1);c.emplaceBack(i,n,r),c.emplaceBack(r,n,s)}this._tileDebugTextIndexBuffer=t.createIndexBuffer(c),this._tileDebugTextBuffer=t.createVertexBuffer(l,e.bc.members),this._globeTileDebugTextBuffer=t.createVertexBuffer(h,e.bm.members),this._tileDebugTextSegments=e.bd.simpleSegment(0,0,d,32)}destroy(t=!1){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture.destroy(),delete this.imageAtlasTexture),this.glyphAtlasTexture&&(this.glyphAtlasTexture.destroy(),delete this.glyphAtlasTexture),this.lineAtlasTexture&&(this.lineAtlasTexture.destroy(),delete this.lineAtlasTexture),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),!t&&this.texture&&this.texture instanceof e.T&&(this.texture.destroy(),delete this.texture),this.hillshadeFBO&&(this.hillshadeFBO.destroy(),delete this.hillshadeFBO),this.dem&&delete this.dem,this.neighboringTiles&&delete this.neighboringTiles,this.demTexture&&(this.demTexture.destroy(),delete this.demTexture),this.rasterParticleState&&(this.rasterParticleState.destroy(),delete this.rasterParticleState),this.latestFeatureIndex=null,this.state="unloaded"}}e.bp.setPbf(e.bq);class bt extends xt{constructor(e,t,i,n,r){super(e,t,i,n,r),this._workQueuePerLayer=new Map,this._fetchQueuePerLayer=new Map,this._isHeaderLoaded=!1,this.textureDescriptorPerLayer=new Map,this.texturePerLayer=new Map}getLayers(){return this._mrt?Object.values(this._mrt.layers):[]}getLayer(e){return this._mrt&&this._mrt.getLayer(e)}setTexturePerLayer(t,i,n){const r=n.context,s=r.gl;let o=this.texturePerLayer.get(t)||n.getTileTexture(i.width);o&&o instanceof e.T?o.update(i,{premultiply:!1}):o=new e.T(r,i,s.RGBA8,{premultiply:!1}),this.texturePerLayer.has(t)||this.texturePerLayer.set(t,o)}flushQueues(e){const t=this._workQueuePerLayer.get(e)||[],i=this._fetchQueuePerLayer.get(e)||[];for(;t.length;)t.pop()();for(;i.length;)i.pop()()}flushAllQueues(){for(const e of this._workQueuePerLayer.keys()){const t=this._workQueuePerLayer.get(e)||[];for(;t.length;)t.pop()()}for(const e of this._fetchQueuePerLayer.keys()){const t=this._fetchQueuePerLayer.get(e)||[];for(;t.length;)t.pop()()}}fetchHeader(t=16384,i){const n=this._mrt=new e.bp(30),r=Object.assign({},this.requestParams,{headers:{Range:"bytes=0-"+(t-1)}});return this.entireBuffer=null,this.request=e.br(r,(e,r,s,o)=>{if(e)i(e);else try{const e=n.getHeaderLength(r);if(e>t)return void(this.request=this.fetchHeader(e,i));n.parseHeader(r),this._isHeaderLoaded=!0;let a=0;for(const e of Object.values(n.layers))a=Math.max(a,e.dataIndex[e.dataIndex.length-1].lastByte);r.byteLength>=a&&(this.entireBuffer=r),i(null,this.entireBuffer||r,s,o)}catch(e){i(e)}}),this.request}fetchBand(t,i,n,r){const s=this._mrt;if(!this._isHeaderLoaded||!s)return void r(new Error("Tile header is not ready"));const o=this.actor;if(!o)return void r(new Error("Can't fetch tile band without an actor"));let a;const l=(e,s)=>{if(a.complete(e,s),e)return void r(e);this.updateTextureDescriptor(t,i,n);const o=this.textureDescriptorPerLayer.get(i);r(null,o&&o.img)},c=(e,t)=>{if(e)return r(e);const n=o.send("decodeRasterArray",{type:"raster-array",source:this.source,scope:this.scope,tileID:this.tileID,uid:this.uid,buffer:t,task:a},l,void 0,!0),s=this._workQueuePerLayer.get(i)||[];s.push(()=>{n&&n.cancel(),a.cancel()}),this._workQueuePerLayer.has(i)||this._workQueuePerLayer.set(i,s)},h=s.getLayer(t);if(!h)return void r(new Error(`Unknown sourceLayer "${t}"`));if(h.hasDataForBand(n)){this.updateTextureDescriptor(t,i,n);const e=this.textureDescriptorPerLayer.get(i);return void r(null,e?e.img:null)}const d=h.getDataRange([n]);if(a=s.createDecodingTask(d),!a||a.tasks.length)if(this.flushQueues(i),this.entireBuffer)c(null,this.entireBuffer.slice(d.firstByte,d.lastByte+1));else{const t=Object.assign({},this.requestParams,{headers:{Range:`bytes=${d.firstByte}-${d.lastByte}`}}),n=e.br(t,c),r=this._fetchQueuePerLayer.get(i)||[];r.push(()=>{n.cancel(),a.cancel()}),this._fetchQueuePerLayer.has(i)||this._fetchQueuePerLayer.set(i,r)}else r(null)}updateNeeded(e,t){return(!this.textureDescriptorPerLayer.get(e)||this.textureDescriptorPerLayer.get(e).band!==t)&&"errored"!==this.state}updateTextureDescriptor(t,i,n){if(!this._mrt)return;const r=this._mrt.getLayer(t);if(!r||!r.hasBand(n)||!r.hasDataForBand(n))return;const{bytes:s,tileSize:o,buffer:a,offset:l,scale:c}=r.getBandView(n),h=o+2*a,d=new e.r({width:h,height:h},s),u=this.texturePerLayer.get(i);u&&u instanceof e.T&&u.update(d,{premultiply:!1}),this.textureDescriptorPerLayer.set(i,{layer:t,band:n,img:d,buffer:a,offset:l,tileSize:o,format:r.pixelFormat,mix:[c,256*c,65536*c,16777216*c]})}destroy(t=!1){if(super.destroy(t),delete this._mrt,!t)for(const t of this.texturePerLayer.values())t&&t instanceof e.T&&t.destroy();this.texturePerLayer.clear(),this.textureDescriptorPerLayer.clear(),this.fbo&&(this.fbo.destroy(),delete this.fbo),delete this.request,delete this.requestParams,this._isHeaderLoaded=!1}}class wt{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(const e in this.data)for(const t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,i){const n=e.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);const r={value:t,timeout:void 0};if(void 0!==i&&(r.timeout=setTimeout(()=>{this.remove(e,r)},i)),this.data[n].push(r),this.order.push(n),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const i=e.wrapped().key,n=void 0===t?0:this.data[i].indexOf(t),r=this.data[i][n];return this.data[i].splice(n,1),r.timeout&&clearTimeout(r.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(r.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const i in this.data)for(const n of this.data[i])e(n.value)||t.push(n);for(const e of t)this.remove(e.value.tileID,e)}}class St{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,i,n){const r=String(i);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][r]=this.stateChanges[t][r]||{},e.h(this.stateChanges[t][r],n),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==r&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][r]){this.deletedStates[t][r]={};for(const e in this.state[t][r])n[e]||(this.deletedStates[t][r][e]=null)}else for(const e in n)this.deletedStates[t]&&this.deletedStates[t][r]&&null===this.deletedStates[t][r][e]&&delete this.deletedStates[t][r][e]}removeFeatureState(e,t,i){if(null===this.deletedStates[e])return;const n=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},i&&void 0!==t)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||{},this.deletedStates[e][n][i]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][n])for(i in this.deletedStates[e][n]={},this.stateChanges[e][n])this.deletedStates[e][n][i]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}getState(t,i){const n=this.state[t]||{},r=this.stateChanges[t]||{},s=this.deletedStates[t];if(null===s)return{};if(void 0!==i){const t=String(i),o=e.h({},n[t],r[t]);if(s){const e=s[i];if(null===e)return{};for(const t in e)delete o[t]}return o}const o=e.h({},n,r);if(s)for(const e in s)delete o[e];return o}initializeTileState(e,t){e.refreshFeatureState(t)}coalesceChanges(t,i){const n={};for(const t in this.stateChanges){this.state[t]=this.state[t]||{};const i={};for(const n in this.stateChanges[t])this.state[t][n]||(this.state[t][n]={}),e.h(this.state[t][n],this.stateChanges[t][n]),i[n]=this.state[t][n];n[t]=i}for(const t in this.deletedStates){this.state[t]=this.state[t]||{};const i={};if(null===this.deletedStates[t])for(const e in this.state[t])i[e]={},this.state[t][e]={};else for(const e in this.deletedStates[t]){if(null===this.deletedStates[t][e])this.state[t][e]={};else if(this.state[t][e])for(const i of Object.keys(this.deletedStates[t][e]))delete this.state[t][e][i];i[e]=this.state[t][e]}n[t]=n[t]||{},e.h(n[t],i)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(const e in t)t[e].refreshFeatureState(i)}}class Tt extends e.E{constructor(e,t,i){super(),this.id=e,this._onlySymbols=i,t.on("data",e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),t.on("error",()=>{this._sourceErrored=!0}),this._source=t,this._tiles={},this._cache=new wt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new St,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"raster-array"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const e in this._tiles)if(!this._tiles[e].loaded())return!1;return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,t){return e.isSymbolTile=this._onlySymbols,e.isExtraShadowCaster=this._shadowCasterTiles[e.tileID.key],this._source.loadTile(e,t)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e)}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e)}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const i=this._tiles[t];i.upload(e),i.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(kt).map(e=>e.key)}getRenderableIds(t,i){const n=[];for(const e in this._tiles)this._isIdRenderable(+e,t,i)&&n.push(this._tiles[e]);return t?n.sort((t,i)=>{const n=t.tileID,r=i.tileID,s=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),o=new e.P(r.canonical.x,r.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-r.overscaledZ||o.y-s.y||o.x-s.x}).map(e=>e.tileID.key):n.map(e=>e.tileID).sort(kt).map(e=>e.key)}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())&&(i||!this._shadowCasterTiles[e])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,t){const i=this._tiles[e];i&&("loading"!==i.state&&(i.state=t),this._loadTile(i,this._tileLoaded.bind(this,i,e,t)))}_tileLoaded(t,i,n,r){if(r)if(t.state="errored",404!==r.status)this._source.fire(new e.z(r,{tile:t}));else{if(this._source.fire(new e.A("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:t})),!(t.tileID.key in this._loadedParentTiles))return;if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const e=this.map.painter.terrain;this.update(this.transform,e.getScaledDemTileSize(),!0),e.resetTileLookupCache(this.id)}else this.update(this.transform)}else t.timeAdded=e.q.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),"raster-dem"===this._source.type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new e.A("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const t=this.getRenderableIds();for(let n=0;n<t.length;n++){const r=t[n];if(e.neighboringTiles&&e.neighboringTiles[r]){const t=this.getTileByID(r);i(e,t),i(t,e)}}function i(e,t){if(!e.dem||e.dem.borderReady)return;e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0;let i=t.tileID.canonical.x-e.tileID.canonical.x;const n=t.tileID.canonical.y-e.tileID.canonical.y,r=Math.pow(2,e.tileID.canonical.z),s=t.tileID.key;0===i&&0===n||Math.abs(n)>1||(Math.abs(i)>1&&(1===Math.abs(i+r)?i+=r:1===Math.abs(i-r)&&(i-=r)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,i,n),e.neighboringTiles&&e.neighboringTiles[s]&&(e.neighboringTiles[s].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,i,n){for(const r in this._tiles){let s=this._tiles[r];if(n[r]||!s.hasData()||s.tileID.overscaledZ<=t||s.tileID.overscaledZ>i)continue;let o=s.tileID;for(;s&&s.tileID.overscaledZ>t+1;){const e=s.tileID.scaledTo(s.tileID.overscaledZ-1);s=this._tiles[e.key],s&&s.hasData()&&(o=e)}let a=o;for(;a.overscaledZ>t;)if(a=a.scaledTo(a.overscaledZ-1),e[a.key]){n[o.key]=o;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const i=this._loadedParentTiles[e.key];return i&&i.tileID.overscaledZ>=t?i:null}for(let i=e.overscaledZ-1;i>=t;i--){const t=e.scaledTo(i),n=this._getLoadedTile(t);if(n)return n}}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,t){t=t||this._source.tileSize;const i=Math.ceil(e.width/t)+1,n=Math.ceil(e.height/t)+1,r=Math.floor(i*n*5),s="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,r):r,o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,s):s;this._cache.setMaxSize(o)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const i in this._tiles){const n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),e[n.tileID.key]=n}this._tiles=e;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles)this._setTileReloadTimer(+e,this._tiles[e])}}update(t,i,n,r,s){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!n)return;this.updateCacheSize(t,i),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const o="batched-model"===this._source.type;let a,l=this._source.maxzoom;const c=this.map&&this.map.painter?this.map.painter._terrain:null;if(c&&c.sourceCache===this&&c.attenuationRange()){const e=c.attenuationRange()[0],t=Math.floor(e)-Math.log2(c.getDemUpscale());l>t&&(l=t)}if(this.used||this.usedForTerrain){if(this._source.tileID)a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(t=>new e.aM(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y));else if(0!==this.tileCoverLift){const r=t.clone();r.tileCoverLift=this.tileCoverLift,a=r.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:l,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:o}),this._source.minzoom<=1&&"globe"===t.projection.name&&(a.push(new e.aM(1,0,1,0,0)),a.push(new e.aM(1,0,1,1,0)),a.push(new e.aM(1,0,1,0,1)),a.push(new e.aM(1,0,1,1,1)))}else if(a=t.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:l,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:o}),this._source.hasTile){const e=this._source.hasTile.bind(this._source);a=a.filter(t=>e(t))}}else a=[];if(a.length>0&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!Mt(this._source.type)){const e=t.coveringZoomLevel({tileSize:i||this._source.tileSize,roundZoom:this._source.roundZoom&&!n}),l=Math.min(e,this._source.maxzoom);if(o){const e=t.extendTileCover(a,l);for(const t of e)a.push(t)}else if(s){const e=t.extendTileCoverToNearPlane(a,this.transform.getFrustum(l),l);for(const t of e)a.push(t)}else if(this.castsShadows&&r){const e=t.extendTileCover(a,l,r);for(const t of e)this._shadowCasterTiles[t.key]=!0,a.push(t)}}const h=this._updateRetainedTiles(a);if(Mt(this._source.type)&&0!==a.length){const t={},i={},n=Object.keys(h);for(const r of n){const n=h[r],s=this._tiles[r];if(!s||s.fadeEndTime&&s.fadeEndTime<=e.q.now())continue;const o=this.findLoadedParent(n,Math.max(n.overscaledZ-Tt.maxOverzooming,this._source.minzoom));o&&(this._addTile(o.tileID),t[o.tileID.key]=o.tileID),i[r]=n}const r=a[a.length-1].overscaledZ;for(const e in this._tiles){const t=this._tiles[e];if(h[e]||!t.hasData())continue;let n=t.tileID;for(;n.overscaledZ>r;){n=n.scaledTo(n.overscaledZ-1);const r=this._tiles[n.key];if(r&&r.hasData()&&i[n.key]){h[e]=t.tileID;break}}}for(const e in t)h[e]||(this._coveredTiles[e]=!0,h[e]=t[e])}for(const e in h)this._tiles[e].clearFadeHold();const d=e.bs(this._tiles,h);for(const e of d){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(+e)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const t={};if(0===e.length)return t;const i={},n=e.reduce((e,t)=>Math.min(e,t.overscaledZ),1/0),r=e[0].overscaledZ,s=Math.max(r-Tt.maxOverzooming,this._source.minzoom),o=Math.max(r+Tt.maxUnderzooming,this._source.minzoom),a={};for(const i of e){const e=this._addTile(i);t[i.key]=i,e.hasData()||n<this._source.maxzoom&&(a[i.key]=i)}this._retainLoadedChildren(a,n,o,t);for(const n of e){let e=this._tiles[n.key];if(e.hasData())continue;if(n.canonical.z>=this._source.maxzoom){const e=n.children(this._source.maxzoom)[0],i=this.getTile(e);if(i&&i.hasData()){t[e.key]=e;continue}}else{const e=n.children(this._source.maxzoom);if(t[e[0].key]&&t[e[1].key]&&t[e[2].key]&&t[e[3].key])continue}let r=e.wasRequested();for(let o=n.overscaledZ-1;o>=s;--o){const s=n.scaledTo(o);if(i[s.key])break;if(i[s.key]=!0,e=this.getTile(s),!e&&r&&(e=this._addTile(s)),e&&(t[s.key]=s,r=e.wasRequested(),e.hasData()))break}}return t}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let i,n=this._tiles[e].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){i=this._loadedParentTiles[n.key];break}t.push(n.key);const e=n.scaledTo(n.overscaledZ-1);if(i=this._getLoadedTile(e),i)break;n=e}for(const e of t)this._loadedParentTiles[e]=i}}_addTile(t){let i=this._tiles[t.key];if(i)return!0!==i.isExtraShadowCaster||!!this._shadowCasterTiles[t.key]||this._reloadTile(t.key,"reloading"),i;i=this._cache.getAndRemove(t),i&&(this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,i)));const n=Boolean(i);if(!n){const e=this.map?this.map.painter:null,n=this._source.tileSize*t.overscaleFactor();i="raster-array"===this._source.type?new bt(t,n,this.transform.tileZoom,e,this._isRaster):new xt(t,n,this.transform.tileZoom,e,this._isRaster,this._source.worldview),this._loadTile(i,this._tileLoaded.bind(this,i,t.key,i.state))}return i.uses++,this._tiles[t.key]=i,n||this._source.fire(new e.A("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const i=t.getExpiryTimeout();i&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},i))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state||"empty"===t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,i,n){const r=[],s=this.transform;if(!s)return r;const o="globe"===s.projection.name,a=e.aD(s.center.lng);for(const l in this._tiles){const c=this._tiles[l];if(n&&c.clearQueryDebugViz(),c.holdingForFade())continue;let h;if(o){const t=c.tileID.canonical;if(0===t.z){const i=[Math.abs(e.ay(a,...At(t,-1))-a),Math.abs(e.ay(a,...At(t,1))-a)];h=[0,2*i.indexOf(Math.min(...i))-1]}else{const i=[Math.abs(e.ay(a,...At(t,-1))-a),Math.abs(e.ay(a,...At(t,0))-a),Math.abs(e.ay(a,...At(t,1))-a)];h=[i.indexOf(Math.min(...i))-1]}}else h=[0];for(const e of h){const n=t.containsTile(c,s,i,e);n&&r.push(n)}}return r}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(e){return this._getRenderableCoordinates(e)}_getRenderableCoordinates(e,t){const i=this.getRenderableIds(e,t).map(e=>this._tiles[e].tileID),n="globe"===this.transform.projection.name;for(const e of i)e.projMatrix=this.transform.calculateProjMatrix(e.toUnwrapped()),e.expandedProjMatrix=n?this.transform.calculateProjMatrix(e.toUnwrapped(),!1,!0):e.projMatrix;return i}sortCoordinatesByDistance(e){const t=e.slice(),i=this.transform._camera.position,n=this.transform._camera.forward(),r={};for(const e of t){const t=1/(1<<e.canonical.z);r[e.key]=((e.canonical.x+.5)*t+e.wrap-i[0])*n[0]+((e.canonical.y+.5)*t-i[1])*n[1]-i[2]*n[2]}return t.sort((e,t)=>r[e.key]-r[t.key]),t}hasTransition(){if(this._source.hasTransition())return!0;if(Mt(this._source.type))for(const t in this._tiles){const i=this._tiles[t];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=e.q.now())return!0}return!1}setFeatureState(e,t,i){this._state.updateState(e=e||"_geojsonTileLayer",t,i)}removeFeatureState(e,t,i){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,i)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,i){const n=this._tiles[e];n&&n.setDependencies(t,i)}reloadTilesForDependencies(e,t){for(const i in this._tiles)this._tiles[i].hasDependency(e,t)&&this._reloadTile(+i,"reloading");this._cache.filter(i=>!i.hasDependency(e,t))}_preloadTiles(t,i){if(!this._sourceLoaded){const e=()=>{this._sourceLoaded&&(this._source.off("data",e),this._preloadTiles(t,i))};return void this._source.on("data",e)}const n=new Map,r=Array.isArray(t)?t:[t],s=this.map.painter.terrain,o=this.usedForTerrain&&s?s.getScaledDemTileSize():this._source.tileSize;for(const e of r){const t=e.coveringTiles({tileSize:o,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const e of t)n.set(e.key,e);this.usedForTerrain&&e.updateElevation(!1)}const a=Array.from(n.values());e.bt(a,(e,t)=>{const i=new xt(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster,this._source.worldview);this._loadTile(i,e=>{"raster-dem"===this._source.type&&i.dem&&this._backfillDEM(i),t(e,i)})},i)}}function kt(e,t){const i=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-i||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Mt(e){return"raster"===e||"image"===e||"video"===e||"custom"===e}function At(e,t){const i=1<<e.z;return[e.x/i+t,(e.x+1)/i+t]}Tt.maxOverzooming=10,Tt.maxUnderzooming=3;class Ct{constructor(e){this.style=e,this.layersGotHidden=!1,this.layers=[]}processLayersChanged(){this.layers=[];const e=!1,t=!1;for(const i in this.style._mergedLayers){const n=this.style._mergedLayers[i];if("fill-extrusion"===n.type||"building"===n.type)this.layers.push({layer:n,visible:e,visibilityChanged:t});else if("model"===n.type){const i=this.style.getLayerSource(n);i&&"batched-model"===i.type&&this.layers.push({layer:n,visible:e,visibilityChanged:t})}}}onNewFrame(e){this.layersGotHidden=!1;for(const t of this.layers){const i=t.layer;let n=!1;"fill-extrusion"===i.type?n=!i.isHidden(e)&&i.paint.get("fill-extrusion-opacity")>0:"building"===i.type?n=!i.isHidden(e)&&i.paint.get("building-opacity")>0:"model"===i.type&&(n=!i.isHidden(e)&&i.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!n&&t.visible,t.visible=n}}updateZOffset(e,t){this.currentBuildingBuckets=[];for(const e of this.layers){const i=e.layer,n=this.style.getLayerSourceCache(i);let r=1;"fill-extrusion"===i.type?r=e.visible?i.paint.get("fill-extrusion-vertical-scale"):0:"building"===i.type&&(r=e.visible?i.paint.get("building-vertical-scale"):0);let s=n?n.getTile(t):null;if(!s&&n)for(const e in n._tiles){const i=n._tiles[e];if(t.canonical.isChildOf(i.tileID.canonical)){s=i;break}}this.currentBuildingBuckets.push({bucket:s?s.getBucket(i):null,tileID:s?s.tileID:t,verticalScale:r})}e.hasAnyZOffset=!1;let i=!1;for(let n=0;n<e.symbolInstances.length;n++){const r=e.symbolInstances.get(n),s=r.zOffset,o=this._getHeightAtTileOffset(t,r.tileAnchorX,r.tileAnchorY);r.zOffset=o!==Number.NEGATIVE_INFINITY?o:s,i||s===r.zOffset||(i=!0),e.hasAnyZOffset||0===r.zOffset||(e.hasAnyZOffset=!0)}i&&(e.zOffsetBuffersNeedUpload=!0,e.zOffsetSortDirty=!0)}_mapCoordToOverlappingTile(t,i,n,r){let s=i,o=n;if(t.canonical.z!==r.canonical.z){const a=r.canonical,l=1/(1<<t.canonical.z-a.z);s=(i+t.canonical.x*e.aj)*l-a.x*e.aj|0,o=(n+t.canonical.y*e.aj)*l-a.y*e.aj|0}return{tileX:s,tileY:o}}_getHeightAtTileOffset(e,t,i){let n,r;for(let s=0;s<this.layers.length;++s){const o=this.layers[s].layer;if("fill-extrusion"!==o.type&&"building"!==o.type)continue;const{bucket:a,tileID:l,verticalScale:c}=this.currentBuildingBuckets[s];if(!a)continue;const{tileX:h,tileY:d}=this._mapCoordToOverlappingTile(e,t,i,l),u=a.getHeightAtTileCoord(h,d);u&&void 0!==u.height&&(u.hidden?n=u.height:r=Math.max(u.height*c,r||0))}if(void 0!==r)return r;for(let r=0;r<this.layers.length;++r){const s=this.layers[r];if("model"!==s.layer.type||!s.visible)continue;const{bucket:o,tileID:a}=this.currentBuildingBuckets[r];if(!o)continue;const{tileX:l,tileY:c}=this._mapCoordToOverlappingTile(e,t,i,a),h=o.getHeightAtTileCoord(l,c);if(h&&!h.hidden)return void 0===h.height&&void 0!==n?Math.min(h.maxHeight,n)*h.verticalScale:h.height?h.height*h.verticalScale:Number.NEGATIVE_INFINITY}return this.layersGotHidden?0:Number.NEGATIVE_INFINITY}}function Dt(t,i){const n={};for(const e in t)"ref"!==e&&(n[e]=t[e]);return e.bu.forEach(e=>{e in i&&(n[e]=i[e])}),n}function Lt(e){e=e.slice();const t=Object.create(null);for(let i=0;i<e.length;i++)t[e[i].id]=e[i];for(let i=0;i<e.length;i++)"ref"in e[i]&&(e[i]=Dt(e[i],t[e[i].ref]));return e}const Et={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setSlot:"setSlot",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setSnow:"setSnow",setRain:"setRain",setCamera:"setCamera",setLights:"setLights",setProjection:"setProjection",addImport:"addImport",removeImport:"removeImport",updateImport:"updateImport",addIconset:"addIconset",removeIconset:"removeIconset"};function It(e,t,i){i.push({command:Et.addSource,args:[e,t[e]]})}function Pt(e,t,i){t.push({command:Et.removeSource,args:[e]}),i[e]=!0}function Rt(e,t,i,n){Pt(e,i,n),It(e,t,i)}function Ot(t,i,n){let r;for(r in t[n])if(t[n].hasOwnProperty(r)&&"data"!==r&&!e.bv(t[n][r],i[n][r]))return!1;for(r in i[n])if(i[n].hasOwnProperty(r)&&"data"!==r&&!e.bv(t[n][r],i[n][r]))return!1;return!0}function zt(t,i,n,r,s,o){let a;for(a in i=i||{},t=t||{})t.hasOwnProperty(a)&&(e.bv(t[a],i[a])||n.push({command:o,args:[r,a,i[a],s]}));for(a in i)i.hasOwnProperty(a)&&!t.hasOwnProperty(a)&&(e.bv(t[a],i[a])||n.push({command:o,args:[r,a,i[a],s]}))}function Ft(e){return e.id}function Nt(e,t){return e[t.id]=t,e}function Yt(t,i,n){const r=i.createTileMatrix(t,t.worldSize,n.toUnwrapped());return e.az(new Float32Array(16),t.projMatrix,r)}function Bt(e,t,i){if(t.projection.name===i.projection.name)return e.projMatrix;const n=i.clone();return n.setProjection(t.projection),Yt(n,t.getProjection(),e)}function Ht(e,t,i){return t.name===i.projection.name?e.projMatrix:Yt(i,t,e)}class jt{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.ay(t,0,1);let i=1,n=this._distances[i];const r=t*this.paddedLength+this.padding;for(;n<r&&i<this._distances.length;)n=this._distances[++i];const s=i-1,o=this._distances[s],a=n-o,l=a>0?(r-o)/a:0;return this.points[s].mult(1-l).add(this.points[i].mult(l))}}class Vt{constructor(e,t,i){const n=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(e/i),this.yCellCount=Math.ceil(t/i);for(let e=0;e<this.xCellCount*this.yCellCount;e++)n.push([]),r.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,i,n,r){this._forEachCell(t,i,n,r,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)}insertCircle(e,t,i,n){this._forEachCell(t-n,i-n,t+n,i+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(i),this.circles.push(n)}_insertBoxCell(e,t,i,n,r,s){this.boxCells[r].push(s)}_insertCircleCell(e,t,i,n,r,s){this.circleCells[r].push(s)}_query(e,t,i,n,r,s){if(i<0||e>this.width||n<0||t>this.height)return!r&&[];const o=[];if(e<=0&&t<=0&&this.width<=i&&this.height<=n){if(r)return!0;for(let e=0;e<this.boxKeys.length;e++)o.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){const t=this.circles[3*e],i=this.circles[3*e+1],n=this.circles[3*e+2];o.push({key:this.circleKeys[e],x1:t-n,y1:i-n,x2:t+n,y2:i+n})}return s?o.filter(s):o}return this._forEachCell(e,t,i,n,this._queryCell,o,{hitTest:r,seenUids:{box:{},circle:{}}},s),r?o.length>0:o}_queryCircle(e,t,i,n,r){const s=e-i,o=e+i,a=t-i,l=t+i;if(o<0||s>this.width||l<0||a>this.height)return!n&&[];const c=[];return this._forEachCell(s,a,o,l,this._queryCellCircle,c,{hitTest:n,circle:{x:e,y:t,radius:i},seenUids:{box:{},circle:{}}},r),n?c.length>0:c}query(e,t,i,n,r){return this._query(e,t,i,n,!1,r)}hitTest(e,t,i,n,r){return this._query(e,t,i,n,!0,r)}hitTestCircle(e,t,i,n){return this._queryCircle(e,t,i,!0,n)}_queryCell(e,t,i,n,r,s,o,a){const l=o.seenUids,c=this.boxCells[r];if(null!==c){const r=this.bboxes;for(const h of c)if(!l.box[h]){l.box[h]=!0;const c=4*h;if(e<=r[c+2]&&t<=r[c+3]&&i>=r[c+0]&&n>=r[c+1]&&(!a||a(this.boxKeys[h]))){if(o.hitTest)return s.push(!0),!0;s.push({key:this.boxKeys[h],x1:r[c],y1:r[c+1],x2:r[c+2],y2:r[c+3]})}}}const h=this.circleCells[r];if(null!==h){const r=this.circles;for(const c of h)if(!l.circle[c]){l.circle[c]=!0;const h=3*c;if(this._circleAndRectCollide(r[h],r[h+1],r[h+2],e,t,i,n)&&(!a||a(this.circleKeys[c]))){if(o.hitTest)return s.push(!0),!0;{const e=r[h],t=r[h+1],i=r[h+2];s.push({key:this.circleKeys[c],x1:e-i,y1:t-i,x2:e+i,y2:t+i})}}}}}_queryCellCircle(e,t,i,n,r,s,o,a){const l=o.circle,c=o.seenUids,h=this.boxCells[r];if(null!==h){const e=this.bboxes;for(const t of h)if(!c.box[t]){c.box[t]=!0;const i=4*t;if(this._circleAndRectCollide(l.x,l.y,l.radius,e[i+0],e[i+1],e[i+2],e[i+3])&&(!a||a(this.boxKeys[t])))return s.push(!0),!0}}const d=this.circleCells[r];if(null!==d){const e=this.circles;for(const t of d)if(!c.circle[t]){c.circle[t]=!0;const i=3*t;if(this._circlesCollide(e[i],e[i+1],e[i+2],l.x,l.y,l.radius)&&(!a||a(this.circleKeys[t])))return s.push(!0),!0}}}_forEachCell(e,t,i,n,r,s,o,a){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),h=this._convertToXCellCoord(i),d=this._convertToYCellCoord(n);for(let u=l;u<=h;u++)for(let l=c;l<=d;l++)if(r.call(this,e,t,i,n,this.xCellCount*l+u,s,o,a))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,i,n,r,s){const o=n-e,a=r-t,l=i+s;return l*l>o*o+a*a}_circleAndRectCollide(e,t,i,n,r,s,o){const a=(s-n)/2,l=Math.abs(e-(n+a));if(l>a+i)return!1;const c=(o-r)/2,h=Math.abs(t-(r+c));if(h>c+i)return!1;if(l<=a||h<=c)return!0;const d=l-a,u=h-c;return d*d+u*u<=i*i}}const Wt=0,Ut=1,$t=2,Gt=Math.tan(85*Math.PI/180);function Xt(t,i,n,r,s,o,a){const l=e.bz();if(n)if("globe"===o.name){const t=e.bA(s,i);e.az(l,l,t)}else{const t=e.bB([],a);l[0]=t[0],l[1]=t[1],l[4]=t[2],l[5]=t[3],r||e.by(l,l,s.angle)}else e.az(l,s.labelPlaneMatrix,t);return l}function qt(e,t,i,n,r,s,o){const a=Xt(e,t,i,n,r,s,o);return"globe"===s.name&&i||(a[2]=a[6]=a[10]=a[14]=0),a}function Zt(t,i,n,r,s,o,a){if(n){if("globe"===o.name){const l=Xt(t,i,n,r,s,o,a);return e.bi(l,l),e.az(l,t,l),l}{const i=e.bw(t),n=e.bx([]);return n[0]=a[0],n[1]=a[1],n[4]=a[2],n[5]=a[3],e.az(i,i,n),r||e.by(i,i,-s.angle),i}}return s.glCoordMatrix}function Jt(t,i,n,r){const s=[t,i,n,1];n?e.aA(s,s,r):li(s,s,r);const o=s[3];return s[0]/=o,s[1]/=o,s[2]/=o,s}function Kt(e,t){return Math.min(.5+e/t*.5,1.5)}function Qt(e,t){const i=e[0]/e[3],n=e[1]/e[3];return i>=-t[0]&&i<=t[0]&&n>=-t[1]&&n<=t[1]}function ei(t,i,n,r,s,o,a,l,c,h){const d=n.transform,u=r?t.textSizeData:t.iconSizeData,f=e.bH(u,n.transform.zoom),p="globe"===d.projection.name,m=[256/n.width*2+1,256/n.height*2+1],g=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;g.clear();let _=null;p&&(_=r?t.text.globeExtVertexArray:t.icon.globeExtVertexArray);const y=t.lineVertexArray,v=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,x=n.transform.width/n.transform.height;let b,w=!1;for(let r=0;r<v.length;r++){const p=v.get(r),{numGlyphs:S,writingMode:T}=p;if(T!==e.bI.vertical||w||b===e.bI.horizontal||(w=!0),b=T,(p.hidden||T===e.bI.vertical)&&!w){ai(S,g);continue}w=!1;const k=new e.P(p.tileAnchorX,p.tileAnchorY);let{x:M,y:A,z:C}=d.projection.projectTilePoint(k.x,k.y,h.canonical);if(c){const[e,t,i]=c(k);M+=e,A+=t,C+=i}const D=[M,A,C,1];if(e.aA(D,D,i),!Qt(D,m)){ai(S,g);continue}const L=D[3],E=Kt(n.transform.getCameraToCenterDistance(d.projection),L),I=e.bJ(u,f,p),P=a?I/E:I*E,R=Jt(M,A,C,s);if(R[3]<=0){ai(S,g);continue}let O={};const z=e.al(t.layers[0].layout.get("text-max-angle")),F=Math.cos(z),N=a?null:c,Y=ni(p,P,!1,l,i,s,o,t.glyphOffsetArray,y,g,_,R,k,O,x,N,d.projection,h,a,F);w=Y.useVertical,N&&Y.needsFlipping&&(O={}),(Y.notEnoughRoom||w||Y.needsFlipping&&ni(p,P,!0,l,i,s,o,t.glyphOffsetArray,y,g,_,R,k,O,x,N,d.projection,h,a,F).notEnoughRoom)&&ai(S,g)}r?(t.text.dynamicLayoutVertexBuffer.updateData(g),_&&t.text.globeExtVertexBuffer&&t.text.globeExtVertexBuffer.updateData(_)):(t.icon.dynamicLayoutVertexBuffer.updateData(g),_&&t.icon.globeExtVertexBuffer&&t.icon.globeExtVertexBuffer.updateData(_))}function ti(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g){const{lineStartIndex:_,glyphStartIndex:y,segment:v}=a,x=y+a.numGlyphs,b=_+a.lineLength,w=t.getoffsetX(y),S=t.getoffsetX(x-1),T=oi(e*w,i,n,r,s,o,v,_,b,l,c,h,d,u,!0,f,p,m,g);if(!T)return null;const k=oi(e*S,i,n,r,s,o,v,_,b,l,c,h,d,u,!0,f,p,m,g);return k?{first:T,last:k}:null}function ii(t,i,n,r){return t===e.bI.horizontal&&Math.abs(r)>Math.abs(n)?{useVertical:!0}:t===e.bI.vertical?r>0?{needsFlipping:!0}:null:i!==Wt&&function(e,t){return 0===e||Math.abs(t/e)>Gt}(n,r)?i===Ut?{needsFlipping:!0}:null:n<0?{needsFlipping:!0}:null}function ni(t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x){const b=i/24,w=t.lineOffsetX*b,S=t.lineOffsetY*b,{lineStartIndex:T,glyphStartIndex:k,numGlyphs:M,segment:A,writingMode:C,flipState:D}=t,L=T+t.lineLength,E=t=>{if(d){const[i,n,r]=t.up,s=h.length;e.bK(d,s+0,i,n,r),e.bK(d,s+1,i,n,r),e.bK(d,s+2,i,n,r),e.bK(d,s+3,i,n,r)}const[i,n,r]=t.point;e.bL(h,i,n,r,t.angle)};if(M>1){const e=ti(b,l,w,S,n,u,f,t,c,o,p,g,!1,_,y,v,x);if(!e)return{notEnoughRoom:!0};if(r&&!n){let[i,n,r]=e.first.point,[s,o,l]=e.last.point;[i,n]=Jt(i,n,r,a),[s,o]=Jt(s,o,l,a);const c=ii(C,D,(s-i)*m,o-n);if(t.flipState=c&&c.needsFlipping?Ut:$t,c)return c}E(e.first);for(let e=k+1;e<k+M-1;e++){const t=oi(b*l.getoffsetX(e),w,S,n,u,f,A,T,L,c,o,p,g,!1,!1,_,y,v,x);if(!t)return h.length-=4*(e-k),{notEnoughRoom:!0};E(t)}E(e.last)}else{if(r&&!n){const i=Jt(f.x,f.y,0,s),n=T+A+1,r=new e.P(c.getx(n),c.gety(n)),o=Jt(r.x,r.y,0,s),a=o[3]>0?o:si(f,r,i,1,s,void 0,_,y.canonical),l=ii(C,D,(a[0]-i[0])*m,a[1]-i[1]);if(t.flipState=l&&l.needsFlipping?Ut:$t,l)return l}const i=oi(b*l.getoffsetX(k),w,S,n,u,f,A,T,L,c,o,p,g,!1,!1,_,y,v,x);if(!i)return{notEnoughRoom:!0};E(i)}return{}}function ri(e,t,i,n,r){const{x:s,y:o,z:a}=n.projectTilePoint(e.x,e.y,t);if(!r)return Jt(s,o,a,i);const[l,c,h]=r(e);return Jt(s+l,o+c,a+h,i)}function si(t,i,n,r,s,o,a,l){const c=ri(t.sub(i)._unit()._add(t),l,s,a,o);return e.at(c,n,c),e.au(c,c),e.bE(c,n,c,r)}function oi(t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v){const x=r?t-i:t+i;let b=x>0?1:-1,w=0;r&&(b*=-1,w=Math.PI),b<0&&(w+=Math.PI);let S=l+a+(b>0?0:1)|0,T=s,k=s,M=0,A=0;const C=Math.abs(x),D=[],L=[];let E=o,I=E,P=e.bC([]);const R=()=>si(I,E,k,C-M+1,d,f,g,_.canonical);for(;M+A<=C;){if(S+=b,S<l||S>=c)return null;if(k=T,I=E,D.push(k),p&&L.push(I),E=new e.P(h.getx(S),h.gety(S)),T=u[S],!T){const e=ri(E,_.canonical,d,g,f);T=e[3]>0?u[S]=e:R()}M+=A;const t=e.at([],T,k),i=e.bD(k,T);if(n&&i>0&&A>0&&e.bG(P,t)/(A*i)<v)return null;A=i,P=t}m&&f&&(u[S]&&(T=R(),A=e.bD(k,T),P=e.at([],T,k)),u[S]=T);const O=(C-M)/A,z=E.sub(I)._mult(O)._add(I),F=e.bE([],k,P,O);let N=[0,0,1],Y=P[0],B=P[1];if(y&&(N=g.upVector(_.canonical,z.x,z.y),0!==N[0]||0!==N[1]||1!==N[2])){const t=[N[2],0,-N[0]],i=e.bF([],N,t);e.au(t,t),e.au(i,i),Y=e.bG(P,t),B=e.bG(P,i)}if(n){const t=e.bF([],N,P);e.au(t,t),e.bE(F,F,t,n*b)}const H=w+Math.atan2(B,Y);return D.push(F),p&&L.push(z),{point:F,angle:H,path:D,tilePath:L,up:N}}function ai(e,t){const i=t.length,n=i+4*e;t.resize(n),t.float32.fill(-1/0,4*i,4*n)}function li(e,t,i){const n=t[0],r=t[1];return e[0]=i[0]*n+i[4]*r+i[12],e[1]=i[1]*n+i[5]*r+i[13],e[3]=i[3]*n+i[7]*r+i[15],e}const ci=100;class hi{constructor(e,t,i=new Vt(e.width+200,e.height+200,25),n=new Vt(e.width+200,e.height+200,25)){this.transform=e,this.grid=i,this.ignoredGrid=n,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+ci,this.screenBottomBoundary=e.height+ci,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.fogState=t}placeCollisionBox(t,i,n,r,s,o,a,l,c,h,d){let u=n.projectedAnchorX,f=n.projectedAnchorY,p=n.projectedAnchorZ;const m=n.tileAnchorX,g=n.tileAnchorY,_=n.elevation,y=n.tileID,v=t.getProjection();if(_&&y){const[e,t,i]=v.upVector(y.canonical,n.tileAnchorX,n.tileAnchorY),r=v.upVectorScale(y.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;u+=e*_*r,f+=t*_*r,p+=i*_*r}const x="globe"===t.projection.name,b="globe"===t.projection.name?e.ah(this.transform.zoom):0;if(y&&x&&b<1&&!o){const t=1<<y.canonical.z,i=e.bM(m,g);e.bN(i,i,1/e.aj),e.bO(i,i,e.bM(y.canonical.x,y.canonical.y)),e.bN(i,i,1/t),e.bP(i,i,e.bM(r[0],r[1])),i[0]=e.bQ(i[0],-.5,.5),e.bN(i,i,e.aj);const n=e.bR(i[0],i[1],e.aj/(2*Math.PI),1);e.aA(n,n,s),u=e.ai(u,n[0],b),f=e.ai(f,n[1],b),p=e.ai(p,n[2],b)}const w=this.projectAndGetPerspectiveRatio(h,u,f,p,n.tileID,"globe"===v.name||!!_||this.transform.pitch>0,v),S=c*w.perspectiveRatio,T=(n.x1*i+a.x-n.padding)*S+w.point.x,k=(n.y1*i+a.y-n.padding)*S+w.point.y,M=(n.x2*i+a.x+n.padding)*S+w.point.x,A=(n.y2*i+a.y+n.padding)*S+w.point.y,C=w.perspectiveRatio<=.55||w.occluded;return!this.isInsideGrid(T,k,M,A)||!l&&this.grid.hitTest(T,k,M,A,d)||C?{box:[],offscreen:!1,occluded:w.occluded}:{box:[T,k,M,A],offscreen:this.isOffscreen(T,k,M,A),occluded:!1}}placeCollisionCircles(t,i,n,r,s,o,a,l,c,h,d,u,f,p,m){const g=[],_=this.transform.elevation,y=t.getProjection(),v=_?_.getAtTileOffsetFunc(m,this.transform.center.lat,this.transform.worldSize,y):null,x=new e.P(n.tileAnchorX,n.tileAnchorY);let{x:b,y:w,z:S}=y.projectTilePoint(x.x,x.y,m.canonical);if(v){const[e,t,i]=v(x);b+=e,w+=t,S+=i}const T="globe"===y.name,k=this.projectAndGetPerspectiveRatio(a,b,w,S,m,T||!!_||this.transform.pitch>0,y),{perspectiveRatio:M}=k,A=(d?o/M:o*M)/e.bU,C=Jt(b,w,S,l),D=n.lineOffsetX*A,L=n.lineOffsetY*A,E=e.al(t.layers[0].layout.get("text-max-angle")),I=Math.cos(E),P=k.signedDistanceFromCamera>0?ti(A,s,D,L,!1,C,x,n,r,l,{},_&&!d?v:null,d&&!!_,y,m,d,I):null;let R=!1,O=!1,z=!0;if(P&&!k.occluded){const t=.5*f*M+p,n=new e.P(-100,-100),r=new e.P(this.screenRightBoundary,this.screenBottomBoundary),s=new jt,{first:o,last:a}=P,l=o.path.length;let d=[];for(let e=l-1;e>=1;e--)d.push(o.path[e]);for(let e=1;e<a.path.length;e++)d.push(a.path[e]);const m=2.5*t;c&&(d=d.map(([e,t,i],n)=>(v&&!T&&(i=v(n<l-1?o.tilePath[l-1-n]:a.tilePath[n-l+2])[2]),Jt(e,t,i,c))),d.some(e=>e[3]<=0)&&(d=[]));let _=[];if(d.length>0){let t=1/0,i=-1/0,s=1/0,o=-1/0;for(const e of d)t=Math.min(t,e[0]),s=Math.min(s,e[1]),i=Math.max(i,e[0]),o=Math.max(o,e[1]);i>=n.x&&t<=r.x&&o>=n.y&&s<=r.y&&(_=[d.map(t=>new e.P(t[0],t[1]))],(t<n.x||i>r.x||s<n.y||o>r.y)&&(_=e.bS(_,n.x,n.y,r.x,r.y)))}for(const e of _){s.reset(e,.25*t);let n=0;n=s.length<=.5*t?1:Math.ceil(s.paddedLength/m)+1;for(let e=0;e<n;e++){const r=e/Math.max(n-1,1),o=s.lerp(r),a=o.x+ci,l=o.y+ci;g.push(a,l,t,0);const c=a-t,d=l-t,f=a+t,p=l+t;if(z=z&&this.isOffscreen(c,d,f,p),O=O||this.isInsideGrid(c,d,f,p),!i&&this.grid.hitTestCircle(a,l,t,u)&&(R=!0,!h))return{circles:[],offscreen:!1,collisionDetected:R,occluded:!1}}}}return{circles:!h&&R||!O?[]:g,offscreen:z,collisionDetected:R,occluded:k.occluded}}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const i=[];let n=1/0,r=1/0,s=-1/0,o=-1/0;for(const a of t){const t=new e.P(a.x+ci,a.y+ci);n=Math.min(n,t.x),r=Math.min(r,t.y),s=Math.max(s,t.x),o=Math.max(o,t.y),i.push(t)}const a=this.grid.query(n,r,s,o).concat(this.ignoredGrid.query(n,r,s,o)),l={},c={};for(const t of a){const n=t.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.featureIndex])continue;const r=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];e.bT(i,r)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(e,t,i,n,r){(t?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:r},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,i,n,r){const s=t?this.ignoredGrid:this.grid,o={bucketInstanceId:i,featureIndex:n,collisionGroupID:r};for(let t=0;t<e.length;t+=4)s.insertCircle(o,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(t,i,n,r,s,o,a){const l=[i,n,r,1];let c=!1;if(r||this.transform.pitch>0){if(e.aA(l,l,t),this.fogState&&s&&"globe"!==a.name){const t=function(t,i,n,r,s,o){const a=o.calculateFogTileMatrix(s),l=[i,n,r];return e.ad(l,l,a),Oe(t,e.ae(l),o.pitch,o._fov)}(this.fogState,i,n,r,s.toUnwrapped(),this.transform);c=t>.9}}else li(l,l,t);const h=l[3];return{point:new e.P((l[0]/h+1)/2*this.transform.width+ci,(-l[1]/h+1)/2*this.transform.height+ci),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(a)/h*.5,1.5),signedDistanceFromCamera:h,occluded:o&&l[2]>h||c}}isOffscreen(e,t,i,n){return i<ci||e>=this.screenRightBoundary||n<ci||t>this.screenBottomBoundary}isInsideGrid(e,t,i,n){return i>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary}getViewportMatrix(){const t=e.bx([]);return e.bo(t,t,[-100,-100,0]),t}}class di{constructor(e,t,i,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):n&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class ui{constructor(e,t,i,n,r,s=!1){this.text=new di(e?e.text:null,t,i,r),this.icon=new di(e?e.icon:null,t,n,r),this.clipped=s}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class fi{constructor(e,t,i,n=!1){this.text=e,this.icon=t,this.skipFade=i,this.clipped=n}}class pi{constructor(){this.invProjMatrix=e.bz(),this.viewportMatrix=e.bz(),this.circles=[]}}class mi{constructor(e,t,i,n,r){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=r}}class gi{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function _i(t,i,n,r,s){const{horizontalAlign:o,verticalAlign:a}=e.bZ(t),l=-(o-.5)*i,c=-(a-.5)*n,h=e.b_(t,r);return new e.P(l+h[0]*s,c+h[1]*s)}function yi(t,i,n,r,s){const o=new e.P(t,i);return n&&o._rotate(r?s:-s),o}class vi{constructor(e,t,i,n,r,s){this.transform=e.clone(),this.projection=e.projection.name,this.collisionIndex=new hi(this.transform,r),this.buildingIndex=s,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new gi(i),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,i,n,r,s=1){const o=n.getBucket(i),a=n.latestFeatureIndex;if(!o||!a||i.fqid!==o.layerIds[0])return;const l=o.layers[0].layout,c=o.layers[0].paint,h=n.collisionBoxArray,d=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),u=n.tileSize/e.aj,f=n.tileID.toUnwrapped();this.transform.setProjection(o.projection);const p=(m=n.tileID,g=o.getProjection(),_=this.transform,g.name===this.projection?_.calculateProjMatrix(m.toUnwrapped()):Yt(_,g,m));var m,g,_;const y="map"===l.get("text-pitch-alignment"),v="map"===l.get("text-rotation-alignment");i.compileFilter(i.options);const x=i.dynamicFilter(),b=i.dynamicFilterNeedsFeature(),w=this.transform.calculatePixelsToTileUnitsMatrix(n),S=qt(p,n.tileID.canonical,y,v,this.transform,o.getProjection(),w);let T=null;const k=o.getProjection().createInversionMatrix(this.transform,n.tileID.canonical);if(y){const t=Zt(p,n.tileID.canonical,y,v,this.transform,o.getProjection(),w);T=e.az([],this.transform.labelPlaneMatrix,t)}let M=null;x&&n.latestFeatureIndex&&(M={unwrappedTileID:f,dynamicFilter:x,dynamicFilterNeedsFeature:b}),this.retainedQueryData[o.bucketInstanceId]=new mi(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,n.tileID);const[A,C]=o.layers[0].layout.get("text-size-scale-range"),D=e.ay(s,A,C),[L,E]=l.get("icon-size-scale-range"),I=e.ay(s,L,E),P={bucket:o,layout:l,paint:c,posMatrix:p,invMatrix:k,mercatorCenter:[e.aD(this.transform.center.lng),e.aH(this.transform.center.lat)],textLabelPlaneMatrix:S,labelToScreenMatrix:T,clippingData:M,scale:d,textPixelRatio:u,holdingForFade:n.holdingForFade(),collisionBoxArray:h,partiallyEvaluatedTextSize:e.bH(o.textSizeData,this.transform.zoom,D),partiallyEvaluatedIconSize:e.bH(o.iconSizeData,this.transform.zoom,I),collisionGroup:this.collisionGroups.get(o.sourceID),latestFeatureIndex:n.latestFeatureIndex};if(r)for(const e of o.sortKeyRanges){const{sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r}=e;t.push({sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r,parameters:P})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:P})}attemptAnchorPlacement(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x){const{textOffset0:b,textOffset1:w,crossTileID:S}=p,T=[b,w],k=_i(e,s,o,T,a),M=this.collisionIndex.placeCollisionBox(g,a,t,i,n,r,yi(k.x,k.y,l,c,this.transform.angle),f,h,d,u.predicate);if(y){const e=g.getSymbolInstanceIconSize(x,this.transform.zoom,p.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(g,e,y,i,n,r,yi(k.x,k.y,l,c,this.transform.angle),f,h,d,u.predicate).box.length)return}if(M.box.length>0){let t;return this.prevPlacement&&this.prevPlacement.variableOffsets[S]&&this.prevPlacement.placements[S]&&this.prevPlacement.placements[S].text&&(t=this.prevPlacement.variableOffsets[S].anchor),this.variableOffsets[S]={textOffset:T,width:s,height:o,anchor:e,textScale:a,prevAnchor:t},this.markUsedJustification(g,e,p,_),g.allowVerticalPlacement&&(this.markUsedOrientation(g,_,p),this.placedOrientations[S]=_),{shift:k,placedGlyphBoxes:M}}}placeLayerBucketPart(t,i,n,r,s=1){const{bucket:o,layout:a,paint:l,posMatrix:c,textLabelPlaneMatrix:h,labelToScreenMatrix:d,clippingData:u,textPixelRatio:f,mercatorCenter:p,invMatrix:m,holdingForFade:g,collisionBoxArray:_,partiallyEvaluatedTextSize:y,partiallyEvaluatedIconSize:v,collisionGroup:x,latestFeatureIndex:b}=t.parameters,w=a.get("text-optional"),S=a.get("icon-optional"),T=a.get("text-allow-overlap"),k=a.get("icon-allow-overlap"),M="map"===a.get("text-rotation-alignment"),A="map"===a.get("icon-rotation-alignment"),C="map"===a.get("text-pitch-alignment"),D=l.get("symbol-z-offset"),L="sea"===a.get("symbol-elevation-reference"),E=a.get("symbol-placement"),[I,P]=a.get("text-size-scale-range"),[R,O]=a.get("icon-size-scale-range"),z=e.ay(s,I,P),F=e.ay(s,R,O),N=a.get("text-variable-anchor"),Y=M&&"point"!==E,B=A&&"point"!==E,H=N&&o.hasTextData(),j=o.hasIconTextFit()&&H&&o.hasIconData();this.transform.setProjection(o.projection);const V=H||Y,W=B||j;let U=T&&(k||!o.hasIconData()||S),$=k&&(T||!o.hasTextData()||w);const G=!D.isConstant();!o.collisionArrays&&_&&o.deserializeCollisionBoxes(_),n&&r&&o.updateCollisionDebugBuffers(this.transform.zoom,_,z,F);const X=(t,r,l)=>{const{crossTileID:_,numVerticalGlyphVertices:A}=t;let E=null;if(u&&u.dynamicFilterNeedsFeature||G){const e=this.retainedQueryData[o.bucketInstanceId];E=b.loadFeature({featureIndex:t.featureIndex,bucketIndex:e.bucketIndex,sourceLayerIndex:e.sourceLayerIndex,layoutVertexArrayOffset:0})}if(u&&!(0,u.dynamicFilter)({zoom:this.transform.zoom,pitch:this.transform.pitch},E,this.retainedQueryData[o.bucketInstanceId].tileID.canonical,new e.P(t.tileAnchorX,t.tileAnchorY),this.transform.calculateDistanceTileData(u.unwrappedTileID)))return this.placements[_]=new fi(!1,!1,!1,!0),void i.add(_);const I=D.evaluate(E,{});if(i.has(_))return;if(g)return void(this.placements[_]=new fi(!1,!1,!1));let P=!1,R=!1,O=!0,z=!1,F=!1,Y=null,B={box:null,offscreen:null,occluded:null},H={box:null},j=null,X=null,q=null,Z=0,J=0,K=0;l.textFeatureIndex?Z=l.textFeatureIndex:t.useRuntimeCollisionCircles&&(Z=t.featureIndex),l.verticalTextFeatureIndex&&(J=l.verticalTextFeatureIndex);const Q=e=>{e.tileID=this.retainedQueryData[o.bucketInstanceId].tileID;const i=this.transform.elevation;e.elevation=L?I:I+(i?i.getAtTileOffset(e.tileID,e.tileAnchorX,e.tileAnchorY):0),e.elevation+=t.zOffset},ee=l.textBox;if(ee){Q(ee);const i=i=>{let n=e.bI.horizontal;if(o.allowVerticalPlacement&&!i&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[_];e&&(this.placedOrientations[_]=e,n=e,this.markUsedOrientation(o,n,t))}return n},n=(t,i)=>{if(o.allowVerticalPlacement&&A>0&&l.verticalTextBox){for(const n of o.writingModes)if(n===e.bI.vertical?(B=i(),H=B):B=t(),B&&B.box&&B.box.length)break}else B=t()};if(N){let s=N;if(this.prevPlacement&&this.prevPlacement.variableOffsets[_]){const e=this.prevPlacement.variableOffsets[_];s.indexOf(e.anchor)>0&&(s=s.filter(t=>t!==e.anchor),s.unshift(e.anchor))}const a=(e,i,n)=>{const a=o.getSymbolInstanceTextSize(y,t,this.transform.zoom,r),l=(e.x2-e.x1)*a+2*e.padding,h=(e.y2-e.y1)*a+2*e.padding,d=t.hasIconTextFit&&!k?i:null;d&&Q(d);let u={box:[],offscreen:!1,occluded:!1};const g=T?2*s.length:s.length;for(let i=0;i<g;++i){const g=this.attemptAnchorPlacement(s[i%s.length],e,p,m,V,l,h,a,M,C,f,c,x,i>=s.length,t,r,o,n,d,y,v);if(g&&(u=g.placedGlyphBoxes,u&&u.box&&u.box.length)){P=!0,Y=g.shift;break}}return u};n(()=>a(ee,l.iconBox,e.bI.horizontal),()=>{const t=l.verticalTextBox;return t&&Q(t),o.allowVerticalPlacement&&!(B&&B.box&&B.box.length)&&A>0&&t?a(t,l.verticalIconBox,e.bI.vertical):{box:null,offscreen:null,occluded:null}}),B&&(P=B.box,O=B.offscreen,z=B.occluded);const h=i(!(!B||!B.box));if(!P&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[_];e&&(this.variableOffsets[_]=e,this.markUsedJustification(o,e.anchor,t,h))}}else{const a=(i,n)=>{const a=o.getSymbolInstanceTextSize(y,t,this.transform.zoom,r,s),l=this.collisionIndex.placeCollisionBox(o,a,i,p,m,V,new e.P(0,0),T,f,c,x.predicate);return l&&l.box&&l.box.length&&(this.markUsedOrientation(o,n,t),this.placedOrientations[_]=n),l};n(()=>a(ee,e.bI.horizontal),()=>{const t=l.verticalTextBox;return o.allowVerticalPlacement&&A>0&&t?(Q(t),a(t,e.bI.vertical)):{box:null,offscreen:null,occluded:null}}),i(!!(B&&B.box&&B.box.length))}}if(j=B,P=j&&j.box&&j.box.length>0,O=j&&j.offscreen,z=j&&j.occluded,t.useRuntimeCollisionCircles){const i=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex),r=e.bJ(o.textSizeData,y,i),s=a.get("text-padding");X=this.collisionIndex.placeCollisionCircles(o,T,i,o.lineVertexArray,o.glyphOffsetArray,r,c,h,d,n,C,x.predicate,t.collisionCircleDiameter*r/e.bU,s,this.retainedQueryData[o.bucketInstanceId].tileID),P=T||X.circles.length>0&&!X.collisionDetected,O=O&&X.offscreen,z=X.occluded}if(l.iconFeatureIndex&&(K=l.iconFeatureIndex),l.iconBox){const i=i=>{Q(i);const n=t.hasIconTextFit&&Y?yi(Y.x,Y.y,M,C,this.transform.angle):new e.P(0,0),r=o.getSymbolInstanceIconSize(v,this.transform.zoom,t.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(o,r,i,p,m,W,n,k,f,c,x.predicate)};H&&H.box&&H.box.length&&l.verticalIconBox?(q=i(l.verticalIconBox),R=q.box.length>0):(q=i(l.iconBox),R=q.box.length>0),O=O&&q.offscreen,F=q.occluded}const te=w||0===t.numHorizontalGlyphVertices&&0===A,ie=S||0===t.numIconVertices;if(te||ie?ie?te||(R=R&&P):P=R&&P:R=P=R&&P,P&&j&&j.box&&this.collisionIndex.insertCollisionBox(j.box,a.get("text-ignore-placement"),o.bucketInstanceId,H&&H.box&&J?J:Z,x.ID),R&&q&&this.collisionIndex.insertCollisionBox(q.box,a.get("icon-ignore-placement"),o.bucketInstanceId,K,x.ID),X&&(P&&this.collisionIndex.insertCollisionCircles(X.circles,a.get("text-ignore-placement"),o.bucketInstanceId,Z,x.ID),n)){const e=o.bucketInstanceId;let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new pi);for(let e=0;e<X.circles.length;e+=4)t.circles.push(X.circles[e+0]),t.circles.push(X.circles[e+1]),t.circles.push(X.circles[e+2]),t.circles.push(X.collisionDetected?1:0)}const ne="globe"!==o.projection.name;U=U&&(ne||!z),$=$&&(ne||!F),this.placements[_]=new fi(P||U,R||$,O||o.justReloaded),i.add(_)},q=this.retainedQueryData[o.bucketInstanceId].tileID;if("offset"===o.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(o,q),"road"===o.elevationType&&o.updateRoadElevation(q.canonical),o.updateZOffset(),o.sortFeaturesByY){const t=o.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const i=t[e];X(o.symbolInstances.get(i),i,o.collisionArrays[i])}o.hasAnyZOffset&&e.w(`${o.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(o.hasAnyZOffset){const e=o.getSortedIndexesByZOffset();for(let t=0;t<e.length;++t){const i=e[t];X(o.symbolInstances.get(i),i,o.collisionArrays[i])}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)X(o.symbolInstances.get(e),e,o.collisionArrays[e]);if(n&&o.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[o.bucketInstanceId];e.bi(t.invProjMatrix,c),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1}markUsedJustification(t,i,n,r){const{leftJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:o,rightJustifiedTextSymbolIndex:a,verticalPlacedTextSymbolIndex:l,crossTileID:c}=n,h=e.b$(i),d=r===e.bI.vertical?l:"left"===h?s:"center"===h?o:"right"===h?a:-1;s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=d>=0&&s!==d?0:c),o>=0&&(t.text.placedSymbolArray.get(o).crossTileID=d>=0&&o!==d?0:c),a>=0&&(t.text.placedSymbolArray.get(a).crossTileID=d>=0&&a!==d?0:c),l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=d>=0&&l!==d?0:c)}markUsedOrientation(t,i,n){const r=i===e.bI.horizontal||i===e.bI.horizontalOnly?i:0,s=i===e.bI.vertical?i:0,{leftJustifiedTextSymbolIndex:o,centerJustifiedTextSymbolIndex:a,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=n,h=t.text.placedSymbolArray;o>=0&&(h.get(o).placedOrientation=r),a>=0&&(h.get(a).placedOrientation=r),l>=0&&(h.get(l).placedOrientation=r),c>=0&&(h.get(c).placedOrientation=s)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let i=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const n=t?t.symbolFadeChange(e):1,r=t?t.opacities:{},s=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(const e in this.placements){const t=this.placements[e],s=r[e];s?(this.opacities[e]=new ui(s,n,t.text,t.icon,null,t.clipped),i=i||t.text!==s.text.placed||t.icon!==s.icon.placed):(this.opacities[e]=new ui(null,n,t.text,t.icon,t.skipFade,t.clipped),i=i||t.text||t.icon)}for(const e in r){const t=r[e];if(!this.opacities[e]){const r=new ui(t,n,!1,!1);r.isHidden()||(this.opacities[e]=r,i=i||t.text.placed||t.icon.placed)}}for(const e in s)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=s[e]);for(const e in o)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=o[e]);i?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t,i,n){const r=new Set;for(const s of t){const t=s.getBucket(e);t&&s.latestFeatureIndex&&e.fqid===t.layerIds[0]&&(this.updateBucketOpacities(t,r,s,s.collisionBoxArray,i,n,s.tileID,e.scope),"offset"===t.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(t,s.tileID),"road"===t.elevationType&&t.updateRoadElevation(s.tileID.canonical),t.updateZOffset())}}updateBucketOpacities(t,i,n,r,s,o,a,l){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const c=t.layers[0].layout,h=t.layers[0].paint,d=!!t.layers[0].dynamicFilter(),u=new ui(null,0,!1,!1,!0),f=c.get("text-allow-overlap"),p=c.get("icon-allow-overlap"),m=c.get("text-variable-anchor"),g="map"===c.get("text-rotation-alignment"),_="map"===c.get("text-pitch-alignment"),y=h.get("symbol-z-offset"),v="sea"===c.get("symbol-elevation-reference"),x=!y.isConstant(),b=new ui(null,0,f&&(p||!t.hasIconData()||c.get("icon-optional")),p&&(f||!t.hasTextData()||c.get("text-optional")),!0);!t.collisionArrays&&r&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(r);const w=(e,t,i)=>{for(let n=0;n<t/4;n++)e.opacityVertexArray.emplaceBack(i)};let S=0;o&&t.updateReplacement(a,o);for(let r=0;r<t.symbolInstances.length;r++){const c=t.symbolInstances.get(r),{numHorizontalGlyphVertices:h,numVerticalGlyphVertices:f,crossTileID:p,numIconVertices:T,tileAnchorX:k,tileAnchorY:M}=c;let A=null;const C=this.retainedQueryData[t.bucketInstanceId];x&&c&&C&&(A=n.latestFeatureIndex.loadFeature({featureIndex:c.featureIndex,bucketIndex:C.bucketIndex,sourceLayerIndex:C.sourceLayerIndex,layoutVertexArrayOffset:0}));const D=y.evaluate(A,{}),L=i.has(p);let E=this.opacities[p];L?E=u:E||(E=b,this.opacities[p]=E),i.add(p);const I=h>0||f>0,P=T>0,R=this.placedOrientations[p],O=R===e.bI.vertical,z=R===e.bI.horizontal||R===e.bI.horizontalOnly;!I&&!P||E.isHidden()||S++;let F=!1;if((I||P)&&o)for(const i of t.activeReplacements){if(e.bV(i,s,e.bW.Symbol,l))continue;if(i.min.x>k||k>i.max.x||i.min.y>M||M>i.max.y)continue;const t=e.bX(k,M,a.canonical,i.footprintTileId.canonical);if(F=e.bY(t,i.footprint),F)break}if(I){const e=F?Di:Ci(E.text);w(t.text,h,O?Di:e),w(t.text,f,z?Di:e);const i=E.text.isHidden(),{leftJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:r,rightJustifiedTextSymbolIndex:s,verticalPlacedTextSymbolIndex:o}=c,a=t.text.placedSymbolArray,l=i||O?1:0;n>=0&&(a.get(n).hidden=l),r>=0&&(a.get(r).hidden=l),s>=0&&(a.get(s).hidden=l),o>=0&&(a.get(o).hidden=i||z?1:0);const d=this.variableOffsets[p];d&&this.markUsedJustification(t,d.anchor,c,R);const u=this.placedOrientations[p];u&&(this.markUsedJustification(t,"left",c,u),this.markUsedOrientation(t,u,c))}if(P){const e=F?Di:Ci(E.icon),{placedIconSymbolIndex:i,verticalPlacedIconSymbolIndex:n}=c,r=t.icon.placedSymbolArray,s=E.icon.isHidden()?1:0;i>=0&&(w(t.icon,T,O?Di:e),r.get(i).hidden=s),n>=0&&(w(t.icon,c.numVerticalIconVertices,z?Di:e),r.get(n).hidden=s)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const i=t.collisionArrays[r];if(i){let n=new e.P(0,0),r=!0;if(i.textBox||i.verticalTextBox){if(m){const e=this.variableOffsets[p];e?(n=_i(e.anchor,e.width,e.height,e.textOffset,e.textScale),g&&n._rotate(_?this.transform.angle:-this.transform.angle)):r=!1}d&&(r=!E.clipped),i.textBox&&xi(t.textCollisionBox.collisionVertexArray,E.text.placed,!r||O,D,v,n.x,n.y),i.verticalTextBox&&xi(t.textCollisionBox.collisionVertexArray,E.text.placed,!r||z,D,v,n.x,n.y)}const s=r&&Boolean(!z&&i.verticalIconBox);i.iconBox&&xi(t.iconCollisionBox.collisionVertexArray,E.icon.placed,s,D,v,c.hasIconTextFit?n.x:0,c.hasIconTextFit?n.y:0),i.verticalIconBox&&xi(t.iconCollisionBox.collisionVertexArray,E.icon.placed,!s,D,v,c.hasIconTextFit?n.x:0,c.hasIconTextFit?n.y:0)}}}if(t.fullyClipped=0===S,t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){const i=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*i>e}setStale(){this.stale=!0}}function xi(e,t,i,n,r,s,o){e.emplaceBack(t?1:0,i?1:0,s||0,o||0,n,r?1:0),e.emplaceBack(t?1:0,i?1:0,s||0,o||0,n,r?1:0),e.emplaceBack(t?1:0,i?1:0,s||0,o||0,n,r?1:0),e.emplaceBack(t?1:0,i?1:0,s||0,o||0,n,r?1:0)}const bi=Math.pow(2,25),wi=Math.pow(2,24),Si=Math.pow(2,17),Ti=Math.pow(2,16),ki=Math.pow(2,9),Mi=Math.pow(2,8),Ai=Math.pow(2,1);function Ci(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,i=Math.floor(127*e.opacity);return i*bi+t*wi+i*Si+t*Ti+i*ki+t*Mi+i*Ai+t}const Di=0;class Li{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(e,t,i,n,r,s){const o=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(o,n,e[this._currentTileIndex],this._sortAcrossTiles,s),this._currentTileIndex++,r())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort((e,t)=>e.sortKey-t.sortKey));this._currentPartIndex<o.length;){const e=o[this._currentPartIndex];if(t.placeLayerBucketPart(e,this._seenCrossTileIDs,i,0===e.symbolInstanceStart,s),this._currentPartIndex++,r())return!0}return!1}}class Ei{constructor(e,t,i,n,r,s,o,a,l){this.placement=new vi(e,r,s,o,a,l),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(t,i,n,r,s){const o=e.q.now(),a=()=>{const t=e.q.now()-o;return!this._forceFullPlacement&&t>2};for(;this._currentPlacementIndex>=0;){const o=i[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===o.type&&(!o.minzoom||o.minzoom<=l)&&(!o.maxzoom||o.maxzoom>l)){const t=o,i=t.layout.get("symbol-z-elevate"),l=void 0!==t.layout.get("symbol-sort-key").constantOr(1),c=t.layout.get("symbol-z-order"),h="viewport-y"===c||"auto"===c&&!("viewport-y"!==c&&l),d=t.layout.get("text-allow-overlap")||t.layout.get("icon-allow-overlap")||t.layout.get("text-ignore-placement")||t.layout.get("icon-ignore-placement"),u=h&&d,f=this._inProgressLayer=this._inProgressLayer||new Li(t),p=e.C(o.source,o.scope);if(f.continuePlacement(i||u?r[p]:n[p],this.placement,this._showCollisionBoxes,o,a,s))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const Ii=512/e.aj/2;class Pi{constructor(t,i,n){this.tileID=t,this.bucketInstanceId=n,this.index=new e.c0(i.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const r=t.canonical.x*e.aj,s=t.canonical.y*e.aj;for(let e=0;e<i.length;e++){const{key:t,crossTileID:n,tileAnchorX:o,tileAnchorY:a}=i.get(e),l=Math.floor((r+o)*Ii),c=Math.floor((s+a)*Ii);this.index.add(l,c),this.keys.push(t),this.crossTileIDs.push(n)}this.index.finish()}findMatches(t,i,n){const r=this.tileID.canonical.z<i.canonical.z?1:Math.pow(2,this.tileID.canonical.z-i.canonical.z),s=Ii/Math.pow(2,i.canonical.z-this.tileID.canonical.z),o=i.canonical.x*e.aj,a=i.canonical.y*e.aj;for(let e=0;e<t.length;e++){const i=t.get(e);if(i.crossTileID)continue;const{key:l,tileAnchorX:c,tileAnchorY:h}=i,d=Math.floor((o+c)*s),u=Math.floor((a+h)*s),f=this.index.range(d-r,u-r,d+r,u+r).sort((e,t)=>e-t);for(const e of f){const t=this.crossTileIDs[e];if(this.keys[e]===l&&!n.has(t)){n.add(t),i.crossTileID=t;break}}}}}class Ri{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Oi{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const t=Math.round((e-this.lng)/360);if(0!==t)for(const e in this.indexes){const i=this.indexes[e],n={};for(const e in i){const r=i[e];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),n[r.tileID.key]=r}this.indexes[e]=n}this.lng=e}addBucket(e,t,i){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++)t.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]=new Set);const n=this.usedCrossTileIDs[e.overscaledZ];for(const i in this.indexes){const r=this.indexes[i];if(Number(i)>e.overscaledZ)for(const i in r){const s=r[i];s.tileID.isChildOf(e)&&s.findMatches(t.symbolInstances,e,n)}else{const s=r[e.scaledTo(Number(i)).key];s&&s.findMatches(t.symbolInstances,e,n)}}for(let e=0;e<t.symbolInstances.length;e++){const r=t.symbolInstances.get(e);r.crossTileID||(r.crossTileID=i.generate(),n.add(r.crossTileID))}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Pi(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(const i of t.crossTileIDs)this.usedCrossTileIDs[e].delete(i)}removeStaleBuckets(e){let t=!1;for(const i in this.indexes){const n=this.indexes[i];for(const r in n)e[n[r].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,n[r]),delete n[r],t=!0)}return t}}class zi{constructor(){this.layerIndexes={},this.crossTileIDs=new Ri,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,i,n){let r=this.layerIndexes[e.fqid];void 0===r&&(r=this.layerIndexes[e.fqid]=new Oi);let s=!1;const o={};"globe"!==n.name&&r.handleWrapJump(i);for(const i of t){const t=i.getBucket(e);t&&e.fqid===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(i.tileID,t,this.crossTileIDs)&&(s=!0),o[t.bucketInstanceId]=!0)}return r.removeStaleBuckets(o)&&(s=!0),s}pruneUnusedLayers(e){const t={};e.forEach(e=>{t[e]=!0});for(const e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}const Fi=771;class Ni{constructor(e,t,i,n){this.blendFunction=e,this.blendColor=t.toNonPremultipliedRenderColor(null),this.mask=i,this.blendEquation=n}}Ni.Replace=[1,0,1,0],Ni.disabled=new Ni(Ni.Replace,e.am.transparent,[!1,!1,!1,!1]),Ni.unblended=new Ni(Ni.Replace,e.am.transparent,[!0,!0,!0,!0]),Ni.alphaBlended=new Ni([1,Fi,1,Fi],e.am.transparent,[!0,!0,!0,!0]),Ni.alphaBlendedNonPremultiplied=new Ni([770,Fi,770,Fi],e.am.transparent,[!0,!0,!0,!0]),Ni.multiply=new Ni([774,0,774,0],e.am.transparent,[!0,!0,!0,!0]);class Yi{constructor(e,t,i){this.func=e,this.mask=t,this.range=i}}Yi.ReadOnly=!1,Yi.ReadWrite=!0,Yi.disabled=new Yi(519,Yi.ReadOnly,[0,1]);const Bi=7680;class Hi{constructor(e,t,i,n,r,s){this.test=e,this.ref=t,this.mask=i,this.fail=n,this.depthFail=r,this.pass=s}}Hi.disabled=new Hi({func:519,mask:0},0,0,Bi,Bi,Bi);const ji=1029,Vi=2305;class Wi{constructor(e,t,i){this.enable=e,this.mode=t,this.frontFace=i}}function Ui(t,i){const n=e.c6(t,3);e.c8(t,i),e.cc(t,3,n)}function $i(t,i){const n=e.c3([]);return e.c4(n,n,-i),e.c5(n,n,-t),n}function Gi(t,i){const n=[t[0],t[1],0],r=[i[0],i[1],0];if(e.ae(n)>=1e-15){const t=e.au([],n);e.c1(r,t,e.bG(r,t)),i[0]=r[0],i[1]=r[1]}const s=e.bF([],i,t);if(e.c2(s)<1e-15)return null;const o=Math.atan2(-s[1],s[0]);return $i(Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2]),o)}Wi.disabled=new Wi(!1,ji,Vi),Wi.backCCW=new Wi(!0,ji,Vi),Wi.backCW=new Wi(!0,ji,2304),Wi.frontCW=new Wi(!0,1028,2304),Wi.frontCCW=new Wi(!0,1028,Vi);class Xi{constructor(e,t){this.position=e,this.orientation=t}get position(){return this._position}set position(t){if(t){const i=t instanceof e.ac?t:new e.ac(t[0],t[1],t[2]);this._renderWorldCopies&&(i.x=e.bQ(i.x,0,1)),this._position=i}else this._position=null}lookAtPoint(t,i){if(this.orientation=null,!this.position)return;const n=this.position,r=this._elevation?this._elevation.getAtPointOrZero(e.ac.fromLngLat(t)):0,s=e.ac.fromLngLat(t,r),o=[s.x-n.x,s.y-n.y,s.z-n.z];i||(i=[0,0,1]),i[2]=Math.abs(i[2]),this.orientation=Gi(o,i)}setPitchBearing(t,i){this.orientation=$i(e.al(t),e.al(-i))}}class qi{constructor(t,i){this._transform=e.bx([]),this.orientation=i,this.position=t}get mercatorPosition(){const t=this.position;return new e.ac(t[0],t[1],t[2])}get position(){const t=e.c6(this._transform,3);return[t[0],t[1],t[2]]}set position(t){var i;t&&e.cc(this._transform,3,[(i=t)[0],i[1],i[2],1])}get orientation(){return this._orientation}set orientation(t){this._orientation=t||e.c3([]),t&&Ui(this._transform,this._orientation)}getPitchBearing(){const e=this.forward(),t=this.right();return{bearing:Math.atan2(-t[1],t[0]),pitch:Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2])}}setPitchBearing(e,t){this._orientation=$i(e,t),Ui(this._transform,this._orientation)}forward(){const t=e.c6(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=e.c6(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=e.c6(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(t,i){const n=new Float64Array(16);return e.bi(n,this.getWorldToCamera(t,i)),n}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(t,i,n){const r=this.position;e.c1(r,r,-t);const s=new Float64Array(16);return e.bn(s,[n,n,n]),e.bo(s,s,r),s[10]*=i,s}getWorldToCamera(t,i){const n=new Float64Array(16),r=new Float64Array(4),s=this.position;return e.c7(r,this._orientation),e.c1(s,s,-t),e.c8(n,r),e.bo(n,n,s),n[1]*=-1,n[5]*=-1,n[9]*=-1,n[13]*=-1,n[8]*=i,n[9]*=i,n[10]*=i,n[11]*=i,n}getCameraToClipPerspective(t,i,n,r){const s=new Float64Array(16);return e.c9(s,t,i,n,r),s}getCameraToClipOrthographic(t,i,n,r,s,o){const a=new Float64Array(16);return e.ca(a,t,i,n,r,s,o),a}getDistanceToElevation(t,i=!1){const n=0===t?0:e.cb(t,i?e.aY(this.position[1]):this.position[1]),r=this.forward();return(n-this.position[2])/r[2]}clone(){return new qi([...this.position],[...this.orientation])}}const Zi=5,Ji=6,Ki=7,Qi=8,en=9,tn=10,nn=11;class rn{constructor(e=0,t=0,i=0,n=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(i)||i<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=i,this.right=n}interpolate(t,i,n){return null!=i.top&&null!=t.top&&(this.top=e.ai(t.top,i.top,n)),null!=i.bottom&&null!=t.bottom&&(this.bottom=e.ai(t.bottom,i.bottom,n)),null!=i.left&&null!=t.left&&(this.left=e.ai(t.left,i.left,n)),null!=i.right&&null!=t.right&&(this.right=e.ai(t.right,i.right,n)),this}getCenter(t,i){const n=e.ay((this.left+t-this.right)/2,0,t),r=e.ay((this.top+i-this.bottom)/2,0,i);return new e.P(n,r)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new rn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const sn=15;class on{constructor(t,i,n,r,s,o,a){this.tileSize=512,this._renderWorldCopies=void 0===s||s,this._minZoom=t||0,this._maxZoom=i||22,this._minPitch=n??0,this._maxPitch=r??60,this.setProjection(o),this.setMaxBounds(a),this.width=0,this.height=0,this._center=new e.ci(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new rn,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new qi,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1,this._allowWorldUnderZoom=!1}clone(){const e=new on(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection(),this.maxBounds);return e._elevation=this._elevation,e._centerAltitude=this._centerAltitude,e._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,e.tileSize=this.tileSize,e.mercatorFromTransition=this.mercatorFromTransition,e.width=this.width,e.height=this.height,e.cameraElevationReference=this.cameraElevationReference,e._center=this._center,e._setZoom(this.zoom),e._seaLevelZoom=this._seaLevelZoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._nearZ=this._nearZ,e._farZ=this._farZ,e._averageElevation=this._averageElevation,e._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._camera=this._camera.clone(),e._calcMatrices(),e.freezeTileCoverage=this.freezeTileCoverage,e.frustumCorners=this.frustumCorners,e._allowWorldUnderZoom=this._allowWorldUnderZoom,e}get isOrthographic(){return"globe"!==this.projection.name&&this._orthographicProjectionAtLowPitch&&this.pitch<sn}get elevation(){return this._elevation}set elevation(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices())}get depthOcclusionForSymbolsAndCircles(){return"globe"!==this.projection.name&&!this.isOrthographic}updateElevation(e,t=!1){const i=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||i)&&this._updateCameraOnTerrain(),(e||i)&&this._constrainCamera(t),this._calcMatrices()}getProjection(){return e.aF(this.projection,["name","center","parallels"])}setProjection(t){this.projectionOptions=t||{name:"mercator"};const i=this.projection?this.getProjection():void 0;this.projection=e.cj(this.projectionOptions);const n=this.getProjection(),r=!e.bv(i,n);return r&&this._calcMatrices(),this.mercatorFromTransition=!1,r}setOrthographicProjectionAtLowPitch(e){return this._orthographicProjectionAtLowPitch!==e&&(this._orthographicProjectionAtLowPitch=e,this._calcMatrices(),!0)}setMercatorFromTransition(){const t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=e.cj({name:"mercator"});const i=t!==this.projection.name;return i&&this._calcMatrices(),i}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get cameraWorldSize(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return e.cb(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return e.bQ(this.rotation,-180,180)}set bearing(e){this.rotation=e}get rotation(){return-this.angle/Math.PI*180}set rotation(t){const i=-t*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=e.ck(),e.cl(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const i=e.ay(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=e.al(t),this._calcMatrices())}get fovX(){return this._fov}get fovY(){const e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}get averageElevation(){return this._averageElevation}set averageElevation(e){this._averageElevation=e,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._setZoom(t),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(e){this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(e){this._tileCoverLift!==e&&(this._tileCoverLift=e)}_updateCameraOnTerrain(){const e=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,t=this.elevation&&e===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>0&&this._centerAltitudeValidForExaggeration;if(!this._elevation||e===Number.NEGATIVE_INFINITY&&(!t||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const i=this._elevation;t||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&i.exaggeration()&&this._centerAltitudeValidForExaggeration!==i.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*i.exaggeration(),this._centerAltitudeValidForExaggeration=i.exaggeration()):(this._centerAltitude=e||0,this._centerAltitudeValidForExaggeration=i.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){if(void 0===this._centerAltitudeValidForExaggeration)return;const e=Math.max(0,(this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize);this._seaLevelZoom=this._zoomFromMercatorZ(e)}sampleAverageElevation(){if(!this._elevation)return 0;const t=this._elevation,i=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],n=this.horizonLineFromTop();let r=0,s=0;for(let o=0;o<i.length;o++){const a=new e.P(i[o][0]*this.width,n+i[o][1]*(this.height-n)),l=t.pointCoordinate(a);if(!l)continue;const c=1/Math.hypot(l[0]-this._camera.position[0],l[1]-this._camera.position[1]);r+=l[3]*c,s+=c}return 0===s?NaN:r/s}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;const e=this._seaLevelZoom,t=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),i=this.pixelsPerMeter/this.worldSize*t,n=this._mercatorZfromZoom(e),r=this._mercatorZfromZoom(this._maxZoom),s=Math.max(n-i,r);this._setZoom(this._zoomFromMercatorZ(s))}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}computeZoomRelativeTo(t){const i=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,t.toAltitude()));let n;n=t.z<this._camera.position[2]?[i.x,i.y,i.z]:[t.x,t.y,t.z];const r=e.ae(e.at([],this._camera.position,n));return e.ay(this._zoomFromMercatorZ(r),this._minZoom,this._maxZoom)}setFreeCameraOptions(t){if(!this.height)return;if(!t.position&&!t.orientation)return;this._updateCameraState();let i=!1;if(t.orientation&&!e.cm(t.orientation,this._camera.orientation)&&(i=this._setCameraOrientation(t.orientation)),t.position){const n=[t.position.x,t.position.y,t.position.z];e.cn(n,this._camera.position)||(this._setCameraPosition(n),i=!0)}i&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const t=this._camera.position,i=new Xi;return i.position=new e.ac(t[0],t[1],t[2]),i.orientation=this._camera.orientation,i._elevation=this.elevation,i._renderWorldCopies=this.renderWorldCopies,i}_setCameraOrientation(t){if(!e.co(t))return!1;e.cp(t,t);const i=e.cq([],[0,0,-1],t),n=e.cq([],[0,-1,0],t);if(n[2]<0)return!1;const r=Gi(i,n);return!!r&&(this._camera.orientation=r,!0)}_setCameraPosition(t){const i=this.zoomScale(this.minZoom)*this.tileSize,n=this.zoomScale(this.maxZoom)*this.tileSize,r=this.cameraToCenterDistance;t[2]=e.ay(t[2],r/n,r/i),this._camera.position=t}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,i){this._unmodified=!1,this._edgeInsets.interpolate(e,t,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(t){const i=[new e.cr(0,t)];if(this.renderWorldCopies){const n=this.pointCoordinate(new e.P(0,0)),r=this.pointCoordinate(new e.P(this.width,0)),s=this.pointCoordinate(new e.P(this.width,this.height)),o=this.pointCoordinate(new e.P(0,this.height)),a=Math.floor(Math.min(n.x,r.x,s.x,o.x)),l=Math.floor(Math.max(n.x,r.x,s.x,o.x)),c=1;for(let n=a-c;n<=l+c;n++)0!==n&&i.push(new e.cr(n,t))}return i}isLODDisabled(e){return(!e||this.pitch<=60)&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace}extendTileCover(t,i,n){let r=[];const s=null!=n,o=!s;if(o&&this.zoom<i)return r;if(s&&0===n[0]&&0===n[1])return r;const a=new Set,l=(t,i,n,s,o)=>{const l=e.cV(i,t,n,s,o);a.has(l)||(r.push(new e.aM(t,i,n,s,o)),a.add(l))};for(let e=0;e<t.length;e++){const r=t[e];if(o&&r.canonical.z!==i)continue;const a=r.canonical,c=r.overscaledZ,h=r.wrap,d=1<<a.z,u=a.x+1<d,f=a.x>0,p=a.y+1<d,m=a.y>0,g=r.wrap-(f?0:1),_=r.wrap+(u?0:1),y=f?a.x-1:d-1,v=u?a.x+1:0;if(s)n[0]<0?(l(c,_,a.z,v,a.y),n[1]<0&&p&&(l(c,h,a.z,a.x,a.y+1),l(c,_,a.z,v,a.y+1)),n[1]>0&&m&&(l(c,h,a.z,a.x,a.y-1),l(c,_,a.z,v,a.y-1))):n[0]>0?(l(c,g,a.z,y,a.y),n[1]<0&&p&&(l(c,h,a.z,a.x,a.y+1),l(c,g,a.z,y,a.y+1)),n[1]>0&&m&&(l(c,h,a.z,a.x,a.y-1),l(c,g,a.z,y,a.y-1))):n[1]<0&&p?l(c,h,a.z,a.x,a.y+1):m&&l(c,h,a.z,a.x,a.y-1);else{const e=r.visibleQuadrants;1&e&&(l(c,g,a.z,y,a.y),m&&(l(c,h,a.z,a.x,a.y-1),l(c,g,a.z,y,a.y-1))),2&e&&(l(c,_,a.z,v,a.y),m&&(l(c,h,a.z,a.x,a.y-1),l(c,_,a.z,v,a.y-1))),4&e&&(l(c,g,a.z,y,a.y),p&&(l(c,h,a.z,a.x,a.y+1),l(c,g,a.z,y,a.y+1))),8&e&&(l(c,_,a.z,v,a.y),p&&(l(c,h,a.z,a.x,a.y+1),l(c,_,a.z,v,a.y+1)))}}const c=[];for(const e of r)r.some(t=>e.isChildOf(t))||c.push(e);if(r=c.filter(e=>!t.some(t=>!!(e.overscaledZ<i&&t.isChildOf(e))||e.equals(t)||e.isChildOf(t))),o){const e=1<<i,t="globe"===this.projection.name?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),n=[e*t.x,e*t.y],s=4,o=s*s;r=r.filter(e=>{const t=e.canonical.x+.5-n[0],i=e.canonical.y+.5-n[1];return t*t+i*i<o})}return r}extendTileCoverToNearPlane(t,i,n){const r=[],s=new Set;for(const e of t)s.add(e.key);const o=(t,i,n,o,a)=>{const l=e.cV(i,t,n,o,a);s.has(l)||(r.push(new e.aM(t,i,n,o,a)),s.add(l))},a=t.reduce((e,t)=>Math.max(e,t.overscaledZ),n),l=1<<n,c=[new e.P(0,0),new e.P(e.aj,0),new e.P(e.aj,e.aj),new e.P(0,e.aj)],h=new e.P(0,0),d=new e.P(0,0),u=(t,i)=>{const r=Math.floor(t[0]),s=Math.floor(t[1]),u=(t[0]-r)*e.aj,f=(t[1]-s)*e.aj,p=Math.floor(i[0]),m=Math.floor(i[1]),g=(i[0]-p)*e.aj,_=(i[1]-m)*e.aj;for(let t=-1;t<=1;t++){const i=r+t;if(!(i<0||i>=l)){h.x=u-t*e.aj,d.x=g-(i-p)*e.aj;for(let t=-1;t<=1;t++){const r=s+t;h.y=f-t*e.aj,d.y=_-(r-m)*e.aj,e.cW(h,d,c)&&o(a,0,n,i,r)}}}},f=i.points,p=f[e.cs],m=f[e.ct],g=this._projectToGround(p,f[e.cu]),_=this._projectToGround(m,f[e.cv]);return u(p,g),u(m,_),r}_projectToGround(t,i){return e.cw(e.cx(),t,i,t[2]/(t[2]-i[2]))}coveringTiles(t){let i=this.coveringZoomLevel(t);const n=i,r=this.elevation&&this.elevation.exaggeration(),s=r&&!t.isTerrainDEM,o="mercator"===this.projection.name;if(void 0!==t.minzoom&&i<t.minzoom)return[];void 0!==t.maxzoom&&i>t.maxzoom&&(i=t.maxzoom);const a=this.locationCoordinate(this.center),l=this.center.lat,c=1<<i,h=[c*a.x,c*a.y,0],d="globe"===this.projection.name,u=!d,f=e.cy.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,i,u),p=d?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),m=c*e.cb(1,this.center.lat),g=this._camera.position[2]/e.cb(1,this.center.lat),_=[c*p.x,c*p.y,g*(u?1:m)],y=d||r,v=this.cameraToCenterDistance/t.tileSize*(t.roundZoom?1:.502),x=this.isLODDisabled(!0)?i:0;let b;if(this._elevation&&t.isTerrainDEM)b=1e4*this._elevation.exaggeration();else if(this._elevation){const e=this._elevation.getMinMaxForVisibleTiles();b=e?e.max:this._centerAltitude}else b=this._centerAltitude;const w=t.isTerrainDEM?-b:this._elevation?this._elevation.getMinElevationBelowMSL():0,S=this.projection.isReprojectedInTileSpace?e.cz(this):1,T=t=>{const i=1/4e4,n=new e.ac(t.x+i,t.y,t.z),r=new e.ac(t.x,t.y+i,t.z),s=t.toLngLat(),o=n.toLngLat(),a=r.toLngLat(),l=this.locationCoordinate(s),c=this.locationCoordinate(o),h=this.locationCoordinate(a),d=Math.hypot(c.x-l.x,c.y-l.y),u=Math.hypot(h.x-l.x,h.y-l.y);return Math.sqrt(d*u)*S/i},k=t=>{const i=b,n=w;return{aabb:e.cC(this,c,0,0,0,t,n,i,this.projection),zoom:0,x:0,y:0,minZ:n,maxZ:i,wrap:t,fullyVisible:!1}},M=[];let A=[];const C=i,D=t.reparseOverscaled?n:i,L=(g-this._centerAltitude)*m,E=e=>{if(!this._elevation||!e.tileID||!o)return;const t=this._elevation.getMinMaxForTile(e.tileID),i=e.aabb;t?(i.min[2]=t.min,i.max[2]=t.max,i.center[2]=(i.min[2]+i.max[2])/2):(e.shouldSplit=P(e),e.shouldSplit||(i.min[2]=i.max[2]=i.center[2]=this._centerAltitude))},I=(e,t)=>{if(.707*t<e)return 1;const i=t/e;return i/(1.4144271570014144+(Math.pow(1.1,i-1.4144271570014144+1)-1)/(1.1-1)-1)},P=t=>{if(t.zoom<x)return!0;if(t.zoom===C)return!1;if(null!=t.shouldSplit)return t.shouldSplit;const i=t.aabb.distanceX(_),r=t.aabb.distanceY(_);let a=L,c=1;if(d){a=t.aabb.distanceZ(_);const i=Math.pow(2,t.zoom),n=e.aY((t.y+1)/i),r=e.aY(t.y/i),s=Math.min(Math.max(l,n),r),o=e.c_(s)/e.c_(l);if(c=s===l?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,o/this._mercatorScaleRatio),this.zoom<=e.cX&&t.zoom===C-1&&o>=.9)return!0}else if(s&&(a=t.aabb.distanceZ(_)*m),this.projection.isReprojectedInTileSpace&&n<=5){const i=Math.pow(2,t.zoom),n=T(new e.ac((t.x+.5)/i,(t.y+.5)/i));c=n>.85?1:n}if(!o){const e=Math.sqrt(i*i+r*r+a*a);let n=(1<<C-t.zoom)*v*c;return n*=I(Math.max(a,L),e),e<n}let u=Number.MAX_VALUE,f=0;const p=t.aabb.getCorners(),g=[];for(const t of p){e.at(g,t,_),d||(s?g[2]*=m:g[2]=L);const i=e.bG(g,this._camera.forward());i<u&&(u=i,f=Math.abs(g[2]))}let y=(1<<C-t.zoom)*v*c;if(y*=I(Math.max(f,L),u),u<y)return!0;const b=t.aabb.closestPoint(h);return b[0]===h[0]&&b[1]===h[1]};if(this.renderWorldCopies)for(let e=1;e<=3;e++)M.push(k(-e)),M.push(k(e));for(M.push(k(0));M.length>0;){const n=M.pop(),r=n.x,a=n.y;let l=n.fullyVisible;const u=()=>"globe"===this.projection.name&&(0===n.y||n.y===(1<<n.zoom)-1);if(!l){let t=y?n.aabb.intersects(f):n.aabb.intersectsFlat(f);if(0===t&&u()){const i=new e.cA(n.zoom,r,a);t=e.cB(this,c,i,!0).intersects(f)}if(0===t)continue;l=2===t}if(n.zoom!==C&&P(n))for(let t=0;t<4;t++){const i=(r<<1)+t%2,h=(a<<1)+(t>>1),u={aabb:o?n.aabb.quadrant(t):e.cC(this,c,n.zoom+1,i,h,n.wrap,n.minZ,n.maxZ,this.projection),zoom:n.zoom+1,x:i,y:h,wrap:n.wrap,fullyVisible:l,tileID:void 0,shouldSplit:void 0,minZ:n.minZ,maxZ:n.maxZ};s&&!d&&(u.tileID=new e.aM(n.zoom+1===C?D:n.zoom+1,n.wrap,n.zoom+1,i,h),E(u)),M.push(u)}else{const s=n.zoom===C?D:n.zoom;if(t.minzoom&&t.minzoom>s)continue;let o=0;if(!l){let i=y?n.aabb.intersectsPrecise(f):n.aabb.intersectsPreciseFlat(f);if(0===i&&u()){const t=new e.cA(n.zoom,r,a);i=e.cB(this,c,t,!0).intersectsPrecise(f)}if(0===i)continue;if(t.calculateQuadrantVisibility)if(f.containsPoint(n.aabb.center))o=15;else for(let e=0;e<4;e++)0!==n.aabb.quadrant(e).intersects(f)&&(o|=1<<e)}const d=h[0]-(.5+r+(n.wrap<<n.zoom))*(1<<i-n.zoom),p=h[1]-.5-a,m=n.tileID?n.tileID:new e.aM(s,n.wrap,n.zoom,r,a);t.calculateQuadrantVisibility&&(m.visibleQuadrants=o),A.push({tileID:m,distanceSq:d*d+p*p})}}if(this.fogCullDistSq){const i=this.fogCullDistSq,n=this.horizonLineFromTop();A=A.filter(r=>{const s=[0,0,0,1],o=[e.aj,e.aj,0,1],a=this.calculateFogTileMatrix(r.tileID.toUnwrapped());e.aA(s,s,a),e.aA(o,o,a);const l=e.cD([],s,o),c=e.cE([],s,o),h=e.cY(l,c);if(0===h)return!0;let d=!1;const u=this._elevation;if(u&&h>i&&0!==n){const i=this.calculateProjMatrix(r.tileID.toUnwrapped());let s;t.isTerrainDEM||(s=u.getMinMaxForTile(r.tileID)),s||(s={min:w,max:b});const o=e.cF(this.rotation),a=[o[0]*e.aj,o[1]*e.aj,s.max];e.ad(a,a,i),d=(1-a[1])*this.height*.5<n}return h<i||d})}return A.sort((e,t)=>e.distanceSq-t.distanceSq).map(e=>e.tileID)}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(t){const i=e.ay(t.lat,-e.cG,e.cG),n=this.projection.project(t.lng,i);return new e.P(n.x*this.worldSize,n.y*this.worldSize)}unproject(e){return this.projection.unproject(e.x/this.worldSize,e.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/e.cb(1,this.center.lat)/this.worldSize}setLocationAtPoint(t,i){let n,r;const s=this.centerPoint;if("globe"===this.projection.name){const e=this.worldSize;n=(i.x-s.x)/e,r=(i.y-s.y)/e}else{const e=this.pointCoordinate(i),t=this.pointCoordinate(s);n=e.x-t.x,r=e.y-t.y}const o=this.locationCoordinate(t);this.setLocation(new e.ac(o.x-n,o.y-r))}setLocation(e){this.center=this.coordinateLocation(e),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(e,t){return this.projection.locationPoint(this,e,t)}locationPoint3D(e,t){return this.projection.locationPoint(this,e,t,!0)}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}pointLocation3D(e,t){return this.coordinateLocation(this.pointCoordinate3D(e,t))}locationCoordinate(t,i){const n=i?e.cb(i,t.lat):void 0,r=this.projection.project(t.lng,t.lat);return new e.ac(r.x,r.y,n)}coordinateLocation(e){return this.projection.unproject(e.x,e.y)}pointRayIntersection(t,i){const n=null!=i?i:this._centerAltitude,r=[t.x,t.y,0,1],s=[t.x,t.y,1,1];e.aA(r,r,this.pixelMatrixInverse),e.aA(s,s,this.pixelMatrixInverse);const o=s[3];e.cH(r,r,1/r[3]),e.cH(s,s,1/o);const a=r[2],l=s[2];return{p0:r,p1:s,t:a===l?0:(n-a)/(l-a)}}screenPointToMercatorRay(t){const i=[t.x,t.y,0,1],n=[t.x,t.y,1,1];return e.aA(i,i,this.pixelMatrixInverse),e.aA(n,n,this.pixelMatrixInverse),e.cH(i,i,1/i[3]),e.cH(n,n,1/n[3]),i[2]=e.cb(i[2],this._center.lat)*this.worldSize,n[2]=e.cb(n[2],this._center.lat)*this.worldSize,e.cH(i,i,1/this.worldSize),e.cH(n,n,1/this.worldSize),new e.av([i[0],i[1],i[2]],e.au([],e.at([],n,i)))}rayIntersectionCoordinate(t){const{p0:i,p1:n,t:r}=t,s=e.cb(i[2],this._center.lat),o=e.cb(n[2],this._center.lat);return new e.ac(e.ai(i[0],n[0],r)/this.worldSize,e.ai(i[1],n[1],r)/this.worldSize,e.ai(s,o,r))}pointCoordinate(e,t=this._centerAltitude){return this.projection.pointCoordinate(this,e.x,e.y,t)}pointCoordinate3D(t,i){if(!this.elevation)return this.pointCoordinate(t,i);let n=this.projection.pointCoordinate3D(this,t.x,t.y);if(n)return new e.ac(n[0],n[1],n[2]);let r=0,s=this.horizonLineFromTop();if(t.y>s)return this.pointCoordinate(t,i);const o=.02*s,a=t.clone();for(let t=0;t<10&&s-r>o;t++){a.y=e.ai(r,s,.66);const t=this.projection.pointCoordinate3D(this,a.x,a.y);t?(s=a.y,n=t):r=a.y}return n?new e.ac(n[0],n[1],n[2]):this.pointCoordinate(t)}isPointAboveHorizon(e){return this.projection.isPointAboveHorizon(this,e)}isPointOnSurface(t){if(t.y<0||t.y>this.height||t.x<0||t.x>this.width)return!1;if(this.elevation||this.zoom>=e.cI)return!this.isPointAboveHorizon(t);const i=this.pointCoordinate(t);return i.y>=0&&i.y<=1}_coordinatePoint(t,i){const n=i&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,r=[t.x*this.worldSize,t.y*this.worldSize,n+t.toAltitude(),1];return e.aA(r,r,this.pixelMatrix),r[3]>0?new e.P(r[0]/r[3],r[1]/r[3]):new e.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:t,left:i}=this._edgeInsets,n=this.height-this._edgeInsets.bottom,r=this.width-this._edgeInsets.right,s=this.pointLocation3D(new e.P(i,t)),o=this.pointLocation3D(new e.P(r,t)),a=this.pointLocation3D(new e.P(r,n)),l=this.pointLocation3D(new e.P(i,n));let c=Math.min(s.lng,o.lng,a.lng,l.lng),h=Math.max(s.lng,o.lng,a.lng,l.lng),d=Math.min(s.lat,o.lat,a.lat,l.lat),u=Math.max(s.lat,o.lat,a.lat,l.lat);const f=Math.pow(2,-this.zoom)/16*270,p="globe"===this.projection.name?1:4,m=(t,i,n,r,s)=>{const o=(t+n)/2,a=(i+r)/2,l=new e.P(o,a),{lng:g,lat:_}=this.pointLocation3D(l),y=Math.max(0,c-g,d-_,g-h,_-u);c=Math.min(c,g),h=Math.max(h,g),d=Math.min(d,_),u=Math.max(u,_),(s<p||y>f)&&(m(t,i,o,a,s+1),m(o,a,n,r,s+1))};if(m(i,t,r,t,1),m(r,t,r,n,1),m(r,n,i,n,1),m(i,n,i,t,1),"globe"===this.projection.name){const[t,i]=e.cJ(this);t?(u=90,h=180,c=-180):i&&(d=-90,h=180,c=-180)}return new e.aG(new e.ci(c,d),new e.ci(h,u))}_getBoundsRectangular(t,i){const{top:n,left:r}=this._edgeInsets,s=this.height-this._edgeInsets.bottom,o=this.width-this._edgeInsets.right,a=new e.P(r,n),l=new e.P(o,n),c=new e.P(o,s),h=new e.P(r,s);let d=this.pointCoordinate(a,t),u=this.pointCoordinate(l,t);const f=this.pointCoordinate(c,i),p=this.pointCoordinate(h,i),m=(e,t)=>(t.y-e.y)/(t.x-e.x);return d.y>1&&u.y>=0?d=new e.ac((1-p.y)/m(p,d)+p.x,1):d.y<0&&u.y<=1&&(d=new e.ac(-p.y/m(p,d)+p.x,0)),u.y>1&&d.y>=0?u=new e.ac((1-f.y)/m(f,u)+f.x,1):u.y<0&&d.y<=1&&(u=new e.ac(-f.y/m(f,u)+f.x,0)),(new e.aG).extend(this.coordinateLocation(d)).extend(this.coordinateLocation(u)).extend(this.coordinateLocation(p)).extend(this.coordinateLocation(f))}_getBoundsRectangularTerrain(){const e=this.elevation;if(!e.visibleDemTiles.length||e.isUsingMockSource())return this._getBoundsRectangular(0,0);const t=e.visibleDemTiles.reduce((e,t)=>{if(t.dem){const i=t.dem.tree;e.min=Math.min(e.min,i.minimums[0]),e.max=Math.max(e.max,i.maximums[0])}return e},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(t.min*e.exaggeration(),t.max*e.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(e=!0){const t=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,i=this.height/2-t*(1-this._horizonShift);return e?Math.max(0,i):i}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-e.cG,this.maxLat=e.cG,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=e.aD(this.minLng)*this.tileSize,this.worldMaxX=e.aD(this.maxLng)*this.tileSize,this.worldMinY=e.aH(this.maxLat)*this.tileSize,this.worldMaxY=e.aH(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(e,t){return this.projection.createTileMatrix(this,t,e)}calculateDistanceTileData(t){const i=t.key,n=this._distanceTileDataCache;if(n[i])return n[i];const r=t.canonical,s=1/this.height,o=this.cameraWorldSize,a=o/this.zoomScale(r.z),l=(r.x+Math.pow(2,r.z)*t.wrap)*a,c=r.y*a,h=this.point;h.x*=o/this.worldSize,h.y*=o/this.worldSize;const d=this.angle,u=Math.sin(-d),f=-Math.cos(-d);return n[i]={bearing:[u,f],center:[(h.x-l)*s,(h.y-c)*s],scale:a/e.aj*s},n[i]}calculateFogTileMatrix(t){const i=t.key,n=this._fogTileMatrixCache;if(n[i])return n[i];const r=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,t);return e.az(r,this.worldToFogMatrix,r),n[i]=new Float32Array(r),n[i]}calculateProjMatrix(t,i=!1,n=!1){const r=t.key;let s;if(s=n?this._expandedProjMatrixCache:i?this._alignedProjMatrixCache:this._projMatrixCache,s[r])return s[r];const o=this.calculatePosMatrix(t,this.worldSize);let a;return a=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:n?this.expandedFarZProjMatrix:i?this.alignedProjMatrix:this.projMatrix,e.az(o,a,o),s[r]=new Float32Array(o),s[r]}calculatePixelsToTileUnitsMatrix(t){const i=t.tileID.key,n=this._pixelsToTileUnitsCache;if(n[i])return n[i];const r=e.cK(t,this);return n[i]=r,n[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){const t=1/this.worldSize,i=e.bn([],[t,t,t]);return e.az(i,i,this.globeMatrix),i}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const t=this._elevation;this._updateCameraState();const i=e.cb(1,this._center.lat)*this.worldSize,n=this._computeCameraPosition(i),r=this._camera.forward(),s=e.cb(1,this._center.lat);n[2]/=s,r[2]/=s,e.au(r,r);const o=t.raycast(n,r,t.exaggeration());if(o){const t=e.bE([],n,r,o),i=new e.ac(t[0],t[1],e.cb(t[2],e.aY(t[1]))),a=(i.z+e.ae([i.x-n[0],i.y-n[1],i.z-n[2]*s]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(a),this._centerAltitude=i.toAltitude(),this._center=this.coordinateLocation(i),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(t=!1){if(!this._elevation)return;const i=this._elevation,n=e.cb(1,this._center.lat)*this.worldSize,r=this._computeCameraPosition(n),s=i.getAtPointOrZero(new e.ac(...r)),o=this.pixelsPerMeter/this.worldSize*s,a=this._minimumHeightOverTerrain(),l=r[2]-o;if(l<=a)if(l<0||t){const t=this.locationCoordinate(this._center,this._centerAltitude),i=[r[0],r[1],t.z-r[2]],n=e.ae(i);i[2]-=(a-l)/this._pixelsPerMercatorPixel;const s=e.ae(i);if(0===s)return;e.c1(i,i,n/s*this._pixelsPerMercatorPixel),this._camera.position=[r[0],r[1],t.z*this._pixelsPerMercatorPixel-i[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||t){const i=this.center;return i.lat=e.ay(i.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!t)&&(i.lng=e.ay(i.lng,this.minLng,this.maxLng)),this.center=i,void(this._constraining=!1)}const i=this._unmodified,{x:n,y:r}=this.point;let s=0,o=n,a=r;const l=this.width/2,c=this.height/2,h=this.worldMinY*this.scale,d=this.worldMaxY*this.scale;if(r-c<h&&(a=h+c),r+c>d&&(a=d-c),d-h<this.height&&(s=Math.max(s,this.height/(d-h)),a=(d+h)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const e=this.worldMinX*this.scale,t=this.worldMaxX*this.scale,i=this.worldSize/2-(e+t)/2;o=(n+i+this.worldSize)%this.worldSize-i,o-l<e&&(o=e+l),o+l>t&&(o=t-l),t-e<this.width&&(s=Math.max(s,this.width/(t-e)),o=(t+e)/2)}o===n&&a===r||this._allowWorldUnderZoom||(this.center=this.unproject(new e.P(o,a))),s&&!this._allowWorldUnderZoom&&(this.zoom+=this.scaleZoom(s)),this._constrainCamera(),this._unmodified=i,this._constraining=!1}_minZoomForBounds(){let e=Math.max(0,this.scaleZoom(Math.max(0,this.height)/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(e=Math.max(e,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),e}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,i="globe"===this.projection.name,n=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=e.cb(1,this.center.lat)/e.cb(1,e.c$));const r=e.cL(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,r),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const s="meters"===this.projection.zAxisUnit?n:1,o=this._camera.getWorldToCamera(this.worldSize,s);let a;const l=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);if(l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,this.isOrthographic){let i=.5*this.height/Math.tan(this._fov/2)*1*Math.tan(.5*this._fov),n=i*this.aspect,r=-n,s=-i;n-=t.x,r-=t.x,i+=t.y,s+=t.y,a=this._camera.getCameraToClipOrthographic(r,n,s,i,this._nearZ,this._farZ),((t,i,n,r)=>{for(let s=0;s<16;s++)t[s]=e.ai(i[s],n[s],r)})(a,a,l,e.cZ(this.pitch>=sn?1:this.pitch/sn))}else a=l;const c=e.cM([],l,o);let h=e.cM([],a,o);if(this.projection.isReprojectedInTileSpace){const t=this.locationCoordinate(this.center),i=e.bx([]);e.bo(i,i,[t.x*this.worldSize,t.y*this.worldSize,0]),e.az(i,i,e.cN(this)),e.bo(i,i,[-t.x*this.worldSize,-t.y*this.worldSize,0]),e.az(h,h,i),e.az(c,c,i),this.inverseAdjustmentMatrix=e.cO(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=e.cP([],h,[this.worldSize,this.worldSize,this.worldSize/s,1]),this.projMatrix=h,this.invProjMatrix=e.bi(new Float64Array(16),this.projMatrix),i){const i=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);i[8]=2*-t.x/this.width,i[9]=2*t.y/this.height,this.expandedFarZProjMatrix=e.cM([],i,o)}else this.expandedFarZProjMatrix=this.projMatrix;const d=e.bi([],a);this.frustumCorners=e.cQ.fromInvProjectionMatrix(d,this.horizonLineFromTop(),this.height),this.cameraFrustum=e.cy.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!i);const u=new Float32Array(16);e.bx(u),e.cP(u,u,[1,-1,1]),e.cR(u,u,this._pitch),e.by(u,u,this.angle);const f=e.c9(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=e.bw(f);const p=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;f[8]=2*-t.x/this.width,f[9]=2*(t.y+p)/this.height,this.skyboxMatrix=e.az(u,f,u);const m=this.point,g=m.x,_=m.y,y=this.width%2/2,v=this.height%2/2,x=Math.cos(this.angle),b=Math.sin(this.angle),w=g-Math.round(g)+x*y+b*v,S=_-Math.round(_)+x*v+b*y,T=new Float64Array(h);if(e.bo(T,T,[w>.5?w-1:w,S>.5?S-1:S,0]),this.alignedProjMatrix=T,h=e.bz(),e.cP(h,h,[this.width/2,-this.height/2,1]),e.bo(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=e.bz(),e.cP(h,h,[1,-1,1]),e.bo(h,h,[-1,-1,0]),e.cP(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=e.az(new Float64Array(16),this.labelPlaneMatrix,c),this._calcFogMatrices(),this._distanceTileDataCache={},h=e.bi(new Float64Array(16),this.pixelMatrix),!h)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=h,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=e.cS(this);const t=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=e.ad(t,t,o),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=h;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,i=this.cameraPixelsPerMeter,n=this._camera.position,r=1/this.height/this._pixelsPerMercatorPixel,s=[t,t,i];e.c1(s,s,r),e.c1(n,n,-1),e.cT(n,n,s);const o=e.bz();e.bo(o,o,n),e.cP(o,o,s),this.mercatorFogMatrix=o,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,i,r)}_computeCameraPosition(e){const t=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,i=this._camera.forward(),n=this.point,r=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*t-e/this.worldSize*this._centerAltitude;return[n.x/this.worldSize-i[0]*r,n.y/this.worldSize-i[1]*r,e/this.worldSize*this._centerAltitude-i[2]*r]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(t){const i=this._maxCameraBoundsDistance()*Math.cos(this._pitch),n=this._camera.position[2],r=t[2];let s=1;this.projection.wrap&&(this.center=this.center.wrap()),r>0&&(s=Math.min((i-n)/r,1)),this._camera.position=e.bE([],this._camera.position,t,s),this._updateStateFromCamera()}_updateStateFromCamera(){const t=this._camera.position,i=this._camera.forward(),{pitch:n,bearing:r}=this._camera.getPitchBearing(),s=e.cb(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,o=this._mercatorZfromZoom(this._maxZoom)*Math.cos(e.al(this._maxPitch)),a=Math.max((t[2]-s)/Math.cos(n),o),l=this._zoomFromMercatorZ(a);e.bE(t,t,i,a),this._pitch=e.ay(n,e.al(this.minPitch),e.al(this.maxPitch)),this.angle=e.bQ(r,-Math.PI,Math.PI),this._setZoom(e.ay(l,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new e.ac(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(e){return Math.pow(2,e)*this.tileSize}_mercatorZfromZoom(e){return this.cameraToCenterDistance/this._worldSizeFromZoom(e)}_minimumHeightOverTerrain(){const e=Math.min(null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(e)}_zoomFromMercatorZ(e){return this.scaleZoom(this.cameraToCenterDistance/(Math.max(0,e)*this.tileSize))}zoomFromMercatorZAdjusted(t){let i=0,n=e.cI,r=0,s=1/0;for(;n-i>1e-6&&n>i;){const e=i+.5*(n-i),o=this.tileSize*Math.pow(2,e),a=this.getCameraToCenterDistance(this.projection,e,o),l=this.scaleZoom(a/(Math.max(0,t)*this.tileSize)),c=Math.abs(e-l);c<s&&(s=c,r=e),e<l?i=e:n=e}return r}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(e.w("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(t,i){const n=Math.min(t.x,i.x),r=Math.max(t.x,i.x),s=Math.min(t.y,i.y),o=Math.max(t.y,i.y);if(s<this.horizonLineFromTop(!1))return!0;if("mercator"!==this.projection.name)return!1;const a=[new e.P(n,s),new e.P(r,o),new e.P(n,o),new e.P(r,s)],l=this.renderWorldCopies?-3:0,c=this.renderWorldCopies?4:1;for(const e of a){const t=this.pointRayIntersection(e);if(t.t<0)return!0;const i=this.rayIntersectionCoordinate(t);if(i.x<l||i.y<0||i.x>c||i.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+e.cU(this.fovAboveCenter)>88||this.anyCornerOffEdge(new e.P(0,0),new e.P(this.width,this.height))}zoomDeltaToMovement(t,i){const n=e.ae(e.at([],this._camera.position,t)),r=this._zoomFromMercatorZ(n)+i;return n-this._mercatorZfromZoom(r)}getCameraPoint(){if("globe"===this.projection.name){const t=function([t,i,n],r){const s=[t,i,n,1];e.aA(s,s,r);const o=s[3]=Math.max(s[3],1e-6);return s[0]/=o,s[1]/=o,s[2]/=o,s}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new e.P(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}}getCameraToCenterDistance(t,i=this.zoom,n=this.worldSize){const r=e.cL(t,i,this.width,this.height,1024),s=t.pixelSpaceConversion(this.center.lat,n,r);let o=.5/Math.tan(.5*this._fov)*this.height*s;return this.isOrthographic&&(o=e.ai(1,o,e.cZ(this.pitch>=sn?1:this.pitch/sn))),o}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&e.az(t,t,this.globeMatrix),t}getFrustum(t){return e.cy.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,t,"meters"===this.projection.zAxisUnit)}}const an=(t,i)=>{if(i>0&&t.terrain&&e.w("Cutoff is currently disabled on terrain"),i<=0||t.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const n=t.transform,r=Math.max(Math.abs(n._zoom-(t.minCutoffZoom-1)),1),s=n.isLODDisabled(!1)?e.af(60,45,n.pitch):e.af(30,15,n.pitch),o=n._farZ-n._nearZ,a=i*n.height,l=((1-(c=s))*n.cameraToCenterDistance+c*(n._farZ+a))*r;var c;return{shouldRenderCutoff:s<1,uniformValues:{u_cutoff_params:[n._nearZ,n._farZ,(l-n._nearZ)/o,(l-a-n._nearZ)/o]}}},ln={cascadeCount:2,normalOffset:3,shadowMapResolution:2048};class cn{constructor(e,t){this.aabb=e,this.lastCascade=t}}class hn{add(e,t){const i=this.receivers[e.key];void 0!==i?(i.aabb.min[0]=Math.min(i.aabb.min[0],t.min[0]),i.aabb.min[1]=Math.min(i.aabb.min[1],t.min[1]),i.aabb.min[2]=Math.min(i.aabb.min[2],t.min[2]),i.aabb.max[0]=Math.max(i.aabb.max[0],t.max[0]),i.aabb.max[1]=Math.max(i.aabb.max[1],t.max[1]),i.aabb.max[2]=Math.max(i.aabb.max[2],t.max[2])):this.receivers[e.key]=new cn(t,null)}clear(){this.receivers={}}get(e){return this.receivers[e.key]}computeRequiredCascades(t,i,n){const r=e.d6.fromPoints(t.points);let s=0;for(const t in this.receivers){const o=this.receivers[t];if(!o)continue;if(!r.intersectsAabb(o.aabb))continue;o.aabb.min=r.closestPoint(o.aabb.min),o.aabb.max=r.closestPoint(o.aabb.max);const a=o.aabb.getCorners();for(let t=0;t<n.length;t++){let r=!0;for(const s of a){const o=[s[0]*i,s[1]*i,s[2]];if(e.ad(o,o,n[t].matrix),o[0]<-1||o[0]>1||o[1]<-1||o[1]>1){r=!1;break}}if(o.lastCascade=t,s=Math.max(s,t),r)break}}return s+1}}class dn{constructor(e){this.painter=e,this._enabled=!1,this._shadowLayerCount=0,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new hn,this._depthMode=new Yi(e.context.gl.LEQUAL,Yi.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this.useNormalOffset=!1,e.tp.registerParameter(this,["Shadows"],"_forceDisable",{label:"forceDisable"},()=>{this.painter.style.map.triggerRepaint()}),e.tp.registerParameter(ln,["Shadows"],"cascadeCount",{min:1,max:2,step:1}),e.tp.registerParameter(ln,["Shadows"],"normalOffset",{min:0,max:10,step:.05}),e.tp.registerParameter(ln,["Shadows"],"shadowMapResolution",{min:32,max:2048,step:32}),e.tp.registerBinding(this,["Shadows"],"_numCascadesToRender",{readonly:!0,label:"numCascadesToRender"})}destroy(){for(const e of this._cascades)e.texture.destroy(),e.framebuffer.destroy();this._cascades=[]}updateShadowParameters(t,i){const n=this.painter;if(this._enabled=!1,this._shadowLayerCount=0,this._receivers.clear(),!i||!i.properties)return;const r=i.properties.get("shadow-intensity");if(!i.shadowsEnabled()||r<=0)return;if(this._shadowLayerCount=n.style.order.reduce((e,i)=>{const r=n.style._mergedLayers[i];return e+(r.hasShadowPass()&&!r.isHidden(t.zoom)?1:0)},0),this._enabled=this._shadowLayerCount>0,!this.enabled)return;const s=n.context,o=ln.shadowMapResolution,a=ln.shadowMapResolution;if(0===this._cascades.length||ln.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let t=0;t<ln.cascadeCount;++t){const t=n._shadowMapDebug,i=s.gl,r=s.createFramebuffer(o,a,t,"texture"),l=new e.T(s,{width:o,height:a,data:null},i.DEPTH_COMPONENT16);if(r.depthAttachment.set(l.texture),t){const t=new e.T(s,{width:o,height:a,data:null},i.RGBA8);r.colorAttachment.set(t.texture)}this._cascades.push({framebuffer:r,texture:l,matrix:[],far:0,boundingSphereRadius:0,frustum:new e.cy,scale:0})}}this.shadowDirection=fn(i);let l=0;if(t.elevation){const e=t.elevation,i=[1e4,-1e4];e.visibleDemTiles.filter(e=>e.dem).forEach(e=>{const t=e.dem.tree;i[0]=Math.min(i[0],t.minimums[0]),i[1]=Math.max(i[1],t.maximums[0])}),1e4!==i[0]&&(l=(i[1]-i[0])*e.exaggeration())}const c=1.5*t.cameraToCenterDistance,h=3*c,d=new Float64Array(16);for(let i=0;i<this._cascades.length;++i){const n=this._cascades[i];let r=t.height/50,s=1;1===ln.cascadeCount?s=h:0===i?s=c:(r=c,s=h);const[o,a]=mn(t,this.shadowDirection,r,s,ln.shadowMapResolution,l);n.scale=t.scale,n.matrix=o,n.boundingSphereRadius=a,e.bi(d,n.matrix),n.frustum=e.cy.fromInvProjectionMatrix(d,1,0,!0),n.far=s}const u=this._cascades.length-1;this._uniformValues.u_fade_range=[.75*this._cascades[u].far,this._cascades[u].far],this._uniformValues.u_shadow_intensity=r,this._uniformValues.u_shadow_direction=[this.shadowDirection[0],this.shadowDirection[1],this.shadowDirection[2]],this._uniformValues.u_shadow_texel_size=1/ln.shadowMapResolution,this._uniformValues.u_shadow_map_resolution=ln.shadowMapResolution,this._uniformValues.u_shadowmap_0=nn,this._uniformValues.u_shadowmap_1=nn+1,this._groundShadowTiles=n.transform.coveringTiles({tileSize:512,renderWorldCopies:!0});const f=n.transform.elevation;for(const e of this._groundShadowTiles){let t={min:0,max:0};if(f){const i=f.getMinMaxForTile(e);i&&(t=i)}this.addShadowReceiver(e.toUnwrapped(),t.min,t.max)}}get enabled(){return this._enabled&&!this._forceDisable}set enabled(e){this._enabled=e}drawShadowPass(t,i){if(!this.enabled)return;const n=this.painter,r=n.context;this._numCascadesToRender=this._receivers.computeRequiredCascades(n.transform.getFrustum(0),n.transform.worldSize,this._cascades),r.viewport.set([0,0,ln.shadowMapResolution,ln.shadowMapResolution]);for(let s=0;s<this._numCascadesToRender;++s){n.currentShadowCascade=s,r.bindFramebuffer.set(this._cascades[s].framebuffer.framebuffer),r.clear({color:e.am.white,depth:1});for(const e of t.order){const r=t._mergedLayers[e];if(!r.hasShadowPass()||r.isHidden(n.transform.zoom))continue;const s=t.getLayerSourceCache(r),o=s?i[s.id]:void 0;("model"===r.type||o&&o.length)&&n.renderLayer(n,s,r,o)}}n.currentShadowCascade=0}drawGroundShadows(){if(!this.enabled)return;const e=this.painter,t=e.style,i=e.context,n=i.gl,r=t.directionalLight,s=t.ambientLight;if(!r||!s)return;const o=[],a=an(e,e.longestCutoffRange);a.shouldRenderCutoff&&o.push("RENDER_CUTOFF"),o.push("RENDER_SHADOWS","DEPTH_TEXTURE"),this.useNormalOffset&&o.push("NORMAL_OFFSET");const l=pn(t,r,s),c=new Yi(n.LEQUAL,Yi.ReadOnly,e.depthRangeFor3D),h=new Hi({func:n.EQUAL,mask:255},0,255,n.KEEP,n.KEEP,n.KEEP);for(const t of this._groundShadowTiles){const r=t.toUnwrapped(),s=e.isTileAffectedByFog(t),d=e.getOrCreateProgram("groundShadow",{defines:o,overrideFog:s});this.setupShadows(r,d),e.uploadCommonUniforms(i,d,r,null,a);const u={u_matrix:e.transform.calculateProjMatrix(r),u_ground_shadow_factor:l};d.draw(e,n.TRIANGLES,c,h,Ni.multiply,Wi.disabled,u,"ground_shadow",e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments,null,e.transform.zoom,null,null)}}getShadowPassColorMode(){return this.painter._shadowMapDebug?Ni.unblended:Ni.disabled}getShadowPassDepthMode(){return this._depthMode}getShadowCastingLayerCount(){return this._shadowLayerCount}calculateShadowPassMatrixFromTile(t){const i=this.painter.transform,n=i.calculatePosMatrix(t,i.worldSize);return e.az(n,this._cascades[this.painter.currentShadowCascade].matrix,n),Float32Array.from(n)}calculateShadowPassMatrixFromMatrix(t){return e.az(t,this._cascades[this.painter.currentShadowCascade].matrix,t),Float32Array.from(t)}setupShadows(t,i,n){if(!this.enabled)return;const r=this.painter.transform,s=this.painter.context,o=s.gl,a=this._uniformValues,l=new Float64Array(16),c=r.calculatePosMatrix(t,r.worldSize);for(let t=0;t<this._cascades.length;t++)e.az(l,this._cascades[t].matrix,c),a[0===t?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(l),s.activeTexture.set(o.TEXTURE0+nn+t),this._cascades[t].texture.bindExtraParam(o.LINEAR,o.LINEAR,o.CLAMP_TO_EDGE,o.CLAMP_TO_EDGE,o.GREATER);if(this.useNormalOffset=!!n,this.useNormalOffset){const i=e.d4(t.canonical),s=2/r.tileSize*e.aj/ln.shadowMapResolution,o=s*this._cascades[0].boundingSphereRadius,l=s*this._cascades[this._cascades.length-1].boundingSphereRadius,c=("vector-tile"===n?1:3)*function(t){const i=e.ay((t-22)/-22,0,1);return.125*(1-i)+4*i}(r.zoom);a.u_shadow_normal_offset=[i,o*c,l*c],a.u_shadow_bias=[1e-4,.0012,.012]}else a.u_shadow_bias=[36e-5,.0012,.012];i.setShadowUniformValues(s,a)}setupShadowsFromMatrix(t,i,n=!1){if(!this.enabled)return;const r=this.painter.context,s=r.gl,o=this._uniformValues,a=new Float64Array(16);for(let i=0;i<ln.cascadeCount;i++)e.az(a,this._cascades[i].matrix,t),o[0===i?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(a),r.activeTexture.set(s.TEXTURE0+nn+i),this._cascades[i].texture.bindExtraParam(s.LINEAR,s.LINEAR,s.CLAMP_TO_EDGE,s.CLAMP_TO_EDGE,s.GREATER);if(this.useNormalOffset=n,n){const e=ln.normalOffset;o.u_shadow_normal_offset=[1,e,e],o.u_shadow_bias=[6e-5,.0012,.012]}else o.u_shadow_bias=[36e-5,.0012,.012];i.setShadowUniformValues(r,o)}getShadowUniformValues(){return this._uniformValues}getCurrentCascadeFrustum(){return this._cascades[this.painter.currentShadowCascade].frustum}computeSimplifiedTileShadowVolume(t,i,n,r){if(r[2]>=0)return{};const s=function(t,i,n){const r=n/(1<<t.canonical.z);return new e.d6([t.canonical.x*r+t.wrap*n,t.canonical.y*r+t.wrap*n,0],[(t.canonical.x+1)*r+t.wrap*n,(t.canonical.y+1)*r+t.wrap*n,i])}(t,i,n).getCorners(),o=i/-r[2];r[0]<0?(e.d5(s[0],s[0],[r[0]*o,0,0]),e.d5(s[3],s[3],[r[0]*o,0,0])):r[0]>0&&(e.d5(s[1],s[1],[r[0]*o,0,0]),e.d5(s[2],s[2],[r[0]*o,0,0])),r[1]<0?(e.d5(s[0],s[0],[0,r[1]*o,0]),e.d5(s[1],s[1],[0,r[1]*o,0])):r[1]>0&&(e.d5(s[2],s[2],[0,r[1]*o,0]),e.d5(s[3],s[3],[0,r[1]*o,0]));const a={};return a.vertices=s,a.planes=[un(s[1],s[0],s[4]),un(s[2],s[1],s[5]),un(s[3],s[2],s[6]),un(s[0],s[3],s[7])],a}addShadowReceiver(t,i,n){this._receivers.add(t,e.d6.fromTileIdAndHeight(t,i,n))}getMaxCascadeForTile(e){const t=this._receivers.get(e);return t&&t.lastCascade?t.lastCascade:0}}function un(t,i,n){const r=e.at([],n,i),s=e.at([],t,i),o=e.bF([],r,s),a=e.ae(o);return 0===a?[0,0,1,0]:(e.c1(o,o,1/a),[o[0],o[1],o[2],-e.bG(o,i)])}function fn(t){const i=t.properties.get("direction"),n=e.d1(i.x,i.y,i.z);n[2]=e.ay(n[2],0,75);const r=e.d3([n[0],n[1],n[2]]);return e.d2(r.x,r.y,r.z)}function pn(t,i,n){const r="none"===i.properties.get("color-use-theme"),s=i.properties.get("color"),o=i.properties.get("intensity"),a=i.properties.get("direction"),l=[a.x,a.y,a.z],c="none"===n.properties.get("color-use-theme"),h=n.properties.get("color"),d=n.properties.get("intensity"),u=Math.max(e.bG([0,0,1],l),0),f=[0,0,0];e.c1(f,h.toPremultipliedRenderColor(c?null:t.getLut(i.scope)).toArray01Linear().slice(0,3),d);const p=[0,0,0];return e.c1(p,s.toPremultipliedRenderColor(r?null:t.getLut(n.scope)).toArray01Linear().slice(0,3),u*o),e.d8([f[0]>0?f[0]/(f[0]+p[0]):0,f[1]>0?f[1]/(f[1]+p[1]):0,f[2]>0?f[2]/(f[2]+p[2]):0])}function mn(t,i,n,r,s,o){const a=t.zoom,l=t.scale,c=t.worldSize,h=1/c,d=t.aspect,u=Math.sqrt(1+d*d)*Math.tan(.5*t.fovX),f=u*u,p=r-n,m=r+n;let g,_;f>p/m?(g=r,_=r*u):(g=.5*m*(1+f),_=.5*Math.sqrt(p*p+2*(r*r+n*n)*f+m*m*f*f));const y=t.projection.pixelsPerMeter(t.center.lat,c),v=t._camera.getCameraToWorldMercator(),x=[0,0,-g*h];e.ad(x,x,v);let b=_*h;const w=t._edgeInsets;if(!(0===w.left&&0===w.top&&0===w.right&&0===w.bottom||w.left===w.right&&w.top===w.bottom)){const i=t._camera.getWorldToCamera(t.worldSize,"meters"===t.projection.zAxisUnit?y:1),s=t._camera.getCameraToClipPerspective(t._fov,t.width/t.height,n,r);s[8]=2*-t.centerOffset.x/t.width,s[9]=2*t.centerOffset.y/t.height;const o=new Float64Array(16);e.cM(o,s,i);const h=new Float64Array(16);e.bi(h,o);const d=e.cy.fromInvProjectionMatrix(h,c,a,!0);for(const i of d.points){const n=((S=i)[0]/=l,S[1]/=l,S[2]=e.cb(S[2],t._center.lat),S);b=Math.max(b,e.c2(e.d7([],x,n)))}}var S;b*=s/(s-1);const T=Math.acos(i[2]),k=Math.atan2(-i[0],-i[1]),M=new qi;M.position=x,M.setPitchBearing(T,k);const A=M.getWorldToCamera(c,y),C=b*c,D=Math.min(t._mercatorZfromZoom(17)*c*-2,-2*C),L=M.getCameraToClipOrthographic(-C,C,-C,C,D,(C+o*y)/i[2]),E=new Float64Array(16);e.az(E,L,A);const I=e.d2(Math.floor(1e6*x[0])/1e6*c,Math.floor(1e6*x[1])/1e6*c,0),P=.5*s,R=[0,0,0];e.ad(R,I,E),e.c1(R,R,P);const O=[Math.floor(R[0]),Math.floor(R[1]),Math.floor(R[2])],z=[0,0,0];e.at(z,R,O),e.c1(z,z,-1/P);const F=new Float64Array(16);return e.bx(F),e.bo(F,F,z),e.az(E,F,E),[E,C]}class gn extends e.E{constructor(e){super(),this.requestManager=e,this.models={"":{}},this.modelUris={"":{}},this.modelByURL={},this.numModelsLoading={}}loadModel(t,i){return e.aS(this.requestManager.transformRequest(i,e.R.Model).url).then(i=>{if(!i)return;const n=e.aT(i),r=new e.aU(t,void 0,void 0,n);return r.computeBoundsAndApplyParent(),r}).catch(n=>{if(n&&404===n.status)return null;this.fire(new e.z(new Error(`Could not load model ${t} from ${i}: ${n.message}`)))})}load(t,i,n={forceReload:!1}){this.models[i]||(this.models[i]={});const r=Object.keys(t),s=[],o=[];for(const e of r){const r=t[e];this.hasURLBeenRequested(r)&&!n.forceReload||(this.modelByURL[r]={modelId:e,scope:i},s.push(this.loadModel(e,r)),o.push(e)),this.models[i][e]||(this.models[i][e]={model:null,numReferences:1})}this.numModelsLoading[i]=(this.numModelsLoading[i]||0)+o.length,Promise.allSettled(s).then(t=>{for(let e=0;e<t.length;e++){const{status:n}=t[e];if("rejected"===n)continue;const{value:r}=t[e];this.models[i][o[e]]||(this.models[i][o[e]]={model:null,numReferences:1}),this.models[i][o[e]].model=r}this.numModelsLoading[i]-=o.length,this.fire(new e.A("data",{dataType:"style"}))}).catch(t=>{this.fire(new e.z(new Error(`Could not load models: ${t.message}`)))})}isLoaded(){for(const e in this.numModelsLoading)if(this.numModelsLoading[e]>0)return!1;return!0}hasModel(e,t,i={exactIdMatch:!1}){return!!(i.exactIdMatch?this.getModel(e,t):this.getModelByURL(this.modelUris[t][e]))}getModel(e,t){return this.models[t]||(this.models[t]={}),this.models[t][e]?this.models[t][e].model:void 0}getModelByURL(e){if(!e)return null;const t=this.modelByURL[e];return t?this.models[t.scope][t.modelId].model:null}hasModelBeenAdded(e,t){return this.models[t]&&void 0!==this.models[t][e]}getModelURIs(e){return this.modelUris[e]||{}}addModel(e,t,i){this.models[i]||(this.models[i]={}),this.modelUris[i]||(this.modelUris[i]={});const n=this.requestManager.normalizeModelURL(t);if((this.hasModel(e,i,{exactIdMatch:!0})||this.hasModelBeenAdded(e,i))&&this.modelUris[i][e]===n)this.models[i][e].numReferences++;else if(this.hasURLBeenRequested(n)){const{scope:e,modelId:t}=this.modelByURL[n];this.models[e][t].numReferences++}else this.modelUris[i][e]=n,this.load({[e]:this.modelUris[i][e]},i)}addModelURLs(e,t){this.models[t]||(this.models[t]={}),this.modelUris[t]||(this.modelUris[t]={});const i=this.modelUris[t];for(const t in e)i[t]=this.requestManager.normalizeModelURL(e[t])}reloadModels(e){this.load(this.modelUris[e],e,{forceReload:!0})}addModelsFromBucket(t,i){this.models[i]||(this.models[i]={}),this.modelUris[i]||(this.modelUris[i]={});const n={};for(const r of t)this.hasModel(r,i,{exactIdMatch:!0})||this.hasURLBeenRequested(r)?this.models[i][r].numReferences++:this.modelUris[i][r]&&!this.hasURLBeenRequested(r)?n[r]=this.modelUris[i][r]:!this.hasURLBeenRequested(r)&&e.d9(r,!1)&&(this.modelUris[i][r]=this.requestManager.normalizeModelURL(r),n[r]=this.modelUris[i][r]);this.load(n,i)}hasURLBeenRequested(e){return void 0!==this.modelByURL[e]}removeModel(e,t,i=!1,n=!1){if(this.models[t]&&this.models[t][e]&&(this.models[t][e].numReferences--,0===this.models[t][e].numReferences||n)){const n=this.modelUris[t][e];i||delete this.modelUris[t][e],delete this.modelByURL[n];const r=this.models[t][e].model;if(!r)return;delete this.models[t][e],r.destroy()}}destroy(){for(const e of Object.keys(this.models))for(const t of Object.keys(this.models[e])){const i=this.models[e][t].model;delete this.models[e][t],i&&i.destroy()}this.models={"":{}},this.modelUris={"":{}},this.modelByURL={},this.numModelsLoading={}}listModels(e){return this.models[e]||(this.models[e]={}),Object.keys(this.models[e])}upload(e,t){this.models[t]||(this.models[t]={});for(const i in this.models[t])this.models[t][i].model&&this.models[t][i].model.upload(e.context)}}const _n=new e.a7({data:new e.a8(e.a5.colorTheme.data)});class yn{constructor(e){this._scope=e,this._buildingQueryParams={target:{featuresetId:"building-outline",importId:this._scope}},this._floorQueryParams={target:{featuresetId:"floor-outline",importId:this._scope}}}execute(e){const t=this._makeBuildingsQueryArea(e),i=this._makeFloorsQueryArea(e),n=e.queryRenderedFeatures(t,this._buildingQueryParams).filter(e=>"building"===e.properties.shape_type).reduce((e,t)=>{const i=t.properties.id;return"building"!==t.properties.shape_type||e.some(e=>e.properties.id===i)||e.push(t),e},[]),r=e.queryRenderedFeatures(i,this._floorQueryParams).filter(e=>"floor"===e.properties.shape_type).reduce((e,t)=>{const i=t.properties.id;return"floor"!==t.properties.shape_type||e.some(e=>e.properties.id===i)||e.push(t),e},[]),s=[e.getCenter().lng,e.getCenter().lat];return{floors:r,building:this._findBuildingAtCenter(s,n)||(n.length>0?n[0]:null)}}_makeBuildingsQueryArea(t){const i=t.transform.width,n=t.transform.height,r=Math.min(i,n),s=r*(1/8),o=r*(1/8),a=.5*(i-s),l=.5*(n-o);return[new e.P(a,l),new e.P(a+s,l+o)]}_makeFloorsQueryArea(t){const i=t.transform.width,n=t.transform.height,r=i*(2/3),s=n*(2/3),o=.5*(i-r),a=.5*(n-s);return[new e.P(o,a),new e.P(o+r,a+s)]}_findBuildingAtCenter(e,t){for(const i of t)if("Polygon"===i.geometry.type&&this._pointInPolygon(e,i.geometry.coordinates[0]))return i;return null}_pointInPolygon(e,t){let i=!1;for(let n=0,r=t.length-1;n<t.length;r=n++){const s=t[n][0],o=t[n][1],a=t[r][1];o>e[1]!=a>e[1]&&e[0]<(t[r][0]-s)*(e[1]-o)/(a-o)+s&&(i=!i)}return i}}class vn{constructor(){this._selectedFloorId=null,this._selectedBuildingId=null,this._floors=[]}setBuildingId(e){this._selectedBuildingId=e}setFloors(e){if(this._floors=e.filter(e=>e.properties.building_id===this._selectedBuildingId),!this._selectedFloorId||!this._floors.map(e=>e.properties.id).includes(this._selectedFloorId)){const e=this._floors.map(e=>({id:e.properties.id,level:e.properties.floor_level})).reduce((e,t)=>{const i=Math.abs(e.level-1),n=Math.abs(t.level-1);return n<i||n===i&&t.level>e.level?t:e});this._selectedFloorId=e.id}}setFloorId(e){this._selectedFloorId=e}getSelectedFloorId(){return this._selectedFloorId}getCurrentBuildingFloors(){return this._floors}reset(){this._selectedFloorId=null,this._selectedBuildingId=null,this._floors=[]}}const xn={"mbx-indoor-level-selected":{default:["literal",[]]}};function bn(e){return e=e||{},Object.assign(e,xn)}class wn extends e.E{constructor(t){super(),e.aV(["_onLoad","_onMove"],this),this._map=t,this._floorSelectionState=new vn,this._queryIndoor(),this._map.on("load",this._onLoad),this._map.on("move",this._onMove)}destroy(){this._map.indoor.off("load",this._onLoad),this._map.indoor.off("move",this._onMove),this._map=null,this._floorSelectionState=null}_onLoad(){this._map.style.forEachFragmentStyle(t=>{t.stylesheet.indoor&&(this._indoorDataQuery?this.fire(new e.z(new Error("Multiple indoor map styles detected, simultaneous usage is not allowed currently."))):(this._scope=t.scope,this._indoorDataQuery=new yn(this._scope)))}),this._map._addIndoorControl(),this._queryIndoor()}_onMove(){this._queryIndoor()}_queryIndoor(){if(!this._indoorDataQuery||!this._map.isStyleLoaded())return;if(this._map.transform.zoom<16)return void this._clearIndoorData();const e=this._indoorDataQuery.execute(this._map);e&&0!==e.floors.length?(this._floorSelectionState.getSelectedFloorId()||this._map._addIndoorControl(),this._selectFloors(e)):this._clearIndoorData()}_selectFloors(e){if(e.building)this._floorSelectionState.setBuildingId(e.building.properties.id),this._floorSelectionState.setFloors(e.floors),this._updateUI();else{const t=this._floorSelectionState.getSelectedFloorId();if(t&&e.floors.some(e=>e.properties.id===t))return;this._clearIndoorData()}}_clearIndoorData(){this._floorSelectionState.reset(),this._map._removeIndoorControl(),this._map.setConfigProperty(this._scope,"mbx-indoor-level-selected",["literal",[]])}_updateUI(){const t=this._floorSelectionState.getCurrentBuildingFloors().map(e=>({id:e.properties.id,name:e.properties.name,shortName:e.properties.floor_level,levelOrder:e.properties.floor_level})),i=this._floorSelectionState.getSelectedFloorId();i?(this._updateIndoorConfig(),this.fire(new e.A("indoorupdate",{selectedFloorId:i,floors:t}))):console.warn("IndoorManager: Selected floor is not set")}_updateIndoorConfig(){const e=this._floorSelectionState.getSelectedFloorId();e?this._map.setConfigProperty(this._scope,"mbx-indoor-level-selected",["literal",[e]]):console.warn("IndoorManager: Selected floor is not set")}selectFloor(e){this._floorSelectionState.setFloorId(e),this._updateIndoorConfig()}}function Sn(t){if(!t.metadata||!t.metadata.content_area)return;const i=e.q.devicePixelRatio,{left:n,top:r,width:s,height:o}=t.metadata.content_area,a=n*i,l=r*i;return[a,l,a+s*i,l+o*i]}function Tn(t){if(t)return t.map(([t,i])=>[t*e.q.devicePixelRatio,i*e.q.devicePixelRatio])}class kn{constructor(e,t,i){this.id=e,this.scope=t,this.sourceCache=i,this.pendingRequests=new Set,this.missingRequests=new Set}addPendingRequest(e){this.missingRequests.has(e.name)||this.pendingRequests.has(e.name)||this.pendingRequests.add(e.name)}hasPendingRequests(){return this.pendingRequests.size>0}resolvePendingRequests(){const t=new Map;if(!this.sourceCache.loaded())return t;const i=this.sourceCache.getVisibleCoordinates();if(0===i.length)return t;const n=this.sourceCache.getSource();if(!(n instanceof it))return t;const r=i.map(e=>this.sourceCache.getTile(e)),s=n.getImages(r,Array.from(this.pendingRequests));for(const[i,n]of s)t.set(e.I.from({name:i,iconsetId:this.id}),n),this.pendingRequests.delete(i);for(const e of this.pendingRequests)this.missingRequests.add(e);return this.pendingRequests.clear(),t}}const Mn=(e,t)=>Le(e,t&&t.filter(e=>"source.canvas"!==e.identifier)),An=e.aF(Et,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport","addIconset","removeIconset"]),Cn=e.aF(Et,["setCenter","setZoom","setBearing","setPitch"]),Dn=new Set(["background","sky","slot","custom"]),Ln={version:8,layers:[],sources:{}},En={duration:300,delay:0};class In extends e.E{constructor(t,i={}){super(),this.map=t,this.scope=i.scope||"",this.globalId=null,this.fragments=[],this.importDepth=i.importDepth||0,this.importsCache=i.importsCache||new Map,this.resolvedImports=i.resolvedImports||new Set,this.transition=e.h({},En),this._buildingIndex=new Ct(this),this.crossTileSymbolIndex=new zi,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._clipLayerPresent=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._changes=i.styleChanges||new j,this.dispatcher=i.dispatcher?i.dispatcher:new e.D(e.db(),this),i.imageManager?this.imageManager=i.imageManager:(this.imageManager=new W(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.addScope(this.scope),this.glyphManager=i.glyphManager?i.glyphManager:new e.dc(t._requestManager,i.localFontFamily?e.dd.all:i.localIdeographFontFamily?e.dd.ideographs:e.dd.none,i.localFontFamily||i.localIdeographFontFamily),i.modelManager?this.modelManager=i.modelManager:(this.modelManager=new gn(t._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._availableModels={},this._order=[],this._markersNeedUpdate=!1,this.options=i.configOptions?i.configOptions:new Map,this._configDependentLayers=i.configDependentLayers?i.configDependentLayers:new Set,this._config=i.config,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:i.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=i.initialConfig,this.dispatcher.broadcast("setReferrer",e.de());const n=this;this._rtlTextPluginCallback=In.registerForPluginStateChange(t=>{n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},(t,i)=>{if(e.df(t),i&&i.every(e=>e))for(const e in n._sourceCaches){const t=n._sourceCaches[e],i=t.getSource().type;"vector"!==i&&"geojson"!==i||t.reload()}})}),this.on("data",e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.getOwnSource(e.sourceId);if(t&&t.vectorLayerIds)for(const e in this._layers){const i=this._layers[e];i.source===t.id&&this._validateLayer(i)}})}load(e){return e?("string"==typeof e?this.loadURL(e):this.loadJSON(e),this):this}_getGlobalId(t){if(!t)return null;if("string"==typeof t){if(e.j(t))return t;const i=e.dg(t);if(!i.startsWith("http"))try{return new URL(i,location.href).toString()}catch(e){return i}return i}return`json://${e.dh(JSON.stringify(t))}`}_diffStyle(t,i,n){this.globalId=this._getGlobalId(t);const r=(e,t)=>{try{t(null,this.setState(e,n))}catch(e){t(e,!1)}};if("string"==typeof t){const n=this.map._requestManager.normalizeStyleURL(t),s=this.map._requestManager.transformRequest(n,e.R.Style);e.n(s,(t,n)=>{t?this.fire(new e.z(t)):n&&r(n,i)})}else"object"==typeof t&&r(t,i)}loadURL(t,i={}){this.fire(new e.A("dataloading",{dataType:"style"}));const n="boolean"==typeof i.validate?i.validate:!e.j(t);this.globalId=this._getGlobalId(t),t=this.map._requestManager.normalizeStyleURL(t,i.accessToken),this.resolvedImports.add(t);const r=this.importsCache.get(t);if(r)return this._load(r,n);const s=this.map._requestManager.transformRequest(t,e.R.Style);this._request=e.n(s,(i,r)=>{if(this._request=null,i)this.fire(new e.z(i));else if(r)return this.importsCache.set(t,r),this._load(r,n)})}loadJSON(t,i={}){this.fire(new e.A("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(t),this._request=e.q.frame(()=>{this._request=null,this._load(t,!1!==i.validate)})}loadEmpty(){this.fire(new e.A("dataloading",{dataType:"style"})),this._load(Ln,!1)}_loadImports(t,i,n){if(this.importDepth>=4)return e.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const r=[];for(const e of t){const t=this._createFragmentStyle(e),s=new Promise(e=>{t.once("style.import.load",e),t.once("error",e)}).then(()=>this.mergeAll());if(r.push(s),this.resolvedImports.has(e.url)){t.loadEmpty();continue}const o=e.data||this.importsCache.get(e.url);o?(t.loadJSON(o,{validate:i}),this._isInternalStyle(o)&&(t.globalId=null)):e.url?t.loadURL(e.url,{validate:i}):t.loadEmpty();const a={style:t,id:e.id,config:e.config};if(n){const e=this.fragments.findIndex(({id:e})=>e===n);this.fragments=this.fragments.slice(0,e).concat(a).concat(this.fragments.slice(e))}else this.fragments.push(a)}return Promise.allSettled(r)}getImportGlobalIds(e=this,t=new Set){for(const i of e.fragments)i.style.globalId&&t.add(i.style.globalId),this.getImportGlobalIds(i.style,t);return[...t.values()]}_createFragmentStyle(t){const i=this.scope?e.C(t.id,this.scope):t.id;let n;const r=this._initialConfig&&this._initialConfig[i];(t.config||r)&&(n=e.h({},t.config,r));const s=new In(this.map,{scope:i,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:n,configOptions:this.options,colorThemeOverride:t["color-theme"],configDependentLayers:this._configDependentLayers});return s.setEventedParent(this.map,{style:s}),s}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.updateConfigDependencies(),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),this._shouldPrecompile=this.map._precompilePrograms&&this.isRootStyle()}_isInternalStyle(e){return this.isRootStyle()&&(e.fragment||!!e.schema&&!1!==e.fragment)}_load(t,i){const n=t.indoor?bn(t.schema):t.schema;if(this._isInternalStyle(t)){const n=e.h({},Ln,{imports:[{id:"basemap",data:t,url:""}]});return void this._load(n,i)}if(this.updateConfig(this._config,n),i&&Mn(this,ge(t)))return;this._loaded=!0,this.stylesheet=e.di(t);const r=()=>{for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1,isInitialLoad:!0});if(t.iconsets)for(const e in t.iconsets)this.addIconset(e,t.iconsets[e]);t.sprite?this._loadIconset(t.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),!this.glyphManager.url&&t.glyphs&&this.glyphManager.setURL(t.glyphs);const n=Lt(this.stylesheet.layers);if(this._order=n.map(e=>e.id),this.stylesheet.light&&e.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){const e=this.stylesheet.lights[0];this.light=new Ie(e.properties,e.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new Ie(this.stylesheet.light)),this._layers={};for(const t of n){const i=e.dn(t,this.scope,this._styleColorTheme.lut,this.options);0!==i.configDependencies.size&&this._configDependentLayers.add(i.fqid),i.setEventedParent(this,{layer:{id:i.id}}),this._layers[i.id]=i;const n=this.getOwnLayerSourceCache(i),r=!!this.directionalLight&&this.directionalLight.shadowsEnabled();n&&i.canCastShadows()&&r&&(n.castsShadows=!0)}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.addModelURLs(this.stylesheet.models);const r=this.stylesheet.terrain;r&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(r,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.snow&&this._createSnow(this.stylesheet.snow),this.stylesheet.rain&&this._createRain(this.stylesheet.rain),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new e.A("data",{dataType:"style"}));const s=this.isRootStyle();t.imports?this._loadImports(t.imports,i).then(()=>{this._reloadImports(),this.fire(new e.A(s?"style.load":"style.import.load"))}).catch(t=>{this.fire(new e.z(new Error("Failed to load imports",t))),this.fire(new e.A(s?"style.load":"style.import.load"))}):(this._reloadImports(),this.fire(new e.A(s?"style.load":"style.import.load")))};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];const s=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(s){const t=this._evaluateColorThemeData(s);this._loadColorTheme(t).then(()=>{r()}).catch(t=>{e.w(`Couldn't load color theme from the stylesheet: ${t}`),r()})}else this._styleColorTheme.lut=null,r()}isRootStyle(){return 0===this.importDepth}mergeAll(){let t,i,n,r,s,o,a,l,c,h;const d={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(e=>{if(e.stylesheet){if(null!=e.light&&(t=e.light),e.stylesheet.lights)for(const t of e.stylesheet.lights)"ambient"===t.type&&null!=e.ambientLight&&(i=e.ambientLight),"directional"===t.type&&null!=e.directionalLight&&(n=e.directionalLight);r=this._prioritizeTerrain(r,e.terrain,e.stylesheet.terrain),e.stylesheet.fog&&null!=e.fog&&(s=e.fog),e.stylesheet.snow&&null!=e.snow&&(o=e.snow),e.stylesheet.rain&&null!=e.rain&&(a=e.rain),null!=e.stylesheet.camera&&(h=e.stylesheet.camera),null!=e.stylesheet.projection&&(l=e.stylesheet.projection),null!=e.stylesheet.transition&&(c=e.stylesheet.transition),d[e.scope]=e._styleColorTheme}}),this.light=t,this.ambientLight=i,this.directionalLight=n,this.fog=s,this.snow=o,this.rain=a,this._styleColorThemeForScope=d,null===r?delete this.terrain:this.terrain=r,this.camera=h||{"camera-projection":"perspective"},this.projection=l||{name:"mercator"},this.transition=e.h({},En,c),this.mergeSources(),this.mergeLayers()}forEachFragmentStyle(e){const t=i=>{for(const e of i.fragments)t(e.style);e(i)};t(this)}_prioritizeTerrain(e,t,i){const n=e&&0===e.drapeRenderMode;return null===i?t&&0===t.drapeRenderMode?t:n?e:null:null!=t&&(!e||n||t&&1===t.drapeRenderMode)?t:e}mergeTerrain(){let e;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(t=>{e=this._prioritizeTerrain(e,t.terrain,t.stylesheet.terrain)}),null===e?delete this.terrain:this.terrain=e}mergeProjection(){let e;this.forEachFragmentStyle(t=>{null!=t.stylesheet.projection&&(e=t.stylesheet.projection)}),this.projection=e||{name:"mercator"}}mergeSources(){const t={},i={},n={};this.forEachFragmentStyle(r=>{for(const i in r._sourceCaches){const n=e.C(i,r.scope);t[n]=r._sourceCaches[i]}for(const t in r._otherSourceCaches){const n=e.C(t,r.scope);i[n]=r._otherSourceCaches[t]}for(const t in r._symbolSourceCaches){const i=e.C(t,r.scope);n[i]=r._symbolSourceCaches[t]}}),this._mergedSourceCaches=t,this._mergedOtherSourceCaches=i,this._mergedSymbolSourceCaches=n}mergeLayers(){const t={},i=[],n={};this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle(n=>{for(const r of n._order){const s=n._layers[r];if("slot"===s.type){const i=e.dj(r);if(t[i])continue;t[i]=[]}s.slot&&t[s.slot]?t[s.slot].push(s):i.push(s)}}),this._mergedOrder=[];const r=(i=[])=>{for(const s of i)if("slot"===s.type){const i=e.dj(s.id);t[i]&&r(t[i]),this._mergedSlots.push(i)}else{const t=e.C(s.id,s.scope);this._mergedOrder.push(t),n[t]=s,s.is3D(!!this.terrain)&&(this._has3DLayers=!0),"circle"===s.type&&(this._hasCircleLayers=!0),"symbol"===s.type&&(this._hasSymbolLayers=!0),"clip"===s.type&&(this._clipLayerPresent=!0)}};r(i),this._mergedOrder.sort((e,t)=>{const i=n[e],r=n[t];return i.hasInitialOcclusionOpacityProperties?r.is3D(!!this.terrain)?1:0:i.is3D(!!this.terrain)&&r.hasInitialOcclusionOpacityProperties?-1:0}),this._mergedLayers=n,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged()}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(t){return this.stylesheet.camera=e.h({},this.stylesheet.camera,t),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(t){return t.data?function(t,i,n){const r=e.h({},i);for(const t of Object.keys(e.a5.colorTheme))void 0===r[t]&&(r[t]=e.a5.colorTheme[t].default);const s=new e.a6(_n,t,new Map(n));return s.setTransitionOrValue(r,n),s.untransitioned().possiblyEvaluate(new e.aa(0,{worldview:void 0}))}(this.scope,t,this.options).get("data"):null}_loadColorTheme(t){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const i=this._styleColorTheme.lutLoadingCorrelationID;return new Promise((n,r)=>{const s="data:image/png;base64,";if(!t||0===t.length)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void n();let o=t;o.startsWith(s)||(o=s+o);const a=e.I.from("mapbox-reserved-lut"),l=new Image;l.src=o,l.onerror=()=>{this._styleColorTheme.lutLoading=!1,r(new Error("Failed to load image data"))},l.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==i)return void n();this._styleColorTheme.lutLoading=!1;const{width:s,height:o,data:c}=e.q.getImageData(l);if(o>32)return void r(new Error("The height of the image must be less than or equal to 32 pixels."));if(s!==o*o)return void r(new Error("The width of the image must be equal to the height squared."));this.getImage(a)&&this.removeImage(a),this.addImage(a,{data:new e.r({width:s,height:o},c),pixelRatio:1,sdf:!1,usvg:!1,version:0});const h=this.imageManager.getImage(a,this.scope);h?(this._styleColorTheme.lut={image:h.data,data:t},n()):r(new Error("Missing LUT image."))}})}getLut(e){const t=this._styleColorThemeForScope[e];return t?t.lut:null}setProjection(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(t){this._spriteRequest=function(t,i,n){let r,s,o;const a=e.q.devicePixelRatio>1?"@2x":"";let l=e.n(i.transformRequest(i.normalizeSpriteURL(t,a,".json"),e.R.SpriteJSON),(e,t)=>{l=null,o||(o=e,r=t,h())}),c=e.o(i.transformRequest(i.normalizeSpriteURL(t,a,".png"),e.R.SpriteImage),(e,t)=>{c=null,o||(o=e,s=t,h())});function h(){if(o)n(o);else if(r&&s){const t=e.q.getImageData(s),i={};for(const n in r){const{width:s,height:o,x:a,y:l,sdf:c,pixelRatio:h,stretchX:d,stretchY:u,content:f}=r[n],p=new e.r({width:s,height:o});e.r.copy(t,p,{x:a,y:l},{x:0,y:0},{width:s,height:o},null),i[n]={data:p,pixelRatio:h,sdf:c,stretchX:d,stretchY:u,content:f,usvg:!1}}n(null,i)}}return{cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,(t,i)=>{if(this._spriteRequest=null,t)this.fire(new e.z(t));else if(i){const t=new Map;for(const n in i)t.set(e.I.from(n),i[n]);this.addImages(t)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new e.A("data",{dataType:"style"}))})}addIconset(t,i){if("sprite"===i.type)return void this._loadSprite(i.url);const n=this.getOwnSourceCache(i.source);if(!n)return void this.fire(new e.z(new Error(`Source "${i.source}" as specified by iconset "${t}" does not exist and cannot be used as an iconset source`)));const r=n.getSource();if("raster-array"!==r.type)return void this.fire(new e.z(new Error(`Source "${i.source}" as specified by iconset "${t}" is not a "raster-array" source and cannot be used as an iconset source`)));r.partial=!1;const s=new kn(t,this.scope,n);this.imageManager.addImageProvider(s,this.scope)}removeIconset(e){this.imageManager.removeImageProvider(e,this.scope)}_loadIconset(t){if(!e.j(t)&&"icon_set"!==this.map._spriteFormat||"raster"===this.map._spriteFormat)return void this._loadSprite(t);const i="auto"===this.map._spriteFormat;var n,r;this._spriteRequest=(r=(n,r)=>{if(this._spriteRequest=null,n)i?this._loadSprite(t):this.fire(new e.z(n));else if(r){const t=new Map;for(const i in r)t.set(e.I.from(i),r[i]);this.addImages(t)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new e.A("data",{dataType:"style"}))},e.br((n=this.map._requestManager).transformRequest(n.normalizeIconsetURL(t),e.R.Iconset),(t,i)=>{if(t)return void r(t);const n={},s=e.da(new e.bq(i));for(const t of s.icons){const i={version:1,pixelRatio:e.q.devicePixelRatio,content:Sn(t),stretchX:t.metadata?Tn(t.metadata.stretch_x_areas):void 0,stretchY:t.metadata?Tn(t.metadata.stretch_y_areas):void 0,sdf:!1,usvg:!0,icon:t};n[t.name]=i}r(null,n)}))}_validateLayer(t){const i=this.getOwnSource(t.source);if(!i)return;const n=t.sourceLayer;n&&("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new e.z(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return!1;if(!this.imageManager.isLoaded())return!1;if(this.imageManager.hasPatternsInFlight())return!1;if(!this.modelManager.isLoaded())return!1;if(this._styleColorTheme.lutLoading)return!1;for(const{style:e}of this.fragments)if(!e.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map((e,t)=>{const i=this.fragments[t];return i&&i.style&&(e.data=i.style.serialize()),e})}_serializeSources(){const e={};for(const t in this._sourceCaches){const i=this._sourceCaches[t].getSource();e[i.id]||(e[i.id]=i.serialize())}return e}_serializeLayers(e){const t=[];for(const i of e){const e=this._layers[i];e&&"custom"!==e.type&&t.push(e.serialize())}return t}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasSnowTransition(){return!!this.snow&&this.snow.hasTransition()}hasRainTransition(){return!!this.rain&&this.rain.hasTransition()}hasTransitions(){if(this.hasLightTransitions())return!0;if(this.hasFogTransition())return!0;if(this.hasSnowTransition())return!0;if(this.hasRainTransition())return!0;for(const e in this._sourceCaches)if(this._sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(e){return e?this.order:this._mergedOrder}isLayerDraped(e){return!!this.terrain&&e.isDraped(this.getLayerSourceCache(e))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(t){const i=this.getOwnLayer(t);if(i)return i;this.fire(new e.z(new Error(`The layer '${t}' does not exist in the map's style.`)))}_checkSource(t){const i=this.getOwnSource(t);if(i)return i;this.fire(new e.z(new Error(`The source '${t}' does not exist in the map's style.`)))}precompilePrograms(e,t){const i=this.map.painter;if(i)for(let n=e.minzoom||0;n<(e.maxzoom||25.5);n++){const n=e.getProgramIds();if(n)for(const r of n){const n=e.getDefaultProgramParams(r,t.zoom,this._styleColorTheme.lut);n&&(i.style=this,this.fog&&(i._fogVisible=!0,n.overrideFog=!0,i.getOrCreateProgram(r,n)),i._fogVisible=!1,n.overrideFog=!1,i.getOrCreateProgram(r,n),(this.stylesheet.terrain||this.stylesheet.projection&&"globe"===this.stylesheet.projection.name)&&(n.overrideRtt=!0,i.getOrCreateProgram(r,n)))}}}update(t){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(t),this.directionalLight&&this.directionalLight.recalculate(t);const i=this.calculateLightsBrightness();t.brightness=i||0,i!==this._brightness&&(this._brightness=i,this.dispatcher.broadcast("setBrightness",i)),t.worldview!==this._worldview&&(this._worldview=t.worldview,this.dispatcher.broadcast("setWorldview",this._worldview));const n=this._changes.isDirty();let r=!1;if(this._changes.isDirty()){const e=this._changes.getLayerUpdatesByScope();for(const t in e){const{updatedIds:i,removedIds:n}=e[t];(i||n)&&(this._updateWorkerLayers(t,i,n),r=!0)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(t),this.light&&this.light.updateTransitions(t),this.ambientLight&&this.ambientLight.updateTransitions(t),this.directionalLight&&this.directionalLight.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this.snow&&this.snow.updateTransitions(t),this.rain&&this.rain.updateTransitions(t),this._changes.reset()}const s={};for(const e in this._mergedSourceCaches){const t=this._mergedSourceCaches[e];s[e]=t.used,t.used=!1,t.tileCoverLift=0}for(const e of this._mergedOrder){const i=this._mergedLayers[e];if(i.recalculate(t,this._availableImages),!i.isHidden(t.zoom)){const e=this.getLayerSourceCache(i);e&&(e.used=!0,e.tileCoverLift=Math.max(e.tileCoverLift,i.tileCoverLift()))}!this._precompileDone&&this._shouldPrecompile&&("requestIdleCallback"in window?requestIdleCallback(()=>{this.precompilePrograms(i,t)}):this.precompilePrograms(i,t))}this._shouldPrecompile&&(this._precompileDone=!0),this.terrain&&r&&this.mergeLayers();const o=this.imageManager.getPendingImageProviders();for(const e of o)e.sourceCache.used=!0;for(const t in s){const i=this._mergedSourceCaches[t];s[t]!==i.used&&i.getSource().fire(new e.A("data",{sourceDataType:"visibility",dataType:"source",sourceId:i.getSource().id}))}this.light&&this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.snow&&this.snow.recalculate(t),this.rain&&this.rain.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),this.imageManager.clearUpdatedImages(this.scope),n&&this.fire(new e.A("data",{dataType:"style"}))}updateImageProviders(){const e=this.imageManager.getPendingImageProviders();for(const t of e){const e=t.resolvePendingRequests(),i=this.getFragmentStyle(t.scope);i&&i.addImages(e)}}_updateTilesForChangedImages(){const e={};for(const t in this._mergedSourceCaches){const i=this._mergedSourceCaches[t].getSource().scope;e[i]=e[i]||this._changes.getUpdatedImages(i),0!==e[i].length&&this._mergedSourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e[i])}for(const t in e)this._changes.resetUpdatedImages(t)}_updateWorkerLayers(e,t,i){const n=this.getFragmentStyle(e);n&&this.dispatcher.broadcast("updateLayers",{layers:t?n._serializeLayers(t):[],scope:e,removedIds:i||[],options:n.options})}setState(t,i){if(this._checkLoaded(),Mn(this,ge(t)))return!1;(t=e.di(t)).layers=Lt(t.layers);const n=function(t,i){if(!t)return[{command:Et.setStyle,args:[i]}];let n=[];try{if(!e.bv(t.version,i.version))return[{command:Et.setStyle,args:[i]}];if(e.bv(t.center,i.center)||n.push({command:Et.setCenter,args:[i.center]}),e.bv(t.zoom,i.zoom)||n.push({command:Et.setZoom,args:[i.zoom]}),e.bv(t.bearing,i.bearing)||n.push({command:Et.setBearing,args:[i.bearing]}),e.bv(t.pitch,i.pitch)||n.push({command:Et.setPitch,args:[i.pitch]}),e.bv(t.sprite,i.sprite)||n.push({command:Et.setSprite,args:[i.sprite]}),e.bv(t.glyphs,i.glyphs)||n.push({command:Et.setGlyphs,args:[i.glyphs]}),e.bv(t.imports,i.imports)||function(t=[],i=[],n){i=i||[];const r=(t=t||[]).map(Ft),s=i.map(Ft),o=t.reduce(Nt,{}),a=i.reduce(Nt,{}),l=r.slice();let c,h,d,u;for(c=0,h=0;c<r.length;c++)d=r[c],a.hasOwnProperty(d)?h++:(n.push({command:Et.removeImport,args:[d]}),l.splice(l.indexOf(d,h),1));for(c=0,h=0;c<s.length;c++)d=s[s.length-1-c],l[l.length-1-c]!==d&&(o.hasOwnProperty(d)?(n.push({command:Et.removeImport,args:[d]}),l.splice(l.lastIndexOf(d,l.length-h),1)):h++,u=l[l.length-c],n.push({command:Et.addImport,args:[a[d],u]}),l.splice(l.length-c,0,d));for(const t of i){const i=o[t.id];i&&(delete i.data,e.bv(i,t)||n.push({command:Et.updateImport,args:[t.id,t]}))}}(t.imports,i.imports,n),e.bv(t.transition,i.transition)||n.push({command:Et.setTransition,args:[i.transition]}),e.bv(t.light,i.light)||n.push({command:Et.setLight,args:[i.light]}),e.bv(t.fog,i.fog)||n.push({command:Et.setFog,args:[i.fog]}),e.bv(t.snow,i.snow)||n.push({command:Et.setSnow,args:[i.snow]}),e.bv(t.rain,i.rain)||n.push({command:Et.setRain,args:[i.rain]}),e.bv(t.projection,i.projection)||n.push({command:Et.setProjection,args:[i.projection]}),e.bv(t.lights,i.lights)||n.push({command:Et.setLights,args:[i.lights]}),e.bv(t.camera,i.camera)||n.push({command:Et.setCamera,args:[i.camera]}),e.bv(t.iconsets,i.iconsets)||function(t,i,n){let r;for(r in i=i||{},t=t||{})t.hasOwnProperty(r)&&(i.hasOwnProperty(r)||n.push({command:Et.removeIconset,args:[r]}));for(r in i){if(!i.hasOwnProperty(r))continue;const s=i[r];t.hasOwnProperty(r)?e.bv(t[r],s)||(n.push({command:Et.removeIconset,args:[r]}),n.push({command:Et.addIconset,args:[r,s]})):n.push({command:Et.addIconset,args:[r,s]})}}(t.iconsets,i.iconsets,n),!e.bv(t["color-theme"],i["color-theme"]))return[{command:Et.setStyle,args:[i]}];const r={},s=[];!function(t,i,n,r){let s;for(s in i=i||{},t=t||{})t.hasOwnProperty(s)&&(i.hasOwnProperty(s)||Pt(s,n,r));for(s in i){if(!i.hasOwnProperty(s))continue;const o=i[s];t.hasOwnProperty(s)?e.bv(t[s],o)||("geojson"===t[s].type&&"geojson"===o.type&&Ot(t,i,s)?n.push({command:Et.setGeoJSONSourceData,args:[s,o.data]}):Rt(s,i,n,r)):It(s,i,n)}}(t.sources,i.sources,s,r);const o=[];t.layers&&t.layers.forEach(e=>{e.source&&r[e.source]?n.push({command:Et.removeLayer,args:[e.id]}):o.push(e)});let a=t.terrain;a&&r[a.source]&&(n.push({command:Et.setTerrain,args:[void 0]}),a=void 0),n=n.concat(s),e.bv(a,i.terrain)||n.push({command:Et.setTerrain,args:[i.terrain]}),function(t,i,n){i=i||[];const r=(t=t||[]).map(Ft),s=i.map(Ft),o=t.reduce(Nt,{}),a=i.reduce(Nt,{}),l=r.slice(),c=Object.create(null);let h,d,u,f,p,m,g;for(h=0,d=0;h<r.length;h++)u=r[h],a.hasOwnProperty(u)?d++:(n.push({command:Et.removeLayer,args:[u]}),l.splice(l.indexOf(u,d),1));for(h=0,d=0;h<s.length;h++)u=s[s.length-1-h],l[l.length-1-h]!==u&&(o.hasOwnProperty(u)?(n.push({command:Et.removeLayer,args:[u]}),l.splice(l.lastIndexOf(u,l.length-d),1)):d++,m=l[l.length-h],n.push({command:Et.addLayer,args:[a[u],m]}),l.splice(l.length-h,0,u),c[u]=!0);for(h=0;h<s.length;h++)if(u=s[h],f=o[u],p=a[u],!c[u]&&!e.bv(f,p))if(e.bv(f.source,p.source)&&e.bv(f["source-layer"],p["source-layer"])&&e.bv(f.type,p.type)){for(g in zt(f.layout,p.layout,n,u,null,Et.setLayoutProperty),zt(f.paint,p.paint,n,u,null,Et.setPaintProperty),e.bv(f.slot,p.slot)||n.push({command:Et.setSlot,args:[u,p.slot]}),e.bv(f.filter,p.filter)||n.push({command:Et.setFilter,args:[u,p.filter]}),e.bv(f.minzoom,p.minzoom)&&e.bv(f.maxzoom,p.maxzoom)||n.push({command:Et.setLayerZoomRange,args:[u,p.minzoom,p.maxzoom]}),f)f.hasOwnProperty(g)&&"layout"!==g&&"paint"!==g&&"filter"!==g&&"metadata"!==g&&"minzoom"!==g&&"maxzoom"!==g&&"slot"!==g&&(0===g.indexOf("paint.")?zt(f[g],p[g],n,u,g.slice(6),Et.setPaintProperty):e.bv(f[g],p[g])||n.push({command:Et.setLayerProperty,args:[u,g,p[g]]}));for(g in p)p.hasOwnProperty(g)&&!f.hasOwnProperty(g)&&"layout"!==g&&"paint"!==g&&"filter"!==g&&"metadata"!==g&&"minzoom"!==g&&"maxzoom"!==g&&"slot"!==g&&(0===g.indexOf("paint.")?zt(f[g],p[g],n,u,g.slice(6),Et.setPaintProperty):e.bv(f[g],p[g])||n.push({command:Et.setLayerProperty,args:[u,g,p[g]]}))}else n.push({command:Et.removeLayer,args:[u]}),m=l[l.lastIndexOf(u)+1],n.push({command:Et.addLayer,args:[p,m]})}(o,i.layers,n)}catch(e){console.warn("Unable to compute style diff:",e),n=[{command:Et.setStyle,args:[i]}]}return n}(this.serialize(),t).filter(e=>!(e.command in Cn));if(0===n.length)return!1;const r=n.filter(e=>!(e.command in An));if(r.length>0)throw new Error(`Unimplemented: ${r.map(e=>e.command).join(", ")}.`);const s=[];return n.forEach(e=>{s.push(this[e.command](...e.args))}),i&&Promise.all(s).then(i).catch(i),this.stylesheet=t,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}_updateWorkerImages(){this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages})}_updateWorkerModels(){this._availableModels=this.modelManager.getModelURIs(this.scope),this.dispatcher.broadcast("setModels",{scope:this.scope,models:this._availableModels})}addImages(t){if(0===t.size)return this;for(const[i,n]of t.entries()){if(this.getImage(i))return this.fire(new e.z(new Error(`An image with the name "${i.name}" already exists.`)));this.imageManager.addImage(i,this.scope,n),this._changes.updateImage(i,this.scope)}return this._updateWorkerImages(),this.fire(new e.A("data",{dataType:"style"})),this}addImage(t,i){return this.getImage(t)?this.fire(new e.z(new Error(`An image with the name "${t.name}" already exists.`))):(this.imageManager.addImage(t,this.scope,i),this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.A("data",{dataType:"style"})),this)}updateImage(t,i,n=!1){this.imageManager.updateImage(t,this.scope,i),n&&(this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.A("data",{dataType:"style"})))}getImage(e){return this.imageManager.getImage(e,this.scope)}removeImage(t){return this.getImage(t)?(this.imageManager.removeImage(t,this.scope),this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.A("data",{dataType:"style"})),this):this.fire(new e.z(new Error("No image with this name exists.")))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addModelURLs(t){return this.modelManager.addModelURLs(t,this.scope),this._updateWorkerModels(),this.fire(new e.A("data",{dataType:"style"})),this}addModel(t,i,n={}){return this._checkLoaded(),this._validate(Ce,`models.${t}`,i,null,n)||(this.modelManager.addModel(t,i,this.scope),this.fire(new e.A("data",{dataType:"style"}))),this}hasModel(e){return this.modelManager.hasModel(e,this.scope)}removeModel(t){return this.hasModel(t)?(this.modelManager.removeModel(t,this.scope,!1,!0),this.fire(new e.A("data",{dataType:"style"})),this):this.fire(new e.z(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.scope)}addSource(t,i,n={}){if(this._checkLoaded(),void 0!==this.getOwnSource(t))throw new Error(`There is already a source with ID "${t}".`);if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(_e,`sources.${t}`,i,null,n))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const r=rt(t,i,this.dispatcher,this);r.scope=this.scope,r.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(r.id),source:r.serialize(),sourceId:r.id}));const s=t=>{const i=(t?"symbol:":"other:")+r.id,n=e.C(i,this.scope),s=this._sourceCaches[i]=new Tt(n,r,t);(t?this._symbolSourceCaches:this._otherSourceCaches)[r.id]=s,s.onAdd(this.map)};s(!1),"vector"!==i.type&&"geojson"!==i.type||s(!0),r.onAdd&&r.onAdd(this.map),n.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(t){this._checkLoaded();const i=this.getOwnSource(t);if(!i)throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===t)return this.fire(new e.z(new Error(`Source "${t}" cannot be removed while layer "${i}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===t)return this.fire(new e.z(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));if(this.stylesheet.iconsets){const i=Object.entries(this.stylesheet.iconsets).find(([e,i])=>"source"===i.type&&i.source===t);if(i)return this.fire(new e.z(new Error(`Source "${t}" cannot be removed while iconset "${i[0]}" is using it.`)))}const n=this.getOwnSourceCaches(t);for(const t of n){const i=e.dj(t.id);delete this._sourceCaches[i],this._changes.discardSourceCacheUpdate(t.id),t.fire(new e.A("data",{sourceDataType:"metadata",dataType:"source",sourceId:t.getSource().id})),t.setEventedParent(null),t.clearTiles()}return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],this.mergeSources(),i.setEventedParent(null),i.onRemove&&i.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(e,t){this._checkLoaded(),this.getOwnSource(e).setData(t),this._changes.setDirty()}getOwnSource(e){const t=this.getOwnSourceCache(e);return t&&t.getSource()}getOwnSources(){const e=[];for(const t in this._otherSourceCaches){const i=this.getOwnSourceCache(t);i&&e.push(i.getSource())}return e}areTilesLoaded(){const e=this._mergedSourceCaches;for(const t in e){const i=e[t]._tiles;for(const e in i){const t=i[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}setLights(t){if(this._checkLoaded(),!t)return delete this.ambientLight,void delete this.directionalLight;const i=this._getTransitionParameters();for(const n of t){if(this._validate(ve,"lights",n))return;switch(n.type){case"ambient":if(this.ambientLight){const e=this.ambientLight;e.set(n),e.updateTransitions(i)}else this.ambientLight=new $e(n,je||(je=new e.a7({color:new e.a8(e.a5.properties_light_ambient.color),"color-use-theme":new e.a8({type:"string",default:"default","property-type":"data-constant"}),intensity:new e.a8(e.a5.properties_light_ambient.intensity)})),this.scope,this.options);break;case"directional":if(this.directionalLight){const e=this.directionalLight;e.set(n),e.updateTransitions(i)}else this.directionalLight=new $e(n,Ve||(Ve=new e.a7({direction:new e.an(e.a5.properties_light_directional.direction),color:new e.a8(e.a5.properties_light_directional.color),"color-use-theme":new e.a8({type:"string",default:"default","property-type":"data-constant"}),intensity:new e.a8(e.a5.properties_light_directional.intensity),"cast-shadows":new e.a8(e.a5.properties_light_directional["cast-shadows"]),"shadow-quality":new e.a8(e.a5.properties_light_directional["shadow-quality"]),"shadow-intensity":new e.a8(e.a5.properties_light_directional["shadow-intensity"])})),this.scope,this.options)}}const n=Object.assign(i,{worldview:this.map.getWorldview()}),r=new e.aa(this.z||0,n);this.ambientLight&&this.ambientLight.recalculate(r),this.directionalLight&&this.directionalLight.recalculate(r),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){const t=this.directionalLight,i=this.ambientLight;if(!t||!i)return;const n=e=>.2126*(e[0]<=.03928?e[0]/12.92:Math.pow((e[0]+.055)/1.055,2.4))+.7152*(e[1]<=.03928?e[1]/12.92:Math.pow((e[1]+.055)/1.055,2.4))+.0722*(e[2]<=.03928?e[2]/12.92:Math.pow((e[2]+.055)/1.055,2.4)),r=t.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),s=t.properties.get("intensity"),o=t.properties.get("direction"),a=1-e.d1(o.x,o.y,o.z)[2]/90,l=n(r)*s*a,c=i.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),h=i.properties.get("intensity"),d=n(c)*h;return Number(((l+d)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const e=[];return this.directionalLight&&e.push(this.directionalLight.get()),this.ambientLight&&e.push(this.ambientLight.get()),e}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(t){if(null==t||""===t&&this.isRootStyle())return this;if(e.dk(t)){const i=e.dl(t),n=this.fragments.find(({id:e})=>e===i);if(!n)return;const r=e.dj(t);return n.style.getFragmentStyle(r)}{const e=this.fragments.find(({id:e})=>e===t);return e?e.style:void 0}}setFeaturesetSelectors(t){if(!t)return;const i={},n=(e,t="")=>`${e}::${t}`;this._featuresetSelectors={};for(const r in t){const s=this._featuresetSelectors[r]=[];for(const o of t[r].selectors){if(o.featureNamespace){const t=this.getOwnLayer(o.layer);if(!t){e.w(`Layer is undefined for selector: ${o.layer}`);continue}const s=n(t.source,t.sourceLayer);if(s in i&&i[s]!==o.featureNamespace){e.w(`"featureNamespace ${o.featureNamespace} of featureset ${r}'s selector is not associated to the same source, skip this selector`);continue}i[s]=o.featureNamespace}let t;if(o.properties)for(const i in o.properties){const n=e.X(o.properties[i]);"success"===n.result&&(t=t||{},t[i]=n.value)}s.push({layerId:o.layer,namespace:o.featureNamespace,properties:t,uniqueFeatureID:o._uniqueFeatureID})}}}getFeaturesetDescriptors(e){const t=this.getFragmentStyle(e);if(!t||!t.stylesheet.featuresets)return[];const i=[];for(const e in t.stylesheet.featuresets)i.push({featuresetId:e,importId:t.scope?t.scope:void 0});return i}getFeaturesetLayers(t,i){const n=this.getFragmentStyle(i),r=n.stylesheet.featuresets;if(!r||!r[t])return this.fire(new e.z(new Error(`The featureset '${t}' does not exist in the map's style and cannot be queried.`))),[];const s=[];for(const e of r[t].selectors){const t=n.getOwnLayer(e.layer);t&&s.push(t)}return s}getConfigProperty(t,i){const n=this.getFragmentStyle(t);if(!n)return null;const r=e.C(i,n.scope),s=n.options.get(r),o=s?s.value||s.default:null;return o?o.serialize():null}setConfigProperty(t,i,n){const r=this.getFragmentStyle(t);if(!r)return;const s=r.stylesheet.indoor?bn(r.stylesheet.schema):r.stylesheet.schema;if(!s||!s[i])return;const o=e.X(n);if("success"!==o.result)return void Mn(this,o.value);const a=o.value.expression,l=e.C(i,r.scope),c=r.options.get(l);if(!c)return;let h;const{minValue:d,maxValue:u,stepValue:f,type:p,values:m}=s[i],g=e.X(s[i].default);"success"===g.result&&(h=g.value.expression),h?(this.options.set(l,Object.assign({},c,{value:a,default:h,minValue:d,maxValue:u,stepValue:f,type:p,values:m})),this.updateConfigDependencies(i)):this.fire(new e.z(new Error(`No schema defined for the config option "${i}" in the "${t}" fragment.`)))}getConfig(t){const i=this.getFragmentStyle(t);if(!i)return null;const n=i.stylesheet.schema;if(!n)return null;const r={};for(const t in n){const n=e.C(t,i.scope),s=i.options.get(n),o=s?s.value||s.default:null;r[t]=o?o.serialize():null}return r}setConfig(e,t){const i=this.getFragmentStyle(e);i&&(i.updateConfig(t,i.stylesheet.schema),this.updateConfigDependencies())}getSchema(e){const t=this.getFragmentStyle(e);return t?t.stylesheet.schema:null}setSchema(e,t){const i=this.getFragmentStyle(e);i&&(i.stylesheet.schema=t,i.updateConfig(i._config,t),this.updateConfigDependencies())}updateConfig(t,i){if(this._config=t,t||i)if(i)for(const n in i){let r,s;const o=e.X(i[n].default);if("success"===o.result&&(r=o.value.expression),t&&void 0!==t[n]){const i=e.X(t[n]);"success"===i.result&&(s=i.value.expression)}const{minValue:a,maxValue:l,stepValue:c,type:h,values:d}=i[n];if(r){const t=e.C(n,this.scope);this.options.set(t,{default:r,value:s,minValue:a,maxValue:l,stepValue:c,type:h,values:d})}else this.fire(new e.z(new Error(`No schema defined for config option "${n}".`)))}else this.fire(new e.z(new Error("Attempting to set config for a style without schema.")))}updateConfigDependencies(e){for(const t of this._configDependentLayers){const i=this.getLayer(t);if(i){if(e&&!i.configDependencies.has(e))continue;i.possiblyEvaluateVisibility(),this._updateLayer(i)}}this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.snow&&this.snow.updateConfig(this.options),this.rain&&this.rain.updateConfig(this.options),this.forEachFragmentStyle(e=>{const t=e._styleColorTheme.colorThemeOverride?e._styleColorTheme.colorThemeOverride:e._styleColorTheme.colorTheme;if(t){const i=e._evaluateColorThemeData(t);(!e._styleColorTheme.lut&&""!==i||e._styleColorTheme.lut&&i!==e._styleColorTheme.lut.data)&&e.setColorTheme(t)}}),this._changes.setDirty()}addLayer(t,i,n={}){this._checkLoaded();const r=t.id;if(this._layers[r])return void this.fire(new e.z(new Error(`Layer with id "${r}" already exists on this map`)));let s;if("custom"===t.type){if(Mn(this,e.dm(t)))return;s=e.dn(t,this.scope,this._styleColorTheme.lut,this.options)}else{if("object"==typeof t.source&&(this.addSource(r,t.source),t=e.di(t),t=e.h(t,{source:r})),this._validate(Te,`layers.${r}`,t,{arrayIndex:-1},n))return;s=e.dn(t,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(s),s.setEventedParent(this,{layer:{id:r}})}0!==s.configDependencies.size&&this._configDependentLayers.add(s.fqid);let o=this._order.length;if(i){const t=this._order.indexOf(i);if(-1===t)return void this.fire(new e.z(new Error(`Layer with id "${i}" does not exist on this map.`)));s.slot===this._layers[i].slot?o=t:e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(o,0,r),this._layerOrderChanged=!0,this._layers[r]=s;const a=this.getOwnLayerSourceCache(s),l=!!this.directionalLight&&this.directionalLight.shadowsEnabled();a&&s.canCastShadows()&&l&&(a.castsShadows=!0);const c=this._changes.getRemovedLayer(s);if(c&&s.source&&a&&"custom"!==s.type){this._changes.discardLayerRemoval(s);const t=e.C(s.source,s.scope);c.type!==s.type?this._changes.updateSourceCache(t,"clear"):(this._changes.updateSourceCache(t,"reload"),a.pause())}this._updateLayer(s),s.onAdd&&s.onAdd(this.map),s.scope=this.scope,this.mergeLayers()}moveLayer(t,i){this._checkLoaded();const n=this._checkLayer(t);if(!n)return;if(t===i)return;const r=this._order.indexOf(t);this._order.splice(r,1);let s=this._order.length;if(i){const t=this._order.indexOf(i);if(-1===t)return void this.fire(new e.z(new Error(`Layer with id "${i}" does not exist on this map.`)));n.slot===this._layers[i].slot?s=t:e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(s,0,t),this._changes.setDirty(),this._layerOrderChanged=!0,this.mergeLayers()}removeLayer(e){this._checkLoaded();const t=this._checkLayer(e);if(!t)return;t.setEventedParent(null);const i=this._order.indexOf(e);this._order.splice(i,1),delete this._layers[e],this._changes.setDirty(),this._layerOrderChanged=!0,this._configDependentLayers.delete(t.fqid),this._changes.removeLayer(t);const n=this.getOwnLayerSourceCache(t);if(n&&n.castsShadows){let e=!1;for(const i in this._layers)if(this._layers[i].source===t.source&&this._layers[i].canCastShadows()){e=!0;break}n.castsShadows=e}t.onRemove&&t.onRemove(this.map),this.mergeLayers()}getOwnLayer(e){return this._layers[e]}hasLayer(e){return e in this._mergedLayers}hasLayerType(e){for(const t in this._layers)if(this._layers[t].type===e)return!0;return!1}setLayerZoomRange(e,t,i){this._checkLoaded();const n=this._checkLayer(e);n&&(n.minzoom===t&&n.maxzoom===i||(null!=t&&(n.minzoom=t),null!=i&&(n.maxzoom=i),this._updateLayer(n)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(e,t){this._checkLoaded();const i=this._checkLayer(e);i&&i.slot!==t&&(i.slot=t,this._updateLayer(i))}setFilter(t,i,n={}){this._checkLoaded();const r=this._checkLayer(t);if(r&&!e.bv(r.filter,i))return null==i?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(ke,`layers.${r.id}.filter`,i,{layerType:r.type},n)||(r.filter=e.di(i),this._updateLayer(r)))}getFilter(t){const i=this._checkLayer(t);if(i)return e.di(i.filter)}setLayoutProperty(t,i,n,r={}){this._checkLoaded();const s=this._checkLayer(t);if(s&&!e.bv(s.getLayoutProperty(i),n)){if(null!=n&&(!r||!1!==r.validate)&&Mn(s,Ae.call(ge,{key:`layers.${t}.layout.${i}`,layerType:s.type,objectKey:i,value:n,styleSpec:e.a5,style:{glyphs:!0,sprite:!0}})))return;s.setLayoutProperty(i,n),0!==s.configDependencies.size&&this._configDependentLayers.add(s.fqid),this._updateLayer(s)}}getLayoutProperty(e,t){const i=this._checkLayer(e);if(i)return i.getLayoutProperty(t)}setPaintProperty(t,i,n,r={}){this._checkLoaded();const s=this._checkLayer(t);if(!s)return;if(e.bv(s.getPaintProperty(i),n))return;if(null!=n&&(!r||!1!==r.validate)&&Mn(s,Me.call(ge,{key:`layers.${t}.paint.${i}`,layerType:s.type,objectKey:i,value:n,styleSpec:e.a5})))return;const o=s.setPaintProperty(i,n);0!==s.configDependencies.size&&this._configDependentLayers.add(s.fqid),o&&this._updateLayer(s),this._changes.updatePaintProperties(s)}getPaintProperty(e,t){const i=this._checkLayer(e);if(i)return i.getPaintProperty(t)}setFeatureState(t,i){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:e,importId:n}=t.target,r=this.getFragmentStyle(n),s=r.getFeaturesetLayers(e);for(const{source:e,sourceLayer:n}of s)r.setFeatureState({id:t.id,source:e,sourceLayer:n},i)}else if("layerId"in t.target){const{layerId:e}=t.target,n=this.getLayer(e);this.setFeatureState({id:t.id,source:n.source,sourceLayer:n.sourceLayer},i)}return}const n=t.source,r=t.sourceLayer,s=this._checkSource(n);if(!s)return;const o=s.type;if("geojson"===o&&r)return void this.fire(new e.z(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===o&&!r)return void this.fire(new e.z(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===t.id&&this.fire(new e.z(new Error("The feature id parameter must be provided.")));const a=this.getOwnSourceCaches(n);for(const e of a)e.setFeatureState(r,t.id,i)}removeFeatureState(t,i){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:e,importId:n}=t.target,r=this.getFragmentStyle(n),s=r.getFeaturesetLayers(e);for(const{source:e,sourceLayer:n}of s)r.removeFeatureState({id:t.id,source:e,sourceLayer:n},i)}else if("layerId"in t.target){const{layerId:e}=t.target,n=this.getLayer(e);this.removeFeatureState({id:t.id,source:n.source,sourceLayer:n.sourceLayer},i)}return}const n=t.source,r=this._checkSource(n);if(!r)return;const s=r.type,o="vector"===s?t.sourceLayer:void 0;if("vector"===s&&!o)return void this.fire(new e.z(new Error("The sourceLayer parameter must be provided for vector source types.")));if(i&&"string"!=typeof t.id&&"number"!=typeof t.id)return void this.fire(new e.z(new Error("A feature id is required to remove its specific state property.")));const a=this.getOwnSourceCaches(n);for(const e of a)e.removeFeatureState(o,t.id,i)}getFeatureState(t){if(this._checkLoaded(),"target"in t){let i;if("featuresetId"in t.target){const{featuresetId:n,importId:r}=t.target,s=this.getFragmentStyle(r),o=s.getFeaturesetLayers(n);for(const{source:n,sourceLayer:r}of o){const o=s.getFeatureState({id:t.id,source:n,sourceLayer:r});if(o&&!i)i=o;else if(!e.bv(i,o))return void this.fire(new e.z(new Error("The same feature id exists in multiple sources in the featureset, but their feature states are not consistent through the sources.")))}}else if("layerId"in t.target){const{layerId:e}=t.target,n=this.getLayer(e);i=this.getFeatureState({id:t.id,source:n.source,sourceLayer:n.sourceLayer})}return i}const i=t.source,n=t.sourceLayer,r=this._checkSource(i);if(r){if("vector"!==r.type||n)return void 0===t.id&&this.fire(new e.z(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(i)[0].getFeatureState(n,t.id);this.fire(new e.z(new Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(t){return this.stylesheet.transition=e.h({},this.stylesheet.transition,t),this.transition=this.stylesheet.transition,this}getTransition(){return e.h({},this.stylesheet.transition)}serialize(){this._checkLoaded();const t=this.getTerrain(),i=t&&this.terrain&&this.terrain.scope===this.scope?t:this.stylesheet.terrain;return e.dp({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,iconsets:this.stylesheet.iconsets,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:i,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},e=>void 0!==e)}_updateFilteredLayers(e){for(const t of Object.values(this._mergedLayers))e(t)&&this._updateLayer(t)}_updateLayer(t){this._changes.updateLayer(t);const i=this.getLayerSourceCache(t),n=e.C(t.source,t.scope),r=this._changes.getUpdatedSourceCaches();t.source&&!r[n]&&i&&"raster"!==i.getSource().type&&(this._changes.updateSourceCache(n,"reload"),i.pause()),t.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(e){const t=e=>this._mergedLayers[e].is3D(!!this.terrain),i=this.order,n={},r=[];for(let s=i.length-1;s>=0;s--){const o=i[s];if(t(o)){n[o]=s;for(const t of e){const e=t[o];if(e)for(const t of e)r.push(t)}}}r.sort((e,t)=>t.intersectionZ-e.intersectionZ);const s=[];for(let o=i.length-1;o>=0;o--){const a=i[o];if(t(a))for(let e=r.length-1;e>=0;e--){const t=r[e].feature;if(t.layer&&n[t.layer.id]<o)break;s.push(t),r.pop()}else for(const t of e){const e=t[a];if(e)for(const t of e)s.push(t.feature)}}return s}queryRenderedFeatures(t,i,n){let r;i&&!Array.isArray(i)&&i.filter&&(this._validate(ke,"queryRenderedFeatures.filter",i.filter,null,i),r=e.b3(i.filter));const s={},o=e=>{if(Dn.has(e.type))return;const t=this.getOwnLayerSourceCache(e),i=s[t.id]=s[t.id]||{sourceCache:t,layers:{},has3DLayers:!1};e.is3D(!!this.terrain)&&(i.has3DLayers=!0),i.layers[e.fqid]=i.layers[e.fqid]||{styleLayer:e,targets:[]},i.layers[e.fqid].targets.push({filter:r})};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new e.z(new Error("parameters.layers must be an Array."))),[];for(const t of i.layers){const i=this._layers[t];if(!i)return this.fire(new e.z(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];o(i)}}else for(const e in this._layers)o(this._layers[e]);const a=this._queryRenderedFeatures(t,s,n),l=this._flattenAndSortRenderedFeatures(a),c=[];for(const t of l)e.dq(t.layer.id)===this.scope&&c.push(t);return c}queryRenderedFeatureset(t,i,n){let r;i&&!Array.isArray(i)&&i.filter&&(this._validate(ke,"queryRenderedFeatures.filter",i.filter,null,i),r=e.b3(i.filter));const s="mock",o=[];if(i&&i.target)o.push(Object.assign({},i,{targetId:s,filter:r}));else{const e=this.getFeaturesetDescriptors();for(const t of e)o.push({targetId:s,filter:r,target:t});for(const{style:e}of this.fragments){const t=e.getFeaturesetDescriptors();for(const e of t)o.push({targetId:s,filter:r,target:e})}}const a=this.queryRenderedTargets(t,o,n),l=[],c=new Set;for(const t of a)for(const i of t.variants[s])ot(i,t,c)||l.push(new e.dr(t,i));return l}queryRenderedTargets(t,i,n){const r={},s=(e,t,i,n)=>{const s=r[t.id]=r[t.id]||{sourceCache:t,layers:{},has3DLayers:!1};if(s.layers[e.fqid]=s.layers[e.fqid]||{styleLayer:e,targets:[]},e.is3D(!!this.terrain)&&(s.has3DLayers=!0),!n)return i.uniqueFeatureID=!1,void s.layers[e.fqid].targets.push(i);s.layers[e.fqid].targets.push(Object.assign({},i,{namespace:n.namespace,properties:n.properties,uniqueFeatureID:n.uniqueFeatureID}))};for(const t of i)if("featuresetId"in t.target){const{featuresetId:i,importId:n}=t.target,r=this.getFragmentStyle(n);if(!r||!r._featuresetSelectors)continue;const o=r._featuresetSelectors[i];if(!o){this.fire(new e.z(new Error(`The featureset '${i}' does not exist in the map's style and cannot be queried for features.`)));continue}for(const e of o){const i=r.getOwnLayer(e.layerId);i&&!Dn.has(i.type)&&s(i,r.getOwnLayerSourceCache(i),t,e)}}else if("layerId"in t.target){const{layerId:e}=t.target,i=this.getLayer(e);if(!i||Dn.has(i.type))continue;s(i,this.getLayerSourceCache(i),t)}const o=this._queryRenderedFeatures(t,r,n);return this._flattenAndSortRenderedFeatures(o)}_queryRenderedFeatures(e,t,i){const n=[],r=!!this.map._showQueryGeometry,s=Ge.createFromScreenPoints(e,i);for(const e in t){const o=at(s,t[e],this._availableImages,i,r);Object.keys(o).length&&n.push(o)}if(this.placement)for(const e in t){if(!t[e].sourceCache._onlySymbols)continue;const i=lt(s.screenGeometry,t[e],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData,this.map.getWorldview());Object.keys(i).length&&n.push(i)}return n}querySourceFeatures(e,t){const i=t&&t.filter;i&&this._validate(ke,"querySourceFeatures.filter",i,null,t);let n=[];const r=this.getOwnSourceCaches(e);for(const e of r)n=n.concat(ct(e,t));return n}addSourceType(e,t,i){return In.getSourceType(e)?i(new Error(`A source type called "${e}" already exists.`)):(In.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},i):i(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(t,i,n={}){this._checkLoaded();const r=this.light.getLight();let s=!1;for(const i in t)if(!e.bv(t[i],r[i])){s=!0;break}if(!s)return;const o=this._getTransitionParameters();this.light.setLight(t,i,n),this.light.updateTransitions(o)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=e.q.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&e.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(t,i=1){if(this._checkLoaded(),!t)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),0===i&&delete this.terrain,null===t?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);this.checkCanvasFingerprintNoise();let n=t;const r=null==t.source;if(1===i){if(this.disableElevatedTerrain)return;if("object"==typeof n.source){const t="terrain-dem-src";this.addSource(t,n.source),n=e.di(n),n=e.h(n,{source:t})}const t=e.h({},n),i={};if(this.terrain&&r){t.source=this.terrain.get().source;const e=this.terrain?this.getFragmentStyle(this.terrain.scope):null;e&&(i.style=e.serialize())}if(this._validate(xe,"terrain",t,i))return}if(!this.terrain||this.terrain.scope!==this.scope&&!r||this.terrain&&i!==this.terrain.drapeRenderMode){if(!n)return;this._createTerrain(n,i),this.fire(new e.A("data",{dataType:"style"}))}else{const i=this.terrain,r=i.get();for(const t of Object.keys(e.a5.terrain))!n.hasOwnProperty(t)&&e.a5.terrain[t].default&&(n[t]=e.a5.terrain[t].default);for(const n in t)if(!e.bv(t[n],r[n])){i.set(t,this.options),this.stylesheet.terrain=t;const n=this._getTransitionParameters({duration:0});i.updateTransitions(n),this.fire(new e.A("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(e){const t=this.fog=new Ye(e,this.map.transform,this.scope,this.options);this.stylesheet.fog=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i)}_createSnow(e){const t=this.snow=new We(e,this.map.transform,this.scope,this.options);this.stylesheet.snow=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i)}_createRain(e){const t=this.rain=new Ue(e,this.map.transform,this.scope,this.options);this.stylesheet.rain=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(const e of this.map._markers)e._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(t){if(this._checkLoaded(),!t)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const i=this.fog;if(!e.bv(i.get(),t)){i.set(t,this.options),this.stylesheet.fog=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e)}}else this._createFog(t);this._markersNeedUpdate=!0}getSnow(){return this.snow?this.snow.get():null}setSnow(t){if(this._checkLoaded(),!t)return delete this.snow,void delete this.stylesheet.snow;if(this.snow){const i=this.snow;if(!e.bv(i.get(),t)){i.set(t,this.options),this.stylesheet.snow=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e)}}else this._createSnow(t);this._markersNeedUpdate=!0}getRain(){return this.rain?this.rain.get():null}setRain(t){if(this._checkLoaded(),!t)return delete this.rain,void delete this.stylesheet.rain;if(this.rain){const i=this.rain;if(!e.bv(i.get(),t)){i.set(t,this.options),this.stylesheet.rain=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e)}}else this._createRain(t);this._markersNeedUpdate=!0}_reloadColorTheme(){const t=()=>{for(const e in this._layers)this._layers[e].lut=this._styleColorTheme.lut;for(const e in this._sourceCaches)this._sourceCaches[e].clearTiles()},i=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!i)return this._styleColorTheme.lut=null,void t();const n=this._evaluateColorThemeData(i);this._loadColorTheme(n).then(()=>{this.fire(new e.A("colorthemeset")),t()}).catch(t=>{e.w(`Couldn't set color theme: ${t}`)})}setColorTheme(t){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&e.w("Note: setColorTheme is called on a style with a color-theme override, the passed color-theme won't be visible."),this._styleColorTheme.colorTheme=t,this._reloadColorTheme()}setImportColorTheme(e,t){const i=this.getFragmentStyle(e);i&&(i._styleColorTheme.colorThemeOverride=t,i._reloadColorTheme())}_getTransitionParameters(t){return{now:e.q.now(),transition:e.h(this.transition,t)}}updateDrapeFirstLayers(){if(!this.terrain)return;const e=[],t=[];for(const i of this._mergedOrder)this.isLayerDraped(this._mergedLayers[i])?e.push(i):t.push(i);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...e),this._drapedFirstOrder.push(...t)}_createTerrain(e,t){const i=this.terrain=new Pe(e,t,this.scope,this.options,this.map.getWorldview());1===t&&(this.stylesheet.terrain=e),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const n=this._getTransitionParameters({duration:0});i.updateTransitions(n)}_force3DLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"fill-extrusion"===t.type&&this._updateLayer(t)}}_forceSymbolLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"symbol"===t.type&&this._updateLayer(t)}}_validate(t,i,n,r,s={}){if(s&&!1===s.validate)return!1;const o=e.h({},this.serialize());return Mn(this,t.call(ge,e.h({key:i,style:o,value:n,styleSpec:e.a5},r)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.ds.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._mergedLayers)this._mergedLayers[e].setEventedParent(null);for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles(),this._mergedSourceCaches[e].setEventedParent(null);this.imageManager.removeScope(this.scope),this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this.modelManager.setEventedParent(null),this.modelManager.destroy(),this.dispatcher.remove())}clearSource(e){const t=this.getSourceCaches(e);for(const e of t)e.clearTiles()}clearSources(){for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles()}clearLayers(){for(const e in this._mergedLayers){const t=this._mergedLayers[e];t._clear&&t._clear()}}reloadSource(e){const t=this.getSourceCaches(e);for(const e of t)e.resume(),e.reload()}reloadSources(){for(const e of this.getSources())e.reload&&e.reload()}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle(e=>{e.modelManager.reloadModels(e.scope)})}updateSources(e){let t;this.directionalLight&&(t=fn(this.directionalLight));const i=new Set;for(const e in this._mergedLayers){const t=this._mergedLayers[e];t.hasElevation()&&!i.has(t.source)&&i.add(t.source)}for(const n in this._mergedSourceCaches){const r=this._mergedSourceCaches[n],s=i.has(r._source.id);r.update(e,void 0,void 0,t,s)}}_generateCollisionBoxes(){for(const e in this._sourceCaches){const t=this._sourceCaches[e];t.resume(),t.reload()}}_updatePlacement(t,i,n,r,s,o,a=!1){let l=!1,c=!1;const h={},d={};for(const t of this._mergedOrder){const n=this._mergedLayers[t];if("symbol"!==n.type)continue;const r=e.C(n.source,n.scope);let s=h[r];if(!s){const e=this.getLayerSourceCache(n);if(!e)continue;const t=e.getRenderableIds(!0).map(t=>e.getTileByID(t));d[r]=t.slice(),s=h[r]=t.sort((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1))}const o=this.crossTileSymbolIndex.addLayer(n,s,i.center.lng,i.projection);l=l||o}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder),a=a||this._layerOrderChanged||0===r,this._layerOrderChanged&&this.fire(new e.A("neworder")),(a||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.q.now(),i.zoom))&&(this.pauseablePlacement=new Ei(i,this._mergedOrder,a,n,r,s,this.placement,this.fog&&i.projection.supportsFog?this.fog.state:null,this._buildingIndex),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,h,d,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.q.now()),c=!0),l&&this.pauseablePlacement.placement.setStale()),c||l){this._buildingIndex.onNewFrame(i.zoom);for(let t=0;t<this._mergedOrder.length;t++){const i=this._mergedLayers[this._mergedOrder[t]];if("symbol"!==i.type)continue;const n=this.isLayerClipped(i);this.placement.updateLayerOpacities(i,h[e.C(i.source,i.scope)],t,n?o:null)}}return{needsRerender:!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.q.now())}}_releaseSymbolFadeTiles(){for(const e in this._sourceCaches)this._sourceCaches[e].releaseSymbolFadeTiles()}addImport(t,i){this._checkLoaded();const n=this.stylesheet.imports=this.stylesheet.imports||[];if(-1!==n.findIndex(({id:e})=>e===t.id))return void this.fire(new e.z(new Error(`Import with id '${t.id}' already exists in the map's style.`)));if(!i)return n.push(t),this._loadImports([t],!0);const r=n.findIndex(({id:e})=>e===i);return-1===r&&this.fire(new e.z(new Error(`Import with id "${i}" does not exist on this map.`))),this.stylesheet.imports=n.slice(0,r).concat(t).concat(n.slice(r)),this._loadImports([t],!0,i)}updateImport(t,i){this._checkLoaded();const n=this.stylesheet.imports||[],r=this.getImportIndex(t);return-1===r?this:"string"==typeof i?(this.setImportUrl(t,i),this):(i.url&&i.url!==n[r].url&&this.setImportUrl(t,i.url),e.bv(i.config,n[r].config)||this.setImportConfig(t,i.config,i.data.schema),e.bv(i.data,n[r].data)||this.setImportData(t,i.data),this)}moveImport(e,t){this._checkLoaded();let i=this.stylesheet.imports||[];const n=this.getImportIndex(e);if(-1===n)return this;const r=this.getImportIndex(t);if(-1===r)return this;const s=i[n],o=this.fragments[n];return i=i.filter(({id:t})=>t!==e),this.fragments=this.fragments.filter(({id:t})=>t!==e),this.stylesheet.imports=i.slice(0,r).concat(s).concat(i.slice(r)),this.fragments=this.fragments.slice(0,r).concat(o).concat(this.fragments.slice(r)),this.mergeLayers(),this}setImportUrl(e,t){this._checkLoaded();const i=this.stylesheet.imports||[],n=this.getImportIndex(e);if(-1===n)return this;i[n].url=t;const r=this.fragments[n];return r.style=this._createFragmentStyle(i[n]),r.style.on("style.import.load",()=>this.mergeAll()),r.style.loadURL(t),this}setImportData(e,t){this._checkLoaded();const i=this.getImportIndex(e),n=this.stylesheet.imports||[];return-1===i?this:t?(this.fragments[i].style.setState(t),this._reloadImports(),this):(delete n[i].data,this.setImportUrl(e,n[i].url))}setImportConfig(e,t,i){this._checkLoaded();const n=this.getImportIndex(e),r=this.stylesheet.imports||[];if(-1===n)return this;t?r[n].config=t:delete r[n].config;const s=this.fragments[n];i&&s.style.stylesheet&&(s.style.stylesheet.schema=i);const o=s.style.stylesheet&&s.style.stylesheet.schema;return s.config=t,s.style.updateConfig(t,o),this.updateConfigDependencies(),this}removeImport(e){this._checkLoaded();const t=this.stylesheet.imports||[],i=this.getImportIndex(e);-1!==i&&(t.splice(i,1),this.fragments[i].style._remove(),this.fragments.splice(i,1),this._reloadImports())}getImportIndex(t){const i=(this.stylesheet.imports||[]).findIndex(e=>e.id===t);return-1===i&&this.fire(new e.z(new Error(`Import '${t}' does not exist in the map's style and cannot be updated.`))),i}getLayer(e){return this._mergedLayers[e]}getSources(){const e=[];for(const t in this._mergedOtherSourceCaches){const i=this._mergedOtherSourceCaches[t];i&&e.push(i.getSource())}return e}getSource(e,t){const i=this.getSourceCache(e,t);return i&&i.getSource()}getLayerSource(e){const t=this.getLayerSourceCache(e);return t&&t.getSource()}getSourceCache(t,i){const n=e.C(t,i);return this._mergedOtherSourceCaches[n]}getLayerSourceCache(t){const i=e.C(t.source,t.scope);return"symbol"===t.type?this._mergedSymbolSourceCaches[i]:this._mergedOtherSourceCaches[i]}getSourceCaches(e){if(null==e)return Object.values(this._mergedSourceCaches);const t=[];return this._mergedOtherSourceCaches[e]&&t.push(this._mergedOtherSourceCaches[e]),this._mergedSymbolSourceCaches[e]&&t.push(this._mergedSymbolSourceCaches[e]),t}updateSourceCaches(){const e=this._changes.getUpdatedSourceCaches();for(const t in e){const i=e[t];"reload"===i?this.reloadSource(t):"clear"===i&&this.clearSource(t)}}updateLayers(e){const t=this._changes.getUpdatedPaintProperties();for(const i of t){const t=this.getLayer(i);t&&t.updateTransitions(e)}}getGlyphsUrl(){return this.stylesheet.glyphs}setGlyphsUrl(e){this.stylesheet.glyphs=e,this.glyphManager.setURL(e)}getImages(t,i,n){this.imageManager.getImages(i.images,i.scope,n),this._updateTilesForChangedImages();const r=t=>{if(t){const n=i.images.map(t=>e.I.toString(t));t.setDependencies(i.tileID.key,i.type,n)}},s=e.C(i.source,i.scope);r(this._mergedOtherSourceCaches[s]),r(this._mergedSymbolSourceCaches[s]),i.images.some(e=>e.iconsetId)&&this.fire(new e.A("data",{dataType:"style"}))}rasterizeImages(e,t,i){this.imageManager.rasterizeImages(t,i)}getGlyphs(e,t,i){this.glyphManager.getGlyphs(t.stacks,i)}getResource(t,i,n){return e.dt(i,n)}getOwnSourceCache(e){return this._otherSourceCaches[e]}getOwnLayerSourceCache(e){return"symbol"===e.type?this._symbolSourceCaches[e.source]:this._otherSourceCaches[e.source]}getOwnSourceCaches(e){const t=[];return this._otherSourceCaches[e]&&t.push(this._otherSourceCaches[e]),this._symbolSourceCaches[e]&&t.push(this._symbolSourceCaches[e]),t}_isSourceCacheLoaded(t){const i=this.getOwnSourceCaches(t);return 0===i.length?(this.fire(new e.z(new Error(`There is no source with ID '${t}'`))),!1):i.every(e=>e.loaded())}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(e,t){if(!this._clipLayerPresent&&"fill-extrusion"!==e.type&&"building"!==e.type)return!1;const i="fill-extrusion"===e.type&&("building"===e.sourceLayer||"procedural_buildings"===e.sourceLayer),n="building"===e.type;if(e.is3D(!!this.terrain)){if(i||n||t&&"batched-model"===t.type)return!0;if("model"===e.type)return!0}else if("symbol"===e.type)return!0;return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.fragments.forEach(e=>{e.style._remove()}),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}In.getSourceType=function(e){return nt[e]},In.setSourceType=function(e,t){nt[e]=t},In.registerForPluginStateChange=e.du;var Pn="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",Rn="\nout vec4 glFragColor;highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\n#ifdef INDICATOR_CUTOUT\nuniform vec3 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;\n#endif\nvec4 applyCutout(vec4 color,float height) {\n#ifdef INDICATOR_CUTOUT\nfloat verticalFadeRange=u_indicator_cutout_centers.z*0.25;float holeMinOpacity=mix(1.0,u_indicator_cutout_params.x,smoothstep(u_indicator_cutout_centers.z,u_indicator_cutout_centers.z+verticalFadeRange,height));float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);\n#else\nreturn color;\n#endif\n}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif\nvec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 applyLUT(highp sampler3D lut,vec4 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return vec4(texture(lut,uvw).rgb,col.a);}vec3 applyLUT(highp sampler3D lut,vec3 col) {return applyLUT(lut,vec4(col,1.0)).rgb;}",On="\n#define EXTENT 8192.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const vec2 units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (units_to_pixels*pos+offset)/pattern_size;}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}",zn="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",Fn="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nvec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }\n#endif\n#ifdef DEPTH_OCCLUSION\nuniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset;\n#ifdef DEPTH_D24\nfloat unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);}\n#else\nhighp float unpack_depth_rgba(vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;\n#ifdef DEPTH_D24\nfloat depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r);\n#else\nfloat depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5));\n#endif\nreturn coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef DEPTH_D24\nhighp vec4 depth=vec4(\ntexture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r\n);depth=unpack_depth4(depth);\n#else\nhighp vec4 depth=vec4(\nunpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy))\n);\n#endif\nreturn depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;int NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) {\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)));\n#endif\nres+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));}\n#else\nbool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; }\n#endif//DEPTH_OCCLUSION",Nn="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",Yn="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;\n#ifdef FLIP_Y\nuv.y=1.0-uv.y;\n#endif\nhighp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {return color;}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",Bn="#ifdef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0)\n);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0)\n);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",Hn="#ifdef RASTER_ARRAY\nuniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;}\n#endif\nuniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}",jn="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif//RENDER_SHADOWS",Vn="#ifdef RENDER_SHADOWS\nprecision highp sampler2DShadow;uniform sampler2DShadow u_shadowmap_0;uniform sampler2DShadow u_shadowmap_1;uniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;float shadow_sample(sampler2DShadow shadowmap,highp vec3 pos,highp float bias) {\n#ifdef CLIP_ZERO_TO_ONE\nhighp vec3 coord=vec3(pos.xy*0.5+0.5,pos.z-bias);\n#else\nhighp vec3 coord=vec3(pos.xy*0.5+0.5,pos.z*0.5+0.5-bias);\n#endif\nreturn texture(shadowmap,coord);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {light_view_pos0.xyz/=light_view_pos0.w;\n#ifdef SHADOWS_SINGLE_CASCADE\nvec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);\n#else\nlight_view_pos1.xyz/=light_view_pos1.w;vec4 abs_bounds=abs(vec4(light_view_pos0.xy,light_view_pos1.xy));if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}float occlusion1=shadow_sample(u_shadowmap_1,light_view_pos1.xyz,bias);return clamp(mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth)),0.0,1.0);\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}highp vec2 compute_receiver_plane_depth_bias(highp vec3 pos_dx,highp vec3 pos_dy)\n{highp vec2 biasUV=vec2(\npos_dy.y*pos_dx.z-pos_dx.y*pos_dy.z,pos_dx.x*pos_dy.z-pos_dy.x*pos_dx.z);biasUV*=1.0/((pos_dx.x*pos_dy.y)-(pos_dx.y*pos_dy.x));return biasUV;}float shadowed_light_factor_plane_bias(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {highp vec3 light_view_pos0_xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;highp vec3 light_view_pos0_ddx=dFdx(light_view_pos0_xyz);highp vec3 light_view_pos0_ddy=dFdy(light_view_pos0_xyz);highp vec2 plane_depth_bias=compute_receiver_plane_depth_bias(light_view_pos0_ddx,light_view_pos0_ddy);highp float bias=dot(vec2(u_shadow_texel_size,u_shadow_texel_size),plane_depth_bias)+0.0001;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";const Wn=[];Zn(Pn,Wn),Zn(On,Wn),Zn(Rn,Wn);const Un={"_prelude_fog.vertex.glsl":Nn,"_prelude_terrain.vertex.glsl":Fn,"_prelude_shadow.vertex.glsl":jn,"_prelude_fog.fragment.glsl":Yn,"_prelude_shadow.fragment.glsl":Vn,"_prelude_lighting.glsl":"\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif//LIGHTING_3D_MODE","_prelude_raster_array.glsl":Bn,"_prelude_raster_particle.glsl":Hn},$n={};Jn("",Fn),Jn(Yn,Nn),Jn(Vn,jn),Jn(Bn,""),Jn(Hn,"");const Gn=Jn(Rn,On),Xn=Pn;var qn={background:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nin vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;uniform float u_emissive_strength;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),backgroundPattern:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in vec2 a_pos;out highp vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),building:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nconst float window_depth=0.5;const float ao_radius=0.2;in vec4 v_color;in highp vec3 v_normal;in highp vec3 v_pos;\n#ifdef BUILDING_FAUX_FACADE\nin lowp float v_faux_facade;in highp float v_faux_facade_ed;in highp vec2 v_faux_facade_window;in highp vec2 v_faux_facade_floor;in highp vec2 v_faux_facade_range;in highp float v_aspect;in highp vec3 v_tbn_0;in highp vec3 v_tbn_1;in highp vec3 v_tbn_2;in highp vec4 v_faux_color_emissive;uniform float u_faux_facade_ao_intensity;\n#endif\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\nuniform lowp float u_opacity;uniform vec3 u_camera_pos;uniform highp float u_tile_to_meter;uniform float u_facade_emissive_chance;vec3 linearTosRGB(in vec3 color) {return pow(color,vec3(1./2.2));}\n#ifdef BUILDING_FAUX_FACADE\nfloat hash12(in vec2 p) {vec3 p3 =fract(vec3(p.xyx)*0.1031);p3+=dot(p3,p3.yzx+33.33);return fract((p3.x+p3.y)*p3.z);}float min3(in vec3 v) {return min(min(v.x,v.y),v.z);}vec2 get_uv_mask_id(in vec2 q,out float mask,out vec2 id) {vec2 p=q;mask=step(v_faux_facade_range.x,p.y)*step(p.y,v_faux_facade_range.y);p.y=p.y-v_faux_facade_range.x;vec2 uv=modf(p/v_faux_facade_floor,id);vec4 d=(v_faux_facade_floor.xyxy+vec4(-v_faux_facade_window,v_faux_facade_window))*0.5;vec4 edge=d/v_faux_facade_floor.xyxy;vec2 m=step(edge.xy,uv)*step(uv,edge.zw);mask*=m.x*m.y;uv-=vec2(0.5);uv*=vec2(0.5)/(vec2(0.5)-edge.xy);uv+=vec2(0.5);return uv;}float ray_unit_box(in vec3 ray_o,in vec3 ray_d,in vec3 bmin,in vec3 bmax) {vec3 planes=mix(bmin,bmax,step(0.0,ray_d));vec3 t=(planes-ray_o)/ray_d;return min3(t);}float get_emissive(in vec2 id) {if (u_facade_emissive_chance > 0.0) {return (step(hash12(id),u_facade_emissive_chance)+0.05)*v_faux_color_emissive.a;}return 0.0;}vec3 get_shade_info(in vec3 v,in vec3 v_normalized,in vec3 color,in vec2 id,in mat3 tbn,inout vec3 out_normal,inout float out_emissive) {vec3 out_color=color;vec3 abs_v=abs(v_normalized);bool x_major=abs_v.x >=abs_v.y && abs_v.x >=abs_v.z;bool y_major=abs_v.y >=abs_v.x && abs_v.y >=abs_v.z;bool z_major=abs_v.z >=abs_v.x && abs_v.z >=abs_v.y;\n#if 0\nif (x_major) {out_color=v.x > 0.0 ? vec3(1.0,0.0,0.0) : vec3(0.0,1.0,1.0);} else if (y_major) {out_color=v.y > 0.0 ? vec3(0.0,1.0,0.0) : vec3(1.0,0.0,1.0);} else if (z_major) {out_color=v.z > 0.0 ? vec3(0.0,0.0,1.0) : vec3(1.0,1.0,0.0);}out_emissive=1.0;\n#else\nif (x_major) {out_normal=sign(v.x)*tbn[0];} else if (y_major) {out_normal=vec3(0.0,0.0,-sign(v.y));} else if (z_major) {out_color=v_faux_color_emissive.rgb;out_emissive=v.z <=0.0 ? get_emissive(id) : out_emissive;}float ao=1.0;if (u_faux_facade_ao_intensity > 0.0) {vec4 ao_range=v_faux_facade_window.xxyy*0.5-vec4(0,ao_radius,0,ao_radius);vec2 ao_range_z=vec2(window_depth*0.5)-vec2(0.0,ao_radius);if (x_major || y_major) {ao*=smoothstep(-ao_range_z.x,-ao_range_z.y,v.z);} else if (z_major) {ao*=smoothstep(-ao_range.x,-ao_range.y,v.x)*(1.0-smoothstep(ao_range.y,ao_range.x,v.x));ao*=smoothstep(-ao_range.z,-ao_range.w,v.y)*(1.0-smoothstep(ao_range.w,ao_range.z,v.y));}ao=mix(1.0,min(1.0,ao+0.25),u_faux_facade_ao_intensity);}out_color*=ao;\n#endif\nreturn out_color;}\n#endif\nvec3 apply_lighting_linear(in vec3 color,in vec3 normal,in float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return color*(ambient_contrib+directional_contrib);}void main() {vec3 normal=normalize(v_normal);vec3 base_color=v_color.rgb;float emissive=v_color.a;\n#ifdef BUILDING_FAUX_FACADE\nif (v_faux_facade > 0.0) {mat3 tbn=mat3(v_tbn_0,v_tbn_1,v_tbn_2);vec3 v=vec3(v_pos.xy,v_pos.z/u_tile_to_meter)-u_camera_pos;vec3 view_tangent=transpose(tbn)*v;vec2 q=vec2(v_faux_facade_ed,v_pos.z);float mask=0.0;vec2 id=vec2(0.0);vec2 uv=get_uv_mask_id(q,mask,id);uv*=v_faux_facade_window;vec3 bmin=vec3(0.0,0.0,-window_depth);vec3 bmax=bmin+vec3(v_faux_facade_window,window_depth);vec3 ray_o=vec3(uv,0.0);vec3 ray_d=normalize(view_tangent);float t_min=ray_unit_box(ray_o,ray_d,bmin,bmax);vec3 hit=ray_o+t_min*ray_d;vec3 r=vec3(v_faux_facade_window,-window_depth);hit-=r*0.5;vec3 normalized=hit/r;vec3 out_normal=normal;float out_emissive=emissive;vec3 room_color=get_shade_info(hit,normalized,base_color,id,tbn,out_normal,out_emissive);base_color=mix(base_color,room_color,mask);normal=mix(normal,out_normal,mask);emissive=mix(emissive,out_emissive,mask);}\n#endif\nvec4 color=vec4(base_color,1.0);vec3 xy_flipped_normal=vec3(-normal.xy,normal.z);float shadowed_lighting_factor=0.0;\n#ifdef RENDER_SHADOWS\nshadowed_lighting_factor=shadowed_light_factor_normal(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nshadowed_lighting_factor=dot(normal,u_lighting_directional_dir);\n#endif\ncolor.rgb=apply_lighting_linear(color.rgb,xy_flipped_normal,shadowed_lighting_factor);color.rgb=mix(color.rgb,base_color.rgb,emissive);\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,v_pos.z));\n#endif\ncolor.rgb=linearTosRGB(color.rgb);color*=u_opacity;\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,v_pos.z);\n#endif\nglFragColor=color; \n#ifdef DEBUG_SHOW_NORMALS\ncolor.rgb=xy_flipped_normal*0.5+vec3(0.5,0.5,0.5);color.a=1.0;glFragColor=color;\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;in vec3 a_normal_3;in vec3 a_centroid_3;in vec4 a_faux_facade_data;in vec2 a_faux_facade_vertical_range;uniform mat4 u_matrix;uniform mat4 u_normal_matrix;uniform highp float u_tile_to_meter;out vec4 v_color;out vec3 v_normal;out highp vec3 v_pos;\n#ifdef BUILDING_FAUX_FACADE\nout lowp float v_faux_facade;out highp float v_faux_facade_ed;out highp vec2 v_faux_facade_window;out highp vec2 v_faux_facade_floor;out highp vec2 v_faux_facade_range;out highp float v_aspect;out highp vec3 v_tbn_0;out highp vec3 v_tbn_1;out highp vec3 v_tbn_2;out highp vec4 v_faux_color_emissive;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nconst float MAX_UINT_16=65535.0;const float MAX_INT_16=32767.0;const float MAX_UINT_8=255.0;const float TWO_POW_8=256.0;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#ifdef BUILDING_FAUX_FACADE\nmat3 get_tbn(in vec3 normal) {const vec3 bitangent=vec3(0.0,0.0,1.0);vec3 tangent=normalize(vec3(normal.y,-normal.x,0.0));return mat3(tangent,bitangent,normal);}\n#endif\n#pragma mapbox: define-attribute-vertex-shader-only highp vec2 part_color_emissive\n#pragma mapbox: define-attribute-vertex-shader-only highp vec2 faux_facade_color_emissive\nvoid main() {\n#pragma mapbox: initialize-attribute-custom highp vec2 part_color_emissive\n#pragma mapbox: initialize-attribute-custom highp vec2 faux_facade_color_emissive\nvec4 color_emissive=decode_color(part_color_emissive);v_color=vec4(sRGBToLinear(color_emissive.rgb),color_emissive.a);vec3 a_normal_3f=a_normal_3/MAX_INT_16;v_normal=vec3(u_normal_matrix*vec4(a_normal_3f,0.0));float hidden=0.0;\n#ifdef BUILDING_FAUX_FACADE\nv_faux_facade=a_faux_facade_data.x;if (v_faux_facade > 0.0) {v_faux_facade_ed=a_faux_facade_data.x *u_tile_to_meter;float window_x_perc=floor(a_faux_facade_data.y/TWO_POW_8);float window_y_perc=a_faux_facade_data.y-TWO_POW_8*window_x_perc;vec2 window_perc=vec2(window_x_perc,window_y_perc)/MAX_UINT_8;v_faux_facade_floor=(a_faux_facade_data.zw/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_faux_facade_window=window_perc*v_faux_facade_floor;v_faux_facade_range=(a_faux_facade_vertical_range/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_aspect=v_faux_facade_window.x/v_faux_facade_window.y;mat3 tbn=get_tbn(normalize(v_normal));v_tbn_0=tbn[0];v_tbn_1=tbn[1];v_tbn_2=tbn[2];v_faux_color_emissive=decode_color(faux_facade_color_emissive);v_faux_color_emissive.rgb=sRGBToLinear(v_faux_color_emissive.rgb);}\n#endif\nv_pos=a_pos_3f;\n#ifdef RENDER_CUTOFF\nvec4 ground=u_matrix*vec4(a_centroid_3,1.0);v_cutoff_opacity=cutoff_opacity(u_cutoff_params,ground.z);hidden=float(v_cutoff_opacity==0.0);v_pos.z*=v_cutoff_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shadow_pos=v_pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset_model(v_normal);shadow_pos+=offset*shadow_normal_offset_multiplier0();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shadow_pos,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(shadow_pos,1.0);v_depth_shadows=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(v_pos);\n#endif\ngl_Position=mix(u_matrix*vec4(v_pos,1),AWAY,hidden);}'),buildingBloom:Jn("in vec4 v_color_emissive;\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\nfloat saturate(float val) {return clamp(val,0.0,1.0);}void main() {float emission=v_color_emissive.a;float opacity=1.0;\n#ifdef HAS_ATTRIBUTE_a_bloom_attenuation\nfloat distance=length(vec2(1.3*max(0.0,abs(bloom_attenuation.x)-bloom_attenuation.z),bloom_attenuation.y));distance+= mix(0.5,0.0,clamp(emission-1.0,0.0,1.0));opacity*=saturate(1.0-distance*distance);\n#endif\nglFragColor=vec4(v_color_emissive.rgb,1.0)*opacity;}","in vec3 a_pos_3f;\n#pragma mapbox: define-attribute-vertex-shader-only highp vec2 part_color_emissive\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\nout vec4 v_color_emissive;uniform mat4 u_matrix;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute-custom highp vec2 part_color_emissive\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\n#ifdef HAS_ATTRIBUTE_a_part_color_emissive\nvec4 color_emissive=decode_color(part_color_emissive);float part_emissive=color_emissive.a*5.0;v_color_emissive=vec4(sRGBToLinear(color_emissive.rgb),part_emissive);\n#else\nv_color_emissive=vec4(1.0);\n#endif\ngl_Position=u_matrix*vec4(a_pos_3f,1.0);}"),buildingDepth:Jn("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;void main() {gl_Position=u_matrix*vec4(a_pos_3f,1.0);v_depth=gl_Position.z/gl_Position.w;}"),circle:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? \nsmoothstep(0.0,-antialiased_blur,1.0-extrude_length) : \nsmoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_opacity;float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\n#ifdef ELEVATED_ROADS\nin float a_circle_z_offset;\n#endif\nout vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\n#ifdef ELEVATED_ROADS\nworld_center.z+=a_circle_z_offset+ELEVATION_BIAS;\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}'),clippingMask:Jn("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Jn('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),heatmapTexture:Jn("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:Jn("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform float u_zoom_transition;\n#endif\nout float v_placed;out float v_notUsed;void main() {float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(a_anchor_pos));vec3 proj_pos=a_pos+elevationVector(a_anchor_pos)*(feature_elevation+terrain_elevation);\n#ifdef PROJECTION_GLOBE_VIEW\n#ifndef PROJECTED_POS_ON_VIEWPORT\nvec3 globe_pos=proj_pos;vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,a_anchor_pos,u_tile_id,u_merc_center);proj_pos=mix_globe_mercator(globe_pos,mercator_pos,u_zoom_transition);\n#endif\n#endif\nvec4 projectedPoint=u_matrix*vec4(proj_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}'),collisionCircle:Jn("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Jn("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;\n#endif\nout vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}'),elevatedStructuresDepth:Jn("void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=vec4(0.);\n#endif\n}","in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform float u_depth_bias;void main() {gl_Position=u_matrix*vec4(a_pos,a_height,1);gl_Position.z=gl_Position.z+u_depth_bias;}"),elevatedStructuresDepthReconstruct:Jn("#ifdef DEPTH_RECONSTRUCTION\nin float v_height;\n#endif\nvoid main() {\n#ifdef DEPTH_RECONSTRUCTION\nif (v_height >=0.0)\ndiscard;\n#endif\nglFragColor=vec4(1.0,0.0,0.0,1.0);}","in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform vec3 u_camera_pos;uniform highp float u_depth_bias;uniform lowp float u_height_scale;uniform lowp float u_reset_depth;\n#ifdef DEPTH_RECONSTRUCTION\nout float v_height;\n#endif\nvoid main() {vec3 vpos=vec3(a_pos,a_height*u_height_scale);\n#ifdef DEPTH_RECONSTRUCTION\nif (u_camera_pos.z > vpos.z) {vpos-=(u_camera_pos-vpos)*(vpos.z/(u_camera_pos.z-vpos.z));}v_height=a_height;\n#endif\ngl_Position=u_matrix*vec4(vpos,1);gl_Position.z=u_reset_depth==1.0 ? gl_Position.w : gl_Position.z+u_depth_bias;}"),elevatedStructures:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nin vec3 v_normal;in float v_height;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth;\n#endif\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}vec3 compute_view_dependent_emissive_color(float ndotl,float emissive_strength,vec3 color)\n{color=sRGBToLinear(color);color=color*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);color=linearTosRGB(color.rgb);return color;}uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nvec3 color=structure_color.xyz;\n#ifdef LIGHTING_3D_MODE\nvec3 normal=normalize(v_normal);vec3 transformed_normal=vec3(-normal.xy,normal.z);float ndotl=calculate_NdotL(transformed_normal);float emissive_strength=u_emissive_strength;emissive_strength=0.0;vec3 emissive_color=compute_view_dependent_emissive_color(ndotl,emissive_strength,color.xyz);\n#ifdef RENDER_SHADOWS\nfloat shadowed_lighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);color.rgb=apply_lighting(color.rgb,transformed_normal,shadowed_lighting_factor);\n#else\ncolor=apply_lighting(color,transformed_normal);\n#endif\ncolor=mix(color,emissive_color,emissive_strength);if (v_height < 0.0) {float penetration=max(v_height+7.5,0.0);float occlusion=1.0-1.0/PI*acos(1.0-penetration/4.0);color=color*(1.0-pow(occlusion,2.0)*0.3);}\n#endif\n#ifdef FOG\ncolor=fog_apply(color,v_fog_pos);\n#endif\nvec4 out_color=vec4(color,1.0);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_height);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;HANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;in float a_height;in vec3 a_pos_normal_3;uniform mat4 u_matrix;out vec3 v_normal;out float v_height;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth;\n#endif\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nv_normal=a_pos_normal_3/16384.0;v_height=a_height;vec3 pos=vec3(a_pos,a_height);gl_Position=u_matrix*vec4(pos,1);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(-v_normal.xy,v_normal.z));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fill:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=opacity;\n#ifdef INDICATOR_CUTOUT\nif (v_z_offset >=0.0) {out_color=applyCutout(out_color,v_z_offset);}\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=z_offset;\n#endif\n}'),fillOutline:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nin highp vec2 v_pos;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nuniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef FLIP_Y\nv_pos=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world;\n#else\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutlinePattern:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nuniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nin highp vec2 v_pos;in highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;out highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FLIP_Y\nv_pos_world=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world;\n#else\nv_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillPattern:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin highp vec2 v_pos;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillExtrusion:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec4 v_color;in vec4 v_flat;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\nuniform lowp float u_opacity;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radius;in float v_has_floodlight;\n#endif\nin float v_height;\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float emissive_strength\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor;\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\ncolor.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,h);\n#endif\n#ifdef FEATURE_CUTOUT\ncolor=apply_feature_cutout(color,gl_FragCoord);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;uniform float u_width_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nuniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radius;out float v_has_floodlight;\n#endif\nout float v_height;vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp float emissive_strength\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat cutoff=1.0;vec3 scaled_pos=pos;\n#ifdef RENDER_CUTOFF\nvec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_pos.x==0.0 ? pos.xyz : (centroid_random/8.0);vec4 ground=u_matrix*vec4(ground_pos.xy,ele,1.0);\n#ifdef CLIP_ZERO_TO_ONE\ncutoff=cutoff_opacity(u_cutoff_params,ground.z*2.0-ground.w);\n#else\ncutoff=cutoff_opacity(u_cutoff_params,ground.z);\n#endif\nif (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale);\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0));\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\ngl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#endif\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);float ndotl=calculate_NdotL(normal);v_flat.rgb=sRGBToLinear(color.rgb);v_flat.rgb=v_flat.rgb*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);v_flat=vec4(linearTosRGB(v_flat.rgb),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillExtrusionDepth:Jn("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale;\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nin vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp vec4 color\nout highp float v_depth;void main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp vec4 color\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nvec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;float ele=elevation(pos_nx.xy);float c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);float h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);v_depth=gl_Position.z/gl_Position.w;}'),fillExtrusionPattern:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\nin highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,height);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_width_scale;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nout highp vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\n#pragma mapbox: define highp float line_width\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\n#pragma mapbox: initialize highp float line_width\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);p.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;p.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_normal=normal;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}'),groundShadow:Jn('#include "_prelude_shadow.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor_plane_bias(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\n#ifdef INDICATOR_CUTOUT\nshadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0),0.0).r);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos);\n#endif\n}'),fillExtrusionGroundEffect:Jn("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;\n#endif\nHANDLE_WIREFRAME_DEBUG;\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao;\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=a_angular_offset_factor/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=a_hidden_by_landmark;\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),hillshadePrepare:Jn("precision highp float;uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),line:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_floor_width_scale;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec3 v_uv;\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;in vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nfloat linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture(u_dash_image,v_tex).r;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;float scaled_floorwidth=(floorwidth*u_floor_width_scale);alpha*=linearstep(0.5-sdfgamma/scaled_floorwidth,0.5+sdfgamma/scaled_floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trim_alpha=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);out_color=mix(out_color,u_trim_color,transition_factor);trim_alpha=1.0-transition_factor;}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=((border_width*u_width_scale)+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) {float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color=mix(border_color*trim_alpha,out_color,smoothAlpha);}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*opacity);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH)\nin vec3 a_z_offset_width;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nin highp vec3 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;uniform float u_width_scale;uniform highp float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec3 v_uv;\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth;\n#ifdef VARIABLE_LINE_WIDTH\nfloat left=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);halfwidth=(u_width_scale*(left==1.0 ? a_z_offset_width.y : a_z_offset_width.z))/2.0;\n#else\nhalfwidth=(u_width_scale*width)/2.0;\n#endif\noffset=-1.0*offset*u_width_scale;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat epsilon=0.0001;float extrude_length_without_perspective=max(length(dist),epsilon);float extrude_length_with_perspective=max(length(projected_extrude_xy/gl_Position.w*u_units_to_pixels),epsilon);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nhighp float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float line_progress=a_packed[2];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec3(a_uv_x,a_split_index*texel_height-half_texel_height,line_progress);\n#else\nv_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/(floorwidth*u_floor_width_scale),(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),linePattern:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_alpha_discard_threshold;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;uniform sampler2D u_image;\n#ifdef LINE_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef LINE_JOIN_NONE\nin vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nuniform float u_emissive_strength;\n#pragma mapbox: define mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;highp float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LINE_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl*texel_size-texel_size,pattern_b_br*texel_size+texel_size,vec2(x,y));vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);color=color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);color=mix(color,color.a*u_trim_color,transition_factor);}\n#endif\n#ifdef LINE_JOIN_NONE\nhighp float pattern_len=pattern_size/aspect;highp float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);highp float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;highp float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);}\n#endif\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_with_emission_ground(color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\ncolor.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\ncolor.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}}\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,v_z_offset);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\nin vec3 a_z_offset_width;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 a_packed;\n#endif\nin highp float a_linesofar;\n#ifdef LINE_JOIN_NONE\nin highp vec3 a_pattern_data;out vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nout highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define mediump float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float floorwidth\n#pragma mapbox: define mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize mediump float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=(u_width_scale*width)/2.0;offset=-1.0*offset*u_width_scale;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude_xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale);\n#ifdef LINE_JOIN_NONE\nv_width=(floorwidth*u_floor_width_scale)+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/((pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),raster:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nin float v_split_fade;\n#endif\nuniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;\n#ifdef GLOBE_POLES\ncolor.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);\n#endif\nvec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef PROJECTION_GLOBE_VIEW\nglFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));\n#endif\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;in vec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nout float v_split_fade;\n#endif\nvoid main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos ,1.0);uv=a_uv;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\nfloat w=1.0+dot(a_texture_pos,u_perspective_transform);uv=a_texture_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]); \nv_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}float tiles=u_grid_matrix[0][2];if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\ngl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),rasterParticle:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),0.0).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\nin vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nuv=a_texture_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}'),rasterParticleDraw:Jn("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",'#include "_prelude_raster_particle.glsl"\nin float a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2(\nmod(a_index,u_particle_texture_side_len),a_index/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}'),rasterParticleTexture:Jn("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in vec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*a_pos+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:Jn('#include "_prelude_raster_particle.glsl"\nuniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow(\nlinearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4)\n);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}',"in vec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*(a_pos+vec2(1.0));gl_Position=vec4(a_pos,0.0,1.0);}"),symbol:Jn('#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;uniform lowp float u_scale_factor;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\n#ifdef COLOR_ADJUSTMENT\nuniform mat4 u_color_adj_mat;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#else\n#ifdef RENDER_SHADOWS\nin highp float v_z_offset;\n#endif\n#endif\nin vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\nin float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nin float is_sdf;in vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nvec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2];\n#ifdef RENDER_TEXT_AND_SYMBOL\nif (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity;glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}\n#endif\n#ifdef RENDER_SDF\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*u_scale_factor*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width*u_scale_factor/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha;\n#else\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b);\n#else\nout_color=texture(u_texture,v_tex_a);\n#endif\n#ifdef COLOR_ADJUSTMENT\nout_color=u_color_adj_mat*out_color;\n#endif\n#endif\nout_color*=opacity*fade_opacity;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef TERRAIN\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#else\nout_color.rgb*=mix(v_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_auto_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin vec2 a_texb;\n#endif\n#ifdef OCCLUSION_QUERIES\nin float a_occlusion_query_opacity;\n#endif\n#ifdef ELEVATED_ROADS\nin vec3 a_x_axis;in vec3 a_y_axis;uniform float u_normal_scale;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#else\n#ifdef RENDER_SHADOWS\nout highp float v_z_offset;\n#endif\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_elevation_from_sea;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nout float is_sdf;out vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\n#pragma mapbox: define lowp float occlusion_opacity\n#pragma mapbox: define lowp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\n#pragma mapbox: initialize lowp float occlusion_opacity\n#pragma mapbox: initialize lowp float z_offset\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_auto_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=a_globe_anchor+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w;\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;\n#endif\nvec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\n#ifdef PROJECTED_POS_ON_VIEWPORT\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0);\n#else\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz,mercator_pos,u_zoom_transition)+h;projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); \n#endif\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\n#ifdef Z_OFFSET\nz+=u_pitch_with_map ? a_auto_z_offset+z_offset : 0.0;\n#else\nz+=u_pitch_with_map ? z_offset : 0.0;\n#endif\nfloat occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));\n#ifdef DEPTH_OCCLUSION\nfloat depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier;\n#endif\n#ifdef OCCLUSION_QUERIES\nfloat occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier;\n#endif\nfloat alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\n#ifdef ELEVATED_ROADS\nvec3 xAxis=vec3(a_x_axis.xy,a_x_axis.z*u_normal_scale);vec3 yAxis=vec3(a_y_axis.xy,a_y_axis.z*u_normal_scale);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\npos=vec3(projected_pos.xy/projected_pos.w+offset,z);\n#endif\n#endif\ngl_Position=mix(u_coord_matrix*vec4(pos,1.0),AWAY,hidden);float gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize;\n#ifdef RENDER_TEXT_AND_SYMBOL\nis_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon;\n#endif\n#ifdef ICON_TRANSITION\nv_tex_b=a_texb/u_texsize;\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shd_pos=u_inv_matrix*vec4(pos,1.0);vec3 shd_pos0=shd_pos.xyz;vec3 shd_pos1=shd_pos.xyz;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=e;\n#else\n#ifdef RENDER_SHADOWS\nv_z_offset=e;\n#endif\n#endif\n}'),terrainRaster:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;in vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nvec3 unlit_base=image_color.rgb*(1.0-image_color.a);vec3 emissive_base=image_color.rgb*image_color.a;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor.rgb=mix(color.rgb,image_color.rgb,image_color.a);color.a=1.0;\n#endif\n#endif\n#else\ncolor=image_color;\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);\n#endif\n}'),terrainDepth:Jn("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;out float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}'),skybox:Jn('#include "_prelude_fog.fragment.glsl"\nin lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',zn),skyboxGradient:Jn('#include "_prelude_fog.fragment.glsl"\nin highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',zn),skyboxCapture:Jn("\nin highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float;\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;uniform float u_far_z_cutoff;in vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nhighp vec2 uv=gl_FragCoord.xy/u_viewport;\n#ifdef FLIP_Y\nuv.y=1.0-uv.y;\n#endif\nhighp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;highp float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);highp float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nraster=apply_lighting_with_emission_ground(raster,raster.a);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias);\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor=apply_lighting_with_emission_ground(color,color.a);color.a=1.0;\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;\n#endif\nout vec2 v_pos0;void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);globe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}'),globeAtmosphere:Jn('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\n#ifdef NATIVE\nglFragColor=vec4(1,1,1,1);\n#else\nglFragColor=vec4(0,0,0,1);\n#endif\nreturn;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;\n#ifdef ALPHA_PASS\nfloat a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;glFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}"),model:Jn('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_opacity;uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nuniform vec4 u_occlusionTextureTransform;\n#endif\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_pbr\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nin highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack;\n#ifdef DEPTH_D24\nhighp float unpack_depth(highp float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}\n#else\nhighp float unpack_depth_rgba(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size;\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depthTexture,coord).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depthTexture,coord));\n#endif\nreturn v_depth > depth+0.0005;}\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-lightColor),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\nif(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0;\n#endif\nif(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}\n#endif\nvec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\nreturn color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;\n#ifdef FLIP_Y\nT=-T;B=-B;\n#endif\nhighp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_3f\nn=normalize(normal_3f);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));\n#ifdef FLIP_Y\nn=normalize(cross(fdx,fdy));\n#else\nn=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_pbr\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) \nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*lightColor;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nif (isOccluded()) {discard;}\n#endif\nvec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nvec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;\n#else\nvec2 uv=uv_2f;\n#endif\nao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nfloat emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength;\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_pbr\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb;\n#ifdef APPLY_LUT_ON_GPU\ncolor_mix=applyLUT(u_lutTexture,color_mix);\n#endif\ncolor=mix(color,color_mix,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nfinalColor=applyCutout(finalColor,v_position_height.w);\n#endif\n#ifdef FEATURE_CUTOUT\nfinalColor=apply_feature_cutout(finalColor,gl_FragCoord);\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr\n#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength\nuniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nout highp float v_depth;\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp vec4 pbr\n#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_pbr\nvec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);\n#else\nnormal_3f=vec3(normal_matrix*vec4(normal_3f,0));\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:Jn("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden);\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\nv_depth=gl_Position.z/gl_Position.w;}"),stars:Jn("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_fade_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}"),snowParticle:Jn("in highp vec2 uv;in highp float alphaMultiplier;uniform vec4 u_particleColor;uniform vec2 u_simpleShapeParameters;void main() {float t=clamp((length(uv)-u_simpleShapeParameters.x)/(1.0-u_simpleShapeParameters.x),0.0,1.0);float alpha=1.0-pow(t,pow(10.0,u_simpleShapeParameters.y));alpha*=alphaMultiplier;alpha*=u_particleColor.a;vec3 color=u_particleColor.rgb*alpha;glFragColor=vec4(color,alpha) ;HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_snowParticleData;in highp vec4 a_snowParticleDataHorizontalOscillation;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform vec2 u_screenSize;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; \nuniform float u_horizontalOscillationRate; \nuniform float u_billboardSize;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;out highp vec2 uv;out highp float alphaMultiplier;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos.xyz*=halfBoxSize;pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_snowParticleData.z;float coneAngleHeadingRad=a_snowParticleData.w*radians(360.0);vec3 localZ=normalize(u_direction);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 direction;direction.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.z=cos(coneAnglePichRad);direction=normalize(direction);vec3 simPosLocal=vec3(0,0,0);float velocityScale=(1.0+3.0*a_snowParticleData.y)*u_velocity;simPosLocal+=direction*velocityScale*u_time;float horizontalOscillationRadius=u_horizontalOscillationRadius*a_snowParticleDataHorizontalOscillation.x;float horizontalOscillationAngle=u_horizontalOscillationRate*u_time*(-1.0+2.0*a_snowParticleDataHorizontalOscillation.y);simPosLocal.xy+=horizontalOscillationRadius*vec2(cos(horizontalOscillationAngle),sin(horizontalOscillationAngle));vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);float clipZ=-u_cam_pos.z+pos.z;vec4 posView=u_modelview*vec4(pos,1.0);float size=u_billboardSize;alphaMultiplier=1.0;vec4 posScreen=u_projection*posView;posScreen/=posScreen.w;posScreen.xy=vec2(0.5)+posScreen.xy*0.5;posScreen.xy*=u_screenSize;vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=u_screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-posScreen.xy)/(0.5*u_screenSize));screenDist+=a_snowParticleData.x*u_thinningParticleOffset;float scaleFactorMode=0.0;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);if (a_snowParticleData.x < u_thinningAffectedRatio) {scaleFactorMode=1.0-thinningFadeRatio;alphaMultiplier=thinningFadeRatio;}}vec4 posScreen1=u_projection*vec4(posView.x-size,posView.yzw);posScreen1/=posScreen1.w;vec4 posScreen2=u_projection*vec4(posView.x+size,posView.yzw);posScreen2/=posScreen2.w;posScreen1.xy=vec2(0.5)+posScreen1.xy*0.5;posScreen1.xy*=u_screenSize;posScreen2.xy=vec2(0.5)+posScreen2.xy*0.5;posScreen2.xy*=u_screenSize;float screenLength=length(posScreen1.xy-posScreen2.xy);float screenEpsilon=3.0;float scaleFactor=1.0;if (screenLength < screenEpsilon) {scaleFactor=screenEpsilon/max(screenLength,0.01);scaleFactor=mix(scaleFactor,1.0,scaleFactorMode);}float screenEpsilon2=15.0;if (screenLength > screenEpsilon2) {scaleFactor=screenEpsilon2/max(screenLength,0.01);}size*=scaleFactor;vec2 right=size*vec2(1,0);vec2 up=size*vec2(0,1);posView.xy+=right*a_uv.x;posView.xy+=up*a_uv.y;uv=a_uv;gl_Position=u_projection*posView;}"),rainParticle:Jn("in highp vec2 uv;in highp float particleRandomValue;uniform sampler2D u_texScreen;uniform float u_distortionStrength;uniform vec4 u_color;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;uniform float u_shapeDirectionalPower;uniform float u_mode;void main() {vec2 st=uv*0.5+vec2(0.5);vec2 uvm=uv;uvm.y=-1.0+2.0*pow(st.y,u_shapeDirectionalPower);float shape=clamp(1.0-length(uvm),0.0,1.0);float alpha=abs(shape)*u_color.a;vec2 screenSize=vec2(textureSize(u_texScreen,0));vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-gl_FragCoord.xy)/(0.5*screenSize));screenDist+=(0.5+0.5*particleRandomValue)*u_thinningParticleOffset;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;float thinningAlpha=1.0;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);thinningAlpha*=thinningFadeRatio;}vec2 offsetXY=normalize(uvm)*abs(shape);vec2 stScreen=(gl_FragCoord.xy+offsetXY*u_distortionStrength*thinningAlpha)/screenSize;vec3 colorScreen=texture(u_texScreen,stScreen).rgb;alpha*=thinningAlpha;glFragColor=mix(vec4(colorScreen,1.0),vec4(u_color.rgb*alpha,alpha),u_mode);HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_rainParticleData;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity; \nuniform vec2 u_rainDropletSize;uniform vec3 u_rainDirection;out highp vec2 uv;out highp float particleRandomValue;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos*=halfBoxSize; \npos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_rainParticleData.z;float coneAngleHeadingRad=a_rainParticleData.w*radians(360.0);vec3 localZ=normalize(u_rainDirection);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 directionLocal;directionLocal.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.z=cos(coneAnglePichRad);directionLocal=normalize(directionLocal);vec3 directionWorld=localX*directionLocal.x+localY*directionLocal.y+localZ*directionLocal.z;float velocityScale=(1.0+3.0*a_rainParticleData.y)*u_velocity;vec3 simPosLocal=vec3(0,0,0);simPosLocal+=directionLocal*velocityScale*u_time;vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);vec4 posView=u_modelview*vec4(pos,1.0);vec3 directionView=normalize((u_modelview*vec4(directionWorld,0.0)).xyz);vec3 side=cross(directionView,normalize(posView.xyz));posView.xyz+=side*a_uv.x*u_rainDropletSize.x;posView.xyz+=directionView*a_uv.y*u_rainDropletSize.y;uv=a_uv;particleRandomValue=a_rainParticleData.x;gl_Position=u_projection*posView;}"),vignette:Jn("uniform vec3 u_vignetteShape;uniform vec4 u_vignetteColor;in vec2 st;void main() {float screenDist=length(st);float alpha=clamp((screenDist-u_vignetteShape.x)/u_vignetteShape.y,0.0,1.0);alpha=pow(alpha,u_vignetteShape.z)*u_vignetteColor.a;vec3 color=u_vignetteColor.rgb;glFragColor=vec4(color*alpha,alpha) ;}","in vec2 a_pos_2f;out vec2 st;void main() {st=a_pos_2f;gl_Position=vec4(a_pos_2f,0,1);}"),occlusion:Jn("uniform vec4 u_color;void main() {glFragColor=u_color;}",'#include "_prelude_terrain.vertex.glsl"\nin highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos;\n#ifdef TERRAIN\nfloat e=elevation(world_pos.xy);world_pos.z+=e;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}')};function Zn(e,t){const i=e.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let e of i)if(e=e.trim(),"#"===e[0]&&e.includes("if")&&!e.includes("endif")){e=e.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const i=e.split(" ");for(const e of i)t.includes(e)||t.push(e)}}function Jn(e,t){const i=/#include\s+"([^"]+)"/g,n=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g;let r=t.match(/(attribute(\S*)|(^\s*|;)in) (highp |mediump |lowp )?([\w]+) ([\w]+)/gm);r&&(r=r.map(e=>{const t=e.split(" ");return t[t.length-1]}),r=[...new Set(r)]);const s={},o=[],a=[];if(e=e.replace(i,(e,t)=>(a.push(t),"")),(t=t.replace(i,(e,t)=>(o.push(t),""))).includes("flat out"))return void console.error('The usage of "flat" qualifier is disallowed, see: https://bugs.webkit.org/show_bug.cgi?id=268071');let l=[...Wn];Zn(e,l),Zn(t,l);for(const e of[...o,...a])Un[e]||console.error(`Undefined include: ${e}`),$n[e]||($n[e]=[],Zn(Un[e],$n[e])),l=[...l,...$n[e]];return{fragmentSource:e=e.replace(n,(e,t,i,n,r)=>(s[r]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${r}\nin ${i} ${n} ${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"initialize"===t?`\n#ifdef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = u_${r};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${r}\n in ${i} ${n} ${r};\n#endif\n`:"initialize-attribute"===t?"":void 0)),vertexSource:t=t.replace(n,(e,t,i,n,r)=>{const o="float"===n?"vec2":n,a=r.match(/color/)?"color":o;return"define-attribute-vertex-shader-only"===t?`\n#ifdef HAS_ATTRIBUTE_a_${r}\nin ${i} ${n} a_${r};\n#endif\n`:s[r]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${r}\nuniform lowp float u_${r}_t;\nin ${i} ${o} a_${r};\nout ${i} ${n} ${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"initialize"===t?"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${r}\n ${r} = a_${r};\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${r}\n ${r} = unpack_mix_${a}(a_${r}, u_${r}_t);\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${r}\n in ${i} ${n} a_${r};\n out ${i} ${n} ${r};\n#endif\n`:"initialize-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${r}\n ${r} = a_${r};\n#endif\n`:void 0:"define"===t?`\n#ifndef HAS_UNIFORM_u_${r}\nuniform lowp float u_${r}_t;\nin ${i} ${o} a_${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"define-instanced"===t?"mat4"===a?`\n#ifdef INSTANCED_ARRAYS\nin vec4 a_${r}0;\nin vec4 a_${r}1;\nin vec4 a_${r}2;\nin vec4 a_${r}3;\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:`\n#ifdef INSTANCED_ARRAYS\nin ${i} ${o} a_${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"initialize-attribute-custom"===t?`\n#ifdef HAS_ATTRIBUTE_a_${r}\n ${i} ${n} ${r} = a_${r};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = a_${r};\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = unpack_mix_${a}(a_${r}, u_${r}_t);\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`}),staticAttributes:r,usedDefines:l,vertexIncludes:o,fragmentIncludes:a}}class Kn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(e,t,i,n,r,s,o,a){this.context=e;let l=this.boundPaintVertexBuffers.length!==n.length;for(let e=0;!l&&e<n.length;e++)this.boundPaintVertexBuffers[e]!==n[e]&&(l=!0);let c=this.boundDynamicVertexBuffers.length!==o.length;for(let e=0;!c&&e<o.length;e++)this.boundDynamicVertexBuffers[e]!==o[e]&&(c=!0);if(!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==i||l||c||this.boundIndexBuffer!==r||this.boundVertexOffset!==s)this.freshBind(t,i,n,r,s,o,a);else{e.bindVertexArrayOES.set(this.vao);for(const i of o)i&&(i.bind(),a&&i.instanceCount&&i.setVertexAttribDivisor(e.gl,t,a));r&&r.dynamicDraw&&r.bind()}}freshBind(e,t,i,n,r,s,o){const a=e.numAttributes,l=this.context,c=l.gl;this.vao&&this.destroy(),this.vao=l.gl.createVertexArray(),l.bindVertexArrayOES.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=r,this.boundDynamicVertexBuffers=s,t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,r);for(const t of i)t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,r);for(const t of s)t&&(t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,r),o&&t.instanceCount&&t.setVertexAttribDivisor(c,e,o));n&&n.bind(),l.currentNumAttributes=a}destroy(){this.vao&&(this.context.gl.deleteVertexArray(this.vao),this.vao=null)}}function Qn(t,i){const n=Math.pow(2,i.canonical.z),r=i.canonical.y;return[new e.ac(0,r/n).toLngLat().lat,new e.ac(0,(r+1)/n).toLngLat().lat]}function er(t,i,n,r,s,o,a){const l=t.context,c=l.gl,h=n.hillshadeFBO;if(!h)return;t.prepareDrawTile();const d=t.isTileAffectedByFog(i),u=t.getOrCreateProgram("hillshade",{overrideFog:d});l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,h.colorAttachment.get());const f=((t,i,n,r)=>{const s=n.paint.get("hillshade-shadow-color"),o="none"===n.paint.get("hillshade-shadow-color-use-theme").constantOr("default"),a=n.paint.get("hillshade-highlight-color"),l="none"===n.paint.get("hillshade-highlight-color-use-theme").constantOr("default"),c=n.paint.get("hillshade-accent-color"),h="none"===n.paint.get("hillshade-accent-color-use-theme").constantOr("default"),d=n.paint.get("hillshade-emissive-strength");let u=e.al(n.paint.get("hillshade-illumination-direction"));if("viewport"===n.paint.get("hillshade-illumination-anchor"))u-=t.transform.angle;else if(t.style&&t.style.enable3dLights()&&t.style.directionalLight){const i=t.style.directionalLight.properties.get("direction"),n=e.d1(i.x,i.y,i.z);u=e.al(n[1])}const f=!t.options.moving;return{u_matrix:r||t.transform.calculateProjMatrix(i.tileID.toUnwrapped(),f),u_image:0,u_latrange:Qn(0,i.tileID),u_light:[n.paint.get("hillshade-exaggeration"),u],u_shadow:s.toPremultipliedRenderColor(o?null:n.lut),u_highlight:a.toPremultipliedRenderColor(l?null:n.lut),u_emissive_strength:d,u_accent:c.toPremultipliedRenderColor(h?null:n.lut)}})(t,n,r,t.terrain?i.projMatrix:null);t.uploadCommonUniforms(l,u,i.toUnwrapped());const{tileBoundsBuffer:p,tileBoundsIndexBuffer:m,tileBoundsSegments:g}=t.getTileBoundsBuffers(n);u.draw(t,c.TRIANGLES,s,o,a,Wi.disabled,f,r.id,p,m,g)}function tr(t,i,n){if(!i.needsDEMTextureUpload)return;const r=t.context,s=r.gl;r.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||t.getTileTexture(n.stride);const o=n.getPixels();i.demTexture?i.demTexture.update(o,{premultiply:!1}):i.demTexture=new e.T(r,o,s.R32F,{premultiply:!1}),i.needsDEMTextureUpload=!1}function ir(t,i,n){const r=t.context,s=r.gl;if(!i.dem)return;const o=i.dem;if(r.activeTexture.set(s.TEXTURE1),tr(t,i,o),!i.demTexture)return;i.demTexture.bind(s.NEAREST,s.CLAMP_TO_EDGE);const a=o.dim;r.activeTexture.set(s.TEXTURE0);let l=i.hillshadeFBO;if(!l){const t=new e.T(r,{width:a,height:a,data:null},s.RGBA8);t.bind(s.LINEAR,s.CLAMP_TO_EDGE),l=i.hillshadeFBO=r.createFramebuffer(a,a,!0,"renderbuffer"),l.colorAttachment.set(t.texture)}r.bindFramebuffer.set(l.framebuffer),r.viewport.set([0,0,a,a]);const{tileBoundsBuffer:c,tileBoundsIndexBuffer:h,tileBoundsSegments:d}=t.getMercatorTileBoundsBuffers(),u=[];t.linearFloatFilteringSupported()&&u.push("TERRAIN_DEM_FLOAT_FORMAT"),t.getOrCreateProgram("hillshadePrepare",{defines:u}).draw(t,s.TRIANGLES,Yi.disabled,Hi.disabled,Ni.unblended,Wi.disabled,((t,i)=>{const n=i.stride,r=e.bz();return e.ca(r,0,e.aj,-e.aj,0,0,1),e.bo(r,r,[0,-e.aj,0]),{u_matrix:r,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ}})(i.tileID,o),n.id,c,h,d),i.needsHillshadePrepare=!1}class nr{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class rr extends nr{getDefault(){return e.am.transparent.toNonPremultipliedRenderColor(null)}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class sr extends nr{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class or extends nr{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class ar extends nr{getDefault(){return[!0,!0,!0,!0]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class lr extends nr{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class cr extends nr{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class hr extends nr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class dr extends nr{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class ur extends nr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class fr extends nr{getDefault(){return[0,1]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class pr extends nr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class mr extends nr{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class gr extends nr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class _r extends nr{getDefault(){const e=this.gl;return[e.ONE,e.ZERO,e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.blendFuncSeparate(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class yr extends nr{getDefault(){return e.am.transparent.toNonPremultipliedRenderColor(null)}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class vr extends nr{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(e,e),this.current=e,this.dirty=!1)}}class xr extends nr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class br extends nr{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class wr extends nr{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}let Sr=class extends nr{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}};class Tr extends nr{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class kr extends nr{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Mr extends nr{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class Ar extends nr{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Cr extends nr{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class Dr extends nr{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Lr extends nr{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Er extends nr{getDefault(){return null}set(e){this.gl&&(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}}class Ir extends nr{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class Pr extends nr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class Rr extends nr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class Or extends nr{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class zr extends Or{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class Fr extends Or{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,this.attachment(),t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Nr extends Or{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,this.attachment(),t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class Yr extends Fr{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const Br=(e,t,i)=>({u_matrix:e,u_image0:0,u_skirt_height:t,u_ground_shadow_factor:i}),Hr=(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m)=>({u_proj_matrix:Float32Array.from(e),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(n),u_merc_matrix:i,u_zoom_transition:r,u_merc_center:s,u_image0:0,u_frustum_tl:o,u_frustum_tr:a,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:h,u_globe_radius:d,u_viewport:u,u_grid_matrix:m?Float32Array.from(m):new Float32Array(9),u_skirt_height:f,u_far_z_cutoff:p});function jr(e,t){return null!=e&&null!=t&&!(!e.hasData()||!t.hasData())&&null!=e.demTexture&&null!=t.demTexture&&e.tileID.key!==t.tileID.key}const Vr=new class{constructor(){this.operations={}}newMorphing(e,t,i,n,r){if(e in this.operations){const t=this.operations[e];t.to.tileID.key!==i.tileID.key&&(t.queued=i)}else this.operations[e]={startTime:n,phase:0,duration:r,from:t,to:i,queued:null}}getMorphValuesForProxy(e){if(!(e in this.operations))return null;const t=this.operations[e];return{from:t.from,to:t.to,phase:t.phase}}update(e){for(const t in this.operations){const i=this.operations[t];for(i.phase=(e-i.startTime)/i.duration;i.phase>=1||!this._validOp(i);)if(!this._nextOp(i,e)){delete this.operations[t];break}}}_nextOp(e,t){return!!e.queued&&(e.from=e.to,e.to=e.queued,e.queued=null,e.phase=0,e.startTime=t,!0)}_validOp(e){return e.from.hasData()&&e.to.hasData()}},Wr={0:null,1:"TERRAIN_VERTEX_MORPHING"};function Ur(e,t,i){if(0===t)return 0;const n=t<1&&514===i?.25/t:1;return 6*Math.pow(1.5,22-e)*Math.max(t,1)*n}function $r(e,t){const i=1<<e.z;return!t&&(0===e.x||e.x===i-1)||0===e.y||e.y===i-1}const Gr=e=>({u_matrix:e});function Xr(t,i,n,r,s){if(s>0){const o=e.q.now(),a=(o-t.timeAdded)/s,l=i?(o-i.timeAdded)/s:-1,c=n.getSource(),h=r.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),d=!i||Math.abs(i.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),u=d&&t.refreshedUponExpiration?1:e.ay(d?a:1-l,0,1);return t.refreshedUponExpiration&&a>=1&&(t.refreshedUponExpiration=!1),i?{opacity:1,mix:1-u}:{opacity:u,mix:0}}return{opacity:1,mix:0}}class qr extends Tt{constructor(e){const t=rt("mock-dem",{type:"raster-dem",maxzoom:e.transform.maxZoom},e.style.dispatcher,e.style);super("mock-dem",t,!1),t.setEventedParent(this),this._sourceLoaded=!0}_loadTile(e,t){e.state="loaded",t(null)}}class Zr extends Tt{constructor(e){const t=rt("proxy",{type:"geojson",maxzoom:e.transform.maxZoom},e.style.dispatcher,e.style);super("proxy",t,!1),t.setEventedParent(this),this.map=this.getSource().map=e,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(e,t,i){if(e.freezeTileCoverage)return;this.transform=e;const n=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((t,i)=>{if(t[i.key]="",!this._tiles[i.key]){const t=new xt(i,this._source.tileSize*i.overscaleFactor(),e.tileZoom,void 0,void 0,this._source.worldview);t.state="loaded",this._tiles[i.key]=t}return t},{});for(const e in this._tiles)e in n||(this.freeFBO(e),this._tiles[e].unloadVectorData(),delete this._tiles[e])}freeFBO(e){const t=this.proxyCachedFBO[e];if(void 0!==t){const i=Object.values(t);this.renderCachePool.push(...i),delete this.proxyCachedFBO[e]}}deallocRenderCache(){this.renderCache.forEach(e=>e.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Jr extends e.aM{constructor(e,t,i){super(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y),this.proxyTileKey=t,this.projMatrix=i}}class Kr extends e.dF{constructor(t,i){super(),this._debugParams={sortTilesHiZFirst:!0,disableRenderCache:!1},t.tp.registerParameter(this._debugParams,["Terrain"],"sortTilesHiZFirst",{},()=>{this._style.map.triggerRepaint()}),t.tp.registerParameter(this._debugParams,["Terrain"],"disableRenderCache",{},()=>{this._style.map.triggerRepaint()}),t.tp.registerButton(["Terrain"],"Invalidate Render Cache",()=>{this.invalidateRenderCache=!0,this._style.map.triggerRepaint()}),this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[n,r,s]=function(){const t=new e.ba,i=new e.a_,n=131;t.reserve(17161),i.reserve(33800);const r=e.aj/128,s=e.aj+r/2,o=s+r;for(let i=-r;i<o;i+=r)for(let n=-r;n<o;n+=r){const r=n<0||n>s||i<0||i>s?24575:0,o=e.ay(Math.round(n),0,e.aj),a=e.ay(Math.round(i),0,e.aj);t.emplaceBack(o+r,a)}const a=(e,t)=>{const r=t*n+e;i.emplaceBack(r+1,r,r+n),i.emplaceBack(r+n,r+n+1,r+1)};for(let e=1;e<129;e++)for(let t=1;t<129;t++)a(t,e);return[0,129].forEach(e=>{for(let t=0;t<130;t++)a(t,e),a(e,t)}),[t,i,32768]}(),o=t.context;this.gridBuffer=o.createVertexBuffer(n,e.bc.members),this.gridIndexBuffer=o.createIndexBuffer(r),this.gridSegments=e.bd.simpleSegment(0,0,n.length,r.length),this.gridNoSkirtSegments=e.bd.simpleSegment(0,0,n.length,s),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Zr(i.map),this.orthoMatrix=e.bz(),e.ca(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,e.aj,0,e.aj,0,1);const a=o.gl;this._overlapStencilMode=new Hi({func:a.GEQUAL,mask:255},0,255,a.KEEP,a.KEEP,a.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=i,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new qr(i.map),this._pendingGroundEffectLayers=[]}set style(e){e.on("data",this._onStyleDataEvent.bind(this)),this._style=e,this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(t,i,n){if(t&&t.terrain){this._style!==t&&(this.style=t,this._evaluationZoom=void 0);const r=t.terrain.properties,s=0===t.terrain.drapeRenderMode,o=t.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=e.q.now();const a=t.terrain&&t.terrain.scope,l=r.get("source"),c=s?this._mockSourceCache:t.getSourceCache(l,a);if(!c)return void e.w(`Couldn't find terrain source "${l}".`);if(this.sourceCache=c,this._attenuationRange=t.terrain.getAttenuationRange(),this._exaggeration=o?this.calculateExaggeration(i):r.get("exaggeration"),!i.projection.requiresDraping&&o&&0===this._exaggeration)return void this._disable();this.enabled=!0;const h=()=>{this.sourceCache.used&&e.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const t=this.getScaledDemTileSize();this.sourceCache.update(i,t,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,h(),this._initializing=!0),h(),i.updateElevation(!0,n),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(i),this._emptyDEMTextureDirty=!0,this._previousZoom=i.zoom}else this._disable()}calculateExaggeration(t){if(this._attenuationRange&&t.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(t.zoom);const i=this._previousCameraAltitude,n=t.getFreeCameraOptions().position.z/t.pixelsPerMeter*t.worldSize;this._previousCameraAltitude=n;const r=null!=i?n-i:Number.MAX_VALUE;if(Math.abs(r)<2)return this._exaggeration;const s=t.zoom,o=this._style.terrain;if(!this._previousUpdateTimestamp)return o.getExaggeration(s);let a=s-this._previousZoom;const l=this._previousUpdateTimestamp;let c=s;null!=this._evaluationZoom&&(c=this._evaluationZoom,Math.abs(s-c)>.5&&(a=.5*(s-c+a)),a*r<0&&(c+=a)),this._evaluationZoom=c;const h=o.getExaggeration(c),d=h===o.getExaggeration(Math.max(0,c-.1));if(d&&Math.abs(h-this._exaggeration)<.01)return h;let u=Math.min(.1,.00375*(this._updateTimestamp-l));return(d||h<.1||Math.abs(a)<1e-4)&&(u=Math.min(.2,4*u)),e.ai(this._exaggeration,h,u)}resetTileLookupCache(e){this._findCoveringTileCache[e]={}}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(e){e.coord&&"source"===e.dataType?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const e in this._style._mergedSourceCaches)this._style._mergedSourceCaches[e].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach(e=>e.fb.destroy()),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const e=2*this.proxySourceCache.getSource().tileSize;return[e,e]}set useVertexMorphing(e){this._useVertexMorphing=e}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const i=this.proxySourceCache,n=this.painter.transform;this._initializing&&(this._initializing=0===n._centerAltitude&&-1===this.getAtPointOrZero(e.ac.fromLngLat(n.center),-1),this._emptyDEMTextureDirty=!this._initializing);const r=this.proxyCoords=i.getIds().map(e=>{const t=i.getTileByID(e).tileID;return t.projMatrix=n.calculateProjMatrix(t.toUnwrapped()),t});!function(t,i){const n=i.transform.pointCoordinate(i.transform.getCameraPoint()),r=new e.P(n.x,n.y);t.sort((t,i)=>{if(i.overscaledZ-t.overscaledZ)return i.overscaledZ-t.overscaledZ;const n=new e.P(t.canonical.x+(1<<t.canonical.z)*t.wrap,t.canonical.y),s=new e.P(i.canonical.x+(1<<i.canonical.z)*i.wrap,i.canonical.y),o=r.mult(1<<t.canonical.z);return o.x-=.5,o.y-=.5,o.distSqr(n)-o.distSqr(s)})}(r,this.painter);const s=this.proxyToSource||{};this.proxyToSource={},r.forEach(e=>{this.proxyToSource[e.key]={}}),this.terrainTileForTile={};const o=this._style._mergedSourceCaches;for(const e in o){const i=o[e];if(!i.used)continue;if(i!==this.sourceCache&&this.resetTileLookupCache(i.id),this._setupProxiedCoordsForOrtho(i,t[e],s),i.usedForTerrain)continue;const n=t[e];i.getSource().reparseOverscaled&&this._assignTerrainTiles(n)}this.proxiedCoords[i.id]=r.map(e=>new Jr(e,e.key,this.orthoMatrix)),this._assignTerrainTiles(r),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(s),this.renderingToTexture=!1;const a={};this._visibleDemTiles=[];for(const e of this.proxyCoords){const t=this.terrainTileForTile[e.key];if(!t)continue;const i=t.tileID.key;i in a||(this._visibleDemTiles.push(t),a[i]=i)}}_assignTerrainTiles(e){this._initializing||e.forEach(e=>{if(this.terrainTileForTile[e.key])return;const t=this._findTileCoveringTileID(e,this.sourceCache);t&&(this.terrainTileForTile[e.key]=t)})}_prepareDEMTextures(){const e=this.painter.context,t=e.gl;for(const i in this.terrainTileForTile){const n=this.terrainTileForTile[i],r=n.dem;!r||n.demTexture&&!n.needsDEMTextureUpload||(e.activeTexture.set(t.TEXTURE1),tr(this.painter,n,r))}}_prepareDemTileUniforms(e,t,i,n){if(!t||null==t.demTexture)return!1;const r=e.tileID.canonical,s=Math.pow(2,t.tileID.canonical.z-r.z),o=n||"";return i[`u_dem_tl${o}`]=[r.x*s%1,r.y*s%1],i[`u_dem_scale${o}`]=s,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let e=0;const t=this._visibleDemTiles.reduce((t,i)=>{if(!i.dem)return t;const n=i.dem.tree.minimums[0];return n>0&&e++,t+n},0);return e?t/e:0}_updateEmptyDEMTexture(){const t=this.painter.context,i=t.gl;t.activeTexture.set(i.TEXTURE2);const n=this._getLoadedAreaMinimum(),r=new e.dG({width:1,height:1},new Float32Array([n]));this._emptyDEMTextureDirty=!1;let s=this._emptyDEMTexture;return s?s.update(r,{premultiply:!1}):s=this._emptyDEMTexture=new e.T(t,r,i.R32F,{premultiply:!1}),s}setupElevationDraw(t,i,n){const r=this.painter.context,s=r.gl,o={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};o.u_exaggeration=this.exaggeration();let a=null,l=null,c=1;if(n&&n.morphing&&this._useVertexMorphing){const e=n.morphing.srcDemTile,i=n.morphing.dstDemTile;c=n.morphing.phase,e&&i&&(this._prepareDemTileUniforms(t,e,o,"_prev")&&(l=e),this._prepareDemTileUniforms(t,i,o)&&(a=i))}const h=e=>e&&e.demTexture&&this.painter.linearFloatFilteringSupported()?s.LINEAR:s.NEAREST;let d=null;var u;if(this.enabled?l&&a?(d=a.demTexture,r.activeTexture.set(s.TEXTURE4),l.demTexture.bind(h(l),s.CLAMP_TO_EDGE),o.u_dem_lerp=c):(a=this.terrainTileForTile[t.tileID.key],d=this._prepareDemTileUniforms(t,a,o)?a.demTexture:this.emptyDEMTexture):d=this.emptyDEMTexture,r.activeTexture.set(s.TEXTURE2),d&&(o.u_dem_size=1===(u=d).size[0]?1:u.size[0]-2,d.bind(h(a),s.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(n&&n.useDepthForOcclusion,i,o),n&&n.useMeterToDem&&a){const t=(1<<a.tileID.canonical.z)*e.cb(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;o.u_meter_to_dem=t}if(n&&n.labelPlaneMatrixInv&&(o.u_label_plane_matrix_inv=n.labelPlaneMatrixInv),i.setTerrainUniformValues(r,o),"globe"===this.painter.transform.projection.name){const e=this.globeUniformValues(this.painter.transform,t.tileID.canonical,n&&n.useDenormalizedUpVectorScale);i.setGlobeUniformValues(r,e)}}globeUniformValues(t,i,n){const r=t.projection;return{u_tile_tl_up:r.upVector(i,0,0),u_tile_tr_up:r.upVector(i,e.aj,0),u_tile_br_up:r.upVector(i,e.aj,e.aj),u_tile_bl_up:r.upVector(i,0,e.aj),u_tile_up_scale:n?e.dH(1):r.upVectorScale(i,t.center.lat,t.worldSize).metersToTile}}renderToBackBuffer(t){const i=this.painter,n=this.painter.context;0!==t.length&&(n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),i.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(t,i,n,r,s){if("globe"===t.transform.projection.name)!function(t,i,n,r,s){const o=t.context,a=o.gl;let l,c;const h=t.transform,d=e.dy(t,o,h),u=(e,i)=>{if(c===i)return;const n=[Wr[i],"PROJECTION_GLOBE_VIEW"];d&&n.push("CUSTOM_ANTIALIASING");const r=t.isTileAffectedByFog(e);l=t.getOrCreateProgram("globeRaster",{defines:n,overrideFog:r}),c=i},f=t.colorModeForRenderPass(),p=new Yi(a.LEQUAL,Yi.ReadWrite,t.depthRangeFor3D);Vr.update(s);const m=e.dz(h),g=[e.aD(h.center.lng),e.aH(h.center.lat)],_=t.globeSharedBuffers,y=[h.width*e.q.devicePixelRatio,h.height*e.q.devicePixelRatio],v=Float32Array.from(h.globeMatrix),x={useDenormalizedUpVectorScale:!0};{const h=t.transform,d=Ur(h.zoom,i.exaggeration(),i.sourceCache._source.tileSize);c=-1;const b=a.TRIANGLES;for(const c of r){const r=n.getTile(c),w=Hi.disabled,S=i.prevTerrainTileForTile[c.key],T=i.terrainTileForTile[c.key];jr(S,T)&&Vr.newMorphing(c.key,S,T,s,250),o.activeTexture.set(a.TEXTURE0),r.texture&&r.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const k=Vr.getMorphValuesForProxy(c.key),M=k?1:0;k&&e.L(x,{morphing:{srcDemTile:k.from,dstDemTile:k.to,phase:e.dx(k.phase)}});const A=e.dA(c.canonical),C=e.dB(A.getCenter().lat),D=e.dC(c.canonical,A,C,h.worldSize/h._pixelsPerMercatorPixel),L=e.bh(e.dD(c.canonical)),E=Hr(h.expandedFarZProjMatrix,v,m,L,e.ah(h.zoom),g,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,y,d,h._farZ,D);if(u(c,M),l&&(i.setupElevationDraw(r,l,x),t.uploadCommonUniforms(o,l,c.toUnwrapped()),_)){const[e,i,n]=_.getGridBuffers(C,0!==d);l.draw(t,b,p,w,f,Wi.backCCW,E,"globe_raster",e,i,n)}}}if(_&&(t.renderDefaultNorthPole||t.renderDefaultSouthPole)){const s=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];d&&s.push("CUSTOM_ANTIALIASING"),l=t.getOrCreateProgram("globeRaster",{defines:s});for(const s of r){const{x:r,y:c,z:d}=s.canonical,u=0===c,m=c===(1<<d)-1,[v,b,w,S]=_.getPoleBuffers(d,!1);if(S&&(u||m)){const c=n.getTile(s);o.activeTexture.set(a.TEXTURE0),c.texture&&c.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);let _=e.dE(d,r,h);const T=e.bh(e.dD(s.canonical)),k=(e,i)=>e.draw(t,a.TRIANGLES,p,Hi.disabled,f,Wi.disabled,Hr(h.expandedFarZProjMatrix,_,_,T,0,g,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,y,0,h._farZ),"globe_pole_raster",i,w,S);i.setupElevationDraw(c,l,x),t.uploadCommonUniforms(o,l,s.toUnwrapped()),u&&t.renderDefaultNorthPole&&k(l,v),m&&t.renderDefaultSouthPole&&(_=e.cP(e.bz(),_,[1,-1,1]),k(l,b))}}}}(t,i,n,r,s);else{const o=t.context,a=o.gl;let l,c;const h=t.shadowRenderer,d=an(t,t.longestCutoffRange),u=e=>{if(c===e)return;const i=[];i.push(Wr[e]),d.shouldRenderCutoff&&i.push("RENDER_CUTOFF"),h&&(i.push("RENDER_SHADOWS","DEPTH_TEXTURE"),h.useNormalOffset&&i.push("NORMAL_OFFSET")),l=t.getOrCreateProgram("terrainRaster",{defines:i}),c=e},f=t.colorModeForRenderPass(),p=new Yi(a.LEQUAL,Yi.ReadWrite,t.depthRangeFor3D);Vr.update(s);const m=t.transform,g=Ur(m.zoom,i.exaggeration(),i.sourceCache._source.tileSize);let _=[0,0,0];if(h){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(_=pn(t.style,e,i))}{c=-1;const y=a.TRIANGLES,[v,x]=[i.gridIndexBuffer,i.gridSegments];for(const c of r){const r=n.getTile(c),b=Hi.disabled,w=i.prevTerrainTileForTile[c.key],S=i.terrainTileForTile[c.key];jr(w,S)&&Vr.newMorphing(c.key,w,S,s,250),o.activeTexture.set(a.TEXTURE0),r.texture&&r.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const T=Vr.getMorphValuesForProxy(c.key),k=T?1:0;let M;T&&(M={morphing:{srcDemTile:T.from,dstDemTile:T.to,phase:e.dx(T.phase)}});const A=Br(c.projMatrix,$r(c.canonical,m.renderWorldCopies)?g/10:g,_);if(u(k),!l)continue;i.setupElevationDraw(r,l,M);const C=c.toUnwrapped();h&&h.setupShadows(C,l),t.uploadCommonUniforms(o,l,C,null,d),l.draw(t,y,p,b,f,Wi.backCCW,A,"terrain_raster",i.gridBuffer,v,x)}}}}(i,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,i.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(0===this._drapedRenderBatches.length)return t+1;this.renderingToTexture=!0;const i=this.painter,n=this.painter.context,r=this.proxySourceCache,s=this.proxiedCoords[r.id],o=this._drapedRenderBatches.shift(),a=i.style.order,l=[];let c=0;for(const h of s){const s=r.getTileByID(h.proxyTileKey),d=r.proxyCachedFBO[h.key]?r.proxyCachedFBO[h.key][t]:void 0,u=void 0!==d?r.renderCache[d]:this.pool[c++],f=void 0!==d;if(s.texture=u.tex,f&&!u.dirty){l.push(s.tileID);continue}let p;n.bindFramebuffer.set(u.fb.framebuffer),this.renderedToTile=!1,u.dirty&&(n.clear({color:e.am.transparent,stencil:0}),u.dirty=!1);for(let e=o.start;e<=o.end;++e){const t=i.style._mergedLayers[a[e]];if(t.isHidden(i.transform.zoom))continue;const r=i.style.getLayerSourceCache(t),s=r?this.proxyToSource[h.key][r.id]:[h];if(!s)continue;const o=s;n.viewport.set([0,0,u.fb.width,u.fb.height]),p!==(r?r.id:null)&&(this._setupStencil(u,s,t,r),p=r?r.id:null),i.renderLayer(i,r,t,o)}if(0===this._drapedRenderBatches.length)for(const e of this._pendingGroundEffectLayers){const t=i.style._mergedLayers[a[e]];if(t.isHidden(i.transform.zoom))continue;const r=i.style.getLayerSourceCache(t),s=r?this.proxyToSource[h.key][r.id]:[h];if(!s)continue;const o=s;n.viewport.set([0,0,u.fb.width,u.fb.height]),p!==(r?r.id:null)&&(this._setupStencil(u,s,t,r),p=r?r.id:null),i.renderLayer(i,r,t,o)}this.renderedToTile?(u.dirty=!0,l.push(s.tileID)):f||--c,5===c&&(c=0,this.renderToBackBuffer(l))}return this.renderToBackBuffer(l),this.renderingToTexture=!1,n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),o.end+1}postRender(){}isLayerOrderingCorrect(e){const t=e.order.length;let i=-1,n=t;for(let r=0;r<t;++r)this._style.isLayerDraped(e._mergedLayers[e.order[r]])?i=Math.max(i,r):n=Math.min(n,r);return n>i}getMinElevationBelowMSL(){let e=0;return this._visibleDemTiles.filter(e=>e.dem).forEach(t=>{e=Math.min(e,t.dem.tree.minimums[0])}),0===e?e:(e-30)*this._exaggeration}raycast(e,t,i){if(!this._visibleDemTiles)return null;const n=this._visibleDemTiles.filter(e=>e.dem).map(n=>{const r=n.tileID,s=1<<r.overscaledZ,{x:o,y:a}=r.canonical,l=o/s,c=(o+1)/s,h=a/s,d=(a+1)/s;return{minx:l,miny:h,maxx:c,maxy:d,t:n.dem.tree.raycastRoot(l,h,c,d,e,t,i),tile:n}});n.sort((e,t)=>(null!==e.t?e.t:Number.MAX_VALUE)-(null!==t.t?t.t:Number.MAX_VALUE));for(const r of n){if(null==r.t)return null;const n=r.tile.dem.tree.raycast(r.minx,r.miny,r.maxx,r.maxy,e,t,i);if(null!=n)return n}return null}_createFBO(){const t=this.painter.context,i=t.gl,n=this.drapeBufferSize;t.activeTexture.set(i.TEXTURE0);const r=new e.T(t,{width:n[0],height:n[1],data:null},i.RGBA8);r.bind(i.LINEAR,i.CLAMP_TO_EDGE);const s=t.createFramebuffer(n[0],n[1],!0,null);return s.colorAttachment.set(r.texture),s.depthAttachment=new Yr(t,s.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,n[0],n[1]),this._stencilRef=0,s.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):s.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:s,tex:r,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._debugParams.disableRenderCache)return!0;if(this._style.hasLightTransitions())return!0;for(const e in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[e].hasTransition())return!0;return this._style.order.some(e=>{const t=this._style._mergedLayers[e],i=t.isHidden(this.painter.transform.zoom);return"hillshade"===t.type||"custom"===t.type?!i&&t.shouldRedrape():!i&&t.hasTransition()})}_clearLineLayersFromRenderCache(){let t=!1;for(const e of this._style.getSources())if(e instanceof et){t=!0;break}if(!t)return;const i={};for(let t=0;t<this._style.order.length;++t){const n=this._style._mergedLayers[this._style.order[t]],r=this._style.getLayerSourceCache(n);if(r&&!i[r.id]&&!n.isHidden(this.painter.transform.zoom)&&"line"===n.type&&n.widthExpression()instanceof e.ab){i[r.id]=!0;for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][r.id];if(t)for(const e of t)this._clearRenderCacheForTile(r.id,e)}}}}_clearRasterLayersFromRenderCache(){let e=!1;for(const t in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[t]._source instanceof tt){e=!0;break}if(!e)return;const t={};for(let e=0;e<this._style.order.length;++e){const i=this._style._mergedLayers[this._style.order[e]],n=this._style.getLayerSourceCache(i);if(!n||t[n.id])continue;if(i.isHidden(this.painter.transform.zoom)||"raster"!==i.type)continue;const r=i.paint.get("raster-fade-duration");for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][n.id];if(t)for(const e of t){const t=Xr(n.getTile(e),n.findLoadedParent(e,0),n,this.painter.transform,r);(1!==t.opacity||0!==t.mix)&&this._clearRenderCacheForTile(n.id,e)}}}}_setupDrapedRenderBatches(){this._style.updateDrapeFirstLayers();const t=this._style.order,i=t.length;if(0===i)return;const n=[];this._pendingGroundEffectLayers=[];let r,s=0,o=this._style._mergedLayers[t[s]];for(;!this._style.isLayerDraped(o)&&o.isHidden(this.painter.transform.zoom)&&++s<i;)o=this._style._mergedLayers[t[s]];for(;s<i;++s){const e=this._style._mergedLayers[t[s]];e.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(e)?void 0===r&&(r=s):("fill-extrusion"===e.type&&this._pendingGroundEffectLayers.push(s),void 0!==r&&(n.push({start:r,end:s-1}),r=void 0)))}if(void 0!==r&&n.push({start:r,end:s-1}),0!==n.length){const t=n[n.length-1];this._pendingGroundEffectLayers.every(e=>e>t.end)||e.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=n}_setupRenderCache(e){const t=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,t.renderCache.length>t.renderCachePool.length){const e=Object.values(t.proxyCachedFBO);t.proxyCachedFBO={};for(let i=0;i<e.length;++i){const n=Object.values(e[i]);t.renderCachePool.push(...n)}}return}this._clearRasterLayersFromRenderCache();const i=this.proxyCoords,n=this._tilesDirty;for(let r=i.length-1;r>=0;r--){const s=i[r];if(t.getTileByID(s.key),void 0!==t.proxyCachedFBO[s.key]){const i=e[s.key],r=this.proxyToSource[s.key];let o=0;for(const e in r){const t=r[e],s=i[e];if(!s||s.length!==t.length||t.some((t,i)=>t!==s[i]||n[e]&&n[e].hasOwnProperty(t.key))){o=-1;break}++o}for(const e in t.proxyCachedFBO[s.key])t.renderCache[t.proxyCachedFBO[s.key][e]].dirty=o<0||o!==Object.values(i).length}}const r=[...this._drapedRenderBatches];r.sort((e,t)=>t.end-t.start-(e.end-e.start));for(const e of r)for(const n of i){if(t.proxyCachedFBO[n.key])continue;let i=t.renderCachePool.pop();void 0===i&&t.renderCache.length<50&&(i=t.renderCache.length,t.renderCache.push(this._createFBO())),void 0!==i&&(t.proxyCachedFBO[n.key]={},t.proxyCachedFBO[n.key][e.start]=i,t.renderCache[i].dirty=!0)}this._tilesDirty={}}_setupStencil(e,t,i,n){if(!n||!this._sourceTilesOverlap[n.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const r=this.painter.context,s=r.gl;if(t.length<=1)return void(this._overlapStencilType=!1);let o;if(i.isTileClipped())o=t.length,this._overlapStencilMode.test={func:s.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(t[0].overscaledZ>t[t.length-1].overscaledZ))return void(this._overlapStencilType=!1);o=1,this._overlapStencilMode.test={func:s.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+o>255&&(r.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=o,this._overlapStencilMode.ref=this._stencilRef,i.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(e){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[e.key]),this._overlapStencilMode):Hi.disabled}_renderTileClippingMasks(e,t){const i=this.painter,n=this.painter.context,r=n.gl;i._tileClippingMaskIDs={},n.setColorMode(Ni.disabled),n.setDepthMode(Yi.disabled);const s=i.getOrCreateProgram("clippingMask");for(const n of e){const e=i._tileClippingMaskIDs[n.key]=--t;s.draw(i,r.TRIANGLES,Yi.disabled,new Hi({func:r.ALWAYS,mask:0},e,255,r.KEEP,r.KEEP,r.REPLACE),Ni.disabled,Wi.disabled,Gr(n.projMatrix),"$clipping",i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}pointCoordinate(t){const i=this.painter.transform;if(t.x<0||t.x>i.width||t.y<0||t.y>i.height)return null;const n=[t.x,t.y,1,1];e.aA(n,n,i.pixelMatrixInverse),e.cH(n,n,1/n[3]),n[0]/=i.worldSize,n[1]/=i.worldSize;const r=i._camera.position,s=e.cb(1,i.center.lat),o=[r[0],r[1],r[2]/s,0],a=e.d7([],n.slice(0,3),o);e.au(a,a);const l=this.raycast(o,a,this._exaggeration);return null!==l&&l?(e.bE(o,o,a,l),o[3]=o[2],o[2]*=s,o):null}_setupProxiedCoordsForOrtho(t,i,n){if(t.getSource()instanceof e.aP)return this._setupProxiedCoordsForImageSource(t,i,n);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const r=this.proxiedCoords[t.id]=[],s=this.proxyCoords;for(let e=0;e<s.length;e++){const i=s[e],o=this._findTileCoveringTileID(i,t);if(o){const e=this._createProxiedId(i,o,n[i.key]&&n[i.key][t.id]);r.push(e),this.proxyToSource[i.key][t.id]=[e]}}let o=!1;const a=new Set;for(let e=0;e<i.length;e++){const s=t.getTile(i[e]);if(!s||!s.hasData())continue;const l=this._findTileCoveringTileID(s.tileID,this.proxySourceCache);if(l&&l.tileID.canonical.z!==s.tileID.canonical.z){const e=this.proxyToSource[l.tileID.key][t.id],i=this._createProxiedId(l.tileID,s,n[l.tileID.key]&&n[l.tileID.key][t.id]);e?e.splice(e.length-1,0,i):this.proxyToSource[l.tileID.key][t.id]=[i];const c=this.proxyToSource[l.tileID.key][t.id];a.has(c)||a.add(c),r.push(i),o=!0}}if(this._sourceTilesOverlap[t.id]=o,o&&this._debugParams.sortTilesHiZFirst)for(const e of a)e.sort((e,t)=>t.overscaledZ-e.overscaledZ)}_setupProxiedCoordsForImageSource(t,i,n){if(!t.getSource().loaded())return;const r=this.proxiedCoords[t.id]=[],s=this.proxyCoords,o=t.getSource(),a=o.tileID;if(!a)return;const l=new e.P(a.x,a.y)._div(1<<a.z),c=o.coordinates.map(e.ac.fromLngLat).reduce((e,t)=>(e.min.x=Math.min(e.min.x,t.x-l.x),e.min.y=Math.min(e.min.y,t.y-l.y),e.max.x=Math.max(e.max.x,t.x-l.x),e.max.y=Math.max(e.max.y,t.y-l.y),e),{min:new e.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new e.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),h=(t,i)=>{const n=t.wrap+t.canonical.x/(1<<t.canonical.z),r=t.canonical.y/(1<<t.canonical.z),s=e.aj/(1<<t.canonical.z),o=i.wrap+i.canonical.x/(1<<i.canonical.z),a=i.canonical.y/(1<<i.canonical.z);return n+s<o+c.min.x||n>o+c.max.x||r+s<a+c.min.y||r>a+c.max.y};for(let e=0;e<s.length;e++){const o=s[e];for(let e=0;e<i.length;e++){const s=t.getTile(i[e]);if(!s||!s.hasData())continue;if(h(o,s.tileID))continue;const a=this._createProxiedId(o,s,n[o.key]&&n[o.key][t.id]),l=this.proxyToSource[o.key][t.id];l?l.push(a):this.proxyToSource[o.key][t.id]=[a],r.push(a)}}}_createProxiedId(t,i,n){let r=this.orthoMatrix;if(n){const e=n.find(e=>e.key===i.tileID.key);if(e)return e}if(i.tileID.key!==t.key){const n=t.canonical.z-i.tileID.canonical.z;let s,o,a;r=e.bz();const l=i.tileID.wrap-t.wrap<<t.overscaledZ;n>0?(s=e.aj>>n,o=s*((i.tileID.canonical.x<<n)-t.canonical.x+l),a=s*((i.tileID.canonical.y<<n)-t.canonical.y)):(s=e.aj<<-n,o=e.aj*(i.tileID.canonical.x-(t.canonical.x+l<<-n)),a=e.aj*(i.tileID.canonical.y-(t.canonical.y<<-n))),e.ca(r,0,s,0,s,0,1),e.bo(r,r,[o,a,0])}return new Jr(i.tileID,t.key,r)}_findTileCoveringTileID(t,i){let n=i.getTile(t);if(n&&n.hasData())return n;const r=this._findCoveringTileCache[i.id],s=r[t.key];if(n=s?i.getTileByID(s):null,n&&n.hasData()||null===s)return n;let o=n?n.tileID:t,a=o.overscaledZ;const l=i.getSource().minzoom,c=[];if(!s){const r=i.getSource().maxzoom;if(t.canonical.z>=r){const n=t.canonical.z-r;i.getSource().reparseOverscaled?(a=Math.max(t.canonical.z+2,i.transform.tileZoom),o=new e.aM(a,t.wrap,r,t.canonical.x>>n,t.canonical.y>>n)):0!==n&&(a=r,o=new e.aM(a,t.wrap,r,t.canonical.x>>n,t.canonical.y>>n))}o.key!==t.key&&(c.push(o.key),n=i.getTile(o))}const h=e=>{c.forEach(t=>{r[t]=e}),c.length=0};for(a-=1;a>=l&&(!n||!n.hasData());a--){n&&h(n.tileID.key);const e=o.calculateScaledKey(a);if(n=i.getTileByID(e),n&&n.hasData())break;const t=r[e];if(null===t)break;void 0===t?c.push(e):n=i.getTileByID(t)}return h(n?n.tileID.key:null),n&&n.hasData()?n:null}findDEMTileFor(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(e,t){let i=this._tilesDirty[e];i||(i=this._tilesDirty[e]={}),i[t.key]=!0}}function Qr(t,i,n){const r=function(t,i,n){const r=e.bG(i,t),s=e.bG(n,[.2126,.7152,.0722]),o=(e,t,i)=>(1-i)*e+i*t,a=o(1-.3*Math.min(s,1),1,Math.min(r+1,1));return o(.92,1,Math.asin(e.ay(i[2],-1,1))/Math.PI+.5)*a}(t,[0,0,1],i),s=[0,0,0];e.c1(s,n.slice(0,3),r);const o=[0,0,0];e.c1(o,i.slice(0,3),t[2]);const a=[0,0,0];return e.d5(a,s,o),e.d8(a)}const es=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],ts=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","elevatedStructures","model","symbol"];class is{static cacheKey(e,t,i,n){let r=`${t}${n?n.cacheKey:""}`;for(const t of i)e.usedDefines.includes(t)&&(r+=`/${t}`);return r}constructor(t,i,n,r,s,o){const a=t.gl;this.program=a.createProgram(),this.configuration=r,this.name=i,this.fixedDefines=[...o];const l=r?r.getBinderAttributes():[],c=(n.staticAttributes||[]).concat(l);let h=r?r.defines():[];h=h.concat(o.map(e=>`#define ${e}`));const d="#version 300 es\n";let u=d+h.concat("precision mediump float;",Xn,Gn.fragmentSource).join("\n");for(const e of n.fragmentIncludes)u+=`\n${Un[e]}`;u+=`\n${n.fragmentSource}`;let f=d+h.concat("precision highp float;",Xn,Gn.vertexSource).join("\n");for(const e of n.vertexIncludes)f+=`\n${Un[e]}`;this.forceManualRenderingForInstanceIDShaders=t.forceManualRenderingForInstanceIDShaders&&-1!==n.vertexSource.indexOf("gl_InstanceID"),this.forceManualRenderingForInstanceIDShaders&&(f+="\nuniform int u_instanceID;\n"),f+=`\n${n.vertexSource}`,this.forceManualRenderingForInstanceIDShaders&&(f=f.replaceAll("gl_InstanceID","u_instanceID"));const p=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())return void(this.failedToCreate=!0);a.shaderSource(p,u),a.compileShader(p),a.attachShader(this.program,p);const m=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(m,f),a.compileShader(m),a.attachShader(this.program,m),this.attributes={},this.numAttributes=c.length;for(let e=0;e<this.numAttributes;e++)if(c[e]){const t=c[e].startsWith("a_")?c[e]:`a_${c[e]}`;a.bindAttribLocation(this.program,e,t),this.attributes[t]=e}a.linkProgram(this.program),a.deleteShader(m),a.deleteShader(p),this.fixedUniforms=s(t),this.binderUniforms=r?r.getUniforms(t):[],this.forceManualRenderingForInstanceIDShaders&&(this.instancingUniforms=(t=>({u_instanceID:new e.cd(t)}))(t)),(o.includes("TERRAIN")||-1!==i.indexOf("symbol")||-1!==i.indexOf("circle"))&&(this.terrainUniforms=(t=>({u_dem:new e.cd(t),u_dem_prev:new e.cd(t),u_dem_tl:new e.cg(t),u_dem_scale:new e.cf(t),u_dem_tl_prev:new e.cg(t),u_dem_scale_prev:new e.cf(t),u_dem_size:new e.cf(t),u_dem_lerp:new e.cf(t),u_exaggeration:new e.cf(t),u_depth:new e.cd(t),u_depth_size_inv:new e.cg(t),u_depth_range_unpack:new e.cg(t),u_occluder_half_size:new e.cf(t),u_occlusion_depth_offset:new e.cf(t),u_meter_to_dem:new e.cf(t),u_label_plane_matrix_inv:new e.ch(t)}))(t)),o.includes("GLOBE")&&(this.globeUniforms=(t=>({u_tile_tl_up:new e.ce(t),u_tile_tr_up:new e.ce(t),u_tile_br_up:new e.ce(t),u_tile_bl_up:new e.ce(t),u_tile_up_scale:new e.cf(t)}))(t)),o.includes("FOG")&&(this.fogUniforms=(t=>({u_fog_matrix:new e.ch(t),u_fog_range:new e.cg(t),u_fog_color:new e.d0(t),u_fog_horizon_blend:new e.cf(t),u_fog_vertical_limit:new e.cg(t),u_fog_temporal_offset:new e.cf(t),u_frustum_tl:new e.ce(t),u_frustum_tr:new e.ce(t),u_frustum_br:new e.ce(t),u_frustum_bl:new e.ce(t),u_globe_pos:new e.ce(t),u_globe_radius:new e.cf(t),u_globe_transition:new e.cf(t),u_is_globe:new e.cd(t),u_viewport:new e.cg(t)}))(t)),o.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(t=>({u_cutoff_params:new e.d0(t)}))(t)),o.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(t=>({u_lighting_ambient_color:new e.ce(t),u_lighting_directional_dir:new e.ce(t),u_lighting_directional_color:new e.ce(t),u_ground_radiance:new e.ce(t)}))(t)),o.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(t=>({u_light_matrix_0:new e.ch(t),u_light_matrix_1:new e.ch(t),u_fade_range:new e.cg(t),u_shadow_normal_offset:new e.ce(t),u_shadow_intensity:new e.cf(t),u_shadow_texel_size:new e.cf(t),u_shadow_map_resolution:new e.cf(t),u_shadow_direction:new e.ce(t),u_shadow_bias:new e.ce(t),u_shadowmap_0:new e.cd(t),u_shadowmap_1:new e.cd(t)}))(t))}}setTerrainUniformValues(e,t){if(!this.terrainUniforms)return;const i=this.terrainUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e]&&i[e].set(this.program,e,t[e])}}setGlobeUniformValues(e,t){if(!this.globeUniforms)return;const i=this.globeUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e]&&i[e].set(this.program,e,t[e])}}setFogUniformValues(e,t){if(!this.fogUniforms)return;const i=this.fogUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}}setCutoffUniformValues(e,t){if(!this.cutoffUniforms)return;const i=this.cutoffUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}}setLightsUniformValues(e,t){if(!this.lightsUniforms)return;const i=this.lightsUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}}setShadowUniformValues(e,t){if(this.failedToCreate||!this.shadowUniforms)return;const i=this.shadowUniforms;e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}_drawDebugWireframe(t,i,n,r,s,o,a,l,c,h){const d=t.options.wireframe;if(!1===d.terrain&&!1===d.layers2D&&!1===d.layers3D)return;const u=t.context;if(!(()=>!(!d.terrain||"terrainRaster"!==this.name&&"globeRaster"!==this.name)||!(!d.layers2D||t._terrain&&t._terrain.renderingToTexture||!es.includes(this.name))||!(!d.layers3D||!ts.includes(this.name)))())return;const f=u.gl,p=t.wireframeDebugCache.getLinesFromTrianglesBuffer(t.frameCounter,s,u);if(!p)return;const m=[...this.fixedDefines];m.push("DEBUG_WIREFRAME");const g=t.getOrCreateProgram(this.name,{config:this.configuration,defines:m});u.program.set(g.program);const _=(e,t,i)=>{if(t[e]&&i[e])for(const n in t[e])i[e][n]&&i[e][n].set(i.program,n,t[e][n].current)};c&&c.setUniforms(g.program,u,g.binderUniforms,a,{zoom:l}),_("fixedUniforms",this,g),_("terrainUniforms",this,g),_("globeUniforms",this,g),_("fogUniforms",this,g),_("lightsUniforms",this,g),_("shadowUniforms",this,g),p.bind(),u.setColorMode(new Ni([f.ONE,f.ONE_MINUS_SRC_ALPHA,f.ZERO,f.ONE],e.am.transparent,[!0,!0,!0,!1])),u.setDepthMode(new Yi(i.func===f.LESS?f.LEQUAL:i.func,Yi.ReadOnly,i.range)),u.setStencilMode(Hi.disabled);const y=3*o.primitiveLength*2,v=3*o.primitiveOffset*2*2;if(this.forceManualRenderingForInstanceIDShaders){const e=h||1;for(let t=0;t<e;++t)g.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",t),f.drawElements(f.LINES,y,f.UNSIGNED_SHORT,v)}else h&&h>1?f.drawElementsInstanced(f.LINES,y,f.UNSIGNED_SHORT,v,h):f.drawElements(f.LINES,y,f.UNSIGNED_SHORT,v);s.bind(),u.program.set(this.program),u.setDepthMode(i),u.setStencilMode(n),u.setColorMode(r)}checkUniforms(e,t,i){if(this.fixedDefines.includes(t))for(const n of Object.keys(i))if(!i[n].initialized)throw new Error(`Program '${this.name}', from draw '${e}': uniform ${n} not set but required by ${t} being defined`)}draw(e,t,i,n,r,s,o,a,l,c,h,d,u,f,p,m){const g=e.context,_=g.gl;if(this.failedToCreate)return;g.program.set(this.program),g.setDepthMode(i),g.setStencilMode(n),g.setColorMode(r),g.setCullFace(s);for(const e of Object.keys(this.fixedUniforms))this.fixedUniforms[e].set(this.program,e,o[e]);f&&f.setUniforms(this.program,g,this.binderUniforms,d,{zoom:u});const y={[_.POINTS]:1,[_.LINES]:2,[_.TRIANGLES]:3,[_.LINE_STRIP]:1}[t];this.checkUniforms(a,"RENDER_SHADOWS",this.shadowUniforms);const v=m&&m>0?1:void 0;for(const s of h.get()){const o=s.vaos||(s.vaos={});if((o[a]||(o[a]=new Kn)).bind(g,this,l,f?f.getPaintVertexBuffers():[],c,s.vertexOffset,p||[],v),this.forceManualRenderingForInstanceIDShaders){const e=m||1;for(let i=0;i<e;++i)this.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",i),c?_.drawElements(t,s.primitiveLength*y,_.UNSIGNED_SHORT,s.primitiveOffset*y*2):_.drawArrays(t,s.vertexOffset,s.vertexLength)}else m&&m>1?_.drawElementsInstanced(t,s.primitiveLength*y,_.UNSIGNED_SHORT,s.primitiveOffset*y*2,m):c?_.drawElements(t,s.primitiveLength*y,_.UNSIGNED_SHORT,s.primitiveOffset*y*2):_.drawArrays(t,s.vertexOffset,s.vertexLength);t===_.TRIANGLES&&c&&this._drawDebugWireframe(e,i,n,r,c,s,d,u,f,m)}}}function ns(t,i,n=0){const r=Math.pow(2,i.tileID.overscaledZ),s=i.tileSize*Math.pow(2,t.transform.tileZoom)/r,o=s*(i.tileID.canonical.x+i.tileID.wrap*r),a=s*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture?i.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/e.aw(i,1,t.transform.tileZoom),u_pixel_coord_upper:[o>>16,a>>16],u_pixel_coord_lower:[65535&o,65535&a],u_pattern_transition:n}}const rs={terrain:0,flat:1},ss=e.bz(),os=(t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y)=>{const v=i.style.light,x=v.properties.get("position"),b=[x.x,x.y,x.z],w=e.dJ();"viewport"===v.properties.get("anchor")&&(e.dK(w,-i.transform.angle),e.dL(b,b,w));const S=v.properties.get("color").toPremultipliedRenderColor(null),T=i.transform,k={u_matrix:t,u_lightpos:b,u_lightintensity:v.properties.get("intensity"),u_lightcolor:[S.r,S.g,S.b],u_vertical_gradient:+n,u_opacity:r,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:ss,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:rs[h],u_base_type:rs[d],u_ao:s,u_edge_radius:o,u_width_scale:a,u_flood_light_color:m,u_vertical_scale:g,u_flood_light_intensity:_,u_ground_shadow_factor:y};return"globe"===T.projection.name&&(k.u_tile_id=[l.canonical.x,l.canonical.y,1<<l.canonical.z],k.u_zoom_transition=u,k.u_inv_rot_matrix=p,k.u_merc_center=f,k.u_up_dir=T.projection.upVector(new e.cA(0,0,0),f[0]*e.aj,f[1]*e.aj),k.u_height_lift=c),k},as=(e,t,i,n,r,s)=>({u_matrix:e,u_edge_radius:t,u_width_scale:i,u_vertical_scale:n,u_height_type:rs[r],u_base_type:rs[s]}),ls=(t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y)=>{const v=os(t,i,n,r,s,o,a,l,h,d,u,f,p,m,g,_,1,[0,0,0]),x={u_height_factor:-Math.pow(2,l.overscaledZ)/c.tileSize/8};return e.h(v,ns(i,c,y),x)},cs=(e,t,i)=>({u_matrix:e,u_emissive_strength:t,u_ground_shadow_factor:i}),hs=(t,i,n,r,s,o=0)=>e.h(cs(t,i,s),ns(n,r,o)),ds=(e,t,i,n)=>({u_matrix:e,u_world:i,u_emissive_strength:t,u_ground_shadow_factor:n}),us=(t,i,n,r,s,o,a=0)=>e.h(hs(t,i,n,r,o,a),{u_world:s}),fs=(e,t)=>({u_matrix:e,u_ground_shadow_factor:t}),ps=(e,t,i,n,r)=>({u_matrix:e,u_camera_pos:[t[0],t[1],t[2]],u_depth_bias:i,u_height_scale:n,u_reset_depth:r}),ms=(e,t)=>({u_matrix:e,u_normal_matrix:t,u_opacity:1}),gs=e=>({u_matrix:e}),_s=e=>({u_matrix:e}),ys=(t,i,n,r,s,o,a,l)=>{const c=e.aj/o.tileSize;return{u_matrix:t,u_inv_rot_matrix:i,u_camera_to_center_distance:n.getCameraToCenterDistance(l),u_extrude_scale:[n.pixelsToGLUnits[0]/c,n.pixelsToGLUnits[1]/c],u_zoom_transition:r,u_tile_id:a,u_merc_center:s}},vs=(e,t,i=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:i}),xs=e.bz(),bs=(t,i,n,r,s,o,a)=>{const l=t.transform,c="globe"===l.projection.name,h=c?e.dM(l.zoom,i.canonical)*l._pixelsPerMercatorPixel:e.aw(n,1,o),d={u_matrix:i.projMatrix,u_extrude_scale:h,u_intensity:a,u_inv_rot_matrix:xs,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){d.u_inv_rot_matrix=r,d.u_merc_center=s,d.u_tile_id=[i.canonical.x,i.canonical.y,1<<i.canonical.z],d.u_zoom_transition=e.ah(l.zoom);const t=s[0]*e.aj,n=s[1]*e.aj;d.u_up_dir=l.projection.upVector(new e.cA(0,0,0),t,n)}return d};function ws(e,[t,i,n,r],[s,o]){if(s===o)return[0,0,0,0];const a=255*(e-1)/(e*(o-s));return[t*a,i*a,n*a,r*a]}function Ss(e,t,[i,n]){return i===n?0:.5/e+(t-i)*(e-1)/(e*(n-i))}const Ts=(t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x,b)=>({u_matrix:t,u_normalize_matrix:i,u_globe_matrix:n,u_merc_matrix:r,u_grid_matrix:s,u_tl_parent:o,u_scale_parent:h,u_fade_t:d.mix,u_opacity:d.opacity*u.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:u.paint.get("raster-brightness-min"),u_brightness_high:u.paint.get("raster-brightness-max"),u_saturation_factor:e.dO(u.paint.get("raster-saturation")),u_contrast_factor:e.dN(u.paint.get("raster-contrast")),u_spin_weights:ks(u.paint.get("raster-hue-rotate")),u_perspective_transform:f,u_raster_elevation:p,u_zoom_transition:a,u_merc_center:l,u_cutoff_params:c,u_colorization_mix:ws(e.dP,g,y),u_colorization_offset:Ss(e.dP,_,y),u_color_ramp:m,u_texture_offset:[x/(v+2*x),v/(v+2*x)],u_texture_res:[v+2*x,v+2*x],u_emissive_strength:b});function ks(e){e*=Math.PI/180;const t=Math.sin(e),i=Math.cos(e);return[(2*i+1)/3,(-Math.sqrt(3)*t-i+1)/3,(Math.sqrt(3)*t-i+1)/3]}const Ms=.05,As=(e,t,i,n,r,s,o,a,l,c,h,d)=>({u_matrix:e,u_normalize_matrix:t,u_globe_matrix:i,u_merc_matrix:n,u_grid_matrix:r,u_tl_parent:s,u_scale_parent:c,u_fade_t:h.mix,u_opacity:h.opacity,u_image0:0,u_image1:1,u_raster_elevation:d,u_zoom_transition:o,u_merc_center:a,u_cutoff_params:l}),Cs=(e,t,i,n,r,s,o,a,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_tile_offset:i,u_velocity:n,u_color_ramp:s,u_velocity_res:r,u_max_speed:o,u_uv_offset:a,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[Ms,Ms]}),Ds=(e,t,i,n,r,s,o,a,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_velocity:i,u_velocity_res:n,u_max_speed:r,u_speed_factor:s,u_reset_rate:o,u_rand_seed:Math.random(),u_uv_offset:a,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[Ms,Ms]}),Ls=e.bz(),Es=(t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x,b,w,S,T)=>{const k=s.transform,M={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:k.getCameraToCenterDistance(v),u_rotate_symbol:+n,u_aspect_ratio:k.width/k.height,u_fade_change:s.options.fadeDuration?s.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:l,u_is_text:+h,u_elevation_from_sea:c?1:0,u_pitch_with_map:+r,u_texsize:d,u_texsize_icon:u,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Ls,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Ls,u_up_vector:[0,-1,0],u_color_adj_mat:w,u_icon_transition:S||0,u_gamma_scale:r?s.transform.getCameraToCenterDistance(v)*Math.cos(s.terrain?0:s.transform._pitch):1,u_device_pixel_ratio:e.q.devicePixelRatio,u_is_halo:1,u_scale_factor:T||1,u_ground_shadow_factor:x,u_inv_matrix:e.bi(e.bz(),a),u_normal_scale:b};return"globe"===v.name&&(M.u_tile_id=[p.canonical.x,p.canonical.y,1<<p.canonical.z],M.u_zoom_transition=m,M.u_inv_rot_matrix=_,M.u_merc_center=g,M.u_camera_forward=k._camera.forward(),M.u_ecef_origin=e.dQ(k.globeMatrix,p.toUnwrapped()),M.u_tile_matrix=Float32Array.from(k.globeMatrix),M.u_up_vector=y),M},Is=(e,t,i,n)=>({u_matrix:e,u_emissive_strength:t,u_opacity:i,u_color:n}),Ps=(t,i,n,r,s,o,a,l,c)=>e.h(function(t,i,n,r,s,o){const{width:a,height:l}=r.imageManager.getPixelSize(i),c=Math.pow(2,o.tileID.overscaledZ),h=o.tileSize*Math.pow(2,r.transform.tileZoom)/c,d=h*(o.tileID.canonical.x+o.tileID.wrap*c),u=h*o.tileID.canonical.y;return{u_image:0,u_pattern_tl:n.tl,u_pattern_br:n.br,u_texsize:[a,l],u_pattern_size:n.displaySize,u_pattern_units_to_pixels:s?[r.transform.width,-1*r.transform.height]:[1/e.aw(o,1,r.transform.tileZoom),1/e.aw(o,1,r.transform.tileZoom)],u_pixel_coord_upper:[d>>16,u>>16],u_pixel_coord_lower:[65535&d,65535&u]}}(0,o,a,r,l,c),{u_matrix:t,u_emissive_strength:i,u_opacity:n}),Rs=new Float32Array(e.bx([])),Os=(t,i,n,r,s,o,a,l,c,h,d,u,f,p=[0,0,0],m)=>{const g=s.style.light,_=g.properties.get("position"),y=[-_.x,-_.y,_.z],v=e.dJ();"viewport"===g.properties.get("anchor")&&(e.dK(v,-s.transform.angle),e.dL(y,y,v));const x="MASK"===d.alphaMode,b=g.properties.get("color").toNonPremultipliedRenderColor(null),w=f.paint.get("model-ambient-occlusion-intensity"),S=f.paint.get("model-color").constantOr(e.am.white).toNonPremultipliedRenderColor(null);return S.a=f.paint.get("model-color-mix-intensity").constantOr(0),{u_matrix:t,u_lighting_matrix:i,u_normal_matrix:n,u_node_matrix:r||Rs,u_lightpos:y,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[b.r,b.g,b.b],u_camera_pos:p,u_opacity:o,u_baseTextureIsAlpha:0,u_alphaMask:+x,u_alphaCutoff:d.alphaCutoff,u_baseColorFactor:a.toNonPremultipliedRenderColor(null).toArray01(),u_emissiveFactor:l.toNonPremultipliedRenderColor(null).toArray01(),u_metallicFactor:c,u_roughnessFactor:h,u_baseColorTexture:Zi,u_metallicRoughnessTexture:Ji,u_normalTexture:Ki,u_occlusionTexture:Qi,u_emissionTexture:en,u_lutTexture:tn,u_color_mix:S.toArray01(),u_aoIntensity:w,u_emissive_strength:u,u_occlusionTextureTransform:m||[0,0,0,0]}},zs=(e,t=Rs,i=Rs)=>({u_matrix:e,u_instance:t,u_node_matrix:i}),Fs={fillExtrusion:t=>({u_matrix:new e.ch(t),u_lightpos:new e.ce(t),u_lightintensity:new e.cf(t),u_lightcolor:new e.ce(t),u_vertical_gradient:new e.cf(t),u_opacity:new e.cf(t),u_edge_radius:new e.cf(t),u_width_scale:new e.cf(t),u_ao:new e.cg(t),u_height_type:new e.cd(t),u_base_type:new e.cd(t),u_tile_id:new e.ce(t),u_zoom_transition:new e.cf(t),u_inv_rot_matrix:new e.ch(t),u_merc_center:new e.cg(t),u_up_dir:new e.ce(t),u_height_lift:new e.cf(t),u_flood_light_color:new e.ce(t),u_vertical_scale:new e.cf(t),u_flood_light_intensity:new e.cf(t),u_ground_shadow_factor:new e.ce(t)}),fillExtrusionDepth:t=>({u_matrix:new e.ch(t),u_edge_radius:new e.cf(t),u_width_scale:new e.cf(t),u_vertical_scale:new e.cf(t),u_height_type:new e.cd(t),u_base_type:new e.cd(t)}),fillExtrusionPattern:t=>({u_matrix:new e.ch(t),u_lightpos:new e.ce(t),u_lightintensity:new e.cf(t),u_lightcolor:new e.ce(t),u_vertical_gradient:new e.cf(t),u_height_factor:new e.cf(t),u_edge_radius:new e.cf(t),u_width_scale:new e.cf(t),u_ao:new e.cg(t),u_height_type:new e.cd(t),u_base_type:new e.cd(t),u_tile_id:new e.ce(t),u_zoom_transition:new e.cf(t),u_inv_rot_matrix:new e.ch(t),u_merc_center:new e.cg(t),u_up_dir:new e.ce(t),u_height_lift:new e.cf(t),u_image:new e.cd(t),u_texsize:new e.cg(t),u_pixel_coord_upper:new e.cg(t),u_pixel_coord_lower:new e.cg(t),u_tile_units_to_pixels:new e.cf(t),u_opacity:new e.cf(t),u_pattern_transition:new e.cf(t)}),fillExtrusionGroundEffect:t=>({u_matrix:new e.ch(t),u_opacity:new e.cf(t),u_ao_pass:new e.cf(t),u_meter_to_tile:new e.cf(t),u_ao:new e.cg(t),u_flood_light_intensity:new e.cf(t),u_flood_light_color:new e.ce(t),u_attenuation:new e.cf(t),u_edge_radius:new e.cf(t),u_fb:new e.cd(t),u_fb_size:new e.cf(t),u_dynamic_offset:new e.cf(t)}),fill:t=>({u_matrix:new e.ch(t),u_emissive_strength:new e.cf(t),u_ground_shadow_factor:new e.ce(t)}),fillPattern:t=>({u_matrix:new e.ch(t),u_emissive_strength:new e.cf(t),u_image:new e.cd(t),u_texsize:new e.cg(t),u_pixel_coord_upper:new e.cg(t),u_pixel_coord_lower:new e.cg(t),u_tile_units_to_pixels:new e.cf(t),u_ground_shadow_factor:new e.ce(t),u_pattern_transition:new e.cf(t)}),fillOutline:t=>({u_matrix:new e.ch(t),u_emissive_strength:new e.cf(t),u_world:new e.cg(t),u_ground_shadow_factor:new e.ce(t)}),fillOutlinePattern:t=>({u_matrix:new e.ch(t),u_emissive_strength:new e.cf(t),u_world:new e.cg(t),u_image:new e.cd(t),u_texsize:new e.cg(t),u_pixel_coord_upper:new e.cg(t),u_pixel_coord_lower:new e.cg(t),u_tile_units_to_pixels:new e.cf(t),u_ground_shadow_factor:new e.ce(t),u_pattern_transition:new e.cf(t)}),building:t=>({u_matrix:new e.ch(t),u_normal_matrix:new e.ch(t),u_opacity:new e.cf(t)}),buildingBloom:t=>({u_matrix:new e.ch(t)}),buildingDepth:t=>({u_matrix:new e.ch(t)}),elevatedStructuresDepth:t=>({u_matrix:new e.ch(t),u_depth_bias:new e.cf(t)}),elevatedStructures:t=>({u_matrix:new e.ch(t),u_ground_shadow_factor:new e.ce(t)}),elevatedStructuresDepthReconstruct:t=>({u_matrix:new e.ch(t),u_camera_pos:new e.ce(t),u_depth_bias:new e.cf(t),u_height_scale:new e.cf(t),u_reset_depth:new e.cf(t)}),circle:e.dT,collisionBox:t=>({u_matrix:new e.ch(t),u_inv_rot_matrix:new e.ch(t),u_camera_to_center_distance:new e.cf(t),u_extrude_scale:new e.cg(t),u_zoom_transition:new e.cf(t),u_merc_center:new e.cg(t),u_tile_id:new e.ce(t)}),collisionCircle:t=>({u_matrix:new e.ch(t),u_inv_matrix:new e.ch(t),u_camera_to_center_distance:new e.cf(t),u_viewport_size:new e.cg(t)}),debug:t=>({u_color:new e.dv(t),u_matrix:new e.ch(t),u_overlay:new e.cd(t),u_overlay_scale:new e.cf(t)}),clippingMask:t=>({u_matrix:new e.ch(t)}),heatmap:t=>({u_extrude_scale:new e.cf(t),u_intensity:new e.cf(t),u_matrix:new e.ch(t),u_inv_rot_matrix:new e.ch(t),u_merc_center:new e.cg(t),u_tile_id:new e.ce(t),u_zoom_transition:new e.cf(t),u_up_dir:new e.ce(t)}),heatmapTexture:t=>({u_image:new e.cd(t),u_color_ramp:new e.cd(t),u_opacity:new e.cf(t)}),hillshade:t=>({u_matrix:new e.ch(t),u_image:new e.cd(t),u_latrange:new e.cg(t),u_light:new e.cg(t),u_shadow:new e.dv(t),u_highlight:new e.dv(t),u_emissive_strength:new e.cf(t),u_accent:new e.dv(t)}),hillshadePrepare:t=>({u_matrix:new e.ch(t),u_image:new e.cd(t),u_dimension:new e.cg(t),u_zoom:new e.cf(t)}),line:e.dS,linePattern:e.dR,raster:t=>({u_matrix:new e.ch(t),u_normalize_matrix:new e.ch(t),u_globe_matrix:new e.ch(t),u_merc_matrix:new e.ch(t),u_grid_matrix:new e.dw(t),u_tl_parent:new e.cg(t),u_scale_parent:new e.cf(t),u_fade_t:new e.cf(t),u_opacity:new e.cf(t),u_image0:new e.cd(t),u_image1:new e.cd(t),u_brightness_low:new e.cf(t),u_brightness_high:new e.cf(t),u_saturation_factor:new e.cf(t),u_contrast_factor:new e.cf(t),u_spin_weights:new e.ce(t),u_perspective_transform:new e.cg(t),u_raster_elevation:new e.cf(t),u_zoom_transition:new e.cf(t),u_merc_center:new e.cg(t),u_cutoff_params:new e.d0(t),u_colorization_mix:new e.d0(t),u_colorization_offset:new e.cf(t),u_color_ramp:new e.cd(t),u_texture_offset:new e.cg(t),u_texture_res:new e.cg(t),u_emissive_strength:new e.cf(t)}),rasterParticle:t=>({u_matrix:new e.ch(t),u_normalize_matrix:new e.ch(t),u_globe_matrix:new e.ch(t),u_merc_matrix:new e.ch(t),u_grid_matrix:new e.dw(t),u_tl_parent:new e.cg(t),u_scale_parent:new e.cf(t),u_fade_t:new e.cf(t),u_opacity:new e.cf(t),u_image0:new e.cd(t),u_image1:new e.cd(t),u_raster_elevation:new e.cf(t),u_zoom_transition:new e.cf(t),u_merc_center:new e.cg(t),u_cutoff_params:new e.d0(t)}),rasterParticleTexture:t=>({u_texture:new e.cd(t),u_opacity:new e.cf(t)}),rasterParticleDraw:t=>({u_particle_texture:new e.cd(t),u_particle_texture_side_len:new e.cf(t),u_tile_offset:new e.cg(t),u_velocity:new e.cd(t),u_color_ramp:new e.cd(t),u_velocity_res:new e.cg(t),u_max_speed:new e.cf(t),u_uv_offset:new e.cg(t),u_data_scale:new e.cg(t),u_data_offset:new e.cf(t),u_particle_pos_scale:new e.cf(t),u_particle_pos_offset:new e.cg(t)}),rasterParticleUpdate:t=>({u_particle_texture:new e.cd(t),u_particle_texture_side_len:new e.cf(t),u_velocity:new e.cd(t),u_velocity_res:new e.cg(t),u_max_speed:new e.cf(t),u_speed_factor:new e.cf(t),u_reset_rate:new e.cf(t),u_rand_seed:new e.cf(t),u_uv_offset:new e.cg(t),u_data_scale:new e.cg(t),u_data_offset:new e.cf(t),u_particle_pos_scale:new e.cf(t),u_particle_pos_offset:new e.cg(t)}),symbol:t=>({u_is_size_zoom_constant:new e.cd(t),u_is_size_feature_constant:new e.cd(t),u_size_t:new e.cf(t),u_size:new e.cf(t),u_camera_to_center_distance:new e.cf(t),u_rotate_symbol:new e.cd(t),u_aspect_ratio:new e.cf(t),u_fade_change:new e.cf(t),u_matrix:new e.ch(t),u_label_plane_matrix:new e.ch(t),u_coord_matrix:new e.ch(t),u_is_text:new e.cd(t),u_elevation_from_sea:new e.cd(t),u_pitch_with_map:new e.cd(t),u_texsize:new e.cg(t),u_texsize_icon:new e.cg(t),u_texture:new e.cd(t),u_texture_icon:new e.cd(t),u_gamma_scale:new e.cf(t),u_device_pixel_ratio:new e.cf(t),u_tile_id:new e.ce(t),u_zoom_transition:new e.cf(t),u_inv_rot_matrix:new e.ch(t),u_merc_center:new e.cg(t),u_camera_forward:new e.ce(t),u_tile_matrix:new e.ch(t),u_up_vector:new e.ce(t),u_ecef_origin:new e.ce(t),u_is_halo:new e.cd(t),u_icon_transition:new e.cf(t),u_color_adj_mat:new e.ch(t),u_scale_factor:new e.cf(t),u_ground_shadow_factor:new e.ce(t),u_inv_matrix:new e.ch(t),u_normal_scale:new e.cf(t)}),background:t=>({u_matrix:new e.ch(t),u_emissive_strength:new e.cf(t),u_opacity:new e.cf(t),u_color:new e.dv(t)}),backgroundPattern:t=>({u_matrix:new e.ch(t),u_emissive_strength:new e.cf(t),u_opacity:new e.cf(t),u_image:new e.cd(t),u_pattern_tl:new e.cg(t),u_pattern_br:new e.cg(t),u_texsize:new e.cg(t),u_pattern_size:new e.cg(t),u_pixel_coord_upper:new e.cg(t),u_pixel_coord_lower:new e.cg(t),u_pattern_units_to_pixels:new e.cg(t)}),terrainRaster:t=>({u_matrix:new e.ch(t),u_image0:new e.cd(t),u_skirt_height:new e.cf(t),u_ground_shadow_factor:new e.ce(t)}),skybox:t=>({u_matrix:new e.ch(t),u_sun_direction:new e.ce(t),u_cubemap:new e.cd(t),u_opacity:new e.cf(t),u_temporal_offset:new e.cf(t)}),skyboxGradient:t=>({u_matrix:new e.ch(t),u_color_ramp:new e.cd(t),u_center_direction:new e.ce(t),u_radius:new e.cf(t),u_opacity:new e.cf(t),u_temporal_offset:new e.cf(t)}),skyboxCapture:t=>({u_matrix_3f:new e.dw(t),u_sun_direction:new e.ce(t),u_sun_intensity:new e.cf(t),u_color_tint_r:new e.d0(t),u_color_tint_m:new e.d0(t),u_luminance:new e.cf(t)}),globeRaster:t=>({u_proj_matrix:new e.ch(t),u_globe_matrix:new e.ch(t),u_normalize_matrix:new e.ch(t),u_merc_matrix:new e.ch(t),u_zoom_transition:new e.cf(t),u_merc_center:new e.cg(t),u_image0:new e.cd(t),u_grid_matrix:new e.dw(t),u_skirt_height:new e.cf(t),u_far_z_cutoff:new e.cf(t),u_frustum_tl:new e.ce(t),u_frustum_tr:new e.ce(t),u_frustum_br:new e.ce(t),u_frustum_bl:new e.ce(t),u_globe_pos:new e.ce(t),u_globe_radius:new e.cf(t),u_viewport:new e.cg(t)}),globeAtmosphere:t=>({u_frustum_tl:new e.ce(t),u_frustum_tr:new e.ce(t),u_frustum_br:new e.ce(t),u_frustum_bl:new e.ce(t),u_horizon:new e.cf(t),u_transition:new e.cf(t),u_fadeout_range:new e.cf(t),u_color:new e.d0(t),u_high_color:new e.d0(t),u_space_color:new e.d0(t),u_temporal_offset:new e.cf(t),u_horizon_angle:new e.cf(t)}),model:t=>({u_matrix:new e.ch(t),u_lighting_matrix:new e.ch(t),u_normal_matrix:new e.ch(t),u_node_matrix:new e.ch(t),u_lightpos:new e.ce(t),u_lightintensity:new e.cf(t),u_lightcolor:new e.ce(t),u_camera_pos:new e.ce(t),u_opacity:new e.cf(t),u_baseColorFactor:new e.d0(t),u_emissiveFactor:new e.d0(t),u_metallicFactor:new e.cf(t),u_roughnessFactor:new e.cf(t),u_baseTextureIsAlpha:new e.cd(t),u_alphaMask:new e.cd(t),u_alphaCutoff:new e.cf(t),u_baseColorTexture:new e.cd(t),u_metallicRoughnessTexture:new e.cd(t),u_normalTexture:new e.cd(t),u_occlusionTexture:new e.cd(t),u_emissionTexture:new e.cd(t),u_lutTexture:new e.cd(t),u_color_mix:new e.d0(t),u_aoIntensity:new e.cf(t),u_emissive_strength:new e.cf(t),u_occlusionTextureTransform:new e.d0(t)}),modelDepth:t=>({u_matrix:new e.ch(t),u_instance:new e.ch(t),u_node_matrix:new e.ch(t)}),groundShadow:t=>({u_matrix:new e.ch(t),u_ground_shadow_factor:new e.ce(t)}),stars:t=>({u_matrix:new e.ch(t),u_up:new e.ce(t),u_right:new e.ce(t),u_intensity_multiplier:new e.cf(t)}),snowParticle:t=>({u_modelview:new e.ch(t),u_projection:new e.ch(t),u_time:new e.cf(t),u_cam_pos:new e.ce(t),u_velocityConeAperture:new e.cf(t),u_velocity:new e.cf(t),u_horizontalOscillationRadius:new e.cf(t),u_horizontalOscillationRate:new e.cf(t),u_boxSize:new e.cf(t),u_billboardSize:new e.cf(t),u_simpleShapeParameters:new e.cg(t),u_screenSize:new e.cg(t),u_thinningCenterPos:new e.cg(t),u_thinningShape:new e.ce(t),u_thinningAffectedRatio:new e.cf(t),u_thinningParticleOffset:new e.cf(t),u_particleColor:new e.d0(t),u_direction:new e.ce(t)}),rainParticle:t=>({u_modelview:new e.ch(t),u_projection:new e.ch(t),u_time:new e.cf(t),u_cam_pos:new e.ce(t),u_texScreen:new e.cd(t),u_velocityConeAperture:new e.cf(t),u_velocity:new e.cf(t),u_boxSize:new e.cf(t),u_rainDropletSize:new e.cg(t),u_distortionStrength:new e.cf(t),u_rainDirection:new e.ce(t),u_color:new e.d0(t),u_screenSize:new e.cg(t),u_thinningCenterPos:new e.cg(t),u_thinningShape:new e.ce(t),u_thinningAffectedRatio:new e.cf(t),u_thinningParticleOffset:new e.cf(t),u_shapeDirectionalPower:new e.cf(t),u_shapeNormalPower:new e.cf(t),u_mode:new e.cf(t)}),vignette:t=>({u_vignetteShape:new e.ce(t),u_vignetteColor:new e.d0(t)}),occlusion:t=>({u_matrix:new e.ch(t),u_anchorPos:new e.ce(t),u_screenSizePx:new e.cg(t),u_occluderSizePx:new e.cg(t),u_color:new e.d0(t)})};class Ns{constructor(e,t,i,n){this.id=Ns.uniqueIdxCounter,Ns.uniqueIdxCounter++,this.context=e;const r=e.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||n||t.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){this.id=Ns.uniqueIdxCounter,Ns.uniqueIdxCounter++;const t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}Ns.uniqueIdxCounter=0;const Ys={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Bs{constructor(e,t,i,n,r,s){this.length=t.length,this.attributes=i,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,this.instanceCount=s,this.context=e;const o=e.gl;this.buffer=o.createBuffer(),e.bindVertexBuffer.set(this.buffer),o.bufferData(o.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||r||t.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let i=0;i<this.attributes.length;i++){const n=t.attributes[this.attributes[i].name];void 0!==n&&e.enableVertexAttribArray(n)}}setVertexAttribPointers(e,t,i){for(let n=0;n<this.attributes.length;n++){const r=this.attributes[n],s=t.attributes[r.name];void 0!==s&&e.vertexAttribPointer(s,r.components,e[Ys[r.type]],!1,this.itemSize,r.offset+this.itemSize*(i||0))}}setVertexAttribDivisor(e,t,i){for(let n=0;n<this.attributes.length;n++){const r=t.attributes[this.attributes[n].name];void 0!==r&&this.instanceCount&&this.instanceCount>0&&e.vertexAttribDivisor(r,i)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Hs{constructor(e,t,i,n,r){this.context=e,this.width=t,this.height=i;const s=this.framebuffer=e.gl.createFramebuffer();n&&(this.colorAttachment=new zr(e,s)),r&&(this.depthAttachmentType=r,this.depthAttachment="renderbuffer"===r?new Fr(e,s):new Nr(e,s))}destroy(){const e=this.context.gl;if(this.colorAttachment){const t=this.colorAttachment.get();t&&e.deleteTexture(t)}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}else{const t=this.depthAttachment.get();t&&e.deleteTexture(t)}e.deleteFramebuffer(this.framebuffer)}}class js{constructor(e,t){this.gl=e,this.clearColor=new rr(this),this.clearDepth=new sr(this),this.clearStencil=new or(this),this.colorMask=new ar(this),this.depthMask=new lr(this),this.stencilMask=new cr(this),this.stencilFunc=new hr(this),this.stencilOp=new dr(this),this.stencilTest=new ur(this),this.depthRange=new fr(this),this.depthTest=new pr(this),this.depthFunc=new mr(this),this.blend=new gr(this),this.blendFunc=new _r(this),this.blendColor=new yr(this),this.blendEquation=new vr(this),this.cullFace=new xr(this),this.cullFaceSide=new br(this),this.frontFace=new wr(this),this.program=new Sr(this),this.activeTexture=new Tr(this),this.viewport=new kr(this),this.bindFramebuffer=new Mr(this),this.bindRenderbuffer=new Ar(this),this.bindTexture=new Cr(this),this.bindVertexBuffer=new Dr(this),this.bindElementBuffer=new Lr(this),this.bindVertexArrayOES=new Er(this),this.pixelStoreUnpack=new Ir(this),this.pixelStoreUnpackPremultiplyAlpha=new Pr(this),this.pixelStoreUnpackFlipY=new Rr(this),this.options=t?Object.assign({},t):{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=e.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=e.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=e.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.forceManualRenderingForInstanceIDShaders=t&&!!t.forceManualRenderingForInstanceIDShaders||this.renderer&&-1!==this.renderer.indexOf("PowerVR"),this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=e.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxPointSize=e.getParameter(e.ALIASED_POINT_SIZE_RANGE)[1]}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t,i){return new Ns(this,e,t,i)}createVertexBuffer(e,t,i,n,r){return new Bs(this,e,t,i,n,r)}createRenderbuffer(e,t,i){const n=this.gl,r=n.createRenderbuffer();return this.bindRenderbuffer.set(r),n.renderbufferStorage(n.RENDERBUFFER,e,t,i),this.bindRenderbuffer.set(null),r}createFramebuffer(e,t,i,n){return new Hs(this,e,t,i,n)}clear({color:e,depth:t,stencil:i,colorMask:n}){const r=this.gl;let s=0;e&&(s|=r.COLOR_BUFFER_BIT,this.clearColor.set(e.toNonPremultipliedRenderColor(null)),this.colorMask.set(n||[!0,!0,!0,!0])),void 0!==t&&(s|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==i&&(s|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(s)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(t){e.bv(t.blendFunction,Ni.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor),t.blendEquation?this.blendEquation.set(t.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(t.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}let Vs;function Ws(t,i,n,r,s,o,a){const l=t.context,c=l.gl,h=t.transform,d=[e.aD(h.center.lng),e.aH(h.center.lat)],u=n.layout.get("symbol-placement"),f=n.layout.get("text-variable-anchor"),p="map"===n.layout.get("icon-rotation-alignment"),m="map"===n.layout.get("text-rotation-alignment"),g="point"!==u,_=[];let y=0,v=0;for(let l=0;l<r.length;l++){const u=r[l],x=i.getTile(u),b=x.getBucket(n);if(!b)continue;const w=b.getProjection().createInversionMatrix(h,u.canonical),S=[],T=Bt(u,b,h),k=!a&&p&&g,M=a&&m&&g,A=f&&b.hasTextData(),C=b.hasIconTextFit()&&A&&b.hasIconData(),D=k||M||a&&A||C,L="globe"===b.projection.name,E=L?e.ah(h.zoom):0;L&&(S.push("PROJECTION_GLOBE_VIEW"),D&&S.push("PROJECTED_POS_ON_VIEWPORT"));const I=t.getOrCreateProgram("collisionBox",{defines:S});let P=T;0===s[0]&&0===s[1]||(P=t.translatePosMatrix(T,x,s,o));const R=a?b.textCollisionBox:b.iconCollisionBox,O=b.collisionCircleArray;if(O.length>0){const t=e.bz(),i=P;e.cM(t,b.placementInvProjMatrix,h.glCoordMatrix),e.cM(t,t,b.placementViewportMatrix),_.push({circleArray:O,circleOffset:v,transform:i,invTransform:t,projection:b.getProjection()}),y+=O.length/4,v=y}if(!R)continue;t.terrain&&t.terrain.setupElevationDraw(x,I);const z=L?[u.canonical.x,u.canonical.y,1<<u.canonical.z]:[0,0,0];I.draw(t,c.LINES,Yi.disabled,Hi.disabled,t.colorModeForRenderPass(),Wi.disabled,ys(P,w,h,E,d,x,z,b.getProjection()),n.id,R.layoutVertexBuffer,R.indexBuffer,R.segments,null,h.zoom,null,[R.collisionVertexBuffer,R.collisionVertexBufferExt])}if(!a||!_.length)return;const x=t.getOrCreateProgram("collisionCircle"),b=new e.dU;b.resize(4*y),b._trim();let w=0;for(const e of _)for(let t=0;t<e.circleArray.length/4;t++){const i=4*t,n=e.circleArray[i+0],r=e.circleArray[i+1],s=e.circleArray[i+2],o=e.circleArray[i+3];b.emplace(w++,n,r,s,o,0),b.emplace(w++,n,r,s,o,1),b.emplace(w++,n,r,s,o,2),b.emplace(w++,n,r,s,o,3)}(!Vs||Vs.length<2*y)&&(Vs=function(t){const i=2*t,n=new e.a_;n.resize(i),n._trim();for(let e=0;e<i;e++){const t=6*e;n.uint16[t+0]=4*e+0,n.uint16[t+1]=4*e+1,n.uint16[t+2]=4*e+2,n.uint16[t+3]=4*e+2,n.uint16[t+4]=4*e+3,n.uint16[t+5]=4*e+0}return n}(y));const S=l.createIndexBuffer(Vs,!0),T=l.createVertexBuffer(b,e.dV.members,!0);for(const i of _){const r={u_matrix:i.transform,u_inv_matrix:i.invTransform,u_camera_to_center_distance:(k=h).getCameraToCenterDistance(i.projection),u_viewport_size:[k.width,k.height]};x.draw(t,c.TRIANGLES,Yi.disabled,Hi.disabled,t.colorModeForRenderPass(),Wi.disabled,r,n.id,T,S,e.bd.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,h.zoom)}var k;T.destroy(),S.destroy()}const Us=e.bz();function $s(t){const i=t._camera.getWorldToCamera(t.worldSize,1),n=e.az([],i,t.globeMatrix);e.bi(n,n);const r=[0,0,0],s=[0,1,0,0];return e.aA(s,s,n),r[0]=s[0],r[1]=s[1],r[2]=s[2],e.au(r,r),r}function Gs({width:t,height:i,anchor:n,textOffset:r,textScale:s},o){const{horizontalAlign:a,verticalAlign:l}=e.bZ(n),c=-(a-.5)*t,h=-(l-.5)*i,d=e.b_(n,r);return new e.P((c/s+d[0])*o,(h/s+d[1])*o)}function Xs(t,i,n,r,s,o,a,l,c,h){const d=t.text.placedSymbolArray,u=t.text.dynamicLayoutVertexArray,f=t.icon.dynamicLayoutVertexArray,p={},m=t.getProjection(),g=Ht(a,m,s),_=s.elevation,y=m.upVectorScale(a.canonical,s.center.lat,s.worldSize).metersToTile;u.clear();for(let f=0;f<d.length;f++){const v=d.get(f),{tileAnchorX:x,tileAnchorY:b,numGlyphs:w}=v,S=v.hidden||!v.crossTileID||t.allowVerticalPlacement&&!v.placedOrientation?null:r[v.crossTileID];if(S){let r=0,d=0,f=0;if(_){const e=_?_.getAtTileOffset(a,x,b):0,[t,i,n]=m.upVector(a.canonical,x,b);r=e*t*y,d=e*i*y,f=e*n*y}let[T,k,M,A]=Jt(v.projectedAnchorX+r,v.projectedAnchorY+d,v.projectedAnchorZ+f,n?g:o);const C=Kt(s.getCameraToCenterDistance(m),A);let D=e.bJ(t.textSizeData,c,v)*C/e.bU;n&&(D*=t.tilePixelRatio/l);const L=Gs(S,D);n?(({x:T,y:k,z:M}=m.projectTilePoint(x+L.x,b+L.y,a.canonical)),[T,k,M]=Jt(T+r,k+d,M+f,o)):(i&&L._rotate(-s.angle),T+=L.x,k+=L.y,M=0);const E=t.allowVerticalPlacement&&v.placedOrientation===e.bI.vertical?Math.PI/2:0;for(let t=0;t<w;t++)e.bL(u,T,k,M,E);h&&v.associatedIconIndex>=0&&(p[v.associatedIconIndex]={x:T,y:k,z:M,angle:E})}else ai(w,u)}if(h){f.clear();const i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){const n=i.get(t),{numGlyphs:r}=n,s=p[t];if(n.hidden||!s)ai(r,f);else{const{x:t,y:i,z:n,angle:o}=s;for(let s=0;s<r;s++)e.bL(f,t,i,n,o)}}t.icon.dynamicLayoutVertexBuffer.updateData(f)}t.text.dynamicLayoutVertexBuffer.updateData(u)}function qs(t,i,n,r,s,o,a={}){const l=n.paint.get("icon-translate"),c=n.paint.get("text-translate"),h=n.paint.get("icon-translate-anchor"),d=n.paint.get("text-translate-anchor"),u=n.layout.get("icon-rotation-alignment"),f=n.layout.get("text-rotation-alignment"),p=n.layout.get("icon-pitch-alignment"),m=n.layout.get("text-pitch-alignment"),g=n.layout.get("icon-keep-upright"),_=n.layout.get("text-keep-upright"),y=n.paint.get("icon-color-saturation"),v=n.paint.get("icon-color-contrast"),x=n.paint.get("icon-color-brightness-min"),b=n.paint.get("icon-color-brightness-max"),w="sea"===n.layout.get("symbol-elevation-reference"),S=t.context,T=S.gl,k=t.transform,M="map"===u,A="map"===f,C="map"===p,D="map"===m,L=void 0!==n.layout.get("symbol-sort-key").constantOr(1);let E=!1;const I=t.depthModeForSublayer(0,Yi.ReadOnly),P=new Yi(t.context.gl.LEQUAL,Yi.ReadOnly,t.depthRangeFor3D),R=[e.aD(k.center.lng),e.aH(k.center.lat)],O=n.layout.get("text-variable-anchor"),z="globe"===k.projection.name,F=[],N=[0,-1,0];for(const s of r){const r=i.getTile(s),o=r.getBucket(n);if(!o)continue;if("mercator"===o.projection.name&&z)continue;if(o.fullyClipped)continue;const u="globe"===o.projection.name,f=u?e.ah(k.zoom):0,p=Ht(s,o.getProjection(),k),m=k.calculatePixelsToTileUnitsMatrix(r),S=O&&o.hasTextData(),Y=o.hasIconTextFit()&&S&&o.hasIconData(),B=o.getProjection().createInversionMatrix(k,s.canonical),H=(1<<r.tileID.canonical.z)*e.aj/t.transform.worldSize,j=e=>{let i=[0,0,0];if(e){const e=t.style.directionalLight,n=t.style.ambientLight;e&&n&&(i=pn(t.style,e,n))}return i},V=e=>{k.depthOcclusionForSymbolsAndCircles&&(n.hasInitialOcclusionOpacityProperties||t.terrain)&&(e.push("DEPTH_D24"),e.push("DEPTH_OCCLUSION"))},W=()=>{const i=M&&"point"!==n.layout.get("symbol-placement"),a=[];V(a);const c=i||Y,d="road"===o.elevationType,_=t.shadowRenderer,S=d&&C&&!!_&&_.enabled,A=j(S),D=d&&C&&!t.terrain?P:I,L=n.paint.get("icon-image-cross-fade");t.terrainRenderModeElevated()&&C&&a.push("PITCH_WITH_MAP_TERRAIN"),u&&(a.push("PROJECTION_GLOBE_VIEW"),c&&a.push("PROJECTED_POS_ON_VIEWPORT")),L>0&&o.hasAnySecondaryIcon&&a.push("ICON_TRANSITION"),!o.icon.zOffsetVertexBuffer||d&&t.terrain||a.push("Z_OFFSET"),0===y&&0===v&&0===x&&1===b||a.push("COLOR_ADJUSTMENT"),o.sdfIcons&&a.push("RENDER_SDF"),S&&a.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"),d&&C&&!t.terrain&&o.icon.orientationVertexBuffer&&a.push("ELEVATED_ROADS");const E=o.icon.programConfigurations.get(n.id),O=t.getOrCreateProgram("symbol",{config:E,defines:a}),F=r.imageAtlasTexture?r.imageAtlasTexture.size:[0,0],W=o.iconSizeData,U=e.bH(W,k.zoom),$=C||!k.isOrthographic,G=Xt(p,r.tileID.canonical,C,M,k,o.getProjection(),m),X=Zt(p,r.tileID.canonical,C,M,k,o.getProjection(),m),q=t.translatePosMatrix(X,r,l,h,!0),Z=t.translatePosMatrix(p,r,l,h),J=c?Us:G,K=M&&!C&&!i;let Q=N;!z&&!k.mercatorFromTransition||M||(Q=$s(k));const ee=u?Q:N,te=n.getColorAdjustmentMatrix(y,v,x,b),ie=Es(W.kind,U,K,C,t,Z,J,q,w,!1,F,[0,0],0,s,f,R,B,ee,o.getProjection(),A,H,te,L,null),ne=r.imageAtlasTexture?r.imageAtlasTexture:null,re=1!==n.layout.get("icon-size").constantOr(0)||o.iconsNeedLinear,se=o.sdfIcons||t.options.rotating||t.options.zooming||re||$?T.LINEAR:T.NEAREST,oe=o.sdfIcons&&0!==n.paint.get("icon-halo-width").constantOr(1),ae=t.terrain&&C&&i?e.bi(e.bz(),G):Us;if(i&&o.icon){const e=k.elevation,i=e?e.getAtTileOffsetFunc(s,k.center.lat,k.worldSize,o.getProjection()):null,n=qt(p,r.tileID.canonical,C,M,k,o.getProjection(),m);ei(o,p,t,!1,n,X,C,g,i,s)}return{program:O,buffers:o.icon,uniformValues:ie,atlasTexture:ne,atlasTextureIcon:null,atlasInterpolation:se,atlasInterpolationIcon:null,isSDF:o.sdfIcons,hasHalo:oe,depthMode:D,tile:r,renderWithShadows:S,labelPlaneMatrixInv:ae}},U=()=>{const i=A&&"point"!==n.layout.get("symbol-placement"),a=[],l=i||O||Y,h="road"===o.elevationType,g=t.shadowRenderer,y=h&&D&&!!g&&g.enabled,v=j(y),x=h&&D&&!t.terrain?P:I;t.terrainRenderModeElevated()&&D&&a.push("PITCH_WITH_MAP_TERRAIN"),u&&(a.push("PROJECTION_GLOBE_VIEW"),l&&a.push("PROJECTED_POS_ON_VIEWPORT")),!o.text.zOffsetVertexBuffer||h&&t.terrain||a.push("Z_OFFSET"),o.iconsInText&&a.push("RENDER_TEXT_AND_SYMBOL"),a.push("RENDER_SDF"),y&&a.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"),h&&D&&!t.terrain&&o.text.orientationVertexBuffer&&a.push("ELEVATED_ROADS"),V(a);const b=o.text.programConfigurations.get(n.id),S=t.getOrCreateProgram("symbol",{config:b,defines:a});let M,C=[0,0],L=null;const E=o.textSizeData;o.iconsInText&&(C=r.imageAtlasTexture?r.imageAtlasTexture.size:[0,0],L=r.imageAtlasTexture?r.imageAtlasTexture:null,M=D||!k.isOrthographic||t.options.rotating||t.options.zooming||"composite"===E.kind||"camera"===E.kind?T.LINEAR:T.NEAREST);const F=r.glyphAtlasTexture?r.glyphAtlasTexture.size:[0,0],W=n.layout.get("text-size-scale-range"),U=e.ay(t.scaleFactor,W[0],W[1]),$=e.bH(E,k.zoom,U),G=Xt(p,r.tileID.canonical,D,A,k,o.getProjection(),m),X=Zt(p,r.tileID.canonical,D,A,k,o.getProjection(),m),q=t.translatePosMatrix(X,r,c,d,!0),Z=t.translatePosMatrix(p,r,c,d),J=l?Us:G,K=A&&!D&&!i;let Q=N;!z&&!k.mercatorFromTransition||A||(Q=$s(k));const ee=Es(E.kind,$,K,D,t,Z,J,q,w,!0,F,C,0,s,f,R,B,u?Q:N,o.getProjection(),v,H,null,null,U),te=r.glyphAtlasTexture?r.glyphAtlasTexture:null,ie=T.LINEAR,ne=0!==n.paint.get("text-halo-width").constantOr(1),re=t.terrain&&D&&i?e.bi(e.bz(),G):Us;if(i&&o.text){const e=k.elevation,i=e?e.getAtTileOffsetFunc(s,k.center.lat,k.worldSize,o.getProjection()):null,n=qt(p,r.tileID.canonical,D,A,k,o.getProjection(),m);ei(o,p,t,!0,n,X,D,_,i,s)}return{program:S,buffers:o.text,uniformValues:ee,atlasTexture:te,atlasTextureIcon:L,atlasInterpolation:ie,atlasInterpolationIcon:M,isSDF:!0,hasHalo:ne,depthMode:x,tile:r,renderWithShadows:y,labelPlaneMatrixInv:re}},$=o.icon.segments.get().length,G=o.text.segments.get().length,X=$&&!a.onlyText?W():null,q=G&&!a.onlyIcons?U():null,Z=n.paint.get("icon-opacity").constantOr(1),J=n.paint.get("text-opacity").constantOr(1);if(L&&o.canOverlap){E=!0;const t=Z&&!a.onlyText?o.icon.segments.get():[],i=J&&!a.onlyIcons?o.text.segments.get():[];for(const i of t)F.push({segments:new e.bd([i]),sortKey:i.sortKey,state:X});for(const t of i)F.push({segments:new e.bd([t]),sortKey:t.sortKey,state:q})}else a.onlyText||F.push({segments:Z?o.icon.segments:new e.bd([]),sortKey:0,state:X}),a.onlyIcons||F.push({segments:J?o.text.segments:new e.bd([]),sortKey:0,state:q})}E&&F.sort((e,t)=>e.sortKey-t.sortKey);for(const e of F){const i=e.state;if(i)if(t.terrain?t.terrain.setupElevationDraw(i.tile,i.program,{useDepthForOcclusion:k.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:i.labelPlaneMatrixInv}):t.setupDepthForOcclusion(k.depthOcclusionForSymbolsAndCircles,i.program),S.activeTexture.set(T.TEXTURE0),i.atlasTexture&&i.atlasTexture.bind(i.atlasInterpolation,T.CLAMP_TO_EDGE,!0),i.atlasTextureIcon&&(S.activeTexture.set(T.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,T.CLAMP_TO_EDGE,!0)),i.renderWithShadows&&t.shadowRenderer.setupShadows(i.tile.tileID.toUnwrapped(),i.program,"vector-tile"),t.uploadCommonLightUniforms(t.context,i.program),i.hasHalo){const r=i.uniformValues;r.u_is_halo=1,Zs(i.buffers,e.segments,n,t,i.program,i.depthMode,s,o,r,2),r.u_is_halo=0}else{if(i.isSDF){const r=i.uniformValues;i.hasHalo&&(r.u_is_halo=1,Zs(i.buffers,e.segments,n,t,i.program,i.depthMode,s,o,r,1)),r.u_is_halo=0}Zs(i.buffers,e.segments,n,t,i.program,i.depthMode,s,o,i.uniformValues,1)}}}function Zs(e,t,i,n,r,s,o,a,l,c){const h=[e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer,e.iconTransitioningVertexBuffer,e.globeExtVertexBuffer,e.zOffsetVertexBuffer,e.orientationVertexBuffer];r.draw(n,n.context.gl.TRIANGLES,s,o,a,Wi.disabled,l,i.id,e.layoutVertexBuffer,e.indexBuffer,t,i.paint,n.transform.zoom,e.programConfigurations.get(i.id),h,c)}function Js(t,i){const n=1<<t.canonical.z,r=(i.x*n-t.canonical.x-t.wrap*n)*e.aj,s=(i.y*n-t.canonical.y)*e.aj,o=e.e2(i.z,i.y);return e.d2(r,s,o)}function Ks(t,i,n,r,s){if(!n.layout||"none"===n.layout.get("fill-elevation-reference"))return;const o=t.context.gl,a=new Yi(t.context.gl.LEQUAL,Yi.ReadWrite,t.depthRangeFor3D),l=new Yi(t.context.gl.GREATER,Yi.ReadWrite,t.depthRangeFor3D),c=function(t){const i=e.cU(t.pitch);let n=.01;return t.isOrthographic&&(n=e.ai(1e-4,n,e.cZ(i>=sn?1:i/sn))),2*n}(t.transform),h=t.transform.getFreeCameraOptions().position,d="elevatedStructuresDepthReconstruct",u=t.getOrCreateProgram(d,{defines:["DEPTH_RECONSTRUCTION"]}),f=t.getOrCreateProgram(d);for(const e of r){const r=i.getTile(e),d=r.getBucket(n);if(!d)continue;const p=d.elevatedStructures;if(!p)continue;const m=d.elevationBufferData.heightRange,g=Js(e.toUnwrapped(),h),_=t.translatePosMatrix(e.projMatrix,r,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));let y,v,x,b;if("initialize"===s){if(!m||m.min>=1||0===p.depthSegments.segments[0].primitiveLength)continue;y=ps(_,g,c,1,0),v=a,x=p.depthSegments,b=u}else if("reset"===s){if(!m||m.min>=0||0===p.maskSegments.segments[0].primitiveLength)continue;y=ps(_,g,0,0,1),v=l,x=p.maskSegments,b=u}else if("geometry"===s){if(0===p.depthSegments.segments[0].primitiveLength)continue;y=ps(_,g,c,1,0),v=a,x=p.depthSegments,b=f}b.draw(t,o.TRIANGLES,v,Hi.disabled,Ni.disabled,Wi.disabled,y,n.id,p.vertexBuffer,p.indexBuffer,x,n.paint,t.transform.zoom)}}function Qs(t,i,n){const{painter:r,sourceCache:s,layer:o,coords:a,colorMode:l,elevationType:c,terrainEnabled:h,pass:d}=t,u=r.context.gl,f=o.paint.get("fill-pattern"),p=o.paint.get("fill-pattern-cross-fade"),m=f.constantOr(null);let g=c;"road"!==c||i&&!h||(g="none");const _="road"===g,y=t.painter.shadowRenderer,v=_&&!!y&&y.enabled,x=new Yi(r.context.gl.LEQUAL,Yi.ReadOnly,r.depthRangeFor3D);let b=[0,0,0];if(v){const e=r.style.directionalLight,t=r.style.ambientLight;e&&t&&(b=pn(r.style,e,t))}const w=f&&f.constantOr(1),S=(t,d)=>{let f,g,S,T,k;d?(f=w&&!o.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",S=u.LINES):(f=w?"fillPattern":"fill",S=u.TRIANGLES);for(const M of a){const a=s.getTile(M);if(w&&!a.patternsLoaded())continue;const A=a.getBucket(o);if(!A)continue;const C=i?A.elevationBufferData:A.bufferData;if(C.isEmpty())continue;r.prepareDrawTile();const D=C.programConfigurations.get(o.id),L=r.isTileAffectedByFog(M),E=[],I=[];_&&(E.push("ELEVATED_ROADS"),I.push(C.elevatedLayoutVertexBuffer)),v&&E.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"),w&&(r.context.activeTexture.set(u.TEXTURE0),a.imageAtlasTexture&&a.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),D.updatePaintBuffers());let P=!1;if(m&&a.imageAtlas){const t=a.imageAtlas,i=e.dZ.from(m),n=i.getPrimary().scaleSelf(e.q.devicePixelRatio).toString(),r=i.getSecondary(),s=t.patternPositions.get(n),o=r?t.patternPositions.get(r.scaleSelf(e.q.devicePixelRatio).toString()):null;P=!!s&&!!o,s&&D.setConstantPatternPositions(s,o)}p>0&&(P||D.getPatternTransitionVertexBuffer("fill-pattern"))&&E.push("FILL_PATTERN_TRANSITION");const R=r.getOrCreateProgram(f,{config:D,overrideFog:L,defines:E}),O=r.translatePosMatrix(M.projMatrix,a,o.paint.get("fill-translate"),o.paint.get("fill-translate-anchor"));v&&y.setupShadows(a.tileID.toUnwrapped(),R,"vector-tile");const z=o.paint.get("fill-emissive-strength");if(d){T=C.lineIndexBuffer,k=C.lineSegments;const e=r.terrain&&r.terrain.renderingToTexture?r.terrain.drapeBufferSize:[u.drawingBufferWidth,u.drawingBufferHeight];g="fillOutlinePattern"===f&&w?us(O,z,r,a,e,b,p):ds(O,z,e,b)}else T=C.indexBuffer,k=C.triangleSegments,g=w?hs(O,z,r,a,b,p):cs(O,z,b);r.uploadCommonUniforms(r.context,R,M.toUnwrapped());let F=t;("road"===c&&!h||"offset"===c)&&(F=x),R.draw(r,S,F,n||r.stencilModeForClipping(M),l,Wi.disabled,g,o.id,C.layoutVertexBuffer,T,k,o.paint,r.transform.zoom,D,I)}};r.renderPass===d&&S(r.depthModeForSublayer(1,"opaque"===r.renderPass?Yi.ReadWrite:Yi.ReadOnly),!1),"none"===g&&"translucent"===r.renderPass&&o.paint.get("fill-antialias")&&S(r.depthModeForSublayer(o.getPaintProperty("fill-outline-color")?2:0,Yi.ReadOnly),!0)}function eo(t,i,n,r,s,o,a,l){n.resetLayerRenderingStats(t);const c=t.context,h=c.gl,d=t.transform,u=n.paint.get("fill-extrusion-pattern"),f=n.paint.get("fill-extrusion-pattern-cross-fade"),p=u.constantOr(null),m=u.constantOr(1),g=n.paint.get("fill-extrusion-opacity"),_=t.style.enable3dLights(),y=n.paint.get(_&&!m?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),v=[n.paint.get("fill-extrusion-ambient-occlusion-intensity"),y],x=n.layout.get("fill-extrusion-edge-radius"),b=x>0&&!n.paint.get("fill-extrusion-rounded-roof"),w=b?0:x,S="globe"===d.projection.name?e.e5():0,T="globe"===d.projection.name,k=T?e.ah(d.zoom):0,M=[e.aD(d.center.lng),e.aH(d.center.lat)],A="none"===n.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),C=n.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(A?null:n.lut).toArray01().slice(0,3),D=n.paint.get("fill-extrusion-flood-light-intensity"),L=n.paint.get("fill-extrusion-vertical-scale"),E=0!==n.paint.get("fill-extrusion-line-width").constantOr(1),I=n.paint.get("fill-extrusion-height-alignment"),P=n.paint.get("fill-extrusion-base-alignment"),R=an(t,n.paint.get("fill-extrusion-cutoff-fade-range")),O=[];let z;T&&O.push("PROJECTION_GLOBE_VIEW"),v[0]>0&&O.push("FAUX_AO"),b&&O.push("ZERO_ROOF_RADIUS"),l&&O.push("HAS_CENTROID"),D>0&&O.push("FLOOD_LIGHT"),R.shouldRenderCutoff&&O.push("RENDER_CUTOFF"),E&&O.push("RENDER_WALL_MODE");const F="shadow"===t.renderPass,N=t.shadowRenderer,Y=F&&!!N,B=F?Wi.disabled:Wi.backCCW;t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!0);let H=[0,0,0];if(N){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(H=pn(t.style,e,i)),F||(O.push("RENDER_SHADOWS","DEPTH_TEXTURE"),N.useNormalOffset&&O.push("NORMAL_OFFSET")),z=O.concat(["SHADOWS_SINGLE_CASCADE"])}const j=Y?"fillExtrusionDepth":m?"fillExtrusionPattern":"fillExtrusion",V=n.getLayerRenderingStats();for(const u of r){const r=i.getTile(u),_=r.getBucket(n);if(!_||_.projection.name!==d.projection.name)continue;let y=!1;N&&(y=0===N.getMaxCascadeForTile(u.toUnwrapped()));const x=t.isTileAffectedByFog(u),b=_.programConfigurations.get(n.id);let A=!1;if(p&&r.imageAtlas){const t=r.imageAtlas,i=e.dZ.from(p),n=i.getPrimary().scaleSelf(e.q.devicePixelRatio).toString(),s=i.getSecondary(),o=t.patternPositions.get(n),a=s?t.patternPositions.get(s.scaleSelf(e.q.devicePixelRatio).toString()):null;A=!!o&&!!a,o&&b.setConstantPatternPositions(o,a)}f>0&&(A||b.getPatternTransitionVertexBuffer("fill-extrusion-pattern"))&&O.push("FILL_EXTRUSION_PATTERN_TRANSITION");const Y=t.getOrCreateProgram(j,{config:b,defines:y?z:O,overrideFog:x});if(t.terrain&&t.terrain.setupElevationDraw(r,Y,{useMeterToDem:!0}),!_.centroidVertexBuffer){const e=Y.attributes.a_centroid_pos;void 0!==e&&h.vertexAttrib2f(e,0,0)}!F&&N&&N.setupShadows(r.tileID.toUnwrapped(),Y,"vector-tile"),m&&(t.context.activeTexture.set(h.TEXTURE0),r.imageAtlasTexture&&r.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),b.updatePaintBuffers());const W=n.paint.get("fill-extrusion-vertical-gradient"),U=1/_.tileToMeter;let $;if(F&&N){if(ao(r.tileID,_.maxHeight,t))continue;const e=N.calculateShadowPassMatrixFromTile(r.tileID.toUnwrapped());$=as(e,w,U,L,I,P)}else{const e=t.translatePosMatrix(u.expandedProjMatrix,r,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),i=d.projection.createInversionMatrix(d,u.canonical);$=m?ls(e,t,W,g,v,w,U,u,r,S,I,P,k,M,i,C,L,f):os(e,t,W,g,v,w,U,u,S,I,P,k,M,i,C,L,D,H)}t.uploadCommonUniforms(c,Y,u.toUnwrapped(),null,R);let G=_.segments;if("mercator"===d.projection.name&&!F&&(G=_.getVisibleSegments(r.tileID,t.terrain,t.transform.getFrustum(0)),!G.get().length))continue;if(V)if(F)for(const e of G.get())V.numRenderedVerticesInShadowPass+=e.primitiveLength;else for(const e of G.get())V.numRenderedVerticesInTransparentPass+=e.primitiveLength;const X=[];(t.terrain||l)&&X.push(_.centroidVertexBuffer),T&&X.push(_.layoutVertexExtBuffer),E&&X.push(_.wallVertexBuffer),Y.draw(t,c.gl.TRIANGLES,s,o,a,B,$,n.id,_.layoutVertexBuffer,_.indexBuffer,G,n.paint,t.transform.zoom,b,X)}t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!1)}class to{constructor(){this.translate=[0,0],this.translateAnchor="map",this.edgeRadius=0,this.cutoffFadeRange=0}}function io(t,i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x){const b=i.context,w=b.gl,S=i.transform,T=i.transform.zoom,k=[],M=t.translate,A=t.translateAnchor,C=t.edgeRadius,D=an(i,t.cutoffFadeRange);"clear"===d?(k.push("CLEAR_SUBPASS"),x&&(k.push("CLEAR_FROM_TEXTURE"),b.activeTexture.set(w.TEXTURE0),x.bind(w.LINEAR,w.CLAMP_TO_EDGE))):"sdf"===d&&k.push("SDF_SUBPASS"),y&&k.push("HAS_CENTROID"),D.shouldRenderCutoff&&k.push("RENDER_CUTOFF");const L=(e,t,n,s,d)=>{const v=t.programConfigurations.get(r.id),w=i.isTileAffectedByFog(e),S=i.getOrCreateProgram("fillExtrusionGroundEffect",{config:v,defines:k,overrideFog:w}),M=((e,t,i,n,r,s,o,a,l,c,h)=>({u_matrix:t,u_opacity:i,u_ao_pass:n?1:0,u_meter_to_tile:r,u_ao:s,u_flood_light_intensity:o,u_flood_light_color:a,u_attenuation:l,u_edge_radius:c,u_fb:0,u_fb_size:h,u_dynamic_offset:1}))(0,s,u,h,d,[f,p*d],m,g,_,T>=17?0:C*d,x?x.size[0]:0),A=[];y&&A.push(t.hiddenByLandmarkVertexBuffer),i.uploadCommonUniforms(b,S,e.toUnwrapped(),null,D),S.draw(i,b.gl.TRIANGLES,o,a,l,c,M,r.id,t.vertexBuffer,t.indexBuffer,n,r.paint,T,v,A)};for(const t of s){const s=n.getTile(t),o=s.getBucket(r);if(!o||o.projection.name!==S.projection.name||!o.groundEffect||o.groundEffect&&!o.groundEffect.hasData())continue;const a=o.groundEffect,l=1/o.tileToMeter;{const e=i.translatePosMatrix(t.projMatrix,s,M,A),n=a.getDefaultSegment();L(t,a,n,e,l)}if(v)for(let o=0;o<4;o++){const a=e.e3[o](t),c=n.getTile(a);if(!c)continue;const h=c.getBucket(r);if(!h||h.projection.name!==S.projection.name||!h.groundEffect||h.groundEffect&&!h.groundEffect.hasData())continue;const d=h.groundEffect;let u,f;0===o?(u=[-e.aj,0,0],f=1):1===o?(u=[e.aj,0,0],f=0):2===o?(u=[0,-e.aj,0],f=3):(u=[0,e.aj,0],f=2);const p=d.regionSegments[f];if(!p)continue;const m=new Float32Array(16);e.bo(m,t.projMatrix,u),L(t,d,p,i.translatePosMatrix(m,s,M,A),l)}}}function no(t,i,n,r,s,o,a){0===r.centroidVertexArray.length&&r.createCentroidsBuffer();const l=o?o.findDEMTileFor(n):null;if(!(l&&l.dem||a))return;o&&l&&l.dem&&r.selfDEMTileTimestamp!==l.dem._timestamp&&(r.borderDoneWithNeighborZ=[-1,-1,-1,-1],r.selfDEMTileTimestamp=l.dem._timestamp);const c=t=>new e.P(Math.ceil((t+e.e7)*e.e8),0),h=e=>{const t=i.getSource().minzoom,n=e=>{const t=i.getTileByID(e);if(t&&t.hasData())return t.getBucket(s)},r=[0,-1,1];for(const i of r){if(e.overscaledZ+i<t)continue;const r=n(e.calculateScaledKey(e.overscaledZ+i));if(r)return r}},d=[0,0,0],u=(t,i)=>(d[0]=Math.min(t.min.y,i.min.y),d[1]=Math.max(t.max.y,i.max.y),d[2]=e.aj-i.min.x>t.max.x?i.min.x-e.aj:t.max.x,d),f=(t,i)=>(d[0]=Math.min(t.min.x,i.min.x),d[1]=Math.max(t.max.x,i.max.x),d[2]=e.aj-i.min.y>t.max.y?i.min.y-e.aj:t.max.y,d),p=[(e,t)=>u(e,t),(e,t)=>u(t,e),(e,t)=>f(e,t),(e,t)=>f(t,e)],m=(t,i,r,s,a,c,h)=>{if(!o)return 0;const d=[[c?r:t,c?t:r,0],[c?r:i,c?i:r,0]],u=h<0?e.aj+h:h,f=[c?u:(t+i)/2,c?(t+i)/2:u,0];return 0===r&&h<0||0!==r&&h>0?o.getForTilePoints(a,[f],!0,s):d.push(f),o.getForTilePoints(n,d,!0,l),Math.max(d[0][2],d[1][2],f[2])/o.exaggeration()};for(let t=0;t<4;t++){const i=r.borderFeatureIndices[t];if(0===i.length)continue;const s=e.e3[t](n),l=h(s);if(!(l&&l instanceof e.e4))continue;const d=o?o.findDEMTileFor(s):null;if(!(d&&d.dem||a))continue;if(o&&d&&d.dem&&r.borderDEMTileTimestamp[t]!==d.dem._timestamp&&(r.borderDoneWithNeighborZ[t]=-1,r.borderDEMTileTimestamp[t]=d.dem._timestamp),r.borderDoneWithNeighborZ[t]===l.canonical.z)continue;0===l.centroidVertexArray.length&&l.createCentroidsBuffer();const u=(t<2?1:5)-t,f=l.borderDoneWithNeighborZ[u]!==r.canonical.z,y=l.borderFeatureIndices[u];let v=0;if(r.canonical.z!==l.canonical.z){for(const e of i)r.showCentroid(r.featuresOnBorder[e]);if(f)for(const e of y)l.showCentroid(l.featuresOnBorder[e]);r.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[u]=r.canonical.z}for(const n of i){const i=r.featuresOnBorder[n],o=r.centroidData[i.centroidDataIndex],h=i.borders[t];let f;for(;v<y.length;){f=l.featuresOnBorder[y[v]];const e=f.borders[u];if(e[1]>h[0]+3||e[0]>h[0]-3)break;l.showCentroid(f),v++}if(f&&v<y.length){const n=v;let x=0;for(;!(f.borders[u][0]>h[1]-3)&&(x++,++v!==y.length);)f=l.featuresOnBorder[y[v]];f=l.featuresOnBorder[y[n]];let b=!1;if(x>=1){const e=f.borders[u];Math.abs(h[0]-e[0])<3&&Math.abs(h[1]-e[1])<3&&(x=1,b=!0,v=n+1)}else if(0===x){r.showCentroid(i);continue}const w=l.centroidData[f.centroidDataIndex];a&&b&&(((g=o).flags|(_=w).flags)&e.e6?(g.flags|=e.e6,_.flags|=e.e6):(g.flags&=~e.e6,_.flags&=~e.e6));const S=i.intersectsCount()>1||f.intersectsCount()>1;if(x>1)v=n,o.centroidXY=w.centroidXY=new e.P(0,0);else if(d&&d.dem&&!S){const i=p[t](o,w),n=t%2?e.aj-1:0,r=m(i[0],Math.min(e.aj-1,i[1]),n,d,s,t<2,i[2]);o.centroidXY=w.centroidXY=c(r)}else S?o.centroidXY=w.centroidXY=new e.P(0,0):(o.centroidXY=r.encodeBorderCentroid(i),w.centroidXY=l.encodeBorderCentroid(f));r.writeCentroidToBuffer(o),l.writeCentroidToBuffer(w)}else r.showCentroid(i)}r.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[u]=r.canonical.z}var g,_;(r.needsCentroidUpdate||!r.centroidVertexBuffer&&0!==r.centroidVertexArray.length)&&r.uploadCentroid(t)}const ro=[1,0,0],so=[0,1,0],oo=[0,0,1];function ao(t,i,n){const r=n.transform,s=n.shadowRenderer;if(!s)return!0;const o=t.toUnwrapped(),a=r.tileSize*s._cascades[n.currentShadowCascade].scale;let l=i;if(r.elevation){const e=r.elevation.getMinMaxForTile(t);e&&(l+=e.max)}const c=[...s.shadowDirection];c[2]=-c[2];const h=s.computeSimplifiedTileShadowVolume(o,l,a,c);if(!h)return!1;const d=[ro,so,oo,c,[c[0],0,c[2]],[0,c[1],c[2]]],u="globe"===r.projection.name,f=r.scaleZoom(a),p=e.cy.fromInvProjectionMatrix(r.invProjMatrix,r.worldSize,f,!u),m=s.getCurrentCascadeFrustum();return 0===p.intersectsPrecise(h.vertices,h.planes,d)||0===m.intersectsPrecise(h.vertices,h.planes,d)}function lo(t){const{painter:i,source:n,layer:r,coords:s}=t,o=t.defines,a=i.context,l="shadow"===i.renderPass,c="light-beam"===i.renderPass,h=i.shadowRenderer;let d;h&&(d=o.concat(["SHADOWS_SINGLE_CASCADE"]));const u=e.e9(i.transform.center.lat,i.transform.zoom);for(const f of s){const s=n.getTile(f),p=s.getBucket(r);if(!p)continue;let m=!1;h&&(m=0===h.getMaxCascadeForTile(f.toUnwrapped()));const g=p.programConfigurations.get(r.id);let _,y,v=i.translatePosMatrix(f.expandedProjMatrix,s,[0,0],"map");if(v=e.cP(e.bz(),v,[1,1,t.verticalScale]),l&&h){if(ao(s.tileID,p.maxHeight*u,i))continue;let n=h.calculateShadowPassMatrixFromTile(s.tileID.toUnwrapped());n=e.cP(e.bz(),n,[1,1,t.verticalScale]),y=_s(n),_=i.getOrCreateProgram("buildingDepth",{config:g,defines:m?d:o,overrideFog:!1})}else if(c)_=i.getOrCreateProgram("buildingBloom",{config:g,defines:m?d:o,overrideFog:!1}),y=gs(v);else{const n=i.transform.calculatePosMatrix(f.toUnwrapped(),i.transform.worldSize);e.cP(n,n,[1,1,t.verticalScale]);const r=e.bz();e.cP(r,n,[1,-1,1/u]),e.bi(r,r),e.ea(r,r),y=ms(v,r),_=i.getOrCreateProgram("building",{config:g,defines:m?d:o,overrideFog:!1}),h&&h.setupShadowsFromMatrix(n,_,!0)}if(i.uploadCommonUniforms(a,_,f.toUnwrapped(),null,null),c){const e=p.bloomGeometry;_.draw(i,a.gl.TRIANGLES,t.depthMode,Hi.disabled,t.blendMode,Wi.disabled,y,r.id,e.layoutVertexBuffer,e.indexBuffer,e.segmentsBucket,r.paint,i.transform.zoom,g,[e.layoutAttenuationBuffer,e.layoutColorBuffer])}else _.draw(i,a.gl.TRIANGLES,t.depthMode,Hi.disabled,t.blendMode,l?Wi.disabled:Wi.backCW,y,r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,r.paint,i.transform.zoom,g,[p.layoutNormalBuffer,p.layoutColorBuffer])}}function co(t){return[t[0]*e.eb,t[1]*e.eb,t[2]*e.eb,0]}function ho(t,i,n,r,s,o,a,l,c){const h=r.getSource(),d=n.globeSharedBuffers;if(!d)return;let u,f,p;if(i&&(u=r.getTile(i)),h instanceof e.aP?(f=h.texture,p=e.dE(0,0,n.transform)):u&&i&&(f=u.texture,p=e.dE(i.canonical.z,i.canonical.x,n.transform)),!f||!p)return;t||(p=e.cP(e.bz(),p,[1,-1,1]));const m=n.context,g=m.gl,_="nearest"===s.paint.get("raster-resampling")?g.NEAREST:g.LINEAR,y=n.colorModeForDrapableLayerRenderPass(o),v=a.defines;v.push("GLOBE_POLES");const x=new Yi(g.LEQUAL,Yi.ReadWrite,n.depthRangeFor3D),b=Float32Array.from(n.transform.expandedFarZProjMatrix),w=Float32Array.from(e.bh(e.dD(new e.cA(0,0,0))));n.terrain&&n.terrain.prepareDrawTile(),m.activeTexture.set(g.TEXTURE0),f.bind(_,g.CLAMP_TO_EDGE),m.activeTexture.set(g.TEXTURE1),f.bind(_,g.CLAMP_TO_EDGE),"useMipmap"in f&&m.extTextureFilterAnisotropic&&n.transform.pitch>20&&g.texParameterf(g.TEXTURE_2D,m.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,m.extTextureFilterAnisotropicMax);const[S,T,k,M]=i?d.getPoleBuffers(i.canonical.z,!1):d.getPoleBuffers(0,!0),A=s.paint.get("raster-elevation");let C;t?(C=S,n.renderDefaultNorthPole=0!==A):(C=T,n.renderDefaultSouthPole=0!==A);const D=co(a.mix),L=((e,t,i,n,r,s,o,a,l,c,h,d,u)=>Ts(e,t,i,new Float32Array(16),new Float32Array(9),[0,0],n,[0,0],[0,0,0,0],1,{opacity:1,mix:0},s,[0,0]||0,a,2,c,h,d,1,0,u))(b,w,p,e.ah(n.transform.zoom),0,s,0,A,0,D,a.offset,a.range,o),E=n.getOrCreateProgram("raster",{defines:v});n.uploadCommonUniforms(m,E,null),E.draw(n,g.TRIANGLES,x,c,y,l,L,s.id,C,k,M)}function uo(e){const t=e._nearZ,i=e.projection.farthestPixelDistance(e),n=i-t,r=.2*e.height,s=t+r;return[t,i,(s-r-t)/n,(s-t)/n]}function fo(e,t,i,n){if(e)return t instanceof it&&e instanceof bt?t.getTextureDescriptor(e,i,!0):{texture:e.texture,mix:co(n.mix),offset:n.offset,buffer:0,tileSize:1}}var po=e.ec([{name:"a_index",type:"Int16",components:1}]);class mo{constructor(t,i,n,r){const s={width:n[0],height:n[1],data:null},o=t.gl;this.targetColorTexture=new e.T(t,s,o.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new e.T(t,s,o.RGBA8,{useMipmap:!1}),this.context=t,this.updateParticleTexture(i,r),this.lastInvalidatedAt=0}updateParticleTexture(t,i){if(this.particleTextureDimension===i.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const n=this.context.gl,r=i.width*i.height;this.particleTexture0=new e.T(this.context,i,n.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new e.T(this.context,i,n.RGBA8,{premultiply:!1,useMipmap:!1});const s=new e.ed;s.reserve(r);for(let e=0;e<r;e++)s.emplaceBack(e);this.particleIndexBuffer=this.context.createVertexBuffer(s,po.members,!0),this.particleSegment=e.bd.simpleSegment(0,0,this.particleIndexBuffer.length,0),this.particleTextureDimension=i.width}update(t){return!(this.lastInvalidatedAt<t&&(this.lastInvalidatedAt=e.q.now(),1))}destroy(){this.targetColorTexture.destroy(),this.backgroundColorTexture.destroy(),this.particleIndexBuffer.destroy(),this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleSegment.destroy()}}function go(t,i,n){if(!t)return null;const r=i.getTextureDescriptor(t,n,!0);if(!r)return null;let{texture:s,mix:o,offset:a,tileSize:l,buffer:c,format:h}=r;if(!s||!h)return null;let d=!1;return"uint32"===h&&(d=!0,o[3]=0,o=ws(e.ee,o,[0,n.paint.get("raster-particle-max-speed")]),a=Ss(e.ee,a,[0,n.paint.get("raster-particle-max-speed")])),{texture:s,textureOffset:[c/(l+2*c),l/(l+2*c)],tileSize:l,scalarData:d,scale:o,offset:a,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[h]]}}function _o(e){const t=e._nearZ,i=e.projection.farthestPixelDistance(e),n=i-t,r=.2*e.height,s=t+r;return[t,i,(s-r-t)/n,(s-t)/n]}const yo=new e.am(1,0,0,1),vo=new e.am(0,1,0,1),xo=new e.am(0,0,1,1),bo=new e.am(1,0,1,1),wo=new e.am(0,1,1,1);function So(t,i,n,r,s,o){for(let a=0;a<n.length;a++)if(s){const s=1,l=.8,c=new e.am(r.r*l,r.g*l,r.b*l,1);To(t,i,n[a],r,-s,-s,o),To(t,i,n[a],r,-s,s,o),To(t,i,n[a],r,s,s,o),To(t,i,n[a],r,s,-s,o),To(t,i,n[a],c,0,0,o)}else To(t,i,n[a],r,0,0,o)}function To(t,i,n,r,s,o,a){const l=t.context,c=t.transform,h=l.gl,d="globe"===c.projection.name,u=d?["PROJECTION_GLOBE_VIEW"]:[];let f=e.bw(n.projMatrix);if(d&&e.ah(c.zoom)>0){const t=e.bg(n.canonical,c),i=e.ef(t);f=e.az(new Float32Array(16),c.globeMatrix,i),e.az(f,c.projMatrix,f)}const p=e.bz();p[12]+=2*s/(e.q.devicePixelRatio*c.width),p[13]+=2*o/(e.q.devicePixelRatio*c.height),e.az(f,p,f);const m=t.getOrCreateProgram("debug",{defines:u}),g=i.getTileByID(n.key);t.terrain&&t.terrain.setupElevationDraw(g,m);const _=Yi.disabled,y=Hi.disabled,v=t.colorModeForRenderPass(),x="$debug";l.activeTexture.set(h.TEXTURE0),t.emptyTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),d?g._makeGlobeTileDebugBuffers(t.context,c):g._makeDebugTileBoundsBuffers(t.context,c.projection);const b=g._tileDebugBuffer||t.debugBuffer,w=g._tileDebugIndexBuffer||t.debugIndexBuffer,S=g._tileDebugSegments||t.debugSegments;if(m.draw(t,h.LINE_STRIP,_,y,v,Wi.disabled,vs(f,r.toPremultipliedRenderColor(null)),x,b,w,S,null,null,null,[g._globeTileDebugBorderBuffer]),a){const e=g.latestRawTileData,i=Math.floor((e&&e.byteLength||0)/1024);let r=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(r+=` => ${n.overscaledZ}`),r+=` ${g.state}`,r+=` ${i}kb`,function(e,t){e.initDebugOverlayCanvas();const i=e.debugOverlayCanvas,n=e.context.gl,r=e.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(t,5,5),r.strokeText(t,5,5),e.debugOverlayTexture.update(i),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,r)}const T=i.getTile(n).tileSize,k=512/Math.min(T,512)*(n.overscaledZ/c.zoom)*.5,M=g._tileDebugTextBuffer||t.debugBuffer,A=g._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,C=g._tileDebugTextSegments||t.debugSegments;m.draw(t,h.TRIANGLES,_,y,Ni.alphaBlended,Wi.disabled,vs(f,e.am.transparent.toPremultipliedRenderColor(null),k),x,M,A,C,null,null,null,[g._globeTileDebugTextBuffer])}function ko(e,t,i,n){Ao(e,0,t+i/2,e.transform.width,i,n)}function Mo(e,t,i,n){Ao(e,t-i/2,0,i,e.transform.height,n)}function Ao(t,i,n,r,s,o){const a=t.context,l=a.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*e.q.devicePixelRatio,n*e.q.devicePixelRatio,r*e.q.devicePixelRatio,s*e.q.devicePixelRatio),a.clear({color:o}),l.disable(l.SCISSOR_TEST)}const Co=e.ec([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Do}=Co;function Lo(e,t,i,n){e.emplaceBack(t,i,n)}class Eo{constructor(t){this.vertexArray=new e.eg,this.indices=new e.a_,Lo(this.vertexArray,-1,-1,1),Lo(this.vertexArray,1,-1,1),Lo(this.vertexArray,-1,1,1),Lo(this.vertexArray,1,1,1),Lo(this.vertexArray,-1,-1,-1),Lo(this.vertexArray,1,-1,-1),Lo(this.vertexArray,-1,1,-1),Lo(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=t.createVertexBuffer(this.vertexArray,Do),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=e.bd.simpleSegment(0,0,36,12)}}function Io(t,i,n,r,s,o){const a=t.context.gl,l=i.paint.get("sky-atmosphere-color"),c=i.paint.get("sky-atmosphere-halo-color"),h=i.paint.get("sky-atmosphere-sun-intensity"),d=((e,t,i,n,r)=>({u_matrix_3f:e,u_sun_direction:t,u_sun_intensity:i,u_color_tint_r:[n.r,n.g,n.b,n.a],u_color_tint_m:[r.r,r.g,r.b,r.a],u_luminance:5e-5}))(e.ei(e.dJ(),r),s,h,l.toPremultipliedRenderColor(null),c.toPremultipliedRenderColor(null));a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+o,i.skyboxTexture,0),n.draw(t,a.TRIANGLES,Yi.disabled,Hi.disabled,Ni.unblended,Wi.frontCW,d,"skyboxCapture",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}const Po=e.ec([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Ro{constructor(t){const i=new e.ej;i.emplaceBack(-1,1,1,0,0),i.emplaceBack(1,1,1,1,0),i.emplaceBack(1,-1,1,1,1),i.emplaceBack(-1,-1,1,0,1);const n=new e.a_;n.emplaceBack(0,1,2),n.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(i,Po.members),this.indexBuffer=t.createIndexBuffer(n),this.segments=e.bd.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Oo=e.ec([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_fade_opacity",components:1}]);class zo{constructor(){this.starsCount=16e3,this.sizeMultiplier=.15,this.sizeRange=100,this.intensityRange=200}}class Fo{constructor(t){this.colorModeAlphaBlendedWriteRGB=new Ni([1,Fi,1,Fi],e.am.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new Ni([1,0,1,0],e.am.transparent,[!1,!1,!1,!0]),this.params=new zo,this.updateNeeded=!0,t.tp.registerParameter(this.params,["Stars"],"starsCount",{min:100,max:16e3,step:1},()=>{this.updateNeeded=!0}),t.tp.registerParameter(this.params,["Stars"],"sizeMultiplier",{min:.01,max:2,step:.01}),t.tp.registerParameter(this.params,["Stars"],"sizeRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0}),t.tp.registerParameter(this.params,["Stars"],"intensityRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0})}update(t){const i=t.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new Ro(i);const t=this.params.sizeRange,n=this.params.intensityRange,r=function(t){const i=e.el(30),n=[];for(let r=0;r<t;++r){const t=2*Math.PI*i(),r=Math.acos(1-2*i())-.5*Math.PI;n.push(e.d2(Math.cos(r)*Math.cos(t),Math.cos(r)*Math.sin(t),Math.sin(r)))}return n}(this.params.starsCount),s=e.el(300),o=new e.ek,a=new e.a_;let l=0;for(let i=0;i<r.length;++i){const c=e.c1([],r[i],200),h=Math.max(0,1+.01*t*(1*s()-.5)),d=Math.max(0,1+.01*n*(1*s()-.5));o.emplaceBack(c[0],c[1],c[2],-1,-1,h,d),o.emplaceBack(c[0],c[1],c[2],1,-1,h,d),o.emplaceBack(c[0],c[1],c[2],1,1,h,d),o.emplaceBack(c[0],c[1],c[2],-1,1,h,d),a.emplaceBack(l+0,l+1,l+2),a.emplaceBack(l+0,l+2,l+3),l+=4}this.starsVx=i.createVertexBuffer(o,Oo.members),this.starsIdx=i.createIndexBuffer(a),this.starsSegments=e.bd.simpleSegment(0,0,o.length,a.length)}}destroy(){this.atmosphereBuffer&&this.atmosphereBuffer.destroy(),this.starsVx&&this.starsVx.destroy(),this.starsIdx&&this.starsIdx.destroy()}drawAtmosphereGlow(t,i){const n=t.context,r=n.gl,s=t.transform,o=new Yi(r.LEQUAL,Yi.ReadOnly,[0,1]),a=e.ah(s.zoom),l=t.style.getLut(i.scope),c="none"===i.properties.get("color-use-theme"),h=i.properties.get("color").toNonPremultipliedRenderColor(c?null:l).toArray01(),d="none"===i.properties.get("high-color-use-theme"),u=i.properties.get("high-color").toNonPremultipliedRenderColor(d?null:l).toArray01(),f="none"===i.properties.get("space-color-use-theme"),p=i.properties.get("space-color").toNonPremultipliedRenderColor(f?null:l).toArray01(),m=5e-4,g=e.em(i.properties.get("horizon-blend"),0,1,m,.25),_=e.dy(t,n,s)&&g===m?s.worldSize/(2*Math.PI*1.025)-1:s.globeRadius,y=t.frameCounter/1e3%1,v=e.ae(s.globeCenterInViewSpace),x=Math.sqrt(Math.pow(v,2)-Math.pow(_,2)),b=Math.acos(x/v),w=e=>{const i="globe"===s.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];e&&i.push("ALPHA_PASS");const l=t.getOrCreateProgram("globeAtmosphere",{defines:i}),c=((e,t,i,n,r,s,o,a,l,c,h,d)=>({u_frustum_tl:e,u_frustum_tr:t,u_frustum_br:i,u_frustum_bl:n,u_horizon:r,u_transition:s,u_fadeout_range:o,u_color:a,u_high_color:l,u_space_color:c,u_temporal_offset:h,u_horizon_angle:d}))(s.frustumCorners.TL,s.frustumCorners.TR,s.frustumCorners.BR,s.frustumCorners.BL,s.frustumCorners.horizon,a,g,h,u,p,y,b);t.uploadCommonUniforms(n,l);const d=this.atmosphereBuffer;d&&l.draw(t,r.TRIANGLES,o,Hi.disabled,e?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,Wi.backCW,c,e?"atmosphere_glow_alpha":"atmosphere_glow",d.vertexBuffer,d.indexBuffer,d.segments)};w(!1),w(!0)}drawStars(t,i){const n=e.ay(i.properties.get("star-intensity"),0,1);if(0===n)return;const r=t.context,s=r.gl,o=t.transform,a=t.getOrCreateProgram("stars"),l=e.c3([]);e.c5(l,l,-o._pitch),e.c4(l,l,-o.angle),e.c5(l,l,e.al(o._center.lat)),e.en(l,l,-e.al(o._center.lng));const c=e.c8(new Float32Array(16),l),h=e.az([],o.starsProjMatrix,c),d=e.ei([],c),u=e.eo([],d),f=[0,1,0];e.dL(f,f,u),e.c1(f,f,this.params.sizeMultiplier);const p=[1,0,0];e.dL(p,p,u),e.c1(p,p,this.params.sizeMultiplier);const m=(g=f,_=p,y=n,{u_matrix:Float32Array.from(h),u_up:g,u_right:_,u_intensity_multiplier:y});var g,_,y;t.uploadCommonUniforms(r,a),this.starsVx&&this.starsIdx&&a.draw(t,s.TRIANGLES,Yi.disabled,Hi.disabled,this.colorModeAlphaBlendedWriteRGB,Wi.disabled,m,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}class No{constructor(){this.visibleTiles=[]}updateBorders(t,i){const n=[],r=[],s=t._getRenderableCoordinates(!1,!0);for(const e of s){const s=t.getTile(e);if(!s.hasData())continue;const o=s.getBucket(i);o&&(o.isEmpty()||(n.push(e.key),r.push({bucket:o,tileID:e.canonical})))}let o=n.length!==this.visibleTiles.length;if(!o){n.sort();for(let e=0;e<n.length;e++)if(n[e]!==this.visibleTiles[e]){o=!0;break}}if(!o)return;const a=new Set;this.visibleTiles=n,r.sort((e,t)=>e.tileID.z-t.tileID.z||e.tileID.x-t.tileID.x||e.tileID.y-t.tileID.y);for(const t of r){const i=new Array,n=new Array,r=t.bucket;for(const e of r.featuresOnBorder)a.has(e.featureId)?n.push(e.footprintIndex):(a.add(e.featureId),i.push(e.footprintIndex));r.updateFootprintHiddenFlags(i,e.ep,!1),r.updateFootprintHiddenFlags(n,e.ep,!0)}}}function Yo(t,i){const n=[...t],r=i.cameraWorldSizeForFog/i.worldSize,s=e.bx([]);return e.cP(s,s,[r,r,1]),e.az(n,s,n),e.az(n,i.worldToFogMatrix,n),n}function Bo(t,i,n,r,s){const o=n.material,a=r.context,{baseColorTexture:l,metallicRoughnessTexture:c}=o.pbrMetallicRoughness,{normalTexture:h,occlusionTexture:d,emissionTexture:u}=o;function f(e,i,n){if(e&&(t.push(i),a.activeTexture.set(a.gl.TEXTURE0+n),e.gfxTexture)){const{minFilter:t,magFilter:i,wrapS:n,wrapT:r}=e.sampler;e.gfxTexture.bindExtraParam(t,i,n,r)}}f(l,"HAS_TEXTURE_u_baseColorTexture",Zi),f(c,"HAS_TEXTURE_u_metallicRoughnessTexture",Ji),f(h,"HAS_TEXTURE_u_normalTexture",Ki),f(d,"HAS_TEXTURE_u_occlusionTexture",Qi),f(u,"HAS_TEXTURE_u_emissionTexture",en),s&&(s.texture||(s.texture=new e.et(r.context,s.image,[s.image.height,s.image.height,s.image.height],a.gl.RGBA8)),a.activeTexture.set(a.gl.TEXTURE0+tn),s.texture&&s.texture.bind(a.gl.LINEAR,a.gl.CLAMP_TO_EDGE),t.push("APPLY_LUT_ON_GPU")),n.texcoordBuffer&&(t.push("HAS_ATTRIBUTE_a_uv_2f"),i.push(n.texcoordBuffer)),n.colorBuffer&&(t.push(12===n.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),i.push(n.colorBuffer)),n.normalBuffer&&(t.push("HAS_ATTRIBUTE_a_normal_3f"),i.push(n.normalBuffer)),n.pbrBuffer&&(t.push("HAS_ATTRIBUTE_a_pbr"),t.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),i.push(n.pbrBuffer)),"OPAQUE"!==o.alphaMode&&"MASK"!==o.alphaMode||t.push("UNPREMULT_TEXTURE_IN_SHADER"),o.defined||t.push("DIFFUSE_SHADED");const p=r.shadowRenderer;p&&(t.push("RENDER_SHADOWS","DEPTH_TEXTURE"),p.useNormalOffset&&t.push("NORMAL_OFFSET"))}function Ho(t,i,n,r,s,o){const a=n.paint.get("model-opacity").constantOr(1),l=i.context,c=new Yi(i.context.gl.LEQUAL,Yi.ReadWrite,i.depthRangeFor3D),h=i.transform,d=t.mesh,u=d.material,f=u.pbrMetallicRoughness,p=i.style.fog;let m;m="pixels"===i.transform.projection.zAxisUnit?[...t.nodeModelMatrix]:e.az([],r.zScaleMatrix,t.nodeModelMatrix),e.az(m,r.negCameraPosMatrix,m);const g=e.bi([],m);e.ea(g,g);const _="none"===n.paint.get("model-color-use-theme").constantOr("default"),y=n.paint.get("model-emissive-strength").constantOr(0),v=Os(new Float32Array(t.worldViewProjection),new Float32Array(m),new Float32Array(g),null,i,a,f.baseColorFactor,u.emissiveFactor,f.metallicFactor,f.roughnessFactor,u,y,n),x={defines:[]},b=[],w=i.shadowRenderer;w&&(w.useNormalOffset=!1),Bo(x.defines,b,d,i,_?null:n.lut);let S=null;if(p){const e=Yo(t.nodeModelMatrix,i.transform);if(S=new Float32Array(e),"globe"!==h.projection.name){const t=d.aabb.min,i=d.aabb.max,[n,r]=p.getOpacityForBounds(e,t[0],t[1],i[0],i[1]);x.overrideFog=n>=Re||r>=Re}}const T=an(i,n.paint.get("model-cutoff-fade-range"));T.shouldRenderCutoff&&x.defines.push("RENDER_CUTOFF");const k=i.getOrCreateProgram("model",x);i.uploadCommonUniforms(l,k,null,S,T),"shadow"!==i.renderPass&&w&&w.setupShadowsFromMatrix(t.nodeModelMatrix,k),k.draw(i,l.gl.TRIANGLES,c,s,o,d.material.doubleSided?Wi.disabled:Wi.backCCW,v,n.id,d.vertexBuffer,d.indexBuffer,d.segments,n.paint,i.transform.zoom,void 0,b)}function jo(t,i,n,r,s,o,a){let l;l="globe"===t.projection.name?e.er(n,t):[...n],e.az(l,l,i.matrix);const c=e.az([],r,l);if(i.meshes)for(const n of i.meshes){if("BLEND"!==n.material.alphaMode){a.push({mesh:n,depth:0,modelIndex:s,worldViewProjection:c,nodeModelMatrix:l});continue}const i=e.ad([],n.centroid,c);!t.isOrthographic&&i[2]<=0||o.push({mesh:n,depth:i[2],modelIndex:s,worldViewProjection:c,nodeModelMatrix:l})}if(i.children)for(const e of i.children)jo(t,e,n,r,s,o,a)}function Vo(e,t,i,n){const r=i.shadowRenderer;if(!r)return;const s=r.getShadowPassDepthMode(),o=r.getShadowPassColorMode(),a=r.calculateShadowPassMatrixFromMatrix(t),l=zs(a);i.getOrCreateProgram("modelDepth",{defines:i._shadowMapDebug?[]:["DEPTH_TEXTURE"]}).draw(i,i.context.gl.TRIANGLES,s,Hi.disabled,o,Wi.backCCW,l,n.id,e.vertexBuffer,e.indexBuffer,e.segments,n.paint,i.transform.zoom,void 0,void 0)}function Wo(t,i,n){const r=i.updateZoomBasedPaintProperties(),s=function(t,i,n){let r,s,o,a=t.terrain?t.terrain.exaggeration():0;if(t.terrain&&a>0){const i=t.terrain,s=i.findDEMTileFor(n);s&&s.dem?r=e.eu.create(i,n,s):a=0}if(0===a&&(i.terrainElevationMin=0,i.terrainElevationMax=0),a===i.validForExaggeration&&(0===a||r&&r._demTile&&r._demTile.tileID===i.validForDEMTile.id&&r._dem._timestamp===i.validForDEMTile.timestamp))return!1;for(const e in i.instancesPerModel){const t=i.instancesPerModel[e];for(let e=0;e<t.instancedDataArray.length;++e){const n=(r?a*r.getElevationAt(0|t.instancedDataArray.float32[16*e],0|t.instancedDataArray.float32[16*e+1],!0,!0):0)+t.instancesEvaluatedElevation[e];t.instancedDataArray.float32[16*e+6]=n,s=s?Math.min(i.terrainElevationMin,n):n,o=o?Math.max(i.terrainElevationMax,n):n}}return i.terrainElevationMin=s||0,i.terrainElevationMax=o||0,i.validForExaggeration=a,i.validForDEMTile=r&&r._demTile?{id:r._demTile.tileID,timestamp:r._dem._timestamp}:{id:void 0,timestamp:0},!0}(t,i,n);(r||s)&&(i.uploaded=!1,i.upload(t.context))}const Uo={shadowUniformsInitialized:!1,useSingleShadowCascade:!1,tileMatrix:new Float64Array(16),shadowTileMatrix:new Float32Array(16),aabb:new e.d6([0,0,0],[e.aj,e.aj,0])};function $o(t,i){const n=1<<t.canonical.z,r=i.getFreeCameraOptions().position,s=i.elevation,o=t.canonical.x/n,a=(t.canonical.x+1)/n,l=t.canonical.y/n,c=(t.canonical.y+1)/n;let h=i._centerAltitude;if(s){const e=s.getMinMaxForTile(t);e&&e.max>h&&(h=e.max)}const d=e.ay(r.x,o,a)-r.x,u=e.ay(r.y,l,c)-r.y,f=e.cb(h,i.center.lat)-r.z;return i._zoomFromMercatorZ(Math.sqrt(d*d+u*u+f*f))}function Go(e,t,i,n,r,s,o){const a=e.context,l="shadow"===e.renderPass,c=e.shadowRenderer,h=l&&c?c.getShadowPassDepthMode():new Yi(a.gl.LEQUAL,Yi.ReadWrite,e.depthRangeFor3D),d=e.isTileAffectedByFog(s);if(i.meshes)for(const u of i.meshes){const f=["MODEL_POSITION_ON_GPU"],p=[];let m,g,_;n.instancedDataArray.length>20&&f.push("INSTANCED_ARRAYS");const y=an(e,t.paint.get("model-cutoff-fade-range"));if(y.shouldRenderCutoff&&f.push("RENDER_CUTOFF"),l&&c)m=e.getOrCreateProgram("modelDepth",{defines:f}),g=zs(o.shadowTileMatrix,o.shadowTileMatrix,Float32Array.from(i.matrix)),_=c.getShadowPassColorMode();else{Bo(f,p,u,e,"none"===t.paint.get("model-color-use-theme").constantOr("default")?null:t.lut),m=e.getOrCreateProgram("model",{defines:f,overrideFog:d});const n=u.material,l=n.pbrMetallicRoughness,h=t.paint.get("model-opacity").constantOr(1),v=t.paint.get("model-emissive-strength").constantOr(0);g=Os(s.expandedProjMatrix,Float32Array.from(i.matrix),new Float32Array(16),null,e,h,l.baseColorFactor,n.emissiveFactor,l.metallicFactor,l.roughnessFactor,n,v,t,r),c&&(o.shadowUniformsInitialized?m.setShadowUniformValues(a,c.getShadowUniformValues()):(c.setupShadows(s.toUnwrapped(),m,"model-tile"),o.shadowUniformsInitialized=!0)),_=y.shouldRenderCutoff||h<1||"OPAQUE"!==n.alphaMode?Ni.alphaBlended:Ni.unblended}e.uploadCommonUniforms(a,m,s.toUnwrapped(),null,y);const v=u.material.doubleSided?Wi.disabled:Wi.backCCW;if(n.instancedDataArray.length>20)p.push(n.instancedDataBuffer),m.draw(e,a.gl.TRIANGLES,h,Hi.disabled,_,v,g,t.id,u.vertexBuffer,u.indexBuffer,u.segments,t.paint,e.transform.zoom,void 0,p,n.instancedDataArray.length);else{const i=l?"u_instance":"u_normal_matrix";for(let r=0;r<n.instancedDataArray.length;++r)g[i]=new Float32Array(n.instancedDataArray.arrayBuffer,64*r,16),m.draw(e,a.gl.TRIANGLES,h,Hi.disabled,_,v,g,t.id,u.vertexBuffer,u.indexBuffer,u.segments,t.paint,e.transform.zoom,void 0,p)}}if(i.children)for(const a of i.children)Go(e,t,a,n,r,s,o)}const Xo=[1,-1,1];function qo(t,i,n,r){if(!n.modelManager)return!0;const s=n.modelManager;if(!n.shadowRenderer)return!0;const o=n.shadowRenderer,a=i.aabb;let l=!0,c=t.maxHeight;if(0===c){let e=0;for(const i in t.instancesPerModel){const t=s.getModel(i,r);t?e=Math.max(e,Math.max(Math.max(t.aabb.max[0],t.aabb.max[1]),t.aabb.max[2])):l=!1}c=t.maxScale*e*1.41+t.maxVerticalOffset,l&&(t.maxHeight=c)}a.max[2]=c,a.min[2]+=t.terrainElevationMin,a.max[2]+=t.terrainElevationMax,e.ad(a.min,a.min,i.tileMatrix),e.ad(a.max,a.max,i.tileMatrix);const h=a.intersects(o.getCurrentCascadeFrustum());return 0===n.currentShadowCascade&&(t.isInsideFirstShadowMapFrustum=2===h),0===h}function Zo(t,i){const n=t.uniformValues.u_cutoff_params[0],r=t.uniformValues.u_cutoff_params[1],s=t.uniformValues.u_cutoff_params[2],o=t.uniformValues.u_cutoff_params[3];return r===n||o===s?1:e.ay(((i-n)/(r-n)-s)/(o-s),0,1)}function Jo(t,i,n,r){if(i.pitch<20)return 1;const s=i.getWorldToCameraMatrix();e.az(s,s,t);const o=e.bR(n.min[0],n.min[1],n.min[2],1);let a=e.aA(e.ev(),o,s),l=a,c=a;o[1]=n.max[1],a=e.aA(e.ev(),o,s),l=a[1]<l[1]?a:l,c=a[1]>c[1]?a:c,o[0]=n.max[0],a=e.aA(e.ev(),o,s),l=a[1]<l[1]?a:l,c=a[1]>c[1]?a:c,o[1]=n.min[1],a=e.aA(e.ev(),o,s),l=a[1]<l[1]?a:l,c=a[1]>c[1]?a:c;const h=e.ay(r[0],0,1),d=100*i.pixelsPerMeter*e.ay(r[1],0,1),u=e.ay(r[2],0,1),f=e.ew(e.ev(),l,c,h),p=Math.tan(.5*i.fovX),m=-f[2]*p;if(0===d)return f[1]<-Math.abs(m)?u:1;const g=(-Math.abs(m)-f[1])/d,_=(e,t,i)=>(1-i)*e+i*t,y=e.ay(_(1,u,g),u,1);return _(1,y,e.ay((i.pitch-20)/20,0,1))}class Ko{}class Qo{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(t,i,n){{const e=this._storage.get(i.id);if(e)return e.lastUsedFrameIdx=t,e.buf}const r=n.gl,s=r.getBufferParameter(r.ELEMENT_ARRAY_BUFFER,r.BUFFER_SIZE),o=new ArrayBuffer(s),a=new Int16Array(o);r.getBufferSubData(r.ELEMENT_ARRAY_BUFFER,0,new Int16Array(o));const l=new e.ey;for(let e=0;e<s/2;e+=3){const t=a[e],i=a[e+1],n=a[e+2];l.emplaceBack(t,i),l.emplaceBack(i,n),l.emplaceBack(n,t)}const c=n.bindVertexArrayOES.current,h=new Ko;return h.buf=new Ns(n,l),h.lastUsedFrameIdx=t,this._storage.set(i.id,h),n.bindVertexArrayOES.set(c),h.buf}update(e){for(const[t,i]of this._storage)e-i.lastUsedFrameIdx>30&&(i.buf.destroy(),this._storage.delete(t))}destroy(){for(const[e,t]of this._storage)t.buf.destroy(),this._storage.delete(e)}}class ea{constructor(e){this.occluderSize=30,this.depthOffset=-1e-4,e.registerParameter(this,["Occlusion"],"occluderSize",{min:1,max:100,step:1}),e.registerParameter(this,["Occlusion"],"depthOffset",{min:-.05,max:0,step:1e-5})}}const ta=e.ec([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]);class ia{registerParameter(){}registerButton(){}registerBinding(){}refreshUI(){}}class na{constructor(e,t){this.revealStart=11,this.revealRange=2,e.registerParameter(this,[...t,"Reveal"],"revealStart",{min:0,max:17,step:.05}),e.registerParameter(this,[...t,"Reveal"],"revealRange",{min:.1,max:5.1,step:.05})}}const ra=e.ec([{type:"Float32",name:"a_pos_2f",components:2}]);class sa{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy()}draw(t,i){const n=t.getOrCreateProgram("vignette");if(!this.vignetteVx||!this.vignetteIdx){const i=new e.ez,n=new e.a_;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(1,1),i.emplaceBack(-1,1),n.emplaceBack(0,1,2),n.emplaceBack(0,2,3),this.vignetteVx=t.context.createVertexBuffer(i,ra.members),this.vignetteIdx=t.context.createIndexBuffer(n)}const r=e.bd.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){t.uploadCommonUniforms(t.context,n);const e={u_vignetteShape:(s={vignetteShape:[i.start,i.range,Math.pow(10,i.fadePower)],vignetteColor:[i.color.r,i.color.g,i.color.b,i.color.a*i.strength]}).vignetteShape,u_vignetteColor:s.vignetteColor};n.draw(t,t.context.gl.TRIANGLES,Yi.disabled,Hi.disabled,Ni.alphaBlended,Wi.disabled,e,"vignette",this.vignetteVx,this.vignetteIdx,r)}var s}}class oa{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0}update(t,i){const n=t.getFreeCameraOptions().position,r=n.toAltitude(),s=n.toLngLat(),o=e.al(s.lng),a=e.al(s.lat),l=t.pixelsPerMeter/i,c=o*e.eB,h=e.eB*Math.log(Math.tan(Math.PI/4+a/2));if(void 0===this._offsetXPrev)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else{const e=-this._offsetYPrev+h,t=-this._elevationPrev+r;this._accumulatedOffsetX+=(-this._offsetXPrev+c)*l,this._accumulatedOffsetY+=e*l,this._accumulatedElevation+=t*l,this._offsetXPrev=c,this._offsetYPrev=h,this._elevationPrev=r}}getPosition(){return[this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function aa(e,t){return[-(e[0]-Math.floor(e[0]/t)*t),-(e[1]-Math.floor(e[1]/t)*t),-(e[2]-Math.floor(e[2]/t)*t)]}function la(t){const i=e.el(1323123451230),n=[];for(let r=0;r<t;++r){const t=2*i()-1,r=2*i()-1,s=2*i()-1;n.push(e.d2(t,r,s))}return n}function ca(t,i,n,r,s){const o=e.ay((s-n)/(r-n),0,1);return(1-o)*t+o*i}class ha{constructor(e){this._movement=new oa,this._accumulatedTimeFromStart=0,this._prevTime=Date.now()/1e3,this._vignette=new sa,this._ppmScaleFactor=e}destroy(){this.particlesVx&&this.particlesVx.destroy(),this.particlesIdx&&this.particlesIdx.destroy(),this._vignette&&this._vignette.destroy()}updateOnRender(t,i){const n=t.transform;this._movement.update(n,this._ppmScaleFactor);const r=n.starsProjMatrix,s=e.c3([]);e.c5(s,s,e.al(90)-n._pitch),e.c4(s,s,-n.angle);const o=e.c8(new Float32Array(16),s),a=e.eA(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),l=e.ea([],a),c=e.az([],l,o),h=Date.now()/1e3;return this._accumulatedTimeFromStart+=(h-this._prevTime)*i,this._prevTime=h,{projectionMatrix:r,modelviewMatrix:c}}}class da extends ha{constructor(e){super(4.25),this._params={overrideStyleParameters:!1,intensity:.5,timeFactor:1,velocityConeAperture:0,velocity:300,boxSize:2500,dropletSizeX:1,dropletSizeYScale:10,distortionStrength:70,screenThinning:{intensity:.57,start:.46,range:1.17,fadePower:.17,affectedRatio:1,particleOffset:-.2},color:{r:.66,g:.68,b:.74,a:.7},direction:{x:-50,y:-35},shapeDirPower:2,shapeNormalPower:1},this._revealParams=new na(e.tp,["Precipitation","Rain"]),this._vignetteParams={strength:1,start:.7,range:1,fadePower:.4,color:{r:.27,g:.27,b:.27,a:1}},this.particlesCount=16e3}update(t){const i=t.context;if(!this.particlesVx){const t=la(this.particlesCount),n=new e.eC,r=new e.a_;let s=0;const o=e.el(1323123451230);for(let e=0;e<t.length;++e){const i=t[e],a=[2*o()-1,o(),o(),o()];n.emplaceBack(i[0],i[1],i[2],-1,-1,...a),n.emplaceBack(i[0],i[1],i[2],1,-1,...a),n.emplaceBack(i[0],i[1],i[2],1,1,...a),n.emplaceBack(i[0],i[1],i[2],-1,1,...a),r.emplaceBack(s+0,s+1,s+2),r.emplaceBack(s+0,s+2,s+3),s+=4}this.particlesVx=i.createVertexBuffer(n,ta.members),this.particlesIdx=i.createIndexBuffer(r)}}draw(t){if(!this._params.overrideStyleParameters&&!t.style.rain)return;const i=this._params.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},n=t.transform.zoom;if(i.revealStart>n)return;const r=ca(0,1,i.revealStart,i.revealStart+i.revealRange,n);if(!this.particlesVx||!this.particlesIdx)return;const s=structuredClone(this._params);let o=[-s.direction.x,s.direction.y,-100];e.au(o,o);const a=structuredClone(this._vignetteParams);a.strength*=r,s.overrideStyleParameters||(s.intensity=t.style.rain.state.density,s.timeFactor=t.style.rain.state.intensity,s.color=structuredClone(t.style.rain.state.color),o=structuredClone(t.style.rain.state.direction),s.screenThinning.intensity=t.style.rain.state.centerThinning,s.dropletSizeX=t.style.rain.state.dropletSize[0],s.dropletSizeYScale=t.style.rain.state.dropletSize[1]/t.style.rain.state.dropletSize[0],s.distortionStrength=100*t.style.rain.state.distortionStrength,a.strength=1,a.color=structuredClone(t.style.rain.state.vignetteColor));const l=this.updateOnRender(t,s.timeFactor),c=t.context,h=c.gl,d=t.transform;this.screenTexture&&this.screenTexture.size[0]===t.width&&this.screenTexture.size[1]===t.height||(this.screenTexture=new e.T(c,{width:t.width,height:t.height,data:null},h.RGBA8)),s.distortionStrength>0&&(c.activeTexture.set(h.TEXTURE0),this.screenTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,0,0,t.width,t.height));const u=t.getOrCreateProgram("rainParticle");t.uploadCommonUniforms(c,u),c.activeTexture.set(h.TEXTURE0),this.screenTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE);const f=[s.color.r,s.color.g,s.color.b,s.color.a],p=(i,n)=>{const r=aa(this._movement.getPosition(),i),a=s.dropletSizeX,c=s.dropletSizeX*s.dropletSizeYScale,p=t.width/2,m=t.height/2,g=ca(0,s.screenThinning.start,0,1,s.screenThinning.intensity),_=ca(.001,s.screenThinning.range,0,1,s.screenThinning.intensity),y=ca(0,s.screenThinning.particleOffset,0,1,s.screenThinning.intensity),v=(x={modelview:l.modelviewMatrix,projection:l.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:r,velocityConeAperture:s.velocityConeAperture,velocity:s.velocity,boxSize:i,rainDropletSize:[a,c],distortionStrength:s.distortionStrength,rainDirection:o,color:f,screenSize:[d.width,d.height],thinningCenterPos:[p,m],thinningShape:[g,_,Math.pow(10,s.screenThinning.fadePower)],thinningAffectedRatio:s.screenThinning.affectedRatio,thinningParticleOffset:y,shapeDirectionalPower:s.shapeDirPower,shapeNormalPower:s.shapeNormalPower,mode:n?0:1},{u_modelview:Float32Array.from(x.modelview),u_projection:Float32Array.from(x.projection),u_time:x.time,u_cam_pos:x.camPos,u_texScreen:0,u_velocityConeAperture:x.velocityConeAperture,u_velocity:x.velocity,u_boxSize:x.boxSize,u_rainDropletSize:x.rainDropletSize,u_distortionStrength:x.distortionStrength,u_rainDirection:x.rainDirection,u_color:x.color,u_screenSize:x.screenSize,u_thinningCenterPos:x.thinningCenterPos,u_thinningShape:x.thinningShape,u_thinningAffectedRatio:x.thinningAffectedRatio,u_thinningParticleOffset:x.thinningParticleOffset,u_shapeDirectionalPower:x.shapeDirectionalPower,u_shapeNormalPower:x.shapeNormalPower,u_mode:x.mode});var x;const b=Math.round(s.intensity*this.particlesCount),w=e.bd.simpleSegment(0,0,4*b,2*b);u.draw(t,h.TRIANGLES,Yi.disabled,Hi.disabled,Ni.alphaBlended,Wi.disabled,v,"rain_particles",this.particlesVx,this.particlesIdx,w)};s.distortionStrength>0&&p(s.boxSize,!0),p(s.boxSize,!1),this._vignette.draw(t,a)}}const ua=e.ec([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_snowParticleData",components:4},{type:"Float32",name:"a_snowParticleDataHorizontalOscillation",components:2}]);class fa extends ha{constructor(e){super(2.25),this._params={overrideStyleParameters:!1,intensity:.85,timeFactor:.75,velocityConeAperture:70,velocity:40,horizontalOscillationRadius:4,horizontalOscillationRate:1.5,boxSize:2e3,billboardSize:2,shapeFadeStart:.27,shapeFadePower:.21,screenThinning:{intensity:.4,start:.15,range:1.4,fadePower:.24,affectedRatio:1,particleOffset:-.2},color:{r:1,g:1,b:1,a:1},direction:{x:-50,y:-35}},this._revealParams=new na(e.tp,["Precipitation","Snow"]),this._vignetteParams={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3}update(t){const i=t.context;if(!this.particlesVx){const t=la(this.particlesCount),n=new e.eD,r=new e.a_;let s=0;const o=e.el(1323123451230);for(let e=0;e<t.length;++e){const i=t[e],a=o(),l=o(),c=o(),h=[e/t.length,a,l,c],d=[o(),o()];n.emplaceBack(i[0],i[1],i[2],-1,-1,...h,...d),n.emplaceBack(i[0],i[1],i[2],1,-1,...h,...d),n.emplaceBack(i[0],i[1],i[2],1,1,...h,...d),n.emplaceBack(i[0],i[1],i[2],-1,1,...h,...d),r.emplaceBack(s+0,s+1,s+2),r.emplaceBack(s+0,s+2,s+3),s+=4}this.particlesVx=i.createVertexBuffer(n,ua.members),this.particlesIdx=i.createIndexBuffer(r)}}draw(t){if(!this._params.overrideStyleParameters&&!t.style.snow)return;const i=structuredClone(this._params);let n=[-i.direction.x,i.direction.y,-100];e.au(n,n);const r=structuredClone(this._vignetteParams),s=i.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},o=t.transform.zoom;if(s.revealStart>o)return;const a=ca(0,1,s.revealStart,s.revealStart+s.revealRange,o);r.strength*=a,i.overrideStyleParameters||(i.intensity=t.style.snow.state.density,i.timeFactor=t.style.snow.state.intensity,i.color=structuredClone(t.style.snow.state.color),n=structuredClone(t.style.snow.state.direction),i.screenThinning.intensity=t.style.snow.state.centerThinning,i.billboardSize=2.79*t.style.snow.state.flakeSize,r.strength=1,r.color=structuredClone(t.style.snow.state.vignetteColor));const l=this.updateOnRender(t,i.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;const c=t.context,h=c.gl,d=t.transform,u=t.getOrCreateProgram("snowParticle");t.uploadCommonUniforms(c,u),((i,r,s)=>{const o=aa(this._movement.getPosition(),i),a=d.width/2,c=d.height/2,f=ca(0,s.screenThinning.start,0,1,s.screenThinning.intensity),p=ca(.001,s.screenThinning.range,0,1,s.screenThinning.intensity),m=ca(0,s.screenThinning.particleOffset,0,1,s.screenThinning.intensity),g=(_={modelview:l.modelviewMatrix,projection:l.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:o,velocityConeAperture:s.velocityConeAperture,velocity:s.velocity,horizontalOscillationRadius:s.horizontalOscillationRadius,horizontalOscillationRate:s.horizontalOscillationRate,boxSize:i,billboardSize:1*s.billboardSize,simpleShapeParameters:[s.shapeFadeStart,s.shapeFadePower],screenSize:[d.width,d.height],thinningCenterPos:[a,c],thinningShape:[f,p,Math.pow(10,s.screenThinning.fadePower)],thinningAffectedRatio:s.screenThinning.affectedRatio,thinningParticleOffset:m,color:[s.color.r,s.color.g,s.color.b,s.color.a],direction:n},{u_modelview:Float32Array.from(_.modelview),u_projection:Float32Array.from(_.projection),u_time:_.time,u_cam_pos:_.camPos,u_velocityConeAperture:_.velocityConeAperture,u_velocity:_.velocity,u_horizontalOscillationRadius:_.horizontalOscillationRadius,u_horizontalOscillationRate:_.horizontalOscillationRate,u_boxSize:_.boxSize,u_billboardSize:_.billboardSize,u_simpleShapeParameters:_.simpleShapeParameters,u_screenSize:_.screenSize,u_thinningCenterPos:_.thinningCenterPos,u_thinningShape:_.thinningShape,u_thinningAffectedRatio:_.thinningAffectedRatio,u_thinningParticleOffset:_.thinningParticleOffset,u_particleColor:_.color,u_direction:_.direction});var _;const y=Math.round(s.intensity*this.particlesCount),v=e.bd.simpleSegment(0,0,4*y,2*y);this.particlesVx&&this.particlesIdx&&u.draw(t,h.TRIANGLES,Yi.disabled,Hi.disabled,Ni.alphaBlended,Wi.disabled,g,"snow_particles",this.particlesVx,this.particlesIdx,v)})(i.boxSize,0,i),this._vignette.draw(t,r)}}const pa={symbol:function(t,i,n,r,s){if("translucent"!==t.renderPass)return;const o=Hi.disabled,a=t.colorModeForRenderPass(),l=n.layout.get("text-variable-anchor"),c=n.layout.get("text-size-scale-range"),h=e.ay(t.scaleFactor,c[0],c[1]);l&&function(t,i,n,r,s,o,a,l){const c=i.transform,h="map"===s,d="map"===o;for(const i of t){const t=r.getTile(i),s=t.getBucket(n);if(!s||!s.text||!s.text.segments.get().length)continue;const o=e.bH(s.textSizeData,c.zoom,l),u=Ht(i,s.getProjection(),c),f=c.calculatePixelsToTileUnitsMatrix(t),p=Xt(u,t.tileID.canonical,d,h,c,s.getProjection(),f),m=s.hasIconTextFit()&&s.hasIconData();o&&Xs(s,h,d,a,c,p,i,Math.pow(2,c.zoom-t.tileID.overscaledZ),o,m)}}(r,t,n,i,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),s,h);const d=0!==n.paint.get("icon-opacity").constantOr(1),u=0!==n.paint.get("text-opacity").constantOr(1);void 0!==n.layout.get("symbol-sort-key").constantOr(1)&&(d||u)?qs(t,i,n,r,o,a):(d&&qs(t,i,n,r,o,a,{onlyIcons:!0}),u&&qs(t,i,n,r,o,a,{onlyText:!0})),i.map.showCollisionBoxes&&(Ws(t,i,n,r,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Ws(t,i,n,r,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(t,i,n,r){if("translucent"!==t.renderPass)return;const s=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),a=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1),c=n.paint.get("circle-emissive-strength");if(0===s.constantOr(1)&&(0===o.constantOr(1)||0===a.constantOr(1)))return;const h=t.context,d=h.gl,u=t.transform,f=!(!t.terrain||!t.terrain.enabled),p=n.layout.get("circle-elevation-reference"),m=t.depthModeForSublayer(0,Yi.ReadOnly),g=new Yi(t.context.gl.LEQUAL,Yi.ReadOnly,t.depthRangeFor3D),_="none"===p||f?m:g,y=Hi.disabled,v=t.colorModeForDrapableLayerRenderPass(c),x="globe"===u.projection.name,b=[e.aD(u.center.lng),e.aH(u.center.lat)],w=[];for(let s=0;s<r.length;s++){const o=r[s],a=i.getTile(o),c=a.getBucket(n);if(!c||c.projection.name!==u.projection.name)continue;const h=c.programConfigurations.get(n.id),d=c.layoutVertexBuffer,f=c.globeExtVertexBuffer,p=c.indexBuffer,m=e.dW(n),g=[f],_=t.isTileAffectedByFog(o);x&&m.push("PROJECTION_GLOBE_VIEW"),m.push("DEPTH_D24"),t.terrain&&u.depthOcclusionForSymbolsAndCircles&&m.push("DEPTH_OCCLUSION"),c.hasElevation&&!t.terrain&&(m.push("ELEVATED_ROADS"),g.push(c.elevatedLayoutVertexBuffer));const y=t.getOrCreateProgram("circle",{config:h,defines:m,overrideFog:_}),v=u.projection.createInversionMatrix(u,o.canonical),S={programConfiguration:h,program:y,layoutVertexBuffer:d,dynamicBuffers:g,indexBuffer:p,uniformValues:e.dX(t,o,a,v,b,n),tile:a};if(l){const t=c.segments.get();for(const i of t)w.push({segments:new e.bd([i]),sortKey:i.sortKey,state:S})}else w.push({segments:c.segments,sortKey:0,state:S})}l&&w.sort((e,t)=>e.sortKey-t.sortKey);const S={useDepthForOcclusion:u.depthOcclusionForSymbolsAndCircles};for(const e of w){const{programConfiguration:i,program:r,layoutVertexBuffer:s,dynamicBuffers:o,indexBuffer:a,uniformValues:l,tile:c}=e.state,f=e.segments;t.terrain&&t.terrain.setupElevationDraw(c,r,S),t.uploadCommonUniforms(h,r,c.tileID.toUnwrapped()),r.draw(t,d.TRIANGLES,_,y,v,Wi.disabled,l,n.id,s,a,f,n.paint,u.zoom,i,o)}},heatmap:function(t,i,n,r){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const s=t.context,o=s.gl,a=Hi.disabled,l=new Ni([o.ONE,o.ONE,o.ONE,o.ONE],e.am.transparent,[!0,!0,!0,!0]);!function(e,t,i,n){const r=e.gl,s=t.width*n,o=t.height*n;e.activeTexture.set(r.TEXTURE1),e.viewport.set([0,0,s,o]);let a=i.heatmapFbo;if(!a||a&&(a.width!==s||a.height!==o)){a&&a.destroy();const t=r.createTexture();r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),a=i.heatmapFbo=e.createFramebuffer(s,o,!0,null),function(e,t,i,n,r,s){const o=e.gl;o.texImage2D(o.TEXTURE_2D,0,e.extRenderToTextureHalfFloat?o.RGBA16F:o.RGBA,r,s,0,o.RGBA,e.extRenderToTextureHalfFloat?o.HALF_FLOAT:o.UNSIGNED_BYTE,null),n.colorAttachment.set(i)}(e,0,t,a,s,o)}else r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)}(s,t,n,"globe"===t.transform.projection.name?.5:.25),s.clear({color:e.am.transparent});const c=t.transform,h="globe"===c.projection.name,d=h?["PROJECTION_GLOBE_VIEW"]:[],u=h?Wi.frontCCW:Wi.disabled,f=[e.aD(c.center.lng),e.aH(c.center.lat)];for(let e=0;e<r.length;e++){const p=r[e];if(i.hasRenderableParent(p))continue;const m=i.getTile(p),g=m.getBucket(n);if(!g||g.projection.name!==c.projection.name)continue;const _=t.isTileAffectedByFog(p),y=g.programConfigurations.get(n.id),v=t.getOrCreateProgram("heatmap",{config:y,defines:d,overrideFog:_}),{zoom:x}=t.transform;t.terrain&&t.terrain.setupElevationDraw(m,v),t.uploadCommonUniforms(s,v,p.toUnwrapped());const b=c.projection.createInversionMatrix(c,p.canonical);v.draw(t,o.TRIANGLES,Yi.disabled,a,l,u,bs(t,p,m,b,f,x,n.paint.get("heatmap-intensity")),n.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,n.paint,t.transform.zoom,y,h?[g.globeExtVertexBuffer]:null)}s.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,i){const n=t.context,r=n.gl,s=i.heatmapFbo;if(!s)return;n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,s.colorAttachment.get()),n.activeTexture.set(r.TEXTURE1);let o=i.colorRampTexture;o||(o=i.colorRampTexture=new e.T(n,i.colorRamp,r.RGBA8)),o.bind(r.LINEAR,r.CLAMP_TO_EDGE),t.getOrCreateProgram("heatmapTexture").draw(t,r.TRIANGLES,Yi.disabled,Hi.disabled,t.colorModeForRenderPass(),Wi.disabled,((e,t)=>({u_image:0,u_color_ramp:1,u_opacity:t.paint.get("heatmap-opacity")}))(0,i),i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom)}(t,n))},line:function(t,i,n,r){if("translucent"!==t.renderPass)return;const s=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0===s.constantOr(1)||0===o.constantOr(1))return;const a=n.paint.get("line-emissive-strength"),l=n.paint.get("line-occlusion-opacity"),c=n.layout.get("line-elevation-reference"),h="meters"===n.layout.get("line-width-unit"),d="sea"===c,u=!(!t.terrain||!t.terrain.enabled),f=t.context,p=f.gl;if(n.hasElevatedBuckets&&"globe"===t.transform.projection.name)return;const m=n.layout.get("line-cross-slope"),g=void 0!==m,_=m<1,y=t.colorModeForDrapableLayerRenderPass(a),v=t.terrain&&t.terrain.renderingToTexture,x=v?1:e.q.devicePixelRatio,b=n.paint.get("line-dasharray"),w=b.constantOr(1),S=n.layout.get("line-cap"),T=b.constantOr(null),k=S.constantOr(null),M=n.paint.get("line-pattern"),A=M.constantOr(1),C=n.paint.get("line-pattern-cross-fade"),D=M.constantOr(null),L=n.paint.get("line-opacity").constantOr(1);let E=!A&&1!==L||t.depthOcclusion&&l>0&&l<1;const I=n.paint.get("line-gradient"),P=A?"linePattern":"line",R=e.dY(n);let O;if(v&&t.terrain&&t.terrain.clipOrMaskOverlapStencilType()&&(E=!1),0!==l&&t.depthOcclusion){const t=n.paint._values["line-opacity"];t&&t.value&&"constant"===t.value.kind?O=t.value:e.w(`Occlusion opacity for layer ${n.id} is supported only when line-opacity isn't data-driven.`)}"constant"!==o.value.kind&&!1===o.value.isLineProgressConstant&&R.push("VARIABLE_LINE_WIDTH");const z=(r,s,o,a,c,u)=>{for(const m of r){const r=i.getTile(m);if(A&&!r.patternsLoaded())continue;const g=r.getBucket(n);if(!g)continue;if("none"!==g.elevationType&&!c||"none"===g.elevationType&&c)continue;t.prepareDrawTile();const _=[...s],b=t.shadowRenderer,S="road"===g.elevationType&&!!b&&b.enabled;let M=[0,0,0];if(S){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(M=pn(t.style,e,i)),_.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET")}const R=g.programConfigurations.get(n.id);let z=!1;if(D&&r.imageAtlas){const t=e.dZ.from(D),i=t.getPrimary().scaleSelf(x).toString(),n=r.imageAtlas.patternPositions.get(i),s=t.getSecondary(),o=s?r.imageAtlas.patternPositions.get(s.scaleSelf(x).toString()):null;z=!!n&&!!o,n&&R.setConstantPatternPositions(n,o)}C>0&&(z||R.getPatternTransitionVertexBuffer("line-pattern"))&&_.push("LINE_PATTERN_TRANSITION");const F=t.isTileAffectedByFog(m),N=t.getOrCreateProgram(P,{config:R,defines:_,overrideFog:F});if(!A&&T&&k&&r.lineAtlas){const e=r.lineAtlas.getDash(T,k);e&&R.setConstantPatternPositions(e)}S&&b.setupShadows(r.tileID.toUnwrapped(),N,"vector-tile");let[Y,B]=n.paint.get("line-trim-offset");if("round"===k||"square"===k){const e=1;Y!==B&&(0===Y&&(Y-=e),1===B&&(B+=e))}const H=v?m.projMatrix:null,j=h?1/g.tileToMeter/e.aw(r,1,t.transform.zoom):1,V=h?1/g.tileToMeter/e.aw(r,1,Math.floor(t.transform.zoom)):1,W=A?e.d_(t,r,n,H,x,j,V,[Y,B],M,C):e.d$(t,r,n,H,g.lineClipsArray.length,x,j,V,[Y,B],M);if(I){const r=g.gradients[n.id];let s=r.texture;if(n.gradientVersion!==r.version){let o=256;if(n.stepInterpolant){const n=i.getSource().maxzoom,r=m.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-m.canonical.z):1;o=e.ay(e.e0(g.maxLineLength/e.aj*1024*r),256,f.maxTextureSize)}r.gradient=e.e1({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:o,image:r.gradient||void 0,clips:g.lineClipsArray}),r.texture?r.texture.update(r.gradient):r.texture=new e.T(f,r.gradient,p.RGBA8),r.version=n.gradientVersion,s=r.texture}f.activeTexture.set(p.TEXTURE1),s.bind(n.stepInterpolant?p.NEAREST:p.LINEAR,p.CLAMP_TO_EDGE)}w&&(f.activeTexture.set(p.TEXTURE0),r.lineAtlasTexture&&r.lineAtlasTexture.bind(p.LINEAR,p.REPEAT),R.updatePaintBuffers()),A&&(f.activeTexture.set(p.TEXTURE0),r.imageAtlasTexture&&r.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),R.updatePaintBuffers()),c&&!d&&t.terrain.setupElevationDraw(r,N),t.uploadCommonUniforms(f,N,m.toUnwrapped());const U=e=>{null!=O&&(O.value=L*l),N.draw(t,p.TRIANGLES,o,e,y,Wi.disabled,W,n.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,n.paint,t.transform.zoom,R,[g.layoutVertexBuffer2,g.patternVertexBuffer,g.zOffsetVertexBuffer]),null!=O&&(O.value=L)};if(E&&!c){const e=t.stencilModeForClipping(m).ref;0===e&&v&&f.clear({stencil:0});const i={func:p.EQUAL,mask:255};W.u_alpha_discard_threshold=.8,U(new Hi(i,e,255,p.KEEP,p.KEEP,p.INVERT)),W.u_alpha_discard_threshold=0,U(new Hi(i,e,255,p.KEEP,p.KEEP,p.KEEP))}else W.u_alpha_discard_threshold=E&&c&&u?.8:0,U(c?a:t.stencilModeForClipping(m))}};let F=t.depthModeForSublayer(0,Yi.ReadOnly);const N=new Yi(t.depthOcclusion?p.GREATER:p.LEQUAL,Yi.ReadOnly,t.depthRangeFor3D);if(n.hasNonElevatedBuckets){const i=!v&&t.terrain;0!==l&&i?e.w(`Occlusion opacity for layer ${n.id} is supported on terrain only if the layer has line-z-offset enabled.`):i?e.w(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${n.id}.`):z(r,R,F,Hi.disabled,!1,!0)}if(n.hasElevatedBuckets){"hd-road-markup"===c?u||(F=N,R.push("ELEVATED_ROADS")):(R.push("ELEVATED"),F=N,g&&R.push(_?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),d&&R.push("ELEVATION_REFERENCE_SEA"));const e=E?t.stencilModeFor3D():Hi.disabled;t.forceTerrainMode=!0,z(r,R,F,e,!0,!0),E&&z(r,R,F,e,!0,!1),t.forceTerrainMode=!1}E&&(t.resetStencilClippingMasks(),v&&f.clear({stencil:0})),0===l||t.depthOcclusion||v||t.layersWithOcclusionOpacity.push(t.currentLayer)},fill:function(t,i,n,r){const s=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0===o.constantOr(1))return;const a=n.paint.get("fill-emissive-strength"),l=t.colorModeForDrapableLayerRenderPass(a),c=n.paint.get("fill-pattern"),h=t.opaquePassEnabledForLayer()&&!c.constantOr(1)&&1===s.constantOr(e.am.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";let d="none";"none"!==n.layout.get("fill-elevation-reference")?d="road":0!==n.paint.get("fill-z-offset").constantOr(1)&&(d="offset");const u=!(!t.terrain||!t.terrain.enabled),f={painter:t,sourceCache:i,layer:n,coords:r,colorMode:l,elevationType:d,terrainEnabled:u,pass:h};if("shadow"!==t.renderPass)if("offset"!==d){if(Qs(f,!1),"road"===d){const e=!u&&"translucent"===t.renderPass;e&&Ks(t,i,n,r,"geometry"),Qs(f,!0,Hi.disabled),e&&function(e){const{painter:t,sourceCache:i,layer:n,coords:r,colorMode:s}=e,o=t.context.gl,a=e.painter.shadowRenderer,l=!!a&&a.enabled,c=new Yi(t.context.gl.LEQUAL,Yi.ReadOnly,t.depthRangeFor3D);let h=[0,0,0];if(l){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(h=pn(t.style,e,i))}const d=e=>{for(const d of r){const r=i.getTile(d),u=r.getBucket(n);if(!u)continue;const f=u.elevatedStructures;if(!f)continue;let p,m;if(e?(p=f.renderableBridgeSegments,m=f.bridgeProgramConfigurations.get(n.id)):(p=f.renderableTunnelSegments,m=f.tunnelProgramConfigurations.get(n.id)),!p||0===p.segments[0].primitiveLength)continue;m.updatePaintBuffers(),t.prepareDrawTile();const g=t.isTileAffectedByFog(d),_=[];l&&_.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET");const y=t.getOrCreateProgram("elevatedStructures",{config:m,overrideFog:g,defines:_}),v=t.translatePosMatrix(d.projMatrix,r,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));l&&a.setupShadows(r.tileID.toUnwrapped(),y,"vector-tile");const x=fs(v,h);t.uploadCommonUniforms(t.context,y,d.toUnwrapped()),y.draw(t,o.TRIANGLES,c,Hi.disabled,s,Wi.backCCW,x,n.id,f.vertexBuffer,f.indexBuffer,p,n.paint,t.transform.zoom,m,[f.vertexBufferNormal])}};d(!0),d(!1)}(f)}}else Qs(f,!1,t.stencilModeFor3D());else t.shadowRenderer&&"road"===d&&!u&&function(e){const{painter:t,sourceCache:i,layer:n,coords:r}=e,s=t.context.gl,o=e.painter.shadowRenderer;for(const e of r){const r=i.getTile(e),a=r.getBucket(n);if(!a)continue;const l=a.elevatedStructures;if(!l)continue;if(!l.shadowCasterSegments||0===l.shadowCasterSegments.segments[0].primitiveLength)continue;t.prepareDrawTile();const c=a.bufferData.programConfigurations.get(n.id),h=t.isTileAffectedByFog(e),d=t.getOrCreateProgram("elevatedStructuresDepth",{config:c,overrideFog:h}),u=o.calculateShadowPassMatrixFromTile(r.tileID.toUnwrapped());t.uploadCommonUniforms(t.context,d,e.toUnwrapped());const f={u_matrix:u,u_depth_bias:0};d.draw(t,s.TRIANGLES,o.getShadowPassDepthMode(),Hi.disabled,o.getShadowPassColorMode(),Wi.disabled,f,n.id,l.vertexBuffer,l.indexBuffer,l.shadowCasterSegments,n.paint,t.transform.zoom,c)}}(f)},"fill-extrusion":function(t,i,n,r){const s=n.paint.get("fill-extrusion-opacity"),o=t.context,a=o.gl,l=t.terrain,c=l&&l.renderingToTexture;if(0===s)return;const h=t.conflationActive&&t.style.isLayerClipped(n,i.getSource()),d=t.style.order.indexOf(n.fqid);if(h&&function(e,t,i,n,r){for(const s of n){const n=t.getTile(s).getBucket(i);n&&(n.updateReplacement(s,e.replacementSource,r),n.uploadCentroid(e.context))}}(t,i,n,r,d),l||h)for(const e of r){const r=i.getTile(e).getBucket(n);r&&no(t.context,i,e,r,n,l,h)}if("shadow"===t.renderPass&&t.shadowRenderer){const o=t.shadowRenderer;if(l&&s<.65&&n._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof e.ab)return;const a=o.getShadowPassDepthMode(),c=o.getShadowPassColorMode();eo(t,i,n,r,a,Hi.disabled,c,h)}else if("translucent"===t.renderPass){const d=!n.paint.get("fill-extrusion-pattern").constantOr(1),u=n.paint.get("fill-extrusion-color").constantOr(e.am.white);if(!c&&0!==u.a){const e=new Yi(t.context.gl.LEQUAL,Yi.ReadWrite,t.depthRangeFor3D);1===s&&d?eo(t,i,n,r,e,Hi.disabled,Ni.unblended,h):(eo(t,i,n,r,e,Hi.disabled,Ni.disabled,h),eo(t,i,n,r,e,t.stencilModeFor3D(),t.colorModeForRenderPass(),h),t.resetStencilClippingMasks())}if(t.style.enable3dLights()&&d&&(!l&&"globe"!==t.transform.projection.name||c)){const s=n.paint.get("fill-extrusion-opacity"),d=n.paint.get("fill-extrusion-ambient-occlusion-intensity"),u=n.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),f=n.paint.get("fill-extrusion-flood-light-intensity"),p="none"===n.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),m=n.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(p?null:n.lut).toArray01().slice(0,3),g=d>0&&u>0,_=f>0,y=(e,t,i)=>(1-i)*e+i*t,v=new to;v.translate=n.paint.get("fill-extrusion-translate"),v.translateAnchor=n.paint.get("fill-extrusion-translate-anchor"),v.edgeRadius=n.layout.get("fill-extrusion-edge-radius"),v.cutoffFadeRange=n.paint.get("fill-extrusion-cutoff-fade-range");const x=o=>{const l=t.depthModeForSublayer(1,Yi.ReadOnly,a.LEQUAL,!0),c=n.paint.get(o?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),p=y(.1,3,c),g=t._showOverdrawInspector;if(!g){const c=new Hi({func:a.ALWAYS,mask:255},255,255,a.KEEP,a.KEEP,a.REPLACE),g=new Ni([a.ONE,a.ONE,a.ONE,a.ONE],e.am.transparent,[!1,!1,!1,!0],a.MIN);io(v,t,i,n,r,l,c,g,Wi.disabled,o,"sdf",s,d,u,f,m,p,h,!1)}{const c=g?Hi.disabled:new Hi({func:a.EQUAL,mask:255},255,255,a.KEEP,a.DECR,a.DECR),_=g?t.colorModeForRenderPass():new Ni([a.ONE_MINUS_DST_ALPHA,a.DST_ALPHA,a.ONE,a.ONE],e.am.transparent,[!0,!0,!0,!0]);io(v,t,i,n,r,l,c,_,Wi.disabled,o,"color",s,d,u,f,m,p,h,!1)}};if(c){const c=(o,l,c)=>{const p=t.depthModeForSublayer(1,Yi.ReadOnly,a.LEQUAL,!1),g=n.paint.get(o?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),_=y(.1,3,g);{const c=new Ni([a.ONE,a.ONE,a.ONE,a.ONE],e.am.transparent,[!1,!1,!1,!0]);io(v,t,i,n,r,p,Hi.disabled,c,Wi.disabled,o,"clear",s,d,u,f,m,_,h,l)}{const c=new Hi({func:a.ALWAYS,mask:255},255,255,a.KEEP,a.KEEP,a.REPLACE),g=new Ni([a.ONE,a.ONE,a.ONE,a.ONE],e.am.transparent,[!1,!1,!1,!0],a.MIN);io(v,t,i,n,r,p,c,g,Wi.disabled,o,"sdf",s,d,u,f,m,_,h,l)}{const c=o?a.ZERO:a.ONE_MINUS_DST_ALPHA,g=new Hi({func:a.EQUAL,mask:255},255,255,a.KEEP,a.DECR,a.DECR),y=new Ni([c,a.DST_ALPHA,a.ONE_MINUS_DST_ALPHA,a.ZERO],e.am.transparent,[!0,!0,!0,!0]);io(v,t,i,n,r,p,g,y,Wi.disabled,o,"color",s,d,u,f,m,_,h,l)}{const g=new Ni([a.ONE,a.ONE,a.ONE,o?a.ZERO:a.ONE],e.am.transparent,[!1,!1,!1,!0],o?a.FUNC_ADD:a.MAX);io(v,t,i,n,r,p,Hi.disabled,g,Wi.disabled,o,"clear",s,d,u,f,m,_,h,l,c)}};if(g||_){let i;if(t.prepareDrawTile(),l){const t=l.drapeBufferSize[0],n=l.drapeBufferSize[1];i=l.framebufferCopyTexture,i&&(!i||i.size[0]===t&&i.size[1]===n)||(i&&i.destroy(),i=l.framebufferCopyTexture=new e.T(o,new e.r({width:t,height:n}),a.RGBA8)),i.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.copyTexSubImage2D(a.TEXTURE_2D,0,0,0,0,0,t,n)}g&&c(!0,!1,i),_&&c(!1,!0,i)}}else g&&x(!0),_&&x(!1),(g||_)&&t.resetStencilClippingMasks()}}},building:function(t,i,n,r){t.currentLayer<t.firstLightBeamLayer&&(t.firstLightBeamLayer=t.currentLayer);const s=n.paint.get("building-ambient-occlusion-ground-intensity"),o=n.paint.get("building-ambient-occlusion-ground-radius"),a=n.paint.get("building-ambient-occlusion-ground-attenuation");let l=s>0&&o>0,c=!0;const h=n.paint.get("building-vertical-scale");h<1&&(c=!1);const d=t.conflationActive&&t.style.isLayerClipped(n,i.getSource()),u=t.style.order.indexOf(n.fqid);if(function(e,t,i,n,r,s){for(const o of s){const s=t.getTile(o).getBucket(i);s&&(r&&s.updateReplacement(o,e.replacementSource,n),s.uploadUpdatedIndexBuffer(e.context))}}(t,i,n,u,d,r),function(e,t,i,n){for(const r of n){const n=t.getTile(r).getBucket(i);n&&n.needsEvaluation(e,i)&&(n.evaluate(i),n.uploadUpdatedColorBuffer(e.context))}}(t,i,n,r),n.resetLayerRenderingStats(t),t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!0),"shadow"===t.renderPass&&t.shadowRenderer){const e=t.shadowRenderer,s=[],o=e.getShadowPassDepthMode();lo({painter:t,source:i,layer:n,coords:r,defines:s,blendMode:e.getShadowPassColorMode(),depthMode:o,verticalScale:h})}else if("translucent"===t.renderPass){l&&function(t,i,n,r,s,o,a,l,c,h,d,u){const f=t.context.gl,p=t.depthModeForSublayer(1,Yi.ReadOnly,f.LEQUAL,!0),m=.1*(1-(g=d))+3*g;var g;const _=t._showOverdrawInspector,y=u,v=new to;_||io(v,t,i,n,r,p,new Hi({func:f.ALWAYS,mask:255},255,255,f.KEEP,f.KEEP,f.REPLACE),new Ni([f.ONE,f.ONE,f.ONE,f.ONE],e.am.transparent,[!1,!1,!1,!0],f.MIN),Wi.disabled,s,"sdf",1,a,l,0,h,m,y,!1);{const o=_?Hi.disabled:new Hi({func:f.EQUAL,mask:255},255,255,f.KEEP,f.DECR,f.DECR),c=_?t.colorModeForRenderPass():new Ni([f.ONE_MINUS_DST_ALPHA,f.DST_ALPHA,f.ONE,f.ONE],e.am.transparent,[!0,!0,!0,!0]);io(v,t,i,n,r,p,o,c,Wi.disabled,s,"color",1,a,l,0,h,m,y,!1)}}(t,i,n,r,!0,0,s,o,0,[0,0,0],a,d);let u=["HAS_ATTRIBUTE_a_part_color_emissive","LIGHTING_3D_MODE"];c&&(u=u.concat("RENDER_SHADOWS","DEPTH_TEXTURE")),t.shadowRenderer.useNormalOffset&&(u=u.concat("NORMAL_OFFSET"));const f=new Yi(t.context.gl.LEQUAL,Yi.ReadWrite,t.depthRangeFor3D),p=t.colorModeForRenderPass();lo({painter:t,source:i,layer:n,coords:r,defines:u,blendMode:p,depthMode:f,verticalScale:h})}else if("light-beam"===t.renderPass){const e=["HAS_ATTRIBUTE_a_part_color_emissive","HAS_ATTRIBUTE_a_bloom_attenuation"],s=new Yi(t.context.gl.LEQUAL,Yi.ReadOnly,t.depthRangeFor3D);lo({painter:t,source:i,layer:n,coords:r,defines:e,blendMode:Ni.alphaBlended,depthMode:s,verticalScale:h})}t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!1),t.resetStencilClippingMasks()},hillshade:function(e,t,i,n){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;if(e.style.disableElevatedTerrain)return;const r=e.context,s=e.terrain&&e.terrain.renderingToTexture,[o,a]="translucent"!==e.renderPass||s?[{},n]:e.stencilConfigForOverlap(n);for(const n of a){const r=t.getTile(n);if(r.needsHillshadePrepare&&"offscreen"===e.renderPass)ir(e,r,i);else if("translucent"===e.renderPass){const t=e.depthModeForSublayer(0,Yi.ReadOnly),a=i.paint.get("hillshade-emissive-strength"),l=e.colorModeForDrapableLayerRenderPass(a),c=s&&e.terrain?e.terrain.stencilModeForRTTOverlap(n):o[n.overscaledZ];er(e,n,r,i,t,c,l)}}r.viewport.set([0,0,e.width,e.height]),e.resetStencilClippingMasks()},raster:function(t,i,n,r,s,o){if("translucent"!==t.renderPass)return;if(0===n.paint.get("raster-opacity"))return;const a="globe"===t.transform.projection.name,l=0!==n.paint.get("raster-elevation"),c=l&&a;if(t.renderElevatedRasterBackface&&!c)return;const h=t.context,d=h.gl,u=i.getSource(),f=function(t,i,n,r){const s=i.paint.get("raster-color"),o="raster-array"===t.type,a=[],l=i.paint.get("raster-resampling"),c=i.paint.get("raster-color-mix");let h=i.paint.get("raster-color-range");const d=[c[0],c[1],c[2],0],u=c[3];let f="nearest"===l?r.NEAREST:r.LINEAR;if(o&&(a.push("RASTER_ARRAY"),s||a.push("RASTER_COLOR"),"linear"===l&&a.push("RASTER_ARRAY_LINEAR"),f=r.NEAREST,!h&&t.rasterLayers)){const e=t.rasterLayers.find(({id:e})=>e===i.sourceLayer);e&&e.fields&&e.fields.range&&(h=e.fields.range)}if(h=h||[0,1],s){a.push("RASTER_COLOR"),n.activeTexture.set(r.TEXTURE2),i.updateColorRamp(h);let t=i.colorRampTexture;t||(t=i.colorRampTexture=new e.T(n,i.colorRamp,r.RGBA8)),t.bind(r.LINEAR,r.CLAMP_TO_EDGE)}return{mix:d,range:h,offset:u,defines:a,resampling:f}}(u,n,h,d);if(u instanceof e.aP&&!r.length&&!a)return;const p=n.paint.get("raster-emissive-strength"),m=t.colorModeForDrapableLayerRenderPass(p),g=t.terrain&&t.terrain.renderingToTexture,_=!t.options.moving,y="nearest"===n.paint.get("raster-resampling")?d.NEAREST:d.LINEAR;if(u instanceof e.aP&&!r.length&&(u.onNorthPole||u.onSouthPole)){const e=l?t.stencilModeFor3D():Hi.disabled;return void ho(!!u.onNorthPole,null,t,i,n,p,f,Wi.disabled,e)}if(!r.length)return;const[v,x]=u instanceof e.aP||g?[{},r]:t.stencilConfigForOverlap(r),b=x[x.length-1].overscaledZ;c&&f.defines.push("PROJECTION_GLOBE_VIEW"),l&&f.defines.push("RENDER_CUTOFF");const w=(r,s,x)=>{for(const w of r){const r=w.toUnwrapped(),S=i.getTile(w);if(g&&(!S||!S.hasData()))continue;h.activeTexture.set(d.TEXTURE0);const T=fo(S,u,n,f);if(!T||!T.texture)continue;const{texture:k,mix:M,offset:A,tileSize:C,buffer:D}=T;let L,E;g?(L=Yi.disabled,E=w.projMatrix):l?(L=new Yi(d.LEQUAL,Yi.ReadWrite,t.depthRangeFor3D),E=a?Float32Array.from(t.transform.expandedFarZProjMatrix):t.transform.calculateProjMatrix(r,_)):(L=t.depthModeForSublayer(w.overscaledZ-b,1===n.paint.get("raster-opacity")?Yi.ReadWrite:Yi.ReadOnly,d.LESS),E=t.transform.calculateProjMatrix(r,_));const I=t.terrain&&g?t.terrain.stencilModeForRTTOverlap(w):v[w.overscaledZ],P=o?0:n.paint.get("raster-fade-duration");S.registerFadeDuration(P);const R=i.findLoadedParent(w,0),O=Xr(S,R,i,t.transform,P);let z,F;t.terrain&&t.terrain.prepareDrawTile(),h.activeTexture.set(d.TEXTURE0),k.bind(y,d.CLAMP_TO_EDGE),h.activeTexture.set(d.TEXTURE1),R?(R.texture&&R.texture.bind(y,d.CLAMP_TO_EDGE),z=Math.pow(2,R.tileID.overscaledZ-S.tileID.overscaledZ),F=[S.tileID.canonical.x*z%1,S.tileID.canonical.y*z%1]):k.bind(y,d.CLAMP_TO_EDGE),"useMipmap"in k&&h.extTextureFilterAnisotropic&&t.transform.pitch>20&&d.texParameterf(d.TEXTURE_2D,h.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,h.extTextureFilterAnisotropicMax);const N=t.transform;let Y;const B=l?uo(N):[0,0,0,0];let H,j,V,W,U,$=0;if(c&&u instanceof e.aP&&u.coordinates.length>3)H=Float32Array.from(e.bh(e.dD(new e.cA(0,0,0)))),j=Float32Array.from(N.globeMatrix),V=Float32Array.from(e.dz(N)),W=[e.aD(N.center.lng),e.aH(N.center.lat)],Y=u.elevatedGlobePerspectiveTransform,U=u.elevatedGlobeGridMatrix||new Float32Array(9);else if(c){const t=e.dA(w.canonical);$=e.dB(t.getCenter().lat),H=Float32Array.from(e.bh(e.dD(w.canonical))),j=Float32Array.from(N.globeMatrix),V=Float32Array.from(e.dz(N)),W=[e.aD(N.center.lng),e.aH(N.center.lat)],Y=[0,0],U=Float32Array.from(e.dC(w.canonical,t,$,N.worldSize/N._pixelsPerMercatorPixel))}else Y=u instanceof e.aP?u.perspectiveTransform:[0,0],H=new Float32Array(16),j=new Float32Array(9),V=new Float32Array(16),W=[0,0],U=new Float32Array(9);const G=Ts(E,H,j,V,U,F||[0,0],e.ah(t.transform.zoom),W,B,z||1,O,n,Y,l?n.paint.get("raster-elevation"):0,2,M,A,f.range,C,D,p),X=t.isTileAffectedByFog(w),q=t.getOrCreateProgram("raster",{defines:f.defines,overrideFog:X});if(t.uploadCommonUniforms(h,q,r),u instanceof e.aP){const i=u.elevatedGlobeVertexBuffer,r=u.elevatedGlobeIndexBuffer;if(g||!a)u.boundsBuffer&&u.boundsSegments&&q.draw(t,d.TRIANGLES,L,Hi.disabled,m,Wi.disabled,G,n.id,u.boundsBuffer,t.quadTriangleIndexBuffer,u.boundsSegments);else if(i&&r){const o=N.zoom<=e.cX?u.elevatedGlobeSegments:u.getSegmentsForLongitude(N.center.lng);o&&q.draw(t,d.TRIANGLES,L,Hi.disabled,m,s,G,n.id,i,r,o)}}else if(c){L=new Yi(d.LEQUAL,Yi.ReadOnly,t.depthRangeFor3D);const e=t.globeSharedBuffers;if(e){const[i,r,o]=e.getGridBuffers($,!1);q.draw(t,d.TRIANGLES,L,x||I,t.colorModeForRenderPass(),s,G,n.id,i,r,o)}}else{const{tileBoundsBuffer:e,tileBoundsIndexBuffer:i,tileBoundsSegments:r}=t.getTileBoundsBuffers(S);q.draw(t,d.TRIANGLES,L,I,m,Wi.disabled,G,n.id,e,i,r)}}if(!(u instanceof e.aP)&&c)for(const e of r){const r=e.canonical.y===(1<<e.canonical.z)-1;0===e.canonical.y&&ho(!0,e,t,i,n,p,f,s,x||Hi.disabled),r&&ho(!1,e,t,i,n,p,f,s===Wi.frontCW?Wi.backCW:Wi.frontCW,x||Hi.disabled)}};c?w(x,t.renderElevatedRasterBackface?Wi.backCW:Wi.frontCW,t.stencilModeFor3D()):w(x,Wi.disabled,void 0),t.resetStencilClippingMasks()},"raster-particle":function(t,i,n,r,s,o){"offscreen"===t.renderPass&&function(t,i,n,r){if(!r.length)return;const s=t.context,o=s.gl,a=i.getSource();if(!(a instanceof it))return;const l=Math.ceil(Math.sqrt(n.paint.get("raster-particle-count")));let c=n.particlePositionRGBAImage;if(!c||c.width!==l){const t=function(e){const t=e*e,i=new Uint8Array(4*t),n=function(e){return e|=0,e=Math.imul(2747636419^e,2654435769),e=Math.imul(e^e>>>16,2654435769),((e=Math.imul(e^e>>>16,2654435769))>>>0)/4294967296},r=1/1.1;for(let e=0;e<t;e++){const t=r*(n(2*e+0)+Ms),s=r*(n(2*e+1)+Ms),o=255*t%1,a=255*s%1,l=o,c=s-a/255,h=a;i[4*e+0]=255*(t-o/255),i[4*e+1]=255*l,i[4*e+2]=255*c,i[4*e+3]=255*h}return i}(l);c=n.particlePositionRGBAImage=new e.r({width:l,height:l},t)}let h=n.particleFramebuffer;h?h.width!==l&&(h.destroy(),h=n.particleFramebuffer=s.createFramebuffer(l,l,!0,null)):h=n.particleFramebuffer=s.createFramebuffer(l,l,!0,null);const d=[];for(const e of r){const t=i.getTile(e);if(!(t instanceof bt))continue;const r=go(t,a,n);if(!r)continue;const o=[t.tileSize,t.tileSize];let h=n.tileFramebuffer;h||(h=n.tileFramebuffer=s.createFramebuffer(o[0],o[1],!0,null));let u=t.rasterParticleState;u||(u=t.rasterParticleState=new mo(s,e,o,c));const f=u.update(n.lastInvalidatedAt);u.particleTextureDimension!==l&&u.updateParticleTexture(e,c);const p=u.targetColorTexture;u.targetColorTexture=u.backgroundColorTexture,u.backgroundColorTexture=p;const m=u.particleTexture0;u.particleTexture0=u.particleTexture1,u.particleTexture1=m,d.push([e,r,u,f])}if(0===d.length)return;const u=e.q.now(),f=n.previousDrawTimestamp?.001*(u-n.previousDrawTimestamp):.0167;if(n.previousDrawTimestamp=u,n.hasColorMap()){s.activeTexture.set(o.TEXTURE0+2);let t=n.colorRampTexture;t||(t=n.colorRampTexture=new e.T(s,n.colorRamp,o.RGBA8)),t.bind(o.LINEAR,o.CLAMP_TO_EDGE)}s.bindFramebuffer.set(n.tileFramebuffer.framebuffer),function(t,i,n){const r=t.context,s=r.gl,o=i.tileFramebuffer;r.activeTexture.set(s.TEXTURE0);const a={u_texture:0,u_opacity:1.05*(c=i.paint.get("raster-particle-fade-opacity-factor"))/(c+.05)},l=t.getOrCreateProgram("rasterParticleTexture",{defines:[],overrideFog:!1});var c;for(const c of n){const[,,n,h]=c;o.colorAttachment.set(n.targetColorTexture.texture),r.viewport.set([0,0,o.width,o.height]),r.clear({color:e.am.transparent}),h&&(n.backgroundColorTexture.bind(s.NEAREST,s.CLAMP_TO_EDGE),l.draw(t,s.TRIANGLES,Yi.disabled,Hi.disabled,Ni.alphaBlended,Wi.disabled,a,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments))}}(t,n,d),function(t,i,n,r){const s=t.context,o=s.gl,a=n.tileFramebuffer,l="globe"===t.transform.projection.name,c=n.paint.get("raster-particle-max-speed");for(const h of r){const[r,d,u]=h;s.activeTexture.set(o.TEXTURE0+0),d.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),a.colorAttachment.set(u.targetColorTexture.texture);const f=t.getOrCreateProgram("rasterParticleDraw",{defines:d.defines,overrideFog:!1});s.activeTexture.set(o.TEXTURE0+1);const p=d.scalarData?[]:[0,1,2,3].map(t=>e.e3[t](r));p.push(r);const m=r.canonical.x,g=r.canonical.y;for(const e of p){const s=i.getTile(l?e.wrapped():e);if(!s)continue;const a=s.rasterParticleState;if(!a)continue;const h=e.canonical.x+(1<<e.canonical.z)*(e.wrap-r.wrap),u=e.canonical.y;a.particleTexture0.bind(o.NEAREST,o.CLAMP_TO_EDGE);const p=Cs(1,a.particleTexture0.size[0],[h-m,u-g],0,d.texture.size,2,c,d.textureOffset,d.scale,d.offset);f.draw(t,o.POINTS,Yi.disabled,Hi.disabled,Ni.alphaBlended,Wi.disabled,p,n.id,a.particleIndexBuffer,void 0,a.particleSegment)}}}(t,i,n,d),s.bindFramebuffer.set(n.particleFramebuffer.framebuffer),function(t,i,n,r){const s=t.context,o=s.gl,a=i.paint.get("raster-particle-max-speed"),l=r*i.paint.get("raster-particle-speed-factor")*.15,c=function(e){return Math.pow(e,6)}(.01+1*i.paint.get("raster-particle-reset-rate-factor")),h=i.particleFramebuffer;s.viewport.set([0,0,h.width,h.height]);for(const r of n){const[,n,d]=r;s.activeTexture.set(o.TEXTURE0+0),n.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.activeTexture.set(o.TEXTURE0+1);const u=d.particleTexture0;u.bind(o.NEAREST,o.CLAMP_TO_EDGE);const f=Ds(1,u.size[0],0,n.texture.size,a,l,c,n.textureOffset,n.scale,n.offset);h.colorAttachment.set(d.particleTexture1.texture),s.clear({color:e.am.transparent}),t.getOrCreateProgram("rasterParticleUpdate",{defines:n.defines}).draw(t,o.TRIANGLES,Yi.disabled,Hi.disabled,Ni.unblended,Wi.disabled,f,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments)}}(t,n,d,f)}(t,i,n,r),"translucent"===t.renderPass&&(function(t,i,n,r){const s=t.context,o=s.gl,a=i.getSource().tileSize,l=5*(1-e.af(e.cI,e.cI+1,t.transform.zoom))*a+n.paint.get("raster-particle-elevation"),c=!t.options.moving,h="globe"===t.transform.projection.name;if(!r.length)return;const[d,u]=t.stencilConfigForOverlap(r),f=[];h&&f.push("PROJECTION_GLOBE_VIEW");const p=t.stencilModeFor3D();for(const r of u){const a=r.toUnwrapped(),u=i.getTile(r);if(!u.rasterParticleState)continue;const m=u.rasterParticleState,g=100;u.registerFadeDuration(g);const _=i.findLoadedParent(r,0),y=Xr(u,_,i,t.transform,g);let v,x;t.terrain&&t.terrain.prepareDrawTile(),s.activeTexture.set(o.TEXTURE0),m.targetColorTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.activeTexture.set(o.TEXTURE1),_&&_.rasterParticleState?(_.rasterParticleState.targetColorTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),v=Math.pow(2,_.tileID.overscaledZ-u.tileID.overscaledZ),x=[u.tileID.canonical.x*v%1,u.tileID.canonical.y*v%1]):m.targetColorTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE);const b=h?Float32Array.from(t.transform.expandedFarZProjMatrix):t.transform.calculateProjMatrix(a,c),w=t.transform,S=_o(w),T=e.dA(r.canonical),k=e.dB(T.getCenter().lat);let M,A,C,D,L;h?(M=Float32Array.from(e.bh(e.dD(r.canonical))),A=Float32Array.from(w.globeMatrix),C=Float32Array.from(e.dz(w)),D=[e.aD(w.center.lng),e.aH(w.center.lat)],L=Float32Array.from(e.dC(r.canonical,T,k,w.worldSize/w._pixelsPerMercatorPixel))):(M=new Float32Array(16),A=new Float32Array(9),C=new Float32Array(16),D=[0,0],L=new Float32Array(9));const E=As(b,M,A,C,L,x||[0,0],e.ah(t.transform.zoom),D,S,v||1,y,l),I=t.isTileAffectedByFog(r),P=t.getOrCreateProgram("rasterParticle",{defines:f,overrideFog:I});if(t.uploadCommonUniforms(s,P,a),h){const e=new Yi(o.LEQUAL,Yi.ReadOnly,t.depthRangeFor3D),i=0,r=t.globeSharedBuffers;if(r){const[s,a,l]=r.getGridBuffers(k,0!==i);P.draw(t,o.TRIANGLES,e,p,Ni.alphaBlended,t.renderElevatedRasterBackface?Wi.frontCCW:Wi.backCCW,E,n.id,s,a,l)}}else{const e=t.depthModeForSublayer(0,Yi.ReadOnly),i=d[r.overscaledZ],{tileBoundsBuffer:s,tileBoundsIndexBuffer:a,tileBoundsSegments:l}=t.getTileBoundsBuffers(u);P.draw(t,o.TRIANGLES,e,i,Ni.alphaBlended,Wi.disabled,E,n.id,s,a,l)}}t.resetStencilClippingMasks()}(t,i,n,r),t.style.map.triggerRepaint())},background:function(t,i,n,r){const s=n.paint.get("background-color"),o="none"===n.paint.get("background-color-use-theme").constantOr("default"),a=n.paint.get("background-opacity"),l=n.paint.get("background-emissive-strength"),c="viewport"===n.paint.get("background-pitch-alignment");if(0===a)return;const h=t.context,d=h.gl,u=t.transform,f=u.tileSize,p=n.paint.get("background-pattern");let m;if(void 0!==p){if(null===p)return;if(m=t.imageManager.getPattern(e.I.from(p.toString()),n.scope,t.style.getLut(n.scope)),!m)return}const g=!p&&1===s.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==g)return;const _=Hi.disabled,y=t.depthModeForSublayer(0,"opaque"===g?Yi.ReadWrite:Yi.ReadOnly),v=t.colorModeForDrapableLayerRenderPass(l),x=p?"backgroundPattern":"background";let b,w=r;if(w||(b=t.getBackgroundTiles(),w=Object.values(b).map(e=>e.tileID)),p&&(h.activeTexture.set(d.TEXTURE0),t.imageManager.bind(t.context,n.scope)),c){const i=t.getOrCreateProgram(x,{overrideFog:!1,overrideRtt:!0}),r=new Float32Array(e.bx([])),h=new e.aM(0,0,0,0,0),u=p?Ps(r,l,a,t,0,n.scope,m,c,{tileID:h,tileSize:f}):Is(r,l,a,s.toPremultipliedRenderColor(o?null:n.lut));i.draw(t,d.TRIANGLES,y,_,v,Wi.disabled,u,n.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments)}else for(const e of w){const g=t.isTileAffectedByFog(e),w=t.getOrCreateProgram(x,{overrideFog:g}),S=e.toUnwrapped(),T=r?e.projMatrix:t.transform.calculateProjMatrix(S);t.prepareDrawTile();const k=i?i.getTile(e):b?b[e.key]:new xt(e,f,u.zoom,t),M=p?Ps(T,l,a,t,0,n.scope,m,c,{tileID:e,tileSize:f}):Is(T,l,a,s.toPremultipliedRenderColor(o?null:n.lut));t.uploadCommonUniforms(h,w,S);const{tileBoundsBuffer:A,tileBoundsIndexBuffer:C,tileBoundsSegments:D}=t.getTileBoundsBuffers(k);w.draw(t,d.TRIANGLES,y,_,v,Wi.disabled,M,n.id,A,C,D)}},sky:function(t,i,n){const r=t._atmosphere?e.ah(t.transform.zoom):1,s=n.paint.get("sky-opacity")*r;if(0===s)return;const o=t.context,a=n.paint.get("sky-type"),l=new Yi(o.gl.LEQUAL,Yi.ReadOnly,[0,1]),c=t.frameCounter/1e3%1;"atmosphere"===a?"offscreen"===t.renderPass?n.needsSkyboxCapture(t)&&(function(t,i){const n=t.context,r=n.gl;let s=i.skyboxFbo;if(!s){s=i.skyboxFbo=n.createFramebuffer(32,32,!0,null),i.skyboxGeometry=new Eo(n),i.skyboxTexture=n.gl.createTexture(),r.bindTexture(r.TEXTURE_CUBE_MAP,i.skyboxTexture),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MAG_FILTER,r.LINEAR);for(let e=0;e<6;++e)r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,r.RGBA,32,32,0,r.RGBA,r.UNSIGNED_BYTE,null)}n.bindFramebuffer.set(s.framebuffer),n.viewport.set([0,0,32,32]);const o=i.getCenter(t,!0),a=t.getOrCreateProgram("skyboxCapture"),l=new Float64Array(16);e.bx(l),e.eh(l,l,.5*-Math.PI),Io(t,i,a,l,o,0),e.bx(l),e.eh(l,l,.5*Math.PI),Io(t,i,a,l,o,1),e.bx(l),e.cR(l,l,.5*-Math.PI),Io(t,i,a,l,o,2),e.bx(l),e.cR(l,l,.5*Math.PI),Io(t,i,a,l,o,3),e.bx(l),Io(t,i,a,l,o,4),e.bx(l),e.eh(l,l,Math.PI),Io(t,i,a,l,o,5),n.viewport.set([0,0,t.width,t.height])}(t,n),n.markSkyboxValid(t)):"sky"===t.renderPass&&function(e,t,i,n,r){const s=e.context,o=s.gl,a=e.transform,l=e.getOrCreateProgram("skybox");s.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_CUBE_MAP,t.skyboxTexture);const c=((e,t,i,n,r)=>({u_matrix:e,u_sun_direction:t,u_cubemap:0,u_opacity:n,u_temporal_offset:r}))(a.skyboxMatrix,t.getCenter(e,!1),0,n,r);e.uploadCommonUniforms(s,l),l.draw(e,o.TRIANGLES,i,Hi.disabled,e.colorModeForRenderPass(),Wi.backCW,c,"skybox",t.skyboxGeometry.vertexBuffer,t.skyboxGeometry.indexBuffer,t.skyboxGeometry.segment)}(t,n,l,s,c):"gradient"===a&&"sky"===t.renderPass&&function(t,i,n,r,s){const o=t.context,a=o.gl,l=t.transform,c=t.getOrCreateProgram("skyboxGradient");i.skyboxGeometry||(i.skyboxGeometry=new Eo(o)),o.activeTexture.set(a.TEXTURE0);let h=i.colorRampTexture;h||(h=i.colorRampTexture=new e.T(o,i.colorRamp,a.RGBA8)),h.bind(a.LINEAR,a.CLAMP_TO_EDGE);const d=((t,i,n,r,s)=>({u_matrix:t,u_color_ramp:0,u_center_direction:i,u_radius:e.al(n),u_opacity:r,u_temporal_offset:s}))(l.skyboxMatrix,i.getCenter(t,!1),i.paint.get("sky-gradient-radius"),r,s);t.uploadCommonUniforms(o,c),c.draw(t,a.TRIANGLES,n,Hi.disabled,t.colorModeForRenderPass(),Wi.backCW,d,"skyboxGradient",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}(t,n,l,s,c)},custom:function(t,i,n,r){const s=t.context,o=n.implementation;if(!t.transform.projection.unsupportedLayers||!t.transform.projection.unsupportedLayers.includes("custom")||t.terrain&&(t.terrain.renderingToTexture||"offscreen"===t.renderPass)&&n.isDraped(i)){if("offscreen"===t.renderPass){const i=o.prerender;if(i){if(t.setCustomLayerDefaults(),s.setColorMode(t.colorModeForRenderPass()),"globe"===t.transform.projection.name){const n=t.transform.pointMerc;i.call(o,s.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.ah(t.transform.zoom),[n.x,n.y],t.transform.pixelsPerMeterRatio)}else i.call(o,s.gl,t.transform.customLayerMatrix());s.setDirty(),t.setBaseState()}}else if("translucent"===t.renderPass){if(t.terrain&&t.terrain.renderingToTexture){const e=o.renderToTile;if(e){const i=r[0].canonical,n={x:i.x+r[0].wrap*(o.wrapTileId?0:1<<i.z),y:i.y,z:i.z};s.setDepthMode(Yi.disabled),s.setStencilMode(Hi.disabled),s.setColorMode(t.colorModeForRenderPass()),t.setCustomLayerDefaults(),e.call(o,s.gl,n),s.setDirty(),t.setBaseState()}return}t.setCustomLayerDefaults(),s.setColorMode(t.colorModeForRenderPass()),s.setStencilMode(Hi.disabled);const i="3d"===o.renderingMode?new Yi(t.context.gl.LEQUAL,Yi.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Yi.ReadOnly);if(s.setDepthMode(i),"globe"===t.transform.projection.name){const i=t.transform.pointMerc;o.render(s.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.ah(t.transform.zoom),[i.x,i.y],t.transform.pixelsPerMeterRatio)}else o.render(s.gl,t.transform.customLayerMatrix());s.setDirty(),t.setBaseState(),s.bindFramebuffer.set(null)}}else e.w("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")},model:function(t,i,n,r){if("opaque"===t.renderPass)return;const s=n.paint.get("model-opacity").constantOr(1);if(0===s)return;const o=n.paint.get("model-cast-shadows");if("shadow"===t.renderPass){if(!o)return;if(t.terrain&&s<.65&&n._transitionablePaint._values["model-opacity"].value.expression instanceof e.ab)return}const a=t.shadowRenderer,l=n.paint.get("model-receive-shadows");a&&(a.useNormalOffset=!0,l||(a.enabled=!1));const c=()=>{a&&(a.useNormalOffset=!0,l||(a.enabled=!0))},h=i.getSource();if("light-beam"===t.renderPass&&"batched-model"!==h.type)return;if("vector"===h.type||"geojson"===h.type)return function(t,i,n,r,s){const o=t.transform;if("mercator"!==o.projection.name)return void e.w(`Drawing 3D models for ${o.projection.name} projection is not yet implemented`);const a=o.getFreeCameraOptions().position;if(!t.modelManager)return;const l=t.modelManager;n.modelManager=l;const c=t.shadowRenderer;if(!n._unevaluatedLayout._values.hasOwnProperty("model-id"))return;const h=n._unevaluatedLayout._values["model-id"],d=Object.assign({},n.layout.get("model-id").parameters),u=t.style.order.indexOf(n.fqid);for(const f of r){const r=i.getTile(f).getBucket(n);if(!r||r.projection.name!==o.projection.name)continue;const p=r.getModelUris();p&&!r.modelsRequested&&(l.addModelsFromBucket(p,s),r.modelsRequested=!0);const m=$o(f,o);d.zoom=m;const g=h.possiblyEvaluate(d);if(Wo(t,r,f),Uo.shadowUniformsInitialized=!1,Uo.useSingleShadowCascade=!!c&&0===c.getMaxCascadeForTile(f.toUnwrapped()),"shadow"===t.renderPass&&c){if(1===t.currentShadowCascade&&r.isInsideFirstShadowMapFrustum)continue;const i=o.calculatePosMatrix(f.toUnwrapped(),o.worldSize);if(Uo.tileMatrix.set(i),Uo.shadowTileMatrix=Float32Array.from(c.calculateShadowPassMatrixFromMatrix(i)),Uo.aabb.min.fill(0),Uo.aabb.max[0]=Uo.aabb.max[1]=e.aj,Uo.aabb.max[2]=0,qo(r,Uo,t,n.scope))continue}const _=1<<f.canonical.z,y=[((a.x-f.wrap)*_-f.canonical.x)*e.aj,(a.y*_-f.canonical.y)*e.aj,a.z*_*e.aj];t.conflationActive&&Object.keys(r.instancesPerModel).length>0&&t.style.isLayerClipped(n,i.getSource())&&r.updateReplacement(f,t.replacementSource,u,s)&&(r.uploaded=!1,r.upload(t.context));for(let e in r.instancesPerModel){const i=r.instancesPerModel[e];i.features.length>0&&(e=g.evaluate(i.features[0].feature,{}));const o=l.getModel(e,s);if(o||l.hasURLBeenRequested(e)||r.modelUris.includes(e)||(r.modelUris.push(e),r.modelsRequested=!1),o&&o.uploaded)for(const e of o.nodes)Go(t,n,e,i,y,f,Uo)}}}(t,i,n,r,"vector"===h.type?n.scope:""),void c();if(!h.loaded())return;if("batched-model"===h.type)return function(t,i,n,r){n.resetLayerRenderingStats(t);const s=t.context,o=t.transform,a=t.style.fog,l=t.shadowRenderer;if("mercator"!==o.projection.name)return void e.w(`Drawing 3D landmark models for ${o.projection.name} projection is not yet implemented`);const c=t.transform.getFreeCameraOptions().position,h=e.c1([],[c.x,c.y,c.z],t.transform.worldSize),d=e.eq([],h),u=e.bx([]),f=e.e9(o.center.lat,o.zoom),p=e.bn([],[1,1,1/f]);e.bo(u,u,d);const m=n.paint.get("model-opacity").constantOr(1),g=new Yi(s.gl.LEQUAL,Yi.ReadWrite,t.depthRangeFor3D),_=new Yi(s.gl.LEQUAL,Yi.ReadOnly,t.depthRangeFor3D),y=new e.d6([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),v="shadow"===t.renderPass,x=v&&l?l.getCurrentCascadeFrustum():o.getFrustum(o.scaleZoom(o.worldSize)),b=n.paint.get("model-front-cutoff"),w=b[2]<1,S=an(t,n.paint.get("model-cutoff-fade-range")),T=n.getLayerRenderingStats();(function(e,t,i,n){const r=e.terrain?e.terrain.exaggeration():0,s=e.transform.zoom;for(const o of n){const n=t.getTile(o).getBucket(i);n&&(n.setFilter(i.filter),e.conflationActive&&n.updateReplacement(o,e.replacementSource),n.evaluateTransform(e,i),e.terrain&&r>0&&n.elevationUpdate(e.terrain,r,o,i.source),n.needsReEvaluation(e,s,i)&&n.evaluate(i))}})(t,i,n,r),function(){let c,d,k;w?(c=r.length-1,d=-1,k=-1):(c=0,d=r.length,k=1);const M=new Float64Array(16),A=e.cx(),C=new e.P(0,0);for(let D=c;D!==d;D+=k){const c=r[D],d=i.getTile(c).getBucket(n);if(!d||!d.uploaded)continue;let k=!1;l&&(k=0===l.getMaxCascadeForTile(c.toUnwrapped()));const L=o.calculatePosMatrix(c.toUnwrapped(),o.worldSize),E=d.modelTraits;!v&&w&&(e.bi(M,L),e.ad(A,h,M),C.x=A[0],C.y=A[1]);const I=[];d.setFilter(n.filter);for(const i of d.getNodesInfo()){if(i.hiddenByReplacement)continue;if(!i.node.meshes)continue;const n=i.node;let r=0;t.terrain&&n.elevation&&(r=n.elevation*t.terrain.exaggeration());const s=(()=>{const t=i.aabb;return y.min=[...t.min],y.max=[...t.max],y.min[2]+=r,y.max[2]+=r,e.ad(y.min,y.min,L),e.ad(y.max,y.max,L),y})(),a=i.evaluatedScale;if(a[0]<=1&&a[1]<=1&&a[2]<=1&&0===s.intersects(x))continue;if(!v&&w){const t=1/6;i.cameraCollisionOpacity=h[0]>s.min[0]&&h[0]<s.max[0]&&h[1]>s.min[1]&&h[1]<s.max[1]&&h[2]*f<s.max[2]&&n.footprint&&e.bY(C,n.footprint)?Math.max(i.cameraCollisionOpacity-t,0):Math.min(1,i.cameraCollisionOpacity+t)}const l=[...L],d=1/e.d4(c.canonical),u=n.anchor?n.anchor[0]:0,p=n.anchor?n.anchor[1]:0;e.bo(l,l,[u*(a[0]-1)+i.evaluatedTranslation[0]*d,p*(a[1]-1)+i.evaluatedTranslation[1]*d,r+i.evaluatedTranslation[2]]),e.cn(a,e.es)||e.cP(l,l,a);const g=e.az([],l,n.matrix),_=e.az([],o.expandedFarZProjMatrix,g),T=e.az([],o.expandedFarZProjMatrix,l),k=e.aA([],[u,p,r,1],_)[2];n.hidden=!1;let M=m;v||(w&&(M*=i.cameraCollisionOpacity,M*=Jo(l,o,i.aabb,b)),M*=Zo(S,k)),0!==M?I.push({nodeInfo:i,depth:k,opacity:M,wvpForNode:_,wvpForTile:T,nodeModelMatrix:g,tileModelMatrix:l}):n.hidden=!0}v||I.sort((e,t)=>!w||1===e.opacity&&1===t.opacity?e.depth<t.depth?-1:1:1===e.opacity?-1:1===t.opacity?1:e.depth>t.depth?-1:1);for(const i of I){const r=i.nodeInfo,c=r.node;let h=e.az([],p,i.tileModelMatrix);e.az(h,u,h);const d=e.bi([],h);e.ea(d,d),e.cP(d,d,Xo),h=e.az(h,h,c.matrix);const f="light-beam"===t.renderPass,m="none"===n.paint.get("model-color-use-theme").constantOr("default"),y=E&e.ex.HasMapboxMeshFeatures,x=y?0:r.evaluatedRMEA[0][2];for(let e=0;e<c.meshes.length;++e){const u=c.meshes[e],p=e===c.lightMeshIndex;let b=i.wvpForNode;if(p){if(!f&&!t.terrain&&t.shadowRenderer){t.currentLayer<t.firstLightBeamLayer&&(t.firstLightBeamLayer=t.currentLayer);continue}b=i.wvpForTile}else if(f)continue;const w={defines:[]},S=[];if(!v&&l&&(l.useNormalOffset=!!u.normalBuffer),Bo(w.defines,S,u,t,m?null:n.lut),y||w.defines.push("DIFFUSE_SHADED"),k&&w.defines.push("SHADOWS_SINGLE_CASCADE"),T&&(v?T.numRenderedVerticesInShadowPass+=u.vertexArray.length:T.numRenderedVerticesInTransparentPass+=u.vertexArray.length),v){Vo(u,i.nodeModelMatrix,t,n);continue}let M=null;if(a){const e=Yo(i.nodeModelMatrix,t.transform);if(M=new Float32Array(e),"globe"!==o.projection.name){const t=u.aabb.min,i=u.aabb.max,[n,r]=a.getOpacityForBounds(e,t[0],t[1],i[0],i[1]);w.overrideFog=n>=Re||r>=Re}}const A=u.material;let C;A.occlusionTexture&&A.occlusionTexture.offsetScale&&(C=A.occlusionTexture.offsetScale,w.defines.push("OCCLUSION_TEXTURE_TRANSFORM"));const D=t.getOrCreateProgram("model",w);!v&&l&&l.setupShadowsFromMatrix(i.tileModelMatrix,D,l.useNormalOffset),t.uploadCommonUniforms(s,D,null,M);const L=A.pbrMetallicRoughness;L.metallicFactor=.9,L.roughnessFactor=.5;const E=Os(new Float32Array(b),new Float32Array(h),new Float32Array(d),new Float32Array(c.matrix),t,i.opacity,L.baseColorFactor,A.emissiveFactor,L.metallicFactor,L.roughnessFactor,A,x,n,[0,0,0],C);!p&&(r.hasTranslucentParts||i.opacity<1)&&D.draw(t,s.gl.TRIANGLES,g,Hi.disabled,Ni.disabled,Wi.backCCW,E,n.id,u.vertexBuffer,u.indexBuffer,u.segments,n.paint,t.transform.zoom,void 0,S),D.draw(t,s.gl.TRIANGLES,p?_:g,Hi.disabled,p||i.opacity<1||r.hasTranslucentParts?Ni.alphaBlended:Ni.unblended,Wi.backCCW,E,n.id,u.vertexBuffer,u.indexBuffer,u.segments,n.paint,t.transform.zoom,void 0,S)}}}}()}(t,i,n,r),void c();if("model"!==h.type)return;const d=h.getModels(),u=[],f=t.transform.getFreeCameraOptions().position,p=e.c1([],[f.x,f.y,f.z],t.transform.worldSize);e.eq(p,p);const m=[],g=[];let _=0;for(const i of d){const r=n.paint.get("model-rotation").constantOr(null),s=n.paint.get("model-scale").constantOr(null),o=n.paint.get("model-translation").constantOr(null);i.computeModelMatrix(t,r,s,o,!0,!0,!1);const a=e.bx([]),l=e.e9(i.position.lat,t.transform.zoom),c=e.bn([],[1,1,1/l]);e.bo(a,a,p),u.push({zScaleMatrix:c,negCameraPosMatrix:a});for(const e of i.nodes)jo(t.transform,e,i.matrix,t.transform.expandedFarZProjMatrix,_,m,g);_++}if(m.sort((e,t)=>t.depth-e.depth),"shadow"!==t.renderPass){if(1===s)for(const e of g)Ho(e,t,n,u[e.modelIndex],Hi.disabled,t.colorModeForRenderPass());else{for(const e of g)Ho(e,t,n,u[e.modelIndex],Hi.disabled,Ni.disabled);for(const e of g)Ho(e,t,n,u[e.modelIndex],t.stencilModeFor3D(),t.colorModeForRenderPass());t.resetStencilClippingMasks()}for(const e of m)Ho(e,t,n,u[e.modelIndex],Hi.disabled,t.colorModeForRenderPass());c()}else{for(const e of g)Vo(e.mesh,e.nodeModelMatrix,t,n);for(const e of m)Vo(e.mesh,e.nodeModelMatrix,t,n);c()}}},ma={line:function(e,t,i){if(e.hasElevatedBuckets=!1,e.hasNonElevatedBuckets=!1,void 0!==e._unevaluatedLayout.getValue("line-elevation-reference")||void 0!==e._unevaluatedLayout.getValue("line-z-offset")){if(t){const i=t.getVisibleCoordinates();for(const n of i){const i=t.getTile(n).getBucket(e);if(i&&("none"!==i.elevationType?e.hasElevatedBuckets=!0:e.hasNonElevatedBuckets=!0,e.hasElevatedBuckets&&e.hasNonElevatedBuckets))break}}}else e.hasNonElevatedBuckets=!0},model:function(e,t,i){const n=t.getSource();if(!n.loaded())return;if("vector"===n.type||"geojson"===n.type)return void(i.modelManager&&i.modelManager.upload(i,"vector"===n.type?e.scope:""));if("batched-model"===n.type)return;if("model"!==n.type)return;const r=n.getModels();for(const e of r)e.upload(i.context)},raster:function(e,t,i){const n=t.getSource();if(!(n instanceof it&&n.loaded()))return;const r=e.sourceLayer||n.rasterLayerIds&&n.rasterLayerIds[0];if(!r)return;const s=e.paint.get("raster-array-band")||n.getInitialBand(r);if(null==s)return;const o=t.getIds().map(e=>t.getTileByID(e));for(const t of o)t.updateNeeded(e.id,s)&&n.prepareTile(t,r,e.id,s)},"raster-particle":function(e,t,i){const n=t.getSource();if(!(n instanceof it&&n.loaded()))return;const r=e.sourceLayer||n.rasterLayerIds&&n.rasterLayerIds[0];if(!r)return;const s=e.paint.get("raster-particle-array-band")||n.getInitialBand(r);if(null==s)return;const o=t.getIds().map(e=>t.getTileByID(e));for(const t of o)t.updateNeeded(e.id,s)&&n.prepareTile(t,r,e.id,s)}},ga={fill:Ks},_a={fill:function(e,t,i,n){if(!i.layout||"none"===i.layout.get("fill-elevation-reference"))return;const r=e.context.gl,s=new Yi(r.LEQUAL,Yi.ReadOnly,e.depthRangeFor3D),o=new Hi({func:r.ALWAYS,mask:255},255,255,r.KEEP,r.KEEP,r.REPLACE),a=e.transform.getFreeCameraOptions().position,l=e.getOrCreateProgram("elevatedStructuresDepthReconstruct");for(const c of n){const n=t.getTile(c),h=n.getBucket(i);if(!h)continue;const d=h.elevatedStructures;if(!d||0===d.depthSegments.segments[0].primitiveLength)continue;const u=Js(c.toUnwrapped(),a),f=e.translatePosMatrix(c.projMatrix,n,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor")),p=ps(f,u,0,1,0);l.draw(e,r.TRIANGLES,s,o,Ni.disabled,Wi.disabled,p,i.id,d.vertexBuffer,d.indexBuffer,d.depthSegments,i.paint,e.transform.zoom)}}};class ya{constructor(t,i,n,r,s,o){this.context=new js(t,i),this.transform=n,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.tp=s,this._timeStamp=e.q.now(),this._averageFPS=0,this._fpsHistory=[],this._dt=0,this._debugParams={forceEnablePrecipitation:!1,showTerrainProxyTiles:!1,fpsWindow:30,continousRedraw:!1,enabledLayers:{}};const a=["fill","line","symbol","circle","heatmap","fill-extrusion","building","raster","raster-particle","hillshade","model","background","sky"];for(const e of a)this._debugParams.enabledLayers[e]=!0;s.registerParameter(this._debugParams,["Terrain"],"showTerrainProxyTiles",{},()=>{this.style.map.triggerRepaint()}),s.registerParameter(this._debugParams,["Precipitation"],"forceEnablePrecipitation"),s.registerParameter(this._debugParams,["FPS"],"fpsWindow",{min:1,max:100,step:1}),s.registerBinding(this._debugParams,["FPS"],"continousRedraw",{readonly:!0,label:"continuous redraw"}),s.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"value"}),s.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"graph",view:"graph",min:0,max:200});for(const e of a)s.registerParameter(this._debugParams.enabledLayers,["Debug","Layers"],e);this.occlusionParams=new ea(s),this.setup(),this.numSublayers=Tt.maxUnderzooming+Tt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new e.eE,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new dn(this),this._wireframeDebugCache=new Qo,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const l=new e.r({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new e.T(this.context,l,t.RGBA8),this._clippingActiveLastFrame=!1,this.scaleFactor=r,this.worldview=o}updateTerrain(e,t){const i=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;if(!(i||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new Kr(this,e));const n=this._terrain;this.transform.elevation=i?n:null,n.update(e,this.transform,t),this.transform.elevation&&!n.enabled&&(this.transform.elevation=null)}_updateFog(e){const t=e.fog;if(!t||"globe"===this.transform.projection.name||t.getOpacity(this.transform.pitch)<1||t.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[i,n]=t.getFovAdjustedRange(this.transform._fov);if(i>n)return void(this.transform.fogCullDistSq=null);const r=i+.78*(n-i);this.transform.fogCullDistSq=r*r}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(e){e&&!this._terrain&&(this._terrain=new Kr(this,this.style)),this._forceTerrainMode=e}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(t,i){if(this.width=t*e.q.devicePixelRatio,this.height=i*e.q.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const e of this.style.order)this.style._mergedLayers[e].resize()}setup(){const t=this.context,i=new e.ba;i.emplaceBack(0,0),i.emplaceBack(e.aj,0),i.emplaceBack(0,e.aj),i.emplaceBack(e.aj,e.aj),this.tileExtentBuffer=t.createVertexBuffer(i,e.bc.members),this.tileExtentSegments=e.bd.simpleSegment(0,0,4,2);const n=new e.ba;n.emplaceBack(0,0),n.emplaceBack(e.aj,0),n.emplaceBack(0,e.aj),n.emplaceBack(e.aj,e.aj),this.debugBuffer=t.createVertexBuffer(n,e.bc.members),this.debugSegments=e.bd.simpleSegment(0,0,4,5);const r=new e.ba;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(-1,1),r.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(r,e.bc.members),this.viewportSegments=e.bd.simpleSegment(0,0,4,2);const s=new e.aZ;s.emplaceBack(0,0,0,0),s.emplaceBack(e.aj,0,e.aj,0),s.emplaceBack(0,e.aj,0,e.aj),s.emplaceBack(e.aj,e.aj,e.aj,e.aj),this.mercatorBoundsBuffer=t.createVertexBuffer(s,e.bf.members),this.mercatorBoundsSegments=e.bd.simpleSegment(0,0,4,2);const o=new e.a_;o.emplaceBack(0,1,2),o.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(o);const a=new e.bb;for(const e of[0,1,3,2,0])a.emplaceBack(e);this.debugIndexBuffer=t.createIndexBuffer(a),this.emptyTexture=new e.T(t,new e.r({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA8),this.identityMat=e.bz();const l=this.context.gl;this.stencilClearMode=new Hi({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(e){return e._makeTileBoundsBuffers(this.context,this.transform.projection),e._tileBoundsBuffer?{tileBoundsBuffer:e._tileBoundsBuffer,tileBoundsIndexBuffer:e._tileBoundsIndexBuffer,tileBoundsSegments:e._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const e=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,e.TRIANGLES,Yi.disabled,this.stencilClearMode,Ni.disabled,Wi.disabled,Gr(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(e,t,i){if(!t||this.currentStencilSource===t.id||!e.isTileClipped()||!i||0===i.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let e=!1;for(const t of i)if(void 0===this._tileClippingMaskIDs[t.key]){e=!0;break}if(!e)return}this.currentStencilSource=t.id;const n=this.context,r=n.gl;this.nextStencilID+i.length>256&&this.clearStencil(),n.setColorMode(Ni.disabled),n.setDepthMode(Yi.disabled);const s=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const e of i){const i=t.getTile(e),n=this._tileClippingMaskIDs[e.key]=this.nextStencilID++,{tileBoundsBuffer:o,tileBoundsIndexBuffer:a,tileBoundsSegments:l}=this.getTileBoundsBuffers(i);s.draw(this,r.TRIANGLES,Yi.disabled,new Hi({func:r.ALWAYS,mask:0},n,255,r.KEEP,r.KEEP,r.REPLACE),Ni.disabled,Wi.disabled,Gr(e.projMatrix),"$clipping",o,a,l)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,t=this.context.gl;return new Hi({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(e);const t=this.context.gl;return new Hi({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){const t=this.context.gl,i=e.sort((e,t)=>t.overscaledZ-e.overscaledZ),n=i[i.length-1].overscaledZ,r=i[0].overscaledZ-n+1;if(r>1){this.currentStencilSource=void 0,this.nextStencilID+r>256&&this.clearStencil();const e={};for(let i=0;i<r;i++)e[i+n]=new Hi({func:t.GEQUAL,mask:255},i+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=r,[e,i]}return[{[n]:Hi.disabled},i]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const i=1/8;return new Ni([t.CONSTANT_COLOR,t.ONE,t.CONSTANT_COLOR,t.ONE],new e.am(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Ni.unblended:Ni.alphaBlended}colorModeForDrapableLayerRenderPass(t){const i=this.context.gl;return(()=>this.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture)()&&"translucent"===this.renderPass?new Ni([i.ONE,i.ONE_MINUS_SRC_ALPHA,i.CONSTANT_ALPHA,i.ONE_MINUS_SRC_ALPHA],new e.am(0,0,0,void 0===t?0:t),[!0,!0,!0,!0]):this.colorModeForRenderPass()}depthModeForSublayer(e,t,i,n=!1){if(this.depthOcclusion)return new Yi(this.context.gl.GREATER,Yi.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!n)return Yi.disabled;const r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Yi(i||this.context.gl.LEQUAL,t,[r,r])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}blitDepth(){const t=this.context.gl,i=Math.ceil(this.width),n=Math.ceil(this.height),r=this.context.bindFramebuffer.get(),s=t.getParameter(t.TEXTURE_BINDING_2D);this.depthFBO&&this.depthFBO.width===i&&this.depthFBO.height===n||(this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),0!==i&&0!==n&&(this.depthFBO=new Hs(this.context,i,n,!1,"texture"),this.depthTexture=new e.T(this.context,{width:i,height:n,data:null},t.DEPTH24_STENCIL8),this.depthFBO.depthAttachment.set(this.depthTexture.texture))),this.context.bindFramebuffer.set(r),t.bindTexture(t.TEXTURE_2D,s),this.depthFBO&&(t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,this.depthFBO.framebuffer),t.blitFramebuffer(0,0,i,n,0,0,i,n,t.DEPTH_BUFFER_BIT,t.NEAREST),t.bindFramebuffer(t.FRAMEBUFFER,this.context.bindFramebuffer.current))}updateAverageFPS(){this._fpsHistory.push(0===this._dt?0:1e3/this._dt),this._fpsHistory.length>this._debugParams.fpsWindow&&this._fpsHistory.splice(0,this._fpsHistory.length-this._debugParams.fpsWindow),this._averageFPS=Math.round(this._fpsHistory.reduce((e,t)=>e+t/this._fpsHistory.length,0))}render(t,i){const n=e.q.now();this._dt=n-this._timeStamp,this._timeStamp=n,this._wireframeDebugCache.update(this.frameCounter),this._debugParams.continousRedraw=t.map.repaint,this.style=t,this.options=i;const r=this.style._mergedLayers,s=!(!this.terrain||!this.terrain.enabled),o=()=>this.style._getOrder(s).filter(e=>{const t=r[e];return!(t.type in this._debugParams.enabledLayers)||this._debugParams.enabledLayers[t.type]});let a=o(),l=!1,c=!1,h=null;for(const e of a){const t=r[e];"circle"===t.type?l=!0:"building"===t.type?h=t:"symbol"===t.type&&(t.hasInitialOcclusionOpacityProperties?c=!0:l=!0)}let d=a.map(e=>r[e]);const u=this.style._mergedSourceCaches;this.imageManager=t.imageManager,this.modelManager=t.modelManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.q.now()),this.imageManager.beginFrame();let f=0,p=!1;for(const e in u){const t=u[e];t.used&&(t.prepare(this.context),t.getSource().usedInConflation&&++f)}let m=!1;for(const e of d)e.isHidden(this.transform.zoom)||("clip"===e.type&&(m=!0),this.prepareLayer(e));const g={},_={},y={},v={},x={};for(const e in u){const t=u[e];g[e]=t.getVisibleCoordinates(),_[e]=g[e].slice().reverse(),y[e]=t.getVisibleCoordinates(!0).reverse(),v[e]=t.getShadowCasterCoordinates(),x[e]=t.sortCoordinatesByDistance(g[e])}const b=e=>{const t=this.style.getLayerSourceCache(e);return t&&t.used?t.getSource():null};if(f||m||this._clippingActiveLastFrame){const t=[],i=[];let n=0;for(const e of d)this.isSourceForClippingOrConflation(e,b(e))&&(t.push(e),i.push(n)),n++;if(t&&(m||t.length>1)||this._clippingActiveLastFrame){m=!1;const n=[];for(let r=0;r<t.length;r++){const s=t[r],o=i[r],a=this.style.getLayerSourceCache(s);if(!a||!a.used||!a.getSource().usedInConflation&&"clip"!==s.type&&"building"!==s.type)continue;let l=e.eF,c=e.bW.None;const h=[];let d=!0;if("building"===s.type)l=e.eH;else if("clip"===s.type){l=o;for(const t of s.layout.get("clip-layer-types"))c|="model"===t?e.bW.Model:"symbol"===t?e.bW.Symbol:e.bW.FillExtrusion;for(const e of s.layout.get("clip-layer-scope"))h.push(e);s.isHidden(this.transform.zoom)?d=!1:m=!0}d&&n.push({layer:s.fqid,cache:a,order:l,clipMask:c,clipScope:h})}this.replacementSource.setSources(n),p=!0}}this._clippingActiveLastFrame=m,p||this.replacementSource.clear(),this.conflationActive=p,this.minCutoffZoom=0,this.longestCutoffRange=0,this.opaquePassCutoff=1/0,this._lastOcclusionLayer=-1,this.layersWithOcclusionOpacity=[];for(let e=0;e<d.length;e++){const t=d[e],i=t.cutoffRange();if(this.longestCutoffRange=Math.max(i,this.longestCutoffRange),i>0){const e=b(t);e&&(this.minCutoffZoom=Math.max(e.minzoom,this.minCutoffZoom)),t.minzoom&&(this.minCutoffZoom=Math.max(t.minzoom,this.minCutoffZoom))}t.is3D(s)&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=e),this._lastOcclusionLayer=e)}const w=this.style&&this.style.fog;w?(this._fogVisible=0!==w.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=w.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(y),this.opaquePassCutoff=0,a=o(),d=a.map(e=>r[e]));const S=this._shadowRenderer;if(S){S.updateShadowParameters(this.transform,this.style.directionalLight);for(const e in u)for(const t of g[e]){let e={min:0,max:0};this.terrain&&(e=this.terrain.getMinMaxForTile(t)||e),S.addShadowReceiver(t.toUnwrapped(),e.min,e.max)}}"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new e.eG(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new Fo(this)),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);const T=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.snow),k=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.rain);if(T&&!this._snow&&(this._snow=new fa(this)),!T&&this._snow&&(this._snow.destroy(),delete this._snow),k&&!this._rain&&(this._rain=new da(this)),!k&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),h){this.buildingTileBorderManager||(this.buildingTileBorderManager=new No);const e=this.style.getLayerSourceCache(h);this.buildingTileBorderManager.updateBorders(e,h)}if(!B.has(this.context.gl))return;this.renderPass="offscreen";for(const e of d){const i=t.getLayerSourceCache(e);if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const n=i?_[i.id]:void 0;("custom"===e.type||"raster"===e.type||"raster-particle"===e.type||e.isSky()||n&&n.length)&&this.renderLayer(this,i,e,n)}this.depthRangeFor3D=[0,1-(d.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,v)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const M="globe"===this.transform.projection.name||this.transform.isHorizonVisible(),A=(()=>{if(i.showOverdrawInspector)return e.am.black;const t=this.style.fog;if(t&&this.transform.projection.supportsFog){const i=this.style.getLut(t.scope);if(!M){const n="none"===t.properties.get("color-use-theme"),r=t.properties.get("color").toNonPremultipliedRenderColor(n?null:i).toArray01();return new e.am(...r)}if(M){const n="none"===t.properties.get("space-color-use-theme"),r=t.properties.get("space-color").toNonPremultipliedRenderColor(n?null:i).toArray01();return new e.am(...r)}}return e.am.transparent})();if(this.context.clear({color:A,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&M&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=a.length-1;this.currentLayer>=0;this.currentLayer--){const e=d[this.currentLayer],i=t.getLayerSourceCache(e);if(e.isSky())continue;const n=i?(e.is3D(s)?x:_)[i.id]:void 0;this._renderTileClippingMasks(e,i,n),this.renderLayer(this,i,e,n)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&M&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||e.ah(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isHorizonVisible()))for(this.currentLayer=0;this.currentLayer<a.length;this.currentLayer++){const e=d[this.currentLayer],i=t.getLayerSourceCache(e);e.isSky()&&this.renderLayer(this,i,e,i?_[i.id]:void 0)}function C(e,t){let i;return t&&(i=("symbol"===e.type?y:e.is3D(s)?x:_)[t.id]),i}if(this.renderPass="translucent","globe"===this.transform.projection.name){for(this.renderElevatedRasterBackface=!0,this.currentLayer=0;this.currentLayer<a.length;){const e=d[this.currentLayer];if("raster"===e.type||"raster-particle"===e.type){const i=t.getLayerSourceCache(e);this.renderLayer(this,i,e,C(e,i))}++this.currentLayer}this.renderElevatedRasterBackface=!1}this.currentLayer=0,this.firstLightBeamLayer=Number.MAX_SAFE_INTEGER;let D=0;S&&(D=S.getShadowCastingLayerCount());let L=!1,E=-1;for(let e=0;e<a.length;++e){const t=d[e];t.isHidden(this.transform.zoom)||t.is3D(s)&&(E=e)}c&&-1===E&&(l=!0);let I=!1;for(;this.currentLayer<a.length;){const e=d[this.currentLayer],i=t.getLayerSourceCache(e);if(e.isSky())++this.currentLayer;else if(this.terrain&&this.style.isLayerDraped(e)){if(e.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer),this._lastOcclusionLayer=Math.max(this.currentLayer,this._lastOcclusionLayer)}else{if(!I&&e.is3D(s)&&!s){const e=this.currentLayer,t=e=>{for(this.currentLayer=0;this.currentLayer<d.length;this.currentLayer++){const t=d[this.currentLayer];if(ga[t.type]){const i=this.style.getLayerSourceCache(t);ga[t.type](this,i,t,C(t,i),e)}}};t("initialize"),t("reset"),this.currentLayer=e,I=!0}if(l&&!L&&this.terrain&&!this.transform.isOrthographic&&(L=!0,this.blitDepth()),c&&-1!==E&&this.currentLayer===E+1&&!this.transform.isOrthographic&&this.blitDepth(),this.terrain||this._renderTileClippingMasks(e,i,i?g[i.id]:void 0),this.renderLayer(this,i,e,C(e,i)),!this.terrain&&S&&D>0&&e.hasShadowPass()&&0==--D){{this.clearStencil(),this.resetStencilClippingMasks();const e=this.currentLayer;for(this.currentLayer=0;this.currentLayer<d.length;this.currentLayer++){const e=d[this.currentLayer];if(_a[e.type]){const t=this.style.getLayerSourceCache(e);_a[e.type](this,t,e,C(e,t))}}this.currentLayer=e}if(S.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer){const e=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=e;this.currentLayer++){const e=d[this.currentLayer];if(!e.hasLightBeamPass())continue;const i=t.getLayerSourceCache(e);this.renderLayer(this,i,e,i?_[i.id]:void 0)}this.currentLayer=e,this.renderPass="translucent"}}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const e=this.currentLayer;this.depthOcclusion=!0;for(const e of this.layersWithOcclusionOpacity){this.currentLayer=e;const i=d[this.currentLayer],n=t.getLayerSourceCache(i),r=n?_[n.id]:void 0;this.terrain||this._renderTileClippingMasks(i,n,n?g[n.id]:void 0),this.renderLayer(this,n,i,r)}this.depthOcclusion=!1,this.currentLayer=e,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this._snow&&this._snow.draw(this),this._rain&&this._rain.draw(this),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let i=null;d.forEach(e=>{const n=t.getLayerSourceCache(e);n&&!e.isHidden(this.transform.zoom)&&n.getVisibleCoordinates().length&&(!i||i.getSource().maxzoom<n.getSource().maxzoom)&&(i=n)}),i&&this.options.showTileBoundaries&&So(this,i,i.getVisibleCoordinates(),e.am.red,!1,this.options.showParseStatus)}this.terrain&&this._debugParams.showTerrainProxyTiles&&So(this,this.terrain.proxySourceCache,this.terrain.proxyCoords,new e.am(1,.8,.1,1),!0,this.options.showParseStatus),this.options.showPadding&&function(e){const t=e.transform.padding;ko(e,e.transform.height-(t.top||0),3,yo),ko(e,t.bottom||0,3,vo),Mo(e,t.left||0,3,xo),Mo(e,e.transform.width-(t.right||0),3,bo);const i=e.transform.centerPoint;!function(e,t,i,n){Ao(e,t-1,i-10,2,20,n),Ao(e,t-10,i-1,20,2,n)}(e,i.x,e.transform.height-i.y,wo)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(performance.now()),this.saveCanvasCopy()),p||(this.conflationActive=!1)}prepareLayer(e){this.gpuTimingStart(e);const{unsupportedLayers:t}=this.transform.projection,i=!t||!t.includes(e.type);if(ma[e.type]&&(i||this.terrain&&"custom"===e.type)){const t=this.style.getLayerSourceCache(e);ma[e.type](e,t,this)}this.gpuTimingEnd()}renderLayer(e,t,i,n){i.isHidden(this.transform.zoom)||("background"===i.type||"sky"===i.type||"custom"===i.type||"model"===i.type||"raster"===i.type||"raster-particle"===i.type||n&&n.length)&&(this.id=i.id,this.gpuTimingStart(i),e.transform.projection.unsupportedLayers&&e.transform.projection.unsupportedLayers.includes(i.type)&&(!e.terrain||"custom"!==i.type)||"clip"===i.type||pa[i.type](e,t,i,n,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(e){if(!this.options.gpuTiming)return;const t=this.context.extTimerQuery,i=this.context.gl;let n=this.gpuTimers[e.id];n||(n=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:i.createQuery()}),n.calls++,i.beginQuery(t.TIME_ELAPSED_EXT,n.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const e=this.context.extTimerQuery,t=this.context.gl,i=t.createQuery();this.deferredRenderGpuTimeQueries.push(i),t.beginQuery(e.TIME_ELAPSED_EXT,i)}}gpuTimingDeferredRenderEnd(){this.options.gpuTimingDeferredRender&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}gpuTimingEnd(){this.options.gpuTiming&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}collectGpuTimers(){const e=this.gpuTimers;return this.gpuTimers={},e}collectDeferredRenderGpuQueries(){const e=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],e}queryGpuTimers(e){const t={};for(const i in e){const n=e[i],r=this.context.extTimerQuery,s=r.getQueryParameter(n.query,this.context.gl.QUERY_RESULT)/1e6;r.deleteQueryEXT(n.query),t[i]=s}return t}queryGpuTimeDeferredRender(e){if(!this.options.gpuTimingDeferredRender)return 0;const t=this.context.gl;let i=0;for(const n of e)i+=t.getQueryParameter(n,t.QUERY_RESULT)/1e6,t.deleteQuery(n);return i}translatePosMatrix(t,i,n,r,s){if(!n[0]&&!n[1])return t;const o=s?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(o){const e=Math.sin(o),t=Math.cos(o);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}const a=[s?n[0]:e.aw(i,n[0],this.transform.zoom),s?n[1]:e.aw(i,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.bo(l,t,a),l}saveTileTexture(e){if(e.context!==this.context)return;const t=e.size[0],i=this._tileTextures[t];i?i.push(e):this._tileTextures[t]=[e]}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(e,t,i){const n=void 0===i?this.terrain&&this.terrain.renderingToTexture:i,r=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===e||"terrainRaster"===e?(r.push("LIGHTING_3D_MODE"),r.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):n||r.push("LIGHTING_3D_MODE")),"shadow"===this.renderPass&&(this._shadowMapDebug||r.push("DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(r.push("TERRAIN"),this.linearFloatFilteringSupported()&&r.push("TERRAIN_DEM_FLOAT_FORMAT")),"globe"===this.transform.projection.name&&r.push("GLOBE"),!this._fogVisible||n||void 0!==t&&!t||r.push("FOG","FOG_DITHERING"),n&&r.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&r.push("OVERDRAW_INSPECTOR"),r}getOrCreateProgram(e,t){this.cache=this.cache||{};const i=t&&t.defines||[],n=t&&t.config,r=this.currentGlobalDefines(e,t&&t.overrideFog,t&&t.overrideRtt).concat(i),s=is.cacheKey(qn[e],e,r,n);return this.cache[s]||(this.cache[s]=new is(this.context,e,qn[e],n,Fs[e],r)),this.cache[s]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(t,i){if(this.style.enable3dLights()){const n=this.style.directionalLight,r=this.style.ambientLight;if(n&&r){const s=((t,i,n)=>{const r=t.properties.get("direction"),s="none"===t.properties.get("color-use-theme"),o=t.properties.get("color").toNonPremultipliedRenderColor(s?null:n.getLut(t.scope)).toArray01(),a=t.properties.get("intensity"),l="none"===i.properties.get("color-use-theme"),c=i.properties.get("color").toNonPremultipliedRenderColor(l?null:n.getLut(i.scope)).toArray01(),h=i.properties.get("intensity"),d=[r.x,r.y,r.z],u=e.dI(c,h),f=e.dI(o,a);return{u_lighting_ambient_color:u,u_lighting_directional_dir:d,u_lighting_directional_color:f,u_ground_radiance:Qr(d,f,u)}})(n,r,this.style);i.setLightsUniformValues(t,s)}}}uploadCommonUniforms(t,i,n,r,s){if(this.uploadCommonLightUniforms(t,i),this.terrain&&this.terrain.renderingToTexture)return;const o=this.style.fog;if(o){const s=o.getOpacity(this.transform.pitch),a=((t,i,n,r,s,o,a,l,c,h,d,u)=>{const f=t.transform,p="none"===i.properties.get("color-use-theme"),m=i.properties.get("color").toNonPremultipliedRenderColor(p?null:t.style.getLut(i.scope)).toArray01();m[3]=r;const g=t.frameCounter/1e3%1,[_,y]=i.properties.get("vertical-range");return{u_fog_matrix:n?f.calculateFogTileMatrix(n):u||t.identityMat,u_fog_range:i.getFovAdjustedRange(f._fov),u_fog_color:m,u_fog_horizon_blend:i.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(_,y),y],u_fog_temporal_offset:g,u_frustum_tl:s,u_frustum_tr:o,u_frustum_br:a,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:h,u_viewport:d,u_globe_transition:e.ah(f.zoom),u_is_globe:+("globe"===f.projection.name)}})(this,o,n,s,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*e.q.devicePixelRatio,this.transform.height*e.q.devicePixelRatio],r);i.setFogUniformValues(t,a)}s&&i.setCutoffUniformValues(t,s.uniformValues)}setTileLoadedFlag(e){this.tileLoaded=e}saveCanvasCopy(){const e=this.canvasCopy();e&&(this.frameCopies.push(e),this.tileLoaded=!1)}canvasCopy(){const e=this.context.gl,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,0,0,e.drawingBufferWidth,e.drawingBufferHeight,0),t}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const e=this.style&&this.style.fog;return!!e&&0!==e.getOpacity(this.transform.pitch)}getBackgroundTiles(){const e=this._backgroundTiles,t=this._backgroundTiles={},i=this.transform.coveringTiles({tileSize:512});for(const n of i)t[n.key]=e[n.key]||new xt(n,512,this.transform.tileZoom,this,void 0,this.worldview);return t}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(e,t){return!(!e.is3D(!(!this.terrain||!this.terrain.enabled))||"clip"!==e.type&&"building"!==e.type&&(e.minzoom&&e.minzoom>this.transform.zoom||(this.style._clipLayerPresent||"building"!==e.sourceLayer&&"procedural_buildings"!==e.sourceLayer)&&(!t||"batched-model"!==t.type)))}isTileAffectedByFog(e){if(!this.style||!this.style.fog)return!1;if("globe"===this.transform.projection.name)return!0;let t=this._cachedTileFogOpacities[e.key];return t||(this._cachedTileFogOpacities[e.key]=t=this.style.fog.getOpacityForTile(e)),t[0]>=Re||t[1]>=Re}setupDepthForOcclusion(e,t,i){const n=this.context,r=n.gl,s=!!i;var o;i||(i={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),n.activeTexture.set(r.TEXTURE3),e&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE),i.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],i.u_depth_range_unpack=[2/((o=this.depthRangeFor3D)[1]-o[0]),-1-2*o[0]/(o[1]-o[0])],i.u_occluder_half_size=.5*this.occlusionParams.occluderSize,i.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.emptyDepthTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE),n.activeTexture.set(r.TEXTURE0),s||t.setTerrainUniformValues(n,i)}}function va(e,t){let i=!1,n=null;const r=()=>{n=null,i&&(e(),n=setTimeout(r,t),i=!1)};return()=>(i=!0,n||r(),n)}class xa{constructor(t){this._hashName=t&&encodeURIComponent(t),e.aV(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=va(this._updateHashUnthrottled.bind(this),300)}addTo(e){return this._map=e,window.addEventListener("hashchange",this._onHashChange,!1),e.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const e=this._map;if(!e)return"";const t=ba(e);if(this._hashName){const e=this._hashName;let i=!1;const n=location.hash.slice(1).split("&").map(n=>{const r=n.split("=")[0];return r===e?(i=!0,`${r}=${t}`):n}).filter(e=>e);return i||n.push(`${e}=${t}`),`#${n.join("&")}`}return`#${t}`}_getCurrentHash(){const e=location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map(e=>e.split("=")).forEach(e=>{e[0]===this._hashName&&(t=e)}),(t&&t[1]||"").split("/")}return e.split("/")}_onHashChange(){const e=this._map;if(!e)return!1;const t=this._getCurrentHash();if(t.length>=3&&!t.some(e=>isNaN(Number(e)))){const i=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(t[3]||0):e.getBearing();return e.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:i,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(/(#.+)?$/,this.getHashString()))}}function ba(e,t){const i=e.getCenter(),n=Math.round(100*e.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),s=Math.pow(10,r),o=Math.round(i.lng*s)/s,a=Math.round(i.lat*s)/s,l=e.getBearing(),c=e.getPitch();let h=t?`/${o}/${a}/${n}`:`${n}/${a}/${o}`;return(l||c)&&(h+="/"+Math.round(10*l)/10),c&&(h+=`/${Math.round(c)}`),h}const wa={linearity:.3,easing:e.eI(0,0,.3,1)},Sa=e.h({deceleration:2500,maxSpeed:1400},wa),Ta=e.h({deceleration:20,maxSpeed:1400},wa),ka=e.h({deceleration:1e3,maxSpeed:360},wa),Ma=e.h({deceleration:1e3,maxSpeed:90},wa);class Aa{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.q.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,i=e.q.now();for(;t.length>0&&i-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)i.zoom+=e.zoomDelta||0,i.bearing+=e.bearingDelta||0,i.pitch+=e.pitchDelta||0,e.panDelta&&i.pan._add(e.panDelta),e.around&&(i.around=e.around),e.pinchAround&&(i.pinchAround=e.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(i.pan.mag()){const s=Da(i.pan.mag(),n,e.h({},Sa,t||{}));r.offset=i.pan.mult(s.amount/i.pan.mag()),r.center=this._map.transform.center,Ca(r,s)}if(i.zoom){const e=Da(i.zoom,n,Ta);r.zoom=this._map.transform.zoom+e.amount,Ca(r,e)}if(i.bearing){const t=Da(i.bearing,n,ka);r.bearing=this._map.transform.bearing+e.ay(t.amount,-179,179),Ca(r,t)}if(i.pitch){const e=Da(i.pitch,n,Ma);r.pitch=this._map.transform.pitch+e.amount,Ca(r,e)}if(r.zoom||r.bearing){const e=void 0===i.pinchAround?i.around:i.pinchAround;r.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),r.noMoveStart=!0,r}}function Ca(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Da(t,i,n){const{maxSpeed:r,linearity:s,deceleration:o}=n,a=e.ay(t*s/(i/1e3),-r,r),l=Math.abs(a)/(o*s);return{easing:n.easing,duration:1e3*l,amount:a*(l/2)}}class La extends e.A{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,n,r={}){const s=_(i.getCanvasContainer(),n),o=i.unproject(s);super(t,e.h({point:s,lngLat:o,originalEvent:n},r)),this._defaultPrevented=!1,this.target=i}}class Ea extends e.A{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,n){const r="touchend"===t?n.changedTouches:n.touches,s=y(i.getCanvasContainer(),r),o=s.map(e=>i.unproject(e)),a=s.reduce((e,t,i,n)=>e.add(t.div(n.length)),new e.P(0,0));super(t,{points:s,point:a,lngLats:o,lngLat:i.unproject(a),originalEvent:n}),this._defaultPrevented=!1}}class Ia extends e.A{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1}}class Pa{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._mousedownPos=void 0}wheel(e){return this._firePreventable(new Ia(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new La(e.type,this._map,e))}mouseup(e){this._map.fire(new La(e.type,this._map,e))}preclick(t){const i=e.h({},t);i.type="preclick",this._map.fire(new La(i.type,this._map,i))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||(this.preclick(e),this._map.fire(new La(e.type,this._map,e)))}dblclick(e){return this._firePreventable(new La(e.type,this._map,e))}mouseover(e){this._map.fire(new La(e.type,this._map,e))}mouseout(e){this._map.fire(new La(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Ea(e.type,this._map,e))}touchmove(e){this._map.fire(new Ea(e.type,this._map,e))}touchend(e){this._map.fire(new Ea(e.type,this._map,e))}touchcancel(e){this._map.fire(new Ea(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ra{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(e){this._map.fire(new La(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new La("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new La(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Oa{constructor(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(f(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const i=t,n=this._startPos,r=this._lastPos;if(!n||!r||r.equals(i)||!this._box&&i.dist(n)<this._clickTolerance)return;this._lastPos=i,this._box||(this._box=l("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));const s=Math.min(n.x,i.x),o=Math.max(n.x,i.x),a=Math.min(n.y,i.y),c=Math.max(n.y,i.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${s}px,${a}px)`,this._box.style.width=o-s+"px",this._box.style.height=c-a+"px")})}mouseupWindow(t,i){if(!this._active)return;const n=this._startPos,r=i;if(n&&0===t.button){if(this.reset(),g(),n.x!==r.x||n.y!==r.y)return this._map.fire(new e.A("boxzoomend",{originalEvent:t})),{cameraAnimation:e=>e.fitScreenCoordinates(n,r,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),p(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new e.A(t,{originalEvent:i}))}}function za(e,t){const i={};for(let n=0;n<e.length;n++)i[e[n].identifier]=t[n];return i}class Fa{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(t,i,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){const i=new e.P(0,0);for(const e of t)i._add(e);return i.div(t.length)}(i),this.touches=za(n,i)))}touchmove(e,t,i){if(this.aborted||!this.centroid)return;const n=za(i,t);for(const e in this.touches){const t=n[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,i){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class Na{constructor(e){this.singleTap=new Fa(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(e,t,i){this.singleTap.touchstart(e,t,i)}touchmove(e,t,i){this.singleTap.touchmove(e,t,i)}touchend(e,t,i){const n=this.singleTap.touchend(e,t,i);if(n){const t=e.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(n)<30;if(t&&i||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Ya{constructor(){this._zoomIn=new Na({numTouches:1,numTaps:2}),this._zoomOut=new Na({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,i){this._zoomIn.touchstart(e,t,i),this._zoomOut.touchstart(e,t,i)}touchmove(e,t,i){this._zoomIn.touchmove(e,t,i),this._zoomOut.touchmove(e,t,i)}touchend(e,t,i){const n=this._zoomIn.touchend(e,t,i),r=this._zoomOut.touchend(e,t,i);return n?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(n)},{originalEvent:e})}):r?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(r)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Ba={0:1,2:2},Ha={Control:"ctrlKey",Alt:"altKey",Shift:"shiftKey",Meta:"metaKey"};class ja{constructor(e){this.reset(),this._clickTolerance=e.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(e,t){return!1}_move(e,t){return{}}mousedown(e,t){if(this._lastPoint)return;const i=v(e);this._correctButton(e,i)&&(this._lastPoint=t,this._eventButton=i)}mousemoveWindow(e,t){const i=this._lastPoint;if(i)if(e.preventDefault(),null!=this._eventButton&&function(e,t){const i=Ba[t];return void 0===e.buttons||(e.buttons&i)!==i}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(i,t)}mouseupWindow(e){this._lastPoint&&v(e)===this._eventButton&&(this._moved&&g(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Va extends ja{mousedown(e,t){super.mousedown(e,t),this._lastPoint&&(this._active=!0)}_correctButton(e,t){return 0===t&&!e.ctrlKey}_move(e,t){return{around:t,panDelta:t.sub(e)}}}class Wa extends ja{constructor(e){super(e),this._pitchRotateKey=e.pitchRotateKey?Ha[e.pitchRotateKey]:void 0}_correctButton(e,t){return this._pitchRotateKey?0===t&&e[this._pitchRotateKey]:0===t&&e.ctrlKey||2===t}_move(e,t){const i=.8*(t.x-e.x);if(i)return this._active=!0,{bearingDelta:i}}contextmenu(e){this._pitchRotateKey||e.preventDefault()}}class Ua extends ja{constructor(e){super(e),this._pitchRotateKey=e.pitchRotateKey?Ha[e.pitchRotateKey]:void 0}_correctButton(e,t){return this._pitchRotateKey?0===t&&e[this._pitchRotateKey]:0===t&&e.ctrlKey||2===t}_move(e,t){const i=-.5*(t.y-e.y);if(i)return this._active=!0,{pitchDelta:i}}contextmenu(e){this._pitchRotateKey||e.preventDefault()}}class $a{constructor(t,i){this._map=t,this._el=t.getCanvasContainer(),this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset(),e.aV(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}touchstart(e,t,i){return this._calculateTransform(e,t,i)}touchmove(t,i,n){if(this._active&&!(n.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===n.length&&!e.eJ())return void this._showTouchPanBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return t.cancelable&&t.preventDefault(),this._calculateTransform(t,i,n)}}touchend(e,t,i){this._calculateTransform(e,t,i),this._active&&i.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,n){n.length>0&&(this._active=!0);const r=za(n,i),s=new e.P(0,0),o=new e.P(0,0);let a=0;for(const e in r){const t=r[e],i=this._touches[e];i&&(s._add(t),o._add(t.sub(i)),a++,r[e]=t)}if(this._touches=r,a<this._minTouches||!o.mag())return;const l=o.div(a);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:s.div(a),panDelta:l}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=l("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")},500)}}class Ga{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(e){}_move(e,t,i){return{}}touchstart(e,t,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,i){const n=this._firstTwoTouches;if(!n)return;e.preventDefault();const[r,s]=n,o=Xa(i,t,r),a=Xa(i,t,s);if(!o||!a)return;const l=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],l,e)}touchend(e,t,i){if(!this._firstTwoTouches)return;const[n,r]=this._firstTwoTouches,s=Xa(i,t,n),o=Xa(i,t,r);s&&o||(this._active&&g(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Xa(e,t,i){for(let n=0;n<e.length;n++)if(e[n].identifier===i)return t[n]}function qa(e,t){return Math.log(e/t)/Math.LN2}class Za extends Ga{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){const i=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(qa(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:qa(this._distance,i),pinchAround:t}}}function Ja(e,t){return 180*e.angleWith(t)/Math.PI}class Ka extends Ga{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t){const i=this._vector;if(this._vector=e[0].sub(e[1]),i&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:Ja(this._vector,i),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,i=this._startVector;if(!i)return!1;const n=Ja(e,i);return Math.abs(n)<t}}function Qa(e){return Math.abs(e.y)>Math.abs(e.x)}class el extends Ga{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(e){this._lastPoints=e,Qa(e[0].sub(e[1]))&&(this._valid=!1)}_move(t,i,n){const r=this._lastPoints;if(!r)return;const s=t[0].sub(r[0]),o=t[1].sub(r[1]);return this._map._cooperativeGestures&&!e.eJ()&&n.touches.length<3||(this._valid=this.gestureBeginsVertically(s,o,n.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(s.y+o.y)/2*-.5})}gestureBeginsVertically(e,t,i){if(void 0!==this._valid)return this._valid;const n=e.mag()>=2,r=t.mag()>=2;if(!n&&!r)return;if(!n||!r)return null==this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const s=e.y>0==t.y>0;return Qa(e)&&Qa(t)&&s}}const tl={panStep:100,bearingStep:15,pitchStep:10};class il{constructor(){const e=tl;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,i=0,n=0,r=0,s=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?i=-1:(e.preventDefault(),r=-1);break;case 39:e.shiftKey?i=1:(e.preventDefault(),r=1);break;case 38:e.shiftKey?n=1:(e.preventDefault(),s=-1);break;case 40:e.shiftKey?n=-1:(e.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(i=0,n=0),{cameraAnimation:o=>{const a=o.getZoom();o.easeTo({duration:300,easeId:"keyboardHandler",easing:nl,zoom:t?Math.round(a)+t*(e.shiftKey?2:1):a,bearing:o.getBearing()+i*this._bearingStep,pitch:o.getPitch()+n*this._pitchStep,offset:[-r*this._panStep,-s*this._panStep],center:o.getCenter()},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function nl(e){return e*(2-e)}const rl=4.000244140625,sl=1/450;class ol{constructor(t,i){this._map=t,this._el=t.getCanvasContainer(),this._handler=i,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=sl,e.aV(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||e.eJ()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let i=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const n=e.q.now(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==i&&i%rl==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=i,this._timeout=window.setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),t.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=t,this._delta-=i,this._active||this._start(t)),t.preventDefault()}_onTimeout(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const t=_(this._el,e);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:t,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._map.transform;"wheel"===this._type&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const i=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>rl?this._wheelZoomRate:this._defaultZoomRate;let n=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==n&&(n=1/n);const r=i(),s=Math.pow(2,r),o="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):s;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(o*n))),"wheel"===this._type&&(this._startZoom=r,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const n="number"==typeof this._targetZoom?this._targetZoom:i(),r=this._startZoom,s=this._easing;let o,a=!1;if("wheel"===this._type&&r&&s){const t=Math.min((e.q.now()-this._lastWheelEventTime)/200,1),i=s(t);o=e.ai(r,n,i),t<1?this._frameId||(this._frameId=!0):a=!0}else o=n,a=!0;this._active=!0,a&&(this._active=!1,this._finishTimeout=window.setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200));let l=o-i();return l*this._lastDelta<0&&(l=0),{noInertia:!0,needsRenderFrame:!a,zoomDelta:l,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.eK;if(this._prevEase){const t=this._prevEase,n=(e.q.now()-t.start)/t.duration,r=t.easing(n+.01)-t.easing(n),s=.27/Math.sqrt(r*r+1e-4)*.01,o=Math.sqrt(.0729-s*s);i=e.eI(s,o,.25,1)}return this._prevEase={start:e.q.now(),duration:t,easing:i},i}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=l("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")},200)}}class al{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class ll{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(e,t){return e.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:i.getZoom()+(e.shiftKey?-1:1),around:i.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class cl{constructor(){this._tap=new Na({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(e,t,i){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=t[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(e,t,i))}touchmove(e,t,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const n=t[0],r=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(e,t,i)}touchend(e,t,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(e,t,i)&&(this._tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hl{constructor(e,t,i){this._el=e,this._mousePan=t,this._touchPan=i}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class dl{constructor(e,t,i){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class ul{constructor(e,t,i,n){this._el=e,this._touchZoom=t,this._touchRotate=i,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const fl=e=>e.zoom||e.drag||e.pitch||e.rotate;class pl extends e.A{}class ml{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,i){const n=e.at([],i,t);this.radius=e.ae(n[2]<0?e.eM([],n,this.constants):[n[0],n[1],0])}projectRay(t){e.eM(t,t,this.constants),e.au(t,t),e.eN(t,t,this.constants);const i=e.c1([],t,this.radius);if(i[2]>0){const t=e.c1([],[0,0,1],e.bG(i,[0,0,1])),n=e.c1([],e.au([],[i[0],i[1],0]),this.radius),r=e.d5([],i,e.c1([],e.at([],e.d5([],n,t),i),2));i[0]=r[0],i[1]=r[1]}return i}}function gl(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class _l{constructor(t,i){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Aa(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new ml,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(i),e.aV(["handleEvent","handleWindowEvent"],this);const n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[window,"blur",void 0]];for(const[e,t,i]of this._listeners){const n=e===document?this.handleWindowEvent:this.handleEvent;e.addEventListener(t,n,i)}}destroy(){for(const[e,t,i]of this._listeners){const n=e===document?this.handleWindowEvent:this.handleEvent;e.removeEventListener(t,n,i)}}_addDefaultHandlers(e){const t=this._map,i=t.getCanvasContainer();this._add("mapEvent",new Pa(t,e));const n=t.boxZoom=new Oa(t,e);this._add("boxZoom",n);const r=new Ya,s=new ll;t.doubleClickZoom=new al(s,r),this._add("tapZoom",r),this._add("clickZoom",s);const o=new cl;this._add("tapDragZoom",o);const a=t.touchPitch=new el(t);this._add("touchPitch",a);const l=new Wa(e),c=new Ua(e);t.dragRotate=new dl(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const h=new Va(e),d=new $a(t,e);t.dragPan=new hl(i,h,d),this._add("mousePan",h),this._add("touchPan",d,["touchZoom","touchRotate"]);const u=new Ka,f=new Za;t.touchZoomRotate=new ul(i,f,u,o),this._add("touchRotate",u,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Ra(t));const p=t.scrollZoom=new ol(t,this);this._add("scrollZoom",p,["mousePan"]);const m=t.keyboard=new il;this._add("keyboard",m);for(const i of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[i]&&t[i].enable(e[i])}_add(e,t,i){this._handlers.push({handlerName:e,handler:t,allowed:i}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!fl(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(e,t,i){for(const n in e)if(n!==i&&(!t||t.indexOf(n)<0))return!0;return!1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`)}_getMapTouches(e){const t=[];for(const i of e)this._el.contains(i.target)&&t.push(i);return t}handleEvent(e,t){this._updatingCamera=!0;const i="renderFrame"===e.type,n=i?void 0:e,r={needsRenderFrame:!1},s={},o={},a=e.touches?this._getMapTouches(e.touches):void 0,l=a?y(this._el,a):i?void 0:_(this._el,e);for(const{handlerName:i,handler:c,allowed:h}of this._handlers){if(!c.isEnabled())continue;let d;this._blockedByActive(o,h,i)?c.reset():c[t||e.type]&&(d=c[t||e.type](e,l,a),this.mergeHandlerResult(r,s,d,i,n),d&&d.needsRenderFrame&&this._triggerRenderFrame()),(d||c.isActive())&&(o[i]=c)}const c={};for(const e in this._previousActiveHandlers)o[e]||(c[e]=n);this._previousActiveHandlers=o,(Object.keys(c).length||gl(r))&&(this._changes.push([r,s,c]),this._triggerRenderFrame()),(Object.keys(o).length||gl(r))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=r;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))}mergeHandlerResult(t,i,n,r,s){if(!n)return;e.h(t,n);const o={handlerName:r,originalEvent:n.originalEvent||s};void 0!==n.zoomDelta&&(i.zoom=o),void 0!==n.panDelta&&(i.drag=o),void 0!==n.pitchDelta&&(i.pitch=o),void 0!==n.bearingDelta&&(i.rotate=o)}_applyChanges(){const t={},i={},n={};for(const[r,s,o]of this._changes)r.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(r.panDelta)),r.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+r.pitchDelta),void 0!==r.around&&(t.around=r.around),void 0!==r.aroundCoord&&(t.aroundCoord=r.aroundCoord),void 0!==r.pinchAround&&(t.pinchAround=r.pinchAround),r.noInertia&&(t.noInertia=r.noInertia),e.h(i,s),e.h(n,o);this._updateMapTransform(t,i,n),this._changes=[]}_updateMapTransform(t,i,n){const r=this._map,s=r.transform,o=e=>[e.x,e.y,e.z];if((()=>{const e=this._eventsInProgress.drag;return e&&!this._handlersById[e.handlerName].isActive()})()&&!gl(t)){const e=s.zoom;s.cameraElevationReference="sea",null!=this._originalZoom&&s._orthographicProjectionAtLowPitch&&"globe"!==s.projection.name&&0===s.pitch?(s.cameraElevationReference="ground",s.zoom=this._originalZoom):(s.recenterOnTerrain(),s.cameraElevationReference="ground"),e!==s.zoom&&this._map._update(!0)}if(s._isCameraConstrained&&r._stop(!0),!gl(t))return void this._fireEvents(i,n,!0);let{panDelta:a,zoomDelta:l,bearingDelta:c,pitchDelta:h,around:d,aroundCoord:u,pinchAround:f}=t;s._isCameraConstrained&&(l>0&&(l=0),s._isCameraConstrained=!1),void 0!==f&&(d=f),(l||(e=>i[e]&&!this._eventsInProgress[e])("drag"))&&d&&(this._dragOrigin=o(s.pointCoordinate3D(d)),this._originalZoom=s.zoom,this._trackingEllipsoid.setup(s._camera.position,this._dragOrigin)),s.cameraElevationReference="sea",r._stop(!0),d=d||r.transform.centerPoint,c&&(s.bearing+=c),h&&(s.pitch+=h),s._updateCameraState();const p=[0,0,0];if(a)if("mercator"===s.projection.name){const e=this._trackingEllipsoid.projectRay(s.screenPointToMercatorRay(d).dir),t=this._trackingEllipsoid.projectRay(s.screenPointToMercatorRay(d.sub(a)).dir);p[0]=t[0]-e[0],p[1]=t[1]-e[1]}else{const t=s.pointCoordinate(d);if("globe"===s.projection.name){a=a.rotate(-s.angle);const i=s._pixelsPerMercatorPixel/s.worldSize;p[0]=-a.x*e.eL(e.aY(t.y))*i,p[1]=-a.y*e.eL(s.center.lat)*i}else{const e=s.pointCoordinate(d.sub(a));t&&e&&(p[0]=e.x-t.x,p[1]=e.y-t.y)}}const m=s.zoom,g=[0,0,0];if(l){const t=o(u||s.pointCoordinate3D(d)),i={dir:e.au([],e.at([],t,s._camera.position))};if(i.dir[2]<0){const n=s.zoomDeltaToMovement(t,l);e.c1(g,i.dir,n)}}const _=e.d5(p,p,g);s._translateCameraConstrained(_),l&&Math.abs(s.zoom-m)>1e-4&&s.recenterOnTerrain(),s.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(i,n,!0)}_fireEvents(t,i,n){const r=fl(this._eventsInProgress),s=fl(t),o={};for(const e in t){const{originalEvent:i}=t[e];this._eventsInProgress[e]||(o[`${e}start`]=i),this._eventsInProgress[e]=t[e]}!r&&s&&this._fireEvent("movestart",s.originalEvent);for(const e in o)this._fireEvent(e,o[e]);s&&this._fireEvent("move",s.originalEvent);for(const e in t){const{originalEvent:i}=t[e];this._fireEvent(e,i)}const a={};let l;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:n}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=i[t]||n,a[`${e}end`]=l)}for(const e in a)this._fireEvent(e,a[e]);const c=fl(this._eventsInProgress);if(n&&(r||s)&&!c){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;t?(i(t.bearing||this._map.getBearing())&&(t.bearing=0),this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new e.A("moveend",{originalEvent:l})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new e.A(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{this._frameId=void 0,this.handleEvent(new pl("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const yl="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class vl extends e.E{constructor(t,i){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=i.bearingSnap,this._respectPrefersReducedMotion=!1!==i.respectPrefersReducedMotion,e.aV(["_renderFrameCallback"],this)}getCenter(){return new e.ci(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,i,n){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.h({offset:t},i),n)}panTo(t,i,n){return this.easeTo(e.h({center:t},i),n)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(t,i,n){return this.easeTo(e.h({zoom:t},i),n)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(t,i,n){return this.easeTo(e.h({bearing:t},i),n)}resetNorth(t,i){return this.rotateTo(0,e.h({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(e.h({bearing:0,pitch:0,duration:1e3},t),i),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(t,i){t=e.aG.convert(t);const n=i&&i.bearing||0,r=i&&i.pitch||0,s=t.getNorthWest(),o=t.getSouthEast();return this._cameraForBounds(this.transform,s,o,n,r,i)}_extendPadding(t){const i={top:0,right:0,bottom:0,left:0};return null==t?e.h({},i,this.transform.padding):"number"==typeof t?{top:t,bottom:t,right:t,left:t}:e.h({},i,t)}_extendCameraOptions(t){return(t=e.h({offset:[0,0],maxZoom:this.transform.maxZoom},t)).padding=this._extendPadding(t.padding),t}_minimumAABBFrustumDistance(e,t){const i=t.max[0]-t.min[0],n=t.max[1]-t.min[1];return i/n>e.aspect?i/(2*Math.tan(.5*e.fovX)*e.aspect):n/(2*Math.tan(.5*e.fovY)*e.aspect)}_cameraForBoundsOnGlobe(t,i,n,r,s,o){const a=t.clone(),l=this._extendCameraOptions(o);a.bearing=r,a.pitch=s;const c=e.ci.convert(i),h=e.ci.convert(n),d=.5*(c.lat+h.lat),u=.5*(c.lng+h.lng),f=e.eO(d,u),p=e.au([],f),m=e.au([],e.bF([],p,[0,1,0])),g=e.bF([],m,p),_=[m[0],m[1],m[2],0,g[0],g[1],g[2],0,p[0],p[1],p[2],0,0,0,0,1],y=[f,e.eO(c.lat,c.lng),e.eO(h.lat,c.lng),e.eO(h.lat,h.lng),e.eO(c.lat,h.lng),e.eO(d,c.lng),e.eO(d,h.lng),e.eO(c.lat,u),e.eO(h.lat,u)];let v=e.d6.fromPoints(y.map(t=>[e.bG(m,t),e.bG(g,t),e.bG(p,t)]));const x=e.ad([],v.center,_);0===e.eP(x)&&e.eQ(x,0,0,1),e.au(x,x),e.c1(x,x,e.aB),a.center=e.eR(x);const b=a.getWorldToCameraMatrix(),w=e.bi(new Float64Array(16),b);v=e.d6.applyTransform(v,e.az([],b,_));const S=this._extendAABB(v,a,l,r);if(!S)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");v=S,e.ad(x,x,b);const T=.5*(v.max[2]-v.min[2]),k=this._minimumAABBFrustumDistance(a,v),M=e.c1([],[0,0,1],T),A=e.d5(M,x,M),C=k+(0===a.pitch?0:e.bD(x,A)),D=a.globeCenterInViewSpace,L=e.at([],x,[D[0],D[1],D[2]]);e.au(L,L),e.c1(L,L,C);const E=e.d5([],x,L);e.ad(E,E,w);const I=e.eB/e.aB,P=e.ae(E),R=e.cb(Math.max(P*I-e.eB,Number.EPSILON),0),O=Math.min(a.zoomFromMercatorZAdjusted(R),l.maxZoom);return O>.5*(e.cX+e.cI)?(a.setProjection({name:"mercator"}),a.zoom=O,this._cameraForBounds(a,i,n,r,s,o)):{center:a.center,zoom:O,bearing:r,pitch:s}}_extendAABB(t,i,n,r){const s=.5*((n.padding.left||0)+(n.padding.right||0)),o=.5*((n.padding.top||0)+(n.padding.bottom||0)),a=o,l=s,c=s,h=o,d=i.width-(l+c),u=i.height-(a+h),f=e.at([],t.max,t.min),p=Math.min(d/f[0],u/f[1]),m=Math.min(i.scaleZoom(i.scale*p),n.maxZoom);if(isNaN(m))return null;const g=i.scale/i.zoomScale(m),_=new e.d6([t.min[0]-l*g,t.min[1]-h*g,t.min[2]],[t.max[0]+c*g,t.max[1]+a*g,t.max[2]]),y=("number"==typeof n.offset.x&&"number"==typeof n.offset.y?new e.P(n.offset.x,n.offset.y):e.P.convert(n.offset)).rotate(-e.al(r));return _.center[0]-=y.x*g,_.center[1]+=y.y*g,_}queryTerrainElevation(t,i){const n=this.transform.elevation;return n?(i=e.h({},{exaggerated:!0},i),n.getAtPoint(e.ac.fromLngLat(t),null,i.exaggerated)):null}_cameraForBounds(t,i,n,r,s,o){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,i,n,r,s,o);const a=t.clone(),l=this._extendCameraOptions(o);a.bearing=r,a.pitch=s;const c=e.ci.convert(i),h=e.ci.convert(n),d=new e.ci(c.lng,h.lat),u=new e.ci(h.lng,c.lat),f=a.project(c),p=a.project(h),m=this.queryTerrainElevation(c),g=this.queryTerrainElevation(h),_=this.queryTerrainElevation(d),y=this.queryTerrainElevation(u),v=[[f.x,f.y,Math.min(m||0,g||0,_||0,y||0)],[p.x,p.y,Math.max(m||0,g||0,_||0,y||0)]];let x=e.d6.fromPoints(v);const b=a.getWorldToCameraMatrix(),w=e.bi(new Float64Array(16),b);x=e.d6.applyTransform(x,b);const S=this._extendAABB(x,a,l,r);if(!S)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");x=S;const T=.5*e.at([],x.max,x.min)[2],k=this._minimumAABBFrustumDistance(a,x),M=[0,0,1,0];e.aA(M,M,b),e.eS(M,M);const A=e.c1([],M,k+T),C=e.d5([],x.center,A);e.ad(x.center,x.center,w),e.ad(C,C,w);const D=a.unproject(new e.P(x.center[0],x.center[1])),L=e.eT(a.projection,D),E=Math.pow(2,L),I=Math.min(a._zoomFromMercatorZ(C[2]*a.pixelsPerMeter*E/a.worldSize),l.maxZoom);return a.mercatorFromTransition&&I<.5*(e.cX+e.cI)?(a.setProjection({name:"globe"}),a.zoom=I,this._cameraForBounds(a,i,n,r,s,o)):{center:D,zoom:I,bearing:r,pitch:s}}fitBounds(e,t,i){const n=this.cameraForBounds(e,t);return this._fitInternal(n,t,i)}fitScreenCoordinates(t,i,n,r,s){const o=e.P.convert(t),a=e.P.convert(i),l=new e.P(Math.min(o.x,a.x),Math.min(o.y,a.y)),c=new e.P(Math.max(o.x,a.x),Math.max(o.y,a.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(o,a))return this;const h=this.transform.pointLocation3D(l),d=this.transform.pointLocation3D(c),u=this.transform.pointLocation3D(new e.P(l.x,c.y)),f=this.transform.pointLocation3D(new e.P(c.x,l.y)),p=[Math.min(h.lng,d.lng,u.lng,f.lng),Math.min(h.lat,d.lat,u.lat,f.lat)],m=[Math.max(h.lng,d.lng,u.lng,f.lng),Math.max(h.lat,d.lat,u.lat,f.lat)],g=r&&r.pitch?r.pitch:this.getPitch(),_=this._cameraForBounds(this.transform,p,m,n,g,r);return this._fitInternal(_,r,s)}_fitInternal(t,i,n){return t?(i=e.h(t,i)).linear?this.easeTo(i,n):this.flyTo(i,n):this}jumpTo(t,i){this.stop();const n=t.preloadOnly?this.transform.clone():this.transform;let r=!1,s=!1,o=!1;"zoom"in t&&n.zoom!==+t.zoom&&(r=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.ci.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(s=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(o=!0,n.pitch=+t.pitch);const a="number"==typeof t.padding?this._extendPadding(t.padding):t.padding;if(null!=t.padding&&!n.isPaddingEqual(a))if(!1===t.retainPadding){const e=n.clone();e.padding=a,n.setLocationAtPoint(n.center,e.centerPoint)}else n.padding=a;return t.preloadOnly?(this._preloadTiles(n),this):(this.fire(new e.A("movestart",i)).fire(new e.A("move",i)),r&&this.fire(new e.A("zoomstart",i)).fire(new e.A("zoom",i)).fire(new e.A("zoomend",i)),s&&this.fire(new e.A("rotatestart",i)).fire(new e.A("rotate",i)).fire(new e.A("rotateend",i)),o&&this.fire(new e.A("pitchstart",i)).fire(new e.A("pitch",i)).fire(new e.A("pitchend",i)),this.fire(new e.A("moveend",i)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||e.w(yl),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,i){const n=this.transform;if(!n.projection.supportsFreeCamera)return e.w(yl),this;this.stop();const r=n.zoom,s=n.pitch,o=n.bearing;n.setFreeCameraOptions(t);const a=r!==n.zoom,l=s!==n.pitch,c=o!==n.bearing;return this.fire(new e.A("movestart",i)).fire(new e.A("move",i)),a&&this.fire(new e.A("zoomstart",i)).fire(new e.A("zoom",i)).fire(new e.A("zoomend",i)),c&&this.fire(new e.A("rotatestart",i)).fire(new e.A("rotate",i)).fire(new e.A("rotateend",i)),l&&this.fire(new e.A("pitchstart",i)).fire(new e.A("pitch",i)).fire(new e.A("pitchend",i)),this.fire(new e.A("moveend",i)),this}easeTo(t,i){this._stop(!1,t.easeId),(!1===(t=e.h({offset:[0,0],duration:500,easing:e.eK},t)).animate||this._prefersReducedMotion(t))&&(t.duration=0);const n=this.transform,r=this.getZoom(),s=this.getBearing(),o=this.getPitch(),a=this.getPadding(),l="zoom"in t?+t.zoom:r,c="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:o,d=this._extendPadding(t.padding),u=e.P.convert(t.offset);let f,p,m;if("globe"===n.projection.name){const i=e.ac.fromLngLat(n.center),r=u.rotate(-n.angle);i.x+=r.x/n.worldSize,i.y+=r.y/n.worldSize;const s=i.toLngLat(),o=e.ci.convert(t.center||s);this._normalizeCenter(o),f=n.centerPoint.add(r),p=new e.P(i.x,i.y).mult(n.worldSize),m=new e.P(e.aD(o.lng),e.aH(o.lat)).mult(n.worldSize).sub(p)}else{f=n.centerPoint.add(u);const i=n.pointLocation(f),r=e.ci.convert(t.center||i);this._normalizeCenter(r),p=n.project(i),m=n.project(r).sub(p)}const g=n.zoomScale(l-r);let _,y;t.around&&(_=e.ci.convert(t.around),y=n.locationPoint(_));const v=this._zooming||l!==r,x=this._rotating||s!==c,b=this._pitching||h!==o,w=!n.isPaddingEqual(d),S=!1===t.retainPadding?n.clone():n,T=n=>T=>{if(v&&(n.zoom=e.ai(r,l,T)),x&&(n.bearing=e.ai(s,c,T)),b&&(n.pitch=e.ai(o,h,T)),w&&(S.interpolatePadding(a,d,T),f=S.centerPoint.add(u)),_)n.setLocationAtPoint(_,y);else{const e=n.zoomScale(n.zoom-r),t=l>r?Math.min(2,g):Math.max(.5,g),i=Math.pow(t,1-T),s=n.unproject(p.add(m.mult(T*i)).mult(e));n.setLocationAtPoint(n.renderWorldCopies?s.wrap():s,f)}return t.preloadOnly||this._fireMoveEvents(i),n};if(t.preloadOnly){const e=this._emulate(T,t.duration,n);return this._preloadTiles(e),this}const k={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=v,this._rotating=x,this._pitching=b,this._padding=w,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,k),this._ease(T(n),e=>{"sea"===n.cameraElevationReference&&n.recenterOnTerrain(),this._afterEase(i,e)},t),this}_prepareEase(t,i,n={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),i||n.moving||this.fire(new e.A("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.A("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.A("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.A("pitchstart",t))}_fireMoveEvents(t){this.fire(new e.A("move",t)),this._zooming&&this.fire(new e.A("zoom",t)),this._rotating&&this.fire(new e.A("rotate",t)),this._pitching&&this.fire(new e.A("pitch",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const n=this._zooming,r=this._rotating,s=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.A("zoomend",t)),r&&this.fire(new e.A("rotateend",t)),s&&this.fire(new e.A("pitchend",t)),this.fire(new e.A("moveend",t))}flyTo(t,i){if(this._prefersReducedMotion(t)){const n=e.aF(t,["center","zoom","bearing","pitch","around","padding","retainPadding"]);return this.jumpTo(n,i)}this.stop(),t=e.h({offset:[0,0],speed:1.2,curve:1.42,easing:e.eK},t);const n=this.transform,r=this.getZoom(),s=this.getBearing(),o=this.getPitch(),a=this.getPadding(),l="zoom"in t?e.ay(+t.zoom,n.minZoom,n.maxZoom):r,c="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:o,d=this._extendPadding(t.padding),u=n.zoomScale(l-r),f=e.P.convert(t.offset);let p=n.centerPoint.add(f);const m=n.pointLocation(p),g=e.ci.convert(t.center||m);this._normalizeCenter(g);const _=n.project(m),y=n.project(g).sub(_);let v=t.curve;const x=Math.max(n.width,n.height),b=x/u,w=y.mag();if("minZoom"in t){const i=e.ay(Math.min(t.minZoom,r,l),n.minZoom,n.maxZoom),s=x/n.zoomScale(i-r);v=Math.sqrt(s/w*2)}const S=v*v;function T(e){const t=(b*b-x*x+(e?-1:1)*S*S*w*w)/(2*(e?b:x)*S*w);return Math.log(Math.sqrt(t*t+1)-t)}function k(e){return(Math.exp(e)-Math.exp(-e))/2}function M(e){return(Math.exp(e)+Math.exp(-e))/2}const A=T(0);let C=function(e){return M(A)/M(A+v*e)},D=function(e){return x*((M(A)*(k(t=A+v*e)/M(t))-k(A))/S)/w;var t},L=(T(1)-A)/v;if(Math.abs(w)<1e-6||!isFinite(L)){if(Math.abs(x-b)<1e-6)return this.easeTo(t,i);const e=b<x?-1:1;L=Math.abs(Math.log(b/x))/v,D=function(){return 0},C=function(t){return Math.exp(e*v*t)}}t.duration="duration"in t?+t.duration:1e3*L/("screenSpeed"in t?+t.screenSpeed/v:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0);const E=s!==c,I=h!==o,P=!n.isPaddingEqual(d),R=!1===t.retainPadding?n.clone():n,O=n=>u=>{const m=u*L,v=1/C(m);n.zoom=1===u?l:r+n.scaleZoom(v),E&&(n.bearing=e.ai(s,c,u)),I&&(n.pitch=e.ai(o,h,u)),P&&(R.interpolatePadding(a,d,u),p=R.centerPoint.add(f));const x=1===u?g:n.unproject(_.add(y.mult(D(m))).mult(v));return n.setLocationAtPoint(n.renderWorldCopies?x.wrap():x,p),n._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(i),n};if(t.preloadOnly){const e=this._emulate(O,t.duration,n);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=E,this._pitching=I,this._padding=P,this._prepareEase(i,!1),this._ease(O(n),()=>this._afterEase(i),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(e){}_cancelRenderFrame(e){}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const e=this._onEaseEnd;this._onEaseEnd=void 0,e.call(this,t)}if(!e){const e=this.handlers;e&&e.stop(!1)}return this}_ease(t,i,n){!1===n.animate||0===n.duration?(t(1),i()):(this._easeStart=e.q.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((e.q.now()-this._easeStart)/this._easeOptions.duration,1),i=this._onEaseFrame;i&&i(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,i){t=e.bQ(t,-180,180);const n=Math.abs(t-i);return Math.abs(t-360-i)<n&&(t-=360),Math.abs(t+360-i)<n&&(t+=360),t}_normalizeCenter(e){const t=this.transform;if(t.maxBounds)return;if("globe"!==t.projection.name&&!t.renderWorldCopies)return;const i=e.lng-t.center.lng;e.lng+=i>180?-360:i<-180?360:0}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&e.q.prefersReducedMotion&&!(t&&t.essential)}_emulate(e,t,i){const n=Math.ceil(15*t/1e3),r=[],s=e(i.clone());for(let e=0;e<=n;e++){const t=s(e/n);r.push(t.clone())}return r}_preloadTiles(e,t){}}class xl{constructor(t={}){this.options=t,e.aV(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(e){const t=this.options&&this.options.compact,i=e._getUIString("AttributionControl.ToggleAttribution");this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=l("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",i);const n=l("span","mapboxgl-ctrl-icon",this._compactButton);return n.setAttribute("aria-hidden","true"),n.setAttribute("title",i),this._innerContainer=l("div","mapboxgl-ctrl-attrib-inner",this._container),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));const i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.e.ACCESS_TOKEN}];if(t){const n=i.reduce((e,t,n)=>(t.value&&(e+=`${t.key}=${t.value}${n<i.length-1?"&":""}`),e),"?");t.href=`${e.e.FEEDBACK_URL}/${n}#${ba(this._map,!0)}`,t.rel="noopener nofollow"}}_updateData(e){!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let e=[];if(this._map.style.stylesheet){const e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}const t=this._map.style._mergedSourceCaches;for(const i in t){const n=t[i];if(n.used){const t=n.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e.sort((e,t)=>e.length-t.length),e=e.filter((t,i)=>{for(let n=i+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=[...this.options.customAttribution,...e]:e.unshift(this.options.customAttribution));const i=e.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,e.length?(this._innerContainer.innerHTML=i,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class bl{constructor(){e.aV(["_updateLogo","_updateCompact"],this)}onAdd(e){this._map=e,this._container=l("div","mapboxgl-ctrl");const t=l("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const e=this._map.style._sourceCaches;if(0===Object.entries(e).length)return!0;for(const t in e){const i=e[t].getSource();if(i.hasOwnProperty("mapbox_logo")&&!i.mapbox_logo)return!1}return!0}_updateCompact(){const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}}}class wl{constructor(){e.aV(["_onIndoorUpdate"],this)}onAdd(e){return this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._map.indoor.on("indoorupdate",e=>this._onIndoorUpdate({selectedFloorId:e.selectedFloorId,floors:e.floors})),this._container}_createButton(e,t){const i=l("button",e,this._container);return i.type="button",i.addEventListener("click",t),i}_setButtonTitle(e,t){this._map&&(e.setAttribute("aria-label",t),e.innerHTML=`<strong>${t}</strong>`,e.firstElementChild&&e.firstElementChild.setAttribute("title",t))}onRemove(){this._container&&this._container.remove(),this._map&&this._map.indoor&&(this._map.indoor.off("indoorupdate",this._onIndoorUpdate),this._map=null)}getDefaultPosition(){return"right"}_onIndoorUpdate(e){if(!e||!e.floors)return void(this._container.style.display="none");const t=this._model;this._model=e,this._container.style.display="inline-block";const i=e.floors.sort((e,t)=>e.levelOrder-t.levelOrder);t?(Array.from(this._container.children).forEach(e=>e.remove()),this.addCurrentFloors(i)):this.addCurrentFloors(i)}addCurrentFloors(e){for(const t of e){const e=this._createButton("mapboxgl-ctrl-level-button",()=>{this._map._selectIndoorFloor(t.id),Array.from(this._container.children).forEach(e=>{e.classList.remove("mapboxgl-ctrl-level-button-selected")}),e.classList.add("mapboxgl-ctrl-level-button-selected")});this._setButtonTitle(e,t.shortName),this._model&&t.id===this._model.selectedFloorId&&(this._map._selectIndoorFloor(t.id),e.classList.add("mapboxgl-ctrl-level-button-selected")),this._container.append(e)}}}class Sl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,i=t?this._queue.concat(t):this._queue;for(const t of i)if(t.id===e)return void(t.cancelled=!0)}run(e=0){const t=this._currentlyRunning=this._queue;this._queue=[];for(const i of t)if(!i.cancelled&&(i.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}class Tl{constructor(e){this.jumpTo(e)}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const i=e.dx((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-i)+this._end*i}isEasing(e){return e>=this._startTime&&e<=this._endTime}jumpTo(e){this._startTime=-1/0,this._endTime=-1/0,this._start=e,this._end=e}easeTo(e,t,i){this._start=this.getValue(t),this._end=e,this._startTime=t,this._endTime=t+i}}const kl={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class Ml extends e.A{constructor(e,t,i,n){const{point:r,lngLat:s,originalEvent:o,target:a}=e;super(e.type,{point:r,lngLat:s,originalEvent:o,target:a}),this.preventDefault=()=>{e.preventDefault()},this.id=t,this.interaction=i,this.feature=n}}class Al{constructor(e){this.map=e,this.interactionsByType=new Map,this.delegatedInteractions=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this),this.handleMove=this.handleMove.bind(this),this.handleOut=this.handleOut.bind(this),this.hoveredFeatures=new Map,this.prevHoveredFeatures=new Map}add(t,i){if(this.typeById.has(t))throw new Error(`Interaction id "${t}" already exists.`);const n=i.filter;let r=i.type;n&&this.filters.set(t,e.b3(n)),"mouseover"===r&&(r="mouseenter"),"mouseout"===r&&(r="mouseleave");const s=this.interactionsByType.get(r)||new Map;"mouseenter"===r||"mouseleave"===r?(0===this.delegatedInteractions.size&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(t,i)):0===s.size&&this.map.on(r,this.handleType),0===s.size&&this.interactionsByType.set(r,s),s.set(t,i),this.typeById.set(t,r)}get(e){const t=this.typeById.get(e);if(!t)return;const i=this.interactionsByType.get(t);return i?i.get(e):void 0}remove(e){const t=this.typeById.get(e);if(!t)return;this.typeById.delete(e),this.filters.delete(e);const i=this.interactionsByType.get(t);i&&(i.delete(e),"mouseenter"===t||"mouseleave"===t?(this.delegatedInteractions.delete(e),0===this.delegatedInteractions.size&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):0===i.size&&this.map.off(t,this.handleType))}queryTargets(e,t){const i=[];for(const[e,n]of t)n.target&&i.push({targetId:e,target:n.target,filter:this.filters.get(e)});return this.map.style.queryRenderedTargets(e,i,this.map.transform)}handleMove(e){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;const t=this.queryTargets(e.point,Array.from(this.delegatedInteractions).reverse());t.length&&(e.type="mouseenter",this.handleType(e,t));const i=new Map;for(const[e,{feature:t}]of this.prevHoveredFeatures)this.hoveredFeatures.has(e)||i.set(t.id,t);i.size&&(e.type="mouseleave",this.handleType(e,Array.from(i.values())))}handleOut(e){const t=Array.from(this.hoveredFeatures.values()).map(({feature:e})=>e);t.length&&(e.type="mouseleave",this.handleType(e,t)),this.hoveredFeatures.clear()}handleType(t,i){const n="mouseenter"===t.type;if(n&&!this.interactionsByType.has(t.type))return void e.w("mouseenter interaction required for mouseleave to work.");const r=Array.from(this.interactionsByType.get(t.type)).reverse(),s=!!i;i=i||this.queryTargets(t.point,r);let o=!1;const a=new Set;for(const l of i){for(const[i,c]of r){if(!c.target)continue;const r=l.variants?l.variants[i]:null;if(r){for(const h of r){if(ot(h,l,a,i))continue;const r=new e.dr(l,h),d=st(h,l,i);s&&(r.state=this.map.getFeatureState(r));const u=n?this.prevHoveredFeatures.get(d):null,f=new Ml(t,i,c,r),p=u?u.stop:c.handler(f);if(n&&this.hoveredFeatures.set(d,{feature:l,stop:p}),!1!==p){o=!0;break}}if(o)break}}if(o)break}if(!o)for(const[e,i]of r){const{handler:n,target:r}=i;if(!r&&!1!==n(new Ml(t,e,i,null)))break}}}function Cl(t,i){if(Array.isArray(t)&&Array.isArray(i)){const e=new Set(t),n=new Set(i);return e.size===n.size&&t.every(e=>n.has(e))}return e.bv(t,i)}const Dl={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0,scaleFactor:1,spriteFormat:"auto"},Ll={showCompass:!0,showZoom:!0,visualizePitch:!1};class El{constructor(t,i,n=!1){this._clickTolerance=10,this.element=i,this.mouseRotate=new Wa({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,n&&(this.mousePitch=new Ua({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.aV(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),i.addEventListener("mousedown",this.mousedown),i.addEventListener("touchstart",this.touchstart,{passive:!1}),i.addEventListener("touchmove",this.touchmove),i.addEventListener("touchend",this.touchend),i.addEventListener("touchcancel",this.reset)}down(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),f()}move(e,t){const i=this.map,n=this.mouseRotate.mousemoveWindow(e,t),r=n&&n.bearingDelta;if(r&&i.setBearing(i.getBearing()+r),this.mousePitch){const n=this.mousePitch.mousemoveWindow(e,t),r=n&&n.pitchDelta;r&&i.setPitch(i.getPitch()+r)}}off(){const e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){p(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(t){this.down(e.h({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),_(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(e){this.move(e,_(this.element,e))}mouseup(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}touchstart(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=y(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>e.preventDefault()},this._startPos))}touchmove(e){1!==e.targetTouches.length?this.reset():(this._lastPos=y(this.element,e.targetTouches)[0],this.move({preventDefault:()=>e.preventDefault()},this._lastPos))}touchend(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}function Il(t,i,n){if(t=new e.ci(t.lng,t.lat),i){const r=new e.ci(t.lng-360,t.lat),s=new e.ci(t.lng+360,t.lat),o=360*Math.ceil(Math.abs(t.lng-n.center.lng)/360),a=n.locationPoint3D(t).distSqr(i),l=i.x<0||i.y<0||i.x>n.width||i.y>n.height;n.locationPoint3D(r).distSqr(i)<a&&(l||Math.abs(r.lng-n.center.lng)<o)?t=r:n.locationPoint3D(s).distSqr(i)<a&&(l||Math.abs(s.lng-n.center.lng)<o)&&(t=s)}for(;Math.abs(t.lng-n.center.lng)>180;){const e=n.locationPoint3D(t);if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}const Pl={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},Rl={rotation:0,rotationAlignment:"auto",pitchAlignment:"auto",occludedOpacity:.2,altitude:0};class Ol extends e.E{constructor(t,i){super(),(t instanceof HTMLElement||i)&&(t=e.h({element:t},i)),e.aV(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this);const{anchor:n="center",color:r="#3FB1CE",scale:s=1,draggable:o=!1,clickTolerance:a=0,rotation:l=Rl.rotation,rotationAlignment:c=Rl.rotationAlignment,pitchAlignment:h=Rl.pitchAlignment,occludedOpacity:d=Rl.occludedOpacity,altitude:u=Rl.altitude}=t||{};this._anchor=n,this._color=r,this._scale=s,this._draggable=o,this._clickTolerance=a,this._rotation=l,this._rotationAlignment=c,this._pitchAlignment=h,this._occludedOpacity=d,this._altitude=u,this._state="inactive",this._isDragging=!1,this._updateMoving=()=>this._update(!0),t&&t.element?(this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0])):(this._defaultMarker=!0,this._element=this._createDefaultMarker(),this._offset=e.P.convert(t&&t.offset||[0,-14])),this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",e=>{e.preventDefault()}),this._element.addEventListener("mousedown",e=>{e.preventDefault()});const f=this._element.classList;for(const e in Pl)f.remove(`mapboxgl-marker-anchor-${e}`);f.add(`mapboxgl-marker-anchor-${this._anchor}`);const p=t&&t.className?t.className.trim().split(/\s+/):[];f.add(...p),this._popup=null}_createDefaultMarker(){const e=l("div"),t=c("svg",{display:"block",height:41*this._scale+"px",width:27*this._scale+"px",viewBox:"0 0 27 41"},e);if(0===this._altitude){const e=c("radialGradient",{id:"shadowGradient"},c("defs",{},t));c("stop",{offset:"10%","stop-opacity":.4},e),c("stop",{offset:"100%","stop-opacity":.05},e),c("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},t)}return c("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},t),c("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},t),c("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},t),e}addTo(e){return e===this._map||(this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._updateMoving),e.on("moveend",this._update),e.on("remove",this._clearFadeTimer),e._addMarker(this),this.setDraggable(this._draggable),this._update(),e.on("click",this._onMapClick)),this}remove(){const e=this._map;return e&&(e.off("click",this._onMapClick),e.off("move",this._updateMoving),e.off("moveend",this._update),e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler),e.off("mouseup",this._onUp),e.off("touchend",this._onUp),e.off("mousemove",this._onMove),e.off("touchmove",this._onMove),e.off("remove",this._clearFadeTimer),e._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.ci.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}setAltitude(e){return e===this._altitude||(this._defaultMarker&&(0===this._altitude&&0!==e||0!==this._altitude&&0===e)&&(this._element=this._createDefaultMarker()),this._altitude=e||Rl.altitude,this._update()),this}getAltitude(){return this._altitude}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const t=38.1,i=13.5,n=Math.sqrt(Math.pow(i,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[n,-1*(t-i+n)],"bottom-right":[-n,-1*(t-i+n)],left:[i,-1*(t-i)],right:[-i,-1*(t-i)]}:this._offset}this._popup=e,e._marker=this,e._altitude=this._altitude,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(e){const t=e.code,i=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==i&&13!==i||this.togglePopup()}_onMapClick(e){const t=e.originalEvent.target,i=this._element;this._popup&&(t===i||i.contains(t))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const e=this._popup;return e?(e.isOpen()?(e.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(e.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const e=this._map,t=this._pos;if(!e||!t)return!1;const i=e.unproject(t,this._altitude),n=e.getFreeCameraOptions();if(!n.position)return!1;const r=n.position.toLngLat();return r.distanceTo(i)<.9*r.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const i=this._pos;if(!i||i.x<0||i.x>t.transform.width||i.y<0||i.y>t.transform.height)return void this._clearFadeTimer();const n=t.unproject(i,this._altitude);let r;t._showingGlobe()&&e.eW(t.transform,this._lngLat)?r=0:(r=1-t._queryFogOpacity(n),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(r*=this._occludedOpacity)),this._element.style.opacity=`${r}`,this._element.style.pointerEvents=r>0?"auto":"none",this._popup&&this._popup._setOpacity(r),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const e=this._pos;if(!e||!this._map)return;const t=this._offset.mult(this._scale);this._element.style.transform=`\n translate(${e.x}px,${e.y}px)\n ${Pl[this._anchor]}\n ${this._calculateXYTransform()} ${this._calculateZTransform()}\n translate(${t.x}px,${t.y}px)\n `}_calculateXYTransform(){const t=this._pos,i=this._map,n=this.getPitchAlignment();if(!i||!t||"map"!==n)return"";if(!i._showingGlobe()){const e=i.getPitch();return e?`rotateX(${e}deg)`:""}const r=e.cU(e.eX(i.transform,this._lngLat)),s=t.sub(e.eY(i.transform)),o=Math.abs(s.x)+Math.abs(s.y);if(0===o)return"";const a=r/o;return`rotateX(${-s.y*a}deg) rotateY(${s.x*a}deg)`}_calculateZTransform(){const t=this._pos,i=this._map;if(!i||!t)return"";let n=0;const r=this.getRotationAlignment();if("map"===r)if(i._showingGlobe()){const t=i.project(new e.ci(this._lngLat.lng,this._lngLat.lat+.001),this._altitude),r=i.project(new e.ci(this._lngLat.lng,this._lngLat.lat-.001),this._altitude).sub(t);n=e.cU(Math.atan2(r.y,r.x))-90}else n=-i.getBearing();else if("horizon"===r){const r=e.af(4,6,i.getZoom()),s=e.eY(i.transform);s.y+=r*i.transform.height;const o=t.sub(s),a=e.cU(Math.atan2(o.y,o.x));n=(a>90?a-270:a+90)*(1-r)}return n+=this._rotation,n?`rotateZ(${n}deg)`:""}_update(e){cancelAnimationFrame(this._updateFrameId);const t=this._map;t&&(t.transform.renderWorldCopies&&(this._lngLat=Il(this._lngLat,this._pos,t.transform)),this._pos=t.project(this._lngLat,this._altitude),!0===e?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),t._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(t._showingGlobe()||t.getTerrain()||t.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(e){return this._element.classList.add(e),this}removeClassName(e){return this._element.classList.remove(e),this}toggleClassName(e){return this._element.classList.toggle(e)}_onMove(t){const i=this._map;if(!i)return;const n=this._pointerdownPos,r=this._positionDelta;if(n&&r){if(!this._isDragging){const e=this._clickTolerance||i._clickTolerance;if(t.point.dist(n)<e)return;this._isDragging=!0}this._pos=t.point.sub(r),this._lngLat=i.unproject(this._pos,this._altitude),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.A("dragstart"))),this.fire(new e.A("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const t=this._map;t&&(t.off("mousemove",this._onMove),t.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new e.A("dragend")),this._state="inactive"}_addDragHandler(e){const t=this._map,i=this._pos;t&&i&&this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(i),this._pointerdownPos=e.point,this._state="pending",t.on("mousemove",this._onMove),t.on("touchmove",this._onMove),t.once("mouseup",this._onUp),t.once("touchend",this._onUp))}setDraggable(e){this._draggable=!!e;const t=this._map;return t&&(e?(t.on("mousedown",this._addDragHandler),t.on("touchstart",this._addDragHandler)):(t.off("mousedown",this._addDragHandler),t.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||Rl.rotation,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||Rl.rotationAlignment,this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e||Rl.pitchAlignment,this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(e){return this._occludedOpacity=e||Rl.occludedOpacity,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const zl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},Fl={maxWidth:100,unit:"metric"},Nl={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},Yl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",altitude:0},Bl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Hl(t=new e.P(0,0),i="bottom"){if("number"==typeof t){const n=Math.round(Math.sqrt(.5*Math.pow(t,2)));switch(i){case"top":return new e.P(0,t);case"top-left":return new e.P(n,n);case"top-right":return new e.P(-n,n);case"bottom":return new e.P(0,-t);case"bottom-left":return new e.P(n,-n);case"bottom-right":return new e.P(-n,-n);case"left":return new e.P(t,0);case"right":return new e.P(-t,0)}return new e.P(0,0)}return t instanceof e.P||Array.isArray(t)?e.P.convert(t):e.P.convert(t[i]||[0,0])}const jl={version:t,supported:a.supported,setRTLTextPlugin:e.f0,getRTLTextPluginStatus:e.e$,Map:class extends vl{constructor(t){n.mark(i.create);const r=t;if(null!=(t=e.h({},Dl,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(t.antialias&&e.eU(window)&&(t.antialias=!1,e.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new on(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies,null,null),t),this._repaint=!!t.repaint,this._interactive=t.interactive,this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=t.crossSourceCollisions,this._collectResourceTiming=t.collectResourceTiming,this._language=this._parseLanguage(t.language),this._worldview=t.worldview,this._renderTaskQueue=new Sl,this._domRenderTaskQueue=new Sl,this._controls=[],this._markers=[],this._popups=[],this._mapId=e.a$(),this._locale=e.h({},kl,t.locale),this._clickTolerance=t.clickTolerance,this._cooperativeGestures=t.cooperativeGestures,this._performanceMetricsCollection=t.performanceMetricsCollection,this._tessellationStep=t.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=t.precompilePrograms,this._scaleFactorChanged=!1,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new Tl(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._scaleFactor=t.scaleFactor,this._requestManager=new S(t.transformRequest,t.accessToken,t.testMode),this._silenceAuthErrors=!!t.testMode,this._contextCreateOptions=t.contextCreateOptions?Object.assign({},t.contextCreateOptions):{},"string"==typeof t.container){const e=document.getElementById(t.container);if(!e)throw new Error(`Container '${t.container.toString()}' not found.`);this._container=e}else{if(!(t.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(this._container.childNodes.length>0&&e.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),t.maxBounds&&this.setMaxBounds(t.maxBounds),this._spriteFormat=t.spriteFormat,e.aV(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._tp||(this._tp=new ia),this._tp.registerParameter(this,["Debug"],"showOverdrawInspector"),this._tp.registerParameter(this,["Debug"],"showTileBoundaries"),this._tp.registerParameter(this,["Debug"],"showParseStatus"),this._tp.registerParameter(this,["Debug"],"repaint"),this._tp.registerParameter(this,["Debug"],"showTileAABBs"),this._tp.registerParameter(this,["Debug"],"showPadding"),this._tp.registerParameter(this,["Debug"],"showCollisionBoxes",{noSave:!0}),this._tp.registerParameter(this.transform,["Debug"],"freezeTileCoverage",{noSave:!0},()=>{this._update()}),this._tp.registerParameter(this,["Debug","Wireframe"],"showTerrainWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers2DWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers3DWireframe"),this._tp.registerParameter(this,["Scaling"],"_scaleFactor",{min:.1,max:10,step:.1},()=>{this.setScaleFactor(this._scaleFactor)}),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");if(this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new _l(this,t),this._localFontFamily=t.localFontFamily,this._localIdeographFontFamily=t.localIdeographFontFamily,(t.style||!t.testMode)&&this.setStyle(t.style||e.e.DEFAULT_STYLE,{config:t.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),t.projection&&this.setProjection(t.projection),this.indoor=new wn(this),t.hash&&(this._hash=new xa("string"==typeof t.hash&&t.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==r.center&&null==r.zoom||(this.transform._unmodified=!1),this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});const i=t.bounds;i&&(this.resize(),this.fitBounds(i,e.h({},t.fitBoundsOptions,{duration:0})))}this.resize(),t.attributionControl&&this.addControl(new xl({customAttribution:t.customAttribution})),this._logoControl=new bl,this.addControl(this._logoControl,t.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent()}),this.on("data",t=>{this._update("style"===t.dataType),this.fire(new e.A(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new e.A(`${t.dataType}dataloading`,t))}),this._interactions=new Al(this)}_getMapId(){return this._mapId}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.z(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=t.onAdd(this);this._controls.push(t);const r=this._controlPositions[i];return-1!==i.indexOf("bottom")?r.insertBefore(n,r.firstChild):r.appendChild(n),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.z(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(t){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const i=!this._moving;return i&&this.fire(new e.A("movestart",t)).fire(new e.A("move",t)),this.fire(new e.A("resize",t)),i&&this.fire(new e.A("moveend",t)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(t){return this.transform.setMaxBounds(e.aG.convert(t)),this._update()}setMinZoom(t){if((t=t??-2)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t?this.setZoom(t):this.fire(new e.A("zoomstart")).fire(new e.A("zoom")).fire(new e.A("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=t??22)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t?this.setZoom(t):this.fire(new e.A("zoomstart")).fire(new e.A("zoom")).fire(new e.A("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=t??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t?this.setPitch(t):this.fire(new e.A("pitchstart")).fire(new e.A("pitch")).fire(new e.A("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=t??85)>85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t?this.setPitch(t):this.fire(new e.A("pitchstart")).fire(new e.A("pitch")).fire(new e.A("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(e){return this._scaleFactor=e,this.painter.scaleFactor=e,this._tp.refreshUI(),this._scaleFactorChanged=!0,this.style._updateFilteredLayers(e=>"symbol"===e.type),this._update(!0),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(e){return"auto"===e?navigator.language:Array.isArray(e)?0===e.length?void 0:e.map(e=>"auto"===e?navigator.language:e):e}setLanguage(e){const t=this._parseLanguage(e);if(!this.style||t===this._language)return this;this._language=t,this.style.reloadSources();for(const e of this._controls)e._setLanguage&&e._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(e){return this.style&&e!==this._worldview?(this._worldview=e,this._styleDirty=!0,this.style.reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(e){return this._lazyInitEmptyStyle(),e?"string"==typeof e&&(e={name:e}):e=null,this._useExplicitProjection=!!e,this._prioritizeAndUpdateProjection(e,this.style.projection)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const t=this.transform,i=t.projection.name;let n;"globe"===i&&t.zoom>=e.cI?(t.setMercatorFromTransition(),n=!0):"mercator"===i&&t.zoom<e.cI&&(t.setProjection({name:"globe"}),n=!0),n&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate(),this._update(!0))}_prioritizeAndUpdateProjection(e,t){return this._updateProjection(e||t||{name:"mercator"})}_updateProjection(t){let i;return i="globe"===t.name&&this.transform.zoom>=e.cI?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate(),i&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(t,i){return this.transform.locationPoint3D(e.ci.convert(t),i)}unproject(t,i){return this.transform.pointLocation3D(e.P.convert(t),i)}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(e,t,i){const n=e=>{let i=[];if(Array.isArray(t)){const n=t.filter(e=>this.getLayer(e));i=n.length?this.queryRenderedFeatures(e,{layers:n}):[]}else i=this.queryRenderedFeatures(e,{target:t});return i};if("mouseenter"===e||"mouseover"===e){let r=!1;const s=t=>{const s=n(t.point);s.length?r||(r=!0,i.call(this,new La(e,this,t.originalEvent,{features:s}))):r=!1};return{listener:i,targets:t,delegates:{mousemove:s,mouseout:()=>{r=!1}}}}if("mouseleave"===e||"mouseout"===e){let r=!1;const s=t=>{n(t.point).length?r=!0:r&&(r=!1,i.call(this,new La(e,this,t.originalEvent)))},o=t=>{r&&(r=!1,i.call(this,new La(e,this,t.originalEvent)))};return{listener:i,targets:t,delegates:{mousemove:s,mouseout:o}}}{const r=e=>{const t=n(e.point);t.length&&(e.features=t,i.call(this,e),delete e.features)};return{listener:i,targets:t,delegates:{[e]:r}}}}on(e,t,i){if("function"==typeof t||void 0===i)return super.on(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._createDelegatedListener(e,t,i);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(n);for(const e in n.delegates)this.on(e,n.delegates[e]);return this}once(e,t,i){if("function"==typeof t||void 0===i)return super.once(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._createDelegatedListener(e,t,i);for(const e in n.delegates)this.once(e,n.delegates[e]);return this}off(e,t,i){if("function"==typeof t||void 0===i)return super.off(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._delegatedListeners?this._delegatedListeners[e]:void 0;return n&&(e=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.listener===i&&Cl(r.targets,t)){for(const e in r.delegates)this.off(e,r.delegates[e]);return e.splice(n,1),this}}})(n),this}queryRenderedFeatures(t,i){if(!this.style)return[];if(void 0===t||t instanceof e.P||Array.isArray(t)||void 0!==i||(i=t,t=void 0),t=t||[[0,0],[this.transform.width,this.transform.height]],!i){const e=this.style.queryRenderedFeatures(t,void 0,this.transform),i=this.style.queryRenderedFeatureset(t,void 0,this.transform);return e.concat(i)}let n=!0;if(i.target&&(n=this._isTargetValid(i.target),n&&!i.layers))return this.style.queryRenderedFeatureset(t,i,this.transform);let r=!0;if(i.layers&&Array.isArray(i.layers)){for(const e of i.layers)if(!this._isValidId(e)){r=!1;break}if(r&&!i.target)return this.style.queryRenderedFeatures(t,i,this.transform)}let s=[];return r&&(s=s.concat(this.style.queryRenderedFeatures(t,i,this.transform))),n&&(s=s.concat(this.style.queryRenderedFeatureset(t,i,this.transform))),s}querySourceFeatures(e,t){return!e||"string"==typeof e&&!this._isValidId(e)?[]:this.style.querySourceFeatures(e,t)}isPointOnSurface(t){const{name:i}=this.transform.projection;return"globe"!==i&&"mercator"!==i&&e.w(`${i} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(e.P.convert(t))}addInteraction(e,t){return this._interactions.add(e,t),this}removeInteraction(e){return this._interactions.remove(e),this}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(e){return this._cooperativeGestures=e,this}setStyle(t,i){return i=e.h({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},i),this.style&&t&&!1!==i.diff&&i.localFontFamily===this._localFontFamily&&i.localIdeographFontFamily===this._localIdeographFontFamily&&!i.config?(this.style._diffStyle(t,(n,r)=>{if(n){const r="string"==typeof n?n:n instanceof Error?n.message:n.error;e.w(`Unable to perform style diff: ${r}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}else r&&this._update(!0)},()=>this._postStyleLoadEvent()),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._localFontFamily=i.localFontFamily,this._updateStyle(t,i))}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(t,i){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),t){const n=e.h({},i);i&&i.config&&(n.initialConfig=i.config,delete n.config),this.style=new In(this,n).load(t),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new In(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(e.w("There is no style added to the map."),!1)}_isValidId(t){return null==t?(this.fire(new e.z(new Error("IDs can't be empty."))),!1):!e.dk(t)||(this.fire(new e.z(new Error(`IDs can't contain special symbols: "${t}".`))),!1)}_isTargetValid(e){return"featuresetId"in e?this._isValidId("importId"in e?e.importId:e.featuresetId):"layerId"in e&&this._isValidId(e.layerId)}_areTargetsValid(e){if(Array.isArray(e)){for(const t of e)if(!this._isValidId(t))return!1;return!0}return this._isTargetValid(e)}addSource(e,t){return this._isValidId(e)?(this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)):this}isSourceLoaded(e){return!!this._isValidId(e)&&!!this.style&&this.style._isSourceCacheLoaded(e)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(e,t,i){this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,i)}removeSource(e){return this._isValidId(e)?(this.style.removeSource(e),this._updateTerrain(),this._update(!0)):this}getSource(e){return this._isValidId(e)?this.style.getOwnSource(e):null}addImage(t,i,{pixelRatio:n=1,sdf:r=!1,stretchX:s,stretchY:o,content:a}={}){this._lazyInitEmptyStyle();const l=e.I.from(t);if(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap){const{width:t,height:c,data:h}=e.q.getImageData(i);this.style.addImage(l,{data:new e.r({width:t,height:c},h),pixelRatio:n,stretchX:s,stretchY:o,content:a,sdf:r,version:0,usvg:!1})}else if(void 0===i.width||void 0===i.height)this.fire(new e.z(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:c,height:h}=i,d=i;this.style.addImage(l,{data:new e.r({width:c,height:h},new Uint8Array(d.data)),pixelRatio:n,stretchX:s,stretchY:o,content:a,sdf:r,usvg:!1,version:0,userImage:d}),d.onAdd&&d.onAdd(this,t)}}updateImage(t,i){this._lazyInitEmptyStyle();const n=e.I.from(t),r=this.style.getImage(n);if(!r)return void this.fire(new e.z(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const s=i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap?e.q.getImageData(i):i,{width:o,height:a,data:l}=s;if(void 0===o||void 0===a)return void this.fire(new e.z(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==(r.usvg?r.icon.usvg_tree.width:r.data.width)||a!==(r.usvg?r.icon.usvg_tree.height:r.data.height))return void this.fire(new e.z(new Error(`The width and height of the updated image (${o}, ${a})\n must be that same as the previous version of the image\n (${r.data.width}, ${r.data.height})`)));const c=!(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap);let h=!1;r.usvg?(r.data=new e.r({width:o,height:a},new Uint8Array(l)),r.usvg=!1,r.icon=void 0,h=!0):r.data.replace(l,c),this.style.updateImage(n,r,h)}hasImage(t){return t?!!this.style&&!!this.style.getImage(e.I.from(t)):(this.fire(new e.z(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(e.I.from(t))}loadImage(t,i){e.o(this._requestManager.transformRequest(t,e.R.Image),(t,n)=>{i(t,n instanceof HTMLImageElement?e.q.getImageData(n):n)})}listImages(){return this.style.listImages().map(e=>e.name)}addModel(e,t){this._lazyInitEmptyStyle(),this.style.addModel(e,t)}hasModel(t){return t?this.style.hasModel(t):(this.fire(new e.z(new Error("Missing required model id"))),!1)}removeModel(e){this.style.removeModel(e)}listModels(){return this.style.listModels()}addLayer(e,t){return this._isValidId(e.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)):this}getSlot(e){const t=this.getLayer(e);return t&&t.slot||null}setSlot(e,t){return this.style.setSlot(e,t),this.style.mergeLayers(),this._update(!0)}addImport(t,i){return this.style.addImport(t,i).catch(t=>this.fire(new e.z(new Error("Failed to add import",t)))),this}updateImport(e,t){return"string"!=typeof t&&t.id!==e?(this.removeImport(e),this.addImport(t)):(this.style.updateImport(e,t),this._update(!0))}removeImport(e){return this.style.removeImport(e),this}moveImport(e,t){return this.style.moveImport(e,t),this._update(!0)}moveLayer(e,t){return this._isValidId(e)?(this.style.moveLayer(e,t),this._update(!0)):this}removeLayer(e){return this._isValidId(e)?(this.style.removeLayer(e),this._update(!0)):this}getLayer(e){if(!this._isValidId(e))return null;const t=this.style.getOwnLayer(e);return t?"custom"===t.type?t.implementation:t.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(e,t,i){return this._isValidId(e)?(this.style.setLayerZoomRange(e,t,i),this._update(!0)):this}setFilter(e,t,i={}){return this._isValidId(e)?(this.style.setFilter(e,t,i),this._update(!0)):this}getFilter(e){return this._isValidId(e)?this.style.getFilter(e):null}setPaintProperty(e,t,i,n={}){return this._isValidId(e)?(this.style.setPaintProperty(e,t,i,n),this._update(!0)):this}getPaintProperty(e,t){return this._isValidId(e)?this.style.getPaintProperty(e,t):null}setLayoutProperty(e,t,i,n={}){return this._isValidId(e)?(this.style.setLayoutProperty(e,t,i,n),this._update(!0)):this}getLayoutProperty(e,t){return this._isValidId(e)?this.style.getLayoutProperty(e,t):null}getGlyphsUrl(){return this.style.getGlyphsUrl()}setGlyphsUrl(e){return this.style.setGlyphsUrl(e),this._update(!0)}getSchema(e){return this.style.getSchema(e)}setSchema(e,t){return this.style.setSchema(e,t),this._update(!0)}getConfig(e){return this.style.getConfig(e)}setConfig(e,t){return this.style.setConfig(e,t),this._update(!0)}getConfigProperty(e,t){return this.style.getConfigProperty(e,t)}setConfigProperty(e,t,i){return this.style.setConfigProperty(e,t,i),this._update(!0)}getFeaturesetDescriptors(e){return this.style.getFeaturesetDescriptors(e)}setLights(e){if(this._lazyInitEmptyStyle(),e&&1===e.length&&"flat"===e[0].type){const t=e[0];t.properties?this.style.setFlatLight(t.properties,t.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(e),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const e=this.style.getLights()||[];return 0===e.length&&e.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),e}setLight(e,t={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:e}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(e){return this._lazyInitEmptyStyle(),!e&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(e),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(e){return this._lazyInitEmptyStyle(),this.style.setFog(e),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(e){return this._lazyInitEmptyStyle(),this.style.setSnow(e),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(e){return this._lazyInitEmptyStyle(),this.style.setRain(e),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(e){return this._lazyInitEmptyStyle(),this.style.setColorTheme(e),this._update(!0)}setImportColorTheme(e,t){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(e,t),this._update(!0)}setCamera(e){return this.style.setCamera(e),this._triggerCameraUpdate(e)}_triggerCameraUpdate(e){return this._update(this.transform.setOrthographicProjectionAtLowPitch("orthographic"===e["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.ci.convert(t),this.transform):0}setFeatureState(e,t){return e.source&&!this._isValidId(e.source)?this:(this.style.setFeatureState(e,t),this._update())}removeFeatureState(e,t){return e.source&&!this._isValidId(e.source)?this:(this.style.removeFeatureState(e,t),this._update())}getFeatureState(e){return e.source&&!this._isValidId(e.source)?null:this.style.getFeatureState(e)}_selectIndoorFloor(e){this.indoor.selectFloor(e)}_addIndoorControl(){this._indoorControl||(this._indoorControl=new wl),this.addControl(this._indoorControl,"right")}_removeIndoorControl(){this._indoorControl&&this.removeControl(this._indoorControl)}_updateContainerDimensions(){if(!this._container)return;const e=this._container.getBoundingClientRect().width||400,t=this._container.getBoundingClientRect().height||300;let i,n,r,s=this._container;for(;s&&(!n||!r);){const e=window.getComputedStyle(s).transform;e&&"none"!==e&&(i=e.match(/matrix.*\((.+)\)/)[1].split(", "),i[0]&&"0"!==i[0]&&"1"!==i[0]&&(n=i[0]),i[3]&&"0"!==i[3]&&"1"!==i[3]&&(r=i[3])),s=s.parentElement}this._containerWidth=n?Math.abs(e/n):e,this._containerHeight=r?Math.abs(t/r):t}_detectMissingCSS(){"rgb(250, 128, 114)"!==window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=l("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=l("div","mapboxgl-canvas-container",e);this._canvas=l("canvas","mapboxgl-canvas",t),this._interactive&&(t.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const i=this._controlContainer=l("div","mapboxgl-control-container",e),n=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(e=>{n[e]=l("div",`mapboxgl-ctrl-${e}`,i)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,i){const n=e.q.devicePixelRatio||1;this._canvas.width=n*Math.ceil(t),this._canvas.height=n*Math.ceil(i),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${i}px`}_addMarker(e){this._markers.push(e)}_removeMarker(e){const t=this._markers.indexOf(e);-1!==t&&this._markers.splice(t,1)}_addPopup(e){this._popups.push(e)}_removePopup(e){const t=this._popups.indexOf(e);-1!==t&&this._popups.splice(t,1)}_setupPainter(){const t=e.h({},a.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl2",t);i?(H(i,!0),this.painter=new ya(i,this._contextCreateOptions,this.transform,this._scaleFactor,this._tp,this._worldview),this.on("data",e=>{"source"===e.dataType&&this.painter.setTileLoadedFlag(!0)}),e.l.testSupport(i)):this.fire(new e.z(new Error("Failed to initialize WebGL")))}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.A("webglcontextlost",{originalEvent:t}))}_contextRestored(t){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style&&(this.style.clearLayers(),this.style.imageManager.destroyAtlasTextures(),this.style.reloadModels(),this.style.clearSources()),this._update(),this.fire(new e.A("webglcontextrestored",{originalEvent:t}))}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_requestDomTask(e){!this.loaded()||this.loaded()&&!this.isMoving()?e():this._domRenderTaskQueue.add(e)}_render(t){let r;this.fire(new e.A("renderstart")),++this._frameId;const s=this.painter.context.extTimerQuery,o=e.q.now(),a=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(r=a.createQuery(),a.beginQuery(s.TIME_ELAPSED_EXT,r)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),this._removed)return;this._updateProjectionTransition();const l=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,i=this.transform.pitch,n=e.q.now(),r=new e.aa(t,{now:n,fadeDuration:l,pitch:i,transition:this.style.transition,worldview:this._worldview});this.style.update(r)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let c=!1;this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),c=this._updateAverageElevation(o),this.style.updateSources(this.transform),this.style.updateImageProviders(),this.isMoving()||this._forceMarkerAndPopupUpdate()):c=this._updateAverageElevation(o);const h=this.style&&this.style._updatePlacement(this.painter,this.painter.transform,this.showCollisionBoxes,l,this._crossSourceCollisions,this.painter.replacementSource,this._scaleFactorChanged);if(this._scaleFactorChanged&&(this._scaleFactorChanged=!1),h&&(this._placementDirty=h.needsRerender),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:l,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new e.A("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,n.mark(i.load),this.fire(new e.A("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&this.style.imageManager.hasPatternsInFlight()&&(this._styleDirty=!0),this.style&&!this.style.modelManager.isLoaded()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),r){const t=e.q.now()-o;a.endQuery(s.TIME_ELAPSED_EXT),setTimeout(()=>{const i=a.getQueryParameter(r,a.QUERY_RESULT)/1e6;a.deleteQuery(r),this.fire(new e.A("gpu-timing-frame",{cpuTime:t,gpuTime:i}))},50)}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout(()=>{const i=this.painter.queryGpuTimers(t);this.fire(new e.A("gpu-timing-layer",{layerTimes:i}))},50)}if(this.listens("gpu-timing-deferred-render")){const t=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const i=this.painter.queryGpuTimeDeferredRender(t);this.fire(new e.A("gpu-timing-deferred-render",{gpuTime:i}))},50)}const d=this._sourcesDirty||this._styleDirty||this._placementDirty||c;if(d||this._repaint)this.triggerRepaint();else{const t=this.idle();if(t&&(c=this._updateAverageElevation(o,!0)),c)this.triggerRepaint();else if(this._triggerFrame(!1),t&&(this.fire(new e.A("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const t=this._calculateSpeedIndex();this.fire(new e.A("speedindexcompleted",{speedIndex:t})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||d||(this._fullyLoaded=!0,n.mark(i.fullLoad),this._performanceMetricsCollection&&F(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(e){for(const t of this._markers)e&&!this.getRenderWorldCopies()&&(t._lngLat=t._lngLat.wrap()),t._update();for(const t of this._popups)!e||this.getRenderWorldCopies()||t._trackPointer||(t._lngLat=t._lngLat.wrap()),t._update()}_updateAverageElevation(e,t=!1){const i=e=>(this.transform.averageElevation=e,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&i(0);const n=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(n||(t||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){const t=this.transform.averageElevation;let r=this.transform.sampleAverageElevation();null!=this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(r)?r=0:this._averageElevationLastSampledAt=e;const s=Math.abs(t-r);if(s>1){if(this._isInitialLoad||n)return this._averageElevation.jumpTo(r),i(r);this._averageElevation.easeTo(r,e,300)}else if(s>1e-4)return this._averageElevation.jumpTo(r),i(r)}return!!this._averageElevation.isEasing(e)&&i(this._averageElevation.getValue(e))}_authenticate(){Y(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,t=>{if(t&&(t.message===w||401===t.status)){const t=this.painter.context.gl;H(t,!1),this._logoControl instanceof bl&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new e.z(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),P(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&O(this._requestManager._customAccessToken,{map:this,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_updateTerrain(){const e=this._isDragging();this.painter.updateTerrain(this.style,e)}_calculateSpeedIndex(){const e=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());const i=this.painter.context.gl,n=i.createFramebuffer();function r(e){i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0);const t=new Uint8Array(i.drawingBufferWidth*i.drawingBufferHeight*4);return i.readPixels(0,0,i.drawingBufferWidth,i.drawingBufferHeight,i.RGBA,i.UNSIGNED_BYTE,t),t}return i.bindFramebuffer(i.FRAMEBUFFER,n),this._canvasPixelComparison(r(e),t.canvasCopies.map(r),t.timeStamps)}_canvasPixelComparison(e,t,i){let n=i[1]-i[0];const r=e.length/4;for(let s=0;s<t.length;s++){const o=t[s];let a=0;for(let t=0;t<o.length;t+=4)o[t]===e[t]&&o[t+1]===e[t+1]&&o[t+2]===e[t+2]&&o[t+3]===e[t+3]&&(a+=1);n+=(i[s+2]-i[s+1])*(1-a/r)}return n}remove(){this._hash&&this._hash.remove();for(const e of this._controls)e.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.indoor.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("orientationchange",this._onWindowResize,!1),window.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1),window.removeEventListener("visibilitychange",this._onVisibilityChange,!1);const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),B.delete(this.painter.context.gl),N.remove(),I.remove(),this._removed=!0,this.fire(new e.A("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(t){this._renderNextFrame=this._renderNextFrame||t,this.style&&!this._frame&&(this._frame=e.q.frame(e=>{const t=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,t&&this._render(e)}))}_preloadTiles(t){const i=this.style?this.style.getSourceCaches():[];return e.bt(i,(e,i)=>e._preloadTiles(t,i),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update()}_onVisibilityChange(){"hidden"===document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._tp.refreshUI(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(e){this._showParseStatus!==e&&(this._showParseStatus=e,this._tp.refreshUI(),this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(e){this._showTerrainWireframe!==e&&(this._showTerrainWireframe=e,this._tp.refreshUI(),this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(e){this._showLayers2DWireframe!==e&&(this._showLayers2DWireframe=e,this._tp.refreshUI(),this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(e){this._showLayers3DWireframe!==e&&(this._showLayers3DWireframe=e,this._tp.refreshUI(),this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(e){this._speedIndexTiming!==e&&(this._speedIndexTiming=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._tp.refreshUI(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,this._tp.refreshUI(),e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._tp.refreshUI(),this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this._tp.refreshUI(),this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(e){this._showTileAABBs!==e&&(this._showTileAABBs=e,this._tp.refreshUI(),e&&this._update())}_setCacheLimits(t,i){e.eV(t,i)}get version(){return t}},NavigationControl:class{constructor(t={}){this.options=e.h({},Ll,t),this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(e.aV(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",e=>{this._map&&this._map.zoomIn({},{originalEvent:e})}),l("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",e=>{this._map&&this._map.zoomOut({},{originalEvent:e})}),l("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.aV(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",e=>{const t=this._map;t&&(this.options.visualizePitch?t.resetNorthPitch({},{originalEvent:e}):t.resetNorth({},{originalEvent:e}))}),this._compassIcon=l("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const e=this._map;if(!e)return;const t=e.getZoom(),i=t===e.getMaxZoom(),n=t===e.getMinZoom();this._zoomInButton.disabled=i,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){const e=this._map;if(!e)return;const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(e.transform.pitch*(Math.PI/180)),.5)}) rotateX(${e.transform.pitch}deg) rotateZ(${e.transform.angle*(180/Math.PI)}deg)`:`rotate(${e.transform.angle*(180/Math.PI)}deg)`;e._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=t)})}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),e.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&e.on("pitch",this._rotateCompassArrow),e.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new El(e,this._compass,this.options.visualizePitch)),this._container}onRemove(){const e=this._map;e&&(this._container.remove(),this.options.showZoom&&e.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&e.off("pitch",this._rotateCompassArrow),e.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(e,t){const i=l("button",e,this._container);return i.type="button",i.addEventListener("click",t),i}_setButtonTitle(e,t){if(!this._map)return;const i=this._map._getUIString(`NavigationControl.${t}`);e.setAttribute("aria-label",i),e.firstElementChild&&e.firstElementChild.setAttribute("title",i)}},GeolocateControl:class extends e.E{constructor(t={}){super();const i=navigator.geolocation;this.options=e.h({geolocation:i},zl,t),e.aV(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=va(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(e){return this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(e){const t=(t=!!this.options.geolocation)=>{this._supportsGeolocation=t,e(t)};void 0!==this._supportsGeolocation?e(this._supportsGeolocation):void 0!==navigator.permissions?navigator.permissions.query({name:"geolocation"}).then(e=>t("denied"!==e.state)).catch(()=>t()):t()}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),i=e.coords;return!!t&&(i.longitude<t.getWest()||i.longitude>t.getEast()||i.latitude<t.getSouth()||i.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.A("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.A("geolocate",t)),this._finish()}}_updateCamera(t){const i=new e.ci(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,r=this._map.getBearing(),s=e.h({bearing:r},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(n),s,{geolocateSource:!0})}_updateMarker(t){if(t){const i=new e.ci(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map.transform,i=e.cb(1,t._center.lat)*t.worldSize,n=Math.ceil(2*this._accuracy*i);this._circleElement.style.width=`${n}px`,this._circleElement.style.height=`${n}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.A("error",t)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(t){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=l("button","mapboxgl-ctrl-geolocate",this._container),l("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=l("div","mapboxgl-user-location"),this._dotElement.appendChild(l("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(l("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Ol({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=l("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ol({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new e.A("trackuserlocationend")))})}}_onDeviceOrientation(e){this._userLocationDotMarker&&(e.webkitCompassHeading?this._heading=e.webkitCompassHeading:!0===e.absolute&&(this._heading=-1*e.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.A("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.A("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.A("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(e={maximumAge:6e5,timeout:0},this._noTimeout=!0):(e=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,e),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const e=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation)};"undefined"!=typeof DeviceMotionEvent&&"function"==typeof DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(t=>{"granted"===t&&e()}).catch(console.error):e()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:xl,ScaleControl:class{constructor(t={}){this.options=e.h({},Fl,t),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch(e){return!1}}(),e.aV(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const e=this.options.maxWidth||100,t=this._map,i=t._containerHeight/2,n=t._containerWidth/2-e/2,r=t.unproject([n,i]),s=t.unproject([n+e,i]),o=r.distanceTo(s);if("imperial"===this.options.unit){const t=3.2808*o;t>5280?this._setScale(e,t/5280,"mile"):this._setScale(e,t,"foot")}else"nautical"===this.options.unit?this._setScale(e,o/1852,"nautical-mile"):o>=1e3?this._setScale(e,o/1e3,"kilometer"):this._setScale(e,o,"meter")}_setScale(e,t,i){this._map._requestDomTask(()=>{const n=function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let i=e/t;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(i),t*i}(t),r=n/t;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==i?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:i}).format(n):`${n} ${Nl[i]}`,this._container.style.width=e*r+"px"})}onAdd(e){return this._map=e,this._language=e.getLanguage(),this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(e){this._language=e,this._update()}setUnit(e){this.options.unit=e,this._update()}},FullscreenControl:class{constructor(t={}){this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),e.aV(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const e=this._fullscreenButton=l("button","mapboxgl-ctrl-fullscreen",this._controlContainer);l("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",e)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},IndoorControl:wl,Popup:class extends e.E{constructor(t){super(),this.options=e.h(Object.create(Yl),t),this._altitude=this.options.altitude,e.aV(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(t&&t.className?t.className.trim().split(/\s+/):[])}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&t.on("preclick",this._onClose),this.options.closeOnMove&&t.on("move",this._onClose),t.on("remove",this.remove),this._update(),t._addPopup(this),this._focusFirstElement(),this._trackPointer?(t.on("mousemove",this._onMouseEvent),t.on("mouseup",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")):t.on("move",this._update),this.fire(new e.A("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const t=this._map;return t&&(t.off("move",this._update),t.off("move",this._onClose),t.off("preclick",this._onClose),t.off("click",this._onClose),t.off("remove",this.remove),t.off("mousemove",this._onMouseEvent),t.off("mouseup",this._onMouseEvent),t.off("drag",this._onMouseEvent),t._canvasContainer&&t._canvasContainer.classList.remove("mapboxgl-track-pointer"),t._removePopup(this),this._map=void 0),this.fire(new e.A("close")),this}getLngLat(){return this._lngLat}setLngLat(t){this._lngLat=e.ci.convert(t),this._pos=null,this._trackPointer=!1,this._update();const i=this._map;return i&&(i.on("move",this._update),i.off("mousemove",this._onMouseEvent),i._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}getAltitude(){return this._altitude}setAltitude(e){return this._altitude=e,this._update(),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const e=this._map;return e&&(e.off("move",this._update),e.on("mousemove",this._onMouseEvent),e.on("drag",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){const t=document.createDocumentFragment(),i=document.createElement("body");let n;for(i.innerHTML=e;n=i.firstChild,n;)t.appendChild(n);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){let t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=l("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(e),this.options.closeButton){const e=this._closeButton=l("button","mapboxgl-popup-close-button",t);e.type="button",e.setAttribute("aria-label","Close popup"),e.innerHTML='<span aria-hidden="true">×</span>',e.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(e){return this._classList.add(e),this._updateClassList(),this}removeClassName(e){return this._classList.delete(e),this._updateClassList(),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){let t;return this._classList.delete(e)?t=!1:(this._classList.add(e),t=!0),this._updateClassList(),t}_onMouseEvent(e){this._update(e.point)}_getAnchor(e){if(this.options.anchor)return this.options.anchor;const t=this._map,i=this._container,n=this._pos;if(!t||!i||!n)return"bottom";const r=i.offsetWidth,s=i.offsetHeight,o=n.x<r/2,a=n.x>t.transform.width-r/2;if(n.y+e<s)return o?"top-left":a?"top-right":"top";if(n.y>t.transform.height-s){if(o)return"bottom-left";if(a)return"bottom-right"}return o?"left":a?"right":"bottom"}_updateClassList(){const e=this._container;if(!e)return;const t=[...this._classList];t.push("mapboxgl-popup"),this._anchor&&t.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),e.className=t.join(" ")}_update(t){const i=this._map,n=this._content;if(!i||!this._lngLat&&!this._trackPointer||!n)return;let r=this._container;if(r||(r=this._container=l("div","mapboxgl-popup",i.getContainer()),this._tip=l("div","mapboxgl-popup-tip",r),r.appendChild(n)),this.options.maxWidth&&r.style.maxWidth!==this.options.maxWidth&&(r.style.maxWidth=this.options.maxWidth),i.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Il(this._lngLat,this._pos,i.transform)),!this._trackPointer||t){const n=this._pos=this._trackPointer&&t instanceof e.P?t:i.project(this._lngLat,this._altitude),r=Hl(this.options.offset),s=this._anchor=this._getAnchor(r.y),o=Hl(this.options.offset,s),a=n.add(o).round();i._requestDomTask(()=>{this._container&&s&&(this._container.style.transform=`${Pl[s]} translate(${a.x}px,${a.y}px)`)})}if(!this._marker&&i._showingGlobe()){const t=e.eW(i.transform,this._lngLat)?0:1;this._setOpacity(t)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(Bl);e&&e.focus()}_onClose(){this.remove()}_setOpacity(e){this._container&&(this._container.style.opacity=`${e}`),this._content&&(this._content.style.pointerEvents=e?"auto":"none")}},Marker:Ol,Style:In,LngLat:e.ci,LngLatBounds:e.aG,Point:e.P,MercatorCoordinate:e.ac,FreeCameraOptions:Xi,Evented:e.E,config:e.e,prewarm:e.e_,clearPrewarmedResources:e.eZ,get accessToken(){return e.e.ACCESS_TOKEN},set accessToken(t){e.e.ACCESS_TOKEN=t},get baseApiUrl(){return e.e.API_URL},set baseApiUrl(t){e.e.API_URL=t},get workerCount(){return e.f7.workerCount},set workerCount(t){e.f7.workerCount=t},get maxParallelImageRequests(){return e.e.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.e.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage(t){e.f6(t)},get workerUrl(){return e.f5.workerUrl},set workerUrl(t){e.f5.workerUrl=t},get workerClass(){return e.f5.workerClass},set workerClass(t){e.f5.workerClass=t},get workerParams(){return e.f5.workerParams},set workerParams(t){e.f5.workerParams=t},get dracoUrl(){return e.f4()},set dracoUrl(t){e.f3(t)},get meshoptUrl(){return e.f2()},set meshoptUrl(t){e.f1(t)},setNow:e.q.setNow,restoreNow:e.q.restoreNow};return jl}),i}()},844:(e,t,i)=>{"use strict";function n(e){var t=e.reduce(function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}i.d(t,{A:()=>n})},1007:(e,t,i)=>{"use strict";function n(e,t){return t.reduce(function(t,i){return t[i]=e,t},{})}i.d(t,{A:()=>n})},1011:function(e,t,i){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(i(5093))},1025:function(e,t,i){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},i={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,i){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(i(5093))},1052:function(e,t,i){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function i(e,i,n,r){var s=function(e){var i=Math.floor(e%1e3/100),n=Math.floor(e%100/10),r=e%10,s="";return i>0&&(s+=t[i]+"vatlh"),n>0&&(s+=(""!==s?" ":"")+t[n]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(n){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:i,m:"wa’ tup",mm:i,h:"wa’ rep",hh:i,d:"wa’ jaj",dd:i,M:"wa’ jar",MM:i,y:"wa’ DIS",yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},1135:function(e,t,i){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,i){return e<12?i?"sa":"SA":i?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(i(5093))},1149:(e,t,i)=>{"use strict";i.d(t,{oI:()=>h});var n=function(){return n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},r={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",fadeColor:"transparent",animation:"spinner-line-fade-default",rotate:0,direction:1,speed:1,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:"0 0 1px transparent",position:"absolute"},s=function(){function e(e){void 0===e&&(e={}),this.opts=n(n({},r),e)}return e.prototype.spin=function(e){return this.stop(),this.el=document.createElement("div"),this.el.className=this.opts.className,this.el.setAttribute("role","progressbar"),this.el.style.position=this.opts.position,this.el.style.width="0",this.el.style.zIndex=this.opts.zIndex.toString(),this.el.style.left=this.opts.left,this.el.style.top=this.opts.top,this.el.style.transform="scale(".concat(this.opts.scale,")"),e&&e.insertBefore(this.el,e.firstChild||null),function(e,t){var i=Math.round(t.corners*t.width*500)/1e3+"px",n="none";!0===t.shadow?n="0 2px 4px #000":"string"==typeof t.shadow&&(n=t.shadow);for(var r=function(e){for(var t=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/,i=[],n=0,r=e.split(",");n<r.length;n++){var s=r[n].match(t);if(null!==s){var o=+s[2],a=+s[5],l=s[4],c=s[7];0!==o||l||(l=c),0!==a||c||(c=l),l===c&&i.push({prefix:s[1]||"",x:o,y:a,xUnits:l,yUnits:c,end:s[8]})}}return i}(n),s=0;s<t.lines;s++){var l=~~(360/t.lines*s+t.rotate),c=document.createElement("div");c.style.position="absolute",c.style.top="".concat(-t.width/2,"px"),c.style.width=t.length+t.width+"px",c.style.height=t.width+"px",c.style.background=o(t.fadeColor,s),c.style.borderRadius=i,c.style.transformOrigin="left",c.style.transform="rotate(".concat(l,"deg) translateX(").concat(t.radius,"px)");var h=s*t.direction/t.lines/t.speed;h-=1/t.speed;var d=document.createElement("div");d.style.width="100%",d.style.height="100%",d.style.background=o(t.color,s),d.style.borderRadius=i,d.style.boxShadow=a(r,l),d.style.animation="".concat(1/t.speed,"s linear ").concat(h,"s infinite ").concat(t.animation),c.appendChild(d),e.appendChild(c)}}(this.el,this.opts),this},e.prototype.stop=function(){return this.el&&(this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=void 0),this},e}();function o(e,t){return"string"==typeof e?e:e[t%e.length]}function a(e,t){for(var i=[],n=0,r=e;n<r.length;n++){var s=r[n],o=l(s.x,s.y,t);i.push(s.prefix+o[0]+s.xUnits+" "+o[1]+s.yUnits+s.end)}return i.join(", ")}function l(e,t,i){var n=i*Math.PI/180,r=Math.sin(n),s=Math.cos(n);return[Math.round(1e3*(e*s+t*r))/1e3,Math.round(1e3*(-e*r+t*s))/1e3]}var c=[];function h(e,t){var i;if("string"==typeof e)i=document.querySelectorAll(e);else{if("object"!=typeof e)throw new Error("target must be string or object");i=[e]}t=t||{};for(var n=0;n<i.length;n++)d(i[n],t)}function d(e,t){if("function"==typeof e.addEventListener){var i=function(e){if(void 0!==e){if(e.classList.contains("ladda-button")||e.classList.add("ladda-button"),e.hasAttribute("data-style")||e.setAttribute("data-style","expand-right"),!e.querySelector(".ladda-label")){var t=document.createElement("span");t.className="ladda-label",i=e,n=t,(r=document.createRange()).selectNodeContents(i),r.surroundContents(n),i.appendChild(n)}var i,n,r,o,a,l=e.querySelector(".ladda-spinner");l||((l=document.createElement("span")).className="ladda-spinner"),e.appendChild(l);var h={start:function(){return a||(a=function(e){var t,i,n=e.offsetHeight;0===n&&(n=parseFloat(window.getComputedStyle(e).height)),n>32&&(n*=.8),e.hasAttribute("data-spinner-size")&&(n=parseInt(e.getAttribute("data-spinner-size"),10)),e.hasAttribute("data-spinner-color")&&(t=e.getAttribute("data-spinner-color")),e.hasAttribute("data-spinner-lines")&&(i=parseInt(e.getAttribute("data-spinner-lines"),10));var r=.2*n;return new s({color:t||"#fff",lines:i||12,radius:r,length:.6*r,width:r<7?2:3,animation:"ladda-spinner-line-fade",zIndex:"auto",top:"auto",left:"auto",className:""})}(e)),e.disabled=!0,e.setAttribute("data-loading",""),clearTimeout(o),a.spin(l),this.setProgress(0),this},startAfter:function(e){return clearTimeout(o),o=setTimeout(function(){h.start()},e),this},stop:function(){return h.isLoading()&&(e.disabled=!1,e.removeAttribute("data-loading")),clearTimeout(o),a&&(o=setTimeout(function(){a.stop()},1e3)),this},toggle:function(){return this.isLoading()?this.stop():this.start()},setProgress:function(t){t=Math.max(Math.min(t,1),0);var i=e.querySelector(".ladda-progress");0===t&&i&&i.parentNode?i.parentNode.removeChild(i):(i||((i=document.createElement("div")).className="ladda-progress",e.appendChild(i)),i.style.width=(t||0)*e.offsetWidth+"px")},isLoading:function(){return e.hasAttribute("data-loading")},remove:function(){clearTimeout(o),e.disabled=!1,e.removeAttribute("data-loading"),a&&(a.stop(),a=null),c.splice(c.indexOf(h),1)}};return c.push(h),h}console.warn("Ladda button target must be defined.")}(e),n=-1;e.addEventListener("click",function(){var r=!0,s=function(e,t){for(;e.parentNode&&e.tagName!==t;)e=e.parentNode;return t===e.tagName?e:void 0}(e,"FORM");void 0===s||s.hasAttribute("novalidate")||"function"==typeof s.checkValidity&&(r=s.checkValidity()),r&&(i.startAfter(1),"number"==typeof t.timeout&&(clearTimeout(n),n=setTimeout(i.stop,t.timeout)),"function"==typeof t.callback&&t.callback.apply(null,[i]))},!1)}}},1206:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>s}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(4278);function r(e){var t=new Map,i=new Set,n=[];function r(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!i.has(e)){var n=t.get(e);n&&r(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){i.has(e.name)||r(e)}),n}function s(e){var t=r(e);return n.GM.reduce(function(e,i){return e.concat(t.filter(function(e){return e.phase===i}))},[])}},1221:function(e,t,i){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],i=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:i,weekdaysShort:i,weekdaysMin:i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,i){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(i(5093))},1262:(e,t,i)=>{"use strict";i.d(t,{A:()=>f});var n=i(4278),r=i(5128),s=i(8979),o=i(9760),a=i(271),l=i(2632),c=i(8101),h=i(6906),d={top:"auto",right:"auto",bottom:"auto",left:"auto"};function u(e){var t,i=e.popper,l=e.popperRect,c=e.placement,u=e.variation,f=e.offsets,p=e.position,m=e.gpuAcceleration,g=e.adaptive,_=e.roundOffsets,y=e.isFixed,v=f.x,x=void 0===v?0:v,b=f.y,w=void 0===b?0:b,S="function"==typeof _?_({x,y:w}):{x,y:w};x=S.x,w=S.y;var T=f.hasOwnProperty("x"),k=f.hasOwnProperty("y"),M=n.kb,A=n.Mn,C=window;if(g){var D=(0,r.A)(i),L="clientHeight",E="clientWidth";D===(0,s.A)(i)&&(D=(0,o.A)(i),"static"!==(0,a.A)(D).position&&"absolute"===p&&(L="scrollHeight",E="scrollWidth")),(c===n.Mn||(c===n.kb||c===n.pG)&&u===n._N)&&(A=n.sQ,w-=(y&&D===C&&C.visualViewport?C.visualViewport.height:D[L])-l.height,w*=m?1:-1),c!==n.kb&&(c!==n.Mn&&c!==n.sQ||u!==n._N)||(M=n.pG,x-=(y&&D===C&&C.visualViewport?C.visualViewport.width:D[E])-l.width,x*=m?1:-1)}var I,P=Object.assign({position:p},g&&d),R=!0===_?function(e,t){var i=e.x,n=e.y,r=t.devicePixelRatio||1;return{x:(0,h.LI)(i*r)/r||0,y:(0,h.LI)(n*r)/r||0}}({x,y:w},(0,s.A)(i)):{x,y:w};return x=R.x,w=R.y,m?Object.assign({},P,((I={})[A]=k?"0":"",I[M]=T?"0":"",I.transform=(C.devicePixelRatio||1)<=1?"translate("+x+"px, "+w+"px)":"translate3d("+x+"px, "+w+"px, 0)",I)):Object.assign({},P,((t={})[A]=k?w+"px":"",t[M]=T?x+"px":"",t.transform="",t))}const f={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,n=i.gpuAcceleration,r=void 0===n||n,s=i.adaptive,o=void 0===s||s,a=i.roundOffsets,h=void 0===a||a,d={placement:(0,l.A)(t.placement),variation:(0,c.A)(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,u(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:h})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,u(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:h})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}}},1290:function(e,t,i){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},i={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,i){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(i(5093))},1470:function(e,t,i){!function(e){"use strict";function t(e,t,i){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[i],e)}function i(e){return e>9?i(e%10):e}var n=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(i(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,i){return e<12?"a.m.":"g.m."}})}(i(5093))},1488:function(e,t,i){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},i={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},n=function(e){return function(n,r,s,o){var a=t(n),l=i[e][t(n)];return 2===a&&(l=l[r?0:1]),l.replace(/%d/i,n)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,i){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:n("s"),ss:n("s"),m:n("m"),mm:n("m"),h:n("h"),hh:n("h"),d:n("d"),dd:n("d"),M:n("M"),MM:n("M"),y:n("y"),yy:n("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(i(5093))},1503:(e,t,i)=>{var n,r,s;!function(){"use strict";r=[i(4692)],n=function(e){e.ui=e.ui||{},e.ui.version="1.14.1";var t,i,n=0,r=Array.prototype.hasOwnProperty,s=Array.prototype.slice;e.cleanData=e.cleanData||(t=e.cleanData,function(i){var n,r,s;for(s=0;null!=(r=i[s]);s++)(n=e._data(r,"events"))&&n.remove&&e(r).triggerHandler("remove");t(i)}),e.widget=e.widget||function(t,i,n){var r,s,o,a={},l=t.split(".")[0];if("__proto__"===(t=t.split(".")[1])||"constructor"===t)return e.error("Invalid widget name: "+t);var c=l+"-"+t;return n||(n=i,i=e.Widget),Array.isArray(n)&&(n=e.extend.apply(null,[{}].concat(n))),e.expr.pseudos[c.toLowerCase()]=function(t){return!!e.data(t,c)},e[l]=e[l]||{},r=e[l][t],s=e[l][t]=function(e,t){if(!this||!this._createWidget)return new s(e,t);arguments.length&&this._createWidget(e,t)},e.extend(s,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),(o=new i).options=e.widget.extend({},o.options),e.each(n,function(e,t){a[e]="function"==typeof t?function(){function n(){return i.prototype[e].apply(this,arguments)}function r(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,s=this._superApply;return this._super=n,this._superApply=r,e=t.apply(this,arguments),this._super=i,this._superApply=s,e}}():t}),s.prototype=e.widget.extend(o,{widgetEventPrefix:r&&o.widgetEventPrefix||t},a,{constructor:s,namespace:l,widgetName:t,widgetFullName:c}),r?(e.each(r._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,s,i._proto)}),delete r._childConstructors):i._childConstructors.push(s),e.widget.bridge(t,s),s},e.widget.extend=function(t){for(var i,n,o=s.call(arguments,1),a=0,l=o.length;a<l;a++)for(i in o[a])n=o[a][i],r.call(o[a],i)&&void 0!==n&&(e.isPlainObject(n)?t[i]=e.isPlainObject(t[i])?e.widget.extend({},t[i],n):e.widget.extend({},n):t[i]=n);return t},e.widget.bridge=function(t,i){var n=i.prototype.widgetFullName||t;e.fn[t]=function(r){var o="string"==typeof r,a=s.call(arguments,1),l=this;return o?this.length||"instance"!==r?this.each(function(){var i,s=e.data(this,n);return"instance"===r?(l=s,!1):s?"function"!=typeof s[r]||"_"===r.charAt(0)?e.error("no such method '"+r+"' for "+t+" widget instance"):(i=s[r].apply(s,a))!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0:e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+r+"'")}):l=void 0:(a.length&&(r=e.widget.extend.apply(null,[r].concat(a))),this.each(function(){var t=e.data(this,n);t?(t.option(r||{}),t._init&&t._init()):e.data(this,n,new i(r,this))})),l}},e.Widget=e.Widget||function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,function(e,i){t._removeClass(i,e)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var n,r,s,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},n=t.split("."),t=n.shift(),n.length){for(r=o[t]=e.widget.extend({},this.options[t]),s=0;s<n.length-1;s++)r[n[s]]=r[n[s]]||{},r=r[n[s]];if(t=n.pop(),1===arguments.length)return void 0===r[t]?null:r[t];r[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var i,n,r;for(i in t)r=this.classesElementLookup[i],t[i]!==this.options.classes[i]&&r&&r.length&&(n=e(r.get()),this._removeClass(r,i),n.addClass(this._classes({element:n,keys:i,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){var i=[],n=this;function r(){var i=[];t.element.each(function(t,r){e.map(n.classesElementLookup,function(e){return e}).some(function(e){return e.is(r)})||i.push(r)}),n._on(e(i),{remove:"_untrackClassesElement"})}function s(s,o){var a,l;for(l=0;l<s.length;l++)a=n.classesElementLookup[s[l]]||e(),t.add?(r(),a=e(e.uniqueSort(a.get().concat(t.element.get())))):a=e(a.not(t.element).get()),n.classesElementLookup[s[l]]=a,i.push(s[l]),o&&t.classes[s[l]]&&i.push(t.classes[s[l]])}return(t=e.extend({element:this.element,classes:this.options.classes||{}},t)).keys&&s(t.keys.match(/\S+/g)||[],!0),t.extra&&s(t.extra.match(/\S+/g)||[]),i.join(" ")},_untrackClassesElement:function(t){var i=this;e.each(i.classesElementLookup,function(n,r){-1!==e.inArray(t.target,r)&&(i.classesElementLookup[n]=e(r.not(t.target).get()))}),this._off(e(t.target))},_removeClass:function(e,t,i){return this._toggleClass(e,t,i,!1)},_addClass:function(e,t,i){return this._toggleClass(e,t,i,!0)},_toggleClass:function(e,t,i,n){n="boolean"==typeof n?n:i;var r="string"==typeof e||null===e,s={extra:r?t:i,keys:r?e:t,element:r?this.element:e,add:n};return s.element.toggleClass(this._classes(s),n),this},_on:function(t,i,n){var r,s=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=r=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,r=this.widget()),e.each(n,function(n,o){function a(){if(t||!0!==s.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof o?s[o]:o).apply(s,arguments)}"string"!=typeof o&&(a.guid=o.guid=o.guid||a.guid||e.guid++);var l=n.match(/^([\w:-]*)\s*(.*)$/),c=l[1]+s.eventNamespace,h=l[2];h?r.on(c,h,a):i.on(c,a)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){var i=this;return setTimeout(function(){return("string"==typeof e?i[e]:e).apply(i,arguments)},t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,i,n){var r,s,o=this.options[t];if(n=n||{},(i=e.Event(i)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],s=i.originalEvent)for(r in s)r in i||(i[r]=s[r]);return this.element.trigger(i,n),!("function"==typeof o&&!1===o.apply(this.element[0],[i].concat(n))||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(n,r,s){var o;"string"==typeof r&&(r={effect:r});var a=r?!0===r||"number"==typeof r?i:r.effect||i:t;"number"==typeof(r=r||{})?r={duration:r}:!0===r&&(r={}),o=!e.isEmptyObject(r),r.complete=s,r.delay&&n.delay(r.delay),o&&e.effects&&e.effects.effect[a]?n[t](r):a!==t&&n[a]?n[a](r.duration,r.easing,s):n.queue(function(i){e(this)[t](),s&&s.call(n[0]),i()})}}),e.widget,function(){var t,i=Math.max,n=Math.abs,r=/left|center|right/,s=/top|center|bottom/,o=/[\+\-]\d+(\.[\d]+)?%?/,a=/^\w+/,l=/%$/,c=e.fn.position;function h(e,t,i){return[parseFloat(e[0])*(l.test(e[0])?t/100:1),parseFloat(e[1])*(l.test(e[1])?i/100:1)]}function d(t,i){return parseInt(e.css(t,i),10)||0}function u(e){return null!=e&&e===e.window}e.position=e.position||{scrollbarWidth:function(){if(void 0!==t)return t;var i,n,r=e("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),s=r.children()[0];return e("body").append(r),i=s.offsetWidth,r.css("overflow","scroll"),i===(n=s.offsetWidth)&&(n=r[0].clientWidth),r.remove(),t=i-n},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),n=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),r="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth;return{width:"scroll"===n||"auto"===n&&t.height<t.element[0].scrollHeight?e.position.scrollbarWidth():0,height:r?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),n=u(i[0]),r=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:n,isDocument:r,offset:n||r?{left:0,top:0}:e(t).offset(),scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);var l,f,p,m,g,_,y,v,x="string"==typeof(t=e.extend({},t)).of?e(document).find(t.of):e(t.of),b=e.position.getWithinInfo(t.within),w=e.position.getScrollInfo(b),S=(t.collision||"flip").split(" "),T={};return _=9===(v=(y=x)[0]).nodeType?{width:y.width(),height:y.height(),offset:{top:0,left:0}}:u(v)?{width:y.width(),height:y.height(),offset:{top:y.scrollTop(),left:y.scrollLeft()}}:v.preventDefault?{width:0,height:0,offset:{top:v.pageY,left:v.pageX}}:{width:y.outerWidth(),height:y.outerHeight(),offset:y.offset()},x[0].preventDefault&&(t.at="left top"),f=_.width,p=_.height,m=_.offset,g=e.extend({},m),e.each(["my","at"],function(){var e,i,n=(t[this]||"").split(" ");1===n.length&&(n=r.test(n[0])?n.concat(["center"]):s.test(n[0])?["center"].concat(n):["center","center"]),n[0]=r.test(n[0])?n[0]:"center",n[1]=s.test(n[1])?n[1]:"center",e=o.exec(n[0]),i=o.exec(n[1]),T[this]=[e?e[0]:0,i?i[0]:0],t[this]=[a.exec(n[0])[0],a.exec(n[1])[0]]}),1===S.length&&(S[1]=S[0]),"right"===t.at[0]?g.left+=f:"center"===t.at[0]&&(g.left+=f/2),"bottom"===t.at[1]?g.top+=p:"center"===t.at[1]&&(g.top+=p/2),l=h(T.at,f,p),g.left+=l[0],g.top+=l[1],this.each(function(){var r,s,o=e(this),a=o.outerWidth(),c=o.outerHeight(),u=d(this,"marginLeft"),_=d(this,"marginTop"),y=a+u+d(this,"marginRight")+w.width,v=c+_+d(this,"marginBottom")+w.height,k=e.extend({},g),M=h(T.my,o.outerWidth(),o.outerHeight());"right"===t.my[0]?k.left-=a:"center"===t.my[0]&&(k.left-=a/2),"bottom"===t.my[1]?k.top-=c:"center"===t.my[1]&&(k.top-=c/2),k.left+=M[0],k.top+=M[1],r={marginLeft:u,marginTop:_},e.each(["left","top"],function(i,n){e.ui.position[S[i]]&&e.ui.position[S[i]][n](k,{targetWidth:f,targetHeight:p,elemWidth:a,elemHeight:c,collisionPosition:r,collisionWidth:y,collisionHeight:v,offset:[l[0]+M[0],l[1]+M[1]],my:t.my,at:t.at,within:b,elem:o})}),t.using&&(s=function(e){var r=m.left-k.left,s=r+f-a,l=m.top-k.top,h=l+p-c,d={target:{element:x,left:m.left,top:m.top,width:f,height:p},element:{element:o,left:k.left,top:k.top,width:a,height:c},horizontal:s<0?"left":r>0?"right":"center",vertical:h<0?"top":l>0?"bottom":"middle"};f<a&&n(r+s)<f&&(d.horizontal="center"),p<c&&n(l+h)<p&&(d.vertical="middle"),i(n(r),n(s))>i(n(l),n(h))?d.important="horizontal":d.important="vertical",t.using.call(this,e,d)}),o.offset(e.extend(k,{using:s}))})},e.ui.position={fit:{left:function(e,t){var n,r=t.within,s=r.isWindow?r.scrollLeft:r.offset.left,o=r.width,a=e.left-t.collisionPosition.marginLeft,l=s-a,c=a+t.collisionWidth-o-s;t.collisionWidth>o?l>0&&c<=0?(n=e.left+l+t.collisionWidth-o-s,e.left+=l-n):e.left=c>0&&l<=0?s:l>c?s+o-t.collisionWidth:s:l>0?e.left+=l:c>0?e.left-=c:e.left=i(e.left-a,e.left)},top:function(e,t){var n,r=t.within,s=r.isWindow?r.scrollTop:r.offset.top,o=t.within.height,a=e.top-t.collisionPosition.marginTop,l=s-a,c=a+t.collisionHeight-o-s;t.collisionHeight>o?l>0&&c<=0?(n=e.top+l+t.collisionHeight-o-s,e.top+=l-n):e.top=c>0&&l<=0?s:l>c?s+o-t.collisionHeight:s:l>0?e.top+=l:c>0?e.top-=c:e.top=i(e.top-a,e.top)}},flip:{left:function(e,t){var i,r,s=t.within,o=s.offset.left+s.scrollLeft,a=s.width,l=s.isWindow?s.scrollLeft:s.offset.left,c=e.left-t.collisionPosition.marginLeft,h=c-l,d=c+t.collisionWidth-a-l,u="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,f="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,p=-2*t.offset[0];h<0?((i=e.left+u+f+p+t.collisionWidth-a-o)<0||i<n(h))&&(e.left+=u+f+p):d>0&&((r=e.left-t.collisionPosition.marginLeft+u+f+p-l)>0||n(r)<d)&&(e.left+=u+f+p)},top:function(e,t){var i,r,s=t.within,o=s.offset.top+s.scrollTop,a=s.height,l=s.isWindow?s.scrollTop:s.offset.top,c=e.top-t.collisionPosition.marginTop,h=c-l,d=c+t.collisionHeight-a-l,u="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,p=-2*t.offset[1];h<0?((r=e.top+u+f+p+t.collisionHeight-a-o)<0||r<n(h))&&(e.top+=u+f+p):d>0&&((i=e.top-t.collisionPosition.marginTop+u+f+p-l)>0||n(i)<d)&&(e.top+=u+f+p)}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}}}(),e.ui.position,e.escapeSelector||(e.escapeSelector=function(e){return CSS.escape(e+"")}),e.fn.even&&e.fn.odd||e.fn.extend({even:function(){return this.filter(function(e){return e%2==0})},odd:function(){return this.filter(function(e){return e%2==1})}}),e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.fn.scrollParent=function(t){var i=this.css("position"),n="absolute"===i,r=t?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var t=e(this);return(!n||"static"!==t.css("position"))&&r.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&s.length?s:e(this[0].ownerDocument||document)},e.fn.extend({uniqueId:(i=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++i)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}})},void 0===(s=n.apply(t,r))||(e.exports=s)}()},1509:function(e,t,i){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},i={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,i,s,o){var a=n(t),l=r[e][n(t)];return 2===a&&(l=l[i?0:1]),l.replace(/%d/i,t)}},o=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:o,monthsShort:o,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,i){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return i[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})}(i(5093))},1541:function(e,t,i){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,i){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(i(5093))},1545:function(e,t,i){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},i={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,i){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(i(5093))},1576:(e,t,i)=>{"use strict";i.d(t,{n4:()=>p});var n=i(3424),r=i(9068),s=i(5059),o=i(1262),a=i(6607),l=i(8490),c=i(644),h=i(192),d=i(8256),u=i(9081),f=[r.A,s.A,o.A,a.A,l.A,c.A,h.A,d.A,u.A],p=(0,n.UD)({defaultModifiers:f})},1632:function(e,t,i){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,i){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1200?"上午":1200===n?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(i(5093))},1713:function(e,t,i){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,i){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?i?'לפנה"צ':"לפני הצהריים":e<18?i?'אחה"צ':"אחרי הצהריים":"בערב"}})}(i(5093))},1734:function(e,t,i){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(i(5093))},1765:function(e,t,i){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(i(5093))},1788:function(e,t,i){e.exports=function(e){"use strict";var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(e);const i=(e=>{const t="transitionend",i={TRANSITION_END:"mmTransitionEnd",triggerTransitionEnd(i){e(i).trigger(t)},supportsTransitionEnd:()=>Boolean(t)};return e.fn.mmEmulateTransitionEnd=function(t){let n=!1;return e(this).one(i.TRANSITION_END,()=>{n=!0}),setTimeout(()=>{n||i.triggerTransitionEnd(this)},t),this},e.event.special[i.TRANSITION_END]={bindType:t,delegateType:t,handle(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}},i})(t.default),n="metisMenu",r="metisMenu",s=t.default.fn[n],o={toggle:!0,preventDefault:!0,triggerElement:"a",parentTrigger:"li",subMenu:"ul"},a="show.metisMenu",l="shown.metisMenu",c="hide.metisMenu",h="hidden.metisMenu",d="click.metisMenu.data-api",u="mm-active",f="mm-show",p="mm-collapse",m="mm-collapsing";class g{constructor(e,t){this.element=e,this.config={...o,...t},this.transitioning=null,this.init()}init(){const e=this,i=this.config,n=t.default(this.element);n.addClass("metismenu"),n.find(`${i.parentTrigger}.${u}`).children(i.triggerElement).attr("aria-expanded","true"),n.find(`${i.parentTrigger}.${u}`).parents(i.parentTrigger).addClass(u),n.find(`${i.parentTrigger}.${u}`).parents(i.parentTrigger).children(i.triggerElement).attr("aria-expanded","true"),n.find(`${i.parentTrigger}.${u}`).has(i.subMenu).children(i.subMenu).addClass(`${p} ${f}`),n.find(i.parentTrigger).not(`.${u}`).has(i.subMenu).children(i.subMenu).addClass(p),n.find(i.parentTrigger).children(i.triggerElement).on(d,function(n){const r=t.default(this);if("true"===r.attr("aria-disabled"))return;i.preventDefault&&"#"===r.attr("href")&&n.preventDefault();const s=r.parent(i.parentTrigger),o=s.siblings(i.parentTrigger),a=o.children(i.triggerElement);s.hasClass(u)?(r.attr("aria-expanded","false"),e.removeActive(s)):(r.attr("aria-expanded","true"),e.setActive(s),i.toggle&&(e.removeActive(o),a.attr("aria-expanded","false"))),i.onTransitionStart&&i.onTransitionStart(n)})}setActive(e){t.default(e).addClass(u);const i=t.default(e).children(this.config.subMenu);i.length>0&&!i.hasClass(f)&&this.show(i)}removeActive(e){t.default(e).removeClass(u);const i=t.default(e).children(`${this.config.subMenu}.${f}`);i.length>0&&this.hide(i)}show(e){if(this.transitioning||t.default(e).hasClass(m))return;const n=t.default(e),r=t.default.Event(a);if(n.trigger(r),!r.isDefaultPrevented()){if(n.parent(this.config.parentTrigger).addClass(u),this.config.toggle){const e=n.parent(this.config.parentTrigger).siblings().children(`${this.config.subMenu}.${f}`);this.hide(e)}n.removeClass(p).addClass(m).height(0),this.setTransitioning(!0),n.height(e[0].scrollHeight).one(i.TRANSITION_END,()=>{this.config&&this.element&&(n.removeClass(m).addClass(`${p} ${f}`).height(""),this.setTransitioning(!1),n.trigger(l))}).mmEmulateTransitionEnd(350)}}hide(e){if(this.transitioning||!t.default(e).hasClass(f))return;const n=t.default(e),r=t.default.Event(c);if(n.trigger(r),r.isDefaultPrevented())return;n.parent(this.config.parentTrigger).removeClass(u),n.height(n.height())[0].offsetHeight,n.addClass(m).removeClass(p).removeClass(f),this.setTransitioning(!0);const s=()=>{this.config&&this.element&&(this.transitioning&&this.config.onTransitionEnd&&this.config.onTransitionEnd(),this.setTransitioning(!1),n.trigger(h),n.removeClass(m).addClass(p))};0===n.height()||"none"===n.css("display")?s():n.height(0).one(i.TRANSITION_END,s).mmEmulateTransitionEnd(350)}setTransitioning(e){this.transitioning=e}dispose(){t.default.removeData(this.element,r),t.default(this.element).find(this.config.parentTrigger).children(this.config.triggerElement).off(d),this.transitioning=null,this.config=null,this.element=null}static jQueryInterface(e){return this.each(function(){const i=t.default(this);let n=i.data(r);const s={...o,...i.data(),..."object"==typeof e&&e?e:{}};if(n||(n=new g(this,s),i.data(r,n)),"string"==typeof e){if(void 0===n[e])throw new Error(`No method named "${e}"`);n[e]()}})}}return t.default.fn[n]=g.jQueryInterface,t.default.fn[n].Constructor=g,t.default.fn[n].noConflict=()=>(t.default.fn[n]=s,g.jQueryInterface),g}(i(4692))},1794:function(e,t,i){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,function(e,t,i){return"ი"===i?t+"ში":t+i+"ში"})},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(i(5093))},1815:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>a}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(2632);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(8101);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(9703);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(4278);function a(e){var t,i=e.reference,a=e.element,l=e.placement,c=l?(0,n.A)(l):null,h=l?(0,r.A)(l):null,d=i.x+i.width/2-a.width/2,u=i.y+i.height/2-a.height/2;switch(c){case o.Mn:t={x:d,y:i.y-a.height};break;case o.sQ:t={x:d,y:i.y+i.height};break;case o.pG:t={x:i.x+i.width,y:u};break;case o.kb:t={x:i.x-a.width,y:u};break;default:t={x:i.x,y:i.y}}var f=c?(0,s.A)(c):null;if(null!=f){var p="y"===f?"height":"width";switch(h){case o.ni:t[f]=t[f]-(i[p]/2-a[p]/2);break;case o._N:t[f]=t[f]+(i[p]/2-a[p]/2)}}return t}},1827:function(e,t,i){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){return 0===this.day()?"[la scorsa] dddd [alle] LT":"[lo scorso] dddd [alle] LT"},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(i(5093))},1848:function(e,t,i){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(i(5093))},1885:function(e,t,i){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,i){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(i(5093))},2063:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>r}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(7604);function r(e){return["table","td","th"].indexOf((0,n.A)(e))>=0}},2083:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>o}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(7604);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(9760);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(5581);function o(e){return"html"===(0,n.A)(e)?e:e.assignedSlot||e.parentNode||((0,s.Ng)(e)?e.host:null)||(0,r.A)(e)}},2124:function(e,t,i){!function(e){"use strict";function t(e,t,i,n){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return n?r[i][0]:r[i][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){return"D"===t?e+"वेर":e},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,i){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(i(5093))},2218:function(e,t,i){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(i(5093))},2264:function(e,t,i){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},i={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},week:{dow:1,doy:4}})}(i(5093))},2271:function(e,t,i){!function(e){"use strict";function t(e,t,i){return"m"===i?t?"минута":"минуту":e+" "+(n=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[i].split("_"),n%10==1&&n%100!=11?r[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?r[1]:r[2]);var n,r}var i=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:i,longMonthsParse:i,shortMonthsParse:i,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,i){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(i(5093))},2274:function(e,t,i){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"én time",hh:"%d timer",d:"én dag",dd:"%d dager",w:"én uke",ww:"%d uker",M:"én måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},2283:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>r}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(2398);function r(){return!/^((?!chrome|android).)*safari/i.test((0,n.A)())}},2297:function(e,t,i){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,i){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(i(5093))},2323:(e,t,i)=>{"use strict";i.d(t,{v:()=>n});class n{constructor(e){this.element=e,this.verticalBorderSize=this._styleProp("borderTopWidth")+this._styleProp("borderBottomWidth")||0,this._inputHandler=this._inputHandler.bind(this),e.addEventListener("input",this._inputHandler),this.update()}_inputHandler(e){this.update()}destroy(){this.removeEventListener("input",this._inputHandler),this.element=null}update(){const e=this._styleProp("fontSize");this.element.style.height=`${e}px`;const t=this.element.scrollHeight+this.verticalBorderSize;this.element.style.height=`${t}px`}_styleProp(e){const t=getComputedStyle(this.element,null);return parseInt(t[e])}}},2353:function(e,t,i){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},i=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,o){var a=i(t),l=n[e][i(t)];return 2===a&&(l=l[r?0:1]),l.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,i){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})}(i(5093))},2398:(e,t,i)=>{"use strict";function n(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}i.d(t,{A:()=>n})},2475:function(e,t,i){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(i(5093))},2477:function(e,t,i){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},2572:function(e,t,i){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),i="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),n=[/^jan/i,/^feb/i,/^(maart|mrt\.?)$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,n){return e?/-MMM-/.test(n)?i[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(i(5093))},2632:(e,t,i)=>{"use strict";function n(e){return e.split("-")[0]}i.d(t,{A:()=>n})},2648:function(e,t,i){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,i){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(i(5093))},2682:function(e,t,i){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},i={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,i){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return i[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:0,doy:6}})}(i(5093))},2883:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>y}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(4278);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(5487);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(8848);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(3341);if(/^(7(06|92|96)|140)$/.test(i.j))var a=i(5128);if(/^(7(06|92|96)|140)$/.test(i.j))var l=i(9760);if(/^(7(06|92|96)|140)$/.test(i.j))var c=i(271);if(/^(7(06|92|96)|140)$/.test(i.j))var h=i(5581);if(/^(7(06|92|96)|140)$/.test(i.j))var d=i(6354);if(/^(7(06|92|96)|140)$/.test(i.j))var u=i(2083);if(/^(7(06|92|96)|140)$/.test(i.j))var f=i(5446);if(/^(7(06|92|96)|140)$/.test(i.j))var p=i(7604);if(/^(7(06|92|96)|140)$/.test(i.j))var m=i(4426);if(/^(7(06|92|96)|140)$/.test(i.j))var g=i(6906);function _(e,t,i){return t===n.R9?(0,m.A)((0,r.A)(e,i)):(0,h.vq)(t)?function(e,t){var i=(0,d.A)(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):(0,m.A)((0,s.A)((0,l.A)(e)))}function y(e,t,i,n){var r="clippingParents"===t?function(e){var t=(0,o.A)((0,u.A)(e)),i=["absolute","fixed"].indexOf((0,c.A)(e).position)>=0&&(0,h.sb)(e)?(0,a.A)(e):e;return(0,h.vq)(i)?t.filter(function(e){return(0,h.vq)(e)&&(0,f.A)(e,i)&&"body"!==(0,p.A)(e)}):[]}(e):[].concat(t),s=[].concat(r,[i]),l=s[0],d=s.reduce(function(t,i){var r=_(e,i,n);return t.top=(0,g.T9)(r.top,t.top),t.right=(0,g.jk)(r.right,t.right),t.bottom=(0,g.jk)(r.bottom,t.bottom),t.left=(0,g.T9)(r.left,t.left),t},_(e,l,n));return d.width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d}},2934:function(e,t,i){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,i){return e>11?i?"p.t.m.":"P.T.M.":i?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(i(5093))},3004:function(e,t,i){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(i(5093))},3035:function(e,t,i){!function(e){"use strict";function t(e,t,i,n){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[i][2]?r[i][2]:r[i][1]:n?r[i][0]:r[i][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},3041:(e,t,i)=>{"use strict";i.d(t,{A:()=>g});var n=i(7363),r=i(9174),s=i(172);class o extends r.B{constructor(){super(...arguments),this.state={textId:(0,r.a3)()}}render(){let{theme:e,dateEnv:t,options:i,viewApi:n}=this.context,{cellId:o,dayDate:l,todayRange:c}=this.props,{textId:h}=this.state,d=(0,r.aY)(l,c),u=i.listDayFormat?t.format(l,i.listDayFormat):"",f=i.listDaySideFormat?t.format(l,i.listDaySideFormat):"",p=Object.assign({date:t.toDate(l),view:n,textId:h,text:u,sideText:f,navLinkAttrs:(0,r.a_)(this.context,l),sideNavLinkAttrs:(0,r.a_)(this.context,l,"day",!1)},d);return(0,s.n)(r.C,{elTag:"tr",elClasses:["fc-list-day",...(0,r.aX)(d,e)],elAttrs:{"data-date":(0,r.bt)(l)},renderProps:p,generatorName:"dayHeaderContent",customGenerator:i.dayHeaderContent,defaultGenerator:a,classNameGenerator:i.dayHeaderClassNames,didMount:i.dayHeaderDidMount,willUnmount:i.dayHeaderWillUnmount},t=>(0,s.n)("th",{scope:"colgroup",colSpan:3,id:o,"aria-labelledby":h},(0,s.n)(t,{elTag:"div",elClasses:["fc-list-day-cushion",e.getClass("tableCellShaded")]})))}}function a(e){return(0,s.n)(s.FK,null,e.text&&(0,s.n)("a",Object.assign({id:e.textId,className:"fc-list-day-text"},e.navLinkAttrs),e.text),e.sideText&&(0,s.n)("a",Object.assign({"aria-hidden":!0,className:"fc-list-day-side-text"},e.sideNavLinkAttrs),e.sideText))}const l=(0,r.x)({hour:"numeric",minute:"2-digit",meridiem:"short"});class c extends r.B{render(){let{props:e,context:t}=this,{options:i}=t,{seg:n,timeHeaderId:o,eventHeaderId:a,dateHeaderId:c}=e,d=i.eventTimeFormat||l;return(0,s.n)(r.ck,Object.assign({},e,{elTag:"tr",elClasses:["fc-list-event",n.eventRange.def.url&&"fc-event-forced-url"],defaultGenerator:()=>function(e,t){let i=(0,r.bS)(e,t);return(0,s.n)("a",Object.assign({},i),e.eventRange.def.title)}(n,t),seg:n,timeText:"",disableDragging:!0,disableResizing:!0}),(e,i)=>(0,s.n)(s.FK,null,function(e,t,i,n,o){let{options:a}=i;if(!1!==a.displayEventTime){let l,c=e.eventRange.def,d=e.eventRange.instance,u=!1;if(c.allDay?u=!0:(0,r.ax)(e.eventRange.range)?e.isStart?l=(0,r.bO)(e,t,i,null,null,d.range.start,e.end):e.isEnd?l=(0,r.bO)(e,t,i,null,null,e.start,d.range.end):u=!0:l=(0,r.bO)(e,t,i),u){let e={text:i.options.allDayText,view:i.viewApi};return(0,s.n)(r.C,{elTag:"td",elClasses:["fc-list-event-time"],elAttrs:{headers:`${n} ${o}`},renderProps:e,generatorName:"allDayContent",customGenerator:a.allDayContent,defaultGenerator:h,classNameGenerator:a.allDayClassNames,didMount:a.allDayDidMount,willUnmount:a.allDayWillUnmount})}return(0,s.n)("td",{className:"fc-list-event-time"},l)}return null}(n,d,t,o,c),(0,s.n)("td",{"aria-hidden":!0,className:"fc-list-event-graphic"},(0,s.n)("span",{className:"fc-list-event-dot",style:{borderColor:i.borderColor||i.backgroundColor}})),(0,s.n)(e,{elTag:"td",elClasses:["fc-list-event-title"],elAttrs:{headers:`${a} ${c}`}})))}}function h(e){return e.text}class d extends r.bc{constructor(){super(...arguments),this.computeDateVars=(0,r.z)(f),this.eventStoreToSegs=(0,r.z)(this._eventStoreToSegs),this.state={timeHeaderId:(0,r.a3)(),eventHeaderId:(0,r.a3)(),dateHeaderIdRoot:(0,r.a3)()},this.setRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:t}=this,{dayDates:i,dayRanges:n}=this.computeDateVars(e.dateProfile),o=this.eventStoreToSegs(e.eventStore,e.eventUiBases,n);return(0,s.n)(r.cq,{elRef:this.setRootEl,elClasses:["fc-list",t.theme.getClass("table"),!1!==t.options.stickyHeaderDates?"fc-list-sticky":""],viewSpec:t.viewSpec},(0,s.n)(r.cb,{liquid:!e.isHeightAuto,overflowX:e.isHeightAuto?"visible":"hidden",overflowY:e.isHeightAuto?"visible":"auto"},o.length>0?this.renderSegList(o,i):this.renderEmptyMessage()))}renderEmptyMessage(){let{options:e,viewApi:t}=this.context,i={text:e.noEventsText,view:t};return(0,s.n)(r.C,{elTag:"div",elClasses:["fc-list-empty"],renderProps:i,generatorName:"noEventsContent",customGenerator:e.noEventsContent,defaultGenerator:u,classNameGenerator:e.noEventsClassNames,didMount:e.noEventsDidMount,willUnmount:e.noEventsWillUnmount},e=>(0,s.n)(e,{elTag:"div",elClasses:["fc-list-empty-cushion"]}))}renderSegList(e,t){let{theme:i,options:n}=this.context,{timeHeaderId:a,eventHeaderId:l,dateHeaderIdRoot:h}=this.state,d=function(e){let t,i,n=[];for(t=0;t<e.length;t+=1)i=e[t],(n[i.dayIndex]||(n[i.dayIndex]=[])).push(i);return n}(e);return(0,s.n)(r.a6,{unit:"day"},(e,u)=>{let f=[];for(let i=0;i<d.length;i+=1){let p=d[i];if(p){let d=(0,r.bt)(t[i]),m=h+"-"+d;f.push((0,s.n)(o,{key:d,cellId:m,dayDate:t[i],todayRange:u})),p=(0,r.bP)(p,n.eventOrder);for(let t of p)f.push((0,s.n)(c,Object.assign({key:d+":"+t.eventRange.instance.instanceId,seg:t,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,timeHeaderId:a,eventHeaderId:l,dateHeaderId:m},(0,r.bQ)(t,u,e))))}}return(0,s.n)("table",{className:"fc-list-table "+i.getClass("table")},(0,s.n)("thead",null,(0,s.n)("tr",null,(0,s.n)("th",{scope:"col",id:a},n.timeHint),(0,s.n)("th",{scope:"col","aria-hidden":!0}),(0,s.n)("th",{scope:"col",id:l},n.eventHint))),(0,s.n)("tbody",null,f))})}_eventStoreToSegs(e,t,i){return this.eventRangesToSegs((0,r.ad)(e,t,this.props.dateProfile.activeRange,this.context.options.nextDayThreshold).fg,i)}eventRangesToSegs(e,t){let i=[];for(let n of e)i.push(...this.eventRangeToSegs(n,t));return i}eventRangeToSegs(e,t){let i,n,s,{dateEnv:o}=this.context,{nextDayThreshold:a}=this.context.options,l=e.range,c=e.def.allDay,h=[];for(i=0;i<t.length;i+=1)if(n=(0,r.o)(l,t[i]),n&&(s={component:this,eventRange:e,start:n.start,end:n.end,isStart:e.isStart&&n.start.valueOf()===l.start.valueOf(),isEnd:e.isEnd&&n.end.valueOf()===l.end.valueOf(),dayIndex:i},h.push(s),!s.isEnd&&!c&&i+1<t.length&&l.end<o.add(t[i+1].start,a))){s.end=l.end,s.isEnd=!0;break}return h}}function u(e){return e.text}function f(e){let t=(0,r.q)(e.renderRange.start),i=e.renderRange.end,n=[],s=[];for(;t<i;)n.push(t),s.push({start:t,end:(0,r.t)(t,1)}),t=(0,r.t)(t,1);return{dayDates:n,dayRanges:s}}(0,r.ct)(':root{--fc-list-event-dot-width:10px;--fc-list-event-hover-bg-color:#f5f5f5}.fc-theme-standard .fc-list{border:1px solid var(--fc-border-color)}.fc .fc-list-empty{align-items:center;background-color:var(--fc-neutral-bg-color);display:flex;height:100%;justify-content:center}.fc .fc-list-empty-cushion{margin:5em 0}.fc .fc-list-table{border-style:hidden;width:100%}.fc .fc-list-table tr>*{border-left:0;border-right:0}.fc .fc-list-sticky .fc-list-day>*{background:var(--fc-page-bg-color);position:sticky;top:0}.fc .fc-list-table thead{left:-10000px;position:absolute}.fc .fc-list-table tbody>tr:first-child th{border-top:0}.fc .fc-list-table th{padding:0}.fc .fc-list-day-cushion,.fc .fc-list-table td{padding:8px 14px}.fc .fc-list-day-cushion:after{clear:both;content:"";display:table}.fc-theme-standard .fc-list-day-cushion{background-color:var(--fc-neutral-bg-color)}.fc-direction-ltr .fc-list-day-text,.fc-direction-rtl .fc-list-day-side-text{float:left}.fc-direction-ltr .fc-list-day-side-text,.fc-direction-rtl .fc-list-day-text{float:right}.fc-direction-ltr .fc-list-table .fc-list-event-graphic{padding-right:0}.fc-direction-rtl .fc-list-table .fc-list-event-graphic{padding-left:0}.fc .fc-list-event.fc-event-forced-url{cursor:pointer}.fc .fc-list-event:hover td{background-color:var(--fc-list-event-hover-bg-color)}.fc .fc-list-event-graphic,.fc .fc-list-event-time{white-space:nowrap;width:1px}.fc .fc-list-event-dot{border:calc(var(--fc-list-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-list-event-dot-width)/2);box-sizing:content-box;display:inline-block;height:0;width:0}.fc .fc-list-event-title a{color:inherit;text-decoration:none}.fc .fc-list-event.fc-event-forced-url:hover a{text-decoration:underline}');const p={listDayFormat:m,listDaySideFormat:m,noEventsClassNames:r.n,noEventsContent:r.n,noEventsDidMount:r.n,noEventsWillUnmount:r.n};function m(e){return!1===e?null:(0,r.x)(e)}var g=(0,n.i1)({name:"@fullcalendar/list",optionRefiners:p,views:{list:{component:d,buttonTextKey:"list",listDayFormat:{month:"long",day:"numeric",year:"numeric"}},listDay:{type:"list",duration:{days:1},listDayFormat:{weekday:"long"}},listWeek:{type:"list",duration:{weeks:1},listDayFormat:{weekday:"long"},listDaySideFormat:{month:"long",day:"numeric",year:"numeric"}},listMonth:{type:"list",duration:{month:1},listDaySideFormat:{weekday:"long"}},listYear:{type:"list",duration:{year:1},listDaySideFormat:{weekday:"long"}}}})},3104:(e,t,i)=>{"use strict";i.d(t,{A:()=>mt});var n=i(4692);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function s(e){if(Array.isArray(e))return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,x(n.key),n)}}function l(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=w(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){a=!0,s=e},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}function h(e,t,i){return(t=x(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function f(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function p(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(){m=function(){return t};var e,t={},i=Object.prototype,n=i.hasOwnProperty,r=Object.defineProperty||function(e,t,i){e[t]=i.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function c(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,i){return e[t]=i}}function h(e,t,i,n){var s=t&&t.prototype instanceof _?t:_,o=Object.create(s.prototype),a=new L(n||[]);return r(o,"_invoke",{value:M(e,i,a)}),o}function d(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var u="suspendedStart",f="executing",p="completed",g={};function _(){}function y(){}function v(){}var x={};c(x,o,function(){return this});var b=Object.getPrototypeOf,w=b&&b(b(E([])));w&&w!==i&&n.call(w,o)&&(x=w);var S=v.prototype=_.prototype=Object.create(x);function T(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function k(e,t){function i(r,s,o,a){var l=d(e[r],e,s);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then(function(e){i("next",e,o,a)},function(e){i("throw",e,o,a)}):t.resolve(h).then(function(e){c.value=e,o(c)},function(e){return i("throw",e,o,a)})}a(l.arg)}var s;r(this,"_invoke",{value:function(e,n){function r(){return new t(function(t,r){i(e,n,t,r)})}return s=s?s.then(r,r):r()}})}function M(t,i,n){var r=u;return function(s,o){if(r===f)throw Error("Generator is already running");if(r===p){if("throw"===s)throw o;return{value:e,done:!0}}for(n.method=s,n.arg=o;;){var a=n.delegate;if(a){var l=A(a,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===u)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var c=d(t,i,n);if("normal"===c.type){if(r=n.done?p:"suspendedYield",c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=p,n.method="throw",n.arg=c.arg)}}}function A(t,i){var n=i.method,r=t.iterator[n];if(r===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,A(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var s=d(r,t.iterator,i.arg);if("throw"===s.type)return i.method="throw",i.arg=s.arg,i.delegate=null,g;var o=s.arg;return o?o.done?(i[t.resultName]=o.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,g):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function E(t){if(t||""===t){var i=t[o];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function i(){for(;++r<t.length;)if(n.call(t,r))return i.value=t[r],i.done=!1,i;return i.value=e,i.done=!0,i};return s.next=s}}throw new TypeError(typeof t+" is not iterable")}return y.prototype=v,r(S,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:y,configurable:!0}),y.displayName=c(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,c(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},T(k.prototype),c(k.prototype,a,function(){return this}),t.AsyncIterator=k,t.async=function(e,i,n,r,s){void 0===s&&(s=Promise);var o=new k(h(e,i,n,r),s);return t.isGeneratorFunction(i)?o:o.next().then(function(e){return e.done?e.value:o.next()})},T(S),c(S,l,"Generator"),c(S,o,function(){return this}),c(S,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=E,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function r(n,r){return a.type="throw",a.arg=t,i.next=n,r&&(i.method="next",i.arg=e),!!r}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var s=r;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=e,o.arg=t,s?(this.method="next",this.next=s.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),D(i),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;D(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:E(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function _(e,t){return s(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(e,t)||w(e,t)||p()}function y(e){return s(e)||f(e)||w(e)||p()}function v(e){return function(e){if(Array.isArray(e))return r(e)}(e)||f(e)||w(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function w(e,t){if(e){if("string"==typeof e)return r(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(e,t):void 0}}function S(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}function T(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function k(e){if(null===e||"object"!==b(e)||"nodeType"in e)return e;var t={};for(var i in e)"jQuery"in window&&n&&e[i]instanceof n?t[i]=e[i]:t[i]=k(e[i]);return t}"function"==typeof SuppressedError&&SuppressedError;var M=function(e,t){return(null!=t?t:document).querySelector(e)},A=function(e,t){return(null!=t?t:document).querySelectorAll(e)},C=function(e){e.setHints([]);var t=e.getTargetElement(),i=e.getOption("hints");if(i&&i.length>0){var n,r=c(i);try{for(r.s();!(n=r.n()).done;){var s=k(n.value);"string"==typeof s.element&&(s.element=M(s.element)),s.hintPosition=s.hintPosition||e.getOption("hintPosition"),s.hintAnimation=s.hintAnimation||e.getOption("hintAnimation"),null!==s.element&&e.addHint(s)}}catch(e){r.e(e)}finally{r.f()}}else{var o=Array.from(A("*[".concat("data-hint","]"),t));if(!o||!o.length)return!1;for(var a=0,l=o;a<l.length;a++){var h=l[a],d=h.getAttribute("data-hint-position"),u=e.getOption("hintAnimation");d&&(u="true"===d),e.addHint({element:h,hint:h.getAttribute("data-hint")||"",hintPosition:h.getAttribute("data-hint-position")||e.getOption("hintPosition"),hintAnimation:u,tooltipClass:h.getAttribute("data-tooltip-class")||void 0,position:h.getAttribute("data-position")||e.getOption("tooltipPosition")})}}return!0};function D(e,t,i){return e[t]=i,e}function L(e,t){for(var i=0,n=Object.entries(t);i<n.length;i++){var r=_(n[i],2);e=D(e,r[0],r[1])}return e}var E,I,P,R,O,z=function(e){return"function"==typeof e},F=new(function(){function e(){o(this,e)}return l(e,[{key:"on",value:function(e,t,i,n){"addEventListener"in e?e.addEventListener(t,i,n):"attachEvent"in e&&e.attachEvent("on".concat(t),i)}},{key:"off",value:function(e,t,i,n){"removeEventListener"in e?e.removeEventListener(t,i,n):"detachEvent"in e&&e.detachEvent("on".concat(t),i)}}]),e}()),N=function(e){return e?"string"==typeof e?function(e){var t=M(e,void 0);if(!t)throw new Error("Element with selector ".concat(e," not found"));return t}(e):e:document.body};function Y(e,t){var i;return T(this,void 0,void 0,m().mark(function n(){var r;return m().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:(r=t.isActive)&&(r.val=!1),e.hideHintDialog(),null===(i=e.callback("hintClose"))||void 0===i||i.call(e,t);case 4:case"end":return n.stop()}},n)}))}function B(e){return T(this,void 0,void 0,m().mark(function t(){var i,n,r;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i=c(e.getHints()),t.prev=1,i.s();case 3:if((n=i.n()).done){t.next=9;break}return r=n.value,t.next=7,Y(e,r);case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),i.e(t.t0);case 14:return t.prev=14,i.f(),t.finish(14);case 17:case"end":return t.stop()}},t,null,[[1,11,14,17]])}))}function H(e){return T(this,void 0,void 0,m().mark(function t(){var i,n;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isRendered()){t.next=5;break}i=c(e.getHints());try{for(i.s();!(n=i.n()).done;)j(n.value)}catch(e){i.e(e)}finally{i.f()}t.next=7;break;case 5:return t.next=7,e.render();case 7:case"end":return t.stop()}},t)}))}function j(e){var t=e.isActive;t&&(t.val=!0)}var V=Object,W=document,U=V.getPrototypeOf,$={isConnected:1},G={},X=U($),q=Function.prototype,Z=function(e,t,i,n){return void 0===e&&(setTimeout(i,n),e=new Set),e.add(t),e},J=function(e,t,i){var n=P;P=t;try{return e(i)}catch(e){return console.error(e),i}finally{P=n}},K=function(e){return e.filter(function(e){var t;return null===(t=e._dom)||void 0===t?void 0:t.isConnected})},Q=function(e){O=Z(O,e,function(){if(O){var e,t=c(O);try{for(t.s();!(e=t.n()).done;){var i=e.value;i._bindings=K(i._bindings),i._listeners=K(i._listeners)}}catch(e){t.e(e)}finally{t.f()}O=void 0}},1e3)},ee={get val(){var e;return null===(e=null==P?void 0:P._getters)||void 0===e||e.add(this),this.rawVal},get oldVal(){var e;return null===(e=null==P?void 0:P._getters)||void 0===e||e.add(this),this._oldVal},set val(e){var t,i=this;null===(t=null==P?void 0:P._setters)||void 0===t||t.add(i),e!==i.rawVal&&(i.rawVal=e,i._bindings.length+i._listeners.length?(null==I||I.add(i),E=Z(E,i,he)):i._oldVal=e)}},te=function(e){return{writable:!0,configurable:!0,enumerable:!0,value:e}},ie=function(e){return V.create(ee,{rawVal:te(e),_oldVal:te(e),_bindings:te([]),_listeners:te([])})},ne=function(e,t){var i={_getters:new Set,_setters:new Set},n={f:e},r=R;R=[];var s=J(e,i,t);s=(null!=s?s:W).nodeType?s:new Text(s);var o,a=c(i._getters);try{for(a.s();!(o=a.n()).done;){var l=o.value;i._setters.has(l)||(Q(l),l._bindings.push(n))}}catch(e){a.e(e)}finally{a.f()}var h,d=c(R);try{for(d.s();!(h=d.n()).done;)h.value._dom=s}catch(e){d.e(e)}finally{d.f()}return R=r,n._dom=s},re=function(e,t,i){var n;t=null!=t?t:ie();var r={_getters:new Set,_setters:new Set},s={f:e,s:t};s._dom=null!==(n=null!=i?i:null==R?void 0:R.push(s))&&void 0!==n?n:$,t.val=J(e,r,t.rawVal);var o,a=c(r._getters);try{for(a.s();!(o=a.n()).done;){var l=o.value;r._setters.has(l)||(Q(l),l._listeners.push(s))}}catch(e){a.e(e)}finally{a.f()}return t},se=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];var r,s=c(i.flat(1/0));try{var o=function(){var t=r.value,i=U(null!=t?t:0),n=i===ee?ne(function(){return t.val}):i===q?ne(t):t;null!=n&&e.append(n)};for(s.s();!(r=s.n()).done;)o()}catch(e){s.e(e)}finally{s.f()}return e},oe=function(e,t){for(var i,n,r,s,o=arguments.length,a=new Array(o>2?o-2:0),l=2;l<o;l++)a[l-2]=arguments[l];var h,d=y(U(null!==(i=a[0])&&void 0!==i?i:0)===X?a:[{}].concat(a)),u=d[0],f=d.slice(1),p=e?W.createElementNS(e,t):W.createElement(t),m=c(V.entries(u));try{var g=function(){var e=_(h.value,2),i=e[0],o=e[1],a="".concat(t,",").concat(i),l=null!==(n=G[a])&&void 0!==n?n:G[a]=null!==(s=null===(r=function e(t){var n;return t?null!==(n=V.getOwnPropertyDescriptor(t,i))&&void 0!==n?n:e(U(t)):void 0}(U(p)))||void 0===r?void 0:r.set)&&void 0!==s?s:0,c=i.startsWith("on")?function(e,t){var n=i.slice(2);t&&p.removeEventListener(n,t),p.addEventListener(n,e)}:l?l.bind(p):p.setAttribute.bind(p,i),d=U(null!=o?o:0);i.startsWith("on")||d===q&&(o=re(o),d=ee),d===ee?ne(function(){return c(o.val,o._oldVal),p}):c(o)};for(m.s();!(h=m.n()).done;)g()}catch(e){m.e(e)}finally{m.f()}return se.apply(void 0,[p].concat(v(f)))},ae=function(e){return{get:function(t,i){return oe.bind(void 0,null!=e?e:null,i)}}},le=new Proxy(function(e){return new Proxy(oe,ae(e))},ae()),ce=function(e,t){t?t!==e&&e.replaceWith(t):e.remove()},he=function(){var e=0,t=E?v(E).filter(function(e){return e.rawVal!==e._oldVal}):[];do{I=new Set;var i,n=c(new Set(t.flatMap(function(e){return e._listeners=K(e._listeners)})));try{for(n.s();!(i=n.n()).done;){var r=i.value;re(r.f,r.s,r._dom),r._dom=void 0}}catch(e){n.e(e)}finally{n.f()}}while(++e<100&&(t=v(I)).length);var s=E?v(E).filter(function(e){return e.rawVal!==e._oldVal}):[];E=void 0;var o,a=c(new Set(s.flatMap(function(e){return e._bindings=K(e._bindings)})));try{for(a.s();!(o=a.n()).done;){var l=o.value;l._dom&&ce(l._dom,ne(l.f,l._dom)),l._dom=void 0}}catch(e){a.e(e)}finally{a.f()}var h,d=c(s);try{for(d.s();!(h=d.n()).done;){var u=h.value;u._oldVal=u.rawVal}}catch(e){d.e(e)}finally{d.f()}},de={add:se,tags:le,state:ie,derive:re,hydrate:function(e,t){return ce(e,ne(t,e))}},ue="introjs-hints";function fe(e,t){var i="";return"currentStyle"in e?i=e.currentStyle[t]:document.defaultView&&document.defaultView.getComputedStyle&&(i=document.defaultView.getComputedStyle(e,null).getPropertyValue(t)),i&&i.toLowerCase?i.toLowerCase():i}function pe(e){var t=e.parentElement;return!(!t||"HTML"===t.nodeName)&&("fixed"===fe(e,"position")||pe(t))}function me(e,t){var i=document.body,n=document.documentElement,r=window.pageYOffset||n.scrollTop||i.scrollTop,s=window.pageXOffset||n.scrollLeft||i.scrollLeft;t=t||i;var o=e.getBoundingClientRect(),a=t.getBoundingClientRect(),l=fe(t,"position"),c={top:0,left:0};return c="body"!==t.tagName.toLowerCase()&&"relative"===l||"sticky"===l?Object.assign(c,{top:o.top-a.top,left:o.left-a.left}):pe(e)?Object.assign(c,{top:o.top,left:o.left}):Object.assign(c,{top:o.top+r,left:o.left+s}),Object.assign(Object.assign({},c),{width:o.width,height:o.height,bottom:c.top+o.height,right:c.left+o.width,absoluteTop:o.top,absoluteLeft:o.left,absoluteBottom:o.bottom,absoluteRight:o.right})}var ge=de.tags,_e=ge.a,ye=ge.div,ve=function(e){var t,i=e.index,n=e.hintItem,r=e.onClick,s=e.refreshesSignal,o=_e((h(t={},"data-step",i.toString()),h(t,"className",function(){return function(e){var t,i=["introjs-hint"];return e.hintAnimation||i.push("introjs-hint-no-anim"),pe(e.element)&&i.push("introjs-fixedhint"),(null===(t=e.isActive)||void 0===t?void 0:t.val)||i.push("introjs-hidehint"),i.join(" ")}(n)}),h(t,"role","button"),h(t,"tabindex",0),h(t,"onclick",r),t),ye({className:"introjs-hint-dot"}),ye({className:"introjs-hint-pulse"}));return de.derive(function(){void 0!==s.val&&function(e,t,i){if(void 0!==i){var n=me(i),r=20,s=20;switch(e){default:case"top-left":t.style.left="".concat(n.left,"px"),t.style.top="".concat(n.top,"px");break;case"top-right":t.style.left="".concat(n.left+n.width-r,"px"),t.style.top="".concat(n.top,"px");break;case"bottom-left":t.style.left="".concat(n.left,"px"),t.style.top="".concat(n.top+n.height-s,"px");break;case"bottom-right":t.style.left="".concat(n.left+n.width-r,"px"),t.style.top="".concat(n.top+n.height-s,"px");break;case"middle-left":t.style.left="".concat(n.left,"px"),t.style.top="".concat(n.top+(n.height-s)/2,"px");break;case"middle-right":t.style.left="".concat(n.left+n.width-r,"px"),t.style.top="".concat(n.top+(n.height-s)/2,"px");break;case"middle-middle":t.style.left="".concat(n.left+(n.width-r)/2,"px"),t.style.top="".concat(n.top+(n.height-s)/2,"px");break;case"bottom-middle":t.style.left="".concat(n.left+(n.width-r)/2,"px"),t.style.top="".concat(n.top+n.height-s,"px");break;case"top-middle":t.style.left="".concat(n.left+(n.width-r)/2,"px"),t.style.top="".concat(n.top,"px")}}}(n.hintPosition,o,n.element)}),o},xe=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];for(var r=0,s=i;r<s.length;r++){var o=s[r];if(e instanceof SVGElement){var a=e.getAttribute("class")||"";a.match(o)||be(e,a,o)}else void 0!==e.classList?e.classList.add(o):e.className.match(o)||be(e,e.className,o)}},be=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];var r=i.filter(Boolean).join(" ");e instanceof SVGElement?e.setAttribute("class",r):void 0!==e.classList?e.classList.value=r:e.className=r},we=function(e,t){if(e instanceof SVGElement){var i=e.getAttribute("class")||"";e.setAttribute("class",i.replace(t,"").replace(/\s\s+/g," ").trim())}else e.className=e.className.replace(t,"").replace(/\s\s+/g," ").trim()},Se=function(e){var t="";for(var i in e)t+="".concat(i,":").concat(e[i],";");return t},Te=function(e,t,i,n){var r=function(e,t,i,n){if(t&&e&&i){i instanceof Element&&pe(i)?xe(t,"introjs-fixedTooltip"):we(t,"introjs-fixedTooltip");var r=me(i,e);return{width:"".concat(r.width+n,"px"),height:"".concat(r.height+n,"px"),top:"".concat(r.top-n/2,"px"),left:"".concat(r.left-n/2,"px")}}}(e,t,i,n);r&&function(e,t){var i="";e.style.cssText&&(i+=e.style.cssText),i+="string"==typeof t?t:Se(t),e.style.cssText=i}(t,r)};function ke(){if(void 0!==window.innerWidth)return{width:window.innerWidth,height:window.innerHeight};var e=document.documentElement;return{width:e.clientWidth,height:e.clientHeight}}function Me(e,t){e.includes(t)&&e.splice(e.indexOf(t),1)}var Ae=de.tags.div;function Ce(e,t,i,n,r){return e.left+e.width-t-i<0?(n.val="-".concat(e.left,"px"),!1):(r.val="".concat(t,"px"),!0)}function De(e,t,i,n,r){return e.left+i+n>t.width?(r.val="".concat(t.width-n-e.left,"px"),!1):(r.val="".concat(i,"px"),!0)}var Le=function(e,t){var i=e.position,n=e.element,r=e.refreshes,s=e.hintMode,o=void 0!==s&&s,a=e.showStepNumbers,l=void 0!==a&&a,c=e.transitionDuration,h=void 0===c?0:c,d=e.positionPrecedence,u=void 0===d?[]:d,f=e.className,p=e.autoPosition,m=void 0===p||p,g=e.onClick,_=de.state("auto"),y=de.state("auto"),v=de.state("auto"),x=de.state("auto"),b=de.state("0"),w=de.state("0"),S=de.state(0),T=de.state(250),k=de.state(300),M=de.state(i),A=de.state(ke()),C=de.state(me(n)),D=de.derive(function(){return C.val.top+T.val>A.val.height});de.derive(function(){void 0!==r.val&&(A.val=ke(),C.val=me(n))}),de.derive(function(){void 0!==M.val&&"floating"!==i&&m&&k.val&&T.val&&C.val&&A.val&&(M.val=function(e,t,i,n,r,s){var o=e.slice();n+=10,i+=20;var a="floating";if(t.absoluteBottom+n>s.height&&Me(o,"bottom"),t.absoluteTop-n<0&&Me(o,"top"),t.absoluteRight+i>s.width&&Me(o,"right"),t.absoluteLeft-i<0&&Me(o,"left"),r&&(r=r.split("-")[0]),o.length&&(a=o[0],o.includes(r)&&(a=r)),"top"===a||"bottom"===a){var l,c=[];"top"===a?(l="top-middle-aligned",c=["top-left-aligned","top-middle-aligned","top-right-aligned"]):(l="bottom-middle-aligned",c=["bottom-left-aligned","bottom-middle-aligned","bottom-right-aligned"]),a=function(e,t,i,n){var r=t/2,s=Math.min(i,window.screen.width);return s-e<t&&(Me(n,"top-left-aligned"),Me(n,"bottom-left-aligned")),(e<r||s-e<r)&&(Me(n,"top-middle-aligned"),Me(n,"bottom-middle-aligned")),e<t&&(Me(n,"top-right-aligned"),Me(n,"bottom-right-aligned")),n.length?n[0]:null}(t.absoluteLeft,i,s.width,c)||l}return a}(u,C.val,k.val,T.val,i,A.val))}),de.derive(function(){void 0!==k.val&&void 0!==T.val&&void 0!==D.val&&void 0!==M.val&&void 0!==C.val&&void 0!==A.val&&function(e,t,i,n,r,s,o,a,l,c,h,d,u,f){s.val="auto",o.val="auto",a.val="auto",l.val="auto",c.val="0",h.val="0";var p=t.width/2-n/2;switch(e){case"top-right-aligned":var m=0;Ce(t,m,n,a,l),o.val="".concat(t.height+20,"px");break;case"top-middle-aligned":f&&(p+=5),Ce(t,p,n,a,l)&&(l.val=void 0,De(t,i,p,n,a)),o.val="".concat(t.height+20,"px");break;case"top-left-aligned":case"top":De(t,i,f?0:15,n,a),o.val="".concat(t.height+20,"px");break;case"right":a.val="".concat(t.width+20,"px"),d.val&&(s.val="-".concat(r-t.height-20,"px"));break;case"left":f||!0!==u||(s.val="15px"),d.val&&(s.val="-".concat(r-t.height-20,"px")),l.val="".concat(t.width+20,"px");break;case"floating":a.val="50%",s.val="50%",c.val="-".concat(n/2,"px"),h.val="-".concat(r/2,"px");break;case"bottom-right-aligned":Ce(t,m=0,n,a,l),s.val="".concat(t.height+20,"px");break;case"bottom-middle-aligned":f&&(p+=5),Ce(t,p,n,a,l)&&(l.val="",De(t,i,p,n,a)),s.val="".concat(t.height+20,"px");break;default:De(t,i,0,n,a),s.val="".concat(t.height+20,"px")}}(M.val,C.val,A.val,k.val,T.val,_,v,x,y,b,w,D,l,o)});var L,E,I=Ae({style:function(){return"top: ".concat(_.val,"; right: ").concat(y.val,"; bottom: ").concat(v.val,"; left: ").concat(x.val,"; margin-left: ").concat(b.val,"; margin-top: ").concat(w.val,";opacity: ").concat(S.val)},className:function(){return"".concat("introjs-tooltip"," introjs-").concat(M.val," ").concat(f||"")},role:"dialog",onclick:null!=g?g:null},[(L={tooltipPosition:M,tooltipBottomOverflow:D},E=de.derive(function(){var e=["introjs-arrow"];switch(L.tooltipPosition.val){case"top-right-aligned":e.push("bottom-right");break;case"top-middle-aligned":e.push("bottom-middle");break;case"top-left-aligned":case"top":e.push("bottom");break;case"right":L.tooltipBottomOverflow.val?e.push("left-bottom"):e.push("left");break;case"left":L.tooltipBottomOverflow.val?e.push("right-bottom"):e.push("right");break;case"floating":break;case"bottom-right-aligned":e.push("top-right");break;case"bottom-middle-aligned":e.push("top-middle");break;default:e.push("top")}return e}),Ae({className:function(){var e;return null===(e=E.val)||void 0===e?void 0:e.filter(Boolean).join(" ")},style:function(){return"display: ".concat("floating"===L.tooltipPosition.val?"none":"block",";")}})),[t]]);return setTimeout(function(){S.val=1},h),setTimeout(function(){T.val=I.offsetHeight,k.val=I.offsetWidth},1),I},Ee=function(e){var t=e.text,i=e.container,n=e.tooltipRenderAsHtml;return de.derive(function(){var e=i;if(e)if(e.innerHTML="",n&&t){var r=document.createRange().createContextualFragment(t);e.appendChild(r)}else e.textContent=t}),i},Ie=de.tags,Pe=Ie.a,Re=Ie.div,Oe=de.tags.div,ze=function(e){var t=e.activeHintSignal,i=e.targetElement,n=e.helperElementPadding,r=S(e,["activeHintSignal","targetElement","helperElementPadding"]),s=t.val;return function(){var e;if(null==t.val)return null;if(s!==t.val)return null;var o=Oe((h(e={},"data-step",t.val),h(e,"className","".concat("introjs-tooltipReferenceLayer"," ").concat("introjs-hintReference")),e),function(e){var t=e.hintItem,i=e.closeButtonEnabled,n=e.closeButtonOnClick,r=e.closeButtonLabel,s=e.closeButtonClassName,o=e.className,a=e.renderAsHtml,l=S(e,["hintItem","closeButtonEnabled","closeButtonOnClick","closeButtonLabel","closeButtonClassName","className","renderAsHtml"]),c=t.hint;return Le(Object.assign(Object.assign({},l),{element:t.hintTooltipElement,position:t.position,hintMode:!0,onClick:function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}}),[Re({className:"".concat("introjs-tooltiptext"," ").concat(o||"")},Ee({text:c||"",tooltipRenderAsHtml:a,container:Re({className:"introjs-tooltiptext"})}),i?Pe({className:s,role:"button",onclick:function(){return n(t)}},r):null)])}(r));return setTimeout(function(){Te(i,o,r.hintItem.hintTooltipElement,n)},1),o}},Fe=de.tags.div,Ne=function(e,t){return function(i){var n=i||window.event;n&&n.stopPropagation&&n.stopPropagation(),n&&null!==n.cancelBubble&&(n.cancelBubble=!0),e.showHintDialog(t)}},Ye=function(){function e(t,i){o(this,e),this._hints=[],this._activeHintSignal=de.state(void 0),this._refreshesSignal=de.state(0),this.callbacks={},this._targetElement=N(t),this._options=i?L(this._options,i):{hints:[],isActive:!0,tooltipPosition:"bottom",tooltipClass:"",hintPosition:"top-middle",hintButtonLabel:"Got it",hintShowButton:!0,hintAutoRefreshInterval:10,hintAnimation:!0,buttonClass:"introjs-button",helperElementPadding:10,autoPosition:!0,positionPrecedence:["bottom","top","right","left"],tooltipRenderAsHtml:!0}}return l(e,[{key:"callback",value:function(e){var t=this.callbacks[e];if(z(t))return t}},{key:"getTargetElement",value:function(){return this._targetElement}},{key:"getHints",value:function(){return this._hints}},{key:"getHint",value:function(e){return this._hints[e]}},{key:"setHints",value:function(e){return this._hints=e,this}},{key:"addHint",value:function(e){return e.isActive=de.state(!0),this._hints.push(e),this}},{key:"getActiveHintSignal",value:function(){return this._activeHintSignal}},{key:"getRefreshesSignal",value:function(){return this._refreshesSignal}},{key:"isRendered",value:function(){return void 0!==this._root}},{key:"createRoot",value:function(){this._root=function(e){var t,i=e.hint,n=[],r=c(i.getHints().entries());try{for(r.s();!(t=r.n()).done;){var s=_(t.value,2),o=s[0],a=s[1],l=ve({index:o,hintItem:a,onClick:Ne(i,o),refreshesSignal:i.getRefreshesSignal()});a.hintTooltipElement=l,n.push(l)}}catch(e){r.e(e)}finally{r.f()}var h=Fe.apply(void 0,[{className:ue}].concat(n));return de.derive(function(){var e=i.getActiveHintSignal();if(void 0!==e.val){var t=e.val,n=i.getHints()[t];if(n){var r=ze({activeHintSignal:e,hintItem:n,helperElementPadding:i.getOption("helperElementPadding"),targetElement:i.getTargetElement(),refreshes:i.getRefreshesSignal(),showStepNumbers:!1,renderAsHtml:i.getOption("tooltipRenderAsHtml"),autoPosition:i.getOption("autoPosition"),positionPrecedence:i.getOption("positionPrecedence"),closeButtonEnabled:i.getOption("hintShowButton"),closeButtonLabel:i.getOption("hintButtonLabel"),closeButtonClassName:i.getOption("buttonClass"),closeButtonOnClick:function(e){return Y(i,e)},className:i.getOption("tooltipClass")});de.add(h,r)}}}),h}({hint:this}),de.add(this._targetElement,this._root)}},{key:"recreateRoot",value:function(){this._root&&(this._root.remove(),this.createRoot())}},{key:"render",value:function(){var e;return T(this,void 0,void 0,m().mark(function t(){return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.isActive()){t.next=2;break}return t.abrupt("return",this);case 2:if(!this.isRendered()){t.next=4;break}return t.abrupt("return",this);case 4:return C(this),this.createRoot(),null===(e=this.callback("hintsAdded"))||void 0===e||e.call(this),this.enableHintAutoRefresh(),this.enableCloseDialogOnWindowClick(),t.abrupt("return",this);case 10:case"end":return t.stop()}},t,this)}))}},{key:"enableCloseDialogOnWindowClick",value:function(){var e=this;this._windowClickFunction=function(){e._activeHintSignal.val=void 0},F.on(document,"click",this._windowClickFunction,!1)}},{key:"disableCloseDialogOnWindowClick",value:function(){this._windowClickFunction&&F.off(document,"click",this._windowClickFunction,!1)}},{key:"addHints",value:function(){return T(this,void 0,void 0,m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.render());case 1:case"end":return e.stop()}},e,this)}))}},{key:"hideHint",value:function(e){return T(this,void 0,void 0,m().mark(function t(){var i;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(i=this.getHint(e))){t.next=4;break}return t.next=4,Y(this,i);case 4:return t.abrupt("return",this);case 5:case"end":return t.stop()}},t,this)}))}},{key:"hideHints",value:function(){return T(this,void 0,void 0,m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B(this);case 2:return e.abrupt("return",this);case 3:case"end":return e.stop()}},e,this)}))}},{key:"showHint",value:function(e){var t=this.getHint(e);return t&&j(t),this}},{key:"showHints",value:function(){return T(this,void 0,void 0,m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,H(this);case 2:return e.abrupt("return",this);case 3:case"end":return e.stop()}},e,this)}))}},{key:"destroy",value:function(){return this._root&&(this._root.remove(),this._root=void 0),this.disableHintAutoRefresh(),this.disableCloseDialogOnWindowClick(),this}},{key:"removeHints",value:function(){return this.destroy(),this}},{key:"removeHint",value:function(e){return this._hints=this._hints.filter(function(t,i){return i!==e}),this.recreateRoot(),this}},{key:"showHintDialog",value:function(e){var t;return T(this,void 0,void 0,m().mark(function i(){var n;return m().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(n=this.getHint(e)){i.next=3;break}return i.abrupt("return");case 3:if(this._activeHintSignal.val===e){i.next=9;break}return this._activeHintSignal.val=e,i.next=7,null===(t=this.callback("hintClick"))||void 0===t?void 0:t.call(this,n);case 7:i.next=10;break;case 9:this._activeHintSignal.val=void 0;case 10:return i.abrupt("return",this);case 11:case"end":return i.stop()}},i,this)}))}},{key:"hideHintDialog",value:function(){return this._activeHintSignal.val=void 0,this}},{key:"refresh",value:function(){return this.isRendered()?(void 0!==this._refreshesSignal.val&&(this._refreshesSignal.val+=1),this):this}},{key:"enableHintAutoRefresh",value:function(){var e,t,i,n=this,r=this.getOption("hintAutoRefreshInterval");return r>=0&&(this._hintsAutoRefreshFunction=(e=function(){return n.refresh()},t=r,function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];window.clearTimeout(i),i=window.setTimeout(function(){e()},t)}),F.on(window,"scroll",this._hintsAutoRefreshFunction,!0),F.on(window,"resize",this._hintsAutoRefreshFunction,!0)),this}},{key:"disableHintAutoRefresh",value:function(){return this._hintsAutoRefreshFunction&&(F.off(window,"scroll",this._hintsAutoRefreshFunction,!0),F.on(window,"resize",this._hintsAutoRefreshFunction,!0),this._hintsAutoRefreshFunction=void 0),this}},{key:"getOption",value:function(e){return this._options[e]}},{key:"setOptions",value:function(e){return this._options=L(this._options,e),this}},{key:"setOption",value:function(e,t){return this._options=D(this._options,e,t),this}},{key:"clone",value:function(){return new e(this._targetElement,this._options)}},{key:"isActive",value:function(){return this.getOption("isActive")}},{key:"onHintsAdded",value:function(e){if(!z(e))throw new Error("Provided callback for onhintsadded was not a function.");return this.callbacks.hintsAdded=e,this}},{key:"onhintsadded",value:function(e){this.onHintsAdded(e)}},{key:"onHintClick",value:function(e){if(!z(e))throw new Error("Provided callback for onhintclick was not a function.");return this.callbacks.hintClick=e,this}},{key:"onhintclick",value:function(e){this.onHintClick(e)}},{key:"onHintClose",value:function(e){if(!z(e))throw new Error("Provided callback for onhintclose was not a function.");return this.callbacks.hintClose=e,this}},{key:"onhintclose",value:function(e){this.onHintClose(e)}}]),e}();function Be(e){xe(e,"introjs-showElement");var t=fe(e,"position");"absolute"!==t&&"relative"!==t&&"sticky"!==t&&"fixed"!==t&&xe(e,"introjs-relativePosition")}function He(e,t){var i,n;return T(this,void 0,void 0,m().mark(function r(){return m().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return null===(i=e.callback("change"))||void 0===i||i.call(e,t.element),je(),Be(t.element),r.next=5,null===(n=e.callback("afterChange"))||void 0===n?void 0:n.call(e,t.element);case 5:case"end":return r.stop()}},r)}))}function je(){for(var e=0,t=Array.from(A(".".concat("introjs-showElement"),void 0));e<t.length;e++){var i=t[e];we(i,/introjs-[a-zA-Z]+/g)}}function Ve(e){var t,i;return T(this,void 0,void 0,m().mark(function n(){var r,s;return m().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(e.incrementCurrentStep(),void 0!==(r=e.getCurrentStep())){n.next=4;break}return n.abrupt("return",!1);case 4:return s=e.getStep(r),n.next=8,null===(t=e.callback("beforeChange"))||void 0===t?void 0:t.call(e,s&&s.element,e.getCurrentStep(),e.getDirection());case 8:if(!1!==n.sent){n.next=12;break}return e.decrementCurrentStep(),n.abrupt("return",!1);case 12:if(!e.isEnd()){n.next=18;break}return n.next=15,null===(i=e.callback("complete"))||void 0===i?void 0:i.call(e,e.getCurrentStep(),"end");case 15:return n.next=17,e.exit();case 17:return n.abrupt("return",!1);case 18:return n.next=20,He(e,s);case 20:return n.abrupt("return",!0);case 21:case"end":return n.stop()}},n)}))}function We(e){var t;return T(this,void 0,void 0,m().mark(function i(){var n,r;return m().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(!(void 0===(n=e.getCurrentStep())||n<=0)){i.next=3;break}return i.abrupt("return",!1);case 3:if(e.decrementCurrentStep(),void 0!==(n=e.getCurrentStep())){i.next=7;break}return i.abrupt("return",!1);case 7:return r=e.getStep(n),i.next=11,null===(t=e.callback("beforeChange"))||void 0===t?void 0:t.call(e,r&&r.element,e.getCurrentStep(),e.getDirection());case 11:if(!1!==i.sent){i.next=15;break}return e.incrementCurrentStep(),i.abrupt("return",!1);case 15:return i.next=17,He(e,r);case 17:return i.abrupt("return",!0);case 18:case"end":return i.stop()}},i)}))}var Ue=function(e){var t,i=[];if(null===(t=e.getOption("steps"))||void 0===t?void 0:t.length){var n,r=c(e.getOption("steps"));try{for(r.s();!(n=r.n()).done;){var s=k(n.value);s.step=i.length+1,s.title=s.title||"","string"==typeof s.element&&(s.element=M(s.element)||void 0),s.element||(s.element=e.appendFloatingElement(),s.position="floating"),s.position=s.position||e.getOption("tooltipPosition"),s.scrollTo=s.scrollTo||e.getOption("scrollTo"),void 0===s.disableInteraction&&(s.disableInteraction=e.getOption("disableInteraction")),null!==s.element&&i.push(s)}}catch(e){r.e(e)}finally{r.f()}}else{var o=Array.from(A("*[".concat("data-intro","]"),e.getTargetElement()));if(o.length<1)return[];for(var a=[],l=0,h=o;l<h.length;l++){var d=h[l];if((!e.getOption("group")||d.getAttribute("data-intro-group")===e.getOption("group"))&&"none"!==d.style.display){var u=parseInt(d.getAttribute("data-step")||"0",10),f=e.getOption("disableInteraction");d.hasAttribute("data-disable-interaction")&&(f=!!d.getAttribute("data-disable-interaction"));var p={step:u,element:d,title:d.getAttribute("data-title")||"",intro:d.getAttribute("data-intro")||"",tooltipClass:d.getAttribute("data-tooltip-class")||void 0,highlightClass:d.getAttribute("data-highlight-class")||void 0,position:d.getAttribute("data-position")||e.getOption("tooltipPosition"),scrollTo:d.getAttribute("data-scroll-to")||e.getOption("scrollTo"),disableInteraction:f};u>0?i[u-1]=p:a.push(p)}}for(var m=0;a.length>0;m++)if(void 0===i[m]){var g=a.shift();if(!g)break;g.step=m+1,i[m]=g}}return(i=i.filter(function(e){return e})).sort(function(e,t){return e.step-t.step}),i},$e=function(e){return T(void 0,void 0,void 0,m().mark(function t(){var i,n;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isActive()){t.next=2;break}return t.abrupt("return",!1);case 2:if(!e.hasStarted()){t.next=4;break}return t.abrupt("return",!1);case 4:return t.next=6,null===(i=e.callback("start"))||void 0===i?void 0:i.call(e,e.getTargetElement());case 6:if(0!==(n=Ue(e)).length){t.next=9;break}return t.abrupt("return",!1);case 9:return e.setSteps(n),t.next=12,Ve(e);case 12:return t.abrupt("return",!0);case 13:case"end":return t.stop()}},t)}))};function Ge(e){var t,i,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return T(this,void 0,void 0,m().mark(function r(){var s,o;return m().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return s=e.getTargetElement(),o=!0,r.next=4,null===(t=e.callback("beforeExit"))||void 0===t?void 0:t.call(e,s);case 4:if(o=r.sent,n||!1!==o){r.next=7;break}return r.abrupt("return",!1);case 7:return je(),r.next=10,null===(i=e.callback("exit"))||void 0===i?void 0:i.call(e);case 10:return e.resetCurrentStep(),r.abrupt("return",!0);case 12:case"end":return r.stop()}},r)}))}function Xe(e,t,i){var n,r=(h(n={},e,t),h(n,"path","/"),h(n,"expires",void 0),n);if(i){var s=new Date;s.setTime(s.getTime()+24*i*60*60*1e3),r.expires=s.toUTCString()}var o=[];for(var a in r)o.push("".concat(a,"=").concat(r[a]));return document.cookie=o.join("; "),qe(e)}function qe(e){return(t={},document.cookie.split(";").forEach(function(e){var i=_(e.split("="),2),n=i[0],r=i[1];t[n.trim()]=r}),t)[e];var t}var Ze=function(e,t,i,n){Te(e,t,i.element,"floating"===i.position?0:n)},Je=de.tags,Ke=Je.h1,Qe=Je.div,et=Je.input,tt=Je.label,it=Je.ul,nt=Je.li,rt=Je.a,st=function(e){var t=e.label,i=e.onClick,n=e.disabled,r=e.className;return rt({role:"button",tabIndex:0,ariaDisabled:null!=n&&n,onclick:i,className:null!=r?r:""},[t])},ot=function(e){var t=e.step,i=e.currentStep,n=e.steps,r=e.onBulletClick,s=e.bullets,o=e.buttons,a=e.nextLabel,l=e.onNextClick,c=e.prevLabel,d=e.onPrevClick,u=e.skipLabel,f=e.onSkipClick,p=e.buttonClass,m=e.nextToDone,g=e.doneLabel,_=e.hideNext,y=e.hidePrev,x=e.progress,b=e.progressBarAdditionalClass,w=e.stepNumbers,T=e.stepNumbersOfLabel,k=e.scrollToElement,M=e.scrollPadding,A=e.dontShowAgain,C=e.onDontShowAgainChange,D=e.dontShowAgainLabel,L=e.renderAsHtml,E=S(e,["step","currentStep","steps","onBulletClick","bullets","buttons","nextLabel","onNextClick","prevLabel","onPrevClick","skipLabel","onSkipClick","buttonClass","nextToDone","doneLabel","hideNext","hidePrev","progress","progressBarAdditionalClass","stepNumbers","stepNumbersOfLabel","scrollToElement","scrollPadding","dontShowAgain","onDontShowAgainChange","dontShowAgainLabel","renderAsHtml"]),I=[],P=t.title,R=t.intro,O=t.position;I.push(function(e){var t=e.skipLabel,i=e.onSkipClick,n=Ee({text:e.title,tooltipRenderAsHtml:e.renderAsHtml,container:Ke({className:"introjs-tooltip-title"})});return Qe({className:"introjs-tooltip-header"},[n,st({className:"introjs-skipbutton",label:t,onClick:i})])}({title:P,skipLabel:u,renderAsHtml:L,onSkipClick:f})),I.push(Ee({text:R,tooltipRenderAsHtml:L,container:Qe({className:"introjs-tooltiptext"})})),A&&I.push(function(e){var t=e.dontShowAgainLabel,i=e.onDontShowAgainChange;return Qe({className:"introjs-dontShowAgain"},[et({type:"checkbox",id:"introjs-dontShowAgain",name:"introjs-dontShowAgain",onchange:function(e){i(e.target.checked)}}),tt({for:"introjs-dontShowAgain"},t)])}({dontShowAgainLabel:D,onDontShowAgainChange:C})),s&&I.push(function(e){var t=e.step,i=e.onBulletClick;return Qe({className:"introjs-bullets"},[it({role:"tablist"},v(e.steps.map(function(e){var n=e.step;return nt({role:"presentation"},[rt(h({role:"tab",className:function(){return"".concat(t.step===n?"active":"")},onclick:function(e){var t=e.target.getAttribute("data-step-number");t&&i(parseInt(t,10))},innerHTML:" "},"data-step-number",n))])})))])}({step:t,steps:n,onBulletClick:r})),x&&I.push(function(e){var t=e.progressBarAdditionalClass,i=(e.currentStep+1)/e.steps.length*100;return Qe({className:"introjs-progress"},[Qe({className:"".concat("introjs-progressbar"," ").concat(t||""),role:"progress","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":function(){return i.toString()},style:"width:".concat(i,"%;")})])}({steps:n,currentStep:i,progressBarAdditionalClass:b})),w&&I.push(function(e){var t=e.steps,i=e.stepNumbersOfLabel;return Qe({className:"introjs-helperNumberLayer"},["".concat(e.step.step," ").concat(i," ").concat(t.length)])}({step:t,steps:n,stepNumbersOfLabel:T})),o&&I.push(function(e){var t=e.steps,i=e.currentStep,n=e.buttonClass,r=e.nextToDone,s=e.doneLabel,o=e.hideNext,a=e.nextLabel,l=e.onNextClick,c=e.hidePrev,h=e.prevLabel,d=e.onPrevClick;return Qe({className:"introjs-tooltipbuttons"},t.length>1?function(e){var t=e.label,i=e.steps,n=e.currentStep,r=e.hidePrev,s=e.hideNext,o=e.onClick,a=e.buttonClass,l=0===n&&i.length>1,c=l&&!r,h=l&&r,d=(n===i.length-1||1===i.length)&&s;return st({label:t,onClick:o,disabled:c,className:function(){var e=[a,"introjs-prevbutton"];return d&&e.push("introjs-fullbutton"),c&&e.push("introjs-disabled"),h&&e.push("introjs-hidden"),e.filter(Boolean).join(" ")}})}({label:h,steps:t,currentStep:i,hidePrev:c,hideNext:o,onClick:d,buttonClass:n}):null,function(e){var t=e.steps,i=e.currentStep,n=e.nextLabel,r=e.doneLabel,s=e.hideNext,o=e.hidePrev,a=e.nextToDone,l=e.onClick,c=e.buttonClass,h=0===i&&t.length>1&&o,d=i===t.length-1||1===t.length,u=de.derive(function(){return d&&!s&&!a}),f=de.derive(function(){return d&&!s&&a}),p=st({label:f.val?r:n,onClick:l,className:function(){var e=[c,"introjs-nextbutton"];return f.val&&e.push("introjs-donebutton"),u.val&&e.push("introjs-disabled"),h&&e.push("introjs-fullbutton"),e.filter(Boolean).join(" ")}});return setTimeout(function(){p.focus()},1),p}({currentStep:i,steps:t,doneLabel:s,nextLabel:a,onClick:l,hideNext:o,hidePrev:c,nextToDone:r,buttonClass:n}))}({steps:n,currentStep:i,nextLabel:a,onNextClick:l,prevLabel:c,onPrevClick:d,buttonClass:p,nextToDone:m,doneLabel:g,hideNext:_,hidePrev:y}));var z=Le(Object.assign(Object.assign({},E),{element:t.element,hintMode:!1,position:O}),I);return function(e){var t=e.step,i=e.tooltip,n=e.scrollToElement,r=e.scrollPadding;(function(e,t){if(e){var i=function(e){var t=window.getComputedStyle(e),i="absolute"===t.position,n=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(var r=e;r=r.parentElement;)if(t=window.getComputedStyle(r),(!i||"static"!==t.position)&&n.test(t.overflow+t.overflowY+t.overflowX))return r;return document.body}(t);i!==document.body&&(i.scrollTop=t.offsetTop-i.offsetTop)}})(n,t.element),function(e,t,i,n,r){var s;if("off"!==t&&e&&(s="tooltip"===t?r.getBoundingClientRect():n.getBoundingClientRect(),!function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom+80<=window.innerHeight&&t.right<=window.innerWidth}(n))){var o=ke().height;s.bottom-(s.bottom-s.top)<0||n.clientHeight>o?window.scrollBy(0,s.top-(o/2-s.height/2)-i):window.scrollBy(0,s.top-(o/2-s.height/2)+i)}}(n,t.scrollTo,r,t.element,i)}({step:t,tooltip:z,scrollToElement:k,scrollPadding:M}),z},at=de.tags.div,lt=de.tags.div,ct=de.tags.div,ht=de.tags.div,dt=de.tags.div,ut=de.tags.div,ft=function(){function e(t,i){o(this,e),this._steps=[],this._currentStepSignal=de.state(void 0),this._refreshesSignal=de.state(0),this.callbacks={},this._targetElement=N(t),this._options=i?L(this._options,i):{steps:[],isActive:!0,nextLabel:"Next",prevLabel:"Back",skipLabel:"×",doneLabel:"Done",hidePrev:!1,hideNext:!1,nextToDone:!0,tooltipPosition:"bottom",tooltipClass:"",group:"",highlightClass:"",exitOnEsc:!0,exitOnOverlayClick:!0,showStepNumbers:!1,stepNumbersOfLabel:"of",keyboardNavigation:!0,showButtons:!0,showBullets:!0,showProgress:!1,scrollToElement:!0,scrollTo:"element",scrollPadding:30,overlayOpacity:.5,autoPosition:!0,positionPrecedence:["bottom","top","right","left"],disableInteraction:!1,dontShowAgain:!1,dontShowAgainLabel:"Don't show this again",dontShowAgainCookie:"introjs-dontShowAgain",dontShowAgainCookieDays:365,helperElementPadding:10,buttonClass:"introjs-button",progressBarAdditionalClass:"",tooltipRenderAsHtml:!0}}return l(e,[{key:"callback",value:function(e){var t=this.callbacks[e];if(z(t))return t}},{key:"goToStep",value:function(e){return T(this,void 0,void 0,m().mark(function t(){return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.setCurrentStep(e-2),t.next=3,Ve(this);case 3:return t.abrupt("return",this);case 4:case"end":return t.stop()}},t,this)}))}},{key:"goToStepNumber",value:function(e){return T(this,void 0,void 0,m().mark(function t(){var i;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i=0;case 1:if(!(i<this._steps.length)){t.next=9;break}if(this._steps[i].step!==e){t.next=6;break}return this.setCurrentStep(i-1),t.abrupt("break",9);case 6:i++,t.next=1;break;case 9:return t.next=11,Ve(this);case 11:return t.abrupt("return",this);case 12:case"end":return t.stop()}},t,this)}))}},{key:"addStep",value:function(e){return this._options.steps||(this._options.steps=[]),this._options.steps.push(e),this}},{key:"addSteps",value:function(e){if(!e.length)return this;var t,i=c(e);try{for(i.s();!(t=i.n()).done;){var n=t.value;this.addStep(n)}}catch(e){i.e(e)}finally{i.f()}return this}},{key:"setSteps",value:function(e){return this._steps=e,this}},{key:"getSteps",value:function(){return this._steps}},{key:"getStep",value:function(e){return this._steps[e]}},{key:"getCurrentStepSignal",value:function(){return this._currentStepSignal}},{key:"getRefreshesSignal",value:function(){return this._refreshesSignal}},{key:"getCurrentStep",value:function(){return this._currentStepSignal.val}},{key:"currentStep",value:function(){return this._currentStepSignal.val}},{key:"resetCurrentStep",value:function(){this._currentStepSignal.val=void 0}},{key:"setCurrentStep",value:function(e){return void 0===this._currentStepSignal.val||e>=this._currentStepSignal.val?this._direction="forward":this._direction="backward",this._currentStepSignal.val=e,this}},{key:"incrementCurrentStep",value:function(){var e=this.getCurrentStep();return void 0===e?this.setCurrentStep(0):this.setCurrentStep(e+1),this}},{key:"decrementCurrentStep",value:function(){var e=this.getCurrentStep();return void 0!==e&&e>0&&this.setCurrentStep(e-1),this}},{key:"getDirection",value:function(){return this._direction}},{key:"nextStep",value:function(){return T(this,void 0,void 0,m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ve(this);case 2:return e.abrupt("return",this);case 3:case"end":return e.stop()}},e,this)}))}},{key:"previousStep",value:function(){return T(this,void 0,void 0,m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,We(this);case 2:return e.abrupt("return",this);case 3:case"end":return e.stop()}},e,this)}))}},{key:"isEnd",value:function(){var e=this.getCurrentStep();return void 0!==e&&e>=this._steps.length}},{key:"isLastStep",value:function(){return this.getCurrentStep()===this._steps.length-1}},{key:"getTargetElement",value:function(){return this._targetElement}},{key:"setOptions",value:function(e){return this._options=L(this._options,e),this}},{key:"setOption",value:function(e,t){return this._options=D(this._options,e,t),this}},{key:"getOption",value:function(e){return this._options[e]}},{key:"clone",value:function(){return new e(this._targetElement,this._options)}},{key:"isActive",value:function(){return(!this.getOption("dontShowAgain")||""===(e=qe(this.getOption("dontShowAgainCookie")))||"true"!==e)&&this.getOption("isActive");var e}},{key:"hasStarted",value:function(){return void 0!==this.getCurrentStep()}},{key:"setDontShowAgain",value:function(e){return function(e,t,i){e?Xe(t,"true",i):Xe(t,"",-1)}(e,this.getOption("dontShowAgainCookie"),this.getOption("dontShowAgainCookieDays")),this}},{key:"enableKeyboardNavigation",value:function(){var e=this;return this.getOption("keyboardNavigation")&&(this._keyboardNavigationHandler=function(t){return function(e,t){var i;return T(this,void 0,void 0,m().mark(function n(){var r,s;return m().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(null===(r=void 0===t.code?t.which:t.code)&&(r=null===t.charCode?t.keyCode:t.charCode),"Escape"!==r&&27!==r||!0!==e.getOption("exitOnEsc")){n.next=7;break}return n.next=5,e.exit();case 5:n.next=39;break;case 7:if("ArrowLeft"!==r&&37!==r){n.next=12;break}return n.next=10,We(e);case 10:n.next=39;break;case 12:if("ArrowRight"!==r&&39!==r){n.next=17;break}return n.next=15,Ve(e);case 15:n.next=39;break;case 17:if("Enter"!==r&&"NumpadEnter"!==r&&13!==r){n.next=39;break}if(!(s=t.target||t.srcElement)||!s.className.match("introjs-prevbutton")){n.next=24;break}return n.next=22,We(e);case 22:n.next=38;break;case 24:if(!s||!s.className.match("introjs-skipbutton")){n.next=32;break}if(!e.isEnd()){n.next=28;break}return n.next=28,null===(i=e.callback("complete"))||void 0===i?void 0:i.call(e,e.getCurrentStep(),"skip");case 28:return n.next=30,e.exit();case 30:n.next=38;break;case 32:if(!s||!s.getAttribute("data-step-number")){n.next=36;break}s.click(),n.next=38;break;case 36:return n.next=38,Ve(e);case 38:t.preventDefault?t.preventDefault():t.returnValue=!1;case 39:case"end":return n.stop()}},n)}))}(e,t)},F.on(window,"keydown",this._keyboardNavigationHandler,!0)),this}},{key:"disableKeyboardNavigation",value:function(){return this._keyboardNavigationHandler&&(F.off(window,"keydown",this._keyboardNavigationHandler,!0),this._keyboardNavigationHandler=void 0),this}},{key:"enableRefreshOnResize",value:function(){var e=this;this._refreshOnResizeHandler=function(t){return e.refresh()},F.on(window,"resize",this._refreshOnResizeHandler,!0)}},{key:"disableRefreshOnResize",value:function(){this._refreshOnResizeHandler&&(F.off(window,"resize",this._refreshOnResizeHandler,!0),this._refreshOnResizeHandler=void 0)}},{key:"appendFloatingElement",value:function(){var e,t,i;return this._floatingElement||(this._floatingElement=(e={currentStep:this.getCurrentStepSignal()},t=e.currentStep,i=ut({className:"introjsFloatingElement"}),de.derive(function(){void 0===t.val&&i.remove()}),i),de.add(this.getTargetElement(),this._floatingElement)),this._floatingElement}},{key:"createRoot",value:function(){this._root||(this._root=function(e){var t=e.tour,i=t.getCurrentStepSignal(),n=t.getRefreshesSignal(),r=t.getSteps(),s=function(e){var t=e.currentStep,i=e.steps,n=e.refreshes,r=e.targetElement,s=e.tourHighlightClass,o=e.overlayOpacity,a=e.helperLayerPadding,l=de.derive(function(){return void 0!==t.val?i[t.val]:null}),c=lt({className:function(){return function(e){var t=e.step,i=e.tourHighlightClass,n="introjs-helperLayer";return t.val&&"string"==typeof t.val.highlightClass&&(n+=" ".concat(t.val.highlightClass)),"string"==typeof i&&(n+=" ".concat(i)),n}({step:l,tourHighlightClass:s})},style:Se({"box-shadow":"0 0 1px 2px rgba(33, 33, 33, 0.8), rgba(33, 33, 33, ".concat(o.toString(),") 0 0 0 5000px")})});return de.derive(function(){l.val&&void 0!==n.val&&Ze(r,c,l.val,a)}),c}({currentStep:i,steps:r,refreshes:n,targetElement:t.getTargetElement(),tourHighlightClass:t.getOption("highlightClass"),overlayOpacity:t.getOption("overlayOpacity"),helperLayerPadding:t.getOption("helperElementPadding")}),o=de.state(0),a=0,l=dt({className:"introjs-tour",style:function(){return Se({opacity:"".concat(o.val)})}},s,function(){if(void 0===i.val)return null;var e=de.derive(function(){return void 0!==i.val?r[i.val]:null});if(!e.val)return null;var s=function(e){var t=e.exitOnOverlayClick,i=e.onExitTour,n=ht({className:"introjs-overlay",style:Se({top:0,bottom:0,left:0,right:0,position:"fixed",cursor:t?"pointer":"auto"})});return t&&(n.onclick=function(){return T(void 0,void 0,void 0,m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i();case 2:case"end":return e.stop()}},e)}))}),n}({exitOnOverlayClick:!0===t.getOption("exitOnOverlayClick"),onExitTour:function(){return T(void 0,void 0,void 0,m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.exit());case 1:case"end":return e.stop()}},e)}))}}),o=function(e){var t=e.targetElement,i=e.helperElementPadding,n=S(e,["targetElement","helperElementPadding"]),r=at({className:"introjs-tooltipReferenceLayer"},ot(n));return de.derive(function(){null!=n.refreshes.val&&Ze(t,r,n.step,i)}),r}({step:e.val,targetElement:t.getTargetElement(),refreshes:n,helperElementPadding:t.getOption("helperElementPadding"),transitionDuration:a,positionPrecedence:t.getOption("positionPrecedence"),autoPosition:t.getOption("autoPosition"),showStepNumbers:t.getOption("showStepNumbers"),steps:t.getSteps(),currentStep:i.val,onBulletClick:function(e){t.goToStep(e)},bullets:t.getOption("showBullets"),buttons:t.getOption("showButtons"),nextLabel:t.getOption("nextLabel"),onNextClick:function(e){return T(void 0,void 0,void 0,m().mark(function i(){var n;return m().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(t.isLastStep()){i.next=5;break}return i.next=3,Ve(t);case 3:i.next=10;break;case 5:if(!new RegExp("introjs-donebutton","gi").test(e.target.className)){i.next=10;break}return i.next=8,null===(n=t.callback("complete"))||void 0===n?void 0:n.call(t,t.getCurrentStep(),"done");case 8:return i.next=10,t.exit();case 10:case"end":return i.stop()}},i)}))},prevLabel:t.getOption("prevLabel"),onPrevClick:function(){return T(void 0,void 0,void 0,m().mark(function e(){var i;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(void 0!==(i=t.getCurrentStep())&&i>0)){e.next=4;break}return e.next=4,We(t);case 4:case"end":return e.stop()}},e)}))},skipLabel:t.getOption("skipLabel"),onSkipClick:function(){return T(void 0,void 0,void 0,m().mark(function e(){var i,n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.isLastStep()){e.next=3;break}return e.next=3,null===(i=t.callback("complete"))||void 0===i?void 0:i.call(t,t.getCurrentStep(),"skip");case 3:return e.next=5,null===(n=t.callback("skip"))||void 0===n?void 0:n.call(t,t.getCurrentStep());case 5:return e.next=7,t.exit();case 7:case"end":return e.stop()}},e)}))},buttonClass:t.getOption("buttonClass"),nextToDone:t.getOption("nextToDone"),doneLabel:t.getOption("doneLabel"),hideNext:t.getOption("hideNext"),hidePrev:t.getOption("hidePrev"),className:e.val.tooltipClass||t.getOption("tooltipClass"),progress:t.getOption("showProgress"),progressBarAdditionalClass:t.getOption("progressBarAdditionalClass"),stepNumbers:t.getOption("showStepNumbers"),stepNumbersOfLabel:t.getOption("stepNumbersOfLabel"),scrollToElement:t.getOption("scrollToElement"),scrollPadding:t.getOption("scrollPadding"),dontShowAgain:t.getOption("dontShowAgain"),onDontShowAgainChange:function(e){t.setDontShowAgain(e)},dontShowAgainLabel:t.getOption("dontShowAgainLabel"),renderAsHtml:t.getOption("tooltipRenderAsHtml")}),l=e.val.disableInteraction?function(e){var t=e.currentStep,i=e.steps,n=e.refreshes,r=e.targetElement,s=e.helperElementPadding,o=de.derive(function(){return void 0!==t.val?i[t.val]:null});return function(){if(!o.val)return null;var e=ct({className:"introjs-disableInteraction"});return de.derive(function(){o.val&&null!=n.val&&Ze(r,e,o.val,s)}),e}}({currentStep:i,steps:t.getSteps(),refreshes:n,targetElement:t.getTargetElement(),helperElementPadding:t.getOption("helperElementPadding")}):null;return a=300,dt(s,o,l)});return de.derive(function(){void 0===i.val&&(o.val=0,setTimeout(function(){l.remove()},250))}),setTimeout(function(){o.val=1},1),l}({tour:this}),de.add(this.getTargetElement(),this._root))}},{key:"recreateRoot",value:function(){this._root&&(this._root.remove(),this._root=void 0,this.createRoot())}},{key:"start",value:function(){return T(this,void 0,void 0,m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$e(this);case 2:if(!e.sent){e.next=6;break}this.createRoot(),this.enableKeyboardNavigation(),this.enableRefreshOnResize();case 6:return e.abrupt("return",this);case 7:case"end":return e.stop()}},e,this)}))}},{key:"exit",value:function(e){return T(this,void 0,void 0,m().mark(function t(){return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ge(this,null!=e&&e);case 2:if(!t.sent){t.next=5;break}this.disableKeyboardNavigation(),this.disableRefreshOnResize();case 5:return t.abrupt("return",this);case 6:case"end":return t.stop()}},t,this)}))}},{key:"refresh",value:function(e){return void 0===this.getCurrentStep()||(void 0!==this._refreshesSignal.val&&(this._refreshesSignal.val+=1),e&&(this.setSteps(Ue(this)),this.recreateRoot())),this}},{key:"onbeforechange",value:function(e){return this.onBeforeChange(e)}},{key:"onBeforeChange",value:function(e){if(!z(e))throw new Error("Provided callback for onBeforeChange was not a function");return this.callbacks.beforeChange=e,this}},{key:"onchange",value:function(e){this.onChange(e)}},{key:"onChange",value:function(e){if(!z(e))throw new Error("Provided callback for onChange was not a function.");return this.callbacks.change=e,this}},{key:"onafterchange",value:function(e){this.onAfterChange(e)}},{key:"onAfterChange",value:function(e){if(!z(e))throw new Error("Provided callback for onAfterChange was not a function");return this.callbacks.afterChange=e,this}},{key:"oncomplete",value:function(e){return this.onComplete(e)}},{key:"onComplete",value:function(e){if(!z(e))throw new Error("Provided callback for oncomplete was not a function.");return this.callbacks.complete=e,this}},{key:"onstart",value:function(e){return this.onStart(e)}},{key:"onStart",value:function(e){if(!z(e))throw new Error("Provided callback for onstart was not a function.");return this.callbacks.start=e,this}},{key:"onexit",value:function(e){return this.onExit(e)}},{key:"onExit",value:function(e){if(!z(e))throw new Error("Provided callback for onexit was not a function.");return this.callbacks.exit=e,this}},{key:"onskip",value:function(e){return this.onSkip(e)}},{key:"onSkip",value:function(e){if(!z(e))throw new Error("Provided callback for onskip was not a function.");return this.callbacks.skip=e,this}},{key:"onbeforeexit",value:function(e){return this.onBeforeExit(e)}},{key:"onBeforeExit",value:function(e){if(!z(e))throw new Error("Provided callback for onbeforeexit was not a function.");return this.callbacks.beforeExit=e,this}}]),e}(),pt=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(t,ft);var e=function(e){var t=u();return function(){var i,n=d(e);if(t){var r=d(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,i)}}(t);function t(){return o(this,t),e.apply(this,arguments)}return l(t,[{key:"addHints",value:function(){console.error("introJs().addHints() is deprecated, please use introJs.hint.addHints() instead.")}},{key:"addHint",value:function(){console.error("introJs().addHint() is deprecated, please use introJs.hint.addHint() instead.")}},{key:"removeHints",value:function(){console.error("introJs().removeHints() is deprecated, please use introJs.hint.removeHints() instead.")}}]),t}(),mt=function(e){return console.warn("introJs() is deprecated. Please use introJs.tour() or introJs.hint() instead."),new pt(e)};mt.tour=function(e){return new ft(e)},mt.hint=function(e){return new Ye(e)},mt.version="8.3.2"},3164:function(e,t,i){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,i){return e<12?"오전":"오후"}})}(i(5093))},3177:(e,t,i)=>{"use strict";i.d(t,{Ay:()=>Be});const n="undefined"!=typeof window&&void 0!==window.document,r=n?window:{},s=!!n&&"ontouchstart"in r.document.documentElement,o=!!n&&"PointerEvent"in r,a="cropper",l=`${a}-canvas`,c=`${a}-crosshair`,h=`${a}-grid`,d=`${a}-handle`,u=`${a}-image`,f=`${a}-selection`,p=`${a}-shade`,m=`${a}-viewer`,g="select",_="move",y="scale",v="rotate",x="transform",b="none",w="n-resize",S="e-resize",T="s-resize",k="w-resize",M="ne-resize",A="nw-resize",C="se-resize",D="sw-resize",L=o?"pointerdown":s?"touchstart":"mousedown",E=o?"pointermove":s?"touchmove":"mousemove",I=o?"pointerup pointercancel":s?"touchend touchcancel":"mouseup",P="error",R="keydown",O="load",z="wheel",F="action",N="actionend",Y="actionstart",B="change",H="transform";function j(e){return"string"==typeof e}const V=Number.isNaN||r.isNaN;function W(e){return"number"==typeof e&&!V(e)}function U(e){return W(e)&&e>0&&e<1/0}function $(e){return"object"==typeof e&&null!==e}const{hasOwnProperty:G}=Object.prototype;function X(e){if(!$(e))return!1;try{const{constructor:t}=e,{prototype:i}=t;return t&&i&&G.call(i,"isPrototypeOf")}catch(e){return!1}}function q(e){return"function"==typeof e}function Z(e){return"object"==typeof e&&null!==e&&1===e.nodeType}const J=/([a-z\d])([A-Z])/g;function K(e){return String(e).replace(J,"$1-$2").toLowerCase()}const Q=/-[A-z\d]/g;function ee(e){return e.replace(Q,e=>e.slice(1).toUpperCase())}const te=/\s\s*/;function ie(e,t,i,n){t.trim().split(te).forEach(t=>{e.removeEventListener(t,i,n)})}function ne(e,t,i,n){t.trim().split(te).forEach(t=>{e.addEventListener(t,i,n)})}function re(e,t,i,n){ne(e,t,i,Object.assign(Object.assign({},n),{once:!0}))}const se={bubbles:!0,cancelable:!0,composed:!0},oe=Promise.resolve();function ae(e){const{documentElement:t}=e.ownerDocument,i=e.getBoundingClientRect();return{left:i.left+(r.pageXOffset-t.clientLeft),top:i.top+(r.pageYOffset-t.clientTop)}}const le=/deg|g?rad|turn$/i;function ce(e){const t=parseFloat(e)||0;if(0!==t){const[i="rad"]=String(e).match(le)||[];switch(i.toLowerCase()){case"deg":return t/360*(2*Math.PI);case"grad":return t/400*(2*Math.PI);case"turn":return t*(2*Math.PI)}}return t}const he="contain";function de(e,t=he){const{aspectRatio:i}=e;let{width:n,height:r}=e;const s=U(n),o=U(r);if(s&&o){const e=r*i;t===he&&e>n||"cover"===t&&e<n?r=n/i:n=r*i}else s?r=n/i:o&&(n=r*i);return{width:n,height:r}}function ue(e,...t){if(0===t.length)return e;const[i,n,r,s,o,a]=e,[l,c,h,d,u,f]=t[0];return ue(e=[i*l+r*c,n*l+s*c,i*h+r*d,n*h+s*d,i*u+r*f+o,n*u+s*f+a],...t.slice(1))}const fe=/left|top|width|height/i,pe="open",me=new WeakMap,ge=new WeakMap,_e=new Map,ye=r.document&&Array.isArray(r.document.adoptedStyleSheets)&&"replaceSync"in r.CSSStyleSheet.prototype;class ve extends HTMLElement{get $sharedStyle(){return(this.themeColor?`:host{--theme-color: ${this.themeColor};}`:"")+":host([hidden]){display:none!important}"}constructor(){var e,t;super(),this.shadowRootMode=pe,this.slottable=!0;const i=null===(t=null===(e=Object.getPrototypeOf(this))||void 0===e?void 0:e.constructor)||void 0===t?void 0:t.$name;i&&_e.set(i,this.tagName.toLowerCase())}static get observedAttributes(){return["shadow-root-mode","slottable","theme-color"]}attributeChangedCallback(e,t,i){if(Object.is(i,t))return;const n=ee(e);let r=i;switch(typeof this[n]){case"boolean":r=null!==i&&"false"!==i;break;case"number":r=Number(i)}switch(this[n]=r,e){case"theme-color":{const e=ge.get(this),t=this.$sharedStyle;e&&t&&(ye?e.replaceSync(t):e.textContent=t);break}}}$propertyChangedCallback(e,t,i){if(!Object.is(i,t))switch(e=K(e),typeof i){case"boolean":!0===i?this.hasAttribute(e)||this.setAttribute(e,""):this.removeAttribute(e);break;case"number":i=V(i)?"":String(i);default:i?this.getAttribute(e)!==i&&this.setAttribute(e,i):this.removeAttribute(e)}}connectedCallback(){Object.getPrototypeOf(this).constructor.observedAttributes.forEach(e=>{const t=ee(e);let i=this[t];(function(e){return void 0===e})(i)||this.$propertyChangedCallback(t,void 0,i),Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>i,set(e){const n=i;i=e,this.$propertyChangedCallback(t,n,e)}})});const e=this.attachShadow({mode:this.shadowRootMode||pe});if(this.shadowRoot||me.set(this,e),ge.set(this,this.$addStyles(this.$sharedStyle)),this.$style&&this.$addStyles(this.$style),this.$template){const t=document.createElement("template");t.innerHTML=this.$template,e.appendChild(t.content)}if(this.slottable){const t=document.createElement("slot");e.appendChild(t)}}disconnectedCallback(){ge.has(this)&&ge.delete(this),me.has(this)&&me.delete(this)}$getTagNameOf(e){var t;return null!==(t=_e.get(e))&&void 0!==t?t:e}$setStyles(e){return Object.keys(e).forEach(t=>{let i=e[t];W(i)&&(i=0!==i&&fe.test(t)?`${i}px`:String(i)),this.style[t]=i}),this}$getShadowRoot(){return this.shadowRoot||me.get(this)}$addStyles(e){let t;const i=this.$getShadowRoot();return ye?(t=new CSSStyleSheet,t.replaceSync(e),i.adoptedStyleSheets=i.adoptedStyleSheets.concat(t)):(t=document.createElement("style"),t.textContent=e,i.appendChild(t)),t}$emit(e,t,i){return function(e,t,i,n){return e.dispatchEvent(new CustomEvent(t,Object.assign(Object.assign(Object.assign({},se),{detail:i}),n)))}(this,e,t,i)}$nextTick(e){return function(e,t){return t?oe.then(e?t.bind(e):t):oe}(this,e)}static $define(e,t){$(e)&&(t=e,e=""),e||(e=this.$name||this.name),e=K(e),n&&r.customElements&&!r.customElements.get(e)&&customElements.define(e,this,t)}}ve.$version="2.0.0";class xe extends ve{constructor(){super(...arguments),this.$onPointerDown=null,this.$onPointerMove=null,this.$onPointerUp=null,this.$onWheel=null,this.$wheeling=!1,this.$pointers=new Map,this.$style=':host{display:block;min-height:100px;min-width:200px;overflow:hidden;position:relative;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([background]){background-color:#fff;background-image:repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);background-image:repeating-conic-gradient(#ccc 0 25%,#fff 0 50%);background-position:0 0,.5rem .5rem;background-size:1rem 1rem}:host([disabled]){pointer-events:none}:host([disabled]):after{bottom:0;content:"";cursor:not-allowed;display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}',this.$action=b,this.background=!1,this.disabled=!1,this.scaleStep=.1,this.themeColor="#39f"}static get observedAttributes(){return super.observedAttributes.concat(["background","disabled","scale-step"])}connectedCallback(){super.connectedCallback(),this.disabled||this.$bind()}disconnectedCallback(){this.disabled||this.$unbind(),super.disconnectedCallback()}$propertyChangedCallback(e,t,i){Object.is(i,t)||(super.$propertyChangedCallback(e,t,i),"disabled"!==e)||(i?this.$unbind():this.$bind())}$bind(){this.$onPointerDown||(this.$onPointerDown=this.$handlePointerDown.bind(this),ne(this,L,this.$onPointerDown)),this.$onPointerMove||(this.$onPointerMove=this.$handlePointerMove.bind(this),ne(this.ownerDocument,E,this.$onPointerMove)),this.$onPointerUp||(this.$onPointerUp=this.$handlePointerUp.bind(this),ne(this.ownerDocument,I,this.$onPointerUp)),this.$onWheel||(this.$onWheel=this.$handleWheel.bind(this),ne(this,z,this.$onWheel,{passive:!1,capture:!0}))}$unbind(){this.$onPointerDown&&(ie(this,L,this.$onPointerDown),this.$onPointerDown=null),this.$onPointerMove&&(ie(this.ownerDocument,E,this.$onPointerMove),this.$onPointerMove=null),this.$onPointerUp&&(ie(this.ownerDocument,I,this.$onPointerUp),this.$onPointerUp=null),this.$onWheel&&(ie(this,z,this.$onWheel,{capture:!0}),this.$onWheel=null)}$handlePointerDown(e){const{buttons:t,button:i,type:n}=e;if(this.disabled||("pointerdown"===n&&"mouse"===e.pointerType||"mousedown"===n)&&(W(t)&&1!==t||W(i)&&0!==i||e.ctrlKey))return;const{$pointers:r}=this;let s="";if(e.changedTouches)Array.from(e.changedTouches).forEach(({identifier:e,pageX:t,pageY:i})=>{r.set(e,{startX:t,startY:i,endX:t,endY:i})});else{const{pointerId:t=0,pageX:i,pageY:n}=e;r.set(t,{startX:i,startY:n,endX:i,endY:n})}r.size>1?s=x:Z(e.target)&&(s=e.target.action||e.target.getAttribute("action")||""),!1!==this.$emit(Y,{action:s,relatedEvent:e})&&(e.preventDefault(),this.$action=s,this.style.willChange="transform")}$handlePointerMove(e){const{$action:t,$pointers:i}=this;if(this.disabled||t===b||0===i.size)return;if(!1===this.$emit("actionmove",{action:t,relatedEvent:e}))return;if(e.preventDefault(),e.changedTouches)Array.from(e.changedTouches).forEach(({identifier:e,pageX:t,pageY:n})=>{const r=i.get(e);r&&Object.assign(r,{endX:t,endY:n})});else{const{pointerId:t=0,pageX:n,pageY:r}=e,s=i.get(t);s&&Object.assign(s,{endX:n,endY:r})}const n={action:t,relatedEvent:e};if(t===x){const t=new Map(i);let r=0,s=0,o=0,a=0,l=e.pageX,c=e.pageY;i.forEach((e,i)=>{t.delete(i),t.forEach(t=>{let i=t.startX-e.startX,n=t.startY-e.startY,h=t.endX-e.endX,d=t.endY-e.endY,u=0,f=0,p=0,m=0;if(0===i?n<0?p=2*Math.PI:n>0&&(p=Math.PI):i>0?p=Math.PI/2+Math.atan(n/i):i<0&&(p=1.5*Math.PI+Math.atan(n/i)),0===h?d<0?m=2*Math.PI:d>0&&(m=Math.PI):h>0?m=Math.PI/2+Math.atan(d/h):h<0&&(m=1.5*Math.PI+Math.atan(d/h)),m>0||p>0){const i=m-p,n=Math.abs(i);n>r&&(r=n,o=i,l=(e.startX+t.startX)/2,c=(e.startY+t.startY)/2)}if(i=Math.abs(i),n=Math.abs(n),h=Math.abs(h),d=Math.abs(d),i>0&&n>0?u=Math.sqrt(i*i+n*n):i>0?u=i:n>0&&(u=n),h>0&&d>0?f=Math.sqrt(h*h+d*d):h>0?f=h:d>0&&(f=d),u>0&&f>0){const i=(f-u)/u,n=Math.abs(i);n>s&&(s=n,a=i,l=(e.startX+t.startX)/2,c=(e.startY+t.startY)/2)}})});const h=r>0,d=s>0;h&&d?(n.rotate=o,n.scale=a,n.centerX=l,n.centerY=c):h?(n.action=v,n.rotate=o,n.centerX=l,n.centerY=c):d?(n.action=y,n.scale=a,n.centerX=l,n.centerY=c):n.action=b}else{const[e]=Array.from(i.values());Object.assign(n,e)}i.forEach(e=>{e.startX=e.endX,e.startY=e.endY}),n.action!==b&&this.$emit(F,n,{cancelable:!1})}$handlePointerUp(e){const{$action:t,$pointers:i}=this;if(!this.disabled&&t!==b&&!1!==this.$emit(N,{action:t,relatedEvent:e})){if(e.preventDefault(),e.changedTouches)Array.from(e.changedTouches).forEach(({identifier:e})=>{i.delete(e)});else{const{pointerId:t=0}=e;i.delete(t)}0===i.size&&(this.style.willChange="",this.$action=b)}}$handleWheel(e){if(this.disabled)return;if(e.preventDefault(),this.$wheeling)return;this.$wheeling=!0,setTimeout(()=>{this.$wheeling=!1},50);const t=(e.deltaY>0?-1:1)*this.scaleStep;this.$emit(F,{action:y,scale:t,relatedEvent:e},{cancelable:!1})}$setAction(e){return j(e)&&(this.$action=e),this}$toCanvas(e){return new Promise((t,i)=>{if(!this.isConnected)return void i(new Error("The current element is not connected to the DOM."));const n=document.createElement("canvas");let r=this.offsetWidth,s=this.offsetHeight,o=1;X(e)&&(U(e.width)||U(e.height))&&(({width:r,height:s}=de({aspectRatio:r/s,width:e.width,height:e.height})),o=r/this.offsetWidth),n.width=r,n.height=s;const a=this.querySelector(this.$getTagNameOf(u));a?a.$ready().then(i=>{const l=n.getContext("2d");if(l){const[t,c,h,d,u,f]=a.$getTransform();let p=u,m=f,g=i.naturalWidth,_=i.naturalHeight;1!==o&&(p*=o,m*=o,g*=o,_*=o);const y=g/2,v=_/2;l.fillStyle="transparent",l.fillRect(0,0,r,s),X(e)&&q(e.beforeDraw)&&e.beforeDraw.call(this,l,n),l.save(),l.translate(y,v),l.transform(t,c,h,d,p,m),l.translate(-y,-v),l.drawImage(i,0,0,g,_),l.restore()}t(n)}).catch(i):t(n)})}}xe.$name=l,xe.$version="2.0.0";const be=new WeakMap,we=["alt","crossorigin","decoding","importance","loading","referrerpolicy","sizes","src","srcset"];class Se extends ve{constructor(){super(...arguments),this.$matrix=[1,0,0,1,0,0],this.$onLoad=null,this.$onCanvasAction=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$actionStartTarget=null,this.$style=":host{display:inline-block}img{display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}",this.$image=new Image,this.initialCenterSize="contain",this.rotatable=!1,this.scalable=!1,this.skewable=!1,this.slottable=!1,this.translatable=!1}set $canvas(e){be.set(this,e)}get $canvas(){return be.get(this)}static get observedAttributes(){return super.observedAttributes.concat(we,["initial-center-size","rotatable","scalable","skewable","translatable"])}attributeChangedCallback(e,t,i){Object.is(i,t)||(super.attributeChangedCallback(e,t,i),we.includes(e)&&this.$image.setAttribute(e,i))}$propertyChangedCallback(e,t,i){Object.is(i,t)||(super.$propertyChangedCallback(e,t,i),"initialCenterSize"!==e)||this.$nextTick(()=>{this.$center(i)})}connectedCallback(){super.connectedCallback();const{$image:e}=this,t=this.closest(this.$getTagNameOf(l));t&&(this.$canvas=t,this.$setStyles({display:"block",position:"absolute"}),this.$onCanvasActionStart=e=>{var t,i;this.$actionStartTarget=null===(i=null===(t=e.detail)||void 0===t?void 0:t.relatedEvent)||void 0===i?void 0:i.target},this.$onCanvasActionEnd=()=>{this.$actionStartTarget=null},this.$onCanvasAction=this.$handleAction.bind(this),ne(t,Y,this.$onCanvasActionStart),ne(t,N,this.$onCanvasActionEnd),ne(t,F,this.$onCanvasAction)),this.$onLoad=this.$handleLoad.bind(this),ne(e,O,this.$onLoad),this.$getShadowRoot().appendChild(e)}disconnectedCallback(){const{$image:e,$canvas:t}=this;t&&(this.$onCanvasActionStart&&(ie(t,Y,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(ie(t,N,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(ie(t,F,this.$onCanvasAction),this.$onCanvasAction=null)),e&&this.$onLoad&&(ie(e,O,this.$onLoad),this.$onLoad=null),this.$getShadowRoot().removeChild(e),super.disconnectedCallback()}$handleLoad(){const{$image:e}=this;this.$setStyles({width:e.naturalWidth,height:e.naturalHeight}),this.$canvas&&this.$center(this.initialCenterSize)}$handleAction(e){if(this.hidden||!(this.rotatable||this.scalable||this.translatable))return;const{$canvas:t}=this,{detail:i}=e;if(i){const{relatedEvent:e}=i;let{action:n}=i;switch(n!==x||this.rotatable&&this.scalable||(n=this.rotatable?v:this.scalable?y:b),n){case _:if(this.translatable){let n=null;e&&(n=e.target.closest(this.$getTagNameOf(f))),n||(n=t.querySelector(this.$getTagNameOf(f))),n&&n.multiple&&!n.active&&(n=t.querySelector(`${this.$getTagNameOf(f)}[active]`)),n&&!n.hidden&&n.movable&&!n.dynamic&&this.$actionStartTarget&&n.contains(this.$actionStartTarget)||this.$move(i.endX-i.startX,i.endY-i.startY)}break;case v:if(this.rotatable)if(e){const{x:t,y:n}=this.getBoundingClientRect();this.$rotate(i.rotate,e.clientX-t,e.clientY-n)}else this.$rotate(i.rotate);break;case y:if(this.scalable)if(e){const t=e.target.closest(this.$getTagNameOf(f));if(!t||!t.zoomable||t.zoomable&&t.dynamic){const{x:t,y:n}=this.getBoundingClientRect();this.$zoom(i.scale,e.clientX-t,e.clientY-n)}}else this.$zoom(i.scale);break;case x:if(this.rotatable&&this.scalable){const{rotate:t}=i;let{scale:n}=i;n<0?n=1/(1-n):n+=1;const r=Math.cos(t),s=Math.sin(t),[o,a,l,c]=[r*n,s*n,-s*n,r*n];if(e){const t=this.getBoundingClientRect(),i=e.clientX-t.x,n=e.clientY-t.y,[r,s,h,d]=this.$matrix,u=i-t.width/2,f=n-t.height/2,p=(u*d-h*f)/(r*d-h*s),m=(f*r-s*u)/(r*d-h*s);this.$transform(o,a,l,c,p*(1-o)+m*l,m*(1-c)+p*a)}else this.$transform(o,a,l,c,0,0)}}}}$ready(e){const{$image:t}=this,i=new Promise((e,i)=>{const n=new Error("Failed to load the image source");if(t.complete)t.naturalWidth>0&&t.naturalHeight>0?e(t):i(n);else{const r=()=>{ie(t,P,s),e(t)},s=()=>{ie(t,O,r),i(n)};re(t,O,r),re(t,P,s)}});return q(e)&&i.then(t=>(e(t),t)),i}$center(e){const{parentElement:t}=this;if(!t)return this;const i=t.getBoundingClientRect(),n=i.width,r=i.height,{x:s,y:o,width:a,height:l}=this.getBoundingClientRect(),c=s+a/2,h=o+l/2,d=i.x+n/2,u=i.y+r/2;if(this.$move(d-c,u-h),e&&(a!==n||l!==r)){const t=n/a,i=r/l;switch(e){case"cover":this.$scale(Math.max(t,i));break;case"contain":this.$scale(Math.min(t,i))}}return this}$move(e,t=e){if(this.translatable&&W(e)&&W(t)){const[i,n,r,s]=this.$matrix,o=(e*s-r*t)/(i*s-r*n),a=(t*i-n*e)/(i*s-r*n);this.$translate(o,a)}return this}$moveTo(e,t=e){if(this.translatable&&W(e)&&W(t)){const[i,n,r,s]=this.$matrix,o=(e*s-r*t)/(i*s-r*n),a=(t*i-n*e)/(i*s-r*n);this.$setTransform(i,n,r,s,o,a)}return this}$rotate(e,t,i){if(this.rotatable){const n=ce(e),r=Math.cos(n),s=Math.sin(n),[o,a,l,c]=[r,s,-s,r];if(W(t)&&W(i)){const[e,n,r,s]=this.$matrix,{width:h,height:d}=this.getBoundingClientRect(),u=t-h/2,f=i-d/2,p=(u*s-r*f)/(e*s-r*n),m=(f*e-n*u)/(e*s-r*n);this.$transform(o,a,l,c,p*(1-o)-m*l,m*(1-c)-p*a)}else this.$transform(o,a,l,c,0,0)}return this}$zoom(e,t,i){if(!this.scalable||0===e)return this;if(e<0?e=1/(1-e):e+=1,W(t)&&W(i)){const[n,r,s,o]=this.$matrix,{width:a,height:l}=this.getBoundingClientRect(),c=t-a/2,h=i-l/2,d=(c*o-s*h)/(n*o-s*r),u=(h*n-r*c)/(n*o-s*r);this.$transform(e,0,0,e,d*(1-e),u*(1-e))}else this.$scale(e);return this}$scale(e,t=e){return this.scalable&&this.$transform(e,0,0,t,0,0),this}$skew(e,t=0){if(this.skewable){const i=ce(e),n=ce(t);this.$transform(1,Math.tan(n),Math.tan(i),1,0,0)}return this}$translate(e,t=e){return this.translatable&&W(e)&&W(t)&&this.$transform(1,0,0,1,e,t),this}$transform(e,t,i,n,r,s){return W(e)&&W(t)&&W(i)&&W(n)&&W(r)&&W(s)?this.$setTransform(ue(this.$matrix,[e,t,i,n,r,s])):this}$setTransform(e,t,i,n,r,s){if((this.rotatable||this.scalable||this.skewable||this.translatable)&&(Array.isArray(e)&&([e,t,i,n,r,s]=e),W(e)&&W(t)&&W(i)&&W(n)&&W(r)&&W(s))){const o=[...this.$matrix],a=[e,t,i,n,r,s];if(!1===this.$emit(H,{matrix:a,oldMatrix:o}))return this;this.$matrix=a,this.style.transform=`matrix(${a.join(", ")})`}return this}$getTransform(){return this.$matrix.slice()}$resetTransform(){return this.$setTransform([1,0,0,1,0,0])}}Se.$name=u,Se.$version="2.0.0";const Te=new WeakMap;class ke extends ve{constructor(){super(...arguments),this.$onCanvasChange=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$style=":host{display:block;height:0;left:0;outline:var(--theme-color) solid 1px;position:relative;top:0;width:0}:host([transparent]){outline-color:transparent}",this.x=0,this.y=0,this.width=0,this.height=0,this.slottable=!1,this.themeColor="rgba(0, 0, 0, 0.65)"}set $canvas(e){Te.set(this,e)}get $canvas(){return Te.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["height","width","x","y"])}connectedCallback(){super.connectedCallback();const e=this.closest(this.$getTagNameOf(l));if(e){this.$canvas=e,this.style.position="absolute";const t=e.querySelector(this.$getTagNameOf(f));t&&(this.$onCanvasActionStart=e=>{t.hidden&&e.detail.action===g&&(this.hidden=!1)},this.$onCanvasActionEnd=e=>{t.hidden&&e.detail.action===g&&(this.hidden=!0)},this.$onCanvasChange=e=>{const{x:i,y:n,width:r,height:s}=e.detail;this.$change(i,n,r,s),(t.hidden||0===i&&0===n&&0===r&&0===s)&&(this.hidden=!0)},ne(e,Y,this.$onCanvasActionStart),ne(e,N,this.$onCanvasActionEnd),ne(e,B,this.$onCanvasChange))}this.$render()}disconnectedCallback(){const{$canvas:e}=this;e&&(this.$onCanvasActionStart&&(ie(e,Y,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(ie(e,N,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasChange&&(ie(e,B,this.$onCanvasChange),this.$onCanvasChange=null)),super.disconnectedCallback()}$change(e,t,i=this.width,n=this.height){return W(e)&&W(t)&&W(i)&&W(n)&&(e!==this.x||t!==this.y||i!==this.width||n!==this.height)?(this.hidden&&(this.hidden=!1),this.x=e,this.y=t,this.width=i,this.height=n,this.$render()):this}$reset(){return this.$change(0,0,0,0)}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height,outlineWidth:r.innerWidth})}}ke.$name=p,ke.$version="2.0.0";class Me extends ve{constructor(){super(...arguments),this.$onCanvasCropEnd=null,this.$onCanvasCropStart=null,this.$style=':host{background-color:var(--theme-color);display:block}:host([action=move]),:host([action=select]){height:100%;left:0;position:absolute;top:0;width:100%}:host([action=move]){cursor:move}:host([action=select]){cursor:crosshair}:host([action$=-resize]){background-color:transparent;height:15px;position:absolute;width:15px}:host([action$=-resize]):after{background-color:var(--theme-color);content:"";display:block;height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:5px}:host([action=n-resize]),:host([action=s-resize]){cursor:ns-resize;left:50%;transform:translateX(-50%);width:100%}:host([action=n-resize]){top:-8px}:host([action=s-resize]){bottom:-8px}:host([action=e-resize]),:host([action=w-resize]){cursor:ew-resize;height:100%;top:50%;transform:translateY(-50%)}:host([action=e-resize]){right:-8px}:host([action=w-resize]){left:-8px}:host([action=ne-resize]){cursor:nesw-resize;right:-8px;top:-8px}:host([action=nw-resize]){cursor:nwse-resize;left:-8px;top:-8px}:host([action=se-resize]){bottom:-8px;cursor:nwse-resize;right:-8px}:host([action=se-resize]):after{height:15px;width:15px}@media (pointer:coarse){:host([action=se-resize]):after{height:10px;width:10px}}@media (pointer:fine){:host([action=se-resize]):after{height:5px;width:5px}}:host([action=sw-resize]){bottom:-8px;cursor:nesw-resize;left:-8px}:host([plain]){background-color:transparent}',this.action=b,this.plain=!1,this.slottable=!1,this.themeColor="rgba(51, 153, 255, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["action","plain"])}}Me.$name=d,Me.$version="2.0.0";const Ae=new WeakMap;class Ce extends ve{constructor(){super(...arguments),this.$onCanvasAction=null,this.$onCanvasActionStart=null,this.$onCanvasActionEnd=null,this.$onDocumentKeyDown=null,this.$action="",this.$actionStartTarget=null,this.$changing=!1,this.$style=':host{display:block;left:0;position:relative;right:0}:host([outlined]){outline:1px solid var(--theme-color)}:host([multiple]){outline:1px dashed hsla(0,0%,100%,.5)}:host([multiple]):after{bottom:0;content:"";cursor:pointer;display:block;left:0;position:absolute;right:0;top:0}:host([multiple][active]){outline-color:var(--theme-color);z-index:1}:host([multiple])>*{visibility:hidden}:host([multiple][active])>*{visibility:visible}:host([multiple][active]):after{display:none}',this.$initialSelection={x:0,y:0,width:0,height:0},this.x=0,this.y=0,this.width=0,this.height=0,this.aspectRatio=NaN,this.initialAspectRatio=NaN,this.initialCoverage=NaN,this.active=!1,this.linked=!1,this.dynamic=!1,this.movable=!1,this.resizable=!1,this.zoomable=!1,this.multiple=!1,this.keyboard=!1,this.outlined=!1,this.precise=!1}set $canvas(e){Ae.set(this,e)}get $canvas(){return Ae.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["active","aspect-ratio","dynamic","height","initial-aspect-ratio","initial-coverage","keyboard","linked","movable","multiple","outlined","precise","resizable","width","x","y","zoomable"])}$propertyChangedCallback(e,t,i){if(!Object.is(i,t))switch(super.$propertyChangedCallback(e,t,i),e){case"x":case"y":case"width":case"height":this.$changing||this.$nextTick(()=>{this.$change(this.x,this.y,this.width,this.height,this.aspectRatio,!0)});break;case"aspectRatio":case"initialAspectRatio":this.$nextTick(()=>{this.$initSelection()});break;case"initialCoverage":this.$nextTick(()=>{U(i)&&i<=1&&this.$initSelection(!0,!0)});break;case"keyboard":this.$nextTick(()=>{this.$canvas&&(i?this.$onDocumentKeyDown||(this.$onDocumentKeyDown=this.$handleKeyDown.bind(this),ne(this.ownerDocument,R,this.$onDocumentKeyDown)):this.$onDocumentKeyDown&&(ie(this.ownerDocument,R,this.$onDocumentKeyDown),this.$onDocumentKeyDown=null))});break;case"multiple":this.$nextTick(()=>{if(this.$canvas){const e=this.$getSelections();i?(e.forEach(e=>{e.active=!1}),this.active=!0,this.$emit(B,{x:this.x,y:this.y,width:this.width,height:this.height})):(this.active=!1,e.slice(1).forEach(e=>{this.$removeSelection(e)}))}});break;case"precise":this.$nextTick(()=>{this.$change(this.x,this.y)});break;case"linked":i&&(this.dynamic=!0)}}connectedCallback(){super.connectedCallback();const e=this.closest(this.$getTagNameOf(l));e?(this.$canvas=e,this.$setStyles({position:"absolute",transform:`translate(${this.x}px, ${this.y}px)`}),this.hidden||this.$render(),this.$initSelection(!0),this.$onCanvasActionStart=this.$handleActionStart.bind(this),this.$onCanvasActionEnd=this.$handleActionEnd.bind(this),this.$onCanvasAction=this.$handleAction.bind(this),ne(e,Y,this.$onCanvasActionStart),ne(e,N,this.$onCanvasActionEnd),ne(e,F,this.$onCanvasAction)):this.$render()}disconnectedCallback(){const{$canvas:e}=this;e&&(this.$onCanvasActionStart&&(ie(e,Y,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(ie(e,N,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(ie(e,F,this.$onCanvasAction),this.$onCanvasAction=null)),super.disconnectedCallback()}$getSelections(){let e=[];return this.parentElement&&(e=Array.from(this.parentElement.querySelectorAll(this.$getTagNameOf(f)))),e}$initSelection(e=!1,t=!1){const{initialCoverage:i,parentElement:n}=this;if(U(i)&&n){const r=this.aspectRatio||this.initialAspectRatio;let s=(t?0:this.width)||n.offsetWidth*i,o=(t?0:this.height)||n.offsetHeight*i;U(r)&&({width:s,height:o}=de({aspectRatio:r,width:s,height:o})),this.$change(this.x,this.y,s,o),e&&this.$center(),this.$initialSelection={x:this.x,y:this.y,width:this.width,height:this.height}}}$createSelection(){const e=this.cloneNode(!0);return this.hasAttribute("id")&&e.removeAttribute("id"),e.initialCoverage=NaN,this.active=!1,this.parentElement&&this.parentElement.insertBefore(e,this.nextSibling),e}$removeSelection(e=this){if(this.parentElement){const t=this.$getSelections();if(t.length>1){const i=t.indexOf(e),n=t[i+1]||t[i-1];n&&(e.active=!1,this.parentElement.removeChild(e),n.active=!0,n.$emit(B,{x:n.x,y:n.y,width:n.width,height:n.height}))}else this.$clear()}}$handleActionStart(e){var t,i;const n=null===(i=null===(t=e.detail)||void 0===t?void 0:t.relatedEvent)||void 0===i?void 0:i.target;this.$action="",this.$actionStartTarget=n,!this.hidden&&this.multiple&&!this.active&&n===this&&this.parentElement&&(this.$getSelections().forEach(e=>{e.active=!1}),this.active=!0,this.$emit(B,{x:this.x,y:this.y,width:this.width,height:this.height}))}$handleAction(e){const{currentTarget:t,detail:i}=e;if(!t||!i)return;const{relatedEvent:n}=i;let{action:r}=i;if(!r&&this.multiple&&(r=this.$action||(null==n?void 0:n.target.action),this.$action=r),!r||this.hidden&&r!==g||this.multiple&&!this.active&&r!==y)return;const s=i.endX-i.startX,o=i.endY-i.startY,{width:a,height:l}=this;let{aspectRatio:c}=this;switch(!U(c)&&n.shiftKey&&(c=U(a)&&U(l)?a/l:1),r){case g:if(0!==s&&0!==o){const{$canvas:e}=this,n=ae(t);(this.multiple&&!this.hidden?this.$createSelection():this).$change(i.startX-n.left,i.startY-n.top,Math.abs(s),Math.abs(o),c),s<0?o<0?r=A:o>0&&(r=D):s>0&&(o<0?r=M:o>0&&(r=C)),e&&(e.$action=r)}break;case _:this.movable&&(this.dynamic||this.$actionStartTarget&&this.contains(this.$actionStartTarget))&&this.$move(s,o);break;case y:if(n&&this.zoomable&&(this.dynamic||this.contains(n.target))){const e=ae(t);this.$zoom(i.scale,n.pageX-e.left,n.pageY-e.top)}break;default:this.$resize(r,s,o,c)}}$handleActionEnd(){this.$action="",this.$actionStartTarget=null}$handleKeyDown(e){if(this.hidden||!this.keyboard||this.multiple&&!this.active||e.defaultPrevented)return;const{activeElement:t}=document;if(!t||!["INPUT","TEXTAREA"].includes(t.tagName)&&!["true","plaintext-only"].includes(t.contentEditable))switch(e.key){case"Backspace":e.metaKey&&(e.preventDefault(),this.$removeSelection());break;case"Delete":e.preventDefault(),this.$removeSelection();break;case"ArrowLeft":e.preventDefault(),this.$move(-1,0);break;case"ArrowRight":e.preventDefault(),this.$move(1,0);break;case"ArrowUp":e.preventDefault(),this.$move(0,-1);break;case"ArrowDown":e.preventDefault(),this.$move(0,1);break;case"+":e.preventDefault(),this.$zoom(.1);break;case"-":e.preventDefault(),this.$zoom(-.1)}}$center(){const{parentElement:e}=this;if(!e)return this;const t=(e.offsetWidth-this.width)/2,i=(e.offsetHeight-this.height)/2;return this.$change(t,i)}$move(e,t=e){return this.$moveTo(this.x+e,this.y+t)}$moveTo(e,t=e){return this.movable?this.$change(e,t):this}$resize(e,t=0,i=0,n=this.aspectRatio){if(!this.resizable)return this;const r=U(n),{$canvas:s}=this;let{x:o,y:a,width:l,height:c}=this;switch(e){case w:a+=i,c-=i,c<0&&(e=T,c=-c,a-=c),r&&(o+=(t=i*n)/2,l-=t,l<0&&(l=-l,o-=l));break;case S:l+=t,l<0&&(e=k,l=-l,o-=l),r&&(a-=(i=t/n)/2,c+=i,c<0&&(c=-c,a-=c));break;case T:c+=i,c<0&&(e=w,c=-c,a-=c),r&&(o-=(t=i*n)/2,l+=t,l<0&&(l=-l,o-=l));break;case k:o+=t,l-=t,l<0&&(e=S,l=-l,o-=l),r&&(a+=(i=t/n)/2,c-=i,c<0&&(c=-c,a-=c));break;case M:r&&(i=-t/n),a+=i,c-=i,l+=t,l<0&&c<0?(e=D,l=-l,c=-c,o-=l,a-=c):l<0?(e=A,l=-l,o-=l):c<0&&(e=C,c=-c,a-=c);break;case A:r&&(i=t/n),o+=t,a+=i,l-=t,c-=i,l<0&&c<0?(e=C,l=-l,c=-c,o-=l,a-=c):l<0?(e=M,l=-l,o-=l):c<0&&(e=D,c=-c,a-=c);break;case C:r&&(i=t/n),l+=t,c+=i,l<0&&c<0?(e=A,l=-l,c=-c,o-=l,a-=c):l<0?(e=D,l=-l,o-=l):c<0&&(e=M,c=-c,a-=c);break;case D:r&&(i=-t/n),o+=t,l-=t,c+=i,l<0&&c<0?(e=M,l=-l,c=-c,o-=l,a-=c):l<0?(e=C,l=-l,o-=l):c<0&&(e=A,c=-c,a-=c)}return s&&s.$setAction(e),this.$change(o,a,l,c)}$zoom(e,t,i){if(!this.zoomable||0===e)return this;e<0?e=1/(1-e):e+=1;const{width:n,height:r}=this,s=n*e,o=r*e;let a=this.x,l=this.y;return W(t)&&W(i)?(a-=(s-n)*((t-this.x)/n),l-=(o-r)*((i-this.y)/r)):(a-=(s-n)/2,l-=(o-r)/2),this.$change(a,l,s,o)}$change(e,t,i=this.width,n=this.height,r=this.aspectRatio,s=!1){return this.$changing||!W(e)||!W(t)||!W(i)||!W(n)||i<0||n<0?this:(U(r)&&({width:i,height:n}=de({aspectRatio:r,width:i,height:n},"cover")),this.precise||(e=Math.round(e),t=Math.round(t),i=Math.round(i),n=Math.round(n)),e===this.x&&t===this.y&&i===this.width&&n===this.height&&Object.is(r,this.aspectRatio)&&!s?this:(this.hidden&&(this.hidden=!1),!1===this.$emit(B,{x:e,y:t,width:i,height:n})?this:(this.$changing=!0,this.x=e,this.y=t,this.width=i,this.height=n,this.$changing=!1,this.$render())))}$reset(){const{x:e,y:t,width:i,height:n}=this.$initialSelection;return this.$change(e,t,i,n)}$clear(){return this.$change(0,0,0,0,NaN,!0),this.hidden=!0,this}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height})}$toCanvas(e){return new Promise((t,i)=>{if(!this.isConnected)return void i(new Error("The current element is not connected to the DOM."));const n=document.createElement("canvas");let{width:r,height:s}=this,o=1;if(X(e)&&(U(e.width)||U(e.height))&&(({width:r,height:s}=de({aspectRatio:r/s,width:e.width,height:e.height})),o=r/this.width),n.width=r,n.height=s,!this.$canvas)return void t(n);const a=this.$canvas.querySelector(this.$getTagNameOf(u));a?a.$ready().then(i=>{const l=n.getContext("2d");if(l){const[t,c,h,d,u,f]=a.$getTransform(),p=-this.x,m=-this.y,g=(p*d-h*m)/(t*d-h*c),_=(m*t-c*p)/(t*d-h*c);let y=t*g+h*_+u,v=c*g+d*_+f,x=i.naturalWidth,b=i.naturalHeight;1!==o&&(y*=o,v*=o,x*=o,b*=o);const w=x/2,S=b/2;l.fillStyle="transparent",l.fillRect(0,0,r,s),X(e)&&q(e.beforeDraw)&&e.beforeDraw.call(this,l,n),l.save(),l.translate(w,S),l.transform(t,c,h,d,y,v),l.translate(-w,-S),l.drawImage(i,0,0,x,b),l.restore()}t(n)}).catch(i):t(n)})}}Ce.$name=f,Ce.$version="2.0.0";class De extends ve{constructor(){super(...arguments),this.$style=":host{display:flex;flex-direction:column;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([bordered]){border:1px dashed var(--theme-color)}:host([covered]){bottom:0;left:0;position:absolute;right:0;top:0}:host>span{display:flex;flex:1}:host>span+span{border-top:1px dashed var(--theme-color)}:host>span>span{flex:1}:host>span>span+span{border-left:1px dashed var(--theme-color)}",this.bordered=!1,this.columns=3,this.covered=!1,this.rows=3,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["bordered","columns","covered","rows"])}$propertyChangedCallback(e,t,i){Object.is(i,t)||(super.$propertyChangedCallback(e,t,i),"rows"!==e&&"columns"!==e||this.$nextTick(()=>{this.$render()}))}connectedCallback(){super.connectedCallback(),this.$render()}$render(){const e=this.$getShadowRoot(),t=document.createDocumentFragment();for(let e=0;e<this.rows;e+=1){const e=document.createElement("span");e.setAttribute("role","row");for(let t=0;t<this.columns;t+=1){const t=document.createElement("span");t.setAttribute("role","gridcell"),e.appendChild(t)}t.appendChild(e)}e&&(e.innerHTML="",e.appendChild(t))}}De.$name=h,De.$version="2.0.0";class Le extends ve{constructor(){super(...arguments),this.$style=':host{display:inline-block;height:1em;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1em}:host:after,:host:before{background-color:var(--theme-color);content:"";display:block;position:absolute}:host:before{height:1px;left:0;top:50%;transform:translateY(-50%);width:100%}:host:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:1px}:host([centered]){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}',this.centered=!1,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["centered"])}}Le.$name=c,Le.$version="2.0.0";const Ee=new WeakMap,Ie=new WeakMap,Pe=new WeakMap,Re=new WeakMap,Oe="vertical";class ze extends ve{constructor(){super(...arguments),this.$onSelectionChange=null,this.$onSourceImageLoad=null,this.$onSourceImageTransform=null,this.$scale=1,this.$style=":host{display:block;height:100%;overflow:hidden;position:relative;width:100%}",this.resize=Oe,this.selection="",this.slottable=!1}set $image(e){Ie.set(this,e)}get $image(){return Ie.get(this)}set $sourceImage(e){Re.set(this,e)}get $sourceImage(){return Re.get(this)}set $canvas(e){Ee.set(this,e)}get $canvas(){return Ee.get(this)}set $selection(e){Pe.set(this,e)}get $selection(){return Pe.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["resize","selection"])}connectedCallback(){super.connectedCallback();let e=null;if(e=this.selection?this.ownerDocument.querySelector(this.selection):this.closest(this.$getTagNameOf(f)),Z(e)){this.$selection=e,this.$onSelectionChange=this.$handleSelectionChange.bind(this),ne(e,B,this.$onSelectionChange);const t=e.closest(this.$getTagNameOf(l));if(t){this.$canvas=t;const e=t.querySelector(this.$getTagNameOf(u));e&&(this.$sourceImage=e,this.$image=e.cloneNode(!0),this.$getShadowRoot().appendChild(this.$image),this.$onSourceImageLoad=this.$handleSourceImageLoad.bind(this),this.$onSourceImageTransform=this.$handleSourceImageTransform.bind(this),ne(e.$image,O,this.$onSourceImageLoad),ne(e,H,this.$onSourceImageTransform))}this.$render()}}disconnectedCallback(){const{$selection:e,$sourceImage:t}=this;e&&this.$onSelectionChange&&(ie(e,B,this.$onSelectionChange),this.$onSelectionChange=null),t&&this.$onSourceImageLoad&&(ie(t.$image,O,this.$onSourceImageLoad),this.$onSourceImageLoad=null),t&&this.$onSourceImageTransform&&(ie(t,H,this.$onSourceImageTransform),this.$onSourceImageTransform=null),super.disconnectedCallback()}$handleSelectionChange(e){this.$render(e.detail)}$handleSourceImageLoad(){const{$image:e,$sourceImage:t}=this,i=e.getAttribute("src"),n=t.getAttribute("src");n&&n!==i&&(e.setAttribute("src",n),e.$ready(()=>{setTimeout(()=>{this.$render()},50)}))}$handleSourceImageTransform(e){this.$render(void 0,e.detail.matrix)}$render(e,t){const{$canvas:i,$selection:n}=this;e||n.hidden||(e=n),(!e||0===e.x&&0===e.y&&0===e.width&&0===e.height)&&(e={x:0,y:0,width:i.offsetWidth,height:i.offsetHeight});const{x:r,y:s,width:o,height:a}=e,l={},{clientWidth:c,clientHeight:h}=this;let d=c,u=h,f=NaN;switch(this.resize){case"both":f=1,d=o,u=a,l.width=o,l.height=a;break;case"horizontal":f=a>0?h/a:0,d=o*f,l.width=d;break;case Oe:f=o>0?c/o:0,u=a*f,l.height=u;break;default:c>0?f=o>0?c/o:0:h>0&&(f=a>0?h/a:0)}this.$scale=f,this.$setStyles(l),this.$sourceImage&&this.$transformImageByOffset(null!=t?t:this.$sourceImage.$getTransform(),-r,-s)}$transformImageByOffset(e,t,i){const{$image:n,$scale:r,$sourceImage:s}=this;if(s&&n&&r>=0){const[s,o,a,l,c,h]=e,d=(t*l-a*i)/(s*l-a*o),u=(i*s-o*t)/(s*l-a*o),f=s*d+a*u+c,p=o*d+l*u+h;n.$ready(e=>{this.$setStyles.call(n,{width:e.naturalWidth*r,height:e.naturalHeight*r})}),n.$setTransform(s,o,a,l,f*r,p*r)}}}ze.$name=m,ze.$version="2.0.0";const Fe=/^img|canvas$/,Ne=/<(\/?(?:script|style)[^>]*)>/gi,Ye={template:'<cropper-canvas background><cropper-image rotatable scalable skewable translatable></cropper-image><cropper-shade hidden></cropper-shade><cropper-handle action="select" plain></cropper-handle><cropper-selection initial-coverage="0.5" movable resizable><cropper-grid role="grid" bordered covered></cropper-grid><cropper-crosshair centered></cropper-crosshair><cropper-handle action="move" theme-color="rgba(255, 255, 255, 0.35)"></cropper-handle><cropper-handle action="n-resize"></cropper-handle><cropper-handle action="e-resize"></cropper-handle><cropper-handle action="s-resize"></cropper-handle><cropper-handle action="w-resize"></cropper-handle><cropper-handle action="ne-resize"></cropper-handle><cropper-handle action="nw-resize"></cropper-handle><cropper-handle action="se-resize"></cropper-handle><cropper-handle action="sw-resize"></cropper-handle></cropper-selection></cropper-canvas>'};xe.$define(),Le.$define(),De.$define(),Me.$define(),Se.$define(),Ce.$define(),ke.$define(),ze.$define();class Be{constructor(e,t){if(this.options=Ye,j(e)&&(e=document.querySelector(e)),!Z(e)||!Fe.test(e.localName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,t=Object.assign(Object.assign({},Ye),t),this.options=t;const{ownerDocument:i}=e;let{container:n}=t;if(n&&(j(n)&&(n=i.querySelector(n)),!Z(n)))throw new Error("The `container` option must be an element or a valid selector.");Z(n)||(n=e.parentElement?e.parentElement:i.body),this.container=n;const r=e.localName;let s="";"img"===r?({src:s}=e):"canvas"===r&&window.HTMLCanvasElement&&(s=e.toDataURL());const{template:o}=t;if(o&&j(o)){const t=document.createElement("template"),i=document.createDocumentFragment();t.innerHTML=o.replace(Ne,"<$1>"),i.appendChild(t.content),Array.from(i.querySelectorAll(u)).forEach(t=>{t.setAttribute("src",s),t.setAttribute("alt",e.alt||"The image to crop")}),e.parentElement?(e.style.display="none",n.insertBefore(i,e.nextSibling)):n.appendChild(i)}}getCropperCanvas(){return this.container.querySelector(l)}getCropperImage(){return this.container.querySelector(u)}getCropperSelection(){return this.container.querySelector(f)}getCropperSelections(){return this.container.querySelectorAll(f)}}Be.version="2.0.0"},3318:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>a}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(222);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(8979);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(5581);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(6233);function a(e){return e!==(0,r.A)(e)&&(0,s.sb)(e)?(0,o.A)(e):(0,n.A)(e)}},3322:function(e,t,i){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једног минута"],mm:["минут","минута","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],d:["један дан","једног дана"],dd:["дан","дана","дана"],M:["један месец","једног месеца"],MM:["месец","месеца","месеци"],y:["једну годину","једне године"],yy:["годину","године","година"]},correctGrammaticalCase:function(e,t){return e%10>=1&&e%10<=4&&(e%100<10||e%100>=20)?e%10==1?t[0]:t[1]:t[2]},translate:function(e,i,n,r){var s,o=t.words[n];return 1===n.length?"y"===n&&i?"једна година":r||i?o[0]:o[1]:(s=t.correctGrammaticalCase(e,o),"yy"===n&&i&&"годину"===s?e+" година":e+" "+s)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:t.translate,dd:t.translate,M:t.translate,MM:t.translate,y:t.translate,yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(i(5093))},3335:function(e,t,i){var n,r;n=[i(5093),i(4692)],void 0===(r=function(e,t){return t.fn||(t.fn={}),"function"!=typeof e&&e.hasOwnProperty("default")&&(e=e.default),function(e,t){var i=function(i,n,r){if(this.parentEl="body",this.element=t(i),this.startDate=e().startOf("day"),this.endDate=e().endOf("day"),this.minDate=!1,this.maxDate=!1,this.maxSpan=!1,this.autoApply=!1,this.singleDatePicker=!1,this.showDropdowns=!1,this.minYear=e().subtract(100,"year").format("YYYY"),this.maxYear=e().add(100,"year").format("YYYY"),this.showWeekNumbers=!1,this.showISOWeekNumbers=!1,this.showCustomRangeLabel=!0,this.timePicker=!1,this.timePicker24Hour=!1,this.timePickerIncrement=1,this.timePickerSeconds=!1,this.linkedCalendars=!0,this.autoUpdateInput=!0,this.alwaysShowCalendars=!1,this.ranges={},this.opens="right",this.element.hasClass("pull-right")&&(this.opens="left"),this.drops="down",this.element.hasClass("dropup")&&(this.drops="up"),this.buttonClasses="btn btn-sm",this.applyButtonClasses="btn-primary",this.cancelButtonClasses="btn-default",this.locale={direction:"ltr",format:e.localeData().longDateFormat("L"),separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:e.weekdaysMin(),monthNames:e.monthsShort(),firstDay:e.localeData().firstDayOfWeek()},this.callback=function(){},this.isShowing=!1,this.leftCalendar={},this.rightCalendar={},"object"==typeof n&&null!==n||(n={}),"string"==typeof(n=t.extend(this.element.data(),n)).template||n.template instanceof t||(n.template='<div class="daterangepicker"><div class="ranges"></div><div class="drp-calendar left"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-calendar right"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-buttons"><span class="drp-selected"></span><button class="cancelBtn" type="button"></button><button class="applyBtn" disabled="disabled" type="button"></button> </div></div>'),this.parentEl=n.parentEl&&t(n.parentEl).length?t(n.parentEl):t(this.parentEl),this.container=t(n.template).appendTo(this.parentEl),"object"==typeof n.locale&&("string"==typeof n.locale.direction&&(this.locale.direction=n.locale.direction),"string"==typeof n.locale.format&&(this.locale.format=n.locale.format),"string"==typeof n.locale.separator&&(this.locale.separator=n.locale.separator),"object"==typeof n.locale.daysOfWeek&&(this.locale.daysOfWeek=n.locale.daysOfWeek.slice()),"object"==typeof n.locale.monthNames&&(this.locale.monthNames=n.locale.monthNames.slice()),"number"==typeof n.locale.firstDay&&(this.locale.firstDay=n.locale.firstDay),"string"==typeof n.locale.applyLabel&&(this.locale.applyLabel=n.locale.applyLabel),"string"==typeof n.locale.cancelLabel&&(this.locale.cancelLabel=n.locale.cancelLabel),"string"==typeof n.locale.weekLabel&&(this.locale.weekLabel=n.locale.weekLabel),"string"==typeof n.locale.customRangeLabel)){(u=document.createElement("textarea")).innerHTML=n.locale.customRangeLabel;var s=u.value;this.locale.customRangeLabel=s}if(this.container.addClass(this.locale.direction),"string"==typeof n.startDate&&(this.startDate=e(n.startDate,this.locale.format)),"string"==typeof n.endDate&&(this.endDate=e(n.endDate,this.locale.format)),"string"==typeof n.minDate&&(this.minDate=e(n.minDate,this.locale.format)),"string"==typeof n.maxDate&&(this.maxDate=e(n.maxDate,this.locale.format)),"object"==typeof n.startDate&&(this.startDate=e(n.startDate)),"object"==typeof n.endDate&&(this.endDate=e(n.endDate)),"object"==typeof n.minDate&&(this.minDate=e(n.minDate)),"object"==typeof n.maxDate&&(this.maxDate=e(n.maxDate)),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),"string"==typeof n.applyButtonClasses&&(this.applyButtonClasses=n.applyButtonClasses),"string"==typeof n.applyClass&&(this.applyButtonClasses=n.applyClass),"string"==typeof n.cancelButtonClasses&&(this.cancelButtonClasses=n.cancelButtonClasses),"string"==typeof n.cancelClass&&(this.cancelButtonClasses=n.cancelClass),"object"==typeof n.maxSpan&&(this.maxSpan=n.maxSpan),"object"==typeof n.dateLimit&&(this.maxSpan=n.dateLimit),"string"==typeof n.opens&&(this.opens=n.opens),"string"==typeof n.drops&&(this.drops=n.drops),"boolean"==typeof n.showWeekNumbers&&(this.showWeekNumbers=n.showWeekNumbers),"boolean"==typeof n.showISOWeekNumbers&&(this.showISOWeekNumbers=n.showISOWeekNumbers),"string"==typeof n.buttonClasses&&(this.buttonClasses=n.buttonClasses),"object"==typeof n.buttonClasses&&(this.buttonClasses=n.buttonClasses.join(" ")),"boolean"==typeof n.showDropdowns&&(this.showDropdowns=n.showDropdowns),"number"==typeof n.minYear&&(this.minYear=n.minYear),"number"==typeof n.maxYear&&(this.maxYear=n.maxYear),"boolean"==typeof n.showCustomRangeLabel&&(this.showCustomRangeLabel=n.showCustomRangeLabel),"boolean"==typeof n.singleDatePicker&&(this.singleDatePicker=n.singleDatePicker,this.singleDatePicker&&(this.endDate=this.startDate.clone())),"boolean"==typeof n.timePicker&&(this.timePicker=n.timePicker),"boolean"==typeof n.timePickerSeconds&&(this.timePickerSeconds=n.timePickerSeconds),"number"==typeof n.timePickerIncrement&&(this.timePickerIncrement=n.timePickerIncrement),"boolean"==typeof n.timePicker24Hour&&(this.timePicker24Hour=n.timePicker24Hour),"boolean"==typeof n.autoApply&&(this.autoApply=n.autoApply),"boolean"==typeof n.autoUpdateInput&&(this.autoUpdateInput=n.autoUpdateInput),"boolean"==typeof n.linkedCalendars&&(this.linkedCalendars=n.linkedCalendars),"function"==typeof n.isInvalidDate&&(this.isInvalidDate=n.isInvalidDate),"function"==typeof n.isCustomDate&&(this.isCustomDate=n.isCustomDate),"boolean"==typeof n.alwaysShowCalendars&&(this.alwaysShowCalendars=n.alwaysShowCalendars),0!=this.locale.firstDay)for(var o=this.locale.firstDay;o>0;)this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()),o--;var a,l,c;if(void 0===n.startDate&&void 0===n.endDate&&t(this.element).is(":text")){var h=t(this.element).val(),d=h.split(this.locale.separator);a=l=null,2==d.length?(a=e(d[0],this.locale.format),l=e(d[1],this.locale.format)):this.singleDatePicker&&""!==h&&(a=e(h,this.locale.format),l=e(h,this.locale.format)),null!==a&&null!==l&&(this.setStartDate(a),this.setEndDate(l))}if("object"==typeof n.ranges){for(c in n.ranges){a="string"==typeof n.ranges[c][0]?e(n.ranges[c][0],this.locale.format):e(n.ranges[c][0]),l="string"==typeof n.ranges[c][1]?e(n.ranges[c][1],this.locale.format):e(n.ranges[c][1]),this.minDate&&a.isBefore(this.minDate)&&(a=this.minDate.clone());var u,f=this.maxDate;this.maxSpan&&f&&a.clone().add(this.maxSpan).isAfter(f)&&(f=a.clone().add(this.maxSpan)),f&&l.isAfter(f)&&(l=f.clone()),this.minDate&&l.isBefore(this.minDate,this.timepicker?"minute":"day")||f&&a.isAfter(f,this.timepicker?"minute":"day")||((u=document.createElement("textarea")).innerHTML=c,s=u.value,this.ranges[s]=[a,l])}var p="<ul>";for(c in this.ranges)p+='<li data-range-key="'+c+'">'+c+"</li>";this.showCustomRangeLabel&&(p+='<li data-range-key="'+this.locale.customRangeLabel+'">'+this.locale.customRangeLabel+"</li>"),p+="</ul>",this.container.find(".ranges").prepend(p)}"function"==typeof r&&(this.callback=r),this.timePicker||(this.startDate=this.startDate.startOf("day"),this.endDate=this.endDate.endOf("day"),this.container.find(".calendar-time").hide()),this.timePicker&&this.autoApply&&(this.autoApply=!1),this.autoApply&&this.container.addClass("auto-apply"),"object"==typeof n.ranges&&this.container.addClass("show-ranges"),this.singleDatePicker&&(this.container.addClass("single"),this.container.find(".drp-calendar.left").addClass("single"),this.container.find(".drp-calendar.left").show(),this.container.find(".drp-calendar.right").hide(),!this.timePicker&&this.autoApply&&this.container.addClass("auto-apply")),(void 0===n.ranges&&!this.singleDatePicker||this.alwaysShowCalendars)&&this.container.addClass("show-calendar"),this.container.addClass("opens"+this.opens),this.container.find(".applyBtn, .cancelBtn").addClass(this.buttonClasses),this.applyButtonClasses.length&&this.container.find(".applyBtn").addClass(this.applyButtonClasses),this.cancelButtonClasses.length&&this.container.find(".cancelBtn").addClass(this.cancelButtonClasses),this.container.find(".applyBtn").html(this.locale.applyLabel),this.container.find(".cancelBtn").html(this.locale.cancelLabel),this.container.find(".drp-calendar").on("click.daterangepicker",".prev",t.proxy(this.clickPrev,this)).on("click.daterangepicker",".next",t.proxy(this.clickNext,this)).on("mousedown.daterangepicker","td.available",t.proxy(this.clickDate,this)).on("mouseenter.daterangepicker","td.available",t.proxy(this.hoverDate,this)).on("change.daterangepicker","select.yearselect",t.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.monthselect",t.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.secondselect,select.ampmselect",t.proxy(this.timeChanged,this)),this.container.find(".ranges").on("click.daterangepicker","li",t.proxy(this.clickRange,this)),this.container.find(".drp-buttons").on("click.daterangepicker","button.applyBtn",t.proxy(this.clickApply,this)).on("click.daterangepicker","button.cancelBtn",t.proxy(this.clickCancel,this)),this.element.is("input")||this.element.is("button")?this.element.on({"click.daterangepicker":t.proxy(this.show,this),"focus.daterangepicker":t.proxy(this.show,this),"keyup.daterangepicker":t.proxy(this.elementChanged,this),"keydown.daterangepicker":t.proxy(this.keydown,this)}):(this.element.on("click.daterangepicker",t.proxy(this.toggle,this)),this.element.on("keydown.daterangepicker",t.proxy(this.toggle,this))),this.updateElement()};return i.prototype={constructor:i,setStartDate:function(t){"string"==typeof t&&(this.startDate=e(t,this.locale.format)),"object"==typeof t&&(this.startDate=e(t)),this.timePicker||(this.startDate=this.startDate.startOf("day")),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone(),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)),this.maxDate&&this.startDate.isAfter(this.maxDate)&&(this.startDate=this.maxDate.clone(),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.floor(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)),this.isShowing||this.updateElement(),this.updateMonthsInView()},setEndDate:function(t){"string"==typeof t&&(this.endDate=e(t,this.locale.format)),"object"==typeof t&&(this.endDate=e(t)),this.timePicker||(this.endDate=this.endDate.endOf("day")),this.timePicker&&this.timePickerIncrement&&this.endDate.minute(Math.round(this.endDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.endDate.isBefore(this.startDate)&&(this.endDate=this.startDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),this.maxSpan&&this.startDate.clone().add(this.maxSpan).isBefore(this.endDate)&&(this.endDate=this.startDate.clone().add(this.maxSpan)),this.previousRightTime=this.endDate.clone(),this.container.find(".drp-selected").html(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.isShowing||this.updateElement(),this.updateMonthsInView()},isInvalidDate:function(){return!1},isCustomDate:function(){return!1},updateView:function(){this.timePicker&&(this.renderTimePicker("left"),this.renderTimePicker("right"),this.endDate?this.container.find(".right .calendar-time select").prop("disabled",!1).removeClass("disabled"):this.container.find(".right .calendar-time select").prop("disabled",!0).addClass("disabled")),this.endDate&&this.container.find(".drp-selected").html(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.updateMonthsInView(),this.updateCalendars(),this.updateFormInputs()},updateMonthsInView:function(){if(this.endDate){if(!this.singleDatePicker&&this.leftCalendar.month&&this.rightCalendar.month&&(this.startDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.startDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM"))&&(this.endDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.endDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM")))return;this.leftCalendar.month=this.startDate.clone().date(2),this.linkedCalendars||this.endDate.month()==this.startDate.month()&&this.endDate.year()==this.startDate.year()?this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"):this.rightCalendar.month=this.endDate.clone().date(2)}else this.leftCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&this.rightCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&(this.leftCalendar.month=this.startDate.clone().date(2),this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"));this.maxDate&&this.linkedCalendars&&!this.singleDatePicker&&this.rightCalendar.month>this.maxDate&&(this.rightCalendar.month=this.maxDate.clone().date(2),this.leftCalendar.month=this.maxDate.clone().date(2).subtract(1,"month"))},updateCalendars:function(){var e,t,i,n;this.timePicker&&(this.endDate?(e=parseInt(this.container.find(".left .hourselect").val(),10),t=parseInt(this.container.find(".left .minuteselect").val(),10),isNaN(t)&&(t=parseInt(this.container.find(".left .minuteselect option:last").val(),10)),i=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0,this.timePicker24Hour||("PM"===(n=this.container.find(".left .ampmselect").val())&&e<12&&(e+=12),"AM"===n&&12===e&&(e=0))):(e=parseInt(this.container.find(".right .hourselect").val(),10),t=parseInt(this.container.find(".right .minuteselect").val(),10),isNaN(t)&&(t=parseInt(this.container.find(".right .minuteselect option:last").val(),10)),i=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0,this.timePicker24Hour||("PM"===(n=this.container.find(".right .ampmselect").val())&&e<12&&(e+=12),"AM"===n&&12===e&&(e=0))),this.leftCalendar.month.hour(e).minute(t).second(i),this.rightCalendar.month.hour(e).minute(t).second(i)),this.renderCalendar("left"),this.renderCalendar("right"),this.container.find(".ranges li").removeClass("active"),null!=this.endDate&&this.calculateChosenLabel()},renderCalendar:function(i){var n,r=(n="left"==i?this.leftCalendar:this.rightCalendar).month.month(),s=n.month.year(),o=n.month.hour(),a=n.month.minute(),l=n.month.second(),c=e([s,r]).daysInMonth(),h=e([s,r,1]),d=e([s,r,c]),u=e(h).subtract(1,"month").month(),f=e(h).subtract(1,"month").year(),p=e([f,u]).daysInMonth(),m=h.day();(n=[]).firstDay=h,n.lastDay=d;for(var g=0;g<6;g++)n[g]=[];var _=p-m+this.locale.firstDay+1;_>p&&(_-=7),m==this.locale.firstDay&&(_=p-6);for(var y=e([f,u,_,12,a,l]),v=(g=0,0),x=0;g<42;g++,v++,y=e(y).add(24,"hour"))g>0&&v%7==0&&(v=0,x++),n[x][v]=y.clone().hour(o).minute(a).second(l),y.hour(12),this.minDate&&n[x][v].format("YYYY-MM-DD")==this.minDate.format("YYYY-MM-DD")&&n[x][v].isBefore(this.minDate)&&"left"==i&&(n[x][v]=this.minDate.clone()),this.maxDate&&n[x][v].format("YYYY-MM-DD")==this.maxDate.format("YYYY-MM-DD")&&n[x][v].isAfter(this.maxDate)&&"right"==i&&(n[x][v]=this.maxDate.clone());"left"==i?this.leftCalendar.calendar=n:this.rightCalendar.calendar=n;var b="left"==i?this.minDate:this.startDate,w=this.maxDate,S=("left"==i?this.startDate:this.endDate,this.locale.direction,'<table class="table-condensed">');S+="<thead>",S+="<tr>",(this.showWeekNumbers||this.showISOWeekNumbers)&&(S+="<th></th>"),b&&!b.isBefore(n.firstDay)||this.linkedCalendars&&"left"!=i?S+="<th></th>":S+='<th class="prev available"><span></span></th>';var T=this.locale.monthNames[n[1][1].month()]+n[1][1].format(" YYYY");if(this.showDropdowns){for(var k=n[1][1].month(),M=n[1][1].year(),A=w&&w.year()||this.maxYear,C=b&&b.year()||this.minYear,D=M==C,L=M==A,E='<select class="monthselect">',I=0;I<12;I++)(!D||b&&I>=b.month())&&(!L||w&&I<=w.month())?E+="<option value='"+I+"'"+(I===k?" selected='selected'":"")+">"+this.locale.monthNames[I]+"</option>":E+="<option value='"+I+"'"+(I===k?" selected='selected'":"")+" disabled='disabled'>"+this.locale.monthNames[I]+"</option>";E+="</select>";for(var P='<select class="yearselect">',R=C;R<=A;R++)P+='<option value="'+R+'"'+(R===M?' selected="selected"':"")+">"+R+"</option>";T=E+(P+="</select>")}if(S+='<th colspan="5" class="month">'+T+"</th>",w&&!w.isAfter(n.lastDay)||this.linkedCalendars&&"right"!=i&&!this.singleDatePicker?S+="<th></th>":S+='<th class="next available"><span></span></th>',S+="</tr>",S+="<tr>",(this.showWeekNumbers||this.showISOWeekNumbers)&&(S+='<th class="week">'+this.locale.weekLabel+"</th>"),t.each(this.locale.daysOfWeek,function(e,t){S+="<th>"+t+"</th>"}),S+="</tr>",S+="</thead>",S+="<tbody>",null==this.endDate&&this.maxSpan){var O=this.startDate.clone().add(this.maxSpan).endOf("day");w&&!O.isBefore(w)||(w=O)}for(x=0;x<6;x++){for(S+="<tr>",this.showWeekNumbers?S+='<td class="week">'+n[x][0].week()+"</td>":this.showISOWeekNumbers&&(S+='<td class="week">'+n[x][0].isoWeek()+"</td>"),v=0;v<7;v++){var z=[];n[x][v].isSame(new Date,"day")&&z.push("today"),n[x][v].isoWeekday()>5&&z.push("weekend"),n[x][v].month()!=n[1][1].month()&&z.push("off","ends"),this.minDate&&n[x][v].isBefore(this.minDate,"day")&&z.push("off","disabled"),w&&n[x][v].isAfter(w,"day")&&z.push("off","disabled"),this.isInvalidDate(n[x][v])&&z.push("off","disabled"),n[x][v].format("YYYY-MM-DD")==this.startDate.format("YYYY-MM-DD")&&z.push("active","start-date"),null!=this.endDate&&n[x][v].format("YYYY-MM-DD")==this.endDate.format("YYYY-MM-DD")&&z.push("active","end-date"),null!=this.endDate&&n[x][v]>this.startDate&&n[x][v]<this.endDate&&z.push("in-range");var F=this.isCustomDate(n[x][v]);!1!==F&&("string"==typeof F?z.push(F):Array.prototype.push.apply(z,F));var N="",Y=!1;for(g=0;g<z.length;g++)N+=z[g]+" ","disabled"==z[g]&&(Y=!0);Y||(N+="available"),S+='<td class="'+N.replace(/^\s+|\s+$/g,"")+'" data-title="r'+x+"c"+v+'">'+n[x][v].date()+"</td>"}S+="</tr>"}S+="</tbody>",S+="</table>",this.container.find(".drp-calendar."+i+" .calendar-table").html(S)},renderTimePicker:function(e){if("right"!=e||this.endDate){var t,i,n,r=this.maxDate;if(!this.maxSpan||this.maxDate&&!this.startDate.clone().add(this.maxSpan).isBefore(this.maxDate)||(r=this.startDate.clone().add(this.maxSpan)),"left"==e)i=this.startDate.clone(),n=this.minDate;else if("right"==e){i=this.endDate.clone(),n=this.startDate;var s=this.container.find(".drp-calendar.right .calendar-time");if(""!=s.html()&&(i.hour(isNaN(i.hour())?s.find(".hourselect option:selected").val():i.hour()),i.minute(isNaN(i.minute())?s.find(".minuteselect option:selected").val():i.minute()),i.second(isNaN(i.second())?s.find(".secondselect option:selected").val():i.second()),!this.timePicker24Hour)){var o=s.find(".ampmselect option:selected").val();"PM"===o&&i.hour()<12&&i.hour(i.hour()+12),"AM"===o&&12===i.hour()&&i.hour(0)}i.isBefore(this.startDate)&&(i=this.startDate.clone()),r&&i.isAfter(r)&&(i=r.clone())}t='<select class="hourselect">';for(var a=this.timePicker24Hour?0:1,l=this.timePicker24Hour?23:12,c=a;c<=l;c++){var h=c;this.timePicker24Hour||(h=i.hour()>=12?12==c?12:c+12:12==c?0:c);var d=i.clone().hour(h),u=!1;n&&d.minute(59).isBefore(n)&&(u=!0),r&&d.minute(0).isAfter(r)&&(u=!0),h!=i.hour()||u?t+=u?'<option value="'+c+'" disabled="disabled" class="disabled">'+c+"</option>":'<option value="'+c+'">'+c+"</option>":t+='<option value="'+c+'" selected="selected">'+c+"</option>"}for(t+="</select> ",t+=': <select class="minuteselect">',c=0;c<60;c+=this.timePickerIncrement){var f=c<10?"0"+c:c;d=i.clone().minute(c),u=!1,n&&d.second(59).isBefore(n)&&(u=!0),r&&d.second(0).isAfter(r)&&(u=!0),i.minute()!=c||u?t+=u?'<option value="'+c+'" disabled="disabled" class="disabled">'+f+"</option>":'<option value="'+c+'">'+f+"</option>":t+='<option value="'+c+'" selected="selected">'+f+"</option>"}if(t+="</select> ",this.timePickerSeconds){for(t+=': <select class="secondselect">',c=0;c<60;c++)f=c<10?"0"+c:c,d=i.clone().second(c),u=!1,n&&d.isBefore(n)&&(u=!0),r&&d.isAfter(r)&&(u=!0),i.second()!=c||u?t+=u?'<option value="'+c+'" disabled="disabled" class="disabled">'+f+"</option>":'<option value="'+c+'">'+f+"</option>":t+='<option value="'+c+'" selected="selected">'+f+"</option>";t+="</select> "}if(!this.timePicker24Hour){t+='<select class="ampmselect">';var p="",m="";n&&i.clone().hour(12).minute(0).second(0).isBefore(n)&&(p=' disabled="disabled" class="disabled"'),r&&i.clone().hour(0).minute(0).second(0).isAfter(r)&&(m=' disabled="disabled" class="disabled"'),i.hour()>=12?t+='<option value="AM"'+p+'>AM</option><option value="PM" selected="selected"'+m+">PM</option>":t+='<option value="AM" selected="selected"'+p+'>AM</option><option value="PM"'+m+">PM</option>",t+="</select>"}this.container.find(".drp-calendar."+e+" .calendar-time").html(t)}},updateFormInputs:function(){this.singleDatePicker||this.endDate&&(this.startDate.isBefore(this.endDate)||this.startDate.isSame(this.endDate))?this.container.find("button.applyBtn").prop("disabled",!1):this.container.find("button.applyBtn").prop("disabled",!0)},move:function(){var e,i={top:0,left:0},n=this.drops,r=t(window).width();switch(this.parentEl.is("body")||(i={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()},r=this.parentEl[0].clientWidth+this.parentEl.offset().left),n){case"auto":(e=this.element.offset().top+this.element.outerHeight()-i.top)+this.container.outerHeight()>=this.parentEl[0].scrollHeight&&(e=this.element.offset().top-this.container.outerHeight()-i.top,n="up");break;case"up":e=this.element.offset().top-this.container.outerHeight()-i.top;break;default:e=this.element.offset().top+this.element.outerHeight()-i.top}this.container.css({top:0,left:0,right:"auto"});var s=this.container.outerWidth();if(this.container.toggleClass("drop-up","up"==n),"left"==this.opens){var o=r-this.element.offset().left-this.element.outerWidth();s+o>t(window).width()?this.container.css({top:e,right:"auto",left:9}):this.container.css({top:e,right:o,left:"auto"})}else if("center"==this.opens)(a=this.element.offset().left-i.left+this.element.outerWidth()/2-s/2)<0?this.container.css({top:e,right:"auto",left:9}):a+s>t(window).width()?this.container.css({top:e,left:"auto",right:0}):this.container.css({top:e,left:a,right:"auto"});else{var a;(a=this.element.offset().left-i.left)+s>t(window).width()?this.container.css({top:e,left:"auto",right:0}):this.container.css({top:e,left:a,right:"auto"})}},show:function(e){this.isShowing||(this._outsideClickProxy=t.proxy(function(e){this.outsideClick(e)},this),t(document).on("mousedown.daterangepicker",this._outsideClickProxy).on("touchend.daterangepicker",this._outsideClickProxy).on("click.daterangepicker","[data-toggle=dropdown]",this._outsideClickProxy).on("focusin.daterangepicker",this._outsideClickProxy),t(window).on("resize.daterangepicker",t.proxy(function(e){this.move(e)},this)),this.oldStartDate=this.startDate.clone(),this.oldEndDate=this.endDate.clone(),this.previousRightTime=this.endDate.clone(),this.updateView(),this.container.show(),this.move(),this.element.trigger("show.daterangepicker",this),this.isShowing=!0)},hide:function(e){this.isShowing&&(this.endDate||(this.startDate=this.oldStartDate.clone(),this.endDate=this.oldEndDate.clone()),this.startDate.isSame(this.oldStartDate)&&this.endDate.isSame(this.oldEndDate)||this.callback(this.startDate.clone(),this.endDate.clone(),this.chosenLabel),this.updateElement(),t(document).off(".daterangepicker"),t(window).off(".daterangepicker"),this.container.hide(),this.element.trigger("hide.daterangepicker",this),this.isShowing=!1)},toggle:function(e){this.isShowing?this.hide():this.show()},outsideClick:function(e){var i=t(e.target);"focusin"==e.type||i.closest(this.element).length||i.closest(this.container).length||i.closest(".calendar-table").length||(this.hide(),this.element.trigger("outsideClick.daterangepicker",this))},showCalendars:function(){this.container.addClass("show-calendar"),this.move(),this.element.trigger("showCalendar.daterangepicker",this)},hideCalendars:function(){this.container.removeClass("show-calendar"),this.element.trigger("hideCalendar.daterangepicker",this)},clickRange:function(e){var t=e.target.getAttribute("data-range-key");if(this.chosenLabel=t,t==this.locale.customRangeLabel)this.showCalendars();else{var i=this.ranges[t];this.startDate=i[0],this.endDate=i[1],this.timePicker||(this.startDate.startOf("day"),this.endDate.endOf("day")),this.alwaysShowCalendars||this.hideCalendars(),this.clickApply()}},clickPrev:function(e){t(e.target).parents(".drp-calendar").hasClass("left")?(this.leftCalendar.month.subtract(1,"month"),this.linkedCalendars&&this.rightCalendar.month.subtract(1,"month")):this.rightCalendar.month.subtract(1,"month"),this.updateCalendars()},clickNext:function(e){t(e.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.month.add(1,"month"):(this.rightCalendar.month.add(1,"month"),this.linkedCalendars&&this.leftCalendar.month.add(1,"month")),this.updateCalendars()},hoverDate:function(e){if(t(e.target).hasClass("available")){var i=t(e.target).attr("data-title"),n=i.substr(1,1),r=i.substr(3,1),s=t(e.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.calendar[n][r]:this.rightCalendar.calendar[n][r],o=this.leftCalendar,a=this.rightCalendar,l=this.startDate;this.endDate||this.container.find(".drp-calendar tbody td").each(function(e,i){if(!t(i).hasClass("week")){var n=t(i).attr("data-title"),r=n.substr(1,1),c=n.substr(3,1),h=t(i).parents(".drp-calendar").hasClass("left")?o.calendar[r][c]:a.calendar[r][c];h.isAfter(l)&&h.isBefore(s)||h.isSame(s,"day")?t(i).addClass("in-range"):t(i).removeClass("in-range")}})}},clickDate:function(e){if(t(e.target).hasClass("available")){var i=t(e.target).attr("data-title"),n=i.substr(1,1),r=i.substr(3,1),s=t(e.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.calendar[n][r]:this.rightCalendar.calendar[n][r];if(this.endDate||s.isBefore(this.startDate,"day")){if(this.timePicker){var o=parseInt(this.container.find(".left .hourselect").val(),10);this.timePicker24Hour||("PM"===(c=this.container.find(".left .ampmselect").val())&&o<12&&(o+=12),"AM"===c&&12===o&&(o=0));var a=parseInt(this.container.find(".left .minuteselect").val(),10);isNaN(a)&&(a=parseInt(this.container.find(".left .minuteselect option:last").val(),10));var l=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0;s=s.clone().hour(o).minute(a).second(l)}this.endDate=null,this.setStartDate(s.clone())}else if(!this.endDate&&s.isBefore(this.startDate))this.setEndDate(this.startDate.clone());else{var c;this.timePicker&&(o=parseInt(this.container.find(".right .hourselect").val(),10),this.timePicker24Hour||("PM"===(c=this.container.find(".right .ampmselect").val())&&o<12&&(o+=12),"AM"===c&&12===o&&(o=0)),a=parseInt(this.container.find(".right .minuteselect").val(),10),isNaN(a)&&(a=parseInt(this.container.find(".right .minuteselect option:last").val(),10)),l=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0,s=s.clone().hour(o).minute(a).second(l)),this.setEndDate(s.clone()),this.autoApply&&(this.calculateChosenLabel(),this.clickApply())}this.singleDatePicker&&(this.setEndDate(this.startDate),!this.timePicker&&this.autoApply&&this.clickApply()),this.updateView(),e.stopPropagation()}},calculateChosenLabel:function(){var e=!0,t=0;for(var i in this.ranges){if(this.timePicker){var n=this.timePickerSeconds?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm";if(this.startDate.format(n)==this.ranges[i][0].format(n)&&this.endDate.format(n)==this.ranges[i][1].format(n)){e=!1,this.chosenLabel=this.container.find(".ranges li:eq("+t+")").addClass("active").attr("data-range-key");break}}else if(this.startDate.format("YYYY-MM-DD")==this.ranges[i][0].format("YYYY-MM-DD")&&this.endDate.format("YYYY-MM-DD")==this.ranges[i][1].format("YYYY-MM-DD")){e=!1,this.chosenLabel=this.container.find(".ranges li:eq("+t+")").addClass("active").attr("data-range-key");break}t++}e&&(this.showCustomRangeLabel?this.chosenLabel=this.container.find(".ranges li:last").addClass("active").attr("data-range-key"):this.chosenLabel=null,this.showCalendars())},clickApply:function(e){this.hide(),this.element.trigger("apply.daterangepicker",this)},clickCancel:function(e){this.startDate=this.oldStartDate,this.endDate=this.oldEndDate,this.hide(),this.element.trigger("cancel.daterangepicker",this)},monthOrYearChanged:function(e){var i=t(e.target).closest(".drp-calendar").hasClass("left"),n=i?"left":"right",r=this.container.find(".drp-calendar."+n),s=parseInt(r.find(".monthselect").val(),10),o=r.find(".yearselect").val();i||(o<this.startDate.year()||o==this.startDate.year()&&s<this.startDate.month())&&(s=this.startDate.month(),o=this.startDate.year()),this.minDate&&(o<this.minDate.year()||o==this.minDate.year()&&s<this.minDate.month())&&(s=this.minDate.month(),o=this.minDate.year()),this.maxDate&&(o>this.maxDate.year()||o==this.maxDate.year()&&s>this.maxDate.month())&&(s=this.maxDate.month(),o=this.maxDate.year()),i?(this.leftCalendar.month.month(s).year(o),this.linkedCalendars&&(this.rightCalendar.month=this.leftCalendar.month.clone().add(1,"month"))):(this.rightCalendar.month.month(s).year(o),this.linkedCalendars&&(this.leftCalendar.month=this.rightCalendar.month.clone().subtract(1,"month"))),this.updateCalendars()},timeChanged:function(e){var i=t(e.target).closest(".drp-calendar"),n=i.hasClass("left"),r=parseInt(i.find(".hourselect").val(),10),s=parseInt(i.find(".minuteselect").val(),10);isNaN(s)&&(s=parseInt(i.find(".minuteselect option:last").val(),10));var o=this.timePickerSeconds?parseInt(i.find(".secondselect").val(),10):0;if(!this.timePicker24Hour){var a=i.find(".ampmselect").val();"PM"===a&&r<12&&(r+=12),"AM"===a&&12===r&&(r=0)}if(n){var l=this.startDate.clone();l.hour(r),l.minute(s),l.second(o),this.setStartDate(l),this.singleDatePicker?this.endDate=this.startDate.clone():this.endDate&&this.endDate.format("YYYY-MM-DD")==l.format("YYYY-MM-DD")&&this.endDate.isBefore(l)&&this.setEndDate(l.clone())}else if(this.endDate){var c=this.endDate.clone();c.hour(r),c.minute(s),c.second(o),this.setEndDate(c)}this.updateCalendars(),this.updateFormInputs(),this.renderTimePicker("left"),this.renderTimePicker("right")},elementChanged:function(){if(this.element.is("input")&&this.element.val().length){var t=this.element.val().split(this.locale.separator),i=null,n=null;2===t.length&&(i=e(t[0],this.locale.format),n=e(t[1],this.locale.format)),(this.singleDatePicker||null===i||null===n)&&(n=i=e(this.element.val(),this.locale.format)),i.isValid()&&n.isValid()&&(this.setStartDate(i),this.setEndDate(n),this.updateView())}},keydown:function(e){9!==e.keyCode&&13!==e.keyCode||this.hide(),27===e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.hide())},updateElement:function(){if(this.element.is("input")&&this.autoUpdateInput){var e=this.startDate.format(this.locale.format);this.singleDatePicker||(e+=this.locale.separator+this.endDate.format(this.locale.format)),e!==this.element.val()&&this.element.val(e).trigger("change")}},remove:function(){this.container.remove(),this.element.off(".daterangepicker"),this.element.removeData()}},t.fn.daterangepicker=function(e,n){var r=t.extend(!0,{},t.fn.daterangepicker.defaultOptions,e);return this.each(function(){var e=t(this);e.data("daterangepicker")&&e.data("daterangepicker").remove(),e.data("daterangepicker",new i(e,r,n))}),this},i}(e,t)}.apply(t,n))||(e.exports=r)},3341:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>a}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(9970);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(2083);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(8979);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(134);function a(e,t){var i;void 0===t&&(t=[]);var l=(0,n.A)(e),c=l===(null==(i=e.ownerDocument)?void 0:i.body),h=(0,s.A)(l),d=c?[h].concat(h.visualViewport||[],(0,o.A)(l)?l:[]):l,u=t.concat(d);return c?u:u.concat(a((0,r.A)(d)))}},3383:function(e,t,i){!function(e){"use strict";function t(e,t,i,n){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return n?r[i][0]:r[i][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){return"D"===t?e+"er":e},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,i){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(i(5093))},3386:function(e,t,i){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,i){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(i(5093))},3411:function(t,i,n){"use strict";var r,s,o,a,l,c,h,d,u,f,p,m=n(4692);t.exports=(o=function(e,t){var i;if(e===t)return e;for(i in t)void 0!==t[i]&&(e[i]=t[i]);return e},a=function(e,t){var i,n=Array.prototype.slice.call(arguments,2),r=[],s=e.length;if(Array.prototype.map&&e.map===Array.prototype.map)r=Array.prototype.map.call(e,function(e){var i=n.slice(0);return i.splice(0,0,e),t.apply(this,i)});else for(i=0;i<s;i++)callback_params=n,callback_params.splice(0,0,e[i]),r.push(t.apply(this,callback_params));return r},l=function(e){var t,i=[];for(t=0;t<e.length;t++)i=i.concat(e[t]);return i},c=function(e,t){var i=e[0],n=e[1];return t&&(i=e[1],n=e[0]),new google.maps.LatLng(i,n)},h=function(e,t){var i;for(i=0;i<e.length;i++)e[i]instanceof google.maps.LatLng||(e[i].length>0&&"object"==typeof e[i][0]?e[i]=h(e[i],t):e[i]=c(e[i],t));return e},d=function(e,t){var i=e.replace(".","");return"jQuery"in this&&t?m("."+i,t)[0]:document.getElementsByClassName(i)[0]},u=function(e,t){return e=e.replace("#",""),"jQuery"in window&&t?m("#"+e,t)[0]:document.getElementById(e)},f=function(e){var t=0,i=0;if(e.getBoundingClientRect){var n=e.getBoundingClientRect(),r=-(window.scrollX?window.scrollX:window.pageXOffset),s=-(window.scrollY?window.scrollY:window.pageYOffset);return[n.left-r,n.top-s]}if(e.offsetParent)do{t+=e.offsetLeft,i+=e.offsetTop}while(e=e.offsetParent);return[t,i]},p=function(){var e=document,t=function(i){if("object"!=typeof window.google||!window.google.maps)return"object"==typeof window.console&&window.console.error&&console.error("Google Maps API is required. Please register the following JavaScript library https://maps.googleapis.com/maps/api/js."),function(){};if(!this)return new t(i);i.zoom=i.zoom||15,i.mapType=i.mapType||"roadmap";var n,r=function(e,t){return void 0===e?t:e},s=this,a=["bounds_changed","center_changed","click","dblclick","drag","dragend","dragstart","idle","maptypeid_changed","projection_changed","resize","tilesloaded","zoom_changed"],l=["mousemove","mouseout","mouseover"],c=["el","lat","lng","mapType","width","height","markerClusterer","enableNewStyle"],h=i.el||i.div,p=i.markerClusterer,m=google.maps.MapTypeId[i.mapType.toUpperCase()],g=new google.maps.LatLng(i.lat,i.lng),_=r(i.zoomControl,!0),y=i.zoomControlOpt||{style:"DEFAULT",position:"TOP_LEFT"},v=y.style||"DEFAULT",x=y.position||"TOP_LEFT",b=r(i.panControl,!0),w=r(i.mapTypeControl,!0),S=r(i.scaleControl,!0),T=r(i.streetViewControl,!0),k=r(k,!0),M={},A={zoom:this.zoom,center:g,mapTypeId:m},C={panControl:b,zoomControl:_,zoomControlOptions:{style:google.maps.ZoomControlStyle[v],position:google.maps.ControlPosition[x]},mapTypeControl:w,scaleControl:S,streetViewControl:T,overviewMapControl:k};if("string"==typeof i.el||"string"==typeof i.div?h.indexOf("#")>-1?this.el=u(h,i.context):this.el=d.apply(this,[h,i.context]):this.el=h,void 0===this.el||null===this.el)throw"No element defined.";for(window.context_menu=window.context_menu||{},window.context_menu[s.el.id]={},this.controls=[],this.overlays=[],this.layers=[],this.singleLayers={},this.markers=[],this.polylines=[],this.routes=[],this.polygons=[],this.infoWindow=null,this.overlay_el=null,this.zoom=i.zoom,this.registered_events={},this.el.style.width=i.width||this.el.scrollWidth||this.el.offsetWidth,this.el.style.height=i.height||this.el.scrollHeight||this.el.offsetHeight,google.maps.visualRefresh=i.enableNewStyle,n=0;n<c.length;n++)delete i[c[n]];for(1!=i.disableDefaultUI&&(A=o(A,C)),M=o(A,i),n=0;n<a.length;n++)delete M[a[n]];for(n=0;n<l.length;n++)delete M[l[n]];this.map=new google.maps.Map(this.el,M),p&&(this.markerClusterer=p.apply(this,[this.map]));var D=function(e,t){var i="",n=window.context_menu[s.el.id][e];for(var r in n)if(n.hasOwnProperty(r)){var o=n[r];i+='<li><a id="'+e+"_"+r+'" href="#">'+o.title+"</a></li>"}if(u("gmaps_context_menu")){var a=u("gmaps_context_menu");a.innerHTML=i;var l=a.getElementsByTagName("a"),c=l.length;for(r=0;r<c;r++){var h=l[r],d=function(i){i.preventDefault(),n[this.id.replace(e+"_","")].action.apply(s,[t]),s.hideContextMenu()};google.maps.event.clearListeners(h,"click"),google.maps.event.addDomListenerOnce(h,"click",d,!1)}var p=f.apply(this,[s.el]),m=p[0]+t.pixel.x-15,g=p[1]+t.pixel.y-15;a.style.left=m+"px",a.style.top=g+"px"}};this.buildContextMenu=function(e,t){if("marker"===e){t.pixel={};var i=new google.maps.OverlayView;i.setMap(s.map),i.draw=function(){var n=i.getProjection(),r=t.marker.getPosition();t.pixel=n.fromLatLngToContainerPixel(r),D(e,t)}}else D(e,t);var n=u("gmaps_context_menu");setTimeout(function(){n.style.display="block"},0)},this.setContextMenu=function(t){window.context_menu[s.el.id][t.control]={};var i,n=e.createElement("ul");for(i in t.options)if(t.options.hasOwnProperty(i)){var r=t.options[i];window.context_menu[s.el.id][t.control][r.name]={title:r.title,action:r.action}}n.id="gmaps_context_menu",n.style.display="none",n.style.position="absolute",n.style.minWidth="100px",n.style.background="white",n.style.listStyle="none",n.style.padding="8px",n.style.boxShadow="2px 2px 6px #ccc",u("gmaps_context_menu")||e.body.appendChild(n);var o=u("gmaps_context_menu");google.maps.event.addDomListener(o,"mouseout",function(e){e.relatedTarget&&this.contains(e.relatedTarget)||window.setTimeout(function(){o.style.display="none"},400)},!1)},this.hideContextMenu=function(){var e=u("gmaps_context_menu");e&&(e.style.display="none")};var L=function(e,t){google.maps.event.addListener(e,t,function(e){null==e&&(e=this),i[t].apply(this,[e]),s.hideContextMenu()})};google.maps.event.addListener(this.map,"zoom_changed",this.hideContextMenu);for(var E=0;E<a.length;E++)(I=a[E])in i&&L(this.map,I);for(E=0;E<l.length;E++){var I;(I=l[E])in i&&L(this.map,I)}google.maps.event.addListener(this.map,"rightclick",function(e){i.rightclick&&i.rightclick.apply(this,[e]),null!=window.context_menu[s.el.id].map&&s.buildContextMenu("map",e)}),this.refresh=function(){google.maps.event.trigger(this.map,"resize")},this.fitZoom=function(){var e,t=[],i=this.markers.length;for(e=0;e<i;e++)"boolean"==typeof this.markers[e].visible&&this.markers[e].visible&&t.push(this.markers[e].getPosition());this.fitLatLngBounds(t)},this.fitLatLngBounds=function(e){var t,i=e.length,n=new google.maps.LatLngBounds;for(t=0;t<i;t++)n.extend(e[t]);this.map.fitBounds(n)},this.setCenter=function(e,t,i){this.map.panTo(new google.maps.LatLng(e,t)),i&&i()},this.getElement=function(){return this.el},this.zoomIn=function(e){e=e||1,this.zoom=this.map.getZoom()+e,this.map.setZoom(this.zoom)},this.zoomOut=function(e){e=e||1,this.zoom=this.map.getZoom()-e,this.map.setZoom(this.zoom)};var P,R=[];for(P in this.map)"function"!=typeof this.map[P]||this[P]||R.push(P);for(n=0;n<R.length;n++)(function(e,t,i){e[i]=function(){return t[i].apply(t,arguments)}})(this,this.map,R[n])};return t}(),p.prototype.createControl=function(e){var t=document.createElement("div");for(var i in t.style.cursor="pointer",!0!==e.disableDefaultStyles&&(t.style.fontFamily="Roboto, Arial, sans-serif",t.style.fontSize="11px",t.style.boxShadow="rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px"),e.style)t.style[i]=e.style[i];for(var n in e.id&&(t.id=e.id),e.title&&(t.title=e.title),e.classes&&(t.className=e.classes),e.content&&("string"==typeof e.content?t.innerHTML=e.content:e.content instanceof HTMLElement&&t.appendChild(e.content)),e.position&&(t.position=google.maps.ControlPosition[e.position.toUpperCase()]),e.events)(function(t,i){google.maps.event.addDomListener(t,i,function(){e.events[i].apply(this,[this])})})(t,n);return t.index=1,t},p.prototype.addControl=function(e){var t=this.createControl(e);return this.controls.push(t),this.map.controls[t.position].push(t),t},p.prototype.removeControl=function(e){var t,i=null;for(t=0;t<this.controls.length;t++)this.controls[t]==e&&(i=this.controls[t].position,this.controls.splice(t,1));if(i)for(t=0;t<this.map.controls.length;t++){var n=this.map.controls[e.position];if(n.getAt(t)==e){n.removeAt(t);break}}return e},p.prototype.createMarker=function(e){if(null==e.lat&&null==e.lng&&null==e.position)throw"No latitude or longitude defined.";var t=this,i=e.details,n=e.fences,r=e.outside,s={position:new google.maps.LatLng(e.lat,e.lng),map:null},a=o(s,e);delete a.lat,delete a.lng,delete a.fences,delete a.outside;var l=new google.maps.Marker(a);if(l.fences=n,e.infoWindow){l.infoWindow=new google.maps.InfoWindow(e.infoWindow);for(var c=["closeclick","content_changed","domready","position_changed","zindex_changed"],h=0;h<c.length;h++)(function(t,i){e.infoWindow[i]&&google.maps.event.addListener(t,i,function(t){e.infoWindow[i].apply(this,[t])})})(l.infoWindow,c[h])}var d=["animation_changed","clickable_changed","cursor_changed","draggable_changed","flat_changed","icon_changed","position_changed","shadow_changed","shape_changed","title_changed","visible_changed","zindex_changed"],u=["dblclick","drag","dragend","dragstart","mousedown","mouseout","mouseover","mouseup"];for(h=0;h<d.length;h++)(function(t,i){e[i]&&google.maps.event.addListener(t,i,function(){e[i].apply(this,[this])})})(l,d[h]);for(h=0;h<u.length;h++)(function(t,i,n){e[n]&&google.maps.event.addListener(i,n,function(i){i.pixel||(i.pixel=t.getProjection().fromLatLngToPoint(i.latLng)),e[n].apply(this,[i])})})(this.map,l,u[h]);return google.maps.event.addListener(l,"click",function(){this.details=i,e.click&&e.click.apply(this,[this]),l.infoWindow&&(t.hideInfoWindows(),l.infoWindow.open(t.map,l))}),google.maps.event.addListener(l,"rightclick",function(i){i.marker=this,e.rightclick&&e.rightclick.apply(this,[i]),null!=window.context_menu[t.el.id].marker&&t.buildContextMenu("marker",i)}),l.fences&&google.maps.event.addListener(l,"dragend",function(){t.checkMarkerGeofence(l,function(e,t){r(e,t)})}),l},p.prototype.addMarker=function(e){var t;if(e.hasOwnProperty("gm_accessors_"))t=e;else{if(!(e.hasOwnProperty("lat")&&e.hasOwnProperty("lng")||e.position))throw"No latitude or longitude defined.";t=this.createMarker(e)}return t.setMap(this.map),this.markerClusterer&&this.markerClusterer.addMarker(t),this.markers.push(t),p.fire("marker_added",t,this),t},p.prototype.addMarkers=function(e){for(var t,i=0;t=e[i];i++)this.addMarker(t);return this.markers},p.prototype.hideInfoWindows=function(){for(var e,t=0;e=this.markers[t];t++)e.infoWindow&&e.infoWindow.close()},p.prototype.removeMarker=function(e){for(var t=0;t<this.markers.length;t++)if(this.markers[t]===e){this.markers[t].setMap(null),this.markers.splice(t,1),this.markerClusterer&&this.markerClusterer.removeMarker(e),p.fire("marker_removed",e,this);break}return e},p.prototype.removeMarkers=function(e){var t=[];if(void 0===e){for(var i=0;i<this.markers.length;i++)(r=this.markers[i]).setMap(null),p.fire("marker_removed",r,this);this.markerClusterer&&this.markerClusterer.clearMarkers&&this.markerClusterer.clearMarkers(),this.markers=t}else{for(i=0;i<e.length;i++){var n=this.markers.indexOf(e[i]);n>-1&&((r=this.markers[n]).setMap(null),this.markerClusterer&&this.markerClusterer.removeMarker(r),p.fire("marker_removed",r,this))}for(i=0;i<this.markers.length;i++){var r;null!=(r=this.markers[i]).getMap()&&t.push(r)}this.markers=t}},p.prototype.drawOverlay=function(e){var t=new google.maps.OverlayView,i=!0;return t.setMap(this.map),null!=e.auto_show&&(i=e.auto_show),t.onAdd=function(){var i=document.createElement("div");i.style.borderStyle="none",i.style.borderWidth="0px",i.style.position="absolute",i.style.zIndex=100,i.innerHTML=e.content,t.el=i,e.layer||(e.layer="overlayLayer");var n=this.getPanes(),r=["contextmenu","DOMMouseScroll","dblclick","mousedown"];n[e.layer].appendChild(i);for(var s=0;s<r.length;s++)(function(e,t){google.maps.event.addDomListener(e,t,function(e){-1!=navigator.userAgent.toLowerCase().indexOf("msie")&&document.all?(e.cancelBubble=!0,e.returnValue=!1):e.stopPropagation()})})(i,r[s]);e.click&&(n.overlayMouseTarget.appendChild(t.el),google.maps.event.addDomListener(t.el,"click",function(){e.click.apply(t,[t])})),google.maps.event.trigger(this,"ready")},t.draw=function(){var n=this.getProjection().fromLatLngToDivPixel(new google.maps.LatLng(e.lat,e.lng));e.horizontalOffset=e.horizontalOffset||0,e.verticalOffset=e.verticalOffset||0;var r=t.el,s=r.children[0],o=s.clientHeight,a=s.clientWidth;switch(e.verticalAlign){case"top":r.style.top=n.y-o+e.verticalOffset+"px";break;default:case"middle":r.style.top=n.y-o/2+e.verticalOffset+"px";break;case"bottom":r.style.top=n.y+e.verticalOffset+"px"}switch(e.horizontalAlign){case"left":r.style.left=n.x-a+e.horizontalOffset+"px";break;default:case"center":r.style.left=n.x-a/2+e.horizontalOffset+"px";break;case"right":r.style.left=n.x+e.horizontalOffset+"px"}r.style.display=i?"block":"none",i||e.show.apply(this,[r])},t.onRemove=function(){var i=t.el;e.remove?e.remove.apply(this,[i]):(t.el.parentNode.removeChild(t.el),t.el=null)},this.overlays.push(t),t},p.prototype.removeOverlay=function(e){for(var t=0;t<this.overlays.length;t++)if(this.overlays[t]===e){this.overlays[t].setMap(null),this.overlays.splice(t,1);break}},p.prototype.removeOverlays=function(){for(var e,t=0;e=this.overlays[t];t++)e.setMap(null);this.overlays=[]},p.prototype.drawPolyline=function(e){var t=[],i=e.path;if(i.length)if(void 0===i[0][0])t=i;else for(var n,r=0;n=i[r];r++)t.push(new google.maps.LatLng(n[0],n[1]));var s={map:this.map,path:t,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,geodesic:e.geodesic,clickable:!0,editable:!1,visible:!0};e.hasOwnProperty("clickable")&&(s.clickable=e.clickable),e.hasOwnProperty("editable")&&(s.editable=e.editable),e.hasOwnProperty("icons")&&(s.icons=e.icons),e.hasOwnProperty("zIndex")&&(s.zIndex=e.zIndex);for(var o=new google.maps.Polyline(s),a=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],l=0;l<a.length;l++)(function(t,i){e[i]&&google.maps.event.addListener(t,i,function(t){e[i].apply(this,[t])})})(o,a[l]);return this.polylines.push(o),p.fire("polyline_added",o,this),o},p.prototype.removePolyline=function(e){for(var t=0;t<this.polylines.length;t++)if(this.polylines[t]===e){this.polylines[t].setMap(null),this.polylines.splice(t,1),p.fire("polyline_removed",e,this);break}},p.prototype.removePolylines=function(){for(var e,t=0;e=this.polylines[t];t++)e.setMap(null);this.polylines=[]},p.prototype.drawCircle=function(e){delete(e=o({map:this.map,center:new google.maps.LatLng(e.lat,e.lng)},e)).lat,delete e.lng;for(var t=new google.maps.Circle(e),i=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],n=0;n<i.length;n++)(function(t,i){e[i]&&google.maps.event.addListener(t,i,function(t){e[i].apply(this,[t])})})(t,i[n]);return this.polygons.push(t),t},p.prototype.drawRectangle=function(e){e=o({map:this.map},e);var t=new google.maps.LatLngBounds(new google.maps.LatLng(e.bounds[0][0],e.bounds[0][1]),new google.maps.LatLng(e.bounds[1][0],e.bounds[1][1]));e.bounds=t;for(var i=new google.maps.Rectangle(e),n=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],r=0;r<n.length;r++)(function(t,i){e[i]&&google.maps.event.addListener(t,i,function(t){e[i].apply(this,[t])})})(i,n[r]);return this.polygons.push(i),i},p.prototype.drawPolygon=function(e){var t=!1;e.hasOwnProperty("useGeoJSON")&&(t=e.useGeoJSON),delete e.useGeoJSON,e=o({map:this.map},e),0==t&&(e.paths=[e.paths.slice(0)]),e.paths.length>0&&e.paths[0].length>0&&(e.paths=l(a(e.paths,h,t)));for(var i=new google.maps.Polygon(e),n=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],r=0;r<n.length;r++)(function(t,i){e[i]&&google.maps.event.addListener(t,i,function(t){e[i].apply(this,[t])})})(i,n[r]);return this.polygons.push(i),p.fire("polygon_added",i,this),i},p.prototype.removePolygon=function(e){for(var t=0;t<this.polygons.length;t++)if(this.polygons[t]===e){this.polygons[t].setMap(null),this.polygons.splice(t,1),p.fire("polygon_removed",e,this);break}},p.prototype.removePolygons=function(){for(var e,t=0;e=this.polygons[t];t++)e.setMap(null);this.polygons=[]},p.prototype.getFromFusionTables=function(e){var t=e.events;delete e.events;var i=e,n=new google.maps.FusionTablesLayer(i);for(var r in t)(function(e,i){google.maps.event.addListener(e,i,function(e){t[i].apply(this,[e])})})(n,r);return this.layers.push(n),n},p.prototype.loadFromFusionTables=function(e){var t=this.getFromFusionTables(e);return t.setMap(this.map),t},p.prototype.getFromKML=function(e){var t=e.url,i=e.events;delete e.url,delete e.events;var n=e,r=new google.maps.KmlLayer(t,n);for(var s in i)(function(e,t){google.maps.event.addListener(e,t,function(e){i[t].apply(this,[e])})})(r,s);return this.layers.push(r),r},p.prototype.loadFromKML=function(e){var t=this.getFromKML(e);return t.setMap(this.map),t},p.prototype.addLayer=function(e,t){var i;switch(t=t||{},e){case"weather":this.singleLayers.weather=i=new google.maps.weather.WeatherLayer;break;case"clouds":this.singleLayers.clouds=i=new google.maps.weather.CloudLayer;break;case"traffic":this.singleLayers.traffic=i=new google.maps.TrafficLayer;break;case"transit":this.singleLayers.transit=i=new google.maps.TransitLayer;break;case"bicycling":this.singleLayers.bicycling=i=new google.maps.BicyclingLayer;break;case"panoramio":this.singleLayers.panoramio=i=new google.maps.panoramio.PanoramioLayer,i.setTag(t.filter),delete t.filter,t.click&&google.maps.event.addListener(i,"click",function(e){t.click(e),delete t.click});break;case"places":if(this.singleLayers.places=i=new google.maps.places.PlacesService(this.map),t.search||t.nearbySearch||t.radarSearch){var n={bounds:t.bounds||null,keyword:t.keyword||null,location:t.location||null,name:t.name||null,radius:t.radius||null,rankBy:t.rankBy||null,types:t.types||null};t.radarSearch&&i.radarSearch(n,t.radarSearch),t.search&&i.search(n,t.search),t.nearbySearch&&i.nearbySearch(n,t.nearbySearch)}if(t.textSearch){var r={bounds:t.bounds||null,location:t.location||null,query:t.query||null,radius:t.radius||null};i.textSearch(r,t.textSearch)}}if(void 0!==i)return"function"==typeof i.setOptions&&i.setOptions(t),"function"==typeof i.setMap&&i.setMap(this.map),i},p.prototype.removeLayer=function(e){if("string"==typeof e&&void 0!==this.singleLayers[e])this.singleLayers[e].setMap(null),delete this.singleLayers[e];else for(var t=0;t<this.layers.length;t++)if(this.layers[t]===e){this.layers[t].setMap(null),this.layers.splice(t,1);break}},p.prototype.getRoutes=function(e){switch(e.travelMode){case"bicycling":r=google.maps.TravelMode.BICYCLING;break;case"transit":r=google.maps.TravelMode.TRANSIT;break;case"driving":r=google.maps.TravelMode.DRIVING;break;default:r=google.maps.TravelMode.WALKING}s="imperial"===e.unitSystem?google.maps.UnitSystem.IMPERIAL:google.maps.UnitSystem.METRIC;var t=o({avoidHighways:!1,avoidTolls:!1,optimizeWaypoints:!1,waypoints:[]},e);t.origin=/string/.test(typeof e.origin)?e.origin:new google.maps.LatLng(e.origin[0],e.origin[1]),t.destination=/string/.test(typeof e.destination)?e.destination:new google.maps.LatLng(e.destination[0],e.destination[1]),t.travelMode=r,t.unitSystem=s,delete t.callback,delete t.error;var i=[];(new google.maps.DirectionsService).route(t,function(t,n){if(n===google.maps.DirectionsStatus.OK){for(var r in t.routes)t.routes.hasOwnProperty(r)&&i.push(t.routes[r]);e.callback&&e.callback(i,t,n)}else e.error&&e.error(t,n)})},p.prototype.removeRoutes=function(){this.routes.length=0},p.prototype.getElevations=function(e){(e=o({locations:[],path:!1,samples:256},e)).locations.length>0&&e.locations[0].length>0&&(e.locations=l(a([e.locations],h,!1)));var t=e.callback;delete e.callback;var i=new google.maps.ElevationService;if(e.path){var n={path:e.locations,samples:e.samples};i.getElevationAlongPath(n,function(e,i){t&&"function"==typeof t&&t(e,i)})}else delete e.path,delete e.samples,i.getElevationForLocations(e,function(e,i){t&&"function"==typeof t&&t(e,i)})},p.prototype.cleanRoute=p.prototype.removePolylines,p.prototype.renderRoute=function(e,t){var i,n="string"==typeof t.panel?document.getElementById(t.panel.replace("#","")):t.panel;t.panel=n,t=o({map:this.map},t),i=new google.maps.DirectionsRenderer(t),this.getRoutes({origin:e.origin,destination:e.destination,travelMode:e.travelMode,waypoints:e.waypoints,unitSystem:e.unitSystem,error:e.error,avoidHighways:e.avoidHighways,avoidTolls:e.avoidTolls,optimizeWaypoints:e.optimizeWaypoints,callback:function(e,t,n){n===google.maps.DirectionsStatus.OK&&i.setDirections(t)}})},p.prototype.drawRoute=function(e){var t=this;this.getRoutes({origin:e.origin,destination:e.destination,travelMode:e.travelMode,waypoints:e.waypoints,unitSystem:e.unitSystem,error:e.error,avoidHighways:e.avoidHighways,avoidTolls:e.avoidTolls,optimizeWaypoints:e.optimizeWaypoints,callback:function(i){if(i.length>0){var n={path:i[i.length-1].overview_path,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight};e.hasOwnProperty("icons")&&(n.icons=e.icons),t.drawPolyline(n),e.callback&&e.callback(i[i.length-1])}}})},p.prototype.travelRoute=function(e){if(e.origin&&e.destination)this.getRoutes({origin:e.origin,destination:e.destination,travelMode:e.travelMode,waypoints:e.waypoints,unitSystem:e.unitSystem,error:e.error,callback:function(t){if(t.length>0&&e.start&&e.start(t[t.length-1]),t.length>0&&e.step){var i=t[t.length-1];if(i.legs.length>0)for(var n,r=i.legs[0].steps,s=0;n=r[s];s++)n.step_number=s,e.step(n,i.legs[0].steps.length-1)}t.length>0&&e.end&&e.end(t[t.length-1])}});else if(e.route&&e.route.legs.length>0)for(var t,i=e.route.legs[0].steps,n=0;t=i[n];n++)t.step_number=n,e.step(t)},p.prototype.drawSteppedRoute=function(e){var t=this;if(e.origin&&e.destination)this.getRoutes({origin:e.origin,destination:e.destination,travelMode:e.travelMode,waypoints:e.waypoints,error:e.error,callback:function(i){if(i.length>0&&e.start&&e.start(i[i.length-1]),i.length>0&&e.step){var n=i[i.length-1];if(n.legs.length>0)for(var r,s=n.legs[0].steps,o=0;r=s[o];o++){r.step_number=o;var a={path:r.path,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight};e.hasOwnProperty("icons")&&(a.icons=e.icons),t.drawPolyline(a),e.step(r,n.legs[0].steps.length-1)}}i.length>0&&e.end&&e.end(i[i.length-1])}});else if(e.route&&e.route.legs.length>0)for(var i,n=e.route.legs[0].steps,r=0;i=n[r];r++){i.step_number=r;var s={path:i.path,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight};e.hasOwnProperty("icons")&&(s.icons=e.icons),t.drawPolyline(s),e.step(i)}},p.Route=function(e){this.origin=e.origin,this.destination=e.destination,this.waypoints=e.waypoints,this.map=e.map,this.route=e.route,this.step_count=0,this.steps=this.route.legs[0].steps,this.steps_length=this.steps.length;var t={path:new google.maps.MVCArray,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight};e.hasOwnProperty("icons")&&(t.icons=e.icons),this.polyline=this.map.drawPolyline(t).getPath()},p.Route.prototype.getRoute=function(t){var i=this;this.map.getRoutes({origin:this.origin,destination:this.destination,travelMode:t.travelMode,waypoints:this.waypoints||[],error:t.error,callback:function(){i.route=e[0],t.callback&&t.callback.call(i)}})},p.Route.prototype.back=function(){if(this.step_count>0){this.step_count--;var e=this.route.legs[0].steps[this.step_count].path;for(var t in e)e.hasOwnProperty(t)&&this.polyline.pop()}},p.Route.prototype.forward=function(){if(this.step_count<this.steps_length){var e=this.route.legs[0].steps[this.step_count].path;for(var t in e)e.hasOwnProperty(t)&&this.polyline.push(e[t]);this.step_count++}},p.prototype.checkGeofence=function(e,t,i){return i.containsLatLng(new google.maps.LatLng(e,t))},p.prototype.checkMarkerGeofence=function(e,t){if(e.fences)for(var i,n=0;i=e.fences[n];n++){var r=e.getPosition();this.checkGeofence(r.lat(),r.lng(),i)||t(e,i)}},p.prototype.toImage=function(e){e=e||{};var t={};if(t.size=e.size||[this.el.clientWidth,this.el.clientHeight],t.lat=this.getCenter().lat(),t.lng=this.getCenter().lng(),this.markers.length>0){t.markers=[];for(var i=0;i<this.markers.length;i++)t.markers.push({lat:this.markers[i].getPosition().lat(),lng:this.markers[i].getPosition().lng()})}if(this.polylines.length>0){var n=this.polylines[0];t.polyline={},t.polyline.path=google.maps.geometry.encoding.encodePath(n.getPath()),t.polyline.strokeColor=n.strokeColor,t.polyline.strokeOpacity=n.strokeOpacity,t.polyline.strokeWeight=n.strokeWeight}return p.staticMapURL(t)},p.staticMapURL=function(e){var t,i=[],n=("file:"===location.protocol?"http:":location.protocol)+"//maps.googleapis.com/maps/api/staticmap";e.url&&(n=e.url,delete e.url),n+="?";var r=e.markers;delete e.markers,!r&&e.marker&&(r=[e.marker],delete e.marker);var s=e.styles;delete e.styles;var o=e.polyline;if(delete e.polyline,e.center)i.push("center="+e.center),delete e.center;else if(e.address)i.push("center="+e.address),delete e.address;else if(e.lat)i.push(["center=",e.lat,",",e.lng].join("")),delete e.lat,delete e.lng;else if(e.visible){var a=encodeURI(e.visible.join("|"));i.push("visible="+a)}var l=e.size;l?(l.join&&(l=l.join("x")),delete e.size):l="630x300",i.push("size="+l),e.zoom||!1===e.zoom||(e.zoom=15);var c=!e.hasOwnProperty("sensor")||!!e.sensor;for(var h in delete e.sensor,i.push("sensor="+c),e)e.hasOwnProperty(h)&&i.push(h+"="+e[h]);if(r)for(var d,u,f=0;t=r[f];f++){for(var h in d=[],t.size&&"normal"!==t.size?(d.push("size:"+t.size),delete t.size):t.icon&&(d.push("icon:"+encodeURI(t.icon)),delete t.icon),t.color&&(d.push("color:"+t.color.replace("#","0x")),delete t.color),t.label&&(d.push("label:"+t.label[0].toUpperCase()),delete t.label),u=t.address?t.address:t.lat+","+t.lng,delete t.address,delete t.lat,delete t.lng,t)t.hasOwnProperty(h)&&d.push(h+":"+t[h]);d.length||0===f?(d.push(u),d=d.join("|"),i.push("markers="+encodeURI(d))):(d=i.pop()+encodeURI("|"+u),i.push(d))}if(s)for(f=0;f<s.length;f++){var p=[];s[f].featureType&&p.push("feature:"+s[f].featureType.toLowerCase()),s[f].elementType&&p.push("element:"+s[f].elementType.toLowerCase());for(var m=0;m<s[f].stylers.length;m++)for(var g in s[f].stylers[m]){var _=s[f].stylers[m][g];"hue"!=g&&"color"!=g||(_="0x"+_.substring(1)),p.push(g+":"+_)}var y=p.join("|");""!=y&&i.push("style="+y)}function v(e,t){if("#"===e[0]&&(e=e.replace("#","0x"),t)){if(t=parseFloat(t),0===(t=Math.min(1,Math.max(t,0))))return"0x00000000";1===(t=(255*t).toString(16)).length&&(t+=t),e=e.slice(0,8)+t}return e}if(o){if(t=o,o=[],t.strokeWeight&&o.push("weight:"+parseInt(t.strokeWeight,10)),t.strokeColor){var x=v(t.strokeColor,t.strokeOpacity);o.push("color:"+x)}if(t.fillColor){var b=v(t.fillColor,t.fillOpacity);o.push("fillcolor:"+b)}var w,S=t.path;if(S.join)for(m=0;w=S[m];m++)o.push(w.join(","));else o.push("enc:"+S);o=o.join("|"),i.push("path="+encodeURI(o))}var T=window.devicePixelRatio||1;return i.push("scale="+T),n+i.join("&")},p.prototype.addMapType=function(e,t){if(!t.hasOwnProperty("getTileUrl")||"function"!=typeof t.getTileUrl)throw"'getTileUrl' function required.";t.tileSize=t.tileSize||new google.maps.Size(256,256);var i=new google.maps.ImageMapType(t);this.map.mapTypes.set(e,i)},p.prototype.addOverlayMapType=function(e){if(!e.hasOwnProperty("getTile")||"function"!=typeof e.getTile)throw"'getTile' function required.";var t=e.index;delete e.index,this.map.overlayMapTypes.insertAt(t,e)},p.prototype.removeOverlayMapType=function(e){this.map.overlayMapTypes.removeAt(e)},p.prototype.addStyle=function(e){var t=new google.maps.StyledMapType(e.styles,{name:e.styledMapName});this.map.mapTypes.set(e.mapTypeId,t)},p.prototype.setStyle=function(e){this.map.setMapTypeId(e)},p.prototype.createPanorama=function(e){return e.hasOwnProperty("lat")&&e.hasOwnProperty("lng")||(e.lat=this.getCenter().lat(),e.lng=this.getCenter().lng()),this.panorama=p.createPanorama(e),this.map.setStreetView(this.panorama),this.panorama},p.createPanorama=function(e){var t=u(e.el,e.context);e.position=new google.maps.LatLng(e.lat,e.lng),delete e.el,delete e.context,delete e.lat,delete e.lng;for(var i=["closeclick","links_changed","pano_changed","position_changed","pov_changed","resize","visible_changed"],n=o({visible:!0},e),r=0;r<i.length;r++)delete n[i[r]];var s=new google.maps.StreetViewPanorama(t,n);for(r=0;r<i.length;r++)(function(t,i){e[i]&&google.maps.event.addListener(t,i,function(){e[i].apply(this)})})(s,i[r]);return s},p.prototype.on=function(e,t){return p.on(e,this,t)},p.prototype.off=function(e){p.off(e,this)},p.prototype.once=function(e,t){return p.once(e,this,t)},p.custom_events=["marker_added","marker_removed","polyline_added","polyline_removed","polygon_added","polygon_removed","geolocated","geolocation_failed"],p.on=function(e,t,i){if(-1==p.custom_events.indexOf(e))return t instanceof p&&(t=t.map),google.maps.event.addListener(t,e,i);var n={handler:i,eventName:e};return t.registered_events[e]=t.registered_events[e]||[],t.registered_events[e].push(n),n},p.off=function(e,t){-1==p.custom_events.indexOf(e)?(t instanceof p&&(t=t.map),google.maps.event.clearListeners(t,e)):t.registered_events[e]=[]},p.once=function(e,t,i){if(-1==p.custom_events.indexOf(e))return t instanceof p&&(t=t.map),google.maps.event.addListenerOnce(t,e,i)},p.fire=function(e,t,i){if(-1==p.custom_events.indexOf(e))google.maps.event.trigger(t,e,Array.prototype.slice.apply(arguments).slice(2));else if(e in i.registered_events)for(var n=i.registered_events[e],r=0;r<n.length;r++)(function(e,t,i){e.apply(t,[i])})(n[r].handler,i,t)},p.geolocate=function(e){var t=e.always||e.complete;navigator.geolocation?navigator.geolocation.getCurrentPosition(function(i){e.success(i),t&&t()},function(i){e.error(i),t&&t()},e.options):(e.not_supported(),t&&t())},p.geocode=function(e){this.geocoder=new google.maps.Geocoder;var t=e.callback;e.hasOwnProperty("lat")&&e.hasOwnProperty("lng")&&(e.latLng=new google.maps.LatLng(e.lat,e.lng)),delete e.lat,delete e.lng,delete e.callback,this.geocoder.geocode(e,function(e,i){t(e,i)})},"object"==typeof window.google&&window.google.maps&&(google.maps.Polygon.prototype.getBounds||(google.maps.Polygon.prototype.getBounds=function(e){for(var t,i=new google.maps.LatLngBounds,n=this.getPaths(),r=0;r<n.getLength();r++){t=n.getAt(r);for(var s=0;s<t.getLength();s++)i.extend(t.getAt(s))}return i}),google.maps.Polygon.prototype.containsLatLng||(google.maps.Polygon.prototype.containsLatLng=function(e){var t=this.getBounds();if(null!==t&&!t.contains(e))return!1;for(var i=!1,n=this.getPaths().getLength(),r=0;r<n;r++)for(var s=this.getPaths().getAt(r),o=s.getLength(),a=o-1,l=0;l<o;l++){var c=s.getAt(l),h=s.getAt(a);(c.lng()<e.lng()&&h.lng()>=e.lng()||h.lng()<e.lng()&&c.lng()>=e.lng())&&c.lat()+(e.lng()-c.lng())/(h.lng()-c.lng())*(h.lat()-c.lat())<e.lat()&&(i=!i),a=l}return i}),google.maps.Circle.prototype.containsLatLng||(google.maps.Circle.prototype.containsLatLng=function(e){return!google.maps.geometry||google.maps.geometry.spherical.computeDistanceBetween(this.getCenter(),e)<=this.getRadius()}),google.maps.Rectangle.prototype.containsLatLng=function(e){return this.getBounds().contains(e)},google.maps.LatLngBounds.prototype.containsLatLng=function(e){return this.contains(e)},google.maps.Marker.prototype.setFences=function(e){this.fences=e},google.maps.Marker.prototype.addFence=function(e){this.fences.push(e)},google.maps.Marker.prototype.getId=function(){return this.__gm_id}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){if(null==this)throw new TypeError;var t=Object(this),i=t.length>>>0;if(0===i)return-1;var n=0;if(arguments.length>1&&((n=Number(arguments[1]))!=n?n=0:0!=n&&n!=1/0&&n!=-1/0&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=i)return-1;for(var r=n>=0?n:Math.max(i-Math.abs(n),0);r<i;r++)if(r in t&&t[r]===e)return r;return-1}),p)},3424:(e,t,i)=>{"use strict";if(i.d(t,{UD:()=>f,n4:()=>p}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(7310);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(6979);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(3341);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(5128);if(/^(7(06|92|96)|140)$/.test(i.j))var a=i(1206);if(/^(7(06|92|96)|140)$/.test(i.j))var l=i(571);if(/^(7(06|92|96)|140)$/.test(i.j))var c=i(844);if(/^(7(06|92|96)|140)$/.test(i.j))var h=i(5581);var d={placement:"bottom",modifiers:[],strategy:"absolute"};function u(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function f(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,f=void 0===i?[]:i,p=t.defaultOptions,m=void 0===p?d:p;return function(e,t,i){void 0===i&&(i=m);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},d,m),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},g=[],_=!1,y={state:p,setOptions:function(i){var n="function"==typeof i?i(p.options):i;v(),p.options=Object.assign({},m,p.options,n),p.scrollParents={reference:(0,h.vq)(e)?(0,s.A)(e):e.contextElement?(0,s.A)(e.contextElement):[],popper:(0,s.A)(t)};var r=(0,a.A)((0,c.A)([].concat(f,p.options.modifiers)));return p.orderedModifiers=r.filter(function(e){return e.enabled}),p.orderedModifiers.forEach(function(e){var t=e.name,i=e.options,n=void 0===i?{}:i,r=e.effect;if("function"==typeof r){var s=r({state:p,name:t,instance:y,options:n});g.push(s||function(){})}}),y.update()},forceUpdate:function(){if(!_){var e=p.elements,t=e.reference,i=e.popper;if(u(t,i)){p.rects={reference:(0,n.A)(t,(0,o.A)(i),"fixed"===p.options.strategy),popper:(0,r.A)(i)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(e){return p.modifiersData[e.name]=Object.assign({},e.data)});for(var s=0;s<p.orderedModifiers.length;s++)if(!0!==p.reset){var a=p.orderedModifiers[s],l=a.fn,c=a.options,h=void 0===c?{}:c,d=a.name;"function"==typeof l&&(p=l({state:p,options:h,name:d,instance:y})||p)}else p.reset=!1,s=-1}}},update:(0,l.A)(function(){return new Promise(function(e){y.forceUpdate(),e(p)})}),destroy:function(){v(),_=!0}};if(!u(e,t))return y;function v(){g.forEach(function(e){return e()}),g=[]}return y.setOptions(i).then(function(e){!_&&i.onFirstUpdate&&i.onFirstUpdate(e)}),y}}var p=/^(7(06|92|96)|140)$/.test(i.j)?f():null},3478:function(e,t,i){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},3508:function(e,t,i){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(i(5093))},3601:function(e,t,i){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},3635:function(e,t,i){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(i(5093))},3739:function(e,t,i){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,i){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(i(5093))},3784:function(e,t,i){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),i="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),n=[/^jan/i,/^feb/i,/^(maart|mrt\.?)$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,n){return e?/-MMM-/.test(n)?i[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(i(5093))},3827:function(e,t,i){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,i){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(i(5093))},3861:function(e,t,i){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},i={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},n=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:n,longMonthsParse:n,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,i){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(i(5093))},3872:function(e,t,i){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(i(5093))},4051:function(e,t,i){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(i(5093))},4063:function(e,t,i){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,i){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(i(5093))},4226:function(e,t,i){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(i(5093))},4278:(e,t,i)=>{"use strict";i.d(t,{DD:()=>g,EP:()=>w,GM:()=>M,LF:()=>y,LG:()=>x,M9:()=>T,Mn:()=>n,OM:()=>l,Ol:()=>m,R9:()=>u,SE:()=>k,WY:()=>d,_N:()=>h,ci:()=>_,iW:()=>b,ir:()=>p,kb:()=>o,ni:()=>c,pA:()=>S,pG:()=>s,qZ:()=>a,sQ:()=>r,v5:()=>v,xf:()=>f});var n="top",r="bottom",s="right",o="left",a="auto",l=[n,r,s,o],c="start",h="end",d="clippingParents",u="viewport",f="popper",p="reference",m=/^(7(06|92|96)|140)$/.test(i.j)?l.reduce(function(e,t){return e.concat([t+"-"+c,t+"-"+h])},[]):null,g=/^(7(06|92|96)|140)$/.test(i.j)?[].concat(l,[a]).reduce(function(e,t){return e.concat([t,t+"-"+c,t+"-"+h])},[]):null,_="beforeRead",y="read",v="afterRead",x="beforeMain",b="main",w="afterMain",S="beforeWrite",T="write",k="afterWrite",M=[_,y,v,x,b,w,S,T,k]},4318:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>r}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(7364);function r(e){return Object.assign({},(0,n.A)(),e)}},4418:function(e,t,i){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),i="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),n=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,i){var n=e+" ";switch(i){case"ss":return n+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return n+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return n+(r(e)?"godziny":"godzin");case"ww":return n+(r(e)?"tygodnie":"tygodni");case"MM":return n+(r(e)?"miesiące":"miesięcy");case"yy":return n+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,n){return e?/D MMMM/.test(n)?i[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},4426:(e,t,i)=>{"use strict";function n(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}i.d(t,{A:()=>n})},4429:function(e,t,i){!function(e){"use strict";function t(e,t,i){var n=e+" ";switch(i){case"ss":return n+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"mm":return n+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return"jedan sat";case"hh":return n+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return n+(1===e?"dan":"dana");case"MM":return n+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return n+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:function(e,t,i,n){if("m"===i)return t?"jedna minuta":n?"jednu minutu":"jedne minute"},mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(i(5093))},4451:function(e,t,i){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},i={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,i){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(i(5093))},4457:function(e,t,i){!function(e){"use strict";function t(e,t,i){var n=" ";return(e%100>=20||e>=100&&e%100==0)&&(n=" de "),e+n+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[i]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(i(5093))},4496:function(e,t,i){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(i(5093))},4566:function(e,t,i){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},4691:function(e,t,i){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,i){return e>11?i?"μμ":"ΜΜ":i?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){return 6===this.day()?"[το προηγούμενο] dddd [{}] LT":"[την προηγούμενη] dddd [{}] LT"},sameElse:"L"},calendar:function(e,t){var i,n=this._calendarEl[e],r=t&&t.hours();return i=n,("undefined"!=typeof Function&&i instanceof Function||"[object Function]"===Object.prototype.toString.call(i))&&(n=n.apply(t)),n.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(i(5093))},4692:function(e,t){var i;!function(t,i){"use strict";"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return i(e)}:i(t)}("undefined"!=typeof window?window:this,function(n,r){"use strict";var s=[],o=Object.getPrototypeOf,a=s.slice,l=s.flat?function(e){return s.flat.call(e)}:function(e){return s.concat.apply([],e)},c=s.push,h=s.indexOf,d={},u=d.toString,f=d.hasOwnProperty,p=f.toString,m=p.call(Object),g={},_=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},v=n.document,x={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,i){var n,r,s=(i=i||v).createElement("script");if(s.text=e,t)for(n in x)(r=t[n]||t.getAttribute&&t.getAttribute(n))&&s.setAttribute(n,r);i.head.appendChild(s).parentNode.removeChild(s)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[u.call(e)]||"object":typeof e}var S="3.7.1",T=/HTML$/i,k=function(e,t){return new k.fn.init(e,t)};function M(e){var t=!!e&&"length"in e&&e.length,i=w(e);return!_(e)&&!y(e)&&("array"===i||0===t||"number"==typeof t&&t>0&&t-1 in e)}function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}k.fn=k.prototype={jquery:S,constructor:k,length:0,toArray:function(){return a.call(this)},get:function(e){return null==e?a.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(e){return this.pushStack(k.map(this,function(t,i){return e.call(t,i,t)}))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(k.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(k.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,i=+e+(e<0?t:0);return this.pushStack(i>=0&&i<t?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:s.sort,splice:s.splice},k.extend=k.fn.extend=function(){var e,t,i,n,r,s,o=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[a]||{},a++),"object"==typeof o||_(o)||(o={}),a===l&&(o=this,a--);a<l;a++)if(null!=(e=arguments[a]))for(t in e)n=e[t],"__proto__"!==t&&o!==n&&(c&&n&&(k.isPlainObject(n)||(r=Array.isArray(n)))?(i=o[t],s=r&&!Array.isArray(i)?[]:r||k.isPlainObject(i)?i:{},r=!1,o[t]=k.extend(c,s,n)):void 0!==n&&(o[t]=n));return o},k.extend({expando:"jQuery"+(S+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,i;return!(!e||"[object Object]"!==u.call(e)||(t=o(e))&&("function"!=typeof(i=f.call(t,"constructor")&&t.constructor)||p.call(i)!==m))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,i){b(e,{nonce:t&&t.nonce},i)},each:function(e,t){var i,n=0;if(M(e))for(i=e.length;n<i&&!1!==t.call(e[n],n,e[n]);n++);else for(n in e)if(!1===t.call(e[n],n,e[n]))break;return e},text:function(e){var t,i="",n=0,r=e.nodeType;if(!r)for(;t=e[n++];)i+=k.text(t);return 1===r||11===r?e.textContent:9===r?e.documentElement.textContent:3===r||4===r?e.nodeValue:i},makeArray:function(e,t){var i=t||[];return null!=e&&(M(Object(e))?k.merge(i,"string"==typeof e?[e]:e):c.call(i,e)),i},inArray:function(e,t,i){return null==t?-1:h.call(t,e,i)},isXMLDoc:function(e){var t=e&&e.namespaceURI,i=e&&(e.ownerDocument||e).documentElement;return!T.test(t||i&&i.nodeName||"HTML")},merge:function(e,t){for(var i=+t.length,n=0,r=e.length;n<i;n++)e[r++]=t[n];return e.length=r,e},grep:function(e,t,i){for(var n=[],r=0,s=e.length,o=!i;r<s;r++)!t(e[r],r)!==o&&n.push(e[r]);return n},map:function(e,t,i){var n,r,s=0,o=[];if(M(e))for(n=e.length;s<n;s++)null!=(r=t(e[s],s,i))&&o.push(r);else for(s in e)null!=(r=t(e[s],s,i))&&o.push(r);return l(o)},guid:1,support:g}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=s[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){d["[object "+t+"]"]=t.toLowerCase()});var C=s.pop,D=s.sort,L=s.splice,E="[\\x20\\t\\r\\n\\f]",I=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g");k.contains=function(e,t){var i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(e.contains?e.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))};var P=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function R(e,t){return t?"\0"===e?"<22>":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}k.escapeSelector=function(e){return(e+"").replace(P,R)};var O=v,z=c;!function(){var e,t,i,r,o,l,c,d,u,p,m=z,_=k.expando,y=0,v=0,x=ee(),b=ee(),w=ee(),S=ee(),T=function(e,t){return e===t&&(o=!0),0},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="(?:\\\\[\\da-fA-F]{1,6}"+E+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",R="\\["+E+"*("+P+")(?:"+E+"*([*^$|!~]?=)"+E+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+E+"*\\]",F=":("+P+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+R+")*)|.*)\\)|)",N=new RegExp(E+"+","g"),Y=new RegExp("^"+E+"*,"+E+"*"),B=new RegExp("^"+E+"*([>+~]|"+E+")"+E+"*"),H=new RegExp(E+"|>"),j=new RegExp(F),V=new RegExp("^"+P+"$"),W={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+E+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)","i")},U=/^(?:input|select|textarea|button)$/i,$=/^h\d$/i,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,X=/[+~]/,q=new RegExp("\\\\[\\da-fA-F]{1,6}"+E+"?|\\\\([^\\r\\n\\f])","g"),Z=function(e,t){var i="0x"+e.slice(1)-65536;return t||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},J=function(){le()},K=ue(function(e){return!0===e.disabled&&A(e,"fieldset")},{dir:"parentNode",next:"legend"});try{m.apply(s=a.call(O.childNodes),O.childNodes),s[O.childNodes.length].nodeType}catch(e){m={apply:function(e,t){z.apply(e,a.call(t))},call:function(e){z.apply(e,a.call(arguments,1))}}}function Q(e,t,i,n){var r,s,o,a,c,h,f,p=t&&t.ownerDocument,y=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==y&&9!==y&&11!==y)return i;if(!n&&(le(t),t=t||l,d)){if(11!==y&&(c=G.exec(e)))if(r=c[1]){if(9===y){if(!(o=t.getElementById(r)))return i;if(o.id===r)return m.call(i,o),i}else if(p&&(o=p.getElementById(r))&&Q.contains(t,o)&&o.id===r)return m.call(i,o),i}else{if(c[2])return m.apply(i,t.getElementsByTagName(e)),i;if((r=c[3])&&t.getElementsByClassName)return m.apply(i,t.getElementsByClassName(r)),i}if(!(S[e+" "]||u&&u.test(e))){if(f=e,p=t,1===y&&(H.test(e)||B.test(e))){for((p=X.test(e)&&ae(t.parentNode)||t)==t&&g.scope||((a=t.getAttribute("id"))?a=k.escapeSelector(a):t.setAttribute("id",a=_)),s=(h=he(e)).length;s--;)h[s]=(a?"#"+a:":scope")+" "+de(h[s]);f=h.join(",")}try{return m.apply(i,p.querySelectorAll(f)),i}catch(t){S(e,!0)}finally{a===_&&t.removeAttribute("id")}}}return ye(e.replace(I,"$1"),t,i,n)}function ee(){var e=[];return function i(n,r){return e.push(n+" ")>t.cacheLength&&delete i[e.shift()],i[n+" "]=r}}function te(e){return e[_]=!0,e}function ie(e){var t=l.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ne(e){return function(t){return A(t,"input")&&t.type===e}}function re(e){return function(t){return(A(t,"input")||A(t,"button"))&&t.type===e}}function se(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&K(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function oe(e){return te(function(t){return t=+t,te(function(i,n){for(var r,s=e([],i.length,t),o=s.length;o--;)i[r=s[o]]&&(i[r]=!(n[r]=i[r]))})})}function ae(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var i,n=e?e.ownerDocument||e:O;return n!=l&&9===n.nodeType&&n.documentElement?(c=(l=n).documentElement,d=!k.isXMLDoc(l),p=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&O!=l&&(i=l.defaultView)&&i.top!==i&&i.addEventListener("unload",J),g.getById=ie(function(e){return c.appendChild(e).id=k.expando,!l.getElementsByName||!l.getElementsByName(k.expando).length}),g.disconnectedMatch=ie(function(e){return p.call(e,"*")}),g.scope=ie(function(){return l.querySelectorAll(":scope")}),g.cssHas=ie(function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),g.getById?(t.filter.ID=function(e){var t=e.replace(q,Z);return function(e){return e.getAttribute("id")===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var i=t.getElementById(e);return i?[i]:[]}}):(t.filter.ID=function(e){var t=e.replace(q,Z);return function(e){var i=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return i&&i.value===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var i,n,r,s=t.getElementById(e);if(s){if((i=s.getAttributeNode("id"))&&i.value===e)return[s];for(r=t.getElementsByName(e),n=0;s=r[n++];)if((i=s.getAttributeNode("id"))&&i.value===e)return[s]}return[]}}),t.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},t.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},u=[],ie(function(e){var t;c.appendChild(e).innerHTML="<a id='"+_+"' href='' disabled='disabled'></a><select id='"+_+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||u.push("\\["+E+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+_+"-]").length||u.push("~="),e.querySelectorAll("a#"+_+"+*").length||u.push(".#.+[+~]"),e.querySelectorAll(":checked").length||u.push(":checked"),(t=l.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),c.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&u.push(":enabled",":disabled"),(t=l.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||u.push("\\["+E+"*name"+E+"*="+E+"*(?:''|\"\")")}),g.cssHas||u.push(":has"),u=u.length&&new RegExp(u.join("|")),T=function(e,t){if(e===t)return o=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!g.sortDetached&&t.compareDocumentPosition(e)===i?e===l||e.ownerDocument==O&&Q.contains(O,e)?-1:t===l||t.ownerDocument==O&&Q.contains(O,t)?1:r?h.call(r,e)-h.call(r,t):0:4&i?-1:1)},l):l}for(e in Q.matches=function(e,t){return Q(e,null,null,t)},Q.matchesSelector=function(e,t){if(le(e),d&&!S[t+" "]&&(!u||!u.test(t)))try{var i=p.call(e,t);if(i||g.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){S(t,!0)}return Q(t,l,null,[e]).length>0},Q.contains=function(e,t){return(e.ownerDocument||e)!=l&&le(e),k.contains(e,t)},Q.attr=function(e,i){(e.ownerDocument||e)!=l&&le(e);var n=t.attrHandle[i.toLowerCase()],r=n&&f.call(t.attrHandle,i.toLowerCase())?n(e,i,!d):void 0;return void 0!==r?r:e.getAttribute(i)},Q.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},k.uniqueSort=function(e){var t,i=[],n=0,s=0;if(o=!g.sortStable,r=!g.sortStable&&a.call(e,0),D.call(e,T),o){for(;t=e[s++];)t===e[s]&&(n=i.push(s));for(;n--;)L.call(e,i[n],1)}return r=null,e},k.fn.uniqueSort=function(){return this.pushStack(k.uniqueSort(a.apply(this)))},t=k.expr={cacheLength:50,createPseudo:te,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(q,Z),e[3]=(e[3]||e[4]||e[5]||"").replace(q,Z),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Q.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Q.error(e[0]),e},PSEUDO:function(e){var t,i=!e[6]&&e[2];return W.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":i&&j.test(i)&&(t=he(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(q,Z).toLowerCase();return"*"===e?function(){return!0}:function(e){return A(e,t)}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+E+")"+e+"("+E+"|$)"))&&x(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,i){return function(n){var r=Q.attr(n,e);return null==r?"!="===t:!t||(r+="","="===t?r===i:"!="===t?r!==i:"^="===t?i&&0===r.indexOf(i):"*="===t?i&&r.indexOf(i)>-1:"$="===t?i&&r.slice(-i.length)===i:"~="===t?(" "+r.replace(N," ")+" ").indexOf(i)>-1:"|="===t&&(r===i||r.slice(0,i.length+1)===i+"-"))}},CHILD:function(e,t,i,n,r){var s="nth"!==e.slice(0,3),o="last"!==e.slice(-4),a="of-type"===t;return 1===n&&0===r?function(e){return!!e.parentNode}:function(t,i,l){var c,h,d,u,f,p=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=a&&t.nodeName.toLowerCase(),v=!l&&!a,x=!1;if(m){if(s){for(;p;){for(d=t;d=d[p];)if(a?A(d,g):1===d.nodeType)return!1;f=p="only"===e&&!f&&"nextSibling"}return!0}if(f=[o?m.firstChild:m.lastChild],o&&v){for(x=(u=(c=(h=m[_]||(m[_]={}))[e]||[])[0]===y&&c[1])&&c[2],d=u&&m.childNodes[u];d=++u&&d&&d[p]||(x=u=0)||f.pop();)if(1===d.nodeType&&++x&&d===t){h[e]=[y,u,x];break}}else if(v&&(x=u=(c=(h=t[_]||(t[_]={}))[e]||[])[0]===y&&c[1]),!1===x)for(;(d=++u&&d&&d[p]||(x=u=0)||f.pop())&&(!(a?A(d,g):1===d.nodeType)||!++x||(v&&((h=d[_]||(d[_]={}))[e]=[y,x]),d!==t)););return(x-=r)===n||x%n===0&&x/n>=0}}},PSEUDO:function(e,i){var n,r=t.pseudos[e]||t.setFilters[e.toLowerCase()]||Q.error("unsupported pseudo: "+e);return r[_]?r(i):r.length>1?(n=[e,e,"",i],t.setFilters.hasOwnProperty(e.toLowerCase())?te(function(e,t){for(var n,s=r(e,i),o=s.length;o--;)e[n=h.call(e,s[o])]=!(t[n]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:te(function(e){var t=[],i=[],n=_e(e.replace(I,"$1"));return n[_]?te(function(e,t,i,r){for(var s,o=n(e,null,r,[]),a=e.length;a--;)(s=o[a])&&(e[a]=!(t[a]=s))}):function(e,r,s){return t[0]=e,n(t,null,s,i),t[0]=null,!i.pop()}}),has:te(function(e){return function(t){return Q(e,t).length>0}}),contains:te(function(e){return e=e.replace(q,Z),function(t){return(t.textContent||k.text(t)).indexOf(e)>-1}}),lang:te(function(e){return V.test(e||"")||Q.error("unsupported lang: "+e),e=e.replace(q,Z).toLowerCase(),function(t){var i;do{if(i=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(i=i.toLowerCase())===e||0===i.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===c},focus:function(e){return e===function(){try{return l.activeElement}catch(e){}}()&&l.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:se(!1),disabled:se(!0),checked:function(e){return A(e,"input")&&!!e.checked||A(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!t.pseudos.empty(e)},header:function(e){return $.test(e.nodeName)},input:function(e){return U.test(e.nodeName)},button:function(e){return A(e,"input")&&"button"===e.type||A(e,"button")},text:function(e){var t;return A(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:oe(function(){return[0]}),last:oe(function(e,t){return[t-1]}),eq:oe(function(e,t,i){return[i<0?i+t:i]}),even:oe(function(e,t){for(var i=0;i<t;i+=2)e.push(i);return e}),odd:oe(function(e,t){for(var i=1;i<t;i+=2)e.push(i);return e}),lt:oe(function(e,t,i){var n;for(n=i<0?i+t:i>t?t:i;--n>=0;)e.push(n);return e}),gt:oe(function(e,t,i){for(var n=i<0?i+t:i;++n<t;)e.push(n);return e})}},t.pseudos.nth=t.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[e]=ne(e);for(e in{submit:!0,reset:!0})t.pseudos[e]=re(e);function ce(){}function he(e,i){var n,r,s,o,a,l,c,h=b[e+" "];if(h)return i?0:h.slice(0);for(a=e,l=[],c=t.preFilter;a;){for(o in n&&!(r=Y.exec(a))||(r&&(a=a.slice(r[0].length)||a),l.push(s=[])),n=!1,(r=B.exec(a))&&(n=r.shift(),s.push({value:n,type:r[0].replace(I," ")}),a=a.slice(n.length)),t.filter)!(r=W[o].exec(a))||c[o]&&!(r=c[o](r))||(n=r.shift(),s.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return i?a.length:a?Q.error(e):b(e,l).slice(0)}function de(e){for(var t=0,i=e.length,n="";t<i;t++)n+=e[t].value;return n}function ue(e,t,i){var n=t.dir,r=t.next,s=r||n,o=i&&"parentNode"===s,a=v++;return t.first?function(t,i,r){for(;t=t[n];)if(1===t.nodeType||o)return e(t,i,r);return!1}:function(t,i,l){var c,h,d=[y,a];if(l){for(;t=t[n];)if((1===t.nodeType||o)&&e(t,i,l))return!0}else for(;t=t[n];)if(1===t.nodeType||o)if(h=t[_]||(t[_]={}),r&&A(t,r))t=t[n]||t;else{if((c=h[s])&&c[0]===y&&c[1]===a)return d[2]=c[2];if(h[s]=d,d[2]=e(t,i,l))return!0}return!1}}function fe(e){return e.length>1?function(t,i,n){for(var r=e.length;r--;)if(!e[r](t,i,n))return!1;return!0}:e[0]}function pe(e,t,i,n,r){for(var s,o=[],a=0,l=e.length,c=null!=t;a<l;a++)(s=e[a])&&(i&&!i(s,n,r)||(o.push(s),c&&t.push(a)));return o}function me(e,t,i,n,r,s){return n&&!n[_]&&(n=me(n)),r&&!r[_]&&(r=me(r,s)),te(function(s,o,a,l){var c,d,u,f,p=[],g=[],_=o.length,y=s||function(e,t,i){for(var n=0,r=t.length;n<r;n++)Q(e,t[n],i);return i}(t||"*",a.nodeType?[a]:a,[]),v=!e||!s&&t?y:pe(y,p,e,a,l);if(i?i(v,f=r||(s?e:_||n)?[]:o,a,l):f=v,n)for(c=pe(f,g),n(c,[],a,l),d=c.length;d--;)(u=c[d])&&(f[g[d]]=!(v[g[d]]=u));if(s){if(r||e){if(r){for(c=[],d=f.length;d--;)(u=f[d])&&c.push(v[d]=u);r(null,f=[],c,l)}for(d=f.length;d--;)(u=f[d])&&(c=r?h.call(s,u):p[d])>-1&&(s[c]=!(o[c]=u))}}else f=pe(f===o?f.splice(_,f.length):f),r?r(null,o,f,l):m.apply(o,f)})}function ge(e){for(var n,r,s,o=e.length,a=t.relative[e[0].type],l=a||t.relative[" "],c=a?1:0,d=ue(function(e){return e===n},l,!0),u=ue(function(e){return h.call(n,e)>-1},l,!0),f=[function(e,t,r){var s=!a&&(r||t!=i)||((n=t).nodeType?d(e,t,r):u(e,t,r));return n=null,s}];c<o;c++)if(r=t.relative[e[c].type])f=[ue(fe(f),r)];else{if((r=t.filter[e[c].type].apply(null,e[c].matches))[_]){for(s=++c;s<o&&!t.relative[e[s].type];s++);return me(c>1&&fe(f),c>1&&de(e.slice(0,c-1).concat({value:" "===e[c-2].type?"*":""})).replace(I,"$1"),r,c<s&&ge(e.slice(c,s)),s<o&&ge(e=e.slice(s)),s<o&&de(e))}f.push(r)}return fe(f)}function _e(e,n){var r,s=[],o=[],a=w[e+" "];if(!a){for(n||(n=he(e)),r=n.length;r--;)(a=ge(n[r]))[_]?s.push(a):o.push(a);a=w(e,function(e,n){var r=n.length>0,s=e.length>0,o=function(o,a,c,h,u){var f,p,g,_=0,v="0",x=o&&[],b=[],w=i,S=o||s&&t.find.TAG("*",u),T=y+=null==w?1:Math.random()||.1,M=S.length;for(u&&(i=a==l||a||u);v!==M&&null!=(f=S[v]);v++){if(s&&f){for(p=0,a||f.ownerDocument==l||(le(f),c=!d);g=e[p++];)if(g(f,a||l,c)){m.call(h,f);break}u&&(y=T)}r&&((f=!g&&f)&&_--,o&&x.push(f))}if(_+=v,r&&v!==_){for(p=0;g=n[p++];)g(x,b,a,c);if(o){if(_>0)for(;v--;)x[v]||b[v]||(b[v]=C.call(h));b=pe(b)}m.apply(h,b),u&&!o&&b.length>0&&_+n.length>1&&k.uniqueSort(h)}return u&&(y=T,i=w),x};return r?te(o):o}(o,s)),a.selector=e}return a}function ye(e,i,n,r){var s,o,a,l,c,h="function"==typeof e&&e,u=!r&&he(e=h.selector||e);if(n=n||[],1===u.length){if((o=u[0]=u[0].slice(0)).length>2&&"ID"===(a=o[0]).type&&9===i.nodeType&&d&&t.relative[o[1].type]){if(!(i=(t.find.ID(a.matches[0].replace(q,Z),i)||[])[0]))return n;h&&(i=i.parentNode),e=e.slice(o.shift().value.length)}for(s=W.needsContext.test(e)?0:o.length;s--&&(a=o[s],!t.relative[l=a.type]);)if((c=t.find[l])&&(r=c(a.matches[0].replace(q,Z),X.test(o[0].type)&&ae(i.parentNode)||i))){if(o.splice(s,1),!(e=r.length&&de(o)))return m.apply(n,r),n;break}}return(h||_e(e,u))(r,i,!d,n,!i||X.test(e)&&ae(i.parentNode)||i),n}ce.prototype=t.filters=t.pseudos,t.setFilters=new ce,g.sortStable=_.split("").sort(T).join("")===_,le(),g.sortDetached=ie(function(e){return 1&e.compareDocumentPosition(l.createElement("fieldset"))}),k.find=Q,k.expr[":"]=k.expr.pseudos,k.unique=k.uniqueSort,Q.compile=_e,Q.select=ye,Q.setDocument=le,Q.tokenize=he,Q.escape=k.escapeSelector,Q.getText=k.text,Q.isXML=k.isXMLDoc,Q.selectors=k.expr,Q.support=k.support,Q.uniqueSort=k.uniqueSort}();var F=function(e,t,i){for(var n=[],r=void 0!==i;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&k(e).is(i))break;n.push(e)}return n},N=function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i},Y=k.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function H(e,t,i){return _(t)?k.grep(e,function(e,n){return!!t.call(e,n,e)!==i}):t.nodeType?k.grep(e,function(e){return e===t!==i}):"string"!=typeof t?k.grep(e,function(e){return h.call(t,e)>-1!==i}):k.filter(t,e,i)}k.filter=function(e,t,i){var n=t[0];return i&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?k.find.matchesSelector(n,e)?[n]:[]:k.find.matches(e,k.grep(t,function(e){return 1===e.nodeType}))},k.fn.extend({find:function(e){var t,i,n=this.length,r=this;if("string"!=typeof e)return this.pushStack(k(e).filter(function(){for(t=0;t<n;t++)if(k.contains(r[t],this))return!0}));for(i=this.pushStack([]),t=0;t<n;t++)k.find(e,r[t],i);return n>1?k.uniqueSort(i):i},filter:function(e){return this.pushStack(H(this,e||[],!1))},not:function(e){return this.pushStack(H(this,e||[],!0))},is:function(e){return!!H(this,"string"==typeof e&&Y.test(e)?k(e):e||[],!1).length}});var j,V=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,i){var n,r;if(!e)return this;if(i=i||j,"string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:V.exec(e))||!n[1]&&t)return!t||t.jquery?(t||i).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:v,!0)),B.test(n[1])&&k.isPlainObject(t))for(n in t)_(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(r=v.getElementById(n[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):_(e)?void 0!==i.ready?i.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,j=k(v);var W=/^(?:parents|prev(?:Until|All))/,U={children:!0,contents:!0,next:!0,prev:!0};function $(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}k.fn.extend({has:function(e){var t=k(e,this),i=t.length;return this.filter(function(){for(var e=0;e<i;e++)if(k.contains(this,t[e]))return!0})},closest:function(e,t){var i,n=0,r=this.length,s=[],o="string"!=typeof e&&k(e);if(!Y.test(e))for(;n<r;n++)for(i=this[n];i&&i!==t;i=i.parentNode)if(i.nodeType<11&&(o?o.index(i)>-1:1===i.nodeType&&k.find.matchesSelector(i,e))){s.push(i);break}return this.pushStack(s.length>1?k.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?h.call(k(e),this[0]):h.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return F(e,"parentNode")},parentsUntil:function(e,t,i){return F(e,"parentNode",i)},next:function(e){return $(e,"nextSibling")},prev:function(e){return $(e,"previousSibling")},nextAll:function(e){return F(e,"nextSibling")},prevAll:function(e){return F(e,"previousSibling")},nextUntil:function(e,t,i){return F(e,"nextSibling",i)},prevUntil:function(e,t,i){return F(e,"previousSibling",i)},siblings:function(e){return N((e.parentNode||{}).firstChild,e)},children:function(e){return N(e.firstChild)},contents:function(e){return null!=e.contentDocument&&o(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},function(e,t){k.fn[e]=function(i,n){var r=k.map(this,t,i);return"Until"!==e.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=k.filter(n,r)),this.length>1&&(U[e]||k.uniqueSort(r),W.test(e)&&r.reverse()),this.pushStack(r)}});var G=/[^\x20\t\r\n\f]+/g;function X(e){return e}function q(e){throw e}function Z(e,t,i,n){var r;try{e&&_(r=e.promise)?r.call(e).done(t).fail(i):e&&_(r=e.then)?r.call(e,t,i):t.apply(void 0,[e].slice(n))}catch(e){i.apply(void 0,[e])}}k.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return k.each(e.match(G)||[],function(e,i){t[i]=!0}),t}(e):k.extend({},e);var t,i,n,r,s=[],o=[],a=-1,l=function(){for(r=r||e.once,n=t=!0;o.length;a=-1)for(i=o.shift();++a<s.length;)!1===s[a].apply(i[0],i[1])&&e.stopOnFalse&&(a=s.length,i=!1);e.memory||(i=!1),t=!1,r&&(s=i?[]:"")},c={add:function(){return s&&(i&&!t&&(a=s.length-1,o.push(i)),function t(i){k.each(i,function(i,n){_(n)?e.unique&&c.has(n)||s.push(n):n&&n.length&&"string"!==w(n)&&t(n)})}(arguments),i&&!t&&l()),this},remove:function(){return k.each(arguments,function(e,t){for(var i;(i=k.inArray(t,s,i))>-1;)s.splice(i,1),i<=a&&a--}),this},has:function(e){return e?k.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return r=o=[],s=i="",this},disabled:function(){return!s},lock:function(){return r=o=[],i||t||(s=i=""),this},locked:function(){return!!r},fireWith:function(e,i){return r||(i=[e,(i=i||[]).slice?i.slice():i],o.push(i),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},k.extend({Deferred:function(e){var t=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return k.Deferred(function(i){k.each(t,function(t,n){var r=_(e[n[4]])&&e[n[4]];s[n[1]](function(){var e=r&&r.apply(this,arguments);e&&_(e.promise)?e.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[n[0]+"With"](this,r?[e]:arguments)})}),e=null}).promise()},then:function(e,i,r){var s=0;function o(e,t,i,r){return function(){var a=this,l=arguments,c=function(){var n,c;if(!(e<s)){if((n=i.apply(a,l))===t.promise())throw new TypeError("Thenable self-resolution");c=n&&("object"==typeof n||"function"==typeof n)&&n.then,_(c)?r?c.call(n,o(s,t,X,r),o(s,t,q,r)):(s++,c.call(n,o(s,t,X,r),o(s,t,q,r),o(s,t,X,t.notifyWith))):(i!==X&&(a=void 0,l=[n]),(r||t.resolveWith)(a,l))}},h=r?c:function(){try{c()}catch(n){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(n,h.error),e+1>=s&&(i!==q&&(a=void 0,l=[n]),t.rejectWith(a,l))}};e?h():(k.Deferred.getErrorHook?h.error=k.Deferred.getErrorHook():k.Deferred.getStackHook&&(h.error=k.Deferred.getStackHook()),n.setTimeout(h))}}return k.Deferred(function(n){t[0][3].add(o(0,n,_(r)?r:X,n.notifyWith)),t[1][3].add(o(0,n,_(e)?e:X)),t[2][3].add(o(0,n,_(i)?i:q))}).promise()},promise:function(e){return null!=e?k.extend(e,r):r}},s={};return k.each(t,function(e,n){var o=n[2],a=n[5];r[n[1]]=o.add,a&&o.add(function(){i=a},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),o.add(n[3].fire),s[n[0]]=function(){return s[n[0]+"With"](this===s?void 0:this,arguments),this},s[n[0]+"With"]=o.fireWith}),r.promise(s),e&&e.call(s,s),s},when:function(e){var t=arguments.length,i=t,n=Array(i),r=a.call(arguments),s=k.Deferred(),o=function(e){return function(i){n[e]=this,r[e]=arguments.length>1?a.call(arguments):i,--t||s.resolveWith(n,r)}};if(t<=1&&(Z(e,s.done(o(i)).resolve,s.reject,!t),"pending"===s.state()||_(r[i]&&r[i].then)))return s.then();for(;i--;)Z(r[i],o(i),s.reject);return s.promise()}});var J=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&J.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},k.readyException=function(e){n.setTimeout(function(){throw e})};var K=k.Deferred();function Q(){v.removeEventListener("DOMContentLoaded",Q),n.removeEventListener("load",Q),k.ready()}k.fn.ready=function(e){return K.then(e).catch(function(e){k.readyException(e)}),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0,!0!==e&&--k.readyWait>0||K.resolveWith(v,[k]))}}),k.ready.then=K.then,"complete"===v.readyState||"loading"!==v.readyState&&!v.documentElement.doScroll?n.setTimeout(k.ready):(v.addEventListener("DOMContentLoaded",Q),n.addEventListener("load",Q));var ee=function(e,t,i,n,r,s,o){var a=0,l=e.length,c=null==i;if("object"===w(i))for(a in r=!0,i)ee(e,t,a,i[a],!0,s,o);else if(void 0!==n&&(r=!0,_(n)||(o=!0),c&&(o?(t.call(e,n),t=null):(c=t,t=function(e,t,i){return c.call(k(e),i)})),t))for(;a<l;a++)t(e[a],i,o?n:n.call(e[a],a,t(e[a],i)));return r?e:c?t.call(e):l?t(e[0],i):s},te=/^-ms-/,ie=/-([a-z])/g;function ne(e,t){return t.toUpperCase()}function re(e){return e.replace(te,"ms-").replace(ie,ne)}var se=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function oe(){this.expando=k.expando+oe.uid++}oe.uid=1,oe.prototype={cache:function(e){var t=e[this.expando];return t||(t={},se(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,i){var n,r=this.cache(e);if("string"==typeof t)r[re(t)]=i;else for(n in t)r[re(n)]=t[n];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][re(t)]},access:function(e,t,i){return void 0===t||t&&"string"==typeof t&&void 0===i?this.get(e,t):(this.set(e,t,i),void 0!==i?i:t)},remove:function(e,t){var i,n=e[this.expando];if(void 0!==n){if(void 0!==t){i=(t=Array.isArray(t)?t.map(re):(t=re(t))in n?[t]:t.match(G)||[]).length;for(;i--;)delete n[t[i]]}(void 0===t||k.isEmptyObject(n))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!k.isEmptyObject(t)}};var ae=new oe,le=new oe,ce=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,he=/[A-Z]/g;function de(e,t,i){var n;if(void 0===i&&1===e.nodeType)if(n="data-"+t.replace(he,"-$&").toLowerCase(),"string"==typeof(i=e.getAttribute(n))){try{i=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ce.test(e)?JSON.parse(e):e)}(i)}catch(e){}le.set(e,t,i)}else i=void 0;return i}k.extend({hasData:function(e){return le.hasData(e)||ae.hasData(e)},data:function(e,t,i){return le.access(e,t,i)},removeData:function(e,t){le.remove(e,t)},_data:function(e,t,i){return ae.access(e,t,i)},_removeData:function(e,t){ae.remove(e,t)}}),k.fn.extend({data:function(e,t){var i,n,r,s=this[0],o=s&&s.attributes;if(void 0===e){if(this.length&&(r=le.get(s),1===s.nodeType&&!ae.get(s,"hasDataAttrs"))){for(i=o.length;i--;)o[i]&&0===(n=o[i].name).indexOf("data-")&&(n=re(n.slice(5)),de(s,n,r[n]));ae.set(s,"hasDataAttrs",!0)}return r}return"object"==typeof e?this.each(function(){le.set(this,e)}):ee(this,function(t){var i;if(s&&void 0===t)return void 0!==(i=le.get(s,e))||void 0!==(i=de(s,e))?i:void 0;this.each(function(){le.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){le.remove(this,e)})}}),k.extend({queue:function(e,t,i){var n;if(e)return t=(t||"fx")+"queue",n=ae.get(e,t),i&&(!n||Array.isArray(i)?n=ae.access(e,t,k.makeArray(i)):n.push(i)),n||[]},dequeue:function(e,t){t=t||"fx";var i=k.queue(e,t),n=i.length,r=i.shift(),s=k._queueHooks(e,t);"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===t&&i.unshift("inprogress"),delete s.stop,r.call(e,function(){k.dequeue(e,t)},s)),!n&&s&&s.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return ae.get(e,i)||ae.access(e,i,{empty:k.Callbacks("once memory").add(function(){ae.remove(e,[t+"queue",i])})})}}),k.fn.extend({queue:function(e,t){var i=2;return"string"!=typeof e&&(t=e,e="fx",i--),arguments.length<i?k.queue(this[0],e):void 0===t?this:this.each(function(){var i=k.queue(this,e,t);k._queueHooks(this,e),"fx"===e&&"inprogress"!==i[0]&&k.dequeue(this,e)})},dequeue:function(e){return this.each(function(){k.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var i,n=1,r=k.Deferred(),s=this,o=this.length,a=function(){--n||r.resolveWith(s,[s])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)(i=ae.get(s[o],e+"queueHooks"))&&i.empty&&(n++,i.empty.add(a));return a(),r.promise(t)}});var ue=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,fe=new RegExp("^(?:([+-])=|)("+ue+")([a-z%]*)$","i"),pe=["Top","Right","Bottom","Left"],me=v.documentElement,ge=function(e){return k.contains(e.ownerDocument,e)},_e={composed:!0};me.getRootNode&&(ge=function(e){return k.contains(e.ownerDocument,e)||e.getRootNode(_e)===e.ownerDocument});var ye=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ge(e)&&"none"===k.css(e,"display")};function ve(e,t,i,n){var r,s,o=20,a=n?function(){return n.cur()}:function(){return k.css(e,t,"")},l=a(),c=i&&i[3]||(k.cssNumber[t]?"":"px"),h=e.nodeType&&(k.cssNumber[t]||"px"!==c&&+l)&&fe.exec(k.css(e,t));if(h&&h[3]!==c){for(l/=2,c=c||h[3],h=+l||1;o--;)k.style(e,t,h+c),(1-s)*(1-(s=a()/l||.5))<=0&&(o=0),h/=s;h*=2,k.style(e,t,h+c),i=i||[]}return i&&(h=+h||+l||0,r=i[1]?h+(i[1]+1)*i[2]:+i[2],n&&(n.unit=c,n.start=h,n.end=r)),r}var xe={};function be(e){var t,i=e.ownerDocument,n=e.nodeName,r=xe[n];return r||(t=i.body.appendChild(i.createElement(n)),r=k.css(t,"display"),t.parentNode.removeChild(t),"none"===r&&(r="block"),xe[n]=r,r)}function we(e,t){for(var i,n,r=[],s=0,o=e.length;s<o;s++)(n=e[s]).style&&(i=n.style.display,t?("none"===i&&(r[s]=ae.get(n,"display")||null,r[s]||(n.style.display="")),""===n.style.display&&ye(n)&&(r[s]=be(n))):"none"!==i&&(r[s]="none",ae.set(n,"display",i)));for(s=0;s<o;s++)null!=r[s]&&(e[s].style.display=r[s]);return e}k.fn.extend({show:function(){return we(this,!0)},hide:function(){return we(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ye(this)?k(this).show():k(this).hide()})}});var Se,Te,ke=/^(?:checkbox|radio)$/i,Me=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ae=/^$|^module$|\/(?:java|ecma)script/i;Se=v.createDocumentFragment().appendChild(v.createElement("div")),(Te=v.createElement("input")).setAttribute("type","radio"),Te.setAttribute("checked","checked"),Te.setAttribute("name","t"),Se.appendChild(Te),g.checkClone=Se.cloneNode(!0).cloneNode(!0).lastChild.checked,Se.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!Se.cloneNode(!0).lastChild.defaultValue,Se.innerHTML="<option></option>",g.option=!!Se.lastChild;var Ce={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function De(e,t){var i;return i=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],i):i}function Le(e,t){for(var i=0,n=e.length;i<n;i++)ae.set(e[i],"globalEval",!t||ae.get(t[i],"globalEval"))}Ce.tbody=Ce.tfoot=Ce.colgroup=Ce.caption=Ce.thead,Ce.th=Ce.td,g.option||(Ce.optgroup=Ce.option=[1,"<select multiple='multiple'>","</select>"]);var Ee=/<|&#?\w+;/;function Ie(e,t,i,n,r){for(var s,o,a,l,c,h,d=t.createDocumentFragment(),u=[],f=0,p=e.length;f<p;f++)if((s=e[f])||0===s)if("object"===w(s))k.merge(u,s.nodeType?[s]:s);else if(Ee.test(s)){for(o=o||d.appendChild(t.createElement("div")),a=(Me.exec(s)||["",""])[1].toLowerCase(),l=Ce[a]||Ce._default,o.innerHTML=l[1]+k.htmlPrefilter(s)+l[2],h=l[0];h--;)o=o.lastChild;k.merge(u,o.childNodes),(o=d.firstChild).textContent=""}else u.push(t.createTextNode(s));for(d.textContent="",f=0;s=u[f++];)if(n&&k.inArray(s,n)>-1)r&&r.push(s);else if(c=ge(s),o=De(d.appendChild(s),"script"),c&&Le(o),i)for(h=0;s=o[h++];)Ae.test(s.type||"")&&i.push(s);return d}var Pe=/^([^.]*)(?:\.(.+)|)/;function Re(){return!0}function Oe(){return!1}function ze(e,t,i,n,r,s){var o,a;if("object"==typeof t){for(a in"string"!=typeof i&&(n=n||i,i=void 0),t)ze(e,a,i,n,t[a],s);return e}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),!1===r)r=Oe;else if(!r)return e;return 1===s&&(o=r,r=function(e){return k().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=k.guid++)),e.each(function(){k.event.add(this,t,r,n,i)})}function Fe(e,t,i){i?(ae.set(e,t,!1),k.event.add(e,t,{namespace:!1,handler:function(e){var i,n=ae.get(this,t);if(1&e.isTrigger&&this[t]){if(n)(k.event.special[t]||{}).delegateType&&e.stopPropagation();else if(n=a.call(arguments),ae.set(this,t,n),this[t](),i=ae.get(this,t),ae.set(this,t,!1),n!==i)return e.stopImmediatePropagation(),e.preventDefault(),i}else n&&(ae.set(this,t,k.event.trigger(n[0],n.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Re)}})):void 0===ae.get(e,t)&&k.event.add(e,t,Re)}k.event={global:{},add:function(e,t,i,n,r){var s,o,a,l,c,h,d,u,f,p,m,g=ae.get(e);if(se(e))for(i.handler&&(i=(s=i).handler,r=s.selector),r&&k.find.matchesSelector(me,r),i.guid||(i.guid=k.guid++),(l=g.events)||(l=g.events=Object.create(null)),(o=g.handle)||(o=g.handle=function(t){return void 0!==k&&k.event.triggered!==t.type?k.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(G)||[""]).length;c--;)f=m=(a=Pe.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f&&(d=k.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=k.event.special[f]||{},h=k.extend({type:f,origType:m,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&k.expr.match.needsContext.test(r),namespace:p.join(".")},s),(u=l[f])||((u=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,n,p,o)||e.addEventListener&&e.addEventListener(f,o)),d.add&&(d.add.call(e,h),h.handler.guid||(h.handler.guid=i.guid)),r?u.splice(u.delegateCount++,0,h):u.push(h),k.event.global[f]=!0)},remove:function(e,t,i,n,r){var s,o,a,l,c,h,d,u,f,p,m,g=ae.hasData(e)&&ae.get(e);if(g&&(l=g.events)){for(c=(t=(t||"").match(G)||[""]).length;c--;)if(f=m=(a=Pe.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f){for(d=k.event.special[f]||{},u=l[f=(n?d.delegateType:d.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=u.length;s--;)h=u[s],!r&&m!==h.origType||i&&i.guid!==h.guid||a&&!a.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(u.splice(s,1),h.selector&&u.delegateCount--,d.remove&&d.remove.call(e,h));o&&!u.length&&(d.teardown&&!1!==d.teardown.call(e,p,g.handle)||k.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)k.event.remove(e,f+t[c],i,n,!0);k.isEmptyObject(l)&&ae.remove(e,"handle events")}},dispatch:function(e){var t,i,n,r,s,o,a=new Array(arguments.length),l=k.event.fix(e),c=(ae.get(this,"events")||Object.create(null))[l.type]||[],h=k.event.special[l.type]||{};for(a[0]=l,t=1;t<arguments.length;t++)a[t]=arguments[t];if(l.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,l)){for(o=k.event.handlers.call(this,l,c),t=0;(r=o[t++])&&!l.isPropagationStopped();)for(l.currentTarget=r.elem,i=0;(s=r.handlers[i++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==s.namespace&&!l.rnamespace.test(s.namespace)||(l.handleObj=s,l.data=s.data,void 0!==(n=((k.event.special[s.origType]||{}).handle||s.handler).apply(r.elem,a))&&!1===(l.result=n)&&(l.preventDefault(),l.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,l),l.result}},handlers:function(e,t){var i,n,r,s,o,a=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(s=[],o={},i=0;i<l;i++)void 0===o[r=(n=t[i]).selector+" "]&&(o[r]=n.needsContext?k(r,this).index(c)>-1:k.find(r,this,null,[c]).length),o[r]&&s.push(n);s.length&&a.push({elem:c,handlers:s})}return c=this,l<t.length&&a.push({elem:c,handlers:t.slice(l)}),a},addProp:function(e,t){Object.defineProperty(k.Event.prototype,e,{enumerable:!0,configurable:!0,get:_(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[k.expando]?e:new k.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return ke.test(t.type)&&t.click&&A(t,"input")&&Fe(t,"click",!0),!1},trigger:function(e){var t=this||e;return ke.test(t.type)&&t.click&&A(t,"input")&&Fe(t,"click"),!0},_default:function(e){var t=e.target;return ke.test(t.type)&&t.click&&A(t,"input")&&ae.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},k.removeEvent=function(e,t,i){e.removeEventListener&&e.removeEventListener(t,i)},k.Event=function(e,t){if(!(this instanceof k.Event))return new k.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Re:Oe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&k.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Oe,isPropagationStopped:Oe,isImmediatePropagationStopped:Oe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Re,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Re,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Re,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},function(e,t){function i(e){if(v.documentMode){var i=ae.get(this,"handle"),n=k.event.fix(e);n.type="focusin"===e.type?"focus":"blur",n.isSimulated=!0,i(e),n.target===n.currentTarget&&i(n)}else k.event.simulate(t,e.target,k.event.fix(e))}k.event.special[e]={setup:function(){var n;if(Fe(this,e,!0),!v.documentMode)return!1;(n=ae.get(this,t))||this.addEventListener(t,i),ae.set(this,t,(n||0)+1)},trigger:function(){return Fe(this,e),!0},teardown:function(){var e;if(!v.documentMode)return!1;(e=ae.get(this,t)-1)?ae.set(this,t,e):(this.removeEventListener(t,i),ae.remove(this,t))},_default:function(t){return ae.get(t.target,e)},delegateType:t},k.event.special[t]={setup:function(){var n=this.ownerDocument||this.document||this,r=v.documentMode?this:n,s=ae.get(r,t);s||(v.documentMode?this.addEventListener(t,i):n.addEventListener(e,i,!0)),ae.set(r,t,(s||0)+1)},teardown:function(){var n=this.ownerDocument||this.document||this,r=v.documentMode?this:n,s=ae.get(r,t)-1;s?ae.set(r,t,s):(v.documentMode?this.removeEventListener(t,i):n.removeEventListener(e,i,!0),ae.remove(r,t))}}}),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){k.event.special[e]={delegateType:t,bindType:t,handle:function(e){var i,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||k.contains(this,n))||(e.type=r.origType,i=r.handler.apply(this,arguments),e.type=t),i}}}),k.fn.extend({on:function(e,t,i,n){return ze(this,e,t,i,n)},one:function(e,t,i,n){return ze(this,e,t,i,n,1)},off:function(e,t,i){var n,r;if(e&&e.preventDefault&&e.handleObj)return n=e.handleObj,k(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return!1!==t&&"function"!=typeof t||(i=t,t=void 0),!1===i&&(i=Oe),this.each(function(){k.event.remove(this,e,i,t)})}});var Ne=/<script|<style|<link/i,Ye=/checked\s*(?:[^=]|=\s*.checked.)/i,Be=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function He(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function je(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ve(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function We(e,t){var i,n,r,s,o,a;if(1===t.nodeType){if(ae.hasData(e)&&(a=ae.get(e).events))for(r in ae.remove(t,"handle events"),a)for(i=0,n=a[r].length;i<n;i++)k.event.add(t,r,a[r][i]);le.hasData(e)&&(s=le.access(e),o=k.extend({},s),le.set(t,o))}}function Ue(e,t){var i=t.nodeName.toLowerCase();"input"===i&&ke.test(e.type)?t.checked=e.checked:"input"!==i&&"textarea"!==i||(t.defaultValue=e.defaultValue)}function $e(e,t,i,n){t=l(t);var r,s,o,a,c,h,d=0,u=e.length,f=u-1,p=t[0],m=_(p);if(m||u>1&&"string"==typeof p&&!g.checkClone&&Ye.test(p))return e.each(function(r){var s=e.eq(r);m&&(t[0]=p.call(this,r,s.html())),$e(s,t,i,n)});if(u&&(s=(r=Ie(t,e[0].ownerDocument,!1,e,n)).firstChild,1===r.childNodes.length&&(r=s),s||n)){for(a=(o=k.map(De(r,"script"),je)).length;d<u;d++)c=r,d!==f&&(c=k.clone(c,!0,!0),a&&k.merge(o,De(c,"script"))),i.call(e[d],c,d);if(a)for(h=o[o.length-1].ownerDocument,k.map(o,Ve),d=0;d<a;d++)c=o[d],Ae.test(c.type||"")&&!ae.access(c,"globalEval")&&k.contains(h,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?k._evalUrl&&!c.noModule&&k._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},h):b(c.textContent.replace(Be,""),c,h))}return e}function Ge(e,t,i){for(var n,r=t?k.filter(t,e):e,s=0;null!=(n=r[s]);s++)i||1!==n.nodeType||k.cleanData(De(n)),n.parentNode&&(i&&ge(n)&&Le(De(n,"script")),n.parentNode.removeChild(n));return e}k.extend({htmlPrefilter:function(e){return e},clone:function(e,t,i){var n,r,s,o,a=e.cloneNode(!0),l=ge(e);if(!(g.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(o=De(a),n=0,r=(s=De(e)).length;n<r;n++)Ue(s[n],o[n]);if(t)if(i)for(s=s||De(e),o=o||De(a),n=0,r=s.length;n<r;n++)We(s[n],o[n]);else We(e,a);return(o=De(a,"script")).length>0&&Le(o,!l&&De(e,"script")),a},cleanData:function(e){for(var t,i,n,r=k.event.special,s=0;void 0!==(i=e[s]);s++)if(se(i)){if(t=i[ae.expando]){if(t.events)for(n in t.events)r[n]?k.event.remove(i,n):k.removeEvent(i,n,t.handle);i[ae.expando]=void 0}i[le.expando]&&(i[le.expando]=void 0)}}}),k.fn.extend({detach:function(e){return Ge(this,e,!0)},remove:function(e){return Ge(this,e)},text:function(e){return ee(this,function(e){return void 0===e?k.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return $e(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||He(this,e).appendChild(e)})},prepend:function(){return $e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=He(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(k.cleanData(De(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return k.clone(this,e,t)})},html:function(e){return ee(this,function(e){var t=this[0]||{},i=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!Ce[(Me.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;i<n;i++)1===(t=this[i]||{}).nodeType&&(k.cleanData(De(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return $e(this,arguments,function(t){var i=this.parentNode;k.inArray(this,e)<0&&(k.cleanData(De(this)),i&&i.replaceChild(t,this))},e)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){k.fn[e]=function(e){for(var i,n=[],r=k(e),s=r.length-1,o=0;o<=s;o++)i=o===s?this:this.clone(!0),k(r[o])[t](i),c.apply(n,i.get());return this.pushStack(n)}});var Xe=new RegExp("^("+ue+")(?!px)[a-z%]+$","i"),qe=/^--/,Ze=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=n),t.getComputedStyle(e)},Je=function(e,t,i){var n,r,s={};for(r in t)s[r]=e.style[r],e.style[r]=t[r];for(r in n=i.call(e),t)e.style[r]=s[r];return n},Ke=new RegExp(pe.join("|"),"i");function Qe(e,t,i){var n,r,s,o,a=qe.test(t),l=e.style;return(i=i||Ze(e))&&(o=i.getPropertyValue(t)||i[t],a&&o&&(o=o.replace(I,"$1")||void 0),""!==o||ge(e)||(o=k.style(e,t)),!g.pixelBoxStyles()&&Xe.test(o)&&Ke.test(t)&&(n=l.width,r=l.minWidth,s=l.maxWidth,l.minWidth=l.maxWidth=l.width=o,o=i.width,l.width=n,l.minWidth=r,l.maxWidth=s)),void 0!==o?o+"":o}function et(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(h){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",h.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",me.appendChild(c).appendChild(h);var e=n.getComputedStyle(h);i="1%"!==e.top,l=12===t(e.marginLeft),h.style.right="60%",o=36===t(e.right),r=36===t(e.width),h.style.position="absolute",s=12===t(h.offsetWidth/3),me.removeChild(c),h=null}}function t(e){return Math.round(parseFloat(e))}var i,r,s,o,a,l,c=v.createElement("div"),h=v.createElement("div");h.style&&(h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===h.style.backgroundClip,k.extend(g,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),i},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),s},reliableTrDimensions:function(){var e,t,i,r;return null==a&&(e=v.createElement("table"),t=v.createElement("tr"),i=v.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",i.style.height="9px",i.style.display="block",me.appendChild(e).appendChild(t).appendChild(i),r=n.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,me.removeChild(e)),a}}))}();var tt=["Webkit","Moz","ms"],it=v.createElement("div").style,nt={};function rt(e){return k.cssProps[e]||nt[e]||(e in it?e:nt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),i=tt.length;i--;)if((e=tt[i]+t)in it)return e}(e)||e)}var st=/^(none|table(?!-c[ea]).+)/,ot={position:"absolute",visibility:"hidden",display:"block"},at={letterSpacing:"0",fontWeight:"400"};function lt(e,t,i){var n=fe.exec(t);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):t}function ct(e,t,i,n,r,s){var o="width"===t?1:0,a=0,l=0,c=0;if(i===(n?"border":"content"))return 0;for(;o<4;o+=2)"margin"===i&&(c+=k.css(e,i+pe[o],!0,r)),n?("content"===i&&(l-=k.css(e,"padding"+pe[o],!0,r)),"margin"!==i&&(l-=k.css(e,"border"+pe[o]+"Width",!0,r))):(l+=k.css(e,"padding"+pe[o],!0,r),"padding"!==i?l+=k.css(e,"border"+pe[o]+"Width",!0,r):a+=k.css(e,"border"+pe[o]+"Width",!0,r));return!n&&s>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-s-l-a-.5))||0),l+c}function ht(e,t,i){var n=Ze(e),r=(!g.boxSizingReliable()||i)&&"border-box"===k.css(e,"boxSizing",!1,n),s=r,o=Qe(e,t,n),a="offset"+t[0].toUpperCase()+t.slice(1);if(Xe.test(o)){if(!i)return o;o="auto"}return(!g.boxSizingReliable()&&r||!g.reliableTrDimensions()&&A(e,"tr")||"auto"===o||!parseFloat(o)&&"inline"===k.css(e,"display",!1,n))&&e.getClientRects().length&&(r="border-box"===k.css(e,"boxSizing",!1,n),(s=a in e)&&(o=e[a])),(o=parseFloat(o)||0)+ct(e,t,i||(r?"border":"content"),s,n,o)+"px"}function dt(e,t,i,n,r){return new dt.prototype.init(e,t,i,n,r)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=Qe(e,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,i,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,s,o,a=re(t),l=qe.test(t),c=e.style;if(l||(t=rt(a)),o=k.cssHooks[t]||k.cssHooks[a],void 0===i)return o&&"get"in o&&void 0!==(r=o.get(e,!1,n))?r:c[t];"string"==(s=typeof i)&&(r=fe.exec(i))&&r[1]&&(i=ve(e,t,r),s="number"),null!=i&&i==i&&("number"!==s||l||(i+=r&&r[3]||(k.cssNumber[a]?"":"px")),g.clearCloneStyle||""!==i||0!==t.indexOf("background")||(c[t]="inherit"),o&&"set"in o&&void 0===(i=o.set(e,i,n))||(l?c.setProperty(t,i):c[t]=i))}},css:function(e,t,i,n){var r,s,o,a=re(t);return qe.test(t)||(t=rt(a)),(o=k.cssHooks[t]||k.cssHooks[a])&&"get"in o&&(r=o.get(e,!0,i)),void 0===r&&(r=Qe(e,t,n)),"normal"===r&&t in at&&(r=at[t]),""===i||i?(s=parseFloat(r),!0===i||isFinite(s)?s||0:r):r}}),k.each(["height","width"],function(e,t){k.cssHooks[t]={get:function(e,i,n){if(i)return!st.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ht(e,t,n):Je(e,ot,function(){return ht(e,t,n)})},set:function(e,i,n){var r,s=Ze(e),o=!g.scrollboxSize()&&"absolute"===s.position,a=(o||n)&&"border-box"===k.css(e,"boxSizing",!1,s),l=n?ct(e,t,n,a,s):0;return a&&o&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(s[t])-ct(e,t,"border",!1,s)-.5)),l&&(r=fe.exec(i))&&"px"!==(r[3]||"px")&&(e.style[t]=i,i=k.css(e,t)),lt(0,i,l)}}}),k.cssHooks.marginLeft=et(g.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Qe(e,"marginLeft"))||e.getBoundingClientRect().left-Je(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(e,t){k.cssHooks[e+t]={expand:function(i){for(var n=0,r={},s="string"==typeof i?i.split(" "):[i];n<4;n++)r[e+pe[n]+t]=s[n]||s[n-2]||s[0];return r}},"margin"!==e&&(k.cssHooks[e+t].set=lt)}),k.fn.extend({css:function(e,t){return ee(this,function(e,t,i){var n,r,s={},o=0;if(Array.isArray(t)){for(n=Ze(e),r=t.length;o<r;o++)s[t[o]]=k.css(e,t[o],!1,n);return s}return void 0!==i?k.style(e,t,i):k.css(e,t)},e,t,arguments.length>1)}}),k.Tween=dt,dt.prototype={constructor:dt,init:function(e,t,i,n,r,s){this.elem=e,this.prop=i,this.easing=r||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=s||(k.cssNumber[i]?"":"px")},cur:function(){var e=dt.propHooks[this.prop];return e&&e.get?e.get(this):dt.propHooks._default.get(this)},run:function(e){var t,i=dt.propHooks[this.prop];return this.options.duration?this.pos=t=k.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):dt.propHooks._default.set(this),this}},dt.prototype.init.prototype=dt.prototype,dt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||!k.cssHooks[e.prop]&&null==e.elem.style[rt(e.prop)]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}},dt.propHooks.scrollTop=dt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},k.fx=dt.prototype.init,k.fx.step={};var ut,ft,pt=/^(?:toggle|show|hide)$/,mt=/queueHooks$/;function gt(){ft&&(!1===v.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(gt):n.setTimeout(gt,k.fx.interval),k.fx.tick())}function _t(){return n.setTimeout(function(){ut=void 0}),ut=Date.now()}function yt(e,t){var i,n=0,r={height:e};for(t=t?1:0;n<4;n+=2-t)r["margin"+(i=pe[n])]=r["padding"+i]=e;return t&&(r.opacity=r.width=e),r}function vt(e,t,i){for(var n,r=(xt.tweeners[t]||[]).concat(xt.tweeners["*"]),s=0,o=r.length;s<o;s++)if(n=r[s].call(i,t,e))return n}function xt(e,t,i){var n,r,s=0,o=xt.prefilters.length,a=k.Deferred().always(function(){delete l.elem}),l=function(){if(r)return!1;for(var t=ut||_t(),i=Math.max(0,c.startTime+c.duration-t),n=1-(i/c.duration||0),s=0,o=c.tweens.length;s<o;s++)c.tweens[s].run(n);return a.notifyWith(e,[c,n,i]),n<1&&o?i:(o||a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c]),!1)},c=a.promise({elem:e,props:k.extend({},t),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},i),originalProperties:t,originalOptions:i,startTime:ut||_t(),duration:i.duration,tweens:[],createTween:function(t,i){var n=k.Tween(e,c.opts,t,i,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(n),n},stop:function(t){var i=0,n=t?c.tweens.length:0;if(r)return this;for(r=!0;i<n;i++)c.tweens[i].run(1);return t?(a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c,t])):a.rejectWith(e,[c,t]),this}}),h=c.props;for(function(e,t){var i,n,r,s,o;for(i in e)if(r=t[n=re(i)],s=e[i],Array.isArray(s)&&(r=s[1],s=e[i]=s[0]),i!==n&&(e[n]=s,delete e[i]),(o=k.cssHooks[n])&&"expand"in o)for(i in s=o.expand(s),delete e[n],s)i in e||(e[i]=s[i],t[i]=r);else t[n]=r}(h,c.opts.specialEasing);s<o;s++)if(n=xt.prefilters[s].call(c,e,h,c.opts))return _(n.stop)&&(k._queueHooks(c.elem,c.opts.queue).stop=n.stop.bind(n)),n;return k.map(h,vt,c),_(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),k.fx.timer(k.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}k.Animation=k.extend(xt,{tweeners:{"*":[function(e,t){var i=this.createTween(e,t);return ve(i.elem,e,fe.exec(t),i),i}]},tweener:function(e,t){_(e)?(t=e,e=["*"]):e=e.match(G);for(var i,n=0,r=e.length;n<r;n++)i=e[n],xt.tweeners[i]=xt.tweeners[i]||[],xt.tweeners[i].unshift(t)},prefilters:[function(e,t,i){var n,r,s,o,a,l,c,h,d="width"in t||"height"in t,u=this,f={},p=e.style,m=e.nodeType&&ye(e),g=ae.get(e,"fxshow");for(n in i.queue||(null==(o=k._queueHooks(e,"fx")).unqueued&&(o.unqueued=0,a=o.empty.fire,o.empty.fire=function(){o.unqueued||a()}),o.unqueued++,u.always(function(){u.always(function(){o.unqueued--,k.queue(e,"fx").length||o.empty.fire()})})),t)if(r=t[n],pt.test(r)){if(delete t[n],s=s||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!g||void 0===g[n])continue;m=!0}f[n]=g&&g[n]||k.style(e,n)}if((l=!k.isEmptyObject(t))||!k.isEmptyObject(f))for(n in d&&1===e.nodeType&&(i.overflow=[p.overflow,p.overflowX,p.overflowY],null==(c=g&&g.display)&&(c=ae.get(e,"display")),"none"===(h=k.css(e,"display"))&&(c?h=c:(we([e],!0),c=e.style.display||c,h=k.css(e,"display"),we([e]))),("inline"===h||"inline-block"===h&&null!=c)&&"none"===k.css(e,"float")&&(l||(u.done(function(){p.display=c}),null==c&&(h=p.display,c="none"===h?"":h)),p.display="inline-block")),i.overflow&&(p.overflow="hidden",u.always(function(){p.overflow=i.overflow[0],p.overflowX=i.overflow[1],p.overflowY=i.overflow[2]})),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=ae.access(e,"fxshow",{display:c}),s&&(g.hidden=!m),m&&we([e],!0),u.done(function(){for(n in m||we([e]),ae.remove(e,"fxshow"),f)k.style(e,n,f[n])})),l=vt(m?g[n]:0,n,u),n in g||(g[n]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?xt.prefilters.unshift(e):xt.prefilters.push(e)}}),k.speed=function(e,t,i){var n=e&&"object"==typeof e?k.extend({},e):{complete:i||!i&&t||_(e)&&e,duration:e,easing:i&&t||t&&!_(t)&&t};return k.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in k.fx.speeds?n.duration=k.fx.speeds[n.duration]:n.duration=k.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){_(n.old)&&n.old.call(this),n.queue&&k.dequeue(this,n.queue)},n},k.fn.extend({fadeTo:function(e,t,i,n){return this.filter(ye).css("opacity",0).show().end().animate({opacity:t},e,i,n)},animate:function(e,t,i,n){var r=k.isEmptyObject(e),s=k.speed(t,i,n),o=function(){var t=xt(this,k.extend({},e),s);(r||ae.get(this,"finish"))&&t.stop(!0)};return o.finish=o,r||!1===s.queue?this.each(o):this.queue(s.queue,o)},stop:function(e,t,i){var n=function(e){var t=e.stop;delete e.stop,t(i)};return"string"!=typeof e&&(i=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,r=null!=e&&e+"queueHooks",s=k.timers,o=ae.get(this);if(r)o[r]&&o[r].stop&&n(o[r]);else for(r in o)o[r]&&o[r].stop&&mt.test(r)&&n(o[r]);for(r=s.length;r--;)s[r].elem!==this||null!=e&&s[r].queue!==e||(s[r].anim.stop(i),t=!1,s.splice(r,1));!t&&i||k.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,i=ae.get(this),n=i[e+"queue"],r=i[e+"queueHooks"],s=k.timers,o=n?n.length:0;for(i.finish=!0,k.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;t<o;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete i.finish})}}),k.each(["toggle","show","hide"],function(e,t){var i=k.fn[t];k.fn[t]=function(e,n,r){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(yt(t,!0),e,n,r)}}),k.each({slideDown:yt("show"),slideUp:yt("hide"),slideToggle:yt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){k.fn[e]=function(e,i,n){return this.animate(t,e,i,n)}}),k.timers=[],k.fx.tick=function(){var e,t=0,i=k.timers;for(ut=Date.now();t<i.length;t++)(e=i[t])()||i[t]!==e||i.splice(t--,1);i.length||k.fx.stop(),ut=void 0},k.fx.timer=function(e){k.timers.push(e),k.fx.start()},k.fx.interval=13,k.fx.start=function(){ft||(ft=!0,gt())},k.fx.stop=function(){ft=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(e,t){return e=k.fx&&k.fx.speeds[e]||e,t=t||"fx",this.queue(t,function(t,i){var r=n.setTimeout(t,e);i.stop=function(){n.clearTimeout(r)}})},function(){var e=v.createElement("input"),t=v.createElement("select").appendChild(v.createElement("option"));e.type="checkbox",g.checkOn=""!==e.value,g.optSelected=t.selected,(e=v.createElement("input")).value="t",e.type="radio",g.radioValue="t"===e.value}();var bt,wt=k.expr.attrHandle;k.fn.extend({attr:function(e,t){return ee(this,k.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){k.removeAttr(this,e)})}}),k.extend({attr:function(e,t,i){var n,r,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===e.getAttribute?k.prop(e,t,i):(1===s&&k.isXMLDoc(e)||(r=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?bt:void 0)),void 0!==i?null===i?void k.removeAttr(e,t):r&&"set"in r&&void 0!==(n=r.set(e,i,t))?n:(e.setAttribute(t,i+""),i):r&&"get"in r&&null!==(n=r.get(e,t))?n:null==(n=k.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&A(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}},removeAttr:function(e,t){var i,n=0,r=t&&t.match(G);if(r&&1===e.nodeType)for(;i=r[n++];)e.removeAttribute(i)}}),bt={set:function(e,t,i){return!1===t?k.removeAttr(e,i):e.setAttribute(i,i),i}},k.each(k.expr.match.bool.source.match(/\w+/g),function(e,t){var i=wt[t]||k.find.attr;wt[t]=function(e,t,n){var r,s,o=t.toLowerCase();return n||(s=wt[o],wt[o]=r,r=null!=i(e,t,n)?o:null,wt[o]=s),r}});var St=/^(?:input|select|textarea|button)$/i,Tt=/^(?:a|area)$/i;function kt(e){return(e.match(G)||[]).join(" ")}function Mt(e){return e.getAttribute&&e.getAttribute("class")||""}function At(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(G)||[]}k.fn.extend({prop:function(e,t){return ee(this,k.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[k.propFix[e]||e]})}}),k.extend({prop:function(e,t,i){var n,r,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&k.isXMLDoc(e)||(t=k.propFix[t]||t,r=k.propHooks[t]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(e,i,t))?n:e[t]=i:r&&"get"in r&&null!==(n=r.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=k.find.attr(e,"tabindex");return t?parseInt(t,10):St.test(e.nodeName)||Tt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(k.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(e){var t,i,n,r,s,o;return _(e)?this.each(function(t){k(this).addClass(e.call(this,t,Mt(this)))}):(t=At(e)).length?this.each(function(){if(n=Mt(this),i=1===this.nodeType&&" "+kt(n)+" "){for(s=0;s<t.length;s++)r=t[s],i.indexOf(" "+r+" ")<0&&(i+=r+" ");o=kt(i),n!==o&&this.setAttribute("class",o)}}):this},removeClass:function(e){var t,i,n,r,s,o;return _(e)?this.each(function(t){k(this).removeClass(e.call(this,t,Mt(this)))}):arguments.length?(t=At(e)).length?this.each(function(){if(n=Mt(this),i=1===this.nodeType&&" "+kt(n)+" "){for(s=0;s<t.length;s++)for(r=t[s];i.indexOf(" "+r+" ")>-1;)i=i.replace(" "+r+" "," ");o=kt(i),n!==o&&this.setAttribute("class",o)}}):this:this.attr("class","")},toggleClass:function(e,t){var i,n,r,s,o=typeof e,a="string"===o||Array.isArray(e);return _(e)?this.each(function(i){k(this).toggleClass(e.call(this,i,Mt(this),t),t)}):"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):(i=At(e),this.each(function(){if(a)for(s=k(this),r=0;r<i.length;r++)n=i[r],s.hasClass(n)?s.removeClass(n):s.addClass(n);else void 0!==e&&"boolean"!==o||((n=Mt(this))&&ae.set(this,"__className__",n),this.setAttribute&&this.setAttribute("class",n||!1===e?"":ae.get(this,"__className__")||""))}))},hasClass:function(e){var t,i,n=0;for(t=" "+e+" ";i=this[n++];)if(1===i.nodeType&&(" "+kt(Mt(i))+" ").indexOf(t)>-1)return!0;return!1}});var Ct=/\r/g;k.fn.extend({val:function(e){var t,i,n,r=this[0];return arguments.length?(n=_(e),this.each(function(i){var r;1===this.nodeType&&(null==(r=n?e.call(this,i,k(this).val()):e)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=k.map(r,function(e){return null==e?"":e+""})),(t=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))})):r?(t=k.valHooks[r.type]||k.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(i=t.get(r,"value"))?i:"string"==typeof(i=r.value)?i.replace(Ct,""):null==i?"":i:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:kt(k.text(e))}},select:{get:function(e){var t,i,n,r=e.options,s=e.selectedIndex,o="select-one"===e.type,a=o?null:[],l=o?s+1:r.length;for(n=s<0?l:o?s:0;n<l;n++)if(((i=r[n]).selected||n===s)&&!i.disabled&&(!i.parentNode.disabled||!A(i.parentNode,"optgroup"))){if(t=k(i).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var i,n,r=e.options,s=k.makeArray(t),o=r.length;o--;)((n=r[o]).selected=k.inArray(k.valHooks.option.get(n),s)>-1)&&(i=!0);return i||(e.selectedIndex=-1),s}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=k.inArray(k(e).val(),t)>-1}},g.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Dt=n.location,Lt={guid:Date.now()},Et=/\?/;k.parseXML=function(e){var t,i;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){}return i=t&&t.getElementsByTagName("parsererror")[0],t&&!i||k.error("Invalid XML: "+(i?k.map(i.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var It=/^(?:focusinfocus|focusoutblur)$/,Pt=function(e){e.stopPropagation()};k.extend(k.event,{trigger:function(e,t,i,r){var s,o,a,l,c,h,d,u,p=[i||v],m=f.call(e,"type")?e.type:e,g=f.call(e,"namespace")?e.namespace.split("."):[];if(o=u=a=i=i||v,3!==i.nodeType&&8!==i.nodeType&&!It.test(m+k.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),c=m.indexOf(":")<0&&"on"+m,(e=e[k.expando]?e:new k.Event(m,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),t=null==t?[e]:k.makeArray(t,[e]),d=k.event.special[m]||{},r||!d.trigger||!1!==d.trigger.apply(i,t))){if(!r&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,It.test(l+m)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(i.ownerDocument||v)&&p.push(a.defaultView||a.parentWindow||n)}for(s=0;(o=p[s++])&&!e.isPropagationStopped();)u=o,e.type=s>1?l:d.bindType||m,(h=(ae.get(o,"events")||Object.create(null))[e.type]&&ae.get(o,"handle"))&&h.apply(o,t),(h=c&&o[c])&&h.apply&&se(o)&&(e.result=h.apply(o,t),!1===e.result&&e.preventDefault());return e.type=m,r||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),t)||!se(i)||c&&_(i[m])&&!y(i)&&((a=i[c])&&(i[c]=null),k.event.triggered=m,e.isPropagationStopped()&&u.addEventListener(m,Pt),i[m](),e.isPropagationStopped()&&u.removeEventListener(m,Pt),k.event.triggered=void 0,a&&(i[c]=a)),e.result}},simulate:function(e,t,i){var n=k.extend(new k.Event,i,{type:e,isSimulated:!0});k.event.trigger(n,null,t)}}),k.fn.extend({trigger:function(e,t){return this.each(function(){k.event.trigger(e,t,this)})},triggerHandler:function(e,t){var i=this[0];if(i)return k.event.trigger(e,t,i,!0)}});var Rt=/\[\]$/,Ot=/\r?\n/g,zt=/^(?:submit|button|image|reset|file)$/i,Ft=/^(?:input|select|textarea|keygen)/i;function Nt(e,t,i,n){var r;if(Array.isArray(t))k.each(t,function(t,r){i||Rt.test(e)?n(e,r):Nt(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,i,n)});else if(i||"object"!==w(t))n(e,t);else for(r in t)Nt(e+"["+r+"]",t[r],i,n)}k.param=function(e,t){var i,n=[],r=function(e,t){var i=_(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==i?"":i)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!k.isPlainObject(e))k.each(e,function(){r(this.name,this.value)});else for(i in e)Nt(i,e[i],t,r);return n.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&Ft.test(this.nodeName)&&!zt.test(e)&&(this.checked||!ke.test(e))}).map(function(e,t){var i=k(this).val();return null==i?null:Array.isArray(i)?k.map(i,function(e){return{name:t.name,value:e.replace(Ot,"\r\n")}}):{name:t.name,value:i.replace(Ot,"\r\n")}}).get()}});var Yt=/%20/g,Bt=/#.*$/,Ht=/([?&])_=[^&]*/,jt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Vt=/^(?:GET|HEAD)$/,Wt=/^\/\//,Ut={},$t={},Gt="*/".concat("*"),Xt=v.createElement("a");function qt(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var n,r=0,s=t.toLowerCase().match(G)||[];if(_(i))for(;n=s[r++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(i)):(e[n]=e[n]||[]).push(i)}}function Zt(e,t,i,n){var r={},s=e===$t;function o(a){var l;return r[a]=!0,k.each(e[a]||[],function(e,a){var c=a(t,i,n);return"string"!=typeof c||s||r[c]?s?!(l=c):void 0:(t.dataTypes.unshift(c),o(c),!1)}),l}return o(t.dataTypes[0])||!r["*"]&&o("*")}function Jt(e,t){var i,n,r=k.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((r[i]?e:n||(n={}))[i]=t[i]);return n&&k.extend(!0,e,n),e}Xt.href=Dt.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Dt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Gt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Jt(Jt(e,k.ajaxSettings),t):Jt(k.ajaxSettings,e)},ajaxPrefilter:qt(Ut),ajaxTransport:qt($t),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,r,s,o,a,l,c,h,d,u,f=k.ajaxSetup({},t),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?k(p):k.event,g=k.Deferred(),_=k.Callbacks("once memory"),y=f.statusCode||{},x={},b={},w="canceled",S={readyState:0,getResponseHeader:function(e){var t;if(c){if(!o)for(o={};t=jt.exec(s);)o[t[1].toLowerCase()+" "]=(o[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=o[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?s:null},setRequestHeader:function(e,t){return null==c&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)S.always(e[S.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||w;return i&&i.abort(t),T(0,t),this}};if(g.promise(S),f.url=((e||f.url||Dt.href)+"").replace(Wt,Dt.protocol+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(G)||[""],null==f.crossDomain){l=v.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Xt.protocol+"//"+Xt.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=k.param(f.data,f.traditional)),Zt(Ut,f,t,S),c)return S;for(d in(h=k.event&&f.global)&&0===k.active++&&k.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Vt.test(f.type),r=f.url.replace(Bt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Yt,"+")):(u=f.url.slice(r.length),f.data&&(f.processData||"string"==typeof f.data)&&(r+=(Et.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(r=r.replace(Ht,"$1"),u=(Et.test(r)?"&":"?")+"_="+Lt.guid+++u),f.url=r+u),f.ifModified&&(k.lastModified[r]&&S.setRequestHeader("If-Modified-Since",k.lastModified[r]),k.etag[r]&&S.setRequestHeader("If-None-Match",k.etag[r])),(f.data&&f.hasContent&&!1!==f.contentType||t.contentType)&&S.setRequestHeader("Content-Type",f.contentType),S.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Gt+"; q=0.01":""):f.accepts["*"]),f.headers)S.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(p,S,f)||c))return S.abort();if(w="abort",_.add(f.complete),S.done(f.success),S.fail(f.error),i=Zt($t,f,t,S)){if(S.readyState=1,h&&m.trigger("ajaxSend",[S,f]),c)return S;f.async&&f.timeout>0&&(a=n.setTimeout(function(){S.abort("timeout")},f.timeout));try{c=!1,i.send(x,T)}catch(e){if(c)throw e;T(-1,e)}}else T(-1,"No Transport");function T(e,t,o,l){var d,u,v,x,b,w=t;c||(c=!0,a&&n.clearTimeout(a),i=void 0,s=l||"",S.readyState=e>0?4:0,d=e>=200&&e<300||304===e,o&&(x=function(e,t,i){for(var n,r,s,o,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(r in a)if(a[r]&&a[r].test(n)){l.unshift(r);break}if(l[0]in i)s=l[0];else{for(r in i){if(!l[0]||e.converters[r+" "+l[0]]){s=r;break}o||(o=r)}s=s||o}if(s)return s!==l[0]&&l.unshift(s),i[s]}(f,S,o)),!d&&k.inArray("script",f.dataTypes)>-1&&k.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),x=function(e,t,i,n){var r,s,o,a,l,c={},h=e.dataTypes.slice();if(h[1])for(o in e.converters)c[o.toLowerCase()]=e.converters[o];for(s=h.shift();s;)if(e.responseFields[s]&&(i[e.responseFields[s]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=s,s=h.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(o=c[l+" "+s]||c["* "+s]))for(r in c)if((a=r.split(" "))[1]===s&&(o=c[l+" "+a[0]]||c["* "+a[0]])){!0===o?o=c[r]:!0!==c[r]&&(s=a[0],h.unshift(a[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+l+" to "+s}}}return{state:"success",data:t}}(f,x,S,d),d?(f.ifModified&&((b=S.getResponseHeader("Last-Modified"))&&(k.lastModified[r]=b),(b=S.getResponseHeader("etag"))&&(k.etag[r]=b)),204===e||"HEAD"===f.type?w="nocontent":304===e?w="notmodified":(w=x.state,u=x.data,d=!(v=x.error))):(v=w,!e&&w||(w="error",e<0&&(e=0))),S.status=e,S.statusText=(t||w)+"",d?g.resolveWith(p,[u,w,S]):g.rejectWith(p,[S,w,v]),S.statusCode(y),y=void 0,h&&m.trigger(d?"ajaxSuccess":"ajaxError",[S,f,d?u:v]),_.fireWith(p,[S,w]),h&&(m.trigger("ajaxComplete",[S,f]),--k.active||k.event.trigger("ajaxStop")))}return S},getJSON:function(e,t,i){return k.get(e,t,i,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],function(e,t){k[t]=function(e,i,n,r){return _(i)&&(r=r||n,n=i,i=void 0),k.ajax(k.extend({url:e,type:t,dataType:r,data:i,success:n},k.isPlainObject(e)&&e))}}),k.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),k._evalUrl=function(e,t,i){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){k.globalEval(e,t,i)}})},k.fn.extend({wrapAll:function(e){var t;return this[0]&&(_(e)&&(e=e.call(this[0])),t=k(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return _(e)?this.each(function(t){k(this).wrapInner(e.call(this,t))}):this.each(function(){var t=k(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)})},wrap:function(e){var t=_(e);return this.each(function(i){k(this).wrapAll(t?e.call(this,i):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Kt={0:200,1223:204},Qt=k.ajaxSettings.xhr();g.cors=!!Qt&&"withCredentials"in Qt,g.ajax=Qt=!!Qt,k.ajaxTransport(function(e){var t,i;if(g.cors||Qt&&!e.crossDomain)return{send:function(r,s){var o,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)a[o]=e.xhrFields[o];for(o in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(o,r[o]);t=function(e){return function(){t&&(t=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(Kt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=t(),i=a.onerror=a.ontimeout=t("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout(function(){t&&i()})},t=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),k.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return k.globalEval(e),e}}}),k.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),k.ajaxTransport("script",function(e){var t,i;if(e.crossDomain||e.scriptAttrs)return{send:function(n,r){t=k("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",i=function(e){t.remove(),i=null,e&&r("error"===e.type?404:200,e.type)}),v.head.appendChild(t[0])},abort:function(){i&&i()}}});var ei,ti=[],ii=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=ti.pop()||k.expando+"_"+Lt.guid++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,i){var r,s,o,a=!1!==e.jsonp&&(ii.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&ii.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=_(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(ii,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",s=n[r],n[r]=function(){o=arguments},i.always(function(){void 0===s?k(n).removeProp(r):n[r]=s,e[r]&&(e.jsonpCallback=t.jsonpCallback,ti.push(r)),o&&_(s)&&s(o[0]),o=s=void 0}),"script"}),g.createHTMLDocument=((ei=v.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===ei.childNodes.length),k.parseHTML=function(e,t,i){return"string"!=typeof e?[]:("boolean"==typeof t&&(i=t,t=!1),t||(g.createHTMLDocument?((n=(t=v.implementation.createHTMLDocument("")).createElement("base")).href=v.location.href,t.head.appendChild(n)):t=v),s=!i&&[],(r=B.exec(e))?[t.createElement(r[1])]:(r=Ie([e],t,s),s&&s.length&&k(s).remove(),k.merge([],r.childNodes)));var n,r,s},k.fn.load=function(e,t,i){var n,r,s,o=this,a=e.indexOf(" ");return a>-1&&(n=kt(e.slice(a)),e=e.slice(0,a)),_(t)?(i=t,t=void 0):t&&"object"==typeof t&&(r="POST"),o.length>0&&k.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done(function(e){s=arguments,o.html(n?k("<div>").append(k.parseHTML(e)).find(n):e)}).always(i&&function(e,t){o.each(function(){i.apply(this,s||[e.responseText,t,e])})}),this},k.expr.pseudos.animated=function(e){return k.grep(k.timers,function(t){return e===t.elem}).length},k.offset={setOffset:function(e,t,i){var n,r,s,o,a,l,c=k.css(e,"position"),h=k(e),d={};"static"===c&&(e.style.position="relative"),a=h.offset(),s=k.css(e,"top"),l=k.css(e,"left"),("absolute"===c||"fixed"===c)&&(s+l).indexOf("auto")>-1?(o=(n=h.position()).top,r=n.left):(o=parseFloat(s)||0,r=parseFloat(l)||0),_(t)&&(t=t.call(e,i,k.extend({},a))),null!=t.top&&(d.top=t.top-a.top+o),null!=t.left&&(d.left=t.left-a.left+r),"using"in t?t.using.call(e,d):h.css(d)}},k.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){k.offset.setOffset(this,e,t)});var t,i,n=this[0];return n?n.getClientRects().length?(t=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:t.top+i.pageYOffset,left:t.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,i,n=this[0],r={top:0,left:0};if("fixed"===k.css(n,"position"))t=n.getBoundingClientRect();else{for(t=this.offset(),i=n.ownerDocument,e=n.offsetParent||i.documentElement;e&&(e===i.body||e===i.documentElement)&&"static"===k.css(e,"position");)e=e.parentNode;e&&e!==n&&1===e.nodeType&&((r=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),r.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-r.top-k.css(n,"marginTop",!0),left:t.left-r.left-k.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===k.css(e,"position");)e=e.offsetParent;return e||me})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var i="pageYOffset"===t;k.fn[e]=function(n){return ee(this,function(e,n,r){var s;if(y(e)?s=e:9===e.nodeType&&(s=e.defaultView),void 0===r)return s?s[t]:e[n];s?s.scrollTo(i?s.pageXOffset:r,i?r:s.pageYOffset):e[n]=r},e,n,arguments.length)}}),k.each(["top","left"],function(e,t){k.cssHooks[t]=et(g.pixelPosition,function(e,i){if(i)return i=Qe(e,t),Xe.test(i)?k(e).position()[t]+"px":i})}),k.each({Height:"height",Width:"width"},function(e,t){k.each({padding:"inner"+e,content:t,"":"outer"+e},function(i,n){k.fn[n]=function(r,s){var o=arguments.length&&(i||"boolean"!=typeof r),a=i||(!0===r||!0===s?"margin":"border");return ee(this,function(t,i,r){var s;return y(t)?0===n.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(s=t.documentElement,Math.max(t.body["scroll"+e],s["scroll"+e],t.body["offset"+e],s["offset"+e],s["client"+e])):void 0===r?k.css(t,i,a):k.style(t,i,r,a)},t,o?r:void 0,o)}})}),k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.fn.extend({bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,i,n){return this.on(t,e,i,n)},undelegate:function(e,t,i){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",i)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){k.fn[t]=function(e,i){return arguments.length>0?this.on(t,null,e,i):this.trigger(t)}});var ni=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;k.proxy=function(e,t){var i,n,r;if("string"==typeof t&&(i=e[t],t=e,e=i),_(e))return n=a.call(arguments,2),r=function(){return e.apply(t||this,n.concat(a.call(arguments)))},r.guid=e.guid=e.guid||k.guid++,r},k.holdReady=function(e){e?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=A,k.isFunction=_,k.isWindow=y,k.camelCase=re,k.type=w,k.now=Date.now,k.isNumeric=function(e){var t=k.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},k.trim=function(e){return null==e?"":(e+"").replace(ni,"$1")},void 0===(i=function(){return k}.apply(t,[]))||(e.exports=i);var ri=n.jQuery,si=n.$;return k.noConflict=function(e){return n.$===k&&(n.$=si),e&&n.jQuery===k&&(n.jQuery=ri),k},void 0===r&&(n.jQuery=n.$=k),k})},4697:function(e,t,i){!function(e){"use strict";function t(e,t,i,n){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[i][0]:r[i][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},4808:function(e,t,i){!function(e){"use strict";function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e=e&&e.hasOwnProperty("default")?e.default:e;var i={autoShow:!1,autoHide:!1,autoPick:!1,inline:!1,container:null,trigger:null,language:"",format:"mm/dd/yyyy",date:null,startDate:null,endDate:null,startView:0,weekStart:0,yearFirst:!1,yearSuffix:"",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],itemTag:"li",mutedClass:"muted",pickedClass:"picked",disabledClass:"disabled",highlightedClass:"highlighted",template:'<div class="datepicker-container"><div class="datepicker-panel" data-view="years picker"><ul><li data-view="years prev">‹</li><li data-view="years current"></li><li data-view="years next">›</li></ul><ul data-view="years"></ul></div><div class="datepicker-panel" data-view="months picker"><ul><li data-view="year prev">‹</li><li data-view="year current"></li><li data-view="year next">›</li></ul><ul data-view="months"></ul></div><div class="datepicker-panel" data-view="days picker"><ul><li data-view="month prev">‹</li><li data-view="month current"></li><li data-view="month next">›</li></ul><ul data-view="week"></ul><ul data-view="days"></ul></div></div>',offset:10,zIndex:1e3,filter:null,show:null,hide:null,pick:null},n="undefined"!=typeof window,r=n?window:{},s=!!n&&"ontouchstart"in r.document.documentElement,o="datepicker",a="click.".concat(o),l="focus.".concat(o),c="hide.".concat(o),h="keyup.".concat(o),d="pick.".concat(o),u="resize.".concat(o),f="scroll.".concat(o),p="show.".concat(o),m="touchstart.".concat(o),g="".concat(o,"-hide"),_={},y=0,v=1,x=2,b=Object.prototype.toString;function w(e){return"string"==typeof e}var S=Number.isNaN||r.isNaN;function T(e){return"number"==typeof e&&!S(e)}function k(e){return void 0===e}function M(e){return"date"===(t=e,b.call(t).slice(8,-1).toLowerCase())&&!S(e.getTime());var t}function A(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return e.apply(t,n.concat(r))}}function C(e){return'[data-view="'.concat(e,'"]')}function D(e){return e%4==0&&e%100!=0||e%400==0}function L(e,t){return[31,D(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]}function E(e,t,i){return Math.min(i,L(e,t))}var I=/(y|m|d)+/g;function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=String(Math.abs(e)),n=i.length,r="";for(e<0&&(r+="-");n<t;)n+=1,r+="0";return r+i}var R=/\d+/g,O={show:function(){this.built||this.build(),this.shown||this.trigger(p).isDefaultPrevented()||(this.shown=!0,this.$picker.removeClass(g).on(a,e.proxy(this.click,this)),this.showView(this.options.startView),this.inline||(this.$scrollParent.on(f,e.proxy(this.place,this)),e(window).on(u,this.onResize=A(this.place,this)),e(document).on(a,this.onGlobalClick=A(this.globalClick,this)),e(document).on(h,this.onGlobalKeyup=A(this.globalKeyup,this)),s&&e(document).on(m,this.onTouchStart=A(this.touchstart,this)),this.place()))},hide:function(){this.shown&&(this.trigger(c).isDefaultPrevented()||(this.shown=!1,this.$picker.addClass(g).off(a,this.click),this.inline||(this.$scrollParent.off(f,this.place),e(window).off(u,this.onResize),e(document).off(a,this.onGlobalClick),e(document).off(h,this.onGlobalKeyup),s&&e(document).off(m,this.onTouchStart))))},toggle:function(){this.shown?this.hide():this.show()},update:function(){var e=this.getValue();e!==this.oldValue&&(this.setDate(e,!0),this.oldValue=e)},pick:function(e){var t=this.$element,i=this.date;this.trigger(d,{view:e||"",date:i}).isDefaultPrevented()||(i=this.formatDate(this.date),this.setValue(i),this.isInput&&(t.trigger("input"),t.trigger("change")))},reset:function(){this.setDate(this.initialDate,!0),this.setValue(this.initialValue),this.shown&&this.showView(this.options.startView)},getMonthName:function(t,i){var n=this.options,r=n.monthsShort,s=n.months;return e.isNumeric(t)?t=Number(t):k(i)&&(i=t),!0===i&&(s=r),s[T(t)?t:this.date.getMonth()]},getDayName:function(t,i,n){var r=this.options,s=r.days;return e.isNumeric(t)?t=Number(t):(k(n)&&(n=i),k(i)&&(i=t)),n?s=r.daysMin:i&&(s=r.daysShort),s[T(t)?t:this.date.getDay()]},getDate:function(e){var t=this.date;return e?this.formatDate(t):new Date(t)},setDate:function(t,i){var n=this.options.filter;if(M(t)||w(t)){if(t=this.parseDate(t),e.isFunction(n)&&!1===n.call(this.$element,t,"day"))return;this.date=t,this.viewDate=new Date(t),i||this.pick(),this.built&&this.render()}},setStartDate:function(e){M(e)||w(e)?this.startDate=this.parseDate(e):this.startDate=null,this.built&&this.render()},setEndDate:function(e){M(e)||w(e)?this.endDate=this.parseDate(e):this.endDate=null,this.built&&this.render()},parseDate:function(t){var i=this.format,n=[];return M(t)||(w(t)&&(n=t.match(R)||[]),M(t=t?new Date(t):new Date)||(t=new Date),n.length===i.parts.length&&(e.each(n,function(e,n){var r=parseInt(n,10);switch(i.parts[e]){case"yy":t.setFullYear(2e3+r);break;case"yyyy":t.setFullYear(2===n.length?2e3+r:r);break;case"mm":case"m":t.setMonth(r-1)}}),e.each(n,function(e,n){var r=parseInt(n,10);switch(i.parts[e]){case"dd":case"d":t.setDate(r)}}))),new Date(t.getFullYear(),t.getMonth(),t.getDate())},formatDate:function(t){var i=this.format,n="";if(M(t)){var r=t.getFullYear(),s=t.getMonth(),o=t.getDate(),a={d:o,dd:P(o,2),m:s+1,mm:P(s+1,2),yy:String(r).substring(2),yyyy:P(r,4)};n=i.source,e.each(i.parts,function(e,t){n=n.replace(t,a[t])})}return n},destroy:function(){this.unbind(),this.unbuild(),this.$element.removeData(o)}},z={click:function(t){var i=e(t.target),n=this.options,r=this.date,s=this.viewDate,o=this.format;if(t.stopPropagation(),t.preventDefault(),!i.hasClass("disabled")){var a=i.data("view"),l=s.getFullYear(),c=s.getMonth(),h=s.getDate();switch(a){case"years prev":case"years next":l="years prev"===a?l-10:l+10,s.setFullYear(l),s.setDate(E(l,c,h)),this.renderYears();break;case"year prev":case"year next":l="year prev"===a?l-1:l+1,s.setFullYear(l),s.setDate(E(l,c,h)),this.renderMonths();break;case"year current":o.hasYear&&this.showView(x);break;case"year picked":o.hasMonth?this.showView(v):(i.siblings(".".concat(n.pickedClass)).removeClass(n.pickedClass).data("view","year"),this.hideView()),this.pick("year");break;case"year":l=parseInt(i.text(),10),r.setDate(E(l,c,h)),r.setFullYear(l),s.setDate(E(l,c,h)),s.setFullYear(l),o.hasMonth?this.showView(v):(i.addClass(n.pickedClass).data("view","year picked").siblings(".".concat(n.pickedClass)).removeClass(n.pickedClass).data("view","year"),this.hideView()),this.pick("year");break;case"month prev":case"month next":(c="month prev"===a?c-1:c+1)<0?(l-=1,c+=12):c>11&&(l+=1,c-=12),s.setFullYear(l),s.setDate(E(l,c,h)),s.setMonth(c),this.renderDays();break;case"month current":o.hasMonth&&this.showView(v);break;case"month picked":o.hasDay?this.showView(y):(i.siblings(".".concat(n.pickedClass)).removeClass(n.pickedClass).data("view","month"),this.hideView()),this.pick("month");break;case"month":c=e.inArray(i.text(),n.monthsShort),r.setFullYear(l),r.setDate(E(l,c,h)),r.setMonth(c),s.setFullYear(l),s.setDate(E(l,c,h)),s.setMonth(c),o.hasDay?this.showView(y):(i.addClass(n.pickedClass).data("view","month picked").siblings(".".concat(n.pickedClass)).removeClass(n.pickedClass).data("view","month"),this.hideView()),this.pick("month");break;case"day prev":case"day next":case"day":"day prev"===a?c-=1:"day next"===a&&(c+=1),h=parseInt(i.text(),10),r.setDate(1),r.setFullYear(l),r.setMonth(c),r.setDate(h),s.setDate(1),s.setFullYear(l),s.setMonth(c),s.setDate(h),this.renderDays(),"day"===a&&this.hideView(),this.pick("day");break;case"day picked":this.hideView(),this.pick("day")}}},globalClick:function(e){for(var t=e.target,i=this.element,n=this.$trigger[0],r=!0;t!==document;){if(t===n||t===i){r=!1;break}t=t.parentNode}r&&this.hide()},keyup:function(){this.update()},globalKeyup:function(e){var t=e.target,i=e.key,n=e.keyCode;this.isInput&&t!==this.element&&this.shown&&("Tab"===i||9===n)&&this.hide()},touchstart:function(t){var i=t.target;this.isInput&&i!==this.element&&!e.contains(this.$picker[0],i)&&(this.hide(),this.element.blur())}},F={render:function(){this.renderYears(),this.renderMonths(),this.renderDays()},renderWeek:function(){var t=this,i=[],n=this.options,r=n.weekStart,s=n.daysMin;r=parseInt(r,10)%7,s=s.slice(r).concat(s.slice(0,r)),e.each(s,function(e,n){i.push(t.createItem({text:n}))}),this.$week.html(i.join(""))},renderYears:function(){var e,t=this.options,i=this.startDate,n=this.endDate,r=t.disabledClass,s=t.filter,o=t.yearSuffix,a=this.viewDate.getFullYear(),l=(new Date).getFullYear(),c=this.date.getFullYear(),h=[],d=!1,u=!1;for(e=-5;e<=6;e+=1){var f=new Date(a+e,1,1),p=!1;i&&(p=f.getFullYear()<i.getFullYear(),-5===e&&(d=p)),!p&&n&&(p=f.getFullYear()>n.getFullYear(),6===e&&(u=p)),!p&&s&&(p=!1===s.call(this.$element,f,"year"));var m=a+e===c,g=m?"year picked":"year";h.push(this.createItem({picked:m,disabled:p,text:a+e,view:p?"year disabled":g,highlighted:f.getFullYear()===l}))}this.$yearsPrev.toggleClass(r,d),this.$yearsNext.toggleClass(r,u),this.$yearsCurrent.toggleClass(r,!0).html("".concat(a+-5+o," - ").concat(a+6).concat(o)),this.$years.html(h.join(""))},renderMonths:function(){var t,i=this.options,n=this.startDate,r=this.endDate,s=this.viewDate,o=i.disabledClass||"",a=i.monthsShort,l=e.isFunction(i.filter)&&i.filter,c=s.getFullYear(),h=new Date,d=h.getFullYear(),u=h.getMonth(),f=this.date.getFullYear(),p=this.date.getMonth(),m=[],g=!1,_=!1;for(t=0;t<=11;t+=1){var y=new Date(c,t,1),v=!1;n&&(v=(g=y.getFullYear()===n.getFullYear())&&y.getMonth()<n.getMonth()),!v&&r&&(v=(_=y.getFullYear()===r.getFullYear())&&y.getMonth()>r.getMonth()),!v&&l&&(v=!1===l.call(this.$element,y,"month"));var x=c===f&&t===p,b=x?"month picked":"month";m.push(this.createItem({disabled:v,picked:x,highlighted:c===d&&y.getMonth()===u,index:t,text:a[t],view:v?"month disabled":b}))}this.$yearPrev.toggleClass(o,g),this.$yearNext.toggleClass(o,_),this.$yearCurrent.toggleClass(o,g&&_).html(c+i.yearSuffix||""),this.$months.html(m.join(""))},renderDays:function(){var e,t,i,n=this.$element,r=this.options,s=this.startDate,o=this.endDate,a=this.viewDate,l=this.date,c=r.disabledClass,h=r.filter,d=r.months,u=r.weekStart,f=r.yearSuffix,p=a.getFullYear(),m=a.getMonth(),g=new Date,_=g.getFullYear(),y=g.getMonth(),v=g.getDate(),x=l.getFullYear(),b=l.getMonth(),w=l.getDate(),S=[],T=p,k=m,M=!1;0===m?(T-=1,k=11):k-=1,e=L(T,k);var A=new Date(p,m,1);for((i=A.getDay()-parseInt(u,10)%7)<=0&&(i+=7),s&&(M=A.getTime()<=s.getTime()),t=e-(i-1);t<=e;t+=1){var C=new Date(T,k,t),D=!1;s&&(D=C.getTime()<s.getTime()),!D&&h&&(D=!1===h.call(n,C,"day")),S.push(this.createItem({disabled:D,highlighted:T===_&&k===y&&C.getDate()===v,muted:!0,picked:T===x&&k===b&&t===w,text:t,view:"day prev"}))}var E=[],I=p,P=m,R=!1;11===m?(I+=1,P=0):P+=1,e=L(p,m),i=42-(S.length+e);var O=new Date(p,m,e);for(o&&(R=O.getTime()>=o.getTime()),t=1;t<=i;t+=1){var z=new Date(I,P,t),F=I===x&&P===b&&t===w,N=!1;o&&(N=z.getTime()>o.getTime()),!N&&h&&(N=!1===h.call(n,z,"day")),E.push(this.createItem({disabled:N,picked:F,highlighted:I===_&&P===y&&z.getDate()===v,muted:!0,text:t,view:"day next"}))}var Y=[];for(t=1;t<=e;t+=1){var B=new Date(p,m,t),H=!1;s&&(H=B.getTime()<s.getTime()),!H&&o&&(H=B.getTime()>o.getTime()),!H&&h&&(H=!1===h.call(n,B,"day"));var j=p===x&&m===b&&t===w,V=j?"day picked":"day";Y.push(this.createItem({disabled:H,picked:j,highlighted:p===_&&m===y&&B.getDate()===v,text:t,view:H?"day disabled":V}))}this.$monthPrev.toggleClass(c,M),this.$monthNext.toggleClass(c,R),this.$monthCurrent.toggleClass(c,M&&R).html(r.yearFirst?"".concat(p+f," ").concat(d[m]):"".concat(d[m]," ").concat(p).concat(f)),this.$days.html(S.join("")+Y.join("")+E.join(""))}},N="".concat(o,"-top-left"),Y="".concat(o,"-top-right"),B="".concat(o,"-bottom-left"),H="".concat(o,"-bottom-right"),j=[N,Y,B,H].join(" "),V=function(){function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n),this.$element=e(t),this.element=t,this.options=e.extend({},i,_[r.language],e.isPlainObject(r)&&r),this.$scrollParent=function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e(t),r=n.css("position"),s="absolute"===r,o=i?/auto|scroll|hidden/:/auto|scroll/,a=n.parents().filter(function(t,i){var n=e(i);return(!s||"static"!==n.css("position"))&&o.test(n.css("overflow")+n.css("overflow-y")+n.css("overflow-x"))}).eq(0);return"fixed"!==r&&a.length?a:e(t.ownerDocument||document)}(t,!0),this.built=!1,this.shown=!1,this.isInput=!1,this.inline=!1,this.initialValue="",this.initialDate=null,this.startDate=null,this.endDate=null,this.init()}return r=n,s=[{key:"init",value:function(){var t=this.$element,i=this.options,n=i.startDate,r=i.endDate,s=i.date;this.$trigger=e(i.trigger),this.isInput=t.is("input")||t.is("textarea"),this.inline=i.inline&&(i.container||!this.isInput),this.format=function(t){var i=String(t).toLowerCase(),n=i.match(I);if(!n||0===n.length)throw new Error("Invalid date format.");return t={source:i,parts:n},e.each(n,function(e,i){switch(i){case"dd":case"d":t.hasDay=!0;break;case"mm":case"m":t.hasMonth=!0;break;case"yyyy":case"yy":t.hasYear=!0}}),t}(i.format);var o=this.getValue();this.initialValue=o,this.oldValue=o,s=this.parseDate(s||o),n&&(n=this.parseDate(n),s.getTime()<n.getTime()&&(s=new Date(n)),this.startDate=n),r&&(r=this.parseDate(r),n&&r.getTime()<n.getTime()&&(r=new Date(n)),s.getTime()>r.getTime()&&(s=new Date(r)),this.endDate=r),this.date=s,this.viewDate=new Date(s),this.initialDate=new Date(this.date),this.bind(),(i.autoShow||this.inline)&&this.show(),i.autoPick&&this.pick()}},{key:"build",value:function(){if(!this.built){this.built=!0;var t=this.$element,i=this.options,n=e(i.template);this.$picker=n,this.$week=n.find(C("week")),this.$yearsPicker=n.find(C("years picker")),this.$yearsPrev=n.find(C("years prev")),this.$yearsNext=n.find(C("years next")),this.$yearsCurrent=n.find(C("years current")),this.$years=n.find(C("years")),this.$monthsPicker=n.find(C("months picker")),this.$yearPrev=n.find(C("year prev")),this.$yearNext=n.find(C("year next")),this.$yearCurrent=n.find(C("year current")),this.$months=n.find(C("months")),this.$daysPicker=n.find(C("days picker")),this.$monthPrev=n.find(C("month prev")),this.$monthNext=n.find(C("month next")),this.$monthCurrent=n.find(C("month current")),this.$days=n.find(C("days")),this.inline?e(i.container||t).append(n.addClass("".concat(o,"-inline"))):(e(document.body).append(n.addClass("".concat(o,"-dropdown"))),n.addClass(g).css({zIndex:parseInt(i.zIndex,10)})),this.renderWeek()}}},{key:"unbuild",value:function(){this.built&&(this.built=!1,this.$picker.remove())}},{key:"bind",value:function(){var t=this.options,i=this.$element;e.isFunction(t.show)&&i.on(p,t.show),e.isFunction(t.hide)&&i.on(c,t.hide),e.isFunction(t.pick)&&i.on(d,t.pick),this.isInput&&i.on(h,e.proxy(this.keyup,this)),this.inline||(t.trigger?this.$trigger.on(a,e.proxy(this.toggle,this)):this.isInput?i.on(l,e.proxy(this.show,this)):i.on(a,e.proxy(this.show,this)))}},{key:"unbind",value:function(){var t=this.$element,i=this.options;e.isFunction(i.show)&&t.off(p,i.show),e.isFunction(i.hide)&&t.off(c,i.hide),e.isFunction(i.pick)&&t.off(d,i.pick),this.isInput&&t.off(h,this.keyup),this.inline||(i.trigger?this.$trigger.off(a,this.toggle):this.isInput?t.off(l,this.show):t.off(a,this.show))}},{key:"showView",value:function(e){var t=this.$yearsPicker,i=this.$monthsPicker,n=this.$daysPicker,r=this.format;if(r.hasYear||r.hasMonth||r.hasDay)switch(Number(e)){case x:i.addClass(g),n.addClass(g),r.hasYear?(this.renderYears(),t.removeClass(g),this.place()):this.showView(y);break;case v:t.addClass(g),n.addClass(g),r.hasMonth?(this.renderMonths(),i.removeClass(g),this.place()):this.showView(x);break;default:t.addClass(g),i.addClass(g),r.hasDay?(this.renderDays(),n.removeClass(g),this.place()):this.showView(v)}}},{key:"hideView",value:function(){!this.inline&&this.options.autoHide&&this.hide()}},{key:"place",value:function(){if(!this.inline){var t=this.$element,i=this.options,n=this.$picker,r=e(document).outerWidth(),s=e(document).outerHeight(),o=t.outerWidth(),a=t.outerHeight(),l=n.width(),c=n.height(),h=t.offset(),d=h.left,u=h.top,f=parseFloat(i.offset),p=N;S(f)&&(f=10),u>c&&u+a+c>s?(u-=c+f,p=B):u+=a+f,d+l>r&&(d+=o-l,p=p.replace("left","right")),n.removeClass(j).addClass(p).css({top:u,left:d})}}},{key:"trigger",value:function(t,i){var n=e.Event(t,i);return this.$element.trigger(n),n}},{key:"createItem",value:function(t){var i=this.options,n=i.itemTag,r={text:"",view:"",muted:!1,picked:!1,disabled:!1,highlighted:!1},s=[];return e.extend(r,t),r.muted&&s.push(i.mutedClass),r.highlighted&&s.push(i.highlightedClass),r.picked&&s.push(i.pickedClass),r.disabled&&s.push(i.disabledClass),"<".concat(n,' class="').concat(s.join(" "),'" data-view="').concat(r.view,'">').concat(r.text,"</").concat(n,">")}},{key:"getValue",value:function(){var e=this.$element;return this.isInput?e.val():e.text()}},{key:"setValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.$element;this.isInput?t.val(e):this.inline&&!this.options.container||t.text(e)}}],u=[{key:"setDefaults",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.extend(i,_[t.language],e.isPlainObject(t)&&t)}}],s&&t(r.prototype,s),u&&t(r,u),n;var r,s,u}();if(e.extend&&e.extend(V.prototype,F,z,O),e.fn){var W=e.fn.datepicker;e.fn.datepicker=function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];var s;return this.each(function(i,r){var a=e(r),l="destroy"===t,c=a.data(o);if(!c){if(l)return;var h=e.extend({},a.data(),e.isPlainObject(t)&&t);c=new V(r,h),a.data(o,c)}if(w(t)){var d=c[t];e.isFunction(d)&&(s=d.apply(c,n),l&&a.removeData(o))}}),k(s)?this:s},e.fn.datepicker.Constructor=V,e.fn.datepicker.languages=_,e.fn.datepicker.setDefaults=V.setDefaults,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=W,this}}}(i(4692))},4903:function(e,t,i){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(i(5093))},5050:function(e,t,i){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},i={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,i){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(i(5093))},5059:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var n=i(1815);const r={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=(0,n.A)({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}}},5093:function(e,t,i){(e=i.nmd(e)).exports=function(){"use strict";var t,n;function r(){return t.apply(null,arguments)}function s(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(a(e,t))return!1;return!0}function c(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function u(e,t){var i,n=[],r=e.length;for(i=0;i<r;++i)n.push(t(e[i],i));return n}function f(e,t){for(var i in t)a(t,i)&&(e[i]=t[i]);return a(t,"toString")&&(e.toString=t.toString),a(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,i,n){return Ot(e,t,i,n,!0).utc()}function m(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function g(e){var t=null,i=!1,r=e._d&&!isNaN(e._d.getTime());return r&&(t=m(e),i=n.call(t.parsedDateParts,function(e){return null!=e}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&i),e._strict&&(r=r&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?r:(e._isValid=r,e._isValid)}function _(e){var t=p(NaN);return null!=e?f(m(t),e):m(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){var t,i=Object(this),n=i.length>>>0;for(t=0;t<n;t++)if(t in i&&e.call(this,i[t],t,i))return!0;return!1};var y=r.momentProperties=[],v=!1;function x(e,t){var i,n,r,s=y.length;if(c(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),c(t._i)||(e._i=t._i),c(t._f)||(e._f=t._f),c(t._l)||(e._l=t._l),c(t._strict)||(e._strict=t._strict),c(t._tzm)||(e._tzm=t._tzm),c(t._isUTC)||(e._isUTC=t._isUTC),c(t._offset)||(e._offset=t._offset),c(t._pf)||(e._pf=m(t)),c(t._locale)||(e._locale=t._locale),s>0)for(i=0;i<s;i++)c(r=t[n=y[i]])||(e[n]=r);return e}function b(e){x(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===v&&(v=!0,r.updateOffset(this),v=!1)}function w(e){return e instanceof b||null!=e&&null!=e._isAMomentObject}function S(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function T(e,t){var i=!0;return f(function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),i){var n,s,o,l=[],c=arguments.length;for(s=0;s<c;s++){if(n="","object"==typeof arguments[s]){for(o in n+="\n["+s+"] ",arguments[0])a(arguments[0],o)&&(n+=o+": "+arguments[0][o]+", ");n=n.slice(0,-2)}else n=arguments[s];l.push(n)}S(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),i=!1}return t.apply(this,arguments)},t)}var k,M={};function A(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),M[e]||(S(t),M[e]=!0)}function C(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function D(e,t){var i,n=f({},e);for(i in t)a(t,i)&&(o(e[i])&&o(t[i])?(n[i]={},f(n[i],e[i]),f(n[i],t[i])):null!=t[i]?n[i]=t[i]:delete n[i]);for(i in e)a(e,i)&&!a(t,i)&&o(e[i])&&(n[i]=f({},n[i]));return n}function L(e){null!=e&&this.set(e)}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,k=Object.keys?Object.keys:function(e){var t,i=[];for(t in e)a(e,t)&&i.push(t);return i};function E(e,t,i){var n=""+Math.abs(e),r=t-n.length;return(e>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+n}var I=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,P=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,R={},O={};function z(e,t,i,n){var r=n;"string"==typeof n&&(r=function(){return this[n]()}),e&&(O[e]=r),t&&(O[t[0]]=function(){return E(r.apply(this,arguments),t[1],t[2])}),i&&(O[i]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function F(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function N(e,t){return e.isValid()?(t=Y(t,e.localeData()),R[t]=R[t]||function(e){var t,i,n=e.match(I);for(t=0,i=n.length;t<i;t++)O[n[t]]?n[t]=O[n[t]]:n[t]=F(n[t]);return function(t){var r,s="";for(r=0;r<i;r++)s+=C(n[r])?n[r].call(t,e):n[r];return s}}(t),R[t](e)):e.localeData().invalidDate()}function Y(e,t){var i=5;function n(e){return t.longDateFormat(e)||e}for(P.lastIndex=0;i>=0&&P.test(e);)e=e.replace(P,n),P.lastIndex=0,i-=1;return e}var B={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function H(e){return"string"==typeof e?B[e]||B[e.toLowerCase()]:void 0}function j(e){var t,i,n={};for(i in e)a(e,i)&&(t=H(i))&&(n[t]=e[i]);return n}var V={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};var W,U=/\d/,$=/\d\d/,G=/\d{3}/,X=/\d{4}/,q=/[+-]?\d{6}/,Z=/\d\d?/,J=/\d\d\d\d?/,K=/\d\d\d\d\d\d?/,Q=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ie=/\d+/,ne=/[+-]?\d+/,re=/Z|[+-]\d\d:?\d\d/gi,se=/Z|[+-]\d\d(?::?\d\d)?/gi,oe=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ae=/^[1-9]\d?/,le=/^([1-9]\d|\d)/;function ce(e,t,i){W[e]=C(t)?t:function(e,n){return e&&i?i:t}}function he(e,t){return a(W,e)?W[e](t._strict,t._locale):new RegExp(de(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,n,r){return t||i||n||r})))}function de(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ue(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function fe(e){var t=+e,i=0;return 0!==t&&isFinite(t)&&(i=ue(t)),i}W={};var pe={};function me(e,t){var i,n,r=t;for("string"==typeof e&&(e=[e]),h(t)&&(r=function(e,i){i[t]=fe(e)}),n=e.length,i=0;i<n;i++)pe[e[i]]=r}function ge(e,t){me(e,function(e,i,n,r){n._w=n._w||{},t(e,n._w,n,r)})}function _e(e,t,i){null!=t&&a(pe,e)&&pe[e](t,i._a,i,e)}function ye(e){return e%4==0&&e%100!=0||e%400==0}var ve=0,xe=1,be=2,we=3,Se=4,Te=5,ke=6,Me=7,Ae=8;function Ce(e){return ye(e)?366:365}z("Y",0,0,function(){var e=this.year();return e<=9999?E(e,4):"+"+e}),z(0,["YY",2],0,function(){return this.year()%100}),z(0,["YYYY",4],0,"year"),z(0,["YYYYY",5],0,"year"),z(0,["YYYYYY",6,!0],0,"year"),ce("Y",ne),ce("YY",Z,$),ce("YYYY",ee,X),ce("YYYYY",te,q),ce("YYYYYY",te,q),me(["YYYYY","YYYYYY"],ve),me("YYYY",function(e,t){t[ve]=2===e.length?r.parseTwoDigitYear(e):fe(e)}),me("YY",function(e,t){t[ve]=r.parseTwoDigitYear(e)}),me("Y",function(e,t){t[ve]=parseInt(e,10)}),r.parseTwoDigitYear=function(e){return fe(e)+(fe(e)>68?1900:2e3)};var De,Le=Ee("FullYear",!0);function Ee(e,t){return function(i){return null!=i?(Pe(this,e,i),r.updateOffset(this,t),this):Ie(this,e)}}function Ie(e,t){if(!e.isValid())return NaN;var i=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?i.getUTCMilliseconds():i.getMilliseconds();case"Seconds":return n?i.getUTCSeconds():i.getSeconds();case"Minutes":return n?i.getUTCMinutes():i.getMinutes();case"Hours":return n?i.getUTCHours():i.getHours();case"Date":return n?i.getUTCDate():i.getDate();case"Day":return n?i.getUTCDay():i.getDay();case"Month":return n?i.getUTCMonth():i.getMonth();case"FullYear":return n?i.getUTCFullYear():i.getFullYear();default:return NaN}}function Pe(e,t,i){var n,r,s,o,a;if(e.isValid()&&!isNaN(i)){switch(n=e._d,r=e._isUTC,t){case"Milliseconds":return void(r?n.setUTCMilliseconds(i):n.setMilliseconds(i));case"Seconds":return void(r?n.setUTCSeconds(i):n.setSeconds(i));case"Minutes":return void(r?n.setUTCMinutes(i):n.setMinutes(i));case"Hours":return void(r?n.setUTCHours(i):n.setHours(i));case"Date":return void(r?n.setUTCDate(i):n.setDate(i));case"FullYear":break;default:return}s=i,o=e.month(),a=29!==(a=e.date())||1!==o||ye(s)?a:28,r?n.setUTCFullYear(s,o,a):n.setFullYear(s,o,a)}}function Re(e,t){if(isNaN(e)||isNaN(t))return NaN;var i,n=(t%(i=12)+i)%i;return e+=(t-n)/12,1===n?ye(e)?29:28:31-n%7%2}De=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},z("M",["MM",2],"Mo",function(){return this.month()+1}),z("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),z("MMMM",0,0,function(e){return this.localeData().months(this,e)}),ce("M",Z,ae),ce("MM",Z,$),ce("MMM",function(e,t){return t.monthsShortRegex(e)}),ce("MMMM",function(e,t){return t.monthsRegex(e)}),me(["M","MM"],function(e,t){t[xe]=fe(e)-1}),me(["MMM","MMMM"],function(e,t,i,n){var r=i._locale.monthsParse(e,n,i._strict);null!=r?t[xe]=r:m(i).invalidMonth=e});var Oe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ze="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Fe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ne=oe,Ye=oe;function Be(e,t,i){var n,r,s,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)s=p([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===t?-1!==(r=De.call(this._shortMonthsParse,o))?r:null:-1!==(r=De.call(this._longMonthsParse,o))?r:null:"MMM"===t?-1!==(r=De.call(this._shortMonthsParse,o))||-1!==(r=De.call(this._longMonthsParse,o))?r:null:-1!==(r=De.call(this._longMonthsParse,o))||-1!==(r=De.call(this._shortMonthsParse,o))?r:null}function He(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=fe(t);else if(!h(t=e.localeData().monthsParse(t)))return e;var i=t,n=e.date();return n=n<29?n:Math.min(n,Re(e.year(),i)),e._isUTC?e._d.setUTCMonth(i,n):e._d.setMonth(i,n),e}function je(e){return null!=e?(He(this,e),r.updateOffset(this,!0),this):Ie(this,"Month")}function Ve(){function e(e,t){return t.length-e.length}var t,i,n,r,s=[],o=[],a=[];for(t=0;t<12;t++)i=p([2e3,t]),n=de(this.monthsShort(i,"")),r=de(this.months(i,"")),s.push(n),o.push(r),a.push(r),a.push(n);s.sort(e),o.sort(e),a.sort(e),this._monthsRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function We(e,t,i,n,r,s,o){var a;return e<100&&e>=0?(a=new Date(e+400,t,i,n,r,s,o),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,i,n,r,s,o),a}function Ue(e){var t,i;return e<100&&e>=0?((i=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,i)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function $e(e,t,i){var n=7+t-i;return-(7+Ue(e,0,n).getUTCDay()-t)%7+n-1}function Ge(e,t,i,n,r){var s,o,a=1+7*(t-1)+(7+i-n)%7+$e(e,n,r);return a<=0?o=Ce(s=e-1)+a:a>Ce(e)?(s=e+1,o=a-Ce(e)):(s=e,o=a),{year:s,dayOfYear:o}}function Xe(e,t,i){var n,r,s=$e(e.year(),t,i),o=Math.floor((e.dayOfYear()-s-1)/7)+1;return o<1?n=o+qe(r=e.year()-1,t,i):o>qe(e.year(),t,i)?(n=o-qe(e.year(),t,i),r=e.year()+1):(r=e.year(),n=o),{week:n,year:r}}function qe(e,t,i){var n=$e(e,t,i),r=$e(e+1,t,i);return(Ce(e)-n+r)/7}z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),ce("w",Z,ae),ce("ww",Z,$),ce("W",Z,ae),ce("WW",Z,$),ge(["w","ww","W","WW"],function(e,t,i,n){t[n.substr(0,1)]=fe(e)});function Ze(e,t){return e.slice(t,7).concat(e.slice(0,t))}z("d",0,"do","day"),z("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),z("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),z("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),ce("d",Z),ce("e",Z),ce("E",Z),ce("dd",function(e,t){return t.weekdaysMinRegex(e)}),ce("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ce("dddd",function(e,t){return t.weekdaysRegex(e)}),ge(["dd","ddd","dddd"],function(e,t,i,n){var r=i._locale.weekdaysParse(e,n,i._strict);null!=r?t.d=r:m(i).invalidWeekday=e}),ge(["d","e","E"],function(e,t,i,n){t[n]=fe(e)});var Je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ke="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Qe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),et=oe,tt=oe,it=oe;function nt(e,t,i){var n,r,s,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)s=p([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===t?-1!==(r=De.call(this._weekdaysParse,o))?r:null:"ddd"===t?-1!==(r=De.call(this._shortWeekdaysParse,o))?r:null:-1!==(r=De.call(this._minWeekdaysParse,o))?r:null:"dddd"===t?-1!==(r=De.call(this._weekdaysParse,o))||-1!==(r=De.call(this._shortWeekdaysParse,o))||-1!==(r=De.call(this._minWeekdaysParse,o))?r:null:"ddd"===t?-1!==(r=De.call(this._shortWeekdaysParse,o))||-1!==(r=De.call(this._weekdaysParse,o))||-1!==(r=De.call(this._minWeekdaysParse,o))?r:null:-1!==(r=De.call(this._minWeekdaysParse,o))||-1!==(r=De.call(this._weekdaysParse,o))||-1!==(r=De.call(this._shortWeekdaysParse,o))?r:null}function rt(){function e(e,t){return t.length-e.length}var t,i,n,r,s,o=[],a=[],l=[],c=[];for(t=0;t<7;t++)i=p([2e3,1]).day(t),n=de(this.weekdaysMin(i,"")),r=de(this.weekdaysShort(i,"")),s=de(this.weekdays(i,"")),o.push(n),a.push(r),l.push(s),c.push(n),c.push(r),c.push(s);o.sort(e),a.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function st(){return this.hours()%12||12}function ot(e,t){z(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function at(e,t){return t._meridiemParse}z("H",["HH",2],0,"hour"),z("h",["hh",2],0,st),z("k",["kk",2],0,function(){return this.hours()||24}),z("hmm",0,0,function(){return""+st.apply(this)+E(this.minutes(),2)}),z("hmmss",0,0,function(){return""+st.apply(this)+E(this.minutes(),2)+E(this.seconds(),2)}),z("Hmm",0,0,function(){return""+this.hours()+E(this.minutes(),2)}),z("Hmmss",0,0,function(){return""+this.hours()+E(this.minutes(),2)+E(this.seconds(),2)}),ot("a",!0),ot("A",!1),ce("a",at),ce("A",at),ce("H",Z,le),ce("h",Z,ae),ce("k",Z,ae),ce("HH",Z,$),ce("hh",Z,$),ce("kk",Z,$),ce("hmm",J),ce("hmmss",K),ce("Hmm",J),ce("Hmmss",K),me(["H","HH"],we),me(["k","kk"],function(e,t,i){var n=fe(e);t[we]=24===n?0:n}),me(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),me(["h","hh"],function(e,t,i){t[we]=fe(e),m(i).bigHour=!0}),me("hmm",function(e,t,i){var n=e.length-2;t[we]=fe(e.substr(0,n)),t[Se]=fe(e.substr(n)),m(i).bigHour=!0}),me("hmmss",function(e,t,i){var n=e.length-4,r=e.length-2;t[we]=fe(e.substr(0,n)),t[Se]=fe(e.substr(n,2)),t[Te]=fe(e.substr(r)),m(i).bigHour=!0}),me("Hmm",function(e,t,i){var n=e.length-2;t[we]=fe(e.substr(0,n)),t[Se]=fe(e.substr(n))}),me("Hmmss",function(e,t,i){var n=e.length-4,r=e.length-2;t[we]=fe(e.substr(0,n)),t[Se]=fe(e.substr(n,2)),t[Te]=fe(e.substr(r))});var lt=Ee("Hours",!0);var ct,ht={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Oe,monthsShort:ze,week:{dow:0,doy:6},weekdays:Je,weekdaysMin:Qe,weekdaysShort:Ke,meridiemParse:/[ap]\.?m?\.?/i},dt={},ut={};function ft(e,t){var i,n=Math.min(e.length,t.length);for(i=0;i<n;i+=1)if(e[i]!==t[i])return i;return n}function pt(e){return e?e.toLowerCase().replace("_","-"):e}function mt(t){var n=null;if(void 0===dt[t]&&e&&e.exports&&function(e){return!(!e||!e.match("^[^/\\\\]*$"))}(t))try{n=ct._abbr,i(5358)("./"+t),gt(n)}catch(e){dt[t]=null}return dt[t]}function gt(e,t){var i;return e&&((i=c(t)?yt(e):_t(e,t))?ct=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ct._abbr}function _t(e,t){if(null!==t){var i,n=ht;if(t.abbr=e,null!=dt[e])A("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=dt[e]._config;else if(null!=t.parentLocale)if(null!=dt[t.parentLocale])n=dt[t.parentLocale]._config;else{if(null==(i=mt(t.parentLocale)))return ut[t.parentLocale]||(ut[t.parentLocale]=[]),ut[t.parentLocale].push({name:e,config:t}),null;n=i._config}return dt[e]=new L(D(n,t)),ut[e]&&ut[e].forEach(function(e){_t(e.name,e.config)}),gt(e),dt[e]}return delete dt[e],null}function yt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ct;if(!s(e)){if(t=mt(e))return t;e=[e]}return function(e){for(var t,i,n,r,s=0;s<e.length;){for(t=(r=pt(e[s]).split("-")).length,i=(i=pt(e[s+1]))?i.split("-"):null;t>0;){if(n=mt(r.slice(0,t).join("-")))return n;if(i&&i.length>=t&&ft(r,i)>=t-1)break;t--}s++}return ct}(e)}function vt(e){var t,i=e._a;return i&&-2===m(e).overflow&&(t=i[xe]<0||i[xe]>11?xe:i[be]<1||i[be]>Re(i[ve],i[xe])?be:i[we]<0||i[we]>24||24===i[we]&&(0!==i[Se]||0!==i[Te]||0!==i[ke])?we:i[Se]<0||i[Se]>59?Se:i[Te]<0||i[Te]>59?Te:i[ke]<0||i[ke]>999?ke:-1,m(e)._overflowDayOfYear&&(t<ve||t>be)&&(t=be),m(e)._overflowWeeks&&-1===t&&(t=Me),m(e)._overflowWeekday&&-1===t&&(t=Ae),m(e).overflow=t),e}var xt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,bt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,St=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Tt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],kt=/^\/?Date\((-?\d+)/i,Mt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,At={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ct(e){var t,i,n,r,s,o,a=e._i,l=xt.exec(a)||bt.exec(a),c=St.length,h=Tt.length;if(l){for(m(e).iso=!0,t=0,i=c;t<i;t++)if(St[t][1].exec(l[1])){r=St[t][0],n=!1!==St[t][2];break}if(null==r)return void(e._isValid=!1);if(l[3]){for(t=0,i=h;t<i;t++)if(Tt[t][1].exec(l[3])){s=(l[2]||" ")+Tt[t][0];break}if(null==s)return void(e._isValid=!1)}if(!n&&null!=s)return void(e._isValid=!1);if(l[4]){if(!wt.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=r+(s||"")+(o||""),Pt(e)}else e._isValid=!1}function Dt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Lt(e){var t,i,n,r,s,o,a,l,c=Mt.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(c){if(i=c[4],n=c[3],r=c[2],s=c[5],o=c[6],a=c[7],l=[Dt(i),ze.indexOf(n),parseInt(r,10),parseInt(s,10),parseInt(o,10)],a&&l.push(parseInt(a,10)),t=l,!function(e,t,i){return!e||Ke.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(m(i).weekdayMismatch=!0,i._isValid=!1,!1)}(c[1],t,e))return;e._a=t,e._tzm=function(e,t,i){if(e)return At[e];if(t)return 0;var n=parseInt(i,10),r=n%100;return(n-r)/100*60+r}(c[8],c[9],c[10]),e._d=Ue.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),m(e).rfc2822=!0}else e._isValid=!1}function Et(e,t,i){return null!=e?e:null!=t?t:i}function It(e){var t,i,n,s,o,a=[];if(!e._d){for(n=function(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[be]&&null==e._a[xe]&&function(e){var t,i,n,r,s,o,a,l,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(s=1,o=4,i=Et(t.GG,e._a[ve],Xe(zt(),1,4).year),n=Et(t.W,1),((r=Et(t.E,1))<1||r>7)&&(l=!0)):(s=e._locale._week.dow,o=e._locale._week.doy,c=Xe(zt(),s,o),i=Et(t.gg,e._a[ve],c.year),n=Et(t.w,c.week),null!=t.d?((r=t.d)<0||r>6)&&(l=!0):null!=t.e?(r=t.e+s,(t.e<0||t.e>6)&&(l=!0)):r=s),n<1||n>qe(i,s,o)?m(e)._overflowWeeks=!0:null!=l?m(e)._overflowWeekday=!0:(a=Ge(i,n,r,s,o),e._a[ve]=a.year,e._dayOfYear=a.dayOfYear)}(e),null!=e._dayOfYear&&(o=Et(e._a[ve],n[ve]),(e._dayOfYear>Ce(o)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),i=Ue(o,0,e._dayOfYear),e._a[xe]=i.getUTCMonth(),e._a[be]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=n[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[we]&&0===e._a[Se]&&0===e._a[Te]&&0===e._a[ke]&&(e._nextDay=!0,e._a[we]=0),e._d=(e._useUTC?Ue:We).apply(null,a),s=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[we]=24),e._w&&void 0!==e._w.d&&e._w.d!==s&&(m(e).weekdayMismatch=!0)}}function Pt(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],m(e).empty=!0;var t,i,n,s,o,a,l,c=""+e._i,h=c.length,d=0;for(l=(n=Y(e._f,e._locale).match(I)||[]).length,t=0;t<l;t++)s=n[t],(i=(c.match(he(s,e))||[])[0])&&((o=c.substr(0,c.indexOf(i))).length>0&&m(e).unusedInput.push(o),c=c.slice(c.indexOf(i)+i.length),d+=i.length),O[s]?(i?m(e).empty=!1:m(e).unusedTokens.push(s),_e(s,i,e)):e._strict&&!i&&m(e).unusedTokens.push(s);m(e).charsLeftOver=h-d,c.length>0&&m(e).unusedInput.push(c),e._a[we]<=12&&!0===m(e).bigHour&&e._a[we]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[we]=function(e,t,i){var n;return null==i?t:null!=e.meridiemHour?e.meridiemHour(t,i):null!=e.isPM?((n=e.isPM(i))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}(e._locale,e._a[we],e._meridiem),null!==(a=m(e).era)&&(e._a[ve]=e._locale.erasConvertYear(a,e._a[ve])),It(e),vt(e)}else Lt(e);else Ct(e)}function Rt(e){var t=e._i,i=e._f;return e._locale=e._locale||yt(e._l),null===t||void 0===i&&""===t?_({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new b(vt(t)):(d(t)?e._d=t:s(i)?function(e){var t,i,n,r,s,o,a=!1,l=e._f.length;if(0===l)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<l;r++)s=0,o=!1,t=x({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],Pt(t),g(t)&&(o=!0),s+=m(t).charsLeftOver,s+=10*m(t).unusedTokens.length,m(t).score=s,a?s<n&&(n=s,i=t):(null==n||s<n||o)&&(n=s,i=t,o&&(a=!0));f(e,i||t)}(e):i?Pt(e):function(e){var t=e._i;c(t)?e._d=new Date(r.now()):d(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=kt.exec(e._i);null===t?(Ct(e),!1===e._isValid&&(delete e._isValid,Lt(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):s(t)?(e._a=u(t.slice(0),function(e){return parseInt(e,10)}),It(e)):o(t)?function(e){if(!e._d){var t=j(e._i),i=void 0===t.day?t.date:t.day;e._a=u([t.year,t.month,i,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),It(e)}}(e):h(t)?e._d=new Date(t):r.createFromInputFallback(e)}(e),g(e)||(e._d=null),e))}function Ot(e,t,i,n,r){var a,c={};return!0!==t&&!1!==t||(n=t,t=void 0),!0!==i&&!1!==i||(n=i,i=void 0),(o(e)&&l(e)||s(e)&&0===e.length)&&(e=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=r,c._l=i,c._i=e,c._f=t,c._strict=n,(a=new b(vt(Rt(c))))._nextDay&&(a.add(1,"d"),a._nextDay=void 0),a}function zt(e,t,i,n){return Ot(e,t,i,n,!1)}r.createFromInputFallback=T("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),r.ISO_8601=function(){},r.RFC_2822=function(){};var Ft=T("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=zt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:_()}),Nt=T("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=zt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:_()});function Yt(e,t){var i,n;if(1===t.length&&s(t[0])&&(t=t[0]),!t.length)return zt();for(i=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](i)||(i=t[n]);return i}var Bt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ht(e){var t=j(e),i=t.year||0,n=t.quarter||0,r=t.month||0,s=t.week||t.isoWeek||0,o=t.day||0,l=t.hour||0,c=t.minute||0,h=t.second||0,d=t.millisecond||0;this._isValid=function(e){var t,i,n=!1,r=Bt.length;for(t in e)if(a(e,t)&&(-1===De.call(Bt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(i=0;i<r;++i)if(e[Bt[i]]){if(n)return!1;parseFloat(e[Bt[i]])!==fe(e[Bt[i]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*h+6e4*c+1e3*l*60*60,this._days=+o+7*s,this._months=+r+3*n+12*i,this._data={},this._locale=yt(),this._bubble()}function jt(e){return e instanceof Ht}function Vt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Wt(e,t){z(e,0,0,function(){var e=this.utcOffset(),i="+";return e<0&&(e=-e,i="-"),i+E(~~(e/60),2)+t+E(~~e%60,2)})}Wt("Z",":"),Wt("ZZ",""),ce("Z",se),ce("ZZ",se),me(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=$t(se,e)});var Ut=/([\+\-]|\d\d)/gi;function $t(e,t){var i,n,r=(t||"").match(e);return null===r?null:0===(n=60*(i=((r[r.length-1]||[])+"").match(Ut)||["-",0,0])[1]+fe(i[2]))?0:"+"===i[0]?n:-n}function Gt(e,t){var i,n;return t._isUTC?(i=t.clone(),n=(w(e)||d(e)?e.valueOf():zt(e).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+n),r.updateOffset(i,!1),i):zt(e).local()}function Xt(e){return-Math.round(e._d.getTimezoneOffset())}function qt(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Zt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Jt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Kt(e,t){var i,n,r,s,o,l,c=e,d=null;return jt(e)?c={ms:e._milliseconds,d:e._days,M:e._months}:h(e)||!isNaN(+e)?(c={},t?c[t]=+e:c.milliseconds=+e):(d=Zt.exec(e))?(i="-"===d[1]?-1:1,c={y:0,d:fe(d[be])*i,h:fe(d[we])*i,m:fe(d[Se])*i,s:fe(d[Te])*i,ms:fe(Vt(1e3*d[ke]))*i}):(d=Jt.exec(e))?(i="-"===d[1]?-1:1,c={y:Qt(d[2],i),M:Qt(d[3],i),w:Qt(d[4],i),d:Qt(d[5],i),h:Qt(d[6],i),m:Qt(d[7],i),s:Qt(d[8],i)}):null==c?c={}:"object"==typeof c&&("from"in c||"to"in c)&&(s=zt(c.from),o=zt(c.to),r=s.isValid()&&o.isValid()?(o=Gt(o,s),s.isBefore(o)?l=ei(s,o):((l=ei(o,s)).milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0},(c={}).ms=r.milliseconds,c.M=r.months),n=new Ht(c),jt(e)&&a(e,"_locale")&&(n._locale=e._locale),jt(e)&&a(e,"_isValid")&&(n._isValid=e._isValid),n}function Qt(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function ei(e,t){var i={};return i.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+e.clone().add(i.months,"M"),i}function ti(e,t){return function(i,n){var r;return null===n||isNaN(+n)||(A(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=i,i=n,n=r),ii(this,Kt(i,n),e),this}}function ii(e,t,i,n){var s=t._milliseconds,o=Vt(t._days),a=Vt(t._months);e.isValid()&&(n=null==n||n,a&&He(e,Ie(e,"Month")+a*i),o&&Pe(e,"Date",Ie(e,"Date")+o*i),s&&e._d.setTime(e._d.valueOf()+s*i),n&&r.updateOffset(e,o||a))}Kt.fn=Ht.prototype,Kt.invalid=function(){return Kt(NaN)};var ni=ti(1,"add"),ri=ti(-1,"subtract");function si(e){return"string"==typeof e||e instanceof String}function oi(e){return w(e)||d(e)||si(e)||h(e)||function(e){var t=s(e),i=!1;return t&&(i=0===e.filter(function(t){return!h(t)&&si(e)}).length),t&&i}(e)||function(e){var t,i,n=o(e)&&!l(e),r=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],c=s.length;for(t=0;t<c;t+=1)i=s[t],r=r||a(e,i);return n&&r}(e)||null==e}function ai(e,t){if(e.date()<t.date())return-ai(t,e);var i=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(i,"months");return-(i+(t-n<0?(t-n)/(n-e.clone().add(i-1,"months")):(t-n)/(e.clone().add(i+1,"months")-n)))||0}function li(e){var t;return void 0===e?this._locale._abbr:(null!=(t=yt(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ci=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function hi(){return this._locale}var di=1e3,ui=6e4,fi=36e5,pi=126227808e5;function mi(e,t){return(e%t+t)%t}function gi(e,t,i){return e<100&&e>=0?new Date(e+400,t,i)-pi:new Date(e,t,i).valueOf()}function _i(e,t,i){return e<100&&e>=0?Date.UTC(e+400,t,i)-pi:Date.UTC(e,t,i)}function yi(e,t){return t.erasAbbrRegex(e)}function vi(){var e,t,i,n,r,s=[],o=[],a=[],l=[],c=this.eras();for(e=0,t=c.length;e<t;++e)i=de(c[e].name),n=de(c[e].abbr),r=de(c[e].narrow),o.push(i),s.push(n),a.push(r),l.push(i),l.push(n),l.push(r);this._erasRegex=new RegExp("^("+l.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+o.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}function xi(e,t){z(0,[e,e.length],0,t)}function bi(e,t,i,n,r){var s;return null==e?Xe(this,n,r).year:(t>(s=qe(e,n,r))&&(t=s),wi.call(this,e,t,i,n,r))}function wi(e,t,i,n,r){var s=Ge(e,t,i,n,r),o=Ue(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}z("N",0,0,"eraAbbr"),z("NN",0,0,"eraAbbr"),z("NNN",0,0,"eraAbbr"),z("NNNN",0,0,"eraName"),z("NNNNN",0,0,"eraNarrow"),z("y",["y",1],"yo","eraYear"),z("y",["yy",2],0,"eraYear"),z("y",["yyy",3],0,"eraYear"),z("y",["yyyy",4],0,"eraYear"),ce("N",yi),ce("NN",yi),ce("NNN",yi),ce("NNNN",function(e,t){return t.erasNameRegex(e)}),ce("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),me(["N","NN","NNN","NNNN","NNNNN"],function(e,t,i,n){var r=i._locale.erasParse(e,n,i._strict);r?m(i).era=r:m(i).invalidEra=e}),ce("y",ie),ce("yy",ie),ce("yyy",ie),ce("yyyy",ie),ce("yo",function(e,t){return t._eraYearOrdinalRegex||ie}),me(["y","yy","yyy","yyyy"],ve),me(["yo"],function(e,t,i,n){var r;i._locale._eraYearOrdinalRegex&&(r=e.match(i._locale._eraYearOrdinalRegex)),i._locale.eraYearOrdinalParse?t[ve]=i._locale.eraYearOrdinalParse(e,r):t[ve]=parseInt(e,10)}),z(0,["gg",2],0,function(){return this.weekYear()%100}),z(0,["GG",2],0,function(){return this.isoWeekYear()%100}),xi("gggg","weekYear"),xi("ggggg","weekYear"),xi("GGGG","isoWeekYear"),xi("GGGGG","isoWeekYear"),ce("G",ne),ce("g",ne),ce("GG",Z,$),ce("gg",Z,$),ce("GGGG",ee,X),ce("gggg",ee,X),ce("GGGGG",te,q),ce("ggggg",te,q),ge(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,n){t[n.substr(0,2)]=fe(e)}),ge(["gg","GG"],function(e,t,i,n){t[n]=r.parseTwoDigitYear(e)}),z("Q",0,"Qo","quarter"),ce("Q",U),me("Q",function(e,t){t[xe]=3*(fe(e)-1)}),z("D",["DD",2],"Do","date"),ce("D",Z,ae),ce("DD",Z,$),ce("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),me(["D","DD"],be),me("Do",function(e,t){t[be]=fe(e.match(Z)[0])});var Si=Ee("Date",!0);z("DDD",["DDDD",3],"DDDo","dayOfYear"),ce("DDD",Q),ce("DDDD",G),me(["DDD","DDDD"],function(e,t,i){i._dayOfYear=fe(e)}),z("m",["mm",2],0,"minute"),ce("m",Z,le),ce("mm",Z,$),me(["m","mm"],Se);var Ti=Ee("Minutes",!1);z("s",["ss",2],0,"second"),ce("s",Z,le),ce("ss",Z,$),me(["s","ss"],Te);var ki,Mi,Ai=Ee("Seconds",!1);for(z("S",0,0,function(){return~~(this.millisecond()/100)}),z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,function(){return 10*this.millisecond()}),z(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),z(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),z(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),z(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),z(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),ce("S",Q,U),ce("SS",Q,$),ce("SSS",Q,G),ki="SSSS";ki.length<=9;ki+="S")ce(ki,ie);function Ci(e,t){t[ke]=fe(1e3*("0."+e))}for(ki="S";ki.length<=9;ki+="S")me(ki,Ci);Mi=Ee("Milliseconds",!1),z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var Di=b.prototype;function Li(e){return e}Di.add=ni,Di.calendar=function(e,t){1===arguments.length&&(arguments[0]?oi(arguments[0])?(e=arguments[0],t=void 0):function(e){var t,i=o(e)&&!l(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<r.length;t+=1)n=n||a(e,r[t]);return i&&n}(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var i=e||zt(),n=Gt(i,this).startOf("day"),s=r.calendarFormat(this,n)||"sameElse",c=t&&(C(t[s])?t[s].call(this,i):t[s]);return this.format(c||this.localeData().calendar(s,this,zt(i)))},Di.clone=function(){return new b(this)},Di.diff=function(e,t,i){var n,r,s;if(!this.isValid())return NaN;if(!(n=Gt(e,this)).isValid())return NaN;switch(r=6e4*(n.utcOffset()-this.utcOffset()),t=H(t)){case"year":s=ai(this,n)/12;break;case"month":s=ai(this,n);break;case"quarter":s=ai(this,n)/3;break;case"second":s=(this-n)/1e3;break;case"minute":s=(this-n)/6e4;break;case"hour":s=(this-n)/36e5;break;case"day":s=(this-n-r)/864e5;break;case"week":s=(this-n-r)/6048e5;break;default:s=this-n}return i?s:ue(s)},Di.endOf=function(e){var t,i;if(void 0===(e=H(e))||"millisecond"===e||!this.isValid())return this;switch(i=this._isUTC?_i:gi,e){case"year":t=i(this.year()+1,0,1)-1;break;case"quarter":t=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=i(this.year(),this.month()+1,1)-1;break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=fi-mi(t+(this._isUTC?0:this.utcOffset()*ui),fi)-1;break;case"minute":t=this._d.valueOf(),t+=ui-mi(t,ui)-1;break;case"second":t=this._d.valueOf(),t+=di-mi(t,di)-1}return this._d.setTime(t),r.updateOffset(this,!0),this},Di.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=N(this,e);return this.localeData().postformat(t)},Di.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||zt(e).isValid())?Kt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Di.fromNow=function(e){return this.from(zt(),e)},Di.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||zt(e).isValid())?Kt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Di.toNow=function(e){return this.to(zt(),e)},Di.get=function(e){return C(this[e=H(e)])?this[e]():this},Di.invalidAt=function(){return m(this).overflow},Di.isAfter=function(e,t){var i=w(e)?e:zt(e);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf())},Di.isBefore=function(e,t){var i=w(e)?e:zt(e);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf())},Di.isBetween=function(e,t,i,n){var r=w(e)?e:zt(e),s=w(t)?t:zt(t);return!!(this.isValid()&&r.isValid()&&s.isValid())&&("("===(n=n||"()")[0]?this.isAfter(r,i):!this.isBefore(r,i))&&(")"===n[1]?this.isBefore(s,i):!this.isAfter(s,i))},Di.isSame=function(e,t){var i,n=w(e)?e:zt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf()))},Di.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},Di.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},Di.isValid=function(){return g(this)},Di.lang=ci,Di.locale=li,Di.localeData=hi,Di.max=Nt,Di.min=Ft,Di.parsingFlags=function(){return f({},m(this))},Di.set=function(e,t){if("object"==typeof e){var i,n=function(e){var t,i=[];for(t in e)a(e,t)&&i.push({unit:t,priority:V[t]});return i.sort(function(e,t){return e.priority-t.priority}),i}(e=j(e)),r=n.length;for(i=0;i<r;i++)this[n[i].unit](e[n[i].unit])}else if(C(this[e=H(e)]))return this[e](t);return this},Di.startOf=function(e){var t,i;if(void 0===(e=H(e))||"millisecond"===e||!this.isValid())return this;switch(i=this._isUTC?_i:gi,e){case"year":t=i(this.year(),0,1);break;case"quarter":t=i(this.year(),this.month()-this.month()%3,1);break;case"month":t=i(this.year(),this.month(),1);break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=i(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=mi(t+(this._isUTC?0:this.utcOffset()*ui),fi);break;case"minute":t=this._d.valueOf(),t-=mi(t,ui);break;case"second":t=this._d.valueOf(),t-=mi(t,di)}return this._d.setTime(t),r.updateOffset(this,!0),this},Di.subtract=ri,Di.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},Di.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},Di.toDate=function(){return new Date(this.valueOf())},Di.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,i=t?this.clone().utc():this;return i.year()<0||i.year()>9999?N(i,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):C(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",N(i,"Z")):N(i,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Di.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,i,n="moment",r="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",r="Z"),e="["+n+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=r+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+i)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(Di[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Di.toJSON=function(){return this.isValid()?this.toISOString():null},Di.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Di.unix=function(){return Math.floor(this.valueOf()/1e3)},Di.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Di.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Di.eraName=function(){var e,t,i,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(i=this.clone().startOf("day").valueOf(),n[e].since<=i&&i<=n[e].until)return n[e].name;if(n[e].until<=i&&i<=n[e].since)return n[e].name}return""},Di.eraNarrow=function(){var e,t,i,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(i=this.clone().startOf("day").valueOf(),n[e].since<=i&&i<=n[e].until)return n[e].narrow;if(n[e].until<=i&&i<=n[e].since)return n[e].narrow}return""},Di.eraAbbr=function(){var e,t,i,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(i=this.clone().startOf("day").valueOf(),n[e].since<=i&&i<=n[e].until)return n[e].abbr;if(n[e].until<=i&&i<=n[e].since)return n[e].abbr}return""},Di.eraYear=function(){var e,t,i,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(i=s[e].since<=s[e].until?1:-1,n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return(this.year()-r(s[e].since).year())*i+s[e].offset;return this.year()},Di.year=Le,Di.isLeapYear=function(){return ye(this.year())},Di.weekYear=function(e){return bi.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},Di.isoWeekYear=function(e){return bi.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Di.quarter=Di.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Di.month=je,Di.daysInMonth=function(){return Re(this.year(),this.month())},Di.week=Di.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Di.isoWeek=Di.isoWeeks=function(e){var t=Xe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Di.weeksInYear=function(){var e=this.localeData()._week;return qe(this.year(),e.dow,e.doy)},Di.weeksInWeekYear=function(){var e=this.localeData()._week;return qe(this.weekYear(),e.dow,e.doy)},Di.isoWeeksInYear=function(){return qe(this.year(),1,4)},Di.isoWeeksInISOWeekYear=function(){return qe(this.isoWeekYear(),1,4)},Di.date=Si,Di.day=Di.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=Ie(this,"Day");return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},Di.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},Di.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},Di.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},Di.hour=Di.hours=lt,Di.minute=Di.minutes=Ti,Di.second=Di.seconds=Ai,Di.millisecond=Di.milliseconds=Mi,Di.utcOffset=function(e,t,i){var n,s=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=$t(se,e)))return this}else Math.abs(e)<16&&!i&&(e*=60);return!this._isUTC&&t&&(n=Xt(this)),this._offset=e,this._isUTC=!0,null!=n&&this.add(n,"m"),s!==e&&(!t||this._changeInProgress?ii(this,Kt(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:Xt(this)},Di.utc=function(e){return this.utcOffset(0,e)},Di.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Xt(this),"m")),this},Di.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=$t(re,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},Di.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?zt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},Di.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Di.isLocal=function(){return!!this.isValid()&&!this._isUTC},Di.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Di.isUtc=qt,Di.isUTC=qt,Di.zoneAbbr=function(){return this._isUTC?"UTC":""},Di.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Di.dates=T("dates accessor is deprecated. Use date instead.",Si),Di.months=T("months accessor is deprecated. Use month instead",je),Di.years=T("years accessor is deprecated. Use year instead",Le),Di.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),Di.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!c(this._isDSTShifted))return this._isDSTShifted;var e,t={};return x(t,this),(t=Rt(t))._a?(e=t._isUTC?p(t._a):zt(t._a),this._isDSTShifted=this.isValid()&&function(e,t,i){var n,r=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),o=0;for(n=0;n<r;n++)(i&&e[n]!==t[n]||!i&&fe(e[n])!==fe(t[n]))&&o++;return o+s}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var Ei=L.prototype;function Ii(e,t,i,n){var r=yt(),s=p().set(n,t);return r[i](s,e)}function Pi(e,t,i){if(h(e)&&(t=e,e=void 0),e=e||"",null!=t)return Ii(e,t,i,"month");var n,r=[];for(n=0;n<12;n++)r[n]=Ii(e,n,i,"month");return r}function Ri(e,t,i,n){"boolean"==typeof e?(h(t)&&(i=t,t=void 0),t=t||""):(i=t=e,e=!1,h(t)&&(i=t,t=void 0),t=t||"");var r,s=yt(),o=e?s._week.dow:0,a=[];if(null!=i)return Ii(t,(i+o)%7,n,"day");for(r=0;r<7;r++)a[r]=Ii(t,(r+o)%7,n,"day");return a}Ei.calendar=function(e,t,i){var n=this._calendar[e]||this._calendar.sameElse;return C(n)?n.call(t,i):n},Ei.longDateFormat=function(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return t||!i?t:(this._longDateFormat[e]=i.match(I).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},Ei.invalidDate=function(){return this._invalidDate},Ei.ordinal=function(e){return this._ordinal.replace("%d",e)},Ei.preparse=Li,Ei.postformat=Li,Ei.relativeTime=function(e,t,i,n){var r=this._relativeTime[i];return C(r)?r(e,t,i,n):r.replace(/%d/i,e)},Ei.pastFuture=function(e,t){var i=this._relativeTime[e>0?"future":"past"];return C(i)?i(t):i.replace(/%s/i,t)},Ei.set=function(e){var t,i;for(i in e)a(e,i)&&(C(t=e[i])?this[i]=t:this["_"+i]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Ei.eras=function(e,t){var i,n,s,o=this._eras||yt("en")._eras;for(i=0,n=o.length;i<n;++i)switch("string"==typeof o[i].since&&(s=r(o[i].since).startOf("day"),o[i].since=s.valueOf()),typeof o[i].until){case"undefined":o[i].until=1/0;break;case"string":s=r(o[i].until).startOf("day").valueOf(),o[i].until=s.valueOf()}return o},Ei.erasParse=function(e,t,i){var n,r,s,o,a,l=this.eras();for(e=e.toUpperCase(),n=0,r=l.length;n<r;++n)if(s=l[n].name.toUpperCase(),o=l[n].abbr.toUpperCase(),a=l[n].narrow.toUpperCase(),i)switch(t){case"N":case"NN":case"NNN":if(o===e)return l[n];break;case"NNNN":if(s===e)return l[n];break;case"NNNNN":if(a===e)return l[n]}else if([s,o,a].indexOf(e)>=0)return l[n]},Ei.erasConvertYear=function(e,t){var i=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*i},Ei.erasAbbrRegex=function(e){return a(this,"_erasAbbrRegex")||vi.call(this),e?this._erasAbbrRegex:this._erasRegex},Ei.erasNameRegex=function(e){return a(this,"_erasNameRegex")||vi.call(this),e?this._erasNameRegex:this._erasRegex},Ei.erasNarrowRegex=function(e){return a(this,"_erasNarrowRegex")||vi.call(this),e?this._erasNarrowRegex:this._erasRegex},Ei.months=function(e,t){return e?s(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Fe).test(t)?"format":"standalone"][e.month()]:s(this._months)?this._months:this._months.standalone},Ei.monthsShort=function(e,t){return e?s(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Fe.test(t)?"format":"standalone"][e.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Ei.monthsParse=function(e,t,i){var n,r,s;if(this._monthsParseExact)return Be.call(this,e,t,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(r=p([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(s="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[n]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(i&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!i&&this._monthsParse[n].test(e))return n}},Ei.monthsRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Ve.call(this),e?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=Ye),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Ei.monthsShortRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Ve.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=Ne),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Ei.week=function(e){return Xe(e,this._week.dow,this._week.doy).week},Ei.firstDayOfYear=function(){return this._week.doy},Ei.firstDayOfWeek=function(){return this._week.dow},Ei.weekdays=function(e,t){var i=s(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ze(i,this._week.dow):e?i[e.day()]:i},Ei.weekdaysMin=function(e){return!0===e?Ze(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Ei.weekdaysShort=function(e){return!0===e?Ze(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Ei.weekdaysParse=function(e,t,i){var n,r,s;if(this._weekdaysParseExact)return nt.call(this,e,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(r=p([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[n]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(i&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(i&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!i&&this._weekdaysParse[n].test(e))return n}},Ei.weekdaysRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||rt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=et),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Ei.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||rt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=tt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Ei.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||rt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=it),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Ei.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Ei.meridiem=function(e,t,i){return e>11?i?"pm":"PM":i?"am":"AM"},gt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===fe(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=T("moment.lang is deprecated. Use moment.locale instead.",gt),r.langData=T("moment.langData is deprecated. Use moment.localeData instead.",yt);var Oi=Math.abs;function zi(e,t,i,n){var r=Kt(t,i);return e._milliseconds+=n*r._milliseconds,e._days+=n*r._days,e._months+=n*r._months,e._bubble()}function Fi(e){return e<0?Math.floor(e):Math.ceil(e)}function Ni(e){return 4800*e/146097}function Yi(e){return 146097*e/4800}function Bi(e){return function(){return this.as(e)}}var Hi=Bi("ms"),ji=Bi("s"),Vi=Bi("m"),Wi=Bi("h"),Ui=Bi("d"),$i=Bi("w"),Gi=Bi("M"),Xi=Bi("Q"),qi=Bi("y"),Zi=Hi;function Ji(e){return function(){return this.isValid()?this._data[e]:NaN}}var Ki=Ji("milliseconds"),Qi=Ji("seconds"),en=Ji("minutes"),tn=Ji("hours"),nn=Ji("days"),rn=Ji("months"),sn=Ji("years");var on=Math.round,an={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ln(e,t,i,n,r){return r.relativeTime(t||1,!!i,e,n)}var cn=Math.abs;function hn(e){return(e>0)-(e<0)||+e}function dn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,i,n,r,s,o,a,l=cn(this._milliseconds)/1e3,c=cn(this._days),h=cn(this._months),d=this.asSeconds();return d?(e=ue(l/60),t=ue(e/60),l%=60,e%=60,i=ue(h/12),h%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",r=d<0?"-":"",s=hn(this._months)!==hn(d)?"-":"",o=hn(this._days)!==hn(d)?"-":"",a=hn(this._milliseconds)!==hn(d)?"-":"",r+"P"+(i?s+i+"Y":"")+(h?s+h+"M":"")+(c?o+c+"D":"")+(t||e||l?"T":"")+(t?a+t+"H":"")+(e?a+e+"M":"")+(l?a+n+"S":"")):"P0D"}var un=Ht.prototype;return un.isValid=function(){return this._isValid},un.abs=function(){var e=this._data;return this._milliseconds=Oi(this._milliseconds),this._days=Oi(this._days),this._months=Oi(this._months),e.milliseconds=Oi(e.milliseconds),e.seconds=Oi(e.seconds),e.minutes=Oi(e.minutes),e.hours=Oi(e.hours),e.months=Oi(e.months),e.years=Oi(e.years),this},un.add=function(e,t){return zi(this,e,t,1)},un.subtract=function(e,t){return zi(this,e,t,-1)},un.as=function(e){if(!this.isValid())return NaN;var t,i,n=this._milliseconds;if("month"===(e=H(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,i=this._months+Ni(t),e){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(t=this._days+Math.round(Yi(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}},un.asMilliseconds=Hi,un.asSeconds=ji,un.asMinutes=Vi,un.asHours=Wi,un.asDays=Ui,un.asWeeks=$i,un.asMonths=Gi,un.asQuarters=Xi,un.asYears=qi,un.valueOf=Zi,un._bubble=function(){var e,t,i,n,r,s=this._milliseconds,o=this._days,a=this._months,l=this._data;return s>=0&&o>=0&&a>=0||s<=0&&o<=0&&a<=0||(s+=864e5*Fi(Yi(a)+o),o=0,a=0),l.milliseconds=s%1e3,e=ue(s/1e3),l.seconds=e%60,t=ue(e/60),l.minutes=t%60,i=ue(t/60),l.hours=i%24,o+=ue(i/24),a+=r=ue(Ni(o)),o-=Fi(Yi(r)),n=ue(a/12),a%=12,l.days=o,l.months=a,l.years=n,this},un.clone=function(){return Kt(this)},un.get=function(e){return e=H(e),this.isValid()?this[e+"s"]():NaN},un.milliseconds=Ki,un.seconds=Qi,un.minutes=en,un.hours=tn,un.days=nn,un.weeks=function(){return ue(this.days()/7)},un.months=rn,un.years=sn,un.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var i,n,r=!1,s=an;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"==typeof t&&(s=Object.assign({},an,t),null!=t.s&&null==t.ss&&(s.ss=t.s-1)),n=function(e,t,i,n){var r=Kt(e).abs(),s=on(r.as("s")),o=on(r.as("m")),a=on(r.as("h")),l=on(r.as("d")),c=on(r.as("M")),h=on(r.as("w")),d=on(r.as("y")),u=s<=i.ss&&["s",s]||s<i.s&&["ss",s]||o<=1&&["m"]||o<i.m&&["mm",o]||a<=1&&["h"]||a<i.h&&["hh",a]||l<=1&&["d"]||l<i.d&&["dd",l];return null!=i.w&&(u=u||h<=1&&["w"]||h<i.w&&["ww",h]),(u=u||c<=1&&["M"]||c<i.M&&["MM",c]||d<=1&&["y"]||["yy",d])[2]=t,u[3]=+e>0,u[4]=n,ln.apply(null,u)}(this,!r,s,i=this.localeData()),r&&(n=i.pastFuture(+this,n)),i.postformat(n)},un.toISOString=dn,un.toString=dn,un.toJSON=dn,un.locale=li,un.localeData=hi,un.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",dn),un.lang=ci,z("X",0,0,"unix"),z("x",0,0,"valueOf"),ce("x",ne),ce("X",/[+-]?\d+(\.\d{1,3})?/),me("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e))}),me("x",function(e,t,i){i._d=new Date(fe(e))}),r.version="2.30.1",t=zt,r.fn=Di,r.min=function(){return Yt("isBefore",[].slice.call(arguments,0))},r.max=function(){return Yt("isAfter",[].slice.call(arguments,0))},r.now=function(){return Date.now?Date.now():+new Date},r.utc=p,r.unix=function(e){return zt(1e3*e)},r.months=function(e,t){return Pi(e,t,"months")},r.isDate=d,r.locale=gt,r.invalid=_,r.duration=Kt,r.isMoment=w,r.weekdays=function(e,t,i){return Ri(e,t,i,"weekdays")},r.parseZone=function(){return zt.apply(null,arguments).parseZone()},r.localeData=yt,r.isDuration=jt,r.monthsShort=function(e,t){return Pi(e,t,"monthsShort")},r.weekdaysMin=function(e,t,i){return Ri(e,t,i,"weekdaysMin")},r.defineLocale=_t,r.updateLocale=function(e,t){if(null!=t){var i,n,r=ht;null!=dt[e]&&null!=dt[e].parentLocale?dt[e].set(D(dt[e]._config,t)):(null!=(n=mt(e))&&(r=n._config),t=D(r,t),null==n&&(t.abbr=e),(i=new L(t)).parentLocale=dt[e],dt[e]=i),gt(e)}else null!=dt[e]&&(null!=dt[e].parentLocale?(dt[e]=dt[e].parentLocale,e===gt()&>(e)):null!=dt[e]&&delete dt[e]);return dt[e]},r.locales=function(){return k(dt)},r.weekdaysShort=function(e,t,i){return Ri(e,t,i,"weekdaysShort")},r.normalizeUnits=H,r.relativeTimeRounding=function(e){return void 0===e?on:"function"==typeof e&&(on=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==an[e]&&(void 0===t?an[e]:(an[e]=t,"s"===e&&(an.ss=t-1),!0))},r.calendarFormat=function(e,t){var i=e.diff(t,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},r.prototype=Di,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()},5096:function(e,t,i){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pzt_Sal_Çar_Per_Cum_Cmt".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,i){return e<12?i?"öö":"ÖÖ":i?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,i){switch(i){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(i(5093))},5128:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>d}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(8979);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(7604);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(271);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(5581);if(/^(7(06|92|96)|140)$/.test(i.j))var a=i(2063);if(/^(7(06|92|96)|140)$/.test(i.j))var l=i(2083);if(/^(7(06|92|96)|140)$/.test(i.j))var c=i(2398);function h(e){return(0,o.sb)(e)&&"fixed"!==(0,s.A)(e).position?e.offsetParent:null}function d(e){for(var t=(0,n.A)(e),i=h(e);i&&(0,a.A)(i)&&"static"===(0,s.A)(i).position;)i=h(i);return i&&("html"===(0,r.A)(i)||"body"===(0,r.A)(i)&&"static"===(0,s.A)(i).position)?t:i||function(e){var t=/firefox/i.test((0,c.A)());if(/Trident/i.test((0,c.A)())&&(0,o.sb)(e)&&"fixed"===(0,s.A)(e).position)return null;var i=(0,l.A)(e);for((0,o.Ng)(i)&&(i=i.host);(0,o.sb)(i)&&["html","body"].indexOf((0,r.A)(i))<0;){var n=(0,s.A)(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}},5177:function(e,t,i){!function(e){"use strict";e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,i){return e<12?i?"vm":"VM":i?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(i(5093))},5299:(e,t,i)=>{"use strict";i.d(t,{d5:()=>I});var n,r,s,o=i(172),a=[],l=[],c=o.fF.__b,h=o.fF.__r,d=o.fF.diffed,u=o.fF.__c,f=o.fF.unmount;function p(){for(var e;e=a.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(_),e.__H.__h.forEach(y),e.__H.__h=[]}catch(t){e.__H.__h=[],o.fF.__e(t,e.__v)}}o.fF.__b=function(e){n=null,c&&c(e)},o.fF.__r=function(e){h&&h(e);var t=(n=e.__c).__H;t&&(r===n?(t.__h=[],n.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=l,e.__N=e.i=void 0})):(t.__h.forEach(_),t.__h.forEach(y),t.__h=[])),r=n},o.fF.diffed=function(e){d&&d(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==a.push(t)&&s===o.fF.requestAnimationFrame||((s=o.fF.requestAnimationFrame)||g)(p)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==l&&(e.__=e.__V),e.i=void 0,e.__V=l})),r=n=null},o.fF.__c=function(e,t){t.some(function(e){try{e.__h.forEach(_),e.__h=e.__h.filter(function(e){return!e.__||y(e)})}catch(i){t.some(function(e){e.__h&&(e.__h=[])}),t=[],o.fF.__e(i,e.__v)}}),u&&u(e,t)},o.fF.unmount=function(e){f&&f(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach(function(e){try{_(e)}catch(e){t=e}}),i.__H=void 0,t&&o.fF.__e(t,i.__v))};var m="function"==typeof requestAnimationFrame;function g(e){var t,i=function(){clearTimeout(n),m&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(i,100);m&&(t=requestAnimationFrame(i))}function _(e){var t=n,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),n=t}function y(e){var t=n;e.__c=e.__(),n=t}function v(e,t){for(var i in e)if("__source"!==i&&!(i in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}function x(e){this.props=e}(x.prototype=new o.uA).isPureReactComponent=!0,x.prototype.shouldComponentUpdate=function(e,t){return v(this.props,e)||v(this.state,t)};var b=o.fF.__b;o.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),b&&b(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var w=(o.v2,o.fF.__e);o.fF.__e=function(e,t,i,n){if(e.then)for(var r,s=t;s=s.__;)if((r=s.__c)&&r.__c)return null==t.__e&&(t.__e=i.__e,t.__k=i.__k),r.__c(e,t);w(e,t,i,n)};var S=o.fF.unmount;function T(e,t,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var i in t)e[i]=t[i];return e}({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return T(e,t,i)})),e}function k(e,t,i){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return k(e,t,i)}),e.__c&&e.__c.__P===t&&(e.__e&&i.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=i)),e}function M(){this.__u=0,this.t=null,this.__b=null}function A(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function C(){this.u=null,this.o=null}o.fF.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),S&&S(e)},(M.prototype=new o.uA).__c=function(e,t){var i=t.__c,n=this;null==n.t&&(n.t=[]),n.t.push(i);var r=A(n.__v),s=!1,o=function(){s||(s=!0,i.__R=null,r?r(a):a())};i.__R=o;var a=function(){if(! --n.__u){if(n.state.__a){var e=n.state.__a;n.__v.__k[0]=k(e,e.__c.__P,e.__c.__O)}var t;for(n.setState({__a:n.__b=null});t=n.t.pop();)t.forceUpdate()}},l=!0===t.__h;n.__u++||l||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(o,o)},M.prototype.componentWillUnmount=function(){this.t=[]},M.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var i=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=T(this.__b,i,n.__O=n.__P)}this.__b=null}var r=t.__a&&(0,o.n)(o.FK,null,e.fallback);return r&&(r.__h=null),[(0,o.n)(o.FK,null,t.__a?null:e.children),r]};var D=function(e,t,i){if(++i[1]===i[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(i=e.u;i;){for(;i.length>3;)i.pop()();if(i[1]<i[0])break;e.u=i=i[2]}};function L(e){return this.getChildContext=function(){return e.context},e.children}function E(e){var t=this,i=e.i;t.componentWillUnmount=function(){(0,o.XX)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==i&&t.componentWillUnmount(),e.__v?(t.l||(t.i=i,t.l={nodeType:1,parentNode:i,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,i){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,o.XX)((0,o.n)(L,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function I(e,t){var i=(0,o.n)(E,{__v:e,i:t});return i.containerInfo=t,i}(C.prototype=new o.uA).__a=function(e){var t=this,i=A(t.__v),n=t.o.get(e);return n[0]++,function(r){var s=function(){t.props.revealOrder?(n.push(r),D(t,e,n)):r()};i?i(s):s()}},C.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,o.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var i=t.length;i--;)this.o.set(t[i],this.u=[1,0,this.u]);return e.children},C.prototype.componentDidUpdate=C.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,i){D(e,i,t)})};var P="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,R=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,O="undefined"!=typeof document,z=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};o.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(o.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var F=o.fF.event;function N(){}function Y(){return this.cancelBubble}function B(){return this.defaultPrevented}o.fF.event=function(e){return F&&(e=F(e)),e.persist=N,e.isPropagationStopped=Y,e.isDefaultPrevented=B,e.nativeEvent=e};var H={configurable:!0,get:function(){return this.class}},j=o.fF.vnode;o.fF.vnode=function(e){var t=e.type,i=e.props,n=i;if("string"==typeof t){var r=-1===t.indexOf("-");for(var s in n={},i){var a=i[s];O&&"children"===s&&"noscript"===t||"value"===s&&"defaultValue"in i&&null==a||("defaultValue"===s&&"value"in i&&null==i.value?s="value":"download"===s&&!0===a?a="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+t)&&!z(i.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():r&&R.test(s)?s=s.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===a&&(a=void 0),/^oninput$/i.test(s)&&(s=s.toLowerCase(),n[s]&&(s="oninputCapture")),n[s]=a)}"select"==t&&n.multiple&&Array.isArray(n.value)&&(n.value=(0,o.v2)(i.children).forEach(function(e){e.props.selected=-1!=n.value.indexOf(e.props.value)})),"select"==t&&null!=n.defaultValue&&(n.value=(0,o.v2)(i.children).forEach(function(e){e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value})),e.props=n,i.class!=i.className&&(H.enumerable="className"in i,null!=i.className&&(n.class=i.className),Object.defineProperty(n,"className",H))}e.$$typeof=P,j&&j(e)};var V=o.fF.__r;o.fF.__r=function(e){V&&V(e),e.__c},o.FK,o.n,o.q6,o._3,o.FK,o.uA},5446:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>r}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(5581);function r(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&(0,n.Ng)(i)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}},5487:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>a}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(8979);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(9760);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(793);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(2283);function a(e,t){var i=(0,n.A)(e),a=(0,r.A)(e),l=i.visualViewport,c=a.clientWidth,h=a.clientHeight,d=0,u=0;if(l){c=l.width,h=l.height;var f=(0,o.A)();(f||!f&&"fixed"===t)&&(d=l.offsetLeft,u=l.offsetTop)}return{width:c,height:h,x:d+(0,s.A)(e),y:u}}},5498:function(e,t,i){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,i=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(i(5093))},5533:function(e,t,i){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,i){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var i=e%10;return e+(t[i]||t[e%100-i]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(i(5093))},5543:function(e,t,i){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(i(5093))},5581:(e,t,i)=>{"use strict";if(i.d(t,{Ng:()=>o,sb:()=>s,vq:()=>r}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(8979);function r(e){return e instanceof(0,n.A)(e).Element||e instanceof Element}function s(e){return e instanceof(0,n.A)(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof(0,n.A)(e).ShadowRoot||e instanceof ShadowRoot)}},5668:(e,t,i)=>{"use strict";i.d(t,{A:()=>ri});var n,r,s,o,a=i(4692),l=i(9875),c=a,h=function(e,t){if(h.factory(e,t))return h;if(this instanceof h)return c(e).DataTable(t);var i=this,n=void 0===(t=e),s=this.length;return n&&(t={}),this.api=function(){return new r(this)},this.each(function(){var e,o=s>1?tt({},t,!0):t,a=0,l=this.getAttribute("id"),d=h.defaults,u=c(this);if("table"==this.nodeName.toLowerCase()){o.on&&o.on.options&&ht(u,"options",o.on.options),u.trigger("options.dt",o),z(d),F(d.column),R(d,d,!0),R(d.column,d.column,!0),R(d,c.extend(o,dt(u.data())),!0);var f=h.settings;for(a=0,e=f.length;a<e;a++){var p=f[a];if(p.nTable==this||p.nTHead&&p.nTHead.parentNode==this||p.nTFoot&&p.nTFoot.parentNode==this){var m=void 0!==o.bRetrieve?o.bRetrieve:d.bRetrieve,g=void 0!==o.bDestroy?o.bDestroy:d.bDestroy;if(n||m)return p.oInstance;if(g){new h.Api(p).destroy();break}return void Qe(p,0,"Cannot reinitialise DataTable",3)}if(p.sTableId==this.id){f.splice(a,1);break}}null!==l&&""!==l||(l="DataTables_Table_"+h.ext._unique++,this.id=l);var _=c.extend(!0,{},h.models.oSettings,{sDestroyWidth:u[0].style.width,sInstance:l,sTableId:l,colgroup:c("<colgroup>").prependTo(this),fastData:function(e,t,i){return Q(_,e,t,i)}});_.nTable=this,_.oInit=o,f.push(_),_.api=new r(_),_.oInstance=1===i.length?i:u.dataTable(),z(o),o.aLengthMenu&&!o.iDisplayLength&&(o.iDisplayLength=Array.isArray(o.aLengthMenu[0])?o.aLengthMenu[0][0]:c.isPlainObject(o.aLengthMenu[0])?o.aLengthMenu[0].value:o.aLengthMenu[0]),o=tt(c.extend(!0,{},d),o),et(_.oFeatures,o,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]),et(_,o,["ajax","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","iStateDuration","bSortCellsTop","iTabIndex","sDom","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId","caption","layout","orderDescReverse","orderIndicators","orderHandler","titleRow","typeDetect",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]),et(_.oScroll,o,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]),et(_.oLanguage,o,"fnInfoCallback"),nt(_,"aoDrawCallback",o.fnDrawCallback),nt(_,"aoStateSaveParams",o.fnStateSaveParams),nt(_,"aoStateLoadParams",o.fnStateLoadParams),nt(_,"aoStateLoaded",o.fnStateLoaded),nt(_,"aoRowCallback",o.fnRowCallback),nt(_,"aoRowCreatedCallback",o.fnCreatedRow),nt(_,"aoHeaderCallback",o.fnHeaderCallback),nt(_,"aoFooterCallback",o.fnFooterCallback),nt(_,"aoInitComplete",o.fnInitComplete),nt(_,"aoPreDrawCallback",o.fnPreDrawCallback),_.rowIdFn=re(o.rowId),o.on&&Object.keys(o.on).forEach(function(e){ht(u,e,o.on[e])}),function(e){if(!h.__browser){var t={};h.__browser=t;var i=c("<div/>").css({position:"fixed",top:0,left:-1*window.pageXOffset,height:1,width:1,overflow:"hidden"}).append(c("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(c("<div/>").css({width:"100%",height:10}))).appendTo("body"),n=i.children(),r=n.children();t.barWidth=n[0].offsetWidth-n[0].clientWidth,t.bScrollbarLeft=1!==Math.round(r.offset().left),i.remove()}c.extend(e.oBrowser,h.__browser),e.oScroll.iBarWidth=h.__browser.barWidth}(_);var y=_.oClasses;c.extend(y,h.ext.classes,o.oClasses),u.addClass(y.table),_.oFeatures.bPaginate||(o.iDisplayStart=0),void 0===_.iInitDisplayStart&&(_.iInitDisplayStart=o.iDisplayStart,_._iDisplayStart=o.iDisplayStart);var v=o.iDeferLoading;if(null!==v){_.deferLoading=!0;var x=Array.isArray(v);_._iRecordsDisplay=x?v[0]:v,_._iRecordsTotal=x?v[1]:v}var b=[],w=this.getElementsByTagName("thead"),S=we(_,w[0]);if(o.aoColumns)b=o.aoColumns;else if(S.length)for(a=0,e=S[0].length;a<e;a++)b.push(null);for(a=0,e=b.length;a<e;a++)N(_);!function(e,t,i,n,r){var s,o,a,l,h,d,u,f=e.aoColumns;if(i)for(s=0,o=i.length;s<o;s++)i[s]&&i[s].name&&(f[s].sName=i[s].name);if(t)for(s=t.length-1;s>=0;s--){var p=void 0!==(u=t[s]).target?u.target:void 0!==u.targets?u.targets:u.aTargets;for(Array.isArray(p)||(p=[p]),a=0,l=p.length;a<l;a++){var m=p[a];if("number"==typeof m&&m>=0){for(;f.length<=m;)N(e);r(m,u)}else if("number"==typeof m&&m<0)r(f.length+m,u);else if("string"==typeof m)for(h=0,d=f.length;h<d;h++)"_all"===m?r(h,u):-1!==m.indexOf(":name")?f[h].sName===m.replace(":name","")&&r(h,u):n.forEach(function(e){if(e[h]){var t=c(e[h].cell);m.match(/^[a-z][\w-]*$/i)&&(m="."+m),t.is(m)&&r(h,u)}})}}if(i)for(s=0,o=i.length;s<o;s++)r(s,i[s])}(_,o.aoColumnDefs,b,S,function(e,t){Y(_,e,t)});var T=u.children("tbody").find("tr:first-child").eq(0);if(T.length){var k=function(e,t){return null!==e.getAttribute("data-"+t)?t:null};c(T[0]).children("th, td").each(function(e,t){var i=_.aoColumns[e];if(i||Qe(_,0,"Incorrect column count",18),i.mData===e){var n=k(t,"sort")||k(t,"order"),r=k(t,"filter")||k(t,"search");null===n&&null===r||(i.mData={_:e+".display",sort:null!==n?e+".@data-"+n:void 0,type:null!==n?e+".@data-"+n:void 0,filter:null!==r?e+".@data-"+r:void 0},i._isArrayHost=!0,Y(_,e))}})}nt(_,"aoDrawCallback",Je);var M=_.oFeatures;if(o.bStateSave&&(M.bStateSave=!0),void 0===o.aaSorting){var A=_.aaSorting;for(a=0,e=A.length;a<e;a++)A[a][1]=_.aoColumns[a].asSorting[0]}qe(_),nt(_,"aoDrawCallback",function(){(_.bSorted||"ssp"===at(_)||M.bDeferRender)&&qe(_)});var C=u.children("caption");_.caption&&(0===C.length&&(C=c("<caption/>").appendTo(u)),C.html(_.caption)),C.length&&(C[0]._captionSide=C.css("caption-side"),_.captionNode=C[0]),0===w.length&&(w=c("<thead/>").appendTo(u)),_.nTHead=w[0];var D=u.children("tbody");0===D.length&&(D=c("<tbody/>").insertAfter(w)),_.nTBody=D[0];var L=u.children("tfoot");0===L.length&&(L=c("<tfoot/>").appendTo(u)),_.nTFoot=L[0],_.aiDisplay=_.aiDisplayMaster.slice(),_.bInitialised=!0;var E=_.oLanguage;c.extend(!0,E,o.oLanguage),E.sUrl?c.ajax({dataType:"json",url:E.sUrl,success:function(e){R(d.oLanguage,e),c.extend(!0,E,e,_.oInit.oLanguage),rt(_,null,"i18n",[_],!0),Ee(_)},error:function(){Qe(_,0,"i18n file loading error",21),Ee(_)}}):(rt(_,null,"i18n",[_],!0),Ee(_))}else Qe(null,0,"Non-table node initialisation ("+this.nodeName+")",2)}),i=null,this};h.ext=n={builder:"-source-",buttons:{},ccContent:{},classes:{},errMode:"alert",escape:{attributes:!1},feature:[],features:{},search:[],selector:{cell:[],column:[],row:[]},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{className:{},detect:[],render:{},search:{},order:{}},_unique:0,fnVersionCheck:h.fnVersionCheck,iApiIndex:0,sVersion:h.version},c.extend(n,{afnFiltering:n.search,aTypes:n.type.detect,ofnSearch:n.type.search,oSort:n.type.order,afnSortData:n.order,aoFeatures:n.feature,oStdClasses:n.classes,oPagination:n.pager}),c.extend(h.ext.classes,{container:"dt-container",empty:{row:"dt-empty"},info:{container:"dt-info"},layout:{row:"dt-layout-row",cell:"dt-layout-cell",tableRow:"dt-layout-table",tableCell:"",start:"dt-layout-start",end:"dt-layout-end",full:"dt-layout-full"},length:{container:"dt-length",select:"dt-input"},order:{canAsc:"dt-orderable-asc",canDesc:"dt-orderable-desc",isAsc:"dt-ordering-asc",isDesc:"dt-ordering-desc",none:"dt-orderable-none",position:"sorting_"},processing:{container:"dt-processing"},scrolling:{body:"dt-scroll-body",container:"dt-scroll",footer:{self:"dt-scroll-foot",inner:"dt-scroll-footInner"},header:{self:"dt-scroll-head",inner:"dt-scroll-headInner"}},search:{container:"dt-search",input:"dt-input"},table:"dataTable",tbody:{cell:"",row:""},thead:{cell:"",row:""},tfoot:{cell:"",row:""},paging:{active:"current",button:"dt-paging-button",container:"dt-paging",disabled:"disabled",nav:""}});var d={},u=/[\r\n\u2028]/g,f=/<([^>]*>)/g,p=Math.pow(2,28),m=/^\d{2,4}[./-]\d{1,2}[./-]\d{1,2}([T ]{1}\d{1,2}[:.]\d{2}([.:]\d{2})?)?$/,g=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),_=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,y=function(e){return!e||!0===e||"-"===e},v=function(e){var t=parseInt(e,10);return!isNaN(t)&&isFinite(e)?t:null},x=function(e,t){return d[t]||(d[t]=new RegExp(Ce(t),"g")),"string"==typeof e&&"."!==t?e.replace(/\./g,"").replace(d[t],"."):e},b=function(e,t,i,n){var r=typeof e,s="string"===r;return"number"===r||"bigint"===r||!(!n||!y(e))||(t&&s&&(e=x(e,t)),i&&s&&(e=e.replace(_,"")),!isNaN(parseFloat(e))&&isFinite(e))},w=function(e,t,i,n){if(n&&y(e))return!0;if("string"==typeof e&&e.match(/<(input|select)/i))return null;var r=function(e){return y(e)||"string"==typeof e}(e);return r&&!!b(A(e),t,i,n)||null},S=function(e,t,i){var n=[],r=0,s=e.length;if(void 0!==i)for(;r<s;r++)e[r]&&e[r][t]&&n.push(e[r][t][i]);else for(;r<s;r++)e[r]&&n.push(e[r][t]);return n},T=function(e,t,i,n){var r=[],s=0,o=t.length;if(void 0!==n)for(;s<o;s++)e[t[s]]&&e[t[s]][i]&&r.push(e[t[s]][i][n]);else for(;s<o;s++)e[t[s]]&&r.push(e[t[s]][i]);return r},k=function(e,t){var i,n=[];void 0===t?(t=0,i=e):(i=t,t=e);for(var r=t;r<i;r++)n.push(r);return n},M=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[i]&&t.push(e[i]);return t},A=function(e){if(!e||"string"!=typeof e)return e;if(e.length>p)throw new Error("Exceeded max str len");var t;e=e.replace(f,"");do{t=e,e=e.replace(/<script/i,"")}while(e!==t);return t},C=function(e){return Array.isArray(e)&&(e=e.join(",")),"string"==typeof e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):e},D=function(e,t){if("string"!=typeof e)return e;var i=e.normalize?e.normalize("NFD"):e;return i.length!==e.length?(!0===t?e+" ":"")+i.replace(/[\u0300-\u036f]/g,""):i},L=function(e){if(Array.from&&Set)return Array.from(new Set(e));if(function(e){if(e.length<2)return!0;for(var t=e.slice().sort(),i=t[0],n=1,r=t.length;n<r;n++){if(t[n]===i)return!1;i=t[n]}return!0}(e))return e.slice();var t,i,n,r=[],s=e.length,o=0;e:for(i=0;i<s;i++){for(t=e[i],n=0;n<o;n++)if(r[n]===t)continue e;r.push(t),o++}return r},E=function(e,t){if(Array.isArray(t))for(var i=0;i<t.length;i++)E(e,t[i]);else e.push(t);return e};function I(e,t){t&&t.split(" ").forEach(function(t){t&&e.classList.add(t)})}function P(e){var t,i,n={};c.each(e,function(r){(t=r.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(t[1]+" ")&&(i=r.replace(t[0],t[2].toLowerCase()),n[i]=r,"o"===t[1]&&P(e[r]))}),e._hungarianMap=n}function R(e,t,i){var n;e._hungarianMap||P(e),c.each(t,function(r){void 0===(n=e._hungarianMap[r])||!i&&void 0!==t[n]||("o"===n.charAt(0)?(t[n]||(t[n]={}),c.extend(!0,t[n],t[r]),R(e[n],t[n],i)):t[n]=t[r])})}h.util={diacritics:function(e,t){if("function"!=typeof e)return D(e,t);D=e},debounce:function(e,t){var i;return function(){var n=this,r=arguments;clearTimeout(i),i=setTimeout(function(){e.apply(n,r)},t||250)}},throttle:function(e,t){var i,n,r=void 0!==t?t:200;return function(){var t=this,s=+new Date,o=arguments;i&&s<i+r?(clearTimeout(n),n=setTimeout(function(){i=void 0,e.apply(t,o)},r)):(i=s,e.apply(t,o))}},escapeRegex:function(e){return e.replace(g,"\\$1")},set:function(e){if(c.isPlainObject(e))return h.util.set(e._);if(null===e)return function(){};if("function"==typeof e)return function(t,i,n){e(t,"set",i,n)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,i){t[e]=i};var t=function(e,i,n){for(var r,s,o,a,l,c=ne(n),h=c[c.length-1],d=0,u=c.length-1;d<u;d++){if("__proto__"===c[d]||"constructor"===c[d])throw new Error("Cannot set prototype values");if(s=c[d].match(te),o=c[d].match(ie),s){if(c[d]=c[d].replace(te,""),e[c[d]]=[],(r=c.slice()).splice(0,d+1),l=r.join("."),Array.isArray(i))for(var f=0,p=i.length;f<p;f++)t(a={},i[f],l),e[c[d]].push(a);else e[c[d]]=i;return}o&&(c[d]=c[d].replace(ie,""),e=e[c[d]](i)),null!==e[c[d]]&&void 0!==e[c[d]]||(e[c[d]]={}),e=e[c[d]]}h.match(ie)?e=e[h.replace(ie,"")](i):e[h.replace(te,"")]=i};return function(i,n){return t(i,n,e)}},get:function(e){if(c.isPlainObject(e)){var t={};return c.each(e,function(e,i){i&&(t[e]=h.util.get(i))}),function(e,i,n,r){var s=t[i]||t._;return void 0!==s?s(e,i,n,r):e}}if(null===e)return function(e){return e};if("function"==typeof e)return function(t,i,n,r){return e(t,i,n,r)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t){return t[e]};var i=function(e,t,n){var r,s,o,a;if(""!==n)for(var l=ne(n),c=0,h=l.length;c<h;c++){if(r=l[c].match(te),s=l[c].match(ie),r){if(l[c]=l[c].replace(te,""),""!==l[c]&&(e=e[l[c]]),o=[],l.splice(0,c+1),a=l.join("."),Array.isArray(e))for(var d=0,u=e.length;d<u;d++)o.push(i(e[d],t,a));var f=r[0].substring(1,r[0].length-1);e=""===f?o:o.join(f);break}if(s)l[c]=l[c].replace(ie,""),e=e[l[c]]();else{if(null===e||null===e[l[c]])return null;if(void 0===e||void 0===e[l[c]])return;e=e[l[c]]}}return e};return function(t,n){return i(t,n,e)}},stripHtml:function(e){var t=typeof e;if("function"!==t)return"string"===t?A(e):e;A=e},escapeHtml:function(e){var t=typeof e;if("function"!==t)return"string"===t||Array.isArray(e)?C(e):e;C=e},unique:L};var O=function(e,t,i){void 0!==e[t]&&(e[i]=e[t])};function z(e){O(e,"ordering","bSort"),O(e,"orderMulti","bSortMulti"),O(e,"orderClasses","bSortClasses"),O(e,"orderCellsTop","bSortCellsTop"),O(e,"order","aaSorting"),O(e,"orderFixed","aaSortingFixed"),O(e,"paging","bPaginate"),O(e,"pagingType","sPaginationType"),O(e,"pageLength","iDisplayLength"),O(e,"searching","bFilter"),"boolean"==typeof e.sScrollX&&(e.sScrollX=e.sScrollX?"100%":""),"boolean"==typeof e.scrollX&&(e.scrollX=e.scrollX?"100%":""),"object"==typeof e.bSort?(e.orderIndicators=void 0===e.bSort.indicators||e.bSort.indicators,e.orderHandler=void 0===e.bSort.handler||e.bSort.handler,e.bSort=!0):!1===e.bSort?(e.orderIndicators=!1,e.orderHandler=!1):!0===e.bSort&&(e.orderIndicators=!0,e.orderHandler=!0),"boolean"==typeof e.bSortCellsTop&&(e.titleRow=e.bSortCellsTop);var t=e.aoSearchCols;if(t)for(var i=0,n=t.length;i<n;i++)t[i]&&R(h.models.oSearch,t[i]);e.serverSide&&!e.searchDelay&&(e.searchDelay=400)}function F(e){O(e,"orderable","bSortable"),O(e,"orderData","aDataSort"),O(e,"orderSequence","asSorting"),O(e,"orderDataType","sortDataType");var t=e.aDataSort;"number"!=typeof t||Array.isArray(t)||(e.aDataSort=[t])}function N(e){var t=h.defaults.column,i=e.aoColumns.length,n=c.extend({},h.models.oColumn,t,{aDataSort:t.aDataSort?t.aDataSort:[i],mData:t.mData?t.mData:i,idx:i,searchFixed:{},colEl:c("<col>").attr("data-dt-column",i)});e.aoColumns.push(n);var r=e.aoPreSearchCols;r[i]=c.extend({},h.models.oSearch,r[i])}function Y(e,t,i){var n=e.aoColumns[t];if(null!=i){F(i),R(h.defaults.column,i,!0),void 0===i.mDataProp||i.mData||(i.mData=i.mDataProp),i.sType&&(n._sManualType=i.sType),i.className&&!i.sClass&&(i.sClass=i.className);var r=n.sClass;c.extend(n,i),et(n,i,"sWidth","sWidthOrig"),r!==n.sClass&&(n.sClass=r+" "+n.sClass),void 0!==i.iDataSort&&(n.aDataSort=[i.iDataSort]),et(n,i,"aDataSort")}var s=n.mData,o=re(s);if(n.mRender&&Array.isArray(n.mRender)){var a=n.mRender.slice(),l=a.shift();n.mRender=h.render[l].apply(window,a)}n._render=n.mRender?re(n.mRender):null;var d=function(e){return"string"==typeof e&&-1!==e.indexOf("@")};n._bAttrSrc=c.isPlainObject(s)&&(d(s.sort)||d(s.type)||d(s.filter)),n._setter=null,n.fnGetData=function(e,t,i){var r=o(e,t,void 0,i);return n._render&&t?n._render(r,t,e,i):r},n.fnSetData=function(e,t,i){return se(s)(e,t,i)},"number"==typeof s||n._isArrayHost||(e._rowReadObject=!0),e.oFeatures.bSort||(n.bSortable=!1)}function B(e){!function(e){if(e.oFeatures.bAutoWidth){var t,i,r,s=e.nTable,o=e.aoColumns,a=e.oScroll,l=a.sY,d=a.sX,u=a.sXInner,f=W(e,"bVisible"),p=s.getAttribute("width"),m=s.parentNode,g=s.style.width,_=Ye(e);if(_===e.containerWidth)return!1;e.containerWidth=_,g||p||(s.style.width="100%",g="100%"),g&&-1!==g.indexOf("%")&&(p=g),rt(e,null,"column-calc",{visible:f},!1);var y=c(s.cloneNode()).css("visibility","hidden").removeAttr("id");y.append("<tbody/>");var v=c("<tr/>").appendTo(y.find("tbody"));for(y.append(c(e.nTHead).clone()).append(c(e.nTFoot).clone()),y.find("tfoot th, tfoot td").css("width",""),y.find("thead th, thead td").each(function(){var t=q(e,this,!0,!1);t?(this.style.width=t,d&&(this.style.minWidth=t,c(this).append(c("<div/>").css({width:t,margin:0,padding:0,border:0,height:1})))):this.style.width=""}),t=0;t<f.length;t++){i=o[r=f[t]];var x=Be(e,r),b=n.type.className[i.sType],w=x+i.sContentPadding,S=-1===x.indexOf("<")?document.createTextNode(w):w;c("<td/>").addClass(b).addClass(i.sClass).append(S).appendTo(v)}c("[name]",y).removeAttr("name");var T=c("<div/>").css(d||l?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(y).appendTo(m);d&&u?y.width(u):d?(y.css("width","auto"),y.removeAttr("width"),y.outerWidth()<m.clientWidth&&p&&y.outerWidth(m.clientWidth)):l?y.outerWidth(m.clientWidth):p&&y.outerWidth(p);var k=0,M=y.find("tbody tr").eq(0).children();for(t=0;t<f.length;t++){var A=M[t].getBoundingClientRect().width;k+=A,o[f[t]].sWidth=He(A)}if(s.style.width=He(k),T.remove(),p&&(s.style.width=He(p)),(p||d)&&!e._reszEvt){var C=h.util.throttle(function(){var t=Ye(e);e.bDestroying||0===t||B(e)});if(window.ResizeObserver){var D=c(e.nTableWrapper).is(":visible"),L=c("<div>").css({width:"100%",height:0}).addClass("dt-autosize").appendTo(e.nTableWrapper);e.resizeObserver=new ResizeObserver(function(e){D?D=!1:C()}),e.resizeObserver.observe(L[0])}else c(window).on("resize.DT-"+e.sInstance,C);e._reszEvt=!0}}}(e),function(e){for(var t=e.aoColumns,i=0;i<t.length;i++){var n=q(e,[i],!1,!1);t[i].colEl.css("width",n),e.oScroll.sX&&t[i].colEl.css("min-width",n)}}(e);var t=e.oScroll;""===t.sY&&""===t.sX||Ne(e),rt(e,null,"column-sizing",[e])}function H(e,t){var i=W(e,"bVisible");return"number"==typeof i[t]?i[t]:null}function j(e,t){var i=W(e,"bVisible").indexOf(t);return-1!==i?i:null}function V(e){var t=e.aoHeader,i=e.aoColumns,n=0;if(t.length)for(var r=0,s=t[0].length;r<s;r++)i[r].bVisible&&"none"!==c(t[0][r].cell).css("display")&&n++;return n}function W(e,t){var i=[];return e.aoColumns.map(function(e,n){e[t]&&i.push(n)}),i}function U(e,t){return!0===t?e._name:t}function $(e){var t,i,r,s,o,a,l,c,d,u=e.aoColumns,f=e.aoData,p=h.ext.type.detect;for(t=0,i=u.length;t<i;t++){if(d=[],!(l=u[t]).sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){if(!e.typeDetect)return;for(r=0,s=p.length;r<s;r++){var m=p[r],g=m.oneOf,_=m.allOf||m,v=m.init,x=!1;if(c=null,v&&(c=U(m,v(e,l,t)))){l.sType=c;break}for(o=0,a=f.length;o<a;o++)if(f[o]){if(void 0===d[o]&&(d[o]=Q(e,o,t,"type")),g&&!x&&(x=U(m,g(d[o],e))),!(c=U(m,_(d[o],e)))&&r!==p.length-3)break;if("html"===c&&!y(d[o]))break}if(g&&x&&c||!g&&c){l.sType=c;break}}l.sType||(l.sType="string")}var b=n.type.className[l.sType];b&&(X(e.aoHeader,t,b),X(e.aoFooter,t,b));var w=n.type.render[l.sType];w&&!l._render&&(l._render=h.util.get(w),G(e,t))}}function G(e,t){for(var i=e.aoData,n=0;n<i.length;n++)if(i[n].nTr){var r=Q(e,n,t,"display");i[n].displayData[t]=r,ee(i[n].anCells[t],r)}}function X(e,t,i){e.forEach(function(e){e[t]&&e[t].unique&&I(e[t].cell,i)})}function q(e,t,i,n){Array.isArray(t)||(t=Z(t));for(var r,s=0,o=e.aoColumns,a=0,l=t.length;a<l;a++){var c=o[t[a]],h=i?c.sWidthOrig:c.sWidth;if(n||!1!==c.bVisible){if(null==h)return null;if("number"==typeof h)r="px",s+=h;else{var d=h.match(/([\d\.]+)([^\d]*)/);d&&(s+=1*d[1],r=3===d.length?d[2]:"px")}}}return s+r}function Z(e){var t=c(e).closest("[data-dt-column]").attr("data-dt-column");return t?t.split(",").map(function(e){return 1*e}):[]}function J(e,t,i,n){var r=e.aoData.length,s=c.extend(!0,{},h.models.oRow,{src:i?"dom":"data",idx:r});s._aData=t,e.aoData.push(s);for(var o=e.aoColumns,a=0,l=o.length;a<l;a++)o[a].sType=null;e.aiDisplayMaster.push(r);var d=e.rowIdFn(t);return void 0!==d&&(e.aIds[d]=s),!i&&e.oFeatures.bDeferRender||de(e,r,i,n),r}function K(e,t){var i;return t instanceof c||(t=c(t)),t.map(function(t,n){return i=ce(e,n),J(e,i.data,n,i.cells)})}function Q(e,t,i,n){"search"===n?n="filter":"order"===n&&(n="sort");var r=e.aoData[t];if(r){var s=e.iDraw,o=e.aoColumns[i],a=r._aData,l=o.sDefaultContent,c=o.fnGetData(a,n,{settings:e,row:t,col:i});if("display"!==n&&c&&"object"==typeof c&&c.nodeName&&(c=c.innerHTML),void 0===c)return e.iDrawError!=s&&null===l&&(Qe(e,0,"Requested unknown parameter "+("function"==typeof o.mData?"{function}":"'"+o.mData+"'")+" for row "+t+", column "+i,4),e.iDrawError=s),l;if(c!==a&&null!==c||null===l||void 0===n){if("function"==typeof c)return c.call(a)}else c=l;if(null===c&&"display"===n)return"";if("filter"===n){var d=h.ext.type.search;d[o.sType]&&(c=d[o.sType](c))}return c}}function ee(e,t){t&&"object"==typeof t&&t.nodeName?c(e).empty().append(t):e.innerHTML=t}var te=/\[.*?\]$/,ie=/\(\)$/;function ne(e){return(e.match(/(\\.|[^.])+/g)||[""]).map(function(e){return e.replace(/\\\./g,".")})}var re=h.util.get,se=h.util.set;function oe(e){return S(e.aoData,"_aData")}function ae(e){e.aoData.length=0,e.aiDisplayMaster.length=0,e.aiDisplay.length=0,e.aIds={}}function le(e,t,i,n){var r,s,o=e.aoData[t];if(o._aSortData=null,o._aFilterData=null,o.displayData=null,"dom"!==i&&(i&&"auto"!==i||"dom"!==o.src)){var a=o.anCells,l=he(e,t);if(a)if(void 0!==n)ee(a[n],l[n]);else for(r=0,s=a.length;r<s;r++)ee(a[r],l[r])}else o._aData=ce(e,o,n,void 0===n?void 0:o._aData).data;var c=e.aoColumns;if(void 0!==n)c[n].sType=null,c[n].maxLenString=null;else{for(r=0,s=c.length;r<s;r++)c[r].sType=null,c[r].maxLenString=null;ue(e,o)}}function ce(e,t,i,n){var r,s,o,a=[],l=t.firstChild,c=0,h=e.aoColumns,d=e._rowReadObject;n=void 0!==n?n:d?{}:[];var u=function(e,t){if("string"==typeof e){var i=e.indexOf("@");if(-1!==i){var r=e.substring(i+1);se(e)(n,t.getAttribute(r))}}},f=function(e){void 0!==i&&i!==c||(s=h[c],o=e.innerHTML.trim(),s&&s._bAttrSrc?(se(s.mData._)(n,o),u(s.mData.sort,e),u(s.mData.type,e),u(s.mData.filter,e)):d?(s._setter||(s._setter=se(s.mData)),s._setter(n,o)):n[c]=o),c++};if(l)for(;l;)"TD"!=(r=l.nodeName.toUpperCase())&&"TH"!=r||(f(l),a.push(l)),l=l.nextSibling;else for(var p=0,m=(a=t.anCells).length;p<m;p++)f(a[p]);var g=t.firstChild?t:t.nTr;if(g){var _=g.getAttribute("id");_&&se(e.rowId)(n,_)}return{data:n,cells:a}}function he(e,t){var i=e.aoData[t],n=e.aoColumns;if(!i.displayData){i.displayData=[];for(var r=0,s=n.length;r<s;r++)i.displayData.push(Q(e,t,r,"display"))}return i.displayData}function de(e,t,i,n){var r,s,o,a,l,h,d=e.aoData[t],u=d._aData,f=[],p=e.oClasses.tbody.row;if(null===d.nTr){for(r=i||document.createElement("tr"),d.nTr=r,d.anCells=f,I(r,p),r._DT_RowIndex=t,ue(e,d),a=0,l=e.aoColumns.length;a<l;a++){o=e.aoColumns[a],(s=(h=!i||!n[a])?document.createElement(o.sCellType):n[a])||Qe(e,0,"Incorrect column count",18),s._DT_CellIndex={row:t,column:a},f.push(s);var m=he(e,t);!h&&(!o.mRender&&o.mData===a||c.isPlainObject(o.mData)&&o.mData._===a+".display")||ee(s,m[a]),I(s,o.sClass),o.bVisible&&h?r.appendChild(s):o.bVisible||h||s.parentNode.removeChild(s),o.fnCreatedCell&&o.fnCreatedCell.call(e.oInstance,s,Q(e,t,a),u,t,a)}rt(e,"aoRowCreatedCallback","row-created",[r,u,t,f])}else I(d.nTr,p)}function ue(e,t){var i=t.nTr,n=t._aData;if(i){var r=e.rowIdFn(n);if(r&&(i.id=r),n.DT_RowClass){var s=n.DT_RowClass.split(" ");t.__rowc=t.__rowc?L(t.__rowc.concat(s)):s,c(i).removeClass(t.__rowc.join(" ")).addClass(n.DT_RowClass)}n.DT_RowAttr&&c(i).attr(n.DT_RowAttr),n.DT_RowData&&c(i).data(n.DT_RowData)}}function fe(e,t){var i,n,r,s=e.oClasses,o=e.aoColumns,a="header"===t?e.nTHead:e.nTFoot,l="header"===t?"sTitle":t;if(a){if(("header"===t||S(e.aoColumns,l).join(""))&&((r=c("tr",a)).length||(r=c("<tr/>").appendTo(a)),1===r.length)){var h=0;for(c("td, th",r).each(function(){h+=this.colSpan}),i=h,n=o.length;i<n;i++)c("<th/>").html(o[i][l]||"").appendTo(r)}var d=we(e,a,!0);"header"===t?(e.aoHeader=d,c("tr",a).addClass(s.thead.row)):(e.aoFooter=d,c("tr",a).addClass(s.tfoot.row)),c(a).children("tr").children("th, td").each(function(){ot(e,t)(e,c(this),s)})}}function pe(e,t,i){var n,r,s,o,a,l=[],h=[],d=e.aoColumns,u=d.length;if(t){for(i||(i=k(u).filter(function(e){return d[e].bVisible})),n=0;n<t.length;n++)l[n]=t[n].slice().filter(function(e,t){return i.includes(t)}),h.push([]);for(n=0;n<l.length;n++)for(r=0;r<l[n].length;r++)if(o=1,a=1,void 0===h[n][r]){for(s=l[n][r].cell;void 0!==l[n+o]&&l[n][r].cell==l[n+o][r].cell;)h[n+o][r]=null,o++;for(;void 0!==l[n][r+a]&&l[n][r].cell==l[n][r+a].cell;){for(var f=0;f<o;f++)h[n+f][r+a]=null;a++}var p=c("span.dt-column-title",s);h[n][r]={cell:s,colspan:a,rowspan:o,title:p.length?p.html():c(s).html()}}return h}}function me(e,t){for(var i,n,r=pe(e,t),s=0;s<t.length;s++){if(i=t[s].row)for(;n=i.firstChild;)i.removeChild(n);for(var o=0;o<r[s].length;o++){var a=r[s][o];a&&c(a.cell).appendTo(i).attr("rowspan",a.rowspan).attr("colspan",a.colspan)}}}function ge(e,t){if(function(e){var t="ssp"==at(e),i=e.iInitDisplayStart;void 0!==i&&-1!==i&&(e._iDisplayStart=t?i:i>=e.fnRecordsDisplay()?0:i,e.iInitDisplayStart=-1)}(e),-1===rt(e,"aoPreDrawCallback","preDraw",[e]).indexOf(!1)){var i,r=[],s=0,o="ssp"==at(e),a=e.aiDisplay,l=e._iDisplayStart,h=e.fnDisplayEnd(),d=e.aoColumns,u=c(e.nTBody);if(e.bDrawing=!0,e.deferLoading)e.deferLoading=!1,e.iDraw++,Oe(e,!1);else if(o){if(!e.bDestroying&&!t)return 0===e.iDraw&&u.empty().append(ye(e)),(i=e).iDraw++,Oe(i,!0),void Se(i,function(e){var t=e.aoColumns,i=e.oFeatures,n=e.oPreviousSearch,r=e.aoPreSearchCols,s=function(e,i){return"function"==typeof t[e][i]?"function":t[e][i]};return{draw:e.iDraw,columns:t.map(function(e,t){return{data:s(t,"mData"),name:e.sName,searchable:e.bSearchable,orderable:e.bSortable,search:{value:r[t].search,regex:r[t].regex,fixed:Object.keys(e.searchFixed).map(function(t){return{name:t,term:e.searchFixed[t].toString()}})}}}),order:$e(e).map(function(e){return{column:e.col,dir:e.dir,name:s(e.col,"sName")}}),start:e._iDisplayStart,length:i.bPaginate?e._iDisplayLength:-1,search:{value:n.search,regex:n.regex,fixed:Object.keys(e.searchFixed).map(function(t){return{name:t,term:e.searchFixed[t].toString()}})}}}(i),function(e){!function(e,t){var i=Te(e,t),n=ke(e,"draw",t),r=ke(e,"recordsTotal",t),s=ke(e,"recordsFiltered",t);if(void 0!==n){if(1*n<e.iDraw)return;e.iDraw=1*n}i||(i=[]),ae(e),e._iRecordsTotal=parseInt(r,10),e._iRecordsDisplay=parseInt(s,10);for(var o=0,a=i.length;o<a;o++)J(e,i[o]);e.aiDisplay=e.aiDisplayMaster.slice(),$(e),ge(e,!0),Ie(e),Oe(e,!1)}(i,e)})}else e.iDraw++;if(0!==a.length)for(var f=o?0:l,p=o?e.aoData.length:h,m=f;m<p;m++){var g=a[m],_=e.aoData[g];null===_.nTr&&de(e,g);for(var y=_.nTr,v=0;v<d.length;v++){var x=d[v],b=_.anCells[v];I(b,n.type.className[x.sType]),I(b,e.oClasses.tbody.cell)}rt(e,"aoRowCallback",null,[y,_._aData,s,m,g]),r.push(y),s++}else r[0]=ye(e);rt(e,"aoHeaderCallback","header",[c(e.nTHead).children("tr")[0],oe(e),l,h,a]),rt(e,"aoFooterCallback","footer",[c(e.nTFoot).children("tr")[0],oe(e),l,h,a]),u[0].replaceChildren?u[0].replaceChildren.apply(u[0],r):(u.children().detach(),u.append(c(r))),c(e.nTableWrapper).toggleClass("dt-empty-footer",0===c("tr",e.nTFoot).length),rt(e,"aoDrawCallback","draw",[e],!0),e.bSorted=!1,e.bFiltered=!1,e.bDrawing=!1}else Oe(e,!1)}function _e(e,t,i){var n=e.oFeatures,r=n.bSort,s=n.bFilter;void 0!==i&&!0!==i||($(e),r&&Ge(e),s?Me(e,e.oPreviousSearch):e.aiDisplay=e.aiDisplayMaster.slice()),!0!==t&&(e._iDisplayStart=0),e._drawHold=t,ge(e),e.api.one("draw",function(){e._drawHold=!1})}function ye(e){var t=e.oLanguage,i=t.sZeroRecords,n=at(e);return"ssp"!==n&&"ajax"!==n||e.json?t.sEmptyTable&&0===e.fnRecordsTotal()&&(i=t.sEmptyTable):i=t.sLoadingRecords,c("<tr/>").append(c("<td />",{colSpan:V(e),class:e.oClasses.empty.row}).html(i))[0]}function ve(e,t,i){if(Array.isArray(i))for(var n=0;n<i.length;n++)ve(e,t,i[n]);else{var r=e[t];c.isPlainObject(i)?i.features?(i.rowId&&(e.id=i.rowId),i.rowClass&&(e.className=i.rowClass),r.id=i.id,r.className=i.className,ve(e,t,i.features)):Object.keys(i).map(function(e){r.contents.push({feature:e,opts:i[e]})}):r.contents.push(i)}}function xe(e,t,i){var n=[];c.each(t,function(e,t){if(null!==t){var r=e.match(/^([a-z]+)([0-9]*)([A-Za-z]*)$/),s=r[2]?1*r[2]:0,o=r[3]?r[3].toLowerCase():"full";if(r[1]===i){var a=function(e,t,i){for(var n,r=0;r<e.length;r++)if((n=e[r]).rowNum===t&&("full"===i&&n.full||("start"===i||"end"===i)&&(n.start||n.end)))return n[i]||(n[i]={contents:[]}),n;return(n={rowNum:t})[i]={contents:[]},e.push(n),n}(n,s,o);ve(a,o,t)}}}),n.sort(function(e,t){var n=e.rowNum,r=t.rowNum;if(n===r){var s=e.full&&!t.full?-1:1;return"bottom"===i?-1*s:s}return r-n}),"bottom"===i&&n.reverse();for(var r=0;r<n.length;r++)delete n[r].rowNum,be(e,n[r]);return n}function be(e,t){var i=function(t,i){return n.features[t]||Qe(e,0,"Unknown feature: "+t),n.features[t].apply(this,[e,i])},r=function(n){if(t[n])for(var r=t[n].contents,s=0,o=r.length;s<o;s++)if(r[s])if("string"==typeof r[s])r[s]=i(r[s],null);else if(c.isPlainObject(r[s]))r[s]=i(r[s].feature,r[s].opts);else if("function"==typeof r[s].node)r[s]=r[s].node(e);else if("function"==typeof r[s]){var a=r[s](e);r[s]="function"==typeof a.node?a.node():a}};r("start"),r("end"),r("full")}function we(e,t,i){var n,r,s,o,a,l,h,d,u,f,p=e.aoColumns,m=c(t).children("tr"),g=e.titleRow,_=t&&"thead"===t.nodeName.toLowerCase(),y=[],v=function(e,t,i){for(var n=e[t];n[i];)i++;return i};for(s=0,l=m.length;s<l;s++)y.push([]);for(s=0,l=m.length;s<l;s++)for(r=(n=m[s]).firstChild;r;){if("TD"==r.nodeName.toUpperCase()||"TH"==r.nodeName.toUpperCase()){var x=[],b=c(r);if(d=(d=1*r.getAttribute("colspan"))&&0!==d&&1!==d?d:1,u=(u=1*r.getAttribute("rowspan"))&&0!==u&&1!==u?u:1,h=v(y,s,0),f=1===d,i){if(f){Y(e,h,dt(b.data()));var w=p[h],S=r.getAttribute("width")||null,T=r.style.width.match(/width:\s*(\d+[pxem%]+)/);T&&(S=T[1]),w.sWidthOrig=w.sWidth||S,_?(null===w.sTitle||w.autoTitle||(!0===g&&0===s||!1===g&&s===m.length-1||g===s||null===g)&&(r.innerHTML=w.sTitle),!w.sTitle&&f&&(w.sTitle=A(r.innerHTML),w.autoTitle=!0)):w.footer&&(r.innerHTML=w.footer),w.ariaTitle||(w.ariaTitle=b.attr("aria-label")||w.sTitle),w.className&&b.addClass(w.className)}0===c("span.dt-column-title",r).length&&c("<span>").addClass("dt-column-title").append(r.childNodes).appendTo(r),e.orderIndicators&&_&&0!==b.filter(":not([data-dt-order=disable])").length&&0!==b.parent(":not([data-dt-order=disable])").length&&0===c("span.dt-column-order",r).length&&c("<span>").addClass("dt-column-order").appendTo(r);var k=_?"header":"footer";0===c("span.dt-column-"+k,r).length&&c("<div>").addClass("dt-column-"+k).append(r.childNodes).appendTo(r)}for(a=0;a<d;a++){for(o=0;o<u;o++)y[s+o][h+a]={cell:r,unique:f},y[s+o].row=n;x.push(h+a)}r.setAttribute("data-dt-column",L(x).join(","))}r=r.nextSibling}return y}function Se(e,t,i){var n,r=e.ajax,s=e.oInstance,o=function(t){var n=e.jqXHR?e.jqXHR.status:null;(null===t||"number"==typeof n&&204==n)&&Te(e,t={},[]);var r=t.error||t.sError;if(r&&Qe(e,0,r),t.d&&"string"==typeof t.d)try{t=JSON.parse(t.d)}catch(e){}e.json=t,rt(e,null,"xhr",[e,t,e.jqXHR],!0),i(t)};if(c.isPlainObject(r)&&r.data){var a="function"==typeof(n=r.data)?n(t,e):n;t="function"==typeof n&&a?a:c.extend(!0,t,a),delete r.data}var l={url:"string"==typeof r?r:"",data:t,success:o,dataType:"json",cache:!1,type:e.sServerMethod,error:function(t,i){-1===rt(e,null,"xhr",[e,null,e.jqXHR],!0).indexOf(!0)&&("parsererror"==i?Qe(e,0,"Invalid JSON response",1):4===t.readyState&&Qe(e,0,"Ajax error",7)),Oe(e,!1)}};if(c.isPlainObject(r)&&c.extend(l,r),e.oAjaxData=t,rt(e,null,"preXhr",[e,t,l],!0),"json"===l.submitAs&&"object"==typeof t&&(l.data=JSON.stringify(t)),"function"==typeof r)e.jqXHR=r.call(s,t,o,e);else if(""===r.url){var h={};Te(e,h,[]),o(h)}else e.jqXHR=c.ajax(l);n&&(r.data=n)}function Te(e,t,i){var n="data";if(c.isPlainObject(e.ajax)&&void 0!==e.ajax.dataSrc){var r=e.ajax.dataSrc;"string"==typeof r||"function"==typeof r?n=r:void 0!==r.data&&(n=r.data)}if(!i)return"data"===n?t.aaData||t[n]:""!==n?re(n)(t):t;se(n)(t,i)}function ke(e,t,i){var n=c.isPlainObject(e.ajax)?e.ajax.dataSrc:null;if(n&&n[t])return re(n[t])(i);var r="";return"draw"===t?r="sEcho":"recordsTotal"===t?r="iTotalRecords":"recordsFiltered"===t&&(r="iTotalDisplayRecords"),void 0!==i[r]?i[r]:i[t]}function Me(e,t){var i=e.aoPreSearchCols;if("ssp"!=at(e)){!function(e){for(var t,i,n,r,s,o=e.aoColumns,a=e.aoData,l=0;l<a.length;l++)if(a[l]&&!(s=a[l])._aFilterData){for(n=[],t=0,i=o.length;t<i;t++)o[t].bSearchable?(null===(r=Q(e,l,t,"filter"))&&(r=""),"string"!=typeof r&&r.toString&&(r=r.toString())):r="",r.indexOf&&-1!==r.indexOf("&")&&(De.innerHTML=r,r=Le?De.textContent:De.innerText),r.replace&&(r=r.replace(/[\r\n\u2028]/g,"")),n.push(r);s._aFilterData=n,s._sFilterRow=n.join(" ")}}(e),e.aiDisplay=e.aiDisplayMaster.slice(),Ae(e.aiDisplay,e,t.search,t),c.each(e.searchFixed,function(t,i){Ae(e.aiDisplay,e,i,{})});for(var n=0;n<i.length;n++){var r=i[n];Ae(e.aiDisplay,e,r.search,r,n),c.each(e.aoColumns[n].searchFixed,function(t,i){Ae(e.aiDisplay,e,i,{},n)})}!function(e){for(var t,i,n=h.ext.search,r=e.aiDisplay,s=0,o=n.length;s<o;s++){for(var a=[],l=0,c=r.length;l<c;l++)i=r[l],t=e.aoData[i],n[s](e,t._aFilterData,i,t._aData,l)&&a.push(i);r.length=0,ct(r,a)}}(e)}e.bFiltered=!0,rt(e,null,"search",[e])}function Ae(e,t,i,n,r){if(""!==i){var s=0,o=[],a="function"==typeof i?i:null,l=i instanceof RegExp?i:a?null:function(e,t){var i=[],n=c.extend({},{boundary:!1,caseInsensitive:!0,exact:!1,regex:!1,smart:!0},t);if("string"!=typeof e&&(e=e.toString()),e=D(e),n.exact)return new RegExp("^"+Ce(e)+"$",n.caseInsensitive?"i":"");if(e=n.regex?e:Ce(e),n.smart){var r=(e.match(/!?["\u201C][^"\u201D]+["\u201D]|[^ ]+/g)||[""]).map(function(e){var t,n=!1;return"!"===e.charAt(0)&&(n=!0,e=e.substring(1)),'"'===e.charAt(0)?(t=e.match(/^"(.*)"$/),e=t?t[1]:e):"“"===e.charAt(0)&&(t=e.match(/^\u201C(.*)\u201D$/),e=t?t[1]:e),n&&(e.length>1&&i.push("(?!"+e+")"),e=""),e.replace(/"/g,"")}),s=i.length?i.join(""):"",o=n.boundary?"\\b":"";e="^(?=.*?"+o+r.join(")(?=.*?"+o)+")("+s+".)*$"}return new RegExp(e,n.caseInsensitive?"i":"")}(i,n);for(s=0;s<e.length;s++){var h=t.aoData[e[s]],d=void 0===r?h._sFilterRow:h._aFilterData[r];(a&&a(d,h._aData,e[s],r)||l&&l.test(d))&&o.push(e[s])}for(e.length=o.length,s=0;s<o.length;s++)e[s]=o[s]}}var Ce=h.util.escapeRegex,De=c("<div>")[0],Le=void 0!==De.textContent;function Ee(e){var t,i=e.oInit,n=e.deferLoading,r=at(e);e.bInitialised?(fe(e,"header"),fe(e,"footer"),function(e,t,i){if(e.oFeatures.bStateSave){var n=e.fnStateLoadCallback.call(e.oInstance,e,function(t){Ke(e,t,i)});void 0!==n&&Ke(e,n,i)}else i()}(e,0,function(){me(e,e.aoHeader),me(e,e.aoFooter);var s=e.iInitDisplayStart;if(i.aaData)for(t=0;t<i.aaData.length;t++)J(e,i.aaData[t]);else(n||"dom"==r)&&K(e,c(e.nTBody).children("tr"));e.aiDisplay=e.aiDisplayMaster.slice(),function(e){var t=e.oClasses,i=c(e.nTable),n=c("<div/>").attr({id:e.sTableId+"_wrapper",class:t.container}).insertBefore(i);if(e.nTableWrapper=n[0],e.sDom)!function(e,t,i){for(var n,r,s,o,a,l=t.match(/(".*?")|('.*?')|./g),d=0;d<l.length;d++){if(n=null,"<"==(r=l[d])){if(s=c("<div/>"),"'"==(o=l[d+1])[0]||'"'==o[0]){var u,f="";if(-1!=(a=o.replace(/['"]/g,"")).indexOf(".")){var p=a.split(".");f=p[0],u=p[1]}else"#"==a[0]?f=a:u=a;s.attr("id",f.substring(1)).addClass(u),d++}i.append(s),i=s}else">"==r?i=i.parent():"t"==r?n=Fe(e):h.ext.feature.forEach(function(t){r==t.cFeature&&(n=t.fnInit(e))});n&&i.append(n)}}(e,e.sDom,n);else{var r=xe(e,e.layout,"top"),s=xe(e,e.layout,"bottom"),o=ot(e,"layout");r.forEach(function(t){o(e,n,t)}),o(e,n,{full:{table:!0,contents:[Fe(e)]}}),s.forEach(function(t){o(e,n,t)})}!function(e){var t=e.nTable,i=""!==e.oScroll.sX||""!==e.oScroll.sY;if(e.oFeatures.bProcessing){var n=c("<div/>",{id:e.sTableId+"_processing",class:e.oClasses.processing.container,role:"status"}).html(e.oLanguage.sProcessing).append("<div><div></div><div></div><div></div><div></div></div>");i?n.prependTo(c("div.dt-scroll",e.nTableWrapper)):n.insertBefore(t),c(t).on("processing.dt.DT",function(e,t,i){n.css("display",i?"block":"none")})}}(e)}(e),function(e){var t=e.nTHead,i=t.querySelectorAll("tr"),n=e.titleRow,r=':not([data-dt-order="disable"]):not([data-dt-order="icon-only"])';!0===n?t=i[0]:!1===n?t=i[i.length-1]:null!==n&&(t=i[n]),e.orderHandler&&Ve(e,t,t===e.nTHead?"tr"+r+" th"+r+", tr"+r+" td"+r:"th"+r+", td"+r);var s=[];Ue(e,s,e.aaSorting),e.aaSorting=s}(e),je(e),Oe(e,!0),rt(e,null,"preInit",[e],!0),_e(e),("ssp"!=r||n)&&("ajax"==r?Se(e,{},function(i){var n=Te(e,i);for(t=0;t<n.length;t++)J(e,n[t]);e.iInitDisplayStart=s,_e(e),Oe(e,!1),Ie(e)}):(Ie(e),Oe(e,!1)))})):setTimeout(function(){Ee(e)},200)}function Ie(e){if(!e._bInitComplete){var t=[e,e.json];e._bInitComplete=!0,B(e),rt(e,null,"plugin-init",t,!0),rt(e,"aoInitComplete","init",t,!0)}}function Pe(e,t){var i=parseInt(t,10);e._iDisplayLength=i,st(e),rt(e,null,"length",[e,i])}function Re(e,t,i){var n=e._iDisplayStart,r=e._iDisplayLength,s=e.fnRecordsDisplay();if(0===s||-1===r)n=0;else if("number"==typeof t)(n=t*r)>s&&(n=0);else if("first"==t)n=0;else if("previous"==t)(n=r>=0?n-r:0)<0&&(n=0);else if("next"==t)n+r<s&&(n+=r);else if("last"==t)n=Math.floor((s-1)/r)*r;else{if("ellipsis"===t)return;Qe(e,0,"Unknown paging action: "+t,5)}var o=e._iDisplayStart!==n;return e._iDisplayStart=n,rt(e,null,o?"page":"page-nc",[e]),o&&i&&ge(e),o}function Oe(e,t){e.bDrawing&&!1===t||rt(e,null,"processing",[e,t])}function ze(e,t,i){t?(Oe(e,!0),setTimeout(function(){i(),Oe(e,!1)},0)):i()}function Fe(e){var t=c(e.nTable),i=e.oScroll;if(""===i.sX&&""===i.sY)return e.nTable;var n=i.sX,r=i.sY,s=e.oClasses.scrolling,o=e.captionNode,a=o?o._captionSide:null,l=c(t[0].cloneNode(!1)),h=c(t[0].cloneNode(!1)),d=t.children("tfoot"),u="<div/>",f=function(e){return e?He(e):null};d.length||(d=null);var p=c(u,{class:s.container}).append(c(u,{class:s.header.self}).css({overflow:"hidden",position:"relative",border:0,width:n?f(n):"100%"}).append(c(u,{class:s.header.inner}).css({"box-sizing":"content-box",width:i.sXInner||"100%"}).append(l.removeAttr("id").css("margin-left",0).append("top"===a?o:null).append(t.children("thead"))))).append(c(u,{class:s.body}).css({position:"relative",overflow:"auto",width:f(n)}).append(t));d&&p.append(c(u,{class:s.footer.self}).css({overflow:"hidden",border:0,width:n?f(n):"100%"}).append(c(u,{class:s.footer.inner}).append(h.removeAttr("id").css("margin-left",0).append("bottom"===a?o:null).append(t.children("tfoot")))));var m=p.children(),g=m[0],_=m[1],y=d?m[2]:null;return c(_).on("scroll.DT",function(){var e=this.scrollLeft;g.scrollLeft=e,d&&(y.scrollLeft=e)}),c("th, td",g).on("focus",function(){var e=g.scrollLeft;_.scrollLeft=e,d&&(_.scrollLeft=e)}),c(_).css("max-height",r),i.bCollapse||c(_).css("height",r),e.nScrollHead=g,e.nScrollBody=_,e.nScrollFoot=y,e.aoDrawCallback.push(Ne),p[0]}function Ne(e){var t,i,n=e.oScroll,r=n.iBarWidth,s=c(e.nScrollHead).children("div"),o=s.children("table"),a=e.nScrollBody,l=c(a),h=c(e.nScrollFoot).children("div"),d=h.children("table"),u=c(e.nTHead),f=c(e.nTable),p=e.nTFoot&&c("th, td",e.nTFoot).length?c(e.nTFoot):null,m=e.oBrowser,g=a.scrollHeight>a.clientHeight;if(e.scrollBarVis!==g&&void 0!==e.scrollBarVis)return e.scrollBarVis=g,void B(e);if(e.scrollBarVis=g,f.children("thead, tfoot").remove(),(t=u.clone().prependTo(f)).find("th, td").removeAttr("tabindex"),t.find("[id]").removeAttr("id"),p&&(i=p.clone().prependTo(f)).find("[id]").removeAttr("id"),e.aiDisplay.length){var _=null,y="ssp"!==at(e)?e._iDisplayStart:0;for(w=y;w<y+e.aiDisplay.length;w++){var v=e.aiDisplay[w],x=e.aoData[v].nTr;if(x){_=x;break}}if(_)for(var b=c(_).children("th, td").map(function(t){return{idx:H(e,t),width:c(this).outerWidth()}}),w=0;w<b.length;w++){var S=e.aoColumns[b[w].idx].colEl[0];S.style.width.replace("px","")!==b[w].width&&(S.style.width=b[w].width+"px",n.sX&&(S.style.minWidth=b[w].width+"px"))}}o.find("colgroup").remove(),o.append(e.colgroup.clone()),p&&(d.find("colgroup").remove(),d.append(e.colgroup.clone())),c("th, td",t).each(function(){c(this.childNodes).wrapAll('<div class="dt-scroll-sizing">')}),p&&c("th, td",i).each(function(){c(this.childNodes).wrapAll('<div class="dt-scroll-sizing">')});var T=Math.floor(f.height())>a.clientHeight||"scroll"==l.css("overflow-y"),k="padding"+(m.bScrollbarLeft?"Left":"Right"),M=f.outerWidth();o.css("width",He(M)),s.css("width",He(M)).css(k,T?r+"px":"0px"),p&&(d.css("width",He(M)),h.css("width",He(M)).css(k,T?r+"px":"0px")),f.children("colgroup").prependTo(f),l.trigger("scroll"),!e.bSorted&&!e.bFiltered||e._drawHold||(a.scrollTop=0)}function Ye(e){return c(e.nTableWrapper).is(":visible")?c(e.nTableWrapper).width():0}function Be(e,t){var i=e.aoColumns[t];if(!i.maxLenString){for(var n,r="",s=-1,o=0,a=e.aiDisplayMaster.length;o<a;o++){var l=he(e,e.aiDisplayMaster[o])[t],c=l&&"object"==typeof l&&l.nodeType?l.innerHTML:l+"";c=c.replace(/id=".*?"/g,"").replace(/name=".*?"/g,""),(n=A(c).replace(/ /g," ")).length>s&&(r=c,s=n.length)}i.maxLenString=r}return i.maxLenString}function He(e){return null===e?"0px":"number"==typeof e?e<0?"0px":e+"px":e.match(/\d$/)?e+"px":e}function je(e){var t=e.aoColumns;for(e.colgroup.empty(),$t=0;$t<t.length;$t++)t[$t].bVisible&&e.colgroup.append(t[$t].colEl)}function Ve(e,t,i,n,r){it(t,i,function(t){var i=!1,s=void 0===n?Z(t.target):"function"==typeof n?n():Array.isArray(n)?n:[n];if(s.length){for(var o=0,a=s.length;o<a&&(!1!==Xe(e,s[o],o,t.shiftKey)&&(i=!0),1!==e.aaSorting.length||""!==e.aaSorting[0][1]);o++);i&&ze(e,!0,function(){Ge(e),We(e,e.aiDisplay),_e(e,!1,!1),r&&r()})}})}function We(e,t){if(!(t.length<2)){var i,n=e.aiDisplayMaster,r={},s={};for(i=0;i<n.length;i++)r[n[i]]=i;for(i=0;i<t.length;i++)s[t[i]]=r[t[i]];t.sort(function(e,t){return s[e]-s[t]})}}function Ue(e,t,i){var n=function(i){if(c.isPlainObject(i)){if(void 0!==i.idx)t.push([i.idx,i.dir]);else if(i.name){var n=S(e.aoColumns,"sName").indexOf(i.name);-1!==n&&t.push([n,i.dir])}}else t.push(i)};if(c.isPlainObject(i))n(i);else if(i.length&&"number"==typeof i[0])n(i);else if(i.length)for(var r=0;r<i.length;r++)n(i[r])}function $e(e){var t,i,n,r,s,o,a,l=[],d=h.ext.type.order,u=e.aoColumns,f=e.aaSortingFixed,p=c.isPlainObject(f),m=[];if(!e.oFeatures.bSort)return l;for(Array.isArray(f)&&Ue(e,m,f),p&&f.pre&&Ue(e,m,f.pre),Ue(e,m,e.aaSorting),p&&f.post&&Ue(e,m,f.post),t=0;t<m.length;t++)if(u[a=m[t][0]])for(i=0,n=(r=u[a].aDataSort).length;i<n;i++)o=u[s=r[i]].sType||"string",void 0===m[t]._idx&&(m[t]._idx=u[s].asSorting.indexOf(m[t][1])),m[t][1]&&l.push({src:a,col:s,dir:m[t][1],index:m[t]._idx,type:o,formatter:d[o+"-pre"],sorter:d[o+"-"+m[t][1]]});return l}function Ge(e,t,i){var n,r,s,o=[],a=h.ext.type.order,l=e.aoData,c=e.aiDisplayMaster;if($(e),void 0!==t){var d=e.aoColumns[t];s=[{src:t,col:t,dir:i,index:0,type:d.sType,formatter:a[d.sType+"-pre"],sorter:a[d.sType+"-"+i]}],c=c.slice()}else s=$e(e);for(n=0,r=s.length;n<r;n++)Ze(e,s[n].col);if("ssp"!=at(e)&&0!==s.length){for(n=0,r=c.length;n<r;n++)o[n]=n;s.length&&"desc"===s[0].dir&&e.orderDescReverse&&o.reverse(),c.sort(function(e,t){var i,n,r,a,c,h=s.length,d=l[e]._aSortData,u=l[t]._aSortData;for(r=0;r<h;r++)if(i=d[(c=s[r]).col],n=u[c.col],c.sorter){if(0!==(a=c.sorter(i,n)))return a}else if(0!=(a=i<n?-1:i>n?1:0))return"asc"===c.dir?a:-a;return(i=o[e])<(n=o[t])?-1:i>n?1:0})}else 0===s.length&&c.sort(function(e,t){return e<t?-1:e>t?1:0});return void 0===t&&(e.bSorted=!0,e.sortDetails=s,rt(e,null,"order",[e,s])),c}function Xe(e,t,i,n){var r,s=e.aoColumns[t],o=e.aaSorting,a=s.asSorting,l=function(e,t){var i=e._idx;return void 0===i&&(i=a.indexOf(e[1])),i+1<a.length?i+1:t?null:0};if(!s.bSortable)return!1;if("number"==typeof o[0]&&(o=e.aaSorting=[o]),(n||i)&&e.oFeatures.bSortMulti){var c=S(o,"0").indexOf(t);-1!==c?(null===(r=l(o[c],!0))&&1===o.length&&(r=0),null===r||""===a[r]?o.splice(c,1):(o[c][1]=a[r],o[c]._idx=r)):n?(o.push([t,a[0],0]),o[o.length-1]._idx=0):(o.push([t,o[0][1],0]),o[o.length-1]._idx=0)}else o.length&&o[0][0]==t?(r=l(o[0]),o.length=1,o[0][1]=a[r],o[0]._idx=r):(o.length=0,o.push([t,a[0]]),o[0]._idx=0)}function qe(e){var t,i,n,r=e.aLastSort,s=e.oClasses.order.position,o=$e(e),a=e.oFeatures;if(a.bSort&&a.bSortClasses){for(t=0,i=r.length;t<i;t++)n=r[t].src,c(S(e.aoData,"anCells",n)).removeClass(s+(t<2?t+1:3));for(t=0,i=o.length;t<i;t++)n=o[t].src,c(S(e.aoData,"anCells",n)).addClass(s+(t<2?t+1:3))}e.aLastSort=o}function Ze(e,t){var i,n,r,s=e.aoColumns[t],o=h.ext.order[s.sSortDataType];o&&(i=o.call(e.oInstance,e,t,j(e,t)));for(var a=h.ext.type.order[s.sType+"-pre"],l=e.aoData,c=0;c<l.length;c++)l[c]&&((n=l[c])._aSortData||(n._aSortData=[]),n._aSortData[t]&&!o||(r=o?i[c]:Q(e,c,t,"sort"),n._aSortData[t]=a?a(r,e):r))}function Je(e){if(!e._bLoadingState){var t=[];Ue(e,t,e.aaSorting);var i=e.aoColumns,n={time:+new Date,start:e._iDisplayStart,length:e._iDisplayLength,order:t.map(function(e){return i[e[0]]&&i[e[0]].sName?[i[e[0]].sName,e[1]]:e.slice()}),search:c.extend({},e.oPreviousSearch),columns:e.aoColumns.map(function(t,i){return{name:t.sName,visible:t.bVisible,search:c.extend({},e.aoPreSearchCols[i])}})};e.oSavedState=n,rt(e,"aoStateSaveParams","stateSaveParams",[e,n]),e.oFeatures.bStateSave&&!e.bDestroying&&e.fnStateSaveCallback.call(e.oInstance,e,n)}}function Ke(e,t,i){var n,r,s=e.aoColumns,o=S(e.aoColumns,"sName");e._bLoadingState=!0;var a=e._bInitComplete?new h.Api(e):null;if(!t||!t.time)return e._bLoadingState=!1,void i();var l=e.iStateDuration;if(l>0&&t.time<+new Date-1e3*l)return e._bLoadingState=!1,void i();if(-1!==rt(e,"aoStateLoadParams","stateLoadParams",[e,t]).indexOf(!1))return e._bLoadingState=!1,void i();if(e.oLoadedState=c.extend(!0,{},t),rt(e,null,"stateLoadInit",[e,t],!0),void 0!==t.length&&(a?a.page.len(t.length):e._iDisplayLength=t.length),void 0!==t.start&&(null===a?(e._iDisplayStart=t.start,e.iInitDisplayStart=t.start):Re(e,t.start/e._iDisplayLength)),void 0!==t.order&&(e.aaSorting=[],c.each(t.order,function(t,i){var n=[i[0],i[1]];if("string"==typeof i[0]){var r=o.indexOf(i[0]);if(r<0)return;n[0]=r}else if(n[0]>=s.length)return;e.aaSorting.push(n)})),void 0!==t.search&&c.extend(e.oPreviousSearch,t.search),t.columns){var d=t.columns,u=S(t.columns,"name");if(u.join("").length&&u.join("")!==o.join(""))for(d=[],n=0;n<o.length;n++)if(""!=o[n]){var f=u.indexOf(o[n]);f>=0?d.push(t.columns[f]):d.push({})}else d.push({});if(d.length===s.length){for(n=0,r=d.length;n<r;n++){var p=d[n];void 0!==p.visible&&(a?a.column(n).visible(p.visible,!1):s[n].bVisible=p.visible),void 0!==p.search&&c.extend(e.aoPreSearchCols[n],p.search)}a&&a.columns.adjust()}}e._bLoadingState=!1,rt(e,"aoStateLoaded","stateLoaded",[e,t]),i()}function Qe(e,t,i,n){if(i="DataTables warning: "+(e?"table id="+e.sTableId+" - ":"")+i,n&&(i+=". For more information about this error, please see https://datatables.net/tn/"+n),t)window.console&&console.log&&console.log(i);else{var r=h.ext,s=r.sErrMode||r.errMode;if(e&&rt(e,null,"dt-error",[e,n,i],!0),"alert"==s)alert(i);else{if("throw"==s)throw new Error(i);"function"==typeof s&&s(e,n,i)}}}function et(e,t,i,n){Array.isArray(i)?c.each(i,function(i,n){Array.isArray(n)?et(e,t,n[0],n[1]):et(e,t,n)}):(void 0===n&&(n=i),void 0!==t[i]&&(e[n]=t[i]))}function tt(e,t,i){var n;for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n=t[r],c.isPlainObject(n)?(c.isPlainObject(e[r])||(e[r]={}),c.extend(!0,e[r],n)):i&&"data"!==r&&"aaData"!==r&&Array.isArray(n)?e[r]=n.slice():e[r]=n);return e}function it(e,t,i){c(e).on("click.DT",t,function(e){i(e)}).on("keypress.DT",t,function(e){13===e.which&&(e.preventDefault(),i(e))}).on("selectstart.DT",t,function(){return!1})}function nt(e,t,i){i&&e[t].push(i)}function rt(e,t,i,n,r){var s=[];if(t&&(s=e[t].slice().reverse().map(function(t){return t.apply(e.oInstance,n)})),null!==i){var o=c.Event(i+".dt"),a=c(e.nTable);o.dt=e.api,a[r?"trigger":"triggerHandler"](o,n),r&&0===a.parents("body").length&&c("body").trigger(o,n),s.push(o.result)}return s}function st(e){var t=e._iDisplayStart,i=e.fnDisplayEnd(),n=e._iDisplayLength;t>=i&&(t=i-n),t-=t%n,(-1===n||t<0)&&(t=0),e._iDisplayStart=t}function ot(e,t){var i=e.renderer,n=h.ext.renderer[t];return c.isPlainObject(i)&&i[t]?n[i[t]]||n._:"string"==typeof i&&n[i]||n._}function at(e){return e.oFeatures.bServerSide?"ssp":e.ajax?"ajax":"dom"}function lt(e,t,i){var n=e.fnFormatNumber,r=e._iDisplayStart+1,s=e._iDisplayLength,o=e.fnRecordsDisplay(),a=e.fnRecordsTotal(),l=-1===s;return t.replace(/_START_/g,n.call(e,r)).replace(/_END_/g,n.call(e,e.fnDisplayEnd())).replace(/_MAX_/g,n.call(e,a)).replace(/_TOTAL_/g,n.call(e,o)).replace(/_PAGE_/g,n.call(e,l?1:Math.ceil(r/s))).replace(/_PAGES_/g,n.call(e,l?1:Math.ceil(o/s))).replace(/_ENTRIES_/g,e.api.i18n("entries","",i)).replace(/_ENTRIES-MAX_/g,e.api.i18n("entries","",a)).replace(/_ENTRIES-TOTAL_/g,e.api.i18n("entries","",o))}function ct(e,t){if(t)if(t.length<1e4)e.push.apply(e,t);else for($t=0;$t<t.length;$t++)e.push(t[$t])}function ht(e,t,i){for(Array.isArray(i)||(i=[i]),$t=0;$t<i.length;$t++)e.on(t+".dt",i[$t])}function dt(e){return h.ext.escape.attributes&&c.each(e,function(t,i){e[t]=C(i)}),e}var ut=[],ft=Array.prototype;function pt(e,t,i){return function(){var n=t.apply(e||this,arguments);return r.extend(n,n,i.methodExt),n}}function mt(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i].name===t)return e[i];return null}r=function(e,t){if(!(this instanceof r))return new r(e,t);var i,n=[],s=function(e){var t=function(e){var t,i,n=h.settings,r=S(n,"nTable");return e?e.nTable&&e.oFeatures?[e]:e.nodeName&&"table"===e.nodeName.toLowerCase()?-1!==(t=r.indexOf(e))?[n[t]]:null:e&&"function"==typeof e.settings?e.settings().toArray():("string"==typeof e?i=c(e).get():e instanceof c&&(i=e.get()),i?n.filter(function(e,t){return i.includes(r[t])}):void 0):[]}(e);t&&n.push.apply(n,t)};if(Array.isArray(e))for(i=0;i<e.length;i++)s(e[i]);else s(e);this.context=n.length>1?L(n):n,ct(this,t),this.selector={rows:null,cols:null,opts:null},r.extend(this,this,ut)},h.Api=r,c.extend(r.prototype,{any:function(){return 0!==this.count()},context:[],count:function(){return this.flatten().length},each:function(e){for(var t=0,i=this.length;t<i;t++)e.call(this,this[t],t,this);return this},eq:function(e){var t=this.context;return t.length>e?new r(t[e],this[e]):null},filter:function(e){var t=ft.filter.call(this,e,this);return new r(this.context,t)},flatten:function(){var e=[];return new r(this.context,e.concat.apply(e,this.toArray()))},get:function(e){return this[e]},join:ft.join,includes:function(e){return-1!==this.indexOf(e)},indexOf:ft.indexOf,iterator:function(e,t,i,n){var s,o,a,l,c,h,d,u,f=[],p=this.context,m=this.selector;for("string"==typeof e&&(n=i,i=t,t=e,e=!1),o=0,a=p.length;o<a;o++){var g=new r(p[o]);if("table"===t)void 0!==(s=i.call(g,p[o],o))&&f.push(s);else if("columns"===t||"rows"===t)void 0!==(s=i.call(g,p[o],this[o],o))&&f.push(s);else if("every"===t||"column"===t||"column-rows"===t||"row"===t||"cell"===t)for(d=this[o],"column-rows"===t&&(h=bt(p[o],m.opts)),l=0,c=d.length;l<c;l++)u=d[l],void 0!==(s="cell"===t?i.call(g,p[o],u.row,u.column,o,l):i.call(g,p[o],u,o,l,h))&&f.push(s)}if(f.length||n){var _=new r(p,e?f.concat.apply([],f):f),y=_.selector;return y.rows=m.rows,y.cols=m.cols,y.opts=m.opts,_}return this},lastIndexOf:ft.lastIndexOf,length:0,map:function(e){var t=ft.map.call(this,e,this);return new r(this.context,t)},pluck:function(e){var t=h.util.get(e);return this.map(function(e){return t(e)})},pop:ft.pop,push:ft.push,reduce:ft.reduce,reduceRight:ft.reduceRight,reverse:ft.reverse,selector:null,shift:ft.shift,slice:function(){return new r(this.context,this)},sort:ft.sort,splice:ft.splice,toArray:function(){return ft.slice.call(this)},to$:function(){return c(this)},toJQuery:function(){return c(this)},unique:function(){return new r(this.context,L(this.toArray()))},unshift:ft.unshift}),window.__apiStruct=ut,r.extend=function(e,t,i){var n,s,o;if(i.length&&t&&(t instanceof r||t.__dt_wrapper))for(n=0,s=i.length;n<s;n++)"__proto__"!==(o=i[n]).name&&(t[o.name]="function"===o.type?pt(e,o.val,o):"object"===o.type?{}:o.val,t[o.name].__dt_wrapper=!0,r.extend(e,t[o.name],o.propExt))},r.register=s=function(e,t){if(Array.isArray(e))for(var i=0,n=e.length;i<n;i++)r.register(e[i],t);else{var s,o,a,l,h=e.split("."),d=ut;for(s=0,o=h.length;s<o;s++){var u=mt(d,a=(l=-1!==h[s].indexOf("()"))?h[s].replace("()",""):h[s]);u||(u={name:a,val:{},methodExt:[],propExt:[],type:"object"},d.push(u)),s===o-1?(u.val=t,u.type="function"==typeof t?"function":c.isPlainObject(t)?"object":"other"):d=l?u.methodExt:u.propExt}}},r.registerPlural=o=function(e,t,i){r.register(e,i),r.register(t,function(){var e=i.apply(this,arguments);return e===this?this:e instanceof r?e.length?Array.isArray(e[0])?new r(e.context,e[0]):e[0]:void 0:e})};var gt=function(e,t){if(Array.isArray(e)){var i=[];return e.forEach(function(e){var n=gt(e,t);ct(i,n)}),i.filter(function(e){return e})}if("number"==typeof e)return[t[e]];var n=t.map(function(e){return e.nTable});return c(n).filter(e).map(function(){var e=n.indexOf(this);return t[e]}).toArray()};s("tables()",function(e){return null!=e?new r(gt(e,this.context)):this}),s("table()",function(e){var t=this.tables(e),i=t.context;return i.length?new r(i[0]):t}),[["nodes","node","nTable"],["body","body","nTBody"],["header","header","nTHead"],["footer","footer","nTFoot"]].forEach(function(e){o("tables()."+e[0]+"()","table()."+e[1]+"()",function(){return this.iterator("table",function(t){return t[e[2]]},1)})}),[["header","aoHeader"],["footer","aoFooter"]].forEach(function(e){s("table()."+e[0]+".structure()",function(t){var i=this.columns(t).indexes().flatten().toArray(),n=this.context[0],r=pe(n,n[e[1]],i),s=i.slice().sort(function(e,t){return e-t});return r.map(function(e){return i.map(function(t){return e[s.indexOf(t)]})})})}),o("tables().containers()","table().container()",function(){return this.iterator("table",function(e){return e.nTableWrapper},1)}),s("tables().every()",function(e){var t=this;return this.iterator("table",function(i,n){e.call(t.table(n),n)})}),s("caption()",function(e,t){var i=this.context;if(void 0===e){var n=i[0].captionNode;return n&&i.length?n.innerHTML:null}return this.iterator("table",function(i){var n=c(i.nTable),r=c(i.captionNode),s=c(i.nTableWrapper);if(r.length||(r=c("<caption/>").html(e),i.captionNode=r[0],t||(n.prepend(r),t=r.css("caption-side"))),r.html(e),t&&(r.css("caption-side",t),r[0]._captionSide=t),s.find("div.dataTables_scroll").length){var o="top"===t?"Head":"Foot";s.find("div.dataTables_scroll"+o+" table").prepend(r)}else n.prepend(r)},1)}),s("caption.node()",function(){var e=this.context;return e.length?e[0].captionNode:null}),s("draw()",function(e){return this.iterator("table",function(t){"page"===e?ge(t):("string"==typeof e&&(e="full-hold"!==e),_e(t,!1===e))})}),s("page()",function(e){return void 0===e?this.page.info().page:this.iterator("table",function(t){Re(t,e)})}),s("page.info()",function(){if(0!==this.context.length){var e=this.context[0],t=e._iDisplayStart,i=e.oFeatures.bPaginate?e._iDisplayLength:-1,n=e.fnRecordsDisplay(),r=-1===i;return{page:r?0:Math.floor(t/i),pages:r?1:Math.ceil(n/i),start:t,end:e.fnDisplayEnd(),length:i,recordsTotal:e.fnRecordsTotal(),recordsDisplay:n,serverSide:"ssp"===at(e)}}}),s("page.len()",function(e){return void 0===e?0!==this.context.length?this.context[0]._iDisplayLength:void 0:this.iterator("table",function(t){Pe(t,e)})});var _t=function(e,t,i){if(i){var n=new r(e);n.one("draw",function(){i(n.ajax.json())})}if("ssp"==at(e))_e(e,t);else{Oe(e,!0);var s=e.jqXHR;s&&4!==s.readyState&&s.abort(),Se(e,{},function(i){ae(e);for(var n=Te(e,i),r=0,s=n.length;r<s;r++)J(e,n[r]);_e(e,t),Ie(e),Oe(e,!1)})}};s("ajax.json()",function(){var e=this.context;if(e.length>0)return e[0].json}),s("ajax.params()",function(){var e=this.context;if(e.length>0)return e[0].oAjaxData}),s("ajax.reload()",function(e,t){return this.iterator("table",function(i){_t(i,!1===t,e)})}),s("ajax.url()",function(e){var t=this.context;if(void 0===e){if(0===t.length)return;return t=t[0],c.isPlainObject(t.ajax)?t.ajax.url:t.ajax}return this.iterator("table",function(t){c.isPlainObject(t.ajax)?t.ajax.url=e:t.ajax=e})}),s("ajax.url().load()",function(e,t){return this.iterator("table",function(i){_t(i,!1===t,e)})});var yt=function(e,t,i,r,s){var o,a,l,c=[],h=typeof t;for(t&&"string"!==h&&"function"!==h&&void 0!==t.length||(t=[t]),a=0,l=t.length;a<l;a++)(o=(o=i("string"==typeof t[a]?t[a].trim():t[a])).filter(function(e){return null!=e}))&&o.length&&(c=c.concat(o));var d=n.selector[e];if(d.length)for(a=0,l=d.length;a<l;a++)c=d[a](r,s,c);return L(c)},vt=function(e){return e||(e={}),e.filter&&void 0===e.search&&(e.search=e.filter),c.extend({columnOrder:"implied",search:"none",order:"current",page:"all"},e)},xt=function(e){var t=new r(e.context[0]);return e.length&&t.push(e[0]),t.selector=e.selector,t.length&&t[0].length>1&&t[0].splice(1),t},bt=function(e,t){var i,n,r,s=[],o=e.aiDisplay,a=e.aiDisplayMaster,l=t.search,c=t.order,h=t.page;if("ssp"==at(e))return"removed"===l?[]:k(0,a.length);if("current"==h)for(i=e._iDisplayStart,n=e.fnDisplayEnd();i<n;i++)s.push(o[i]);else if("current"==c||"applied"==c){if("none"==l)s=a.slice();else if("applied"==l)s=o.slice();else if("removed"==l){var d={};for(i=0,n=o.length;i<n;i++)d[o[i]]=null;a.forEach(function(e){Object.prototype.hasOwnProperty.call(d,e)||s.push(e)})}}else if("index"==c||"original"==c)for(i=0,n=e.aoData.length;i<n;i++)e.aoData[i]&&("none"==l||-1===(r=o.indexOf(i))&&"removed"==l||r>=0&&"applied"==l)&&s.push(i);else if("number"==typeof c){var u=Ge(e,c,"asc");if("none"===l)s=u;else for(i=0;i<u.length;i++)(-1===(r=o.indexOf(u[i]))&&"removed"==l||r>=0&&"applied"==l)&&s.push(u[i])}return s};s("rows()",function(e,t){void 0===e?e="":c.isPlainObject(e)&&(t=e,e=""),t=vt(t);var i=this.iterator("table",function(i){return function(e,t,i){var n,r=yt("row",t,function(t){var r=v(t),s=e.aoData;if(null!==r&&!i)return[r];if(n||(n=bt(e,i)),null!==r&&-1!==n.indexOf(r))return[r];if(null==t||""===t)return n;if("function"==typeof t)return n.map(function(e){var i=s[e];return t(e,i._aData,i.nTr)?e:null});if(t.nodeName){var o=t._DT_RowIndex,a=t._DT_CellIndex;if(void 0!==o)return s[o]&&s[o].nTr===t?[o]:[];if(a)return s[a.row]&&s[a.row].nTr===t.parentNode?[a.row]:[];var l=c(t).closest("*[data-dt-row]");return l.length?[l.data("dt-row")]:[]}if("string"==typeof t&&"#"===t.charAt(0)){var h=e.aIds[t.replace(/^#/,"")];if(void 0!==h)return[h.idx]}var d=M(T(e.aoData,n,"nTr"));return c(d).filter(t).map(function(){return this._DT_RowIndex}).toArray()},e,i);return"current"!==i.order&&"applied"!==i.order||We(e,r),r}(i,e,t)},1);return i.selector.rows=e,i.selector.opts=t,i}),s("rows().nodes()",function(){return this.iterator("row",function(e,t){return e.aoData[t].nTr||void 0},1)}),s("rows().data()",function(){return this.iterator(!0,"rows",function(e,t){return T(e.aoData,t,"_aData")},1)}),o("rows().cache()","row().cache()",function(e){return this.iterator("row",function(t,i){var n=t.aoData[i];return"search"===e?n._aFilterData:n._aSortData},1)}),o("rows().invalidate()","row().invalidate()",function(e){return this.iterator("row",function(t,i){le(t,i,e)})}),o("rows().indexes()","row().index()",function(){return this.iterator("row",function(e,t){return t},1)}),o("rows().ids()","row().id()",function(e){for(var t=[],i=this.context,n=0,s=i.length;n<s;n++)for(var o=0,a=this[n].length;o<a;o++){var l=i[n].rowIdFn(i[n].aoData[this[n][o]]._aData);t.push((!0===e?"#":"")+l)}return new r(i,t)}),o("rows().remove()","row().remove()",function(){return this.iterator("row",function(e,t){var i=e.aoData,n=i[t],r=e.aiDisplayMaster.indexOf(t);-1!==r&&e.aiDisplayMaster.splice(r,1),e._iRecordsDisplay>0&&e._iRecordsDisplay--,st(e);var s=e.rowIdFn(n._aData);void 0!==s&&delete e.aIds[s],i[t]=null}),this}),s("rows.add()",function(e){var t=this.iterator("table",function(t){var i,n,r,s=[];for(n=0,r=e.length;n<r;n++)(i=e[n]).nodeName&&"TR"===i.nodeName.toUpperCase()?s.push(K(t,i)[0]):s.push(J(t,i));return s},1),i=this.rows(-1);return i.pop(),ct(i,t),i}),s("row()",function(e,t){return xt(this.rows(e,t))}),s("row().data()",function(e){var t=this.context;if(void 0===e)return t.length&&this.length&&this[0].length?t[0].aoData[this[0]]._aData:void 0;var i=t[0].aoData[this[0]];return i._aData=e,Array.isArray(e)&&i.nTr&&i.nTr.id&&se(t[0].rowId)(e,i.nTr.id),le(t[0],this[0],"data"),this}),s("row().node()",function(){var e=this.context;if(e.length&&this.length&&this[0].length){var t=e[0].aoData[this[0]];if(t&&t.nTr)return t.nTr}return null}),s("row.add()",function(e){e instanceof c&&e.length&&(e=e[0]);var t=this.iterator("table",function(t){return e.nodeName&&"TR"===e.nodeName.toUpperCase()?K(t,e)[0]:J(t,e)});return this.row(t[0])}),c(document).on("plugin-init.dt",function(e,t){var i=new r(t);i.on("stateSaveParams.DT",function(e,t,i){for(var n=t.rowIdFn,r=t.aiDisplayMaster,s=[],o=0;o<r.length;o++){var a=r[o],l=t.aoData[a];l._detailsShow&&s.push("#"+n(l._aData))}i.childRows=s}),i.on("stateLoaded.DT",function(e,t,n){wt(i,n)}),wt(i,i.state.loaded())});var wt=function(e,t){t&&t.childRows&&e.rows(t.childRows.map(function(e){return e.replace(/([^:\\]*(?:\\.[^:\\]*)*):/g,"$1\\:")})).every(function(){rt(e.settings()[0],null,"requestChild",[this])})},St=h.util.throttle(function(e){Je(e[0])},500),Tt=function(e,t){var i=e.context;if(i.length){var n=i[0].aoData[void 0!==t?t:e[0]];n&&n._details&&(n._details.detach(),n._detailsShow=void 0,n._details=void 0,c(n.nTr).removeClass("dt-hasChild"),St(i))}},kt=function(e,t){var i=e.context;if(i.length&&e.length){var n=i[0].aoData[e[0]];n._details&&(n._detailsShow=t,t?(n._details.insertAfter(n.nTr),c(n.nTr).addClass("dt-hasChild")):(n._details.detach(),c(n.nTr).removeClass("dt-hasChild")),rt(i[0],null,"childRow",[t,e.row(e[0])]),Mt(i[0]),St(i))}},Mt=function(e){var t=new r(e),i=".dt.DT_details",n="draw"+i,s="column-sizing"+i,o="destroy"+i,a=e.aoData;t.off(n+" "+s+" "+o),S(a,"_details").length>0&&(t.on(n,function(i,n){e===n&&t.rows({page:"current"}).eq(0).each(function(e){var t=a[e];t._detailsShow&&t._details.insertAfter(t.nTr)})}),t.on(s,function(t,i){if(e===i)for(var n,r=V(i),s=0,o=a.length;s<o;s++)(n=a[s])&&n._details&&n._details.each(function(){var e=c(this).children("td");1==e.length&&e.attr("colspan",r)})}),t.on(o,function(i,n){if(e===n)for(var r=0,s=a.length;r<s;r++)a[r]&&a[r]._details&&Tt(t,r)}))},At="row().child",Ct=At+"()";s(Ct,function(e,t){var i=this.context;return void 0===e?i.length&&this.length&&i[0].aoData[this[0]]?i[0].aoData[this[0]]._details:void 0:(!0===e?this.child.show():!1===e?Tt(this):i.length&&this.length&&function(e,t,i,n){var r=[],s=function(i,n){if(Array.isArray(i)||i instanceof c)for(var o=0,a=i.length;o<a;o++)s(i[o],n);else if(i.nodeName&&"tr"===i.nodeName.toLowerCase())i.setAttribute("data-dt-row",t.idx),r.push(i);else{var l=c("<tr><td></td></tr>").attr("data-dt-row",t.idx).addClass(n);c("td",l).addClass(n).html(i)[0].colSpan=V(e),r.push(l[0])}};s(i,n),t._details&&t._details.detach(),t._details=c(r),t._detailsShow&&t._details.insertAfter(t.nTr)}(i[0],i[0].aoData[this[0]],e,t),this)}),s([At+".show()",Ct+".show()"],function(){return kt(this,!0),this}),s([At+".hide()",Ct+".hide()"],function(){return kt(this,!1),this}),s([At+".remove()",Ct+".remove()"],function(){return Tt(this),this}),s(At+".isShown()",function(){var e=this.context;return e.length&&this.length&&e[0].aoData[this[0]]&&e[0].aoData[this[0]]._detailsShow||!1});var Dt,Lt,Et=/^([^:]+)?:(name|title|visIdx|visible)$/,It=function(e,t,i,n,r,s){for(var o=[],a=0,l=r.length;a<l;a++)o.push(Q(e,r[a],t,s));return o},Pt=function(e,t,i){var n=e.aoHeader,r=e.titleRow,s=null;if(void 0!==i)s=i;else if(!0===r)s=0;else if(!1===r)s=n.length-1;else if(null!==r)s=r;else{for(var o=0;o<n.length;o++)n[o][t].unique&&c("span.dt-column-title",n[o][t].cell).text()&&(s=o);null===s&&(s=0)}return n[s][t].cell};function Rt(e,t){c(e).find("span.dt-column-order").remove(),c(e).find("span.dt-column-title").each(function(){var e=c(this).html();c(this).parent().parent().append(e),c(this).remove()}),c(e).find("div.dt-column-"+t).remove(),c("th, td",e).removeAttr("data-dt-column")}s("columns()",function(e,t){void 0===e?e="":c.isPlainObject(e)&&(t=e,e=""),t=vt(t);var i=this.iterator("table",function(i){return function(e,t,i){var n,r,s=e.aoColumns,o=function(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<e[i].length;n++){var r=e[i][n].cell;t.includes(r)||t.push(r)}return t}(e.aoHeader),a=yt("column",t,function(t){var a=v(t);if(""===t)return k(s.length);if(null!==a)return[a>=0?a:s.length+a];if("function"==typeof t){var l=bt(e,i);return s.map(function(i,n){return t(n,It(e,n,0,0,l),Pt(e,n))?n:null})}var h="string"==typeof t?t.match(Et):"";if(h)switch(h[2]){case"visIdx":case"visible":if(h[1]&&h[1].match(/^\d+$/)){var d=parseInt(h[1],10);if(d<0){var u=s.map(function(e,t){return e.bVisible?t:null});return[u[u.length+d]]}return[H(e,d)]}return s.map(function(e,t){return e.bVisible?h[1]?c(o[t]).filter(h[1]).length>0?t:null:t:null});case"name":return n||(n=S(s,"sName")),n.map(function(e,t){return e===h[1]?t:null});case"title":return r||(r=S(s,"sTitle")),r.map(function(e,t){return e===h[1]?t:null});default:return[]}if(t.nodeName&&t._DT_CellIndex)return[t._DT_CellIndex.column];var f=c(o).filter(t).map(function(){return Z(this)}).toArray().sort(function(e,t){return e-t});if(f.length||!t.nodeName)return f;var p=c(t).closest("*[data-dt-column]");return p.length?[p.data("dt-column")]:[]},e,i);return i.columnOrder&&"index"===i.columnOrder?a.sort(function(e,t){return e-t}):a}(i,e,t)},1);return i.selector.cols=e,i.selector.opts=t,i}),o("columns().header()","column().header()",function(e){return this.iterator("column",function(t,i){return Pt(t,i,e)},1)}),o("columns().footer()","column().footer()",function(e){return this.iterator("column",function(t,i){return t.aoFooter.length?t.aoFooter[void 0!==e?e:0][i].cell:null},1)}),o("columns().data()","column().data()",function(){return this.iterator("column-rows",It,1)}),o("columns().render()","column().render()",function(e){return this.iterator("column-rows",function(t,i,n,r,s){return It(t,i,0,0,s,e)},1)}),o("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(e,t){return e.aoColumns[t].mData},1)}),o("columns().cache()","column().cache()",function(e){return this.iterator("column-rows",function(t,i,n,r,s){return T(t.aoData,s,"search"===e?"_aFilterData":"_aSortData",i)},1)}),o("columns().init()","column().init()",function(){return this.iterator("column",function(e,t){return e.aoColumns[t]},1)}),o("columns().names()","column().name()",function(){return this.iterator("column",function(e,t){return e.aoColumns[t].sName},1)}),o("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(e,t,i,n,r){return T(e.aoData,r,"anCells",t)},1)}),o("columns().titles()","column().title()",function(e,t){return this.iterator("column",function(i,n){"number"==typeof e&&(t=e,e=void 0);var r=c("span.dt-column-title",this.column(n).header(t));return void 0!==e?(r.html(e),this):r.html()},1)}),o("columns().types()","column().type()",function(){return this.iterator("column",function(e,t){var i=e.aoColumns[t].sType;return i||$(e),i},1)}),o("columns().visible()","column().visible()",function(e,t){var i=this,n=[],r=this.iterator("column",function(t,i){if(void 0===e)return t.aoColumns[i].bVisible;(function(e,t,i){var n,r,s,o,a=e.aoColumns,l=a[t],h=e.aoData;if(void 0===i)return l.bVisible;if(l.bVisible===i)return!1;if(i){var d=S(a,"bVisible").indexOf(!0,t+1);for(r=0,s=h.length;r<s;r++)h[r]&&(o=h[r].nTr,n=h[r].anCells,o&&o.insertBefore(n[t],n[d]||null))}else c(S(e.aoData,"anCells",t)).detach();return l.bVisible=i,je(e),!0})(t,i,e)&&n.push(i)});return void 0!==e&&this.iterator("table",function(r){me(r,r.aoHeader),me(r,r.aoFooter),r.aiDisplay.length||c(r.nTBody).find("td[colspan]").attr("colspan",V(r)),Je(r),i.iterator("column",function(i,r){n.includes(r)&&rt(i,null,"column-visibility",[i,r,e,t])}),n.length&&(void 0===t||t)&&i.columns.adjust()}),r}),o("columns().widths()","column().width()",function(){var e=this.columns(":visible").count(),t=c("<tr>").html("<td>"+Array(e).join("</td><td>")+"</td>");c(this.table().body()).append(t);var i=t.children().map(function(){return c(this).outerWidth()});return t.remove(),this.iterator("column",function(e,t){var n=j(e,t);return null!==n?i[n]:0},1)}),o("columns().indexes()","column().index()",function(e){return this.iterator("column",function(t,i){return"visible"===e?j(t,i):i},1)}),s("columns.adjust()",function(){return this.iterator("table",function(e){e.containerWidth=-1,B(e)},1)}),s("column.index()",function(e,t){if(0!==this.context.length){var i=this.context[0];if("fromVisible"===e||"toData"===e)return H(i,t);if("fromData"===e||"toVisible"===e)return j(i,t)}}),s("column()",function(e,t){return xt(this.columns(e,t))}),s("cells()",function(e,t,i){if(c.isPlainObject(e)&&(void 0===e.row?(i=e,e=null):(i=t,t=null)),c.isPlainObject(t)&&(i=t,t=null),null==t)return this.iterator("table",function(t){return function(e,t,i){var n,r,s,o,a,l,h,d=e.aoData,u=bt(e,i),f=M(T(d,u,"anCells")),p=c(E([],f)),m=e.aoColumns.length;return yt("cell",t,function(t){var i="function"==typeof t;if(null==t||i){for(r=[],s=0,o=u.length;s<o;s++)for(n=u[s],a=0;a<m;a++)l={row:n,column:a},i?(h=d[n],t(l,Q(e,n,a),h.anCells?h.anCells[a]:null)&&r.push(l)):r.push(l);return r}if(c.isPlainObject(t))return void 0!==t.column&&void 0!==t.row&&-1!==u.indexOf(t.row)?[t]:[];var f=p.filter(t).map(function(e,t){return{row:t._DT_CellIndex.row,column:t._DT_CellIndex.column}}).toArray();return f.length||!t.nodeName?f:(h=c(t).closest("*[data-dt-row]")).length?[{row:h.data("dt-row"),column:h.data("dt-column")}]:[]},e,i)}(t,e,vt(i))});var n,r,s,o,a=i?{page:i.page,order:i.order,search:i.search}:{},l=this.columns(t,a),h=this.rows(e,a),d=this.iterator("table",function(e,t){var i=[];for(n=0,r=h[t].length;n<r;n++)for(s=0,o=l[t].length;s<o;s++)i.push({row:h[t][n],column:l[t][s]});return i},1),u=i&&i.selected?this.cells(d,i):d;return c.extend(u.selector,{cols:t,rows:e,opts:i}),u}),o("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(e,t,i){var n=e.aoData[t];return n&&n.anCells?n.anCells[i]:void 0},1)}),s("cells().data()",function(){return this.iterator("cell",function(e,t,i){return Q(e,t,i)},1)}),o("cells().cache()","cell().cache()",function(e){return e="search"===e?"_aFilterData":"_aSortData",this.iterator("cell",function(t,i,n){return t.aoData[i][e][n]},1)}),o("cells().render()","cell().render()",function(e){return this.iterator("cell",function(t,i,n){return Q(t,i,n,e)},1)}),o("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(e,t,i){return{row:t,column:i,columnVisible:j(e,i)}},1)}),o("cells().invalidate()","cell().invalidate()",function(e){return this.iterator("cell",function(t,i,n){le(t,i,e,n)})}),s("cell()",function(e,t,i){return xt(this.cells(e,t,i))}),s("cell().data()",function(e){var t,i,n,r,s,o,a=this.context,l=this[0];return void 0===e?a.length&&l.length?Q(a[0],l[0].row,l[0].column):void 0:(t=a[0],i=l[0].row,n=l[0].column,r=e,s=t.aoColumns[n],o=t.aoData[i]._aData,s.fnSetData(o,r,{settings:t,row:i,col:n}),le(a[0],l[0].row,"data",l[0].column),this)}),s("order()",function(e,t){var i=this.context,n=Array.prototype.slice.call(arguments);return void 0===e?0!==i.length?i[0].aaSorting:void 0:("number"==typeof e?e=[[e,t]]:n.length>1&&(e=n),this.iterator("table",function(t){var i=[];Ue(t,i,e),t.aaSorting=i}))}),s("order.listener()",function(e,t,i){return this.iterator("table",function(n){Ve(n,e,{},t,i)})}),s("order.fixed()",function(e){if(!e){var t=this.context,i=t.length?t[0].aaSortingFixed:void 0;return Array.isArray(i)?{pre:i}:i}return this.iterator("table",function(t){t.aaSortingFixed=c.extend(!0,{},e)})}),s(["columns().order()","column().order()"],function(e){var t=this;return e?this.iterator("table",function(i,n){i.aaSorting=t[n].map(function(t){return[t,e]})}):this.iterator("column",function(e,t){for(var i=$e(e),n=0,r=i.length;n<r;n++)if(i[n].col===t)return i[n].dir;return null},1)}),o("columns().orderable()","column().orderable()",function(e){return this.iterator("column",function(t,i){var n=t.aoColumns[i];return e?n.asSorting:n.bSortable},1)}),s("processing()",function(e){return this.iterator("table",function(t){Oe(t,e)})}),s("search()",function(e,t,i,n){var r=this.context;return void 0===e?0!==r.length?r[0].oPreviousSearch.search:void 0:this.iterator("table",function(r){r.oFeatures.bFilter&&Me(r,"object"==typeof t?c.extend(r.oPreviousSearch,t,{search:e}):c.extend(r.oPreviousSearch,{search:e,regex:null!==t&&t,smart:null===i||i,caseInsensitive:null===n||n}))})}),s("search.fixed()",function(e,t){var i=this.iterator(!0,"table",function(i){var n=i.searchFixed;return e?void 0===t?n[e]:(null===t?delete n[e]:n[e]=t,this):Object.keys(n)});return void 0!==e&&void 0===t?i[0]:i}),o("columns().search()","column().search()",function(e,t,i,n){return this.iterator("column",function(r,s){var o=r.aoPreSearchCols;if(void 0===e)return o[s].search;r.oFeatures.bFilter&&("object"==typeof t?c.extend(o[s],t,{search:e}):c.extend(o[s],{search:e,regex:null!==t&&t,smart:null===i||i,caseInsensitive:null===n||n}),Me(r,r.oPreviousSearch))})}),s(["columns().search.fixed()","column().search.fixed()"],function(e,t){var i=this.iterator(!0,"column",function(i,n){var r=i.aoColumns[n].searchFixed;return e?void 0===t?r[e]||null:(null===t?delete r[e]:r[e]=t,this):Object.keys(r)});return void 0!==e&&void 0===t?i[0]:i}),s("state()",function(e,t){if(!e)return this.context.length?this.context[0].oSavedState:null;var i=c.extend(!0,{},e);return this.iterator("table",function(e){!1!==t&&(i.time=+new Date+100),Ke(e,i,function(){})})}),s("state.clear()",function(){return this.iterator("table",function(e){e.fnStateSaveCallback.call(e.oInstance,e,{})})}),s("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null}),s("state.save()",function(){return this.iterator("table",function(e){Je(e)})}),h.use=function(e,t){var i="string"==typeof e?t:e,n="string"==typeof t?t:e;if(void 0===i&&"string"==typeof n)switch(n){case"lib":case"jq":return c;case"win":return window;case"datetime":return h.DateTime;case"luxon":return Nt;case"moment":return Yt;case"bootstrap":return Dt||l;case"foundation":return Lt||window.Foundation;default:return null}"lib"===n||"jq"===n||i&&i.fn&&i.fn.jquery?c=i:"win"===n||i&&i.document?(window=i,document=i.document):"datetime"===n||i&&"DateTime"===i.type?h.DateTime=i:"luxon"===n||i&&i.FixedOffsetZone?Nt=i:"moment"===n||i&&i.isMoment?Yt=i:"bootstrap"===n||i&&i.Modal&&"modal"===i.Modal.NAME?Dt=i:("foundation"===n||i&&i.Reveal)&&(Lt=i)},h.factory=function(e,t){var i=!1;return e&&e.document&&(window=e,document=e.document),t&&t.fn&&t.fn.jquery&&(c=t,i=!0),i},h.versionCheck=function(e,t){for(var i,n,r=t?t.split("."):h.version.split("."),s=e.split("."),o=0,a=s.length;o<a;o++)if((i=parseInt(r[o],10)||0)!==(n=parseInt(s[o],10)||0))return i>n;return!0},h.isDataTable=function(e){var t=c(e).get(0),i=!1;return e instanceof h.Api||(c.each(h.settings,function(e,n){var r=n.nScrollHead?c("table",n.nScrollHead)[0]:null,s=n.nScrollFoot?c("table",n.nScrollFoot)[0]:null;n.nTable!==t&&r!==t&&s!==t||(i=!0)}),i)},h.tables=function(e){var t=!1;c.isPlainObject(e)&&(t=e.api,e=e.visible);var i=h.settings.filter(function(t){return!!(!e||e&&c(t.nTable).is(":visible"))}).map(function(e){return e.nTable});return t?new r(i):i},h.camelToHungarian=R,s("$()",function(e,t){var i=this.rows(t).nodes(),n=c(i);return c([].concat(n.filter(e).toArray(),n.find(e).toArray()))}),c.each(["on","one","off"],function(e,t){s(t+"()",function(){var e=Array.prototype.slice.call(arguments);e[0]=e[0].split(/\s/).map(function(e){return e.match(/\.dt\b/)?e:e+".dt"}).join(" ");var i=c(this.tables().nodes());return i[t].apply(i,e),this})}),s("clear()",function(){return this.iterator("table",function(e){ae(e)})}),s("error()",function(e){return this.iterator("table",function(t){Qe(t,0,e)})}),s("settings()",function(){return new r(this.context,this.context)}),s("init()",function(){var e=this.context;return e.length?e[0].oInit:null}),s("data()",function(){return this.iterator("table",function(e){return S(e.aoData,"_aData")}).flatten()}),s("trigger()",function(e,t,i){return this.iterator("table",function(n){return rt(n,null,e,t,i)}).flatten()}),s("ready()",function(e){var t=this.context;return e?this.tables().every(function(){var t=this;this.context[0]._bInitComplete?e.call(t):this.on("init.dt.DT",function(){e.call(t)})}):t.length?t[0]._bInitComplete||!1:null}),s("destroy()",function(e){return e=e||!1,this.iterator("table",function(t){var i=t.oClasses,n=t.nTable,s=t.nTBody,o=t.nTHead,a=t.nTFoot,l=c(n),d=c(s),u=c(t.nTableWrapper),f=t.aoData.map(function(e){return e?e.nTr:null}),p=i.order;t.bDestroying=!0,rt(t,"aoDestroyCallback","destroy",[t],!0),e||new r(t).columns().visible(!0),t.resizeObserver&&t.resizeObserver.disconnect(),u.off(".DT").find(":not(tbody *)").off(".DT"),c(window).off(".DT-"+t.sInstance),n!=o.parentNode&&(l.children("thead").detach(),l.append(o)),a&&n!=a.parentNode&&(l.children("tfoot").detach(),l.append(a)),Rt(o,"header"),Rt(a,"footer"),t.colgroup.remove(),t.aaSorting=[],t.aaSortingFixed=[],qe(t),c(l).find("th, td").removeClass(c.map(h.ext.type.className,function(e){return e}).join(" ")),c("th, td",o).removeClass(p.none+" "+p.canAsc+" "+p.canDesc+" "+p.isAsc+" "+p.isDesc).css("width","").removeAttr("aria-sort"),d.children().detach(),d.append(f);var m=t.nTableWrapper.parentNode,g=t.nTableWrapper.nextSibling,_=e?"remove":"detach";l[_](),u[_](),!e&&m&&(m.insertBefore(n,g),l.css("width",t.sDestroyWidth).removeClass(i.table));var y=h.settings.indexOf(t);-1!==y&&h.settings.splice(y,1)})}),c.each(["column","row","cell"],function(e,t){s(t+"s().every()",function(e){var i,n=this.selector.opts,r=this,s=0;return this.iterator("every",function(o,a,l){i=r[t](a,n),"cell"===t?e.call(i,i[0][0].row,i[0][0].column,l,s):e.call(i,a,l,s),s++})})}),s("i18n()",function(e,t,i){var n=this.context[0],r=re(e)(n.oLanguage);return void 0===r&&(r=t),c.isPlainObject(r)&&(r=void 0!==i&&void 0!==r[i]?r[i]:!1===i?r:r._),"string"==typeof r?r.replace("%d",i):r}),h.version="2.3.3",h.settings=[],h.models={},h.models.oSearch={caseInsensitive:!0,search:"",regex:!1,smart:!0,return:!1},h.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,src:null,idx:-1,displayData:null},h.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null,maxLenString:null,searchFixed:null},h.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],bAutoWidth:!0,bDeferRender:!0,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:null,titleRow:null,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnStateLoadCallback:function(e){try{return JSON.parse((-1===e.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+e.sInstance+"_"+location.pathname))}catch(e){return{}}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(e,t){try{(-1===e.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+e.sInstance+"_"+location.pathname,JSON.stringify(t))}catch(e){}},fnStateSaveParams:null,iStateDuration:7200,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{orderable:": Activate to sort",orderableReverse:": Activate to invert sorting",orderableRemove:": Activate to remove sorting",paginate:{first:"First",last:"Last",next:"Next",previous:"Previous",number:""}},oPaginate:{sFirst:"«",sLast:"»",sNext:"›",sPrevious:"‹"},entries:{_:"entries",1:"entry"},lengthLabels:{"-1":"All"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ _ENTRIES-TOTAL_",sInfoEmpty:"Showing 0 to 0 of 0 _ENTRIES-TOTAL_",sInfoFiltered:"(filtered from _MAX_ total _ENTRIES-MAX_)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"_MENU_ _ENTRIES_ per page",sLoadingRecords:"Loading...",sProcessing:"",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},orderDescReverse:!0,oSearch:c.extend({},h.models.oSearch),layout:{topStart:"pageLength",topEnd:"search",bottomStart:"info",bottomEnd:"paging"},sDom:null,searchDelay:null,sPaginationType:"",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId",caption:null,iDeferLoading:null,on:null},P(h.defaults),h.defaults.column={aDataSort:null,iDataSort:-1,ariaTitle:"",asSorting:["asc","desc",""],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null},P(h.defaults.column),h.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:!0,bLengthChange:!0,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollbarLeft:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},searchFixed:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",pagingControls:0,iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,bAjaxDataGet:!0,jqXHR:null,json:void 0,oAjaxData:void 0,sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==at(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==at(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var e=this._iDisplayLength,t=this._iDisplayStart,i=t+e,n=this.aiDisplay.length,r=this.oFeatures,s=r.bPaginate;return r.bServerSide?!1===s||-1===e?t+n:Math.min(t+e,this._iRecordsDisplay):!s||i>n||-1===e?n:i},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null,caption:"",captionNode:null,colgroup:null,deferLoading:null,typeDetect:!0,resizeObserver:null,containerWidth:-1,orderDescReverse:null,orderIndicators:!0,orderHandler:!0,titleRow:null};var Ot=h.ext.pager;c.extend(Ot,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(){return["numbers"]},simple_numbers:function(){return["previous","numbers","next"]},full_numbers:function(){return["first","previous","numbers","next","last"]},first_last:function(){return["first","last"]},first_last_numbers:function(){return["first","numbers","last"]},_numbers:ii,numbers_length:7}),c.extend(!0,h.ext.renderer,{pagingButton:{_:function(e,t,i,n,r){var s,o=e.oClasses.paging,a=[o.button];return n&&a.push(o.active),r&&a.push(o.disabled),{display:s="ellipsis"===t?c('<span class="ellipsis"></span>').html(i)[0]:c("<button>",{class:a.join(" "),role:"link",type:"button"}).html(i),clicker:s}}},pagingContainer:{_:function(e,t){return t}}});var zt=function(e,t){return function(i){return y(i)||"string"!=typeof i||(i=i.replace(u," "),e&&(i=A(i)),t&&(i=D(i,!1))),i}};function Ft(e,t,i,n,r){return Yt?e[t](r):Nt?e[i](r):n?e[n](r):e}var Nt,Yt,Bt=!1;function Ht(e,t,i){var n;if(window.luxon&&!Nt&&(Nt=window.luxon),window.moment&&!Yt&&(Yt=window.moment),Yt){if(!(n=Yt.utc(e,t,i,!0)).isValid())return null}else if(Nt){if(!(n=t&&"string"==typeof e?Nt.DateTime.fromFormat(e,t):Nt.DateTime.fromISO(e)).isValid)return null;n=n.setLocale(i)}else t?(Bt||alert("DataTables warning: Formatted date without Moment.js or Luxon - https://datatables.net/tn/17"),Bt=!0):n=new Date(e);return n}function jt(e){return function(t,i,n,r){0===arguments.length?(n="en",i=null,t=null):1===arguments.length?(n="en",i=t,t=null):2===arguments.length&&(n=i,i=t,t=null);var s="datetime"+(i?"-"+i:"");return h.ext.type.order[s+"-pre"]||h.type(s,{detect:function(e){return e===s&&s},order:{pre:function(e){return e.valueOf()}},className:"dt-right"}),function(o,a){if(null==o)if("--now"===r){var l=new Date;o=new Date(Date.UTC(l.getFullYear(),l.getMonth(),l.getDate(),l.getHours(),l.getMinutes(),l.getSeconds()))}else o="";if("type"===a)return s;if(""===o)return"sort"!==a?"":Ht("0000-01-01 00:00:00",null,n);if(null!==i&&t===i&&"sort"!==a&&"type"!==a&&!(o instanceof Date))return o;var c=Ht(o,t,n);if(null===c)return o;if("sort"===a)return c;var h=null===i?Ft(c,"toDate","toJSDate","")[e]():Ft(c,"format","toFormat","toISOString",i);return"display"===a?C(h):h}}}var Vt=",",Wt=".";if(void 0!==window.Intl)try{for(var Ut=(new Intl.NumberFormat).formatToParts(100000.1),$t=0;$t<Ut.length;$t++)"group"===Ut[$t].type?Vt=Ut[$t].value:"decimal"===Ut[$t].type&&(Wt=Ut[$t].value)}catch(e){}h.datetime=function(e,t){var i="datetime-"+e;t||(t="en"),h.ext.type.order[i]||h.type(i,{detect:function(n){var r=Ht(n,e,t);return!(""!==n&&!r)&&i},order:{pre:function(i){return Ht(i,e,t)||0}},className:"dt-right"})},h.render={date:jt("toLocaleDateString"),datetime:jt("toLocaleString"),time:jt("toLocaleTimeString"),number:function(e,t,i,n,r){return null==e&&(e=Vt),null==t&&(t=Wt),{display:function(s){if("number"!=typeof s&&"string"!=typeof s)return s;if(""===s||null===s)return s;var o=s<0?"-":"",a=parseFloat(s),l=Math.abs(a);if(l>=1e11||l<1e-4&&0!==l){var c=a.toExponential(i).split(/e\+?/);return c[0]+" x 10<sup>"+c[1]+"</sup>"}if(isNaN(a))return C(s);a=a.toFixed(i),s=Math.abs(a);var h=parseInt(s,10),d=i?t+(s-h).toFixed(i).substring(2):"";return 0===h&&0===parseFloat(d)&&(o=""),o+(n||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,e)+d+(r||"")}}},text:function(){return{display:C,filter:C}}};var Gt=h.ext.type;h.type=function(e,t,i){if(!t)return{className:Gt.className[e],detect:Gt.detect.find(function(t){return t._name===e}),order:{pre:Gt.order[e+"-pre"],asc:Gt.order[e+"-asc"],desc:Gt.order[e+"-desc"]},render:Gt.render[e],search:Gt.search[e]};var n=function(t,i){Gt[t][e]=i},r=function(t){Object.defineProperty(t,"_name",{value:e});var i=Gt.detect.findIndex(function(t){return t._name===e});-1===i?Gt.detect.unshift(t):Gt.detect.splice(i,1,t)},s=function(t){Gt.order[e+"-pre"]=t.pre,Gt.order[e+"-asc"]=t.asc,Gt.order[e+"-desc"]=t.desc};void 0===i&&(i=t,t=null),"className"===t?n("className",i):"detect"===t?r(i):"order"===t?s(i):"render"===t?n("render",i):"search"===t?n("search",i):t||(i.className&&n("className",i.className),void 0!==i.detect&&r(i.detect),i.order&&s(i.order),void 0!==i.render&&n("render",i.render),void 0!==i.search&&n("search",i.search))},h.types=function(){return Gt.detect.map(function(e){return e._name})};var Xt=function(e,t){return e=null!=e?e.toString().toLowerCase():"",t=null!=t?t.toString().toLowerCase():"",e.localeCompare(t,navigator.languages[0]||navigator.language,{numeric:!0,ignorePunctuation:!0})},qt=function(e,t){return e=A(e),t=A(t),Xt(e,t)};h.type("string",{detect:function(){return"string"},order:{pre:function(e){return y(e)&&"boolean"!=typeof e?"":"string"==typeof e?e.toLowerCase():e.toString?e.toString():""}},search:zt(!1,!0)}),h.type("string-utf8",{detect:{allOf:function(e){return!0},oneOf:function(e){return!y(e)&&navigator.languages&&"string"==typeof e&&e.match(/[^\x00-\x7F]/)}},order:{asc:Xt,desc:function(e,t){return-1*Xt(e,t)}},search:zt(!1,!0)}),h.type("html",{detect:{allOf:function(e){return y(e)||"string"==typeof e&&-1!==e.indexOf("<")},oneOf:function(e){return!y(e)&&"string"==typeof e&&-1!==e.indexOf("<")}},order:{pre:function(e){return y(e)?"":e.replace?A(e).trim().toLowerCase():e+""}},search:zt(!0,!0)}),h.type("html-utf8",{detect:{allOf:function(e){return y(e)||"string"==typeof e&&-1!==e.indexOf("<")},oneOf:function(e){return navigator.languages&&!y(e)&&"string"==typeof e&&-1!==e.indexOf("<")&&"string"==typeof e&&e.match(/[^\x00-\x7F]/)}},order:{asc:qt,desc:function(e,t){return-1*qt(e,t)}},search:zt(!0,!0)}),h.type("date",{className:"dt-type-date",detect:{allOf:function(e){if(e&&!(e instanceof Date)&&!m.test(e))return null;var t=Date.parse(e);return null!==t&&!isNaN(t)||y(e)},oneOf:function(e){return e instanceof Date||"string"==typeof e&&m.test(e)}},order:{pre:function(e){var t=Date.parse(e);return isNaN(t)?-1/0:t}}}),h.type("html-num-fmt",{className:"dt-type-numeric",detect:{allOf:function(e,t){var i=t.oLanguage.sDecimal;return w(e,i,!0,!1)},oneOf:function(e,t){var i=t.oLanguage.sDecimal;return w(e,i,!0,!1)}},order:{pre:function(e,t){var i=t.oLanguage.sDecimal;return Zt(e,i,f,_)}},search:zt(!0,!0)}),h.type("html-num",{className:"dt-type-numeric",detect:{allOf:function(e,t){var i=t.oLanguage.sDecimal;return w(e,i,!1,!0)},oneOf:function(e,t){var i=t.oLanguage.sDecimal;return w(e,i,!1,!1)}},order:{pre:function(e,t){var i=t.oLanguage.sDecimal;return Zt(e,i,f)}},search:zt(!0,!0)}),h.type("num-fmt",{className:"dt-type-numeric",detect:{allOf:function(e,t){var i=t.oLanguage.sDecimal;return b(e,i,!0,!0)},oneOf:function(e,t){var i=t.oLanguage.sDecimal;return b(e,i,!0,!1)}},order:{pre:function(e,t){var i=t.oLanguage.sDecimal;return Zt(e,i,_)}}}),h.type("num",{className:"dt-type-numeric",detect:{allOf:function(e,t){var i=t.oLanguage.sDecimal;return b(e,i,!1,!0)},oneOf:function(e,t){var i=t.oLanguage.sDecimal;return b(e,i,!1,!1)}},order:{pre:function(e,t){var i=t.oLanguage.sDecimal;return Zt(e,i)}}});var Zt=function(e,t,i,n){if(0!==e&&(!e||"-"===e))return-1/0;var r=typeof e;return"number"===r||"bigint"===r?e:(t&&(e=x(e,t)),e.replace&&(i&&(e=e.replace(i,"")),n&&(e=e.replace(n,""))),1*e)};function Jt(e,t,i){i&&(e[t]=i)}c.extend(!0,h.ext.renderer,{footer:{_:function(e,t,i){t.addClass(i.tfoot.cell)}},header:{_:function(e,t,i){t.addClass(i.thead.cell),e.oFeatures.bSort||t.addClass(i.order.none);var n=e.titleRow,r=t.closest("thead").find("tr"),s=t.parent().index();"disable"===t.attr("data-dt-order")||"disable"===t.parent().attr("data-dt-order")||!0===n&&0!==s||!1===n&&s!==r.length-1||"number"==typeof n&&s!==n||c(e.nTable).on("order.dt.DT column-visibility.dt.DT",function(n,r,s){if(e===r){var o=r.sortDetails;if(o){var a=S(o,"col");if("column-visibility"!==n.type||a.includes(s)){var l,c=i.order,h=r.api.columns(t),d=e.aoColumns[h.flatten()[0]],u=h.orderable().includes(!0),f="",p=h.indexes(),m=h.orderable(!0).flatten(),g=e.iTabIndex,_=r.orderHandler&&u;t.removeClass(c.isAsc+" "+c.isDesc).toggleClass(c.none,!u).toggleClass(c.canAsc,_&&m.includes("asc")).toggleClass(c.canDesc,_&&m.includes("desc"));var y=!0;for(l=0;l<p.length;l++)a.includes(p[l])||(y=!1);if(y){var v=h.order();t.addClass(v.includes("asc")?c.isAsc:""+v.includes("desc")?c.isDesc:"")}var x=-1;for(l=0;l<a.length;l++)if(e.aoColumns[a[l]].bVisible){x=a[l];break}if(p[0]==x){var b=o[0],w=d.asSorting;t.attr("aria-sort","asc"===b.dir?"ascending":"descending"),f=w[b.index+1]?"Reverse":"Remove"}else t.removeAttr("aria-sort");if(u){var T=t.find(".dt-column-order");T.attr("role","button").attr("aria-label",u?d.ariaTitle+r.api.i18n("oAria.orderable"+f):d.ariaTitle),-1!==g&&T.attr("tabindex",g)}}}}})}},layout:{_:function(e,t,i){var n=e.oClasses.layout,r=c("<div/>").attr("id",i.id||null).addClass(i.className||n.row).appendTo(t);h.ext.renderer.layout._forLayoutRow(i,function(e,t){if("id"!==e&&"className"!==e){var i="";t.table&&(r.addClass(n.tableRow),i+=n.tableCell+" "),i+="start"===e?n.start:"end"===e?n.end:n.full,c("<div/>").attr({id:t.id||null,class:t.className?t.className:n.cell+" "+i}).append(t.contents).appendTo(r)}})},_forLayoutRow:function(e,t){var i=function(e){switch(e){case"":return 0;case"start":return 1;case"end":return 2;default:return 3}};Object.keys(e).sort(function(e,t){return i(e)-i(t)}).forEach(function(i){t(i,e[i])})}}}),h.feature={},h.feature.register=function(e,t,i){h.ext.features[e]=t,i&&n.feature.push({cFeature:i,fnInit:t})},h.feature.register("div",function(e,t){var i=c("<div>")[0];return t&&(Jt(i,"className",t.className),Jt(i,"id",t.id),Jt(i,"innerHTML",t.html),Jt(i,"textContent",t.text)),i}),h.feature.register("info",function(e,t){if(!e.oFeatures.bInfo)return null;var i=e.oLanguage,n=e.sTableId,r=c("<div/>",{class:e.oClasses.info.container});return t=c.extend({callback:i.fnInfoCallback,empty:i.sInfoEmpty,postfix:i.sInfoPostFix,search:i.sInfoFiltered,text:i.sInfo},t),e.aoDrawCallback.push(function(e){!function(e,t,i){var n=e._iDisplayStart+1,r=e.fnDisplayEnd(),s=e.fnRecordsTotal(),o=e.fnRecordsDisplay(),a=o?t.text:t.empty;o!==s&&(a+=" "+t.search),a=lt(e,a+=t.postfix),t.callback&&(a=t.callback.call(e.oInstance,e,n,r,s,o,a)),i.html(a),rt(e,null,"info",[e,i[0],a])}(e,t,r)}),e._infoEl||(r.attr({"aria-live":"polite",id:n+"_info",role:"status"}),c(e.nTable).attr("aria-describedby",n+"_info"),e._infoEl=r),r},"i");var Kt=0;function Qt(e){var t=[];return e.numbers&&t.push("numbers"),e.previousNext&&(t.unshift("previous"),t.push("next")),e.firstLast&&(t.unshift("first"),t.push("last")),t}function ei(e,t,i){if(e._bInitComplete){var n=i.type?h.ext.pager[i.type]:Qt,r=e.oLanguage.oAria.paginate||{},s=e._iDisplayStart,o=e._iDisplayLength,a=e.fnRecordsDisplay(),l=-1===o,d=l?0:Math.ceil(s/o),u=l?1:Math.ceil(a/o),f=[],p=[],m=n(i).map(function(e){return"numbers"===e?ii(d,u,i.buttons,i.boundaryNumbers):e});f=f.concat.apply(f,m);for(var g=0;g<f.length;g++){var _=f[g],y=ti(e,_,d,u),v=ot(e,"pagingButton")(e,_,y.display,y.active,y.disabled),x="string"==typeof _?r[_]:r.number?r.number+(_+1):null;c(v.clicker).attr({"aria-controls":e.sTableId,"aria-disabled":y.disabled?"true":null,"aria-current":y.active?"page":null,"aria-label":x,"data-dt-idx":_,tabIndex:y.disabled?-1:e.iTabIndex&&"span"!==v.clicker[0].nodeName.toLowerCase()?e.iTabIndex:null}),"number"!=typeof _&&c(v.clicker).addClass(_),it(v.clicker,{action:_},function(t){t.preventDefault(),Re(e,t.data.action,!0)}),p.push(v.display)}var b=ot(e,"pagingContainer")(e,p),w=t.find(document.activeElement).data("dt-idx");if(t.empty().append(b),void 0!==w&&t.find("[data-dt-idx="+w+"]").trigger("focus"),p.length){var S=c(p[0]).outerHeight();i.buttons>1&&S>0&&c(t).height()>=2*S-10&&ei(e,t,c.extend({},i,{buttons:i.buttons-2}))}}}function ti(e,t,i,n){var r=e.oLanguage.oPaginate,s={display:"",active:!1,disabled:!1};switch(t){case"ellipsis":s.display="…";break;case"first":s.display=r.sFirst,0===i&&(s.disabled=!0);break;case"previous":s.display=r.sPrevious,0===i&&(s.disabled=!0);break;case"next":s.display=r.sNext,0!==n&&i!==n-1||(s.disabled=!0);break;case"last":s.display=r.sLast,0!==n&&i!==n-1||(s.disabled=!0);break;default:"number"==typeof t&&(s.display=e.fnFormatNumber(t+1),i===t&&(s.active=!0))}return s}function ii(e,t,i,n){var r=[],s=Math.floor(i/2),o=n?2:1,a=n?1:0;return t<=i?r=k(0,t):1===i?r=[e]:3===i?e<=1?r=[0,1,"ellipsis"]:e>=t-2?(r=k(t-2,t)).unshift("ellipsis"):r=["ellipsis",e,"ellipsis"]:e<=s?((r=k(0,i-o)).push("ellipsis"),n&&r.push(t-1)):e>=t-1-s?((r=k(t-(i-o),t)).unshift("ellipsis"),n&&r.unshift(0)):((r=k(e-s+o,e+s-a)).push("ellipsis"),r.unshift("ellipsis"),n&&(r.push(t-1),r.unshift(0))),r}h.feature.register("search",function(e,t){if(!e.oFeatures.bFilter)return null;var i=e.oClasses.search,n=e.sTableId,r=e.oLanguage,s=e.oPreviousSearch,o='<input type="search" class="'+i.input+'"/>';-1===(t=c.extend({placeholder:r.sSearchPlaceholder,processing:!1,text:r.sSearch},t)).text.indexOf("_INPUT_")&&(t.text+="_INPUT_"),t.text=lt(e,t.text);var a=t.text.match(/_INPUT_$/),l=t.text.match(/^_INPUT_/),d=t.text.replace(/_INPUT_/,""),u="<label>"+t.text+"</label>";l?u="_INPUT_<label>"+d+"</label>":a&&(u="<label>"+d+"</label>_INPUT_");var f=c("<div>").addClass(i.container).append(u.replace(/_INPUT_/,o));f.find("label").attr("for","dt-search-"+Kt),f.find("input").attr("id","dt-search-"+Kt),Kt++;var p=function(i){var n=this.value;s.return&&"Enter"!==i.key||n!=s.search&&ze(e,t.processing,function(){s.search=n,Me(e,s),e._iDisplayStart=0,ge(e)})},m=null!==e.searchDelay?e.searchDelay:0,g=c("input",f).val(s.search).attr("placeholder",t.placeholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",m?h.util.debounce(p,m):p).on("mouseup.DT",function(e){setTimeout(function(){p.call(g[0],e)},10)}).on("keypress.DT",function(e){if(13==e.keyCode)return!1}).attr("aria-controls",n);return c(e.nTable).on("search.dt.DT",function(t,i){e===i&&g[0]!==document.activeElement&&g.val("function"!=typeof s.search?s.search:"")}),f},"f"),h.feature.register("paging",function(e,t){if(!e.oFeatures.bPaginate)return null;t=c.extend({buttons:h.ext.pager.numbers_length,type:e.sPaginationType,boundaryNumbers:!0,firstLast:!0,previousNext:!0,numbers:!0},t);var i=c("<div/>").addClass(e.oClasses.paging.container+(t.type?" paging_"+t.type:"")).append(c("<nav>").attr("aria-label","pagination").addClass(e.oClasses.paging.nav)),n=function(){ei(e,i.children(),t)};return e.aoDrawCallback.push(n),c(e.nTable).on("column-sizing.dt.DT",n),i},"p");var ni=0;h.feature.register("pageLength",function(e,t){var i=e.oFeatures;if(!i.bPaginate||!i.bLengthChange)return null;t=c.extend({menu:e.aLengthMenu,text:e.oLanguage.sLengthMenu},t);var n,r=e.oClasses.length,s=e.sTableId,o=t.menu,a=[],l=[];if(Array.isArray(o[0]))a=o[0],l=o[1];else for(n=0;n<o.length;n++)c.isPlainObject(o[n])?(a.push(o[n].value),l.push(o[n].label)):(a.push(o[n]),l.push(o[n]));var h=t.text.match(/_MENU_$/),d=t.text.match(/^_MENU_/),u=t.text.replace(/_MENU_/,""),f="<label>"+t.text+"</label>";d?f="_MENU_<label>"+u+"</label>":h&&(f="<label>"+u+"</label>_MENU_");var p="tmp-"+ +new Date,m=c("<div/>").addClass(r.container).append(f.replace("_MENU_",'<span id="'+p+'"></span>')),g=[];Array.prototype.slice.call(m.find("label")[0].childNodes).forEach(function(e){e.nodeType===Node.TEXT_NODE&&g.push({el:e,text:e.textContent})});var _=function(t){g.forEach(function(i){i.el.textContent=lt(e,i.text,t)})},y=c("<select/>",{"aria-controls":s,class:r.select});for(n=0;n<a.length;n++){var v=e.api.i18n("lengthLabels."+a[n],null);null===v&&(v="number"==typeof l[n]?e.fnFormatNumber(l[n]):l[n]),y[0][n]=new Option(v,a[n])}return m.find("label").attr("for","dt-length-"+ni),y.attr("id","dt-length-"+ni),ni++,m.find("#"+p).replaceWith(y),c("select",m).val(e._iDisplayLength).on("change.DT",function(){Pe(e,c(this).val()),ge(e)}),c(e.nTable).on("length.dt.DT",function(t,i,n){e===i&&(c("select",m).val(n),_(n))}),_(e._iDisplayLength),m},"l"),c.fn.dataTable=h,h.$=c,c.fn.dataTableSettings=h.settings,c.fn.dataTableExt=h.ext,c.fn.DataTable=function(e){return c(this).dataTable(e).api()},c.each(h,function(e,t){c.fn.DataTable[e]=t});const ri=796==i.j?h:null},5719:function(e,t,i){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],d:["jedan dan","jednog dana"],dd:["dan","dana","dana"],M:["jedan mesec","jednog meseca"],MM:["mesec","meseca","meseci"],y:["jednu godinu","jedne godine"],yy:["godinu","godine","godina"]},correctGrammaticalCase:function(e,t){return e%10>=1&&e%10<=4&&(e%100<10||e%100>=20)?e%10==1?t[0]:t[1]:t[2]},translate:function(e,i,n,r){var s,o=t.words[n];return 1===n.length?"y"===n&&i?"jedna godina":r||i?o[0]:o[1]:(s=t.correctGrammaticalCase(e,o),"yy"===n&&i&&"godinu"===s?e+" godina":e+" "+s)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:t.translate,dd:t.translate,M:t.translate,MM:t.translate,y:t.translate,yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(i(5093))},5766:function(e,t,i){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function i(e,t,i,n){return t?r(i)[0]:n?r(i)[1]:r(i)[2]}function n(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,o){var a=e+" ";return 1===e?a+i(0,t,s[0],o):t?a+(n(e)?r(s)[1]:r(s)[0]):o?a+r(s)[1]:a+(n(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,i,n){return t?"kelios sekundės":n?"kelių sekundžių":"kelias sekundes"},ss:s,m:i,mm:s,h:i,hh:s,d:i,dd:s,M:i,MM:s,y:i,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(i(5093))},5784:function(e,t,i){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),i="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function n(e){return e>1&&e<5}function r(e,t,i,r){var s=e+" ";switch(i){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(n(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(n(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(n(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(n(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(n(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(n(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:i,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:case 4:case 5:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},5802:function(e,t,i){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,i){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(i(5093))},5867:function(e,t,i){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,i){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(i(5093))},5995:function(e,t,i){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(i(5093))},6e3:function(e,t,i){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,i){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(i(5093))},6006:(e,t,i)=>{var n,r,s;r=[i(4692),i(1503)],void 0===(s="function"==typeof(n=function(e){"use strict";if(!e.ui||!e.ui.fancytree){var t,i,n=null,r=new RegExp(/\.|\//),s=/[&<>"'/]/g,o=/[<>"'/]/g,a="$recursive_request",l="$request_target_invalid",c={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},h={16:!0,17:!0,18:!0},d={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},u={16:"shift",17:"ctrl",18:"alt",91:"meta",93:"meta"},f={0:"",1:"left",2:"middle",3:"right"},p="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),m={},g="columns types".split(" "),_="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),y={},v={},x={active:!0,children:!0,data:!0,focus:!0};for(t=0;t<p.length;t++)m[p[t]]=!0;for(t=0;t<_.length;t++)i=_[t],y[i]=!0,i!==i.toLowerCase()&&(v[i.toLowerCase()]=i);var b=Array.isArray;return w(e.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),Date.now||(Date.now=function(){return(new Date).getTime()}),z.prototype={_findDirectChild:function(e){var t,i,n=this.children;if(n)if("string"==typeof e){for(t=0,i=n.length;t<i;t++)if(n[t].key===e)return n[t]}else{if("number"==typeof e)return this.children[e];if(e.parent===this)return e}return null},_setChildren:function(e){w(e&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var t=0,i=e.length;t<i;t++)this.children.push(new z(this,e[t]));this.tree._callHook("treeStructureChanged",this.tree,"setChildren")},addChildren:function(t,i){var n,r,s,o,a=this.getFirstChild(),l=this.getLastChild(),c=[];for(e.isPlainObject(t)&&(t=[t]),this.children||(this.children=[]),n=0,r=t.length;n<r;n++)c.push(new z(this,t[n]));if(o=c[0],null==i?this.children=this.children.concat(c):(i=this._findDirectChild(i),w((s=e.inArray(i,this.children))>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[s,0].concat(c))),a&&!i){for(n=0,r=c.length;n<r;n++)c[n].render();a!==this.getFirstChild()&&a.renderStatus(),l!==this.getLastChild()&&l.renderStatus()}else(!this.parent||this.parent.ul||this.tr)&&this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===c.length?c[0]:null),o},addClass:function(e){return this.toggleClass(e,!0)},addNode:function(e,t){switch(void 0!==t&&"over"!==t||(t="child"),t){case"after":return this.getParent().addChildren(e,this.getNextSibling());case"before":return this.getParent().addChildren(e,this);case"firstChild":var i=this.children?this.children[0]:null;return this.addChildren(e,i);case"child":case"over":return this.addChildren(e)}w(!1,"Invalid mode: "+t)},addPagingNode:function(t,i){var n,r;if(i=i||"child",!1!==t)return t=e.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},t),this.partload=!0,this.addNode(t,i);for(n=this.children.length-1;n>=0;n--)"paging"===(r=this.children[n]).statusNodeType&&this.removeChild(r);this.partload=!1},appendSibling:function(e){return this.addNode(e,"after")},applyCommand:function(e,t){return this.tree.applyCommand(e,this,t)},applyPatch:function(e){if(null===e)return this.remove(),L(this);var t,i,n={children:!0,expanded:!0,parent:!0};for(t in e)S(e,t)&&(i=e[t],n[t]||T(i)||(y[t]?this[t]=i:this.data[t]=i));return S(e,"children")&&(this.removeChildren(),e.children&&this._setChildren(e.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),S(e,"expanded")?this.setExpanded(e.expanded):L(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(e,t,i){return e.addNode(this.toDict(!0,i),t)},countChildren:function(e){var t,i,n,r=this.children;if(!r)return 0;if(n=r.length,!1!==e)for(t=0,i=n;t<i;t++)n+=r[t].countChildren();return n},debug:function(e){this.tree.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),M("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(e){var t=e?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(t,this)},error:function(e){this.tree.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),M("error",arguments))},findAll:function(e){e=T(e)?e:O(e);var t=[];return this.visit(function(i){e(i)&&t.push(i)}),t},findFirst:function(e){e=T(e)?e:O(e);var t=null;return this.visit(function(i){if(e(i))return t=i,!1}),t},findRelatedNode:function(e,t){return this.tree.findRelatedNode(this,e,t)},_changeSelectStatusAttrs:function(e){var t=!1,i=this.tree.options,r=n.evalOption("unselectable",this,this,i,!1),s=n.evalOption("unselectableStatus",this,this,i,void 0);switch(r&&null!=s&&(e=s),e){case!1:t=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:t=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case void 0:t=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:w(!1,"invalid state: "+e)}return t&&this.renderStatus(),t},fixSelection3AfterClick:function(e){var t=this.isSelected();this.visit(function(e){if(e._changeSelectStatusAttrs(t),e.radiogroup)return"skip"}),this.fixSelection3FromEndNodes(e)},fixSelection3FromEndNodes:function(e){var t=this.tree.options;w(3===t.selectMode,"expected selectMode 3"),function e(i){var r,s,o,a,l,c,h,d,u=i.children;if(u&&u.length){for(c=!0,h=!1,r=0,s=u.length;r<s;r++)a=e(o=u[r]),n.evalOption("unselectableIgnore",o,o,t,!1)||(!1!==a&&(h=!0),!0!==a&&(c=!1));l=!!c||!!h&&void 0}else l=null==(d=n.evalOption("unselectableStatus",i,i,t,void 0))?!!i.selected:!!d;return i.partsel&&!i.selected&&i.lazy&&null==i.children&&(l=void 0),i._changeSelectStatusAttrs(l),l}(this),this.visitParents(function(e){var i,r,s,o,a,l=e.children,c=!0,h=!1;for(i=0,r=l.length;i<r;i++)s=l[i],n.evalOption("unselectableIgnore",s,s,t,!1)||(((o=null==(a=n.evalOption("unselectableStatus",s,s,t,void 0))?!!s.selected:!!a)||s.partsel)&&(h=!0),o||(c=!1));o=!!c||!!h&&void 0,e._changeSelectStatusAttrs(o)})},fromDict:function(t){for(var i in t)y[i]?this[i]=t[i]:"data"===i?e.extend(this.data,t.data):T(t[i])||x[i]||(this.data[i]=t[i]);t.children&&(this.removeChildren(),this.addChildren(t.children)),this.renderTitle()},getChildren:function(){if(void 0!==this.hasChildren())return this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return e.inArray(this,this.parent.children)},getIndexHier:function(t,i){t=t||".";var n,r=[];return e.each(this.getParentList(!1,!0),function(e,t){n=""+(t.getIndex()+1),i&&(n=("0000000"+n).substr(-i)),r.push(n)}),r.join(t)},getKeyPath:function(e){var t=this.tree.options.keyPathSeparator;return t+this.getPath(!e,"key",t)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},getNextSibling:function(){if(this.parent){var e,t,i=this.parent.children;for(e=0,t=i.length-1;e<t;e++)if(i[e]===this)return i[e+1]}return null},getParent:function(){return this.parent},getParentList:function(e,t){for(var i=[],n=t?this:this.parent;n;)(e||n.parent)&&i.unshift(n),n=n.parent;return i},getPath:function(e,t,i){e=!1!==e,i=i||"/";var n,r=[],s=T(t=t||"title");return this.visitParents(function(e){e.parent&&(n=s?t(e):e[t],r.unshift(n))},e),r.join(i)},getPrevSibling:function(){if(this.parent){var e,t,i=this.parent.children;for(e=1,t=i.length;e<t;e++)if(i[e]===this)return i[e-1]}return null},getSelectedNodes:function(e){var t=[];return this.visit(function(i){if(i.selected&&(t.push(i),!0===e))return"skip"}),t},hasChildren:function(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)},hasClass:function(e){return(" "+(this.extraClasses||"")+" ").indexOf(" "+e+" ")>=0},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},info:function(e){this.tree.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),M("info",arguments))},isActive:function(){return this.tree.activeNode===this},isBelowOf:function(e){return this.getIndexHier(".",5)>e.getIndexHier(".",5)},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(t){if(!t||t.tree!==this.tree)return!1;for(var i=this.parent;i;){if(i===t)return!0;i===i.parent&&e.error("Recursive parent link: "+i),i=i.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var e=this.parent;return!e||e.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var e=this.parent;return!e||e.children[e.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||void 0!==this.hasChildren()},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartsel:function(){return!this.selected&&!!this.partsel},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return void 0===this.hasChildren()},isVisible:function(){var e,t,i=this.tree.enableFilter,n=this.getParentList(!1,!1);if(i&&!this.match&&!this.subMatchCount)return!1;for(e=0,t=n.length;e<t;e++)if(!n[e].expanded)return!1;return!0},lazyLoad:function(t){e.error("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.")},load:function(e){var t,i,n=this,r=this.isExpanded();return w(this.isLazy(),"load() requires a lazy node"),e||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(i=this.tree._triggerNodeEvent("lazyLoad",this))?L(this):(w("boolean"!=typeof i,"lazyLoad event must return source in data.result"),t=this.tree._callHook("nodeLoadChildren",this,i),r?(this.expanded=!0,t.always(function(){n.render()})):t.always(function(){n.renderStatus()}),t)):L(this)},makeVisible:function(t){var i,n=this,r=[],s=new e.Deferred,o=this.getParentList(!1,!1),a=o.length,l=!(t&&!0===t.noAnimation),c=!(t&&!1===t.scrollIntoView);for(i=a-1;i>=0;i--)r.push(o[i].setExpanded(!0,t));return e.when.apply(e,r).done(function(){c?n.scrollIntoView(l).done(function(){s.resolve()}):s.resolve()}),s.promise()},moveTo:function(t,i,n){void 0===i||"over"===i?i="child":"firstChild"===i&&(t.children&&t.children.length?(i="before",t=t.children[0]):i="child");var r,s=this.tree,o=this.parent,a="child"===i?t:t.parent;if(this!==t){if(this.parent?a.isDescendantOf(this)&&e.error("Cannot move a node to its own descendant"):e.error("Cannot move system root"),a!==o&&o.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===a)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else w((r=e.inArray(this,this.parent.children))>=0,"invalid source parent"),this.parent.children.splice(r,1);if(this.parent=a,a.hasChildren())switch(i){case"child":a.children.push(this);break;case"before":w((r=e.inArray(t,a.children))>=0,"invalid target parent"),a.children.splice(r,0,this);break;case"after":w((r=e.inArray(t,a.children))>=0,"invalid target parent"),a.children.splice(r+1,0,this);break;default:e.error("Invalid mode "+i)}else a.children=[this];n&&t.visit(n,!0),a===o?a.triggerModifyChild("move",this):a.triggerModifyChild("add",this),s!==t.tree&&(this.warn("Cross-tree moveTo is experimental!"),this.visit(function(e){e.tree=t.tree},!0)),s._callHook("treeStructureChanged",s,"moveTo"),o.isDescendantOf(a)||o.render(),a.isDescendantOf(o)||a===o||a.render()}},navigate:function(t,i){var n,r=e.ui.keyCode;switch(t){case"left":case r.LEFT:if(this.expanded)return this.setExpanded(!1);break;case"right":case r.RIGHT:if(!this.expanded&&(this.children||this.lazy))return this.setExpanded()}if(n=this.findRelatedNode(t)){try{n.makeVisible({scrollIntoView:!1})}catch(e){}return!1===i?(n.setFocus(),L()):n.setActive()}return this.warn("Could not find related node '"+t+"'."),L()},remove:function(){return this.parent.removeChild(this)},removeChild:function(e){return this.tree._callHook("nodeRemoveChild",this,e)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},removeClass:function(e){return this.toggleClass(e,!1)},render:function(e,t){return this.tree._callHook("nodeRender",this,e,t)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},replaceWith:function(i){var n,r=this.parent,s=e.inArray(this,r.children),o=this;return w(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(n=this.tree._callHook("nodeLoadChildren",this,i)).done(function(e){var i=o.children;for(t=0;t<i.length;t++)i[t].parent=r;r.children.splice.apply(r.children,[s+1,0].concat(i)),o.children=null,o.remove(),r.render()}).fail(function(){o.setExpanded()}),n},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(t,i){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.debug("clearTimeout(%o)",this.tree.timer)),this.tree.timer=null;var n=this;switch(t){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){n.tree.debug("setTimeout: trigger expand"),n.setExpanded(!0)},i);break;case"activate":this.tree.timer=setTimeout(function(){n.tree.debug("setTimeout: trigger activate"),n.setActive(!0)},i);break;default:e.error("Invalid mode "+t)}},scrollIntoView:function(t,i){if(void 0!==i&&((n=i).tree&&void 0!==n.statusNodeType))throw Error("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.");var n,r=e.extend({effects:!0===t?{duration:200,queue:!1}:t,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent,topNode:null},i),s=r.scrollParent,o=this.tree.$container,a=o.css("overflow-y");s?s.jquery||(s=e(s)):s=this.tree.tbody?o.scrollParent():"scroll"===a||"auto"===a?o:o.scrollParent(),s[0]!==document&&s[0]!==document.body||(this.debug("scrollIntoView(): normalizing scrollParent to 'window':",s[0]),s=e(window));var l,c,h,d=new e.Deferred,u=this,f=e(this.span).height(),p=r.scrollOfs.top||0,m=r.scrollOfs.bottom||0,g=s.height(),_=s.scrollTop(),y=s,v=s[0]===window,x=r.topNode||null,b=null;return this.isRootNode()||!this.isVisible()?(this.info("scrollIntoView(): node is invisible."),L()):(v?(c=e(this.span).offset().top,l=x&&x.span?e(x.span).offset().top:0,y=e("html,body")):(w(s[0]!==document&&s[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),h=s.offset().top,c=e(this.span).offset().top-h+_,l=x?e(x.span).offset().top-h+_:0,g-=Math.max(0,s.innerHeight()-s[0].clientHeight)),c<_+p?b=c-p:c+f>_+g-m&&(b=c+f-g+m,x&&(w(x.isRootNode()||x.isVisible(),"topNode must be visible"),l<b&&(b=l-p))),null===b?d.resolveWith(this):r.effects?(r.effects.complete=function(){d.resolveWith(u)},y.stop(!0).animate({scrollTop:b},r.effects)):(y[0].scrollTop=b,d.resolveWith(this)),d.promise())},setActive:function(e,t){return this.tree._callHook("nodeSetActive",this,e,t)},setExpanded:function(e,t){return this.tree._callHook("nodeSetExpanded",this,e,t)},setFocus:function(e){return this.tree._callHook("nodeSetFocus",this,e)},setSelected:function(e,t){return this.tree._callHook("nodeSetSelected",this,e,t)},setStatus:function(e,t,i){return this.tree._callHook("nodeSetStatus",this,e,t,i)},setTitle:function(e){this.title=e,this.renderTitle(),this.triggerModify("rename")},sortChildren:function(e,t){var i,n,r=this.children;if(r){if(e=e||function(e,t){var i=e.title.toLowerCase(),n=t.title.toLowerCase();return i===n?0:i>n?1:-1},r.sort(e),t)for(i=0,n=r.length;i<n;i++)r[i].children&&r[i].sortChildren(e,"$norender$");"$norender$"!==t&&this.render(),this.triggerModifyChild("sort")}},toDict:function(t,i){var n,r,s,o,a={},l=this;if(e.each(_,function(e,t){(l[t]||!1===l[t])&&(a[t]=l[t])}),e.isEmptyObject(this.data)||(a.data=e.extend({},this.data),e.isEmptyObject(a.data)&&delete a.data),i){if(!1===(o=i(a,l)))return!1;"skip"===o&&(t=!1)}if(t&&b(this.children))for(a.children=[],n=0,r=this.children.length;n<r;n++)(s=this.children[n]).isStatusNode()||!1!==(o=s.toDict(!0,i))&&a.children.push(o);return a},toggleClass:function(t,i){var n,r,s=t.match(/\S+/g)||[],o=0,a=!1,l=this[this.tree.statusClassPropName],c=" "+(this.extraClasses||"")+" ";for(l&&e(l).toggleClass(t,i);n=s[o++];)if(r=c.indexOf(" "+n+" ")>=0,i=void 0===i?!r:!!i)r||(c+=n+" ",a=!0);else for(;c.indexOf(" "+n+" ")>-1;)c=c.replace(" "+n+" "," ");return this.extraClasses=k(c),a},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return"FancytreeNode@"+this.key+"[title='"+this.title+"']"},triggerModifyChild:function(t,i,n){var r,s=this.tree.options.modifyChild;s&&(i&&i.parent!==this&&e.error("childNode "+i+" is not a child of "+this),r={node:this,tree:this.tree,operation:t,childNode:i||null},n&&e.extend(r,n),s({type:"modifyChild"},r))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var i,n,r=!0,s=this.children;if(!0===t&&(!1===(r=e(this))||"skip"===r))return r;if(s)for(i=0,n=s.length;i<n&&!1!==(r=s[i].visit(e,!0));i++);return r},visitAndLoad:function(t,i,n){var r,s,o,a=this;return!t||!0!==i||!1!==(s=t(a))&&"skip"!==s?a.children||a.lazy?(r=new e.Deferred,o=[],a.load().done(function(){for(var i=0,n=a.children.length;i<n;i++){if(!1===(s=a.children[i].visitAndLoad(t,!0,!0))){r.reject();break}"skip"!==s&&o.push(s)}e.when.apply(this,o).then(function(){r.resolve()})}),r.promise()):L():n?s:L()},visitParents:function(e,t){if(t&&!1===e(this))return!1;for(var i=this.parent;i;){if(!1===e(i))return!1;i=i.parent}return!0},visitSiblings:function(e,t){var i,n,r,s=this.parent.children;for(i=0,n=s.length;i<n;i++)if(r=s[i],(t||r!==this)&&!1===e(r))return!1;return!0},warn:function(e){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),M("warn",arguments))}},F.prototype={_makeHookContext:function(t,i,n){var r,s;return void 0!==t.node?(i&&t.originalEvent!==i&&e.error("invalid args"),r=t):t.tree?r={node:t,tree:s=t.tree,widget:s.widget,options:s.widget.options,originalEvent:i,typeInfo:s.types[t.type]||{}}:t.widget?r={node:null,tree:t,widget:t.widget,options:t.widget.options,originalEvent:i}:e.error("invalid args"),n&&e.extend(r,n),r},_callHook:function(t,i,n){var r=this._makeHookContext(i),s=this[t],o=Array.prototype.slice.call(arguments,2);return T(s)||e.error("_callHook('"+t+"') is not a function"),o.unshift(r),s.apply(this,o)},_setExpiringValue:function(e,t,i){this._tempCache[e]={value:t,expire:Date.now()+(+i||50)}},_getExpiringValue:function(e){var t=this._tempCache[e];return t&&t.expire>Date.now()?t.value:(delete this._tempCache[e],null)},_usesExtension:function(t){return e.inArray(t,this.options.extensions)>=0},_requireExtension:function(t,i,n,r){null!=n&&(n=!!n);var s=this._local.name,o=this.options.extensions,a=e.inArray(t,o)<e.inArray(s,o),l=i&&null==this.ext[t],c=!l&&null!=n&&n!==a;return w(s&&s!==t,"invalid or same name '"+s+"' (require yourself?)"),!l&&!c||(r||(l||i?(r="'"+s+"' extension requires '"+t+"'",c&&(r+=" to be registered "+(n?"before":"after")+" itself")):r="If used together, `"+t+"` must be registered "+(n?"before":"after")+" `"+s+"`"),e.error(r),!1)},activateKey:function(e,t){var i=this.getNodeByKey(e);return i?i.setActive(!0,t):this.activeNode&&this.activeNode.setActive(!1,t),i},addPagingNode:function(e,t){return this.rootNode.addPagingNode(e,t)},applyCommand:function(t,i,n){var r;switch(i=i||this.getActiveNode(),t){case"moveUp":(r=i.getPrevSibling())&&(i.moveTo(r,"before"),i.setActive());break;case"moveDown":(r=i.getNextSibling())&&(i.moveTo(r,"after"),i.setActive());break;case"indent":(r=i.getPrevSibling())&&(i.moveTo(r,"child"),r.setExpanded(),i.setActive());break;case"outdent":i.isTopLevel()||(i.moveTo(i.getParent(),"after"),i.setActive());break;case"remove":r=i.getPrevSibling()||i.getParent(),i.remove(),r&&r.setActive();break;case"addChild":i.editCreateNode("child","");break;case"addSibling":i.editCreateNode("after","");break;case"rename":i.editStart();break;case"down":case"first":case"last":case"left":case"parent":case"right":case"up":return i.navigate(t);default:e.error("Unhandled command: '"+t+"'")}},applyPatch:function(t){var i,n,r,s,o,a,l=t.length,c=[];for(n=0;n<l;n++)w(2===(r=t[n]).length,"patchList must be an array of length-2-arrays"),s=r[0],o=r[1],(a=null===s?this.rootNode:this.getNodeByKey(s))?(i=new e.Deferred,c.push(i),a.applyPatch(o).always(I(i,a))):this.warn("could not find node with key '"+s+"'");return e.when.apply(e,c).promise()},clear:function(e){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(e){this.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),M("log",arguments))},destroy:function(){this.widget.destroy()},enable:function(e){!1===e?this.widget.disable():this.widget.enable()},enableUpdate:function(e){return e=!1!==e,!!this._enableUpdate==!!e?e:(this._enableUpdate=e,e?(this.debug("enableUpdate(true): redraw "),this._callHook("treeStructureChanged",this,"enableUpdate"),this.render()):this.debug("enableUpdate(false)..."),!e)},error:function(e){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),M("error",arguments))},expandAll:function(e,t){var i=this.enableUpdate(!1);e=!1!==e,this.visit(function(i){!1!==i.hasChildren()&&i.isExpanded()!==e&&i.setExpanded(e,t)}),this.enableUpdate(i)},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(e,t){var i,n=null,r=this.getFirstChild();function s(i){if(e(i)&&(n=i),n||i===t)return!1}return e="string"==typeof e?(i=new RegExp("^"+e,"i"),function(e){return i.test(e.title)}):e,t=t||r,this.visitRows(s,{start:t,includeSelf:!1}),n||t===r||this.visitRows(s,{start:r,includeSelf:!0}),n},findRelatedNode:function(t,i,n){var r=null,s=e.ui.keyCode;switch(i){case"parent":case s.BACKSPACE:t.parent&&t.parent.parent&&(r=t.parent);break;case"first":case s.HOME:this.visit(function(e){if(e.isVisible())return r=e,!1});break;case"last":case s.END:this.visit(function(e){e.isVisible()&&(r=e)});break;case"left":case s.LEFT:t.expanded?t.setExpanded(!1):t.parent&&t.parent.parent&&(r=t.parent);break;case"right":case s.RIGHT:t.expanded||!t.children&&!t.lazy?t.children&&t.children.length&&(r=t.children[0]):(t.setExpanded(),r=t);break;case"up":case s.UP:this.visitRows(function(e){return r=e,!1},{start:t,reverse:!0,includeSelf:!1});break;case"down":case s.DOWN:this.visitRows(function(e){return r=e,!1},{start:t,includeSelf:!1});break;default:this.tree.warn("Unknown relation '"+i+"'.")}return r},generateFormElements:function(t,i,n){n=n||{};var r,s="string"==typeof t?t:"ft_"+this._id+"[]",o="string"==typeof i?i:"ft_"+this._id+"_active",a="fancytree_result_"+this._id,l=e("#"+a),c=3===this.options.selectMode&&!1!==n.stopOnParents;function h(t){l.append(e("<input>",{type:"checkbox",name:s,value:t.key,checked:!0}))}l.length?l.empty():l=e("<div>",{id:a}).hide().insertAfter(this.$container),!1!==i&&this.activeNode&&l.append(e("<input>",{type:"radio",name:o,value:this.activeNode.key,checked:!0})),n.filter?this.visit(function(e){var t=n.filter(e);if("skip"===t)return t;!1!==t&&h(e)}):!1!==t&&(r=this.getSelectedNodes(c),e.each(r,function(e,t){h(t)}))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getOption:function(e){return this.widget.option(e)},getNodeByKey:function(e,t){var i,n;return!t&&(i=document.getElementById(this.options.idPrefix+e))?i.ftnode?i.ftnode:null:(t=t||this.rootNode,n=null,e=""+e,t.visit(function(t){if(t.key===e)return n=t,!1},!0),n)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){this.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),M("info",arguments))},isLoading:function(){var e=!1;return this.rootNode.visit(function(t){if(t._isLoading||t._requestId)return e=!0,!1},!0),e},loadKeyPath:function(t,i){var n,r,s,o=this,a=new e.Deferred,l=this.getRootNode(),c=this.options.keyPathSeparator,h=[],d=e.extend({},i);for("function"==typeof i?n=i:i&&i.callback&&(n=i.callback),d.callback=function(e,t,i){n&&n.call(e,t,i),a.notifyWith(e,[{node:t,status:i}])},null==d.matchKey&&(d.matchKey=function(e,t){return e.key===t}),b(t)||(t=[t]),r=0;r<t.length;r++)(s=t[r]).charAt(0)===c&&(s=s.substr(1)),h.push(s.split(c));return setTimeout(function(){o._loadKeyPathImpl(a,d,l,h).done(function(){a.resolve()})},0),a.promise()},_loadKeyPathImpl:function(t,i,n,r){var s,o,a,l,c,h,d,u,f,p,m=this;function g(e,t){var n,r,s=e.children;if(s)for(n=0,r=s.length;n<r;n++)if(i.matchKey(s[n],t))return s[n];return null}for(d={},o=0;o<r.length;o++)for(f=r[o],u=n;f.length;){if(a=f.shift(),!(l=g(u,a))){this.warn("loadKeyPath: key not found: "+a+" (parent: "+u+")"),i.callback(this,a,"error");break}if(0===f.length){i.callback(this,l,"ok");break}if(l.lazy&&void 0===l.hasChildren()){i.callback(this,l,"loaded"),d[a=l.key]?d[a].pathSegList.push(f):d[a]={parent:l,pathSegList:[f]};break}i.callback(this,l,"loaded"),u=l}function _(e,t,n){i.callback(m,t,"loading"),t.load().done(function(){m._loadKeyPathImpl.call(m,e,i,t,n).always(I(e,m))}).fail(function(n){m.warn("loadKeyPath: error loading lazy "+t),i.callback(m,l,"error"),e.rejectWith(m)})}for(c in s=[],d)S(d,c)&&(h=d[c],p=new e.Deferred,s.push(p),_(p,h.parent,h.pathSegList));return e.when.apply(e,s).promise()},reactivate:function(e){var t,i=this.activeNode;return i?(this.activeNode=null,t=i.setActive(!0,{noFocus:!0}),e&&i.setFocus(),t):L()},reload:function(e){return this._callHook("treeClear",this),this._callHook("treeLoad",this,e)},render:function(e,t){return this.rootNode.render(e,t)},selectAll:function(e){this.visit(function(t){t.setSelected(e)})},setFocus:function(e){return this._callHook("treeSetFocus",this,e)},setOption:function(e,t){return this.widget.option(e,t)},debugTime:function(e){this.options.debugLevel>=4&&window.console.time(this+" - "+e)},debugTimeEnd:function(e){this.options.debugLevel>=4&&window.console.timeEnd(this+" - "+e)},toDict:function(e,t){var i=this.rootNode.toDict(!0,t);return e?i:i.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(e,t,i,n){var r=this._makeHookContext(t,i,n),s=this.widget._trigger(e,i,r);return!1!==s&&void 0!==r.result?r.result:s},_triggerTreeEvent:function(e,t,i){var n=this._makeHookContext(this,t,i),r=this.widget._trigger(e,t,n);return!1!==r&&void 0!==n.result?n.result:r},visit:function(e){return this.rootNode.visit(e,!1)},visitRows:function(e,t){if(!this.rootNode.hasChildren())return!1;if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);var i,n,r,s,o=0,a=!1===(t=t||{}).includeSelf,l=!!t.includeHidden,c=!l&&this.enableFilter,h=t.start||this.rootNode.children[0];for(r=h.parent;r;){for(w((n=(s=r.children).indexOf(h)+o)>=0,"Could not find "+h+" in parent's children: "+r),i=n;i<s.length;i++)if(h=s[i],!c||h.match||h.subMatchCount){if(!a&&!1===e(h))return!1;if(a=!1,h.children&&h.children.length&&(l||h.expanded)&&!1===h.visit(function(t){return!c||t.match||t.subMatchCount?!1!==e(t)&&(l||!t.children||t.expanded?void 0:"skip"):"skip"},!1))return!1}h=r,r=r.parent,o=1}return!0},_visitRowsUp:function(e,t){for(var i,n,r,s=!!t.includeHidden,o=t.start||this.rootNode.children[0];;){if((i=(r=o.parent).children)[0]===o){if(!(o=r).parent)break;i=r.children}else for(n=i.indexOf(o),o=i[n-1];(s||o.expanded)&&o.children&&o.children.length;)r=o,o=(i=o.children)[i.length-1];if((s||o.isVisible())&&!1===e(o))return!1}},warn:function(e){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),M("warn",arguments))}},e.extend(F.prototype,{nodeClick:function(e){var t,i,n=e.targetType,r=e.node;if("expander"===n){if(r.isLoading())return void r.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",e)}else if("checkbox"===n)this._callHook("nodeToggleSelected",e),e.options.focusOnSelect&&this._callHook("nodeSetFocus",e,!0);else{if(i=!1,t=!0,r.folder)switch(e.options.clickFolderMode){case 2:i=!0,t=!1;break;case 3:t=!0,i=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),i&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var i,n,r,s=e.node;if(s.parent)for(n=0,r=(i=s.parent.children).length;n<r;n++)i[n]!==s&&i[n].expanded&&this._callHook("nodeSetExpanded",i[n],!1,t)},nodeDblclick:function(e){"title"===e.targetType&&4===e.options.clickFolderMode&&this._callHook("nodeToggleExpanded",e),"title"===e.targetType&&e.originalEvent.preventDefault()},nodeKeydown:function(t){var i,r,s,o=t.originalEvent,a=t.node,l=t.tree,c=t.options,h=o.which,f=o.key||String.fromCharCode(h),p=!!(o.altKey||o.ctrlKey||o.metaKey),m=!u[h]&&!d[h]&&!p,g=e(o.target),_=!0,y=!(o.ctrlKey||!c.autoActivate);if(a||(s=this.getActiveNode()||this.getFirstChild())&&(s.setFocus(),(a=t.node=this.focusNode).debug("Keydown force focus on active node")),c.quicksearch&&m&&!g.is(":input:enabled"))return(r=Date.now())-l.lastQuicksearchTime>500&&(l.lastQuicksearchTerm=""),l.lastQuicksearchTime=r,l.lastQuicksearchTerm+=f,(i=l.findNextNode(l.lastQuicksearchTerm,l.getActiveNode()))&&i.setActive(),void o.preventDefault();switch(n.eventToString(o)){case"+":case"=":l.nodeSetExpanded(t,!0);break;case"-":l.nodeSetExpanded(t,!1);break;case"space":a.isPagingNode()?l._triggerNodeEvent("clickPaging",t,o):n.evalOption("checkbox",a,a,c,!1)?l.nodeToggleSelected(t):l.nodeSetActive(t,!0);break;case"return":l.nodeSetActive(t,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":a.navigate(o.which,y);break;default:_=!1}_&&o.preventDefault()},nodeLoadChildren:function(t,i){var n,r,s,o=null,c=!0,h=t.tree,d=t.node,u=d.parent,f="nodeLoadChildren",p=Date.now();return T(i)&&w(!T(i=i.call(h,{type:"source"},t)),"source callback must not return another function"),T(i.then)?o=i:i.url?(n=e.extend({},t.options.ajax,i)).debugDelay?(r=n.debugDelay,delete n.debugDelay,b(r)&&(r=r[0]+Math.random()*(r[1]-r[0])),d.warn("nodeLoadChildren waiting debugDelay "+Math.round(r)+" ms ..."),o=e.Deferred(function(t){setTimeout(function(){e.ajax(n).done(function(){t.resolveWith(this,arguments)}).fail(function(){t.rejectWith(this,arguments)})},r)})):o=e.ajax(n):e.isPlainObject(i)||b(i)?(o={then:function(e,t){e(i,null,null)}},c=!1):e.error("Invalid source type: "+i),d._requestId&&(d.warn("Recursive load request #"+p+" while #"+d._requestId+" is pending."),d._requestId=p),c&&(h.debugTime(f),h.nodeSetStatus(t,"loading")),s=new e.Deferred,o.then(function(n,r,o){var c,f;if("json"!==i.dataType&&"jsonp"!==i.dataType||"string"!=typeof n||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),d._requestId&&d._requestId>p)s.rejectWith(this,[a]);else if(null!==d.parent||null===u){if(t.options.postProcess){try{(f=h._triggerNodeEvent("postProcess",t,t.originalEvent,{response:n,error:null,dataType:i.dataType})).error&&h.warn("postProcess returned error:",f)}catch(e){f={error:e,message:""+e,details:"postProcess failed"}}if(f.error)return c=e.isPlainObject(f.error)?f.error:{message:f.error},c=h._makeHookContext(d,null,c),void s.rejectWith(this,[c]);(b(f)||e.isPlainObject(f)&&b(f.children))&&(n=f)}else n&&S(n,"d")&&t.options.enableAspx&&(42===t.options.enableAspx&&h.warn("The default for enableAspx will change to `false` in the fututure. Pass `enableAspx: true` or implement postProcess to silence this warning."),n="string"==typeof n.d?e.parseJSON(n.d):n.d);s.resolveWith(this,[n])}else s.rejectWith(this,[l])},function(e,t,i){var n=h._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:i,details:e.status+": "+i});s.rejectWith(this,[n])}),s.done(function(i){var n,r,s;h.nodeSetStatus(t,"ok"),e.isPlainObject(i)?(w(d.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),w(b(i.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),r=i,n=i.children,delete r.children,e.each(g,function(e,t){void 0!==r[t]&&(h[t]=r[t],delete r[t])}),e.extend(h.data,r)):n=i,w(b(n),"expected array of children"),d._setChildren(n),h.options.nodata&&0===n.length&&(T(h.options.nodata)?s=h.options.nodata.call(h,{type:"nodata"},t):!0===h.options.nodata&&d.isRootNode()?s=h.options.strings.noData:"string"==typeof h.options.nodata&&d.isRootNode()&&(s=h.options.nodata),s&&d.setStatus("nodata",s)),h._triggerNodeEvent("loadChildren",d)}).fail(function(e){var i;e!==a?e!==l?(e.node&&e.error&&e.message?i=e:"[object Object]"===(i=h._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(i.message=""),d.warn("Load children failed ("+i.message+")",i),!1!==h._triggerNodeEvent("loadError",i,null)&&h.nodeSetStatus(t,"error",i.message,i.details)):d.warn("Lazy parent node was removed while loading: discarding response."):d.warn("Ignored response for obsolete load request #"+p+" (expected #"+d._requestId+")")}).always(function(){d._requestId=null,c&&h.debugTimeEnd(f)}),s.promise()},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(t,i){var n,r=t.node,s=e.extend({},t,{node:i}),o=r.children;if(1===o.length)return w(i===o[0],"invalid single child"),this.nodeRemoveChildren(t);this.activeNode&&(i===this.activeNode||this.activeNode.isDescendantOf(i))&&this.activeNode.setActive(!1),this.focusNode&&(i===this.focusNode||this.focusNode.isDescendantOf(i))&&(this.focusNode=null),this.nodeRemoveMarkup(s),this.nodeRemoveChildren(s),w((n=e.inArray(i,o))>=0,"invalid child"),r.triggerModifyChild("remove",i),i.visit(function(e){e.parent=null},!0),this._callHook("treeRegisterNode",this,!1,i),o.splice(n,1)},nodeRemoveChildMarkup:function(t){var i=t.node;i.ul&&(i.isRootNode()?e(i.ul).empty():(e(i.ul).remove(),i.ul=null),i.visit(function(e){e.li=e.ul=null}))},nodeRemoveChildren:function(e){var t=e.tree,i=e.node;i.children&&(this.activeNode&&this.activeNode.isDescendantOf(i)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(i)&&(this.focusNode=null),this.nodeRemoveChildMarkup(e),i.triggerModifyChild("remove",null),i.visit(function(e){e.parent=null,t._callHook("treeRegisterNode",t,!1,e)}),i.lazy?i.children=[]:i.children=null,i.isRootNode()||(i.expanded=!1),this.nodeRenderStatus(e))},nodeRemoveMarkup:function(t){var i=t.node;i.li&&(e(i.li).remove(),i.li=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(t,i,n,r,s){var o,a,l,c,h,d,u,f=t.node,p=t.tree,m=t.options,g=m.aria,_=!1,y=f.parent,v=!y,x=f.children,b=null;if(!1!==p._enableUpdate&&(v||y.ul)){if(w(v||y.ul,"parent UL must exist"),v||(f.li&&(i||f.li.parentNode!==f.parent.ul)&&(f.li.parentNode===f.parent.ul?b=f.li.nextSibling:this.debug("Unlinking "+f+" (must be child of "+f.parent+")"),this.nodeRemoveMarkup(t)),f.li?this.nodeRenderStatus(t):(_=!0,f.li=document.createElement("li"),f.li.ftnode=f,f.key&&m.generateIds&&(f.li.id=m.idPrefix+f.key),f.span=document.createElement("span"),f.span.className="fancytree-node",g&&!f.tr&&e(f.li).attr("role","treeitem"),f.li.appendChild(f.span),this.nodeRenderTitle(t),m.createNode&&m.createNode.call(p,{type:"createNode"},t)),m.renderNode&&m.renderNode.call(p,{type:"renderNode"},t)),x){if(v||f.expanded||!0===n){for(f.ul||(f.ul=document.createElement("ul"),(!0!==r||s)&&f.expanded||(f.ul.style.display="none"),g&&e(f.ul).attr("role","group"),f.li?f.li.appendChild(f.ul):f.tree.$div.append(f.ul)),c=0,h=x.length;c<h;c++)u=e.extend({},t,{node:x[c]}),this.nodeRender(u,i,n,!1,!0);for(o=f.ul.firstChild;o;)(l=o.ftnode)&&l.parent!==f?(f.debug("_fixParent: remove missing "+l,o),d=o.nextSibling,o.parentNode.removeChild(o),o=d):o=o.nextSibling;for(o=f.ul.firstChild,c=0,h=x.length-1;c<h;c++)(a=x[c])===(l=o.ftnode)?o=o.nextSibling:f.ul.insertBefore(a.li,l.li)}}else f.ul&&(this.warn("remove child markup for "+f),this.nodeRemoveChildMarkup(t));v||_&&y.ul.insertBefore(f.li,b)}},nodeRenderTitle:function(t,i){var s,o,a,l,c,h,d,u=t.node,f=t.tree,p=t.options,m=p.aria,g=u.getLevel(),_=[];void 0!==i&&(u.title=i),u.span&&!1!==f._enableUpdate&&(c=m&&!1!==u.hasChildren()?" role='button'":"",g<p.minExpandLevel?(u.lazy||(u.expanded=!0),g>1&&_.push("<span "+c+" class='fancytree-expander fancytree-expander-fixed'></span>")):_.push("<span "+c+" class='fancytree-expander'></span>"),(s=n.evalOption("checkbox",u,u,p,!1))&&!u.isStatusNode()&&(c=m?" role='checkbox'":"",o="fancytree-checkbox",("radio"===s||u.parent&&u.parent.radiogroup)&&(o+=" fancytree-radio"),_.push("<span "+c+" class='"+o+"'></span>")),void 0!==u.data.iconClass&&(u.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(u.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),u.icon=u.data.iconClass)),!1!==(a=n.evalOption("icon",u,u,p,!0))&&(c=m?" role='presentation'":"",d=(d=n.evalOption("iconTooltip",u,u,p,null))?" title='"+R(d)+"'":"","string"==typeof a?r.test(a)?(a="/"===a.charAt(0)?a:(p.imagePath||"")+a,_.push("<img src='"+a+"' class='fancytree-icon'"+d+" alt='' />")):_.push("<span "+c+" class='fancytree-custom-icon "+a+"'"+d+"></span>"):a.text?_.push("<span "+c+" class='fancytree-custom-icon "+(a.addClass||"")+"'"+d+">"+n.escapeHtml(a.text)+"</span>"):a.html?_.push("<span "+c+" class='fancytree-custom-icon "+(a.addClass||"")+"'"+d+">"+a.html+"</span>"):_.push("<span "+c+" class='fancytree-icon'"+d+"></span>")),l="",p.renderTitle&&(l=p.renderTitle.call(f,{type:"renderTitle"},t)||""),l||(!0===(h=n.evalOption("tooltip",u,u,p,null))&&(h=u.title),l="<span class='fancytree-title'"+(h=h?" title='"+R(h)+"'":"")+(p.titlesTabbable?" tabindex='0'":"")+">"+(p.escapeTitles?n.escapeHtml(u.title):u.title)+"</span>"),_.push(l),u.span.innerHTML=_.join(""),this.nodeRenderStatus(t),p.enhanceTitle&&(t.$title=e(">span.fancytree-title",u.span),l=p.enhanceTitle.call(f,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var i,r=t.node,s=t.tree,o=t.options,a=r.hasChildren(),l=r.isLastSibling(),c=o.aria,h=o._classNames,d=[],u=r[s.statusClassPropName];u&&!1!==s._enableUpdate&&(c&&(i=e(r.tr||r.li)),d.push(h.node),s.activeNode===r&&d.push(h.active),s.focusNode===r&&d.push(h.focused),r.expanded&&d.push(h.expanded),c&&(!1===a?i.removeAttr("aria-expanded"):i.attr("aria-expanded",Boolean(r.expanded))),r.folder&&d.push(h.folder),!1!==a&&d.push(h.hasChildren),l&&d.push(h.lastsib),r.lazy&&null==r.children&&d.push(h.lazy),r.partload&&d.push(h.partload),r.partsel&&d.push(h.partsel),n.evalOption("unselectable",r,r,o,!1)&&d.push(h.unselectable),r._isLoading&&d.push(h.loading),r._error&&d.push(h.error),r.statusNodeType&&d.push(h.statusNodePrefix+r.statusNodeType),r.selected?(d.push(h.selected),c&&i.attr("aria-selected",!0)):c&&i.attr("aria-selected",!1),r.extraClasses&&d.push(r.extraClasses),!1===a?d.push(h.combinedExpanderPrefix+"n"+(l?"l":"")):d.push(h.combinedExpanderPrefix+(r.expanded?"e":"c")+(r.lazy&&null==r.children?"d":"")+(l?"l":"")),d.push(h.combinedIconPrefix+(r.expanded?"e":"c")+(r.folder?"f":"")),u.className=d.join(" "),r.li&&e(r.li).toggleClass(h.lastsib,l))},nodeSetActive:function(t,i,n){n=n||{};var r,s=t.node,o=t.tree,a=t.options,l=!0===n.noEvents,c=!0===n.noFocus,h=!1!==n.scrollIntoView;return s===o.activeNode==(i=!1!==i)?L(s):(h&&t.originalEvent&&e(t.originalEvent.target).is("a,:checkbox")&&(s.info("Not scrolling while clicking an embedded link."),h=!1),i&&!l&&!1===this._triggerNodeEvent("beforeActivate",s,t.originalEvent)?E(s,["rejected"]):(i?(o.activeNode&&(w(o.activeNode!==s,"node was active (inconsistency)"),r=e.extend({},t,{node:o.activeNode}),o.nodeSetActive(r,!1),w(null===o.activeNode,"deactivate was out of sync?")),a.activeVisible&&s.makeVisible({scrollIntoView:h}),o.activeNode=s,o.nodeRenderStatus(t),c||o.nodeSetFocus(t),l||o._triggerNodeEvent("activate",s,t.originalEvent)):(w(o.activeNode===s,"node was not active (inconsistency)"),o.activeNode=null,this.nodeRenderStatus(t),l||t.tree._triggerNodeEvent("deactivate",s,t.originalEvent)),L(s)))},nodeSetExpanded:function(t,i,n){n=n||{};var r,s,o,a,l,c,h=t.node,d=t.tree,u=t.options,f=!0===n.noAnimation,p=!0===n.noEvents;if(i=!1!==i,e(h.li).hasClass(u._classNames.animating))return h.warn("setExpanded("+i+") while animating: ignored."),E(h,["recursion"]);if(h.expanded&&i||!h.expanded&&!i)return L(h);if(i&&!h.lazy&&!h.hasChildren())return L(h);if(!i&&h.getLevel()<u.minExpandLevel)return E(h,["locked"]);if(!p&&!1===this._triggerNodeEvent("beforeExpand",h,t.originalEvent))return E(h,["rejected"]);if(f||h.isVisible()||(f=n.noAnimation=!0),s=new e.Deferred,i&&!h.expanded&&u.autoCollapse){l=h.getParentList(!1,!0),c=u.autoCollapse;try{for(u.autoCollapse=!1,o=0,a=l.length;o<a;o++)this._callHook("nodeCollapseSiblings",l[o],n)}finally{u.autoCollapse=c}}return s.done(function(){var e=h.getLastChild();i&&u.autoScroll&&!f&&e&&d._enableUpdate?e.scrollIntoView(!0,{topNode:h}).always(function(){p||t.tree._triggerNodeEvent(i?"expand":"collapse",t)}):p||t.tree._triggerNodeEvent(i?"expand":"collapse",t)}),r=function(n){var r=u._classNames,s=u.toggleEffect;if(h.expanded=i,d._callHook("treeStructureChanged",t,i?"expand":"collapse"),d._callHook("nodeRender",t,!1,!1,!0),h.ul)if("none"!==h.ul.style.display==!!h.expanded)h.warn("nodeSetExpanded: UL.style.display already set");else{if(s&&!f)return e(h.li).addClass(r.animating),void(T(e(h.ul)[s.effect])?e(h.ul)[s.effect]({duration:s.duration,always:function(){e(this).removeClass(r.animating),e(h.li).removeClass(r.animating),n()}}):(e(h.ul).stop(!0,!0),e(h.ul).parent().find(".ui-effects-placeholder").remove(),e(h.ul).toggle(s.effect,s.options,s.duration,function(){e(this).removeClass(r.animating),e(h.li).removeClass(r.animating),n()})));h.ul.style.display=h.expanded||!parent?"":"none"}n()},i&&h.lazy&&void 0===h.hasChildren()?h.load().done(function(){s.notifyWith&&s.notifyWith(h,["loaded"]),r(function(){s.resolveWith(h)})}).fail(function(e){r(function(){s.rejectWith(h,["load failed ("+e+")"])})}):r(function(){s.resolveWith(h)}),s.promise()},nodeSetFocus:function(t,i){var n,r=t.tree,s=t.node,o=r.options,a=!!t.originalEvent&&e(t.originalEvent.target).is(":input");if(i=!1!==i,r.focusNode){if(r.focusNode===s&&i)return;n=e.extend({},t,{node:r.focusNode}),r.focusNode=null,this._triggerNodeEvent("blur",n),this._callHook("nodeRenderStatus",n)}i&&(this.hasFocus()||(s.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",t,!0,{calledByNode:!0})),s.makeVisible({scrollIntoView:!1}),r.focusNode=s,o.titlesTabbable&&(a||e(s.span).find(".fancytree-title").trigger("focus")),o.aria&&e(r.$container).attr("aria-activedescendant",e(s.tr||s.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",t),document.activeElement===r.$container.get(0)||e(document.activeElement,r.$container).length>=1||e(r.$container).trigger("focus"),o.autoScroll&&s.scrollIntoView(),this._callHook("nodeRenderStatus",t))},nodeSetSelected:function(e,t,i){i=i||{};var r=e.node,s=e.tree,o=e.options,a=!0===i.noEvents,l=r.parent;if(t=!1!==t,!n.evalOption("unselectable",r,r,o,!1)){if(r._lastSelectIntent=t,!!r.selected===t&&(3!==o.selectMode||!r.partsel||t))return t;if(!a&&!1===this._triggerNodeEvent("beforeSelect",r,e.originalEvent))return!!r.selected;t&&1===o.selectMode?(s.lastSelectedNode&&s.lastSelectedNode.setSelected(!1),r.selected=t):3!==o.selectMode||!l||l.radiogroup||r.radiogroup?l&&l.radiogroup?r.visitSiblings(function(e){e._changeSelectStatusAttrs(t&&e===r)},!0):r.selected=t:(r.selected=t,r.fixSelection3AfterClick(i)),this.nodeRenderStatus(e),s.lastSelectedNode=t?r:null,a||s._triggerNodeEvent("select",e)}},nodeSetStatus:function(t,i,n,r){var s=t.node,o=t.tree;function a(i,n){var r=s.children?s.children[0]:null;return r&&r.isStatusNode()?(e.extend(r,i),r.statusNodeType=n,o._callHook("nodeRenderTitle",r)):(s._setChildren([i]),o._callHook("treeStructureChanged",t,"setStatusNode"),s.children[0].statusNodeType=n,o.render()),s.children[0]}switch(i){case"ok":(function(){var e=s.children?s.children[0]:null;if(e&&e.isStatusNode()){try{s.ul&&(s.ul.removeChild(e.li),e.li=null)}catch(e){}1===s.children.length?s.children=[]:s.children.shift(),o._callHook("treeStructureChanged",t,"clearStatusNode")}})(),s._isLoading=!1,s._error=null,s.renderStatus();break;case"loading":s.parent||a({title:o.options.strings.loading+(n?" ("+n+")":""),checkbox:!1,tooltip:r},i),s._isLoading=!0,s._error=null,s.renderStatus();break;case"error":a({title:o.options.strings.loadError+(n?" ("+n+")":""),checkbox:!1,tooltip:r},i),s._isLoading=!1,s._error={message:n,details:r},s.renderStatus();break;case"nodata":a({title:n||o.options.strings.noData,checkbox:!1,tooltip:r},i),s._isLoading=!1,s._error=null,s.renderStatus();break;default:e.error("invalid node status "+i)}},nodeToggleExpanded:function(e){return this.nodeSetExpanded(e,!e.node.expanded)},nodeToggleSelected:function(e){var t=e.node,i=!t.selected;return t.partsel&&!t.selected&&!0===t._lastSelectIntent&&(i=!1,t.selected=!0),t._lastSelectIntent=i,this.nodeSetSelected(e,i)},treeClear:function(e){var t=e.tree;t.activeNode=null,t.focusNode=null,t.$div.find(">ul.fancytree-container").empty(),t.rootNode.children=null,t._callHook("treeStructureChanged",e,"clear")},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("fancytree-helper-hidden")},treeInit:function(t){var i=t.tree,n=i.options;i.$container.attr("tabindex",n.tabindex),e.each(g,function(e,t){void 0!==n[t]&&(i.info("Move option "+t+" to tree"),i[t]=n[t],delete n[t])}),n.checkboxAutoHide&&i.$container.addClass("fancytree-checkbox-auto-hide"),n.rtl?i.$container.attr("DIR","RTL").addClass("fancytree-rtl"):i.$container.removeAttr("DIR").removeClass("fancytree-rtl"),n.aria&&(i.$container.attr("role","tree"),1!==n.selectMode&&i.$container.attr("aria-multiselectable",!0)),this.treeLoad(t)},treeLoad:function(t,i){var r,s,o,a=t.tree,l=t.widget.element,c=e.extend({},t,{node:this.rootNode});if(a.rootNode.children&&this.treeClear(t),i=i||this.options.source)"string"==typeof i&&e.error("Not implemented");else switch(s=l.data("type")||"html"){case"html":(o=l.find(">ul").not(".fancytree-container").first()).length?(o.addClass("ui-fancytree-source fancytree-helper-hidden"),i=e.ui.fancytree.parseHtml(o),this.data=e.extend(this.data,P(o))):(n.warn("No `source` option was passed and container does not contain `<ul>`: assuming `source: []`."),i=[]);break;case"json":i=e.parseJSON(l.text()),l.contents().filter(function(){return 3===this.nodeType}).remove(),e.isPlainObject(i)&&(w(b(i.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),r=i,i=i.children,delete r.children,e.each(g,function(e,t){void 0!==r[t]&&(a[t]=r[t],delete r[t])}),e.extend(a.data,r));break;default:e.error("Invalid data-type: "+s)}return a._triggerTreeEvent("preInit",null),this.nodeLoadChildren(c,i).done(function(){a._callHook("treeStructureChanged",t,"loadChildren"),a.render(),3===t.options.selectMode&&a.rootNode.fixSelection3FromEndNodes(),a.activeNode&&a.options.activeVisible&&a.activeNode.makeVisible(),a._triggerTreeEvent("init",null,{status:!0})}).fail(function(){a.render(),a._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(e,t,i){e.tree._callHook("treeStructureChanged",e,t?"addNode":"removeNode")},treeSetFocus:function(t,i,n){var r;(i=!1!==i)!==this.hasFocus()&&(this._hasFocus=i,!i&&this.focusNode?this.focusNode.setFocus(!1):!i||n&&n.calledByNode||e(this.$container).trigger("focus"),this.$container.toggleClass("fancytree-treefocus",i),this._triggerTreeEvent(i?"focusTree":"blurTree"),i&&!this.activeNode&&(r=this._lastMousedownNode||this.getFirstChild())&&r.setFocus())},treeSetOption:function(t,i,n){var r=t.tree,s=!0,o=!1,a=!1;switch(i){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":o=!0,a=!0;break;case"checkboxAutoHide":r.$container.toggleClass("fancytree-checkbox-auto-hide",!!n);break;case"escapeTitles":case"tooltip":a=!0;break;case"rtl":!1===n?r.$container.removeAttr("DIR").removeClass("fancytree-rtl"):r.$container.attr("DIR","RTL").addClass("fancytree-rtl"),a=!0;break;case"source":s=!1,r._callHook("treeLoad",r,n),a=!0}r.debug("set option "+i+"="+n+" <"+typeof n+">"),s&&(this.widget._super?this.widget._super.call(this.widget,i,n):e.Widget.prototype._setOption.call(this.widget,i,n)),o&&r._callHook("treeCreate",r),a&&r.render(!0,!1)},treeStructureChanged:function(e,t){}}),e.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!0,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,copyFunctionsToData:!1,debugLevel:null,disabled:!1,enableAspx:42,escapeTitles:!1,extensions:[],focusOnSelect:!1,generateIds:!1,icon:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,nodata:!0,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading...",loadError:"Load error!",moreData:"More...",noData:"No data."},tabindex:"0",titlesTabbable:!1,toggleEffect:{effect:"slideToggle",duration:200},tooltip:!1,treeId:null,_classNames:{active:"fancytree-active",animating:"fancytree-animating",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",error:"fancytree-error",expanded:"fancytree-expanded",focused:"fancytree-focused",folder:"fancytree-folder",hasChildren:"fancytree-has-children",lastsib:"fancytree-lastsib",lazy:"fancytree-lazy",loading:"fancytree-loading",node:"fancytree-node",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",selected:"fancytree-selected",statusNodePrefix:"fancytree-statusnode-",unselectable:"fancytree-unselectable"},lazyLoad:null,postProcess:null},_deprecationWarning:function(e){var t=this.tree;t&&t.options.debugLevel>=3&&t.warn("$().fancytree('"+e+"') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html")},_create:function(){this.tree=new F(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul").first();var t,i,n,r=this.options,s=r.extensions,o=this.tree;for(n=0;n<s.length;n++)i=s[n],(t=e.ui.fancytree._extensions[i])||e.error("Could not apply extension '"+i+"' (it is not registered, did you forget to include it?)"),this.tree.options[i]=A({},t.options,this.tree.options[i]),w(void 0===this.tree.ext[i],"Extension name must not exist as Fancytree.ext attribute: '"+i+"'"),this.tree.ext[i]={},D(this.tree,o,t,i),o=t;void 0!==r.icons&&(!0===r.icon?(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),r.icon=r.icons):e.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead")),void 0!==r.iconClass&&(r.icon?e.error("'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead"),r.icon=r.iconClass)),void 0!==r.tabbable&&(r.tabindex=r.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+r.tabindex+"' instead")),this.tree._callHook("treeCreate",this.tree)},_init:function(){this.tree._callHook("treeInit",this.tree),this._bind()},_setOption:function(e,t){return this.tree._callHook("treeSetOption",this.tree,e,t)},_destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree)},_unbind:function(){var t=this.tree._ns;this.element.off(t),this.tree.$container.off(t),e(document).off(t)},_bind:function(){var t=this,i=this.options,r=this.tree,s=r._ns;this._unbind(),r.$container.on("focusin"+s+" focusout"+s,function(t){var i=n.getNode(t),s="focusin"===t.type;if(!s&&i&&e(t.target).is("a"))i.debug("Ignored focusout on embedded <a> element.");else{if(s){if(r._getExpiringValue("focusin"))return void r.debug("Ignored double focusin.");r._setExpiringValue("focusin",!0,50),i||(i=r._getExpiringValue("mouseDownNode"))&&r.debug("Reconstruct mouse target for focusin from recent event.")}i?r._callHook("nodeSetFocus",r._makeHookContext(i,t),s):r.tbody&&e(t.target).parents("table.fancytree-container > thead").length?r.debug("Ignore focus event outside table body.",t):r._callHook("treeSetFocus",r,s)}}).on("selectstart"+s,"span.fancytree-title",function(e){e.preventDefault()}).on("keydown"+s,function(e){if(i.disabled||!1===i.keyboard)return!0;var t,n=r.focusNode,s=r._makeHookContext(n||r,e),o=r.phase;try{return r.phase="userEvent","preventNav"===(t=n?r._triggerNodeEvent("keydown",n,e):r._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=r._callHook("nodeKeydown",s)),t}finally{r.phase=o}}).on("mousedown"+s,function(e){var t=n.getEventTarget(e);r._lastMousedownNode=t?t.node:null,r._setExpiringValue("mouseDownNode",r._lastMousedownNode)}).on("click"+s+" dblclick"+s,function(e){if(i.disabled)return!0;var r,s=n.getEventTarget(e),o=s.node,a=t.tree,l=a.phase;if(!o)return!0;r=a._makeHookContext(o,e);try{switch(a.phase="userEvent",e.type){case"click":return r.targetType=s.type,o.isPagingNode()?!0===a._triggerNodeEvent("clickPaging",r,e):!1!==a._triggerNodeEvent("click",r,e)&&a._callHook("nodeClick",r);case"dblclick":return r.targetType=s.type,!1!==a._triggerNodeEvent("dblclick",r,e)&&a._callHook("nodeDblclick",r)}}finally{a.phase=l}})},getActiveNode:function(){return this._deprecationWarning("getActiveNode"),this.tree.activeNode},getNodeByKey:function(e){return this._deprecationWarning("getNodeByKey"),this.tree.getNodeByKey(e)},getRootNode:function(){return this._deprecationWarning("getRootNode"),this.tree.rootNode},getTree:function(){return this._deprecationWarning("getTree"),this.tree}}),n=e.ui.fancytree,e.extend(e.ui.fancytree,{version:"2.38.5",buildType:"production",debugLevel:3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:F,_FancytreeNodeClass:z,jquerySupports:{positionMyOfs:function(t){var i,n,r,s=e.map(k(t).split("."),function(e){return parseInt(e,10)}),o=e.map(Array.prototype.slice.call(arguments,1),function(e){return parseInt(e,10)});for(i=0;i<o.length;i++)if((n=s[i]||0)!==(r=o[i]||0))return n>r;return!0}(e.ui.version,1,9)},assert:function(e,t){return w(e,t)},createTree:function(t,i){var r=e(t).fancytree(i);return n.getTree(r)},debounce:function(e,t,i,n){var r;return 3===arguments.length&&"boolean"!=typeof i&&(n=i,i=!1),function(){var s=arguments;n=n||this,i&&!r&&t.apply(n,s),clearTimeout(r),r=setTimeout(function(){i||t.apply(n,s),r=null},e)}},debug:function(t){e.ui.fancytree.debugLevel>=4&&M("log",arguments)},error:function(t){e.ui.fancytree.debugLevel>=1&&M("error",arguments)},escapeHtml:function(e){return(""+e).replace(s,function(e){return c[e]})},fixPositionOptions:function(t){if((t.offset||(""+t.my+t.at).indexOf("%")>=0)&&e.error("expected new position syntax (but '%' is not supported)"),!e.ui.fancytree.jquerySupports.positionMyOfs){var i=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),r=(i[2]?+i[2]:0)+(n[2]?+n[2]:0),s=(i[4]?+i[4]:0)+(n[4]?+n[4]:0);t=e.extend({},t,{my:i[1]+" "+i[3],at:n[1]+" "+n[3]}),(r||s)&&(t.offset=r+" "+s)}return t},getEventTarget:function(t){var i,r=t&&t.target?t.target.className:"",s={node:this.getNode(t.target),type:void 0};return/\bfancytree-title\b/.test(r)?s.type="title":/\bfancytree-expander\b/.test(r)?s.type=!1===s.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(r)?s.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(r)?s.type="icon":/\bfancytree-node\b/.test(r)?s.type="title":t&&t.target&&((i=e(t.target)).is("ul[role=group]")?((s.node&&s.node.tree||n).debug("Ignoring click on outer UL."),s.node=null):i.closest(".fancytree-title").length?s.type="title":i.closest(".fancytree-checkbox").length?s.type="checkbox":i.closest(".fancytree-expander").length&&(s.type="expander")),s},getEventTargetType:function(e){return this.getEventTarget(e).type},getNode:function(t){if(t instanceof z)return t;for(t instanceof e?t=t[0]:void 0!==t.originalEvent&&(t=t.target);t;){if(t.ftnode)return t.ftnode;t=t.parentNode}return null},getTree:function(t){var i,n=t;return t instanceof F?t:(void 0===t&&(t=0),"number"==typeof t?t=e(".fancytree-container").eq(t):"string"==typeof t?(t=e("#ft-id-"+n).eq(0)).length||(t=e(n).eq(0)):t instanceof Element||t instanceof HTMLDocument?t=e(t):t instanceof e?t=t.eq(0):void 0!==t.originalEvent&&(t=e(t.target)),(i=(t=t.closest(":ui-fancytree")).data("ui-fancytree")||t.data("fancytree"))?i.tree:null)},evalOption:function(e,t,i,n,r){var s,o,a=t.tree,l=n[e],c=i[e];return T(l)?(s={node:t,tree:a,widget:a.widget,options:a.widget.options,typeInfo:a.types[t.type]||{}},null==(o=l.call(a,{type:e},s))&&(o=c)):o=null==c?l:c,null==o&&(o=r),o},setSpanIcon:function(t,i,n){var r=e(t);"string"==typeof n?r.attr("class",i+" "+n):(n.text?r.text(""+n.text):n.html&&(t.innerHTML=n.html),r.attr("class",i+" "+(n.addClass||"")))},eventToString:function(e){var t=e.which,i=e.type,n=[];return e.altKey&&n.push("alt"),e.ctrlKey&&n.push("ctrl"),e.metaKey&&n.push("meta"),e.shiftKey&&n.push("shift"),"click"===i||"dblclick"===i?n.push(f[e.button]+i):"wheel"===i?n.push(i):h[t]||n.push(d[t]||String.fromCharCode(t).toLowerCase()),n.join("+")},info:function(t){e.ui.fancytree.debugLevel>=3&&M("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,i,n,r){var s,o=t[i]||e.noop;t[i]=function(){var e=r||this;try{return s=e._super,e._super=o,n.apply(e,arguments)}finally{e._super=s}}},parseHtml:function(t){var i,n,r,s,o,a,l,c,h=t.find(">li"),d=[];return h.each(function(){var h,u,f=e(this),g=f.find(">span",this).first(),y=g.length?null:f.find(">a").first(),x={tooltip:null,data:{}};for(g.length?x.title=g.html():y&&y.length?(x.title=y.html(),x.data.href=y.attr("href"),x.data.target=y.attr("target"),x.tooltip=y.attr("title")):(x.title=f.html(),(o=x.title.search(/<ul/i))>=0&&(x.title=x.title.substring(0,o))),x.title=k(x.title),s=0,a=p.length;s<a;s++)x[p[s]]=void 0;for(i=this.className.split(" "),r=[],s=0,a=i.length;s<a;s++)n=i[s],m[n]?x[n]=!0:r.push(n);if(x.extraClasses=r.join(" "),(l=f.attr("title"))&&(x.tooltip=l),(l=f.attr("id"))&&(x.key=l),f.attr("hideCheckbox")&&(x.checkbox=!1),(h=P(f))&&!e.isEmptyObject(h)){for(u in v)S(h,u)&&(h[v[u]]=h[u],delete h[u]);for(s=0,a=_.length;s<a;s++)l=_[s],null!=(c=h[l])&&(delete h[l],x[l]=c);e.extend(x.data,h)}(t=f.find(">ul").first()).length?x.children=e.ui.fancytree.parseHtml(t):x.children=x.lazy?void 0:null,d.push(x)}),d},registerExtension:function(t){w(null!=t.name,"extensions must have a `name` property."),w(null!=t.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[t.name]=t},trim:k,unescapeHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(t){e.ui.fancytree.debugLevel>=2&&M("warn",arguments)}}),e.ui.fancytree}function w(t,i){t||(i="Fancytree assertion failed"+(i=i?": "+i:""),e.ui&&e.ui.fancytree&&e.ui.fancytree.error(i),e.error(i))}function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function T(e){return"function"==typeof e}function k(e){return null==e?"":e.trim()}function M(e,t){var i,n,r=window.console?window.console[e]:null;if(r)try{r.apply(window.console,t)}catch(e){for(n="",i=0;i<t.length;i++)n+=t[i];r(n)}}function A(){var t,i,n,r,s,o=arguments[0]||{},a=1,l=arguments.length;if("object"==typeof o||T(o)||(o={}),a===l)throw Error("need at least two args");for(;a<l;a++)if(null!=(t=arguments[a]))for(i in t)if(S(t,i)){if(n=o[i],o===(r=t[i]))continue;r&&e.isPlainObject(r)?(s=n&&e.isPlainObject(n)?n:{},o[i]=A(s,r)):void 0!==r&&(o[i]=r)}return o}function C(e,t,i,n,r){var s,o,a,l,c,h=(s=t[e],o=n[e],a=t.ext[r],l=function(){return s.apply(t,arguments)},c=function(e){return s.apply(t,e)},function(){var e=t._local,i=t._super,n=t._superApply;try{return t._local=a,t._super=l,t._superApply=c,o.apply(t,arguments)}finally{t._local=e,t._super=i,t._superApply=n}});return h}function D(t,i,n,r){for(var s in n)"function"==typeof n[s]?"function"==typeof t[s]?t[s]=C(s,t,0,n,r):"_"===s.charAt(0)?t.ext[r][s]=C(s,t,0,n,r):e.error("Could not override tree."+s+". Use prefix '_' to create tree."+r+"._"+s):"options"!==s&&(t.ext[r][s]=n[s])}function L(t,i){return void 0===t?e.Deferred(function(){this.resolve()}).promise():e.Deferred(function(){this.resolveWith(t,i)}).promise()}function E(t,i){return void 0===t?e.Deferred(function(){this.reject()}).promise():e.Deferred(function(){this.rejectWith(t,i)}).promise()}function I(e,t){return function(){e.resolveWith(t)}}function P(t){var i=e.extend({},t.data()),n=i.json;return delete i.fancytree,delete i.uiFancytree,n&&(delete i.json,i=e.extend(i,n)),i}function R(e){return(""+e).replace(o,function(e){return c[e]})}function O(e){return e=e.toLowerCase(),function(t){return t.title.toLowerCase().indexOf(e)>=0}}function z(t,i){var r,s,o,a;for(this.parent=t,this.tree=t.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},r=0,s=_.length;r<s;r++)this[o=_[r]]=i[o];for(o in null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),i.hideCheckbox&&e.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),i.data&&e.extend(this.data,i.data),i)y[o]||!this.tree.options.copyFunctionsToData&&T(i[o])||x[o]||(this.data[o]=i[o]);null==this.key?this.tree.options.defaultKey?(this.key=""+this.tree.options.defaultKey(this),w(this.key,"defaultKey() must return a unique key")):this.key="_"+n._nextNodeKey++:this.key=""+this.key,i.active&&(w(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),i.selected&&(this.tree.lastSelectedNode=this),(a=i.children)?a.length?this._setChildren(a):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function F(t){this.widget=t,this.$div=t.element,this.options=t.options,this.options&&(void 0!==this.options.lazyload&&e.error("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),void 0!==this.options.loaderror&&e.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&e.error("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&e.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.types={},this.columns={},this.data=P(this.$div),this._id=""+(this.options.treeId||e.ui.fancytree._nextId++),this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this._tempCache={},this._lastMousedownNode=null,this._enableUpdate=!0,this.lastSelectedNode=null,this.systemFocusElement=null,this.lastQuicksearchTerm="",this.lastQuicksearchTime=0,this.viewport=null,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var i,r={tree:this};this.rootNode=new z(r,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,i=e("<ul>",{id:"ft-id-"+this._id,class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=i,this.rootNode.ul=i[0],null==this.options.debugLevel&&(this.options.debugLevel=n.debugLevel)}e.ui.fancytree.warn("Fancytree: ignored duplicate include")})?n.apply(t,r):n)||(e.exports=s)},6111:function(e,t,i){!function(e){"use strict";function t(e,t,i,n){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[i][0]:r[i][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},6169:function(e,t,i){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},i={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function n(e,t,i,n){var r="";if(t)switch(i){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(i){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,i){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(i(5093))},6181:function(e,t,i){!function(e){"use strict";function t(e,t,i,n){var r={s:["çend sanîye","çend sanîyeyan"],ss:[e+" sanîye",e+" sanîyeyan"],m:["deqîqeyek","deqîqeyekê"],mm:[e+" deqîqe",e+" deqîqeyan"],h:["saetek","saetekê"],hh:[e+" saet",e+" saetan"],d:["rojek","rojekê"],dd:[e+" roj",e+" rojan"],w:["hefteyek","hefteyekê"],ww:[e+" hefte",e+" hefteyan"],M:["mehek","mehekê"],MM:[e+" meh",e+" mehan"],y:["salek","salekê"],yy:[e+" sal",e+" salan"]};return t?r[i][0]:r[i][1]}e.defineLocale("ku-kmr",{months:"Rêbendan_Sibat_Adar_Nîsan_Gulan_Hezîran_Tîrmeh_Tebax_Îlon_Cotmeh_Mijdar_Berfanbar".split("_"),monthsShort:"Rêb_Sib_Ada_Nîs_Gul_Hez_Tîr_Teb_Îlo_Cot_Mij_Ber".split("_"),monthsParseExact:!0,weekdays:"Yekşem_Duşem_Sêşem_Çarşem_Pêncşem_În_Şemî".split("_"),weekdaysShort:"Yek_Du_Sê_Çar_Pên_În_Şem".split("_"),weekdaysMin:"Ye_Du_Sê_Ça_Pê_În_Şe".split("_"),meridiem:function(e,t,i){return e<12?i?"bn":"BN":i?"pn":"PN"},meridiemParse:/bn|BN|pn|PN/,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM[a] YYYY[an]",LLL:"Do MMMM[a] YYYY[an] HH:mm",LLLL:"dddd, Do MMMM[a] YYYY[an] HH:mm",ll:"Do MMM[.] YYYY[an]",lll:"Do MMM[.] YYYY[an] HH:mm",llll:"ddd[.], Do MMM[.] YYYY[an] HH:mm"},calendar:{sameDay:"[Îro di saet] LT [de]",nextDay:"[Sibê di saet] LT [de]",nextWeek:"dddd [di saet] LT [de]",lastDay:"[Duh di saet] LT [de]",lastWeek:"dddd[a borî di saet] LT [de]",sameElse:"L"},relativeTime:{future:"di %s de",past:"berî %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,w:t,ww:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(?:yê|ê|\.)/,ordinal:function(e,t){var i=t.toLowerCase();return i.includes("w")||i.includes("m")?e+".":e+function(e){var t=(e=""+e).substring(e.length-1),i=e.length>1?e.substring(e.length-2):"";return 12==i||13==i||"2"!=t&&"3"!=t&&"50"!=i&&"70"!=t&&"80"!=t?"ê":"yê"}(e)},week:{dow:1,doy:4}})}(i(5093))},6195:function(e,t,i){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(i(5093))},6233:(e,t,i)=>{"use strict";function n(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}i.d(t,{A:()=>n})},6308:function(e,t,i){!function(e){"use strict";function t(e,t,i){var n=e+" ";switch(i){case"ss":return n+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return n+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return n+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return n+(1===e?"dan":"dana");case"MM":return n+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return n+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(i(5093))},6354:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>a}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(5581);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(6906);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(8979);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(2283);function a(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),l=1,c=1;t&&(0,n.sb)(e)&&(l=e.offsetWidth>0&&(0,r.LI)(a.width)/e.offsetWidth||1,c=e.offsetHeight>0&&(0,r.LI)(a.height)/e.offsetHeight||1);var h=((0,n.vq)(e)?(0,s.A)(e):window).visualViewport,d=!(0,o.A)()&&i,u=(a.left+(d&&h?h.offsetLeft:0))/l,f=(a.top+(d&&h?h.offsetTop:0))/c,p=a.width/l,m=a.height/c;return{width:p,height:m,top:f,right:u+p,bottom:f+m,left:u,x:u,y:f}}},6435:function(e,t,i){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(i(5093))},6447:(e,t,i)=>{"use strict";function n(e){return e+.5|0}i.d(t,{Ay:()=>R});const r=(e,t,i)=>Math.max(Math.min(e,i),t);function s(e){return r(n(2.55*e),0,255)}function o(e){return r(n(255*e),0,255)}function a(e){return r(n(e/2.55)/100,0,1)}function l(e){return r(n(100*e),0,100)}const c={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},h=[..."0123456789ABCDEF"],d=e=>h[15&e],u=e=>h[(240&e)>>4]+h[15&e],f=e=>(240&e)>>4==(15&e);const p=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function m(e,t,i){const n=t*Math.min(i,1-i),r=(t,r=(t+e/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function g(e,t,i){const n=(n,r=(n+e/60)%6)=>i-i*t*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function _(e,t,i){const n=m(e,1,.5);let r;for(t+i>1&&(r=1/(t+i),t*=r,i*=r),r=0;r<3;r++)n[r]*=1-t-i,n[r]+=t;return n}function y(e){const t=e.r/255,i=e.g/255,n=e.b/255,r=Math.max(t,i,n),s=Math.min(t,i,n),o=(r+s)/2;let a,l,c;return r!==s&&(c=r-s,l=o>.5?c/(2-r-s):c/(r+s),a=function(e,t,i,n,r){return e===r?(t-i)/n+(t<i?6:0):t===r?(i-e)/n+2:(e-t)/n+4}(t,i,n,c,r),a=60*a+.5),[0|a,l||0,o]}function v(e,t,i,n){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,i,n)).map(o)}function x(e,t,i){return v(m,e,t,i)}function b(e){return(e%360+360)%360}const w={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},S={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let T;const k=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,M=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,A=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4),C=/\/\*[^]*?\*\//g;function D(e,t,i){if(e){let n=y(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*i,0===t?360:1)),n=x(n),e.r=n[0],e.g=n[1],e.b=n[2]}}function L(e,t){return e?Object.assign(t||{},e):e}function E(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=o(e[3]))):(t=L(e,{r:0,g:0,b:0,a:1})).a=o(t.a),t}function I(e){return"r"===e.charAt(0)?function(e){const t=k.exec(e);let i,n,o,a=255;if(t){if(t[7]!==i){const e=+t[7];a=t[8]?s(e):r(255*e,0,255)}return i=+t[1],n=+t[3],o=+t[5],i=255&(t[2]?s(i):r(i,0,255)),n=255&(t[4]?s(n):r(n,0,255)),o=255&(t[6]?s(o):r(o,0,255)),{r:i,g:n,b:o,a}}}(e):function(e){const t=p.exec(e);let i,n=255;if(!t)return;t[5]!==i&&(n=t[6]?s(+t[5]):o(+t[5]));const r=b(+t[2]),a=+t[3]/100,l=+t[4]/100;return i="hwb"===t[1]?function(e,t,i){return v(_,e,t,i)}(r,a,l):"hsv"===t[1]?function(e,t,i){return v(g,e,t,i)}(r,a,l):x(r,a,l),{r:i[0],g:i[1],b:i[2],a:n}}(e)}class P{constructor(e){if(e instanceof P)return e;const t=typeof e;let i;if("object"===t)i=E(e);else if("string"===t){const t=e.replace(C,"");s=(n=t).length,"#"===n[0]&&(4===s||5===s?r={r:255&17*c[n[1]],g:255&17*c[n[2]],b:255&17*c[n[3]],a:5===s?17*c[n[4]]:255}:7!==s&&9!==s||(r={r:c[n[1]]<<4|c[n[2]],g:c[n[3]]<<4|c[n[4]],b:c[n[5]]<<4|c[n[6]],a:9===s?c[n[7]]<<4|c[n[8]]:255})),i=r||function(e){T||(T=function(){const e={},t=Object.keys(S),i=Object.keys(w);let n,r,s,o,a;for(n=0;n<t.length;n++){for(o=a=t[n],r=0;r<i.length;r++)s=i[r],a=a.replace(s,w[s]);s=parseInt(S[o],16),e[a]=[s>>16&255,s>>8&255,255&s]}return e}(),T.transparent=[0,0,0,0]);const t=T[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}(t)||I(t)}var n,r,s;this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=L(this._rgb);return e&&(e.a=a(e.a)),e}set rgb(e){this._rgb=E(e)}rgbString(){return this._valid?(e=this._rgb)&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${a(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`):void 0;var e}hexString(){return this._valid?(e=this._rgb,t=(e=>f(e.r)&&f(e.g)&&f(e.b)&&f(e.a))(e)?d:u,e?"#"+t(e.r)+t(e.g)+t(e.b)+((e,t)=>e<255?t(e):"")(e.a,t):void 0):void 0;var e,t}hslString(){return this._valid?function(e){if(!e)return;const t=y(e),i=t[0],n=l(t[1]),r=l(t[2]);return e.a<255?`hsla(${i}, ${n}%, ${r}%, ${a(e.a)})`:`hsl(${i}, ${n}%, ${r}%)`}(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,n=e.rgb;let r;const s=t===r?.5:t,o=2*s-1,a=i.a-n.a,l=((o*a===-1?o:(o+a)/(1+o*a))+1)/2;r=1-l,i.r=255&l*i.r+r*n.r+.5,i.g=255&l*i.g+r*n.g+.5,i.b=255&l*i.b+r*n.b+.5,i.a=s*i.a+(1-s)*n.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=function(e,t,i){const n=A(a(e.r)),r=A(a(e.g)),s=A(a(e.b));return{r:o(M(n+i*(A(a(t.r))-n))),g:o(M(r+i*(A(a(t.g))-r))),b:o(M(s+i*(A(a(t.b))-s))),a:e.a+i*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}clone(){return new P(this.rgb)}alpha(e){return this._rgb.a=o(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const e=this._rgb,t=n(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return D(this._rgb,2,e),this}darken(e){return D(this._rgb,2,-e),this}saturate(e){return D(this._rgb,1,e),this}desaturate(e){return D(this._rgb,1,-e),this}rotate(e){return function(e,t){var i=y(e);i[0]=b(i[0]+t),i=x(i),e.r=i[0],e.g=i[1],e.b=i[2]}(this._rgb,e),this}}function R(e){return new P(e)}},6464:function(e,t,i){!function(e){"use strict";var t={standalone:"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),format:"ledna_února_března_dubna_května_června_července_srpna_září_října_listopadu_prosince".split("_"),isFormat:/DD?[o.]?(\[[^\[\]]*\]|\s)+MMMM/},i="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),n=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function o(e,t,i,n){var r=e+" ";switch(i){case"s":return t||n?"pár sekund":"pár sekundami";case"ss":return t||n?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":n?"minutu":"minutou";case"mm":return t||n?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":n?"hodinu":"hodinou";case"hh":return t||n?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||n?"den":"dnem";case"dd":return t||n?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||n?"měsíc":"měsícem";case"MM":return t||n?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||n?"rok":"rokem";case"yy":return t||n?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:i,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},6465:(e,t,i)=>{"use strict";i.d(t,{n4:()=>c});var n=i(3424),r=i(9068),s=i(5059),o=i(1262),a=i(6607),l=[r.A,s.A,o.A,a.A],c=(0,n.UD)({defaultModifiers:l})},6523:(e,t,i)=>{"use strict";if(i.d(t,{P:()=>s,u:()=>r}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(6906);function r(e,t,i){return(0,n.T9)(e,(0,n.jk)(t,i))}function s(e,t,i){var n=r(e,t,i);return n>i?i:n}},6571:function(e,t,i){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,i){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(i(5093))},6575:function(e,t,i){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),i="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),n=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,n){return e?/-MMM-/.test(n)?i[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(i(5093))},6584:function(e,t,i){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(i(5093))},6607:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var n=i(7604),r=i(5581);const s={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},s=t.attributes[e]||{},o=t.elements[e];(0,r.sb)(o)&&(0,n.A)(o)&&(Object.assign(o.style,i),Object.keys(s).forEach(function(e){var t=s[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(e){var s=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce(function(e,t){return e[t]="",e},{});(0,r.sb)(s)&&(0,n.A)(s)&&(Object.assign(s.style,a),Object.keys(o).forEach(function(e){s.removeAttribute(e)}))})}},requires:["computeStyles"]}},6618:function(e,t,i){!function(e){"use strict";function t(e,t,i){return"m"===i?t?"хвилина":"хвилину":"h"===i?t?"година":"годину":e+" "+(n=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[i].split("_"),n%10==1&&n%100!=11?r[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?r[1]:r[2]);var n,r}function i(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var i={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?i.nominative.slice(1,7).concat(i.nominative.slice(0,1)):e?i[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:i.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:i("[Сьогодні "),nextDay:i("[Завтра "),lastDay:i("[Вчора "),nextWeek:i("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return i("[Минулої] dddd [").call(this);case 1:case 2:case 4:return i("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,i){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(i(5093))},6637:function(e,t,i){!function(e){"use strict";function t(e,t,i,n){var r=e+" ";switch(i){case"s":return t||n?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||n?"sekundi":"sekundah":e<5?t||n?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||n?"minuti":"minutama":e<5?t||n?"minute":"minutami":t||n?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||n?"uri":"urama":e<5?t||n?"ure":"urami":t||n?"ur":"urami");case"d":return t||n?"en dan":"enim dnem";case"dd":return r+(1===e?t||n?"dan":"dnem":2===e?t||n?"dni":"dnevoma":t||n?"dni":"dnevi");case"M":return t||n?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||n?"mesec":"mesecem":2===e?t||n?"meseca":"mesecema":e<5?t||n?"mesece":"meseci":t||n?"mesecev":"meseci");case"y":return t||n?"eno leto":"enim letom";case"yy":return r+(1===e?t||n?"leto":"letom":2===e?t||n?"leti":"letoma":e<5?t||n?"leta":"leti":t||n?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(i(5093))},6794:function(e,t,i){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,i){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},6870:function(e,t,i){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},i={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,i){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},week:{dow:1,doy:4}})}(i(5093))},6906:(e,t,i)=>{"use strict";i.d(t,{LI:()=>s,T9:()=>n,jk:()=>r});var n=Math.max,r=Math.min,s=Math.round},6947:function(e,t,i){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},i={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-ps",{months:"كانون الثاني_شباط_آذار_نيسان_أيّار_حزيران_تمّوز_آب_أيلول_تشري الأوّل_تشرين الثاني_كانون الأوّل".split("_"),monthsShort:"ك٢_شباط_آذار_نيسان_أيّار_حزيران_تمّوز_آب_أيلول_ت١_ت٢_ك١".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,i){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[٣٤٥٦٧٨٩٠]/g,function(e){return i[e]}).split("").reverse().join("").replace(/[١٢](?![\u062a\u0643])/g,function(e){return i[e]}).split("").reverse().join("").replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:0,doy:6}})}(i(5093))},6979:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>r}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(6354);function r(e){var t=(0,n.A)(e),i=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:r}}},6991:(e,t,i)=>{"use strict";i.d(t,{T:()=>r});var n=function(){return n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},r=function(){function e(e,t,i){var r=this;this.endVal=t,this.options=i,this.version="2.9.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(e){r.startTime||(r.startTime=e);var t=e-r.startTime;r.remaining=r.duration-t,r.useEasing?r.countDown?r.frameVal=r.startVal-r.easingFn(t,0,r.startVal-r.endVal,r.duration):r.frameVal=r.easingFn(t,r.startVal,r.endVal-r.startVal,r.duration):r.frameVal=r.startVal+(r.endVal-r.startVal)*(t/r.duration);var i=r.countDown?r.frameVal<r.endVal:r.frameVal>r.endVal;r.frameVal=i?r.endVal:r.frameVal,r.frameVal=Number(r.frameVal.toFixed(r.options.decimalPlaces)),r.printValue(r.frameVal),t<r.duration?r.rAF=requestAnimationFrame(r.count):null!==r.finalEndVal?r.update(r.finalEndVal):r.options.onCompleteCallback&&r.options.onCompleteCallback()},this.formatNumber=function(e){var t,i,n,s,o=e<0?"-":"";t=Math.abs(e).toFixed(r.options.decimalPlaces);var a=(t+="").split(".");if(i=a[0],n=a.length>1?r.options.decimal+a[1]:"",r.options.useGrouping){s="";for(var l=3,c=0,h=0,d=i.length;h<d;++h)r.options.useIndianSeparators&&4===h&&(l=2,c=1),0!==h&&c%l==0&&(s=r.options.separator+s),c++,s=i[d-h-1]+s;i=s}return r.options.numerals&&r.options.numerals.length&&(i=i.replace(/[0-9]/g,function(e){return r.options.numerals[+e]}),n=n.replace(/[0-9]/g,function(e){return r.options.numerals[+e]})),o+r.options.prefix+i+n+r.options.suffix},this.easeOutExpo=function(e,t,i,n){return i*(1-Math.pow(2,-10*e/n))*1024/1023+t},this.options=n(n({},this.defaults),i),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.el="string"==typeof e?document.getElementById(e):e,t=null==t?this.parse(this.el.innerHTML):t,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(t),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,e):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push(function(){return r.handleScroll(r)}),window.onscroll=function(){window.onScrollFns.forEach(function(e){return e()})},this.handleScroll(this)))}return e.prototype.handleScroll=function(e){if(e&&window&&!e.once){var t=window.innerHeight+window.scrollY,i=e.el.getBoundingClientRect(),n=i.top+window.pageYOffset,r=i.top+i.height+window.pageYOffset;r<t&&r>window.scrollY&&e.paused?(e.paused=!1,setTimeout(function(){return e.start()},e.options.scrollSpyDelay),e.options.scrollSpyOnce&&(e.once=!0)):(window.scrollY>r||n>t)&&!e.paused&&e.reset()}},e.prototype.determineDirectionAndSmartEasing=function(){var e=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>e;var t=e-this.startVal;if(Math.abs(t)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=e;var i=this.countDown?1:-1;this.endVal=e+i*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=e,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},e.prototype.start=function(e){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),e&&(this.options.onCompleteCallback=e),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},e.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},e.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},e.prototype.update=function(e){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(e),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},e.prototype.printValue=function(e){var t;if(this.el){var i=this.formattingFn(e);(null===(t=this.options.plugin)||void 0===t?void 0:t.render)?this.options.plugin.render(this.el,i):"INPUT"===this.el.tagName?this.el.value=i:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=i:this.el.innerHTML=i}},e.prototype.ensureNumber=function(e){return"number"==typeof e&&!isNaN(e)},e.prototype.validateValue=function(e){var t=Number(e);return this.ensureNumber(t)?t:(this.error="[CountUp] invalid start or end value: ".concat(e),null)},e.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},e.prototype.parse=function(e){var t=function(e){return e.replace(/([.,' ])/g,"\\$1")},i=t(this.options.separator),n=t(this.options.decimal),r=e.replace(new RegExp(i,"g"),"").replace(new RegExp(n,"g"),".");return parseFloat(r)},e}()},7071:function(e,t,i){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),i="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,n){return e?/-MMM-/.test(n)?i[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(i(5093))},7075:function(e,t,i){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(i(5093))},7088:function(e,t,i){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(i(5093))},7160:function(e,t,i){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(i(5093))},7306:function(e,t,i){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var i=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(i="a"),e+i},week:{dow:1,doy:4}})}(i(5093))},7310:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>d}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(6354);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(3318);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(7604);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(5581);if(/^(7(06|92|96)|140)$/.test(i.j))var a=i(793);if(/^(7(06|92|96)|140)$/.test(i.j))var l=i(9760);if(/^(7(06|92|96)|140)$/.test(i.j))var c=i(134);if(/^(7(06|92|96)|140)$/.test(i.j))var h=i(6906);function d(e,t,i){void 0===i&&(i=!1);var d=(0,o.sb)(t),u=(0,o.sb)(t)&&function(e){var t=e.getBoundingClientRect(),i=(0,h.LI)(t.width)/e.offsetWidth||1,n=(0,h.LI)(t.height)/e.offsetHeight||1;return 1!==i||1!==n}(t),f=(0,l.A)(t),p=(0,n.A)(e,u,i),m={scrollLeft:0,scrollTop:0},g={x:0,y:0};return(d||!d&&!i)&&(("body"!==(0,s.A)(t)||(0,c.A)(f))&&(m=(0,r.A)(t)),(0,o.sb)(t)?((g=(0,n.A)(t,!0)).x+=t.clientLeft,g.y+=t.clientTop):f&&(g.x=(0,a.A)(f))),{x:p.left+m.scrollLeft-g.x,y:p.top+m.scrollTop-g.y,width:p.width,height:p.height}}},7329:function(e,t,i){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(i(5093))},7357:function(e,t,i){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},i={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,i){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(i(5093))},7363:(e,t,i)=>{"use strict";i.d(t,{Vv:()=>ce,i1:()=>d});var n=i(9174),r=i(172);i(5299);const s=[],o={code:"en",week:{dow:0,doy:4},direction:"ltr",buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day",list:"list"},weekText:"W",weekTextLong:"Week",closeHint:"Close",timeHint:"Time",eventHint:"Event",allDayText:"all-day",moreLinkText:"more",noEventsText:"No events to display"},a=Object.assign(Object.assign({},o),{buttonHints:{prev:"Previous $0",next:"Next $0",today:(e,t)=>"day"===t?"Today":`This ${e}`},viewHint:"$0 view",navLinkHint:"Go to $0",moreLinkHint:e=>`Show ${e} more event${1===e?"":"s"}`});function l(e){let t=e.length>0?e[0].code:"en",i=s.concat(e),n={en:a};for(let e of i)n[e.code]=e;return{map:n,defaultCode:t}}function c(e,t){return"object"!=typeof e||Array.isArray(e)?function(e,t){let i=[].concat(e||[]),n=function(e,t){for(let i=0;i<e.length;i+=1){let n=e[i].toLocaleLowerCase().split("-");for(let e=n.length;e>0;e-=1){let i=n.slice(0,e).join("-");if(t[i])return t[i]}}return null}(i,t)||a;return h(e,i,n)}(e,t):h(e.code,[e.code],e)}function h(e,t,i){let r=(0,n.m)([o,i],["buttonText"]);delete r.code;let{week:s}=r;return delete r.week,{codeArg:e,codes:t,week:s,simpleNumberFormat:new Intl.NumberFormat(e),options:r}}function d(e){return{id:(0,n.g)(),name:e.name,premiumReleaseDate:e.premiumReleaseDate?new Date(e.premiumReleaseDate):void 0,deps:e.deps||[],reducers:e.reducers||[],isLoadingFuncs:e.isLoadingFuncs||[],contextInit:[].concat(e.contextInit||[]),eventRefiners:e.eventRefiners||{},eventDefMemberAdders:e.eventDefMemberAdders||[],eventSourceRefiners:e.eventSourceRefiners||{},isDraggableTransformers:e.isDraggableTransformers||[],eventDragMutationMassagers:e.eventDragMutationMassagers||[],eventDefMutationAppliers:e.eventDefMutationAppliers||[],dateSelectionTransformers:e.dateSelectionTransformers||[],datePointTransforms:e.datePointTransforms||[],dateSpanTransforms:e.dateSpanTransforms||[],views:e.views||{},viewPropsTransformers:e.viewPropsTransformers||[],isPropsValid:e.isPropsValid||null,externalDefTransforms:e.externalDefTransforms||[],viewContainerAppends:e.viewContainerAppends||[],eventDropTransformers:e.eventDropTransformers||[],componentInteractions:e.componentInteractions||[],calendarInteractions:e.calendarInteractions||[],themeClasses:e.themeClasses||{},eventSourceDefs:e.eventSourceDefs||[],cmdFormatter:e.cmdFormatter,recurringTypes:e.recurringTypes||[],namedTimeZonedImpl:e.namedTimeZonedImpl,initialView:e.initialView||"",elementDraggingImpl:e.elementDraggingImpl,optionChangeHandlers:e.optionChangeHandlers||{},scrollGridImpl:e.scrollGridImpl||null,listenerRefiners:e.listenerRefiners||{},optionRefiners:e.optionRefiners||{},propSetHandlers:e.propSetHandlers||{}}}function u(e,t){return{premiumReleaseDate:(i=e.premiumReleaseDate,n=t.premiumReleaseDate,void 0===i?n:void 0===n?i:new Date(Math.max(i.valueOf(),n.valueOf()))),reducers:e.reducers.concat(t.reducers),isLoadingFuncs:e.isLoadingFuncs.concat(t.isLoadingFuncs),contextInit:e.contextInit.concat(t.contextInit),eventRefiners:Object.assign(Object.assign({},e.eventRefiners),t.eventRefiners),eventDefMemberAdders:e.eventDefMemberAdders.concat(t.eventDefMemberAdders),eventSourceRefiners:Object.assign(Object.assign({},e.eventSourceRefiners),t.eventSourceRefiners),isDraggableTransformers:e.isDraggableTransformers.concat(t.isDraggableTransformers),eventDragMutationMassagers:e.eventDragMutationMassagers.concat(t.eventDragMutationMassagers),eventDefMutationAppliers:e.eventDefMutationAppliers.concat(t.eventDefMutationAppliers),dateSelectionTransformers:e.dateSelectionTransformers.concat(t.dateSelectionTransformers),datePointTransforms:e.datePointTransforms.concat(t.datePointTransforms),dateSpanTransforms:e.dateSpanTransforms.concat(t.dateSpanTransforms),views:Object.assign(Object.assign({},e.views),t.views),viewPropsTransformers:e.viewPropsTransformers.concat(t.viewPropsTransformers),isPropsValid:t.isPropsValid||e.isPropsValid,externalDefTransforms:e.externalDefTransforms.concat(t.externalDefTransforms),viewContainerAppends:e.viewContainerAppends.concat(t.viewContainerAppends),eventDropTransformers:e.eventDropTransformers.concat(t.eventDropTransformers),calendarInteractions:e.calendarInteractions.concat(t.calendarInteractions),componentInteractions:e.componentInteractions.concat(t.componentInteractions),themeClasses:Object.assign(Object.assign({},e.themeClasses),t.themeClasses),eventSourceDefs:e.eventSourceDefs.concat(t.eventSourceDefs),cmdFormatter:t.cmdFormatter||e.cmdFormatter,recurringTypes:e.recurringTypes.concat(t.recurringTypes),namedTimeZonedImpl:t.namedTimeZonedImpl||e.namedTimeZonedImpl,initialView:e.initialView||t.initialView,elementDraggingImpl:e.elementDraggingImpl||t.elementDraggingImpl,optionChangeHandlers:Object.assign(Object.assign({},e.optionChangeHandlers),t.optionChangeHandlers),scrollGridImpl:t.scrollGridImpl||e.scrollGridImpl,listenerRefiners:Object.assign(Object.assign({},e.listenerRefiners),t.listenerRefiners),optionRefiners:Object.assign(Object.assign({},e.optionRefiners),t.optionRefiners),propSetHandlers:Object.assign(Object.assign({},e.propSetHandlers),t.propSetHandlers)};var i,n}class f extends n.T{}function p(e,t,i,n){if(t[e])return t[e];let r=function(e,t,i,n){let r=i[e],s=n[e],o=e=>r&&null!==r[e]?r[e]:s&&null!==s[e]?s[e]:null,a=o("component"),l=o("superType"),c=null;if(l){if(l===e)throw new Error("Can't have a custom view type that references itself");c=p(l,t,i,n)}return!a&&c&&(a=c.component),a?{type:e,component:a,defaults:Object.assign(Object.assign({},c?c.defaults:{}),r?r.rawOptions:{}),overrides:Object.assign(Object.assign({},c?c.overrides:{}),s?s.rawOptions:{})}:null}(e,t,i,n);return r&&(t[e]=r),r}function m(e){return(0,n.a)(e,g)}function g(e){let t="function"==typeof e?{component:e}:e,{component:i}=t;return t.content?i=_(t):!i||i.prototype instanceof n.B||(i=_(Object.assign(Object.assign({},t),{content:i}))),{superType:t.type,component:i,rawOptions:t}}function _(e){return t=>(0,r.n)(n.V.Consumer,null,i=>(0,r.n)(n.C,{elTag:"div",elClasses:(0,n.b)(i.viewSpec),renderProps:Object.assign(Object.assign({},t),{nextDayThreshold:i.options.nextDayThreshold}),generatorName:void 0,customGenerator:e.content,classNameGenerator:e.classNames,didMount:e.didMount,willUnmount:e.willUnmount}))}function y(e,t,i,r){let s=m(e),o=m(t.views),a=function(e,t){let i,n={};for(i in e)p(i,n,e,t);for(i in t)p(i,n,e,t);return n}(s,o);return(0,n.a)(a,e=>function(e,t,i,r,s){let o=e.overrides.duration||e.defaults.duration||r.duration||i.duration,a=null,l="",c="",h={};if(o&&(a=function(e){let t=JSON.stringify(e),i=v[t];return void 0===i&&(i=(0,n.d)(e),v[t]=i),i}(o),a)){let e=(0,n.c)(a);l=e.unit,1===e.value&&(c=l,h=t[l]?t[l].rawOptions:{})}let d=t=>{let i=t.buttonText||{},n=e.defaults.buttonTextKey;return null!=n&&null!=i[n]?i[n]:null!=i[e.type]?i[e.type]:null!=i[c]?i[c]:null},u=t=>{let i=t.buttonHints||{},n=e.defaults.buttonTextKey;return null!=n&&null!=i[n]?i[n]:null!=i[e.type]?i[e.type]:null!=i[c]?i[c]:null};return{type:e.type,component:e.component,duration:a,durationUnit:l,singleUnit:c,optionDefaults:e.defaults,optionOverrides:Object.assign(Object.assign({},h),e.overrides),buttonTextOverride:d(r)||d(i)||e.overrides.buttonText,buttonTextDefault:d(s)||e.defaults.buttonText||d(n.e)||e.type,buttonTitleOverride:u(r)||u(i)||e.overrides.buttonHint,buttonTitleDefault:u(s)||e.defaults.buttonHint||u(n.e)}}(e,o,t,i,r))}f.prototype.classes={root:"fc-theme-standard",tableCellShaded:"fc-cell-shaded",buttonGroup:"fc-button-group",button:"fc-button fc-button-primary",buttonActive:"fc-button-active"},f.prototype.baseIconClass="fc-icon",f.prototype.iconClasses={close:"fc-icon-x",prev:"fc-icon-chevron-left",next:"fc-icon-chevron-right",prevYear:"fc-icon-chevrons-left",nextYear:"fc-icon-chevrons-right"},f.prototype.rtlIconClasses={prev:"fc-icon-chevron-right",next:"fc-icon-chevron-left",prevYear:"fc-icon-chevrons-right",nextYear:"fc-icon-chevrons-left"},f.prototype.iconOverrideOption="buttonIcons",f.prototype.iconOverrideCustomButtonOption="icon",f.prototype.iconOverridePrefix="fc-icon-";let v={};function x(e){for(let t in e)if(e[t].isFetching)return!0;return!1}function b(e,t,i,n){let r={};for(let e of t)r[e.sourceId]=e;return i&&(r=w(r,i,n)),Object.assign(Object.assign({},e),r)}function w(e,t,i){return S(e,(0,n.h)(e,e=>function(e,t,i){return M(e,i)?!i.options.lazyFetching||!e.fetchRange||e.isFetching||t.start<e.fetchRange.start||t.end>e.fetchRange.end:!e.latestFetchId}(e,t,i)),t,!1,i)}function S(e,t,i,n,r){let s={};for(let o in e){let a=e[o];t[o]?s[o]=T(a,i,n,r):s[o]=a}return s}function T(e,t,i,r){let{options:s,calendarApi:o}=r,a=r.pluginHooks.eventSourceDefs[e.sourceDefId],l=(0,n.g)();return a.fetch({eventSource:e,range:t,isRefetch:i,context:r},i=>{let{rawEvents:n}=i;s.eventSourceSuccess&&(n=s.eventSourceSuccess.call(o,n,i.response)||n),e.success&&(n=e.success.call(o,n,i.response)||n),r.dispatch({type:"RECEIVE_EVENTS",sourceId:e.sourceId,fetchId:l,fetchRange:t,rawEvents:n})},i=>{let n=!1;s.eventSourceFailure&&(s.eventSourceFailure.call(o,i),n=!0),e.failure&&(e.failure(i),n=!0),n||console.warn(i.message,i),r.dispatch({type:"RECEIVE_EVENT_ERROR",sourceId:e.sourceId,fetchId:l,fetchRange:t,error:i})}),Object.assign(Object.assign({},e),{isFetching:!0,latestFetchId:l})}function k(e,t){return(0,n.h)(e,e=>M(e,t))}function M(e,t){return!t.pluginHooks.eventSourceDefs[e.sourceDefId].ignoreRange}function A(e,t){switch(t.type){case"UNSELECT_DATES":return null;case"SELECT_DATES":return t.selection;default:return e}}function C(e,t){switch(t.type){case"UNSELECT_EVENT":return"";case"SELECT_EVENT":return t.eventInstanceId;default:return e}}function D(e,t){let i;switch(t.type){case"UNSET_EVENT_DRAG":return null;case"SET_EVENT_DRAG":return i=t.state,{affectedEvents:i.affectedEvents,mutatedEvents:i.mutatedEvents,isEvent:i.isEvent};default:return e}}function L(e,t){let i;switch(t.type){case"UNSET_EVENT_RESIZE":return null;case"SET_EVENT_RESIZE":return i=t.state,{affectedEvents:i.affectedEvents,mutatedEvents:i.mutatedEvents,isEvent:i.isEvent};default:return e}}function E(e,t,i,n,r){return{header:e.headerToolbar?I(e.headerToolbar,e,t,i,n,r):null,footer:e.footerToolbar?I(e.footerToolbar,e,t,i,n,r):null}}function I(e,t,i,n,r,s){let o={},a=[],l=!1;for(let c in e){let h=P(e[c],t,i,n,r,s);o[c]=h.widgets,a.push(...h.viewsWithButtons),l=l||h.hasTitle}return{sectionWidgets:o,viewsWithButtons:a,hasTitle:l}}function P(e,t,i,r,s,o){let a="rtl"===t.direction,l=t.customButtons||{},c=i.buttonText||{},h=t.buttonText||{},d=i.buttonHints||{},u=t.buttonHints||{},f=e?e.split(" "):[],p=[],m=!1;return{widgets:f.map(e=>e.split(",").map(e=>{if("title"===e)return m=!0,{buttonName:e};let i,f,g,_,y,v;if(i=l[e])g=e=>{i.click&&i.click.call(e.target,e,e.target)},(_=r.getCustomButtonIconClass(i))||(_=r.getIconClass(e,a))||(y=i.text),v=i.hint||i.text;else if(f=s[e]){p.push(e),g=()=>{o.changeView(e)},(y=f.buttonTextOverride)||(_=r.getIconClass(e,a))||(y=f.buttonTextDefault);let i=f.buttonTextOverride||f.buttonTextDefault;v=(0,n.k)(f.buttonTitleOverride||f.buttonTitleDefault||t.viewHint,[i,e],i)}else if(o[e])if(g=()=>{o[e]()},(y=c[e])||(_=r.getIconClass(e,a))||(y=h[e]),"prevYear"===e||"nextYear"===e){let t="prevYear"===e?"prev":"next";v=(0,n.k)(d[t]||u[t],[h.year||"year","year"],h[e])}else v=t=>(0,n.k)(d[e]||u[e],[h[t]||t,t],h[e]);return{buttonName:e,buttonClick:g,buttonIcon:_,buttonText:y,buttonHint:v}})),viewsWithButtons:p,hasTitle:m}}class R{constructor(e,t,i){this.type=e,this.getCurrentData=t,this.dateEnv=i}get calendar(){return this.getCurrentData().calendarApi}get title(){return this.getCurrentData().viewTitle}get activeStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start)}get activeEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end)}get currentStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start)}get currentEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end)}getOption(e){return this.getCurrentData().options[e]}}const O=d({name:"array-event-source",eventSourceDefs:[{ignoreRange:!0,parseMeta:e=>Array.isArray(e.events)?e.events:null,fetch(e,t){t({rawEvents:e.eventSource.meta})}}]}),z=d({name:"func-event-source",eventSourceDefs:[{parseMeta:e=>"function"==typeof e.events?e.events:null,fetch(e,t,i){const{dateEnv:r}=e.context,s=e.eventSource.meta;(0,n.u)(s.bind(null,(0,n.l)(e.range,r)),e=>t({rawEvents:e}),i)}}]}),F=d({name:"json-event-source",eventSourceRefiners:{method:String,extraParams:n.n,startParam:String,endParam:String,timeZoneParam:String},eventSourceDefs:[{parseMeta:e=>!e.url||"json"!==e.format&&e.format?null:{url:e.url,format:"json",method:(e.method||"GET").toUpperCase(),extraParams:e.extraParams,startParam:e.startParam,endParam:e.endParam,timeZoneParam:e.timeZoneParam},fetch(e,t,i){const{meta:r}=e.eventSource,s=function(e,t,i){let n,r,s,o,{dateEnv:a,options:l}=i,c={};return n=e.startParam,null==n&&(n=l.startParam),r=e.endParam,null==r&&(r=l.endParam),s=e.timeZoneParam,null==s&&(s=l.timeZoneParam),o="function"==typeof e.extraParams?e.extraParams():e.extraParams||{},Object.assign(c,o),c[n]=a.formatIso(t.start),c[r]=a.formatIso(t.end),"local"!==a.timeZone&&(c[s]=a.timeZone),c}(r,e.range,e.context);(0,n.r)(r.method,r.url,s).then(([e,i])=>{t({rawEvents:e,response:i})},i)}}]}),N={daysOfWeek:n.n,startTime:n.d,endTime:n.d,duration:n.d,startRecur:n.n,endRecur:n.n};function Y(e,t){let i=(0,n.v)(t.getCurrentData().eventSources);if(1===i.length&&1===e.length&&Array.isArray(i[0]._raw)&&Array.isArray(e[0]))return void t.dispatch({type:"RESET_RAW_EVENTS",sourceId:i[0].sourceId,rawEvents:e[0]});let r=[];for(let t of e){let e=!1;for(let n=0;n<i.length;n+=1)if(i[n]._raw===t){i.splice(n,1),e=!0;break}e||r.push(t)}for(let e of i)t.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:e.sourceId});for(let e of r)t.calendarApi.addEventSource(e)}const B=[O,z,F,d({name:"simple-recurring-event",recurringTypes:[{parse(e,t){if(e.daysOfWeek||e.startTime||e.endTime||e.startRecur||e.endRecur){let i,r={daysOfWeek:e.daysOfWeek||null,startTime:e.startTime||null,endTime:e.endTime||null,startRecur:e.startRecur?t.createMarker(e.startRecur):null,endRecur:e.endRecur?t.createMarker(e.endRecur):null,dateEnv:t};return e.duration&&(i=e.duration),!i&&e.startTime&&e.endTime&&(i=(0,n.s)(e.endTime,e.startTime)),{allDayGuess:Boolean(!e.startTime&&!e.endTime),duration:i,typeData:r}}return null},expand(e,t,i){let r=(0,n.o)(t,{start:e.startRecur,end:e.endRecur});return r?function(e,t,i,r,s){let o=e?(0,n.f)(e):null,a=(0,n.q)(s.start),l=s.end,c=[];for(t&&(t.milliseconds<0?l=(0,n.t)(l,1):t.milliseconds>=864e5&&(a=(0,n.t)(a,-1)));a<l;){let e;o&&!o[a.getUTCDay()]||(e=t?r.add(a,t):a,c.push(r.createMarker(i.toDate(e)))),a=(0,n.t)(a,1)}return c}(e.daysOfWeek,e.startTime,e.dateEnv,i,r):[]}}],eventRefiners:N}),d({name:"change-handler",optionChangeHandlers:{events(e,t){Y([e],t)},eventSources:Y}}),d({name:"misc",isLoadingFuncs:[e=>x(e.eventSources)],propSetHandlers:{dateProfile:function(e,t){t.emitter.trigger("datesSet",Object.assign(Object.assign({},(0,n.l)(e.activeRange,t.dateEnv)),{view:t.viewApi}))},eventStore:function(e,t){let{emitter:i}=t;i.hasHandlers("eventsSet")&&i.trigger("eventsSet",(0,n.w)(e,t))}}})];class H{constructor(e,t){this.runTaskOption=e,this.drainedOption=t,this.queue=[],this.delayedRunner=new n.D(this.drain.bind(this))}request(e,t){this.queue.push(e),this.delayedRunner.request(t)}pause(e){this.delayedRunner.pause(e)}resume(e,t){this.delayedRunner.resume(e,t)}drain(){let{queue:e}=this;for(;e.length;){let t,i=[];for(;t=e.shift();)this.runTask(t),i.push(t);this.drained(i)}}runTask(e){this.runTaskOption&&this.runTaskOption(e)}drained(e){this.drainedOption&&this.drainedOption(e)}}function j(e,t,i){let r;return r=/^(year|month)$/.test(e.currentRangeUnit)?e.currentRange:e.activeRange,i.formatRange(r.start,r.end,(0,n.x)(t.titleFormat||function(e){let{currentRangeUnit:t}=e;if("year"===t)return{year:"numeric"};if("month"===t)return{year:"numeric",month:"long"};let i=(0,n.y)(e.currentRange.start,e.currentRange.end);return null!==i&&i>1?{year:"numeric",month:"short",day:"numeric"}:{year:"numeric",month:"long",day:"numeric"}}(e)),{isEndExclusive:e.isRangeAllDay,defaultSeparator:t.titleRangeSeparator})}class V{constructor(){this.resetListeners=new Set}handleInput(e,t){const i=this.dateEnv;if(e!==i&&("function"==typeof t?this.nowFn=t:i||(this.nowAnchorDate=e.toDate(t?e.createMarker(t):e.createNowMarker()),this.nowAnchorQueried=Date.now()),this.dateEnv=e,i))for(const e of this.resetListeners.values())e()}getDateMarker(){return this.nowAnchorDate?this.dateEnv.timestampToMarker(this.nowAnchorDate.valueOf()+(Date.now()-this.nowAnchorQueried)):this.dateEnv.createMarker(this.nowFn())}addResetListener(e){this.resetListeners.add(e)}removeResetListener(e){this.resetListeners.delete(e)}}class W{constructor(e){this.computeCurrentViewData=(0,n.z)(this._computeCurrentViewData),this.organizeRawLocales=(0,n.z)(l),this.buildLocale=(0,n.z)(c),this.buildPluginHooks=function(){let e,t=[],i=[];return(r,s)=>(e&&(0,n.i)(r,t)&&(0,n.i)(s,i)||(e=function(e,t){let i={},n={premiumReleaseDate:void 0,reducers:[],isLoadingFuncs:[],contextInit:[],eventRefiners:{},eventDefMemberAdders:[],eventSourceRefiners:{},isDraggableTransformers:[],eventDragMutationMassagers:[],eventDefMutationAppliers:[],dateSelectionTransformers:[],datePointTransforms:[],dateSpanTransforms:[],views:{},viewPropsTransformers:[],isPropsValid:null,externalDefTransforms:[],viewContainerAppends:[],eventDropTransformers:[],componentInteractions:[],calendarInteractions:[],themeClasses:{},eventSourceDefs:[],cmdFormatter:null,recurringTypes:[],namedTimeZonedImpl:null,initialView:"",elementDraggingImpl:null,optionChangeHandlers:{},scrollGridImpl:null,listenerRefiners:{},optionRefiners:{},propSetHandlers:{}};function r(e){for(let t of e){const e=t.name,s=i[e];void 0===s?(i[e]=t.id,r(t.deps),n=u(n,t)):s!==t.id&&console.warn(`Duplicate plugin '${e}'`)}}return e&&r(e),r(t),n}(r,s)),t=r,i=s,e)}(),this.buildDateEnv=(0,n.z)(U),this.buildTheme=(0,n.z)($),this.parseToolbars=(0,n.z)(E),this.buildViewSpecs=(0,n.z)(y),this.buildDateProfileGenerator=(0,n.A)(G),this.buildViewApi=(0,n.z)(X),this.buildViewUiProps=(0,n.A)(J),this.buildEventUiBySource=(0,n.z)(q,n.E),this.buildEventUiBases=(0,n.z)(Z),this.parseContextBusinessHours=(0,n.A)(Q),this.buildTitle=(0,n.z)(j),this.nowManager=new V,this.emitter=new n.F,this.actionRunner=new H(this._handleAction.bind(this),this.updateData.bind(this)),this.currentCalendarOptionsInput={},this.currentCalendarOptionsRefined={},this.currentViewOptionsInput={},this.currentViewOptionsRefined={},this.currentCalendarOptionsRefiners={},this.optionsForRefining=[],this.optionsForHandling=[],this.getCurrentData=()=>this.data,this.dispatch=e=>{this.actionRunner.request(e)},this.props=e,this.actionRunner.pause(),this.nowManager=new V;let t={},i=this.computeOptionsData(e.optionOverrides,t,e.calendarApi),r=i.calendarOptions.initialView||i.pluginHooks.initialView,s=this.computeCurrentViewData(r,i,e.optionOverrides,t);e.calendarApi.currentDataManager=this,this.emitter.setThisContext(e.calendarApi),this.emitter.setOptions(s.options);let o={nowManager:this.nowManager,dateEnv:i.dateEnv,options:i.calendarOptions,pluginHooks:i.pluginHooks,calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},a=function(e,t,i){let n=e.initialDate;return null!=n?t.createMarker(n):i.getDateMarker()}(i.calendarOptions,i.dateEnv,this.nowManager),h=s.dateProfileGenerator.build(a);(0,n.G)(h.activeRange,a)||(a=h.currentRange.start);for(let e of i.pluginHooks.contextInit)e(o);let d=function(e,t,i){let r=t?t.activeRange:null;return b({},function(e,t){let i=(0,n.j)(t),r=[].concat(e.eventSources||[]),s=[];e.initialEvents&&r.unshift(e.initialEvents),e.events&&r.unshift(e.events);for(let e of r){let r=(0,n.p)(e,t,i);r&&s.push(r)}return s}(e,i),r,i)}(i.calendarOptions,h,o),f={dynamicOptionOverrides:t,currentViewType:r,currentDate:a,dateProfile:h,businessHours:this.parseContextBusinessHours(o),eventSources:d,eventUiBases:{},eventStore:(0,n.H)(),renderableEventStore:(0,n.H)(),dateSelection:null,eventSelection:"",eventDrag:null,eventResize:null,selectionConfig:this.buildViewUiProps(o).selectionConfig},p=Object.assign(Object.assign({},o),f);for(let e of i.pluginHooks.reducers)Object.assign(f,e(null,null,p));K(f,o)&&this.emitter.trigger("loading",!0),this.state=f,this.updateData(),this.actionRunner.resume()}resetOptions(e,t){let{props:i}=this;void 0===t?i.optionOverrides=e:(i.optionOverrides=Object.assign(Object.assign({},i.optionOverrides||{}),e),this.optionsForRefining.push(...t)),(void 0===t||t.length)&&this.actionRunner.request({type:"NOTHING"})}_handleAction(e){let{props:t,state:i,emitter:r}=this,s=function(e,t){return"SET_OPTION"===t.type?Object.assign(Object.assign({},e),{[t.optionName]:t.rawOptionValue}):e}(i.dynamicOptionOverrides,e),o=this.computeOptionsData(t.optionOverrides,s,t.calendarApi),a=function(e,t){return"CHANGE_VIEW_TYPE"===t.type&&(e=t.viewType),e}(i.currentViewType,e),l=this.computeCurrentViewData(a,o,t.optionOverrides,s);t.calendarApi.currentDataManager=this,r.setThisContext(t.calendarApi),r.setOptions(l.options);let c={nowManager:this.nowManager,dateEnv:o.dateEnv,options:o.calendarOptions,pluginHooks:o.pluginHooks,calendarApi:t.calendarApi,dispatch:this.dispatch,emitter:r,getCurrentData:this.getCurrentData},{currentDate:h,dateProfile:d}=i;this.data&&this.data.dateProfileGenerator!==l.dateProfileGenerator&&(d=l.dateProfileGenerator.build(h)),h=function(e,t){return"CHANGE_DATE"===t.type?t.dateMarker:e}(h,e),d=function(e,t,i,n){let r;switch(t.type){case"CHANGE_VIEW_TYPE":return n.build(t.dateMarker||i);case"CHANGE_DATE":return n.build(t.dateMarker);case"PREV":if(r=n.buildPrev(e,i),r.isValid)return r;break;case"NEXT":if(r=n.buildNext(e,i),r.isValid)return r}return e}(d,e,h,l.dateProfileGenerator),"PREV"!==e.type&&"NEXT"!==e.type&&(0,n.G)(d.currentRange,h)||(h=d.currentRange.start);let u=function(e,t,i,r){let s=i?i.activeRange:null;switch(t.type){case"ADD_EVENT_SOURCES":return b(e,t.sources,s,r);case"REMOVE_EVENT_SOURCE":return o=e,a=t.sourceId,(0,n.h)(o,e=>e.sourceId!==a);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return i?w(e,s,r):e;case"FETCH_EVENT_SOURCES":return S(e,t.sourceIds?(0,n.f)(t.sourceIds):k(e,r),s,t.isRefetch||!1,r);case"RECEIVE_EVENTS":case"RECEIVE_EVENT_ERROR":return function(e,t,i,n){let r=e[t];return r&&i===r.latestFetchId?Object.assign(Object.assign({},e),{[t]:Object.assign(Object.assign({},r),{isFetching:!1,fetchRange:n})}):e}(e,t.sourceId,t.fetchId,t.fetchRange);case"REMOVE_ALL_EVENT_SOURCES":return{};default:return e}var o,a}(i.eventSources,e,d,c),f=(0,n.I)(i.eventStore,e,u,d,c),p=x(u)&&!l.options.progressiveEventRendering&&i.renderableEventStore||f,{eventUiSingleBase:m,selectionConfig:g}=this.buildViewUiProps(c),_=this.buildEventUiBySource(u),y={dynamicOptionOverrides:s,currentViewType:a,currentDate:h,dateProfile:d,eventSources:u,eventStore:f,renderableEventStore:p,selectionConfig:g,eventUiBases:this.buildEventUiBases(p.defs,m,_),businessHours:this.parseContextBusinessHours(c),dateSelection:A(i.dateSelection,e),eventSelection:C(i.eventSelection,e),eventDrag:D(i.eventDrag,e),eventResize:L(i.eventResize,e)},v=Object.assign(Object.assign({},c),y);for(let t of o.pluginHooks.reducers)Object.assign(y,t(i,e,v));let T=K(i,c),M=K(y,c);!T&&M?r.trigger("loading",!0):T&&!M&&r.trigger("loading",!1),this.state=y,t.onAction&&t.onAction(e)}updateData(){let{props:e,state:t}=this,i=this.data,r=this.computeOptionsData(e.optionOverrides,t.dynamicOptionOverrides,e.calendarApi),s=this.computeCurrentViewData(t.currentViewType,r,e.optionOverrides,t.dynamicOptionOverrides),o=this.data=Object.assign(Object.assign(Object.assign({nowManager:this.nowManager,viewTitle:this.buildTitle(t.dateProfile,s.options,r.dateEnv),calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},r),s),t),a=r.pluginHooks.optionChangeHandlers,l=i&&i.calendarOptions,c=r.calendarOptions;if(l&&l!==c){l.timeZone!==c.timeZone&&(t.eventSources=o.eventSources=function(e,t,i){let n=t?t.activeRange:null;return S(e,k(e,i),n,!0,i)}(o.eventSources,t.dateProfile,o),t.eventStore=o.eventStore=(0,n.J)(o.eventStore,i.dateEnv,o.dateEnv),t.renderableEventStore=o.renderableEventStore=(0,n.J)(o.renderableEventStore,i.dateEnv,o.dateEnv));for(let e in a)-1===this.optionsForHandling.indexOf(e)&&l[e]===c[e]||a[e](c[e],o)}this.optionsForHandling=[],e.onData&&e.onData(o)}computeOptionsData(e,t,i){if(!this.optionsForRefining.length&&e===this.stableOptionOverrides&&t===this.stableDynamicOptionOverrides)return this.stableCalendarOptionsData;let{refinedOptions:n,pluginHooks:r,localeDefaults:s,availableLocaleData:o,extra:a}=this.processRawCalendarOptions(e,t);ee(a);let l=this.buildDateEnv(n.timeZone,n.locale,n.weekNumberCalculation,n.firstDay,n.weekText,r,o,n.defaultRangeSeparator),c=this.buildViewSpecs(r.views,this.stableOptionOverrides,this.stableDynamicOptionOverrides,s),h=this.buildTheme(n,r),d=this.parseToolbars(n,this.stableOptionOverrides,h,c,i);return this.stableCalendarOptionsData={calendarOptions:n,pluginHooks:r,dateEnv:l,viewSpecs:c,theme:h,toolbarConfig:d,localeDefaults:s,availableRawLocales:o.map}}processRawCalendarOptions(e,t){let{locales:i,locale:r}=(0,n.K)([n.e,e,t]),s=this.organizeRawLocales(i),o=s.map,a=this.buildLocale(r||s.defaultCode,o).options,l=this.buildPluginHooks(e.plugins||[],B),c=this.currentCalendarOptionsRefiners=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n.L),n.M),n.N),l.listenerRefiners),l.optionRefiners),h={},d=(0,n.K)([n.e,a,e,t]),u={},f=this.currentCalendarOptionsInput,p=this.currentCalendarOptionsRefined,m=!1;for(let e in d)-1===this.optionsForRefining.indexOf(e)&&(d[e]===f[e]||n.O[e]&&e in f&&n.O[e](f[e],d[e]))?u[e]=p[e]:c[e]?(u[e]=c[e](d[e]),m=!0):h[e]=f[e];return m&&(this.currentCalendarOptionsInput=d,this.currentCalendarOptionsRefined=u,this.stableOptionOverrides=e,this.stableDynamicOptionOverrides=t),this.optionsForHandling.push(...this.optionsForRefining),this.optionsForRefining=[],{rawOptions:this.currentCalendarOptionsInput,refinedOptions:this.currentCalendarOptionsRefined,pluginHooks:l,availableLocaleData:s,localeDefaults:a,extra:h}}_computeCurrentViewData(e,t,i,n){let r=t.viewSpecs[e];if(!r)throw new Error(`viewType "${e}" is not available. Please make sure you've loaded all neccessary plugins`);let{refinedOptions:s,extra:o}=this.processRawViewOptions(r,t.pluginHooks,t.localeDefaults,i,n);return ee(o),this.nowManager.handleInput(t.dateEnv,s.now),{viewSpec:r,options:s,dateProfileGenerator:this.buildDateProfileGenerator({dateProfileGeneratorClass:r.optionDefaults.dateProfileGeneratorClass,nowManager:this.nowManager,duration:r.duration,durationUnit:r.durationUnit,usesMinMaxTime:r.optionDefaults.usesMinMaxTime,dateEnv:t.dateEnv,calendarApi:this.props.calendarApi,slotMinTime:s.slotMinTime,slotMaxTime:s.slotMaxTime,showNonCurrentDates:s.showNonCurrentDates,dayCount:s.dayCount,dateAlignment:s.dateAlignment,dateIncrement:s.dateIncrement,hiddenDays:s.hiddenDays,weekends:s.weekends,validRangeInput:s.validRange,visibleRangeInput:s.visibleRange,fixedWeekCount:s.fixedWeekCount}),viewApi:this.buildViewApi(e,this.getCurrentData,t.dateEnv)}}processRawViewOptions(e,t,i,r,s){let o=(0,n.K)([n.e,e.optionDefaults,i,r,e.optionOverrides,s]),a=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n.L),n.M),n.N),n.P),t.listenerRefiners),t.optionRefiners),l={},c=this.currentViewOptionsInput,h=this.currentViewOptionsRefined,d=!1,u={};for(let e in o)o[e]===c[e]||n.O[e]&&n.O[e](o[e],c[e])?l[e]=h[e]:(o[e]===this.currentCalendarOptionsInput[e]||n.O[e]&&n.O[e](o[e],this.currentCalendarOptionsInput[e])?e in this.currentCalendarOptionsRefined&&(l[e]=this.currentCalendarOptionsRefined[e]):a[e]?l[e]=a[e](o[e]):u[e]=o[e],d=!0);return d&&(this.currentViewOptionsInput=o,this.currentViewOptionsRefined=l),{rawOptions:this.currentViewOptionsInput,refinedOptions:this.currentViewOptionsRefined,extra:u}}}function U(e,t,i,r,s,o,a,l){let h=c(t||a.defaultCode,a.map);return new n.Q({calendarSystem:"gregory",timeZone:e,namedTimeZoneImpl:o.namedTimeZonedImpl,locale:h,weekNumberCalculation:i,firstDay:r,weekText:s,cmdFormatter:o.cmdFormatter,defaultSeparator:l})}function $(e,t){return new(t.themeClasses[e.themeSystem]||f)(e)}function G(e){return new(e.dateProfileGeneratorClass||n.R)(e)}function X(e,t,i){return new R(e,t,i)}function q(e){return(0,n.a)(e,e=>e.ui)}function Z(e,t,i){let n={"":t};for(let t in e){let r=e[t];r.sourceId&&i[r.sourceId]&&(n[t]=i[r.sourceId])}return n}function J(e){let{options:t}=e;return{eventUiSingleBase:(0,n.S)({display:t.eventDisplay,editable:t.editable,startEditable:t.eventStartEditable,durationEditable:t.eventDurationEditable,constraint:t.eventConstraint,overlap:"boolean"==typeof t.eventOverlap?t.eventOverlap:void 0,allow:t.eventAllow,backgroundColor:t.eventBackgroundColor,borderColor:t.eventBorderColor,textColor:t.eventTextColor,color:t.eventColor},e),selectionConfig:(0,n.S)({constraint:t.selectConstraint,overlap:"boolean"==typeof t.selectOverlap?t.selectOverlap:void 0,allow:t.selectAllow},e)}}function K(e,t){for(let i of t.pluginHooks.isLoadingFuncs)if(i(e))return!0;return!1}function Q(e){return(0,n.U)(e.options.businessHours,e)}function ee(e,t){for(let i in e)console.warn(`Unknown option '${i}'`+(t?` for view '${t}'`:""))}class te extends n.B{render(){let e=this.props.widgetGroups.map(e=>this.renderWidgetGroup(e));return(0,r.n)("div",{className:"fc-toolbar-chunk"},...e)}renderWidgetGroup(e){let{props:t}=this,{theme:i}=this.context,n=[],s=!0;for(let o of e){let{buttonName:e,buttonClick:a,buttonText:l,buttonIcon:c,buttonHint:h}=o;if("title"===e)s=!1,n.push((0,r.n)("h2",{className:"fc-toolbar-title",id:t.titleId},t.title));else{let s=e===t.activeButton,o=!t.isTodayEnabled&&"today"===e||!t.isPrevEnabled&&"prev"===e||!t.isNextEnabled&&"next"===e,d=[`fc-${e}-button`,i.getClass("button")];s&&d.push(i.getClass("buttonActive")),n.push((0,r.n)("button",{type:"button",title:"function"==typeof h?h(t.navUnit):h,disabled:o,"aria-pressed":s,className:d.join(" "),onClick:a},l||(c?(0,r.n)("span",{className:c,role:"img"}):"")))}}if(n.length>1){let e=s&&i.getClass("buttonGroup")||"";return(0,r.n)("div",{className:e},...n)}return n[0]}}class ie extends n.B{render(){let e,t,{model:i,extraClassName:n}=this.props,s=!1,o=i.sectionWidgets,a=o.center;o.left?(s=!0,e=o.left):e=o.start,o.right?(s=!0,t=o.right):t=o.end;let l=[n||"","fc-toolbar",s?"fc-toolbar-ltr":""];return(0,r.n)("div",{className:l.join(" ")},this.renderSection("start",e||[]),this.renderSection("center",a||[]),this.renderSection("end",t||[]))}renderSection(e,t){let{props:i}=this;return(0,r.n)(te,{key:e,widgetGroups:t,title:i.title,navUnit:i.navUnit,activeButton:i.activeButton,isTodayEnabled:i.isTodayEnabled,isPrevEnabled:i.isPrevEnabled,isNextEnabled:i.isNextEnabled,titleId:i.titleId})}}class ne extends n.B{constructor(){super(...arguments),this.state={availableWidth:null},this.handleEl=e=>{this.el=e,(0,n.W)(this.props.elRef,e),this.updateAvailableWidth()},this.handleResize=()=>{this.updateAvailableWidth()}}render(){let{props:e,state:t}=this,{aspectRatio:i}=e,n=["fc-view-harness",i||e.liquid||e.height?"fc-view-harness-active":"fc-view-harness-passive"],s="",o="";return i?null!==t.availableWidth?s=t.availableWidth/i:o=1/i*100+"%":s=e.height||"",(0,r.n)("div",{"aria-labelledby":e.labeledById,ref:this.handleEl,className:n.join(" "),style:{height:s,paddingBottom:o}},e.children)}componentDidMount(){this.context.addResizeHandler(this.handleResize)}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}updateAvailableWidth(){this.el&&this.props.aspectRatio&&this.setState({availableWidth:this.el.offsetWidth})}}class re extends n.X{constructor(e){super(e),this.handleSegClick=(e,t)=>{let{component:i}=this,{context:r}=i,s=(0,n.Y)(t);if(s&&i.isValidSegDownEl(e.target)){let o=(0,n.Z)(e.target,".fc-event-forced-url"),a=o?o.querySelector("a[href]").href:"";r.emitter.trigger("eventClick",{el:t,event:new n._(i.context,s.eventRange.def,s.eventRange.instance),jsEvent:e,view:r.viewApi}),a&&!e.defaultPrevented&&(window.location.href=a)}},this.destroy=(0,n.$)(e.el,"click",".fc-event",this.handleSegClick)}}class se extends n.X{constructor(e){super(e),this.handleEventElRemove=e=>{e===this.currentSegEl&&this.handleSegLeave(null,this.currentSegEl)},this.handleSegEnter=(e,t)=>{(0,n.Y)(t)&&(this.currentSegEl=t,this.triggerEvent("eventMouseEnter",e,t))},this.handleSegLeave=(e,t)=>{this.currentSegEl&&(this.currentSegEl=null,this.triggerEvent("eventMouseLeave",e,t))},this.removeHoverListeners=(0,n.a0)(e.el,".fc-event",this.handleSegEnter,this.handleSegLeave)}destroy(){this.removeHoverListeners()}triggerEvent(e,t,i){let{component:r}=this,{context:s}=r,o=(0,n.Y)(i);t&&!r.isValidSegDownEl(t.target)||s.emitter.trigger(e,{el:i,event:new n._(s,o.eventRange.def,o.eventRange.instance),jsEvent:t,view:s.viewApi})}}class oe extends n.a1{constructor(){super(...arguments),this.buildViewContext=(0,n.z)(n.a2),this.buildViewPropTransformers=(0,n.z)(le),this.buildToolbarProps=(0,n.z)(ae),this.headerRef=(0,r._3)(),this.footerRef=(0,r._3)(),this.interactionsStore={},this.state={viewLabelId:(0,n.a3)()},this.registerInteractiveComponent=(e,t)=>{let i=(0,n.a4)(e,t),r=[re,se].concat(this.props.pluginHooks.componentInteractions).map(e=>new e(i));this.interactionsStore[e.uid]=r,n.a5[e.uid]=i},this.unregisterInteractiveComponent=e=>{let t=this.interactionsStore[e.uid];if(t){for(let e of t)e.destroy();delete this.interactionsStore[e.uid]}delete n.a5[e.uid]},this.resizeRunner=new n.D(()=>{this.props.emitter.trigger("_resize",!0),this.props.emitter.trigger("windowResize",{view:this.props.viewApi})}),this.handleWindowResize=e=>{let{options:t}=this.props;t.handleWindowResize&&e.target===window&&this.resizeRunner.request(t.windowResizeDelay)}}render(){let e,{props:t}=this,{toolbarConfig:i,options:s}=t,o=!1,a="";t.isHeightAuto||t.forPrint?a="":null!=s.height?o=!0:null!=s.contentHeight?a=s.contentHeight:e=Math.max(s.aspectRatio,.5);let l=this.buildViewContext(t.viewSpec,t.viewApi,t.options,t.dateProfileGenerator,t.dateEnv,t.nowManager,t.theme,t.pluginHooks,t.dispatch,t.getCurrentData,t.emitter,t.calendarApi,this.registerInteractiveComponent,this.unregisterInteractiveComponent),c=i.header&&i.header.hasTitle?this.state.viewLabelId:void 0;return(0,r.n)(n.V.Provider,{value:l},(0,r.n)(n.a6,{unit:"day"},n=>{let s=this.buildToolbarProps(t.viewSpec,t.dateProfile,t.dateProfileGenerator,t.currentDate,n,t.viewTitle);return(0,r.n)(r.FK,null,i.header&&(0,r.n)(ie,Object.assign({ref:this.headerRef,extraClassName:"fc-header-toolbar",model:i.header,titleId:c},s)),(0,r.n)(ne,{liquid:o,height:a,aspectRatio:e,labeledById:c},this.renderView(t),this.buildAppendContent()),i.footer&&(0,r.n)(ie,Object.assign({ref:this.footerRef,extraClassName:"fc-footer-toolbar",model:i.footer,titleId:""},s)))}))}componentDidMount(){let{props:e}=this;this.calendarInteractions=e.pluginHooks.calendarInteractions.map(t=>new t(e)),window.addEventListener("resize",this.handleWindowResize);let{propSetHandlers:t}=e.pluginHooks;for(let i in t)t[i](e[i],e)}componentDidUpdate(e){let{props:t}=this,{propSetHandlers:i}=t.pluginHooks;for(let n in i)t[n]!==e[n]&&i[n](t[n],t)}componentWillUnmount(){window.removeEventListener("resize",this.handleWindowResize),this.resizeRunner.clear();for(let e of this.calendarInteractions)e.destroy();this.props.emitter.trigger("_unmount")}buildAppendContent(){let{props:e}=this,t=e.pluginHooks.viewContainerAppends.map(t=>t(e));return(0,r.n)(r.FK,{},...t)}renderView(e){let{pluginHooks:t}=e,{viewSpec:i}=e,n={dateProfile:e.dateProfile,businessHours:e.businessHours,eventStore:e.renderableEventStore,eventUiBases:e.eventUiBases,dateSelection:e.dateSelection,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,isHeightAuto:e.isHeightAuto,forPrint:e.forPrint},s=this.buildViewPropTransformers(t.viewPropsTransformers);for(let t of s)Object.assign(n,t.transform(n,e));let o=i.component;return(0,r.n)(o,Object.assign({},n))}}function ae(e,t,i,r,s,o){let a=i.build(s,void 0,!1),l=i.buildPrev(t,r,!1),c=i.buildNext(t,r,!1);return{title:o,activeButton:e.type,navUnit:e.singleUnit,isTodayEnabled:a.isValid&&!(0,n.G)(t.currentRange,s),isPrevEnabled:l.isValid,isNextEnabled:c.isValid}}function le(e){return e.map(e=>new e)}class ce extends n.a7{constructor(e,t={}){super(),this.isRendering=!1,this.isRendered=!1,this.currentClassNames=[],this.customContentRenderId=0,this.handleAction=e=>{switch(e.type){case"SET_EVENT_DRAG":case"SET_EVENT_RESIZE":this.renderRunner.tryDrain()}},this.handleData=e=>{this.currentData=e,this.renderRunner.request(e.calendarOptions.rerenderDelay)},this.handleRenderRequest=()=>{if(this.isRendering){this.isRendered=!0;let{currentData:e}=this;(0,n.a8)(()=>{(0,r.XX)((0,r.n)(n.a9,{options:e.calendarOptions,theme:e.theme,emitter:e.emitter},(t,i,s,o)=>(this.setClassNames(t),this.setHeight(i),(0,r.n)(n.aa.Provider,{value:this.customContentRenderId},(0,r.n)(oe,Object.assign({isHeightAuto:s,forPrint:o},e))))),this.el)})}else this.isRendered&&(this.isRendered=!1,(0,r.XX)(null,this.el),this.setClassNames([]),this.setHeight(""))},(0,n.ab)(e),this.el=e,this.renderRunner=new n.D(this.handleRenderRequest),new W({optionOverrides:t,calendarApi:this,onAction:this.handleAction,onData:this.handleData})}render(){let e=this.isRendering;e?this.customContentRenderId+=1:this.isRendering=!0,this.renderRunner.request(),e&&this.updateSize()}destroy(){this.isRendering&&(this.isRendering=!1,this.renderRunner.request())}updateSize(){(0,n.a8)(()=>{super.updateSize()})}batchRendering(e){this.renderRunner.pause("batchRendering"),e(),this.renderRunner.resume("batchRendering")}pauseRendering(){this.renderRunner.pause("pauseRendering")}resumeRendering(){this.renderRunner.resume("pauseRendering",!0)}resetOptions(e,t){this.currentDataManager.resetOptions(e,t)}setClassNames(e){if(!(0,n.i)(e,this.currentClassNames)){let{classList:t}=this.el;for(let e of this.currentClassNames)t.remove(e);for(let i of e)t.add(i);this.currentClassNames=e}}setHeight(e){(0,n.ac)(this.el,"height",e)}}},7364:(e,t,i)=>{"use strict";function n(){return{top:0,right:0,bottom:0,left:0}}i.d(t,{A:()=>n})},7538:function(e,t,i){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,i){return e>11?i?"ප.ව.":"පස් වරු":i?"පෙ.ව.":"පෙර වරු"}})}(i(5093))},7576:function(e){var t;t=function(){return function(){var e={686:function(e,t,i){"use strict";i.d(t,{default:function(){return x}});var n=i(279),r=i.n(n),s=i(370),o=i.n(s),a=i(817),l=i.n(a);function c(e){try{return document.execCommand(e)}catch(e){return!1}}var h=function(e){var t=l()(e);return c("cut"),t},d=function(e,t){var i=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),i=document.createElement("textarea");i.style.fontSize="12pt",i.style.border="0",i.style.padding="0",i.style.margin="0",i.style.position="absolute",i.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;return i.style.top="".concat(n,"px"),i.setAttribute("readonly",""),i.value=e,i}(e);t.container.appendChild(i);var n=l()(i);return c("copy"),i.remove(),n},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},i="";return"string"==typeof e?i=d(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?i=d(e.value,t):(i=l()(e),c("copy")),i};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function m(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}function _(e){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_(e)}function y(e,t){var i="data-clipboard-".concat(e);if(t.hasAttribute(i))return t.getAttribute(i)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(l,e);var t,i,n,r,s,a=(r=l,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=_(r);if(s){var i=_(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function l(e,t){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(i=a.call(this)).resolveOptions(t),i.listenClick(e),i}return t=l,i=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===p(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=o()(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,i=this.action(t)||"copy",n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,i=void 0===t?"copy":t,n=e.container,r=e.target,s=e.text;if("copy"!==i&&"cut"!==i)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==r){if(!r||"object"!==f(r)||1!==r.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===i&&r.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===i&&(r.hasAttribute("readonly")||r.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return s?u(s,{container:n}):r?"cut"===i?h(r):u(r,{container:n}):void 0}({action:i,container:this.container,target:this.target(t),text:this.text(t)});this.emit(n?"success":"error",{action:i,text:n,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return y("action",e)}},{key:"defaultTarget",value:function(e){var t=y("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return y("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],n=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return u(e,t)}},{key:"cut",value:function(e){return h(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,i=!!document.queryCommandSupported;return t.forEach(function(e){i=i&&!!document.queryCommandSupported(e)}),i}}],i&&m(t.prototype,i),n&&m(t,n),l}(r()),x=v},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,i){var n=i(828);function r(e,t,i,n,r){var o=s.apply(this,arguments);return e.addEventListener(i,o,r),{destroy:function(){e.removeEventListener(i,o,r)}}}function s(e,t,i,r){return function(i){i.delegateTarget=n(i.target,t),i.delegateTarget&&r.call(e,i)}}e.exports=function(e,t,i,n,s){return"function"==typeof e.addEventListener?r.apply(null,arguments):"function"==typeof i?r.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(e){return r(e,t,i,n,s)}))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var i=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===i||"[object HTMLCollection]"===i)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,i){var n=i(879),r=i(438);e.exports=function(e,t,i){if(!e&&!t&&!i)throw new Error("Missing required arguments");if(!n.string(t))throw new TypeError("Second argument must be a String");if(!n.fn(i))throw new TypeError("Third argument must be a Function");if(n.node(e))return function(e,t,i){return e.addEventListener(t,i),{destroy:function(){e.removeEventListener(t,i)}}}(e,t,i);if(n.nodeList(e))return function(e,t,i){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,i)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,i)})}}}(e,t,i);if(n.string(e))return function(e,t,i){return r(document.body,e,t,i)}(e,t,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var i=e.hasAttribute("readonly");i||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),i||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r),t=n.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,i){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:i}),this},once:function(e,t,i){var n=this;function r(){n.off(e,r),t.apply(i,arguments)}return r._=t,this.on(e,r,i)},emit:function(e){for(var t=[].slice.call(arguments,1),i=((this.e||(this.e={}))[e]||[]).slice(),n=0,r=i.length;n<r;n++)i[n].fn.apply(i[n].ctx,t);return this},off:function(e,t){var i=this.e||(this.e={}),n=i[e],r=[];if(n&&t)for(var s=0,o=n.length;s<o;s++)n[s].fn!==t&&n[s].fn._!==t&&r.push(n[s]);return r.length?i[e]=r:delete i[e],this}},e.exports=t,e.exports.TinyEmitter=t}},t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}return i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i(686)}().default},e.exports=t()},7604:(e,t,i)=>{"use strict";function n(e){return e?(e.nodeName||"").toLowerCase():null}i.d(t,{A:()=>n})},7609:function(e,t,i){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(i(5093))},7650:function(e,t,i){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),i="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),n=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,n){return e?/-MMM-/.test(n)?i[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(i(5093))},7711:function(e,t,i){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(i(5093))},7730:function(e,t,i){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),i="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),n=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,n){return e?/-MMM-/.test(n)?i[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(i(5093))},7777:function(e,t,i){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,i=e%100;return 0===e?e+"-ев":0===i?e+"-ен":i>10&&i<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(i(5093))},7853:function(e,t,i){!function(e){"use strict";function t(e,t,i,n){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[i][0]:r[i][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},7876:(e,t,i)=>{"use strict";var n,r,s,o,a=i(4692),l=i(9875),c=a,h=function(e,t){if(h.factory(e,t))return h;if(this instanceof h)return c(e).DataTable(t);var i=this,n=void 0===(t=e),s=this.length;return n&&(t={}),this.api=function(){return new r(this)},this.each(function(){var e,o=s>1?tt({},t,!0):t,a=0,l=this.getAttribute("id"),d=h.defaults,u=c(this);if("table"==this.nodeName.toLowerCase()){o.on&&o.on.options&&ht(u,"options",o.on.options),u.trigger("options.dt",o),z(d),F(d.column),R(d,d,!0),R(d.column,d.column,!0),R(d,c.extend(o,dt(u.data())),!0);var f=h.settings;for(a=0,e=f.length;a<e;a++){var p=f[a];if(p.nTable==this||p.nTHead&&p.nTHead.parentNode==this||p.nTFoot&&p.nTFoot.parentNode==this){var m=void 0!==o.bRetrieve?o.bRetrieve:d.bRetrieve,g=void 0!==o.bDestroy?o.bDestroy:d.bDestroy;if(n||m)return p.oInstance;if(g){new h.Api(p).destroy();break}return void Qe(p,0,"Cannot reinitialise DataTable",3)}if(p.sTableId==this.id){f.splice(a,1);break}}null!==l&&""!==l||(l="DataTables_Table_"+h.ext._unique++,this.id=l);var _=c.extend(!0,{},h.models.oSettings,{sDestroyWidth:u[0].style.width,sInstance:l,sTableId:l,colgroup:c("<colgroup>").prependTo(this),fastData:function(e,t,i){return Q(_,e,t,i)}});_.nTable=this,_.oInit=o,f.push(_),_.api=new r(_),_.oInstance=1===i.length?i:u.dataTable(),z(o),o.aLengthMenu&&!o.iDisplayLength&&(o.iDisplayLength=Array.isArray(o.aLengthMenu[0])?o.aLengthMenu[0][0]:c.isPlainObject(o.aLengthMenu[0])?o.aLengthMenu[0].value:o.aLengthMenu[0]),o=tt(c.extend(!0,{},d),o),et(_.oFeatures,o,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]),et(_,o,["ajax","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","iStateDuration","bSortCellsTop","iTabIndex","sDom","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId","caption","layout","orderDescReverse","orderIndicators","orderHandler","titleRow","typeDetect",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]),et(_.oScroll,o,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]),et(_.oLanguage,o,"fnInfoCallback"),nt(_,"aoDrawCallback",o.fnDrawCallback),nt(_,"aoStateSaveParams",o.fnStateSaveParams),nt(_,"aoStateLoadParams",o.fnStateLoadParams),nt(_,"aoStateLoaded",o.fnStateLoaded),nt(_,"aoRowCallback",o.fnRowCallback),nt(_,"aoRowCreatedCallback",o.fnCreatedRow),nt(_,"aoHeaderCallback",o.fnHeaderCallback),nt(_,"aoFooterCallback",o.fnFooterCallback),nt(_,"aoInitComplete",o.fnInitComplete),nt(_,"aoPreDrawCallback",o.fnPreDrawCallback),_.rowIdFn=re(o.rowId),o.on&&Object.keys(o.on).forEach(function(e){ht(u,e,o.on[e])}),function(e){if(!h.__browser){var t={};h.__browser=t;var i=c("<div/>").css({position:"fixed",top:0,left:-1*window.pageXOffset,height:1,width:1,overflow:"hidden"}).append(c("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(c("<div/>").css({width:"100%",height:10}))).appendTo("body"),n=i.children(),r=n.children();t.barWidth=n[0].offsetWidth-n[0].clientWidth,t.bScrollbarLeft=1!==Math.round(r.offset().left),i.remove()}c.extend(e.oBrowser,h.__browser),e.oScroll.iBarWidth=h.__browser.barWidth}(_);var y=_.oClasses;c.extend(y,h.ext.classes,o.oClasses),u.addClass(y.table),_.oFeatures.bPaginate||(o.iDisplayStart=0),void 0===_.iInitDisplayStart&&(_.iInitDisplayStart=o.iDisplayStart,_._iDisplayStart=o.iDisplayStart);var v=o.iDeferLoading;if(null!==v){_.deferLoading=!0;var x=Array.isArray(v);_._iRecordsDisplay=x?v[0]:v,_._iRecordsTotal=x?v[1]:v}var b=[],w=this.getElementsByTagName("thead"),S=we(_,w[0]);if(o.aoColumns)b=o.aoColumns;else if(S.length)for(a=0,e=S[0].length;a<e;a++)b.push(null);for(a=0,e=b.length;a<e;a++)N(_);!function(e,t,i,n,r){var s,o,a,l,h,d,u,f=e.aoColumns;if(i)for(s=0,o=i.length;s<o;s++)i[s]&&i[s].name&&(f[s].sName=i[s].name);if(t)for(s=t.length-1;s>=0;s--){var p=void 0!==(u=t[s]).target?u.target:void 0!==u.targets?u.targets:u.aTargets;for(Array.isArray(p)||(p=[p]),a=0,l=p.length;a<l;a++){var m=p[a];if("number"==typeof m&&m>=0){for(;f.length<=m;)N(e);r(m,u)}else if("number"==typeof m&&m<0)r(f.length+m,u);else if("string"==typeof m)for(h=0,d=f.length;h<d;h++)"_all"===m?r(h,u):-1!==m.indexOf(":name")?f[h].sName===m.replace(":name","")&&r(h,u):n.forEach(function(e){if(e[h]){var t=c(e[h].cell);m.match(/^[a-z][\w-]*$/i)&&(m="."+m),t.is(m)&&r(h,u)}})}}if(i)for(s=0,o=i.length;s<o;s++)r(s,i[s])}(_,o.aoColumnDefs,b,S,function(e,t){Y(_,e,t)});var T=u.children("tbody").find("tr:first-child").eq(0);if(T.length){var k=function(e,t){return null!==e.getAttribute("data-"+t)?t:null};c(T[0]).children("th, td").each(function(e,t){var i=_.aoColumns[e];if(i||Qe(_,0,"Incorrect column count",18),i.mData===e){var n=k(t,"sort")||k(t,"order"),r=k(t,"filter")||k(t,"search");null===n&&null===r||(i.mData={_:e+".display",sort:null!==n?e+".@data-"+n:void 0,type:null!==n?e+".@data-"+n:void 0,filter:null!==r?e+".@data-"+r:void 0},i._isArrayHost=!0,Y(_,e))}})}nt(_,"aoDrawCallback",Je);var M=_.oFeatures;if(o.bStateSave&&(M.bStateSave=!0),void 0===o.aaSorting){var A=_.aaSorting;for(a=0,e=A.length;a<e;a++)A[a][1]=_.aoColumns[a].asSorting[0]}qe(_),nt(_,"aoDrawCallback",function(){(_.bSorted||"ssp"===at(_)||M.bDeferRender)&&qe(_)});var C=u.children("caption");_.caption&&(0===C.length&&(C=c("<caption/>").appendTo(u)),C.html(_.caption)),C.length&&(C[0]._captionSide=C.css("caption-side"),_.captionNode=C[0]),0===w.length&&(w=c("<thead/>").appendTo(u)),_.nTHead=w[0];var D=u.children("tbody");0===D.length&&(D=c("<tbody/>").insertAfter(w)),_.nTBody=D[0];var L=u.children("tfoot");0===L.length&&(L=c("<tfoot/>").appendTo(u)),_.nTFoot=L[0],_.aiDisplay=_.aiDisplayMaster.slice(),_.bInitialised=!0;var E=_.oLanguage;c.extend(!0,E,o.oLanguage),E.sUrl?c.ajax({dataType:"json",url:E.sUrl,success:function(e){R(d.oLanguage,e),c.extend(!0,E,e,_.oInit.oLanguage),rt(_,null,"i18n",[_],!0),Ee(_)},error:function(){Qe(_,0,"i18n file loading error",21),Ee(_)}}):(rt(_,null,"i18n",[_],!0),Ee(_))}else Qe(null,0,"Non-table node initialisation ("+this.nodeName+")",2)}),i=null,this};h.ext=n={builder:"-source-",buttons:{},ccContent:{},classes:{},errMode:"alert",escape:{attributes:!1},feature:[],features:{},search:[],selector:{cell:[],column:[],row:[]},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{className:{},detect:[],render:{},search:{},order:{}},_unique:0,fnVersionCheck:h.fnVersionCheck,iApiIndex:0,sVersion:h.version},c.extend(n,{afnFiltering:n.search,aTypes:n.type.detect,ofnSearch:n.type.search,oSort:n.type.order,afnSortData:n.order,aoFeatures:n.feature,oStdClasses:n.classes,oPagination:n.pager}),c.extend(h.ext.classes,{container:"dt-container",empty:{row:"dt-empty"},info:{container:"dt-info"},layout:{row:"dt-layout-row",cell:"dt-layout-cell",tableRow:"dt-layout-table",tableCell:"",start:"dt-layout-start",end:"dt-layout-end",full:"dt-layout-full"},length:{container:"dt-length",select:"dt-input"},order:{canAsc:"dt-orderable-asc",canDesc:"dt-orderable-desc",isAsc:"dt-ordering-asc",isDesc:"dt-ordering-desc",none:"dt-orderable-none",position:"sorting_"},processing:{container:"dt-processing"},scrolling:{body:"dt-scroll-body",container:"dt-scroll",footer:{self:"dt-scroll-foot",inner:"dt-scroll-footInner"},header:{self:"dt-scroll-head",inner:"dt-scroll-headInner"}},search:{container:"dt-search",input:"dt-input"},table:"dataTable",tbody:{cell:"",row:""},thead:{cell:"",row:""},tfoot:{cell:"",row:""},paging:{active:"current",button:"dt-paging-button",container:"dt-paging",disabled:"disabled",nav:""}});var d={},u=/[\r\n\u2028]/g,f=/<([^>]*>)/g,p=Math.pow(2,28),m=/^\d{2,4}[./-]\d{1,2}[./-]\d{1,2}([T ]{1}\d{1,2}[:.]\d{2}([.:]\d{2})?)?$/,g=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),_=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,y=function(e){return!e||!0===e||"-"===e},v=function(e){var t=parseInt(e,10);return!isNaN(t)&&isFinite(e)?t:null},x=function(e,t){return d[t]||(d[t]=new RegExp(Ce(t),"g")),"string"==typeof e&&"."!==t?e.replace(/\./g,"").replace(d[t],"."):e},b=function(e,t,i,n){var r=typeof e,s="string"===r;return"number"===r||"bigint"===r||!(!n||!y(e))||(t&&s&&(e=x(e,t)),i&&s&&(e=e.replace(_,"")),!isNaN(parseFloat(e))&&isFinite(e))},w=function(e,t,i,n){if(n&&y(e))return!0;if("string"==typeof e&&e.match(/<(input|select)/i))return null;var r=function(e){return y(e)||"string"==typeof e}(e);return r&&!!b(A(e),t,i,n)||null},S=function(e,t,i){var n=[],r=0,s=e.length;if(void 0!==i)for(;r<s;r++)e[r]&&e[r][t]&&n.push(e[r][t][i]);else for(;r<s;r++)e[r]&&n.push(e[r][t]);return n},T=function(e,t,i,n){var r=[],s=0,o=t.length;if(void 0!==n)for(;s<o;s++)e[t[s]]&&e[t[s]][i]&&r.push(e[t[s]][i][n]);else for(;s<o;s++)e[t[s]]&&r.push(e[t[s]][i]);return r},k=function(e,t){var i,n=[];void 0===t?(t=0,i=e):(i=t,t=e);for(var r=t;r<i;r++)n.push(r);return n},M=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[i]&&t.push(e[i]);return t},A=function(e){if(!e||"string"!=typeof e)return e;if(e.length>p)throw new Error("Exceeded max str len");var t;e=e.replace(f,"");do{t=e,e=e.replace(/<script/i,"")}while(e!==t);return t},C=function(e){return Array.isArray(e)&&(e=e.join(",")),"string"==typeof e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):e},D=function(e,t){if("string"!=typeof e)return e;var i=e.normalize?e.normalize("NFD"):e;return i.length!==e.length?(!0===t?e+" ":"")+i.replace(/[\u0300-\u036f]/g,""):i},L=function(e){if(Array.from&&Set)return Array.from(new Set(e));if(function(e){if(e.length<2)return!0;for(var t=e.slice().sort(),i=t[0],n=1,r=t.length;n<r;n++){if(t[n]===i)return!1;i=t[n]}return!0}(e))return e.slice();var t,i,n,r=[],s=e.length,o=0;e:for(i=0;i<s;i++){for(t=e[i],n=0;n<o;n++)if(r[n]===t)continue e;r.push(t),o++}return r},E=function(e,t){if(Array.isArray(t))for(var i=0;i<t.length;i++)E(e,t[i]);else e.push(t);return e};function I(e,t){t&&t.split(" ").forEach(function(t){t&&e.classList.add(t)})}function P(e){var t,i,n={};c.each(e,function(r){(t=r.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(t[1]+" ")&&(i=r.replace(t[0],t[2].toLowerCase()),n[i]=r,"o"===t[1]&&P(e[r]))}),e._hungarianMap=n}function R(e,t,i){var n;e._hungarianMap||P(e),c.each(t,function(r){void 0===(n=e._hungarianMap[r])||!i&&void 0!==t[n]||("o"===n.charAt(0)?(t[n]||(t[n]={}),c.extend(!0,t[n],t[r]),R(e[n],t[n],i)):t[n]=t[r])})}h.util={diacritics:function(e,t){if("function"!=typeof e)return D(e,t);D=e},debounce:function(e,t){var i;return function(){var n=this,r=arguments;clearTimeout(i),i=setTimeout(function(){e.apply(n,r)},t||250)}},throttle:function(e,t){var i,n,r=void 0!==t?t:200;return function(){var t=this,s=+new Date,o=arguments;i&&s<i+r?(clearTimeout(n),n=setTimeout(function(){i=void 0,e.apply(t,o)},r)):(i=s,e.apply(t,o))}},escapeRegex:function(e){return e.replace(g,"\\$1")},set:function(e){if(c.isPlainObject(e))return h.util.set(e._);if(null===e)return function(){};if("function"==typeof e)return function(t,i,n){e(t,"set",i,n)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,i){t[e]=i};var t=function(e,i,n){for(var r,s,o,a,l,c=ne(n),h=c[c.length-1],d=0,u=c.length-1;d<u;d++){if("__proto__"===c[d]||"constructor"===c[d])throw new Error("Cannot set prototype values");if(s=c[d].match(te),o=c[d].match(ie),s){if(c[d]=c[d].replace(te,""),e[c[d]]=[],(r=c.slice()).splice(0,d+1),l=r.join("."),Array.isArray(i))for(var f=0,p=i.length;f<p;f++)t(a={},i[f],l),e[c[d]].push(a);else e[c[d]]=i;return}o&&(c[d]=c[d].replace(ie,""),e=e[c[d]](i)),null!==e[c[d]]&&void 0!==e[c[d]]||(e[c[d]]={}),e=e[c[d]]}h.match(ie)?e=e[h.replace(ie,"")](i):e[h.replace(te,"")]=i};return function(i,n){return t(i,n,e)}},get:function(e){if(c.isPlainObject(e)){var t={};return c.each(e,function(e,i){i&&(t[e]=h.util.get(i))}),function(e,i,n,r){var s=t[i]||t._;return void 0!==s?s(e,i,n,r):e}}if(null===e)return function(e){return e};if("function"==typeof e)return function(t,i,n,r){return e(t,i,n,r)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t){return t[e]};var i=function(e,t,n){var r,s,o,a;if(""!==n)for(var l=ne(n),c=0,h=l.length;c<h;c++){if(r=l[c].match(te),s=l[c].match(ie),r){if(l[c]=l[c].replace(te,""),""!==l[c]&&(e=e[l[c]]),o=[],l.splice(0,c+1),a=l.join("."),Array.isArray(e))for(var d=0,u=e.length;d<u;d++)o.push(i(e[d],t,a));var f=r[0].substring(1,r[0].length-1);e=""===f?o:o.join(f);break}if(s)l[c]=l[c].replace(ie,""),e=e[l[c]]();else{if(null===e||null===e[l[c]])return null;if(void 0===e||void 0===e[l[c]])return;e=e[l[c]]}}return e};return function(t,n){return i(t,n,e)}},stripHtml:function(e){var t=typeof e;if("function"!==t)return"string"===t?A(e):e;A=e},escapeHtml:function(e){var t=typeof e;if("function"!==t)return"string"===t||Array.isArray(e)?C(e):e;C=e},unique:L};var O=function(e,t,i){void 0!==e[t]&&(e[i]=e[t])};function z(e){O(e,"ordering","bSort"),O(e,"orderMulti","bSortMulti"),O(e,"orderClasses","bSortClasses"),O(e,"orderCellsTop","bSortCellsTop"),O(e,"order","aaSorting"),O(e,"orderFixed","aaSortingFixed"),O(e,"paging","bPaginate"),O(e,"pagingType","sPaginationType"),O(e,"pageLength","iDisplayLength"),O(e,"searching","bFilter"),"boolean"==typeof e.sScrollX&&(e.sScrollX=e.sScrollX?"100%":""),"boolean"==typeof e.scrollX&&(e.scrollX=e.scrollX?"100%":""),"object"==typeof e.bSort?(e.orderIndicators=void 0===e.bSort.indicators||e.bSort.indicators,e.orderHandler=void 0===e.bSort.handler||e.bSort.handler,e.bSort=!0):!1===e.bSort?(e.orderIndicators=!1,e.orderHandler=!1):!0===e.bSort&&(e.orderIndicators=!0,e.orderHandler=!0),"boolean"==typeof e.bSortCellsTop&&(e.titleRow=e.bSortCellsTop);var t=e.aoSearchCols;if(t)for(var i=0,n=t.length;i<n;i++)t[i]&&R(h.models.oSearch,t[i]);e.serverSide&&!e.searchDelay&&(e.searchDelay=400)}function F(e){O(e,"orderable","bSortable"),O(e,"orderData","aDataSort"),O(e,"orderSequence","asSorting"),O(e,"orderDataType","sortDataType");var t=e.aDataSort;"number"!=typeof t||Array.isArray(t)||(e.aDataSort=[t])}function N(e){var t=h.defaults.column,i=e.aoColumns.length,n=c.extend({},h.models.oColumn,t,{aDataSort:t.aDataSort?t.aDataSort:[i],mData:t.mData?t.mData:i,idx:i,searchFixed:{},colEl:c("<col>").attr("data-dt-column",i)});e.aoColumns.push(n);var r=e.aoPreSearchCols;r[i]=c.extend({},h.models.oSearch,r[i])}function Y(e,t,i){var n=e.aoColumns[t];if(null!=i){F(i),R(h.defaults.column,i,!0),void 0===i.mDataProp||i.mData||(i.mData=i.mDataProp),i.sType&&(n._sManualType=i.sType),i.className&&!i.sClass&&(i.sClass=i.className);var r=n.sClass;c.extend(n,i),et(n,i,"sWidth","sWidthOrig"),r!==n.sClass&&(n.sClass=r+" "+n.sClass),void 0!==i.iDataSort&&(n.aDataSort=[i.iDataSort]),et(n,i,"aDataSort")}var s=n.mData,o=re(s);if(n.mRender&&Array.isArray(n.mRender)){var a=n.mRender.slice(),l=a.shift();n.mRender=h.render[l].apply(window,a)}n._render=n.mRender?re(n.mRender):null;var d=function(e){return"string"==typeof e&&-1!==e.indexOf("@")};n._bAttrSrc=c.isPlainObject(s)&&(d(s.sort)||d(s.type)||d(s.filter)),n._setter=null,n.fnGetData=function(e,t,i){var r=o(e,t,void 0,i);return n._render&&t?n._render(r,t,e,i):r},n.fnSetData=function(e,t,i){return se(s)(e,t,i)},"number"==typeof s||n._isArrayHost||(e._rowReadObject=!0),e.oFeatures.bSort||(n.bSortable=!1)}function B(e){!function(e){if(e.oFeatures.bAutoWidth){var t,i,r,s=e.nTable,o=e.aoColumns,a=e.oScroll,l=a.sY,d=a.sX,u=a.sXInner,f=W(e,"bVisible"),p=s.getAttribute("width"),m=s.parentNode,g=s.style.width,_=Ye(e);if(_===e.containerWidth)return!1;e.containerWidth=_,g||p||(s.style.width="100%",g="100%"),g&&-1!==g.indexOf("%")&&(p=g),rt(e,null,"column-calc",{visible:f},!1);var y=c(s.cloneNode()).css("visibility","hidden").removeAttr("id");y.append("<tbody>");var v=c("<tr/>").appendTo(y.find("tbody"));for(y.append(c(e.nTHead).clone()).append(c(e.nTFoot).clone()),y.find("tfoot th, tfoot td").css("width",""),y.find("thead th, thead td").each(function(){var t=q(e,this,!0,!1);t?(this.style.width=t,d&&(this.style.minWidth=t,c(this).append(c("<div/>").css({width:t,margin:0,padding:0,border:0,height:1})))):this.style.width=""}),t=0;t<f.length;t++){i=o[r=f[t]];var x=Be(e,r),b=n.type.className[i.sType],w=x+i.sContentPadding,S=-1===x.indexOf("<")?document.createTextNode(w):w;c("<td/>").addClass(b).addClass(i.sClass).append(S).appendTo(v)}c("[name]",y).removeAttr("name");var T=c("<div/>").css(d||l?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(y).appendTo(m);d&&u?y.width(u):d?(y.css("width","auto"),y.removeAttr("width"),y.outerWidth()<m.clientWidth&&p&&y.outerWidth(m.clientWidth)):l?y.outerWidth(m.clientWidth):p&&y.outerWidth(p);var k=0,M=y.find("tbody tr").eq(0).children();for(t=0;t<f.length;t++){var A=M[t].getBoundingClientRect().width;k+=A,o[f[t]].sWidth=He(A)}if(s.style.width=He(k),T.remove(),p&&(s.style.width=He(p)),(p||d)&&!e._reszEvt){var C=h.util.throttle(function(){var t=Ye(e);e.bDestroying||0===t||B(e)});if(window.ResizeObserver){var D=c(e.nTableWrapper).is(":visible"),L=c("<div>").css({width:"100%",height:0}).addClass("dt-autosize").appendTo(e.nTableWrapper);e.resizeObserver=new ResizeObserver(function(e){D?D=!1:C()}),e.resizeObserver.observe(L[0])}else c(window).on("resize.DT-"+e.sInstance,C);e._reszEvt=!0}}}(e),function(e){for(var t=e.aoColumns,i=0;i<t.length;i++){var n=q(e,[i],!1,!1);t[i].colEl.css("width",n),e.oScroll.sX&&t[i].colEl.css("min-width",n)}}(e);var t=e.oScroll;""===t.sY&&""===t.sX||Ne(e),rt(e,null,"column-sizing",[e])}function H(e,t){var i=W(e,"bVisible");return"number"==typeof i[t]?i[t]:null}function j(e,t){var i=W(e,"bVisible").indexOf(t);return-1!==i?i:null}function V(e){var t=e.aoHeader,i=e.aoColumns,n=0;if(t.length)for(var r=0,s=t[0].length;r<s;r++)i[r].bVisible&&"none"!==c(t[0][r].cell).css("display")&&n++;return n}function W(e,t){var i=[];return e.aoColumns.map(function(e,n){e[t]&&i.push(n)}),i}function U(e,t){return!0===t?e._name:t}function $(e){var t,i,r,s,o,a,l,c,d,u=e.aoColumns,f=e.aoData,p=h.ext.type.detect;for(t=0,i=u.length;t<i;t++){if(d=[],!(l=u[t]).sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){if(!e.typeDetect)return;for(r=0,s=p.length;r<s;r++){var m=p[r],g=m.oneOf,_=m.allOf||m,v=m.init,x=!1;if(c=null,v&&(c=U(m,v(e,l,t)))){l.sType=c;break}for(o=0,a=f.length;o<a;o++)if(f[o]){if(void 0===d[o]&&(d[o]=Q(e,o,t,"type")),g&&!x&&(x=U(m,g(d[o],e))),!(c=U(m,_(d[o],e)))&&r!==p.length-3)break;if("html"===c&&!y(d[o]))break}if(g&&x&&c||!g&&c){l.sType=c;break}}l.sType||(l.sType="string")}var b=n.type.className[l.sType];b&&(X(e.aoHeader,t,b),X(e.aoFooter,t,b));var w=n.type.render[l.sType];w&&!l._render&&(l._render=h.util.get(w),G(e,t))}}function G(e,t){for(var i=e.aoData,n=0;n<i.length;n++)if(i[n].nTr){var r=Q(e,n,t,"display");i[n].displayData[t]=r,ee(i[n].anCells[t],r)}}function X(e,t,i){e.forEach(function(e){e[t]&&e[t].unique&&I(e[t].cell,i)})}function q(e,t,i,n){Array.isArray(t)||(t=Z(t));for(var r,s=0,o=e.aoColumns,a=0,l=t.length;a<l;a++){var c=o[t[a]],h=i?c.sWidthOrig:c.sWidth;if(n||!1!==c.bVisible){if(null==h)return null;if("number"==typeof h)r="px",s+=h;else{var d=h.match(/([\d\.]+)([^\d]*)/);d&&(s+=1*d[1],r=3===d.length?d[2]:"px")}}}return s+r}function Z(e){var t=c(e).closest("[data-dt-column]").attr("data-dt-column");return t?t.split(",").map(function(e){return 1*e}):[]}function J(e,t,i,n){var r=e.aoData.length,s=c.extend(!0,{},h.models.oRow,{src:i?"dom":"data",idx:r});s._aData=t,e.aoData.push(s);for(var o=e.aoColumns,a=0,l=o.length;a<l;a++)o[a].sType=null;e.aiDisplayMaster.push(r);var d=e.rowIdFn(t);return void 0!==d&&(e.aIds[d]=s),!i&&e.oFeatures.bDeferRender||de(e,r,i,n),r}function K(e,t){var i;return t instanceof c||(t=c(t)),t.map(function(t,n){return i=ce(e,n),J(e,i.data,n,i.cells)})}function Q(e,t,i,n){"search"===n?n="filter":"order"===n&&(n="sort");var r=e.aoData[t];if(r){var s=e.iDraw,o=e.aoColumns[i],a=r._aData,l=o.sDefaultContent,c=o.fnGetData(a,n,{settings:e,row:t,col:i});if("display"!==n&&c&&"object"==typeof c&&c.nodeName&&(c=c.innerHTML),void 0===c)return e.iDrawError!=s&&null===l&&(Qe(e,0,"Requested unknown parameter "+("function"==typeof o.mData?"{function}":"'"+o.mData+"'")+" for row "+t+", column "+i,4),e.iDrawError=s),l;if(c!==a&&null!==c||null===l||void 0===n){if("function"==typeof c)return c.call(a)}else c=l;if(null===c&&"display"===n)return"";if("filter"===n){var d=h.ext.type.search;d[o.sType]&&(c=d[o.sType](c))}return c}}function ee(e,t){t&&"object"==typeof t&&t.nodeName?c(e).empty().append(t):e.innerHTML=t}var te=/\[.*?\]$/,ie=/\(\)$/;function ne(e){return(e.match(/(\\.|[^.])+/g)||[""]).map(function(e){return e.replace(/\\\./g,".")})}var re=h.util.get,se=h.util.set;function oe(e){return S(e.aoData,"_aData")}function ae(e){e.aoData.length=0,e.aiDisplayMaster.length=0,e.aiDisplay.length=0,e.aIds={}}function le(e,t,i,n){var r,s,o=e.aoData[t];if(o._aSortData=null,o._aFilterData=null,o.displayData=null,"dom"!==i&&(i&&"auto"!==i||"dom"!==o.src)){var a=o.anCells,l=he(e,t);if(a)if(void 0!==n)ee(a[n],l[n]);else for(r=0,s=a.length;r<s;r++)ee(a[r],l[r])}else o._aData=ce(e,o,n,void 0===n?void 0:o._aData).data;var c=e.aoColumns;if(void 0!==n)c[n].sType=null,c[n].maxLenString=null;else{for(r=0,s=c.length;r<s;r++)c[r].sType=null,c[r].maxLenString=null;ue(e,o)}}function ce(e,t,i,n){var r,s,o,a=[],l=t.firstChild,c=0,h=e.aoColumns,d=e._rowReadObject;n=void 0!==n?n:d?{}:[];var u=function(e,t){if("string"==typeof e){var i=e.indexOf("@");if(-1!==i){var r=e.substring(i+1);se(e)(n,t.getAttribute(r))}}},f=function(e){void 0!==i&&i!==c||(s=h[c],o=e.innerHTML.trim(),s&&s._bAttrSrc?(se(s.mData._)(n,o),u(s.mData.sort,e),u(s.mData.type,e),u(s.mData.filter,e)):d?(s._setter||(s._setter=se(s.mData)),s._setter(n,o)):n[c]=o),c++};if(l)for(;l;)"TD"!=(r=l.nodeName.toUpperCase())&&"TH"!=r||(f(l),a.push(l)),l=l.nextSibling;else for(var p=0,m=(a=t.anCells).length;p<m;p++)f(a[p]);var g=t.firstChild?t:t.nTr;if(g){var _=g.getAttribute("id");_&&se(e.rowId)(n,_)}return{data:n,cells:a}}function he(e,t){var i=e.aoData[t],n=e.aoColumns;if(!i.displayData){i.displayData=[];for(var r=0,s=n.length;r<s;r++)i.displayData.push(Q(e,t,r,"display"))}return i.displayData}function de(e,t,i,n){var r,s,o,a,l,h,d=e.aoData[t],u=d._aData,f=[],p=e.oClasses.tbody.row;if(null===d.nTr){for(r=i||document.createElement("tr"),d.nTr=r,d.anCells=f,I(r,p),r._DT_RowIndex=t,ue(e,d),a=0,l=e.aoColumns.length;a<l;a++){o=e.aoColumns[a],(s=(h=!i||!n[a])?document.createElement(o.sCellType):n[a])||Qe(e,0,"Incorrect column count",18),s._DT_CellIndex={row:t,column:a},f.push(s);var m=he(e,t);!h&&(!o.mRender&&o.mData===a||c.isPlainObject(o.mData)&&o.mData._===a+".display")||ee(s,m[a]),I(s,o.sClass),o.bVisible&&h?r.appendChild(s):o.bVisible||h||s.parentNode.removeChild(s),o.fnCreatedCell&&o.fnCreatedCell.call(e.oInstance,s,Q(e,t,a),u,t,a)}rt(e,"aoRowCreatedCallback","row-created",[r,u,t,f])}else I(d.nTr,p)}function ue(e,t){var i=t.nTr,n=t._aData;if(i){var r=e.rowIdFn(n);if(r&&(i.id=r),n.DT_RowClass){var s=n.DT_RowClass.split(" ");t.__rowc=t.__rowc?L(t.__rowc.concat(s)):s,c(i).removeClass(t.__rowc.join(" ")).addClass(n.DT_RowClass)}n.DT_RowAttr&&c(i).attr(n.DT_RowAttr),n.DT_RowData&&c(i).data(n.DT_RowData)}}function fe(e,t){var i,n,r,s=e.oClasses,o=e.aoColumns,a="header"===t?e.nTHead:e.nTFoot,l="header"===t?"sTitle":t;if(a){if(("header"===t||S(e.aoColumns,l).join(""))&&((r=c("tr",a)).length||(r=c("<tr/>").appendTo(a)),1===r.length)){var h=0;for(c("td, th",r).each(function(){h+=this.colSpan}),i=h,n=o.length;i<n;i++)c("<th/>").html(o[i][l]||"").appendTo(r)}var d=we(e,a,!0);"header"===t?(e.aoHeader=d,c("tr",a).addClass(s.thead.row)):(e.aoFooter=d,c("tr",a).addClass(s.tfoot.row)),c(a).children("tr").children("th, td").each(function(){ot(e,t)(e,c(this),s)})}}function pe(e,t,i){var n,r,s,o,a,l=[],h=[],d=e.aoColumns,u=d.length;if(t){for(i||(i=k(u).filter(function(e){return d[e].bVisible})),n=0;n<t.length;n++)l[n]=t[n].slice().filter(function(e,t){return i.includes(t)}),h.push([]);for(n=0;n<l.length;n++)for(r=0;r<l[n].length;r++)if(o=1,a=1,void 0===h[n][r]){for(s=l[n][r].cell;void 0!==l[n+o]&&l[n][r].cell==l[n+o][r].cell;)h[n+o][r]=null,o++;for(;void 0!==l[n][r+a]&&l[n][r].cell==l[n][r+a].cell;){for(var f=0;f<o;f++)h[n+f][r+a]=null;a++}var p=c("span.dt-column-title",s);h[n][r]={cell:s,colspan:a,rowspan:o,title:p.length?p.html():c(s).html()}}return h}}function me(e,t){for(var i,n,r=pe(e,t),s=0;s<t.length;s++){if(i=t[s].row)for(;n=i.firstChild;)i.removeChild(n);for(var o=0;o<r[s].length;o++){var a=r[s][o];a&&c(a.cell).appendTo(i).attr("rowspan",a.rowspan).attr("colspan",a.colspan)}}}function ge(e,t){if(function(e){var t="ssp"==at(e),i=e.iInitDisplayStart;void 0!==i&&-1!==i&&(e._iDisplayStart=t?i:i>=e.fnRecordsDisplay()?0:i,e.iInitDisplayStart=-1)}(e),-1===rt(e,"aoPreDrawCallback","preDraw",[e]).indexOf(!1)){var i,r=[],s=0,o="ssp"==at(e),a=e.aiDisplay,l=e._iDisplayStart,h=e.fnDisplayEnd(),d=e.aoColumns,u=c(e.nTBody);if(e.bDrawing=!0,e.deferLoading)e.deferLoading=!1,e.iDraw++,Oe(e,!1);else if(o){if(!e.bDestroying&&!t)return 0===e.iDraw&&u.empty().append(ye(e)),(i=e).iDraw++,Oe(i,!0),void Se(i,function(e){var t=e.aoColumns,i=e.oFeatures,n=e.oPreviousSearch,r=e.aoPreSearchCols,s=function(e,i){return"function"==typeof t[e][i]?"function":t[e][i]};return{draw:e.iDraw,columns:t.map(function(e,t){return{data:s(t,"mData"),name:e.sName,searchable:e.bSearchable,orderable:e.bSortable,search:{value:r[t].search,regex:r[t].regex,fixed:Object.keys(e.searchFixed).map(function(t){return{name:t,term:e.searchFixed[t].toString()}})}}}),order:$e(e).map(function(e){return{column:e.col,dir:e.dir,name:s(e.col,"sName")}}),start:e._iDisplayStart,length:i.bPaginate?e._iDisplayLength:-1,search:{value:n.search,regex:n.regex,fixed:Object.keys(e.searchFixed).map(function(t){return{name:t,term:e.searchFixed[t].toString()}})}}}(i),function(e){!function(e,t){var i=Te(e,t),n=ke(e,"draw",t),r=ke(e,"recordsTotal",t),s=ke(e,"recordsFiltered",t);if(void 0!==n){if(1*n<e.iDraw)return;e.iDraw=1*n}i||(i=[]),ae(e),e._iRecordsTotal=parseInt(r,10),e._iRecordsDisplay=parseInt(s,10);for(var o=0,a=i.length;o<a;o++)J(e,i[o]);e.aiDisplay=e.aiDisplayMaster.slice(),$(e),ge(e,!0),Ie(e),Oe(e,!1)}(i,e)})}else e.iDraw++;if(0!==a.length)for(var f=o?0:l,p=o?e.aoData.length:h,m=f;m<p;m++){var g=a[m],_=e.aoData[g];null===_.nTr&&de(e,g);for(var y=_.nTr,v=0;v<d.length;v++){var x=d[v],b=_.anCells[v];I(b,n.type.className[x.sType]),I(b,e.oClasses.tbody.cell)}rt(e,"aoRowCallback",null,[y,_._aData,s,m,g]),r.push(y),s++}else r[0]=ye(e);rt(e,"aoHeaderCallback","header",[c(e.nTHead).children("tr")[0],oe(e),l,h,a]),rt(e,"aoFooterCallback","footer",[c(e.nTFoot).children("tr")[0],oe(e),l,h,a]),u[0].replaceChildren?u[0].replaceChildren.apply(u[0],r):(u.children().detach(),u.append(c(r))),c(e.nTableWrapper).toggleClass("dt-empty-footer",0===c("tr",e.nTFoot).length),rt(e,"aoDrawCallback","draw",[e],!0),e.bSorted=!1,e.bFiltered=!1,e.bDrawing=!1}else Oe(e,!1)}function _e(e,t,i){var n=e.oFeatures,r=n.bSort,s=n.bFilter;void 0!==i&&!0!==i||($(e),r&&Ge(e),s?Me(e,e.oPreviousSearch):e.aiDisplay=e.aiDisplayMaster.slice()),!0!==t&&(e._iDisplayStart=0),e._drawHold=t,ge(e),e.api.one("draw",function(){e._drawHold=!1})}function ye(e){var t=e.oLanguage,i=t.sZeroRecords,n=at(e);return"ssp"!==n&&"ajax"!==n||e.json?t.sEmptyTable&&0===e.fnRecordsTotal()&&(i=t.sEmptyTable):i=t.sLoadingRecords,c("<tr/>").append(c("<td />",{colSpan:V(e),class:e.oClasses.empty.row}).html(i))[0]}function ve(e,t,i){if(Array.isArray(i))for(var n=0;n<i.length;n++)ve(e,t,i[n]);else{var r=e[t];c.isPlainObject(i)?i.features?(i.rowId&&(e.id=i.rowId),i.rowClass&&(e.className=i.rowClass),r.id=i.id,r.className=i.className,ve(e,t,i.features)):Object.keys(i).map(function(e){r.contents.push({feature:e,opts:i[e]})}):r.contents.push(i)}}function xe(e,t,i){var n=[];c.each(t,function(e,t){if(null!==t){var r=e.match(/^([a-z]+)([0-9]*)([A-Za-z]*)$/),s=r[2]?1*r[2]:0,o=r[3]?r[3].toLowerCase():"full";if(r[1]===i){var a=function(e,t,i){for(var n,r=0;r<e.length;r++)if((n=e[r]).rowNum===t&&("full"===i&&n.full||("start"===i||"end"===i)&&(n.start||n.end)))return n[i]||(n[i]={contents:[]}),n;return(n={rowNum:t})[i]={contents:[]},e.push(n),n}(n,s,o);ve(a,o,t)}}}),n.sort(function(e,t){var n=e.rowNum,r=t.rowNum;if(n===r){var s=e.full&&!t.full?-1:1;return"bottom"===i?-1*s:s}return r-n}),"bottom"===i&&n.reverse();for(var r=0;r<n.length;r++)delete n[r].rowNum,be(e,n[r]);return n}function be(e,t){var i=function(t,i){return n.features[t]||Qe(e,0,"Unknown feature: "+t),n.features[t].apply(this,[e,i])},r=function(n){if(t[n])for(var r=t[n].contents,s=0,o=r.length;s<o;s++)if(r[s])if("string"==typeof r[s])r[s]=i(r[s],null);else if(c.isPlainObject(r[s]))r[s]=i(r[s].feature,r[s].opts);else if("function"==typeof r[s].node)r[s]=r[s].node(e);else if("function"==typeof r[s]){var a=r[s](e);r[s]="function"==typeof a.node?a.node():a}};r("start"),r("end"),r("full")}function we(e,t,i){var n,r,s,o,a,l,h,d,u,f,p=e.aoColumns,m=c(t).children("tr"),g=e.titleRow,_=t&&"thead"===t.nodeName.toLowerCase(),y=[],v=function(e,t,i){for(var n=e[t];n[i];)i++;return i};for(s=0,l=m.length;s<l;s++)y.push([]);for(s=0,l=m.length;s<l;s++)for(r=(n=m[s]).firstChild;r;){if("TD"==r.nodeName.toUpperCase()||"TH"==r.nodeName.toUpperCase()){var x=[],b=c(r);if(d=(d=1*r.getAttribute("colspan"))&&0!==d&&1!==d?d:1,u=(u=1*r.getAttribute("rowspan"))&&0!==u&&1!==u?u:1,h=v(y,s,0),f=1===d,i){if(f){Y(e,h,dt(b.data()));var w=p[h],S=r.getAttribute("width")||null,T=r.style.width.match(/width:\s*(\d+[pxem%]+)/);T&&(S=T[1]),w.sWidthOrig=w.sWidth||S,_?(null===w.sTitle||w.autoTitle||(!0===g&&0===s||!1===g&&s===m.length-1||g===s||null===g)&&(r.innerHTML=w.sTitle),!w.sTitle&&f&&(w.sTitle=A(r.innerHTML),w.autoTitle=!0)):w.footer&&(r.innerHTML=w.footer),w.ariaTitle||(w.ariaTitle=b.attr("aria-label")||w.sTitle),w.className&&b.addClass(w.className)}0===c("span.dt-column-title",r).length&&c("<span>").addClass("dt-column-title").append(r.childNodes).appendTo(r),e.orderIndicators&&_&&0!==b.filter(":not([data-dt-order=disable])").length&&0!==b.parent(":not([data-dt-order=disable])").length&&0===c("span.dt-column-order",r).length&&c("<span>").addClass("dt-column-order").appendTo(r);var k=_?"header":"footer";0===c("span.dt-column-"+k,r).length&&c("<div>").addClass("dt-column-"+k).append(r.childNodes).appendTo(r)}for(a=0;a<d;a++){for(o=0;o<u;o++)y[s+o][h+a]={cell:r,unique:f},y[s+o].row=n;x.push(h+a)}r.setAttribute("data-dt-column",L(x).join(","))}r=r.nextSibling}return y}function Se(e,t,i){var n,r=e.ajax,s=e.oInstance,o=function(t){var n=e.jqXHR?e.jqXHR.status:null;(null===t||"number"==typeof n&&204==n)&&Te(e,t={},[]);var r=t.error||t.sError;if(r&&Qe(e,0,r),t.d&&"string"==typeof t.d)try{t=JSON.parse(t.d)}catch(e){}e.json=t,rt(e,null,"xhr",[e,t,e.jqXHR],!0),i(t)};if(c.isPlainObject(r)&&r.data){var a="function"==typeof(n=r.data)?n(t,e):n;t="function"==typeof n&&a?a:c.extend(!0,t,a),delete r.data}var l={url:"string"==typeof r?r:"",data:t,success:o,dataType:"json",cache:!1,type:e.sServerMethod,error:function(t,i){-1===rt(e,null,"xhr",[e,null,e.jqXHR],!0).indexOf(!0)&&("parsererror"==i?Qe(e,0,"Invalid JSON response",1):4===t.readyState&&Qe(e,0,"Ajax error",7)),Oe(e,!1)}};if(c.isPlainObject(r)&&c.extend(l,r),e.oAjaxData=t,rt(e,null,"preXhr",[e,t,l],!0),"json"===l.submitAs&&"object"==typeof t&&(l.data=JSON.stringify(t)),"function"==typeof r)e.jqXHR=r.call(s,t,o,e);else if(""===r.url){var h={};Te(e,h,[]),o(h)}else e.jqXHR=c.ajax(l);n&&(r.data=n)}function Te(e,t,i){var n="data";if(c.isPlainObject(e.ajax)&&void 0!==e.ajax.dataSrc){var r=e.ajax.dataSrc;"string"==typeof r||"function"==typeof r?n=r:void 0!==r.data&&(n=r.data)}if(!i)return"data"===n?t.aaData||t[n]:""!==n?re(n)(t):t;se(n)(t,i)}function ke(e,t,i){var n=c.isPlainObject(e.ajax)?e.ajax.dataSrc:null;if(n&&n[t])return re(n[t])(i);var r="";return"draw"===t?r="sEcho":"recordsTotal"===t?r="iTotalRecords":"recordsFiltered"===t&&(r="iTotalDisplayRecords"),void 0!==i[r]?i[r]:i[t]}function Me(e,t){var i=e.aoPreSearchCols;if("ssp"!=at(e)){!function(e){for(var t,i,n,r,s,o=e.aoColumns,a=e.aoData,l=0;l<a.length;l++)if(a[l]&&!(s=a[l])._aFilterData){for(n=[],t=0,i=o.length;t<i;t++)o[t].bSearchable?(null===(r=Q(e,l,t,"filter"))&&(r=""),"string"!=typeof r&&r.toString&&(r=r.toString())):r="",r.indexOf&&-1!==r.indexOf("&")&&(De.innerHTML=r,r=Le?De.textContent:De.innerText),r.replace&&(r=r.replace(/[\r\n\u2028]/g,"")),n.push(r);s._aFilterData=n,s._sFilterRow=n.join(" ")}}(e),e.aiDisplay=e.aiDisplayMaster.slice(),Ae(e.aiDisplay,e,t.search,t),c.each(e.searchFixed,function(t,i){Ae(e.aiDisplay,e,i,{})});for(var n=0;n<i.length;n++){var r=i[n];Ae(e.aiDisplay,e,r.search,r,n),c.each(e.aoColumns[n].searchFixed,function(t,i){Ae(e.aiDisplay,e,i,{},n)})}!function(e){for(var t,i,n=h.ext.search,r=e.aiDisplay,s=0,o=n.length;s<o;s++){for(var a=[],l=0,c=r.length;l<c;l++)i=r[l],t=e.aoData[i],n[s](e,t._aFilterData,i,t._aData,l)&&a.push(i);r.length=0,ct(r,a)}}(e)}e.bFiltered=!0,rt(e,null,"search",[e])}function Ae(e,t,i,n,r){if(""!==i){var s=0,o=[],a="function"==typeof i?i:null,l=i instanceof RegExp?i:a?null:function(e,t){var i=[],n=c.extend({},{boundary:!1,caseInsensitive:!0,exact:!1,regex:!1,smart:!0},t);if("string"!=typeof e&&(e=e.toString()),e=D(e),n.exact)return new RegExp("^"+Ce(e)+"$",n.caseInsensitive?"i":"");if(e=n.regex?e:Ce(e),n.smart){var r=(e.match(/!?["\u201C][^"\u201D]+["\u201D]|[^ ]+/g)||[""]).map(function(e){var t,n=!1;return"!"===e.charAt(0)&&(n=!0,e=e.substring(1)),'"'===e.charAt(0)?(t=e.match(/^"(.*)"$/),e=t?t[1]:e):"“"===e.charAt(0)&&(t=e.match(/^\u201C(.*)\u201D$/),e=t?t[1]:e),n&&(e.length>1&&i.push("(?!"+e+")"),e=""),e.replace(/"/g,"")}),s=i.length?i.join(""):"",o=n.boundary?"\\b":"";e="^(?=.*?"+o+r.join(")(?=.*?"+o)+")("+s+".)*$"}return new RegExp(e,n.caseInsensitive?"i":"")}(i,n);for(s=0;s<e.length;s++){var h=t.aoData[e[s]],d=void 0===r?h._sFilterRow:h._aFilterData[r];(a&&a(d,h._aData,e[s],r)||l&&l.test(d))&&o.push(e[s])}for(e.length=o.length,s=0;s<o.length;s++)e[s]=o[s]}}var Ce=h.util.escapeRegex,De=c("<div>")[0],Le=void 0!==De.textContent;function Ee(e){var t,i=e.oInit,n=e.deferLoading,r=at(e);e.bInitialised?(fe(e,"header"),fe(e,"footer"),function(e,t,i){if(e.oFeatures.bStateSave){var n=e.fnStateLoadCallback.call(e.oInstance,e,function(t){Ke(e,t,i)});void 0!==n&&Ke(e,n,i)}else i()}(e,0,function(){me(e,e.aoHeader),me(e,e.aoFooter);var s=e.iInitDisplayStart;if(i.aaData)for(t=0;t<i.aaData.length;t++)J(e,i.aaData[t]);else(n||"dom"==r)&&K(e,c(e.nTBody).children("tr"));e.aiDisplay=e.aiDisplayMaster.slice(),function(e){var t=e.oClasses,i=c(e.nTable),n=c("<div/>").attr({id:e.sTableId+"_wrapper",class:t.container}).insertBefore(i);if(e.nTableWrapper=n[0],e.sDom)!function(e,t,i){for(var n,r,s,o,a,l=t.match(/(".*?")|('.*?')|./g),d=0;d<l.length;d++){if(n=null,"<"==(r=l[d])){if(s=c("<div/>"),"'"==(o=l[d+1])[0]||'"'==o[0]){var u,f="";if(-1!=(a=o.replace(/['"]/g,"")).indexOf(".")){var p=a.split(".");f=p[0],u=p[1]}else"#"==a[0]?f=a:u=a;s.attr("id",f.substring(1)).addClass(u),d++}i.append(s),i=s}else">"==r?i=i.parent():"t"==r?n=Fe(e):h.ext.feature.forEach(function(t){r==t.cFeature&&(n=t.fnInit(e))});n&&i.append(n)}}(e,e.sDom,n);else{var r=xe(e,e.layout,"top"),s=xe(e,e.layout,"bottom"),o=ot(e,"layout");r.forEach(function(t){o(e,n,t)}),o(e,n,{full:{table:!0,contents:[Fe(e)]}}),s.forEach(function(t){o(e,n,t)})}!function(e){var t=e.nTable,i=""!==e.oScroll.sX||""!==e.oScroll.sY;if(e.oFeatures.bProcessing){var n=c("<div/>",{id:e.sTableId+"_processing",class:e.oClasses.processing.container,role:"status"}).html(e.oLanguage.sProcessing).append("<div><div></div><div></div><div></div><div></div></div>");i?n.prependTo(c("div.dt-scroll",e.nTableWrapper)):n.insertBefore(t),c(t).on("processing.dt.DT",function(e,t,i){n.css("display",i?"block":"none")})}}(e)}(e),function(e){var t=e.nTHead,i=t.querySelectorAll("tr"),n=e.titleRow,r=':not([data-dt-order="disable"]):not([data-dt-order="icon-only"])';!0===n?t=i[0]:!1===n?t=i[i.length-1]:null!==n&&(t=i[n]),e.orderHandler&&Ve(e,t,t===e.nTHead?"tr"+r+" th"+r+", tr"+r+" td"+r:"th"+r+", td"+r);var s=[];Ue(e,s,e.aaSorting),e.aaSorting=s}(e),je(e),Oe(e,!0),rt(e,null,"preInit",[e],!0),_e(e),("ssp"!=r||n)&&("ajax"==r?Se(e,{},function(i){var n=Te(e,i);for(t=0;t<n.length;t++)J(e,n[t]);e.iInitDisplayStart=s,_e(e),Oe(e,!1),Ie(e)}):(Ie(e),Oe(e,!1)))})):setTimeout(function(){Ee(e)},200)}function Ie(e){if(!e._bInitComplete){var t=[e,e.json];e._bInitComplete=!0,B(e),rt(e,null,"plugin-init",t,!0),rt(e,"aoInitComplete","init",t,!0)}}function Pe(e,t){var i=parseInt(t,10);e._iDisplayLength=i,st(e),rt(e,null,"length",[e,i])}function Re(e,t,i){var n=e._iDisplayStart,r=e._iDisplayLength,s=e.fnRecordsDisplay();if(0===s||-1===r)n=0;else if("number"==typeof t)(n=t*r)>s&&(n=0);else if("first"==t)n=0;else if("previous"==t)(n=r>=0?n-r:0)<0&&(n=0);else if("next"==t)n+r<s&&(n+=r);else if("last"==t)n=Math.floor((s-1)/r)*r;else{if("ellipsis"===t)return;Qe(e,0,"Unknown paging action: "+t,5)}var o=e._iDisplayStart!==n;return e._iDisplayStart=n,rt(e,null,o?"page":"page-nc",[e]),o&&i&&ge(e),o}function Oe(e,t){e.bDrawing&&!1===t||rt(e,null,"processing",[e,t])}function ze(e,t,i){t?(Oe(e,!0),setTimeout(function(){i(),Oe(e,!1)},0)):i()}function Fe(e){var t=c(e.nTable),i=e.oScroll;if(""===i.sX&&""===i.sY)return e.nTable;var n=i.sX,r=i.sY,s=e.oClasses.scrolling,o=e.captionNode,a=o?o._captionSide:null,l=c(t[0].cloneNode(!1)),h=c(t[0].cloneNode(!1)),d=t.children("tfoot"),u="<div/>",f=function(e){return e?He(e):null};d.length||(d=null);var p=c(u,{class:s.container}).append(c(u,{class:s.header.self}).css({overflow:"hidden",position:"relative",border:0,width:n?f(n):"100%"}).append(c(u,{class:s.header.inner}).css({"box-sizing":"content-box",width:i.sXInner||"100%"}).append(l.removeAttr("id").css("margin-left",0).append("top"===a?o:null).append(t.children("thead"))))).append(c(u,{class:s.body}).css({position:"relative",overflow:"auto",width:f(n)}).append(t));d&&p.append(c(u,{class:s.footer.self}).css({overflow:"hidden",border:0,width:n?f(n):"100%"}).append(c(u,{class:s.footer.inner}).append(h.removeAttr("id").css("margin-left",0).append("bottom"===a?o:null).append(t.children("tfoot")))));var m=p.children(),g=m[0],_=m[1],y=d?m[2]:null;return c(_).on("scroll.DT",function(){var e=this.scrollLeft;g.scrollLeft=e,d&&(y.scrollLeft=e)}),c("th, td",g).on("focus",function(){var e=g.scrollLeft;_.scrollLeft=e,d&&(_.scrollLeft=e)}),c(_).css("max-height",r),i.bCollapse||c(_).css("height",r),e.nScrollHead=g,e.nScrollBody=_,e.nScrollFoot=y,e.aoDrawCallback.push(Ne),p[0]}function Ne(e){var t,i,n=e.oScroll,r=n.iBarWidth,s=c(e.nScrollHead).children("div"),o=s.children("table"),a=e.nScrollBody,l=c(a),h=c(e.nScrollFoot).children("div"),d=h.children("table"),u=c(e.nTHead),f=c(e.nTable),p=e.nTFoot&&c("th, td",e.nTFoot).length?c(e.nTFoot):null,m=e.oBrowser,g=a.scrollHeight>a.clientHeight;if(e.scrollBarVis!==g&&void 0!==e.scrollBarVis)return e.scrollBarVis=g,void B(e);if(e.scrollBarVis=g,f.children("thead, tfoot").remove(),(t=u.clone().prependTo(f)).find("th, td").removeAttr("tabindex"),t.find("[id]").removeAttr("id"),p&&(i=p.clone().prependTo(f)).find("[id]").removeAttr("id"),e.aiDisplay.length){var _=null,y="ssp"!==at(e)?e._iDisplayStart:0;for(w=y;w<y+e.aiDisplay.length;w++){var v=e.aiDisplay[w],x=e.aoData[v].nTr;if(x){_=x;break}}if(_)for(var b=c(_).children("th, td").map(function(t){return{idx:H(e,t),width:c(this).outerWidth()}}),w=0;w<b.length;w++){var S=e.aoColumns[b[w].idx].colEl[0];S.style.width.replace("px","")!==b[w].width&&(S.style.width=b[w].width+"px",n.sX&&(S.style.minWidth=b[w].width+"px"))}}o.find("colgroup").remove(),o.append(e.colgroup.clone()),p&&(d.find("colgroup").remove(),d.append(e.colgroup.clone())),c("th, td",t).each(function(){c(this.childNodes).wrapAll('<div class="dt-scroll-sizing">')}),p&&c("th, td",i).each(function(){c(this.childNodes).wrapAll('<div class="dt-scroll-sizing">')});var T=Math.floor(f.height())>a.clientHeight||"scroll"==l.css("overflow-y"),k="padding"+(m.bScrollbarLeft?"Left":"Right"),M=f.outerWidth();o.css("width",He(M)),s.css("width",He(M)).css(k,T?r+"px":"0px"),p&&(d.css("width",He(M)),h.css("width",He(M)).css(k,T?r+"px":"0px")),f.children("colgroup").prependTo(f),l.trigger("scroll"),!e.bSorted&&!e.bFiltered||e._drawHold||(a.scrollTop=0)}function Ye(e){return c(e.nTableWrapper).is(":visible")?c(e.nTableWrapper).width():0}function Be(e,t){var i=e.aoColumns[t];if(!i.maxLenString){for(var n,r="",s=-1,o=0,a=e.aiDisplayMaster.length;o<a;o++){var l=he(e,e.aiDisplayMaster[o])[t],c=l&&"object"==typeof l&&l.nodeType?l.innerHTML:l+"";c=c.replace(/id=".*?"/g,"").replace(/name=".*?"/g,""),(n=A(c).replace(/ /g," ")).length>s&&(r=c,s=n.length)}i.maxLenString=r}return i.maxLenString}function He(e){return null===e?"0px":"number"==typeof e?e<0?"0px":e+"px":e.match(/\d$/)?e+"px":e}function je(e){var t=e.aoColumns;for(e.colgroup.empty(),$t=0;$t<t.length;$t++)t[$t].bVisible&&e.colgroup.append(t[$t].colEl)}function Ve(e,t,i,n,r){it(t,i,function(t){var i=!1,s=void 0===n?Z(t.target):"function"==typeof n?n():Array.isArray(n)?n:[n];if(s.length){for(var o=0,a=s.length;o<a&&(!1!==Xe(e,s[o],o,t.shiftKey)&&(i=!0),1!==e.aaSorting.length||""!==e.aaSorting[0][1]);o++);i&&ze(e,!0,function(){Ge(e),We(e,e.aiDisplay),_e(e,!1,!1),r&&r()})}})}function We(e,t){if(!(t.length<2)){var i,n=e.aiDisplayMaster,r={},s={};for(i=0;i<n.length;i++)r[n[i]]=i;for(i=0;i<t.length;i++)s[t[i]]=r[t[i]];t.sort(function(e,t){return s[e]-s[t]})}}function Ue(e,t,i){var n=function(i){if(c.isPlainObject(i)){if(void 0!==i.idx)t.push([i.idx,i.dir]);else if(i.name){var n=S(e.aoColumns,"sName").indexOf(i.name);-1!==n&&t.push([n,i.dir])}}else t.push(i)};if(c.isPlainObject(i))n(i);else if(i.length&&"number"==typeof i[0])n(i);else if(i.length)for(var r=0;r<i.length;r++)n(i[r])}function $e(e){var t,i,n,r,s,o,a,l=[],d=h.ext.type.order,u=e.aoColumns,f=e.aaSortingFixed,p=c.isPlainObject(f),m=[];if(!e.oFeatures.bSort)return l;for(Array.isArray(f)&&Ue(e,m,f),p&&f.pre&&Ue(e,m,f.pre),Ue(e,m,e.aaSorting),p&&f.post&&Ue(e,m,f.post),t=0;t<m.length;t++)if(u[a=m[t][0]])for(i=0,n=(r=u[a].aDataSort).length;i<n;i++)o=u[s=r[i]].sType||"string",void 0===m[t]._idx&&(m[t]._idx=u[s].asSorting.indexOf(m[t][1])),m[t][1]&&l.push({src:a,col:s,dir:m[t][1],index:m[t]._idx,type:o,formatter:d[o+"-pre"],sorter:d[o+"-"+m[t][1]]});return l}function Ge(e,t,i){var n,r,s,o,a=[],l=h.ext.type.order,c=e.aoData,d=e.aiDisplayMaster;if($(e),void 0!==t){var u=e.aoColumns[t];o=[{src:t,col:t,dir:i,index:0,type:u.sType,formatter:l[u.sType+"-pre"],sorter:l[u.sType+"-"+i]}],d=d.slice()}else o=$e(e);for(n=0,r=o.length;n<r;n++)Ze(e,o[n].col);if("ssp"!=at(e)&&0!==o.length){for(n=0,s=d.length;n<s;n++)a[n]=n;o.length&&"desc"===o[0].dir&&e.orderDescReverse&&a.reverse(),d.sort(function(e,t){var i,n,r,s,l,h=o.length,d=c[e]._aSortData,u=c[t]._aSortData;for(r=0;r<h;r++)if(i=d[(l=o[r]).col],n=u[l.col],l.sorter){if(0!==(s=l.sorter(i,n)))return s}else if(0!=(s=i<n?-1:i>n?1:0))return"asc"===l.dir?s:-s;return(i=a[e])<(n=a[t])?-1:i>n?1:0})}else 0===o.length&&d.sort(function(e,t){return e<t?-1:e>t?1:0});return void 0===t&&(e.bSorted=!0,e.sortDetails=o,rt(e,null,"order",[e,o])),d}function Xe(e,t,i,n){var r,s=e.aoColumns[t],o=e.aaSorting,a=s.asSorting,l=function(e,t){var i=e._idx;return void 0===i&&(i=a.indexOf(e[1])),i+1<a.length?i+1:t?null:0};if(!s.bSortable)return!1;if("number"==typeof o[0]&&(o=e.aaSorting=[o]),(n||i)&&e.oFeatures.bSortMulti){var c=S(o,"0").indexOf(t);-1!==c?(null===(r=l(o[c],!0))&&1===o.length&&(r=0),null===r?o.splice(c,1):(o[c][1]=a[r],o[c]._idx=r)):n?(o.push([t,a[0],0]),o[o.length-1]._idx=0):(o.push([t,o[0][1],0]),o[o.length-1]._idx=0)}else o.length&&o[0][0]==t?(r=l(o[0]),o.length=1,o[0][1]=a[r],o[0]._idx=r):(o.length=0,o.push([t,a[0]]),o[0]._idx=0)}function qe(e){var t,i,n,r=e.aLastSort,s=e.oClasses.order.position,o=$e(e),a=e.oFeatures;if(a.bSort&&a.bSortClasses){for(t=0,i=r.length;t<i;t++)n=r[t].src,c(S(e.aoData,"anCells",n)).removeClass(s+(t<2?t+1:3));for(t=0,i=o.length;t<i;t++)n=o[t].src,c(S(e.aoData,"anCells",n)).addClass(s+(t<2?t+1:3))}e.aLastSort=o}function Ze(e,t){var i,n,r,s=e.aoColumns[t],o=h.ext.order[s.sSortDataType];o&&(i=o.call(e.oInstance,e,t,j(e,t)));for(var a=h.ext.type.order[s.sType+"-pre"],l=e.aoData,c=0;c<l.length;c++)l[c]&&((n=l[c])._aSortData||(n._aSortData=[]),n._aSortData[t]&&!o||(r=o?i[c]:Q(e,c,t,"sort"),n._aSortData[t]=a?a(r,e):r))}function Je(e){if(!e._bLoadingState){var t=[];Ue(e,t,e.aaSorting);var i=e.aoColumns,n={time:+new Date,start:e._iDisplayStart,length:e._iDisplayLength,order:t.map(function(e){return i[e[0]]&&i[e[0]].sName?[i[e[0]].sName,e[1]]:e.slice()}),search:c.extend({},e.oPreviousSearch),columns:e.aoColumns.map(function(t,i){return{name:t.sName,visible:t.bVisible,search:c.extend({},e.aoPreSearchCols[i])}})};e.oSavedState=n,rt(e,"aoStateSaveParams","stateSaveParams",[e,n]),e.oFeatures.bStateSave&&!e.bDestroying&&e.fnStateSaveCallback.call(e.oInstance,e,n)}}function Ke(e,t,i){var n,r,s=e.aoColumns,o=S(e.aoColumns,"sName");e._bLoadingState=!0;var a=e._bInitComplete?new h.Api(e):null;if(!t||!t.time)return e._bLoadingState=!1,void i();var l=e.iStateDuration;if(l>0&&t.time<+new Date-1e3*l)return e._bLoadingState=!1,void i();if(-1!==rt(e,"aoStateLoadParams","stateLoadParams",[e,t]).indexOf(!1))return e._bLoadingState=!1,void i();if(e.oLoadedState=c.extend(!0,{},t),rt(e,null,"stateLoadInit",[e,t],!0),void 0!==t.length&&(a?a.page.len(t.length):e._iDisplayLength=t.length),void 0!==t.start&&(null===a?(e._iDisplayStart=t.start,e.iInitDisplayStart=t.start):Re(e,t.start/e._iDisplayLength)),void 0!==t.order&&(e.aaSorting=[],c.each(t.order,function(t,i){var n=[i[0],i[1]];if("string"==typeof i[0]){var r=o.indexOf(i[0]);if(r<0)return;n[0]=r}else if(n[0]>=s.length)return;e.aaSorting.push(n)})),void 0!==t.search&&c.extend(e.oPreviousSearch,t.search),t.columns){var d=t.columns,u=S(t.columns,"name");if(u.join("").length&&u.join("")!==o.join(""))for(d=[],n=0;n<o.length;n++)if(""!=o[n]){var f=u.indexOf(o[n]);f>=0?d.push(t.columns[f]):d.push({})}else d.push({});if(d.length===s.length){for(n=0,r=d.length;n<r;n++){var p=d[n];void 0!==p.visible&&(a?a.column(n).visible(p.visible,!1):s[n].bVisible=p.visible),void 0!==p.search&&c.extend(e.aoPreSearchCols[n],p.search)}a&&a.columns.adjust()}}e._bLoadingState=!1,rt(e,"aoStateLoaded","stateLoaded",[e,t]),i()}function Qe(e,t,i,n){if(i="DataTables warning: "+(e?"table id="+e.sTableId+" - ":"")+i,n&&(i+=". For more information about this error, please see https://datatables.net/tn/"+n),t)window.console&&console.log&&console.log(i);else{var r=h.ext,s=r.sErrMode||r.errMode;if(e&&rt(e,null,"dt-error",[e,n,i],!0),"alert"==s)alert(i);else{if("throw"==s)throw new Error(i);"function"==typeof s&&s(e,n,i)}}}function et(e,t,i,n){Array.isArray(i)?c.each(i,function(i,n){Array.isArray(n)?et(e,t,n[0],n[1]):et(e,t,n)}):(void 0===n&&(n=i),void 0!==t[i]&&(e[n]=t[i]))}function tt(e,t,i){var n;for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n=t[r],c.isPlainObject(n)?(c.isPlainObject(e[r])||(e[r]={}),c.extend(!0,e[r],n)):i&&"data"!==r&&"aaData"!==r&&Array.isArray(n)?e[r]=n.slice():e[r]=n);return e}function it(e,t,i){c(e).on("click.DT",t,function(e){i(e)}).on("keypress.DT",t,function(e){13===e.which&&(e.preventDefault(),i(e))}).on("selectstart.DT",t,function(){return!1})}function nt(e,t,i){i&&e[t].push(i)}function rt(e,t,i,n,r){var s=[];if(t&&(s=e[t].slice().reverse().map(function(t){return t.apply(e.oInstance,n)})),null!==i){var o=c.Event(i+".dt"),a=c(e.nTable);o.dt=e.api,a[r?"trigger":"triggerHandler"](o,n),r&&0===a.parents("body").length&&c("body").trigger(o,n),s.push(o.result)}return s}function st(e){var t=e._iDisplayStart,i=e.fnDisplayEnd(),n=e._iDisplayLength;t>=i&&(t=i-n),t-=t%n,(-1===n||t<0)&&(t=0),e._iDisplayStart=t}function ot(e,t){var i=e.renderer,n=h.ext.renderer[t];return c.isPlainObject(i)&&i[t]?n[i[t]]||n._:"string"==typeof i&&n[i]||n._}function at(e){return e.oFeatures.bServerSide?"ssp":e.ajax?"ajax":"dom"}function lt(e,t,i){var n=e.fnFormatNumber,r=e._iDisplayStart+1,s=e._iDisplayLength,o=e.fnRecordsDisplay(),a=e.fnRecordsTotal(),l=-1===s;return t.replace(/_START_/g,n.call(e,r)).replace(/_END_/g,n.call(e,e.fnDisplayEnd())).replace(/_MAX_/g,n.call(e,a)).replace(/_TOTAL_/g,n.call(e,o)).replace(/_PAGE_/g,n.call(e,l?1:Math.ceil(r/s))).replace(/_PAGES_/g,n.call(e,l?1:Math.ceil(o/s))).replace(/_ENTRIES_/g,e.api.i18n("entries","",i)).replace(/_ENTRIES-MAX_/g,e.api.i18n("entries","",a)).replace(/_ENTRIES-TOTAL_/g,e.api.i18n("entries","",o))}function ct(e,t){if(t)if(t.length<1e4)e.push.apply(e,t);else for($t=0;$t<t.length;$t++)e.push(t[$t])}function ht(e,t,i){for(Array.isArray(i)||(i=[i]),$t=0;$t<i.length;$t++)e.on(t+".dt",i[$t])}function dt(e){return h.ext.escape.attributes&&c.each(e,function(t,i){e[t]=C(i)}),e}var ut=[],ft=Array.prototype;function pt(e,t,i){return function(){var n=t.apply(e||this,arguments);return r.extend(n,n,i.methodExt),n}}function mt(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i].name===t)return e[i];return null}r=function(e,t){if(!(this instanceof r))return new r(e,t);var i,n=[],s=function(e){var t=function(e){var t,i,n=h.settings,r=S(n,"nTable");return e?e.nTable&&e.oFeatures?[e]:e.nodeName&&"table"===e.nodeName.toLowerCase()?-1!==(t=r.indexOf(e))?[n[t]]:null:e&&"function"==typeof e.settings?e.settings().toArray():("string"==typeof e?i=c(e).get():e instanceof c&&(i=e.get()),i?n.filter(function(e,t){return i.includes(r[t])}):void 0):[]}(e);t&&n.push.apply(n,t)};if(Array.isArray(e))for(i=0;i<e.length;i++)s(e[i]);else s(e);this.context=n.length>1?L(n):n,ct(this,t),this.selector={rows:null,cols:null,opts:null},r.extend(this,this,ut)},h.Api=r,c.extend(r.prototype,{any:function(){return 0!==this.count()},context:[],count:function(){return this.flatten().length},each:function(e){for(var t=0,i=this.length;t<i;t++)e.call(this,this[t],t,this);return this},eq:function(e){var t=this.context;return t.length>e?new r(t[e],this[e]):null},filter:function(e){var t=ft.filter.call(this,e,this);return new r(this.context,t)},flatten:function(){var e=[];return new r(this.context,e.concat.apply(e,this.toArray()))},get:function(e){return this[e]},join:ft.join,includes:function(e){return-1!==this.indexOf(e)},indexOf:ft.indexOf,iterator:function(e,t,i,n){var s,o,a,l,c,h,d,u,f=[],p=this.context,m=this.selector;for("string"==typeof e&&(n=i,i=t,t=e,e=!1),o=0,a=p.length;o<a;o++){var g=new r(p[o]);if("table"===t)void 0!==(s=i.call(g,p[o],o))&&f.push(s);else if("columns"===t||"rows"===t)void 0!==(s=i.call(g,p[o],this[o],o))&&f.push(s);else if("every"===t||"column"===t||"column-rows"===t||"row"===t||"cell"===t)for(d=this[o],"column-rows"===t&&(h=bt(p[o],m.opts)),l=0,c=d.length;l<c;l++)u=d[l],void 0!==(s="cell"===t?i.call(g,p[o],u.row,u.column,o,l):i.call(g,p[o],u,o,l,h))&&f.push(s)}if(f.length||n){var _=new r(p,e?f.concat.apply([],f):f),y=_.selector;return y.rows=m.rows,y.cols=m.cols,y.opts=m.opts,_}return this},lastIndexOf:ft.lastIndexOf,length:0,map:function(e){var t=ft.map.call(this,e,this);return new r(this.context,t)},pluck:function(e){var t=h.util.get(e);return this.map(function(e){return t(e)})},pop:ft.pop,push:ft.push,reduce:ft.reduce,reduceRight:ft.reduceRight,reverse:ft.reverse,selector:null,shift:ft.shift,slice:function(){return new r(this.context,this)},sort:ft.sort,splice:ft.splice,toArray:function(){return ft.slice.call(this)},to$:function(){return c(this)},toJQuery:function(){return c(this)},unique:function(){return new r(this.context,L(this.toArray()))},unshift:ft.unshift}),window.__apiStruct=ut,r.extend=function(e,t,i){var n,s,o;if(i.length&&t&&(t instanceof r||t.__dt_wrapper))for(n=0,s=i.length;n<s;n++)"__proto__"!==(o=i[n]).name&&(t[o.name]="function"===o.type?pt(e,o.val,o):"object"===o.type?{}:o.val,t[o.name].__dt_wrapper=!0,r.extend(e,t[o.name],o.propExt))},r.register=s=function(e,t){if(Array.isArray(e))for(var i=0,n=e.length;i<n;i++)r.register(e[i],t);else{var s,o,a,l,h=e.split("."),d=ut;for(s=0,o=h.length;s<o;s++){var u=mt(d,a=(l=-1!==h[s].indexOf("()"))?h[s].replace("()",""):h[s]);u||(u={name:a,val:{},methodExt:[],propExt:[],type:"object"},d.push(u)),s===o-1?(u.val=t,u.type="function"==typeof t?"function":c.isPlainObject(t)?"object":"other"):d=l?u.methodExt:u.propExt}}},r.registerPlural=o=function(e,t,i){r.register(e,i),r.register(t,function(){var e=i.apply(this,arguments);return e===this?this:e instanceof r?e.length?Array.isArray(e[0])?new r(e.context,e[0]):e[0]:void 0:e})};var gt=function(e,t){if(Array.isArray(e)){var i=[];return e.forEach(function(e){var n=gt(e,t);ct(i,n)}),i.filter(function(e){return e})}if("number"==typeof e)return[t[e]];var n=t.map(function(e){return e.nTable});return c(n).filter(e).map(function(){var e=n.indexOf(this);return t[e]}).toArray()};s("tables()",function(e){return null!=e?new r(gt(e,this.context)):this}),s("table()",function(e){var t=this.tables(e),i=t.context;return i.length?new r(i[0]):t}),[["nodes","node","nTable"],["body","body","nTBody"],["header","header","nTHead"],["footer","footer","nTFoot"]].forEach(function(e){o("tables()."+e[0]+"()","table()."+e[1]+"()",function(){return this.iterator("table",function(t){return t[e[2]]},1)})}),[["header","aoHeader"],["footer","aoFooter"]].forEach(function(e){s("table()."+e[0]+".structure()",function(t){var i=this.columns(t).indexes().flatten().toArray(),n=this.context[0],r=pe(n,n[e[1]],i),s=i.slice().sort(function(e,t){return e-t});return r.map(function(e){return i.map(function(t){return e[s.indexOf(t)]})})})}),o("tables().containers()","table().container()",function(){return this.iterator("table",function(e){return e.nTableWrapper},1)}),s("tables().every()",function(e){var t=this;return this.iterator("table",function(i,n){e.call(t.table(n),n)})}),s("caption()",function(e,t){var i=this.context;if(void 0===e){var n=i[0].captionNode;return n&&i.length?n.innerHTML:null}return this.iterator("table",function(i){var n=c(i.nTable),r=c(i.captionNode),s=c(i.nTableWrapper);if(r.length||(r=c("<caption/>").html(e),i.captionNode=r[0],t||(n.prepend(r),t=r.css("caption-side"))),r.html(e),t&&(r.css("caption-side",t),r[0]._captionSide=t),s.find("div.dataTables_scroll").length){var o="top"===t?"Head":"Foot";s.find("div.dataTables_scroll"+o+" table").prepend(r)}else n.prepend(r)},1)}),s("caption.node()",function(){var e=this.context;return e.length?e[0].captionNode:null}),s("draw()",function(e){return this.iterator("table",function(t){"page"===e?ge(t):("string"==typeof e&&(e="full-hold"!==e),_e(t,!1===e))})}),s("page()",function(e){return void 0===e?this.page.info().page:this.iterator("table",function(t){Re(t,e)})}),s("page.info()",function(){if(0!==this.context.length){var e=this.context[0],t=e._iDisplayStart,i=e.oFeatures.bPaginate?e._iDisplayLength:-1,n=e.fnRecordsDisplay(),r=-1===i;return{page:r?0:Math.floor(t/i),pages:r?1:Math.ceil(n/i),start:t,end:e.fnDisplayEnd(),length:i,recordsTotal:e.fnRecordsTotal(),recordsDisplay:n,serverSide:"ssp"===at(e)}}}),s("page.len()",function(e){return void 0===e?0!==this.context.length?this.context[0]._iDisplayLength:void 0:this.iterator("table",function(t){Pe(t,e)})});var _t=function(e,t,i){if(i){var n=new r(e);n.one("draw",function(){i(n.ajax.json())})}if("ssp"==at(e))_e(e,t);else{Oe(e,!0);var s=e.jqXHR;s&&4!==s.readyState&&s.abort(),Se(e,{},function(i){ae(e);for(var n=Te(e,i),r=0,s=n.length;r<s;r++)J(e,n[r]);_e(e,t),Ie(e),Oe(e,!1)})}};s("ajax.json()",function(){var e=this.context;if(e.length>0)return e[0].json}),s("ajax.params()",function(){var e=this.context;if(e.length>0)return e[0].oAjaxData}),s("ajax.reload()",function(e,t){return this.iterator("table",function(i){_t(i,!1===t,e)})}),s("ajax.url()",function(e){var t=this.context;if(void 0===e){if(0===t.length)return;return t=t[0],c.isPlainObject(t.ajax)?t.ajax.url:t.ajax}return this.iterator("table",function(t){c.isPlainObject(t.ajax)?t.ajax.url=e:t.ajax=e})}),s("ajax.url().load()",function(e,t){return this.iterator("table",function(i){_t(i,!1===t,e)})});var yt=function(e,t,i,r,s){var o,a,l,c=[],h=typeof t;for(t&&"string"!==h&&"function"!==h&&void 0!==t.length||(t=[t]),a=0,l=t.length;a<l;a++)(o=(o=i("string"==typeof t[a]?t[a].trim():t[a])).filter(function(e){return null!=e}))&&o.length&&(c=c.concat(o));var d=n.selector[e];if(d.length)for(a=0,l=d.length;a<l;a++)c=d[a](r,s,c);return L(c)},vt=function(e){return e||(e={}),e.filter&&void 0===e.search&&(e.search=e.filter),c.extend({columnOrder:"implied",search:"none",order:"current",page:"all"},e)},xt=function(e){var t=new r(e.context[0]);return e.length&&t.push(e[0]),t.selector=e.selector,t.length&&t[0].length>1&&t[0].splice(1),t},bt=function(e,t){var i,n,r,s=[],o=e.aiDisplay,a=e.aiDisplayMaster,l=t.search,c=t.order,h=t.page;if("ssp"==at(e))return"removed"===l?[]:k(0,a.length);if("current"==h)for(i=e._iDisplayStart,n=e.fnDisplayEnd();i<n;i++)s.push(o[i]);else if("current"==c||"applied"==c){if("none"==l)s=a.slice();else if("applied"==l)s=o.slice();else if("removed"==l){var d={};for(i=0,n=o.length;i<n;i++)d[o[i]]=null;a.forEach(function(e){Object.prototype.hasOwnProperty.call(d,e)||s.push(e)})}}else if("index"==c||"original"==c)for(i=0,n=e.aoData.length;i<n;i++)e.aoData[i]&&("none"==l||-1===(r=o.indexOf(i))&&"removed"==l||r>=0&&"applied"==l)&&s.push(i);else if("number"==typeof c){var u=Ge(e,c,"asc");if("none"===l)s=u;else for(i=0;i<u.length;i++)(-1===(r=o.indexOf(u[i]))&&"removed"==l||r>=0&&"applied"==l)&&s.push(u[i])}return s};s("rows()",function(e,t){void 0===e?e="":c.isPlainObject(e)&&(t=e,e=""),t=vt(t);var i=this.iterator("table",function(i){return function(e,t,i){var n,r=yt("row",t,function(t){var r=v(t),s=e.aoData;if(null!==r&&!i)return[r];if(n||(n=bt(e,i)),null!==r&&-1!==n.indexOf(r))return[r];if(null==t||""===t)return n;if("function"==typeof t)return n.map(function(e){var i=s[e];return t(e,i._aData,i.nTr)?e:null});if(t.nodeName){var o=t._DT_RowIndex,a=t._DT_CellIndex;if(void 0!==o)return s[o]&&s[o].nTr===t?[o]:[];if(a)return s[a.row]&&s[a.row].nTr===t.parentNode?[a.row]:[];var l=c(t).closest("*[data-dt-row]");return l.length?[l.data("dt-row")]:[]}if("string"==typeof t&&"#"===t.charAt(0)){var h=e.aIds[t.replace(/^#/,"")];if(void 0!==h)return[h.idx]}var d=M(T(e.aoData,n,"nTr"));return c(d).filter(t).map(function(){return this._DT_RowIndex}).toArray()},e,i);return"current"!==i.order&&"applied"!==i.order||We(e,r),r}(i,e,t)},1);return i.selector.rows=e,i.selector.opts=t,i}),s("rows().nodes()",function(){return this.iterator("row",function(e,t){return e.aoData[t].nTr||void 0},1)}),s("rows().data()",function(){return this.iterator(!0,"rows",function(e,t){return T(e.aoData,t,"_aData")},1)}),o("rows().cache()","row().cache()",function(e){return this.iterator("row",function(t,i){var n=t.aoData[i];return"search"===e?n._aFilterData:n._aSortData},1)}),o("rows().invalidate()","row().invalidate()",function(e){return this.iterator("row",function(t,i){le(t,i,e)})}),o("rows().indexes()","row().index()",function(){return this.iterator("row",function(e,t){return t},1)}),o("rows().ids()","row().id()",function(e){for(var t=[],i=this.context,n=0,s=i.length;n<s;n++)for(var o=0,a=this[n].length;o<a;o++){var l=i[n].rowIdFn(i[n].aoData[this[n][o]]._aData);t.push((!0===e?"#":"")+l)}return new r(i,t)}),o("rows().remove()","row().remove()",function(){return this.iterator("row",function(e,t){var i=e.aoData,n=i[t],r=e.aiDisplayMaster.indexOf(t);-1!==r&&e.aiDisplayMaster.splice(r,1),e._iRecordsDisplay>0&&e._iRecordsDisplay--,st(e);var s=e.rowIdFn(n._aData);void 0!==s&&delete e.aIds[s],i[t]=null}),this}),s("rows.add()",function(e){var t=this.iterator("table",function(t){var i,n,r,s=[];for(n=0,r=e.length;n<r;n++)(i=e[n]).nodeName&&"TR"===i.nodeName.toUpperCase()?s.push(K(t,i)[0]):s.push(J(t,i));return s},1),i=this.rows(-1);return i.pop(),ct(i,t),i}),s("row()",function(e,t){return xt(this.rows(e,t))}),s("row().data()",function(e){var t=this.context;if(void 0===e)return t.length&&this.length&&this[0].length?t[0].aoData[this[0]]._aData:void 0;var i=t[0].aoData[this[0]];return i._aData=e,Array.isArray(e)&&i.nTr&&i.nTr.id&&se(t[0].rowId)(e,i.nTr.id),le(t[0],this[0],"data"),this}),s("row().node()",function(){var e=this.context;if(e.length&&this.length&&this[0].length){var t=e[0].aoData[this[0]];if(t&&t.nTr)return t.nTr}return null}),s("row.add()",function(e){e instanceof c&&e.length&&(e=e[0]);var t=this.iterator("table",function(t){return e.nodeName&&"TR"===e.nodeName.toUpperCase()?K(t,e)[0]:J(t,e)});return this.row(t[0])}),c(document).on("plugin-init.dt",function(e,t){var i=new r(t);i.on("stateSaveParams.DT",function(e,t,i){for(var n=t.rowIdFn,r=t.aiDisplayMaster,s=[],o=0;o<r.length;o++){var a=r[o],l=t.aoData[a];l._detailsShow&&s.push("#"+n(l._aData))}i.childRows=s}),i.on("stateLoaded.DT",function(e,t,n){wt(i,n)}),wt(i,i.state.loaded())});var wt=function(e,t){t&&t.childRows&&e.rows(t.childRows.map(function(e){return e.replace(/([^:\\]*(?:\\.[^:\\]*)*):/g,"$1\\:")})).every(function(){rt(e.settings()[0],null,"requestChild",[this])})},St=h.util.throttle(function(e){Je(e[0])},500),Tt=function(e,t){var i=e.context;if(i.length){var n=i[0].aoData[void 0!==t?t:e[0]];n&&n._details&&(n._details.remove(),n._detailsShow=void 0,n._details=void 0,c(n.nTr).removeClass("dt-hasChild"),St(i))}},kt=function(e,t){var i=e.context;if(i.length&&e.length){var n=i[0].aoData[e[0]];n._details&&(n._detailsShow=t,t?(n._details.insertAfter(n.nTr),c(n.nTr).addClass("dt-hasChild")):(n._details.detach(),c(n.nTr).removeClass("dt-hasChild")),rt(i[0],null,"childRow",[t,e.row(e[0])]),Mt(i[0]),St(i))}},Mt=function(e){var t=new r(e),i=".dt.DT_details",n="draw"+i,s="column-sizing"+i,o="destroy"+i,a=e.aoData;t.off(n+" "+s+" "+o),S(a,"_details").length>0&&(t.on(n,function(i,n){e===n&&t.rows({page:"current"}).eq(0).each(function(e){var t=a[e];t._detailsShow&&t._details.insertAfter(t.nTr)})}),t.on(s,function(t,i){if(e===i)for(var n,r=V(i),s=0,o=a.length;s<o;s++)(n=a[s])&&n._details&&n._details.each(function(){var e=c(this).children("td");1==e.length&&e.attr("colspan",r)})}),t.on(o,function(i,n){if(e===n)for(var r=0,s=a.length;r<s;r++)a[r]&&a[r]._details&&Tt(t,r)}))},At="row().child",Ct=At+"()";s(Ct,function(e,t){var i=this.context;return void 0===e?i.length&&this.length&&i[0].aoData[this[0]]?i[0].aoData[this[0]]._details:void 0:(!0===e?this.child.show():!1===e?Tt(this):i.length&&this.length&&function(e,t,i,n){var r=[],s=function(i,n){if(Array.isArray(i)||i instanceof c)for(var o=0,a=i.length;o<a;o++)s(i[o],n);else if(i.nodeName&&"tr"===i.nodeName.toLowerCase())i.setAttribute("data-dt-row",t.idx),r.push(i);else{var l=c("<tr><td></td></tr>").attr("data-dt-row",t.idx).addClass(n);c("td",l).addClass(n).html(i)[0].colSpan=V(e),r.push(l[0])}};s(i,n),t._details&&t._details.detach(),t._details=c(r),t._detailsShow&&t._details.insertAfter(t.nTr)}(i[0],i[0].aoData[this[0]],e,t),this)}),s([At+".show()",Ct+".show()"],function(){return kt(this,!0),this}),s([At+".hide()",Ct+".hide()"],function(){return kt(this,!1),this}),s([At+".remove()",Ct+".remove()"],function(){return Tt(this),this}),s(At+".isShown()",function(){var e=this.context;return e.length&&this.length&&e[0].aoData[this[0]]&&e[0].aoData[this[0]]._detailsShow||!1});var Dt,Lt,Et=/^([^:]+)?:(name|title|visIdx|visible)$/,It=function(e,t,i,n,r,s){for(var o=[],a=0,l=r.length;a<l;a++)o.push(Q(e,r[a],t,s));return o},Pt=function(e,t,i){var n=e.aoHeader,r=e.titleRow,s=null;if(void 0!==i)s=i;else if(!0===r)s=0;else if(!1===r)s=n.length-1;else if(null!==r)s=r;else{for(var o=0;o<n.length;o++)n[o][t].unique&&c("span.dt-column-title",n[o][t].cell).text()&&(s=o);null===s&&(s=0)}return n[s][t].cell};function Rt(e,t){c(e).find("span.dt-column-order").remove(),c(e).find("span.dt-column-title").each(function(){var e=c(this).html();c(this).parent().parent().append(e),c(this).remove()}),c(e).find("div.dt-column-"+t).remove(),c("th, td",e).removeAttr("data-dt-column")}s("columns()",function(e,t){void 0===e?e="":c.isPlainObject(e)&&(t=e,e=""),t=vt(t);var i=this.iterator("table",function(i){return function(e,t,i){var n,r,s=e.aoColumns,o=function(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<e[i].length;n++){var r=e[i][n].cell;t.includes(r)||t.push(r)}return t}(e.aoHeader),a=yt("column",t,function(t){var a=v(t);if(""===t)return k(s.length);if(null!==a)return[a>=0?a:s.length+a];if("function"==typeof t){var l=bt(e,i);return s.map(function(i,n){return t(n,It(e,n,0,0,l),Pt(e,n))?n:null})}var h="string"==typeof t?t.match(Et):"";if(h)switch(h[2]){case"visIdx":case"visible":if(h[1]&&h[1].match(/^\d+$/)){var d=parseInt(h[1],10);if(d<0){var u=s.map(function(e,t){return e.bVisible?t:null});return[u[u.length+d]]}return[H(e,d)]}return s.map(function(e,t){return e.bVisible?h[1]?c(o[t]).filter(h[1]).length>0?t:null:t:null});case"name":return n||(n=S(s,"sName")),n.map(function(e,t){return e===h[1]?t:null});case"title":return r||(r=S(s,"sTitle")),r.map(function(e,t){return e===h[1]?t:null});default:return[]}if(t.nodeName&&t._DT_CellIndex)return[t._DT_CellIndex.column];var f=c(o).filter(t).map(function(){return Z(this)}).toArray().sort(function(e,t){return e-t});if(f.length||!t.nodeName)return f;var p=c(t).closest("*[data-dt-column]");return p.length?[p.data("dt-column")]:[]},e,i);return i.columnOrder&&"index"===i.columnOrder?a.sort(function(e,t){return e-t}):a}(i,e,t)},1);return i.selector.cols=e,i.selector.opts=t,i}),o("columns().header()","column().header()",function(e){return this.iterator("column",function(t,i){return Pt(t,i,e)},1)}),o("columns().footer()","column().footer()",function(e){return this.iterator("column",function(t,i){return t.aoFooter.length?t.aoFooter[void 0!==e?e:0][i].cell:null},1)}),o("columns().data()","column().data()",function(){return this.iterator("column-rows",It,1)}),o("columns().render()","column().render()",function(e){return this.iterator("column-rows",function(t,i,n,r,s){return It(t,i,0,0,s,e)},1)}),o("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(e,t){return e.aoColumns[t].mData},1)}),o("columns().cache()","column().cache()",function(e){return this.iterator("column-rows",function(t,i,n,r,s){return T(t.aoData,s,"search"===e?"_aFilterData":"_aSortData",i)},1)}),o("columns().init()","column().init()",function(){return this.iterator("column",function(e,t){return e.aoColumns[t]},1)}),o("columns().names()","column().name()",function(){return this.iterator("column",function(e,t){return e.aoColumns[t].sName},1)}),o("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(e,t,i,n,r){return T(e.aoData,r,"anCells",t)},1)}),o("columns().titles()","column().title()",function(e,t){return this.iterator("column",function(i,n){"number"==typeof e&&(t=e,e=void 0);var r=c("span.dt-column-title",this.column(n).header(t));return void 0!==e?(r.html(e),this):r.html()},1)}),o("columns().types()","column().type()",function(){return this.iterator("column",function(e,t){var i=e.aoColumns[t].sType;return i||$(e),i},1)}),o("columns().visible()","column().visible()",function(e,t){var i=this,n=[],r=this.iterator("column",function(t,i){if(void 0===e)return t.aoColumns[i].bVisible;(function(e,t,i){var n,r,s,o,a=e.aoColumns,l=a[t],h=e.aoData;if(void 0===i)return l.bVisible;if(l.bVisible===i)return!1;if(i){var d=S(a,"bVisible").indexOf(!0,t+1);for(r=0,s=h.length;r<s;r++)h[r]&&(o=h[r].nTr,n=h[r].anCells,o&&o.insertBefore(n[t],n[d]||null))}else c(S(e.aoData,"anCells",t)).detach();return l.bVisible=i,je(e),!0})(t,i,e)&&n.push(i)});return void 0!==e&&this.iterator("table",function(r){me(r,r.aoHeader),me(r,r.aoFooter),r.aiDisplay.length||c(r.nTBody).find("td[colspan]").attr("colspan",V(r)),Je(r),i.iterator("column",function(i,r){n.includes(r)&&rt(i,null,"column-visibility",[i,r,e,t])}),n.length&&(void 0===t||t)&&i.columns.adjust()}),r}),o("columns().widths()","column().width()",function(){var e=this.columns(":visible").count(),t=c("<tr>").html("<td>"+Array(e).join("</td><td>")+"</td>");c(this.table().body()).append(t);var i=t.children().map(function(){return c(this).outerWidth()});return t.remove(),this.iterator("column",function(e,t){var n=j(e,t);return null!==n?i[n]:0},1)}),o("columns().indexes()","column().index()",function(e){return this.iterator("column",function(t,i){return"visible"===e?j(t,i):i},1)}),s("columns.adjust()",function(){return this.iterator("table",function(e){e.containerWidth=-1,B(e)},1)}),s("column.index()",function(e,t){if(0!==this.context.length){var i=this.context[0];if("fromVisible"===e||"toData"===e)return H(i,t);if("fromData"===e||"toVisible"===e)return j(i,t)}}),s("column()",function(e,t){return xt(this.columns(e,t))}),s("cells()",function(e,t,i){if(c.isPlainObject(e)&&(void 0===e.row?(i=e,e=null):(i=t,t=null)),c.isPlainObject(t)&&(i=t,t=null),null==t)return this.iterator("table",function(t){return function(e,t,i){var n,r,s,o,a,l,h,d=e.aoData,u=bt(e,i),f=M(T(d,u,"anCells")),p=c(E([],f)),m=e.aoColumns.length;return yt("cell",t,function(t){var i="function"==typeof t;if(null==t||i){for(r=[],s=0,o=u.length;s<o;s++)for(n=u[s],a=0;a<m;a++)l={row:n,column:a},i?(h=d[n],t(l,Q(e,n,a),h.anCells?h.anCells[a]:null)&&r.push(l)):r.push(l);return r}if(c.isPlainObject(t))return void 0!==t.column&&void 0!==t.row&&-1!==u.indexOf(t.row)?[t]:[];var f=p.filter(t).map(function(e,t){return{row:t._DT_CellIndex.row,column:t._DT_CellIndex.column}}).toArray();return f.length||!t.nodeName?f:(h=c(t).closest("*[data-dt-row]")).length?[{row:h.data("dt-row"),column:h.data("dt-column")}]:[]},e,i)}(t,e,vt(i))});var n,r,s,o,a=i?{page:i.page,order:i.order,search:i.search}:{},l=this.columns(t,a),h=this.rows(e,a),d=this.iterator("table",function(e,t){var i=[];for(n=0,r=h[t].length;n<r;n++)for(s=0,o=l[t].length;s<o;s++)i.push({row:h[t][n],column:l[t][s]});return i},1),u=i&&i.selected?this.cells(d,i):d;return c.extend(u.selector,{cols:t,rows:e,opts:i}),u}),o("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(e,t,i){var n=e.aoData[t];return n&&n.anCells?n.anCells[i]:void 0},1)}),s("cells().data()",function(){return this.iterator("cell",function(e,t,i){return Q(e,t,i)},1)}),o("cells().cache()","cell().cache()",function(e){return e="search"===e?"_aFilterData":"_aSortData",this.iterator("cell",function(t,i,n){return t.aoData[i][e][n]},1)}),o("cells().render()","cell().render()",function(e){return this.iterator("cell",function(t,i,n){return Q(t,i,n,e)},1)}),o("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(e,t,i){return{row:t,column:i,columnVisible:j(e,i)}},1)}),o("cells().invalidate()","cell().invalidate()",function(e){return this.iterator("cell",function(t,i,n){le(t,i,e,n)})}),s("cell()",function(e,t,i){return xt(this.cells(e,t,i))}),s("cell().data()",function(e){var t,i,n,r,s,o,a=this.context,l=this[0];return void 0===e?a.length&&l.length?Q(a[0],l[0].row,l[0].column):void 0:(t=a[0],i=l[0].row,n=l[0].column,r=e,s=t.aoColumns[n],o=t.aoData[i]._aData,s.fnSetData(o,r,{settings:t,row:i,col:n}),le(a[0],l[0].row,"data",l[0].column),this)}),s("order()",function(e,t){var i=this.context,n=Array.prototype.slice.call(arguments);return void 0===e?0!==i.length?i[0].aaSorting:void 0:("number"==typeof e?e=[[e,t]]:n.length>1&&(e=n),this.iterator("table",function(t){var i=[];Ue(t,i,e),t.aaSorting=i}))}),s("order.listener()",function(e,t,i){return this.iterator("table",function(n){Ve(n,e,{},t,i)})}),s("order.fixed()",function(e){if(!e){var t=this.context,i=t.length?t[0].aaSortingFixed:void 0;return Array.isArray(i)?{pre:i}:i}return this.iterator("table",function(t){t.aaSortingFixed=c.extend(!0,{},e)})}),s(["columns().order()","column().order()"],function(e){var t=this;return e?this.iterator("table",function(i,n){i.aaSorting=t[n].map(function(t){return[t,e]})}):this.iterator("column",function(e,t){for(var i=$e(e),n=0,r=i.length;n<r;n++)if(i[n].col===t)return i[n].dir;return null},1)}),o("columns().orderable()","column().orderable()",function(e){return this.iterator("column",function(t,i){var n=t.aoColumns[i];return e?n.asSorting:n.bSortable},1)}),s("processing()",function(e){return this.iterator("table",function(t){Oe(t,e)})}),s("search()",function(e,t,i,n){var r=this.context;return void 0===e?0!==r.length?r[0].oPreviousSearch.search:void 0:this.iterator("table",function(r){r.oFeatures.bFilter&&Me(r,"object"==typeof t?c.extend(r.oPreviousSearch,t,{search:e}):c.extend(r.oPreviousSearch,{search:e,regex:null!==t&&t,smart:null===i||i,caseInsensitive:null===n||n}))})}),s("search.fixed()",function(e,t){var i=this.iterator(!0,"table",function(i){var n=i.searchFixed;return e?void 0===t?n[e]:(null===t?delete n[e]:n[e]=t,this):Object.keys(n)});return void 0!==e&&void 0===t?i[0]:i}),o("columns().search()","column().search()",function(e,t,i,n){return this.iterator("column",function(r,s){var o=r.aoPreSearchCols;if(void 0===e)return o[s].search;r.oFeatures.bFilter&&("object"==typeof t?c.extend(o[s],t,{search:e}):c.extend(o[s],{search:e,regex:null!==t&&t,smart:null===i||i,caseInsensitive:null===n||n}),Me(r,r.oPreviousSearch))})}),s(["columns().search.fixed()","column().search.fixed()"],function(e,t){var i=this.iterator(!0,"column",function(i,n){var r=i.aoColumns[n].searchFixed;return e?void 0===t?r[e]||null:(null===t?delete r[e]:r[e]=t,this):Object.keys(r)});return void 0!==e&&void 0===t?i[0]:i}),s("state()",function(e,t){if(!e)return this.context.length?this.context[0].oSavedState:null;var i=c.extend(!0,{},e);return this.iterator("table",function(e){!1!==t&&(i.time=+new Date+100),Ke(e,i,function(){})})}),s("state.clear()",function(){return this.iterator("table",function(e){e.fnStateSaveCallback.call(e.oInstance,e,{})})}),s("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null}),s("state.save()",function(){return this.iterator("table",function(e){Je(e)})}),h.use=function(e,t){var i="string"==typeof e?t:e,n="string"==typeof t?t:e;if(void 0===i&&"string"==typeof n)switch(n){case"lib":case"jq":return c;case"win":return window;case"datetime":return h.DateTime;case"luxon":return Nt;case"moment":return Yt;case"bootstrap":return Dt||l;case"foundation":return Lt||window.Foundation;default:return null}"lib"===n||"jq"===n||i&&i.fn&&i.fn.jquery?c=i:"win"===n||i&&i.document?(window=i,document=i.document):"datetime"===n||i&&"DateTime"===i.type?h.DateTime=i:"luxon"===n||i&&i.FixedOffsetZone?Nt=i:"moment"===n||i&&i.isMoment?Yt=i:"bootstrap"===n||i&&i.Modal&&"modal"===i.Modal.NAME?Dt=i:("foundation"===n||i&&i.Reveal)&&(Lt=i)},h.factory=function(e,t){var i=!1;return e&&e.document&&(window=e,document=e.document),t&&t.fn&&t.fn.jquery&&(c=t,i=!0),i},h.versionCheck=function(e,t){for(var i,n,r=t?t.split("."):h.version.split("."),s=e.split("."),o=0,a=s.length;o<a;o++)if((i=parseInt(r[o],10)||0)!==(n=parseInt(s[o],10)||0))return i>n;return!0},h.isDataTable=function(e){var t=c(e).get(0),i=!1;return e instanceof h.Api||(c.each(h.settings,function(e,n){var r=n.nScrollHead?c("table",n.nScrollHead)[0]:null,s=n.nScrollFoot?c("table",n.nScrollFoot)[0]:null;n.nTable!==t&&r!==t&&s!==t||(i=!0)}),i)},h.tables=function(e){var t=!1;c.isPlainObject(e)&&(t=e.api,e=e.visible);var i=h.settings.filter(function(t){return!!(!e||e&&c(t.nTable).is(":visible"))}).map(function(e){return e.nTable});return t?new r(i):i},h.camelToHungarian=R,s("$()",function(e,t){var i=this.rows(t).nodes(),n=c(i);return c([].concat(n.filter(e).toArray(),n.find(e).toArray()))}),c.each(["on","one","off"],function(e,t){s(t+"()",function(){var e=Array.prototype.slice.call(arguments);e[0]=e[0].split(/\s/).map(function(e){return e.match(/\.dt\b/)?e:e+".dt"}).join(" ");var i=c(this.tables().nodes());return i[t].apply(i,e),this})}),s("clear()",function(){return this.iterator("table",function(e){ae(e)})}),s("error()",function(e){return this.iterator("table",function(t){Qe(t,0,e)})}),s("settings()",function(){return new r(this.context,this.context)}),s("init()",function(){var e=this.context;return e.length?e[0].oInit:null}),s("data()",function(){return this.iterator("table",function(e){return S(e.aoData,"_aData")}).flatten()}),s("trigger()",function(e,t,i){return this.iterator("table",function(n){return rt(n,null,e,t,i)}).flatten()}),s("ready()",function(e){var t=this.context;return e?this.tables().every(function(){var t=this;this.context[0]._bInitComplete?e.call(t):this.on("init.dt.DT",function(){e.call(t)})}):t.length?t[0]._bInitComplete||!1:null}),s("destroy()",function(e){return e=e||!1,this.iterator("table",function(t){var i=t.oClasses,n=t.nTable,s=t.nTBody,o=t.nTHead,a=t.nTFoot,l=c(n),d=c(s),u=c(t.nTableWrapper),f=t.aoData.map(function(e){return e?e.nTr:null}),p=i.order;t.bDestroying=!0,rt(t,"aoDestroyCallback","destroy",[t],!0),e||new r(t).columns().visible(!0),t.resizeObserver&&t.resizeObserver.disconnect(),u.off(".DT").find(":not(tbody *)").off(".DT"),c(window).off(".DT-"+t.sInstance),n!=o.parentNode&&(l.children("thead").detach(),l.append(o)),a&&n!=a.parentNode&&(l.children("tfoot").detach(),l.append(a)),Rt(o,"header"),Rt(a,"footer"),t.colgroup.remove(),t.aaSorting=[],t.aaSortingFixed=[],qe(t),c(l).find("th, td").removeClass(c.map(h.ext.type.className,function(e){return e}).join(" ")),c("th, td",o).removeClass(p.none+" "+p.canAsc+" "+p.canDesc+" "+p.isAsc+" "+p.isDesc).css("width","").removeAttr("aria-sort"),d.children().detach(),d.append(f);var m=t.nTableWrapper.parentNode,g=t.nTableWrapper.nextSibling,_=e?"remove":"detach";l[_](),u[_](),!e&&m&&(m.insertBefore(n,g),l.css("width",t.sDestroyWidth).removeClass(i.table));var y=h.settings.indexOf(t);-1!==y&&h.settings.splice(y,1)})}),c.each(["column","row","cell"],function(e,t){s(t+"s().every()",function(e){var i,n=this.selector.opts,r=this,s=0;return this.iterator("every",function(o,a,l){i=r[t](a,n),"cell"===t?e.call(i,i[0][0].row,i[0][0].column,l,s):e.call(i,a,l,s),s++})})}),s("i18n()",function(e,t,i){var n=this.context[0],r=re(e)(n.oLanguage);return void 0===r&&(r=t),c.isPlainObject(r)&&(r=void 0!==i&&void 0!==r[i]?r[i]:r._),"string"==typeof r?r.replace("%d",i):r}),h.version="2.3.2",h.settings=[],h.models={},h.models.oSearch={caseInsensitive:!0,search:"",regex:!1,smart:!0,return:!1},h.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,src:null,idx:-1,displayData:null},h.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null,maxLenString:null,searchFixed:null},h.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],bAutoWidth:!0,bDeferRender:!0,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:null,titleRow:null,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnStateLoadCallback:function(e){try{return JSON.parse((-1===e.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+e.sInstance+"_"+location.pathname))}catch(e){return{}}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(e,t){try{(-1===e.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+e.sInstance+"_"+location.pathname,JSON.stringify(t))}catch(e){}},fnStateSaveParams:null,iStateDuration:7200,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{orderable:": Activate to sort",orderableReverse:": Activate to invert sorting",orderableRemove:": Activate to remove sorting",paginate:{first:"First",last:"Last",next:"Next",previous:"Previous",number:""}},oPaginate:{sFirst:"«",sLast:"»",sNext:"›",sPrevious:"‹"},entries:{_:"entries",1:"entry"},lengthLabels:{"-1":"All"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ _ENTRIES-TOTAL_",sInfoEmpty:"Showing 0 to 0 of 0 _ENTRIES-TOTAL_",sInfoFiltered:"(filtered from _MAX_ total _ENTRIES-MAX_)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"_MENU_ _ENTRIES_ per page",sLoadingRecords:"Loading...",sProcessing:"",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},orderDescReverse:!0,oSearch:c.extend({},h.models.oSearch),layout:{topStart:"pageLength",topEnd:"search",bottomStart:"info",bottomEnd:"paging"},sDom:null,searchDelay:null,sPaginationType:"",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId",caption:null,iDeferLoading:null,on:null},P(h.defaults),h.defaults.column={aDataSort:null,iDataSort:-1,ariaTitle:"",asSorting:["asc","desc",""],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null},P(h.defaults.column),h.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:!0,bLengthChange:!0,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollbarLeft:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},searchFixed:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",pagingControls:0,iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,bAjaxDataGet:!0,jqXHR:null,json:void 0,oAjaxData:void 0,sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==at(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==at(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var e=this._iDisplayLength,t=this._iDisplayStart,i=t+e,n=this.aiDisplay.length,r=this.oFeatures,s=r.bPaginate;return r.bServerSide?!1===s||-1===e?t+n:Math.min(t+e,this._iRecordsDisplay):!s||i>n||-1===e?n:i},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null,caption:"",captionNode:null,colgroup:null,deferLoading:null,typeDetect:!0,resizeObserver:null,containerWidth:-1,orderDescReverse:null,orderIndicators:!0,orderHandler:!0,titleRow:null};var Ot=h.ext.pager;c.extend(Ot,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(){return["numbers"]},simple_numbers:function(){return["previous","numbers","next"]},full_numbers:function(){return["first","previous","numbers","next","last"]},first_last:function(){return["first","last"]},first_last_numbers:function(){return["first","numbers","last"]},_numbers:ii,numbers_length:7}),c.extend(!0,h.ext.renderer,{pagingButton:{_:function(e,t,i,n,r){var s,o=e.oClasses.paging,a=[o.button];return n&&a.push(o.active),r&&a.push(o.disabled),{display:s="ellipsis"===t?c('<span class="ellipsis"></span>').html(i)[0]:c("<button>",{class:a.join(" "),role:"link",type:"button"}).html(i),clicker:s}}},pagingContainer:{_:function(e,t){return t}}});var zt=function(e,t){return function(i){return y(i)||"string"!=typeof i||(i=i.replace(u," "),e&&(i=A(i)),t&&(i=D(i,!1))),i}};function Ft(e,t,i,n,r){return Yt?e[t](r):Nt?e[i](r):n?e[n](r):e}var Nt,Yt,Bt=!1;function Ht(e,t,i){var n;if(window.luxon&&!Nt&&(Nt=window.luxon),window.moment&&!Yt&&(Yt=window.moment),Yt){if(!(n=Yt.utc(e,t,i,!0)).isValid())return null}else if(Nt){if(!(n=t&&"string"==typeof e?Nt.DateTime.fromFormat(e,t):Nt.DateTime.fromISO(e)).isValid)return null;n=n.setLocale(i)}else t?(Bt||alert("DataTables warning: Formatted date without Moment.js or Luxon - https://datatables.net/tn/17"),Bt=!0):n=new Date(e);return n}function jt(e){return function(t,i,n,r){0===arguments.length?(n="en",i=null,t=null):1===arguments.length?(n="en",i=t,t=null):2===arguments.length&&(n=i,i=t,t=null);var s="datetime"+(i?"-"+i:"");return h.ext.type.order[s+"-pre"]||h.type(s,{detect:function(e){return e===s&&s},order:{pre:function(e){return e.valueOf()}},className:"dt-right"}),function(o,a){if(null==o)if("--now"===r){var l=new Date;o=new Date(Date.UTC(l.getFullYear(),l.getMonth(),l.getDate(),l.getHours(),l.getMinutes(),l.getSeconds()))}else o="";if("type"===a)return s;if(""===o)return"sort"!==a?"":Ht("0000-01-01 00:00:00",null,n);if(null!==i&&t===i&&"sort"!==a&&"type"!==a&&!(o instanceof Date))return o;var c=Ht(o,t,n);if(null===c)return o;if("sort"===a)return c;var h=null===i?Ft(c,"toDate","toJSDate","")[e]():Ft(c,"format","toFormat","toISOString",i);return"display"===a?C(h):h}}}var Vt=",",Wt=".";if(void 0!==window.Intl)try{for(var Ut=(new Intl.NumberFormat).formatToParts(100000.1),$t=0;$t<Ut.length;$t++)"group"===Ut[$t].type?Vt=Ut[$t].value:"decimal"===Ut[$t].type&&(Wt=Ut[$t].value)}catch(e){}h.datetime=function(e,t){var i="datetime-"+e;t||(t="en"),h.ext.type.order[i]||h.type(i,{detect:function(n){var r=Ht(n,e,t);return!(""!==n&&!r)&&i},order:{pre:function(i){return Ht(i,e,t)||0}},className:"dt-right"})},h.render={date:jt("toLocaleDateString"),datetime:jt("toLocaleString"),time:jt("toLocaleTimeString"),number:function(e,t,i,n,r){return null==e&&(e=Vt),null==t&&(t=Wt),{display:function(s){if("number"!=typeof s&&"string"!=typeof s)return s;if(""===s||null===s)return s;var o=s<0?"-":"",a=parseFloat(s),l=Math.abs(a);if(l>=1e11||l<1e-4&&0!==l){var c=a.toExponential(i).split(/e\+?/);return c[0]+" x 10<sup>"+c[1]+"</sup>"}if(isNaN(a))return C(s);a=a.toFixed(i),s=Math.abs(a);var h=parseInt(s,10),d=i?t+(s-h).toFixed(i).substring(2):"";return 0===h&&0===parseFloat(d)&&(o=""),o+(n||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,e)+d+(r||"")}}},text:function(){return{display:C,filter:C}}};var Gt=h.ext.type;h.type=function(e,t,i){if(!t)return{className:Gt.className[e],detect:Gt.detect.find(function(t){return t._name===e}),order:{pre:Gt.order[e+"-pre"],asc:Gt.order[e+"-asc"],desc:Gt.order[e+"-desc"]},render:Gt.render[e],search:Gt.search[e]};var n=function(t,i){Gt[t][e]=i},r=function(t){Object.defineProperty(t,"_name",{value:e});var i=Gt.detect.findIndex(function(t){return t._name===e});-1===i?Gt.detect.unshift(t):Gt.detect.splice(i,1,t)},s=function(t){Gt.order[e+"-pre"]=t.pre,Gt.order[e+"-asc"]=t.asc,Gt.order[e+"-desc"]=t.desc};void 0===i&&(i=t,t=null),"className"===t?n("className",i):"detect"===t?r(i):"order"===t?s(i):"render"===t?n("render",i):"search"===t?n("search",i):t||(i.className&&n("className",i.className),void 0!==i.detect&&r(i.detect),i.order&&s(i.order),void 0!==i.render&&n("render",i.render),void 0!==i.search&&n("search",i.search))},h.types=function(){return Gt.detect.map(function(e){return e._name})};var Xt=function(e,t){return e=null!=e?e.toString().toLowerCase():"",t=null!=t?t.toString().toLowerCase():"",e.localeCompare(t,navigator.languages[0]||navigator.language,{numeric:!0,ignorePunctuation:!0})},qt=function(e,t){return e=A(e),t=A(t),Xt(e,t)};h.type("string",{detect:function(){return"string"},order:{pre:function(e){return y(e)&&"boolean"!=typeof e?"":"string"==typeof e?e.toLowerCase():e.toString?e.toString():""}},search:zt(!1,!0)}),h.type("string-utf8",{detect:{allOf:function(e){return!0},oneOf:function(e){return!y(e)&&navigator.languages&&"string"==typeof e&&e.match(/[^\x00-\x7F]/)}},order:{asc:Xt,desc:function(e,t){return-1*Xt(e,t)}},search:zt(!1,!0)}),h.type("html",{detect:{allOf:function(e){return y(e)||"string"==typeof e&&-1!==e.indexOf("<")},oneOf:function(e){return!y(e)&&"string"==typeof e&&-1!==e.indexOf("<")}},order:{pre:function(e){return y(e)?"":e.replace?A(e).trim().toLowerCase():e+""}},search:zt(!0,!0)}),h.type("html-utf8",{detect:{allOf:function(e){return y(e)||"string"==typeof e&&-1!==e.indexOf("<")},oneOf:function(e){return navigator.languages&&!y(e)&&"string"==typeof e&&-1!==e.indexOf("<")&&"string"==typeof e&&e.match(/[^\x00-\x7F]/)}},order:{asc:qt,desc:function(e,t){return-1*qt(e,t)}},search:zt(!0,!0)}),h.type("date",{className:"dt-type-date",detect:{allOf:function(e){if(e&&!(e instanceof Date)&&!m.test(e))return null;var t=Date.parse(e);return null!==t&&!isNaN(t)||y(e)},oneOf:function(e){return e instanceof Date||"string"==typeof e&&m.test(e)}},order:{pre:function(e){var t=Date.parse(e);return isNaN(t)?-1/0:t}}}),h.type("html-num-fmt",{className:"dt-type-numeric",detect:{allOf:function(e,t){var i=t.oLanguage.sDecimal;return w(e,i,!0,!1)},oneOf:function(e,t){var i=t.oLanguage.sDecimal;return w(e,i,!0,!1)}},order:{pre:function(e,t){var i=t.oLanguage.sDecimal;return Zt(e,i,f,_)}},search:zt(!0,!0)}),h.type("html-num",{className:"dt-type-numeric",detect:{allOf:function(e,t){var i=t.oLanguage.sDecimal;return w(e,i,!1,!0)},oneOf:function(e,t){var i=t.oLanguage.sDecimal;return w(e,i,!1,!1)}},order:{pre:function(e,t){var i=t.oLanguage.sDecimal;return Zt(e,i,f)}},search:zt(!0,!0)}),h.type("num-fmt",{className:"dt-type-numeric",detect:{allOf:function(e,t){var i=t.oLanguage.sDecimal;return b(e,i,!0,!0)},oneOf:function(e,t){var i=t.oLanguage.sDecimal;return b(e,i,!0,!1)}},order:{pre:function(e,t){var i=t.oLanguage.sDecimal;return Zt(e,i,_)}}}),h.type("num",{className:"dt-type-numeric",detect:{allOf:function(e,t){var i=t.oLanguage.sDecimal;return b(e,i,!1,!0)},oneOf:function(e,t){var i=t.oLanguage.sDecimal;return b(e,i,!1,!1)}},order:{pre:function(e,t){var i=t.oLanguage.sDecimal;return Zt(e,i)}}});var Zt=function(e,t,i,n){if(0!==e&&(!e||"-"===e))return-1/0;var r=typeof e;return"number"===r||"bigint"===r?e:(t&&(e=x(e,t)),e.replace&&(i&&(e=e.replace(i,"")),n&&(e=e.replace(n,""))),1*e)};function Jt(e,t,i){i&&(e[t]=i)}c.extend(!0,h.ext.renderer,{footer:{_:function(e,t,i){t.addClass(i.tfoot.cell)}},header:{_:function(e,t,i){t.addClass(i.thead.cell),e.oFeatures.bSort||t.addClass(i.order.none);var n=e.titleRow,r=t.closest("thead").find("tr"),s=t.parent().index();"disable"===t.attr("data-dt-order")||"disable"===t.parent().attr("data-dt-order")||!0===n&&0!==s||!1===n&&s!==r.length-1||"number"==typeof n&&s!==n||c(e.nTable).on("order.dt.DT column-visibility.dt.DT",function(n,r,s){if(e===r){var o=r.sortDetails;if(o){var a=S(o,"col");if("column-visibility"!==n.type||a.includes(s)){var l,c=i.order,h=r.api.columns(t),d=e.aoColumns[h.flatten()[0]],u=h.orderable().includes(!0),f="",p=h.indexes(),m=h.orderable(!0).flatten(),g=e.iTabIndex,_=r.orderHandler&&u;t.removeClass(c.isAsc+" "+c.isDesc).toggleClass(c.none,!u).toggleClass(c.canAsc,_&&m.includes("asc")).toggleClass(c.canDesc,_&&m.includes("desc"));var y=!0;for(l=0;l<p.length;l++)a.includes(p[l])||(y=!1);if(y){var v=h.order();t.addClass(v.includes("asc")?c.isAsc:""+v.includes("desc")?c.isDesc:"")}var x=-1;for(l=0;l<a.length;l++)if(e.aoColumns[a[l]].bVisible){x=a[l];break}if(p[0]==x){var b=o[0],w=d.asSorting;t.attr("aria-sort","asc"===b.dir?"ascending":"descending"),f=w[b.index+1]?"Reverse":"Remove"}else t.removeAttr("aria-sort");if(u){var T=t.find(".dt-column-order");T.attr("role","button").attr("aria-label",u?d.ariaTitle+r.api.i18n("oAria.orderable"+f):d.ariaTitle),-1!==g&&T.attr("tabindex",g)}}}}})}},layout:{_:function(e,t,i){var n=e.oClasses.layout,r=c("<div/>").attr("id",i.id||null).addClass(i.className||n.row).appendTo(t);h.ext.renderer.layout._forLayoutRow(i,function(e,t){if("id"!==e&&"className"!==e){var i="";t.table&&(r.addClass(n.tableRow),i+=n.tableCell+" "),i+="start"===e?n.start:"end"===e?n.end:n.full,c("<div/>").attr({id:t.id||null,class:t.className?t.className:n.cell+" "+i}).append(t.contents).appendTo(r)}})},_forLayoutRow:function(e,t){var i=function(e){switch(e){case"":return 0;case"start":return 1;case"end":return 2;default:return 3}};Object.keys(e).sort(function(e,t){return i(e)-i(t)}).forEach(function(i){t(i,e[i])})}}}),h.feature={},h.feature.register=function(e,t,i){h.ext.features[e]=t,i&&n.feature.push({cFeature:i,fnInit:t})},h.feature.register("div",function(e,t){var i=c("<div>")[0];return t&&(Jt(i,"className",t.className),Jt(i,"id",t.id),Jt(i,"innerHTML",t.html),Jt(i,"textContent",t.text)),i}),h.feature.register("info",function(e,t){if(!e.oFeatures.bInfo)return null;var i=e.oLanguage,n=e.sTableId,r=c("<div/>",{class:e.oClasses.info.container});return t=c.extend({callback:i.fnInfoCallback,empty:i.sInfoEmpty,postfix:i.sInfoPostFix,search:i.sInfoFiltered,text:i.sInfo},t),e.aoDrawCallback.push(function(e){!function(e,t,i){var n=e._iDisplayStart+1,r=e.fnDisplayEnd(),s=e.fnRecordsTotal(),o=e.fnRecordsDisplay(),a=o?t.text:t.empty;o!==s&&(a+=" "+t.search),a=lt(e,a+=t.postfix),t.callback&&(a=t.callback.call(e.oInstance,e,n,r,s,o,a)),i.html(a),rt(e,null,"info",[e,i[0],a])}(e,t,r)}),e._infoEl||(r.attr({"aria-live":"polite",id:n+"_info",role:"status"}),c(e.nTable).attr("aria-describedby",n+"_info"),e._infoEl=r),r},"i");var Kt=0;function Qt(e){var t=[];return e.numbers&&t.push("numbers"),e.previousNext&&(t.unshift("previous"),t.push("next")),e.firstLast&&(t.unshift("first"),t.push("last")),t}function ei(e,t,i){if(e._bInitComplete){var n=i.type?h.ext.pager[i.type]:Qt,r=e.oLanguage.oAria.paginate||{},s=e._iDisplayStart,o=e._iDisplayLength,a=e.fnRecordsDisplay(),l=-1===o,d=l?0:Math.ceil(s/o),u=l?1:Math.ceil(a/o),f=[],p=[],m=n(i).map(function(e){return"numbers"===e?ii(d,u,i.buttons,i.boundaryNumbers):e});f=f.concat.apply(f,m);for(var g=0;g<f.length;g++){var _=f[g],y=ti(e,_,d,u),v=ot(e,"pagingButton")(e,_,y.display,y.active,y.disabled),x="string"==typeof _?r[_]:r.number?r.number+(_+1):null;c(v.clicker).attr({"aria-controls":e.sTableId,"aria-disabled":y.disabled?"true":null,"aria-current":y.active?"page":null,"aria-label":x,"data-dt-idx":_,tabIndex:y.disabled?-1:e.iTabIndex&&"span"!==v.clicker[0].nodeName.toLowerCase()?e.iTabIndex:null}),"number"!=typeof _&&c(v.clicker).addClass(_),it(v.clicker,{action:_},function(t){t.preventDefault(),Re(e,t.data.action,!0)}),p.push(v.display)}var b=ot(e,"pagingContainer")(e,p),w=t.find(document.activeElement).data("dt-idx");if(t.empty().append(b),void 0!==w&&t.find("[data-dt-idx="+w+"]").trigger("focus"),p.length){var S=c(p[0]).outerHeight();i.buttons>1&&S>0&&c(t).height()>=2*S-10&&ei(e,t,c.extend({},i,{buttons:i.buttons-2}))}}}function ti(e,t,i,n){var r=e.oLanguage.oPaginate,s={display:"",active:!1,disabled:!1};switch(t){case"ellipsis":s.display="…";break;case"first":s.display=r.sFirst,0===i&&(s.disabled=!0);break;case"previous":s.display=r.sPrevious,0===i&&(s.disabled=!0);break;case"next":s.display=r.sNext,0!==n&&i!==n-1||(s.disabled=!0);break;case"last":s.display=r.sLast,0!==n&&i!==n-1||(s.disabled=!0);break;default:"number"==typeof t&&(s.display=e.fnFormatNumber(t+1),i===t&&(s.active=!0))}return s}function ii(e,t,i,n){var r=[],s=Math.floor(i/2),o=n?2:1,a=n?1:0;return t<=i?r=k(0,t):1===i?r=[e]:3===i?e<=1?r=[0,1,"ellipsis"]:e>=t-2?(r=k(t-2,t)).unshift("ellipsis"):r=["ellipsis",e,"ellipsis"]:e<=s?((r=k(0,i-o)).push("ellipsis"),n&&r.push(t-1)):e>=t-1-s?((r=k(t-(i-o),t)).unshift("ellipsis"),n&&r.unshift(0)):((r=k(e-s+o,e+s-a)).push("ellipsis"),r.unshift("ellipsis"),n&&(r.push(t-1),r.unshift(0))),r}h.feature.register("search",function(e,t){if(!e.oFeatures.bFilter)return null;var i=e.oClasses.search,n=e.sTableId,r=e.oLanguage,s=e.oPreviousSearch,o='<input type="search" class="'+i.input+'"/>';-1===(t=c.extend({placeholder:r.sSearchPlaceholder,processing:!1,text:r.sSearch},t)).text.indexOf("_INPUT_")&&(t.text+="_INPUT_"),t.text=lt(e,t.text);var a=t.text.match(/_INPUT_$/),l=t.text.match(/^_INPUT_/),d=t.text.replace(/_INPUT_/,""),u="<label>"+t.text+"</label>";l?u="_INPUT_<label>"+d+"</label>":a&&(u="<label>"+d+"</label>_INPUT_");var f=c("<div>").addClass(i.container).append(u.replace(/_INPUT_/,o));f.find("label").attr("for","dt-search-"+Kt),f.find("input").attr("id","dt-search-"+Kt),Kt++;var p=function(i){var n=this.value;s.return&&"Enter"!==i.key||n!=s.search&&ze(e,t.processing,function(){s.search=n,Me(e,s),e._iDisplayStart=0,ge(e)})},m=null!==e.searchDelay?e.searchDelay:0,g=c("input",f).val(s.search).attr("placeholder",t.placeholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",m?h.util.debounce(p,m):p).on("mouseup.DT",function(e){setTimeout(function(){p.call(g[0],e)},10)}).on("keypress.DT",function(e){if(13==e.keyCode)return!1}).attr("aria-controls",n);return c(e.nTable).on("search.dt.DT",function(t,i){e===i&&g[0]!==document.activeElement&&g.val("function"!=typeof s.search?s.search:"")}),f},"f"),h.feature.register("paging",function(e,t){if(!e.oFeatures.bPaginate)return null;t=c.extend({buttons:h.ext.pager.numbers_length,type:e.sPaginationType,boundaryNumbers:!0,firstLast:!0,previousNext:!0,numbers:!0},t);var i=c("<div/>").addClass(e.oClasses.paging.container+(t.type?" paging_"+t.type:"")).append(c("<nav>").attr("aria-label","pagination").addClass(e.oClasses.paging.nav)),n=function(){ei(e,i.children(),t)};return e.aoDrawCallback.push(n),c(e.nTable).on("column-sizing.dt.DT",n),i},"p");var ni=0;h.feature.register("pageLength",function(e,t){var i=e.oFeatures;if(!i.bPaginate||!i.bLengthChange)return null;t=c.extend({menu:e.aLengthMenu,text:e.oLanguage.sLengthMenu},t);var n,r=e.oClasses.length,s=e.sTableId,o=t.menu,a=[],l=[];if(Array.isArray(o[0]))a=o[0],l=o[1];else for(n=0;n<o.length;n++)c.isPlainObject(o[n])?(a.push(o[n].value),l.push(o[n].label)):(a.push(o[n]),l.push(o[n]));var h=t.text.match(/_MENU_$/),d=t.text.match(/^_MENU_/),u=t.text.replace(/_MENU_/,""),f="<label>"+t.text+"</label>";d?f="_MENU_<label>"+u+"</label>":h&&(f="<label>"+u+"</label>_MENU_");var p="tmp-"+ +new Date,m=c("<div/>").addClass(r.container).append(f.replace("_MENU_",'<span id="'+p+'"></span>')),g=[];Array.prototype.slice.call(m.find("label")[0].childNodes).forEach(function(e){e.nodeType===Node.TEXT_NODE&&g.push({el:e,text:e.textContent})});var _=function(t){g.forEach(function(i){i.el.textContent=lt(e,i.text,t)})},y=c("<select/>",{"aria-controls":s,class:r.select});for(n=0;n<a.length;n++){var v=e.api.i18n("lengthLabels."+a[n],null);null===v&&(v="number"==typeof l[n]?e.fnFormatNumber(l[n]):l[n]),y[0][n]=new Option(v,a[n])}return m.find("label").attr("for","dt-length-"+ni),y.attr("id","dt-length-"+ni),ni++,m.find("#"+p).replaceWith(y),c("select",m).val(e._iDisplayLength).on("change.DT",function(){Pe(e,c(this).val()),ge(e)}),c(e.nTable).on("length.dt.DT",function(t,i,n){e===i&&(c("select",m).val(n),_(n))}),_(e._iDisplayLength),m},"l"),c.fn.dataTable=h,h.$=c,c.fn.dataTableSettings=h.settings,c.fn.dataTableExt=h.ext,c.fn.DataTable=function(e){return c(this).dataTable(e).api()},c.each(h,function(e,t){c.fn.DataTable[e]=t});const ri=h;let si=a;si.extend(!0,ri.defaults,{renderer:"bootstrap"}),si.extend(!0,ri.ext.classes,{container:"dt-container dt-bootstrap5",search:{input:"form-control form-control-sm"},length:{select:"form-select form-select-sm"},processing:{container:"dt-processing card"},layout:{row:"row mt-2 justify-content-between",cell:"d-md-flex justify-content-between align-items-center",tableCell:"col-12",start:"dt-layout-start col-md-auto me-auto",end:"dt-layout-end col-md-auto ms-auto",full:"dt-layout-full col-md"}}),ri.ext.renderer.pagingButton.bootstrap=function(e,t,i,n,r){var s=["dt-paging-button","page-item"];n&&s.push("active"),r&&s.push("disabled");var o=si("<li>").addClass(s.join(" "));return{display:o,clicker:si("<button>",{class:"page-link",role:"link",type:"button"}).html(i).appendTo(o)}},ri.ext.renderer.pagingContainer.bootstrap=function(e,t){return si("<ul/>").addClass("pagination").append(t)};const oi=ri;var ai=i(5668);let li=a;var ci=function(e,t){if(!ai.A.versionCheck||!ai.A.versionCheck("2"))throw"DataTables Responsive requires DataTables 2 or newer";this.s={childNodeStore:{},columns:[],current:[],dt:new ai.A.Api(e)},this.s.dt.settings()[0].responsive||(t&&"string"==typeof t.details?t.details={type:t.details}:t&&!1===t.details?t.details={type:!1}:t&&!0===t.details&&(t.details={type:"inline"}),this.c=li.extend(!0,{},ci.defaults,ai.A.defaults.responsive,t),e.responsive=this,this._constructor())};li.extend(ci.prototype,{_constructor:function(){var e=this,t=this.s.dt,i=li(window).innerWidth();t.settings()[0]._responsive=this,li(window).on("orientationchange.dtr",ai.A.util.throttle(function(){var t=li(window).innerWidth();t!==i&&(e._resize(),i=t)})),t.on("row-created.dtr",function(i,n,r,s){-1!==li.inArray(!1,e.s.current)&&li(">td, >th",n).each(function(i){var n=t.column.index("toData",i);!1===e.s.current[n]&&li(this).css("display","none").addClass("dtr-hidden")})}),t.on("destroy.dtr",function(){t.off(".dtr"),li(t.table().body()).off(".dtr"),li(window).off("resize.dtr orientationchange.dtr"),t.cells(".dtr-control").nodes().to$().removeClass("dtr-control"),li(t.table().node()).removeClass("dtr-inline collapsed"),li.each(e.s.current,function(t,i){!1===i&&e._setColumnVis(t,!0)})}),this.c.breakpoints.sort(function(e,t){return e.width<t.width?1:e.width>t.width?-1:0}),this._classLogic();var n=this.c.details;!1!==n.type&&(e._detailsInit(),t.on("column-visibility.dtr",function(){e._timer&&clearTimeout(e._timer),e._timer=setTimeout(function(){e._timer=null,e._classLogic(),e._resizeAuto(),e._resize(!0),e._redrawChildren()},100)}),t.on("draw.dtr",function(){e._redrawChildren()}),li(t.table().node()).addClass("dtr-"+n.type)),t.on("column-calc.dt",function(t,i){for(var n=e.s.current,r=0;r<n.length;r++){var s=i.visible.indexOf(r);!1===n[r]&&s>=0&&i.visible.splice(s,1)}}),t.on("preXhr.dtr",function(){var i=[];t.rows().every(function(){this.child.isShown()&&i.push(this.id(!0))}),t.one("draw.dtr",function(){e._resizeAuto(),e._resize(),t.rows(i).every(function(){e._detailsDisplay(this,!1)})})}),t.on("draw.dtr",function(){t.page.info().serverSide&&(e.s.childNodeStore={}),e._controlClass()}).ready(function(){e._resizeAuto(),e._resize(),t.on("column-sizing.dtr",function(){e._resizeAuto(),e._resize()})}),t.on("column-reorder.dtr",function(t,i,n){e._classLogic(),e._resizeAuto(),e._resize(!0)})},_colGroupAttach:function(e,t,i){var n=null;if(t[i].get(0).parentNode!==e[0]){for(var r=i+1;r<t.length;r++)if(e[0]===t[r].get(0).parentNode){n=r;break}null!==n?t[i].insertBefore(t[n][0]):e.append(t[i])}},_childNodes:function(e,t,i){var n=t+"-"+i;if(this.s.childNodeStore[n])return this.s.childNodeStore[n];for(var r=[],s=e.cell(t,i).node().childNodes,o=0,a=s.length;o<a;o++)r.push(s[o]);return this.s.childNodeStore[n]=r,r},_childNodesRestore:function(e,t,i){var n=t+"-"+i;if(this.s.childNodeStore[n]){var r=e.cell(t,i).node(),s=this.s.childNodeStore[n];if(s.length>0){for(var o=s[0].parentNode.childNodes,a=[],l=0,c=o.length;l<c;l++)a.push(o[l]);for(var h=0,d=a.length;h<d;h++)r.appendChild(a[h]),console.log("restore",n,r,a[h])}this.s.childNodeStore[n]=void 0}},_columnsVisibility:function(e){var t,i,n=this.s.dt,r=this.s.columns,s=r.map(function(e,t){return{columnIdx:t,priority:e.priority}}).sort(function(e,t){return e.priority!==t.priority?e.priority-t.priority:e.columnIdx-t.columnIdx}),o=li.map(r,function(t,i){return!1===n.column(i).visible()?"not-visible":(!t.auto||null!==t.minWidth)&&(!0===t.auto?"-":-1!==li.inArray(e,t.includeIn))}),a=0;for(t=0,i=o.length;t<i;t++)!0===o[t]&&(a+=r[t].minWidth);var l=n.settings()[0].oScroll,c=l.sY||l.sX?l.iBarWidth:0,h=n.table().container().offsetWidth-c-a;for(t=0,i=o.length;t<i;t++)r[t].control&&(h-=r[t].minWidth);var d=!1;for(t=0,i=s.length;t<i;t++){var u=s[t].columnIdx;"-"===o[u]&&!r[u].control&&r[u].minWidth&&(d||h-r[u].minWidth<0?(d=!0,o[u]=!1):o[u]=!0,h-=r[u].minWidth)}var f=!1;for(t=0,i=r.length;t<i;t++)if(!r[t].control&&!r[t].never&&!1===o[t]){f=!0;break}for(t=0,i=r.length;t<i;t++)r[t].control&&(o[t]=f),"not-visible"===o[t]&&(o[t]=!1);return-1===li.inArray(!0,o)&&(o[0]=!0),o},_classLogic:function(){var e=this,t=this.c.breakpoints,i=this.s.dt.columns().eq(0).map(function(e){var t=this.column(e),i=t.header().className,n=t.init().responsivePriority,r=t.header().getAttribute("data-priority");return void 0===n&&(n=null==r?1e4:1*r),{className:i,includeIn:[],auto:!1,control:!1,never:!!i.match(/\b(dtr\-)?never\b/),priority:n}}),n=function(e,t){var n=i[e].includeIn;-1===li.inArray(t,n)&&n.push(t)},r=function(r,s,o,a){var l,c,h;if(o){if("max-"===o)for(l=e._find(s).width,c=0,h=t.length;c<h;c++)t[c].width<=l&&n(r,t[c].name);else if("min-"===o)for(l=e._find(s).width,c=0,h=t.length;c<h;c++)t[c].width>=l&&n(r,t[c].name);else if("not-"===o)for(c=0,h=t.length;c<h;c++)-1===t[c].name.indexOf(a)&&n(r,t[c].name)}else i[r].includeIn.push(s)};i.each(function(e,i){for(var n=e.className.split(" "),s=!1,o=0,a=n.length;o<a;o++){var l=n[o].trim();if("all"===l||"dtr-all"===l)return s=!0,void(e.includeIn=li.map(t,function(e){return e.name}));if("none"===l||"dtr-none"===l||e.never)return void(s=!0);if("control"===l||"dtr-control"===l)return s=!0,void(e.control=!0);li.each(t,function(e,t){var n=t.name.split("-"),o=new RegExp("(min\\-|max\\-|not\\-)?("+n[0]+")(\\-[_a-zA-Z0-9])?"),a=l.match(o);a&&(s=!0,a[2]===n[0]&&a[3]==="-"+n[1]?r(i,t.name,a[1],a[2]+a[3]):a[2]!==n[0]||a[3]||r(i,t.name,a[1],a[2]))})}s||(e.auto=!0)}),this.s.columns=i},_controlClass:function(){if("inline"===this.c.details.type){var e=this.s.dt,t=this.s.current,i=li.inArray(!0,t);e.cells(null,function(e){return e!==i},{page:"current"}).nodes().to$().filter(".dtr-control").removeClass("dtr-control"),i>=0&&e.cells(null,i,{page:"current"}).nodes().to$().addClass("dtr-control")}this._tabIndexes()},_detailsDisplay:function(e,t){var i=this,n=this.s.dt,r=this.c.details,s=function(i){li(e.node()).toggleClass("dtr-expanded",!1!==i),li(n.table().node()).triggerHandler("responsive-display.dt",[n,e,i,t])};if(r&&!1!==r.type){var o="string"==typeof r.renderer?ci.renderer[r.renderer]():r.renderer,a=r.display(e,t,function(){return o.call(i,n,e[0][0],i._detailsObj(e[0]))},function(){s(!1)});"boolean"==typeof a&&s(a)}},_detailsInit:function(){var e=this,t=this.s.dt,i=this.c.details;"inline"===i.type&&(i.target="td.dtr-control, th.dtr-control"),li(t.table().body()).on("keyup.dtr","td, th",function(e){13===e.keyCode&&li(this).data("dtr-keyboard")&&li(this).click()});var n=i.target,r="string"==typeof n?n:"td, th";void 0===n&&null===n||li(t.table().body()).on("click.dtr mousedown.dtr mouseup.dtr",r,function(i){if(li(t.table().node()).hasClass("collapsed")&&-1!==li.inArray(li(this).closest("tr").get(0),t.rows().nodes().toArray())){if("number"==typeof n){var r=n<0?t.columns().eq(0).length+n:n;if(t.cell(this).index().column!==r)return}var s=t.row(li(this).closest("tr"));"click"===i.type?e._detailsDisplay(s,!1):"mousedown"===i.type?li(this).css("outline","none"):"mouseup"===i.type&&li(this).trigger("blur").css("outline","")}})},_detailsObj:function(e){var t=this,i=this.s.dt,n=[];let r=i.settings()[0];return li.map(this.s.columns,function(s,o){if(!s.never&&!s.control){var a=r.aoColumns[o];return n[o]||(n[o]=i.column(o)),{className:a.sClass,columnIndex:o,data:r.fastData(e,o,t.c.orthogonal),hidden:n[o].visible()&&!t.s.current[o],rowIndex:e,title:n[o].title()}}})},_find:function(e){for(var t=this.c.breakpoints,i=0,n=t.length;i<n;i++)if(t[i].name===e)return t[i]},_redrawChildren:function(){var e=this,t=this.s.dt;t.rows({page:"current"}).iterator("row",function(i,n){e._detailsDisplay(t.row(n),!0)})},_resize:function(e){var t,i,n=this,r=this.s.dt,s=li(window).innerWidth(),o=this.c.breakpoints,a=o[0].name,l=this.s.columns,c=this.s.current.slice();for(t=o.length-1;t>=0;t--)if(s<=o[t].width){a=o[t].name;break}var h=this._columnsVisibility(a);this.s.current=h;var d=!1;for(t=0,i=l.length;t<i;t++)if(!1===h[t]&&!l[t].never&&!l[t].control&&0==!r.column(t).visible()){d=!0;break}li(r.table().node()).toggleClass("collapsed",d);var u=!1,f=0,p=r.settings()[0],m=li(r.table().node()).children("colgroup"),g=p.aoColumns.map(function(e){return e.colEl});r.columns().eq(0).each(function(t,i){r.column(t).visible()&&(!0===h[i]&&f++,(e||h[i]!==c[i])&&(u=!0,n._setColumnVis(t,h[i])),h[i]?n._colGroupAttach(m,g,i):g[i].detach())}),u&&(r.columns.adjust(),this._redrawChildren(),li(r.table().node()).trigger("responsive-resize.dt",[r,this._responsiveOnlyHidden()]),0===r.page.info().recordsDisplay&&li("td",r.table().body()).eq(0).attr("colspan",f)),n._controlClass()},_resizeAuto:function(){var e=this.s.dt,t=this.s.columns,i=this,n=e.columns().indexes().filter(function(t){return e.column(t).visible()});if(this.c.auto&&-1!==li.inArray(!0,li.map(t,function(e){return e.auto}))){var r=e.table().node().cloneNode(!1),s=li(e.table().header().cloneNode(!1)).appendTo(r),o=li(e.table().footer().cloneNode(!1)).appendTo(r),a=li(e.table().body()).clone(!1,!1).empty().appendTo(r);r.style.width="auto",e.table().header.structure(n).forEach(e=>{var t=e.filter(function(e){return!!e}).map(function(e){return li(e.cell).clone(!1).css("display","table-cell").css("width","auto").css("min-width",0)});li("<tr/>").append(t).appendTo(s)});for(var l=li("<tr/>").appendTo(a),c=0;c<n.count();c++)l.append("<td/>");this.c.details.renderer._responsiveMovesNodes?e.rows({page:"current"}).every(function(t){var r=this.node();if(r){var s=r.cloneNode(!1);e.cells(t,n).every(function(e,n){var r=i.s.childNodeStore[t+"-"+n];r?li(this.node().cloneNode(!1)).append(li(r).clone()).appendTo(s):li(this.node()).clone(!1).appendTo(s)}),a.append(s)}}):li(a).append(li(e.rows({page:"current"}).nodes()).clone(!1)).find("th, td").css("display",""),a.find("th, td").css("display",""),e.table().footer.structure(n).forEach(e=>{var t=e.filter(function(e){return!!e}).map(function(e){return li(e.cell).clone(!1).css("display","table-cell").css("width","auto").css("min-width",0)});li("<tr/>").append(t).appendTo(o)}),"inline"===this.c.details.type&&li(r).addClass("dtr-inline collapsed"),li(r).find("[name]").removeAttr("name"),li(r).css("position","relative");var h=li("<div/>").css({width:1,height:1,overflow:"hidden",clear:"both"}).append(r);h.insertBefore(e.table().node()),l.children().each(function(i){var n=e.column.index("fromVisible",i);t[n].minWidth=this.offsetWidth||0}),h.remove()}},_responsiveOnlyHidden:function(){var e=this.s.dt;return li.map(this.s.current,function(t,i){return!1===e.column(i).visible()||t})},_setColumnVis:function(e,t){var i=this,n=this.s.dt,r=t?"":"none";this._setHeaderVis(e,t,n.table().header.structure()),this._setHeaderVis(e,t,n.table().footer.structure()),n.column(e).nodes().to$().css("display",r).toggleClass("dtr-hidden",!t),li.isEmptyObject(this.s.childNodeStore)||n.cells(null,e).indexes().each(function(e){i._childNodesRestore(n,e.row,e.column)})},_setHeaderVis:function(e,t,i){var n=this,r=t?"":"none";i.forEach(function(e,t){for(var n=0;n<e.length;n++)if(e[n]&&e[n].rowspan>1)for(var r=e[n].rowspan,s=1;s<r;s++)i[t+s][n]={}}),i.forEach(function(i){if(i[e]&&i[e].cell)li(i[e].cell).css("display",r).toggleClass("dtr-hidden",!t);else for(var s=e;s>=0;){if(i[s]&&i[s].cell){i[s].cell.colSpan=n._colspan(i,s);break}s--}})},_colspan:function(e,t){for(var i=1,n=t+1;n<e.length;n++)if(null===e[n]&&this.s.current[n])i++;else if(e[n])break;return i},_tabIndexes:function(){var e=this.s.dt,t=e.cells({page:"current"}).nodes().to$(),i=e.settings()[0],n=this.c.details.target;if(t.filter("[data-dtr-keyboard]").removeData("[data-dtr-keyboard]"),"number"==typeof n)e.cells(null,n,{page:"current"}).nodes().to$().attr("tabIndex",i.iTabIndex).data("dtr-keyboard",1);else{"td:first-child, th:first-child"===n&&(n=">td:first-child, >th:first-child");var r=e.rows({page:"current"}).nodes();("tr"===n?li(r):li(n,r)).attr("tabIndex",i.iTabIndex).data("dtr-keyboard",1)}}}),ci.breakpoints=[{name:"desktop",width:1/0},{name:"tablet-l",width:1024},{name:"tablet-p",width:768},{name:"mobile-l",width:480},{name:"mobile-p",width:320}],ci.display={childRow:function(e,t,i){var n=li(e.node());if(!t){if(n.hasClass("dtr-expanded"))return e.child(!1),!1;var r=i();return!1!==r&&(e.child(r,"child").show(),!0)}if(n.hasClass("dtr-expanded"))return e.child(i(),"child").show(),!0},childRowImmediate:function(e,t,i){var n=li(e.node());if(!t&&n.hasClass("dtr-expanded")||!e.responsive.hasHidden())return e.child(!1),!1;var r=i();return!1!==r&&(e.child(r,"child").show(),!0)},modal:function(e){return function(t,i,n,r){var s,o=n();if(!1===o)return!1;if(i){if(!(s=li("div.dtr-modal-content")).length||t.index()!==s.data("dtr-row-idx"))return null;s.empty().append(o)}else{var a=function(){s.remove(),li(document).off("keypress.dtr"),li(t.node()).removeClass("dtr-expanded"),r()};s=li('<div class="dtr-modal"/>').append(li('<div class="dtr-modal-display"/>').append(li('<div class="dtr-modal-content"/>').data("dtr-row-idx",t.index()).append(o)).append(li('<div class="dtr-modal-close">×</div>').click(function(){a()}))).append(li('<div class="dtr-modal-background"/>').click(function(){a()})).appendTo("body"),li(t.node()).addClass("dtr-expanded"),li(document).on("keyup.dtr",function(e){27===e.keyCode&&(e.stopPropagation(),a())})}return e&&e.header&&li("div.dtr-modal-content").prepend("<h2>"+e.header(t)+"</h2>"),!0}}},ci.renderer={listHiddenNodes:function(){var e=function(e,t,i){var n=this,r=li('<ul data-dtr-index="'+t+'" class="dtr-details"/>'),s=!1;return li.each(i,function(t,i){if(i.hidden){var o=i.className?'class="'+i.className+'"':"";li("<li "+o+' data-dtr-index="'+i.columnIndex+'" data-dt-row="'+i.rowIndex+'" data-dt-column="'+i.columnIndex+'"><span class="dtr-title">'+i.title+"</span> </li>").append(li('<span class="dtr-data"/>').append(n._childNodes(e,i.rowIndex,i.columnIndex))).appendTo(r),s=!0}}),!!s&&r};return e._responsiveMovesNodes=!0,e},listHidden:function(){return function(e,t,i){var n=li.map(i,function(e){var t=e.className?'class="'+e.className+'"':"";return e.hidden?"<li "+t+' data-dtr-index="'+e.columnIndex+'" data-dt-row="'+e.rowIndex+'" data-dt-column="'+e.columnIndex+'"><span class="dtr-title">'+e.title+'</span> <span class="dtr-data">'+e.data+"</span></li>":""}).join("");return!!n&&li('<ul data-dtr-index="'+t+'" class="dtr-details"/>').append(n)}},tableAll:function(e){return e=li.extend({tableClass:""},e),function(t,i,n){var r=li.map(n,function(e){return"<tr "+(e.className?'class="'+e.className+'"':"")+' data-dt-row="'+e.rowIndex+'" data-dt-column="'+e.columnIndex+'"><td>'+(""!==e.title?e.title+":":"")+"</td> <td>"+e.data+"</td></tr>"}).join("");return li('<table class="'+e.tableClass+' dtr-details" width="100%"/>').append(r)}}},ci.defaults={breakpoints:ci.breakpoints,auto:!0,details:{display:ci.display.childRow,renderer:ci.renderer.listHidden(),target:0,type:"inline"},orthogonal:"display"};var hi=li.fn.dataTable.Api;hi.register("responsive()",function(){return this}),hi.register("responsive.index()",function(e){return{column:(e=li(e)).data("dtr-index"),row:e.parent().data("dtr-index")}}),hi.register("responsive.rebuild()",function(){return this.iterator("table",function(e){e._responsive&&e._responsive._classLogic()})}),hi.register("responsive.recalc()",function(){return this.iterator("table",function(e){e._responsive&&(e._responsive._resizeAuto(),e._responsive._resize())})}),hi.register("responsive.hasHidden()",function(){var e=this.context[0];return!!e._responsive&&-1!==li.inArray(!1,e._responsive._responsiveOnlyHidden())}),hi.registerPlural("columns().responsiveHidden()","column().responsiveHidden()",function(){return this.iterator("column",function(e,t){return!!e._responsive&&e._responsive._responsiveOnlyHidden()[t]},1)}),ci.version="3.0.6",li.fn.dataTable.Responsive=ci,li.fn.DataTable.Responsive=ci,li(document).on("preInit.dt.dtr",function(e,t,i){if("dt"===e.namespace&&(li(t.nTable).hasClass("responsive")||li(t.nTable).hasClass("dt-responsive")||t.oInit.responsive||ai.A.defaults.responsive)){var n=t.oInit.responsive;!1!==n&&new ci(t,li.isPlainObject(n)?n:{})}});var di=i(9875);let ui=a;var fi,pi=oi.Responsive.display,mi=pi.modal,gi=ui('<div class="modal fade dtr-bs-modal" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body"/></div></div></div>'),_i=di;oi.Responsive.bootstrap=function(e){_i=e},pi.modal=function(e){if(!fi&&_i.Modal){let e=function(){let e=oi.use("bootstrap");if(e)return e;if(_i)return _i;throw new Error("No Bootstrap library. Set it with `DataTable.use(bootstrap);`")}();fi=new e.Modal(gi[0])}return function(t,i,n,r){if(fi){var s=n();if(!1===s)return!1;if(i){if(!ui.contains(document,gi[0])||t.index()!==gi.data("dtr-row-idx"))return null;gi.find("div.modal-body").empty().append(s)}else{if(e&&e.header){var o=gi.find("div.modal-header"),a=o.find("button").detach();o.empty().append('<h4 class="modal-title">'+e.header(t)+"</h4>").append(a)}gi.find("div.modal-body").empty().append(s),gi.data("dtr-row-idx",t.index()).one("hidden.bs.modal",r).appendTo("body"),fi.show()}return!0}return mi(t,i,n,r)}}},7892:function(e,t,i){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(i(5093))},7935:(e,t)=>{var i,n;void 0===(n="function"==typeof(i=function(){"use strict";var e=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function t(e){return e.split("").reverse().join("")}function i(e,t){return e.substring(0,t.length)===t}function n(e,t,i){if((e[t]||e[i])&&e[t]===e[i])throw new Error(t)}function r(e){return"number"==typeof e&&isFinite(e)}function s(e,i,n,s,o,a,l,c,h,d,u,f){var p,m,g,_,y,v=f,x="",b="";return a&&(f=a(f)),!!r(f)&&(!1!==e&&0===parseFloat(f.toFixed(e))&&(f=0),f<0&&(p=!0,f=Math.abs(f)),!1!==e&&(y=e,_=(_=f).toString().split("e"),f=(+((_=(_=Math.round(+(_[0]+"e"+(_[1]?+_[1]+y:y)))).toString().split("e"))[0]+"e"+(_[1]?+_[1]-y:-y))).toFixed(y)),-1!==(f=f.toString()).indexOf(".")?(g=(m=f.split("."))[0],n&&(x=n+m[1])):g=f,i&&(g=t(g).match(/.{1,3}/g),g=t(g.join(t(i)))),p&&c&&(b+=c),s&&(b+=s),p&&h&&(b+=h),b+=g,b+=x,o&&(b+=o),d&&(b=d(b,v)),b)}function o(e,t,n,s,o,a,l,c,h,d,u,f){var p,m="";return u&&(f=u(f)),!(!f||"string"!=typeof f)&&(c&&i(f,c)&&(f=f.replace(c,""),p=!0),s&&i(f,s)&&(f=f.replace(s,"")),h&&i(f,h)&&(f=f.replace(h,""),p=!0),o&&function(e,t){return e.slice(-1*t.length)===t}(f,o)&&(f=f.slice(0,-1*o.length)),t&&(f=f.split(t).join("")),n&&(f=f.replace(n,".")),p&&(m+="-"),""!==(m=(m+=f).replace(/[^0-9\.\-.]/g,""))&&(m=Number(m),l&&(m=l(m)),!!r(m)&&m))}function a(t,i,n){var r,s=[];for(r=0;r<e.length;r+=1)s.push(t[e[r]]);return s.push(n),i.apply("",s)}return function t(i){if(!(this instanceof t))return new t(i);"object"==typeof i&&(i=function(t){var i,r,s,o={};for(void 0===t.suffix&&(t.suffix=t.postfix),i=0;i<e.length;i+=1)if(void 0===(s=t[r=e[i]]))"negative"!==r||o.negativeBefore?"mark"===r&&"."!==o.thousand?o[r]=".":o[r]=!1:o[r]="-";else if("decimals"===r){if(!(s>=0&&s<8))throw new Error(r);o[r]=s}else if("encoder"===r||"decoder"===r||"edit"===r||"undo"===r){if("function"!=typeof s)throw new Error(r);o[r]=s}else{if("string"!=typeof s)throw new Error(r);o[r]=s}return n(o,"mark","thousand"),n(o,"prefix","negative"),n(o,"prefix","negativeBefore"),o}(i),this.to=function(e){return a(i,s,e)},this.from=function(e){return a(i,o,e)})}})?i.apply(t,[]):i)||(e.exports=n)},7950:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var n=i(7363),r=i(8817),s=(0,n.i1)({name:"@fullcalendar/daygrid",initialView:"dayGridMonth",views:{dayGrid:{component:r.eu,dateProfileGeneratorClass:r.LH},dayGridDay:{type:"dayGrid",duration:{days:1}},dayGridWeek:{type:"dayGrid",duration:{weeks:1}},dayGridMonth:{type:"dayGrid",duration:{months:1},fixedWeekCount:!0},dayGridYear:{type:"dayGrid",duration:{years:1}}}})},8076:function(e,t,i){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,i,n){var r=t.words[n];return 1===n.length?i?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(i(5093))},8101:(e,t,i)=>{"use strict";function n(e){return e.split("-")[1]}i.d(t,{A:()=>n})},8174:function(e,t,i){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},i={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},n=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:n,monthsShort:n,weekdays:"یهكشهممه_دووشهممه_سێشهممه_چوارشهممه_پێنجشهممه_ههینی_شهممه".split("_"),weekdaysShort:"یهكشهم_دووشهم_سێشهم_چوارشهم_پێنجشهم_ههینی_شهممه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره|بهیانی/,isPM:function(e){return/ئێواره/.test(e)},meridiem:function(e,t,i){return e<12?"بهیانی":"ئێواره"},calendar:{sameDay:"[ئهمرۆ كاتژمێر] LT",nextDay:"[بهیانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له %s",past:"%s",s:"چهند چركهیهك",ss:"چركه %d",m:"یهك خولهك",mm:"%d خولهك",h:"یهك كاتژمێر",hh:"%d كاتژمێر",d:"یهك ڕۆژ",dd:"%d ڕۆژ",M:"یهك مانگ",MM:"%d مانگ",y:"یهك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return i[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})}(i(5093))},8235:function(e,t,i){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},i={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,i){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(i(5093))},8256:(e,t,i)=>{"use strict";i.d(t,{A:()=>u});var n=i(2632),r=i(6979),s=i(5446),o=i(5128),a=i(9703),l=i(6523),c=i(4318),h=i(1007),d=i(4278);const u={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,s=e.name,u=e.options,f=i.elements.arrow,p=i.modifiersData.popperOffsets,m=(0,n.A)(i.placement),g=(0,a.A)(m),_=[d.kb,d.pG].indexOf(m)>=0?"height":"width";if(f&&p){var y=function(e,t){return e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e,(0,c.A)("number"!=typeof e?e:(0,h.A)(e,d.OM))}(u.padding,i),v=(0,r.A)(f),x="y"===g?d.Mn:d.kb,b="y"===g?d.sQ:d.pG,w=i.rects.reference[_]+i.rects.reference[g]-p[g]-i.rects.popper[_],S=p[g]-i.rects.reference[g],T=(0,o.A)(f),k=T?"y"===g?T.clientHeight||0:T.clientWidth||0:0,M=w/2-S/2,A=y[x],C=k-v[_]-y[b],D=k/2-v[_]/2+M,L=(0,l.u)(A,D,C),E=g;i.modifiersData[s]=((t={})[E]=L,t.centerOffset=L-D,t)}},effect:function(e){var t=e.state,i=e.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&(0,s.A)(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]}},8298:function(e,t,i){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(i(5093))},8303:function(e,t,i){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(i(5093))},8383:function(e,t,i){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){return 0===this.day()?"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT":"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(i(5093))},8414:function(e,t,i){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,i){var n=100*e+t;return n<600?"يېرىم كېچە":n<900?"سەھەر":n<1130?"چۈشتىن بۇرۇن":n<1230?"چۈش":n<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(i(5093))},8465:function(e){e.exports=function(){"use strict";function e(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}function t(t,i){return t.get(e(t,i))}function i(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}const n={},r=e=>new Promise(t=>{if(!e)return t();const i=window.scrollX,r=window.scrollY;n.restoreFocusTimeout=setTimeout(()=>{n.previousActiveElement instanceof HTMLElement?(n.previousActiveElement.focus(),n.previousActiveElement=null):document.body&&document.body.focus(),t()},100),window.scrollTo(i,r)}),s="swal2-",o=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error","draggable","dragging"].reduce((e,t)=>(e[t]=s+t,e),{}),a=["success","warning","info","question","error"].reduce((e,t)=>(e[t]=s+t,e),{}),l="SweetAlert2:",c=e=>e.charAt(0).toUpperCase()+e.slice(1),h=e=>{console.warn(`${l} ${"object"==typeof e?e.join(" "):e}`)},d=e=>{console.error(`${l} ${e}`)},u=[],f=(e,t=null)=>{var i;i=`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`,u.includes(i)||(u.push(i),h(i))},p=e=>"function"==typeof e?e():e,m=e=>e&&"function"==typeof e.toPromise,g=e=>m(e)?e.toPromise():Promise.resolve(e),_=e=>e&&Promise.resolve(e)===e,y=()=>document.body.querySelector(`.${o.container}`),v=e=>{const t=y();return t?t.querySelector(e):null},x=e=>v(`.${e}`),b=()=>x(o.popup),w=()=>x(o.icon),S=()=>x(o.title),T=()=>x(o["html-container"]),k=()=>x(o.image),M=()=>x(o["progress-steps"]),A=()=>x(o["validation-message"]),C=()=>v(`.${o.actions} .${o.confirm}`),D=()=>v(`.${o.actions} .${o.cancel}`),L=()=>v(`.${o.actions} .${o.deny}`),E=()=>v(`.${o.loader}`),I=()=>x(o.actions),P=()=>x(o.footer),R=()=>x(o["timer-progress-bar"]),O=()=>x(o.close),z=()=>{const e=b();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),i=Array.from(t).sort((e,t)=>{const i=parseInt(e.getAttribute("tabindex")||"0"),n=parseInt(t.getAttribute("tabindex")||"0");return i>n?1:i<n?-1:0}),n=e.querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n'),r=Array.from(n).filter(e=>"-1"!==e.getAttribute("tabindex"));return[...new Set(i.concat(r))].filter(e=>ee(e))},F=()=>B(document.body,o.shown)&&!B(document.body,o["toast-shown"])&&!B(document.body,o["no-backdrop"]),N=()=>{const e=b();return!!e&&B(e,o.toast)},Y=(e,t)=>{if(e.textContent="",t){const i=(new DOMParser).parseFromString(t,"text/html"),n=i.querySelector("head");n&&Array.from(n.childNodes).forEach(t=>{e.appendChild(t)});const r=i.querySelector("body");r&&Array.from(r.childNodes).forEach(t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)})}},B=(e,t)=>{if(!t)return!1;const i=t.split(/\s+/);for(let t=0;t<i.length;t++)if(!e.classList.contains(i[t]))return!1;return!0},H=(e,t,i)=>{if(((e,t)=>{Array.from(e.classList).forEach(i=>{Object.values(o).includes(i)||Object.values(a).includes(i)||Object.values(t.showClass||{}).includes(i)||e.classList.remove(i)})})(e,t),!t.customClass)return;const n=t.customClass[i];n&&("string"==typeof n||n.forEach?U(e,n):h(`Invalid type of customClass.${i}! Expected string or iterable object, got "${typeof n}"`))},j=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${o.popup} > .${o[t]}`);case"checkbox":return e.querySelector(`.${o.popup} > .${o.checkbox} input`);case"radio":return e.querySelector(`.${o.popup} > .${o.radio} input:checked`)||e.querySelector(`.${o.popup} > .${o.radio} input:first-child`);case"range":return e.querySelector(`.${o.popup} > .${o.range} input`);default:return e.querySelector(`.${o.popup} > .${o.input}`)}},V=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},W=(e,t,i)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(t=>{Array.isArray(e)?e.forEach(e=>{i?e.classList.add(t):e.classList.remove(t)}):i?e.classList.add(t):e.classList.remove(t)}))},U=(e,t)=>{W(e,t,!0)},$=(e,t)=>{W(e,t,!1)},G=(e,t)=>{const i=Array.from(e.children);for(let e=0;e<i.length;e++){const n=i[e];if(n instanceof HTMLElement&&B(n,t))return n}},X=(e,t,i)=>{i===`${parseInt(i)}`&&(i=parseInt(i)),i||0===parseInt(i)?e.style.setProperty(t,"number"==typeof i?`${i}px`:i):e.style.removeProperty(t)},q=(e,t="flex")=>{e&&(e.style.display=t)},Z=e=>{e&&(e.style.display="none")},J=(e,t="block")=>{e&&new MutationObserver(()=>{Q(e,e.innerHTML,t)}).observe(e,{childList:!0,subtree:!0})},K=(e,t,i,n)=>{const r=e.querySelector(t);r&&r.style.setProperty(i,n)},Q=(e,t,i="flex")=>{t?q(e,i):Z(e)},ee=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),te=e=>!!(e.scrollHeight>e.clientHeight),ie=e=>{const t=window.getComputedStyle(e),i=parseFloat(t.getPropertyValue("animation-duration")||"0"),n=parseFloat(t.getPropertyValue("transition-duration")||"0");return i>0||n>0},ne=(e,t=!1)=>{const i=R();i&&ee(i)&&(t&&(i.style.transition="none",i.style.width="100%"),setTimeout(()=>{i.style.transition=`width ${e/1e3}s linear`,i.style.width="0%"},10))},re=`\n <div aria-labelledby="${o.title}" aria-describedby="${o["html-container"]}" class="${o.popup}" tabindex="-1">\n <button type="button" class="${o.close}"></button>\n <ul class="${o["progress-steps"]}"></ul>\n <div class="${o.icon}"></div>\n <img class="${o.image}" />\n <h2 class="${o.title}" id="${o.title}"></h2>\n <div class="${o["html-container"]}" id="${o["html-container"]}"></div>\n <input class="${o.input}" id="${o.input}" />\n <input type="file" class="${o.file}" />\n <div class="${o.range}">\n <input type="range" />\n <output></output>\n </div>\n <select class="${o.select}" id="${o.select}"></select>\n <div class="${o.radio}"></div>\n <label class="${o.checkbox}">\n <input type="checkbox" id="${o.checkbox}" />\n <span class="${o.label}"></span>\n </label>\n <textarea class="${o.textarea}" id="${o.textarea}"></textarea>\n <div class="${o["validation-message"]}" id="${o["validation-message"]}"></div>\n <div class="${o.actions}">\n <div class="${o.loader}"></div>\n <button type="button" class="${o.confirm}"></button>\n <button type="button" class="${o.deny}"></button>\n <button type="button" class="${o.cancel}"></button>\n </div>\n <div class="${o.footer}"></div>\n <div class="${o["timer-progress-bar-container"]}">\n <div class="${o["timer-progress-bar"]}"></div>\n </div>\n </div>\n`.replace(/(^|\n)\s*/g,""),se=()=>{n.currentInstance.resetValidationMessage()},oe=e=>{const t=(()=>{const e=y();return!!e&&(e.remove(),$([document.documentElement,document.body],[o["no-backdrop"],o["toast-shown"],o["has-column"]]),!0)})();if("undefined"==typeof window||"undefined"==typeof document)return void d("SweetAlert2 requires document to initialize");const i=document.createElement("div");i.className=o.container,t&&U(i,o["no-transition"]),Y(i,re),i.dataset.swal2Theme=e.theme;const n="string"==typeof(r=e.target)?document.querySelector(r):r;var r;n.appendChild(i),e.topLayer&&(i.setAttribute("popover",""),i.showPopover()),(e=>{const t=b();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&U(y(),o.rtl)})(n),(()=>{const e=b(),t=G(e,o.input),i=G(e,o.file),n=e.querySelector(`.${o.range} input`),r=e.querySelector(`.${o.range} output`),s=G(e,o.select),a=e.querySelector(`.${o.checkbox} input`),l=G(e,o.textarea);t.oninput=se,i.onchange=se,s.onchange=se,a.onchange=se,l.oninput=se,n.oninput=()=>{se(),r.value=n.value},n.onchange=()=>{se(),r.value=n.value}})()},ae=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?le(e,t):e&&Y(t,e)},le=(e,t)=>{e.jquery?ce(t,e):Y(t,e.toString())},ce=(e,t)=>{if(e.textContent="",0 in t)for(let i=0;i in t;i++)e.appendChild(t[i].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},he=(e,t)=>{const i=I(),n=E();i&&n&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?q(i):Z(i),H(i,t,"actions"),function(e,t,i){const n=C(),r=L(),s=D();n&&r&&s&&(ue(n,"confirm",i),ue(r,"deny",i),ue(s,"cancel",i),function(e,t,i,n){n.buttonsStyling?(U([e,t,i],o.styled),n.confirmButtonColor&&e.style.setProperty("--swal2-confirm-button-background-color",n.confirmButtonColor),n.denyButtonColor&&t.style.setProperty("--swal2-deny-button-background-color",n.denyButtonColor),n.cancelButtonColor&&i.style.setProperty("--swal2-cancel-button-background-color",n.cancelButtonColor),de(e),de(t),de(i)):$([e,t,i],o.styled)}(n,r,s,i),i.reverseButtons&&(i.toast?(e.insertBefore(s,n),e.insertBefore(r,n)):(e.insertBefore(s,t),e.insertBefore(r,t),e.insertBefore(n,t))))}(i,n,t),Y(n,t.loaderHtml||""),H(n,t,"loader"))};function de(e){const t=window.getComputedStyle(e);if(t.getPropertyValue("--swal2-action-button-focus-box-shadow"))return;const i=t.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/,"rgba($1, $2, $3, 0.5)");e.style.setProperty("--swal2-action-button-focus-box-shadow",t.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/,` ${i}`))}function ue(e,t,i){const n=c(t);Q(e,i[`show${n}Button`],"inline-block"),Y(e,i[`${t}ButtonText`]||""),e.setAttribute("aria-label",i[`${t}ButtonAriaLabel`]||""),e.className=o[t],H(e,i,`${t}Button`)}const fe=(e,t)=>{const i=y();i&&(function(e,t){"string"==typeof t?e.style.background=t:t||U([document.documentElement,document.body],o["no-backdrop"])}(i,t.backdrop),function(e,t){t&&(t in o?U(e,o[t]):(h('The "position" parameter is not valid, defaulting to "center"'),U(e,o.center)))}(i,t.position),function(e,t){t&&U(e,o[`grow-${t}`])}(i,t.grow),H(i,t,"container"))};var pe={innerParams:new WeakMap,domCache:new WeakMap};const me=["input","file","range","select","radio","checkbox","textarea"],ge=e=>{if(!e.input)return;if(!Se[e.input])return void d(`Unexpected type of input! Expected ${Object.keys(Se).join(" | ")}, got "${e.input}"`);const t=be(e.input);if(!t)return;const i=Se[e.input](t,e);q(t),e.inputAutoFocus&&setTimeout(()=>{V(i)})},_e=(e,t)=>{const i=b();if(!i)return;const n=j(i,e);if(n){(e=>{for(let t=0;t<e.attributes.length;t++){const i=e.attributes[t].name;["id","type","value","style"].includes(i)||e.removeAttribute(i)}})(n);for(const e in t)n.setAttribute(e,t[e])}},ye=e=>{if(!e.input)return;const t=be(e.input);t&&H(t,e,"input")},ve=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},xe=(e,t,i)=>{if(i.inputLabel){const n=document.createElement("label"),r=o["input-label"];n.setAttribute("for",e.id),n.className=r,"object"==typeof i.customClass&&U(n,i.customClass.inputLabel),n.innerText=i.inputLabel,t.insertAdjacentElement("beforebegin",n)}},be=e=>{const t=b();if(t)return G(t,o[e]||o.input)},we=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:_(t)||h(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},Se={};Se.text=Se.email=Se.password=Se.number=Se.tel=Se.url=Se.search=Se.date=Se["datetime-local"]=Se.time=Se.week=Se.month=(e,t)=>(we(e,t.inputValue),xe(e,e,t),ve(e,t),e.type=t.input,e),Se.file=(e,t)=>(xe(e,e,t),ve(e,t),e),Se.range=(e,t)=>{const i=e.querySelector("input"),n=e.querySelector("output");return we(i,t.inputValue),i.type=t.input,we(n,t.inputValue),xe(i,e,t),e},Se.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const i=document.createElement("option");Y(i,t.inputPlaceholder),i.value="",i.disabled=!0,i.selected=!0,e.appendChild(i)}return xe(e,e,t),e},Se.radio=e=>(e.textContent="",e),Se.checkbox=(e,t)=>{const i=j(b(),"checkbox");i.value="1",i.checked=Boolean(t.inputValue);const n=e.querySelector("span");return Y(n,t.inputPlaceholder||t.inputLabel),i},Se.textarea=(e,t)=>{we(e,t.inputValue),ve(e,t),xe(e,e,t);return setTimeout(()=>{if("MutationObserver"in window){const i=parseInt(window.getComputedStyle(b()).width);new MutationObserver(()=>{if(!document.body.contains(e))return;const n=e.offsetWidth+(r=e,parseInt(window.getComputedStyle(r).marginLeft)+parseInt(window.getComputedStyle(r).marginRight));var r;n>i?b().style.width=`${n}px`:X(b(),"width",t.width)}).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e};const Te=(e,t)=>{const i=T();i&&(J(i),H(i,t,"htmlContainer"),t.html?(ae(t.html,i),q(i,"block")):t.text?(i.textContent=t.text,q(i,"block")):Z(i),((e,t)=>{const i=b();if(!i)return;const n=pe.innerParams.get(e),r=!n||t.input!==n.input;me.forEach(e=>{const n=G(i,o[e]);n&&(_e(e,t.inputAttributes),n.className=o[e],r&&Z(n))}),t.input&&(r&&ge(t),ye(t))})(e,t))},ke=(e,t)=>{for(const[i,n]of Object.entries(a))t.icon!==i&&$(e,n);U(e,t.icon&&a[t.icon]),Ce(e,t),Me(),H(e,t,"icon")},Me=()=>{const e=b();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),i=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e<i.length;e++)i[e].style.backgroundColor=t},Ae=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let i=e.innerHTML,n="";t.iconHtml?n=De(t.iconHtml):"success"===t.icon?(n=(e=>`\n ${e.animation?'<div class="swal2-success-circular-line-left"></div>':""}\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div>\n ${e.animation?'<div class="swal2-success-fix"></div>':""}\n ${e.animation?'<div class="swal2-success-circular-line-right"></div>':""}\n`)(t),i=i.replace(/ style=".*?"/g,"")):"error"===t.icon?n='\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n':t.icon&&(n=De({question:"?",warning:"!",info:"i"}[t.icon])),i.trim()!==n.trim()&&Y(e,n)},Ce=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const i of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])K(e,i,"background-color",t.iconColor);K(e,".swal2-success-ring","border-color",t.iconColor)}},De=e=>`<div class="${o["icon-content"]}">${e}</div>`;let Le=!1,Ee=0,Ie=0,Pe=0,Re=0;const Oe=e=>{const t=b();if(e.target===t||w().contains(e.target)){Le=!0;const i=Ne(e);Ee=i.clientX,Ie=i.clientY,Pe=parseInt(t.style.insetInlineStart)||0,Re=parseInt(t.style.insetBlockStart)||0,U(t,"swal2-dragging")}},ze=e=>{const t=b();if(Le){let{clientX:i,clientY:n}=Ne(e);t.style.insetInlineStart=`${Pe+(i-Ee)}px`,t.style.insetBlockStart=`${Re+(n-Ie)}px`}},Fe=()=>{const e=b();Le=!1,$(e,"swal2-dragging")},Ne=e=>{let t=0,i=0;return e.type.startsWith("mouse")?(t=e.clientX,i=e.clientY):e.type.startsWith("touch")&&(t=e.touches[0].clientX,i=e.touches[0].clientY),{clientX:t,clientY:i}},Ye=(e,t)=>{const i=y(),n=b();if(i&&n){if(t.toast){X(i,"width",t.width),n.style.width="100%";const e=E();e&&n.insertBefore(e,w())}else X(n,"width",t.width);X(n,"padding",t.padding),t.color&&(n.style.color=t.color),t.background&&(n.style.background=t.background),Z(A()),Be(n,t),t.draggable&&!t.toast?(U(n,o.draggable),(e=>{e.addEventListener("mousedown",Oe),document.body.addEventListener("mousemove",ze),e.addEventListener("mouseup",Fe),e.addEventListener("touchstart",Oe),document.body.addEventListener("touchmove",ze),e.addEventListener("touchend",Fe)})(n)):($(n,o.draggable),(e=>{e.removeEventListener("mousedown",Oe),document.body.removeEventListener("mousemove",ze),e.removeEventListener("mouseup",Fe),e.removeEventListener("touchstart",Oe),document.body.removeEventListener("touchmove",ze),e.removeEventListener("touchend",Fe)})(n))}},Be=(e,t)=>{const i=t.showClass||{};e.className=`${o.popup} ${ee(e)?i.popup:""}`,t.toast?(U([document.documentElement,document.body],o["toast-shown"]),U(e,o.toast)):U(e,o.modal),H(e,t,"popup"),"string"==typeof t.customClass&&U(e,t.customClass),t.icon&&U(e,o[`icon-${t.icon}`])},He=e=>{const t=document.createElement("li");return U(t,o["progress-step"]),Y(t,e),t},je=e=>{const t=document.createElement("li");return U(t,o["progress-step-line"]),e.progressStepsDistance&&X(t,"width",e.progressStepsDistance),t},Ve=(e,t)=>{Ye(0,t),fe(0,t),((e,t)=>{const i=M();if(!i)return;const{progressSteps:n,currentProgressStep:r}=t;n&&0!==n.length&&void 0!==r?(q(i),i.textContent="",r>=n.length&&h("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),n.forEach((e,s)=>{const a=He(e);if(i.appendChild(a),s===r&&U(a,o["active-progress-step"]),s!==n.length-1){const e=je(t);i.appendChild(e)}})):Z(i)})(0,t),((e,t)=>{const i=pe.innerParams.get(e),n=w();if(n){if(i&&t.icon===i.icon)return Ae(n,t),void ke(n,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(a).indexOf(t.icon))return d(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void Z(n);q(n),Ae(n,t),ke(n,t),U(n,t.showClass&&t.showClass.icon),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",Me)}else Z(n)}})(e,t),((e,t)=>{const i=k();i&&(t.imageUrl?(q(i,""),i.setAttribute("src",t.imageUrl),i.setAttribute("alt",t.imageAlt||""),X(i,"width",t.imageWidth),X(i,"height",t.imageHeight),i.className=o.image,H(i,t,"image")):Z(i))})(0,t),((e,t)=>{const i=S();i&&(J(i),Q(i,t.title||t.titleText,"block"),t.title&&ae(t.title,i),t.titleText&&(i.innerText=t.titleText),H(i,t,"title"))})(0,t),((e,t)=>{const i=O();i&&(Y(i,t.closeButtonHtml||""),H(i,t,"closeButton"),Q(i,t.showCloseButton),i.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),Te(e,t),he(0,t),((e,t)=>{const i=P();i&&(J(i),Q(i,t.footer,"block"),t.footer&&ae(t.footer,i),H(i,t,"footer"))})(0,t);const i=b();"function"==typeof t.didRender&&i&&t.didRender(i),n.eventEmitter.emit("didRender",i)},We=()=>{var e;return null===(e=C())||void 0===e?void 0:e.click()},Ue=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),$e=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Ge=(e,t)=>{var i;const n=z();if(n.length)return-2===(e+=t)&&(e=n.length-1),e===n.length?e=0:-1===e&&(e=n.length-1),void n[e].focus();null===(i=b())||void 0===i||i.focus()},Xe=["ArrowRight","ArrowDown"],qe=["ArrowLeft","ArrowUp"],Ze=(e,t,i)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Je(t,e):"Tab"===t.key?Ke(t):[...Xe,...qe].includes(t.key)?Qe(t.key):"Escape"===t.key&&et(t,e,i)))},Je=(e,t)=>{if(!p(t.allowEnterKey))return;const i=j(b(),t.input);if(e.target&&i&&e.target instanceof HTMLElement&&e.target.outerHTML===i.outerHTML){if(["textarea","file"].includes(t.input))return;We(),e.preventDefault()}},Ke=e=>{const t=e.target,i=z();let n=-1;for(let e=0;e<i.length;e++)if(t===i[e]){n=e;break}e.shiftKey?Ge(n,-1):Ge(n,1),e.stopPropagation(),e.preventDefault()},Qe=e=>{const t=I(),i=C(),n=L(),r=D();if(!(t&&i&&n&&r))return;const s=[i,n,r];if(document.activeElement instanceof HTMLElement&&!s.includes(document.activeElement))return;const o=Xe.includes(e)?"nextElementSibling":"previousElementSibling";let a=document.activeElement;if(a){for(let e=0;e<t.children.length;e++){if(a=a[o],!a)return;if(a instanceof HTMLButtonElement&&ee(a))break}a instanceof HTMLButtonElement&&a.focus()}},et=(e,t,i)=>{e.preventDefault(),p(t.allowEscapeKey)&&i(Ue.esc)};var tt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const it=()=>{Array.from(document.body.children).forEach(e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},nt="undefined"!=typeof window&&!!window.GestureEvent,rt=()=>{const e=y();if(!e)return;let t;e.ontouchstart=e=>{t=st(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},st=e=>{const t=e.target,i=y(),n=T();return!(!i||!n||ot(e)||at(e)||t!==i&&(te(i)||!(t instanceof HTMLElement)||((e,t)=>{let i=e;for(;i&&i!==t;){if(te(i))return!0;i=i.parentElement}return!1})(t,n)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||te(n)&&n.contains(t)))},ot=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,at=e=>e.touches&&e.touches.length>1;let lt=null;const ct=e=>{null===lt&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(lt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${lt+(()=>{const e=document.createElement("div");e.className=o["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)};function ht(e,t,i,s){N()?yt(e,s):(r(i).then(()=>yt(e,s)),$e(n)),nt?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),F()&&(null!==lt&&(document.body.style.paddingRight=`${lt}px`,lt=null),(()=>{if(B(document.body,o.iosfix)){const e=parseInt(document.body.style.top,10);$(document.body,o.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),it()),$([document.documentElement,document.body],[o.shown,o["height-auto"],o["no-backdrop"],o["toast-shown"]])}function dt(e){e=mt(e);const t=tt.swalPromiseResolve.get(this),i=ut(this);this.isAwaitingPromise?e.isDismissed||(pt(this),t(e)):i&&t(e)}const ut=e=>{const t=b();if(!t)return!1;const i=pe.innerParams.get(e);if(!i||B(t,i.hideClass.popup))return!1;$(t,i.showClass.popup),U(t,i.hideClass.popup);const n=y();return $(n,i.showClass.backdrop),U(n,i.hideClass.backdrop),gt(e,t,i),!0};function ft(e){const t=tt.swalPromiseReject.get(this);pt(this),t&&t(e)}const pt=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,pe.innerParams.get(e)||e._destroy())},mt=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),gt=(e,t,i)=>{var r;const s=y(),o=ie(t);"function"==typeof i.willClose&&i.willClose(t),null===(r=n.eventEmitter)||void 0===r||r.emit("willClose",t),o?_t(e,t,s,i.returnFocus,i.didClose):ht(e,s,i.returnFocus,i.didClose)},_t=(e,t,i,r,s)=>{n.swalCloseEventFinishedCallback=ht.bind(null,e,i,r,s);const o=function(e){var i;e.target===t&&(null===(i=n.swalCloseEventFinishedCallback)||void 0===i||i.call(n),delete n.swalCloseEventFinishedCallback,t.removeEventListener("animationend",o),t.removeEventListener("transitionend",o))};t.addEventListener("animationend",o),t.addEventListener("transitionend",o)},yt=(e,t)=>{setTimeout(()=>{var i;"function"==typeof t&&t.bind(e.params)(),null===(i=n.eventEmitter)||void 0===i||i.emit("didClose"),e._destroy&&e._destroy()})},vt=e=>{let t=b();if(t||new Ki,t=b(),!t)return;const i=E();N()?Z(w()):xt(t,e),q(i),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},xt=(e,t)=>{const i=I(),n=E();i&&n&&(!t&&ee(C())&&(t=C()),q(i),t&&(Z(t),n.setAttribute("data-button-to-replace",t.className),i.insertBefore(n,t)),U([e,i],o.loading))},bt=e=>e.checked?1:0,wt=e=>e.checked?e.value:null,St=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,Tt=(e,t)=>{const i=b();if(!i)return;const n=e=>{"select"===t.input?function(e,t,i){const n=G(e,o.select);if(!n)return;const r=(e,t,n)=>{const r=document.createElement("option");r.value=n,Y(r,t),r.selected=At(n,i.inputValue),e.appendChild(r)};t.forEach(e=>{const t=e[0],i=e[1];if(Array.isArray(i)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,n.appendChild(e),i.forEach(t=>r(e,t[1],t[0]))}else r(n,i,t)}),n.focus()}(i,Mt(e),t):"radio"===t.input&&function(e,t,i){const n=G(e,o.radio);if(!n)return;t.forEach(e=>{const t=e[0],r=e[1],s=document.createElement("input"),a=document.createElement("label");s.type="radio",s.name=o.radio,s.value=t,At(t,i.inputValue)&&(s.checked=!0);const l=document.createElement("span");Y(l,r),l.className=o.label,a.appendChild(s),a.appendChild(l),n.appendChild(a)});const r=n.querySelectorAll("input");r.length&&r[0].focus()}(i,Mt(e),t)};m(t.inputOptions)||_(t.inputOptions)?(vt(C()),g(t.inputOptions).then(t=>{e.hideLoading(),n(t)})):"object"==typeof t.inputOptions?n(t.inputOptions):d("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},kt=(e,t)=>{const i=e.getInput();i&&(Z(i),g(t.inputValue).then(n=>{i.value="number"===t.input?`${parseFloat(n)||0}`:`${n}`,q(i),i.focus(),e.hideLoading()}).catch(t=>{d(`Error in inputValue promise: ${t}`),i.value="",q(i),i.focus(),e.hideLoading()}))};const Mt=e=>{const t=[];return e instanceof Map?e.forEach((e,i)=>{let n=e;"object"==typeof n&&(n=Mt(n)),t.push([i,n])}):Object.keys(e).forEach(i=>{let n=e[i];"object"==typeof n&&(n=Mt(n)),t.push([i,n])}),t},At=(e,t)=>!!t&&t.toString()===e.toString(),Ct=(e,t)=>{const i=pe.innerParams.get(e);if(!i.input)return void d(`The "input" parameter is needed to be set when using returnInputValueOn${c(t)}`);const n=e.getInput(),r=((e,t)=>{const i=e.getInput();if(!i)return null;switch(t.input){case"checkbox":return bt(i);case"radio":return wt(i);case"file":return St(i);default:return t.inputAutoTrim?i.value.trim():i.value}})(e,i);i.inputValidator?Dt(e,r,t):n&&!n.checkValidity()?(e.enableButtons(),e.showValidationMessage(i.validationMessage||n.validationMessage)):"deny"===t?Lt(e,r):Pt(e,r)},Dt=(e,t,i)=>{const n=pe.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>g(n.inputValidator(t,n.validationMessage))).then(n=>{e.enableButtons(),e.enableInput(),n?e.showValidationMessage(n):"deny"===i?Lt(e,t):Pt(e,t)})},Lt=(e,t)=>{const i=pe.innerParams.get(e||void 0);i.showLoaderOnDeny&&vt(L()),i.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then(()=>g(i.preDeny(t,i.validationMessage))).then(i=>{!1===i?(e.hideLoading(),pt(e)):e.close({isDenied:!0,value:void 0===i?t:i})}).catch(t=>It(e||void 0,t))):e.close({isDenied:!0,value:t})},Et=(e,t)=>{e.close({isConfirmed:!0,value:t})},It=(e,t)=>{e.rejectPromise(t)},Pt=(e,t)=>{const i=pe.innerParams.get(e||void 0);i.showLoaderOnConfirm&&vt(),i.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then(()=>g(i.preConfirm(t,i.validationMessage))).then(i=>{ee(A())||!1===i?(e.hideLoading(),pt(e)):Et(e,void 0===i?t:i)}).catch(t=>It(e||void 0,t))):Et(e,t)};function Rt(){const e=pe.innerParams.get(this);if(!e)return;const t=pe.domCache.get(this);Z(t.loader),N()?e.icon&&q(w()):Ot(t),$([t.popup,t.actions],o.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const Ot=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?q(t[0],"inline-block"):!ee(C())&&!ee(L())&&!ee(D())&&Z(e.actions)};function zt(){const e=pe.innerParams.get(this),t=pe.domCache.get(this);return t?j(t.popup,e.input):null}function Ft(e,t,i){const n=pe.domCache.get(e);t.forEach(e=>{n[e].disabled=i})}function Nt(e,t){const i=b();if(i&&e)if("radio"===e.type){const e=i.querySelectorAll(`[name="${o.radio}"]`);for(let i=0;i<e.length;i++)e[i].disabled=t}else e.disabled=t}function Yt(){Ft(this,["confirmButton","denyButton","cancelButton"],!1)}function Bt(){Ft(this,["confirmButton","denyButton","cancelButton"],!0)}function Ht(){Nt(this.getInput(),!1)}function jt(){Nt(this.getInput(),!0)}function Vt(e){const t=pe.domCache.get(this),i=pe.innerParams.get(this);Y(t.validationMessage,e),t.validationMessage.className=o["validation-message"],i.customClass&&i.customClass.validationMessage&&U(t.validationMessage,i.customClass.validationMessage),q(t.validationMessage);const n=this.getInput();n&&(n.setAttribute("aria-invalid","true"),n.setAttribute("aria-describedby",o["validation-message"]),V(n),U(n,o.inputerror))}function Wt(){const e=pe.domCache.get(this);e.validationMessage&&Z(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),$(t,o.inputerror))}const Ut={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,theme:"light",showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0,topLayer:!1},$t=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","draggable","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","theme","willClose"],Gt={allowEnterKey:void 0},Xt=["allowOutsideClick","allowEnterKey","backdrop","draggable","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],qt=e=>Object.prototype.hasOwnProperty.call(Ut,e),Zt=e=>-1!==$t.indexOf(e),Jt=e=>Gt[e],Kt=e=>{qt(e)||h(`Unknown parameter "${e}"`)},Qt=e=>{Xt.includes(e)&&h(`The parameter "${e}" is incompatible with toasts`)},ei=e=>{const t=Jt(e);t&&f(e,t)},ti=e=>{!1===e.backdrop&&e.allowOutsideClick&&h('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),e.theme&&!["light","dark","auto","minimal","borderless","embed-iframe","bulma","bulma-light","bulma-dark"].includes(e.theme)&&h(`Invalid theme "${e.theme}"`);for(const t in e)Kt(t),e.toast&&Qt(t),ei(t)};function ii(e){const t=y(),i=b(),n=pe.innerParams.get(this);if(!i||B(i,n.hideClass.popup))return void h("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const r=ni(e),s=Object.assign({},n,r);ti(s),t.dataset.swal2Theme=s.theme,Ve(this,s),pe.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const ni=e=>{const t={};return Object.keys(e).forEach(i=>{Zt(i)?t[i]=e[i]:h(`Invalid parameter to update: ${i}`)}),t};function ri(){const e=pe.domCache.get(this),t=pe.innerParams.get(this);t?(e.popup&&n.swalCloseEventFinishedCallback&&(n.swalCloseEventFinishedCallback(),delete n.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),n.eventEmitter.emit("didDestroy"),si(this)):oi(this)}const si=e=>{oi(e),delete e.params,delete n.keydownHandler,delete n.keydownTarget,delete n.currentInstance},oi=e=>{e.isAwaitingPromise?(ai(pe,e),e.isAwaitingPromise=!0):(ai(tt,e),ai(pe,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},ai=(e,t)=>{for(const i in e)e[i].delete(t)};var li=Object.freeze({__proto__:null,_destroy:ri,close:dt,closeModal:dt,closePopup:dt,closeToast:dt,disableButtons:Bt,disableInput:jt,disableLoading:Rt,enableButtons:Yt,enableInput:Ht,getInput:zt,handleAwaitingPromise:pt,hideLoading:Rt,rejectPromise:ft,resetValidationMessage:Wt,showValidationMessage:Vt,update:ii});const ci=(e,t,i)=>{t.popup.onclick=()=>{e&&(hi(e)||e.timer||e.input)||i(Ue.close)}},hi=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let di=!1;const ui=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(di=!0)}}},fi=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(di=!0)}}},pi=(e,t,i)=>{t.container.onclick=n=>{di?di=!1:n.target===t.container&&p(e.allowOutsideClick)&&i(Ue.backdrop)}},mi=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const gi=()=>{if(n.timeout)return(()=>{const e=R();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const i=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${i}%`})(),n.timeout.stop()},_i=()=>{if(n.timeout){const e=n.timeout.start();return ne(e),e}};let yi=!1;const vi={};const xi=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in vi){const i=t.getAttribute(e);if(i)return void vi[e].fire({template:i})}};n.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const i=this._getHandlersByEventName(e);i.includes(t)||i.push(t)}once(e,t){const i=(...n)=>{this.removeListener(e,i),t.apply(this,n)};this.on(e,i)}emit(e,...t){this._getHandlersByEventName(e).forEach(e=>{try{e.apply(this,t)}catch(e){console.error(e)}})}removeListener(e,t){const i=this._getHandlersByEventName(e),n=i.indexOf(t);n>-1&&i.splice(n,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}};var bi=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||mi(e[0])?["title","html","icon"].forEach((i,n)=>{const r=e[n];"string"==typeof r||mi(r)?t[i]=r:void 0!==r&&d(`Unexpected type of ${i}! Expected "string" or "Element", got ${typeof r}`)}):Object.assign(t,e[0]),t},bindClickHandler:function(e="data-swal-template"){vi[e]=this,yi||(document.body.addEventListener("click",xi),yi=!0)},clickCancel:()=>{var e;return null===(e=D())||void 0===e?void 0:e.click()},clickConfirm:We,clickDeny:()=>{var e;return null===(e=L())||void 0===e?void 0:e.click()},enableLoading:vt,fire:function(...e){return new this(...e)},getActions:I,getCancelButton:D,getCloseButton:O,getConfirmButton:C,getContainer:y,getDenyButton:L,getFocusableElements:z,getFooter:P,getHtmlContainer:T,getIcon:w,getIconContent:()=>x(o["icon-content"]),getImage:k,getInputLabel:()=>x(o["input-label"]),getLoader:E,getPopup:b,getProgressSteps:M,getTimerLeft:()=>n.timeout&&n.timeout.getTimerLeft(),getTimerProgressBar:R,getTitle:S,getValidationMessage:A,increaseTimer:e=>{if(n.timeout){const t=n.timeout.increase(e);return ne(t,!0),t}},isDeprecatedParameter:Jt,isLoading:()=>{const e=b();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>!(!n.timeout||!n.timeout.isRunning()),isUpdatableParameter:Zt,isValidParameter:qt,isVisible:()=>ee(b()),mixin:function(e){return class extends(this){_main(t,i){return super._main(t,Object.assign({},e,i))}}},off:(e,t)=>{e?t?n.eventEmitter.removeListener(e,t):n.eventEmitter.removeAllListeners(e):n.eventEmitter.reset()},on:(e,t)=>{n.eventEmitter.on(e,t)},once:(e,t)=>{n.eventEmitter.once(e,t)},resumeTimer:_i,showLoading:vt,stopTimer:gi,toggleTimer:()=>{const e=n.timeout;return e&&(e.running?gi():_i())}});class wi{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const Si=["swal-title","swal-html","swal-footer"],Ti=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach(e=>{Ii(e,["name","value"]);const i=e.getAttribute("name"),n=e.getAttribute("value");i&&n&&(t[i]="boolean"==typeof Ut[i]?"false"!==n:"object"==typeof Ut[i]?JSON.parse(n):n)}),t},ki=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach(e=>{const i=e.getAttribute("name"),n=e.getAttribute("value");i&&n&&(t[i]=new Function(`return ${n}`)())}),t},Mi=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach(e=>{Ii(e,["type","color","aria-label"]);const i=e.getAttribute("type");i&&["confirm","cancel","deny"].includes(i)&&(t[`${i}ButtonText`]=e.innerHTML,t[`show${c(i)}Button`]=!0,e.hasAttribute("color")&&(t[`${i}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${i}ButtonAriaLabel`]=e.getAttribute("aria-label")))}),t},Ai=e=>{const t={},i=e.querySelector("swal-image");return i&&(Ii(i,["src","width","height","alt"]),i.hasAttribute("src")&&(t.imageUrl=i.getAttribute("src")||void 0),i.hasAttribute("width")&&(t.imageWidth=i.getAttribute("width")||void 0),i.hasAttribute("height")&&(t.imageHeight=i.getAttribute("height")||void 0),i.hasAttribute("alt")&&(t.imageAlt=i.getAttribute("alt")||void 0)),t},Ci=e=>{const t={},i=e.querySelector("swal-icon");return i&&(Ii(i,["type","color"]),i.hasAttribute("type")&&(t.icon=i.getAttribute("type")),i.hasAttribute("color")&&(t.iconColor=i.getAttribute("color")),t.iconHtml=i.innerHTML),t},Di=e=>{const t={},i=e.querySelector("swal-input");i&&(Ii(i,["type","label","placeholder","value"]),t.input=i.getAttribute("type")||"text",i.hasAttribute("label")&&(t.inputLabel=i.getAttribute("label")),i.hasAttribute("placeholder")&&(t.inputPlaceholder=i.getAttribute("placeholder")),i.hasAttribute("value")&&(t.inputValue=i.getAttribute("value")));const n=Array.from(e.querySelectorAll("swal-input-option"));return n.length&&(t.inputOptions={},n.forEach(e=>{Ii(e,["value"]);const i=e.getAttribute("value");if(!i)return;const n=e.innerHTML;t.inputOptions[i]=n})),t},Li=(e,t)=>{const i={};for(const n in t){const r=t[n],s=e.querySelector(r);s&&(Ii(s,[]),i[r.replace(/^swal-/,"")]=s.innerHTML.trim())}return i},Ei=e=>{const t=Si.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach(e=>{const i=e.tagName.toLowerCase();t.includes(i)||h(`Unrecognized element <${i}>`)})},Ii=(e,t)=>{Array.from(e.attributes).forEach(i=>{-1===t.indexOf(i.name)&&h([`Unrecognized attribute "${i.name}" on <${e.tagName.toLowerCase()}>.`,t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."])})},Pi=e=>{const t=y(),i=b();"function"==typeof e.willOpen&&e.willOpen(i),n.eventEmitter.emit("willOpen",i);const r=window.getComputedStyle(document.body).overflowY;Fi(t,i,e),setTimeout(()=>{Oi(t,i)},10),F()&&(zi(t,e.scrollbarPadding,r),(()=>{const e=y();Array.from(document.body.children).forEach(t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))})})()),N()||n.previousActiveElement||(n.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout(()=>e.didOpen(i)),n.eventEmitter.emit("didOpen",i),$(t,o["no-transition"])},Ri=e=>{const t=b();if(e.target!==t)return;const i=y();t.removeEventListener("animationend",Ri),t.removeEventListener("transitionend",Ri),i.style.overflowY="auto"},Oi=(e,t)=>{ie(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",Ri),t.addEventListener("transitionend",Ri)):e.style.overflowY="auto"},zi=(e,t,i)=>{(()=>{if(nt&&!B(document.body,o.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",U(document.body,o.iosfix),rt()}})(),t&&"hidden"!==i&&ct(i),setTimeout(()=>{e.scrollTop=0})},Fi=(e,t,i)=>{U(e,i.showClass.backdrop),i.animation?(t.style.setProperty("opacity","0","important"),q(t,"grid"),setTimeout(()=>{U(t,i.showClass.popup),t.style.removeProperty("opacity")},10)):q(t,"grid"),U([document.documentElement,document.body],o.shown),i.heightAuto&&i.backdrop&&!i.toast&&U([document.documentElement,document.body],o["height-auto"])};var Ni=(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),Yi=(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL");function Bi(e){(function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=Ni),"url"===e.input&&(e.inputValidator=Yi))})(e),e.showLoaderOnConfirm&&!e.preConfirm&&h("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(h('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),oe(e)}let Hi;var ji=new WeakMap;class Vi{constructor(...t){if(i(this,ji,void 0),"undefined"==typeof window)return;Hi=this;const n=Object.freeze(this.constructor.argsToParams(t));var r,s,o;this.params=n,this.isAwaitingPromise=!1,r=ji,s=this,o=this._main(Hi.params),r.set(e(r,s),o)}_main(e,t={}){if(ti(Object.assign({},t,e)),n.currentInstance){const e=tt.swalPromiseResolve.get(n.currentInstance),{isAwaitingPromise:t}=n.currentInstance;n.currentInstance._destroy(),t||e({isDismissed:!0}),F()&&it()}n.currentInstance=Hi;const i=Ui(e,t);Bi(i),Object.freeze(i),n.timeout&&(n.timeout.stop(),delete n.timeout),clearTimeout(n.restoreFocusTimeout);const r=$i(Hi);return Ve(Hi,i),pe.innerParams.set(Hi,i),Wi(Hi,r,i)}then(e){return t(ji,this).then(e)}finally(e){return t(ji,this).finally(e)}}const Wi=(e,t,i)=>new Promise((r,s)=>{const o=t=>{e.close({isDismissed:!0,dismiss:t})};tt.swalPromiseResolve.set(e,r),tt.swalPromiseReject.set(e,s),t.confirmButton.onclick=()=>{(e=>{const t=pe.innerParams.get(e);e.disableButtons(),t.input?Ct(e,"confirm"):Pt(e,!0)})(e)},t.denyButton.onclick=()=>{(e=>{const t=pe.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Ct(e,"deny"):Lt(e,!1)})(e)},t.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t(Ue.cancel)})(e,o)},t.closeButton.onclick=()=>{o(Ue.close)},((e,t,i)=>{e.toast?ci(e,t,i):(ui(t),fi(t),pi(e,t,i))})(i,t,o),((e,t,i)=>{$e(e),t.toast||(e.keydownHandler=e=>Ze(t,e,i),e.keydownTarget=t.keydownListenerCapture?window:b(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)})(n,i,o),((e,t)=>{"select"===t.input||"radio"===t.input?Tt(e,t):["text","email","number","tel","textarea"].some(e=>e===t.input)&&(m(t.inputValue)||_(t.inputValue))&&(vt(C()),kt(e,t))})(e,i),Pi(i),Gi(n,i,o),Xi(t,i),setTimeout(()=>{t.container.scrollTop=0})}),Ui=(e,t)=>{const i=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const i=t.content;return Ei(i),Object.assign(Ti(i),ki(i),Mi(i),Ai(i),Ci(i),Di(i),Li(i,Si))})(e),n=Object.assign({},Ut,t,i,e);return n.showClass=Object.assign({},Ut.showClass,n.showClass),n.hideClass=Object.assign({},Ut.hideClass,n.hideClass),!1===n.animation&&(n.showClass={backdrop:"swal2-noanimation"},n.hideClass={}),n},$i=e=>{const t={popup:b(),container:y(),actions:I(),confirmButton:C(),denyButton:L(),cancelButton:D(),loader:E(),closeButton:O(),validationMessage:A(),progressSteps:M()};return pe.domCache.set(e,t),t},Gi=(e,t,i)=>{const n=R();Z(n),t.timer&&(e.timeout=new wi(()=>{i("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(q(n),H(n,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&ne(t.timer)})))},Xi=(e,t)=>{if(!t.toast)return p(t.allowEnterKey)?void(qi(e)||Zi(e,t)||Ge(-1,1)):(f("allowEnterKey"),void Ji())},qi=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const e of t)if(e instanceof HTMLElement&&ee(e))return e.focus(),!0;return!1},Zi=(e,t)=>t.focusDeny&&ee(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ee(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ee(e.confirmButton)||(e.confirmButton.focus(),0)),Ji=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};Vi.prototype.disableButtons=Bt,Vi.prototype.enableButtons=Yt,Vi.prototype.getInput=zt,Vi.prototype.disableInput=jt,Vi.prototype.enableInput=Ht,Vi.prototype.hideLoading=Rt,Vi.prototype.disableLoading=Rt,Vi.prototype.showValidationMessage=Vt,Vi.prototype.resetValidationMessage=Wt,Vi.prototype.close=dt,Vi.prototype.closePopup=dt,Vi.prototype.closeModal=dt,Vi.prototype.closeToast=dt,Vi.prototype.rejectPromise=ft,Vi.prototype.update=ii,Vi.prototype._destroy=ri,Object.assign(Vi,bi),Object.keys(li).forEach(e=>{Vi[e]=function(...t){return Hi&&Hi[e]?Hi[e](...t):null}}),Vi.DismissReason=Ue,Vi.version="11.22.5";const Ki=Vi;return Ki.default=Ki,Ki}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var i=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(i),i.styleSheet)i.styleSheet.disabled||(i.styleSheet.cssText=t);else try{i.innerHTML=t}catch(e){i.innerText=t}}(document,':root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.1s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-icon-animations: true;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px $swal2-outline-color;--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem;container-name:swal2-popup}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}@container swal2-popup style(--swal2-icon-animations:true){.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}')},8474:function(e,t,i){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(i(5093))},8490:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var n=i(2632),r=i(4278);const s={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,s=e.name,o=i.offset,a=void 0===o?[0,0]:o,l=r.DD.reduce(function(e,i){return e[i]=function(e,t,i){var s=(0,n.A)(e),o=[r.kb,r.Mn].indexOf(s)>=0?-1:1,a="function"==typeof i?i(Object.assign({},t,{placement:e})):i,l=a[0],c=a[1];return l=l||0,c=(c||0)*o,[r.kb,r.pG].indexOf(s)>=0?{x:c,y:l}:{x:l,y:c}}(i,t.rects,a),e},{}),c=l[t.placement],h=c.x,d=c.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=h,t.modifiersData.popperOffsets.y+=d),t.modifiersData[s]=l}}},8676:function(e,t,i){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(i(5093))},8680:(e,t,i)=>{"use strict";i.d(t,{Ay:()=>C});var n=i(7363),r=i(9174);r.bG.touchMouseIgnoreWait=500;let s=0,o=0,a=!1;class l{constructor(e){this.subjectEl=null,this.selector="",this.handleSelector="",this.shouldIgnoreMove=!1,this.shouldWatchScroll=!0,this.isDragging=!1,this.isTouchDragging=!1,this.wasTouchScroll=!1,this.handleMouseDown=e=>{if(!this.shouldIgnoreMouse()&&function(e){return 0===e.button&&!e.ctrlKey}(e)&&this.tryStart(e)){let t=this.createEventFromMouse(e,!0);this.emitter.trigger("pointerdown",t),this.initScrollWatch(t),this.shouldIgnoreMove||document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}},this.handleMouseMove=e=>{let t=this.createEventFromMouse(e);this.recordCoords(t),this.emitter.trigger("pointermove",t)},this.handleMouseUp=e=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.emitter.trigger("pointerup",this.createEventFromMouse(e)),this.cleanup()},this.handleTouchStart=e=>{if(this.tryStart(e)){this.isTouchDragging=!0;let t=this.createEventFromTouch(e,!0);this.emitter.trigger("pointerdown",t),this.initScrollWatch(t);let i=e.target;this.shouldIgnoreMove||i.addEventListener("touchmove",this.handleTouchMove),i.addEventListener("touchend",this.handleTouchEnd),i.addEventListener("touchcancel",this.handleTouchEnd),window.addEventListener("scroll",this.handleTouchScroll,!0)}},this.handleTouchMove=e=>{let t=this.createEventFromTouch(e);this.recordCoords(t),this.emitter.trigger("pointermove",t)},this.handleTouchEnd=e=>{if(this.isDragging){let t=e.target;t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd),t.removeEventListener("touchcancel",this.handleTouchEnd),window.removeEventListener("scroll",this.handleTouchScroll,!0),this.emitter.trigger("pointerup",this.createEventFromTouch(e)),this.cleanup(),this.isTouchDragging=!1,s+=1,setTimeout(()=>{s-=1},r.bG.touchMouseIgnoreWait)}},this.handleTouchScroll=()=>{this.wasTouchScroll=!0},this.handleScroll=e=>{if(!this.shouldIgnoreMove){let t=window.scrollX-this.prevScrollX+this.prevPageX,i=window.scrollY-this.prevScrollY+this.prevPageY;this.emitter.trigger("pointermove",{origEvent:e,isTouch:this.isTouchDragging,subjectEl:this.subjectEl,pageX:t,pageY:i,deltaX:t-this.origPageX,deltaY:i-this.origPageY})}},this.containerEl=e,this.emitter=new r.F,e.addEventListener("mousedown",this.handleMouseDown),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),o+=1,1===o&&window.addEventListener("touchmove",c,{passive:!1})}destroy(){this.containerEl.removeEventListener("mousedown",this.handleMouseDown),this.containerEl.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),o-=1,o||window.removeEventListener("touchmove",c,{passive:!1})}tryStart(e){let t=this.querySubjectEl(e),i=e.target;return!(!t||this.handleSelector&&!(0,r.Z)(i,this.handleSelector)||(this.subjectEl=t,this.isDragging=!0,this.wasTouchScroll=!1,0))}cleanup(){a=!1,this.isDragging=!1,this.subjectEl=null,this.destroyScrollWatch()}querySubjectEl(e){return this.selector?(0,r.Z)(e.target,this.selector):this.containerEl}shouldIgnoreMouse(){return s||this.isTouchDragging}cancelTouchScroll(){this.isDragging&&(a=!0)}initScrollWatch(e){this.shouldWatchScroll&&(this.recordCoords(e),window.addEventListener("scroll",this.handleScroll,!0))}recordCoords(e){this.shouldWatchScroll&&(this.prevPageX=e.pageX,this.prevPageY=e.pageY,this.prevScrollX=window.scrollX,this.prevScrollY=window.scrollY)}destroyScrollWatch(){this.shouldWatchScroll&&window.removeEventListener("scroll",this.handleScroll,!0)}createEventFromMouse(e,t){let i=0,n=0;return t?(this.origPageX=e.pageX,this.origPageY=e.pageY):(i=e.pageX-this.origPageX,n=e.pageY-this.origPageY),{origEvent:e,isTouch:!1,subjectEl:this.subjectEl,pageX:e.pageX,pageY:e.pageY,deltaX:i,deltaY:n}}createEventFromTouch(e,t){let i,n,r=e.touches,s=0,o=0;return r&&r.length?(i=r[0].pageX,n=r[0].pageY):(i=e.pageX,n=e.pageY),t?(this.origPageX=i,this.origPageY=n):(s=i-this.origPageX,o=n-this.origPageY),{origEvent:e,isTouch:!0,subjectEl:this.subjectEl,pageX:i,pageY:n,deltaX:s,deltaY:o}}}function c(e){a&&e.preventDefault()}class h{constructor(){this.isVisible=!1,this.sourceEl=null,this.mirrorEl=null,this.sourceElRect=null,this.parentNode=document.body,this.zIndex=9999,this.revertDuration=0}start(e,t,i){this.sourceEl=e,this.sourceElRect=this.sourceEl.getBoundingClientRect(),this.origScreenX=t-window.scrollX,this.origScreenY=i-window.scrollY,this.deltaX=0,this.deltaY=0,this.updateElPosition()}handleMove(e,t){this.deltaX=e-window.scrollX-this.origScreenX,this.deltaY=t-window.scrollY-this.origScreenY,this.updateElPosition()}setIsVisible(e){e?this.isVisible||(this.mirrorEl&&(this.mirrorEl.style.display=""),this.isVisible=e,this.updateElPosition()):this.isVisible&&(this.mirrorEl&&(this.mirrorEl.style.display="none"),this.isVisible=e)}stop(e,t){let i=()=>{this.cleanup(),t()};e&&this.mirrorEl&&this.isVisible&&this.revertDuration&&(this.deltaX||this.deltaY)?this.doRevertAnimation(i,this.revertDuration):setTimeout(i,0)}doRevertAnimation(e,t){let i=this.mirrorEl,n=this.sourceEl.getBoundingClientRect();i.style.transition="top "+t+"ms,left "+t+"ms",(0,r.aN)(i,{left:n.left,top:n.top}),(0,r.b0)(i,()=>{i.style.transition="",e()})}cleanup(){this.mirrorEl&&((0,r.aM)(this.mirrorEl),this.mirrorEl=null),this.sourceEl=null}updateElPosition(){this.sourceEl&&this.isVisible&&(0,r.aN)(this.getMirrorEl(),{left:this.sourceElRect.left+this.deltaX,top:this.sourceElRect.top+this.deltaY})}getMirrorEl(){let e=this.sourceElRect,t=this.mirrorEl;return t||(t=this.mirrorEl=this.sourceEl.cloneNode(!0),t.style.userSelect="none",t.style.webkitUserSelect="none",t.style.pointerEvents="none",t.classList.add("fc-event-dragging"),(0,r.aN)(t,{position:"fixed",zIndex:this.zIndex,visibility:"",boxSizing:"border-box",width:e.right-e.left,height:e.bottom-e.top,right:"auto",bottom:"auto",margin:0}),this.parentNode.appendChild(t)),t}}class d extends r.b9{constructor(e,t){super(),this.handleScroll=()=>{this.scrollTop=this.scrollController.getScrollTop(),this.scrollLeft=this.scrollController.getScrollLeft(),this.handleScrollChange()},this.scrollController=e,this.doesListening=t,this.scrollTop=this.origScrollTop=e.getScrollTop(),this.scrollLeft=this.origScrollLeft=e.getScrollLeft(),this.scrollWidth=e.getScrollWidth(),this.scrollHeight=e.getScrollHeight(),this.clientWidth=e.getClientWidth(),this.clientHeight=e.getClientHeight(),this.clientRect=this.computeClientRect(),this.doesListening&&this.getEventTarget().addEventListener("scroll",this.handleScroll)}destroy(){this.doesListening&&this.getEventTarget().removeEventListener("scroll",this.handleScroll)}getScrollTop(){return this.scrollTop}getScrollLeft(){return this.scrollLeft}setScrollTop(e){this.scrollController.setScrollTop(e),this.doesListening||(this.scrollTop=Math.max(Math.min(e,this.getMaxScrollTop()),0),this.handleScrollChange())}setScrollLeft(e){this.scrollController.setScrollLeft(e),this.doesListening||(this.scrollLeft=Math.max(Math.min(e,this.getMaxScrollLeft()),0),this.handleScrollChange())}getClientWidth(){return this.clientWidth}getClientHeight(){return this.clientHeight}getScrollWidth(){return this.scrollWidth}getScrollHeight(){return this.scrollHeight}handleScrollChange(){}}class u extends d{constructor(e,t){super(new r.ba(e),t)}getEventTarget(){return this.scrollController.el}computeClientRect(){return(0,r.b1)(this.scrollController.el)}}class f extends d{constructor(e){super(new r.bb,e)}getEventTarget(){return window}computeClientRect(){return{left:this.scrollLeft,right:this.scrollLeft+this.clientWidth,top:this.scrollTop,bottom:this.scrollTop+this.clientHeight}}handleScrollChange(){this.clientRect=this.computeClientRect()}}const p="function"==typeof performance?performance.now:Date.now;class m{constructor(){this.isEnabled=!0,this.scrollQuery=[window,".fc-scroller"],this.edgeThreshold=50,this.maxVelocity=300,this.pointerScreenX=null,this.pointerScreenY=null,this.isAnimating=!1,this.scrollCaches=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.animate=()=>{if(this.isAnimating){let e=this.computeBestEdge(this.pointerScreenX+window.scrollX,this.pointerScreenY+window.scrollY);if(e){let t=p();this.handleSide(e,(t-this.msSinceRequest)/1e3),this.requestAnimation(t)}else this.isAnimating=!1}}}start(e,t,i){this.isEnabled&&(this.scrollCaches=this.buildCaches(i),this.pointerScreenX=null,this.pointerScreenY=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.handleMove(e,t))}handleMove(e,t){if(this.isEnabled){let i=e-window.scrollX,n=t-window.scrollY,r=null===this.pointerScreenY?0:n-this.pointerScreenY,s=null===this.pointerScreenX?0:i-this.pointerScreenX;r<0?this.everMovedUp=!0:r>0&&(this.everMovedDown=!0),s<0?this.everMovedLeft=!0:s>0&&(this.everMovedRight=!0),this.pointerScreenX=i,this.pointerScreenY=n,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(p()))}}stop(){if(this.isEnabled){this.isAnimating=!1;for(let e of this.scrollCaches)e.destroy();this.scrollCaches=null}}requestAnimation(e){this.msSinceRequest=e,requestAnimationFrame(this.animate)}handleSide(e,t){let{scrollCache:i}=e,{edgeThreshold:n}=this,r=n-e.distance,s=r*r/(n*n)*this.maxVelocity*t,o=1;switch(e.name){case"left":o=-1;case"right":i.setScrollLeft(i.getScrollLeft()+s*o);break;case"top":o=-1;case"bottom":i.setScrollTop(i.getScrollTop()+s*o)}}computeBestEdge(e,t){let{edgeThreshold:i}=this,n=null,r=this.scrollCaches||[];for(let s of r){let r=s.clientRect,o=e-r.left,a=r.right-e,l=t-r.top,c=r.bottom-t;o>=0&&a>=0&&l>=0&&c>=0&&(l<=i&&this.everMovedUp&&s.canScrollUp()&&(!n||n.distance>l)&&(n={scrollCache:s,name:"top",distance:l}),c<=i&&this.everMovedDown&&s.canScrollDown()&&(!n||n.distance>c)&&(n={scrollCache:s,name:"bottom",distance:c}),o<=i&&this.everMovedLeft&&s.canScrollLeft()&&(!n||n.distance>o)&&(n={scrollCache:s,name:"left",distance:o}),a<=i&&this.everMovedRight&&s.canScrollRight()&&(!n||n.distance>a)&&(n={scrollCache:s,name:"right",distance:a}))}return n}buildCaches(e){return this.queryScrollEls(e).map(e=>e===window?new f(!1):new u(e,!1))}queryScrollEls(e){let t=[];for(let i of this.scrollQuery)"object"==typeof i?t.push(i):t.push(...Array.prototype.slice.call(e.getRootNode().querySelectorAll(i)));return t}}class g extends r.bF{constructor(e,t){super(e),this.containerEl=e,this.delay=null,this.minDistance=0,this.touchScrollAllowed=!0,this.mirrorNeedsRevert=!1,this.isInteracting=!1,this.isDragging=!1,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.delayTimeoutId=null,this.onPointerDown=e=>{this.isDragging||(this.isInteracting=!0,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,(0,r.ap)(document.body),(0,r.ar)(document.body),e.isTouch||e.origEvent.preventDefault(),this.emitter.trigger("pointerdown",e),this.isInteracting&&!this.pointer.shouldIgnoreMove&&(this.mirror.setIsVisible(!1),this.mirror.start(e.subjectEl,e.pageX,e.pageY),this.startDelay(e),this.minDistance||this.handleDistanceSurpassed(e)))},this.onPointerMove=e=>{if(this.isInteracting){if(this.emitter.trigger("pointermove",e),!this.isDistanceSurpassed){let t,i=this.minDistance,{deltaX:n,deltaY:r}=e;t=n*n+r*r,t>=i*i&&this.handleDistanceSurpassed(e)}this.isDragging&&("scroll"!==e.origEvent.type&&(this.mirror.handleMove(e.pageX,e.pageY),this.autoScroller.handleMove(e.pageX,e.pageY)),this.emitter.trigger("dragmove",e))}},this.onPointerUp=e=>{this.isInteracting&&(this.isInteracting=!1,(0,r.aq)(document.body),(0,r.as)(document.body),this.emitter.trigger("pointerup",e),this.isDragging&&(this.autoScroller.stop(),this.tryStopDrag(e)),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null))};let i=this.pointer=new l(e);i.emitter.on("pointerdown",this.onPointerDown),i.emitter.on("pointermove",this.onPointerMove),i.emitter.on("pointerup",this.onPointerUp),t&&(i.selector=t),this.mirror=new h,this.autoScroller=new m}destroy(){this.pointer.destroy(),this.onPointerUp({})}startDelay(e){"number"==typeof this.delay?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=null,this.handleDelayEnd(e)},this.delay):this.handleDelayEnd(e)}handleDelayEnd(e){this.isDelayEnded=!0,this.tryStartDrag(e)}handleDistanceSurpassed(e){this.isDistanceSurpassed=!0,this.tryStartDrag(e)}tryStartDrag(e){this.isDelayEnded&&this.isDistanceSurpassed&&(this.pointer.wasTouchScroll&&!this.touchScrollAllowed||(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(e.pageX,e.pageY,this.containerEl),this.emitter.trigger("dragstart",e),!1===this.touchScrollAllowed&&this.pointer.cancelTouchScroll()))}tryStopDrag(e){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,e))}stopDrag(e){this.isDragging=!1,this.emitter.trigger("dragend",e)}setIgnoreMove(e){this.pointer.shouldIgnoreMove=e}setMirrorIsVisible(e){this.mirror.setIsVisible(e)}setMirrorNeedsRevert(e){this.mirrorNeedsRevert=e}setAutoScrollEnabled(e){this.autoScroller.isEnabled=e}}class _{constructor(e){this.el=e,this.origRect=(0,r.b4)(e),this.scrollCaches=(0,r.b3)(e).map(e=>new u(e,!0))}destroy(){for(let e of this.scrollCaches)e.destroy()}computeLeft(){let e=this.origRect.left;for(let t of this.scrollCaches)e+=t.origScrollLeft-t.getScrollLeft();return e}computeTop(){let e=this.origRect.top;for(let t of this.scrollCaches)e+=t.origScrollTop-t.getScrollTop();return e}isWithinClipping(e,t){let i={left:e,top:t};for(let e of this.scrollCaches)if(!y(e.getEventTarget())&&!(0,r.aD)(i,e.clientRect))return!1;return!0}}function y(e){let t=e.tagName;return"HTML"===t||"BODY"===t}class v{constructor(e,t){this.useSubjectCenter=!1,this.requireInitial=!0,this.disablePointCheck=!1,this.initialHit=null,this.movingHit=null,this.finalHit=null,this.handlePointerDown=e=>{let{dragging:t}=this;this.initialHit=null,this.movingHit=null,this.finalHit=null,this.prepareHits(),this.processFirstCoord(e),this.initialHit||!this.requireInitial?(t.setIgnoreMove(!1),this.emitter.trigger("pointerdown",e)):t.setIgnoreMove(!0)},this.handleDragStart=e=>{this.emitter.trigger("dragstart",e),this.handleMove(e,!0)},this.handleDragMove=e=>{this.emitter.trigger("dragmove",e),this.handleMove(e)},this.handlePointerUp=e=>{this.releaseHits(),this.emitter.trigger("pointerup",e)},this.handleDragEnd=e=>{this.movingHit&&this.emitter.trigger("hitupdate",null,!0,e),this.finalHit=this.movingHit,this.movingHit=null,this.emitter.trigger("dragend",e)},this.droppableStore=t,e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("dragstart",this.handleDragStart),e.emitter.on("dragmove",this.handleDragMove),e.emitter.on("pointerup",this.handlePointerUp),e.emitter.on("dragend",this.handleDragEnd),this.dragging=e,this.emitter=new r.F}processFirstCoord(e){let t,i={left:e.pageX,top:e.pageY},n=i,s=e.subjectEl;s instanceof HTMLElement&&(t=(0,r.b4)(s),n=(0,r.aE)(n,t));let o=this.initialHit=this.queryHitForOffset(n.left,n.top);if(o){if(this.useSubjectCenter&&t){let e=(0,r.aC)(t,o.rect);e&&(n=(0,r.aF)(e))}this.coordAdjust=(0,r.aG)(n,i)}else this.coordAdjust={left:0,top:0}}handleMove(e,t){let i=this.queryHitForOffset(e.pageX+this.coordAdjust.left,e.pageY+this.coordAdjust.top);!t&&x(this.movingHit,i)||(this.movingHit=i,this.emitter.trigger("hitupdate",i,!1,e))}prepareHits(){this.offsetTrackers=(0,r.a)(this.droppableStore,e=>(e.component.prepareHits(),new _(e.el)))}releaseHits(){let{offsetTrackers:e}=this;for(let t in e)e[t].destroy();this.offsetTrackers={}}queryHitForOffset(e,t){let{droppableStore:i,offsetTrackers:n}=this,s=null;for(let o in i){let a=i[o].component,l=n[o];if(l&&l.isWithinClipping(e,t)){let i=l.computeLeft(),n=l.computeTop(),c=e-i,h=t-n,{origRect:d}=l,u=d.right-d.left,f=d.bottom-d.top;if(c>=0&&c<u&&h>=0&&h<f){let e=a.queryHit(c,h,u,f);e&&(0,r.b7)(e.dateProfile.activeRange,e.dateSpan.range)&&(this.disablePointCheck||l.el.contains(l.el.getRootNode().elementFromPoint(c+i-window.scrollX,h+n-window.scrollY)))&&(!s||e.layer>s.layer)&&(e.componentId=o,e.context=a.context,e.rect.left+=i,e.rect.right+=i,e.rect.top+=n,e.rect.bottom+=n,s=e)}}}return s}}function x(e,t){return!e&&!t||Boolean(e)===Boolean(t)&&(0,r.bd)(e.dateSpan,t.dateSpan)}function b(e,t){let i={};for(let n of t.pluginHooks.datePointTransforms)Object.assign(i,n(e,t));var n,r;return Object.assign(i,(n=e,{date:(r=t.dateEnv).toDate(n.range.start),dateStr:r.formatIso(n.range.start,{omitTime:n.allDay}),allDay:n.allDay})),i}class w extends r.X{constructor(e){super(e),this.handlePointerDown=e=>{let{dragging:t}=this,i=e.origEvent.target;t.setIgnoreMove(!this.component.isValidDateDownEl(i))},this.handleDragEnd=e=>{let{component:t}=this,{pointer:i}=this.dragging;if(!i.wasTouchScroll){let{initialHit:i,finalHit:n}=this.hitDragging;if(i&&n&&x(i,n)){let{context:n}=t,r=Object.assign(Object.assign({},b(i.dateSpan,n)),{dayEl:i.dayEl,jsEvent:e.origEvent,view:n.viewApi||n.calendarApi.view});n.emitter.trigger("dateClick",r)}}},this.dragging=new g(e.el),this.dragging.autoScroller.isEnabled=!1;let t=this.hitDragging=new v(this.dragging,(0,r.bE)(e));t.emitter.on("pointerdown",this.handlePointerDown),t.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}}class S extends r.X{constructor(e){super(e),this.dragSelection=null,this.handlePointerDown=e=>{let{component:t,dragging:i}=this,{options:n}=t.context,r=n.selectable&&t.isValidDateDownEl(e.origEvent.target);i.setIgnoreMove(!r),i.delay=e.isTouch?function(e){let{options:t}=e.context,i=t.selectLongPressDelay;return null==i&&(i=t.longPressDelay),i}(t):null},this.handleDragStart=e=>{this.component.context.calendarApi.unselect(e)},this.handleHitUpdate=(e,t)=>{let{context:i}=this.component,n=null,s=!1;if(e){let t=this.hitDragging.initialHit;e.componentId===t.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(t,e)||(n=function(e,t,i){let n=e.dateSpan,s=t.dateSpan,o=[n.range.start,n.range.end,s.range.start,s.range.end];o.sort(r.at);let a={};for(let n of i){let i=n(e,t);if(!1===i)return null;i&&Object.assign(a,i)}return a.range={start:o[0],end:o[3]},a.allDay=n.allDay,a}(t,e,i.pluginHooks.dateSelectionTransformers)),n&&(0,r.bY)(n,e.dateProfile,i)||(s=!0,n=null)}n?i.dispatch({type:"SELECT_DATES",selection:n}):t||i.dispatch({type:"UNSELECT_DATES"}),s?(0,r.av)():(0,r.au)(),t||(this.dragSelection=n)},this.handlePointerUp=e=>{this.dragSelection&&((0,r.cr)(this.dragSelection,e,this.component.context),this.dragSelection=null)};let{component:t}=e,{options:i}=t.context,n=this.dragging=new g(e.el);n.touchScrollAllowed=!1,n.minDistance=i.selectMinDistance||0,n.autoScroller.isEnabled=i.dragScroll;let s=this.hitDragging=new v(this.dragging,(0,r.bE)(e));s.emitter.on("pointerdown",this.handlePointerDown),s.emitter.on("dragstart",this.handleDragStart),s.emitter.on("hitupdate",this.handleHitUpdate),s.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.dragging.destroy()}}class T extends r.X{constructor(e){super(e),this.subjectEl=null,this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=e=>{let t=e.origEvent.target,{component:i,dragging:n}=this,{mirror:s}=n,{options:o}=i.context,a=i.context;this.subjectEl=e.subjectEl;let l=this.subjectSeg=(0,r.Y)(e.subjectEl),c=(this.eventRange=l.eventRange).instance.instanceId;this.relevantEvents=(0,r.aT)(a.getCurrentData().eventStore,c),n.minDistance=e.isTouch?0:o.eventDragMinDistance,n.delay=e.isTouch&&c!==i.props.eventSelection?function(e){let{options:t}=e.context,i=t.eventLongPressDelay;return null==i&&(i=t.longPressDelay),i}(i):null,o.fixedMirrorParent?s.parentNode=o.fixedMirrorParent:s.parentNode=(0,r.Z)(t,".fc"),s.revertDuration=o.dragRevertDuration;let h=i.isValidSegDownEl(t)&&!(0,r.Z)(t,".fc-event-resizer");n.setIgnoreMove(!h),this.isDragging=h&&e.subjectEl.classList.contains("fc-event-draggable")},this.handleDragStart=e=>{let t=this.component.context,i=this.eventRange,n=i.instance.instanceId;e.isTouch?n!==this.component.props.eventSelection&&t.dispatch({type:"SELECT_EVENT",eventInstanceId:n}):t.dispatch({type:"UNSELECT_EVENT"}),this.isDragging&&(t.calendarApi.unselect(e),t.emitter.trigger("eventDragStart",{el:this.subjectEl,event:new r._(t,i.def,i.instance),jsEvent:e.origEvent,view:t.viewApi}))},this.handleHitUpdate=(e,t)=>{if(!this.isDragging)return;let i=this.relevantEvents,n=this.hitDragging.initialHit,s=this.component.context,o=null,a=null,l=null,c=!1,h={affectedEvents:i,mutatedEvents:(0,r.H)(),isEvent:!0};if(e){o=e.context;let t=o.options;s===o||t.editable&&t.droppable?(a=function(e,t,i,n){let s=e.dateSpan,o=t.dateSpan,a=s.range.start,l=o.range.start,c={};s.allDay!==o.allDay&&(c.allDay=o.allDay,c.hasEnd=t.context.options.allDayMaintainDuration,a=o.allDay?(0,r.q)(i):i);let h=(0,r.ay)(a,l,e.context.dateEnv,e.componentId===t.componentId?e.largeUnit:null);h.milliseconds&&(c.allDay=!1);let d={datesDelta:h,standardProps:c};for(let i of n)i(d,e,t);return d}(n,e,this.eventRange.instance.range.start,o.getCurrentData().pluginHooks.eventDragMutationMassagers),a&&(l=(0,r.bV)(i,o.getCurrentData().eventUiBases,a,o),h.mutatedEvents=l,(0,r.bX)(h,e.dateProfile,o)||(c=!0,a=null,l=null,h.mutatedEvents=(0,r.H)()))):o=null}this.displayDrag(o,h),c?(0,r.av)():(0,r.au)(),t||(s===o&&x(n,e)&&(a=null),this.dragging.setMirrorNeedsRevert(!a),this.dragging.setMirrorIsVisible(!e||!this.subjectEl.getRootNode().querySelector(".fc-event-mirror")),this.receivingContext=o,this.validMutation=a,this.mutatedRelevantEvents=l)},this.handlePointerUp=()=>{this.isDragging||this.cleanup()},this.handleDragEnd=e=>{if(this.isDragging){let t=this.component.context,i=t.viewApi,{receivingContext:n,validMutation:s}=this,o=this.eventRange.def,a=this.eventRange.instance,l=new r._(t,o,a),c=this.relevantEvents,h=this.mutatedRelevantEvents,{finalHit:d}=this.hitDragging;if(this.clearDrag(),t.emitter.trigger("eventDragStop",{el:this.subjectEl,event:l,jsEvent:e.origEvent,view:i}),s){if(n===t){let n=new r._(t,h.defs[o.defId],a?h.instances[a.instanceId]:null);t.dispatch({type:"MERGE_EVENTS",eventStore:h});let d={oldEvent:l,event:n,relatedEvents:(0,r.w)(h,t,a),revert(){t.dispatch({type:"MERGE_EVENTS",eventStore:c})}},u={};for(let e of t.getCurrentData().pluginHooks.eventDropTransformers)Object.assign(u,e(s,t));t.emitter.trigger("eventDrop",Object.assign(Object.assign(Object.assign({},d),u),{el:e.subjectEl,delta:s.datesDelta,jsEvent:e.origEvent,view:i})),t.emitter.trigger("eventChange",d)}else if(n){let s={event:l,relatedEvents:(0,r.w)(c,t,a),revert(){t.dispatch({type:"MERGE_EVENTS",eventStore:c})}};t.emitter.trigger("eventLeave",Object.assign(Object.assign({},s),{draggedEl:e.subjectEl,view:i})),t.dispatch({type:"REMOVE_EVENTS",eventStore:c}),t.emitter.trigger("eventRemove",s);let u=h.defs[o.defId],f=h.instances[a.instanceId],p=new r._(n,u,f);n.dispatch({type:"MERGE_EVENTS",eventStore:h});let m={event:p,relatedEvents:(0,r.w)(h,n,f),revert(){n.dispatch({type:"REMOVE_EVENTS",eventStore:h})}};n.emitter.trigger("eventAdd",m),e.isTouch&&n.dispatch({type:"SELECT_EVENT",eventInstanceId:a.instanceId}),n.emitter.trigger("drop",Object.assign(Object.assign({},b(d.dateSpan,n)),{draggedEl:e.subjectEl,jsEvent:e.origEvent,view:d.context.viewApi})),n.emitter.trigger("eventReceive",Object.assign(Object.assign({},m),{draggedEl:e.subjectEl,view:d.context.viewApi}))}}else t.emitter.trigger("_noEventDrop")}this.cleanup()};let{component:t}=this,{options:i}=t.context,n=this.dragging=new g(e.el);n.pointer.selector=T.SELECTOR,n.touchScrollAllowed=!1,n.autoScroller.isEnabled=i.dragScroll;let s=this.hitDragging=new v(this.dragging,r.a5);s.useSubjectCenter=e.useEventCenter,s.emitter.on("pointerdown",this.handlePointerDown),s.emitter.on("dragstart",this.handleDragStart),s.emitter.on("hitupdate",this.handleHitUpdate),s.emitter.on("pointerup",this.handlePointerUp),s.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}displayDrag(e,t){let i=this.component.context,n=this.receivingContext;n&&n!==e&&(n===i?n.dispatch({type:"SET_EVENT_DRAG",state:{affectedEvents:t.affectedEvents,mutatedEvents:(0,r.H)(),isEvent:!0}}):n.dispatch({type:"UNSET_EVENT_DRAG"})),e&&e.dispatch({type:"SET_EVENT_DRAG",state:t})}clearDrag(){let e=this.component.context,{receivingContext:t}=this;t&&t.dispatch({type:"UNSET_EVENT_DRAG"}),e!==t&&e.dispatch({type:"UNSET_EVENT_DRAG"})}cleanup(){this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null}}T.SELECTOR=".fc-event-draggable, .fc-event-resizable";class k extends r.X{constructor(e){super(e),this.draggingSegEl=null,this.draggingSeg=null,this.eventRange=null,this.relevantEvents=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=e=>{let{component:t}=this,i=this.querySegEl(e),n=(0,r.Y)(i),s=this.eventRange=n.eventRange;this.dragging.minDistance=t.context.options.eventDragMinDistance,this.dragging.setIgnoreMove(!this.component.isValidSegDownEl(e.origEvent.target)||e.isTouch&&this.component.props.eventSelection!==s.instance.instanceId)},this.handleDragStart=e=>{let{context:t}=this.component,i=this.eventRange;this.relevantEvents=(0,r.aT)(t.getCurrentData().eventStore,this.eventRange.instance.instanceId);let n=this.querySegEl(e);this.draggingSegEl=n,this.draggingSeg=(0,r.Y)(n),t.calendarApi.unselect(),t.emitter.trigger("eventResizeStart",{el:n,event:new r._(t,i.def,i.instance),jsEvent:e.origEvent,view:t.viewApi})},this.handleHitUpdate=(e,t,i)=>{let{context:n}=this.component,s=this.relevantEvents,o=this.hitDragging.initialHit,a=this.eventRange.instance,l=null,c=null,h=!1,d={affectedEvents:s,mutatedEvents:(0,r.H)(),isEvent:!0};e&&(e.componentId===o.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(o,e)||(l=function(e,t,i,n){let s=e.context.dateEnv,o=e.dateSpan.range.start,a=t.dateSpan.range.start,l=(0,r.ay)(o,a,s,e.largeUnit);if(i){if(s.add(n.start,l)<n.end)return{startDelta:l}}else if(s.add(n.end,l)>n.start)return{endDelta:l};return null}(o,e,i.subjectEl.classList.contains("fc-event-resizer-start"),a.range))),l&&(c=(0,r.bV)(s,n.getCurrentData().eventUiBases,l,n),d.mutatedEvents=c,(0,r.bX)(d,e.dateProfile,n)||(h=!0,l=null,c=null,d.mutatedEvents=null)),c?n.dispatch({type:"SET_EVENT_RESIZE",state:d}):n.dispatch({type:"UNSET_EVENT_RESIZE"}),h?(0,r.av)():(0,r.au)(),t||(l&&x(o,e)&&(l=null),this.validMutation=l,this.mutatedRelevantEvents=c)},this.handleDragEnd=e=>{let{context:t}=this.component,i=this.eventRange.def,n=this.eventRange.instance,s=new r._(t,i,n),o=this.relevantEvents,a=this.mutatedRelevantEvents;if(t.emitter.trigger("eventResizeStop",{el:this.draggingSegEl,event:s,jsEvent:e.origEvent,view:t.viewApi}),this.validMutation){let l=new r._(t,a.defs[i.defId],n?a.instances[n.instanceId]:null);t.dispatch({type:"MERGE_EVENTS",eventStore:a});let c={oldEvent:s,event:l,relatedEvents:(0,r.w)(a,t,n),revert(){t.dispatch({type:"MERGE_EVENTS",eventStore:o})}};t.emitter.trigger("eventResize",Object.assign(Object.assign({},c),{el:this.draggingSegEl,startDelta:this.validMutation.startDelta||(0,r.d)(0),endDelta:this.validMutation.endDelta||(0,r.d)(0),jsEvent:e.origEvent,view:t.viewApi})),t.emitter.trigger("eventChange",c)}else t.emitter.trigger("_noEventResize");this.draggingSeg=null,this.relevantEvents=null,this.validMutation=null};let{component:t}=e,i=this.dragging=new g(e.el);i.pointer.selector=".fc-event-resizer",i.touchScrollAllowed=!1,i.autoScroller.isEnabled=t.context.options.dragScroll;let n=this.hitDragging=new v(this.dragging,(0,r.bE)(e));n.emitter.on("pointerdown",this.handlePointerDown),n.emitter.on("dragstart",this.handleDragStart),n.emitter.on("hitupdate",this.handleHitUpdate),n.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}querySegEl(e){return(0,r.Z)(e.subjectEl,".fc-event")}}const M={fixedMirrorParent:r.n},A={dateClick:r.n,eventDragStart:r.n,eventDragStop:r.n,eventDrop:r.n,eventResizeStart:r.n,eventResizeStop:r.n,eventResize:r.n,drop:r.n,eventReceive:r.n,eventLeave:r.n};r.bG.dataAttrPrefix="",r.bF;var C=(0,n.i1)({name:"@fullcalendar/interaction",componentInteractions:[w,S,T,k],calendarInteractions:[class{constructor(e){this.context=e,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=e=>{e.jsEvent&&(this.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=e=>{let t=this.context.options.unselectCancel,i=(0,r.aP)(e.origEvent);this.matchesCancel=!!(0,r.Z)(i,t),this.matchesEvent=!!(0,r.Z)(i,T.SELECTOR)},this.onDocumentPointerUp=e=>{let{context:t}=this,{documentPointer:i}=this,n=t.getCurrentData();if(!i.wasTouchScroll){if(n.dateSelection&&!this.isRecentPointerDateSelect){let i=t.options.unselectAuto;!i||i&&this.matchesCancel||t.calendarApi.unselect(e)}n.eventSelection&&!this.matchesEvent&&t.dispatch({type:"UNSELECT_EVENT"})}this.isRecentPointerDateSelect=!1};let t=this.documentPointer=new l(document);t.shouldIgnoreMove=!0,t.shouldWatchScroll=!1,t.emitter.on("pointerdown",this.onDocumentPointerDown),t.emitter.on("pointerup",this.onDocumentPointerUp),e.emitter.on("select",this.onSelect)}destroy(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()}}],elementDraggingImpl:g,optionRefiners:M,listenerRefiners:A})},8817:(e,t,i)=>{"use strict";i.d(t,{LH:()=>I,eu:()=>L,t7:()=>D});var n=i(9174),r=i(172);class s extends n.bc{constructor(){super(...arguments),this.headerElRef=(0,r._3)()}renderSimpleLayout(e,t){let{props:i,context:s}=this,o=[],a=(0,n.ca)(s.options);return e&&o.push({type:"header",key:"header",isSticky:a,chunk:{elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}}),o.push({type:"body",key:"body",liquid:!0,chunk:{content:t}}),(0,r.n)(n.cq,{elClasses:["fc-daygrid"],viewSpec:s.viewSpec},(0,r.n)(n.bZ,{liquid:!i.isHeightAuto&&!i.forPrint,collapsibleWidth:i.forPrint,cols:[],sections:o}))}renderHScrollLayout(e,t,i,s){let o=this.context.pluginHooks.scrollGridImpl;if(!o)throw new Error("No ScrollGrid implementation");let{props:a,context:l}=this,c=!a.forPrint&&(0,n.ca)(l.options),h=!a.forPrint&&(0,n.c9)(l.options),d=[];return e&&d.push({type:"header",key:"header",isSticky:c,chunks:[{key:"main",elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}]}),d.push({type:"body",key:"body",liquid:!0,chunks:[{key:"main",content:t}]}),h&&d.push({type:"footer",key:"footer",isSticky:!0,chunks:[{key:"main",content:n.c8}]}),(0,r.n)(n.cq,{elClasses:["fc-daygrid"],viewSpec:l.viewSpec},(0,r.n)(o,{liquid:!a.isHeightAuto&&!a.forPrint,forPrint:a.forPrint,collapsibleWidth:a.forPrint,colGroups:[{cols:[{span:i,minWidth:s}]}],sections:d}))}}function o(e,t){let i=[];for(let e=0;e<t;e+=1)i[e]=[];for(let t of e)i[t.row].push(t);return i}function a(e,t){let i=[];for(let e=0;e<t;e+=1)i[e]=[];for(let t of e)i[t.firstCol].push(t);return i}function l(e,t){let i=[];if(e){for(let n=0;n<t;n+=1)i[n]={affectedInstances:e.affectedInstances,isEvent:e.isEvent,segs:[]};for(let t of e.segs)i[t.row].segs.push(t)}else for(let e=0;e<t;e+=1)i[e]=null;return i}const c=(0,n.x)({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"});function h(e){let{display:t}=e.eventRange.ui;return"list-item"===t||"auto"===t&&!e.eventRange.def.allDay&&e.firstCol===e.lastCol&&e.isStart&&e.isEnd}class d extends n.B{render(){let{props:e}=this;return(0,r.n)(n.cg,Object.assign({},e,{elClasses:["fc-daygrid-event","fc-daygrid-block-event","fc-h-event"],defaultTimeFormat:c,defaultDisplayEventEnd:e.defaultDisplayEventEnd,disableResizing:!e.seg.eventRange.def.allDay}))}}class u extends n.B{render(){let{props:e,context:t}=this,{options:i}=t,{seg:s}=e,o=i.eventTimeFormat||c,a=(0,n.bO)(s,o,t,!0,e.defaultDisplayEventEnd);return(0,r.n)(n.ck,Object.assign({},e,{elTag:"a",elClasses:["fc-daygrid-event","fc-daygrid-dot-event"],elAttrs:(0,n.bS)(e.seg,t),defaultGenerator:f,timeText:a,isResizing:!1,isDateSelecting:!1}))}}function f(e){return(0,r.n)(r.FK,null,(0,r.n)("div",{className:"fc-daygrid-event-dot",style:{borderColor:e.borderColor||e.backgroundColor}}),e.timeText&&(0,r.n)("div",{className:"fc-event-time"},e.timeText),(0,r.n)("div",{className:"fc-event-title"},e.event.title||(0,r.n)(r.FK,null," ")))}class p extends n.B{constructor(){super(...arguments),this.compileSegs=(0,n.z)(m)}render(){let{props:e}=this,{allSegs:t,invisibleSegs:i}=this.compileSegs(e.singlePlacements);return(0,r.n)(n.co,{elClasses:["fc-daygrid-more-link"],dateProfile:e.dateProfile,todayRange:e.todayRange,allDayDate:e.allDayDate,moreCnt:e.moreCnt,allSegs:t,hiddenSegs:i,alignmentElRef:e.alignmentElRef,alignGridTop:e.alignGridTop,extraDateSpan:e.extraDateSpan,popoverContent:()=>{let i=(e.eventDrag?e.eventDrag.affectedInstances:null)||(e.eventResize?e.eventResize.affectedInstances:null)||{};return(0,r.n)(r.FK,null,t.map(t=>{let s=t.eventRange.instance.instanceId;return(0,r.n)("div",{className:"fc-daygrid-event-harness",key:s,style:{visibility:i[s]?"hidden":""}},h(t)?(0,r.n)(u,Object.assign({seg:t,isDragging:!1,isSelected:s===e.eventSelection,defaultDisplayEventEnd:!1},(0,n.bQ)(t,e.todayRange))):(0,r.n)(d,Object.assign({seg:t,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:s===e.eventSelection,defaultDisplayEventEnd:!1},(0,n.bQ)(t,e.todayRange))))}))}})}}function m(e){let t=[],i=[];for(let n of e)t.push(n.seg),n.isVisible||i.push(n.seg);return{allSegs:t,invisibleSegs:i}}const g=(0,n.x)({week:"narrow"});class _ extends n.bc{constructor(){super(...arguments),this.rootElRef=(0,r._3)(),this.state={dayNumberId:(0,n.a3)()},this.handleRootEl=e=>{(0,n.W)(this.rootElRef,e),(0,n.W)(this.props.elRef,e)}}render(){let{context:e,props:t,state:i,rootElRef:s}=this,{options:o,dateEnv:a}=e,{date:l,dateProfile:c}=t;const h=t.showDayNumber&&function(e,t,i){const{start:r,end:s}=t,o=(0,n.be)(s,-1),a=i.getYear(r),l=i.getMonth(r),c=i.getYear(o),h=i.getMonth(o);return!(a===c&&l===h)&&Boolean(e.valueOf()===r.valueOf()||1===i.getDay(e)&&e.valueOf()<s.valueOf())}(l,c.currentRange,a);return(0,r.n)(n.ci,{elTag:"td",elRef:this.handleRootEl,elClasses:["fc-daygrid-day",...t.extraClassNames||[]],elAttrs:Object.assign(Object.assign(Object.assign({},t.extraDataAttrs),t.showDayNumber?{"aria-labelledby":i.dayNumberId}:{}),{role:"gridcell"}),defaultGenerator:y,date:l,dateProfile:c,todayRange:t.todayRange,showDayNumber:t.showDayNumber,isMonthStart:h,extraRenderProps:t.extraRenderProps},(a,c)=>(0,r.n)("div",{ref:t.innerElRef,className:"fc-daygrid-day-frame fc-scrollgrid-sync-inner",style:{minHeight:t.minHeight}},t.showWeekNumber&&(0,r.n)(n.cn,{elTag:"a",elClasses:["fc-daygrid-week-number"],elAttrs:(0,n.a_)(e,l,"week"),date:l,defaultFormat:g}),!c.isDisabled&&(t.showDayNumber||(0,n.cj)(o)||t.forceDayTop)?(0,r.n)("div",{className:"fc-daygrid-day-top"},(0,r.n)(a,{elTag:"a",elClasses:["fc-daygrid-day-number",h&&"fc-daygrid-month-start"],elAttrs:Object.assign(Object.assign({},(0,n.a_)(e,l)),{id:i.dayNumberId})})):t.showDayNumber?(0,r.n)("div",{className:"fc-daygrid-day-top",style:{visibility:"hidden"}},(0,r.n)("a",{className:"fc-daygrid-day-number"}," ")):void 0,(0,r.n)("div",{className:"fc-daygrid-day-events",ref:t.fgContentElRef},t.fgContent,(0,r.n)("div",{className:"fc-daygrid-day-bottom",style:{marginTop:t.moreMarginTop}},(0,r.n)(p,{allDayDate:l,singlePlacements:t.singlePlacements,moreCnt:t.moreCnt,alignmentElRef:s,alignGridTop:!t.showDayNumber,extraDateSpan:t.extraDateSpan,dateProfile:t.dateProfile,eventSelection:t.eventSelection,eventDrag:t.eventDrag,eventResize:t.eventResize,todayRange:t.todayRange}))),(0,r.n)("div",{className:"fc-daygrid-day-bg"},t.bgContent)))}}function y(e){return e.dayNumberText||(0,r.n)(r.FK,null," ")}function v(e){return e.eventRange.instance.instanceId+":"+e.firstCol}function x(e){return v(e)+":"+e.lastCol}function b(e,t,i,r){if(e.firstCol===t&&e.lastCol===i-1)return e;let s=e.eventRange,o=s.range,a=(0,n.o)(o,{start:r[t].date,end:(0,n.t)(r[i-1].date,1)});return Object.assign(Object.assign({},e),{firstCol:t,lastCol:i-1,eventRange:{def:s.def,ui:Object.assign(Object.assign({},s.ui),{durationEditable:!1}),instance:s.instance,range:a},isStart:e.isStart&&a.start.valueOf()===o.start.valueOf(),isEnd:e.isEnd&&a.end.valueOf()===o.end.valueOf()})}class w extends n.by{constructor(){super(...arguments),this.hiddenConsumes=!1,this.forceHidden={}}addSegs(e){const t=super.addSegs(e),{entriesByLevel:i}=this,r=e=>!this.forceHidden[(0,n.bz)(e)];for(let e=0;e<i.length;e+=1)i[e]=i[e].filter(r);return t}handleInvalidInsertion(e,t,i){const{entriesByLevel:r,forceHidden:s}=this,{touchingEntry:o,touchingLevel:a,touchingLateral:l}=e;if(this.hiddenConsumes&&o){const e=(0,n.bz)(o);if(!s[e])if(this.allowReslicing){const e=Object.assign(Object.assign({},o),{span:(0,n.bD)(o.span,t.span)});s[(0,n.bz)(e)]=!0,r[a][l]=e,i.push(e),this.splitEntry(o,t,i)}else s[e]=!0,i.push(o)}super.handleInvalidInsertion(e,t,i)}}class S extends n.bc{constructor(){super(...arguments),this.cellElRefs=new n.cd,this.frameElRefs=new n.cd,this.fgElRefs=new n.cd,this.segHarnessRefs=new n.cd,this.rootElRef=(0,r._3)(),this.state={framePositions:null,maxContentHeight:null,segHeights:{}},this.handleResize=e=>{e&&this.updateSizing(!0)}}render(){let{props:e,state:t,context:i}=this,{options:s}=i,o=e.cells.length,l=a(e.businessHourSegs,o),c=a(e.bgEventSegs,o),h=a(this.getHighlightSegs(),o),d=a(this.getMirrorSegs(),o),{singleColPlacements:u,multiColPlacements:f,moreCnts:p,moreMarginTops:m}=function(e,t,i,n,r,s,o){let a=new w(t=>{let i=e[t.index].eventRange.instance.instanceId+":"+t.span.start+":"+(t.span.end-1);return r[i]||1});a.allowReslicing=!0,a.strictOrder=n,!0===t||!0===i?(a.maxCoord=s,a.hiddenConsumes=!0):"number"==typeof t?a.maxStackCnt=t:"number"==typeof i&&(a.maxStackCnt=i,a.hiddenConsumes=!0);let l=[],c=[];for(let t=0;t<e.length;t+=1){let i=e[t],n=x(i);null!=r[n]?l.push({index:t,span:{start:i.firstCol,end:i.lastCol+1}}):c.push(i)}let h=a.addSegs(l),d=a.toRects(),{singleColPlacements:u,multiColPlacements:f,leftoverMargins:p}=function(e,t,i){let n=function(e,t){let i=[];for(let e=0;e<t;e+=1)i.push([]);for(let t of e)for(let e=t.span.start;e<t.span.end;e+=1)i[e].push(t);return i}(e,i.length),r=[],s=[],o=[];for(let e=0;e<i.length;e+=1){let a=n[e],l=[],c=0,h=0;for(let n of a){let r=t[n.index];l.push({seg:b(r,e,e+1,i),isVisible:!0,isAbsolute:!1,absoluteTop:n.levelCoord,marginTop:n.levelCoord-c}),c=n.levelCoord+n.thickness}let d=[];c=0,h=0;for(let n of a){let r=t[n.index],s=n.span.end-n.span.start>1,o=n.span.start===e;h+=n.levelCoord-c,c=n.levelCoord+n.thickness,s?(h+=n.thickness,o&&d.push({seg:b(r,n.span.start,n.span.end,i),isVisible:!0,isAbsolute:!0,absoluteTop:n.levelCoord,marginTop:0})):o&&(d.push({seg:b(r,n.span.start,n.span.end,i),isVisible:!0,isAbsolute:!1,absoluteTop:n.levelCoord,marginTop:h}),h=0)}r.push(l),s.push(d),o.push(h)}return{singleColPlacements:r,multiColPlacements:s,leftoverMargins:o}}(d,e,o),m=[],g=[];for(let e of c){f[e.firstCol].push({seg:e,isVisible:!1,isAbsolute:!0,absoluteTop:0,marginTop:0});for(let t=e.firstCol;t<=e.lastCol;t+=1)u[t].push({seg:b(e,t,t+1,o),isVisible:!1,isAbsolute:!1,absoluteTop:0,marginTop:0})}for(let e=0;e<o.length;e+=1)m.push(0);for(let t of h){let i=e[t.index],n=t.span;f[n.start].push({seg:b(i,n.start,n.end,o),isVisible:!1,isAbsolute:!0,absoluteTop:0,marginTop:0});for(let e=n.start;e<n.end;e+=1)m[e]+=1,u[e].push({seg:b(i,e,e+1,o),isVisible:!1,isAbsolute:!1,absoluteTop:0,marginTop:0})}for(let e=0;e<o.length;e+=1)g.push(p[e]);return{singleColPlacements:u,multiColPlacements:f,moreCnts:m,moreMarginTops:g}}((0,n.bP)(e.fgEventSegs,s.eventOrder),e.dayMaxEvents,e.dayMaxEventRows,s.eventOrderStrict,t.segHeights,t.maxContentHeight,e.cells),g=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{};return(0,r.n)("tr",{ref:this.rootElRef,role:"row"},e.renderIntro&&e.renderIntro(),e.cells.map((t,i)=>{let n=this.renderFgSegs(i,e.forPrint?u[i]:f[i],e.todayRange,g),s=this.renderFgSegs(i,function(e,t){if(!e.length)return[];let i=function(e){let t={};for(let i of e)for(let e of i)t[e.seg.eventRange.instance.instanceId]=e.absoluteTop;return t}(t);return e.map(e=>({seg:e,isVisible:!0,isAbsolute:!0,absoluteTop:i[e.eventRange.instance.instanceId],marginTop:0}))}(d[i],f),e.todayRange,{},Boolean(e.eventDrag),Boolean(e.eventResize),!1);return(0,r.n)(_,{key:t.key,elRef:this.cellElRefs.createRef(t.key),innerElRef:this.frameElRefs.createRef(t.key),dateProfile:e.dateProfile,date:t.date,showDayNumber:e.showDayNumbers,showWeekNumber:e.showWeekNumbers&&0===i,forceDayTop:e.showWeekNumbers,todayRange:e.todayRange,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,extraRenderProps:t.extraRenderProps,extraDataAttrs:t.extraDataAttrs,extraClassNames:t.extraClassNames,extraDateSpan:t.extraDateSpan,moreCnt:p[i],moreMarginTop:m[i],singlePlacements:u[i],fgContentElRef:this.fgElRefs.createRef(t.key),fgContent:(0,r.n)(r.FK,null,(0,r.n)(r.FK,null,n),(0,r.n)(r.FK,null,s)),bgContent:(0,r.n)(r.FK,null,this.renderFillSegs(h[i],"highlight"),this.renderFillSegs(l[i],"non-business"),this.renderFillSegs(c[i],"bg-event")),minHeight:e.cellMinHeight})}))}componentDidMount(){this.updateSizing(!0),this.context.addResizeHandler(this.handleResize)}componentDidUpdate(e,t){let i=this.props;this.updateSizing(!(0,n.E)(e,i))}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}getHighlightSegs(){let{props:e}=this;return e.eventDrag&&e.eventDrag.segs.length?e.eventDrag.segs:e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:e.dateSelectionSegs}getMirrorSegs(){let{props:e}=this;return e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:[]}renderFgSegs(e,t,i,s,o,a,l){let{context:c}=this,{eventSelection:f}=this.props,{framePositions:p}=this.state,m=1===this.props.cells.length,g=o||a||l,_=[];if(p)for(let e of t){let{seg:t}=e,{instanceId:y}=t.eventRange.instance,b=e.isVisible&&!s[y],w=e.isAbsolute,S="",T="";w&&(c.isRtl?(T=0,S=p.lefts[t.lastCol]-p.lefts[t.firstCol]):(S=0,T=p.rights[t.firstCol]-p.rights[t.lastCol])),_.push((0,r.n)("div",{className:"fc-daygrid-event-harness"+(w?" fc-daygrid-event-harness-abs":""),key:v(t),ref:g?null:this.segHarnessRefs.createRef(x(t)),style:{visibility:b?"":"hidden",marginTop:w?"":e.marginTop,top:w?e.absoluteTop:"",left:S,right:T}},h(t)?(0,r.n)(u,Object.assign({seg:t,isDragging:o,isSelected:y===f,defaultDisplayEventEnd:m},(0,n.bQ)(t,i))):(0,r.n)(d,Object.assign({seg:t,isDragging:o,isResizing:a,isDateSelecting:l,isSelected:y===f,defaultDisplayEventEnd:m},(0,n.bQ)(t,i)))))}return _}renderFillSegs(e,t){let{isRtl:i}=this.context,{todayRange:s}=this.props,{framePositions:o}=this.state,a=[];if(o)for(let l of e){let e=i?{right:0,left:o.lefts[l.lastCol]-o.lefts[l.firstCol]}:{left:0,right:o.rights[l.firstCol]-o.rights[l.lastCol]};a.push((0,r.n)("div",{key:(0,n.bR)(l.eventRange),className:"fc-daygrid-bg-harness",style:e},"bg-event"===t?(0,r.n)(n.cm,Object.assign({seg:l},(0,n.bQ)(l,s))):(0,n.cl)(t)))}return(0,r.n)(r.FK,{},...a)}updateSizing(e){let{props:t,state:i,frameElRefs:r}=this;if(!t.forPrint&&null!==t.clientWidth){if(e){let e=t.cells.map(e=>r.currentMap[e.key]);if(e.length){let t=this.rootElRef.current,r=new n.b8(t,e,!0,!1);i.framePositions&&i.framePositions.similarTo(r)||this.setState({framePositions:new n.b8(t,e,!0,!1)})}}const s=this.state.segHeights,o=this.querySegHeights(),a=!0===t.dayMaxEvents||!0===t.dayMaxEventRows;this.safeSetState({segHeights:Object.assign(Object.assign({},s),o),maxContentHeight:a?this.computeMaxContentHeight():null})}}querySegHeights(){let e=this.segHarnessRefs.currentMap,t={};for(let i in e){let n=Math.round(e[i].getBoundingClientRect().height);t[i]=Math.max(t[i]||0,n)}return t}computeMaxContentHeight(){let e=this.props.cells[0].key,t=this.cellElRefs.currentMap[e],i=this.fgElRefs.currentMap[e];return t.getBoundingClientRect().bottom-i.getBoundingClientRect().top}getCellEls(){let e=this.cellElRefs.currentMap;return this.props.cells.map(t=>e[t.key])}}S.addStateEquality({segHeights:n.E});class T extends n.bc{constructor(){super(...arguments),this.splitBusinessHourSegs=(0,n.z)(o),this.splitBgEventSegs=(0,n.z)(k),this.splitFgEventSegs=(0,n.z)(o),this.splitDateSelectionSegs=(0,n.z)(o),this.splitEventDrag=(0,n.z)(l),this.splitEventResize=(0,n.z)(l),this.rowRefs=new n.cd}render(){let{props:e,context:t}=this,i=e.cells.length,s=this.splitBusinessHourSegs(e.businessHourSegs,i),o=this.splitBgEventSegs(e.bgEventSegs,i),a=this.splitFgEventSegs(e.fgEventSegs,i),l=this.splitDateSelectionSegs(e.dateSelectionSegs,i),c=this.splitEventDrag(e.eventDrag,i),h=this.splitEventResize(e.eventResize,i),d=i>=7&&e.clientWidth?e.clientWidth/t.options.aspectRatio/6:null;return(0,r.n)(n.a6,{unit:"day"},(t,n)=>(0,r.n)(r.FK,null,e.cells.map((t,u)=>(0,r.n)(S,{ref:this.rowRefs.createRef(u),key:t.length?t[0].date.toISOString():u,showDayNumbers:i>1,showWeekNumbers:e.showWeekNumbers,todayRange:n,dateProfile:e.dateProfile,cells:t,renderIntro:e.renderRowIntro,businessHourSegs:s[u],eventSelection:e.eventSelection,bgEventSegs:o[u],fgEventSegs:a[u],dateSelectionSegs:l[u],eventDrag:c[u],eventResize:h[u],dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,clientWidth:e.clientWidth,clientHeight:e.clientHeight,cellMinHeight:d,forPrint:e.forPrint}))))}componentDidMount(){this.registerInteractiveComponent()}componentDidUpdate(){this.registerInteractiveComponent()}registerInteractiveComponent(){if(!this.rootEl){const e=this.rowRefs.currentMap[0].getCellEls()[0],t=e?e.closest(".fc-daygrid-body"):null;t&&(this.rootEl=t,this.context.registerInteractiveComponent(this,{el:t,isHitComboAllowed:this.props.isHitComboAllowed}))}}componentWillUnmount(){this.rootEl&&(this.context.unregisterInteractiveComponent(this),this.rootEl=null)}prepareHits(){this.rowPositions=new n.b8(this.rootEl,this.rowRefs.collect().map(e=>e.getCellEls()[0]),!1,!0),this.colPositions=new n.b8(this.rootEl,this.rowRefs.currentMap[0].getCellEls(),!0,!1)}queryHit(e,t){let{colPositions:i,rowPositions:n}=this,r=i.leftToIndex(e),s=n.topToIndex(t);if(null!=s&&null!=r){let e=this.props.cells[s][r];return{dateProfile:this.props.dateProfile,dateSpan:Object.assign({range:this.getCellRange(s,r),allDay:!0},e.extraDateSpan),dayEl:this.getCellEl(s,r),rect:{left:i.lefts[r],right:i.rights[r],top:n.tops[s],bottom:n.bottoms[s]},layer:0}}return null}getCellEl(e,t){return this.rowRefs.currentMap[e].getCellEls()[t]}getCellRange(e,t){let i=this.props.cells[e][t].date;return{start:i,end:(0,n.t)(i,1)}}}function k(e,t){return o(e.filter(M),t)}function M(e){return e.eventRange.def.allDay}class A extends n.bc{constructor(){super(...arguments),this.elRef=(0,r._3)(),this.needsScrollReset=!1}render(){let{props:e}=this,{dayMaxEventRows:t,dayMaxEvents:i,expandRows:n}=e,s=!0===i||!0===t;s&&!n&&(s=!1,t=null,i=null);let o=["fc-daygrid-body",s?"fc-daygrid-body-balanced":"fc-daygrid-body-unbalanced",n?"":"fc-daygrid-body-natural"];return(0,r.n)("div",{ref:this.elRef,className:o.join(" "),style:{width:e.clientWidth,minWidth:e.tableMinWidth}},(0,r.n)("table",{role:"presentation",className:"fc-scrollgrid-sync-table",style:{width:e.clientWidth,minWidth:e.tableMinWidth,height:n?e.clientHeight:""}},e.colGroupNode,(0,r.n)("tbody",{role:"presentation"},(0,r.n)(T,{dateProfile:e.dateProfile,cells:e.cells,renderRowIntro:e.renderRowIntro,showWeekNumbers:e.showWeekNumbers,clientWidth:e.clientWidth,clientHeight:e.clientHeight,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,dayMaxEvents:i,dayMaxEventRows:t,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed}))))}componentDidMount(){this.requestScrollReset()}componentDidUpdate(e){e.dateProfile!==this.props.dateProfile?this.requestScrollReset():this.flushScrollReset()}requestScrollReset(){this.needsScrollReset=!0,this.flushScrollReset()}flushScrollReset(){if(this.needsScrollReset&&this.props.clientWidth){const e=function(e,t){let i;return t.currentRangeUnit.match(/year|month/)&&(i=e.querySelector(`[data-date="${(0,n.bv)(t.currentDate)}-01"]`)),i||(i=e.querySelector(`[data-date="${(0,n.bt)(t.currentDate)}"]`)),i}(this.elRef.current,this.props.dateProfile);if(e){const t=e.closest(".fc-daygrid-body"),i=t.closest(".fc-scroller"),n=e.getBoundingClientRect().top-t.getBoundingClientRect().top;i.scrollTop=n?n+1:0}this.needsScrollReset=!1}}}class C extends n.bU{constructor(){super(...arguments),this.forceDayIfListItem=!0}sliceRange(e,t){return t.sliceRange(e)}}class D extends n.bc{constructor(){super(...arguments),this.slicer=new C,this.tableRef=(0,r._3)()}render(){let{props:e,context:t}=this;return(0,r.n)(A,Object.assign({ref:this.tableRef},this.slicer.sliceProps(e,e.dateProfile,e.nextDayThreshold,t,e.dayTableModel),{dateProfile:e.dateProfile,cells:e.dayTableModel.cells,colGroupNode:e.colGroupNode,tableMinWidth:e.tableMinWidth,renderRowIntro:e.renderRowIntro,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,showWeekNumbers:e.showWeekNumbers,expandRows:e.expandRows,headerAlignElRef:e.headerAlignElRef,clientWidth:e.clientWidth,clientHeight:e.clientHeight,forPrint:e.forPrint}))}}class L extends s{constructor(){super(...arguments),this.buildDayTableModel=(0,n.z)(E),this.headerRef=(0,r._3)(),this.tableRef=(0,r._3)()}render(){let{options:e,dateProfileGenerator:t}=this.context,{props:i}=this,s=this.buildDayTableModel(i.dateProfile,t),o=e.dayHeaders&&(0,r.n)(n.bI,{ref:this.headerRef,dateProfile:i.dateProfile,dates:s.headerDates,datesRepDistinctDays:1===s.rowCnt}),a=t=>(0,r.n)(D,{ref:this.tableRef,dateProfile:i.dateProfile,dayTableModel:s,businessHours:i.businessHours,dateSelection:i.dateSelection,eventStore:i.eventStore,eventUiBases:i.eventUiBases,eventSelection:i.eventSelection,eventDrag:i.eventDrag,eventResize:i.eventResize,nextDayThreshold:e.nextDayThreshold,colGroupNode:t.tableColGroupNode,tableMinWidth:t.tableMinWidth,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,showWeekNumbers:e.weekNumbers,expandRows:!i.isHeightAuto,headerAlignElRef:this.headerElRef,clientWidth:t.clientWidth,clientHeight:t.clientHeight,forPrint:i.forPrint});return e.dayMinWidth?this.renderHScrollLayout(o,a,s.colCnt,e.dayMinWidth):this.renderSimpleLayout(o,a)}}function E(e,t){let i=new n.bM(e.renderRange,t);return new n.bT(i,/year|month|week/.test(e.currentRangeUnit))}class I extends(270==i.j?n.R:null){buildRenderRange(e,t,i){let r=super.buildRenderRange(e,t,i),{props:s}=this;return function(e){let t,{dateEnv:i,currentRange:r}=e,{start:s,end:o}=r;if(e.snapToWeek&&(s=i.startOfWeek(s),t=i.startOfWeek(o),t.valueOf()!==o.valueOf()&&(o=(0,n.bf)(t,1))),e.fixedWeekCount){let e=i.startOfWeek(i.startOfMonth((0,n.t)(r.end,-1))),t=Math.ceil((0,n.bg)(e,o));o=(0,n.bf)(o,6-t)}return{start:s,end:o}}({currentRange:r,snapToWeek:/^(year|month)$/.test(t),fixedWeekCount:s.fixedWeekCount,dateEnv:s.dateEnv})}}(0,n.ct)(':root{--fc-daygrid-event-dot-width:8px}.fc-daygrid-day-events:after,.fc-daygrid-day-events:before,.fc-daygrid-day-frame:after,.fc-daygrid-day-frame:before,.fc-daygrid-event-harness:after,.fc-daygrid-event-harness:before{clear:both;content:"";display:table}.fc .fc-daygrid-body{position:relative;z-index:1}.fc .fc-daygrid-day.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-daygrid-day-frame{min-height:100%;position:relative}.fc .fc-daygrid-day-top{display:flex;flex-direction:row-reverse}.fc .fc-day-other .fc-daygrid-day-top{opacity:.3}.fc .fc-daygrid-day-number{padding:4px;position:relative;z-index:4}.fc .fc-daygrid-month-start{font-size:1.1em;font-weight:700}.fc .fc-daygrid-day-events{margin-top:1px}.fc .fc-daygrid-body-balanced .fc-daygrid-day-events{left:0;position:absolute;right:0}.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events{min-height:2em;position:relative}.fc .fc-daygrid-body-natural .fc-daygrid-day-events{margin-bottom:1em}.fc .fc-daygrid-event-harness{position:relative}.fc .fc-daygrid-event-harness-abs{left:0;position:absolute;right:0;top:0}.fc .fc-daygrid-bg-harness{bottom:0;position:absolute;top:0}.fc .fc-daygrid-day-bg .fc-non-business{z-index:1}.fc .fc-daygrid-day-bg .fc-bg-event{z-index:2}.fc .fc-daygrid-day-bg .fc-highlight{z-index:3}.fc .fc-daygrid-event{margin-top:1px;z-index:6}.fc .fc-daygrid-event.fc-event-mirror{z-index:7}.fc .fc-daygrid-day-bottom{font-size:.85em;margin:0 2px}.fc .fc-daygrid-day-bottom:after,.fc .fc-daygrid-day-bottom:before{clear:both;content:"";display:table}.fc .fc-daygrid-more-link{border-radius:3px;cursor:pointer;line-height:1;margin-top:1px;max-width:100%;overflow:hidden;padding:2px;position:relative;white-space:nowrap;z-index:4}.fc .fc-daygrid-more-link:hover{background-color:rgba(0,0,0,.1)}.fc .fc-daygrid-week-number{background-color:var(--fc-neutral-bg-color);color:var(--fc-neutral-text-color);min-width:1.5em;padding:2px;position:absolute;text-align:center;top:0;z-index:5}.fc .fc-more-popover .fc-popover-body{min-width:220px;padding:10px}.fc-direction-ltr .fc-daygrid-event.fc-event-start,.fc-direction-rtl .fc-daygrid-event.fc-event-end{margin-left:2px}.fc-direction-ltr .fc-daygrid-event.fc-event-end,.fc-direction-rtl .fc-daygrid-event.fc-event-start{margin-right:2px}.fc-direction-ltr .fc-daygrid-more-link{float:left}.fc-direction-ltr .fc-daygrid-week-number{border-radius:0 0 3px 0;left:0}.fc-direction-rtl .fc-daygrid-more-link{float:right}.fc-direction-rtl .fc-daygrid-week-number{border-radius:0 0 0 3px;right:0}.fc-liquid-hack .fc-daygrid-day-frame{position:static}.fc-daygrid-event{border-radius:3px;font-size:var(--fc-small-font-size);position:relative;white-space:nowrap}.fc-daygrid-block-event .fc-event-time{font-weight:700}.fc-daygrid-block-event .fc-event-time,.fc-daygrid-block-event .fc-event-title{padding:1px}.fc-daygrid-dot-event{align-items:center;display:flex;padding:2px 0}.fc-daygrid-dot-event .fc-event-title{flex-grow:1;flex-shrink:1;font-weight:700;min-width:0;overflow:hidden}.fc-daygrid-dot-event.fc-event-mirror,.fc-daygrid-dot-event:hover{background:rgba(0,0,0,.1)}.fc-daygrid-dot-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-daygrid-event-dot{border:calc(var(--fc-daygrid-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-daygrid-event-dot-width)/2);box-sizing:content-box;height:0;margin:0 4px;width:0}.fc-direction-ltr .fc-daygrid-event .fc-event-time{margin-right:3px}.fc-direction-rtl .fc-daygrid-event .fc-event-time{margin-left:3px}')},8848:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>l}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(9760);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(271);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(793);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(222);if(/^(7(06|92|96)|140)$/.test(i.j))var a=i(6906);function l(e){var t,i=(0,n.A)(e),l=(0,o.A)(e),c=null==(t=e.ownerDocument)?void 0:t.body,h=(0,a.T9)(i.scrollWidth,i.clientWidth,c?c.scrollWidth:0,c?c.clientWidth:0),d=(0,a.T9)(i.scrollHeight,i.clientHeight,c?c.scrollHeight:0,c?c.clientHeight:0),u=-l.scrollLeft+(0,s.A)(e),f=-l.scrollTop;return"rtl"===(0,r.A)(c||i).direction&&(u+=(0,a.T9)(i.clientWidth,c?c.clientWidth:0)-h),{width:h,height:d,x:u,y:f}}},8861:function(e,t,i){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(i(5093))},8959:function(e,t,i){!function(e){"use strict";function t(e,t,i){return"m"===i?t?"хвіліна":"хвіліну":"h"===i?t?"гадзіна":"гадзіну":e+" "+(n=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[i].split("_"),n%10==1&&n%100!=11?r[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?r[1]:r[2]);var n,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,i){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(i(5093))},8979:(e,t,i)=>{"use strict";function n(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}i.d(t,{A:()=>n})},9033:function(e,t,i){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(i(5093))},9053:function(e,t,i){!function(e){"use strict";function t(e,t,i,n){switch(i){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,i){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(i(5093))},9068:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var n=i(8979),r={passive:!0};const s={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,s=e.options,o=s.scroll,a=void 0===o||o,l=s.resize,c=void 0===l||l,h=(0,n.A)(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&d.forEach(function(e){e.addEventListener("scroll",i.update,r)}),c&&h.addEventListener("resize",i.update,r),function(){a&&d.forEach(function(e){e.removeEventListener("scroll",i.update,r)}),c&&h.removeEventListener("resize",i.update,r)}},data:{}}},9081:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var n=i(4278),r=i(9913);function s(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function o(e){return[n.Mn,n.pG,n.sQ,n.kb].some(function(t){return e[t]>=0})}const a={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,a=t.rects.popper,l=t.modifiersData.preventOverflow,c=(0,r.A)(t,{elementContext:"reference"}),h=(0,r.A)(t,{altBoundary:!0}),d=s(c,n),u=s(h,a,l),f=o(d),p=o(u);t.modifiersData[i]={referenceClippingOffsets:d,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}}},9174:(e,t,i)=>{"use strict";i.d(t,{$:()=>S,A:()=>Se,B:()=>_t,C:()=>Tt,D:()=>u,E:()=>tt,F:()=>mi,G:()=>Pt,H:()=>Kt,I:()=>hi,J:()=>fi,K:()=>$e,L:()=>Ne,M:()=>Be,N:()=>He,O:()=>je,P:()=>Ue,Q:()=>lt,R:()=>Nt,S:()=>ri,T:()=>ct,U:()=>_i,V:()=>pt,W:()=>yt,X:()=>en,Y:()=>Ei,Z:()=>p,_:()=>ki,a:()=>Ke,a0:()=>T,a1:()=>gt,a2:()=>mt,a3:()=>b,a4:()=>tn,a5:()=>rn,a6:()=>sn,a7:()=>an,a8:()=>ht,a9:()=>Qi,aC:()=>cn,aD:()=>ln,aE:()=>hn,aF:()=>dn,aG:()=>un,aM:()=>f,aN:()=>_,aP:()=>v,aT:()=>Jt,aW:()=>pn,aX:()=>_n,aY:()=>gn,a_:()=>xn,aa:()=>St,ab:()=>l,ac:()=>y,ad:()=>Ci,ap:()=>P,aq:()=>R,ar:()=>O,as:()=>z,at:()=>B,au:()=>I,av:()=>E,ax:()=>zt,ay:()=>Ft,b:()=>At,b0:()=>M,b1:()=>Tn,b3:()=>Mn,b4:()=>kn,b7:()=>It,b8:()=>An,b9:()=>Dn,bA:()=>Rn,bB:()=>Bn,bC:()=>zn,bD:()=>Nn,bE:()=>nn,bF:()=>Hn,bG:()=>jn,bI:()=>Xn,bM:()=>Zn,bN:()=>Di,bO:()=>Yi,bP:()=>Ri,bQ:()=>Bi,bR:()=>ji,bS:()=>Vi,bT:()=>Jn,bU:()=>Kn,bV:()=>bi,bX:()=>er,bY:()=>tr,bZ:()=>vr,ba:()=>Ln,bb:()=>En,bc:()=>In,bd:()=>Ui,be:()=>re,bf:()=>ie,bg:()=>se,bj:()=>oe,bm:()=>q,bn:()=>G,bq:()=>J,br:()=>K,bs:()=>xe,bt:()=>ye,bu:()=>_e,bv:()=>ve,by:()=>Pn,bz:()=>On,c:()=>Q,c8:()=>gr,c9:()=>yr,ca:()=>_r,cb:()=>cr,cd:()=>hr,cg:()=>br,ch:()=>Sr,ci:()=>kr,cj:()=>Mr,ck:()=>xr,cl:()=>Lr,cm:()=>Cr,cn:()=>Er,co:()=>Or,cp:()=>Nr,cq:()=>Mt,cr:()=>yi,ct:()=>a,d:()=>U,e:()=>Ye,f:()=>Qe,g:()=>L,h:()=>Je,i:()=>ee,j:()=>ci,k:()=>Y,l:()=>$i,m:()=>Ze,n:()=>Xe,o:()=>Lt,p:()=>li,q:()=>le,r:()=>Zi,s:()=>X,t:()=>ne,u:()=>Xi,v:()=>et,w:()=>Ai,x:()=>Fe,y:()=>ae,z:()=>we});var n=i(172),r=i(5299);const s=[],o=new Map;function a(e){s.push(e),o.forEach(t=>{h(t,e)})}function l(e){e.isConnected&&e.getRootNode&&c(e.getRootNode())}function c(e){let t=o.get(e);if(!t||!t.isConnected){if(t=e.querySelector("style[data-fullcalendar]"),!t){t=document.createElement("style"),t.setAttribute("data-fullcalendar","");const i=(void 0===d&&(d=function(){const e=document.querySelector('meta[name="csp-nonce"]');if(e&&e.hasAttribute("content"))return e.getAttribute("content");const t=document.querySelector("script[nonce]");return t&&t.nonce||""}()),d);i&&(t.nonce=i);const n=e===document?document.head:e,r=e===document?n.querySelector("script,link[rel=stylesheet],link[as=style],style"):n.firstChild;n.insertBefore(t,r)}o.set(e,t),function(e){for(const t of s)h(e,t)}(t)}}function h(e,t){const{sheet:i}=e,n=i.cssRules.length;t.split("}").forEach((e,t)=>{(e=e.trim())&&i.insertRule(e+"}",n+t)})}let d;"undefined"!=typeof document&&c(document),a(':root{--fc-small-font-size:.85em;--fc-page-bg-color:#fff;--fc-neutral-bg-color:hsla(0,0%,82%,.3);--fc-neutral-text-color:grey;--fc-border-color:#ddd;--fc-button-text-color:#fff;--fc-button-bg-color:#2c3e50;--fc-button-border-color:#2c3e50;--fc-button-hover-bg-color:#1e2b37;--fc-button-hover-border-color:#1a252f;--fc-button-active-bg-color:#1a252f;--fc-button-active-border-color:#151e27;--fc-event-bg-color:#3788d8;--fc-event-border-color:#3788d8;--fc-event-text-color:#fff;--fc-event-selected-overlay-color:rgba(0,0,0,.25);--fc-more-link-bg-color:#d0d0d0;--fc-more-link-text-color:inherit;--fc-event-resizer-thickness:8px;--fc-event-resizer-dot-total-width:8px;--fc-event-resizer-dot-border-width:1px;--fc-non-business-color:hsla(0,0%,84%,.3);--fc-bg-event-color:#8fdf82;--fc-bg-event-opacity:0.3;--fc-highlight-color:rgba(188,232,241,.3);--fc-today-bg-color:rgba(255,220,40,.15);--fc-now-indicator-color:red}.fc-not-allowed,.fc-not-allowed .fc-event{cursor:not-allowed}.fc{display:flex;flex-direction:column;font-size:1em}.fc,.fc *,.fc :after,.fc :before{box-sizing:border-box}.fc table{border-collapse:collapse;border-spacing:0;font-size:1em}.fc th{text-align:center}.fc td,.fc th{padding:0;vertical-align:top}.fc a[data-navlink]{cursor:pointer}.fc a[data-navlink]:hover{text-decoration:underline}.fc-direction-ltr{direction:ltr;text-align:left}.fc-direction-rtl{direction:rtl;text-align:right}.fc-theme-standard td,.fc-theme-standard th{border:1px solid var(--fc-border-color)}.fc-liquid-hack td,.fc-liquid-hack th{position:relative}@font-face{font-family:fcicons;font-style:normal;font-weight:400;src:url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBfAAAAC8AAAAYGNtYXAXVtKNAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZgYydxIAAAF4AAAFNGhlYWQUJ7cIAAAGrAAAADZoaGVhB20DzAAABuQAAAAkaG10eCIABhQAAAcIAAAALGxvY2ED4AU6AAAHNAAAABhtYXhwAA8AjAAAB0wAAAAgbmFtZXsr690AAAdsAAABhnBvc3QAAwAAAAAI9AAAACAAAwPAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpBgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6Qb//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAWIAjQKeAskAEwAAJSc3NjQnJiIHAQYUFwEWMjc2NCcCnuLiDQ0MJAz/AA0NAQAMJAwNDcni4gwjDQwM/wANIwz/AA0NDCMNAAAAAQFiAI0CngLJABMAACUBNjQnASYiBwYUHwEHBhQXFjI3AZ4BAA0N/wAMJAwNDeLiDQ0MJAyNAQAMIw0BAAwMDSMM4uINIwwNDQAAAAIA4gC3Ax4CngATACcAACUnNzY0JyYiDwEGFB8BFjI3NjQnISc3NjQnJiIPAQYUHwEWMjc2NCcB87e3DQ0MIw3VDQ3VDSMMDQ0BK7e3DQ0MJAzVDQ3VDCQMDQ3zuLcMJAwNDdUNIwzWDAwNIwy4twwkDA0N1Q0jDNYMDA0jDAAAAgDiALcDHgKeABMAJwAAJTc2NC8BJiIHBhQfAQcGFBcWMjchNzY0LwEmIgcGFB8BBwYUFxYyNwJJ1Q0N1Q0jDA0Nt7cNDQwjDf7V1Q0N1QwkDA0Nt7cNDQwkDLfWDCMN1Q0NDCQMt7gMIw0MDNYMIw3VDQ0MJAy3uAwjDQwMAAADAFUAAAOrA1UAMwBoAHcAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMhMjY1NCYjISIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAAVYRGRkR/qoRGRkRA1UFBAUOCQkVDAsZDf2rDRkLDBUJCA4FBQUFBQUOCQgVDAsZDQJVDRkLDBUJCQ4FBAVVAgECBQMCBwQECAX9qwQJAwQHAwMFAQICAgIBBQMDBwQDCQQCVQUIBAQHAgMFAgEC/oAZEhEZGRESGQAAAAADAFUAAAOrA1UAMwBoAIkAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMzFRQWMzI2PQEzMjY1NCYrATU0JiMiBh0BIyIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAgBkSEhmAERkZEYAZEhIZgBEZGREDVQUEBQ4JCRUMCxkN/asNGQsMFQkIDgUFBQUFBQ4JCBUMCxkNAlUNGQsMFQkJDgUEBVUCAQIFAwIHBAQIBf2rBAkDBAcDAwUBAgICAgEFAwMHBAMJBAJVBQgEBAcCAwUCAQL+gIASGRkSgBkSERmAEhkZEoAZERIZAAABAOIAjQMeAskAIAAAExcHBhQXFjI/ARcWMjc2NC8BNzY0JyYiDwEnJiIHBhQX4uLiDQ0MJAzi4gwkDA0N4uINDQwkDOLiDCQMDQ0CjeLiDSMMDQ3h4Q0NDCMN4uIMIw0MDOLiDAwNIwwAAAABAAAAAQAAa5n0y18PPPUACwQAAAAAANivOVsAAAAA2K85WwAAAAADqwNVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAOrAAEAAAAAAAAAAAAAAAAAAAALBAAAAAAAAAAAAAAAAgAAAAQAAWIEAAFiBAAA4gQAAOIEAABVBAAAVQQAAOIAAAAAAAoAFAAeAEQAagCqAOoBngJkApoAAQAAAAsAigADAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGZjaWNvbnMAZgBjAGkAYwBvAG4Ac1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGZjaWNvbnMAZgBjAGkAYwBvAG4Ac2ZjaWNvbnMAZgBjAGkAYwBvAG4Ac1JlZ3VsYXIAUgBlAGcAdQBsAGEAcmZjaWNvbnMAZgBjAGkAYwBvAG4Ac0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") format("truetype")}.fc-icon{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:fcicons!important;font-style:normal;font-variant:normal;font-weight:400;height:1em;line-height:1;text-align:center;text-transform:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:1em}.fc-icon-chevron-left:before{content:"\\e900"}.fc-icon-chevron-right:before{content:"\\e901"}.fc-icon-chevrons-left:before{content:"\\e902"}.fc-icon-chevrons-right:before{content:"\\e903"}.fc-icon-minus-square:before{content:"\\e904"}.fc-icon-plus-square:before{content:"\\e905"}.fc-icon-x:before{content:"\\e906"}.fc .fc-button{border-radius:0;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible;text-transform:none}.fc .fc-button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.fc .fc-button{-webkit-appearance:button}.fc .fc-button:not(:disabled){cursor:pointer}.fc .fc-button{background-color:transparent;border:1px solid transparent;border-radius:.25em;display:inline-block;font-size:1em;font-weight:400;line-height:1.5;padding:.4em .65em;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}.fc .fc-button:hover{text-decoration:none}.fc .fc-button:focus{box-shadow:0 0 0 .2rem rgba(44,62,80,.25);outline:0}.fc .fc-button:disabled{opacity:.65}.fc .fc-button-primary{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:hover{background-color:var(--fc-button-hover-bg-color);border-color:var(--fc-button-hover-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:disabled{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button-primary:not(:disabled).fc-button-active,.fc .fc-button-primary:not(:disabled):active{background-color:var(--fc-button-active-bg-color);border-color:var(--fc-button-active-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:not(:disabled).fc-button-active:focus,.fc .fc-button-primary:not(:disabled):active:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button .fc-icon{font-size:1.5em;vertical-align:middle}.fc .fc-button-group{display:inline-flex;position:relative;vertical-align:middle}.fc .fc-button-group>.fc-button{flex:1 1 auto;position:relative}.fc .fc-button-group>.fc-button.fc-button-active,.fc .fc-button-group>.fc-button:active,.fc .fc-button-group>.fc-button:focus,.fc .fc-button-group>.fc-button:hover{z-index:1}.fc-direction-ltr .fc-button-group>.fc-button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}.fc-direction-ltr .fc-button-group>.fc-button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.fc-direction-rtl .fc-button-group>.fc-button:not(:first-child){border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.fc-direction-rtl .fc-button-group>.fc-button:not(:last-child){border-bottom-left-radius:0;border-top-left-radius:0}.fc .fc-toolbar{align-items:center;display:flex;justify-content:space-between}.fc .fc-toolbar.fc-header-toolbar{margin-bottom:1.5em}.fc .fc-toolbar.fc-footer-toolbar{margin-top:1.5em}.fc .fc-toolbar-title{font-size:1.75em;margin:0}.fc-direction-ltr .fc-toolbar>*>:not(:first-child){margin-left:.75em}.fc-direction-rtl .fc-toolbar>*>:not(:first-child){margin-right:.75em}.fc-direction-rtl .fc-toolbar-ltr{flex-direction:row-reverse}.fc .fc-scroller{-webkit-overflow-scrolling:touch;position:relative}.fc .fc-scroller-liquid{height:100%}.fc .fc-scroller-liquid-absolute{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-scroller-harness{direction:ltr;overflow:hidden;position:relative}.fc .fc-scroller-harness-liquid{height:100%}.fc-direction-rtl .fc-scroller-harness>.fc-scroller{direction:rtl}.fc-theme-standard .fc-scrollgrid{border:1px solid var(--fc-border-color)}.fc .fc-scrollgrid,.fc .fc-scrollgrid table{table-layout:fixed;width:100%}.fc .fc-scrollgrid table{border-left-style:hidden;border-right-style:hidden;border-top-style:hidden}.fc .fc-scrollgrid{border-bottom-width:0;border-collapse:separate;border-right-width:0}.fc .fc-scrollgrid-liquid{height:100%}.fc .fc-scrollgrid-section,.fc .fc-scrollgrid-section table,.fc .fc-scrollgrid-section>td{height:1px}.fc .fc-scrollgrid-section-liquid>td{height:100%}.fc .fc-scrollgrid-section>*{border-left-width:0;border-top-width:0}.fc .fc-scrollgrid-section-footer>*,.fc .fc-scrollgrid-section-header>*{border-bottom-width:0}.fc .fc-scrollgrid-section-body table,.fc .fc-scrollgrid-section-footer table{border-bottom-style:hidden}.fc .fc-scrollgrid-section-sticky>*{background:var(--fc-page-bg-color);position:sticky;z-index:3}.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky>*{top:0}.fc .fc-scrollgrid-section-footer.fc-scrollgrid-section-sticky>*{bottom:0}.fc .fc-scrollgrid-sticky-shim{height:1px;margin-bottom:-1px}.fc-sticky{position:sticky}.fc .fc-view-harness{flex-grow:1;position:relative}.fc .fc-view-harness-active>.fc-view{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-col-header-cell-cushion{display:inline-block;padding:2px 4px}.fc .fc-bg-event,.fc .fc-highlight,.fc .fc-non-business{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-non-business{background:var(--fc-non-business-color)}.fc .fc-bg-event{background:var(--fc-bg-event-color);opacity:var(--fc-bg-event-opacity)}.fc .fc-bg-event .fc-event-title{font-size:var(--fc-small-font-size);font-style:italic;margin:.5em}.fc .fc-highlight{background:var(--fc-highlight-color)}.fc .fc-cell-shaded,.fc .fc-day-disabled{background:var(--fc-neutral-bg-color)}a.fc-event,a.fc-event:hover{text-decoration:none}.fc-event.fc-event-draggable,.fc-event[href]{cursor:pointer}.fc-event .fc-event-main{position:relative;z-index:2}.fc-event-dragging:not(.fc-event-selected){opacity:.75}.fc-event-dragging.fc-event-selected{box-shadow:0 2px 7px rgba(0,0,0,.3)}.fc-event .fc-event-resizer{display:none;position:absolute;z-index:4}.fc-event-selected .fc-event-resizer,.fc-event:hover .fc-event-resizer{display:block}.fc-event-selected .fc-event-resizer{background:var(--fc-page-bg-color);border-color:inherit;border-radius:calc(var(--fc-event-resizer-dot-total-width)/2);border-style:solid;border-width:var(--fc-event-resizer-dot-border-width);height:var(--fc-event-resizer-dot-total-width);width:var(--fc-event-resizer-dot-total-width)}.fc-event-selected .fc-event-resizer:before{bottom:-20px;content:"";left:-20px;position:absolute;right:-20px;top:-20px}.fc-event-selected,.fc-event:focus{box-shadow:0 2px 5px rgba(0,0,0,.2)}.fc-event-selected:before,.fc-event:focus:before{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:3}.fc-event-selected:after,.fc-event:focus:after{background:var(--fc-event-selected-overlay-color);bottom:-1px;content:"";left:-1px;position:absolute;right:-1px;top:-1px;z-index:1}.fc-h-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-h-event .fc-event-main{color:var(--fc-event-text-color)}.fc-h-event .fc-event-main-frame{display:flex}.fc-h-event .fc-event-time{max-width:100%;overflow:hidden}.fc-h-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-width:0}.fc-h-event .fc-event-title{display:inline-block;left:0;max-width:100%;overflow:hidden;right:0;vertical-align:top}.fc-h-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end){border-bottom-left-radius:0;border-left-width:0;border-top-left-radius:0}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start){border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.fc-h-event:not(.fc-event-selected) .fc-event-resizer{bottom:0;top:0;width:var(--fc-event-resizer-thickness)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end{cursor:w-resize;left:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start{cursor:e-resize;right:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-h-event.fc-event-selected .fc-event-resizer{margin-top:calc(var(--fc-event-resizer-dot-total-width)*-.5);top:50%}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-start,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-end{left:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-end,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-start{right:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc .fc-popover{box-shadow:0 2px 6px rgba(0,0,0,.15);position:absolute;z-index:9999}.fc .fc-popover-header{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:3px 4px}.fc .fc-popover-title{margin:0 2px}.fc .fc-popover-close{cursor:pointer;font-size:1.1em;opacity:.65}.fc-theme-standard .fc-popover{background:var(--fc-page-bg-color);border:1px solid var(--fc-border-color)}.fc-theme-standard .fc-popover-header{background:var(--fc-neutral-bg-color)}');class u{constructor(e){this.drainedOption=e,this.isRunning=!1,this.isDirty=!1,this.pauseDepths={},this.timeoutId=0}request(e){this.isDirty=!0,this.isPaused()||(this.clearTimeout(),null==e?this.tryDrain():this.timeoutId=setTimeout(this.tryDrain.bind(this),e))}pause(e=""){let{pauseDepths:t}=this;t[e]=(t[e]||0)+1,this.clearTimeout()}resume(e="",t){let{pauseDepths:i}=this;e in i&&(t?delete i[e]:(i[e]-=1,i[e]<=0&&delete i[e]),this.tryDrain())}isPaused(){return Object.keys(this.pauseDepths).length}tryDrain(){if(!this.isRunning&&!this.isPaused()){for(this.isRunning=!0;this.isDirty;)this.isDirty=!1,this.drained();this.isRunning=!1}}clear(){this.clearTimeout(),this.isDirty=!1,this.pauseDepths={}}clearTimeout(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=0)}drained(){this.drainedOption&&this.drainedOption()}}function f(e){e.parentNode&&e.parentNode.removeChild(e)}function p(e,t){if(e.closest)return e.closest(t);if(!document.documentElement.contains(e))return null;do{if(m(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}function m(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector).call(e,t)}const g=/(top|left|right|bottom|width|height)$/i;function _(e,t){for(let i in t)y(e,i,t[i])}function y(e,t,i){null==i?e.style[t]="":"number"==typeof i&&g.test(t)?e.style[t]=`${i}px`:e.style[t]=i}function v(e){var t,i;return null!==(i=null===(t=e.composedPath)||void 0===t?void 0:t.call(e)[0])&&void 0!==i?i:e.target}let x=0;function b(){return x+=1,"fc-dom-"+x}function w(e){e.preventDefault()}function S(e,t,i,n){let r=function(e,t){return i=>{let n=p(i.target,e);n&&t.call(n,i,n)}}(i,n);return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function T(e,t,i,n){let r;return S(e,"mouseover",t,(e,t)=>{if(t!==r){r=t,i(e,t);let s=e=>{r=null,n(e,t),t.removeEventListener("mouseleave",s)};t.addEventListener("mouseleave",s)}})}const k=270==i.j?["webkitTransitionEnd","otransitionend","oTransitionEnd","msTransitionEnd","transitionend"]:null;function M(e,t){let i=n=>{t(n),k.forEach(t=>{e.removeEventListener(t,i)})};k.forEach(t=>{e.addEventListener(t,i)})}function A(e){return Object.assign({onClick:e},C(e))}function C(e){return{tabIndex:0,onKeyDown(t){"Enter"!==t.key&&" "!==t.key||(e(t),t.preventDefault())}}}let D=0;function L(){return D+=1,String(D)}function E(){document.body.classList.add("fc-not-allowed")}function I(){document.body.classList.remove("fc-not-allowed")}function P(e){e.style.userSelect="none",e.style.webkitUserSelect="none",e.addEventListener("selectstart",w)}function R(e){e.style.userSelect="",e.style.webkitUserSelect="",e.removeEventListener("selectstart",w)}function O(e){e.addEventListener("contextmenu",w)}function z(e){e.removeEventListener("contextmenu",w)}function F(e,t,i){return i.func?i.func(e,t):(n=e[i.field],r=t[i.field],(n||r?null==r?-1:null==n?1:"string"==typeof n||"string"==typeof r?String(n).localeCompare(String(r)):n-r:0)*(i.order||1));var n,r}function N(e,t){let i=String(e);return"000".substr(0,t-i.length)+i}function Y(e,t,i){return"function"==typeof e?e(...t):"string"==typeof e?t.reduce((e,t,i)=>e.replace("$"+i,t||""),e):i}function B(e,t){return e-t}function H(e){return e%1==0}function j(e){let t=e.querySelector(".fc-scrollgrid-shrink-frame"),i=e.querySelector(".fc-scrollgrid-shrink-cushion");if(!t)throw new Error("needs fc-scrollgrid-shrink-frame className");if(!i)throw new Error("needs fc-scrollgrid-shrink-cushion className");return e.getBoundingClientRect().width-t.getBoundingClientRect().width+i.getBoundingClientRect().width}const V=270==i.j?["years","months","days","milliseconds"]:null,W=/^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/;function U(e,t){return"string"==typeof e?function(e){let t=W.exec(e);if(t){let e=t[1]?-1:1;return{years:0,months:0,days:e*(t[2]?parseInt(t[2],10):0),milliseconds:e*(60*(t[3]?parseInt(t[3],10):0)*60*1e3+60*(t[4]?parseInt(t[4],10):0)*1e3+1e3*(t[5]?parseInt(t[5],10):0)+(t[6]?parseInt(t[6],10):0))}}return null}(e):"object"==typeof e&&e?$(e):"number"==typeof e?$({[t||"milliseconds"]:e}):null}function $(e){let t={years:e.years||e.year||0,months:e.months||e.month||0,days:e.days||e.day||0,milliseconds:60*(e.hours||e.hour||0)*60*1e3+60*(e.minutes||e.minute||0)*1e3+1e3*(e.seconds||e.second||0)+(e.milliseconds||e.millisecond||e.ms||0)},i=e.weeks||e.week;return i&&(t.days+=7*i,t.specifiedWeeks=!0),t}function G(e,t){return{years:e.years+t.years,months:e.months+t.months,days:e.days+t.days,milliseconds:e.milliseconds+t.milliseconds}}function X(e,t){return{years:e.years-t.years,months:e.months-t.months,days:e.days-t.days,milliseconds:e.milliseconds-t.milliseconds}}function q(e,t){return{years:e.years*t,months:e.months*t,days:e.days*t,milliseconds:e.milliseconds*t}}function Z(e){return J(e)/864e5}function J(e){return 31536e6*e.years+2592e6*e.months+864e5*e.days+e.milliseconds}function K(e,t){let i=null;for(let n=0;n<V.length;n+=1){let r=V[n];if(t[r]){let n=e[r]/t[r];if(!H(n)||null!==i&&i!==n)return null;i=n}else if(e[r])return null}return i}function Q(e){let t=e.milliseconds;if(t){if(t%1e3!=0)return{unit:"millisecond",value:t};if(t%6e4!=0)return{unit:"second",value:t/1e3};if(t%36e5!=0)return{unit:"minute",value:t/6e4};if(t)return{unit:"hour",value:t/36e5}}return e.days?e.specifiedWeeks&&e.days%7==0?{unit:"week",value:e.days/7}:{unit:"day",value:e.days}:e.months?{unit:"month",value:e.months}:e.years?{unit:"year",value:e.years}:{unit:"millisecond",value:0}}function ee(e,t,i){if(e===t)return!0;let n,r=e.length;if(r!==t.length)return!1;for(n=0;n<r;n+=1)if(!(i?i(e[n],t[n]):e[n]===t[n]))return!1;return!0}const te=["sun","mon","tue","wed","thu","fri","sat"];function ie(e,t){let i=fe(e);return i[2]+=7*t,pe(i)}function ne(e,t){let i=fe(e);return i[2]+=t,pe(i)}function re(e,t){let i=fe(e);return i[6]+=t,pe(i)}function se(e,t){return oe(e,t)/7}function oe(e,t){return(t.valueOf()-e.valueOf())/864e5}function ae(e,t){return ge(e)===ge(t)?Math.round(oe(e,t)):null}function le(e){return pe([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()])}function ce(e,t,i,n){let r=pe([t,0,1+he(t,i,n)]),s=le(e),o=Math.round(oe(r,s));return Math.floor(o/7)+1}function he(e,t,i){let n=7+t-i;return-(7+pe([e,0,n]).getUTCDay()-t)%7+n-1}function de(e){return[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()]}function ue(e){return new Date(e[0],e[1]||0,null==e[2]?1:e[2],e[3]||0,e[4]||0,e[5]||0)}function fe(e){return[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()]}function pe(e){return 1===e.length&&(e=e.concat([0])),new Date(Date.UTC(...e))}function me(e){return!isNaN(e.valueOf())}function ge(e){return 1e3*e.getUTCHours()*60*60+1e3*e.getUTCMinutes()*60+1e3*e.getUTCSeconds()+e.getUTCMilliseconds()}function _e(e,t,i=!1){let n=e.toISOString();return n=n.replace(".000",""),i&&(n=n.replace("T00:00:00Z","")),n.length>10&&(null==t?n=n.replace("Z",""):0!==t&&(n=n.replace("Z",be(t,!0)))),n}function ye(e){return e.toISOString().replace(/T.*$/,"")}function ve(e){return e.toISOString().match(/^\d{4}-\d{2}/)[0]}function xe(e){return N(e.getUTCHours(),2)+":"+N(e.getUTCMinutes(),2)+":"+N(e.getUTCSeconds(),2)}function be(e,t=!1){let i=e<0?"-":"+",n=Math.abs(e),r=Math.floor(n/60),s=Math.round(n%60);return t?`${i+N(r,2)}:${N(s,2)}`:`GMT${i}${r}${s?`:${N(s,2)}`:""}`}function we(e,t,i){let n,r;return function(...s){if(n){if(!ee(n,s)){i&&i(r);let n=e.apply(this,s);t&&t(n,r)||(r=n)}}else r=e.apply(this,s);return n=s,r}}function Se(e,t,i){let n,r;return s=>{if(n){if(!tt(n,s)){i&&i(r);let n=e.call(this,s);t&&t(n,r)||(r=n)}}else r=e.call(this,s);return n=s,r}}const Te={week:3,separator:9,omitZeroMinute:9,meridiem:9,omitCommas:9},ke={timeZoneName:7,era:6,year:5,month:4,day:2,weekday:2,hour:1,minute:1,second:1},Me=/\s*([ap])\.?m\.?/i,Ae=/,/g,Ce=/\s+/g,De=/\u200e/g,Le=/UTC|GMT/;class Ee{constructor(e){let t={},i={},n=9;for(let r in e)r in Te?(i[r]=e[r],Te[r]<9&&(n=Math.min(Te[r],n))):(t[r]=e[r],r in ke&&(n=Math.min(ke[r],n)));this.standardDateProps=t,this.extendedSettings=i,this.smallestUnitNum=n,this.buildFormattingFunc=we(Ie)}format(e,t){return this.buildFormattingFunc(this.standardDateProps,this.extendedSettings,t)(e)}formatRange(e,t,i,n){let{standardDateProps:r,extendedSettings:s}=this,o=(a=e.marker,l=t.marker,(c=i.calendarSystem).getMarkerYear(a)!==c.getMarkerYear(l)?5:c.getMarkerMonth(a)!==c.getMarkerMonth(l)?4:c.getMarkerDay(a)!==c.getMarkerDay(l)?2:ge(a)!==ge(l)?1:0);var a,l,c;if(!o)return this.format(e,i);let h=o;!(h>1)||"numeric"!==r.year&&"2-digit"!==r.year||"numeric"!==r.month&&"2-digit"!==r.month||"numeric"!==r.day&&"2-digit"!==r.day||(h=1);let d=this.format(e,i),u=this.format(t,i);if(d===u)return d;let f=Ie(function(e,t){let i={};for(let n in e)(!(n in ke)||ke[n]<=t)&&(i[n]=e[n]);return i}(r,h),s,i),p=f(e),m=f(t),g=function(e,t,i,n){let r=0;for(;r<e.length;){let s=e.indexOf(t,r);if(-1===s)break;let o=e.substr(0,s);r=s+t.length;let a=e.substr(r),l=0;for(;l<i.length;){let e=i.indexOf(n,l);if(-1===e)break;let t=i.substr(0,e);l=e+n.length;let r=i.substr(l);if(o===t&&a===r)return{before:o,after:a}}}return null}(d,p,u,m),_=s.separator||n||i.defaultSeparator||"";return g?g.before+p+_+m+g.after:d+_+u}getSmallestUnit(){switch(this.smallestUnitNum){case 7:case 6:case 5:return"year";case 4:return"month";case 3:return"week";case 2:return"day";default:return"time"}}}function Ie(e,t,i){let n=Object.keys(e).length;return 1===n&&"short"===e.timeZoneName?e=>be(e.timeZoneOffset):0===n&&t.week?e=>function(e,t,i,n,r){let s=[];return"long"===r?s.push(i):"short"!==r&&"narrow"!==r||s.push(t),"long"!==r&&"short"!==r||s.push(" "),s.push(n.simpleNumberFormat.format(e)),"rtl"===n.options.direction&&s.reverse(),s.join("")}(i.computeWeekNumber(e.marker),i.weekText,i.weekTextLong,i.locale,t.week):function(e,t,i){e=Object.assign({},e),t=Object.assign({},t),function(e,t){e.timeZoneName&&(e.hour||(e.hour="2-digit"),e.minute||(e.minute="2-digit")),"long"===e.timeZoneName&&(e.timeZoneName="short"),t.omitZeroMinute&&(e.second||e.millisecond)&&delete t.omitZeroMinute}(e,t),e.timeZone="UTC";let n,r=new Intl.DateTimeFormat(i.locale.codes,e);if(t.omitZeroMinute){let t=Object.assign({},e);delete t.minute,n=new Intl.DateTimeFormat(i.locale.codes,t)}return s=>{let o,{marker:a}=s;return o=n&&!a.getUTCMinutes()?n:r,function(e,t,i,n,r){return e=e.replace(De,""),"short"===i.timeZoneName&&(e=function(e,t){let i=!1;return e=e.replace(Le,()=>(i=!0,t)),i||(e+=` ${t}`),e}(e,"UTC"===r.timeZone||null==t.timeZoneOffset?"UTC":be(t.timeZoneOffset))),n.omitCommas&&(e=e.replace(Ae,"").trim()),n.omitZeroMinute&&(e=e.replace(":00","")),!1===n.meridiem?e=e.replace(Me,"").trim():"narrow"===n.meridiem?e=e.replace(Me,(e,t)=>t.toLocaleLowerCase()):"short"===n.meridiem?e=e.replace(Me,(e,t)=>`${t.toLocaleLowerCase()}m`):"lowercase"===n.meridiem&&(e=e.replace(Me,e=>e.toLocaleLowerCase())),e=(e=e.replace(Ce," ")).trim()}(o.format(a),s,e,t,i)}}(e,t,i)}function Pe(e,t){let i=t.markerToArray(e.marker);return{marker:e.marker,timeZoneOffset:e.timeZoneOffset,array:i,year:i[0],month:i[1],day:i[2],hour:i[3],minute:i[4],second:i[5],millisecond:i[6]}}function Re(e,t,i,n){let r=Pe(e,i.calendarSystem);return{date:r,start:r,end:t?Pe(t,i.calendarSystem):null,timeZone:i.timeZone,localeCodes:i.locale.codes,defaultSeparator:n||i.defaultSeparator}}class Oe{constructor(e){this.cmdStr=e}format(e,t,i){return t.cmdFormatter(this.cmdStr,Re(e,null,t,i))}formatRange(e,t,i,n){return i.cmdFormatter(this.cmdStr,Re(e,t,i,n))}}class ze{constructor(e){this.func=e}format(e,t,i){return this.func(Re(e,null,t,i))}formatRange(e,t,i,n){return this.func(Re(e,t,i,n))}}function Fe(e){return"object"==typeof e&&e?new Ee(e):"string"==typeof e?new Oe(e):"function"==typeof e?new ze(e):null}const Ne={navLinkDayClick:Xe,navLinkWeekClick:Xe,duration:U,bootstrapFontAwesome:Xe,buttonIcons:Xe,customButtons:Xe,defaultAllDayEventDuration:U,defaultTimedEventDuration:U,nextDayThreshold:U,scrollTime:U,scrollTimeReset:Boolean,slotMinTime:U,slotMaxTime:U,dayPopoverFormat:Fe,slotDuration:U,snapDuration:U,headerToolbar:Xe,footerToolbar:Xe,defaultRangeSeparator:String,titleRangeSeparator:String,forceEventDuration:Boolean,dayHeaders:Boolean,dayHeaderFormat:Fe,dayHeaderClassNames:Xe,dayHeaderContent:Xe,dayHeaderDidMount:Xe,dayHeaderWillUnmount:Xe,dayCellClassNames:Xe,dayCellContent:Xe,dayCellDidMount:Xe,dayCellWillUnmount:Xe,initialView:String,aspectRatio:Number,weekends:Boolean,weekNumberCalculation:Xe,weekNumbers:Boolean,weekNumberClassNames:Xe,weekNumberContent:Xe,weekNumberDidMount:Xe,weekNumberWillUnmount:Xe,editable:Boolean,viewClassNames:Xe,viewDidMount:Xe,viewWillUnmount:Xe,nowIndicator:Boolean,nowIndicatorSnap:Xe,nowIndicatorClassNames:Xe,nowIndicatorContent:Xe,nowIndicatorDidMount:Xe,nowIndicatorWillUnmount:Xe,showNonCurrentDates:Boolean,lazyFetching:Boolean,startParam:String,endParam:String,timeZoneParam:String,timeZone:String,locales:Xe,locale:Xe,themeSystem:String,dragRevertDuration:Number,dragScroll:Boolean,allDayMaintainDuration:Boolean,unselectAuto:Boolean,dropAccept:Xe,eventOrder:function(e){let t,i,n=[],r=[];for("string"==typeof e?r=e.split(/\s*,\s*/):"function"==typeof e?r=[e]:Array.isArray(e)&&(r=e),t=0;t<r.length;t+=1)i=r[t],"string"==typeof i?n.push("-"===i.charAt(0)?{field:i.substring(1),order:-1}:{field:i,order:1}):"function"==typeof i&&n.push({func:i});return n},eventOrderStrict:Boolean,handleWindowResize:Boolean,windowResizeDelay:Number,longPressDelay:Number,eventDragMinDistance:Number,expandRows:Boolean,height:Xe,contentHeight:Xe,direction:String,weekNumberFormat:Fe,eventResizableFromStart:Boolean,displayEventTime:Boolean,displayEventEnd:Boolean,weekText:String,weekTextLong:String,progressiveEventRendering:Boolean,businessHours:Xe,initialDate:Xe,now:Xe,eventDataTransform:Xe,stickyHeaderDates:Xe,stickyFooterScrollbar:Xe,viewHeight:Xe,defaultAllDay:Boolean,eventSourceFailure:Xe,eventSourceSuccess:Xe,eventDisplay:String,eventStartEditable:Boolean,eventDurationEditable:Boolean,eventOverlap:Xe,eventConstraint:Xe,eventAllow:Xe,eventBackgroundColor:String,eventBorderColor:String,eventTextColor:String,eventColor:String,eventClassNames:Xe,eventContent:Xe,eventDidMount:Xe,eventWillUnmount:Xe,selectConstraint:Xe,selectOverlap:Xe,selectAllow:Xe,droppable:Boolean,unselectCancel:String,slotLabelFormat:Xe,slotLaneClassNames:Xe,slotLaneContent:Xe,slotLaneDidMount:Xe,slotLaneWillUnmount:Xe,slotLabelClassNames:Xe,slotLabelContent:Xe,slotLabelDidMount:Xe,slotLabelWillUnmount:Xe,dayMaxEvents:Xe,dayMaxEventRows:Xe,dayMinWidth:Number,slotLabelInterval:U,allDayText:String,allDayClassNames:Xe,allDayContent:Xe,allDayDidMount:Xe,allDayWillUnmount:Xe,slotMinWidth:Number,navLinks:Boolean,eventTimeFormat:Fe,rerenderDelay:Number,moreLinkText:Xe,moreLinkHint:Xe,selectMinDistance:Number,selectable:Boolean,selectLongPressDelay:Number,eventLongPressDelay:Number,selectMirror:Boolean,eventMaxStack:Number,eventMinHeight:Number,eventMinWidth:Number,eventShortHeight:Number,slotEventOverlap:Boolean,plugins:Xe,firstDay:Number,dayCount:Number,dateAlignment:String,dateIncrement:U,hiddenDays:Xe,fixedWeekCount:Boolean,validRange:Xe,visibleRange:Xe,titleFormat:Xe,eventInteractive:Boolean,noEventsText:String,viewHint:Xe,navLinkHint:Xe,closeHint:String,timeHint:String,eventHint:String,moreLinkClick:Xe,moreLinkClassNames:Xe,moreLinkContent:Xe,moreLinkDidMount:Xe,moreLinkWillUnmount:Xe,monthStartFormat:Fe,handleCustomRendering:Xe,customRenderingMetaMap:Xe,customRenderingReplaces:Boolean},Ye={eventDisplay:"auto",defaultRangeSeparator:" - ",titleRangeSeparator:" – ",defaultTimedEventDuration:"01:00:00",defaultAllDayEventDuration:{day:1},forceEventDuration:!1,nextDayThreshold:"00:00:00",dayHeaders:!0,initialView:"",aspectRatio:1.35,headerToolbar:{start:"title",center:"",end:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"local",editable:!1,nowIndicator:!1,scrollTime:"06:00:00",scrollTimeReset:!0,slotMinTime:"00:00:00",slotMaxTime:"24:00:00",showNonCurrentDates:!0,lazyFetching:!0,startParam:"start",endParam:"end",timeZoneParam:"timeZone",timeZone:"local",locales:[],locale:"",themeSystem:"standard",dragRevertDuration:500,dragScroll:!0,allDayMaintainDuration:!1,unselectAuto:!0,dropAccept:"*",eventOrder:"start,-duration,allDay,title",dayPopoverFormat:{month:"long",day:"numeric",year:"numeric"},handleWindowResize:!0,windowResizeDelay:100,longPressDelay:1e3,eventDragMinDistance:5,expandRows:!1,navLinks:!1,selectable:!1,eventMinHeight:15,eventMinWidth:30,eventShortHeight:30,monthStartFormat:{month:"long",day:"numeric"},nowIndicatorSnap:"auto"},Be={datesSet:Xe,eventsSet:Xe,eventAdd:Xe,eventChange:Xe,eventRemove:Xe,windowResize:Xe,eventClick:Xe,eventMouseEnter:Xe,eventMouseLeave:Xe,select:Xe,unselect:Xe,loading:Xe,_unmount:Xe,_beforeprint:Xe,_afterprint:Xe,_noEventDrop:Xe,_noEventResize:Xe,_resize:Xe,_scrollRequest:Xe},He={buttonText:Xe,buttonHints:Xe,views:Xe,plugins:Xe,initialEvents:Xe,events:Xe,eventSources:Xe},je={headerToolbar:Ve,footerToolbar:Ve,buttonText:Ve,buttonHints:Ve,buttonIcons:Ve,dateIncrement:Ve,plugins:We,events:We,eventSources:We,resources:We};function Ve(e,t){return"object"==typeof e&&"object"==typeof t&&e&&t?tt(e,t):e===t}function We(e,t){return Array.isArray(e)&&Array.isArray(t)?ee(e,t):e===t}const Ue={type:String,component:Xe,buttonText:String,buttonTextKey:String,dateProfileGeneratorClass:Xe,usesMinMaxTime:Boolean,classNames:Xe,content:Xe,didMount:Xe,willUnmount:Xe};function $e(e){return Ze(e,je)}function Ge(e,t){let i={},n={};for(let n in t)n in e&&(i[n]=t[n](e[n]));for(let i in e)i in t||(n[i]=e[i]);return{refined:i,extra:n}}function Xe(e){return e}const{hasOwnProperty:qe}=Object.prototype;function Ze(e,t){let i={};if(t)for(let n in t)if(t[n]===Ve){let t=[];for(let r=e.length-1;r>=0;r-=1){let s=e[r][n];if("object"==typeof s&&s)t.unshift(s);else if(void 0!==s){i[n]=s;break}}t.length&&(i[n]=Ze(t))}for(let t=e.length-1;t>=0;t-=1){let n=e[t];for(let e in n)e in i||(i[e]=n[e])}return i}function Je(e,t){let i={};for(let n in e)t(e[n],n)&&(i[n]=e[n]);return i}function Ke(e,t){let i={};for(let n in e)i[n]=t(e[n],n);return i}function Qe(e){let t={};for(let i of e)t[i]=!0;return t}function et(e){let t=[];for(let i in e)t.push(e[i]);return t}function tt(e,t){if(e===t)return!0;for(let i in e)if(qe.call(e,i)&&!(i in t))return!1;for(let i in t)if(qe.call(t,i)&&e[i]!==t[i])return!1;return!0}const it=/^on[A-Z]/;function nt(e,t,i={}){if(e===t)return!0;for(let n in t)if(!(n in e)||!rt(e[n],t[n],i[n]))return!1;for(let i in e)if(!(i in t))return!1;return!0}function rt(e,t,i){return e===t||!0===i||!!i&&i(e,t)}let st={};var ot;ot=class{getMarkerYear(e){return e.getUTCFullYear()}getMarkerMonth(e){return e.getUTCMonth()}getMarkerDay(e){return e.getUTCDate()}arrayToMarker(e){return pe(e)}markerToArray(e){return fe(e)}},st.gregory=ot;const at=/^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/;class lt{constructor(e){let t=this.timeZone=e.timeZone,i="local"!==t&&"UTC"!==t;e.namedTimeZoneImpl&&i&&(this.namedTimeZoneImpl=new e.namedTimeZoneImpl(t)),this.canComputeOffset=Boolean(!i||this.namedTimeZoneImpl),this.calendarSystem=function(e){return new st[e]}(e.calendarSystem),this.locale=e.locale,this.weekDow=e.locale.week.dow,this.weekDoy=e.locale.week.doy,"ISO"===e.weekNumberCalculation&&(this.weekDow=1,this.weekDoy=4),"number"==typeof e.firstDay&&(this.weekDow=e.firstDay),"function"==typeof e.weekNumberCalculation&&(this.weekNumberFunc=e.weekNumberCalculation),this.weekText=null!=e.weekText?e.weekText:e.locale.options.weekText,this.weekTextLong=(null!=e.weekTextLong?e.weekTextLong:e.locale.options.weekTextLong)||this.weekText,this.cmdFormatter=e.cmdFormatter,this.defaultSeparator=e.defaultSeparator}createMarker(e){let t=this.createMarkerMeta(e);return null===t?null:t.marker}createNowMarker(){return this.canComputeOffset?this.timestampToMarker((new Date).valueOf()):pe(de(new Date))}createMarkerMeta(e){if("string"==typeof e)return this.parse(e);let t=null;return"number"==typeof e?t=this.timestampToMarker(e):e instanceof Date?(e=e.valueOf(),isNaN(e)||(t=this.timestampToMarker(e))):Array.isArray(e)&&(t=pe(e)),null!==t&&me(t)?{marker:t,isTimeUnspecified:!1,forcedTzo:null}:null}parse(e){let t=function(e){let t=at.exec(e);if(t){let e=new Date(Date.UTC(Number(t[1]),t[3]?Number(t[3])-1:0,Number(t[5]||1),Number(t[7]||0),Number(t[8]||0),Number(t[10]||0),t[12]?1e3*Number(`0.${t[12]}`):0));if(me(e)){let i=null;return t[13]&&(i=("-"===t[15]?-1:1)*(60*Number(t[16]||0)+Number(t[18]||0))),{marker:e,isTimeUnspecified:!t[6],timeZoneOffset:i}}}return null}(e);if(null===t)return null;let{marker:i}=t,n=null;return null!==t.timeZoneOffset&&(this.canComputeOffset?i=this.timestampToMarker(i.valueOf()-60*t.timeZoneOffset*1e3):n=t.timeZoneOffset),{marker:i,isTimeUnspecified:t.isTimeUnspecified,forcedTzo:n}}getYear(e){return this.calendarSystem.getMarkerYear(e)}getMonth(e){return this.calendarSystem.getMarkerMonth(e)}getDay(e){return this.calendarSystem.getMarkerDay(e)}add(e,t){let i=this.calendarSystem.markerToArray(e);return i[0]+=t.years,i[1]+=t.months,i[2]+=t.days,i[6]+=t.milliseconds,this.calendarSystem.arrayToMarker(i)}subtract(e,t){let i=this.calendarSystem.markerToArray(e);return i[0]-=t.years,i[1]-=t.months,i[2]-=t.days,i[6]-=t.milliseconds,this.calendarSystem.arrayToMarker(i)}addYears(e,t){let i=this.calendarSystem.markerToArray(e);return i[0]+=t,this.calendarSystem.arrayToMarker(i)}addMonths(e,t){let i=this.calendarSystem.markerToArray(e);return i[1]+=t,this.calendarSystem.arrayToMarker(i)}diffWholeYears(e,t){let{calendarSystem:i}=this;return ge(e)===ge(t)&&i.getMarkerDay(e)===i.getMarkerDay(t)&&i.getMarkerMonth(e)===i.getMarkerMonth(t)?i.getMarkerYear(t)-i.getMarkerYear(e):null}diffWholeMonths(e,t){let{calendarSystem:i}=this;return ge(e)===ge(t)&&i.getMarkerDay(e)===i.getMarkerDay(t)?i.getMarkerMonth(t)-i.getMarkerMonth(e)+12*(i.getMarkerYear(t)-i.getMarkerYear(e)):null}greatestWholeUnit(e,t){let i=this.diffWholeYears(e,t);return null!==i?{unit:"year",value:i}:(i=this.diffWholeMonths(e,t),null!==i?{unit:"month",value:i}:(i=function(e,t){let i=ae(e,t);return null!==i&&i%7==0?i/7:null}(e,t),null!==i?{unit:"week",value:i}:(i=ae(e,t),null!==i?{unit:"day",value:i}:(i=function(e,t){return(t.valueOf()-e.valueOf())/36e5}(e,t),H(i)?{unit:"hour",value:i}:(i=function(e,t){return(t.valueOf()-e.valueOf())/6e4}(e,t),H(i)?{unit:"minute",value:i}:(i=function(e,t){return(t.valueOf()-e.valueOf())/1e3}(e,t),H(i)?{unit:"second",value:i}:{unit:"millisecond",value:t.valueOf()-e.valueOf()}))))))}countDurationsBetween(e,t,i){let n;return i.years&&(n=this.diffWholeYears(e,t),null!==n)?n/(Z(i)/365):i.months&&(n=this.diffWholeMonths(e,t),null!==n)?n/(Z(i)/30):i.days&&(n=ae(e,t),null!==n)?n/Z(i):(t.valueOf()-e.valueOf())/J(i)}startOf(e,t){return"year"===t?this.startOfYear(e):"month"===t?this.startOfMonth(e):"week"===t?this.startOfWeek(e):"day"===t?le(e):"hour"===t?function(e){return pe([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours()])}(e):"minute"===t?function(e){return pe([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes()])}(e):"second"===t?function(e){return pe([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()])}(e):null}startOfYear(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e)])}startOfMonth(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e)])}startOfWeek(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e),e.getUTCDate()-(e.getUTCDay()-this.weekDow+7)%7])}computeWeekNumber(e){return this.weekNumberFunc?this.weekNumberFunc(this.toDate(e)):function(e,t,i){let n=e.getUTCFullYear(),r=ce(e,n,t,i);if(r<1)return ce(e,n-1,t,i);let s=ce(e,n+1,t,i);return s>=1?Math.min(r,s):r}(e,this.weekDow,this.weekDoy)}format(e,t,i={}){return t.format({marker:e,timeZoneOffset:null!=i.forcedTzo?i.forcedTzo:this.offsetForMarker(e)},this)}formatRange(e,t,i,n={}){return n.isEndExclusive&&(t=re(t,-1)),i.formatRange({marker:e,timeZoneOffset:null!=n.forcedStartTzo?n.forcedStartTzo:this.offsetForMarker(e)},{marker:t,timeZoneOffset:null!=n.forcedEndTzo?n.forcedEndTzo:this.offsetForMarker(t)},this,n.defaultSeparator)}formatIso(e,t={}){let i=null;return t.omitTimeZoneOffset||(i=null!=t.forcedTzo?t.forcedTzo:this.offsetForMarker(e)),_e(e,i,t.omitTime)}timestampToMarker(e){return"local"===this.timeZone?pe(de(new Date(e))):"UTC"!==this.timeZone&&this.namedTimeZoneImpl?pe(this.namedTimeZoneImpl.timestampToArray(e)):new Date(e)}offsetForMarker(e){return"local"===this.timeZone?-ue(fe(e)).getTimezoneOffset():"UTC"===this.timeZone?0:this.namedTimeZoneImpl?this.namedTimeZoneImpl.offsetForArray(fe(e)):null}toDate(e,t){return"local"===this.timeZone?ue(fe(e)):"UTC"===this.timeZone?new Date(e.valueOf()):this.namedTimeZoneImpl?new Date(e.valueOf()-1e3*this.namedTimeZoneImpl.offsetForArray(fe(e))*60):new Date(e.valueOf()-(t||0))}}class ct{constructor(e){this.iconOverrideOption&&this.setIconOverride(e[this.iconOverrideOption])}setIconOverride(e){let t,i;if("object"==typeof e&&e){for(i in t=Object.assign({},this.iconClasses),e)t[i]=this.applyIconOverridePrefix(e[i]);this.iconClasses=t}else!1===e&&(this.iconClasses={})}applyIconOverridePrefix(e){let t=this.iconOverridePrefix;return t&&0!==e.indexOf(t)&&(e=t+e),e}getClass(e){return this.classes[e]||""}getIconClass(e,t){let i;return i=t&&this.rtlIconClasses&&this.rtlIconClasses[e]||this.iconClasses[e],i?`${this.baseIconClass} ${i}`:""}getCustomButtonIconClass(e){let t;return this.iconOverrideCustomButtonOption&&(t=e[this.iconOverrideCustomButtonOption],t)?`${this.baseIconClass} ${this.applyIconOverridePrefix(t)}`:""}}function ht(e){e();let t=n.fF.debounceRendering,i=[];for(n.fF.debounceRendering=function(e){i.push(e)},n.XX(n.n(dt,{}),document.createElement("div"));i.length;)i.shift()();n.fF.debounceRendering=t}ct.prototype.classes={},ct.prototype.iconClasses={},ct.prototype.baseIconClass="",ct.prototype.iconOverridePrefix="";class dt extends n.uA{render(){return n.n("div",{})}componentDidMount(){this.setState({})}}function ut(e){let t=n.q6(e),i=t.Provider;return t.Provider=function(){let e=!this.getChildContext,t=i.apply(this,arguments);if(e){let e=[];this.shouldComponentUpdate=t=>{this.props.value!==t.value&&e.forEach(e=>{e.context=t.value,e.forceUpdate()})},this.sub=t=>{e.push(t);let i=t.componentWillUnmount;t.componentWillUnmount=()=>{e.splice(e.indexOf(t),1),i&&i.call(t)}}}return t},t}class ft{constructor(e,t,i,n){this.execFunc=e,this.emitter=t,this.scrollTime=i,this.scrollTimeReset=n,this.handleScrollRequest=e=>{this.queuedRequest=Object.assign({},this.queuedRequest||{},e),this.drain()},t.on("_scrollRequest",this.handleScrollRequest),this.fireInitialScroll()}detach(){this.emitter.off("_scrollRequest",this.handleScrollRequest)}update(e){e&&this.scrollTimeReset?this.fireInitialScroll():this.drain()}fireInitialScroll(){this.handleScrollRequest({time:this.scrollTime})}drain(){this.queuedRequest&&this.execFunc(this.queuedRequest)&&(this.queuedRequest=null)}}const pt=ut({});function mt(e,t,i,n,r,s,o,a,l,c,h,d,u,f){return{dateEnv:r,nowManager:s,options:i,pluginHooks:a,emitter:h,dispatch:l,getCurrentData:c,calendarApi:d,viewSpec:e,viewApi:t,dateProfileGenerator:n,theme:o,isRtl:"rtl"===i.direction,addResizeHandler(e){h.on("_resize",e)},removeResizeHandler(e){h.off("_resize",e)},createScrollResponder:e=>new ft(e,h,U(i.scrollTime),i.scrollTimeReset),registerInteractiveComponent:u,unregisterInteractiveComponent:f}}class gt extends n.uA{shouldComponentUpdate(e,t){return!nt(this.props,e,this.propEquality)||!nt(this.state,t,this.stateEquality)}safeSetState(e){nt(this.state,Object.assign(Object.assign({},this.state),e),this.stateEquality)||this.setState(e)}}gt.addPropsEquality=function(e){let t=Object.create(this.prototype.propEquality);Object.assign(t,e),this.prototype.propEquality=t},gt.addStateEquality=function(e){let t=Object.create(this.prototype.stateEquality);Object.assign(t,e),this.prototype.stateEquality=t},gt.contextType=pt,gt.prototype.propEquality={},gt.prototype.stateEquality={};class _t extends gt{}function yt(e,t){"function"==typeof e?e(t):e&&(e.current=t)}_t.contextType=pt;class vt extends _t{constructor(){super(...arguments),this.id=L(),this.queuedDomNodes=[],this.currentDomNodes=[],this.handleEl=e=>{const{options:t}=this.context,{generatorName:i}=this.props;t.customRenderingReplaces&&xt(i,t)||this.updateElRef(e)},this.updateElRef=e=>{this.props.elRef&&yt(this.props.elRef,e)}}render(){const{props:e,context:t}=this,{options:i}=t,{customGenerator:r,defaultGenerator:s,renderProps:o}=e,a=bt(e,[],this.handleEl);let l,c,h=!1,d=[];if(null!=r){const e="function"==typeof r?r(o,n.n):r;if(!0===e)h=!0;else{const t=e&&"object"==typeof e;t&&"html"in e?a.dangerouslySetInnerHTML={__html:e.html}:t&&"domNodes"in e?d=Array.prototype.slice.call(e.domNodes):(t?(0,n.zO)(e):"function"!=typeof e)?l=e:c=e}}else h=!xt(e.generatorName,i);return h&&s&&(l=s(o)),this.queuedDomNodes=d,this.currentGeneratorMeta=c,(0,n.n)(e.elTag,a,l)}componentDidMount(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentDidUpdate(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentWillUnmount(){this.triggerCustomRendering(!1)}triggerCustomRendering(e){var t;const{props:i,context:n}=this,{handleCustomRendering:r,customRenderingMetaMap:s}=n.options;if(r){const n=null!==(t=this.currentGeneratorMeta)&&void 0!==t?t:null==s?void 0:s[i.generatorName];n&&r(Object.assign(Object.assign({id:this.id,isActive:e,containerEl:this.base,reportNewContainerEl:this.updateElRef,generatorMeta:n},i),{elClasses:(i.elClasses||[]).filter(wt)}))}}applyQueueudDomNodes(){const{queuedDomNodes:e,currentDomNodes:t}=this,i=this.base;if(!ee(e,t)){t.forEach(f);for(let t of e)i.appendChild(t);this.currentDomNodes=e}}}function xt(e,t){var i;return Boolean(t.handleCustomRendering&&e&&(null===(i=t.customRenderingMetaMap)||void 0===i?void 0:i[e]))}function bt(e,t,i){const n=Object.assign(Object.assign({},e.elAttrs),{ref:i});return(e.elClasses||t)&&(n.className=(e.elClasses||[]).concat(t||[]).concat(n.className||[]).filter(Boolean).join(" ")),e.elStyle&&(n.style=e.elStyle),n}function wt(e){return Boolean(e)}vt.addPropsEquality({elClasses:ee,elStyle:tt,elAttrs:function(e,t){const i=function(e,t){let i=[];for(let n in e)qe.call(e,n)&&(n in t||i.push(n));for(let n in t)qe.call(t,n)&&e[n]!==t[n]&&i.push(n);return i}(e,t);for(let e of i)if(!it.test(e))return!1;return!0},renderProps:tt});const St=ut(0);class Tt extends n.uA{constructor(){super(...arguments),this.InnerContent=kt.bind(void 0,this),this.handleEl=e=>{this.el=e,this.props.elRef&&(yt(this.props.elRef,e),e&&this.didMountMisfire&&this.componentDidMount())}}render(){const{props:e}=this,t=function(e,t){const i="function"==typeof e?e(t):e||[];return"string"==typeof i?[i]:i}(e.classNameGenerator,e.renderProps);if(e.children){const i=bt(e,t,this.handleEl),r=e.children(this.InnerContent,e.renderProps,i);return e.elTag?(0,n.n)(e.elTag,i,r):r}return(0,n.n)(vt,Object.assign(Object.assign({},e),{elRef:this.handleEl,elTag:e.elTag||"div",elClasses:(e.elClasses||[]).concat(t),renderId:this.context}))}componentDidMount(){var e,t;this.el?null===(t=(e=this.props).didMount)||void 0===t||t.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el})):this.didMountMisfire=!0}componentWillUnmount(){var e,t;null===(t=(e=this.props).willUnmount)||void 0===t||t.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el}))}}function kt(e,t){const i=e.props;return(0,n.n)(vt,Object.assign({renderProps:i.renderProps,generatorName:i.generatorName,customGenerator:i.customGenerator,defaultGenerator:i.defaultGenerator,renderId:e.context},t))}Tt.contextType=St;class Mt extends(270==i.j?_t:null){render(){let{props:e,context:t}=this,{options:i}=t,r={view:t.viewApi};return(0,n.n)(Tt,{elRef:e.elRef,elTag:e.elTag||"div",elAttrs:e.elAttrs,elClasses:[...At(e.viewSpec),...e.elClasses||[]],elStyle:e.elStyle,renderProps:r,classNameGenerator:i.viewClassNames,generatorName:void 0,didMount:i.viewDidMount,willUnmount:i.viewWillUnmount},()=>e.children)}}function At(e){return[`fc-${e.type}-view`,"fc-view"]}function Ct(e,t){let i,n,r=[],{start:s}=t;for(e.sort(Dt),i=0;i<e.length;i+=1)n=e[i],n.start>s&&r.push({start:s,end:n.start}),n.end>s&&(s=n.end);return s<t.end&&r.push({start:s,end:t.end}),r}function Dt(e,t){return e.start.valueOf()-t.start.valueOf()}function Lt(e,t){let{start:i,end:n}=e,r=null;return null!==t.start&&(i=null===i?t.start:new Date(Math.max(i.valueOf(),t.start.valueOf()))),null!=t.end&&(n=null===n?t.end:new Date(Math.min(n.valueOf(),t.end.valueOf()))),(null===i||null===n||i<n)&&(r={start:i,end:n}),r}function Et(e,t){return(null===e.end||null===t.start||e.end>t.start)&&(null===e.start||null===t.end||e.start<t.end)}function It(e,t){return(null===e.start||null!==t.start&&t.start>=e.start)&&(null===e.end||null!==t.end&&t.end<=e.end)}function Pt(e,t){return(null===e.start||t>=e.start)&&(null===e.end||t<e.end)}function Rt(e){let t=Math.floor(oe(e.start,e.end))||1,i=le(e.start);return{start:i,end:ne(i,t)}}function Ot(e,t=U(0)){let i=null,n=null;if(e.end){n=le(e.end);let i=e.end.valueOf()-n.valueOf();i&&i>=J(t)&&(n=ne(n,1))}return e.start&&(i=le(e.start),n&&n<=i&&(n=ne(i,1))),{start:i,end:n}}function zt(e){let t=Ot(e);return oe(t.start,t.end)>1}function Ft(e,t,i,n){return"year"===n?U(i.diffWholeYears(e,t),"year"):"month"===n?U(i.diffWholeMonths(e,t),"month"):function(e,t){let i=le(e),n=le(t);return{years:0,months:0,days:Math.round(oe(i,n)),milliseconds:t.valueOf()-n.valueOf()-(e.valueOf()-i.valueOf())}}(e,t)}class Nt{constructor(e){this.props=e,this.initHiddenDays()}buildPrev(e,t,i){let{dateEnv:n}=this.props,r=n.subtract(n.startOf(t,e.currentRangeUnit),e.dateIncrement);return this.build(r,-1,i)}buildNext(e,t,i){let{dateEnv:n}=this.props,r=n.add(n.startOf(t,e.currentRangeUnit),e.dateIncrement);return this.build(r,1,i)}build(e,t,i=!0){let n,r,s,o,a,l,{props:c}=this;var h,d;return n=this.buildValidRange(),n=this.trimHiddenDays(n),i&&(h=e,e=null!=(d=n).start&&h<d.start?d.start:null!=d.end&&h>=d.end?new Date(d.end.valueOf()-1):h),r=this.buildCurrentRangeInfo(e,t),s=/^(year|month|week|day)$/.test(r.unit),o=this.buildRenderRange(this.trimHiddenDays(r.range),r.unit,s),o=this.trimHiddenDays(o),a=o,c.showNonCurrentDates||(a=Lt(a,r.range)),a=this.adjustActiveRange(a),a=Lt(a,n),l=Et(r.range,n),Pt(o,e)||(e=o.start),{currentDate:e,validRange:n,currentRange:r.range,currentRangeUnit:r.unit,isRangeAllDay:s,activeRange:a,renderRange:o,slotMinTime:c.slotMinTime,slotMaxTime:c.slotMaxTime,isValid:l,dateIncrement:this.buildDateIncrement(r.duration)}}buildValidRange(){let e=this.props.validRangeInput,t="function"==typeof e?e.call(this.props.calendarApi,this.props.dateEnv.toDate(this.props.nowManager.getDateMarker())):e;return this.refineRange(t)||{start:null,end:null}}buildCurrentRangeInfo(e,t){let i,{props:n}=this,r=null,s=null,o=null;return n.duration?(r=n.duration,s=n.durationUnit,o=this.buildRangeFromDuration(e,t,r,s)):(i=this.props.dayCount)?(s="day",o=this.buildRangeFromDayCount(e,t,i)):(o=this.buildCustomVisibleRange(e))?s=n.dateEnv.greatestWholeUnit(o.start,o.end).unit:(r=this.getFallbackDuration(),s=Q(r).unit,o=this.buildRangeFromDuration(e,t,r,s)),{duration:r,unit:s,range:o}}getFallbackDuration(){return U({day:1})}adjustActiveRange(e){let{dateEnv:t,usesMinMaxTime:i,slotMinTime:n,slotMaxTime:r}=this.props,{start:s,end:o}=e;return i&&(Z(n)<0&&(s=le(s),s=t.add(s,n)),Z(r)>1&&(o=le(o),o=ne(o,-1),o=t.add(o,r))),{start:s,end:o}}buildRangeFromDuration(e,t,i,n){let r,s,o,{dateEnv:a,dateAlignment:l}=this.props;if(!l){let{dateIncrement:e}=this.props;l=e&&J(e)<J(i)?Q(e).unit:n}function c(){r=a.startOf(e,l),s=a.add(r,i),o={start:r,end:s}}return Z(i)<=1&&this.isHiddenDay(r)&&(r=this.skipHiddenDays(r,t),r=le(r)),c(),this.trimHiddenDays(o)||(e=this.skipHiddenDays(e,t),c()),o}buildRangeFromDayCount(e,t,i){let n,{dateEnv:r,dateAlignment:s}=this.props,o=0,a=e;s&&(a=r.startOf(a,s)),a=le(a),a=this.skipHiddenDays(a,t),n=a;do{n=ne(n,1),this.isHiddenDay(n)||(o+=1)}while(o<i);return{start:a,end:n}}buildCustomVisibleRange(e){let{props:t}=this,i=t.visibleRangeInput,n="function"==typeof i?i.call(t.calendarApi,t.dateEnv.toDate(e)):i,r=this.refineRange(n);return!r||null!=r.start&&null!=r.end?r:null}buildRenderRange(e,t,i){return e}buildDateIncrement(e){let t,{dateIncrement:i}=this.props;return i||((t=this.props.dateAlignment)?U(1,t):e||U({days:1}))}refineRange(e){if(e){let t=function(e,t){let i=null,n=null;return e.start&&(i=t.createMarker(e.start)),e.end&&(n=t.createMarker(e.end)),i||n?i&&n&&n<i?null:{start:i,end:n}:null}(e,this.props.dateEnv);return t&&(t=Ot(t)),t}return null}initHiddenDays(){let e,t=this.props.hiddenDays||[],i=[],n=0;for(!1===this.props.weekends&&t.push(0,6),e=0;e<7;e+=1)(i[e]=-1!==t.indexOf(e))||(n+=1);if(!n)throw new Error("invalid hiddenDays");this.isHiddenDayHash=i}trimHiddenDays(e){let{start:t,end:i}=e;return t&&(t=this.skipHiddenDays(t)),i&&(i=this.skipHiddenDays(i,-1,!0)),null==t||null==i||t<i?{start:t,end:i}:null}isHiddenDay(e){return e instanceof Date&&(e=e.getUTCDay()),this.isHiddenDayHash[e]}skipHiddenDays(e,t=1,i=!1){for(;this.isHiddenDayHash[(e.getUTCDay()+(i?t:0)+7)%7];)e=ne(e,t);return e}}function Yt(e,t,i,n){return{instanceId:L(),defId:e,range:t,forcedStartTzo:null==i?null:i,forcedEndTzo:null==n?null:n}}function Bt(e,t,i){let{dateEnv:n,pluginHooks:r,options:s}=i,{defs:o,instances:a}=e;a=Je(a,e=>!o[e.defId].recurringDef);for(let e in o){let i=o[e];if(i.recurringDef){let{duration:o}=i.recurringDef;o||(o=i.allDay?s.defaultAllDayEventDuration:s.defaultTimedEventDuration);let l=Ht(i,o,t,n,r.recurringTypes);for(let t of l){let i=Yt(e,{start:t,end:n.add(t,o)});a[i.instanceId]=i}}}return{defs:o,instances:a}}function Ht(e,t,i,n,r){let s=r[e.recurringDef.typeId].expand(e.recurringDef.typeData,{start:n.subtract(i.start,t),end:i.end},n);return e.allDay&&(s=s.map(le)),s}const jt={id:String,groupId:String,title:String,url:String,interactive:Boolean},Vt={start:Xe,end:Xe,date:Xe,allDay:Boolean},Wt=Object.assign(Object.assign(Object.assign({},jt),Vt),{extendedProps:Xe});function Ut(e,t,i,n,r=Gt(i),s,o){let{refined:a,extra:l}=$t(e,i,r),c=function(e,t){let i=null;return e&&(i=e.defaultAllDay),null==i&&(i=t.options.defaultAllDay),i}(t,i),h=function(e,t,i,n){for(let r=0;r<n.length;r+=1){let s=n[r].parse(e,i);if(s){let{allDay:i}=e;return null==i&&(i=t,null==i&&(i=s.allDayGuess,null==i&&(i=!1))),{allDay:i,duration:s.duration,typeData:s.typeData,typeId:r}}}return null}(a,c,i.dateEnv,i.pluginHooks.recurringTypes);if(h){let e=Xt(a,l,t?t.sourceId:"",h.allDay,Boolean(h.duration),i,s);return e.recurringDef={typeId:h.typeId,typeData:h.typeData,duration:h.duration},{def:e,instance:null}}let d=function(e,t,i,n){let r,s,{allDay:o}=e,a=null,l=!1,c=null,h=null!=e.start?e.start:e.date;if(r=i.dateEnv.createMarkerMeta(h),r)a=r.marker;else if(!n)return null;return null!=e.end&&(s=i.dateEnv.createMarkerMeta(e.end)),null==o&&(o=null!=t?t:(!r||r.isTimeUnspecified)&&(!s||s.isTimeUnspecified)),o&&a&&(a=le(a)),s&&(c=s.marker,o&&(c=le(c)),a&&c<=a&&(c=null)),c?l=!0:n||(l=i.options.forceEventDuration||!1,c=i.dateEnv.add(a,o?i.options.defaultAllDayEventDuration:i.options.defaultTimedEventDuration)),{allDay:o,hasEnd:l,range:{start:a,end:c},forcedStartTzo:r?r.forcedTzo:null,forcedEndTzo:s?s.forcedTzo:null}}(a,c,i,n);if(d){let e=Xt(a,l,t?t.sourceId:"",d.allDay,d.hasEnd,i,s),n=Yt(e.defId,d.range,d.forcedStartTzo,d.forcedEndTzo);return o&&e.publicId&&o[e.publicId]&&(n.instanceId=o[e.publicId]),{def:e,instance:n}}return null}function $t(e,t,i=Gt(t)){return Ge(e,i)}function Gt(e){return Object.assign(Object.assign(Object.assign({},ii),Wt),e.pluginHooks.eventRefiners)}function Xt(e,t,i,n,r,s,o){let a={title:e.title||"",groupId:e.groupId||"",publicId:e.id||"",url:e.url||"",recurringDef:null,defId:(o&&e.id?o[e.id]:"")||L(),sourceId:i,allDay:n,hasEnd:r,interactive:e.interactive,ui:ri(e,s),extendedProps:Object.assign(Object.assign({},e.extendedProps||{}),t)};for(let t of s.pluginHooks.eventDefMemberAdders)Object.assign(a,t(e));return Object.freeze(a.ui.classNames),Object.freeze(a.extendedProps),a}function qt(e,t,i,n,r,s){let o={defs:{},instances:{}},a=Gt(i);for(let l of e){let e=Ut(l,t,i,n,a,r,s);e&&Zt(e,o)}return o}function Zt(e,t={defs:{},instances:{}}){return t.defs[e.def.defId]=e.def,e.instance&&(t.instances[e.instance.instanceId]=e.instance),t}function Jt(e,t){let i=e.instances[t];if(i){let t=e.defs[i.defId],n=ei(e,e=>{return i=t,n=e,Boolean(i.groupId&&i.groupId===n.groupId);var i,n});return n.defs[t.defId]=t,n.instances[i.instanceId]=i,n}return{defs:{},instances:{}}}function Kt(){return{defs:{},instances:{}}}function Qt(e,t){return{defs:Object.assign(Object.assign({},e.defs),t.defs),instances:Object.assign(Object.assign({},e.instances),t.instances)}}function ei(e,t){let i=Je(e.defs,t),n=Je(e.instances,e=>i[e.defId]);return{defs:i,instances:n}}function ti(e){return Array.isArray(e)?e:"string"==typeof e?e.split(/\s+/):[]}const ii={display:String,editable:Boolean,startEditable:Boolean,durationEditable:Boolean,constraint:Xe,overlap:Xe,allow:Xe,className:ti,classNames:ti,color:String,backgroundColor:String,borderColor:String,textColor:String},ni={display:null,startEditable:null,durationEditable:null,constraints:[],overlap:null,allows:[],backgroundColor:"",borderColor:"",textColor:"",classNames:[]};function ri(e,t){let i=function(e,t){return Array.isArray(e)?qt(e,null,t,!0):"object"==typeof e&&e?qt([e],null,t,!0):null!=e?String(e):null}(e.constraint,t);return{display:e.display||null,startEditable:null!=e.startEditable?e.startEditable:e.editable,durationEditable:null!=e.durationEditable?e.durationEditable:e.editable,constraints:null!=i?[i]:[],overlap:null!=e.overlap?e.overlap:null,allows:null!=e.allow?[e.allow]:[],backgroundColor:e.backgroundColor||e.color||"",borderColor:e.borderColor||e.color||"",textColor:e.textColor||"",classNames:(e.className||[]).concat(e.classNames||[])}}function si(e){return e.reduce(oi,ni)}function oi(e,t){return{display:null!=t.display?t.display:e.display,startEditable:null!=t.startEditable?t.startEditable:e.startEditable,durationEditable:null!=t.durationEditable?t.durationEditable:e.durationEditable,constraints:e.constraints.concat(t.constraints),overlap:"boolean"==typeof t.overlap?t.overlap:e.overlap,allows:e.allows.concat(t.allows),backgroundColor:t.backgroundColor||e.backgroundColor,borderColor:t.borderColor||e.borderColor,textColor:t.textColor||e.textColor,classNames:e.classNames.concat(t.classNames)}}const ai={id:String,defaultAllDay:Boolean,url:String,format:String,events:Xe,eventDataTransform:Xe,success:Xe,failure:Xe};function li(e,t,i=ci(t)){let n;if("string"==typeof e?n={url:e}:"function"==typeof e||Array.isArray(e)?n={events:e}:"object"==typeof e&&e&&(n=e),n){let{refined:r,extra:s}=Ge(n,i),o=function(e,t){let i=t.pluginHooks.eventSourceDefs;for(let t=i.length-1;t>=0;t-=1){let n=i[t].parseMeta(e);if(n)return{sourceDefId:t,meta:n}}return null}(r,t);if(o)return{_raw:e,isFetching:!1,latestFetchId:"",fetchRange:null,defaultAllDay:r.defaultAllDay,eventDataTransform:r.eventDataTransform,success:r.success,failure:r.failure,publicId:r.id||"",sourceId:L(),sourceDefId:o.sourceDefId,meta:o.meta,ui:ri(r,t),extendedProps:s}}return null}function ci(e){return Object.assign(Object.assign(Object.assign({},ii),ai),e.pluginHooks.eventSourceRefiners)}function hi(e,t,i,n,r){switch(t.type){case"RECEIVE_EVENTS":return function(e,t,i,n,r,s){if(t&&i===t.latestFetchId){let i=qt(di(r,t,s),t,s);return n&&(i=Bt(i,n,s)),Qt(pi(e,t.sourceId),i)}return e}(e,i[t.sourceId],t.fetchId,t.fetchRange,t.rawEvents,r);case"RESET_RAW_EVENTS":return function(e,t,i,n,r){const{defIdMap:s,instanceIdMap:o}=function(e){const{defs:t,instances:i}=e,n={},r={};for(let e in t){const i=t[e],{publicId:r}=i;r&&(n[r]=e)}for(let e in i){const n=t[i[e].defId],{publicId:s}=n;s&&(r[s]=e)}return{defIdMap:n,instanceIdMap:r}}(e);return Bt(qt(di(i,t,r),t,r,!1,s,o),n,r)}(e,i[t.sourceId],t.rawEvents,n.activeRange,r);case"ADD_EVENTS":return function(e,t,i,n){return i&&(t=Bt(t,i,n)),Qt(e,t)}(e,t.eventStore,n?n.activeRange:null,r);case"RESET_EVENTS":return t.eventStore;case"MERGE_EVENTS":return Qt(e,t.eventStore);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return n?Bt(e,n.activeRange,r):e;case"REMOVE_EVENTS":return function(e,t){let{defs:i,instances:n}=e,r={},s={};for(let e in i)t.defs[e]||(r[e]=i[e]);for(let e in n)!t.instances[e]&&r[n[e].defId]&&(s[e]=n[e]);return{defs:r,instances:s}}(e,t.eventStore);case"REMOVE_EVENT_SOURCE":return pi(e,t.sourceId);case"REMOVE_ALL_EVENT_SOURCES":return ei(e,e=>!e.sourceId);case"REMOVE_ALL_EVENTS":return{defs:{},instances:{}};default:return e}}function di(e,t,i){let n=i.options.eventDataTransform,r=t?t.eventDataTransform:null;return r&&(e=ui(e,r)),n&&(e=ui(e,n)),e}function ui(e,t){let i;if(t){i=[];for(let n of e){let e=t(n);e?i.push(e):null==e&&i.push(n)}}else i=e;return i}function fi(e,t,i){let{defs:n}=e,r=Ke(e.instances,e=>n[e.defId].allDay?e:Object.assign(Object.assign({},e),{range:{start:i.createMarker(t.toDate(e.range.start,e.forcedStartTzo)),end:i.createMarker(t.toDate(e.range.end,e.forcedEndTzo))},forcedStartTzo:i.canComputeOffset?null:e.forcedStartTzo,forcedEndTzo:i.canComputeOffset?null:e.forcedEndTzo}));return{defs:n,instances:r}}function pi(e,t){return ei(e,e=>e.sourceId!==t)}class mi{constructor(){this.handlers={},this.thisContext=null}setThisContext(e){this.thisContext=e}setOptions(e){this.options=e}on(e,t){!function(e,t,i){(e[t]||(e[t]=[])).push(i)}(this.handlers,e,t)}off(e,t){!function(e,t,i){i?e[t]&&(e[t]=e[t].filter(e=>e!==i)):delete e[t]}(this.handlers,e,t)}trigger(e,...t){let i=this.handlers[e]||[],n=this.options&&this.options[e],r=[].concat(n||[],i);for(let e of r)e.apply(this.thisContext,t)}hasHandlers(e){return Boolean(this.handlers[e]&&this.handlers[e].length||this.options&&this.options[e])}}const gi={startTime:"09:00",endTime:"17:00",daysOfWeek:[1,2,3,4,5],display:"inverse-background",classNames:"fc-non-business",groupId:"_businessHours"};function _i(e,t){return qt(function(e){let t;return t=!0===e?[{}]:Array.isArray(e)?e.filter(e=>e.daysOfWeek):"object"==typeof e&&e?[e]:[],t=t.map(e=>Object.assign(Object.assign({},gi),e)),t}(e),null,t)}function yi(e,t,i){i.emitter.trigger("select",Object.assign(Object.assign({},vi(e,i)),{jsEvent:t?t.origEvent:null,view:i.viewApi||i.calendarApi.view}))}function vi(e,t){let i={};for(let n of t.pluginHooks.dateSpanTransforms)Object.assign(i,n(e,t));var n,r;return Object.assign(i,(n=e,r=t.dateEnv,Object.assign(Object.assign({},Gi(n.range,r,n.allDay)),{allDay:n.allDay}))),i}function xi(e,t,i){let{dateEnv:n,options:r}=i,s=t;return e?(s=le(s),s=n.add(s,r.defaultAllDayEventDuration)):s=n.add(s,r.defaultTimedEventDuration),s}function bi(e,t,i,n){let r=Ii(e.defs,t),s={defs:{},instances:{}};for(let t in e.defs){let o=e.defs[t];s.defs[t]=wi(o,r[t],i,n)}for(let t in e.instances){let o=e.instances[t],a=s.defs[o.defId];s.instances[t]=Si(o,a,r[o.defId],i,n)}return s}function wi(e,t,i,n){let r=i.standardProps||{};null==r.hasEnd&&t.durationEditable&&(i.startDelta||i.endDelta)&&(r.hasEnd=!0);let s=Object.assign(Object.assign(Object.assign({},e),r),{ui:Object.assign(Object.assign({},e.ui),r.ui)});i.extendedProps&&(s.extendedProps=Object.assign(Object.assign({},s.extendedProps),i.extendedProps));for(let e of n.pluginHooks.eventDefMutationAppliers)e(s,i,n);return!s.hasEnd&&n.options.forceEventDuration&&(s.hasEnd=!0),s}function Si(e,t,i,n,r){let{dateEnv:s}=r,o=n.standardProps&&!0===n.standardProps.allDay,a=n.standardProps&&!1===n.standardProps.hasEnd,l=Object.assign({},e);return o&&(l.range=Rt(l.range)),n.datesDelta&&i.startEditable&&(l.range={start:s.add(l.range.start,n.datesDelta),end:s.add(l.range.end,n.datesDelta)}),n.startDelta&&i.durationEditable&&(l.range={start:s.add(l.range.start,n.startDelta),end:l.range.end}),n.endDelta&&i.durationEditable&&(l.range={start:l.range.start,end:s.add(l.range.end,n.endDelta)}),a&&(l.range={start:l.range.start,end:xi(t.allDay,l.range.start,r)}),t.allDay&&(l.range={start:le(l.range.start),end:le(l.range.end)}),l.range.end<l.range.start&&(l.range.end=xi(t.allDay,l.range.start,r)),l}class Ti{constructor(e,t){this.context=e,this.internalEventSource=t}remove(){this.context.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:this.internalEventSource.sourceId})}refetch(){this.context.dispatch({type:"FETCH_EVENT_SOURCES",sourceIds:[this.internalEventSource.sourceId],isRefetch:!0})}get id(){return this.internalEventSource.publicId}get url(){return this.internalEventSource.meta.url}get format(){return this.internalEventSource.meta.format}}class ki{constructor(e,t,i){this._context=e,this._def=t,this._instance=i||null}setProp(e,t){if(e in Vt)console.warn("Could not set date-related prop 'name'. Use one of the date-related methods instead.");else if("id"===e)t=jt[e](t),this.mutate({standardProps:{publicId:t}});else if(e in jt)t=jt[e](t),this.mutate({standardProps:{[e]:t}});else if(e in ii){let i=ii[e](t);i="color"===e?{backgroundColor:t,borderColor:t}:"editable"===e?{startEditable:t,durationEditable:t}:{[e]:t},this.mutate({standardProps:{ui:i}})}else console.warn(`Could not set prop '${e}'. Use setExtendedProp instead.`)}setExtendedProp(e,t){this.mutate({extendedProps:{[e]:t}})}setStart(e,t={}){let{dateEnv:i}=this._context,n=i.createMarker(e);if(n&&this._instance){let e=Ft(this._instance.range.start,n,i,t.granularity);t.maintainDuration?this.mutate({datesDelta:e}):this.mutate({startDelta:e})}}setEnd(e,t={}){let i,{dateEnv:n}=this._context;if((null==e||(i=n.createMarker(e),i))&&this._instance)if(i){let e=Ft(this._instance.range.end,i,n,t.granularity);this.mutate({endDelta:e})}else this.mutate({standardProps:{hasEnd:!1}})}setDates(e,t,i={}){let n,{dateEnv:r}=this._context,s={allDay:i.allDay},o=r.createMarker(e);var a,l;if(o&&(null==t||(n=r.createMarker(t),n))&&this._instance){let e=this._instance.range;!0===i.allDay&&(e=Rt(e));let t=Ft(e.start,o,r,i.granularity);if(n){let o=Ft(e.end,n,r,i.granularity);l=o,(a=t).years===l.years&&a.months===l.months&&a.days===l.days&&a.milliseconds===l.milliseconds?this.mutate({datesDelta:t,standardProps:s}):this.mutate({startDelta:t,endDelta:o,standardProps:s})}else s.hasEnd=!1,this.mutate({datesDelta:t,standardProps:s})}}moveStart(e){let t=U(e);t&&this.mutate({startDelta:t})}moveEnd(e){let t=U(e);t&&this.mutate({endDelta:t})}moveDates(e){let t=U(e);t&&this.mutate({datesDelta:t})}setAllDay(e,t={}){let i={allDay:e},{maintainDuration:n}=t;null==n&&(n=this._context.options.allDayMaintainDuration),this._def.allDay!==e&&(i.hasEnd=n),this.mutate({standardProps:i})}formatRange(e){let{dateEnv:t}=this._context,i=this._instance,n=Fe(e);return this._def.hasEnd?t.formatRange(i.range.start,i.range.end,n,{forcedStartTzo:i.forcedStartTzo,forcedEndTzo:i.forcedEndTzo}):t.format(i.range.start,n,{forcedTzo:i.forcedStartTzo})}mutate(e){let t=this._instance;if(t){let i=this._def,n=this._context,{eventStore:r}=n.getCurrentData(),s=Jt(r,t.instanceId);s=bi(s,{"":{display:"",startEditable:!0,durationEditable:!0,constraints:[],overlap:null,allows:[],backgroundColor:"",borderColor:"",textColor:"",classNames:[]}},e,n);let o=new ki(n,i,t);this._def=s.defs[i.defId],this._instance=s.instances[t.instanceId],n.dispatch({type:"MERGE_EVENTS",eventStore:s}),n.emitter.trigger("eventChange",{oldEvent:o,event:this,relatedEvents:Ai(s,n,t),revert(){n.dispatch({type:"RESET_EVENTS",eventStore:r})}})}}remove(){let e=this._context,t=Mi(this);e.dispatch({type:"REMOVE_EVENTS",eventStore:t}),e.emitter.trigger("eventRemove",{event:this,relatedEvents:[],revert(){e.dispatch({type:"MERGE_EVENTS",eventStore:t})}})}get source(){let{sourceId:e}=this._def;return e?new Ti(this._context,this._context.getCurrentData().eventSources[e]):null}get start(){return this._instance?this._context.dateEnv.toDate(this._instance.range.start):null}get end(){return this._instance&&this._def.hasEnd?this._context.dateEnv.toDate(this._instance.range.end):null}get startStr(){let e=this._instance;return e?this._context.dateEnv.formatIso(e.range.start,{omitTime:this._def.allDay,forcedTzo:e.forcedStartTzo}):""}get endStr(){let e=this._instance;return e&&this._def.hasEnd?this._context.dateEnv.formatIso(e.range.end,{omitTime:this._def.allDay,forcedTzo:e.forcedEndTzo}):""}get id(){return this._def.publicId}get groupId(){return this._def.groupId}get allDay(){return this._def.allDay}get title(){return this._def.title}get url(){return this._def.url}get display(){return this._def.ui.display||"auto"}get startEditable(){return this._def.ui.startEditable}get durationEditable(){return this._def.ui.durationEditable}get constraint(){return this._def.ui.constraints[0]||null}get overlap(){return this._def.ui.overlap}get allow(){return this._def.ui.allows[0]||null}get backgroundColor(){return this._def.ui.backgroundColor}get borderColor(){return this._def.ui.borderColor}get textColor(){return this._def.ui.textColor}get classNames(){return this._def.ui.classNames}get extendedProps(){return this._def.extendedProps}toPlainObject(e={}){let t=this._def,{ui:i}=t,{startStr:n,endStr:r}=this,s={allDay:t.allDay};return t.title&&(s.title=t.title),n&&(s.start=n),r&&(s.end=r),t.publicId&&(s.id=t.publicId),t.groupId&&(s.groupId=t.groupId),t.url&&(s.url=t.url),i.display&&"auto"!==i.display&&(s.display=i.display),e.collapseColor&&i.backgroundColor&&i.backgroundColor===i.borderColor?s.color=i.backgroundColor:(i.backgroundColor&&(s.backgroundColor=i.backgroundColor),i.borderColor&&(s.borderColor=i.borderColor)),i.textColor&&(s.textColor=i.textColor),i.classNames.length&&(s.classNames=i.classNames),Object.keys(t.extendedProps).length&&(e.collapseExtendedProps?Object.assign(s,t.extendedProps):s.extendedProps=t.extendedProps),s}toJSON(){return this.toPlainObject()}}function Mi(e){let t=e._def,i=e._instance;return{defs:{[t.defId]:t},instances:i?{[i.instanceId]:i}:{}}}function Ai(e,t,i){let{defs:n,instances:r}=e,s=[],o=i?i.instanceId:"";for(let e in r){let i=r[e],a=n[i.defId];i.instanceId!==o&&s.push(new ki(t,a,i))}return s}function Ci(e,t,i,n){let r={},s={},o={},a=[],l=[],c=Ii(e.defs,t);for(let t in e.defs){let i=e.defs[t];"inverse-background"===c[i.defId].display&&(i.groupId?(r[i.groupId]=[],o[i.groupId]||(o[i.groupId]=i)):s[t]=[])}for(let t in e.instances){let o=e.instances[t],h=e.defs[o.defId],d=c[h.defId],u=o.range,f=!h.allDay&&n?Ot(u,n):u,p=Lt(f,i);p&&("inverse-background"===d.display?h.groupId?r[h.groupId].push(p):s[o.defId].push(p):"none"!==d.display&&("background"===d.display?a:l).push({def:h,ui:d,instance:o,range:p,isStart:f.start&&f.start.valueOf()===p.start.valueOf(),isEnd:f.end&&f.end.valueOf()===p.end.valueOf()}))}for(let e in r){let t=Ct(r[e],i);for(let i of t){let t=o[e],n=c[t.defId];a.push({def:t,ui:n,instance:null,range:i,isStart:!1,isEnd:!1})}}for(let t in s){let n=Ct(s[t],i);for(let i of n)a.push({def:e.defs[t],ui:c[t],instance:null,range:i,isStart:!1,isEnd:!1})}return{bg:a,fg:l}}function Di(e){return"background"===e.ui.display||"inverse-background"===e.ui.display}function Li(e,t){e.fcSeg=t}function Ei(e){return e.fcSeg||e.parentNode.fcSeg||null}function Ii(e,t){return Ke(e,e=>Pi(e,t))}function Pi(e,t){let i=[];return t[""]&&i.push(t[""]),t[e.defId]&&i.push(t[e.defId]),i.push(e.ui),si(i)}function Ri(e,t){let i=e.map(Oi);return i.sort((e,i)=>function(e,t,i){let n,r;for(n=0;n<i.length;n+=1)if(r=F(e,t,i[n]),r)return r;return 0}(e,i,t)),i.map(e=>e._seg)}function Oi(e){let{eventRange:t}=e,i=t.def,n=t.instance?t.instance.range:t.range,r=n.start?n.start.valueOf():0,s=n.end?n.end.valueOf():0;return Object.assign(Object.assign(Object.assign({},i.extendedProps),i),{id:i.publicId,start:r,end:s,duration:s-r,allDay:Number(i.allDay),_seg:e})}function zi(e,t){let{pluginHooks:i}=t,n=i.isDraggableTransformers,{def:r,ui:s}=e.eventRange,o=s.startEditable;for(let e of n)o=e(o,r,s,t);return o}function Fi(e,t){return e.isStart&&e.eventRange.ui.durationEditable&&t.options.eventResizableFromStart}function Ni(e,t){return e.isEnd&&e.eventRange.ui.durationEditable}function Yi(e,t,i,n,r,s,o){let{dateEnv:a,options:l}=i,{displayEventTime:c,displayEventEnd:h}=l,d=e.eventRange.def,u=e.eventRange.instance;null==c&&(c=!1!==n),null==h&&(h=!1!==r);let f=u.range.start,p=u.range.end,m=s||e.start||e.eventRange.range.start,g=o||e.end||e.eventRange.range.end,_=le(f).valueOf()===le(m).valueOf(),y=le(re(p,-1)).valueOf()===le(re(g,-1)).valueOf();return c&&!d.allDay&&(_||y)?(m=_?f:m,g=y?p:g,h&&d.hasEnd?a.formatRange(m,g,t,{forcedStartTzo:s?null:u.forcedStartTzo,forcedEndTzo:o?null:u.forcedEndTzo}):a.format(m,t,{forcedTzo:s?null:u.forcedStartTzo})):""}function Bi(e,t,i){let n=e.eventRange.range;return{isPast:n.end<=(i||t.start),isFuture:n.start>=(i||t.end),isToday:t&&Pt(t,n.start)}}function Hi(e){let t=["fc-event"];return e.isMirror&&t.push("fc-event-mirror"),e.isDraggable&&t.push("fc-event-draggable"),(e.isStartResizable||e.isEndResizable)&&t.push("fc-event-resizable"),e.isDragging&&t.push("fc-event-dragging"),e.isResizing&&t.push("fc-event-resizing"),e.isSelected&&t.push("fc-event-selected"),e.isStart&&t.push("fc-event-start"),e.isEnd&&t.push("fc-event-end"),e.isPast&&t.push("fc-event-past"),e.isToday&&t.push("fc-event-today"),e.isFuture&&t.push("fc-event-future"),t}function ji(e){return e.instance?e.instance.instanceId:`${e.def.defId}:${e.range.start.toISOString()}`}function Vi(e,t){let{def:i,instance:n}=e.eventRange,{url:r}=i;if(r)return{href:r};let{emitter:s,options:o}=t,{eventInteractive:a}=o;return null==a&&(a=i.interactive,null==a&&(a=Boolean(s.hasHandlers("eventClick")))),a?C(e=>{s.trigger("eventClick",{el:e.target,event:new ki(t,i,n),jsEvent:e,view:t.viewApi})}):{}}const Wi={start:Xe,end:Xe,allDay:Boolean};function Ui(e,t){return i=e.range,n=t.range,(null===i.start?null:i.start.valueOf())===(null===n.start?null:n.start.valueOf())&&(null===i.end?null:i.end.valueOf())===(null===n.end?null:n.end.valueOf())&&e.allDay===t.allDay&&function(e,t){for(let i in t)if("range"!==i&&"allDay"!==i&&e[i]!==t[i])return!1;for(let i in e)if(!(i in t))return!1;return!0}(e,t);var i,n}function $i(e,t,i){return Object.assign(Object.assign({},Gi(e,t,i)),{timeZone:t.timeZone})}function Gi(e,t,i){return{start:t.toDate(e.start),end:t.toDate(e.end),startStr:t.formatIso(e.start,{omitTime:i}),endStr:t.formatIso(e.end,{omitTime:i})}}function Xi(e,t,i){let n=!1,r=function(e){n||(n=!0,t(e))},s=function(e){n||(n=!0,i(e))},o=e(r,s);o&&"function"==typeof o.then&&o.then(r,s)}class qi extends Error{constructor(e,t){super(e),this.response=t}}function Zi(e,t,i){const n={method:e=e.toUpperCase()};return"GET"===e?t+=(-1===t.indexOf("?")?"?":"&")+new URLSearchParams(i):(n.body=new URLSearchParams(i),n.headers={"Content-Type":"application/x-www-form-urlencoded"}),fetch(t,n).then(e=>{if(e.ok)return e.json().then(t=>[t,e],()=>{throw new qi("Failure parsing JSON",e)});throw new qi("Request failed",e)})}let Ji;function Ki(){return null==Ji&&(Ji=function(){if("undefined"==typeof document)return!0;let e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.innerHTML="<table><tr><td><div></div></td></tr></table>",e.querySelector("table").style.height="100px",e.querySelector("div").style.height="100%",document.body.appendChild(e);let t=e.querySelector("div").offsetHeight>0;return document.body.removeChild(e),t}()),Ji}class Qi extends _t{constructor(){super(...arguments),this.state={forPrint:!1},this.handleBeforePrint=()=>{ht(()=>{this.setState({forPrint:!0})})},this.handleAfterPrint=()=>{ht(()=>{this.setState({forPrint:!1})})}}render(){let{props:e}=this,{options:t}=e,{forPrint:i}=this.state,n=i||"auto"===t.height||"auto"===t.contentHeight,r=n||null==t.height?"":t.height,s=["fc",i?"fc-media-print":"fc-media-screen",`fc-direction-${t.direction}`,e.theme.getClass("root")];return Ki()||s.push("fc-liquid-hack"),e.children(s,r,n,i)}componentDidMount(){let{emitter:e}=this.props;e.on("_beforeprint",this.handleBeforePrint),e.on("_afterprint",this.handleAfterPrint)}componentWillUnmount(){let{emitter:e}=this.props;e.off("_beforeprint",this.handleBeforePrint),e.off("_afterprint",this.handleAfterPrint)}}class en{constructor(e){this.component=e.component,this.isHitComboAllowed=e.isHitComboAllowed||null}destroy(){}}function tn(e,t){return{component:e,el:t.el,useEventCenter:null==t.useEventCenter||t.useEventCenter,isHitComboAllowed:t.isHitComboAllowed||null}}function nn(e){return{[e.component.uid]:e}}const rn={};class sn extends n.uA{constructor(e,t){super(e,t),this.handleRefresh=()=>{let e=this.computeTiming();e.state.nowDate.valueOf()!==this.state.nowDate.valueOf()&&this.setState(e.state),this.clearTimeout(),this.setTimeout(e.waitMs)},this.handleVisibilityChange=()=>{document.hidden||this.handleRefresh()},this.state=this.computeTiming().state}render(){let{props:e,state:t}=this;return e.children(t.nowDate,t.todayRange)}componentDidMount(){this.setTimeout(),this.context.nowManager.addResetListener(this.handleRefresh),document.addEventListener("visibilitychange",this.handleVisibilityChange)}componentDidUpdate(e){e.unit!==this.props.unit&&(this.clearTimeout(),this.setTimeout())}componentWillUnmount(){this.clearTimeout(),this.context.nowManager.removeResetListener(this.handleRefresh),document.removeEventListener("visibilitychange",this.handleVisibilityChange)}computeTiming(){let e,t,{props:i,context:n}=this,r=n.nowManager.getDateMarker(),{nowIndicatorSnap:s}=n.options;return"auto"===s&&(s=/year|month|week|day/.test(i.unit)||1===(i.unitValue||1)),s?(e=n.dateEnv.startOf(r,i.unit),t=n.dateEnv.add(e,U(1,i.unit)).valueOf()-r.valueOf()):(e=r,t=6e4),t=Math.min(864e5,t),{state:{nowDate:e,todayRange:on(e)},waitMs:t}}setTimeout(e=this.computeTiming().waitMs){this.timeoutId=setTimeout(()=>{const e=this.computeTiming();this.setState(e.state,()=>{this.setTimeout(e.waitMs)})},e)}clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}}function on(e){let t=le(e);return{start:t,end:ne(t,1)}}sn.contextType=pt;class an{getCurrentData(){return this.currentDataManager.getCurrentData()}dispatch(e){this.currentDataManager.dispatch(e)}get view(){return this.getCurrentData().viewApi}batchRendering(e){e()}updateSize(){this.trigger("_resize",!0)}setOption(e,t){this.dispatch({type:"SET_OPTION",optionName:e,rawOptionValue:t})}getOption(e){return this.currentDataManager.currentCalendarOptionsInput[e]}getAvailableLocaleCodes(){return Object.keys(this.getCurrentData().availableRawLocales)}on(e,t){let{currentDataManager:i}=this;i.currentCalendarOptionsRefiners[e]?i.emitter.on(e,t):console.warn(`Unknown listener name '${e}'`)}off(e,t){this.currentDataManager.emitter.off(e,t)}trigger(e,...t){this.currentDataManager.emitter.trigger(e,...t)}changeView(e,t){this.batchRendering(()=>{if(this.unselect(),t)if(t.start&&t.end)this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e}),this.dispatch({type:"SET_OPTION",optionName:"visibleRange",rawOptionValue:t});else{let{dateEnv:i}=this.getCurrentData();this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e,dateMarker:i.createMarker(t)})}else this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e})})}zoomTo(e,t){let i;t=t||"day",i=this.getCurrentData().viewSpecs[t]||this.getUnitViewSpec(t),this.unselect(),i?this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:i.type,dateMarker:e}):this.dispatch({type:"CHANGE_DATE",dateMarker:e})}getUnitViewSpec(e){let t,i,{viewSpecs:n,toolbarConfig:r}=this.getCurrentData(),s=[].concat(r.header?r.header.viewsWithButtons:[],r.footer?r.footer.viewsWithButtons:[]);for(let e in n)s.push(e);for(t=0;t<s.length;t+=1)if(i=n[s[t]],i&&i.singleUnit===e)return i;return null}prev(){this.unselect(),this.dispatch({type:"PREV"})}next(){this.unselect(),this.dispatch({type:"NEXT"})}prevYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,-1)})}nextYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,1)})}today(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.nowManager.getDateMarker()})}gotoDate(e){let t=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:t.dateEnv.createMarker(e)})}incrementDate(e){let t=this.getCurrentData(),i=U(e);i&&(this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:t.dateEnv.add(t.currentDate,i)}))}getDate(){let e=this.getCurrentData();return e.dateEnv.toDate(e.currentDate)}formatDate(e,t){let{dateEnv:i}=this.getCurrentData();return i.format(i.createMarker(e),Fe(t))}formatRange(e,t,i){let{dateEnv:n}=this.getCurrentData();return n.formatRange(n.createMarker(e),n.createMarker(t),Fe(i),i)}formatIso(e,t){let{dateEnv:i}=this.getCurrentData();return i.formatIso(i.createMarker(e),{omitTime:t})}select(e,t){let i;i=null==t?null!=e.start?e:{start:e,end:null}:{start:e,end:t};let n=this.getCurrentData(),r=function(e,t,i){let n=function(e,t){let{refined:i,extra:n}=Ge(e,Wi),r=i.start?t.createMarkerMeta(i.start):null,s=i.end?t.createMarkerMeta(i.end):null,{allDay:o}=i;return null==o&&(o=r&&r.isTimeUnspecified&&(!s||s.isTimeUnspecified)),Object.assign({range:{start:r?r.marker:null,end:s?s.marker:null},allDay:o},n)}(e,t),{range:r}=n;if(!r.start)return null;if(!r.end){if(null==i)return null;r.end=t.add(r.start,i)}return n}(i,n.dateEnv,U({days:1}));r&&(this.dispatch({type:"SELECT_DATES",selection:r}),yi(r,null,n))}unselect(e){let t=this.getCurrentData();t.dateSelection&&(this.dispatch({type:"UNSELECT_DATES"}),function(e,t){t.emitter.trigger("unselect",{jsEvent:e?e.origEvent:null,view:t.viewApi||t.calendarApi.view})}(e,t))}addEvent(e,t){if(e instanceof ki){let t=e._def,i=e._instance;return this.getCurrentData().eventStore.defs[t.defId]||(this.dispatch({type:"ADD_EVENTS",eventStore:Zt({def:t,instance:i})}),this.triggerEventAdd(e)),e}let i,n=this.getCurrentData();if(t instanceof Ti)i=t.internalEventSource;else if("boolean"==typeof t)t&&([i]=et(n.eventSources));else if(null!=t){let e=this.getEventSourceById(t);if(!e)return console.warn(`Could not find an event source with ID "${t}"`),null;i=e.internalEventSource}let r=Ut(e,i,n,!1);if(r){let e=new ki(n,r.def,r.def.recurringDef?null:r.instance);return this.dispatch({type:"ADD_EVENTS",eventStore:Zt(r)}),this.triggerEventAdd(e),e}return null}triggerEventAdd(e){let{emitter:t}=this.getCurrentData();t.trigger("eventAdd",{event:e,relatedEvents:[],revert:()=>{this.dispatch({type:"REMOVE_EVENTS",eventStore:Mi(e)})}})}getEventById(e){let t=this.getCurrentData(),{defs:i,instances:n}=t.eventStore;e=String(e);for(let r in i){let s=i[r];if(s.publicId===e){if(s.recurringDef)return new ki(t,s,null);for(let e in n){let i=n[e];if(i.defId===s.defId)return new ki(t,s,i)}}}return null}getEvents(){let e=this.getCurrentData();return Ai(e.eventStore,e)}removeAllEvents(){this.dispatch({type:"REMOVE_ALL_EVENTS"})}getEventSources(){let e=this.getCurrentData(),t=e.eventSources,i=[];for(let n in t)i.push(new Ti(e,t[n]));return i}getEventSourceById(e){let t=this.getCurrentData(),i=t.eventSources;e=String(e);for(let n in i)if(i[n].publicId===e)return new Ti(t,i[n]);return null}addEventSource(e){let t=this.getCurrentData();if(e instanceof Ti)return t.eventSources[e.internalEventSource.sourceId]||this.dispatch({type:"ADD_EVENT_SOURCES",sources:[e.internalEventSource]}),e;let i=li(e,t);return i?(this.dispatch({type:"ADD_EVENT_SOURCES",sources:[i]}),new Ti(t,i)):null}removeAllEventSources(){this.dispatch({type:"REMOVE_ALL_EVENT_SOURCES"})}refetchEvents(){this.dispatch({type:"FETCH_EVENT_SOURCES",isRefetch:!0})}scrollToTime(e){let t=U(e);t&&this.trigger("_scrollRequest",{time:t})}}function ln(e,t){return e.left>=t.left&&e.left<t.right&&e.top>=t.top&&e.top<t.bottom}function cn(e,t){let i={left:Math.max(e.left,t.left),right:Math.min(e.right,t.right),top:Math.max(e.top,t.top),bottom:Math.min(e.bottom,t.bottom)};return i.left<i.right&&i.top<i.bottom&&i}function hn(e,t){return{left:Math.min(Math.max(e.left,t.left),t.right),top:Math.min(Math.max(e.top,t.top),t.bottom)}}function dn(e){return{left:(e.left+e.right)/2,top:(e.top+e.bottom)/2}}function un(e,t){return{left:e.left-t.left,top:e.top-t.top}}const fn={defs:{},instances:{}};class pn{constructor(){this.getKeysForEventDefs=we(this._getKeysForEventDefs),this.splitDateSelection=we(this._splitDateSpan),this.splitEventStore=we(this._splitEventStore),this.splitIndividualUi=we(this._splitIndividualUi),this.splitEventDrag=we(this._splitInteraction),this.splitEventResize=we(this._splitInteraction),this.eventUiBuilders={}}splitProps(e){let t=this.getKeyInfo(e),i=this.getKeysForEventDefs(e.eventStore),n=this.splitDateSelection(e.dateSelection),r=this.splitIndividualUi(e.eventUiBases,i),s=this.splitEventStore(e.eventStore,i),o=this.splitEventDrag(e.eventDrag),a=this.splitEventResize(e.eventResize),l={};this.eventUiBuilders=Ke(t,(e,t)=>this.eventUiBuilders[t]||we(mn));for(let i in t){let c=t[i],h=s[i]||fn,d=this.eventUiBuilders[i];l[i]={businessHours:c.businessHours||e.businessHours,dateSelection:n[i]||null,eventStore:h,eventUiBases:d(e.eventUiBases[""],c.ui,r[i]),eventSelection:h.instances[e.eventSelection]?e.eventSelection:"",eventDrag:o[i]||null,eventResize:a[i]||null}}return l}_splitDateSpan(e){let t={};if(e){let i=this.getKeysForDateSpan(e);for(let n of i)t[n]=e}return t}_getKeysForEventDefs(e){return Ke(e.defs,e=>this.getKeysForEventDef(e))}_splitEventStore(e,t){let{defs:i,instances:n}=e,r={};for(let e in i)for(let n of t[e])r[n]||(r[n]=Kt()),r[n].defs[e]=i[e];for(let e in n){let i=n[e];for(let n of t[i.defId])r[n]&&(r[n].instances[e]=i)}return r}_splitIndividualUi(e,t){let i={};for(let n in e)if(n)for(let r of t[n])i[r]||(i[r]={}),i[r][n]=e[n];return i}_splitInteraction(e){let t={};if(e){let i=this._splitEventStore(e.affectedEvents,this._getKeysForEventDefs(e.affectedEvents)),n=this._getKeysForEventDefs(e.mutatedEvents),r=this._splitEventStore(e.mutatedEvents,n),s=n=>{t[n]||(t[n]={affectedEvents:i[n]||fn,mutatedEvents:r[n]||fn,isEvent:e.isEvent})};for(let e in i)s(e);for(let e in r)s(e)}return t}}function mn(e,t,i){let n=[];e&&n.push(e),t&&n.push(t);let r={"":si(n)};return i&&Object.assign(r,i),r}function gn(e,t,i,n){return{dow:e.getUTCDay(),isDisabled:Boolean(n&&(!n.activeRange||!Pt(n.activeRange,e))),isOther:Boolean(n&&!Pt(n.currentRange,e)),isToday:Boolean(t&&Pt(t,e)),isPast:Boolean(i?e<i:!!t&&e<t.start),isFuture:Boolean(i?e>i:!!t&&e>=t.end)}}function _n(e,t){let i=["fc-day",`fc-day-${te[e.dow]}`];return e.isDisabled?i.push("fc-day-disabled"):(e.isToday&&(i.push("fc-day-today"),i.push(t.getClass("today"))),e.isPast&&i.push("fc-day-past"),e.isFuture&&i.push("fc-day-future"),e.isOther&&i.push("fc-day-other")),i}const yn=Fe({year:"numeric",month:"long",day:"numeric"}),vn=Fe({week:"long"});function xn(e,t,i="day",n=!0){const{dateEnv:r,options:s,calendarApi:o}=e;let a=r.format(t,"week"===i?vn:yn);if(s.navLinks){let e=r.toDate(t);const l=e=>{let n="day"===i?s.navLinkDayClick:"week"===i?s.navLinkWeekClick:null;"function"==typeof n?n.call(o,r.toDate(t),e):("string"==typeof n&&(i=n),o.zoomTo(t,i))};return Object.assign({title:Y(s.navLinkHint,[a,e],a),"data-navlink":""},n?A(l):{onClick:l})}return{"aria-label":a}}let bn,wn=null;function Sn(e){return{x:e.offsetHeight-e.clientHeight,y:e.offsetWidth-e.clientWidth}}function Tn(e,t=!1,i){let n=i?e.getBoundingClientRect():kn(e),r=function(e,t=!1){let i=window.getComputedStyle(e),n=parseInt(i.borderLeftWidth,10)||0,r=parseInt(i.borderRightWidth,10)||0,s=parseInt(i.borderTopWidth,10)||0,o=parseInt(i.borderBottomWidth,10)||0,a=Sn(e),l=a.y-n-r,c={borderLeft:n,borderRight:r,borderTop:s,borderBottom:o,scrollbarBottom:a.x-s-o,scrollbarLeft:0,scrollbarRight:0};return null===wn&&(wn=function(){let e=document.createElement("div");_(e,{position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}),e.innerHTML="<div></div>",document.body.appendChild(e);let t=e.firstChild.getBoundingClientRect().left>e.getBoundingClientRect().left;return f(e),t}()),wn&&"rtl"===i.direction?c.scrollbarLeft=l:c.scrollbarRight=l,t&&(c.paddingLeft=parseInt(i.paddingLeft,10)||0,c.paddingRight=parseInt(i.paddingRight,10)||0,c.paddingTop=parseInt(i.paddingTop,10)||0,c.paddingBottom=parseInt(i.paddingBottom,10)||0),c}(e,t),s={left:n.left+r.borderLeft+r.scrollbarLeft,right:n.right-r.borderRight-r.scrollbarRight,top:n.top+r.borderTop,bottom:n.bottom-r.borderBottom-r.scrollbarBottom};return t&&(s.left+=r.paddingLeft,s.right-=r.paddingRight,s.top+=r.paddingTop,s.bottom-=r.paddingBottom),s}function kn(e){let t=e.getBoundingClientRect();return{left:t.left+window.scrollX,top:t.top+window.scrollY,right:t.right+window.scrollX,bottom:t.bottom+window.scrollY}}function Mn(e){let t=[];for(;e instanceof HTMLElement;){let i=window.getComputedStyle(e);if("fixed"===i.position)break;/(auto|scroll)/.test(i.overflow+i.overflowY+i.overflowX)&&t.push(e),e=e.parentNode}return t}class An{constructor(e,t,i,n){this.els=t;let r=this.originClientRect=e.getBoundingClientRect();i&&this.buildElHorizontals(r.left),n&&this.buildElVerticals(r.top)}buildElHorizontals(e){let t=[],i=[];for(let n of this.els){let r=n.getBoundingClientRect();t.push(r.left-e),i.push(r.right-e)}this.lefts=t,this.rights=i}buildElVerticals(e){let t=[],i=[];for(let n of this.els){let r=n.getBoundingClientRect();t.push(r.top-e),i.push(r.bottom-e)}this.tops=t,this.bottoms=i}leftToIndex(e){let t,{lefts:i,rights:n}=this,r=i.length;for(t=0;t<r;t+=1)if(e>=i[t]&&e<n[t])return t}topToIndex(e){let t,{tops:i,bottoms:n}=this,r=i.length;for(t=0;t<r;t+=1)if(e>=i[t]&&e<n[t])return t}getWidth(e){return this.rights[e]-this.lefts[e]}getHeight(e){return this.bottoms[e]-this.tops[e]}similarTo(e){return Cn(this.tops||[],e.tops||[])&&Cn(this.bottoms||[],e.bottoms||[])&&Cn(this.lefts||[],e.lefts||[])&&Cn(this.rights||[],e.rights||[])}}function Cn(e,t){const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(Math.round(e[n])!==Math.round(t[n]))return!1;return!0}class Dn{getMaxScrollTop(){return this.getScrollHeight()-this.getClientHeight()}getMaxScrollLeft(){return this.getScrollWidth()-this.getClientWidth()}canScrollVertically(){return this.getMaxScrollTop()>0}canScrollHorizontally(){return this.getMaxScrollLeft()>0}canScrollUp(){return this.getScrollTop()>0}canScrollDown(){return this.getScrollTop()<this.getMaxScrollTop()}canScrollLeft(){return this.getScrollLeft()>0}canScrollRight(){return this.getScrollLeft()<this.getMaxScrollLeft()}}class Ln extends Dn{constructor(e){super(),this.el=e}getScrollTop(){return this.el.scrollTop}getScrollLeft(){return this.el.scrollLeft}setScrollTop(e){this.el.scrollTop=e}setScrollLeft(e){this.el.scrollLeft=e}getScrollWidth(){return this.el.scrollWidth}getScrollHeight(){return this.el.scrollHeight}getClientHeight(){return this.el.clientHeight}getClientWidth(){return this.el.clientWidth}}class En extends(270==i.j?Dn:null){getScrollTop(){return window.scrollY}getScrollLeft(){return window.scrollX}setScrollTop(e){window.scroll(window.scrollX,e)}setScrollLeft(e){window.scroll(e,window.scrollY)}getScrollWidth(){return document.documentElement.scrollWidth}getScrollHeight(){return document.documentElement.scrollHeight}getClientHeight(){return document.documentElement.clientHeight}getClientWidth(){return document.documentElement.clientWidth}}class In extends _t{constructor(){super(...arguments),this.uid=L()}prepareHits(){}queryHit(e,t,i,n){return null}isValidSegDownEl(e){return!this.props.eventDrag&&!this.props.eventResize&&!p(e,".fc-event-mirror")}isValidDateDownEl(e){return!(p(e,".fc-event:not(.fc-bg-event)")||p(e,".fc-more-link")||p(e,"a[data-navlink]")||p(e,".fc-popover"))}}class Pn{constructor(e=e=>e.thickness||1){this.getEntryThickness=e,this.strictOrder=!1,this.allowReslicing=!1,this.maxCoord=-1,this.maxStackCnt=-1,this.levelCoords=[],this.entriesByLevel=[],this.stackCnts={}}addSegs(e){let t=[];for(let i of e)this.insertEntry(i,t);return t}insertEntry(e,t){let i=this.findInsertion(e);this.isInsertionValid(i,e)?this.insertEntryAt(e,i):this.handleInvalidInsertion(i,e,t)}isInsertionValid(e,t){return(-1===this.maxCoord||e.levelCoord+this.getEntryThickness(t)<=this.maxCoord)&&(-1===this.maxStackCnt||e.stackCnt<this.maxStackCnt)}handleInvalidInsertion(e,t,i){if(this.allowReslicing&&e.touchingEntry){const n=Object.assign(Object.assign({},t),{span:Nn(t.span,e.touchingEntry.span)});i.push(n),this.splitEntry(t,e.touchingEntry,i)}else i.push(t)}splitEntry(e,t,i){let n=e.span,r=t.span;n.start<r.start&&this.insertEntry({index:e.index,thickness:e.thickness,span:{start:n.start,end:r.start}},i),n.end>r.end&&this.insertEntry({index:e.index,thickness:e.thickness,span:{start:r.end,end:n.end}},i)}insertEntryAt(e,t){let{entriesByLevel:i,levelCoords:n}=this;-1===t.lateral?(Yn(n,t.level,t.levelCoord),Yn(i,t.level,[e])):Yn(i[t.level],t.lateral,e),this.stackCnts[On(e)]=t.stackCnt}findInsertion(e){let{levelCoords:t,entriesByLevel:i,strictOrder:n,stackCnts:r}=this,s=t.length,o=0,a=-1,l=-1,c=null,h=0;for(let d=0;d<s;d+=1){const s=t[d];if(!n&&s>=o+this.getEntryThickness(e))break;let u,f=i[d],p=Bn(f,e.span.start,Rn),m=p[0]+p[1];for(;(u=f[m])&&u.span.start<e.span.end;){let e=s+this.getEntryThickness(u);e>o&&(o=e,c=u,a=d,l=m),e===o&&(h=Math.max(h,r[On(u)]+1)),m+=1}}let d=0;if(c)for(d=a+1;d<s&&t[d]<o;)d+=1;let u=-1;return d<s&&t[d]===o&&(u=Bn(i[d],e.span.end,Rn)[0]),{touchingLevel:a,touchingLateral:l,touchingEntry:c,stackCnt:h,levelCoord:o,level:d,lateral:u}}toRects(){let{entriesByLevel:e,levelCoords:t}=this,i=e.length,n=[];for(let r=0;r<i;r+=1){let i=e[r],s=t[r];for(let e of i)n.push(Object.assign(Object.assign({},e),{thickness:this.getEntryThickness(e),levelCoord:s}))}return n}}function Rn(e){return e.span.end}function On(e){return e.index+":"+e.span.start}function zn(e){let t=[];for(let i of e){let e=[],n={span:i.span,entries:[i]};for(let i of t)Nn(i.span,n.span)?n={entries:i.entries.concat(n.entries),span:Fn(i.span,n.span)}:e.push(i);e.push(n),t=e}return t}function Fn(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function Nn(e,t){let i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return i<n?{start:i,end:n}:null}function Yn(e,t,i){e.splice(t,0,i)}function Bn(e,t,i){let n=0,r=e.length;if(!r||t<i(e[n]))return[0,0];if(t>i(e[r-1]))return[r,0];for(;n<r;){let s=Math.floor(n+(r-n)/2),o=i(e[s]);if(t<o)r=s;else{if(!(t>o))return[s,1];n=s+1}}return[n,0]}class Hn{constructor(e,t){this.emitter=new mi}destroy(){}setMirrorIsVisible(e){}setMirrorNeedsRevert(e){}setAutoScrollEnabled(e){}}const jn={};Boolean;const Vn="fc-col-header-cell";function Wn(e){return e.text}class Un extends _t{render(){let{dateEnv:e,options:t,theme:i,viewApi:r}=this.context,{props:s}=this,{date:o,dateProfile:a}=s,l=gn(o,s.todayRange,null,a),c=[Vn].concat(_n(l,i)),h=e.format(o,s.dayHeaderFormat),d=!l.isDisabled&&s.colCnt>1?xn(this.context,o):{},u=e.toDate(o);e.namedTimeZoneImpl&&(u=re(u,36e5));let f=Object.assign(Object.assign(Object.assign({date:u,view:r},s.extraRenderProps),{text:h}),l);return(0,n.n)(Tt,{elTag:"th",elClasses:c,elAttrs:Object.assign({role:"columnheader",colSpan:s.colSpan,"data-date":l.isDisabled?void 0:ye(o)},s.extraDataAttrs),renderProps:f,generatorName:"dayHeaderContent",customGenerator:t.dayHeaderContent,defaultGenerator:Wn,classNameGenerator:t.dayHeaderClassNames,didMount:t.dayHeaderDidMount,willUnmount:t.dayHeaderWillUnmount},e=>(0,n.n)("div",{className:"fc-scrollgrid-sync-inner"},!l.isDisabled&&(0,n.n)(e,{elTag:"a",elAttrs:d,elClasses:["fc-col-header-cell-cushion",s.isSticky&&"fc-sticky"]})))}}const $n=Fe({weekday:"long"});class Gn extends _t{render(){let{props:e}=this,{dateEnv:t,theme:i,viewApi:r,options:s}=this.context,o=ne(new Date(2592e5),e.dow),a={dow:e.dow,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},l=t.format(o,e.dayHeaderFormat),c=Object.assign(Object.assign(Object.assign(Object.assign({date:o},a),{view:r}),e.extraRenderProps),{text:l});return(0,n.n)(Tt,{elTag:"th",elClasses:[Vn,..._n(a,i),...e.extraClassNames||[]],elAttrs:Object.assign({role:"columnheader",colSpan:e.colSpan},e.extraDataAttrs),renderProps:c,generatorName:"dayHeaderContent",customGenerator:s.dayHeaderContent,defaultGenerator:Wn,classNameGenerator:s.dayHeaderClassNames,didMount:s.dayHeaderDidMount,willUnmount:s.dayHeaderWillUnmount},i=>(0,n.n)("div",{className:"fc-scrollgrid-sync-inner"},(0,n.n)(i,{elTag:"a",elClasses:["fc-col-header-cell-cushion",e.isSticky&&"fc-sticky"],elAttrs:{"aria-label":t.format(o,$n)}})))}}class Xn extends _t{constructor(){super(...arguments),this.createDayHeaderFormatter=we(qn)}render(){let{context:e}=this,{dates:t,dateProfile:i,datesRepDistinctDays:r,renderIntro:s}=this.props,o=this.createDayHeaderFormatter(e.options.dayHeaderFormat,r,t.length);return(0,n.n)(sn,{unit:"day"},(e,a)=>(0,n.n)("tr",{role:"row"},s&&s("day"),t.map(e=>r?(0,n.n)(Un,{key:e.toISOString(),date:e,dateProfile:i,todayRange:a,colCnt:t.length,dayHeaderFormat:o}):(0,n.n)(Gn,{key:e.getUTCDay(),dow:e.getUTCDay(),dayHeaderFormat:o}))))}}function qn(e,t,i){return e||function(e,t){return Fe(!e||t>10?{weekday:"short"}:t>1?{weekday:"short",month:"numeric",day:"numeric",omitCommas:!0}:{weekday:"long"})}(t,i)}class Zn{constructor(e,t){let i=e.start,{end:n}=e,r=[],s=[],o=-1;for(;i<n;)t.isHiddenDay(i)?r.push(o+.5):(o+=1,r.push(o),s.push(i)),i=ne(i,1);this.dates=s,this.indices=r,this.cnt=s.length}sliceRange(e){let t=this.getDateDayIndex(e.start),i=this.getDateDayIndex(ne(e.end,-1)),n=Math.max(0,t),r=Math.min(this.cnt-1,i);return n=Math.ceil(n),r=Math.floor(r),n<=r?{firstIndex:n,lastIndex:r,isStart:t===n,isEnd:i===r}:null}getDateDayIndex(e){let{indices:t}=this,i=Math.floor(oe(this.dates[0],e));return i<0?t[0]-1:i>=t.length?t[t.length-1]+1:t[i]}}class Jn{constructor(e,t){let i,n,r,{dates:s}=e;if(t){for(n=s[0].getUTCDay(),i=1;i<s.length&&s[i].getUTCDay()!==n;i+=1);r=Math.ceil(s.length/i)}else r=1,i=s.length;this.rowCnt=r,this.colCnt=i,this.daySeries=e,this.cells=this.buildCells(),this.headerDates=this.buildHeaderDates()}buildCells(){let e=[];for(let t=0;t<this.rowCnt;t+=1){let i=[];for(let e=0;e<this.colCnt;e+=1)i.push(this.buildCell(t,e));e.push(i)}return e}buildCell(e,t){let i=this.daySeries.dates[e*this.colCnt+t];return{key:i.toISOString(),date:i}}buildHeaderDates(){let e=[];for(let t=0;t<this.colCnt;t+=1)e.push(this.cells[0][t].date);return e}sliceRange(e){let{colCnt:t}=this,i=this.daySeries.sliceRange(e),n=[];if(i){let{firstIndex:e,lastIndex:r}=i,s=e;for(;s<=r;){let o=Math.floor(s/t),a=Math.min((o+1)*t,r+1);n.push({row:o,firstCol:s%t,lastCol:(a-1)%t,isStart:i.isStart&&s===e,isEnd:i.isEnd&&a-1===r}),s=a}}return n}}class Kn{constructor(){this.sliceBusinessHours=we(this._sliceBusinessHours),this.sliceDateSelection=we(this._sliceDateSpan),this.sliceEventStore=we(this._sliceEventStore),this.sliceEventDrag=we(this._sliceInteraction),this.sliceEventResize=we(this._sliceInteraction),this.forceDayIfListItem=!1}sliceProps(e,t,i,n,...r){let{eventUiBases:s}=e,o=this.sliceEventStore(e.eventStore,s,t,i,...r);return{dateSelectionSegs:this.sliceDateSelection(e.dateSelection,t,i,s,n,...r),businessHourSegs:this.sliceBusinessHours(e.businessHours,t,i,n,...r),fgEventSegs:o.fg,bgEventSegs:o.bg,eventDrag:this.sliceEventDrag(e.eventDrag,s,t,i,...r),eventResize:this.sliceEventResize(e.eventResize,s,t,i,...r),eventSelection:e.eventSelection}}sliceNowDate(e,t,i,n,...r){return this._sliceDateSpan({range:{start:e,end:re(e,1)},allDay:!1},t,i,{},n,...r)}_sliceBusinessHours(e,t,i,n,...r){return e?this._sliceEventStore(Bt(e,Qn(t,Boolean(i)),n),{},t,i,...r).bg:[]}_sliceEventStore(e,t,i,n,...r){if(e){let s=Ci(e,t,Qn(i,Boolean(n)),n);return{bg:this.sliceEventRanges(s.bg,r),fg:this.sliceEventRanges(s.fg,r)}}return{bg:[],fg:[]}}_sliceInteraction(e,t,i,n,...r){if(!e)return null;let s=Ci(e.mutatedEvents,t,Qn(i,Boolean(n)),n);return{segs:this.sliceEventRanges(s.fg,r),affectedInstances:e.affectedEvents.instances,isEvent:e.isEvent}}_sliceDateSpan(e,t,i,n,r,...s){if(!e)return[];let o=Qn(t,Boolean(i)),a=Lt(e.range,o);if(a){let t=function(e,t,i){let n=$t({editable:!1},i),r=Xt(n.refined,n.extra,"",e.allDay,!0,i);return{def:r,ui:Pi(r,t),instance:Yt(r.defId,e.range),range:e.range,isStart:!0,isEnd:!0}}(e=Object.assign(Object.assign({},e),{range:a}),n,r),i=this.sliceRange(e.range,...s);for(let e of i)e.eventRange=t;return i}return[]}sliceEventRanges(e,t){let i=[];for(let n of e)i.push(...this.sliceEventRange(n,t));return i}sliceEventRange(e,t){let i=e.range;this.forceDayIfListItem&&"list-item"===e.ui.display&&(i={start:i.start,end:ne(i.start,1)});let n=this.sliceRange(i,...t);for(let t of n)t.eventRange=e,t.isStart=e.isStart&&t.isStart,t.isEnd=e.isEnd&&t.isEnd;return n}}function Qn(e,t){let i=e.activeRange;return t?i:{start:re(i.start,e.slotMinTime.milliseconds),end:re(i.end,e.slotMaxTime.milliseconds-864e5)}}function er(e,t,i){let{instances:n}=e.mutatedEvents;for(let e in n)if(!It(t.validRange,n[e].range))return!1;return ir({eventDrag:e},i)}function tr(e,t,i){return!!It(t.validRange,e.range)&&ir({dateSelection:e},i)}function ir(e,t){let i=t.getCurrentData(),n=Object.assign({businessHours:i.businessHours,dateSelection:"",eventStore:i.eventStore,eventUiBases:i.eventUiBases,eventSelection:"",eventDrag:null,eventResize:null},e);return(t.pluginHooks.isPropsValid||nr)(n,t)}function nr(e,t,i={},n){return!(e.eventDrag&&!function(e,t,i,n){let r=t.getCurrentData(),s=e.eventDrag,o=s.mutatedEvents,a=o.defs,l=o.instances,c=Ii(a,s.isEvent?e.eventUiBases:{"":r.selectionConfig});n&&(c=Ke(c,n));let h=(p=e.eventStore,m=s.affectedEvents.instances,{defs:p.defs,instances:Je(p.instances,e=>!m[e.instanceId])}),d=h.defs,u=h.instances,f=Ii(d,e.eventUiBases);var p,m;for(let n in l){let o=l[n],p=o.range,m=c[o.defId],g=a[o.defId];if(!rr(m.constraints,p,h,e.businessHours,t))return!1;let{eventOverlap:_}=t.options,y="function"==typeof _?_:null;for(let e in u){let i=u[e];if(Et(p,i.range)){if(!1===f[i.defId].overlap&&s.isEvent)return!1;if(!1===m.overlap)return!1;if(y&&!y(new ki(t,d[i.defId],i),new ki(t,g,o)))return!1}}let v=r.eventStore;for(let e of m.allows){let r,s=Object.assign(Object.assign({},i),{range:o.range,allDay:g.allDay}),a=v.defs[g.defId],l=v.instances[n];if(r=a?new ki(t,a,l):new ki(t,g),!e(vi(s,t),r))return!1}}return!0}(e,t,i,n)||e.dateSelection&&!function(e,t,i,n){let r=e.eventStore,s=r.defs,o=r.instances,a=e.dateSelection,l=a.range,{selectionConfig:c}=t.getCurrentData();if(n&&(c=n(c)),!rr(c.constraints,l,r,e.businessHours,t))return!1;let{selectOverlap:h}=t.options,d="function"==typeof h?h:null;for(let e in o){let i=o[e];if(Et(l,i.range)){if(!1===c.overlap)return!1;if(d&&!d(new ki(t,s[i.defId],i),null))return!1}}for(let e of c.allows)if(!e(vi(Object.assign(Object.assign({},i),a),t),null))return!1;return!0}(e,t,i,n))}function rr(e,t,i,n,r){for(let s of e)if(!ar(sr(s,t,i,n,r),t))return!1;return!0}function sr(e,t,i,n,r){return"businessHours"===e?or(Bt(n,t,r)):"string"==typeof e?or(ei(i,t=>t.groupId===e)):"object"==typeof e&&e?or(Bt(e,t,r)):[]}function or(e){let{instances:t}=e,i=[];for(let e in t)i.push(t[e].range);return i}function ar(e,t){for(let i of e)if(It(i,t))return!0;return!1}const lr=/^(visible|hidden)$/;class cr extends _t{constructor(){super(...arguments),this.handleEl=e=>{this.el=e,yt(this.props.elRef,e)}}render(){let{props:e}=this,{liquid:t,liquidIsAbsolute:i}=e,r=t&&i,s=["fc-scroller"];return t&&(i?s.push("fc-scroller-liquid-absolute"):s.push("fc-scroller-liquid")),(0,n.n)("div",{ref:this.handleEl,className:s.join(" "),style:{overflowX:e.overflowX,overflowY:e.overflowY,left:r&&-(e.overcomeLeft||0)||"",right:r&&-(e.overcomeRight||0)||"",bottom:r&&-(e.overcomeBottom||0)||"",marginLeft:!r&&-(e.overcomeLeft||0)||"",marginRight:!r&&-(e.overcomeRight||0)||"",marginBottom:!r&&-(e.overcomeBottom||0)||"",maxHeight:e.maxHeight||""}},e.children)}needsXScrolling(){if(lr.test(this.props.overflowX))return!1;let{el:e}=this,t=this.el.getBoundingClientRect().width-this.getYScrollbarWidth(),{children:i}=e;for(let e=0;e<i.length;e+=1)if(i[e].getBoundingClientRect().width>t)return!0;return!1}needsYScrolling(){if(lr.test(this.props.overflowY))return!1;let{el:e}=this,t=this.el.getBoundingClientRect().height-this.getXScrollbarWidth(),{children:i}=e;for(let e=0;e<i.length;e+=1)if(i[e].getBoundingClientRect().height>t)return!0;return!1}getXScrollbarWidth(){return lr.test(this.props.overflowX)?0:this.el.offsetHeight-this.el.clientHeight}getYScrollbarWidth(){return lr.test(this.props.overflowY)?0:this.el.offsetWidth-this.el.clientWidth}}class hr{constructor(e){this.masterCallback=e,this.currentMap={},this.depths={},this.callbackMap={},this.handleValue=(e,t)=>{let{depths:i,currentMap:n}=this,r=!1,s=!1;null!==e?(r=t in n,n[t]=e,i[t]=(i[t]||0)+1,s=!0):(i[t]-=1,i[t]||(delete n[t],delete this.callbackMap[t],r=!0)),this.masterCallback&&(r&&this.masterCallback(null,String(t)),s&&this.masterCallback(e,String(t)))}}createRef(e){let t=this.callbackMap[e];return t||(t=this.callbackMap[e]=t=>{this.handleValue(t,String(e))}),t}collect(e,t,i){return function(e,t=0,i,n=1){let r=[];null==i&&(i=Object.keys(e).length);for(let s=t;s<i;s+=n){let t=e[s];void 0!==t&&r.push(t)}return r}(this.currentMap,e,t,i)}getAll(){return et(this.currentMap)}}function dr(e,t){return e.liquid&&t.liquid}function ur(e,t){return ee(e,t,tt)}function fr(e,t){let i=[];for(let r of e){let e=r.span||1;for(let s=0;s<e;s+=1)i.push((0,n.n)("col",{style:{width:"shrink"===r.width?pr(t):r.width||"",minWidth:r.minWidth||""}}))}return(0,n.n)("colgroup",{},...i)}function pr(e){return null==e?4:e}function mr(e,t){let i=["fc-scrollgrid-section",`fc-scrollgrid-section-${e.type}`,e.className];return t&&e.liquid&&null==e.maxHeight&&i.push("fc-scrollgrid-section-liquid"),e.isSticky&&i.push("fc-scrollgrid-section-sticky"),i}function gr(e){return(0,n.n)("div",{className:"fc-scrollgrid-sticky-shim",style:{width:e.clientWidth,minWidth:e.tableMinWidth}})}function _r(e){let{stickyHeaderDates:t}=e;return null!=t&&"auto"!==t||(t="auto"===e.height||"auto"===e.viewHeight),t}function yr(e){let{stickyFooterScrollbar:t}=e;return null!=t&&"auto"!==t||(t="auto"===e.height||"auto"===e.viewHeight),t}class vr extends _t{constructor(){super(...arguments),this.processCols=we(e=>e,ur),this.renderMicroColGroup=we(fr),this.scrollerRefs=new hr,this.scrollerElRefs=new hr(this._handleScrollerEl.bind(this)),this.state={shrinkWidth:null,forceYScrollbars:!1,scrollerClientWidths:{},scrollerClientHeights:{}},this.handleSizing=()=>{this.safeSetState(Object.assign({shrinkWidth:this.computeShrinkWidth()},this.computeScrollerDims()))}}render(){let{props:e,state:t,context:i}=this,r=e.sections||[],s=this.processCols(e.cols),o=this.renderMicroColGroup(s,t.shrinkWidth),a=function(e,t){let i=["fc-scrollgrid",t.theme.getClass("table")];return e&&i.push("fc-scrollgrid-liquid"),i}(e.liquid,i);e.collapsibleWidth&&a.push("fc-scrollgrid-collapsible");let l,c=r.length,h=0,d=[],u=[],f=[];for(;h<c&&"header"===(l=r[h]).type;)d.push(this.renderSection(l,o,!0)),h+=1;for(;h<c&&"body"===(l=r[h]).type;)u.push(this.renderSection(l,o,!1)),h+=1;for(;h<c&&"footer"===(l=r[h]).type;)f.push(this.renderSection(l,o,!0)),h+=1;let p=!Ki();const m={role:"rowgroup"};return(0,n.n)("table",{role:"grid",className:a.join(" "),style:{height:e.height}},Boolean(!p&&d.length)&&(0,n.n)("thead",m,...d),Boolean(!p&&u.length)&&(0,n.n)("tbody",m,...u),Boolean(!p&&f.length)&&(0,n.n)("tfoot",m,...f),p&&(0,n.n)("tbody",m,...d,...u,...f))}renderSection(e,t,i){return"outerContent"in e?(0,n.n)(n.FK,{key:e.key},e.outerContent):(0,n.n)("tr",{key:e.key,role:"presentation",className:mr(e,this.props.liquid).join(" ")},this.renderChunkTd(e,t,e.chunk,i))}renderChunkTd(e,t,i,r){if("outerContent"in i)return i.outerContent;let{props:s}=this,{forceYScrollbars:o,scrollerClientWidths:a,scrollerClientHeights:l}=this.state,c=function(e,t){return null!=t.maxHeight||dr(e,t)}(s,e),h=dr(s,e),d=s.liquid?o?"scroll":c?"auto":"hidden":"visible",u=e.key,f=function(e,t,i,r){let{expandRows:s}=i;return"function"==typeof t.content?t.content(i):(0,n.n)("table",{role:"presentation",className:[t.tableClassName,e.syncRowHeights?"fc-scrollgrid-sync-table":""].join(" "),style:{minWidth:i.tableMinWidth,width:i.clientWidth,height:s?i.clientHeight:""}},i.tableColGroupNode,(0,n.n)(r?"thead":"tbody",{role:"presentation"},"function"==typeof t.rowContent?t.rowContent(i):t.rowContent))}(e,i,{tableColGroupNode:t,tableMinWidth:"",clientWidth:s.collapsibleWidth||void 0===a[u]?null:a[u],clientHeight:void 0!==l[u]?l[u]:null,expandRows:e.expandRows,syncRowHeights:!1,rowSyncHeights:[],reportRowHeightChange:()=>{}},r);return(0,n.n)(r?"th":"td",{ref:i.elRef,role:"presentation"},(0,n.n)("div",{className:"fc-scroller-harness"+(h?" fc-scroller-harness-liquid":"")},(0,n.n)(cr,{ref:this.scrollerRefs.createRef(u),elRef:this.scrollerElRefs.createRef(u),overflowY:d,overflowX:s.liquid?"hidden":"visible",maxHeight:e.maxHeight,liquid:h,liquidIsAbsolute:!0},f)))}_handleScrollerEl(e,t){let i=function(e,t){for(let i of e)if(i.key===t)return i;return null}(this.props.sections,t);i&&yt(i.chunk.scrollerElRef,e)}componentDidMount(){this.handleSizing(),this.context.addResizeHandler(this.handleSizing)}componentDidUpdate(){this.handleSizing()}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing)}computeShrinkWidth(){return function(e){for(let t of e)if("shrink"===t.width)return!0;return!1}(this.props.cols)?function(e){let t=function(e){let t=e instanceof HTMLElement?[e]:e,i=[];for(let e=0;e<t.length;e+=1){let n=t[e].querySelectorAll(".fc-scrollgrid-shrink");for(let e=0;e<n.length;e+=1)i.push(n[e])}return i}(e),i=0;for(let e of t)i=Math.max(i,j(e));return Math.ceil(i)}(this.scrollerElRefs.getAll()):0}computeScrollerDims(){let e=(bn||(bn=function(){let e=document.createElement("div");e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",e.style.left="-9999px",document.body.appendChild(e);let t=Sn(e);return document.body.removeChild(e),t}()),bn),{scrollerRefs:t,scrollerElRefs:i}=this,n=!1,r={},s={};for(let e in t.currentMap){let i=t.currentMap[e];if(i&&i.needsYScrolling()){n=!0;break}}for(let t of this.props.sections){let o=t.key,a=i.currentMap[o];if(a){let t=a.parentNode;r[o]=Math.floor(t.getBoundingClientRect().width-(n?e.y:0)),s[o]=Math.floor(t.getBoundingClientRect().height)}}return{forceYScrollbars:n,scrollerClientWidths:r,scrollerClientHeights:s}}}vr.addStateEquality({scrollerClientWidths:tt,scrollerClientHeights:tt});class xr extends _t{constructor(){super(...arguments),this.buildPublicEvent=we((e,t,i)=>new ki(e,t,i)),this.handleEl=e=>{this.el=e,yt(this.props.elRef,e),e&&Li(e,this.props.seg)}}render(){const{props:e,context:t}=this,{options:i}=t,{seg:r}=e,{eventRange:s}=r,{ui:o}=s,a={event:this.buildPublicEvent(t,s.def,s.instance),view:t.viewApi,timeText:e.timeText,textColor:o.textColor,backgroundColor:o.backgroundColor,borderColor:o.borderColor,isDraggable:!e.disableDragging&&zi(r,t),isStartResizable:!e.disableResizing&&Fi(r,t),isEndResizable:!e.disableResizing&&Ni(r),isMirror:Boolean(e.isDragging||e.isResizing||e.isDateSelecting),isStart:Boolean(r.isStart),isEnd:Boolean(r.isEnd),isPast:Boolean(e.isPast),isFuture:Boolean(e.isFuture),isToday:Boolean(e.isToday),isSelected:Boolean(e.isSelected),isDragging:Boolean(e.isDragging),isResizing:Boolean(e.isResizing)};return(0,n.n)(Tt,{elRef:this.handleEl,elTag:e.elTag,elAttrs:e.elAttrs,elClasses:[...Hi(a),...r.eventRange.ui.classNames,...e.elClasses||[]],elStyle:e.elStyle,renderProps:a,generatorName:"eventContent",customGenerator:i.eventContent,defaultGenerator:e.defaultGenerator,classNameGenerator:i.eventClassNames,didMount:i.eventDidMount,willUnmount:i.eventWillUnmount},e.children)}componentDidUpdate(e){this.el&&this.props.seg!==e.seg&&Li(this.el,this.props.seg)}}class br extends _t{render(){let{props:e,context:t}=this,{options:i}=t,{seg:r}=e,{ui:s}=r.eventRange,o=Yi(r,i.eventTimeFormat||e.defaultTimeFormat,t,e.defaultDisplayEventTime,e.defaultDisplayEventEnd);return(0,n.n)(xr,Object.assign({},e,{elTag:"a",elStyle:{borderColor:s.borderColor,backgroundColor:s.backgroundColor},elAttrs:Vi(r,t),defaultGenerator:wr,timeText:o}),(e,t)=>(0,n.n)(n.FK,null,(0,n.n)(e,{elTag:"div",elClasses:["fc-event-main"],elStyle:{color:t.textColor}}),Boolean(t.isStartResizable)&&(0,n.n)("div",{className:"fc-event-resizer fc-event-resizer-start"}),Boolean(t.isEndResizable)&&(0,n.n)("div",{className:"fc-event-resizer fc-event-resizer-end"})))}}function wr(e){return(0,n.n)("div",{className:"fc-event-main-frame"},e.timeText&&(0,n.n)("div",{className:"fc-event-time"},e.timeText),(0,n.n)("div",{className:"fc-event-title-container"},(0,n.n)("div",{className:"fc-event-title fc-sticky"},e.event.title||(0,n.n)(n.FK,null," "))))}br.addPropsEquality({seg:tt});const Sr=e=>(0,n.n)(pt.Consumer,null,t=>{let{options:i}=t,r={isAxis:e.isAxis,date:t.dateEnv.toDate(e.date),view:t.viewApi};return(0,n.n)(Tt,{elRef:e.elRef,elTag:e.elTag||"div",elAttrs:e.elAttrs,elClasses:e.elClasses,elStyle:e.elStyle,renderProps:r,generatorName:"nowIndicatorContent",customGenerator:i.nowIndicatorContent,classNameGenerator:i.nowIndicatorClassNames,didMount:i.nowIndicatorDidMount,willUnmount:i.nowIndicatorWillUnmount},e.children)}),Tr=Fe({day:"numeric"});class kr extends _t{constructor(){super(...arguments),this.refineRenderProps=Se(Ar)}render(){let{props:e,context:t}=this,{options:i}=t,r=this.refineRenderProps({date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,isMonthStart:e.isMonthStart||!1,showDayNumber:e.showDayNumber,extraRenderProps:e.extraRenderProps,viewApi:t.viewApi,dateEnv:t.dateEnv,monthStartFormat:i.monthStartFormat});return(0,n.n)(Tt,{elRef:e.elRef,elTag:e.elTag,elAttrs:Object.assign(Object.assign({},e.elAttrs),r.isDisabled?{}:{"data-date":ye(e.date)}),elClasses:[..._n(r,t.theme),...e.elClasses||[]],elStyle:e.elStyle,renderProps:r,generatorName:"dayCellContent",customGenerator:i.dayCellContent,defaultGenerator:e.defaultGenerator,classNameGenerator:r.isDisabled?void 0:i.dayCellClassNames,didMount:i.dayCellDidMount,willUnmount:i.dayCellWillUnmount},e.children)}}function Mr(e){return Boolean(e.dayCellContent||xt("dayCellContent",e))}function Ar(e){let{date:t,dateEnv:i,dateProfile:n,isMonthStart:r}=e,s=gn(t,e.todayRange,null,n),o=e.showDayNumber?i.format(t,r?e.monthStartFormat:Tr):"";return Object.assign(Object.assign(Object.assign({date:i.toDate(t),view:e.viewApi},s),{isMonthStart:r,dayNumberText:o}),e.extraRenderProps)}class Cr extends(270==i.j?_t:null){render(){let{props:e}=this,{seg:t}=e;return(0,n.n)(xr,{elTag:"div",elClasses:["fc-bg-event"],elStyle:{backgroundColor:t.eventRange.ui.backgroundColor},defaultGenerator:Dr,seg:t,timeText:"",isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,disableDragging:!0,disableResizing:!0})}}function Dr(e){let{title:t}=e.event;return t&&(0,n.n)("div",{className:"fc-event-title"},e.event.title)}function Lr(e){return(0,n.n)("div",{className:`fc-${e}`})}const Er=e=>(0,n.n)(pt.Consumer,null,t=>{let{dateEnv:i,options:r}=t,{date:s}=e,o=r.weekNumberFormat||e.defaultFormat,a={num:i.computeWeekNumber(s),text:i.format(s,o),date:s};return(0,n.n)(Tt,{elRef:e.elRef,elTag:e.elTag,elAttrs:e.elAttrs,elClasses:e.elClasses,elStyle:e.elStyle,renderProps:a,generatorName:"weekNumberContent",customGenerator:r.weekNumberContent,defaultGenerator:Ir,classNameGenerator:r.weekNumberClassNames,didMount:r.weekNumberDidMount,willUnmount:r.weekNumberWillUnmount},e.children)});function Ir(e){return e.text}class Pr extends _t{constructor(){super(...arguments),this.state={titleId:b()},this.handleRootEl=e=>{this.rootEl=e,this.props.elRef&&yt(this.props.elRef,e)},this.handleDocumentMouseDown=e=>{const t=v(e);this.rootEl.contains(t)||this.handleCloseClick()},this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.handleCloseClick()},this.handleCloseClick=()=>{let{onClose:e}=this.props;e&&e()}}render(){let{theme:e,options:t}=this.context,{props:i,state:s}=this,o=["fc-popover",e.getClass("popover")].concat(i.extraClassNames||[]);return(0,r.d5)((0,n.n)("div",Object.assign({},i.extraAttrs,{id:i.id,className:o.join(" "),"aria-labelledby":s.titleId,ref:this.handleRootEl}),(0,n.n)("div",{className:"fc-popover-header "+e.getClass("popoverHeader")},(0,n.n)("span",{className:"fc-popover-title",id:s.titleId},i.title),(0,n.n)("span",{className:"fc-popover-close "+e.getIconClass("close"),title:t.closeHint,onClick:this.handleCloseClick})),(0,n.n)("div",{className:"fc-popover-body "+e.getClass("popoverContent")},i.children)),i.parentEl)}componentDidMount(){document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown),this.updateSize()}componentWillUnmount(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown)}updateSize(){let{isRtl:e}=this.context,{alignmentEl:t,alignGridTop:i}=this.props,{rootEl:n}=this,r=function(e){let t=Mn(e),i=e.getBoundingClientRect();for(let e of t){let t=cn(i,e.getBoundingClientRect());if(!t)return null;i=t}return i}(t);if(r){let s=n.getBoundingClientRect(),o=i?p(t,".fc-scrollgrid").getBoundingClientRect().top:r.top,a=e?r.right-s.width:r.left;o=Math.max(o,10),a=Math.min(a,document.documentElement.clientWidth-10-s.width),a=Math.max(a,10);let l=n.offsetParent.getBoundingClientRect();_(n,{top:o-l.top,left:a-l.left})}}}class Rr extends In{constructor(){super(...arguments),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,useEventCenter:!1}):this.context.unregisterInteractiveComponent(this)}}render(){let{options:e,dateEnv:t}=this.context,{props:i}=this,{startDate:r,todayRange:s,dateProfile:o}=i,a=t.format(r,e.dayPopoverFormat);return(0,n.n)(kr,{elRef:this.handleRootEl,date:r,dateProfile:o,todayRange:s},(t,r,s)=>(0,n.n)(Pr,{elRef:s.ref,id:i.id,title:a,extraClassNames:["fc-more-popover"].concat(s.className||[]),extraAttrs:s,parentEl:i.parentEl,alignmentEl:i.alignmentEl,alignGridTop:i.alignGridTop,onClose:i.onClose},Mr(e)&&(0,n.n)(t,{elTag:"div",elClasses:["fc-more-popover-misc"]}),i.children))}queryHit(e,t,i,n){let{rootEl:r,props:s}=this;return e>=0&&e<i&&t>=0&&t<n?{dateProfile:s.dateProfile,dateSpan:Object.assign({allDay:!s.forceTimed,range:{start:s.startDate,end:s.endDate}},s.extraDateSpan),dayEl:r,rect:{left:0,top:0,right:i,bottom:n},layer:1}:null}}class Or extends _t{constructor(){super(...arguments),this.state={isPopoverOpen:!1,popoverId:b()},this.handleLinkEl=e=>{this.linkEl=e,this.props.elRef&&yt(this.props.elRef,e)},this.handleClick=e=>{let{props:t,context:i}=this,{moreLinkClick:n}=i.options,r=Fr(t).start;function s(e){let{def:t,instance:n,range:r}=e.eventRange;return{event:new ki(i,t,n),start:i.dateEnv.toDate(r.start),end:i.dateEnv.toDate(r.end),isStart:e.isStart,isEnd:e.isEnd}}"function"==typeof n&&(n=n({date:r,allDay:Boolean(t.allDayDate),allSegs:t.allSegs.map(s),hiddenSegs:t.hiddenSegs.map(s),jsEvent:e,view:i.viewApi})),n&&"popover"!==n?"string"==typeof n&&i.calendarApi.zoomTo(r,n):this.setState({isPopoverOpen:!0})},this.handlePopoverClose=()=>{this.setState({isPopoverOpen:!1})}}render(){let{props:e,state:t}=this;return(0,n.n)(pt.Consumer,null,i=>{let{viewApi:r,options:s,calendarApi:o}=i,{moreLinkText:a}=s,{moreCnt:l}=e,c=Fr(e),h="function"==typeof a?a.call(o,l):`+${l} ${a}`,d=Y(s.moreLinkHint,[l],h),u={num:l,shortText:`+${l}`,text:h,view:r};return(0,n.n)(n.FK,null,Boolean(e.moreCnt)&&(0,n.n)(Tt,{elTag:e.elTag||"a",elRef:this.handleLinkEl,elClasses:[...e.elClasses||[],"fc-more-link"],elStyle:e.elStyle,elAttrs:Object.assign(Object.assign(Object.assign({},e.elAttrs),A(this.handleClick)),{title:d,"aria-expanded":t.isPopoverOpen,"aria-controls":t.isPopoverOpen?t.popoverId:""}),renderProps:u,generatorName:"moreLinkContent",customGenerator:s.moreLinkContent,defaultGenerator:e.defaultGenerator||zr,classNameGenerator:s.moreLinkClassNames,didMount:s.moreLinkDidMount,willUnmount:s.moreLinkWillUnmount},e.children),t.isPopoverOpen&&(0,n.n)(Rr,{id:t.popoverId,startDate:c.start,endDate:c.end,dateProfile:e.dateProfile,todayRange:e.todayRange,extraDateSpan:e.extraDateSpan,parentEl:this.parentEl,alignmentEl:e.alignmentElRef?e.alignmentElRef.current:this.linkEl,alignGridTop:e.alignGridTop,forceTimed:e.forceTimed,onClose:this.handlePopoverClose},e.popoverContent()))})}componentDidMount(){this.updateParentEl()}componentDidUpdate(){this.updateParentEl()}updateParentEl(){this.linkEl&&(this.parentEl=p(this.linkEl,".fc-view-harness"))}}function zr(e){return e.text}function Fr(e){if(e.allDayDate)return{start:e.allDayDate,end:ne(e.allDayDate,1)};let{hiddenSegs:t}=e;return{start:Nr(t),end:(i=t,i.reduce(Br).eventRange.range.end)};var i}function Nr(e){return e.reduce(Yr).eventRange.range.start}function Yr(e,t){return e.eventRange.range.start<t.eventRange.range.start?e:t}function Br(e,t){return e.eventRange.range.end>t.eventRange.range.end?e:t}},9205:(e,t,i)=>{"use strict";function n(e){return getComputedStyle(e)}function r(e,t){for(var i in t){var n=t[i];"number"==typeof n&&(n+="px"),e.style[i]=n}return e}function s(e){var t=document.createElement("div");return t.className=e,t}i.d(t,{A:()=>P});var o="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function a(e,t){if(!o)throw new Error("No element matching method supported");return o.call(e,t)}function l(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function c(e,t){return Array.prototype.filter.call(e.children,function(e){return a(e,t)})}var h=function(e){return"ps__thumb-"+e},d=function(e){return"ps__rail-"+e},u="ps__child--consume",f="ps--focus",p="ps--clicking",m=function(e){return"ps--active-"+e},g=function(e){return"ps--scrolling-"+e},_={x:null,y:null};function y(e,t){var i=e.element.classList,n=g(t);i.contains(n)?clearTimeout(_[t]):i.add(n)}function v(e,t){_[t]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(g(t))},e.settings.scrollingThreshold)}var x=function(e){this.element=e,this.handlers={}},b={isEmpty:{configurable:!0}};x.prototype.bind=function(e,t){void 0===this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)},x.prototype.unbind=function(e,t){var i=this;this.handlers[e]=this.handlers[e].filter(function(n){return!(!t||n===t)||(i.element.removeEventListener(e,n,!1),!1)})},x.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)},b.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(t){return 0===e.handlers[t].length})},Object.defineProperties(x.prototype,b);var w=function(){this.eventElements=[]};function S(e){if("function"==typeof window.CustomEvent)return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function T(e,t,i,n,r){var s;if(void 0===n&&(n=!0),void 0===r&&(r=!1),"top"===t)s=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==t)throw new Error("A proper axis should be provided");s=["contentWidth","containerWidth","scrollLeft","x","left","right"]}!function(e,t,i,n,r){var s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],h=i[5];void 0===n&&(n=!0),void 0===r&&(r=!1);var d=e.element;e.reach[l]=null,d[a]<1&&(e.reach[l]="start"),d[a]>e[s]-e[o]-1&&(e.reach[l]="end"),t&&(d.dispatchEvent(S("ps-scroll-"+l)),t<0?d.dispatchEvent(S("ps-scroll-"+c)):t>0&&d.dispatchEvent(S("ps-scroll-"+h)),n&&function(e,t){y(e,t),v(e,t)}(e,l)),e.reach[l]&&(t||r)&&d.dispatchEvent(S("ps-"+l+"-reach-"+e.reach[l]))}(e,i,s,n,r)}function k(e){return parseInt(e,10)||0}w.prototype.eventElement=function(e){var t=this.eventElements.filter(function(t){return t.element===e})[0];return t||(t=new x(e),this.eventElements.push(t)),t},w.prototype.bind=function(e,t,i){this.eventElement(e).bind(t,i)},w.prototype.unbind=function(e,t,i){var n=this.eventElement(e);n.unbind(t,i),n.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(n),1)},w.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]},w.prototype.once=function(e,t,i){var n=this.eventElement(e),r=function(e){n.unbind(t,r),i(e)};n.bind(t,r)};var M={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)};function A(e){var t=e.element,i=Math.floor(t.scrollTop),n=t.getBoundingClientRect();e.containerWidth=Math.floor(n.width),e.containerHeight=Math.floor(n.height),e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(c(t,d("x")).forEach(function(e){return l(e)}),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(c(t,d("y")).forEach(function(e){return l(e)}),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset<e.contentWidth?(e.scrollbarXActive=!0,e.railXWidth=e.containerWidth-e.railXMarginWidth,e.railXRatio=e.containerWidth/e.railXWidth,e.scrollbarXWidth=C(e,k(e.railXWidth*e.containerWidth/e.contentWidth)),e.scrollbarXLeft=k((e.negativeScrollAdjustment+t.scrollLeft)*(e.railXWidth-e.scrollbarXWidth)/(e.contentWidth-e.containerWidth))):e.scrollbarXActive=!1,!e.settings.suppressScrollY&&e.containerHeight+e.settings.scrollYMarginOffset<e.contentHeight?(e.scrollbarYActive=!0,e.railYHeight=e.containerHeight-e.railYMarginHeight,e.railYRatio=e.containerHeight/e.railYHeight,e.scrollbarYHeight=C(e,k(e.railYHeight*e.containerHeight/e.contentHeight)),e.scrollbarYTop=k(i*(e.railYHeight-e.scrollbarYHeight)/(e.contentHeight-e.containerHeight))):e.scrollbarYActive=!1,e.scrollbarXLeft>=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),function(e,t){var i={width:t.railXWidth},n=Math.floor(e.scrollTop);t.isRtl?i.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:i.left=e.scrollLeft,t.isScrollbarXUsingBottom?i.bottom=t.scrollbarXBottom-n:i.top=t.scrollbarXTop+n,r(t.scrollbarXRail,i);var s={top:n,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?s.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:s.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?s.left=t.negativeScrollAdjustment+e.scrollLeft+2*t.containerWidth-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:s.left=t.scrollbarYLeft+e.scrollLeft,r(t.scrollbarYRail,s),r(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),r(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}(t,e),e.scrollbarXActive?t.classList.add(m("x")):(t.classList.remove(m("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,t.scrollLeft=!0===e.isRtl?e.contentWidth:0),e.scrollbarYActive?t.classList.add(m("y")):(t.classList.remove(m("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,t.scrollTop=0)}function C(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}var D=null;function L(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],d=e.element,u=null,f=null,m=null;function g(t){t.touches&&t.touches[0]&&(t[r]=t.touches[0]["page"+c.toUpperCase()]),D===o&&(d[l]=u+m*(t[r]-f),y(e,c),A(e),t.stopPropagation(),t.preventDefault())}function _(){v(e,c),e[h].classList.remove(p),document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",g),document.removeEventListener("touchend",_),D=null}function x(t){null===D&&(D=o,u=d[l],t.touches&&(t[r]=t.touches[0]["page"+c.toUpperCase()]),f=t[r],m=(e[n]-e[i])/(e[s]-e[a]),t.touches?(document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("touchend",_)):(document.addEventListener("mousemove",g),document.addEventListener("mouseup",_)),e[h].classList.add(p)),t.stopPropagation(),t.cancelable&&t.preventDefault()}e[o].addEventListener("mousedown",x),e[o].addEventListener("touchstart",x)}var E={"click-rail":function(e){e.event.bind(e.scrollbarY,"mousedown",function(e){return e.stopPropagation()}),e.event.bind(e.scrollbarYRail,"mousedown",function(t){var i=t.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top>e.scrollbarYTop?1:-1;e.element.scrollTop+=i*e.containerHeight,A(e),t.stopPropagation()}),e.event.bind(e.scrollbarX,"mousedown",function(e){return e.stopPropagation()}),e.event.bind(e.scrollbarXRail,"mousedown",function(t){var i=t.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=i*e.containerWidth,A(e),t.stopPropagation()})},"drag-thumb":function(e){L(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"]),L(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"])},keyboard:function(e){var t=e.element;e.event.bind(e.ownerDocument,"keydown",function(i){if(!(i.isDefaultPrevented&&i.isDefaultPrevented()||i.defaultPrevented)&&(a(t,":hover")||a(e.scrollbarX,":focus")||a(e.scrollbarY,":focus"))){var n,r=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(r){if("IFRAME"===r.tagName)r=r.contentDocument.activeElement;else for(;r.shadowRoot;)r=r.shadowRoot.activeElement;if(a(n=r,"input,[contenteditable]")||a(n,"select,[contenteditable]")||a(n,"textarea,[contenteditable]")||a(n,"button,[contenteditable]"))return}var s=0,o=0;switch(i.which){case 37:s=i.metaKey?-e.contentWidth:i.altKey?-e.containerWidth:-30;break;case 38:o=i.metaKey?e.contentHeight:i.altKey?e.containerHeight:30;break;case 39:s=i.metaKey?e.contentWidth:i.altKey?e.containerWidth:30;break;case 40:o=i.metaKey?-e.contentHeight:i.altKey?-e.containerHeight:-30;break;case 32:o=i.shiftKey?e.containerHeight:-e.containerHeight;break;case 33:o=e.containerHeight;break;case 34:o=-e.containerHeight;break;case 36:o=e.contentHeight;break;case 35:o=-e.contentHeight;break;default:return}e.settings.suppressScrollX&&0!==s||e.settings.suppressScrollY&&0!==o||(t.scrollTop-=o,t.scrollLeft+=s,A(e),function(i,n){var r=Math.floor(t.scrollTop);if(0===i){if(!e.scrollbarYActive)return!1;if(0===r&&n>0||r>=e.contentHeight-e.containerHeight&&n<0)return!e.settings.wheelPropagation}var s=t.scrollLeft;if(0===n){if(!e.scrollbarXActive)return!1;if(0===s&&i<0||s>=e.contentWidth-e.containerWidth&&i>0)return!e.settings.wheelPropagation}return!0}(s,o)&&i.preventDefault())}})},wheel:function(e){var t=e.element;function i(i){var r=function(e){var t=e.deltaX,i=-1*e.deltaY;return void 0!==t&&void 0!==i||(t=-1*e.wheelDeltaX/6,i=e.wheelDeltaY/6),e.deltaMode&&1===e.deltaMode&&(t*=10,i*=10),t!=t&&i!=i&&(t=0,i=e.wheelDelta),e.shiftKey?[-i,-t]:[t,i]}(i),s=r[0],o=r[1];if(!function(e,i,r){if(!M.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(e))return!1;for(var s=e;s&&s!==t;){if(s.classList.contains(u))return!0;var o=n(s);if(r&&o.overflowY.match(/(scroll|auto)/)){var a=s.scrollHeight-s.clientHeight;if(a>0&&(s.scrollTop>0&&r<0||s.scrollTop<a&&r>0))return!0}if(i&&o.overflowX.match(/(scroll|auto)/)){var l=s.scrollWidth-s.clientWidth;if(l>0&&(s.scrollLeft>0&&i<0||s.scrollLeft<l&&i>0))return!0}s=s.parentNode}return!1}(i.target,s,o)){var a=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(o?t.scrollTop-=o*e.settings.wheelSpeed:t.scrollTop+=s*e.settings.wheelSpeed,a=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(s?t.scrollLeft+=s*e.settings.wheelSpeed:t.scrollLeft-=o*e.settings.wheelSpeed,a=!0):(t.scrollTop-=o*e.settings.wheelSpeed,t.scrollLeft+=s*e.settings.wheelSpeed),A(e),a=a||function(i,n){var r=Math.floor(t.scrollTop),s=0===t.scrollTop,o=r+t.offsetHeight===t.scrollHeight,a=0===t.scrollLeft,l=t.scrollLeft+t.offsetWidth===t.scrollWidth;return!(Math.abs(n)>Math.abs(i)?s||o:a||l)||!e.settings.wheelPropagation}(s,o),a&&!i.ctrlKey&&(i.stopPropagation(),i.preventDefault())}}void 0!==window.onwheel?e.event.bind(t,"wheel",i):void 0!==window.onmousewheel&&e.event.bind(t,"mousewheel",i)},touch:function(e){if(M.supportsTouch||M.supportsIePointer){var t=e.element,i={startOffset:{},startTime:0,speed:{},easingLoop:null};M.supportsTouch?(e.event.bind(t,"touchstart",a),e.event.bind(t,"touchmove",l),e.event.bind(t,"touchend",c)):M.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",a),e.event.bind(t,"pointermove",l),e.event.bind(t,"pointerup",c)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",a),e.event.bind(t,"MSPointerMove",l),e.event.bind(t,"MSPointerUp",c)))}function r(i,n){t.scrollTop-=n,t.scrollLeft-=i,A(e)}function s(e){return e.targetTouches?e.targetTouches[0]:e}function o(t){return!(t.target===e.scrollbarX||t.target===e.scrollbarY||t.pointerType&&"pen"===t.pointerType&&0===t.buttons||(!t.targetTouches||1!==t.targetTouches.length)&&(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE))}function a(e){if(o(e)){var t=s(e);i.startOffset.pageX=t.pageX,i.startOffset.pageY=t.pageY,i.startTime=(new Date).getTime(),null!==i.easingLoop&&clearInterval(i.easingLoop)}}function l(a){if(o(a)){var l=s(a),c={pageX:l.pageX,pageY:l.pageY},h=c.pageX-i.startOffset.pageX,d=c.pageY-i.startOffset.pageY;if(function(e,i,r){if(!t.contains(e))return!1;for(var s=e;s&&s!==t;){if(s.classList.contains(u))return!0;var o=n(s);if(r&&o.overflowY.match(/(scroll|auto)/)){var a=s.scrollHeight-s.clientHeight;if(a>0&&(s.scrollTop>0&&r<0||s.scrollTop<a&&r>0))return!0}if(i&&o.overflowX.match(/(scroll|auto)/)){var l=s.scrollWidth-s.clientWidth;if(l>0&&(s.scrollLeft>0&&i<0||s.scrollLeft<l&&i>0))return!0}s=s.parentNode}return!1}(a.target,h,d))return;r(h,d),i.startOffset=c;var f=(new Date).getTime(),p=f-i.startTime;p>0&&(i.speed.x=h/p,i.speed.y=d/p,i.startTime=f),function(i,n){var r=Math.floor(t.scrollTop),s=t.scrollLeft,o=Math.abs(i),a=Math.abs(n);if(a>o){if(n<0&&r===e.contentHeight-e.containerHeight||n>0&&0===r)return 0===window.scrollY&&n>0&&M.isChrome}else if(o>a&&(i<0&&s===e.contentWidth-e.containerWidth||i>0&&0===s))return!0;return!0}(h,d)&&a.cancelable&&a.preventDefault()}}function c(){e.settings.swipeEasing&&(clearInterval(i.easingLoop),i.easingLoop=setInterval(function(){e.isInitialized?clearInterval(i.easingLoop):i.speed.x||i.speed.y?Math.abs(i.speed.x)<.01&&Math.abs(i.speed.y)<.01?clearInterval(i.easingLoop):(r(30*i.speed.x,30*i.speed.y),i.speed.x*=.8,i.speed.y*=.8):clearInterval(i.easingLoop)},10))}}},I=function(e,t){var i=this;if(void 0===t&&(t={}),"string"==typeof e&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var o in this.element=e,e.classList.add("ps"),this.settings={handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1},t)this.settings[o]=t[o];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var a,l,c=function(){return e.classList.add(f)},u=function(){return e.classList.remove(f)};this.isRtl="rtl"===n(e).direction,!0===this.isRtl&&e.classList.add("ps__rtl"),this.isNegativeScroll=(l=e.scrollLeft,e.scrollLeft=-1,a=e.scrollLeft<0,e.scrollLeft=l,a),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new w,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=s(d("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=s(h("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",c),this.event.bind(this.scrollbarX,"blur",u),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var p=n(this.scrollbarXRail);this.scrollbarXBottom=parseInt(p.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=k(p.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=k(p.borderLeftWidth)+k(p.borderRightWidth),r(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=k(p.marginLeft)+k(p.marginRight),r(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=s(d("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=s(h("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",c),this.event.bind(this.scrollbarY,"blur",u),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var m=n(this.scrollbarYRail);this.scrollbarYRight=parseInt(m.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=k(m.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?function(e){var t=n(e);return k(t.width)+k(t.paddingLeft)+k(t.paddingRight)+k(t.borderLeftWidth)+k(t.borderRightWidth)}(this.scrollbarY):null,this.railBorderYWidth=k(m.borderTopWidth)+k(m.borderBottomWidth),r(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=k(m.marginTop)+k(m.marginBottom),r(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(e){return E[e](i)}),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",function(e){return i.onScroll(e)}),A(this)};I.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,r(this.scrollbarXRail,{display:"block"}),r(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=k(n(this.scrollbarXRail).marginLeft)+k(n(this.scrollbarXRail).marginRight),this.railYMarginHeight=k(n(this.scrollbarYRail).marginTop)+k(n(this.scrollbarYRail).marginBottom),r(this.scrollbarXRail,{display:"none"}),r(this.scrollbarYRail,{display:"none"}),A(this),T(this,"top",0,!1,!0),T(this,"left",0,!1,!0),r(this.scrollbarXRail,{display:""}),r(this.scrollbarYRail,{display:""}))},I.prototype.onScroll=function(e){this.isAlive&&(A(this),T(this,"top",this.element.scrollTop-this.lastScrollTop),T(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},I.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),l(this.scrollbarX),l(this.scrollbarY),l(this.scrollbarXRail),l(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},I.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(e){return!e.match(/^ps([-_].+|)$/)}).join(" ")};const P=19==i.j?I:null},9231:function(e,t,i){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(i(5093))},9279:(e,t,i)=>{var n,r,s;r=[i(4692)],void 0===(s="function"==typeof(n=function(e){var t=function(){function t(){var t=this,i=function(i){return e.isNumeric(i)&&(i=Math.floor(i)),e('option[value="'+i+'"]',t.$elem)},n=function(e){var i=t.$elem.data("barrating");return void 0!==e?i[e]:i},r=function(e,i){null!==i&&"object"==typeof i?t.$elem.data("barrating",i):t.$elem.data("barrating")[e]=i},s=function(){var n,s=(n=t.options.initialRating)?i(n):e("option:selected",t.$elem),o=function(){var i=t.$elem.find('option[value="'+t.options.emptyValue+'"]');return!i.length&&t.options.allowEmpty?(i=e("<option />",{value:t.options.emptyValue})).prependTo(t.$elem):i}(),a=s.val(),l=s.data("html")?s.data("html"):s.text(),c=null!==t.options.allowEmpty?t.options.allowEmpty:!!o.length,h=o.length?o.val():null,d=o.length?o.text():null;r(null,{userOptions:t.options,ratingValue:a,ratingText:l,originalRatingValue:a,originalRatingText:l,allowEmpty:c,emptyRatingValue:h,emptyRatingText:d,readOnly:t.options.readonly,ratingMade:!1})},o=function(){return n("ratingText")},a=function(){return n("ratingValue")},l=function(){return n("userOptions").reverse?"nextAll":"prevAll"},c=function(e){i(e).prop("selected",!0),t.$elem.change()},h=function(e){(e=e||o())==n("emptyRatingText")&&(e=""),t.options.showSelectedRating&&t.$elem.parent().find(".br-current-rating").text(e)},d=function(){t.$widget.find("a").removeClass(function(e,t){return(t.match(/(^|\s)br-\S+/g)||[]).join(" ")})},u=function(){var i,r,s,o=t.$widget.find('a[data-rating-value="'+a()+'"]'),c=n("userOptions").initialRating,h=e.isNumeric(a())?a():0,u=(s=c,Math.round(Math.floor(10*s)/10%1*100));if(d(),o.addClass("br-selected br-current")[l()]().addClass("br-selected"),!n("ratingMade")&&e.isNumeric(c)){if(c<=h||!u)return;i=t.$widget.find("a"),(r=o.length?o[n("userOptions").reverse?"prev":"next"]():i[n("userOptions").reverse?"last":"first"]()).addClass("br-fractional"),r.addClass("br-fractional-"+u)}},f=function(i){i.on("click.barrating",function(i){var s,l,d,f=e(this),p=n("userOptions");return i.preventDefault(),s=f.attr("data-rating-value"),l=f.attr("data-rating-text"),d=f,!(!n("allowEmpty")||!n("userOptions").deselectable)&&a()==d.attr("data-rating-value")&&(s=n("emptyRatingValue"),l=n("emptyRatingText")),r("ratingValue",s),r("ratingText",l),r("ratingMade",!0),c(s),h(l),u(),p.onSelect.call(t,a(),o(),i),!1})},p=function(t){t.on("touchstart.barrating",function(t){t.preventDefault(),t.stopPropagation(),e(this).click()})},m=function(i){f(i),t.options.hoverState&&(function(t){t.on("mouseenter.barrating",function(){var t=e(this);d(),t.addClass("br-active")[l()]().addClass("br-active"),h(t.attr("data-rating-text"))})}(i),t.$widget.on("mouseleave.barrating blur.barrating",function(){h(),u()}))},g=function(e){e.off(".barrating")},_=function(e){var i=t.$widget.find("a");p&&p(i),e?(g(i),function(e){e.on("click.barrating",function(e){e.preventDefault()})}(i)):m(i)};this.show=function(){var i,r;n()||(r=["br-wrapper"],""!==t.options.theme&&r.push("br-theme-"+t.options.theme),t.$elem.wrap(e("<div />",{class:r.join(" ")})),s(),t.$widget=(i=e("<div />",{class:"br-widget"}),t.$elem.find("option").each(function(){var r,s,o,a;(r=e(this).val())!==n("emptyRatingValue")&&(s=e(this).text(),(o=e(this).data("html"))&&(s=o),a=e("<a />",{href:"#","data-rating-value":r,"data-rating-text":s,html:t.options.showValues?s:""}),i.append(a))}),t.options.showSelectedRating&&i.append(e("<div />",{text:"",class:"br-current-rating"})),t.options.reverse&&i.addClass("br-reverse"),t.options.readonly&&i.addClass("br-readonly"),i),t.$widget.insertAfter(t.$elem),u(),h(),_(t.options.readonly),t.$elem.hide())},this.readonly=function(e){"boolean"==typeof e&&n("readOnly")!=e&&(_(e),r("readOnly",e),t.$widget.toggleClass("br-readonly"))},this.set=function(e){var i=n("userOptions");0!==t.$elem.find('option[value="'+e+'"]').length&&(r("ratingValue",e),r("ratingText",t.$elem.find('option[value="'+e+'"]').text()),r("ratingMade",!0),c(a()),h(o()),u(),i.silent||i.onSelect.call(this,a(),o()))},this.clear=function(){var i=n("userOptions");r("ratingValue",n("originalRatingValue")),r("ratingText",n("originalRatingText")),r("ratingMade",!1),e("option",t.$elem).prop("selected",function(){return this.defaultSelected}),t.$elem.change(),h(o()),u(),i.onClear.call(this,a(),o())},this.destroy=function(){var e=a(),i=o(),r=n("userOptions");g(t.$widget.find("a")),t.$widget.remove(),t.$elem.removeData("barrating"),t.$elem.unwrap(),t.$elem.show(),r.onDestroy.call(this,e,i)}}return t.prototype.init=function(t,i){return this.$elem=e(i),this.options=e.extend({},e.fn.barrating.defaults,t),this.options},t}();e.fn.barrating=function(i,n){return this.each(function(){var r=new t;if(e(this).is("select")||e.error("Sorry, this plugin only works with select fields."),r.hasOwnProperty(i)){if(r.init(n,this),"show"===i)return r.show(n);if(r.$elem.data("barrating"))return r.$widget=e(this).next(".br-widget"),r[i](n)}else{if("object"==typeof i||!i)return n=i,r.init(n,this),r.show();e.error("Method "+i+" does not exist on jQuery.barrating")}})},e.fn.barrating.defaults={theme:"",initialRating:null,allowEmpty:null,emptyValue:"",showValues:!1,showSelectedRating:!0,deselectable:!0,reverse:!1,readonly:!1,fastClicks:!0,hoverState:!0,silent:!1,onSelect:function(e,t,i){},onClear:function(e,t){},onDestroy:function(e,t){}},e.fn.barrating.BarRating=t})?n.apply(t,r):n)||(e.exports=s)},9330:function(e,t,i){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var i=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(i="a"),e+i},week:{dow:1,doy:4}})}(i(5093))},9364:(e,t,i)=>{"use strict";function n(e){return e+.5|0}i.d(t,{Ay:()=>ho});const r=(e,t,i)=>Math.max(Math.min(e,i),t);function s(e){return r(n(2.55*e),0,255)}function o(e){return r(n(255*e),0,255)}function a(e){return r(n(e/2.55)/100,0,1)}function l(e){return r(n(100*e),0,100)}const c={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},h=[..."0123456789ABCDEF"],d=e=>h[15&e],u=e=>h[(240&e)>>4]+h[15&e],f=e=>(240&e)>>4==(15&e);const p=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function m(e,t,i){const n=t*Math.min(i,1-i),r=(t,r=(t+e/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function g(e,t,i){const n=(n,r=(n+e/60)%6)=>i-i*t*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function _(e,t,i){const n=m(e,1,.5);let r;for(t+i>1&&(r=1/(t+i),t*=r,i*=r),r=0;r<3;r++)n[r]*=1-t-i,n[r]+=t;return n}function y(e){const t=e.r/255,i=e.g/255,n=e.b/255,r=Math.max(t,i,n),s=Math.min(t,i,n),o=(r+s)/2;let a,l,c;return r!==s&&(c=r-s,l=o>.5?c/(2-r-s):c/(r+s),a=function(e,t,i,n,r){return e===r?(t-i)/n+(t<i?6:0):t===r?(i-e)/n+2:(e-t)/n+4}(t,i,n,c,r),a=60*a+.5),[0|a,l||0,o]}function v(e,t,i,n){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,i,n)).map(o)}function x(e,t,i){return v(m,e,t,i)}function b(e){return(e%360+360)%360}const w={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},S={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let T;const k=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,M=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,A=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function C(e,t,i){if(e){let n=y(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*i,0===t?360:1)),n=x(n),e.r=n[0],e.g=n[1],e.b=n[2]}}function D(e,t){return e?Object.assign(t||{},e):e}function L(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=o(e[3]))):(t=D(e,{r:0,g:0,b:0,a:1})).a=o(t.a),t}function E(e){return"r"===e.charAt(0)?function(e){const t=k.exec(e);let i,n,o,a=255;if(t){if(t[7]!==i){const e=+t[7];a=t[8]?s(e):r(255*e,0,255)}return i=+t[1],n=+t[3],o=+t[5],i=255&(t[2]?s(i):r(i,0,255)),n=255&(t[4]?s(n):r(n,0,255)),o=255&(t[6]?s(o):r(o,0,255)),{r:i,g:n,b:o,a}}}(e):function(e){const t=p.exec(e);let i,n=255;if(!t)return;t[5]!==i&&(n=t[6]?s(+t[5]):o(+t[5]));const r=b(+t[2]),a=+t[3]/100,l=+t[4]/100;return i="hwb"===t[1]?function(e,t,i){return v(_,e,t,i)}(r,a,l):"hsv"===t[1]?function(e,t,i){return v(g,e,t,i)}(r,a,l):x(r,a,l),{r:i[0],g:i[1],b:i[2],a:n}}(e)}class I{constructor(e){if(e instanceof I)return e;const t=typeof e;let i;var n,r,s;"object"===t?i=L(e):"string"===t&&(s=(n=e).length,"#"===n[0]&&(4===s||5===s?r={r:255&17*c[n[1]],g:255&17*c[n[2]],b:255&17*c[n[3]],a:5===s?17*c[n[4]]:255}:7!==s&&9!==s||(r={r:c[n[1]]<<4|c[n[2]],g:c[n[3]]<<4|c[n[4]],b:c[n[5]]<<4|c[n[6]],a:9===s?c[n[7]]<<4|c[n[8]]:255})),i=r||function(e){T||(T=function(){const e={},t=Object.keys(S),i=Object.keys(w);let n,r,s,o,a;for(n=0;n<t.length;n++){for(o=a=t[n],r=0;r<i.length;r++)s=i[r],a=a.replace(s,w[s]);s=parseInt(S[o],16),e[a]=[s>>16&255,s>>8&255,255&s]}return e}(),T.transparent=[0,0,0,0]);const t=T[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}(e)||E(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=D(this._rgb);return e&&(e.a=a(e.a)),e}set rgb(e){this._rgb=L(e)}rgbString(){return this._valid?(e=this._rgb)&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${a(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`):void 0;var e}hexString(){return this._valid?(e=this._rgb,t=(e=>f(e.r)&&f(e.g)&&f(e.b)&&f(e.a))(e)?d:u,e?"#"+t(e.r)+t(e.g)+t(e.b)+((e,t)=>e<255?t(e):"")(e.a,t):void 0):void 0;var e,t}hslString(){return this._valid?function(e){if(!e)return;const t=y(e),i=t[0],n=l(t[1]),r=l(t[2]);return e.a<255?`hsla(${i}, ${n}%, ${r}%, ${a(e.a)})`:`hsl(${i}, ${n}%, ${r}%)`}(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,n=e.rgb;let r;const s=t===r?.5:t,o=2*s-1,a=i.a-n.a,l=((o*a===-1?o:(o+a)/(1+o*a))+1)/2;r=1-l,i.r=255&l*i.r+r*n.r+.5,i.g=255&l*i.g+r*n.g+.5,i.b=255&l*i.b+r*n.b+.5,i.a=s*i.a+(1-s)*n.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=function(e,t,i){const n=A(a(e.r)),r=A(a(e.g)),s=A(a(e.b));return{r:o(M(n+i*(A(a(t.r))-n))),g:o(M(r+i*(A(a(t.g))-r))),b:o(M(s+i*(A(a(t.b))-s))),a:e.a+i*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}clone(){return new I(this.rgb)}alpha(e){return this._rgb.a=o(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const e=this._rgb,t=n(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return C(this._rgb,2,e),this}darken(e){return C(this._rgb,2,-e),this}saturate(e){return C(this._rgb,1,e),this}desaturate(e){return C(this._rgb,1,-e),this}rotate(e){return function(e,t){var i=y(e);i[0]=b(i[0]+t),i=x(i),e.r=i[0],e.g=i[1],e.b=i[2]}(this._rgb,e),this}}function P(){}const R=(()=>{let e=0;return()=>e++})();function O(e){return null==e}function z(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return"[object"===t.slice(0,7)&&"Array]"===t.slice(-6)}function F(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function N(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)}function Y(e,t){return N(e)?e:t}function B(e,t){return void 0===e?t:e}const H=(e,t)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e;function j(e,t,i){if(e&&"function"==typeof e.call)return e.apply(i,t)}function V(e,t,i,n){let r,s,o;if(z(e))if(s=e.length,n)for(r=s-1;r>=0;r--)t.call(i,e[r],r);else for(r=0;r<s;r++)t.call(i,e[r],r);else if(F(e))for(o=Object.keys(e),s=o.length,r=0;r<s;r++)t.call(i,e[o[r]],o[r])}function W(e,t){let i,n,r,s;if(!e||!t||e.length!==t.length)return!1;for(i=0,n=e.length;i<n;++i)if(r=e[i],s=t[i],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function U(e){if(z(e))return e.map(U);if(F(e)){const t=Object.create(null),i=Object.keys(e),n=i.length;let r=0;for(;r<n;++r)t[i[r]]=U(e[i[r]]);return t}return e}function $(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function G(e,t,i,n){if(!$(e))return;const r=t[e],s=i[e];F(r)&&F(s)?X(r,s,n):t[e]=U(s)}function X(e,t,i){const n=z(t)?t:[t],r=n.length;if(!F(e))return e;const s=(i=i||{}).merger||G;let o;for(let t=0;t<r;++t){if(o=n[t],!F(o))continue;const r=Object.keys(o);for(let t=0,n=r.length;t<n;++t)s(r[t],e,o,i)}return e}function q(e,t){return X(e,t,{merger:Z})}function Z(e,t,i){if(!$(e))return;const n=t[e],r=i[e];F(n)&&F(r)?q(n,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=U(r))}const J={"":e=>e,x:e=>e.x,y:e=>e.y};function K(e,t){const i=J[t]||(J[t]=function(e){const t=function(e){const t=e.split("."),i=[];let n="";for(const e of t)n+=e,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(e);return e=>{for(const i of t){if(""===i)break;e=e&&e[i]}return e}}(t));return i(e)}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ee=e=>void 0!==e,te=e=>"function"==typeof e,ie=(e,t)=>{if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0},ne=Math.PI,re=2*ne,se=re+ne,oe=Number.POSITIVE_INFINITY,ae=ne/180,le=ne/2,ce=ne/4,he=2*ne/3,de=Math.log10,ue=Math.sign;function fe(e,t,i){return Math.abs(e-t)<i}function pe(e){const t=Math.round(e);e=fe(e,t,e/1e3)?t:e;const i=Math.pow(10,Math.floor(de(e))),n=e/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function me(e){return!function(e){return"symbol"==typeof e||"object"==typeof e&&null!==e&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function ge(e,t,i){let n,r,s;for(n=0,r=e.length;n<r;n++)s=e[n][i],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function _e(e){return e*(ne/180)}function ye(e){return e*(180/ne)}function ve(e){if(!N(e))return;let t=1,i=0;for(;Math.round(e*t)/t!==e;)t*=10,i++;return i}function xe(e,t){const i=t.x-e.x,n=t.y-e.y,r=Math.sqrt(i*i+n*n);let s=Math.atan2(n,i);return s<-.5*ne&&(s+=re),{angle:s,distance:r}}function be(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function we(e,t){return(e-t+se)%re-ne}function Se(e){return(e%re+re)%re}function Te(e,t,i,n){const r=Se(e),s=Se(t),o=Se(i),a=Se(s-r),l=Se(o-r),c=Se(r-s),h=Se(r-o);return r===s||r===o||n&&s===o||a>l&&c<h}function ke(e,t,i){return Math.max(t,Math.min(i,e))}function Me(e,t,i,n=1e-6){return e>=Math.min(t,i)-n&&e<=Math.max(t,i)+n}function Ae(e,t,i){i=i||(i=>e[i]<t);let n,r=e.length-1,s=0;for(;r-s>1;)n=s+r>>1,i(n)?s=n:r=n;return{lo:s,hi:r}}const Ce=(e,t,i,n)=>Ae(e,i,n?n=>{const r=e[n][t];return r<i||r===i&&e[n+1][t]===i}:n=>e[n][t]<i),De=(e,t,i)=>Ae(e,i,n=>e[n][t]>=i),Le=["push","pop","shift","splice","unshift"];function Ee(e,t){const i=e._chartjs;if(!i)return;const n=i.listeners,r=n.indexOf(t);-1!==r&&n.splice(r,1),n.length>0||(Le.forEach(t=>{delete e[t]}),delete e._chartjs)}function Ie(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Pe="undefined"==typeof window?function(e){return e()}:window.requestAnimationFrame;function Re(e,t){let i=[],n=!1;return function(...r){i=r,n||(n=!0,Pe.call(window,()=>{n=!1,e.apply(t,i)}))}}const Oe=e=>"start"===e?"left":"end"===e?"right":"center",ze=(e,t,i)=>"start"===e?t:"end"===e?i:(t+i)/2;function Fe(e,t,i){const n=t.length;let r=0,s=n;if(e._sorted){const{iScale:o,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,h=o.axis,{min:d,max:u,minDefined:f,maxDefined:p}=o.getUserBounds();if(f){if(r=Math.min(Ce(l,h,d).lo,i?n:Ce(t,h,o.getPixelForValue(d)).lo),c){const e=l.slice(0,r+1).reverse().findIndex(e=>!O(e[a.axis]));r-=Math.max(0,e)}r=ke(r,0,n-1)}if(p){let e=Math.max(Ce(l,o.axis,u,!0).hi+1,i?0:Ce(t,h,o.getPixelForValue(u),!0).hi+1);if(c){const t=l.slice(e-1).findIndex(e=>!O(e[a.axis]));e+=Math.max(0,t)}s=ke(e,r,n)-r}else s=n-r}return{start:r,count:s}}function Ne(e){const{xScale:t,yScale:i,_scaleRanges:n}=e,r={xmin:t.min,xmax:t.max,ymin:i.min,ymax:i.max};if(!n)return e._scaleRanges=r,!0;const s=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,r),s}const Ye=e=>0===e||1===e,Be=(e,t,i)=>-Math.pow(2,10*(e-=1))*Math.sin((e-t)*re/i),He=(e,t,i)=>Math.pow(2,-10*e)*Math.sin((e-t)*re/i)+1,je={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>1-Math.cos(e*le),easeOutSine:e=>Math.sin(e*le),easeInOutSine:e=>-.5*(Math.cos(ne*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>Ye(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1))),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Ye(e)?e:Be(e,.075,.3),easeOutElastic:e=>Ye(e)?e:He(e,.075,.3),easeInOutElastic(e){const t=.1125;return Ye(e)?e:e<.5?.5*Be(2*e,t,.45):.5+.5*He(2*e-1,t,.45)},easeInBack(e){const t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){const t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:e=>1-je.easeOutBounce(1-e),easeOutBounce(e){const t=7.5625,i=2.75;return e<1/i?t*e*e:e<2/i?t*(e-=1.5/i)*e+.75:e<2.5/i?t*(e-=2.25/i)*e+.9375:t*(e-=2.625/i)*e+.984375},easeInOutBounce:e=>e<.5?.5*je.easeInBounce(2*e):.5*je.easeOutBounce(2*e-1)+.5};function Ve(e){if(e&&"object"==typeof e){const t=e.toString();return"[object CanvasPattern]"===t||"[object CanvasGradient]"===t}return!1}function We(e){return Ve(e)?e:new I(e)}function Ue(e){return Ve(e)?e:new I(e).saturate(.5).darken(.1).hexString()}const $e=["x","y","borderWidth","radius","tension"],Ge=["color","borderColor","backgroundColor"],Xe=new Map;function qe(e,t,i){return function(e,t){t=t||{};const i=e+JSON.stringify(t);let n=Xe.get(i);return n||(n=new Intl.NumberFormat(e,t),Xe.set(i,n)),n}(t,i).format(e)}const Ze={values:e=>z(e)?e:""+e,numeric(e,t,i){if(0===e)return"0";const n=this.chart.options.locale;let r,s=e;if(i.length>1){const t=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(t<1e-4||t>1e15)&&(r="scientific"),s=function(e,t){let i=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(i)>=1&&e!==Math.floor(e)&&(i=e-Math.floor(e)),i}(e,i)}const o=de(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),qe(e,n,l)},logarithmic(e,t,i){if(0===e)return"0";const n=i[t].significand||e/Math.pow(10,Math.floor(de(e)));return[1,2,3,5,10,15].includes(n)||t>.8*i.length?Ze.numeric.call(this,e,t,i):""}};var Je={formatters:Ze};const Ke=Object.create(null),Qe=Object.create(null);function et(e,t){if(!t)return e;const i=t.split(".");for(let t=0,n=i.length;t<n;++t){const n=i[t];e=e[n]||(e[n]=Object.create(null))}return e}function tt(e,t,i){return"string"==typeof t?X(et(e,t),i):X(et(e,""),t)}class it{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>Ue(t.backgroundColor),this.hoverBorderColor=(e,t)=>Ue(t.borderColor),this.hoverColor=(e,t)=>Ue(t.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return tt(this,e,t)}get(e){return et(this,e)}describe(e,t){return tt(Qe,e,t)}override(e,t){return tt(Ke,e,t)}route(e,t,i,n){const r=et(this,e),s=et(this,i),o="_"+t;Object.defineProperties(r,{[o]:{value:r[t],writable:!0},[t]:{enumerable:!0,get(){const e=this[o],t=s[n];return F(e)?Object.assign({},t,e):B(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}var nt=new it({_scriptable:e=>!e.startsWith("on"),_indexable:e=>"events"!==e,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}),e.set("animations",{colors:{type:"color",properties:Ge},numbers:{type:"number",properties:$e}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>0|e}}}})},function(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Je.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e,_indexable:e=>"borderDash"!==e&&"tickBorderDash"!==e&&"dash"!==e}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:e=>"backdropPadding"!==e&&"callback"!==e,_indexable:e=>"backdropPadding"!==e})}]);function rt(e,t,i,n,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,i.push(r)),s>n&&(n=s),n}function st(e,t,i,n){let r=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(r=n.data={},s=n.garbageCollect=[],n.font=t),e.save(),e.font=t;let o=0;const a=i.length;let l,c,h,d,u;for(l=0;l<a;l++)if(d=i[l],null==d||z(d)){if(z(d))for(c=0,h=d.length;c<h;c++)u=d[c],null==u||z(u)||(o=rt(e,r,s,o,u))}else o=rt(e,r,s,o,d);e.restore();const f=s.length/2;if(f>i.length){for(l=0;l<f;l++)delete r[s[l]];s.splice(0,f)}return o}function ot(e,t,i){const n=e.currentDevicePixelRatio,r=0!==i?Math.max(i/2,.5):0;return Math.round((t-r)*n)/n+r}function at(e,t){(t||e)&&((t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function lt(e,t,i,n){ct(e,t,i,n,null)}function ct(e,t,i,n,r){let s,o,a,l,c,h,d,u;const f=t.pointStyle,p=t.rotation,m=t.radius;let g=(p||0)*ae;if(f&&"object"==typeof f&&(s=f.toString(),"[object HTMLImageElement]"===s||"[object HTMLCanvasElement]"===s))return e.save(),e.translate(i,n),e.rotate(g),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void e.restore();if(!(isNaN(m)||m<=0)){switch(e.beginPath(),f){default:r?e.ellipse(i,n,r/2,m,0,0,re):e.arc(i,n,m,0,re),e.closePath();break;case"triangle":h=r?r/2:m,e.moveTo(i+Math.sin(g)*h,n-Math.cos(g)*m),g+=he,e.lineTo(i+Math.sin(g)*h,n-Math.cos(g)*m),g+=he,e.lineTo(i+Math.sin(g)*h,n-Math.cos(g)*m),e.closePath();break;case"rectRounded":c=.516*m,l=m-c,o=Math.cos(g+ce)*l,d=Math.cos(g+ce)*(r?r/2-c:l),a=Math.sin(g+ce)*l,u=Math.sin(g+ce)*(r?r/2-c:l),e.arc(i-d,n-a,c,g-ne,g-le),e.arc(i+u,n-o,c,g-le,g),e.arc(i+d,n+a,c,g,g+le),e.arc(i-u,n+o,c,g+le,g+ne),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,h=r?r/2:l,e.rect(i-h,n-l,2*h,2*l);break}g+=ce;case"rectRot":d=Math.cos(g)*(r?r/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,u=Math.sin(g)*(r?r/2:m),e.moveTo(i-d,n-a),e.lineTo(i+u,n-o),e.lineTo(i+d,n+a),e.lineTo(i-u,n+o),e.closePath();break;case"crossRot":g+=ce;case"cross":d=Math.cos(g)*(r?r/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,u=Math.sin(g)*(r?r/2:m),e.moveTo(i-d,n-a),e.lineTo(i+d,n+a),e.moveTo(i+u,n-o),e.lineTo(i-u,n+o);break;case"star":d=Math.cos(g)*(r?r/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,u=Math.sin(g)*(r?r/2:m),e.moveTo(i-d,n-a),e.lineTo(i+d,n+a),e.moveTo(i+u,n-o),e.lineTo(i-u,n+o),g+=ce,d=Math.cos(g)*(r?r/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,u=Math.sin(g)*(r?r/2:m),e.moveTo(i-d,n-a),e.lineTo(i+d,n+a),e.moveTo(i+u,n-o),e.lineTo(i-u,n+o);break;case"line":o=r?r/2:Math.cos(g)*m,a=Math.sin(g)*m,e.moveTo(i-o,n-a),e.lineTo(i+o,n+a);break;case"dash":e.moveTo(i,n),e.lineTo(i+Math.cos(g)*(r?r/2:m),n+Math.sin(g)*m);break;case!1:e.closePath()}e.fill(),t.borderWidth>0&&e.stroke()}}function ht(e,t,i){return i=i||.5,!t||e&&e.x>t.left-i&&e.x<t.right+i&&e.y>t.top-i&&e.y<t.bottom+i}function dt(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function ut(e){e.restore()}function ft(e,t,i,n,r){if(!t)return e.lineTo(i.x,i.y);if("middle"===r){const n=(t.x+i.x)/2;e.lineTo(n,t.y),e.lineTo(n,i.y)}else"after"===r!=!!n?e.lineTo(t.x,i.y):e.lineTo(i.x,t.y);e.lineTo(i.x,i.y)}function pt(e,t,i,n){if(!t)return e.lineTo(i.x,i.y);e.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function mt(e,t,i,n,r){if(r.strikethrough||r.underline){const s=e.measureText(n),o=t-s.actualBoundingBoxLeft,a=t+s.actualBoundingBoxRight,l=i-s.actualBoundingBoxAscent,c=i+s.actualBoundingBoxDescent,h=r.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(o,h),e.lineTo(a,h),e.stroke()}}function gt(e,t){const i=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=i}function _t(e,t,i,n,r,s={}){const o=z(t)?t:[t],a=s.strokeWidth>0&&""!==s.strokeColor;let l,c;for(e.save(),e.font=r.string,function(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),O(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}(e,s),l=0;l<o.length;++l)c=o[l],s.backdrop&>(e,s.backdrop),a&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),O(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(c,i,n,s.maxWidth)),e.fillText(c,i,n,s.maxWidth),mt(e,i,n,c,s),n+=Number(r.lineHeight);e.restore()}function yt(e,t){const{x:i,y:n,w:r,h:s,radius:o}=t;e.arc(i+o.topLeft,n+o.topLeft,o.topLeft,1.5*ne,ne,!0),e.lineTo(i,n+s-o.bottomLeft),e.arc(i+o.bottomLeft,n+s-o.bottomLeft,o.bottomLeft,ne,le,!0),e.lineTo(i+r-o.bottomRight,n+s),e.arc(i+r-o.bottomRight,n+s-o.bottomRight,o.bottomRight,le,0,!0),e.lineTo(i+r,n+o.topRight),e.arc(i+r-o.topRight,n+o.topRight,o.topRight,0,-le,!0),e.lineTo(i+o.topLeft,n)}const vt=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,xt=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function bt(e,t){const i=(""+e).match(vt);if(!i||"normal"===i[1])return 1.2*t;switch(e=+i[2],i[3]){case"px":return e;case"%":e/=100}return t*e}const wt=e=>+e||0;function St(e,t){const i={},n=F(t),r=n?Object.keys(t):t,s=F(e)?n?i=>B(e[i],e[t[i]]):t=>e[t]:()=>e;for(const e of r)i[e]=wt(s(e));return i}function Tt(e){return St(e,{top:"y",right:"x",bottom:"y",left:"x"})}function kt(e){return St(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Mt(e){const t=Tt(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function At(e,t){e=e||{},t=t||nt.font;let i=B(e.size,t.size);"string"==typeof i&&(i=parseInt(i,10));let n=B(e.style,t.style);n&&!(""+n).match(xt)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const r={family:B(e.family,t.family),lineHeight:bt(B(e.lineHeight,t.lineHeight),i),size:i,style:n,weight:B(e.weight,t.weight),string:""};return r.string=function(e){return!e||O(e.size)||O(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(r),r}function Ct(e,t,i,n){let r,s,o,a=!0;for(r=0,s=e.length;r<s;++r)if(o=e[r],void 0!==o&&(void 0!==t&&"function"==typeof o&&(o=o(t),a=!1),void 0!==i&&z(o)&&(o=o[i%o.length],a=!1),void 0!==o))return n&&!a&&(n.cacheable=!1),o}function Dt(e,t){return Object.assign(Object.create(e),t)}function Lt(e,t=[""],i,n,r=()=>e[0]){const s=i||e;void 0===n&&(n=Ht("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:n,_getTarget:r,override:i=>Lt([i,...e],t,s,n)};return new Proxy(o,{deleteProperty:(t,i)=>(delete t[i],delete t._keys,delete e[0][i],!0),get:(i,n)=>Ot(i,n,()=>function(e,t,i,n){let r;for(const s of t)if(r=Ht(Pt(s,e),i),void 0!==r)return Rt(e,r)?Yt(i,n,e,r):r}(n,t,e,i)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e._scopes[0],t),getPrototypeOf:()=>Reflect.getPrototypeOf(e[0]),has:(e,t)=>jt(e).includes(t),ownKeys:e=>jt(e),set(e,t,i){const n=e._storage||(e._storage=r());return e[t]=n[t]=i,delete e._keys,!0}})}function Et(e,t,i,n){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:i,_stack:new Set,_descriptors:It(e,n),setContext:t=>Et(e,t,i,n),override:r=>Et(e.override(r),t,i,n)};return new Proxy(r,{deleteProperty:(t,i)=>(delete t[i],delete e[i],!0),get:(e,t,i)=>Ot(e,t,()=>function(e,t,i){const{_proxy:n,_context:r,_subProxy:s,_descriptors:o}=e;let a=n[t];return te(a)&&o.isScriptable(t)&&(a=function(e,t,i,n){const{_proxy:r,_context:s,_subProxy:o,_stack:a}=i;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(s,o||n);return a.delete(e),Rt(e,l)&&(l=Yt(r._scopes,r,e,l)),l}(t,a,e,i)),z(a)&&a.length&&(a=function(e,t,i,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:a}=i;if(void 0!==s.index&&n(e))return t[s.index%t.length];if(F(t[0])){const i=t,n=r._scopes.filter(e=>e!==i);t=[];for(const l of i){const i=Yt(n,r,e,l);t.push(Et(i,s,o&&o[e],a))}}return t}(t,a,e,o.isIndexable)),Rt(t,a)&&(a=Et(a,r,s&&s[t],o)),a}(e,t,i)),getOwnPropertyDescriptor:(t,i)=>t._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i),getPrototypeOf:()=>Reflect.getPrototypeOf(e),has:(t,i)=>Reflect.has(e,i),ownKeys:()=>Reflect.ownKeys(e),set:(t,i,n)=>(e[i]=n,delete t[i],!0)})}function It(e,t={scriptable:!0,indexable:!0}){const{_scriptable:i=t.scriptable,_indexable:n=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:i,indexable:n,isScriptable:te(i)?i:()=>i,isIndexable:te(n)?n:()=>n}}const Pt=(e,t)=>e?e+Q(t):t,Rt=(e,t)=>F(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object);function Ot(e,t,i){if(Object.prototype.hasOwnProperty.call(e,t)||"constructor"===t)return e[t];const n=i();return e[t]=n,n}function zt(e,t,i){return te(e)?e(t,i):e}const Ft=(e,t)=>!0===e?t:"string"==typeof e?K(t,e):void 0;function Nt(e,t,i,n,r){for(const s of t){const t=Ft(i,s);if(t){e.add(t);const s=zt(t._fallback,i,r);if(void 0!==s&&s!==i&&s!==n)return s}else if(!1===t&&void 0!==n&&i!==n)return null}return!1}function Yt(e,t,i,n){const r=t._rootScopes,s=zt(t._fallback,i,n),o=[...e,...r],a=new Set;a.add(n);let l=Bt(a,o,i,s||i,n);return null!==l&&(void 0===s||s===i||(l=Bt(a,o,s,l,n),null!==l))&&Lt(Array.from(a),[""],r,s,()=>function(e,t,i){const n=e._getTarget();t in n||(n[t]={});const r=n[t];return z(r)&&F(i)?i:r||{}}(t,i,n))}function Bt(e,t,i,n,r){for(;i;)i=Nt(e,t,i,n,r);return i}function Ht(e,t){for(const i of t){if(!i)continue;const t=i[e];if(void 0!==t)return t}}function jt(e){let t=e._keys;return t||(t=e._keys=function(e){const t=new Set;for(const i of e)for(const e of Object.keys(i).filter(e=>!e.startsWith("_")))t.add(e);return Array.from(t)}(e._scopes)),t}function Vt(e,t,i,n){const{iScale:r}=e,{key:s="r"}=this._parsing,o=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+i,h=t[c],o[a]={r:r.parse(K(h,s),c)};return o}const Wt=Number.EPSILON||1e-14,Ut=(e,t)=>t<e.length&&!e[t].skip&&e[t],$t=e=>"x"===e?"y":"x";function Gt(e,t,i,n){const r=e.skip?t:e,s=t,o=i.skip?t:i,a=be(s,r),l=be(o,s);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:s.x-d*(o.x-r.x),y:s.y-d*(o.y-r.y)},next:{x:s.x+u*(o.x-r.x),y:s.y+u*(o.y-r.y)}}}function Xt(e,t,i){return Math.max(Math.min(e,i),t)}function qt(e,t,i,n,r){let s,o,a,l;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),"monotone"===t.cubicInterpolationMode)!function(e,t="x"){const i=$t(t),n=e.length,r=Array(n).fill(0),s=Array(n);let o,a,l,c=Ut(e,0);for(o=0;o<n;++o)if(a=l,l=c,c=Ut(e,o+1),l){if(c){const e=c[t]-l[t];r[o]=0!==e?(c[i]-l[i])/e:0}s[o]=a?c?ue(r[o-1])!==ue(r[o])?0:(r[o-1]+r[o])/2:r[o-1]:r[o]}!function(e,t,i){const n=e.length;let r,s,o,a,l,c=Ut(e,0);for(let h=0;h<n-1;++h)l=c,c=Ut(e,h+1),l&&c&&(fe(t[h],0,Wt)?i[h]=i[h+1]=0:(r=i[h]/t[h],s=i[h+1]/t[h],a=Math.pow(r,2)+Math.pow(s,2),a<=9||(o=3/Math.sqrt(a),i[h]=r*o*t[h],i[h+1]=s*o*t[h])))}(e,r,s),function(e,t,i="x"){const n=$t(i),r=e.length;let s,o,a,l=Ut(e,0);for(let c=0;c<r;++c){if(o=a,a=l,l=Ut(e,c+1),!a)continue;const r=a[i],h=a[n];o&&(s=(r-o[i])/3,a[`cp1${i}`]=r-s,a[`cp1${n}`]=h-s*t[c]),l&&(s=(l[i]-r)/3,a[`cp2${i}`]=r+s,a[`cp2${n}`]=h+s*t[c])}}(e,s,t)}(e,r);else{let i=n?e[e.length-1]:e[0];for(s=0,o=e.length;s<o;++s)a=e[s],l=Gt(i,a,e[Math.min(s+1,o-(n?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}t.capBezierPoints&&function(e,t){let i,n,r,s,o,a=ht(e[0],t);for(i=0,n=e.length;i<n;++i)o=s,s=a,a=i<n-1&&ht(e[i+1],t),s&&(r=e[i],o&&(r.cp1x=Xt(r.cp1x,t.left,t.right),r.cp1y=Xt(r.cp1y,t.top,t.bottom)),a&&(r.cp2x=Xt(r.cp2x,t.left,t.right),r.cp2y=Xt(r.cp2y,t.top,t.bottom)))}(e,i)}function Zt(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Jt(e){let t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function Kt(e,t,i){let n;return"string"==typeof e?(n=parseInt(e,10),-1!==e.indexOf("%")&&(n=n/100*t.parentNode[i])):n=e,n}const Qt=e=>e.ownerDocument.defaultView.getComputedStyle(e,null),ei=["top","right","bottom","left"];function ti(e,t,i){const n={};i=i?"-"+i:"";for(let r=0;r<4;r++){const s=ei[r];n[s]=parseFloat(e[t+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function ii(e,t){if("native"in e)return e;const{canvas:i,currentDevicePixelRatio:n}=t,r=Qt(i),s="border-box"===r.boxSizing,o=ti(r,"padding"),a=ti(r,"border","width"),{x:l,y:c,box:h}=function(e,t){const i=e.touches,n=i&&i.length?i[0]:e,{offsetX:r,offsetY:s}=n;let o,a,l=!1;if(((e,t,i)=>(e>0||t>0)&&(!i||!i.shadowRoot))(r,s,e.target))o=r,a=s;else{const e=t.getBoundingClientRect();o=n.clientX-e.left,a=n.clientY-e.top,l=!0}return{x:o,y:a,box:l}}(e,i),d=o.left+(h&&a.left),u=o.top+(h&&a.top);let{width:f,height:p}=t;return s&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const ni=e=>Math.round(10*e)/10;function ri(e,t,i){const n=t||1,r=Math.floor(e.height*n),s=Math.floor(e.width*n);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const o=e.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),(e.currentDevicePixelRatio!==n||o.height!==r||o.width!==s)&&(e.currentDevicePixelRatio=n,o.height=r,o.width=s,e.ctx.setTransform(n,0,0,n,0,0),!0)}const si=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Zt()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(e){}return e}();function oi(e,t){const i=function(e,t){return Qt(e).getPropertyValue(t)}(e,t),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ai(e,t,i,n){return{x:e.x+i*(t.x-e.x),y:e.y+i*(t.y-e.y)}}function li(e,t,i,n){return{x:e.x+i*(t.x-e.x),y:"middle"===n?i<.5?e.y:t.y:"after"===n?i<1?e.y:t.y:i>0?t.y:e.y}}function ci(e,t,i,n){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=ai(e,r,i),a=ai(r,s,i),l=ai(s,t,i),c=ai(o,a,i),h=ai(a,l,i);return ai(c,h,i)}function hi(e,t,i){return e?function(e,t){return{x:i=>e+e+t-i,setWidth(e){t=e},textAlign:e=>"center"===e?e:"right"===e?"left":"right",xPlus:(e,t)=>e-t,leftForLtr:(e,t)=>e-t}}(t,i):{x:e=>e,setWidth(e){},textAlign:e=>e,xPlus:(e,t)=>e+t,leftForLtr:(e,t)=>e}}function di(e,t){let i,n;"ltr"!==t&&"rtl"!==t||(i=e.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",t,"important"),e.prevTextDirection=n)}function ui(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function fi(e){return"angle"===e?{between:Te,compare:we,normalize:Se}:{between:Me,compare:(e,t)=>e-t,normalize:e=>e}}function pi({start:e,end:t,count:i,loop:n,style:r}){return{start:e%i,end:t%i,loop:n&&(t-e+1)%i==0,style:r}}function mi(e,t,i){if(!i)return[e];const{property:n,start:r,end:s}=i,o=t.length,{compare:a,between:l,normalize:c}=fi(n),{start:h,end:d,loop:u,style:f}=function(e,t,i){const{property:n,start:r,end:s}=i,{between:o,normalize:a}=fi(n),l=t.length;let c,h,{start:d,end:u,loop:f}=e;if(f){for(d+=l,u+=l,c=0,h=l;c<h&&o(a(t[d%l][n]),r,s);++c)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:e.style}}(e,t,i),p=[];let m,g,_,y=!1,v=null;const x=()=>y||l(r,_,m)&&0!==a(r,_),b=()=>!y||0===a(s,m)||l(s,_,m);for(let e=h,i=h;e<=d;++e)g=t[e%o],g.skip||(m=c(g[n]),m!==_&&(y=l(m,r,s),null===v&&x()&&(v=0===a(m,r)?e:i),null!==v&&b()&&(p.push(pi({start:v,end:e,loop:u,count:o,style:f})),v=null),i=e,_=m));return null!==v&&p.push(pi({start:v,end:d,loop:u,count:o,style:f})),p}function gi(e,t){const i=[],n=e.segments;for(let r=0;r<n.length;r++){const s=mi(n[r],e.points,t);s.length&&i.push(...s)}return i}function _i(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function yi(e,t){if(!t)return!1;const i=[],n=function(e,t){return Ve(t)?(i.includes(t)||i.push(t),i.indexOf(t)):t};return JSON.stringify(e,n)!==JSON.stringify(t,n)}function vi(e,t,i){return e.options.clip?e[i]:t[i]}function xi(e,t){const i=t._clip;if(i.disabled)return!1;const n=function(e,t){const{xScale:i,yScale:n}=e;return i&&n?{left:vi(i,t,"left"),right:vi(i,t,"right"),top:vi(n,t,"top"),bottom:vi(n,t,"bottom")}:t}(t,e.chartArea);return{left:!1===i.left?0:n.left-(!0===i.left?0:i.left),right:!1===i.right?e.width:n.right+(!0===i.right?0:i.right),top:!1===i.top?0:n.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?e.height:n.bottom+(!0===i.bottom?0:i.bottom)}}class bi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,n){const r=t.listeners[n],s=t.duration;r.forEach(n=>n({chart:e,initial:t.initial,numSteps:s,currentStep:Math.min(i-t.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Pe.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const r=i.items;let s,o=r.length-1,a=!1;for(;o>=0;--o)s=r[o],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(e),a=!0):(r[o]=r[r.length-1],r.pop());a&&(n.draw(),this._notify(n,i,e,"progress")),r.length||(i.running=!1,this._notify(n,i,e,"complete"),i.initial=!1),t+=r.length}),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var wi=new bi;const Si="transparent",Ti={boolean:(e,t,i)=>i>.5?t:e,color(e,t,i){const n=We(e||Si),r=n.valid&&We(t||Si);return r&&r.valid?r.mix(n,i).hexString():t},number:(e,t,i)=>e+(t-e)*i};class ki{constructor(e,t,i,n){const r=t[i];n=Ct([e.to,n,r,e.from]);const s=Ct([e.from,r,n]);this._active=!0,this._fn=e.fn||Ti[e.type||typeof s],this._easing=je[e.easing]||je.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const n=this._target[this._prop],r=i-this._start,s=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(s,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=Ct([e.to,t,n,e.from]),this._from=Ct([e.from,n,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,n=this._prop,r=this._from,s=this._loop,o=this._to;let a;if(this._active=r!==o&&(s||t<i),!this._active)return this._target[n]=o,void this._notify(!0);t<0?this._target[n]=r:(a=t/i%2,a=s&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(r,o,a))}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let e=0;e<i.length;e++)i[e][t]()}}class Mi{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!F(e))return;const t=Object.keys(nt.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(n=>{const r=e[n];if(!F(r))return;const s={};for(const e of t)s[e]=r[e];(z(r.properties)&&r.properties||[n]).forEach(e=>{e!==n&&i.has(e)||i.set(e,s)})})}_animateOptions(e,t){const i=t.options,n=function(e,t){if(!t)return;let i=e.options;if(i)return i.$shared&&(e.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;e.options=t}(e,i);if(!n)return[];const r=this._createAnimations(n,i);return i.$shared&&function(e,t){const i=[],n=Object.keys(t);for(let t=0;t<n.length;t++){const r=e[n[t]];r&&r.active()&&i.push(r.wait())}return Promise.all(i)}(e.options.$animations,i).then(()=>{e.options=i},()=>{}),r}_createAnimations(e,t){const i=this._properties,n=[],r=e.$animations||(e.$animations={}),s=Object.keys(t),o=Date.now();let a;for(a=s.length-1;a>=0;--a){const l=s[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(e,t));continue}const c=t[l];let h=r[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,o);continue}h.cancel()}d&&d.duration?(r[l]=h=new ki(d,e,l,c),n.push(h)):e[l]=c}return n}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const i=this._createAnimations(e,t);return i.length?(wi.add(this._chart,i),!0):void 0}}function Ai(e,t){const i=e&&e.options||{},n=i.reverse,r=void 0===i.min?t:0,s=void 0===i.max?t:0;return{start:n?s:r,end:n?r:s}}function Ci(e,t){const i=[],n=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=n.length;r<s;++r)i.push(n[r].index);return i}function Di(e,t,i,n={}){const r=e.keys,s="single"===n.mode;let o,a,l,c;if(null===t)return;let h=!1;for(o=0,a=r.length;o<a;++o){if(l=+r[o],l===i){if(h=!0,n.all)continue;break}c=e.values[l],N(c)&&(s||0===t||ue(t)===ue(c))&&(t+=c)}return h||n.all?t:0}function Li(e,t){const i=e&&e.options.stacked;return i||void 0===i&&void 0!==t.stack}function Ei(e,t,i){const n=e[t]||(e[t]={});return n[i]||(n[i]={})}function Ii(e,t,i,n){for(const r of t.getMatchingVisibleMetas(n).reverse()){const t=e[r.index];if(i&&t>0||!i&&t<0)return r.index}return null}function Pi(e,t){const{chart:i,_cachedMeta:n}=e,r=i._stacks||(i._stacks={}),{iScale:s,vScale:o,index:a}=n,l=s.axis,c=o.axis,h=function(e,t,i){return`${e.id}.${t.id}.${i.stack||i.type}`}(s,o,n),d=t.length;let u;for(let e=0;e<d;++e){const i=t[e],{[l]:s,[c]:d}=i;u=(i._stacks||(i._stacks={}))[c]=Ei(r,h,s),u[a]=d,u._top=Ii(u,o,!0,n.type),u._bottom=Ii(u,o,!1,n.type),(u._visualValues||(u._visualValues={}))[a]=d}}function Ri(e,t){const i=e.scales;return Object.keys(i).filter(e=>i[e].axis===t).shift()}function Oi(e,t){const i=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){t=t||e._parsed;for(const e of t){const t=e._stacks;if(!t||void 0===t[n]||void 0===t[n][i])return;delete t[n][i],void 0!==t[n]._visualValues&&void 0!==t[n]._visualValues[i]&&delete t[n]._visualValues[i]}}}const zi=e=>"reset"===e||"none"===e,Fi=(e,t)=>t?e:Object.assign({},e);class Ni{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Li(e.vScale,e),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(e){this.index!==e&&Oi(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),n=(e,t,i,n)=>"x"===e?t:"r"===e?n:i,r=t.xAxisID=B(i.xAxisID,Ri(e,"x")),s=t.yAxisID=B(i.yAxisID,Ri(e,"y")),o=t.rAxisID=B(i.rAxisID,Ri(e,"r")),a=t.indexAxis,l=t.iAxisID=n(a,r,s,o),c=t.vAxisID=n(a,s,r,o);t.xScale=this.getScaleForId(r),t.yScale=this.getScaleForId(s),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(l),t.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Ee(this._data,this),e._stacked&&Oi(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(F(t)){const e=this._cachedMeta;this._data=function(e,t){const{iScale:i,vScale:n}=t,r="x"===i.axis?"x":"y",s="x"===n.axis?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,h;for(l=0,c=o.length;l<c;++l)h=o[l],a[l]={[r]:h,[s]:e[h]};return a}(t,e)}else if(i!==t){if(i){Ee(i,this);const e=this._cachedMeta;Oi(e),e._parsed=[]}t&&Object.isExtensible(t)&&((n=t)._chartjs?n._chartjs.listeners.push(this):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),Le.forEach(e=>{const t="_onData"+Q(e),i=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...e){const r=i.apply(this,e);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[t]&&i[t](...e)}),r}})}))),this._syncList=[],this._data=t}var n}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const r=t._stacked;t._stacked=Li(t.vScale,t),t.stack!==i.stack&&(n=!0,Oi(t),t.stack=i.stack),this._resyncElements(e),(n||r!==t._stacked)&&(Pi(this,t._parsed),t._stacked=Li(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:n}=this,{iScale:r,_stacked:s}=i,o=r.axis;let a,l,c,h=0===e&&t===n.length||i._sorted,d=e>0&&i._parsed[e-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=z(n[e])?this.parseArrayData(i,n,e,t):F(n[e])?this.parseObjectData(i,n,e,t):this.parsePrimitiveData(i,n,e,t);const r=()=>null===l[o]||d&&l[o]<d[o];for(a=0;a<t;++a)i._parsed[a+e]=l=c[a],h&&(r()&&(h=!1),d=l);i._sorted=h}s&&Pi(this,c)}parsePrimitiveData(e,t,i,n){const{iScale:r,vScale:s}=e,o=r.axis,a=s.axis,l=r.getLabels(),c=r===s,h=new Array(n);let d,u,f;for(d=0,u=n;d<u;++d)f=d+i,h[d]={[o]:c||r.parse(l[f],f),[a]:s.parse(t[f],f)};return h}parseArrayData(e,t,i,n){const{xScale:r,yScale:s}=e,o=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+i,h=t[c],o[a]={x:r.parse(h[0],c),y:s.parse(h[1],c)};return o}parseObjectData(e,t,i,n){const{xScale:r,yScale:s}=e,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,l=new Array(n);let c,h,d,u;for(c=0,h=n;c<h;++c)d=c+i,u=t[d],l[c]={x:r.parse(K(u,o),d),y:s.parse(K(u,a),d)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const n=this.chart,r=this._cachedMeta,s=t[e.axis];return Di({keys:Ci(n,!0),values:t._stacks[e.axis]._visualValues},s,r.index,{mode:i})}updateRangeFromParsed(e,t,i,n){const r=i[t.axis];let s=null===r?NaN:r;const o=n&&i._stacks[t.axis];n&&o&&(n.values=o,s=Di(n,r,this._cachedMeta.index)),e.min=Math.min(e.min,s),e.max=Math.max(e.max,s)}getMinMax(e,t){const i=this._cachedMeta,n=i._parsed,r=i._sorted&&e===i.iScale,s=n.length,o=this._getOtherScale(e),a=((e,t,i)=>e&&!t.hidden&&t._stacked&&{keys:Ci(i,!0),values:null})(t,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(e){const{min:t,max:i,minDefined:n,maxDefined:r}=e.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:r?i:Number.POSITIVE_INFINITY}}(o);let d,u;function f(){u=n[d];const t=u[o.axis];return!N(u[e.axis])||c>t||h<t}for(d=0;d<s&&(f()||(this.updateRangeFromParsed(l,e,u,a),!r));++d);if(r)for(d=s-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(l,e,u,a);break}return l}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let n,r,s;for(n=0,r=t.length;n<r;++n)s=t[n][e.axis],N(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,n=t.vScale,r=this.getParsed(e);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=function(e){let t,i,n,r;return F(e)?(t=e.top,i=e.right,n=e.bottom,r=e.left):t=i=n=r=e,{top:t,right:i,bottom:n,left:r,disabled:!1===e}}(B(this.options.clip,function(e,t,i){if(!1===i)return!1;const n=Ai(e,i),r=Ai(t,i);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,n=i.data||[],r=t.chartArea,s=[],o=this._drawStart||0,a=this._drawCount||n.length-o,l=this.options.drawActiveElementsOnTop;let c;for(i.dataset&&i.dataset.draw(e,r,o,a),c=o;c<o+a;++c){const t=n[c];t.hidden||(t.active&&l?s.push(t):t.draw(e,r))}for(c=0;c<s.length;++c)s[c].draw(e,r)}getStyle(e,t){const i=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const n=this.getDataset();let r;if(e>=0&&e<this._cachedMeta.data.length){const t=this._cachedMeta.data[e];r=t.$context||(t.$context=function(e,t,i){return Dt(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:i,index:t,mode:"default",type:"data"})}(this.getContext(),e,t)),r.parsed=this.getParsed(e),r.raw=n.data[e],r.index=r.dataIndex=e}else r=this.$context||(this.$context=function(e,t){return Dt(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),r.dataset=n,r.index=r.datasetIndex=this.index;return r.active=!!t,r.mode=i,r}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const n="active"===t,r=this._cachedDataOpts,s=e+"-"+t,o=r[s],a=this.enableOptionSharing&&ee(i);if(o)return Fi(o,a);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,e),h=n?[`${e}Hover`,"hover",e,""]:[e,""],d=l.getOptionScopes(this.getDataset(),c),u=Object.keys(nt.elements[e]),f=l.resolveNamedOptions(d,u,()=>this.getContext(i,n,t),h);return f.$shared&&(f.$shared=a,r[s]=Object.freeze(Fi(f,a))),f}_resolveAnimations(e,t,i){const n=this.chart,r=this._cachedDataOpts,s=`animation-${t}`,o=r[s];if(o)return o;let a;if(!1!==n.options.animation){const n=this.chart.config,r=n.datasetAnimationScopeKeys(this._type,t),s=n.getOptionScopes(this.getDataset(),r);a=n.createResolver(s,this.getContext(e,i,t))}const l=new Mi(n,a&&a.animations);return a&&a._cacheable&&(r[s]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||zi(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),n=this._sharedOptions,r=this.getSharedOptions(i),s=this.includeOptions(t,r)||r!==n;return this.updateSharedOptions(r,t,i),{sharedOptions:r,includeOptions:s}}updateElement(e,t,i,n){zi(n)?Object.assign(e,i):this._resolveAnimations(t,n).update(e,i)}updateSharedOptions(e,t,i){e&&!zi(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,n){e.active=n;const r=this.getStyle(t,n);this._resolveAnimations(t,i,n).update(e,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[e,t,i]of this._syncList)this[e](t,i);this._syncList=[];const n=i.length,r=t.length,s=Math.min(r,n);s&&this.parse(0,s),r>n?this._insertElements(n,r-n,e):r<n&&this._removeElements(r,n-r)}_insertElements(e,t,i=!0){const n=this._cachedMeta,r=n.data,s=e+t;let o;const a=e=>{for(e.length+=t,o=e.length-1;o>=s;o--)e[o]=e[o-t]};for(a(r),o=e;o<s;++o)r[o]=new this.dataElementType;this._parsing&&a(n._parsed),this.parse(e,t),i&&this.updateElements(r,e,t,"reset")}updateElements(e,t,i,n){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(e,t);i._stacked&&Oi(i,n)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,n]=e;this[t](i,n)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Yi(e){const t=e.iScale,i=function(e,t){if(!e._cache.$bar){const i=e.getMatchingVisibleMetas(t);let n=[];for(let t=0,r=i.length;t<r;t++)n=n.concat(i[t].controller.getAllParsedValues(e));e._cache.$bar=Ie(n.sort((e,t)=>e-t))}return e._cache.$bar}(t,e.type);let n,r,s,o,a=t._length;const l=()=>{32767!==s&&-32768!==s&&(ee(o)&&(a=Math.min(a,Math.abs(s-o)||a)),o=s)};for(n=0,r=i.length;n<r;++n)s=t.getPixelForValue(i[n]),l();for(o=void 0,n=0,r=t.ticks.length;n<r;++n)s=t.getPixelForTick(n),l();return a}function Bi(e,t,i,n){return z(e)?function(e,t,i,n){const r=i.parse(e[0],n),s=i.parse(e[1],n),o=Math.min(r,s),a=Math.max(r,s);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[i.axis]=c,t._custom={barStart:l,barEnd:c,start:r,end:s,min:o,max:a}}(e,t,i,n):t[i.axis]=i.parse(e,n),t}function Hi(e,t,i,n){const r=e.iScale,s=e.vScale,o=r.getLabels(),a=r===s,l=[];let c,h,d,u;for(c=i,h=i+n;c<h;++c)u=t[c],d={},d[r.axis]=a||r.parse(o[c],c),l.push(Bi(u,d,s,c));return l}function ji(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function Vi(e,t,i,n){let r=t.borderSkipped;const s={};if(!r)return void(e.borderSkipped=s);if(!0===r)return void(e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:o,end:a,reverse:l,top:c,bottom:h}=function(e){let t,i,n,r,s;return e.horizontal?(t=e.base>e.x,i="left",n="right"):(t=e.base<e.y,i="bottom",n="top"),t?(r="end",s="start"):(r="start",s="end"),{start:i,end:n,reverse:t,top:r,bottom:s}}(e);"middle"===r&&i&&(e.enableBorderRadius=!0,(i._top||0)===n?r=c:(i._bottom||0)===n?r=h:(s[Wi(h,o,a,l)]=!0,r=c)),s[Wi(r,o,a,l)]=!0,e.borderSkipped=s}function Wi(e,t,i,n){var r,s,o;return n?(o=i,e=Ui(e=(r=e)===(s=t)?o:r===o?s:r,i,t)):e=Ui(e,t,i),e}function Ui(e,t,i){return"start"===e?t:"end"===e?i:e}function $i(e,{inflateAmount:t},i){e.inflateAmount="auto"===t?1===i?.33:0:t}class Gi extends Ni{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:e=>"spacing"!==e,_indexable:e=>"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:i,color:n}}=e.legend.options;return t.labels.map((t,r)=>{const s=e.getDatasetMeta(0).controller.getStyle(r);return{text:t,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:n,lineWidth:s.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,t,i){i.chart.toggleDataVisibility(t.index),i.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let r,s,o=e=>+i[e];if(F(i[e])){const{key:e="value"}=this._parsing;o=t=>+K(i[t],e)}for(r=e,s=e+t;r<s;++r)n._parsed[r]=o(r)}}_getRotation(){return _e(this.options.rotation-90)}_getCircumference(){return _e(this.options.circumference)}_getRotationExtents(){let e=re,t=-re;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const n=this.chart.getDatasetMeta(i).controller,r=n._getRotation(),s=n._getCircumference();e=Math.min(e,r),t=Math.max(t,r+s)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:i}=t,n=this._cachedMeta,r=n.data,s=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-s)/2,0),a=Math.min((c=o,"string"==typeof(l=this.options.cutout)&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const h=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:m,offsetY:g}=function(e,t,i){let n=1,r=1,s=0,o=0;if(t<re){const a=e,l=a+t,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),u=Math.sin(l),f=(e,t,n)=>Te(e,a,l,!0)?1:Math.max(t,t*i,n,n*i),p=(e,t,n)=>Te(e,a,l,!0)?-1:Math.min(t,t*i,n,n*i),m=f(0,c,d),g=f(le,h,u),_=p(ne,c,d),y=p(ne+le,h,u);n=(m-_)/2,r=(g-y)/2,s=-(m+_)/2,o=-(g+y)/2}return{ratioX:n,ratioY:r,offsetX:s,offsetY:o}}(u,d,a),_=(i.width-s)/f,y=(i.height-s)/p,v=Math.max(Math.min(_,y)/2,0),x=H(this.options.radius,v),b=(x-Math.max(x*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*x,this.offsetY=g*x,n.total=this.calculateTotal(),this.outerRadius=x-b*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-b*h,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){const i=this.options,n=this._cachedMeta,r=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||null===n._parsed[e]||n.data[e].hidden?0:this.calculateCircumference(n._parsed[e]*r/re)}updateElements(e,t,i,n){const r="reset"===n,s=this.chart,o=s.chartArea,a=s.options.animation,l=(o.left+o.right)/2,c=(o.top+o.bottom)/2,h=r&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(t,n);let m,g=this._getRotation();for(m=0;m<t;++m)g+=this._circumference(m,r);for(m=t;m<t+i;++m){const t=this._circumference(m,r),i=e[m],s={x:l+this.offsetX,y:c+this.offsetY,startAngle:g,endAngle:g+t,circumference:t,outerRadius:u,innerRadius:d};p&&(s.options=f||this.resolveDataElementOptions(m,i.active?"active":n)),g+=t,this.updateElement(i,m,s,n)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let i,n=0;for(i=0;i<t.length;i++){const r=e._parsed[i];null===r||isNaN(r)||!this.chart.getDataVisibility(i)||t[i].hidden||(n+=Math.abs(r))}return n}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?re*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=qe(t._parsed[e],i.options.locale);return{label:n[e]||"",value:r}}getMaxBorderWidth(e){let t=0;const i=this.chart;let n,r,s,o,a;if(!e)for(n=0,r=i.data.datasets.length;n<r;++n)if(i.isDatasetVisible(n)){s=i.getDatasetMeta(n),e=s.data,o=s.controller;break}if(!e)return 0;for(n=0,r=e.length;n<r;++n)a=o.resolveDataElementOptions(n),"inner"!==a.borderAlign&&(t=Math.max(t,a.borderWidth||0,a.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,n=e.length;i<n;++i){const e=this.resolveDataElementOptions(i);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(t+=this._getRingWeight(i));return t}_getRingWeight(e){return Math.max(B(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Xi extends Ni{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(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:i,color:n}}=e.legend.options;return t.labels.map((t,r)=>{const s=e.getDatasetMeta(0).controller.getStyle(r);return{text:t,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:n,lineWidth:s.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,t,i){i.chart.toggleDataVisibility(t.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=qe(t._parsed[e].r,i.options.locale);return{label:n[e]||"",value:r}}parseObjectData(e,t,i,n){return Vt.bind(this)(e,t,i,n)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((e,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(n<t.min&&(t.min=n),n>t.max&&(t.max=n))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,n=Math.min(t.right-t.left,t.bottom-t.top),r=Math.max(n/2,0),s=(r-Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(e,t,i,n){const r="reset"===n,s=this.chart,o=s.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,h=a.getIndexAngle(0)-.5*ne;let d,u=h;const f=360/this.countVisibleElements();for(d=0;d<t;++d)u+=this._computeAngle(d,n,f);for(d=t;d<t+i;d++){const t=e[d];let i=u,p=u+this._computeAngle(d,n,f),m=s.getDataVisibility(d)?a.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=p,r&&(o.animateScale&&(m=0),o.animateRotate&&(i=p=h));const g={x:l,y:c,innerRadius:0,outerRadius:m,startAngle:i,endAngle:p,options:this.resolveDataElementOptions(d,t.active?"active":n)};this.updateElement(t,d,g,n)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((e,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?_e(this.resolveDataElementOptions(e,t).angle||i):0}}var qi=Object.freeze({__proto__:null,BarController:class extends Ni{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(e,t,i,n){return Hi(e,t,i,n)}parseArrayData(e,t,i,n){return Hi(e,t,i,n)}parseObjectData(e,t,i,n){const{iScale:r,vScale:s}=e,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,l="x"===r.axis?o:a,c="x"===s.axis?o:a,h=[];let d,u,f,p;for(d=i,u=i+n;d<u;++d)p=t[d],f={},f[r.axis]=r.parse(K(p,l),d),h.push(Bi(K(p,c),f,s,d));return h}updateRangeFromParsed(e,t,i,n){super.updateRangeFromParsed(e,t,i,n);const r=i._custom;r&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,r.min),e.max=Math.max(e.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:n}=t,r=this.getParsed(e),s=r._custom,o=ji(s)?"["+s.start+", "+s.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,n){const r="reset"===n,{index:s,_cachedMeta:{vScale:o}}=this,a=o.getBasePixel(),l=o.isHorizontal(),c=this._getRuler(),{sharedOptions:h,includeOptions:d}=this._getSharedOptions(t,n);for(let u=t;u<t+i;u++){const t=this.getParsed(u),i=r||O(t[o.axis])?{base:a,head:a}:this._calculateBarValuePixels(u),f=this._calculateBarIndexPixels(u,c),p=(t._stacks||{})[o.axis],m={horizontal:l,base:i.base,enableBorderRadius:!p||ji(t._custom)||s===p._top||s===p._bottom,x:l?i.head:f.center,y:l?f.center:i.head,height:l?f.size:Math.abs(i.size),width:l?Math.abs(i.size):f.size};d&&(m.options=h||this.resolveDataElementOptions(u,e[u].active?"active":n));const g=m.options||e[u].options;Vi(m,g,p,s),$i(m,g,c.ratio),this.updateElement(e[u],u,m,n)}}_getStacks(e,t){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),r=i.options.stacked,s=[],o=this._cachedMeta.controller.getParsed(t),a=o&&o[i.axis],l=e=>{const t=e._parsed.find(e=>e[i.axis]===a),n=t&&t[e.vScale.axis];if(O(n)||isNaN(n))return!0};for(const i of n)if((void 0===t||!l(i))&&((!1===r||-1===s.indexOf(i.stack)||void 0===r&&void 0===i.stack)&&s.push(i.stack),i.index===e))break;return s.length||s.push(void 0),s}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(i=>e[i].axis===t).shift()}_getAxis(){const e={},t=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)e[B("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,i){const n=this._getStacks(e,i),r=void 0!==t?n.indexOf(t):-1;return-1===r?n.length-1:r}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,n=[];let r,s;for(r=0,s=t.data.length;r<s;++r)n.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=e.barThickness;return{min:o||Yi(t),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:o?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i,index:n},options:{base:r,minBarLength:s}}=this,o=r||0,a=this.getParsed(e),l=a._custom,c=ji(l);let h,d,u=a[t.axis],f=0,p=i?this.applyStack(t,a,i):u;p!==u&&(f=p-u,p=u),c&&(u=l.barStart,p=l.barEnd-l.barStart,0!==u&&ue(u)!==ue(l.barEnd)&&(f=0),f+=u);const m=O(r)||c?f:r;let g=t.getPixelForValue(m);if(h=this.chart.getDataVisibility(e)?t.getPixelForValue(f+p):g,d=h-g,Math.abs(d)<s){d=function(e,t,i){return 0!==e?ue(e):(t.isHorizontal()?1:-1)*(t.min>=i?1:-1)}(d,t,o)*s,u===o&&(g-=d/2);const e=t.getPixelForDecimal(0),r=t.getPixelForDecimal(1),l=Math.min(e,r),f=Math.max(e,r);g=Math.max(Math.min(g,f),l),h=g+d,i&&!c&&(a._stacks[t.axis]._visualValues[n]=t.getValueForPixel(h)-t.getValueForPixel(g))}if(g===t.getPixelForValue(o)){const e=ue(d)*t.getLineWidthForValue(o)/2;g+=e,d-=e}return{size:d,base:g,head:h,center:h+d/2}}_calculateBarIndexPixels(e,t){const i=t.scale,n=this.options,r=n.skipNull,s=B(n.maxBarThickness,1/0);let o,a;const l=this._getAxisCount();if(t.grouped){const i=r?this._getStackCount(e):t.stackCount,c="flex"===n.barThickness?function(e,t,i,n){const r=t.pixels,s=r[e];let o=e>0?r[e-1]:null,a=e<r.length-1?r[e+1]:null;const l=i.categoryPercentage;null===o&&(o=s-(null===a?t.end-t.start:a-s)),null===a&&(a=s+s-o);const c=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/n,ratio:i.barPercentage,start:c}}(e,t,n,i*l):function(e,t,i,n){const r=i.barThickness;let s,o;return O(r)?(s=t.min*i.categoryPercentage,o=i.barPercentage):(s=r*n,o=1),{chunk:s/n,ratio:o,start:t.pixels[e]-s/2}}(e,t,n,i*l),h="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(B(h,this.getFirstScaleIdForIndexAxis())),u=this._getStackIndex(this.index,this._cachedMeta.stack,r?e:void 0)+d;o=c.start+c.chunk*u+c.chunk/2,a=Math.min(s,c.chunk*c.ratio)}else o=i.getPixelForValue(this.getParsed(e)[i.axis],e),a=Math.min(s,t.min*t.ratio);return{base:o-a/2,head:o+a/2,center:o,size:a}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,n=i.length;let r=0;for(;r<n;++r)null===this.getParsed(r)[t.axis]||i[r].hidden||i[r].draw(this._ctx)}},BubbleController:class extends Ni{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(e,t,i,n){const r=super.parsePrimitiveData(e,t,i,n);for(let e=0;e<r.length;e++)r[e]._custom=this.resolveDataElementOptions(e+i).radius;return r}parseArrayData(e,t,i,n){const r=super.parseArrayData(e,t,i,n);for(let e=0;e<r.length;e++){const n=t[i+e];r[e]._custom=B(n[2],this.resolveDataElementOptions(e+i).radius)}return r}parseObjectData(e,t,i,n){const r=super.parseObjectData(e,t,i,n);for(let e=0;e<r.length;e++){const n=t[i+e];r[e]._custom=B(n&&n.r&&+n.r,this.resolveDataElementOptions(e+i).radius)}return r}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=t,s=this.getParsed(e),o=n.getLabelForValue(s.x),a=r.getLabelForValue(s.y),l=s._custom;return{label:i[e]||"",value:"("+o+", "+a+(l?", "+l:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,n){const r="reset"===n,{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(t,n),c=s.axis,h=o.axis;for(let d=t;d<t+i;d++){const t=e[d],i=!r&&this.getParsed(d),u={},f=u[c]=r?s.getPixelForDecimal(.5):s.getPixelForValue(i[c]),p=u[h]=r?o.getBasePixel():o.getPixelForValue(i[h]);u.skip=isNaN(f)||isNaN(p),l&&(u.options=a||this.resolveDataElementOptions(d,t.active?"active":n),r&&(u.options.radius=0)),this.updateElement(t,d,u,n)}}resolveDataElementOptions(e,t){const i=this.getParsed(e);let n=super.resolveDataElementOptions(e,t);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const r=n.radius;return"active"!==t&&(n.radius=0),n.radius+=B(i&&i._custom,r),n}},DoughnutController:Gi,LineController:class extends Ni{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(e){const t=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=t,s=this.chart._animationsDisabled;let{start:o,count:a}=Fe(t,n,s);this._drawStart=o,this._drawCount=a,Ne(t)&&(o=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},e),this.updateElements(n,o,a,e)}updateElements(e,t,i,n){const r="reset"===n,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(t,n),d=s.axis,u=o.axis,{spanGaps:f,segment:p}=this.options,m=me(f)?f:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||r||"none"===n,_=t+i,y=e.length;let v=t>0&&this.getParsed(t-1);for(let i=0;i<y;++i){const f=e[i],y=g?f:{};if(i<t||i>=_){y.skip=!0;continue}const x=this.getParsed(i),b=O(x[u]),w=y[d]=s.getPixelForValue(x[d],i),S=y[u]=r||b?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,x,a):x[u],i);y.skip=isNaN(w)||isNaN(S)||b,y.stop=i>0&&Math.abs(x[d]-v[d])>m,p&&(y.parsed=x,y.raw=l.data[i]),h&&(y.options=c||this.resolveDataElementOptions(i,f.active?"active":n)),g||this.updateElement(f,i,y,n),v=x}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,n=e.data||[];if(!n.length)return i;const r=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,s)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},PieController:class extends Gi{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:Xi,RadarController:class extends Ni{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(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,n){return Vt.bind(this)(e,t,i,n)}update(e){const t=this._cachedMeta,i=t.dataset,n=t.data||[],r=t.iScale.getLabels();if(i.points=n,"resize"!==e){const t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);const s={_loop:!0,_fullLoop:r.length===n.length,options:t};this.updateElement(i,void 0,s,e)}this.updateElements(n,0,n.length,e)}updateElements(e,t,i,n){const r=this._cachedMeta.rScale,s="reset"===n;for(let o=t;o<t+i;o++){const t=e[o],i=this.resolveDataElementOptions(o,t.active?"active":n),a=r.getPointPositionForValue(o,this.getParsed(o).r),l=s?r.xCenter:a.x,c=s?r.yCenter:a.y,h={x:l,y:c,angle:a.angle,skip:isNaN(l)||isNaN(c),options:i};this.updateElement(t,o,h,n)}}},ScatterController:class extends Ni{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(e){const t=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=t,s=this.getParsed(e),o=n.getLabelForValue(s.x),a=r.getLabelForValue(s.y);return{label:i[e]||"",value:"("+o+", "+a+")"}}update(e){const t=this._cachedMeta,{data:i=[]}=t,n=this.chart._animationsDisabled;let{start:r,count:s}=Fe(t,i,n);if(this._drawStart=r,this._drawCount=s,Ne(t)&&(r=0,s=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:s}=t;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const o=this.resolveDatasetElementOptions(e);o.segment=this.options.segment,this.updateElement(r,void 0,{animated:!n,options:o},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(i,r,s,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,t,i,n){const r="reset"===n,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(t,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=s.axis,f=o.axis,{spanGaps:p,segment:m}=this.options,g=me(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||r||"none"===n;let y=t>0&&this.getParsed(t-1);for(let c=t;c<t+i;++c){const t=e[c],i=this.getParsed(c),p=_?t:{},v=O(i[f]),x=p[u]=s.getPixelForValue(i[u],c),b=p[f]=r||v?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,i,a):i[f],c);p.skip=isNaN(x)||isNaN(b)||v,p.stop=c>0&&Math.abs(i[u]-y[u])>g,m&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,t.active?"active":n)),_||this.updateElement(t,c,p,n),y=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}const i=e.dataset,n=i.options&&i.options.borderWidth||0;if(!t.length)return n;const r=t[0].size(this.resolveDataElementOptions(0)),s=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(n,r,s)/2}}});function Zi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ji{static override(e){Object.assign(Ji.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return Zi()}parse(){return Zi()}format(){return Zi()}add(){return Zi()}diff(){return Zi()}startOf(){return Zi()}endOf(){return Zi()}}var Ki=Ji;function Qi(e,t,i,n){const{controller:r,data:s,_sorted:o}=e,a=r._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&"r"!==t&&o&&s.length){const o=a._reversePixels?De:Ce;if(!n){const n=o(s,t,i);if(l){const{vScale:t}=r._cachedMeta,{_parsed:i}=e,s=i.slice(0,n.lo+1).reverse().findIndex(e=>!O(e[t.axis]));n.lo-=Math.max(0,s);const o=i.slice(n.hi).findIndex(e=>!O(e[t.axis]));n.hi+=Math.max(0,o)}return n}if(r._sharedOptions){const e=s[0],n="function"==typeof e.getRange&&e.getRange(t);if(n){const e=o(s,t,i-n),r=o(s,t,i+n);return{lo:e.lo,hi:r.hi}}}}return{lo:0,hi:s.length-1}}function en(e,t,i,n,r){const s=e.getSortedVisibleDatasetMetas(),o=i[t];for(let e=0,i=s.length;e<i;++e){const{index:i,data:a}=s[e],{lo:l,hi:c}=Qi(s[e],t,o,r);for(let e=l;e<=c;++e){const t=a[e];t.skip||n(t,i,e)}}}function tn(e,t,i,n,r){const s=[];return r||e.isPointInArea(t)?(en(e,i,t,function(i,o,a){(r||ht(i,e.chartArea,0))&&i.inRange(t.x,t.y,n)&&s.push({element:i,datasetIndex:o,index:a})},!0),s):s}function nn(e,t,i,n,r,s){return s||e.isPointInArea(t)?"r"!==i||n?function(e,t,i,n,r,s){let o=[];const a=function(e){const t=-1!==e.indexOf("x"),i=-1!==e.indexOf("y");return function(e,n){const r=t?Math.abs(e.x-n.x):0,s=i?Math.abs(e.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(s,2))}}(i);let l=Number.POSITIVE_INFINITY;return en(e,i,t,function(i,c,h){const d=i.inRange(t.x,t.y,r);if(n&&!d)return;const u=i.getCenterPoint(r);if(!s&&!e.isPointInArea(u)&&!d)return;const f=a(t,u);f<l?(o=[{element:i,datasetIndex:c,index:h}],l=f):f===l&&o.push({element:i,datasetIndex:c,index:h})}),o}(e,t,i,n,r,s):function(e,t,i,n){let r=[];return en(e,i,t,function(e,i,s){const{startAngle:o,endAngle:a}=e.getProps(["startAngle","endAngle"],n),{angle:l}=xe(e,{x:t.x,y:t.y});Te(l,o,a)&&r.push({element:e,datasetIndex:i,index:s})}),r}(e,t,i,r):[]}function rn(e,t,i,n,r){const s=[],o="x"===i?"inXRange":"inYRange";let a=!1;return en(e,i,t,(e,n,l)=>{e[o]&&e[o](t[i],r)&&(s.push({element:e,datasetIndex:n,index:l}),a=a||e.inRange(t.x,t.y,r))}),n&&!a?[]:s}var sn={evaluateInteractionItems:en,modes:{index(e,t,i,n){const r=ii(t,e),s=i.axis||"x",o=i.includeInvisible||!1,a=i.intersect?tn(e,r,s,n,o):nn(e,r,s,!1,n,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{const t=a[0].index,i=e.data[t];i&&!i.skip&&l.push({element:i,datasetIndex:e.index,index:t})}),l):[]},dataset(e,t,i,n){const r=ii(t,e),s=i.axis||"xy",o=i.includeInvisible||!1;let a=i.intersect?tn(e,r,s,n,o):nn(e,r,s,!1,n,o);if(a.length>0){const t=a[0].datasetIndex,i=e.getDatasetMeta(t).data;a=[];for(let e=0;e<i.length;++e)a.push({element:i[e],datasetIndex:t,index:e})}return a},point:(e,t,i,n)=>tn(e,ii(t,e),i.axis||"xy",n,i.includeInvisible||!1),nearest(e,t,i,n){const r=ii(t,e),s=i.axis||"xy",o=i.includeInvisible||!1;return nn(e,r,s,i.intersect,n,o)},x:(e,t,i,n)=>rn(e,ii(t,e),"x",i.intersect,n),y:(e,t,i,n)=>rn(e,ii(t,e),"y",i.intersect,n)}};const on=["left","top","right","bottom"];function an(e,t){return e.filter(e=>e.pos===t)}function ln(e,t){return e.filter(e=>-1===on.indexOf(e.pos)&&e.box.axis===t)}function cn(e,t){return e.sort((e,i)=>{const n=t?i:e,r=t?e:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight})}function hn(e,t,i,n){return Math.max(e[i],t[i])+Math.max(e[n],t[n])}function dn(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function un(e,t,i,n){const{pos:r,box:s}=i,o=e.maxPadding;if(!F(r)){i.size&&(e[r]-=i.size);const t=n[i.stack]||{size:0,count:1};t.size=Math.max(t.size,i.horizontal?s.height:s.width),i.size=t.size/t.count,e[r]+=i.size}s.getPadding&&dn(o,s.getPadding());const a=Math.max(0,t.outerWidth-hn(o,e,"left","right")),l=Math.max(0,t.outerHeight-hn(o,e,"top","bottom")),c=a!==e.w,h=l!==e.h;return e.w=a,e.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function fn(e,t){const i=t.maxPadding;return function(e){const n={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{n[e]=Math.max(t[e],i[e])}),n}(e?["left","right"]:["top","bottom"])}function pn(e,t,i,n){const r=[];let s,o,a,l,c,h;for(s=0,o=e.length,c=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,fn(a.horizontal,t));const{same:o,other:d}=un(t,i,a,n);c|=o&&r.length,h=h||d,l.fullSize||r.push(a)}return c&&pn(r,t,i,n)||h}function mn(e,t,i,n,r){e.top=i,e.left=t,e.right=t+n,e.bottom=i+r,e.width=n,e.height=r}function gn(e,t,i,n){const r=i.padding;let{x:s,y:o}=t;for(const a of e){const e=a.box,l=n[a.stack]||{count:1,placed:0,weight:1},c=a.stackWeight/l.weight||1;if(a.horizontal){const n=t.w*c,s=l.size||e.height;ee(l.start)&&(o=l.start),e.fullSize?mn(e,r.left,o,i.outerWidth-r.right-r.left,s):mn(e,t.left+l.placed,o,n,s),l.start=o,l.placed+=n,o=e.bottom}else{const n=t.h*c,o=l.size||e.width;ee(l.start)&&(s=l.start),e.fullSize?mn(e,s,r.top,o,i.outerHeight-r.bottom-r.top):mn(e,s,t.top+l.placed,o,n),l.start=s,l.placed+=n,s=e.right}}t.x=s,t.y=o}var _n={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){const i=e.boxes?e.boxes.indexOf(t):-1;-1!==i&&e.boxes.splice(i,1)},configure(e,t,i){t.fullSize=i.fullSize,t.position=i.position,t.weight=i.weight},update(e,t,i,n){if(!e)return;const r=Mt(e.options.layout.padding),s=Math.max(t-r.width,0),o=Math.max(i-r.height,0),a=function(e){const t=function(e){const t=[];let i,n,r,s,o,a;for(i=0,n=(e||[]).length;i<n;++i)r=e[i],({position:s,options:{stack:o,stackWeight:a=1}}=r),t.push({index:i,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&s+o,stackWeight:a});return t}(e),i=cn(t.filter(e=>e.box.fullSize),!0),n=cn(an(t,"left"),!0),r=cn(an(t,"right")),s=cn(an(t,"top"),!0),o=cn(an(t,"bottom")),a=ln(t,"x"),l=ln(t,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:an(t,"chartArea"),vertical:n.concat(r).concat(l),horizontal:s.concat(o).concat(a)}}(e.boxes),l=a.vertical,c=a.horizontal;V(e.boxes,e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()});const h=l.reduce((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:i,padding:r,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/h,hBoxMaxHeight:o/2}),u=Object.assign({},r);dn(u,Mt(n));const f=Object.assign({maxPadding:u,w:s,h:o,x:r.left,y:r.top},r),p=function(e,t){const i=function(e){const t={};for(const i of e){const{stack:e,pos:n,stackWeight:r}=i;if(!e||!on.includes(n))continue;const s=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=r}return t}(e),{vBoxMaxWidth:n,hBoxMaxHeight:r}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:o}=a.box,l=i[a.stack],c=l&&a.stackWeight/l.weight;a.horizontal?(a.width=c?c*n:o&&t.availableWidth,a.height=r):(a.width=n,a.height=c?c*r:o&&t.availableHeight)}return i}(l.concat(c),d);pn(a.fullSize,f,d,p),pn(l,f,d,p),pn(c,f,d,p)&&pn(l,f,d,p),function(e){const t=e.maxPadding;function i(i){const n=Math.max(t[i]-e[i],0);return e[i]+=n,n}e.y+=i("top"),e.x+=i("left"),i("right"),i("bottom")}(f),gn(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,gn(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},V(a.chartArea,t=>{const i=t.box;Object.assign(i,e.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class yn{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,n){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,n?Math.floor(t/n):i)}}isAttached(e){return!0}updateConfig(e){}}class vn extends yn{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const xn="$chartjs",bn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},wn=e=>null===e||""===e,Sn=!!si&&{passive:!0};function Tn(e,t,i){e&&e.canvas&&e.canvas.removeEventListener(t,i,Sn)}function kn(e,t){for(const i of e)if(i===t||i.contains(t))return!0}function Mn(e,t,i){const n=e.canvas,r=new MutationObserver(e=>{let t=!1;for(const i of e)t=t||kn(i.addedNodes,n),t=t&&!kn(i.removedNodes,n);t&&i()});return r.observe(document,{childList:!0,subtree:!0}),r}function An(e,t,i){const n=e.canvas,r=new MutationObserver(e=>{let t=!1;for(const i of e)t=t||kn(i.removedNodes,n),t=t&&!kn(i.addedNodes,n);t&&i()});return r.observe(document,{childList:!0,subtree:!0}),r}const Cn=new Map;let Dn=0;function Ln(){const e=window.devicePixelRatio;e!==Dn&&(Dn=e,Cn.forEach((t,i)=>{i.currentDevicePixelRatio!==e&&t()}))}function En(e,t,i){const n=e.canvas,r=n&&Jt(n);if(!r)return;const s=Re((e,t)=>{const n=r.clientWidth;i(e,t),n<r.clientWidth&&i()},window),o=new ResizeObserver(e=>{const t=e[0],i=t.contentRect.width,n=t.contentRect.height;0===i&&0===n||s(i,n)});return o.observe(r),function(e,t){Cn.size||window.addEventListener("resize",Ln),Cn.set(e,t)}(e,s),o}function In(e,t,i){i&&i.disconnect(),"resize"===t&&function(e){Cn.delete(e),Cn.size||window.removeEventListener("resize",Ln)}(e)}function Pn(e,t,i){const n=e.canvas,r=Re(t=>{null!==e.ctx&&i(function(e,t){const i=bn[e.type]||e.type,{x:n,y:r}=ii(e,t);return{type:i,chart:t,native:e,x:void 0!==n?n:null,y:void 0!==r?r:null}}(t,e))},e);return function(e,t,i){e&&e.addEventListener(t,i,Sn)}(n,t,r),r}class Rn extends yn{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(function(e,t){const i=e.style,n=e.getAttribute("height"),r=e.getAttribute("width");if(e[xn]={initial:{height:n,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",wn(r)){const t=oi(e,"width");void 0!==t&&(e.width=t)}if(wn(n))if(""===e.style.height)e.height=e.width/(t||2);else{const t=oi(e,"height");void 0!==t&&(e.height=t)}}(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[xn])return!1;const i=t[xn].initial;["height","width"].forEach(e=>{const n=i[e];O(n)?t.removeAttribute(e):t.setAttribute(e,n)});const n=i.style||{};return Object.keys(n).forEach(e=>{t.style[e]=n[e]}),t.width=t.width,delete t[xn],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const n=e.$proxies||(e.$proxies={}),r={attach:Mn,detach:An,resize:En}[t]||Pn;n[t]=r(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),n=i[t];n&&(({attach:In,detach:In,resize:In}[t]||Tn)(e,t,n),i[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,n){return function(e,t,i,n){const r=Qt(e),s=ti(r,"margin"),o=Kt(r.maxWidth,e,"clientWidth")||oe,a=Kt(r.maxHeight,e,"clientHeight")||oe,l=function(e,t,i){let n,r;if(void 0===t||void 0===i){const s=e&&Jt(e);if(s){const e=s.getBoundingClientRect(),o=Qt(s),a=ti(o,"border","width"),l=ti(o,"padding");t=e.width-l.width-a.width,i=e.height-l.height-a.height,n=Kt(o.maxWidth,s,"clientWidth"),r=Kt(o.maxHeight,s,"clientHeight")}else t=e.clientWidth,i=e.clientHeight}return{width:t,height:i,maxWidth:n||oe,maxHeight:r||oe}}(e,t,i);let{width:c,height:h}=l;if("content-box"===r.boxSizing){const e=ti(r,"border","width"),t=ti(r,"padding");c-=t.width+e.width,h-=t.height+e.height}return c=Math.max(0,c-s.width),h=Math.max(0,n?c/n:h-s.height),c=ni(Math.min(c,o,l.maxWidth)),h=ni(Math.min(h,a,l.maxHeight)),c&&!h&&(h=ni(c/2)),(void 0!==t||void 0!==i)&&n&&l.height&&h>l.height&&(h=l.height,c=ni(Math.floor(h*n))),{width:c,height:h}}(e,t,i,n)}isAttached(e){const t=e&&Jt(e);return!(!t||!t.isConnected)}}class On{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return me(this.x)&&me(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const n={};return e.forEach(e=>{n[e]=i[e]&&i[e].active()?i[e]._to:this[e]}),n}}function zn(e,t,i,n,r){const s=B(n,0),o=Math.min(B(r,e.length),e.length);let a,l,c,h=0;for(i=Math.ceil(i),r&&(a=r-n,i=a/Math.floor(a/i)),c=s;c<0;)h++,c=Math.round(s+h*i);for(l=Math.max(s,0);l<o;l++)l===c&&(t.push(e[l]),h++,c=Math.round(s+h*i))}const Fn=(e,t,i)=>"top"===t||"left"===t?e[t]+i:e[t]-i,Nn=(e,t)=>Math.min(t||e,e);function Yn(e,t){const i=[],n=e.length/t,r=e.length;let s=0;for(;s<r;s+=n)i.push(e[Math.floor(s)]);return i}function Bn(e,t,i){const n=e.ticks.length,r=Math.min(t,n-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l,c=e.getPixelForTick(r);if(!(i&&(l=1===n?Math.max(c-s,o-c):0===t?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(r-1))/2,c+=r<t?l:-l,c<s-a||c>o+a)))return c}function Hn(e){return e.drawTicks?e.tickLength:0}function jn(e,t){if(!e.display)return 0;const i=At(e.font,t),n=Mt(e.padding);return(z(e.text)?e.text.length:1)*i.lineHeight+n.height}function Vn(e,t,i){let n=Oe(e);return(i&&"right"!==t||!i&&"right"===t)&&(n=(e=>"left"===e?"right":"right"===e?"left":e)(n)),n}class Wn extends On{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:n}=this;return e=Y(e,Number.POSITIVE_INFINITY),t=Y(t,Number.NEGATIVE_INFINITY),i=Y(i,Number.POSITIVE_INFINITY),n=Y(n,Number.NEGATIVE_INFINITY),{min:Y(e,i),max:Y(t,n),minDefined:N(e),maxDefined:N(t)}}getMinMax(e){let t,{min:i,max:n,minDefined:r,maxDefined:s}=this.getUserBounds();if(r&&s)return{min:i,max:n};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;a<l;++a)t=o[a].controller.getMinMax(this,e),r||(i=Math.min(i,t.min)),s||(n=Math.max(n,t.max));return i=s&&i>n?n:i,n=r&&i>n?i:n,{min:Y(i,Y(n,i)),max:Y(n,Y(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){j(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:n,grace:r,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(e,t,i){const{min:n,max:r}=e,s=H(t,(r-n)/2),o=(e,t)=>i&&0===e?0:e+t;return{min:o(n,-Math.abs(s)),max:o(r,s)}}(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=o<this.ticks.length;this._convertTicksToLabels(a?Yn(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||"auto"===s.source)&&(this.ticks=function(e,t){const i=e.options.ticks,n=function(e){const t=e.options.offset,i=e._tickSize(),n=e._length/i+(t?0:1),r=e._maxLength/i;return Math.floor(Math.min(n,r))}(e),r=Math.min(i.maxTicksLimit||n,n),s=i.major.enabled?function(e){const t=[];let i,n;for(i=0,n=e.length;i<n;i++)e[i].major&&t.push(i);return t}(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>r)return function(e,t,i,n){let r,s=0,o=i[0];for(n=Math.ceil(n),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=i[s*n])}(t,c,s,o/r),c;const h=function(e,t,i){const n=function(e){const t=e.length;let i,n;if(t<2)return!1;for(n=e[0],i=1;i<t;++i)if(e[i]-e[i-1]!==n)return!1;return n}(e),r=t.length/i;if(!n)return Math.max(r,1);const s=function(e){const t=[],i=Math.sqrt(e);let n;for(n=1;n<i;n++)e%n===0&&(t.push(n),t.push(e/n));return i===(0|i)&&t.push(i),t.sort((e,t)=>e-t).pop(),t}(n);for(let e=0,t=s.length-1;e<t;e++){const t=s[e];if(t>r)return t}return Math.max(r,1)}(s,t,r);if(o>0){let e,i;const n=o>1?Math.round((l-a)/(o-1)):null;for(zn(t,c,h,O(n)?0:a-n,a),e=0,i=o-1;e<i;e++)zn(t,c,h,s[e],s[e+1]);return zn(t,c,h,l,O(n)?t.length:l+n),c}return zn(t,c,h),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,i=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,i=!i),this._startPixel=e,this._endPixel=t,this._reversePixels=i,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){j(this.options.afterUpdate,[this])}beforeSetDimensions(){j(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(){j(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),j(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){j(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,n,r;for(i=0,n=e.length;i<n;i++)r=e[i],r.label=j(t.callback,[r.value,i,e],this)}afterTickToLabelConversion(){j(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){j(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=Nn(this.ticks.length,e.ticks.maxTicksLimit),n=t.minRotation||0,r=t.maxRotation;let s,o,a,l=n;if(!this._isVisible()||!t.display||n>=r||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=ke(this.chart.width-h,0,this.maxWidth);s=e.offset?this.maxWidth/i:u/(i-1),h+6>s&&(s=u/(i-(e.offset?.5:1)),o=this.maxHeight-Hn(e.grid)-t.padding-jn(e.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=ye(Math.min(Math.asin(ke((c.highest.height+6)/s,-1,1)),Math.asin(ke(o/a,-1,1))-Math.asin(ke(d/a,-1,1)))),l=Math.max(n,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){j(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){j(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:n,grid:r}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const s=jn(n,t.options.font);if(o?(e.width=this.maxWidth,e.height=Hn(r)+s):(e.height=this.maxHeight,e.width=Hn(r)+s),i.display&&this.ticks.length){const{first:t,last:n,widest:r,highest:s}=this._getLabelSizes(),a=2*i.padding,l=_e(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(o){const t=i.mirror?0:h*r.width+c*s.height;e.height=Math.min(this.maxHeight,e.height+t+a)}else{const t=i.mirror?0:c*r.width+h*s.height;e.width=Math.min(this.maxWidth,e.width+t+a)}this._calculatePadding(t,n,h,c)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,n){const{ticks:{align:r,padding:s},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*e.width,d=i*t.height):(h=i*e.height,d=n*t.width):"start"===r?d=t.width:"end"===r?h=e.width:"inner"!==r&&(h=e.width/2,d=t.width/2),this.paddingLeft=Math.max((h-o+s)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-c+s)*this.width/(this.width-c),0)}else{let i=t.height/2,n=e.height/2;"start"===r?(i=0,n=e.height):"end"===r&&(i=t.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_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(){j(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,i=e.length;t<i;t++)O(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=Yn(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,i){const{ctx:n,_longestTextCache:r}=this,s=[],o=[],a=Math.floor(t/Nn(t,i));let l,c,h,d,u,f,p,m,g,_,y,v=0,x=0;for(l=0;l<t;l+=a){if(d=e[l].label,u=this._resolveTickFontOptions(l),n.font=f=u.string,p=r[f]=r[f]||{data:{},gc:[]},m=u.lineHeight,g=_=0,O(d)||z(d)){if(z(d))for(c=0,h=d.length;c<h;++c)y=d[c],O(y)||z(y)||(g=rt(n,p.data,p.gc,g,y),_+=m)}else g=rt(n,p.data,p.gc,g,d),_=m;s.push(g),o.push(_),v=Math.max(g,v),x=Math.max(_,x)}!function(e,t){V(e,e=>{const i=e.gc,n=i.length/2;let r;if(n>t){for(r=0;r<n;++r)delete e.data[i[r]];i.splice(0,n)}})}(r,t);const b=s.indexOf(v),w=o.indexOf(x),S=e=>({width:s[e]||0,height:o[e]||0});return{first:S(0),last:S(t-1),widest:S(b),highest:S(w),widths:s,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return ke(this._alignToPixels?ot(this.chart,t,0):t,-32768,32767)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const i=t[e];return i.$context||(i.$context=function(e,t,i){return Dt(e,{tick:i,index:t,type:"tick"})}(this.getContext(),e,i))}return this.$context||(this.$context=function(e,t){return Dt(e,{scale:t,type:"scale"})}(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=_e(this.labelRotation),i=Math.abs(Math.cos(t)),n=Math.abs(Math.sin(t)),r=this._getLabelSizes(),s=e.autoSkipPadding||0,o=r?r.widest.width+s:0,a=r?r.highest.height+s:0;return this.isHorizontal()?a*i>o*n?o/i:a/n:a*n<o*i?a/i:o/n}_isVisible(){const e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,n=this.options,{grid:r,position:s,border:o}=n,a=r.offset,l=this.isHorizontal(),c=this.ticks.length+(a?1:0),h=Hn(r),d=[],u=o.setContext(this.getContext()),f=u.display?u.width:0,p=f/2,m=function(e){return ot(i,e,f)};let g,_,y,v,x,b,w,S,T,k,M,A;if("top"===s)g=m(this.bottom),b=this.bottom-h,S=g-p,k=m(e.top)+p,A=e.bottom;else if("bottom"===s)g=m(this.top),k=e.top,A=m(e.bottom)-p,b=g+p,S=this.top+h;else if("left"===s)g=m(this.right),x=this.right-h,w=g-p,T=m(e.left)+p,M=e.right;else if("right"===s)g=m(this.left),T=e.left,M=m(e.right)-p,x=g+p,w=this.left+h;else if("x"===t){if("center"===s)g=m((e.top+e.bottom)/2+.5);else if(F(s)){const e=Object.keys(s)[0],t=s[e];g=m(this.chart.scales[e].getPixelForValue(t))}k=e.top,A=e.bottom,b=g+p,S=b+h}else if("y"===t){if("center"===s)g=m((e.left+e.right)/2);else if(F(s)){const e=Object.keys(s)[0],t=s[e];g=m(this.chart.scales[e].getPixelForValue(t))}x=g-p,w=x-h,T=e.left,M=e.right}const C=B(n.ticks.maxTicksLimit,c),D=Math.max(1,Math.ceil(c/C));for(_=0;_<c;_+=D){const e=this.getContext(_),t=r.setContext(e),n=o.setContext(e),s=t.lineWidth,c=t.color,h=n.dash||[],u=n.dashOffset,f=t.tickWidth,p=t.tickColor,m=t.tickBorderDash||[],g=t.tickBorderDashOffset;y=Bn(this,_,a),void 0!==y&&(v=ot(i,y,s),l?x=w=T=M=v:b=S=k=A=v,d.push({tx1:x,ty1:b,tx2:w,ty2:S,x1:T,y1:k,x2:M,y2:A,width:s,color:c,borderDash:h,borderDashOffset:u,tickWidth:f,tickColor:p,tickBorderDash:m,tickBorderDashOffset:g}))}return this._ticksLength=c,this._borderValue=g,d}_computeLabelItems(e){const t=this.axis,i=this.options,{position:n,ticks:r}=i,s=this.isHorizontal(),o=this.ticks,{align:a,crossAlign:l,padding:c,mirror:h}=r,d=Hn(i.grid),u=d+c,f=h?-c:u,p=-_e(this.labelRotation),m=[];let g,_,y,v,x,b,w,S,T,k,M,A,C="middle";if("top"===n)b=this.bottom-f,w=this._getXAxisLabelAlignment();else if("bottom"===n)b=this.top+f,w=this._getXAxisLabelAlignment();else if("left"===n){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,x=e.x}else if("right"===n){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,x=e.x}else if("x"===t){if("center"===n)b=(e.top+e.bottom)/2+u;else if(F(n)){const e=Object.keys(n)[0],t=n[e];b=this.chart.scales[e].getPixelForValue(t)+u}w=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===n)x=(e.left+e.right)/2-u;else if(F(n)){const e=Object.keys(n)[0],t=n[e];x=this.chart.scales[e].getPixelForValue(t)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===t&&("start"===a?C="top":"end"===a&&(C="bottom"));const D=this._getLabelSizes();for(g=0,_=o.length;g<_;++g){y=o[g],v=y.label;const e=r.setContext(this.getContext(g));S=this.getPixelForTick(g)+r.labelOffset,T=this._resolveTickFontOptions(g),k=T.lineHeight,M=z(v)?v.length:1;const t=M/2,i=e.color,a=e.textStrokeColor,c=e.textStrokeWidth;let d,u=w;if(s?(x=S,"inner"===w&&(u=g===_-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),A="top"===n?"near"===l||0!==p?-M*k+k/2:"center"===l?-D.highest.height/2-t*k+k:-D.highest.height+k/2:"near"===l||0!==p?k/2:"center"===l?D.highest.height/2-t*k:D.highest.height-M*k,h&&(A*=-1),0===p||e.showLabelBackdrop||(x+=k/2*Math.sin(p))):(b=S,A=(1-M)*k/2),e.showLabelBackdrop){const t=Mt(e.backdropPadding),i=D.heights[g],n=D.widths[g];let r=A-t.top,s=0-t.left;switch(C){case"middle":r-=i/2;break;case"bottom":r-=i}switch(w){case"center":s-=n/2;break;case"right":s-=n;break;case"inner":g===_-1?s-=n:g>0&&(s-=n/2)}d={left:s,top:r,width:n+t.width,height:i+t.height,color:e.backdropColor}}m.push({label:v,font:T,textOffset:A,options:{rotation:p,color:i,strokeColor:a,strokeWidth:c,textAlign:u,textBaseline:C,translation:[x,b],backdrop:d}})}return m}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-_e(this.labelRotation))return"top"===e?"left":"right";let i="center";return"start"===t.align?i="left":"end"===t.align?i="right":"inner"===t.align&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:n,padding:r}}=this.options,s=e+r,o=this._getLabelSizes().widest.width;let a,l;return"left"===t?n?(l=this.right+r,"near"===i?a="left":"center"===i?(a="center",l+=o/2):(a="right",l+=o)):(l=this.right-s,"near"===i?a="right":"center"===i?(a="center",l-=o/2):(a="left",l=this.left)):"right"===t?n?(l=this.left+r,"near"===i?a="right":"center"===i?(a="center",l-=o/2):(a="left",l-=o)):(l=this.left+s,"near"===i?a="left":"center"===i?(a="center",l+=o/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:n,width:r,height:s}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,n,r,s),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const i=this.ticks.findIndex(t=>t.value===e);return i>=0?t.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let r,s;const o=(e,t,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(e.x,e.y),i.lineTo(t.x,t.y),i.stroke(),i.restore())};if(t.display)for(r=0,s=n.length;r<s;++r){const e=n[r];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:i,grid:n}}=this,r=i.setContext(this.getContext()),s=i.display?r.width:0;if(!s)return;const o=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,c,h,d;this.isHorizontal()?(l=ot(e,this.left,s)-s/2,c=ot(e,this.right,o)+o/2,h=d=a):(h=ot(e,this.top,s)-s/2,d=ot(e,this.bottom,o)+o/2,l=c=a),t.save(),t.lineWidth=r.width,t.strokeStyle=r.color,t.beginPath(),t.moveTo(l,h),t.lineTo(c,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const t=this.ctx,i=this._computeLabelArea();i&&dt(t,i);const n=this.getLabelItems(e);for(const e of n){const i=e.options,n=e.font;_t(t,e.label,0,e.textOffset,n,i)}i&&ut(t)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:n}}=this;if(!i.display)return;const r=At(i.font),s=Mt(i.padding),o=i.align;let a=r.lineHeight/2;"bottom"===t||"center"===t||F(t)?(a+=s.bottom,z(i.text)&&(a+=r.lineHeight*(i.text.length-1))):a+=s.top;const{titleX:l,titleY:c,maxWidth:h,rotation:d}=function(e,t,i,n){const{top:r,left:s,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:h}=l;let d,u,f,p=0;const m=o-r,g=a-s;if(e.isHorizontal()){if(u=ze(n,s,a),F(i)){const e=Object.keys(i)[0],n=i[e];f=h[e].getPixelForValue(n)+m-t}else f="center"===i?(c.bottom+c.top)/2+m-t:Fn(e,i,t);d=a-s}else{if(F(i)){const e=Object.keys(i)[0],n=i[e];u=h[e].getPixelForValue(n)-g+t}else u="center"===i?(c.left+c.right)/2-g+t:Fn(e,i,t);f=ze(n,o,r),p="left"===i?-le:le}return{titleX:u,titleY:f,maxWidth:d,rotation:p}}(this,a,t,o);_t(e,i.text,0,0,r,{color:i.color,maxWidth:h,rotation:d,textAlign:Vn(o,t,n),textBaseline:"middle",translation:[l,c]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=B(e.grid&&e.grid.z,-1),n=B(e.border&&e.border.z,0);return this._isVisible()&&this.draw===Wn.prototype.draw?[{z:i,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let r,s;for(r=0,s=t.length;r<s;++r){const s=t[r];s[i]!==this.id||e&&s.type!==e||n.push(s)}return n}_resolveTickFontOptions(e){return At(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Un{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;(function(e){return"id"in e&&"defaults"in e})(t)&&(i=this.register(t));const n=this.items,r=e.id,s=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+e);return r in n||(n[r]=e,function(e,t,i){const n=X(Object.create(null),[i?nt.get(i):{},nt.get(t),e.defaults]);nt.set(t,n),e.defaultRoutes&&function(e,t){Object.keys(t).forEach(i=>{const n=i.split("."),r=n.pop(),s=[e].concat(n).join("."),o=t[i].split("."),a=o.pop(),l=o.join(".");nt.route(s,r,l,a)})}(t,e.defaultRoutes),e.descriptors&&nt.describe(t,e.descriptors)}(e,s,i),this.override&&nt.override(e.id,e.overrides)),s}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,n=this.scope;i in t&&delete t[i],n&&i in nt[n]&&(delete nt[n][i],this.override&&delete Ke[i])}}class $n{constructor(){this.controllers=new Un(Ni,"datasets",!0),this.elements=new Un(On,"elements"),this.plugins=new Un(Object,"plugins"),this.scales=new Un(Wn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(t=>{const n=i||this._getRegistryForType(t);i||n.isForType(t)||n===this.plugins&&t.id?this._exec(e,n,t):V(t,t=>{const n=i||this._getRegistryForType(t);this._exec(e,n,t)})})}_exec(e,t,i){const n=Q(e);j(i["before"+n],[],i),t[e](i),j(i["after"+n],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const n=t.get(e);if(void 0===n)throw new Error('"'+e+'" is not a registered '+i+".");return n}}var Gn=new $n;class Xn{constructor(){this._init=[]}notify(e,t,i,n){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const r=n?this._descriptors(e).filter(n):this._descriptors(e),s=this._notify(r,e,t,i);return"afterDestroy"===t&&(this._notify(r,e,"stop"),this._notify(this._init,e,"uninstall")),s}_notify(e,t,i,n){n=n||{};for(const r of e){const e=r.plugin;if(!1===j(e[i],[t,n,r.options],e)&&n.cancelable)return!1}return!0}invalidate(){O(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,n=B(i.options&&i.options.plugins,{}),r=function(e){const t={},i=[],n=Object.keys(Gn.plugins.items);for(let e=0;e<n.length;e++)i.push(Gn.getPlugin(n[e]));const r=e.plugins||[];for(let e=0;e<r.length;e++){const n=r[e];-1===i.indexOf(n)&&(i.push(n),t[n.id]=!0)}return{plugins:i,localIds:t}}(i);return!1!==n||t?function(e,{plugins:t,localIds:i},n,r){const s=[],o=e.getContext();for(const a of t){const t=a.id,l=qn(n[t],r);null!==l&&s.push({plugin:a,options:Zn(e.config,{plugin:a,local:i[t]},l,o)})}return s}(e,r,n,t):[]}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,n=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(n(t,i),e,"stop"),this._notify(n(i,t),e,"start")}}function qn(e,t){return t||!1!==e?!0===e?{}:e:null}function Zn(e,{plugin:t,local:i},n,r){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(n,s);return i&&t.defaults&&o.push(t.defaults),e.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Jn(e,t){const i=nt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||i.indexAxis||"x"}function Kn(e){if("x"===e||"y"===e||"r"===e)return e}function Qn(e){return"top"===e||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0}function er(e,...t){if(Kn(e))return e;for(const i of t){const t=i.axis||Qn(i.position)||e.length>1&&Kn(e[0].toLowerCase());if(t)return t}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function tr(e,t,i){if(i[t+"AxisID"]===e)return{axis:t}}function ir(e){const t=e.options||(e.options={});t.plugins=B(t.plugins,{}),t.scales=function(e,t){const i=Ke[e.type]||{scales:{}},n=t.scales||{},r=Jn(e.type,t),s=Object.create(null);return Object.keys(n).forEach(t=>{const o=n[t];if(!F(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const a=er(t,o,function(e,t){if(t.data&&t.data.datasets){const i=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(i.length)return tr(e,"x",i[0])||tr(e,"y",i[0])}return{}}(t,e),nt.scales[o.type]),l=function(e,t){return e===t?"_index_":"_value_"}(a,r),c=i.scales||{};s[t]=q(Object.create(null),[{axis:a},o,c[a],c[l]])}),e.data.datasets.forEach(i=>{const r=i.type||e.type,o=i.indexAxis||Jn(r,t),a=(Ke[r]||{}).scales||{};Object.keys(a).forEach(e=>{const t=function(e,t){let i=e;return"_index_"===e?i=t:"_value_"===e&&(i="x"===t?"y":"x"),i}(e,o),r=i[t+"AxisID"]||t;s[r]=s[r]||Object.create(null),q(s[r],[{axis:t},n[r],a[e]])})}),Object.keys(s).forEach(e=>{const t=s[e];q(t,[nt.scales[t.type],nt.scale])}),s}(e,t)}function nr(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}const rr=new Map,sr=new Set;function or(e,t){let i=rr.get(e);return i||(i=t(),rr.set(e,i),sr.add(i)),i}const ar=(e,t,i)=>{const n=K(t,i);void 0!==n&&e.add(n)};class lr{constructor(e){this._config=function(e){return(e=e||{}).data=nr(e.data),ir(e),e}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=nr(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),ir(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return or(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return or(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return or(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id;return or(`${this.type}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let n=i.get(e);return n&&!t||(n=new Map,i.set(e,n)),n}getOptionScopes(e,t,i){const{options:n,type:r}=this,s=this._cachedScopes(e,i),o=s.get(t);if(o)return o;const a=new Set;t.forEach(t=>{e&&(a.add(e),t.forEach(t=>ar(a,e,t))),t.forEach(e=>ar(a,n,e)),t.forEach(e=>ar(a,Ke[r]||{},e)),t.forEach(e=>ar(a,nt,e)),t.forEach(e=>ar(a,Qe,e))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),sr.has(t)&&s.set(t,l),l}chartOptionScopes(){const{options:e,type:t}=this;return[e,Ke[t]||{},nt.datasets[t]||{},{type:t},nt,Qe]}resolveNamedOptions(e,t,i,n=[""]){const r={$shared:!0},{resolver:s,subPrefixes:o}=cr(this._resolverCache,e,n);let a=s;(function(e,t){const{isScriptable:i,isIndexable:n}=It(e);for(const r of t){const t=i(r),s=n(r),o=(s||t)&&e[r];if(t&&(te(o)||hr(o))||s&&z(o))return!0}return!1})(s,t)&&(r.$shared=!1,a=Et(s,i=te(i)?i():i,this.createResolver(e,i,o)));for(const e of t)r[e]=a[e];return r}createResolver(e,t,i=[""],n){const{resolver:r}=cr(this._resolverCache,e,i);return F(t)?Et(r,t,void 0,n):r}}function cr(e,t,i){let n=e.get(t);n||(n=new Map,e.set(t,n));const r=i.join();let s=n.get(r);return s||(s={resolver:Lt(t,i),subPrefixes:i.filter(e=>!e.toLowerCase().includes("hover"))},n.set(r,s)),s}const hr=e=>F(e)&&Object.getOwnPropertyNames(e).some(t=>te(e[t])),dr=["top","bottom","left","right","chartArea"];function ur(e,t){return"top"===e||"bottom"===e||-1===dr.indexOf(e)&&"x"===t}function fr(e,t){return function(i,n){return i[e]===n[e]?i[t]-n[t]:i[e]-n[e]}}function pr(e){const t=e.chart,i=t.options.animation;t.notifyPlugins("afterRender"),j(i&&i.onComplete,[e],t)}function mr(e){const t=e.chart,i=t.options.animation;j(i&&i.onProgress,[e],t)}function gr(e){return Zt()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const _r={},yr=e=>{const t=gr(e);return Object.values(_r).filter(e=>e.canvas===t).pop()};function vr(e,t,i){const n=Object.keys(e);for(const r of n){const n=+r;if(n>=t){const s=e[r];delete e[r],(i>0||n>t)&&(e[n+i]=s)}}}class xr{static defaults=nt;static instances=_r;static overrides=Ke;static registry=Gn;static version="4.5.0";static getChart=yr;static register(...e){Gn.add(...e),br()}static unregister(...e){Gn.remove(...e),br()}constructor(e,t){const i=this.config=new lr(t),n=gr(e),r=yr(n);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(e){return!Zt()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?vn:Rn}(n)),this.platform.updateConfig(i);const o=this.platform.acquireContext(n,s.aspectRatio),a=o&&o.canvas,l=a&&a.height,c=a&&a.width;this.id=R(),this.ctx=o,this.canvas=a,this.width=c,this.height=l,this._options=s,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 Xn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(e,t){let i;return function(...n){return t?(clearTimeout(i),i=setTimeout(e,t,n)):e.apply(this,n),t}}(e=>this.update(e),s.resizeDelay||0),this._dataChanges=[],_r[this.id]=this,o&&a?(wi.listen(this,"complete",pr),wi.listen(this,"progress",mr),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:e,maintainAspectRatio:t},width:i,height:n,_aspectRatio:r}=this;return O(e)?t&&r?r:n?i/n:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Gn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ri(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return at(this.canvas,this.ctx),this}stop(){return wi.stop(this),this}resize(e,t){wi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,e,t,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,ri(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),j(i.onResize,[this,s],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){V(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,n=Object.keys(i).reduce((e,t)=>(e[t]=!1,e),{});let r=[];t&&(r=r.concat(Object.keys(t).map(e=>{const i=t[e],n=er(e,i),r="r"===n,s="x"===n;return{options:i,dposition:r?"chartArea":s?"bottom":"left",dtype:r?"radialLinear":s?"category":"linear"}}))),V(r,t=>{const r=t.options,s=r.id,o=er(s,r),a=B(r.type,t.dtype);void 0!==r.position&&ur(r.position,o)===ur(t.dposition)||(r.position=t.dposition),n[s]=!0;let l=null;s in i&&i[s].type===a?l=i[s]:(l=new(Gn.getScale(a))({id:s,type:a,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(r,e)}),V(n,(e,t)=>{e||delete i[t]}),V(i,e=>{_n.configure(this,e,e.options),_n.addBox(this,e)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((e,t)=>e.index-t.index),i>t){for(let e=t;e<i;++e)this._destroyDatasetMeta(e);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(fr("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,i)=>{0===t.filter(t=>t===e._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=t.length;i<n;i++){const n=t[i];let r=this.getDatasetMeta(i);const s=n.type||this.config.type;if(r.type&&r.type!==s&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=s,r.indexAxis=n.indexAxis||Jn(s,this.options),r.order=n.order||0,r.index=i,r.label=""+n.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const t=Gn.getController(s),{datasetElementType:n,dataElementType:o}=nt.datasets[s];Object.assign(t,{dataElementType:Gn.getElement(o),datasetElementType:n&&Gn.getElement(n)}),r.controller=new t(this,i),e.push(r.controller)}}return this._updateMetasets(),e}_resetElements(){V(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let e=0,t=this.data.datasets.length;e<t;e++){const{controller:t}=this.getDatasetMeta(e),i=!n&&-1===r.indexOf(t);t.buildOrUpdateElements(i),s=Math.max(+t.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),n||V(r,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(fr("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){V(this.scales,e=>{_n.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);ie(t,i)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:r}of t)vr(e,n,"_removeElements"===i?-r:r)}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+","+e.splice(1).join(","))),n=i(0);for(let e=1;e<t;e++)if(!ie(n,i(e)))return;return Array.from(n).map(e=>e.split(",")).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;_n.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],V(this.boxes,e=>{i&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,te(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),n={meta:i,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(t),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(wi.has(this)?this.attached&&!wi.running(this)&&wi.start(this):(this.draw(),pr({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let n,r;for(n=0,r=t.length;n<r;++n){const r=t[n];e&&!r.visible||i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i={meta:e,index:e.index,cancelable:!0},n=xi(this,e);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&dt(t,n),e.controller.draw(),n&&ut(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(e){return ht(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,n){const r=sn.modes[t];return"function"==typeof r?r(this,e,i,n):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let n=i.filter(e=>e&&e._dataset===t).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Dt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return"boolean"==typeof i.hidden?!i.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const n=i?"show":"hide",r=this.getDatasetMeta(e),s=r.controller._resolveAnimations(void 0,n);ee(t)?(r.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),s.update(r,{visible:i}),this.update(t=>t.datasetIndex===e?n:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),wi.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),at(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete _r[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(i,n)=>{t.addEventListener(this,i,n),e[i]=n},n=(e,t,i)=>{e.offsetX=t,e.offsetY=i,this._eventHandler(e)};V(this.options.events,e=>i(e,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(i,n)=>{t.addEventListener(this,i,n),e[i]=n},n=(i,n)=>{e[i]&&(t.removeEventListener(this,i,n),delete e[i])},r=(e,t)=>{this.canvas&&this.resize(e,t)};let s;const o=()=>{n("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",s)};s=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),i("attach",o)},t.isAttached(this.canvas)?o():s()}unbindEvents(){V(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},V(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const n=i?"set":"remove";let r,s,o,a;for("dataset"===t&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),o=0,a=e.length;o<a;++o){s=e[o];const t=s&&this.getDatasetMeta(s.datasetIndex).controller;t&&t[n+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:e,index:t})=>{const i=this.getDatasetMeta(e);if(!i)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:i.data[t],index:t}});!W(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return 1===this._plugins._cache.filter(t=>t.plugin.id===e).length}_updateHoverStyles(e,t,i){const n=this.options.hover,r=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),s=r(t,e),o=i?e:r(e,t);s.length&&this.updateHoverStyle(s,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},n=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const r=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:n=[],options:r}=this,s=t,o=this._getActiveElements(e,n,i,s),a=function(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}(e),l=function(e,t,i,n){return i&&"mouseout"!==e.type?n?t:e:null}(e,this._lastEvent,i,a);i&&(this._lastEvent=null,j(r.onHover,[e,o,this],this),a&&j(r.onClick,[e,o,this],this));const c=!W(o,n);return(c||t)&&(this._active=o,this._updateHoverStyles(o,n,t)),this._lastEvent=l,c}_getActiveElements(e,t,i,n){if("mouseout"===e.type)return[];if(!i)return t;const r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,n)}}function br(){return V(xr.instances,e=>e._plugins.invalidate())}function wr(e,t,i,n){return{x:i+e*Math.cos(t),y:n+e*Math.sin(t)}}function Sr(e,t,i,n,r,s){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+n+i-c,0),u=h>0?h+n+i+c:0;let f=0;const p=r-l;if(n){const e=((h>0?h-n:0)+(d>0?d-n:0))/2;f=(p-(0!==e?p*e/(e+n):p))/2}const m=(p-Math.max(.001,p*d-i/ne)/d)/2,g=l+m+f,_=r-m-f,{outerStart:y,outerEnd:v,innerStart:x,innerEnd:b}=function(e,t,i,n){const r=St(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),s=(i-t)/2,o=Math.min(s,n*t/2),a=e=>{const t=(i-Math.min(s,e))*n/2;return ke(e,0,Math.min(s,t))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:ke(r.innerStart,0,o),innerEnd:ke(r.innerEnd,0,o)}}(t,u,d,_-g),w=d-y,S=d-v,T=g+y/w,k=_-v/S,M=u+x,A=u+b,C=g+x/M,D=_-b/A;if(e.beginPath(),s){const t=(T+k)/2;if(e.arc(o,a,d,T,t),e.arc(o,a,d,t,k),v>0){const t=wr(S,k,o,a);e.arc(t.x,t.y,v,k,_+le)}const i=wr(A,_,o,a);if(e.lineTo(i.x,i.y),b>0){const t=wr(A,D,o,a);e.arc(t.x,t.y,b,_+le,D+Math.PI)}const n=(_-b/u+(g+x/u))/2;if(e.arc(o,a,u,_-b/u,n,!0),e.arc(o,a,u,n,g+x/u,!0),x>0){const t=wr(M,C,o,a);e.arc(t.x,t.y,x,C+Math.PI,g-le)}const r=wr(w,g,o,a);if(e.lineTo(r.x,r.y),y>0){const t=wr(w,T,o,a);e.arc(t.x,t.y,y,g-le,T)}}else{e.moveTo(o,a);const t=Math.cos(T)*d+o,i=Math.sin(T)*d+a;e.lineTo(t,i);const n=Math.cos(k)*d+o,r=Math.sin(k)*d+a;e.lineTo(n,r)}e.closePath()}function Tr(e,t,i=t){e.lineCap=B(i.borderCapStyle,t.borderCapStyle),e.setLineDash(B(i.borderDash,t.borderDash)),e.lineDashOffset=B(i.borderDashOffset,t.borderDashOffset),e.lineJoin=B(i.borderJoinStyle,t.borderJoinStyle),e.lineWidth=B(i.borderWidth,t.borderWidth),e.strokeStyle=B(i.borderColor,t.borderColor)}function kr(e,t,i){e.lineTo(i.x,i.y)}function Mr(e,t,i={}){const n=e.length,{start:r=0,end:s=n-1}=i,{start:o,end:a}=t,l=Math.max(r,o),c=Math.min(s,a),h=r<o&&s<o||r>a&&s>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function Ar(e,t,i,n){const{points:r,options:s}=t,{count:o,start:a,loop:l,ilen:c}=Mr(r,i,n),h=function(e){return e.stepped?ft:e.tension||"monotone"===e.cubicInterpolationMode?pt:kr}(s);let d,u,f,{move:p=!0,reverse:m}=n||{};for(d=0;d<=c;++d)u=r[(a+(m?c-d:d))%o],u.skip||(p?(e.moveTo(u.x,u.y),p=!1):h(e,f,u,m,s.stepped),f=u);return l&&(u=r[(a+(m?c:0))%o],h(e,f,u,m,s.stepped)),!!l}function Cr(e,t,i,n){const r=t.points,{count:s,start:o,ilen:a}=Mr(r,i,n),{move:l=!0,reverse:c}=n||{};let h,d,u,f,p,m,g=0,_=0;const y=e=>(o+(c?a-e:e))%s,v=()=>{f!==p&&(e.lineTo(g,p),e.lineTo(g,f),e.lineTo(g,m))};for(l&&(d=r[y(0)],e.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=r[y(h)],d.skip)continue;const t=d.x,i=d.y,n=0|t;n===u?(i<f?f=i:i>p&&(p=i),g=(_*g+t)/++_):(v(),e.lineTo(t,i),u=n,_=0,f=p=i),m=i}v()}function Dr(e){const t=e.options,i=t.borderDash&&t.borderDash.length;return e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||i?Ar:Cr}const Lr="function"==typeof Path2D;class Er extends On{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:e=>"borderDash"!==e&&"fill"!==e};constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;qt(this._points,i,e,n,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(e,t){const i=e.points,n=e.options.spanGaps,r=i.length;if(!r)return[];const s=!!e._loop,{start:o,end:a}=function(e,t,i,n){let r=0,s=t-1;if(i&&!n)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,i&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}(i,r,s,n);return function(e,t,i,n){return n&&n.setContext&&i?function(e,t,i,n){const r=e._chart.getContext(),s=_i(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,l=i.length,c=[];let h=s,d=t[0].start,u=d;function f(e,t,n,r){const s=a?-1:1;if(e!==t){for(e+=l;i[e%l].skip;)e-=s;for(;i[t%l].skip;)t+=s;e%l!==t%l&&(c.push({start:e%l,end:t%l,loop:n,style:r}),h=r,d=t%l)}}for(const e of t){d=a?d:e.start;let t,s=i[d%l];for(u=d+1;u<=e.end;u++){const a=i[u%l];t=_i(n.setContext(Dt(r,{type:"segment",p0:s,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:o}))),yi(t,h)&&f(d,u-1,e.loop,h),s=a,h=t}d<u-1&&f(d,u-1,e.loop,h)}return c}(e,t,i,n):t}(e,!0===n?[{start:o,end:a,loop:s}]:function(e,t,i,n){const r=e.length,s=[];let o,a=t,l=e[t];for(o=t+1;o<=i;++o){const i=e[o%r];i.skip||i.stop?l.skip||(n=!1,s.push({start:t%r,end:(o-1)%r,loop:n}),t=a=i.stop?o:null):(a=o,l.skip&&(t=o)),l=i}return null!==a&&s.push({start:t%r,end:a%r,loop:n}),s}(i,o,a<o?a+r:a,!!e._fullLoop&&0===o&&a===r-1),i,t)}(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,n=e[t],r=this.points,s=gi(this,{property:t,start:n,end:n});if(!s.length)return;const o=[],a=function(e){return e.stepped?li:e.tension||"monotone"===e.cubicInterpolationMode?ci:ai}(i);let l,c;for(l=0,c=s.length;l<c;++l){const{start:c,end:h}=s[l],d=r[c],u=r[h];if(d===u){o.push(d);continue}const f=a(d,u,Math.abs((n-d[t])/(u[t]-d[t])),i.stepped);f[t]=e[t],o.push(f)}return 1===o.length?o[0]:o}pathSegment(e,t,i){return Dr(this)(e,this,t,i)}path(e,t,i){const n=this.segments,r=Dr(this);let s=this._loop;t=t||0,i=i||this.points.length-t;for(const o of n)s&=r(e,this,o,{start:t,end:t+i-1});return!!s}draw(e,t,i,n){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(e.save(),function(e,t,i,n){Lr&&!t.options.segment?function(e,t,i,n){let r=t._path;r||(r=t._path=new Path2D,t.path(r,i,n)&&r.closePath()),Tr(e,t.options),e.stroke(r)}(e,t,i,n):function(e,t,i,n){const{segments:r,options:s}=t,o=Dr(t);for(const a of r)Tr(e,s,a.style),e.beginPath(),o(e,t,a,{start:i,end:i+n-1})&&e.closePath(),e.stroke()}(e,t,i,n)}(e,this,i,n),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Ir(e,t,i,n){const r=e.options,{[i]:s}=e.getProps([i],n);return Math.abs(t-s)<r.radius+r.hitRadius}function Pr(e,t){const{x:i,y:n,base:r,width:s,height:o}=e.getProps(["x","y","base","width","height"],t);let a,l,c,h,d;return e.horizontal?(d=o/2,a=Math.min(i,r),l=Math.max(i,r),c=n-d,h=n+d):(d=s/2,a=i-d,l=i+d,c=Math.min(n,r),h=Math.max(n,r)),{left:a,top:c,right:l,bottom:h}}function Rr(e,t,i,n){return e?0:ke(t,i,n)}function Or(e,t,i,n){const r=null===t,s=null===i,o=e&&!(r&&s)&&Pr(e,n);return o&&(r||Me(t,o.left,o.right))&&(s||Me(i,o.top,o.bottom))}function zr(e,t){e.rect(t.x,t.y,t.w,t.h)}function Fr(e,t,i={}){const n=e.x!==i.x?-t:0,r=e.y!==i.y?-t:0,s=(e.x+e.w!==i.x+i.w?t:0)-n,o=(e.y+e.h!==i.y+i.h?t:0)-r;return{x:e.x+n,y:e.y+r,w:e.w+s,h:e.h+o,radius:e.radius}}var Nr=Object.freeze({__proto__:null,ArcElement:class extends On{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,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){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,e&&Object.assign(this,e)}inRange(e,t,i){const n=this.getProps(["x","y"],i),{angle:r,distance:s}=xe(n,{x:e,y:t}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=B(h,a-o),f=Te(r,o,a)&&o!==a,p=u>=re||f,m=Me(s,l+d,c+d);return p&&m}getCenterPoint(e){const{x:t,y:i,startAngle:n,endAngle:r,innerRadius:s,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:a,spacing:l}=this.options,c=(n+r)/2,h=(s+o+l+a)/2;return{x:t+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,n=(t.offset||0)/4,r=(t.spacing||0)/2,s=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=i>re?Math.floor(i/re):0,0===i||this.innerRadius<0||this.outerRadius<0)return;e.save();const o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*n,Math.sin(o)*n);const a=n*(1-Math.sin(Math.min(ne,i||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,function(e,t,i,n,r){const{fullCircles:s,startAngle:o,circumference:a}=t;let l=t.endAngle;if(s){Sr(e,t,i,n,l,r);for(let t=0;t<s;++t)e.fill();isNaN(a)||(l=o+(a%re||re))}Sr(e,t,i,n,l,r),e.fill()}(e,this,a,r,s),function(e,t,i,n,r){const{fullCircles:s,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p="inner"===l.borderAlign;if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=u,p?(e.lineWidth=2*c,e.lineJoin=h||"round"):(e.lineWidth=c,e.lineJoin=h||"bevel");let m=t.endAngle;if(s){Sr(e,t,i,n,m,r);for(let t=0;t<s;++t)e.stroke();isNaN(a)||(m=o+(a%re||re))}p&&function(e,t,i){const{startAngle:n,pixelMargin:r,x:s,y:o,outerRadius:a,innerRadius:l}=t;let c=r/a;e.beginPath(),e.arc(s,o,a,n-c,i+c),l>r?(c=r/l,e.arc(s,o,l,i+c,n-c,!0)):e.arc(s,o,r,i+le,n-le),e.closePath(),e.clip()}(e,t,m),l.selfJoin&&m-o>=ne&&0===f&&"miter"!==h&&function(e,t,i){const{startAngle:n,x:r,y:s,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/o,Se(n-i));if(e.beginPath(),e.arc(r,s,o-c/2,n+d/2,i-d/2),a>0){const t=Math.min(c/a,Se(n-i));e.arc(r,s,a+c/2,i-t/2,n+t/2,!0)}else{const t=Math.min(c/2,o*Se(n-i));if("round"===h)e.arc(r,s,t,i-ne/2,n+ne/2,!0);else if("bevel"===h){const o=2*t*t,a=-o*Math.cos(i+ne/2)+r,l=-o*Math.sin(i+ne/2)+s,c=o*Math.cos(n+ne/2)+r,h=o*Math.sin(n+ne/2)+s;e.lineTo(a,l),e.lineTo(c,h)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}(e,t,m),s||(Sr(e,t,i,n,m,r),e.stroke())}(e,this,a,r,s),e.restore()}},BarElement:class extends On{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){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,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:n}}=this,{inner:r,outer:s}=function(e){const t=Pr(e),i=t.right-t.left,n=t.bottom-t.top,r=function(e,t,i){const n=e.options.borderWidth,r=e.borderSkipped,s=Tt(n);return{t:Rr(r.top,s.top,0,i),r:Rr(r.right,s.right,0,t),b:Rr(r.bottom,s.bottom,0,i),l:Rr(r.left,s.left,0,t)}}(e,i/2,n/2),s=function(e,t,i){const{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=kt(r),o=Math.min(t,i),a=e.borderSkipped,l=n||F(r);return{topLeft:Rr(!l||a.top||a.left,s.topLeft,0,o),topRight:Rr(!l||a.top||a.right,s.topRight,0,o),bottomLeft:Rr(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:Rr(!l||a.bottom||a.right,s.bottomRight,0,o)}}(e,i/2,n/2);return{outer:{x:t.left,y:t.top,w:i,h:n,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:i-r.l-r.r,h:n-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}(this),o=(a=s.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?yt:zr;var a;e.save(),s.w===r.w&&s.h===r.h||(e.beginPath(),o(e,Fr(s,t,r)),e.clip(),o(e,Fr(r,-t,s)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),o(e,Fr(r,t)),e.fillStyle=n,e.fill(),e.restore()}inRange(e,t,i){return Or(this,e,t,i)}inXRange(e,t){return Or(this,e,null,t)}inYRange(e,t){return Or(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:n,horizontal:r}=this.getProps(["x","y","base","horizontal"],e);return{x:r?(t+n)/2:t,y:r?i:(i+n)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}},LineElement:Er,PointElement:class extends On{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(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,i){const n=this.options,{x:r,y:s}=this.getProps(["x","y"],i);return Math.pow(e-r,2)+Math.pow(t-s,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(e,t){return Ir(this,e,"x",t)}inYRange(e,t){return Ir(this,e,"y",t)}getCenterPoint(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}size(e){let t=(e=e||this.options||{}).radius||0;return t=Math.max(t,t&&e.hoverRadius||0),2*(t+(t&&e.borderWidth||0))}draw(e,t){const i=this.options;this.skip||i.radius<.1||!ht(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,lt(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}});const Yr=["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)"],Br=Yr.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Hr(e){return Yr[e%Yr.length]}function jr(e){return Br[e%Br.length]}function Vr(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}var Wr={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,i){if(!i.enabled)return;const{data:{datasets:n},options:r}=e.config,{elements:s}=r,o=Vr(n)||(a=r)&&(a.borderColor||a.backgroundColor)||s&&Vr(s)||"rgba(0,0,0,0.1)"!==nt.borderColor||"rgba(0,0,0,0.1)"!==nt.backgroundColor;var a;if(!i.forceOverride&&o)return;const l=function(e){let t=0;return(i,n)=>{const r=e.getDatasetMeta(n).controller;r instanceof Gi?t=function(e,t){return e.backgroundColor=e.data.map(()=>Hr(t++)),t}(i,t):r instanceof Xi?t=function(e,t){return e.backgroundColor=e.data.map(()=>jr(t++)),t}(i,t):r&&(t=function(e,t){return e.borderColor=Hr(t),e.backgroundColor=jr(t),++t}(i,t))}}(e);n.forEach(l)}};function Ur(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function $r(e){e.data.datasets.forEach(e=>{Ur(e)})}var Gr={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,i)=>{if(!i.enabled)return void $r(e);const n=e.width;e.data.datasets.forEach((t,r)=>{const{_data:s,indexAxis:o}=t,a=e.getDatasetMeta(r),l=s||t.data;if("y"===Ct([o,e.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const c=e.scales[a.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(e.options.parsing)return;let h,{start:d,count:u}=function(e,t){const i=t.length;let n,r=0;const{iScale:s}=e,{min:o,max:a,minDefined:l,maxDefined:c}=s.getUserBounds();return l&&(r=ke(Ce(t,s.axis,o).lo,0,i-1)),n=c?ke(Ce(t,s.axis,a).hi+1,r,i)-r:i-r,{start:r,count:n}}(a,l);if(u<=(i.threshold||4*n))Ur(t);else{switch(O(s)&&(t._data=l,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}})),i.algorithm){case"lttb":h=function(e,t,i,n,r){const s=r.samples||n;if(s>=i)return e.slice(t,t+i);const o=[],a=(i-2)/(s-2);let l=0;const c=t+i-1;let h,d,u,f,p,m=t;for(o[l++]=e[m],h=0;h<s-2;h++){let n,r=0,s=0;const c=Math.floor((h+1)*a)+1+t,g=Math.min(Math.floor((h+2)*a)+1,i)+t,_=g-c;for(n=c;n<g;n++)r+=e[n].x,s+=e[n].y;r/=_,s/=_;const y=Math.floor(h*a)+1+t,v=Math.min(Math.floor((h+1)*a)+1,i)+t,{x,y:b}=e[m];for(u=f=-1,n=y;n<v;n++)f=.5*Math.abs((x-r)*(e[n].y-b)-(x-e[n].x)*(s-b)),f>u&&(u=f,d=e[n],p=n);o[l++]=d,m=p}return o[l++]=e[c],o}(l,d,u,n,i);break;case"min-max":h=function(e,t,i,n){let r,s,o,a,l,c,h,d,u,f,p=0,m=0;const g=[],_=t+i-1,y=e[t].x,v=e[_].x-y;for(r=t;r<t+i;++r){s=e[r],o=(s.x-y)/v*n,a=s.y;const t=0|o;if(t===l)a<u?(u=a,c=r):a>f&&(f=a,h=r),p=(m*p+s.x)/++m;else{const i=r-1;if(!O(c)&&!O(h)){const t=Math.min(c,h),n=Math.max(c,h);t!==d&&t!==i&&g.push({...e[t],x:p}),n!==d&&n!==i&&g.push({...e[n],x:p})}r>0&&i!==d&&g.push(e[i]),g.push(s),l=t,m=0,u=f=a,c=h=d=r}}return g}(l,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}t._decimated=h}})},destroy(e){$r(e)}};function Xr(e,t,i,n){if(n)return;let r=t[e],s=i[e];return"angle"===e&&(r=Se(r),s=Se(s)),{property:e,start:r,end:s}}function qr(e,t,i){for(;t>e;t--){const e=i[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function Zr(e,t,i,n){return e&&t?n(e[i],t[i]):e?e[i]:t?t[i]:0}function Jr(e,t){let i=[],n=!1;return z(e)?(n=!0,i=e):i=function(e,t){const{x:i=null,y:n=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:e,end:t})=>{t=qr(e,t,r);const o=r[e],a=r[t];null!==n?(s.push({x:o.x,y:n}),s.push({x:a.x,y:n})):null!==i&&(s.push({x:i,y:o.y}),s.push({x:i,y:a.y}))}),s}(e,t),i.length?new Er({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Kr(e){return e&&!1!==e.fill}function Qr(e,t,i){let n=e[t].fill;const r=[t];let s;if(!i)return n;for(;!1!==n&&-1===r.indexOf(n);){if(!N(n))return n;if(s=e[n],!s)return!1;if(s.visible)return n;r.push(n),n=s.fill}return!1}function es(e,t,i){const n=function(e){const t=e.options,i=t.fill;let n=B(i&&i.target,i);return void 0===n&&(n=!!t.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(e);if(F(n))return!isNaN(n.value)&&n;let r=parseFloat(n);return N(r)&&Math.floor(r)===r?function(e,t,i,n){return"-"!==e&&"+"!==e||(i=t+i),!(i===t||i<0||i>=n)&&i}(n[0],t,r,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function ts(e,t,i){const n=[];for(let r=0;r<i.length;r++){const s=i[r],{first:o,last:a,point:l}=is(s,t,"x");if(!(!l||o&&a))if(o)n.unshift(l);else if(e.push(l),!a)break}e.push(...n)}function is(e,t,i){const n=e.interpolate(t,i);if(!n)return{};const r=n[i],s=e.segments,o=e.points;let a=!1,l=!1;for(let e=0;e<s.length;e++){const t=s[e],n=o[t.start][i],c=o[t.end][i];if(Me(r,n,c)){a=r===n,l=r===c;break}}return{first:a,last:l,point:n}}class ns{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:n,y:r,radius:s}=this;return t=t||{start:0,end:re},e.arc(n,r,s,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:n}=this,r=e.angle;return{x:t+Math.cos(r)*n,y:i+Math.sin(r)*n,angle:r}}}function rs(e,t,i){const n=function(e){const{chart:t,fill:i,line:n}=e;if(N(i))return function(e,t){const i=e.getDatasetMeta(t);return i&&e.isDatasetVisible(t)?i.dataset:null}(t,i);if("stack"===i)return function(e){const{scale:t,index:i,line:n}=e,r=[],s=n.segments,o=n.points,a=function(e,t){const i=[],n=e.getMatchingVisibleMetas("line");for(let e=0;e<n.length;e++){const r=n[e];if(r.index===t)break;r.hidden||i.unshift(r.dataset)}return i}(t,i);a.push(Jr({x:null,y:t.bottom},n));for(let e=0;e<s.length;e++){const t=s[e];for(let e=t.start;e<=t.end;e++)ts(r,o[e],a)}return new Er({points:r,options:{}})}(e);if("shape"===i)return!0;const r=function(e){return(e.scale||{}).getPointPositionForValue?function(e){const{scale:t,fill:i}=e,n=t.options,r=t.getLabels().length,s=n.reverse?t.max:t.min,o=function(e,t,i){let n;return n="start"===e?i:"end"===e?t.options.reverse?t.min:t.max:F(e)?e.value:t.getBaseValue(),n}(i,t,s),a=[];if(n.grid.circular){const e=t.getPointPositionForValue(0,s);return new ns({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(o)})}for(let e=0;e<r;++e)a.push(t.getPointPositionForValue(e,o));return a}(e):function(e){const{scale:t={},fill:i}=e,n=function(e,t){let i=null;return"start"===e?i=t.bottom:"end"===e?i=t.top:F(e)?i=t.getPixelForValue(e.value):t.getBasePixel&&(i=t.getBasePixel()),i}(i,t);if(N(n)){const e=t.isHorizontal();return{x:e?n:null,y:e?null:n}}return null}(e)}(e);return r instanceof ns?r:Jr(r,n)}(t),{chart:r,index:s,line:o,scale:a,axis:l}=t,c=o.options,h=c.fill,d=c.backgroundColor,{above:u=d,below:f=d}=h||{},p=r.getDatasetMeta(s),m=xi(r,p);n&&o.points.length&&(dt(e,i),function(e,t){const{line:i,target:n,above:r,below:s,area:o,scale:a,clip:l}=t,c=i._loop?"angle":t.axis;e.save();let h=s;s!==r&&("x"===c?(ss(e,n,o.top),as(e,{line:i,target:n,color:r,scale:a,property:c,clip:l}),e.restore(),e.save(),ss(e,n,o.bottom)):"y"===c&&(os(e,n,o.left),as(e,{line:i,target:n,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),os(e,n,o.right),h=r)),as(e,{line:i,target:n,color:h,scale:a,property:c,clip:l}),e.restore()}(e,{line:o,target:n,above:u,below:f,area:i,scale:a,axis:l,clip:m}),ut(e))}function ss(e,t,i){const{segments:n,points:r}=t;let s=!0,o=!1;e.beginPath();for(const a of n){const{start:n,end:l}=a,c=r[n],h=r[qr(n,l,r)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(c.x,i),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(h.x,i)}e.lineTo(t.first().x,i),e.closePath(),e.clip()}function os(e,t,i){const{segments:n,points:r}=t;let s=!0,o=!1;e.beginPath();for(const a of n){const{start:n,end:l}=a,c=r[n],h=r[qr(n,l,r)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(i,c.y),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(i,h.y)}e.lineTo(i,t.first().y),e.closePath(),e.clip()}function as(e,t){const{line:i,target:n,property:r,color:s,scale:o,clip:a}=t,l=function(e,t,i){const n=e.segments,r=e.points,s=t.points,o=[];for(const e of n){let{start:n,end:a}=e;a=qr(n,a,r);const l=Xr(i,r[n],r[a],e.loop);if(!t.segments){o.push({source:e,target:l,start:r[n],end:r[a]});continue}const c=gi(t,l);for(const t of c){const n=Xr(i,s[t.start],s[t.end],t.loop),a=mi(e,r,n);for(const e of a)o.push({source:e,target:t,start:{[i]:Zr(l,n,"start",Math.max)},end:{[i]:Zr(l,n,"end",Math.min)}})}}return o}(i,n,r);for(const{source:t,target:c,start:h,end:d}of l){const{style:{backgroundColor:l=s}={}}=t,u=!0!==n;e.save(),e.fillStyle=l,ls(e,o,a,u&&Xr(r,h,d)),e.beginPath();const f=!!i.pathSegment(e,t);let p;if(u){f?e.closePath():cs(e,n,d,r);const t=!!n.pathSegment(e,c,{move:f,reverse:!0});p=f&&t,p||cs(e,n,h,r)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function ls(e,t,i,n){const r=t.chart.chartArea,{property:s,start:o,end:a}=n||{};if("x"===s||"y"===s){let t,n,l,c;"x"===s?(t=o,n=r.top,l=a,c=r.bottom):(t=r.left,n=o,l=r.right,c=a),e.beginPath(),i&&(t=Math.max(t,i.left),l=Math.min(l,i.right),n=Math.max(n,i.top),c=Math.min(c,i.bottom)),e.rect(t,n,l-t,c-n),e.clip()}}function cs(e,t,i,n){const r=t.interpolate(i,n);r&&e.lineTo(r.x,r.y)}var hs={id:"filler",afterDatasetsUpdate(e,t,i){const n=(e.data.datasets||[]).length,r=[];let s,o,a,l;for(o=0;o<n;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Er&&(l={visible:e.isDatasetVisible(o),index:o,fill:es(a,o,n),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,r.push(l);for(o=0;o<n;++o)l=r[o],l&&!1!==l.fill&&(l.fill=Qr(r,o,i.propagate))},beforeDraw(e,t,i){const n="beforeDraw"===i.drawTime,r=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let t=r.length-1;t>=0;--t){const i=r[t].$filler;i&&(i.line.updateControlPoints(s,i.axis),n&&i.fill&&rs(e.ctx,i,s))}},beforeDatasetsDraw(e,t,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=e.getSortedVisibleDatasetMetas();for(let t=n.length-1;t>=0;--t){const i=n[t].$filler;Kr(i)&&rs(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,i){const n=t.meta.$filler;Kr(n)&&"beforeDatasetDraw"===i.drawTime&&rs(e.ctx,n,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ds=(e,t)=>{let{boxHeight:i=t,boxWidth:n=t}=e;return e.usePointStyle&&(i=Math.min(i,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(t,i)}};class us extends On{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t,i){this.maxWidth=e,this.maxHeight=t,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=j(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,i)=>e.sort(t,i,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const i=e.labels,n=At(i.font),r=n.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:a}=ds(i,r);let l,c;t.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(s,r,o,a)+10):(c=this.maxHeight,l=this._fitCols(s,n,o,a)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,t,i,n){const{ctx:r,maxWidth:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+o;let h=e;r.textAlign="left",r.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach((e,f)=>{const p=i+t/2+r.measureText(e.text).width;(0===f||l[l.length-1]+p+2*o>s)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),a[f]={left:0,top:u,row:d,width:p,height:n},l[l.length-1]+=p+o}),h}_fitCols(e,t,i,n){const{ctx:r,maxHeight:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=s-e;let h=o,d=0,u=0,f=0,p=0;return this.legendItems.forEach((e,s)=>{const{itemWidth:m,itemHeight:g}=function(e,t,i,n,r){const s=function(e,t,i,n){let r=e.text;return r&&"string"!=typeof r&&(r=r.reduce((e,t)=>e.length>t.length?e:t)),t+i.size/2+n.measureText(r).width}(n,e,t,i),o=function(e,t,i){let n=e;return"string"!=typeof t.text&&(n=fs(t,i)),n}(r,n,t.lineHeight);return{itemWidth:s,itemHeight:o}}(i,t,r,e,n);s>0&&u+g+2*o>c&&(h+=d+o,l.push({width:d,height:u}),f+=d+o,p++,d=u=0),a[s]={left:f,top:u,col:p,width:m,height:g},d=Math.max(d,m),u+=g+o}),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:i,labels:{padding:n},rtl:r}}=this,s=hi(r,this.left,this.width);if(this.isHorizontal()){let r=0,o=ze(i,this.left+n,this.right-this.lineWidths[r]);for(const a of t)r!==a.row&&(r=a.row,o=ze(i,this.left+n,this.right-this.lineWidths[r])),a.top+=this.top+e+n,a.left=s.leftForLtr(s.x(o),a.width),o+=a.width+n}else{let r=0,o=ze(i,this.top+e+n,this.bottom-this.columnSizes[r].height);for(const a of t)a.col!==r&&(r=a.col,o=ze(i,this.top+e+n,this.bottom-this.columnSizes[r].height)),a.top=o,a.left+=this.left+n,a.left=s.leftForLtr(s.x(a.left),a.width),o+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;dt(e,this),this._draw(),ut(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:i,ctx:n}=this,{align:r,labels:s}=e,o=nt.color,a=hi(e.rtl,this.left,this.width),l=At(s.font),{padding:c}=s,h=l.size,d=h/2;let u;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:m}=ds(s,h),g=this.isHorizontal(),_=this._computeTitleHeight();u=g?{x:ze(r,this.left+c,this.right-i[0]),y:this.top+c+_,line:0}:{x:this.left+c,y:ze(r,this.top+_+c,this.bottom-t[0].height),line:0},di(this.ctx,e.textDirection);const y=m+c;this.legendItems.forEach((v,x)=>{n.strokeStyle=v.fontColor,n.fillStyle=v.fontColor;const b=n.measureText(v.text).width,w=a.textAlign(v.textAlign||(v.textAlign=s.textAlign)),S=f+d+b;let T=u.x,k=u.y;if(a.setWidth(this.width),g?x>0&&T+S+c>this.right&&(k=u.y+=y,u.line++,T=u.x=ze(r,this.left+c,this.right-i[u.line])):x>0&&k+y>this.bottom&&(T=u.x=T+t[u.line].width+c,u.line++,k=u.y=ze(r,this.top+_+c,this.bottom-t[u.line].height)),function(e,t,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();const r=B(i.lineWidth,1);if(n.fillStyle=B(i.fillStyle,o),n.lineCap=B(i.lineCap,"butt"),n.lineDashOffset=B(i.lineDashOffset,0),n.lineJoin=B(i.lineJoin,"miter"),n.lineWidth=r,n.strokeStyle=B(i.strokeStyle,o),n.setLineDash(B(i.lineDash,[])),s.usePointStyle){const o={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:r},l=a.xPlus(e,f/2);ct(n,o,l,t+d,s.pointStyleWidth&&f)}else{const s=t+Math.max((h-p)/2,0),o=a.leftForLtr(e,f),l=kt(i.borderRadius);n.beginPath(),Object.values(l).some(e=>0!==e)?yt(n,{x:o,y:s,w:f,h:p,radius:l}):n.rect(o,s,f,p),n.fill(),0!==r&&n.stroke()}n.restore()}(a.x(T),k,v),T=((e,t,i,n)=>e===(n?"left":"right")?i:"center"===e?(t+i)/2:t)(w,T+f+d,g?T+S:this.right,e.rtl),function(e,t,i){_t(n,i.text,e,t+m/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(T),k,v),g)u.x+=S+c;else if("string"!=typeof v.text){const e=l.lineHeight;u.y+=fs(v,e)+c}else u.y+=y}),ui(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,i=At(t.font),n=Mt(t.padding);if(!t.display)return;const r=hi(e.rtl,this.left,this.width),s=this.ctx,o=t.position,a=i.size/2,l=n.top+a;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=ze(e.align,h,this.right-d);else{const t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);c=l+ze(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}const u=ze(o,h,h+d);s.textAlign=r.textAlign(Oe(o)),s.textBaseline="middle",s.strokeStyle=t.color,s.fillStyle=t.color,s.font=i.string,_t(s,t.text,u,c,i)}_computeTitleHeight(){const e=this.options.title,t=At(e.font),i=Mt(e.padding);return e.display?t.lineHeight+i.height:0}_getLegendItemAt(e,t){let i,n,r;if(Me(e,this.left,this.right)&&Me(t,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(n=r[i],Me(e,n.left,n.left+n.width)&&Me(t,n.top,n.top+n.height))return this.legendItems[i];return null}handleEvent(e){const t=this.options;if(!function(e,t){return!("mousemove"!==e&&"mouseout"!==e||!t.onHover&&!t.onLeave)||!(!t.onClick||"click"!==e&&"mouseup"!==e)}(e.type,t))return;const i=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const s=this._hoveredItem,o=(r=i,null!==(n=s)&&null!==r&&n.datasetIndex===r.datasetIndex&&n.index===r.index);s&&!o&&j(t.onLeave,[e,s,this],this),this._hoveredItem=i,i&&!o&&j(t.onHover,[e,i,this],this)}else i&&j(t.onClick,[e,i,this],this);var n,r}}function fs(e,t){return t*(e.text?e.text.length:0)}var ps={id:"legend",_element:us,start(e,t,i){const n=e.legend=new us({ctx:e.ctx,options:i,chart:e});_n.configure(e,n,i),_n.addBox(e,n)},stop(e){_n.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,i){const n=e.legend;_n.configure(e,n,i),n.options=i},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,i){const n=t.datasetIndex,r=i.chart;r.isDatasetVisible(n)?(r.hide(n),t.hidden=!0):(r.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:r,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{const l=e.controller.getStyle(i?0:void 0),c=Mt(l.borderWidth);return{text:t[e.index].label,fillStyle:l.backgroundColor,fontColor:s,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:r||l.textAlign,borderRadius:o&&(a||l.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class ms extends On{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=t;const n=z(i.text)?i.text.length:1;this._padding=Mt(i.padding);const r=n*At(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:t,left:i,bottom:n,right:r,options:s}=this,o=s.align;let a,l,c,h=0;return this.isHorizontal()?(l=ze(o,i,r),c=t+e,a=r-i):("left"===s.position?(l=i+e,c=ze(o,n,t),h=-.5*ne):(l=r-e,c=ze(o,t,n),h=.5*ne),a=n-t),{titleX:l,titleY:c,maxWidth:a,rotation:h}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const i=At(t.font),n=i.lineHeight/2+this._padding.top,{titleX:r,titleY:s,maxWidth:o,rotation:a}=this._drawArgs(n);_t(e,t.text,0,0,i,{color:t.color,maxWidth:o,rotation:a,textAlign:Oe(t.align),textBaseline:"middle",translation:[r,s]})}}var gs={id:"title",_element:ms,start(e,t,i){!function(e,t){const i=new ms({ctx:e.ctx,options:t,chart:e});_n.configure(e,i,t),_n.addBox(e,i),e.titleBlock=i}(e,i)},stop(e){const t=e.titleBlock;_n.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,i){const n=e.titleBlock;_n.configure(e,n,i),n.options=i},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 _s=new WeakMap;var ys={id:"subtitle",start(e,t,i){const n=new ms({ctx:e.ctx,options:i,chart:e});_n.configure(e,n,i),_n.addBox(e,n),_s.set(e,n)},stop(e){_n.removeBox(e,_s.get(e)),_s.delete(e)},beforeUpdate(e,t,i){const n=_s.get(e);_n.configure(e,n,i),n.options=i},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 vs={average(e){if(!e.length)return!1;let t,i,n=new Set,r=0,s=0;for(t=0,i=e.length;t<i;++t){const i=e[t].element;if(i&&i.hasValue()){const e=i.tooltipPosition();n.add(e.x),r+=e.y,++s}}return 0!==s&&0!==n.size&&{x:[...n].reduce((e,t)=>e+t)/n.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let i,n,r,s=t.x,o=t.y,a=Number.POSITIVE_INFINITY;for(i=0,n=e.length;i<n;++i){const n=e[i].element;if(n&&n.hasValue()){const e=be(t,n.getCenterPoint());e<a&&(a=e,r=n)}}if(r){const e=r.tooltipPosition();s=e.x,o=e.y}return{x:s,y:o}}};function xs(e,t){return t&&(z(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function bs(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function ws(e,t){const{element:i,datasetIndex:n,index:r}=t,s=e.getDatasetMeta(n).controller,{label:o,value:a}=s.getLabelAndValue(r);return{chart:e,label:o,parsed:s.getParsed(r),raw:e.data.datasets[n].data[r],formattedValue:a,dataset:s.getDataset(),dataIndex:r,datasetIndex:n,element:i}}function Ss(e,t){const i=e.chart.ctx,{body:n,footer:r,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=At(t.bodyFont),c=At(t.titleFont),h=At(t.footerFont),d=s.length,u=r.length,f=n.length,p=Mt(t.padding);let m=p.height,g=0,_=n.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);_+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_&&(m+=f*(t.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(_-f)*l.lineHeight+(_-1)*t.bodySpacing),u&&(m+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const v=function(e){g=Math.max(g,i.measureText(e).width+y)};return i.save(),i.font=c.string,V(e.title,v),i.font=l.string,V(e.beforeBody.concat(e.afterBody),v),y=t.displayColors?o+2+t.boxPadding:0,V(n,e=>{V(e.before,v),V(e.lines,v),V(e.after,v)}),y=0,i.font=h.string,V(e.footer,v),i.restore(),g+=p.width,{width:g,height:m}}function Ts(e,t,i,n){const{x:r,width:s}=i,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return"center"===n?c=r<=(a+l)/2?"left":"right":r<=s/2?c="left":r>=o-s/2&&(c="right"),function(e,t,i,n){const{x:r,width:s}=n,o=i.caretSize+i.caretPadding;return"left"===e&&r+s+o>t.width||"right"===e&&r-s-o<0||void 0}(c,e,t,i)&&(c="center"),c}function ks(e,t,i){const n=i.yAlign||t.yAlign||function(e,t){const{y:i,height:n}=t;return i<n/2?"top":i>e.height-n/2?"bottom":"center"}(e,i);return{xAlign:i.xAlign||t.xAlign||Ts(e,t,i,n),yAlign:n}}function Ms(e,t,i,n){const{caretSize:r,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=i,c=r+s,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=kt(o);let p=function(e,t){let{x:i,width:n}=e;return"right"===t?i-=n:"center"===t&&(i-=n/2),i}(t,a);const m=function(e,t,i){let{y:n,height:r}=e;return"top"===t?n+=i:n-="bottom"===t?r+i:r/2,n}(t,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(h,u)+r:"right"===a&&(p+=Math.max(d,f)+r),{x:ke(p,0,n.width-t.width),y:ke(m,0,n.height-t.height)}}function As(e,t,i){const n=Mt(i.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-n.right:e.x+n.left}function Cs(e){return xs([],bs(e))}function Ds(e,t){const i=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return i?e.override(i):e}const Ls={beforeTitle:P,title(e){if(e.length>0){const t=e[0],i=t.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return i[t.dataIndex]}return""},afterTitle:P,beforeBody:P,beforeLabel:P,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const i=e.formattedValue;return O(i)||(t+=i),t},labelColor(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:P,afterBody:P,beforeFooter:P,footer:P,afterFooter:P};function Es(e,t,i,n){const r=e[t].call(i,n);return void 0===r?Ls[t].call(i,n):r}class Is extends On{static positioners=vs;constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&t.options.animation&&i.animations,r=new Mi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=function(e,t,i){return Dt(e,{tooltip:t,tooltipItems:i,type:"tooltip"})}(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,n=Es(i,"beforeTitle",this,e),r=Es(i,"title",this,e),s=Es(i,"afterTitle",this,e);let o=[];return o=xs(o,bs(n)),o=xs(o,bs(r)),o=xs(o,bs(s)),o}getBeforeBody(e,t){return Cs(Es(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,n=[];return V(e,e=>{const t={before:[],lines:[],after:[]},r=Ds(i,e);xs(t.before,bs(Es(r,"beforeLabel",this,e))),xs(t.lines,Es(r,"label",this,e)),xs(t.after,bs(Es(r,"afterLabel",this,e))),n.push(t)}),n}getAfterBody(e,t){return Cs(Es(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,n=Es(i,"beforeFooter",this,e),r=Es(i,"footer",this,e),s=Es(i,"afterFooter",this,e);let o=[];return o=xs(o,bs(n)),o=xs(o,bs(r)),o=xs(o,bs(s)),o}_createItems(e){const t=this._active,i=this.chart.data,n=[],r=[],s=[];let o,a,l=[];for(o=0,a=t.length;o<a;++o)l.push(ws(this.chart,t[o]));return e.filter&&(l=l.filter((t,n,r)=>e.filter(t,n,r,i))),e.itemSort&&(l=l.sort((t,n)=>e.itemSort(t,n,i))),V(l,t=>{const i=Ds(e.callbacks,t);n.push(Es(i,"labelColor",this,t)),r.push(Es(i,"labelPointStyle",this,t)),s.push(Es(i,"labelTextColor",this,t))}),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=s,this.dataPoints=l,l}update(e,t){const i=this.options.setContext(this.getContext()),n=this._active;let r,s=[];if(n.length){const e=vs[i.position].call(this,n,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const t=this._size=Ss(this,i),o=Object.assign({},e,t),a=ks(this.chart,i,o),l=Ms(i,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,r={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=s,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,n){const r=this.getCaretPosition(e,i,n);t.lineTo(r.x1,r.y1),t.lineTo(r.x2,r.y2),t.lineTo(r.x3,r.y3)}getCaretPosition(e,t,i){const{xAlign:n,yAlign:r}=this,{caretSize:s,cornerRadius:o}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=kt(o),{x:d,y:u}=e,{width:f,height:p}=t;let m,g,_,y,v,x;return"center"===r?(v=u+p/2,"left"===n?(m=d,g=m-s,y=v+s,x=v-s):(m=d+f,g=m+s,y=v-s,x=v+s),_=m):(g="left"===n?d+Math.max(a,c)+s:"right"===n?d+f-Math.max(l,h)-s:this.caretX,"top"===r?(y=u,v=y-s,m=g-s,_=g+s):(y=u+p,v=y+s,m=g+s,_=g-s),x=y),{x1:m,x2:g,x3:_,y1:y,y2:v,y3:x}}drawTitle(e,t,i){const n=this.title,r=n.length;let s,o,a;if(r){const l=hi(i.rtl,this.x,this.width);for(e.x=As(this,i.titleAlign,i),t.textAlign=l.textAlign(i.titleAlign),t.textBaseline="middle",s=At(i.titleFont),o=i.titleSpacing,t.fillStyle=i.titleColor,t.font=s.string,a=0;a<r;++a)t.fillText(n[a],l.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+o,a+1===r&&(e.y+=i.titleMarginBottom-o)}}_drawColorBox(e,t,i,n,r){const s=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:a,boxWidth:l}=r,c=At(r.bodyFont),h=As(this,"left",r),d=n.x(h),u=a<c.lineHeight?(c.lineHeight-a)/2:0,f=t.y+u;if(r.usePointStyle){const t={radius:Math.min(l,a)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},i=n.leftForLtr(d,l)+l/2,c=f+a/2;e.strokeStyle=r.multiKeyBackground,e.fillStyle=r.multiKeyBackground,lt(e,t,i,c),e.strokeStyle=s.borderColor,e.fillStyle=s.backgroundColor,lt(e,t,i,c)}else{e.lineWidth=F(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,e.strokeStyle=s.borderColor,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset||0;const t=n.leftForLtr(d,l),i=n.leftForLtr(n.xPlus(d,1),l-2),o=kt(s.borderRadius);Object.values(o).some(e=>0!==e)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,yt(e,{x:t,y:f,w:l,h:a,radius:o}),e.fill(),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),yt(e,{x:i,y:f+1,w:l-2,h:a-2,radius:o}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(t,f,l,a),e.strokeRect(t,f,l,a),e.fillStyle=s.backgroundColor,e.fillRect(i,f+1,l-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:n}=this,{bodySpacing:r,bodyAlign:s,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=At(i.bodyFont);let d=h.lineHeight,u=0;const f=hi(i.rtl,this.x,this.width),p=function(i){t.fillText(i,f.x(e.x+u),e.y+d/2),e.y+=d+r},m=f.textAlign(s);let g,_,y,v,x,b,w;for(t.textAlign=s,t.textBaseline="middle",t.font=h.string,e.x=As(this,m,i),t.fillStyle=i.bodyColor,V(this.beforeBody,p),u=o&&"right"!==m?"center"===s?l/2+c:l+2+c:0,v=0,b=n.length;v<b;++v){for(g=n[v],_=this.labelTextColors[v],t.fillStyle=_,V(g.before,p),y=g.lines,o&&y.length&&(this._drawColorBox(t,e,v,f,i),d=Math.max(h.lineHeight,a)),x=0,w=y.length;x<w;++x)p(y[x]),d=h.lineHeight;V(g.after,p)}u=0,d=h.lineHeight,V(this.afterBody,p),e.y-=r}drawFooter(e,t,i){const n=this.footer,r=n.length;let s,o;if(r){const a=hi(i.rtl,this.x,this.width);for(e.x=As(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",s=At(i.footerFont),t.fillStyle=i.footerColor,t.font=s.string,o=0;o<r;++o)t.fillText(n[o],a.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+i.footerSpacing}}drawBackground(e,t,i,n){const{xAlign:r,yAlign:s}=this,{x:o,y:a}=e,{width:l,height:c}=i,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=kt(n.cornerRadius);t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.beginPath(),t.moveTo(o+h,a),"top"===s&&this.drawCaret(e,t,i,n),t.lineTo(o+l-d,a),t.quadraticCurveTo(o+l,a,o+l,a+d),"center"===s&&"right"===r&&this.drawCaret(e,t,i,n),t.lineTo(o+l,a+c-f),t.quadraticCurveTo(o+l,a+c,o+l-f,a+c),"bottom"===s&&this.drawCaret(e,t,i,n),t.lineTo(o+u,a+c),t.quadraticCurveTo(o,a+c,o,a+c-u),"center"===s&&"left"===r&&this.drawCaret(e,t,i,n),t.lineTo(o,a+h),t.quadraticCurveTo(o,a,o+h,a),t.closePath(),t.fill(),n.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){const i=vs[e.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=Ss(this,e),o=Object.assign({},i,this._size),a=ks(t,e,o),l=Ms(e,o,a,t);n._to===l.x&&r._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=Mt(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=i,this.drawBackground(r,e,n,t),di(e,t.textDirection),r.y+=s.top,this.drawTitle(r,e,t),this.drawBody(r,e,t),this.drawFooter(r,e,t),ui(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,n=e.map(({datasetIndex:e,index:t})=>{const i=this.chart.getDatasetMeta(e);if(!i)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:i.data[t],index:t}}),r=!W(i,n),s=this._positionChanged(n,t);(r||s)&&(this._active=n,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,r=this._active||[],s=this._getActiveElements(e,r,t,i),o=this._positionChanged(s,e),a=t||!W(s,r)||o;return a&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,n){const r=this.options;if("mouseout"===e.type)return[];if(!n)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&void 0!==this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index));const s=this.chart.getElementsAtEventForMode(e,r.mode,r,i);return r.reverse&&s.reverse(),s}_positionChanged(e,t){const{caretX:i,caretY:n,options:r}=this,s=vs[r.position].call(this,e,t);return!1!==s&&(i!==s.x||n!==s.y)}}var Ps={id:"tooltip",_element:Is,positioners:vs,afterInit(e,t,i){i&&(e.tooltip=new Is({chart:e,options:i}))},beforeUpdate(e,t,i){e.tooltip&&e.tooltip.initialize(i)},reset(e,t,i){e.tooltip&&e.tooltip.initialize(i)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const i={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",i)}},afterEvent(e,t){if(e.tooltip){const i=t.replay;e.tooltip.handleEvent(t.event,i,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ls},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Rs=Object.freeze({__proto__:null,Colors:Wr,Decimation:Gr,Filler:hs,Legend:ps,SubTitle:ys,Title:gs,Tooltip:Ps});function Os(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}function zs(e,t,{horizontal:i,minRotation:n}){const r=_e(n),s=(i?Math.sin(r):Math.cos(r))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Fs extends Wn{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return O(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:n,max:r}=this;const s=e=>n=t?n:e,o=e=>r=i?r:e;if(e){const e=ue(n),t=ue(r);e<0&&t<0?o(0):e>0&&t>0&&s(0)}if(n===r){let t=0===r?1:Math.abs(.05*r);o(r+t),e||s(n-t)}this.min=n,this.max=r}getTickLimit(){const e=this.options.ticks;let t,{maxTicksLimit:i,stepSize:n}=e;return n?(t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,t>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3)):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(e,t){const i=[],{bounds:n,step:r,min:s,max:o,precision:a,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=e,u=r||1,f=c-1,{min:p,max:m}=t,g=!O(s),_=!O(o),y=!O(l),v=(m-p)/(h+1);let x,b,w,S,T=pe((m-p)/f/u)*u;if(T<1e-14&&!g&&!_)return[{value:p},{value:m}];S=Math.ceil(m/T)-Math.floor(p/T),S>f&&(T=pe(S*T/f/u)*u),O(a)||(x=Math.pow(10,a),T=Math.ceil(T*x)/x),"ticks"===n?(b=Math.floor(p/T)*T,w=Math.ceil(m/T)*T):(b=p,w=m),g&&_&&r&&function(e,t){const i=Math.round(e);return i-t<=e&&i+t>=e}((o-s)/r,T/1e3)?(S=Math.round(Math.min((o-s)/T,c)),T=(o-s)/S,b=s,w=o):y?(b=g?s:b,w=_?o:w,S=l-1,T=(w-b)/S):(S=(w-b)/T,S=fe(S,Math.round(S),T/1e3)?Math.round(S):Math.ceil(S));const k=Math.max(ve(T),ve(b));x=Math.pow(10,O(a)?k:a),b=Math.round(b*x)/x,w=Math.round(w*x)/x;let M=0;for(g&&(d&&b!==s?(i.push({value:s}),b<s&&M++,fe(Math.round((b+M*T)*x)/x,s,zs(s,v,e))&&M++):b<s&&M++);M<S;++M){const e=Math.round((b+M*T)*x)/x;if(_&&e>o)break;i.push({value:e})}return _&&d&&w!==o?i.length&&fe(i[i.length-1].value,o,zs(o,v,e))?i[i.length-1].value=o:i.push({value:o}):_&&w!==o||i.push({value:w}),i}({maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&ge(n,this,"value"),e.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const n=(i-t)/Math.max(e.length-1,1)/2;t-=n,i+=n}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return qe(e,this.chart.options.locale,this.options.ticks.format)}}class Ns extends Fs{static id="linear";static defaults={ticks:{callback:Je.formatters.numeric}};determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=N(e)?e:0,this.max=N(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=_e(this.options.ticks.minRotation),n=(e?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,r.lineHeight/n))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const Ys=e=>Math.floor(de(e)),Bs=(e,t)=>Math.pow(10,Ys(e)+t);function Hs(e){return 1===e/Math.pow(10,Ys(e))}function js(e,t,i){const n=Math.pow(10,i),r=Math.floor(e/n);return Math.ceil(t/n)-r}class Vs extends Wn{static id="logarithmic";static defaults={ticks:{callback:Je.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=Fs.prototype.parse.apply(this,[e,t]);if(0!==i)return N(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=N(e)?Math.max(0,e):null,this.max=N(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!N(this._userMin)&&(this.min=e===Bs(this.min,0)?Bs(this.min,-1):Bs(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,n=this.max;const r=t=>i=e?i:t,s=e=>n=t?n:e;i===n&&(i<=0?(r(1),s(10)):(r(Bs(i,-1)),s(Bs(n,1)))),i<=0&&r(Bs(n,-1)),n<=0&&s(Bs(i,1)),this.min=i,this.max=n}buildTicks(){const e=this.options,t=function(e,{min:t,max:i}){t=Y(e.min,t);const n=[],r=Ys(t);let s=function(e,t){let i=Ys(t-e);for(;js(e,t,i)>10;)i++;for(;js(e,t,i)<10;)i--;return Math.min(i,Ys(e))}(t,i),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=r>s?Math.pow(10,r):0,c=Math.round((t-l)*o)/o,h=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-h)/Math.pow(10,s)),u=Y(e.min,Math.round((l+h+d*Math.pow(10,s))*o)/o);for(;u<i;)n.push({value:u,major:Hs(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(s++,d=2,o=s>=0?1:o),u=Math.round((l+h+d*Math.pow(10,s))*o)/o;const f=Y(e.max,u);return n.push({value:f,major:Hs(f),significand:d}),n}({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&ge(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return void 0===e?"0":qe(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=de(e),this._valueRange=de(this.max)-de(e)}getPixelForValue(e){return void 0!==e&&0!==e||(e=this.min),null===e||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(de(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}function Ws(e){const t=e.ticks;if(t.display&&e.display){const e=Mt(t.backdropPadding);return B(t.font&&t.font.size,nt.font.size)+e.height}return 0}function Us(e,t,i){return i=z(i)?i:[i],{w:st(e,t.string,i),h:i.length*t.lineHeight}}function $s(e,t,i,n,r){return e===n||e===r?{start:t-i/2,end:t+i/2}:e<n||e>r?{start:t-i,end:t}:{start:t,end:t+i}}function Gs(e,t,i,n,r){const s=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let a=0,l=0;n.start<t.l?(a=(t.l-n.start)/s,e.l=Math.min(e.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),r.start<t.t?(l=(t.t-r.start)/o,e.t=Math.min(e.t,t.t-l)):r.end>t.b&&(l=(r.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function Xs(e,t,i){const n=e.drawingArea,{extra:r,additionalAngle:s,padding:o,size:a}=i,l=e.getPointPosition(t,n+r+o,s),c=Math.round(ye(Se(l.angle+le))),h=function(e,t,i){return 90===i||270===i?e-=t/2:(i>270||i<90)&&(e-=t),e}(l.y,a.h,c),d=function(e){return 0===e||180===e?"center":e<180?"left":"right"}(c),u=(f=l.x,p=a.w,"right"===(m=d)?f-=p:"center"===m&&(f-=p/2),f);var f,p,m;return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+a.w,bottom:h+a.h}}function qs(e,t){if(!t)return!0;const{left:i,top:n,right:r,bottom:s}=e;return!(ht({x:i,y:n},t)||ht({x:i,y:s},t)||ht({x:r,y:n},t)||ht({x:r,y:s},t))}function Zs(e,t,i){const{left:n,top:r,right:s,bottom:o}=i,{backdropColor:a}=t;if(!O(a)){const i=kt(t.borderRadius),l=Mt(t.backdropPadding);e.fillStyle=a;const c=n-l.left,h=r-l.top,d=s-n+l.width,u=o-r+l.height;Object.values(i).some(e=>0!==e)?(e.beginPath(),yt(e,{x:c,y:h,w:d,h:u,radius:i}),e.fill()):e.fillRect(c,h,d,u)}}function Js(e,t,i,n){const{ctx:r}=e;if(i)r.arc(e.xCenter,e.yCenter,t,0,re);else{let i=e.getPointPosition(0,t);r.moveTo(i.x,i.y);for(let s=1;s<n;s++)i=e.getPointPosition(s,t),r.lineTo(i.x,i.y)}}class Ks extends Fs{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:Je.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:e=>e,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Mt(Ws(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=N(e)&&!isNaN(e)?e:0,this.max=N(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ws(this.options))}generateTickLabels(e){Fs.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{const i=j(this.options.pointLabels.callback,[e,t],this);return i||0===i?i:""}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){const e=this.options;e.display&&e.pointLabels.display?function(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},i=Object.assign({},t),n=[],r=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ne/s:0;for(let l=0;l<s;l++){const s=o.setContext(e.getPointLabelContext(l));r[l]=s.padding;const c=e.getPointPosition(l,e.drawingArea+r[l],a),h=At(s.font),d=Us(e.ctx,h,e._pointLabels[l]);n[l]=d;const u=Se(e.getIndexAngle(l)+a),f=Math.round(ye(u));Gs(i,t,u,$s(f,c.x,d.w,0,180),$s(f,c.y,d.h,90,270))}e.setCenterPoint(t.l-i.l,i.r-t.r,t.t-i.t,i.b-t.b),e._pointLabelItems=function(e,t,i){const n=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:Ws(s)/2,additionalAngle:o?ne/r:0};let c;for(let s=0;s<r;s++){l.padding=i[s],l.size=t[s];const r=Xs(e,s,l);n.push(r),"auto"===a&&(r.visible=qs(r,c),r.visible&&(c=r))}return n}(e,n,r)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,n){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,n))}getIndexAngle(e){return Se(e*(re/(this._pointLabels.length||1))+_e(this.options.startAngle||0))}getDistanceFromCenterForValue(e){if(O(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(O(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const i=t[e];return function(e,t,i){return Dt(e,{label:i,index:t,type:"pointLabel"})}(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const n=this.getIndexAngle(e)-le+i;return{x:Math.cos(n)*t+this.xCenter,y:Math.sin(n)*t+this.yCenter,angle:n}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:i,right:n,bottom:r}=this._pointLabelItems[e];return{left:t,top:i,right:n,bottom:r}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),Js(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:i,grid:n,border:r}=t,s=this._pointLabels.length;let o,a,l;if(t.pointLabels.display&&function(e,t){const{ctx:i,options:{pointLabels:n}}=e;for(let r=t-1;r>=0;r--){const t=e._pointLabelItems[r];if(!t.visible)continue;const s=n.setContext(e.getPointLabelContext(r));Zs(i,s,t);const o=At(s.font),{x:a,y:l,textAlign:c}=t;_t(i,e._pointLabels[r],a,l+o.lineHeight/2,o,{color:s.color,textAlign:c,textBaseline:"middle"})}}(this,s),n.display&&this.ticks.forEach((e,t)=>{if(0!==t||0===t&&this.min<0){a=this.getDistanceFromCenterForValue(e.value);const i=this.getContext(t),o=n.setContext(i),l=r.setContext(i);!function(e,t,i,n,r){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!n||!a||!l||i<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Js(e,i,o,n),s.closePath(),s.stroke(),s.restore())}(this,o,a,s,l)}}),i.display){for(e.save(),o=s-1;o>=0;o--){const n=i.setContext(this.getPointLabelContext(o)),{color:r,lineWidth:s}=n;s&&r&&(e.lineWidth=s,e.strokeStyle=r,e.setLineDash(n.borderDash),e.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),l=this.getPointPosition(o,a),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let r,s;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(n),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((n,o)=>{if(0===o&&this.min>=0&&!t.reverse)return;const a=i.setContext(this.getContext(o)),l=At(a.font);if(r=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){e.font=l.string,s=e.measureText(n.label).width,e.fillStyle=a.backdropColor;const t=Mt(a.backdropPadding);e.fillRect(-s/2-t.left,-r-l.size/2-t.top,s+t.width,l.size+t.height)}_t(e,n.label,0,-r,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})}),e.restore()}drawTitle(){}}const Qs={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}},eo=Object.keys(Qs);function to(e,t){return e-t}function io(e,t){if(O(t))return null;const i=e._adapter,{parser:n,round:r,isoWeekday:s}=e._parseOpts;let o=t;return"function"==typeof n&&(o=n(o)),N(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(r&&(o="week"!==r||!me(s)&&!0!==s?i.startOf(o,r):i.startOf(o,"isoWeek",s)),+o)}function no(e,t,i,n){const r=eo.length;for(let s=eo.indexOf(e);s<r-1;++s){const e=Qs[eo[s]],r=e.steps?e.steps:Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((i-t)/(r*e.size))<=n)return eo[s]}return eo[r-1]}function ro(e,t,i){if(i){if(i.length){const{lo:n,hi:r}=Ae(i,t);e[i[n]>=t?i[n]:i[r]]=!0}}else e[t]=!0}function so(e,t,i){const n=[],r={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],r[a]=o,n.push({value:a,major:!1});return 0!==s&&i?function(e,t,i,n){const r=e._adapter,s=+r.startOf(t[0].value,n),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+r.add(a,1,n))l=i[a],l>=0&&(t[l].major=!0);return t}(e,n,r,i):n}class oo extends Wn{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(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const i=e.time||(e.time={}),n=this._adapter=new Ki(e.adapters.date);n.init(t),q(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:io(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds();function a(e){s||isNaN(e.min)||(n=Math.min(n,e.min)),o||isNaN(e.max)||(r=Math.max(r,e.max))}s&&o||(a(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||a(this.getMinMax(!1))),n=N(n)&&!isNaN(n)?n:+t.startOf(Date.now(),i),r=N(r)&&!isNaN(r)?r:+t.endOf(Date.now(),i)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const r=this.min,s=function(e,t,i){let n=0,r=e.length;for(;n<r&&e[n]<t;)n++;for(;r>n&&e[r-1]>i;)r--;return n>0||r<e.length?e.slice(n,r):e}(n,r,this.max);return this._unit=t.unit||(i.autoSkip?no(t.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(e,t,i,n,r){for(let s=eo.length-1;s>=eo.indexOf(i);s--){const i=eo[s];if(Qs[i].common&&e._adapter.diff(r,n,i)>=t-1)return i}return eo[i?eo.indexOf(i):0]}(this,s.length,t.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(e){for(let t=eo.indexOf(e)+1,i=eo.length;t<i;++t)if(Qs[eo[t]].common)return eo[t]}(this._unit):void 0,this.initOffsets(n),e.reverse&&s.reverse(),so(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t,i,n=0,r=0;this.options.offset&&e.length&&(t=this.getDecimalForValue(e[0]),n=1===e.length?1-t:(this.getDecimalForValue(e[1])-t)/2,i=this.getDecimalForValue(e[e.length-1]),r=1===e.length?i:(i-this.getDecimalForValue(e[e.length-2]))/2);const s=e.length<3?.5:.25;n=ke(n,0,s),r=ke(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,t=this.min,i=this.max,n=this.options,r=n.time,s=r.unit||no(r.minUnit,t,i,this._getLabelCapacity(t)),o=B(n.ticks.stepSize,1),a="week"===s&&r.isoWeekday,l=me(a)||!0===a,c={};let h,d,u=t;if(l&&(u=+e.startOf(u,"isoWeek",a)),u=+e.startOf(u,l?"day":s),e.diff(i,t,s)>1e5*o)throw new Error(t+" and "+i+" are too far apart with stepSize of "+o+" "+s);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;h<i;h=+e.add(h,o,s),d++)ro(c,h,f);return h!==i&&"ticks"!==n.bounds&&1!==d||ro(c,h,f),Object.keys(c).sort(to).map(e=>+e)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const i=this.options.time.displayFormats,n=this._unit,r=t||i[n];return this._adapter.format(e,r)}_tickFormatFunction(e,t,i,n){const r=this.options,s=r.ticks.callback;if(s)return j(s,[e,t,i],this);const o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],h=l&&o[l],d=i[t],u=l&&h&&d&&d.major;return this._adapter.format(e,n||(u?h:c))}generateTickLabels(e){let t,i,n;for(t=0,i=e.length;t<i;++t)n=e[t],n.label=this._tickFormatFunction(n.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,n=_e(this.isHorizontal()?t.maxRotation:t.minRotation),r=Math.cos(n),s=Math.sin(n),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*s,h:i*s+o*r}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,n=i[t.unit]||i.millisecond,r=this._tickFormatFunction(e,0,so(this,[e],this._majorUnit),n),s=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let e,t,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,t=n.length;e<t;++e)i=i.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const n=this.getLabels();for(t=0,i=n.length;t<i;++t)e.push(io(this,n[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Ie(e.sort(to))}}function ao(e,t,i){let n,r,s,o,a=0,l=e.length-1;i?(t>=e[a].pos&&t<=e[l].pos&&({lo:a,hi:l}=Ce(e,"pos",t)),({pos:n,time:s}=e[a]),({pos:r,time:o}=e[l])):(t>=e[a].time&&t<=e[l].time&&({lo:a,hi:l}=Ce(e,"time",t)),({time:n,pos:s}=e[a]),({time:r,pos:o}=e[l]));const c=r-n;return c?s+(o-s)*(t-n)/c:s}var lo=Object.freeze({__proto__:null,CategoryScale:class extends Wn{static id="category";static defaults={ticks:{callback:Os}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const e=this.getLabels();for(const{index:i,label:n}of t)e[i]===n&&e.splice(i,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(O(e))return null;const i=this.getLabels();return((e,t)=>null===e?null:ke(Math.round(e),0,t))(t=isFinite(t)&&i[t]===e?t:function(e,t,i,n){const r=e.indexOf(t);return-1===r?((e,t,i,n)=>("string"==typeof t?(i=e.push(t)-1,n.unshift({index:i,label:t})):isNaN(t)&&(i=null),i))(e,t,i,n):r!==e.lastIndexOf(t)?i:r}(i,e,B(t,e),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(i=0),t||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,n=[];let r=this.getLabels();r=0===e&&t===r.length-1?r:r.slice(e,t+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=e;i<=t;i++)n.push({value:i});return n}getLabelForValue(e){return Os.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:Ns,LogarithmicScale:Vs,RadialLinearScale:Ks,TimeScale:oo,TimeSeriesScale:class extends oo{static id="timeseries";static defaults=oo.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=ao(t,this.min),this._tableRange=ao(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,n=[],r=[];let s,o,a,l,c;for(s=0,o=e.length;s<o;++s)l=e[s],l>=t&&l<=i&&n.push(l);if(n.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(s=0,o=n.length;s<o;++s)c=n[s+1],a=n[s-1],l=n[s],Math.round((c+a)/2)!==l&&r.push({time:l,pos:s/(o-1)});return r}_generate(){const e=this.min,t=this.max;let i=super.getDataTimestamps();return i.includes(e)&&i.length||i.splice(0,0,e),i.includes(t)&&1!==i.length||i.push(t),i.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return e=t.length&&i.length?this.normalize(t.concat(i)):t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(ao(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return ao(this._table,i*this._tableRange+this._minPos,!0)}}});const co=[qi,Nr,Rs,lo];xr.register(...co);const ho=xr},9374:function(e,t,i){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function i(e,i,n,r){var s=e+" ";switch(n){case"s":return i||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(i||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return i?"mínúta":"mínútu";case"mm":return t(e)?s+(i||r?"mínútur":"mínútum"):i?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(i||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return i?"dagur":r?"dag":"degi";case"dd":return t(e)?i?s+"dagar":s+(r?"daga":"dögum"):i?s+"dagur":s+(r?"dag":"degi");case"M":return i?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?i?s+"mánuðir":s+(r?"mánuði":"mánuðum"):i?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return i||r?"ár":"ári";case"yy":return t(e)?s+(i||r?"ár":"árum"):s+(i||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:i,ss:i,m:i,mm:i,h:"klukkustund",hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},9402:function(e,t,i){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(i(5093))},9476:(e,t,i)=>{"use strict";var n,r;function s(e){return"object"==typeof e&&"function"==typeof e.to}function o(e){e.parentElement.removeChild(e)}function a(e){return null!=e}function l(e){e.preventDefault()}function c(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function h(e,t,i){i>0&&(p(e,t),setTimeout(function(){m(e,t)},i))}function d(e){return Math.max(Math.min(e,100),0)}function u(e){return Array.isArray(e)?e:[e]}function f(e){var t=(e=String(e)).split(".");return t.length>1?t[1].length:0}function p(e,t){e.classList&&!/\s/.test(t)?e.classList.add(t):e.className+=" "+t}function m(e,t){e.classList&&!/\s/.test(t)?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function g(e){var t=void 0!==window.pageXOffset,i="CSS1Compat"===(e.compatMode||"");return{x:t?window.pageXOffset:i?e.documentElement.scrollLeft:e.body.scrollLeft,y:t?window.pageYOffset:i?e.documentElement.scrollTop:e.body.scrollTop}}function _(e,t){return 100/(t-e)}function y(e,t,i){return 100*t/(e[i+1]-e[i])}function v(e,t){for(var i=1;e>=t[i];)i+=1;return i}i.d(t,{Ay:()=>J}),function(e){e.Range="range",e.Steps="steps",e.Positions="positions",e.Count="count",e.Values="values"}(n||(n={})),function(e){e[e.None=-1]="None",e[e.NoValue=0]="NoValue",e[e.LargeValue=1]="LargeValue",e[e.SmallValue=2]="SmallValue"}(r||(r={}));var x=function(){function e(e,t,i){var n;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[i||!1],this.xNumSteps=[!1],this.snap=t;var r=[];for(Object.keys(e).forEach(function(t){r.push([u(e[t]),t])}),r.sort(function(e,t){return e[0][0]-t[0][0]}),n=0;n<r.length;n++)this.handleEntryPoint(r[n][1],r[n][0]);for(this.xNumSteps=this.xSteps.slice(0),n=0;n<this.xNumSteps.length;n++)this.handleStepPoint(n,this.xNumSteps[n])}return e.prototype.getDistance=function(e){for(var t=[],i=0;i<this.xNumSteps.length-1;i++)t[i]=y(this.xVal,e,i);return t},e.prototype.getAbsoluteDistance=function(e,t,i){var n,r=0;if(e<this.xPct[this.xPct.length-1])for(;e>this.xPct[r+1];)r++;else e===this.xPct[this.xPct.length-1]&&(r=this.xPct.length-2);i||e!==this.xPct[r+1]||r++,null===t&&(t=[]);var s=1,o=t[r],a=0,l=0,c=0,h=0;for(n=i?(e-this.xPct[r])/(this.xPct[r+1]-this.xPct[r]):(this.xPct[r+1]-e)/(this.xPct[r+1]-this.xPct[r]);o>0;)a=this.xPct[r+1+h]-this.xPct[r+h],t[r+h]*s+100-100*n>100?(l=a*n,s=(o-100*n)/t[r+h],n=1):(l=t[r+h]*a/100*s,s=0),i?(c-=l,this.xPct.length+h>=1&&h--):(c+=l,this.xPct.length-h>=1&&h++),o=t[r+h]*s;return e+c},e.prototype.toStepping=function(e){return function(e,t,i){if(i>=e.slice(-1)[0])return 100;var n=v(i,e),r=e[n-1],s=e[n],o=t[n-1],a=t[n];return o+function(e,t){return y(e,e[0]<0?t+Math.abs(e[0]):t-e[0],0)}([r,s],i)/_(o,a)}(this.xVal,this.xPct,e)},e.prototype.fromStepping=function(e){return function(e,t,i){if(i>=100)return e.slice(-1)[0];var n=v(i,t),r=e[n-1],s=e[n],o=t[n-1];return function(e,t){return t*(e[1]-e[0])/100+e[0]}([r,s],(i-o)*_(o,t[n]))}(this.xVal,this.xPct,e)},e.prototype.getStep=function(e){return function(e,t,i,n){if(100===n)return n;var r=v(n,e),s=e[r-1],o=e[r];return i?n-s>(o-s)/2?o:s:t[r-1]?e[r-1]+function(e,t){return Math.round(e/t)*t}(n-e[r-1],t[r-1]):n}(this.xPct,this.xSteps,this.snap,e)},e.prototype.getDefaultStep=function(e,t,i){var n=v(e,this.xPct);return(100===e||t&&e===this.xPct[n-1])&&(n=Math.max(n-1,1)),(this.xVal[n]-this.xVal[n-1])/i},e.prototype.getNearbySteps=function(e){var t=v(e,this.xPct);return{stepBefore:{startValue:this.xVal[t-2],step:this.xNumSteps[t-2],highestStep:this.xHighestCompleteStep[t-2]},thisStep:{startValue:this.xVal[t-1],step:this.xNumSteps[t-1],highestStep:this.xHighestCompleteStep[t-1]},stepAfter:{startValue:this.xVal[t],step:this.xNumSteps[t],highestStep:this.xHighestCompleteStep[t]}}},e.prototype.countStepDecimals=function(){var e=this.xNumSteps.map(f);return Math.max.apply(null,e)},e.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},e.prototype.convert=function(e){return this.getStep(this.toStepping(e))},e.prototype.handleEntryPoint=function(e,t){var i;if(!c(i="min"===e?0:"max"===e?100:parseFloat(e))||!c(t[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(i),this.xVal.push(t[0]);var n=Number(t[1]);i?this.xSteps.push(!isNaN(n)&&n):isNaN(n)||(this.xSteps[0]=n),this.xHighestCompleteStep.push(0)},e.prototype.handleStepPoint=function(e,t){if(t)if(this.xVal[e]!==this.xVal[e+1]){this.xSteps[e]=y([this.xVal[e],this.xVal[e+1]],t,0)/_(this.xPct[e],this.xPct[e+1]);var i=(this.xVal[e+1]-this.xVal[e])/this.xNumSteps[e],n=Math.ceil(Number(i.toFixed(3))-1),r=this.xVal[e]+this.xNumSteps[e]*n;this.xHighestCompleteStep[e]=r}else this.xSteps[e]=this.xHighestCompleteStep[e]=this.xVal[e]},e}(),b={to:function(e){return void 0===e?"":e.toFixed(2)},from:Number},w={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},S=".__tooltips",T=".__aria";function k(e,t){if(!c(t))throw new Error("noUiSlider: 'step' is not numeric.");e.singleStep=t}function M(e,t){if(!c(t))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");e.keyboardPageMultiplier=t}function A(e,t){if(!c(t))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");e.keyboardMultiplier=t}function C(e,t){if(!c(t))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");e.keyboardDefaultStep=t}function D(e,t){if("object"!=typeof t||Array.isArray(t))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===t.min||void 0===t.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");e.spectrum=new x(t,e.snap||!1,e.singleStep)}function L(e,t){if(t=u(t),!Array.isArray(t)||!t.length)throw new Error("noUiSlider: 'start' option is incorrect.");e.handles=t.length,e.start=t}function E(e,t){if("boolean"!=typeof t)throw new Error("noUiSlider: 'snap' option must be a boolean.");e.snap=t}function I(e,t){if("boolean"!=typeof t)throw new Error("noUiSlider: 'animate' option must be a boolean.");e.animate=t}function P(e,t){if("number"!=typeof t)throw new Error("noUiSlider: 'animationDuration' option must be a number.");e.animationDuration=t}function R(e,t){var i,n=[!1];if("lower"===t?t=[!0,!1]:"upper"===t&&(t=[!1,!0]),!0===t||!1===t){for(i=1;i<e.handles;i++)n.push(t);n.push(!1)}else{if(!Array.isArray(t)||!t.length||t.length!==e.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");n=t}e.connect=n}function O(e,t){switch(t){case"horizontal":e.ort=0;break;case"vertical":e.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function z(e,t){if(!c(t))throw new Error("noUiSlider: 'margin' option must be numeric.");0!==t&&(e.margin=e.spectrum.getDistance(t))}function F(e,t){if(!c(t))throw new Error("noUiSlider: 'limit' option must be numeric.");if(e.limit=e.spectrum.getDistance(t),!e.limit||e.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function N(e,t){var i;if(!c(t)&&!Array.isArray(t))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(t)&&2!==t.length&&!c(t[0])&&!c(t[1]))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(0!==t){for(Array.isArray(t)||(t=[t,t]),e.padding=[e.spectrum.getDistance(t[0]),e.spectrum.getDistance(t[1])],i=0;i<e.spectrum.xNumSteps.length-1;i++)if(e.padding[0][i]<0||e.padding[1][i]<0)throw new Error("noUiSlider: 'padding' option must be a positive number(s).");var n=t[0]+t[1],r=e.spectrum.xVal[0];if(n/(e.spectrum.xVal[e.spectrum.xVal.length-1]-r)>1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function Y(e,t){switch(t){case"ltr":e.dir=0;break;case"rtl":e.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function B(e,t){if("string"!=typeof t)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var i=t.indexOf("tap")>=0,n=t.indexOf("drag")>=0,r=t.indexOf("fixed")>=0,s=t.indexOf("snap")>=0,o=t.indexOf("hover")>=0,a=t.indexOf("unconstrained")>=0,l=t.indexOf("invert-connects")>=0,c=t.indexOf("drag-all")>=0,h=t.indexOf("smooth-steps")>=0;if(r){if(2!==e.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");z(e,e.start[1]-e.start[0])}if(l&&2!==e.handles)throw new Error("noUiSlider: 'invert-connects' behaviour must be used with 2 handles");if(a&&(e.margin||e.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");e.events={tap:i||s,drag:n,dragAll:c,smoothSteps:h,fixed:r,snap:s,hover:o,unconstrained:a,invertConnects:l}}function H(e,t){if(!1!==t)if(!0===t||s(t)){e.tooltips=[];for(var i=0;i<e.handles;i++)e.tooltips.push(t)}else{if((t=u(t)).length!==e.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");t.forEach(function(e){if("boolean"!=typeof e&&!s(e))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")}),e.tooltips=t}}function j(e,t){if(t.length!==e.handles)throw new Error("noUiSlider: must pass a attributes for all handles.");e.handleAttributes=t}function V(e,t){if(!s(t))throw new Error("noUiSlider: 'ariaFormat' requires 'to' method.");e.ariaFormat=t}function W(e,t){if(!function(e){return s(e)&&"function"==typeof e.from}(t))throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.");e.format=t}function U(e,t){if("boolean"!=typeof t)throw new Error("noUiSlider: 'keyboardSupport' option must be a boolean.");e.keyboardSupport=t}function $(e,t){e.documentElement=t}function G(e,t){if("string"!=typeof t&&!1!==t)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");e.cssPrefix=t}function X(e,t){if("object"!=typeof t)throw new Error("noUiSlider: 'cssClasses' must be an object.");"string"==typeof e.cssPrefix?(e.cssClasses={},Object.keys(t).forEach(function(i){e.cssClasses[i]=e.cssPrefix+t[i]})):e.cssClasses=t}function q(e){var t={margin:null,limit:null,padding:null,animate:!0,animationDuration:300,ariaFormat:b,format:b},i={step:{r:!1,t:k},keyboardPageMultiplier:{r:!1,t:M},keyboardMultiplier:{r:!1,t:A},keyboardDefaultStep:{r:!1,t:C},start:{r:!0,t:L},connect:{r:!0,t:R},direction:{r:!0,t:Y},snap:{r:!1,t:E},animate:{r:!1,t:I},animationDuration:{r:!1,t:P},range:{r:!0,t:D},orientation:{r:!1,t:O},margin:{r:!1,t:z},limit:{r:!1,t:F},padding:{r:!1,t:N},behaviour:{r:!0,t:B},ariaFormat:{r:!1,t:V},format:{r:!1,t:W},tooltips:{r:!1,t:H},keyboardSupport:{r:!0,t:U},documentElement:{r:!1,t:$},cssPrefix:{r:!0,t:G},cssClasses:{r:!0,t:X},handleAttributes:{r:!1,t:j}},n={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",cssClasses:w,keyboardPageMultiplier:5,keyboardMultiplier:1,keyboardDefaultStep:10};e.format&&!e.ariaFormat&&(e.ariaFormat=e.format),Object.keys(i).forEach(function(r){if(a(e[r])||void 0!==n[r])i[r].t(t,a(e[r])?e[r]:n[r]);else if(i[r].r)throw new Error("noUiSlider: '"+r+"' is required.")}),t.pips=e.pips;var r=document.createElement("div"),s=void 0!==r.style.msTransform,o=void 0!==r.style.transform;return t.transformRule=o?"transform":s?"msTransform":"webkitTransform",t.style=[["left","top"],["right","bottom"]][t.dir][t.ort],t}function Z(e,t,i){var s,c,f,_,y,v,x,b=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},w=window.CSS&&CSS.supports&&CSS.supports("touch-action","none")&&function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(e){}return e}(),k=e,M=t.spectrum,A=[],C=[],D=[],L=0,E={},I=!1,P=e.ownerDocument,O=t.documentElement||P.documentElement,z=P.body,F="rtl"===P.dir||1===t.ort?0:100;function N(e,t){var i=P.createElement("div");return t&&p(i,t),e.appendChild(i),i}function Y(e,i){var n=N(e,t.cssClasses.origin),r=N(n,t.cssClasses.handle);if(N(r,t.cssClasses.touchArea),r.setAttribute("data-handle",String(i)),t.keyboardSupport&&(r.setAttribute("tabindex","0"),r.addEventListener("keydown",function(e){return function(e,i){if(j()||V(i))return!1;var n=["Left","Right"],r=["Down","Up"],s=["PageDown","PageUp"],o=["Home","End"];t.dir&&!t.ort?n.reverse():t.ort&&!t.dir&&(r.reverse(),s.reverse());var a,l=e.key.replace("Arrow",""),c=l===s[0],h=l===s[1],d=l===r[0]||l===n[0]||c,u=l===r[1]||l===n[1]||h,f=l===o[1];if(!(d||u||l===o[0]||f))return!0;if(e.preventDefault(),u||d){var p=d?0:1,m=ve(i)[p];if(null===m)return!1;!1===m&&(m=M.getDefaultStep(C[i],d,t.keyboardDefaultStep)),m*=h||c?t.keyboardPageMultiplier:t.keyboardMultiplier,m=Math.max(m,1e-7),m*=d?-1:1,a=A[i]+m}else a=f?t.spectrum.xVal[t.spectrum.xVal.length-1]:t.spectrum.xVal[0];return pe(i,M.toStepping(a),!0,!0),le("slide",i),le("update",i),le("change",i),le("set",i),!1}(e,i)})),void 0!==t.handleAttributes){var s=t.handleAttributes[i];Object.keys(s).forEach(function(e){r.setAttribute(e,s[e])})}return r.setAttribute("role","slider"),r.setAttribute("aria-orientation",t.ort?"vertical":"horizontal"),0===i?p(r,t.cssClasses.handleLower):i===t.handles-1&&p(r,t.cssClasses.handleUpper),n.handle=r,n}function B(e,i){return!!i&&N(e,t.cssClasses.connect)}function H(e,i){return!(!t.tooltips||!t.tooltips[i])&&N(e.firstChild,t.cssClasses.tooltip)}function j(){return k.hasAttribute("disabled")}function V(e){return f[e].hasAttribute("disabled")}function W(){v&&(ae("update"+S),v.forEach(function(e){e&&o(e)}),v=null)}function U(){W(),v=f.map(H),oe("update"+S,function(e,i,n){if(v&&t.tooltips&&!1!==v[i]){var r=e[i];!0!==t.tooltips[i]&&(r=t.tooltips[i].to(n[i])),v[i].innerHTML=r}})}function $(e,t){return e.map(function(e){return M.fromStepping(t?M.getStep(e):e)})}function G(){y&&(o(y),y=null)}function X(e){G();var i=function(e){function t(e,t){return Number((e+t).toFixed(7))}var i,s=function(e){if(e.mode===n.Range||e.mode===n.Steps)return M.xVal;if(e.mode===n.Count){if(e.values<2)throw new Error("noUiSlider: 'values' (>= 2) required for mode 'count'.");for(var t=e.values-1,i=100/t,r=[];t--;)r[t]=t*i;return r.push(100),$(r,e.stepped)}return e.mode===n.Positions?$(e.values,e.stepped):e.mode===n.Values?e.stepped?e.values.map(function(e){return M.fromStepping(M.getStep(M.toStepping(e)))}):e.values:[]}(e),o={},a=M.xVal[0],l=M.xVal[M.xVal.length-1],c=!1,h=!1,d=0;return i=s.slice().sort(function(e,t){return e-t}),(s=i.filter(function(e){return!this[e]&&(this[e]=!0)},{}))[0]!==a&&(s.unshift(a),c=!0),s[s.length-1]!==l&&(s.push(l),h=!0),s.forEach(function(i,a){var l,u,f,p,m,g,_,y,v,x,b=i,w=s[a+1],S=e.mode===n.Steps;for(S&&(l=M.xNumSteps[a]),l||(l=w-b),void 0===w&&(w=b),l=Math.max(l,1e-7),u=b;u<=w;u=t(u,l)){for(y=(m=(p=M.toStepping(u))-d)/(e.density||1),x=m/(v=Math.round(y)),f=1;f<=v;f+=1)o[(g=d+f*x).toFixed(5)]=[M.fromStepping(g),0];_=s.indexOf(u)>-1?r.LargeValue:S?r.SmallValue:r.NoValue,!a&&c&&u!==w&&(_=0),u===w&&h||(o[p.toFixed(5)]=[u,_]),d=p}}),o}(e),s=e.filter,o=e.format||{to:function(e){return String(Math.round(e))}};return y=k.appendChild(function(e,i,n){var s,o,a=P.createElement("div"),l=((s={})[r.None]="",s[r.NoValue]=t.cssClasses.valueNormal,s[r.LargeValue]=t.cssClasses.valueLarge,s[r.SmallValue]=t.cssClasses.valueSub,s),c=((o={})[r.None]="",o[r.NoValue]=t.cssClasses.markerNormal,o[r.LargeValue]=t.cssClasses.markerLarge,o[r.SmallValue]=t.cssClasses.markerSub,o),h=[t.cssClasses.valueHorizontal,t.cssClasses.valueVertical],d=[t.cssClasses.markerHorizontal,t.cssClasses.markerVertical];function u(e,i){var n=i===t.cssClasses.value,r=n?l:c;return i+" "+(n?h:d)[t.ort]+" "+r[e]}return p(a,t.cssClasses.pips),p(a,0===t.ort?t.cssClasses.pipsHorizontal:t.cssClasses.pipsVertical),Object.keys(e).forEach(function(s){!function(e,s,o){if((o=i?i(s,o):o)!==r.None){var l=N(a,!1);l.className=u(o,t.cssClasses.marker),l.style[t.style]=e+"%",o>r.NoValue&&((l=N(a,!1)).className=u(o,t.cssClasses.value),l.setAttribute("data-value",String(s)),l.style[t.style]=e+"%",l.innerHTML=String(n.to(s)))}}(s,e[s][0],e[s][1])}),a}(i,s,o))}function Z(){var e=s.getBoundingClientRect(),i="offset"+["Width","Height"][t.ort];return 0===t.ort?e.width||s[i]:e.height||s[i]}function J(e,i,n,r){var s=function(s){var o,a,l=function(e,t,i){var n=0===e.type.indexOf("touch"),r=0===e.type.indexOf("mouse"),s=0===e.type.indexOf("pointer"),o=0,a=0;if(0===e.type.indexOf("MSPointer")&&(s=!0),"mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(n){var l=function(t){var n=t.target;return n===i||i.contains(n)||e.composed&&e.composedPath().shift()===i};if("touchstart"===e.type){var c=Array.prototype.filter.call(e.touches,l);if(c.length>1)return!1;o=c[0].pageX,a=c[0].pageY}else{var h=Array.prototype.find.call(e.changedTouches,l);if(!h)return!1;o=h.pageX,a=h.pageY}}return t=t||g(P),(r||s)&&(o=e.clientX+t.x,a=e.clientY+t.y),e.pageOffset=t,e.points=[o,a],e.cursor=r||s,e}(s,r.pageOffset,r.target||i);return!!l&&!(j()&&!r.doNotReject)&&(o=k,a=t.cssClasses.tap,!((o.classList?o.classList.contains(a):new RegExp("\\b"+a+"\\b").test(o.className))&&!r.doNotReject)&&!(e===b.start&&void 0!==l.buttons&&l.buttons>1)&&(!r.hover||!l.buttons)&&(w||l.preventDefault(),l.calcPoint=l.points[t.ort],void n(l,r)))},o=[];return e.split(" ").forEach(function(e){i.addEventListener(e,s,!!w&&{passive:!0}),o.push([e,s])}),o}function K(e){var i,n,r,o,a,l,c=100*(e-(i=s,n=t.ort,r=i.getBoundingClientRect(),a=(o=i.ownerDocument).documentElement,l=g(o),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(l.x=0),n?r.top+l.y-a.clientTop:r.left+l.x-a.clientLeft))/Z();return c=d(c),t.dir?100-c:c}function Q(e,t){"mouseout"===e.type&&"HTML"===e.target.nodeName&&null===e.relatedTarget&&te(e,t)}function ee(e,i){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===e.buttons&&0!==i.buttonsProperty)return te(e,i);var n=(t.dir?-1:1)*(e.calcPoint-i.startCalcPoint);de(n>0,100*n/i.baseSize,i.locations,i.handleNumbers,i.connect)}function te(e,i){i.handle&&(m(i.handle,t.cssClasses.active),L-=1),i.listeners.forEach(function(e){O.removeEventListener(e[0],e[1])}),0===L&&(m(k,t.cssClasses.drag),fe(),e.cursor&&(z.style.cursor="",z.removeEventListener("selectstart",l))),t.events.smoothSteps&&(i.handleNumbers.forEach(function(e){pe(e,C[e],!0,!0,!1,!1)}),i.handleNumbers.forEach(function(e){le("update",e)})),i.handleNumbers.forEach(function(e){le("change",e),le("set",e),le("end",e)})}function ie(e,i){if(!i.handleNumbers.some(V)){var n;1===i.handleNumbers.length&&(n=f[i.handleNumbers[0]].children[0],L+=1,p(n,t.cssClasses.active)),e.stopPropagation();var r=[],s=J(b.move,O,ee,{target:e.target,handle:n,connect:i.connect,listeners:r,startCalcPoint:e.calcPoint,baseSize:Z(),pageOffset:e.pageOffset,handleNumbers:i.handleNumbers,buttonsProperty:e.buttons,locations:C.slice()}),o=J(b.end,O,te,{target:e.target,handle:n,listeners:r,doNotReject:!0,handleNumbers:i.handleNumbers}),a=J("mouseout",O,Q,{target:e.target,handle:n,listeners:r,doNotReject:!0,handleNumbers:i.handleNumbers});r.push.apply(r,s.concat(o,a)),e.cursor&&(z.style.cursor=getComputedStyle(e.target).cursor,f.length>1&&p(k,t.cssClasses.drag),z.addEventListener("selectstart",l,!1)),i.handleNumbers.forEach(function(e){le("start",e)})}}function ne(e){e.stopPropagation();var i=K(e.calcPoint),n=function(e){var t=100,i=!1;return f.forEach(function(n,r){if(!V(r)){var s=C[r],o=Math.abs(s-e);(o<t||o<=t&&e>s||100===o&&100===t)&&(i=r,t=o)}}),i}(i);!1!==n&&(t.events.snap||h(k,t.cssClasses.tap,t.animationDuration),pe(n,i,!0,!0),fe(),le("slide",n,!0),le("update",n,!0),t.events.snap?ie(e,{handleNumbers:[n]}):(le("change",n,!0),le("set",n,!0)))}function re(e){var t=K(e.calcPoint),i=M.getStep(t),n=M.fromStepping(i);Object.keys(E).forEach(function(e){"hover"===e.split(".")[0]&&E[e].forEach(function(e){e.call(be,n)})})}function se(e){e.fixed||f.forEach(function(e,t){J(b.start,e.children[0],ie,{handleNumbers:[t]})}),e.tap&&J(b.start,s,ne,{}),e.hover&&J(b.move,s,re,{hover:!0}),e.drag&&_.forEach(function(i,n){if(!1!==i&&0!==n&&n!==_.length-1){var r=f[n-1],s=f[n],o=[i],a=[r,s],l=[n-1,n];p(i,t.cssClasses.draggable),e.fixed&&(o.push(r.children[0]),o.push(s.children[0])),e.dragAll&&(a=f,l=D),o.forEach(function(e){J(b.start,e,ie,{handles:a,handleNumbers:l,connect:i})})}})}function oe(e,t){E[e]=E[e]||[],E[e].push(t),"update"===e.split(".")[0]&&f.forEach(function(e,t){le("update",t)})}function ae(e){var t=e&&e.split(".")[0],i=t?e.substring(t.length):e;Object.keys(E).forEach(function(e){var n=e.split(".")[0],r=e.substring(n.length);t&&t!==n||i&&i!==r||function(e){return e===T||e===S}(r)&&i!==r||delete E[e]})}function le(e,i,n){Object.keys(E).forEach(function(r){var s=r.split(".")[0];e===s&&E[r].forEach(function(e){e.call(be,A.map(t.format.to),i,A.slice(),n||!1,C.slice(),be)})})}function ce(e,i,n,r,s,o,a){var l;return f.length>1&&!t.events.unconstrained&&(r&&i>0&&(l=M.getAbsoluteDistance(e[i-1],t.margin,!1),n=Math.max(n,l)),s&&i<f.length-1&&(l=M.getAbsoluteDistance(e[i+1],t.margin,!0),n=Math.min(n,l))),f.length>1&&t.limit&&(r&&i>0&&(l=M.getAbsoluteDistance(e[i-1],t.limit,!1),n=Math.min(n,l)),s&&i<f.length-1&&(l=M.getAbsoluteDistance(e[i+1],t.limit,!0),n=Math.max(n,l))),t.padding&&(0===i&&(l=M.getAbsoluteDistance(0,t.padding[0],!1),n=Math.max(n,l)),i===f.length-1&&(l=M.getAbsoluteDistance(100,t.padding[1],!0),n=Math.min(n,l))),a||(n=M.getStep(n)),!((n=d(n))===e[i]&&!o)&&n}function he(e,i){var n=t.ort;return(n?i:e)+", "+(n?e:i)}function de(e,i,n,r,s){var o=n.slice(),a=r[0],l=t.events.smoothSteps,c=[!e,e],h=[e,!e];r=r.slice(),e&&r.reverse(),r.length>1?r.forEach(function(e,t){var n=ce(o,e,o[e]+i,c[t],h[t],!1,l);!1===n?i=0:(i=n-o[e],o[e]=n)}):c=h=[!0];var d=!1;r.forEach(function(e,t){d=pe(e,n[e]+i,c[t],h[t],!1,l)||d}),d&&(r.forEach(function(e){le("update",e),le("slide",e)}),null!=s&&le("drag",a))}function ue(e,i){return t.dir?100-e-i:e}function fe(){D.forEach(function(e){var t=C[e]>50?-1:1,i=3+(f.length+t*e);f[e].style.zIndex=String(i)})}function pe(e,i,n,r,s,o){return s||(i=ce(C,e,i,n,r,!1,o)),!1!==i&&(function(e,i){C[e]=i,A[e]=M.fromStepping(i);var n="translate("+he(ue(i,0)-F+"%","0")+")";if(f[e].style[t.transformRule]=n,t.events.invertConnects&&C.length>1){var r=C.every(function(e,t,i){return 0===t||e>=i[t-1]});if(I!==!r)return I=!I,R(t,t.connect.map(function(e){return!e})),void xe()}me(e),me(e+1),I&&(me(e-1),me(e+2))}(e,i),!0)}function me(e){if(_[e]){var i=C.slice();I&&i.sort(function(e,t){return e-t});var n=0,r=100;0!==e&&(n=i[e-1]),e!==_.length-1&&(r=i[e]);var s=r-n,o="translate("+he(ue(n,s)+"%","0")+")",a="scale("+he(s/100,"1")+")";_[e].style[t.transformRule]=o+" "+a}}function ge(e,i){return null===e||!1===e||void 0===e?C[i]:("number"==typeof e&&(e=String(e)),!1!==(e=t.format.from(e))&&(e=M.toStepping(e)),!1===e||isNaN(e)?C[i]:e)}function _e(e,i,n){var r=u(e),s=void 0===C[0];i=void 0===i||i,t.animate&&!s&&h(k,t.cssClasses.tap,t.animationDuration),D.forEach(function(e){pe(e,ge(r[e],e),!0,!1,n)});var o=1===D.length?0:1;if(s&&M.hasNoSize()&&(n=!0,C[0]=0,D.length>1)){var a=100/(D.length-1);D.forEach(function(e){C[e]=e*a})}for(;o<D.length;++o)D.forEach(function(e){pe(e,C[e],!0,!0,n)});fe(),D.forEach(function(e){le("update",e),null!==r[e]&&i&&le("set",e)})}function ye(e){if(void 0===e&&(e=!1),e)return 1===A.length?A[0]:A.slice(0);var i=A.map(t.format.to);return 1===i.length?i[0]:i}function ve(e){var i=C[e],n=M.getNearbySteps(i),r=A[e],s=n.thisStep.step,o=null;if(t.snap)return[r-n.stepBefore.startValue||null,n.stepAfter.startValue-r||null];!1!==s&&r+s>n.stepAfter.startValue&&(s=n.stepAfter.startValue-r),o=r>n.thisStep.startValue?n.thisStep.step:!1!==n.stepBefore.step&&r-n.stepBefore.highestStep,100===i?s=null:0===i&&(o=null);var a=M.countStepDecimals();return null!==s&&!1!==s&&(s=Number(s.toFixed(a))),null!==o&&!1!==o&&(o=Number(o.toFixed(a))),[o,s]}function xe(){for(;c.firstChild;)c.removeChild(c.firstChild);for(var e=0;e<=t.handles;e++)_[e]=B(c,t.connect[e]),me(e);se({drag:t.events.drag,fixed:!0})}p(x=k,t.cssClasses.target),0===t.dir?p(x,t.cssClasses.ltr):p(x,t.cssClasses.rtl),0===t.ort?p(x,t.cssClasses.horizontal):p(x,t.cssClasses.vertical),p(x,"rtl"===getComputedStyle(x).direction?t.cssClasses.textDirectionRtl:t.cssClasses.textDirectionLtr),s=N(x,t.cssClasses.base),function(e,i){c=N(i,t.cssClasses.connects),f=[],(_=[]).push(B(c,e[0]));for(var n=0;n<t.handles;n++)f.push(Y(i,n)),D[n]=n,_.push(B(c,e[n+1]))}(t.connect,s),se(t.events),_e(t.start),t.pips&&X(t.pips),t.tooltips&&U(),ae("update"+T),oe("update"+T,function(e,i,n,r,s){D.forEach(function(e){var i=f[e],r=ce(C,e,0,!0,!0,!0),o=ce(C,e,100,!0,!0,!0),a=s[e],l=String(t.ariaFormat.to(n[e]));r=M.fromStepping(r).toFixed(1),o=M.fromStepping(o).toFixed(1),a=M.fromStepping(a).toFixed(1),i.children[0].setAttribute("aria-valuemin",r),i.children[0].setAttribute("aria-valuemax",o),i.children[0].setAttribute("aria-valuenow",a),i.children[0].setAttribute("aria-valuetext",l)})});var be={destroy:function(){for(ae(T),ae(S),Object.keys(t.cssClasses).forEach(function(e){m(k,t.cssClasses[e])});k.firstChild;)k.removeChild(k.firstChild);delete k.noUiSlider},steps:function(){return D.map(ve)},on:oe,off:ae,get:ye,set:_e,setHandle:function(e,t,i,n){if(!((e=Number(e))>=0&&e<D.length))throw new Error("noUiSlider: invalid handle number, got: "+e);pe(e,ge(t,e),!0,!0,n),le("update",e),i&&le("set",e)},reset:function(e){_e(t.start,e)},disable:function(e){null!=e?(f[e].setAttribute("disabled",""),f[e].handle.removeAttribute("tabindex")):(k.setAttribute("disabled",""),f.forEach(function(e){e.handle.removeAttribute("tabindex")}))},enable:function(e){null!=e?(f[e].removeAttribute("disabled"),f[e].handle.setAttribute("tabindex","0")):(k.removeAttribute("disabled"),f.forEach(function(e){e.removeAttribute("disabled"),e.handle.setAttribute("tabindex","0")}))},__moveHandles:function(e,t,i){de(e,t,C,i)},options:i,updateOptions:function(e,n){var r=ye(),s=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips","connect"];s.forEach(function(t){void 0!==e[t]&&(i[t]=e[t])});var o=q(i);s.forEach(function(i){void 0!==e[i]&&(t[i]=o[i])}),M=o.spectrum,t.margin=o.margin,t.limit=o.limit,t.padding=o.padding,t.pips?X(t.pips):G(),t.tooltips?U():W(),C=[],_e(a(e.start)?e.start:r,n),e.connect&&xe()},target:k,removePips:G,removeTooltips:W,getPositions:function(){return C.slice()},getTooltips:function(){return v},getOrigins:function(){return f},pips:X};return be}const J={__spectrum:x,cssClasses:w,create:function(e,t){if(!e||!e.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+e);if(e.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");var i=Z(e,q(t),t);return e.noUiSlider=i,i}}},9527:function(e,t,i){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,i){switch(i){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(i(5093))},9532:function(e,t,i){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function i(e,t,i){return i?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function n(e,n,r){return e+" "+i(t[r],e,n)}function r(e,n,r){return i(t[r],e,n)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:n,m:r,mm:n,h:r,hh:n,d:r,dd:n,M:r,MM:n,y:r,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},9599:(e,t,i)=>{var n,r,s;!function(){"use strict";r=[i(4692)],n=function(e){var t,i=window.Slick||{};(t=0,i=function(i,n){var r,s=this;s.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:e(i),appendDots:e(i),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(t,i){return e('<button type="button" />').text(i+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},s.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},e.extend(s,s.initials),s.activeBreakpoint=null,s.animType=null,s.animProp=null,s.breakpoints=[],s.breakpointSettings=[],s.cssTransitions=!1,s.focussed=!1,s.interrupted=!1,s.hidden="hidden",s.paused=!0,s.positionProp=null,s.respondTo=null,s.rowCount=1,s.shouldClick=!0,s.$slider=e(i),s.$slidesCache=null,s.transformType=null,s.transitionType=null,s.visibilityChange="visibilitychange",s.windowWidth=0,s.windowTimer=null,r=e(i).data("slick")||{},s.options=e.extend({},s.defaults,n,r),s.currentSlide=s.options.initialSlide,s.originalSettings=s.options,void 0!==document.mozHidden?(s.hidden="mozHidden",s.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(s.hidden="webkitHidden",s.visibilityChange="webkitvisibilitychange"),s.autoPlay=e.proxy(s.autoPlay,s),s.autoPlayClear=e.proxy(s.autoPlayClear,s),s.autoPlayIterator=e.proxy(s.autoPlayIterator,s),s.changeSlide=e.proxy(s.changeSlide,s),s.clickHandler=e.proxy(s.clickHandler,s),s.selectHandler=e.proxy(s.selectHandler,s),s.setPosition=e.proxy(s.setPosition,s),s.swipeHandler=e.proxy(s.swipeHandler,s),s.dragHandler=e.proxy(s.dragHandler,s),s.keyHandler=e.proxy(s.keyHandler,s),s.instanceUid=t++,s.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,s.registerBreakpoints(),s.init(!0)}).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},i.prototype.addSlide=i.prototype.slickAdd=function(t,i,n){var r=this;if("boolean"==typeof i)n=i,i=null;else if(i<0||i>=r.slideCount)return!1;r.unload(),"number"==typeof i?0===i&&0===r.$slides.length?e(t).appendTo(r.$slideTrack):n?e(t).insertBefore(r.$slides.eq(i)):e(t).insertAfter(r.$slides.eq(i)):!0===n?e(t).prependTo(r.$slideTrack):e(t).appendTo(r.$slideTrack),r.$slides=r.$slideTrack.children(this.options.slide),r.$slideTrack.children(this.options.slide).detach(),r.$slideTrack.append(r.$slides),r.$slides.each(function(t,i){e(i).attr("data-slick-index",t)}),r.$slidesCache=r.$slides,r.reinit()},i.prototype.animateHeight=function(){var e=this;if(1===e.options.slidesToShow&&!0===e.options.adaptiveHeight&&!1===e.options.vertical){var t=e.$slides.eq(e.currentSlide).outerHeight(!0);e.$list.animate({height:t},e.options.speed)}},i.prototype.animateSlide=function(t,i){var n={},r=this;r.animateHeight(),!0===r.options.rtl&&!1===r.options.vertical&&(t=-t),!1===r.transformsEnabled?!1===r.options.vertical?r.$slideTrack.animate({left:t},r.options.speed,r.options.easing,i):r.$slideTrack.animate({top:t},r.options.speed,r.options.easing,i):!1===r.cssTransitions?(!0===r.options.rtl&&(r.currentLeft=-r.currentLeft),e({animStart:r.currentLeft}).animate({animStart:t},{duration:r.options.speed,easing:r.options.easing,step:function(e){e=Math.ceil(e),!1===r.options.vertical?(n[r.animType]="translate("+e+"px, 0px)",r.$slideTrack.css(n)):(n[r.animType]="translate(0px,"+e+"px)",r.$slideTrack.css(n))},complete:function(){i&&i.call()}})):(r.applyTransition(),t=Math.ceil(t),!1===r.options.vertical?n[r.animType]="translate3d("+t+"px, 0px, 0px)":n[r.animType]="translate3d(0px,"+t+"px, 0px)",r.$slideTrack.css(n),i&&setTimeout(function(){r.disableTransition(),i.call()},r.options.speed))},i.prototype.getNavTarget=function(){var t=this.options.asNavFor;return t&&null!==t&&(t=e(t).not(this.$slider)),t},i.prototype.asNavFor=function(t){var i=this.getNavTarget();null!==i&&"object"==typeof i&&i.each(function(){var i=e(this).slick("getSlick");i.unslicked||i.slideHandler(t,!0)})},i.prototype.applyTransition=function(e){var t=this,i={};!1===t.options.fade?i[t.transitionType]=t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:i[t.transitionType]="opacity "+t.options.speed+"ms "+t.options.cssEase,!1===t.options.fade?t.$slideTrack.css(i):t.$slides.eq(e).css(i)},i.prototype.autoPlay=function(){var e=this;e.autoPlayClear(),e.slideCount>e.options.slidesToShow&&(e.autoPlayTimer=setInterval(e.autoPlayIterator,e.options.autoplaySpeed))},i.prototype.autoPlayClear=function(){this.autoPlayTimer&&clearInterval(this.autoPlayTimer)},i.prototype.autoPlayIterator=function(){var e=this,t=e.currentSlide+e.options.slidesToScroll;e.paused||e.interrupted||e.focussed||(!1===e.options.infinite&&(1===e.direction&&e.currentSlide+1===e.slideCount-1?e.direction=0:0===e.direction&&(t=e.currentSlide-e.options.slidesToScroll,e.currentSlide-1==0&&(e.direction=1))),e.slideHandler(t))},i.prototype.buildArrows=function(){var t=this;!0===t.options.arrows&&(t.$prevArrow=e(t.options.prevArrow).addClass("slick-arrow"),t.$nextArrow=e(t.options.nextArrow).addClass("slick-arrow"),t.slideCount>t.options.slidesToShow?(t.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.prependTo(t.options.appendArrows),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.appendTo(t.options.appendArrows),!0!==t.options.infinite&&t.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},i.prototype.buildDots=function(){var t,i,n=this;if(!0===n.options.dots&&n.slideCount>n.options.slidesToShow){for(n.$slider.addClass("slick-dotted"),i=e("<ul />").addClass(n.options.dotsClass),t=0;t<=n.getDotCount();t+=1)i.append(e("<li />").append(n.options.customPaging.call(this,n,t)));n.$dots=i.appendTo(n.options.appendDots),n.$dots.find("li").first().addClass("slick-active")}},i.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide"),t.slideCount=t.$slides.length,t.$slides.each(function(t,i){e(i).attr("data-slick-index",t).data("originalStyling",e(i).attr("style")||"")}),t.$slider.addClass("slick-slider"),t.$slideTrack=0===t.slideCount?e('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent(),t.$list=t.$slideTrack.wrap('<div class="slick-list"/>').parent(),t.$slideTrack.css("opacity",0),!0!==t.options.centerMode&&!0!==t.options.swipeToSlide||(t.options.slidesToScroll=1),e("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading"),t.setupInfinite(),t.buildArrows(),t.buildDots(),t.updateDots(),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),!0===t.options.draggable&&t.$list.addClass("draggable")},i.prototype.buildRows=function(){var e,t,i,n,r,s,o,a=this;if(n=document.createDocumentFragment(),s=a.$slider.children(),a.options.rows>0){for(o=a.options.slidesPerRow*a.options.rows,r=Math.ceil(s.length/o),e=0;e<r;e++){var l=document.createElement("div");for(t=0;t<a.options.rows;t++){var c=document.createElement("div");for(i=0;i<a.options.slidesPerRow;i++){var h=e*o+(t*a.options.slidesPerRow+i);s.get(h)&&c.appendChild(s.get(h))}l.appendChild(c)}n.appendChild(l)}a.$slider.empty().append(n),a.$slider.children().children().children().css({width:100/a.options.slidesPerRow+"%",display:"inline-block"})}},i.prototype.checkResponsive=function(t,i){var n,r,s,o=this,a=!1,l=o.$slider.width(),c=window.innerWidth||e(window).width();if("window"===o.respondTo?s=c:"slider"===o.respondTo?s=l:"min"===o.respondTo&&(s=Math.min(c,l)),o.options.responsive&&o.options.responsive.length&&null!==o.options.responsive){for(n in r=null,o.breakpoints)o.breakpoints.hasOwnProperty(n)&&(!1===o.originalSettings.mobileFirst?s<o.breakpoints[n]&&(r=o.breakpoints[n]):s>o.breakpoints[n]&&(r=o.breakpoints[n]));null!==r?null!==o.activeBreakpoint?(r!==o.activeBreakpoint||i)&&(o.activeBreakpoint=r,"unslick"===o.breakpointSettings[r]?o.unslick(r):(o.options=e.extend({},o.originalSettings,o.breakpointSettings[r]),!0===t&&(o.currentSlide=o.options.initialSlide),o.refresh(t)),a=r):(o.activeBreakpoint=r,"unslick"===o.breakpointSettings[r]?o.unslick(r):(o.options=e.extend({},o.originalSettings,o.breakpointSettings[r]),!0===t&&(o.currentSlide=o.options.initialSlide),o.refresh(t)),a=r):null!==o.activeBreakpoint&&(o.activeBreakpoint=null,o.options=o.originalSettings,!0===t&&(o.currentSlide=o.options.initialSlide),o.refresh(t),a=r),t||!1===a||o.$slider.trigger("breakpoint",[o,a])}},i.prototype.changeSlide=function(t,i){var n,r,s=this,o=e(t.currentTarget);switch(o.is("a")&&t.preventDefault(),o.is("li")||(o=o.closest("li")),n=s.slideCount%s.options.slidesToScroll!==0?0:(s.slideCount-s.currentSlide)%s.options.slidesToScroll,t.data.message){case"previous":r=0===n?s.options.slidesToScroll:s.options.slidesToShow-n,s.slideCount>s.options.slidesToShow&&s.slideHandler(s.currentSlide-r,!1,i);break;case"next":r=0===n?s.options.slidesToScroll:n,s.slideCount>s.options.slidesToShow&&s.slideHandler(s.currentSlide+r,!1,i);break;case"index":var a=0===t.data.index?0:t.data.index||o.index()*s.options.slidesToScroll;s.slideHandler(s.checkNavigable(a),!1,i),o.children().trigger("focus");break;default:return}},i.prototype.checkNavigable=function(e){var t,i;if(i=0,e>(t=this.getNavigableIndexes())[t.length-1])e=t[t.length-1];else for(var n in t){if(e<t[n]){e=i;break}i=t[n]}return e},i.prototype.cleanUpEvents=function(){var t=this;t.options.dots&&null!==t.$dots&&(e("li",t.$dots).off("click.slick",t.changeSlide).off("mouseenter.slick",e.proxy(t.interrupt,t,!0)).off("mouseleave.slick",e.proxy(t.interrupt,t,!1)),!0===t.options.accessibility&&t.$dots.off("keydown.slick",t.keyHandler)),t.$slider.off("focus.slick blur.slick"),!0===t.options.arrows&&t.slideCount>t.options.slidesToShow&&(t.$prevArrow&&t.$prevArrow.off("click.slick",t.changeSlide),t.$nextArrow&&t.$nextArrow.off("click.slick",t.changeSlide),!0===t.options.accessibility&&(t.$prevArrow&&t.$prevArrow.off("keydown.slick",t.keyHandler),t.$nextArrow&&t.$nextArrow.off("keydown.slick",t.keyHandler))),t.$list.off("touchstart.slick mousedown.slick",t.swipeHandler),t.$list.off("touchmove.slick mousemove.slick",t.swipeHandler),t.$list.off("touchend.slick mouseup.slick",t.swipeHandler),t.$list.off("touchcancel.slick mouseleave.slick",t.swipeHandler),t.$list.off("click.slick",t.clickHandler),e(document).off(t.visibilityChange,t.visibility),t.cleanUpSlideEvents(),!0===t.options.accessibility&&t.$list.off("keydown.slick",t.keyHandler),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().off("click.slick",t.selectHandler),e(window).off("orientationchange.slick.slick-"+t.instanceUid,t.orientationChange),e(window).off("resize.slick.slick-"+t.instanceUid,t.resize),e("[draggable!=true]",t.$slideTrack).off("dragstart",t.preventDefault),e(window).off("load.slick.slick-"+t.instanceUid,t.setPosition)},i.prototype.cleanUpSlideEvents=function(){var t=this;t.$list.off("mouseenter.slick",e.proxy(t.interrupt,t,!0)),t.$list.off("mouseleave.slick",e.proxy(t.interrupt,t,!1))},i.prototype.cleanUpRows=function(){var e,t=this;t.options.rows>0&&((e=t.$slides.children().children()).removeAttr("style"),t.$slider.empty().append(e))},i.prototype.clickHandler=function(e){!1===this.shouldClick&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())},i.prototype.destroy=function(t){var i=this;i.autoPlayClear(),i.touchObject={},i.cleanUpEvents(),e(".slick-cloned",i.$slider).detach(),i.$dots&&i.$dots.remove(),i.$prevArrow&&i.$prevArrow.length&&(i.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.prevArrow)&&i.$prevArrow.remove()),i.$nextArrow&&i.$nextArrow.length&&(i.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.nextArrow)&&i.$nextArrow.remove()),i.$slides&&(i.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){e(this).attr("style",e(this).data("originalStyling"))}),i.$slideTrack.children(this.options.slide).detach(),i.$slideTrack.detach(),i.$list.detach(),i.$slider.append(i.$slides)),i.cleanUpRows(),i.$slider.removeClass("slick-slider"),i.$slider.removeClass("slick-initialized"),i.$slider.removeClass("slick-dotted"),i.unslicked=!0,t||i.$slider.trigger("destroy",[i])},i.prototype.disableTransition=function(e){var t=this,i={};i[t.transitionType]="",!1===t.options.fade?t.$slideTrack.css(i):t.$slides.eq(e).css(i)},i.prototype.fadeSlide=function(e,t){var i=this;!1===i.cssTransitions?(i.$slides.eq(e).css({zIndex:i.options.zIndex}),i.$slides.eq(e).animate({opacity:1},i.options.speed,i.options.easing,t)):(i.applyTransition(e),i.$slides.eq(e).css({opacity:1,zIndex:i.options.zIndex}),t&&setTimeout(function(){i.disableTransition(e),t.call()},i.options.speed))},i.prototype.fadeSlideOut=function(e){var t=this;!1===t.cssTransitions?t.$slides.eq(e).animate({opacity:0,zIndex:t.options.zIndex-2},t.options.speed,t.options.easing):(t.applyTransition(e),t.$slides.eq(e).css({opacity:0,zIndex:t.options.zIndex-2}))},i.prototype.filterSlides=i.prototype.slickFilter=function(e){var t=this;null!==e&&(t.$slidesCache=t.$slides,t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(e).appendTo(t.$slideTrack),t.reinit())},i.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",function(i){i.stopImmediatePropagation();var n=e(this);setTimeout(function(){t.options.pauseOnFocus&&(t.focussed=n.is(":focus"),t.autoPlay())},0)})},i.prototype.getCurrent=i.prototype.slickCurrentSlide=function(){return this.currentSlide},i.prototype.getDotCount=function(){var e=this,t=0,i=0,n=0;if(!0===e.options.infinite)if(e.slideCount<=e.options.slidesToShow)++n;else for(;t<e.slideCount;)++n,t=i+e.options.slidesToScroll,i+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;else if(!0===e.options.centerMode)n=e.slideCount;else if(e.options.asNavFor)for(;t<e.slideCount;)++n,t=i+e.options.slidesToScroll,i+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;else n=1+Math.ceil((e.slideCount-e.options.slidesToShow)/e.options.slidesToScroll);return n-1},i.prototype.getLeft=function(e){var t,i,n,r,s=this,o=0;return s.slideOffset=0,i=s.$slides.first().outerHeight(!0),!0===s.options.infinite?(s.slideCount>s.options.slidesToShow&&(s.slideOffset=s.slideWidth*s.options.slidesToShow*-1,r=-1,!0===s.options.vertical&&!0===s.options.centerMode&&(2===s.options.slidesToShow?r=-1.5:1===s.options.slidesToShow&&(r=-2)),o=i*s.options.slidesToShow*r),s.slideCount%s.options.slidesToScroll!==0&&e+s.options.slidesToScroll>s.slideCount&&s.slideCount>s.options.slidesToShow&&(e>s.slideCount?(s.slideOffset=(s.options.slidesToShow-(e-s.slideCount))*s.slideWidth*-1,o=(s.options.slidesToShow-(e-s.slideCount))*i*-1):(s.slideOffset=s.slideCount%s.options.slidesToScroll*s.slideWidth*-1,o=s.slideCount%s.options.slidesToScroll*i*-1))):e+s.options.slidesToShow>s.slideCount&&(s.slideOffset=(e+s.options.slidesToShow-s.slideCount)*s.slideWidth,o=(e+s.options.slidesToShow-s.slideCount)*i),s.slideCount<=s.options.slidesToShow&&(s.slideOffset=0,o=0),!0===s.options.centerMode&&s.slideCount<=s.options.slidesToShow?s.slideOffset=s.slideWidth*Math.floor(s.options.slidesToShow)/2-s.slideWidth*s.slideCount/2:!0===s.options.centerMode&&!0===s.options.infinite?s.slideOffset+=s.slideWidth*Math.floor(s.options.slidesToShow/2)-s.slideWidth:!0===s.options.centerMode&&(s.slideOffset=0,s.slideOffset+=s.slideWidth*Math.floor(s.options.slidesToShow/2)),t=!1===s.options.vertical?e*s.slideWidth*-1+s.slideOffset:e*i*-1+o,!0===s.options.variableWidth&&(n=s.slideCount<=s.options.slidesToShow||!1===s.options.infinite?s.$slideTrack.children(".slick-slide").eq(e):s.$slideTrack.children(".slick-slide").eq(e+s.options.slidesToShow),t=!0===s.options.rtl?n[0]?-1*(s.$slideTrack.width()-n[0].offsetLeft-n.width()):0:n[0]?-1*n[0].offsetLeft:0,!0===s.options.centerMode&&(n=s.slideCount<=s.options.slidesToShow||!1===s.options.infinite?s.$slideTrack.children(".slick-slide").eq(e):s.$slideTrack.children(".slick-slide").eq(e+s.options.slidesToShow+1),t=!0===s.options.rtl?n[0]?-1*(s.$slideTrack.width()-n[0].offsetLeft-n.width()):0:n[0]?-1*n[0].offsetLeft:0,t+=(s.$list.width()-n.outerWidth())/2)),t},i.prototype.getOption=i.prototype.slickGetOption=function(e){return this.options[e]},i.prototype.getNavigableIndexes=function(){var e,t=this,i=0,n=0,r=[];for(!1===t.options.infinite?e=t.slideCount:(i=-1*t.options.slidesToScroll,n=-1*t.options.slidesToScroll,e=2*t.slideCount);i<e;)r.push(i),i=n+t.options.slidesToScroll,n+=t.options.slidesToScroll<=t.options.slidesToShow?t.options.slidesToScroll:t.options.slidesToShow;return r},i.prototype.getSlick=function(){return this},i.prototype.getSlideCount=function(){var t,i,n=this;return i=!0===n.options.centerMode?n.slideWidth*Math.floor(n.options.slidesToShow/2):0,!0===n.options.swipeToSlide?(n.$slideTrack.find(".slick-slide").each(function(r,s){if(s.offsetLeft-i+e(s).outerWidth()/2>-1*n.swipeLeft)return t=s,!1}),Math.abs(e(t).attr("data-slick-index")-n.currentSlide)||1):n.options.slidesToScroll},i.prototype.goTo=i.prototype.slickGoTo=function(e,t){this.changeSlide({data:{message:"index",index:parseInt(e)}},t)},i.prototype.init=function(t){var i=this;e(i.$slider).hasClass("slick-initialized")||(e(i.$slider).addClass("slick-initialized"),i.buildRows(),i.buildOut(),i.setProps(),i.startLoad(),i.loadSlider(),i.initializeEvents(),i.updateArrows(),i.updateDots(),i.checkResponsive(!0),i.focusHandler()),t&&i.$slider.trigger("init",[i]),!0===i.options.accessibility&&i.initADA(),i.options.autoplay&&(i.paused=!1,i.autoPlay())},i.prototype.initADA=function(){var t=this,i=Math.ceil(t.slideCount/t.options.slidesToShow),n=t.getNavigableIndexes().filter(function(e){return e>=0&&e<t.slideCount});t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==t.$dots&&(t.$slides.not(t.$slideTrack.find(".slick-cloned")).each(function(i){var r=n.indexOf(i);if(e(this).attr({role:"tabpanel",id:"slick-slide"+t.instanceUid+i,tabindex:-1}),-1!==r){var s="slick-slide-control"+t.instanceUid+r;e("#"+s).length&&e(this).attr({"aria-describedby":s})}}),t.$dots.attr("role","tablist").find("li").each(function(r){var s=n[r];e(this).attr({role:"presentation"}),e(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+t.instanceUid+r,"aria-controls":"slick-slide"+t.instanceUid+s,"aria-label":r+1+" of "+i,"aria-selected":null,tabindex:"-1"})}).eq(t.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var r=t.currentSlide,s=r+t.options.slidesToShow;r<s;r++)t.options.focusOnChange?t.$slides.eq(r).attr({tabindex:"0"}):t.$slides.eq(r).removeAttr("tabindex");t.activateADA()},i.prototype.initArrowEvents=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},e.changeSlide),e.$nextArrow.off("click.slick").on("click.slick",{message:"next"},e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow.on("keydown.slick",e.keyHandler),e.$nextArrow.on("keydown.slick",e.keyHandler)))},i.prototype.initDotEvents=function(){var t=this;!0===t.options.dots&&t.slideCount>t.options.slidesToShow&&(e("li",t.$dots).on("click.slick",{message:"index"},t.changeSlide),!0===t.options.accessibility&&t.$dots.on("keydown.slick",t.keyHandler)),!0===t.options.dots&&!0===t.options.pauseOnDotsHover&&t.slideCount>t.options.slidesToShow&&e("li",t.$dots).on("mouseenter.slick",e.proxy(t.interrupt,t,!0)).on("mouseleave.slick",e.proxy(t.interrupt,t,!1))},i.prototype.initSlideEvents=function(){var t=this;t.options.pauseOnHover&&(t.$list.on("mouseenter.slick",e.proxy(t.interrupt,t,!0)),t.$list.on("mouseleave.slick",e.proxy(t.interrupt,t,!1)))},i.prototype.initializeEvents=function(){var t=this;t.initArrowEvents(),t.initDotEvents(),t.initSlideEvents(),t.$list.on("touchstart.slick mousedown.slick",{action:"start"},t.swipeHandler),t.$list.on("touchmove.slick mousemove.slick",{action:"move"},t.swipeHandler),t.$list.on("touchend.slick mouseup.slick",{action:"end"},t.swipeHandler),t.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},t.swipeHandler),t.$list.on("click.slick",t.clickHandler),e(document).on(t.visibilityChange,e.proxy(t.visibility,t)),!0===t.options.accessibility&&t.$list.on("keydown.slick",t.keyHandler),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().on("click.slick",t.selectHandler),e(window).on("orientationchange.slick.slick-"+t.instanceUid,e.proxy(t.orientationChange,t)),e(window).on("resize.slick.slick-"+t.instanceUid,e.proxy(t.resize,t)),e("[draggable!=true]",t.$slideTrack).on("dragstart",t.preventDefault),e(window).on("load.slick.slick-"+t.instanceUid,t.setPosition),e(t.setPosition)},i.prototype.initUI=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.show(),e.$nextArrow.show()),!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&e.$dots.show()},i.prototype.keyHandler=function(e){var t=this;e.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===e.keyCode&&!0===t.options.accessibility?t.changeSlide({data:{message:!0===t.options.rtl?"next":"previous"}}):39===e.keyCode&&!0===t.options.accessibility&&t.changeSlide({data:{message:!0===t.options.rtl?"previous":"next"}}))},i.prototype.lazyLoad=function(){var t,i,n,r=this;function s(t){e("img[data-lazy]",t).each(function(){var t=e(this),i=e(this).attr("data-lazy"),n=e(this).attr("data-srcset"),s=e(this).attr("data-sizes")||r.$slider.attr("data-sizes"),o=document.createElement("img");o.onload=function(){t.animate({opacity:0},100,function(){n&&(t.attr("srcset",n),s&&t.attr("sizes",s)),t.attr("src",i).animate({opacity:1},200,function(){t.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),r.$slider.trigger("lazyLoaded",[r,t,i])})},o.onerror=function(){t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),r.$slider.trigger("lazyLoadError",[r,t,i])},o.src=i})}if(!0===r.options.centerMode?!0===r.options.infinite?n=(i=r.currentSlide+(r.options.slidesToShow/2+1))+r.options.slidesToShow+2:(i=Math.max(0,r.currentSlide-(r.options.slidesToShow/2+1)),n=r.options.slidesToShow/2+1+2+r.currentSlide):(i=r.options.infinite?r.options.slidesToShow+r.currentSlide:r.currentSlide,n=Math.ceil(i+r.options.slidesToShow),!0===r.options.fade&&(i>0&&i--,n<=r.slideCount&&n++)),t=r.$slider.find(".slick-slide").slice(i,n),"anticipated"===r.options.lazyLoad)for(var o=i-1,a=n,l=r.$slider.find(".slick-slide"),c=0;c<r.options.slidesToScroll;c++)o<0&&(o=r.slideCount-1),t=(t=t.add(l.eq(o))).add(l.eq(a)),o--,a++;s(t),r.slideCount<=r.options.slidesToShow?s(r.$slider.find(".slick-slide")):r.currentSlide>=r.slideCount-r.options.slidesToShow?s(r.$slider.find(".slick-cloned").slice(0,r.options.slidesToShow)):0===r.currentSlide&&s(r.$slider.find(".slick-cloned").slice(-1*r.options.slidesToShow))},i.prototype.loadSlider=function(){var e=this;e.setPosition(),e.$slideTrack.css({opacity:1}),e.$slider.removeClass("slick-loading"),e.initUI(),"progressive"===e.options.lazyLoad&&e.progressiveLazyLoad()},i.prototype.next=i.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},i.prototype.orientationChange=function(){this.checkResponsive(),this.setPosition()},i.prototype.pause=i.prototype.slickPause=function(){this.autoPlayClear(),this.paused=!0},i.prototype.play=i.prototype.slickPlay=function(){var e=this;e.autoPlay(),e.options.autoplay=!0,e.paused=!1,e.focussed=!1,e.interrupted=!1},i.prototype.postSlide=function(t){var i=this;i.unslicked||(i.$slider.trigger("afterChange",[i,t]),i.animating=!1,i.slideCount>i.options.slidesToShow&&i.setPosition(),i.swipeLeft=null,i.options.autoplay&&i.autoPlay(),!0===i.options.accessibility&&(i.initADA(),i.options.focusOnChange&&e(i.$slides.get(i.currentSlide)).attr("tabindex",0).focus()))},i.prototype.prev=i.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},i.prototype.preventDefault=function(e){e.preventDefault()},i.prototype.progressiveLazyLoad=function(t){t=t||1;var i,n,r,s,o,a=this,l=e("img[data-lazy]",a.$slider);l.length?(i=l.first(),n=i.attr("data-lazy"),r=i.attr("data-srcset"),s=i.attr("data-sizes")||a.$slider.attr("data-sizes"),(o=document.createElement("img")).onload=function(){r&&(i.attr("srcset",r),s&&i.attr("sizes",s)),i.attr("src",n).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===a.options.adaptiveHeight&&a.setPosition(),a.$slider.trigger("lazyLoaded",[a,i,n]),a.progressiveLazyLoad()},o.onerror=function(){t<3?setTimeout(function(){a.progressiveLazyLoad(t+1)},500):(i.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),a.$slider.trigger("lazyLoadError",[a,i,n]),a.progressiveLazyLoad())},o.src=n):a.$slider.trigger("allImagesLoaded",[a])},i.prototype.refresh=function(t){var i,n,r=this;n=r.slideCount-r.options.slidesToShow,!r.options.infinite&&r.currentSlide>n&&(r.currentSlide=n),r.slideCount<=r.options.slidesToShow&&(r.currentSlide=0),i=r.currentSlide,r.destroy(!0),e.extend(r,r.initials,{currentSlide:i}),r.init(),t||r.changeSlide({data:{message:"index",index:i}},!1)},i.prototype.registerBreakpoints=function(){var t,i,n,r=this,s=r.options.responsive||null;if("array"===e.type(s)&&s.length){for(t in r.respondTo=r.options.respondTo||"window",s)if(n=r.breakpoints.length-1,s.hasOwnProperty(t)){for(i=s[t].breakpoint;n>=0;)r.breakpoints[n]&&r.breakpoints[n]===i&&r.breakpoints.splice(n,1),n--;r.breakpoints.push(i),r.breakpointSettings[i]=s[t].settings}r.breakpoints.sort(function(e,t){return r.options.mobileFirst?e-t:t-e})}},i.prototype.reinit=function(){var t=this;t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&0!==t.currentSlide&&(t.currentSlide=t.currentSlide-t.options.slidesToScroll),t.slideCount<=t.options.slidesToShow&&(t.currentSlide=0),t.registerBreakpoints(),t.setProps(),t.setupInfinite(),t.buildArrows(),t.updateArrows(),t.initArrowEvents(),t.buildDots(),t.updateDots(),t.initDotEvents(),t.cleanUpSlideEvents(),t.initSlideEvents(),t.checkResponsive(!1,!0),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().on("click.slick",t.selectHandler),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),t.setPosition(),t.focusHandler(),t.paused=!t.options.autoplay,t.autoPlay(),t.$slider.trigger("reInit",[t])},i.prototype.resize=function(){var t=this;e(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout(function(){t.windowWidth=e(window).width(),t.checkResponsive(),t.unslicked||t.setPosition()},50))},i.prototype.removeSlide=i.prototype.slickRemove=function(e,t,i){var n=this;if(e="boolean"==typeof e?!0===(t=e)?0:n.slideCount-1:!0===t?--e:e,n.slideCount<1||e<0||e>n.slideCount-1)return!1;n.unload(),!0===i?n.$slideTrack.children().remove():n.$slideTrack.children(this.options.slide).eq(e).remove(),n.$slides=n.$slideTrack.children(this.options.slide),n.$slideTrack.children(this.options.slide).detach(),n.$slideTrack.append(n.$slides),n.$slidesCache=n.$slides,n.reinit()},i.prototype.setCSS=function(e){var t,i,n=this,r={};!0===n.options.rtl&&(e=-e),t="left"==n.positionProp?Math.ceil(e)+"px":"0px",i="top"==n.positionProp?Math.ceil(e)+"px":"0px",r[n.positionProp]=e,!1===n.transformsEnabled?n.$slideTrack.css(r):(r={},!1===n.cssTransitions?(r[n.animType]="translate("+t+", "+i+")",n.$slideTrack.css(r)):(r[n.animType]="translate3d("+t+", "+i+", 0px)",n.$slideTrack.css(r)))},i.prototype.setDimensions=function(){var e=this;!1===e.options.vertical?!0===e.options.centerMode&&e.$list.css({padding:"0px "+e.options.centerPadding}):(e.$list.height(e.$slides.first().outerHeight(!0)*e.options.slidesToShow),!0===e.options.centerMode&&e.$list.css({padding:e.options.centerPadding+" 0px"})),e.listWidth=e.$list.width(),e.listHeight=e.$list.height(),!1===e.options.vertical&&!1===e.options.variableWidth?(e.slideWidth=Math.ceil(e.listWidth/e.options.slidesToShow),e.$slideTrack.width(Math.ceil(e.slideWidth*e.$slideTrack.children(".slick-slide").length))):!0===e.options.variableWidth?e.$slideTrack.width(5e3*e.slideCount):(e.slideWidth=Math.ceil(e.listWidth),e.$slideTrack.height(Math.ceil(e.$slides.first().outerHeight(!0)*e.$slideTrack.children(".slick-slide").length)));var t=e.$slides.first().outerWidth(!0)-e.$slides.first().width();!1===e.options.variableWidth&&e.$slideTrack.children(".slick-slide").width(e.slideWidth-t)},i.prototype.setFade=function(){var t,i=this;i.$slides.each(function(n,r){t=i.slideWidth*n*-1,!0===i.options.rtl?e(r).css({position:"relative",right:t,top:0,zIndex:i.options.zIndex-2,opacity:0}):e(r).css({position:"relative",left:t,top:0,zIndex:i.options.zIndex-2,opacity:0})}),i.$slides.eq(i.currentSlide).css({zIndex:i.options.zIndex-1,opacity:1})},i.prototype.setHeight=function(){var e=this;if(1===e.options.slidesToShow&&!0===e.options.adaptiveHeight&&!1===e.options.vertical){var t=e.$slides.eq(e.currentSlide).outerHeight(!0);e.$list.css("height",t)}},i.prototype.setOption=i.prototype.slickSetOption=function(){var t,i,n,r,s,o=this,a=!1;if("object"===e.type(arguments[0])?(n=arguments[0],a=arguments[1],s="multiple"):"string"===e.type(arguments[0])&&(n=arguments[0],r=arguments[1],a=arguments[2],"responsive"===arguments[0]&&"array"===e.type(arguments[1])?s="responsive":void 0!==arguments[1]&&(s="single")),"single"===s)o.options[n]=r;else if("multiple"===s)e.each(n,function(e,t){o.options[e]=t});else if("responsive"===s)for(i in r)if("array"!==e.type(o.options.responsive))o.options.responsive=[r[i]];else{for(t=o.options.responsive.length-1;t>=0;)o.options.responsive[t].breakpoint===r[i].breakpoint&&o.options.responsive.splice(t,1),t--;o.options.responsive.push(r[i])}a&&(o.unload(),o.reinit())},i.prototype.setPosition=function(){var e=this;e.setDimensions(),e.setHeight(),!1===e.options.fade?e.setCSS(e.getLeft(e.currentSlide)):e.setFade(),e.$slider.trigger("setPosition",[e])},i.prototype.setProps=function(){var e=this,t=document.body.style;e.positionProp=!0===e.options.vertical?"top":"left","top"===e.positionProp?e.$slider.addClass("slick-vertical"):e.$slider.removeClass("slick-vertical"),void 0===t.WebkitTransition&&void 0===t.MozTransition&&void 0===t.msTransition||!0===e.options.useCSS&&(e.cssTransitions=!0),e.options.fade&&("number"==typeof e.options.zIndex?e.options.zIndex<3&&(e.options.zIndex=3):e.options.zIndex=e.defaults.zIndex),void 0!==t.OTransform&&(e.animType="OTransform",e.transformType="-o-transform",e.transitionType="OTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(e.animType=!1)),void 0!==t.MozTransform&&(e.animType="MozTransform",e.transformType="-moz-transform",e.transitionType="MozTransition",void 0===t.perspectiveProperty&&void 0===t.MozPerspective&&(e.animType=!1)),void 0!==t.webkitTransform&&(e.animType="webkitTransform",e.transformType="-webkit-transform",e.transitionType="webkitTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(e.animType=!1)),void 0!==t.msTransform&&(e.animType="msTransform",e.transformType="-ms-transform",e.transitionType="msTransition",void 0===t.msTransform&&(e.animType=!1)),void 0!==t.transform&&!1!==e.animType&&(e.animType="transform",e.transformType="transform",e.transitionType="transition"),e.transformsEnabled=e.options.useTransform&&null!==e.animType&&!1!==e.animType},i.prototype.setSlideClasses=function(e){var t,i,n,r,s=this;if(i=s.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),s.$slides.eq(e).addClass("slick-current"),!0===s.options.centerMode){var o=s.options.slidesToShow%2==0?1:0;t=Math.floor(s.options.slidesToShow/2),!0===s.options.infinite&&(e>=t&&e<=s.slideCount-1-t?s.$slides.slice(e-t+o,e+t+1).addClass("slick-active").attr("aria-hidden","false"):(n=s.options.slidesToShow+e,i.slice(n-t+1+o,n+t+2).addClass("slick-active").attr("aria-hidden","false")),0===e?i.eq(i.length-1-s.options.slidesToShow).addClass("slick-center"):e===s.slideCount-1&&i.eq(s.options.slidesToShow).addClass("slick-center")),s.$slides.eq(e).addClass("slick-center")}else e>=0&&e<=s.slideCount-s.options.slidesToShow?s.$slides.slice(e,e+s.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):i.length<=s.options.slidesToShow?i.addClass("slick-active").attr("aria-hidden","false"):(r=s.slideCount%s.options.slidesToShow,n=!0===s.options.infinite?s.options.slidesToShow+e:e,s.options.slidesToShow==s.options.slidesToScroll&&s.slideCount-e<s.options.slidesToShow?i.slice(n-(s.options.slidesToShow-r),n+r).addClass("slick-active").attr("aria-hidden","false"):i.slice(n,n+s.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==s.options.lazyLoad&&"anticipated"!==s.options.lazyLoad||s.lazyLoad()},i.prototype.setupInfinite=function(){var t,i,n,r=this;if(!0===r.options.fade&&(r.options.centerMode=!1),!0===r.options.infinite&&!1===r.options.fade&&(i=null,r.slideCount>r.options.slidesToShow)){for(n=!0===r.options.centerMode?r.options.slidesToShow+1:r.options.slidesToShow,t=r.slideCount;t>r.slideCount-n;t-=1)i=t-1,e(r.$slides[i]).clone(!0).attr("id","").attr("data-slick-index",i-r.slideCount).prependTo(r.$slideTrack).addClass("slick-cloned");for(t=0;t<n+r.slideCount;t+=1)i=t,e(r.$slides[i]).clone(!0).attr("id","").attr("data-slick-index",i+r.slideCount).appendTo(r.$slideTrack).addClass("slick-cloned");r.$slideTrack.find(".slick-cloned").find("[id]").each(function(){e(this).attr("id","")})}},i.prototype.interrupt=function(e){e||this.autoPlay(),this.interrupted=e},i.prototype.selectHandler=function(t){var i=this,n=e(t.target).is(".slick-slide")?e(t.target):e(t.target).parents(".slick-slide"),r=parseInt(n.attr("data-slick-index"));r||(r=0),i.slideCount<=i.options.slidesToShow?i.slideHandler(r,!1,!0):i.slideHandler(r)},i.prototype.slideHandler=function(e,t,i){var n,r,s,o,a,l=null,c=this;if(t=t||!1,!(!0===c.animating&&!0===c.options.waitForAnimate||!0===c.options.fade&&c.currentSlide===e))if(!1===t&&c.asNavFor(e),n=e,l=c.getLeft(n),o=c.getLeft(c.currentSlide),c.currentLeft=null===c.swipeLeft?o:c.swipeLeft,!1===c.options.infinite&&!1===c.options.centerMode&&(e<0||e>c.getDotCount()*c.options.slidesToScroll))!1===c.options.fade&&(n=c.currentSlide,!0!==i&&c.slideCount>c.options.slidesToShow?c.animateSlide(o,function(){c.postSlide(n)}):c.postSlide(n));else if(!1===c.options.infinite&&!0===c.options.centerMode&&(e<0||e>c.slideCount-c.options.slidesToScroll))!1===c.options.fade&&(n=c.currentSlide,!0!==i&&c.slideCount>c.options.slidesToShow?c.animateSlide(o,function(){c.postSlide(n)}):c.postSlide(n));else{if(c.options.autoplay&&clearInterval(c.autoPlayTimer),r=n<0?c.slideCount%c.options.slidesToScroll!==0?c.slideCount-c.slideCount%c.options.slidesToScroll:c.slideCount+n:n>=c.slideCount?c.slideCount%c.options.slidesToScroll!==0?0:n-c.slideCount:n,c.animating=!0,c.$slider.trigger("beforeChange",[c,c.currentSlide,r]),s=c.currentSlide,c.currentSlide=r,c.setSlideClasses(c.currentSlide),c.options.asNavFor&&(a=(a=c.getNavTarget()).slick("getSlick")).slideCount<=a.options.slidesToShow&&a.setSlideClasses(c.currentSlide),c.updateDots(),c.updateArrows(),!0===c.options.fade)return!0!==i?(c.fadeSlideOut(s),c.fadeSlide(r,function(){c.postSlide(r)})):c.postSlide(r),void c.animateHeight();!0!==i&&c.slideCount>c.options.slidesToShow?c.animateSlide(l,function(){c.postSlide(r)}):c.postSlide(r)}},i.prototype.startLoad=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.hide(),e.$nextArrow.hide()),!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&e.$dots.hide(),e.$slider.addClass("slick-loading")},i.prototype.swipeDirection=function(){var e,t,i,n,r=this;return e=r.touchObject.startX-r.touchObject.curX,t=r.touchObject.startY-r.touchObject.curY,i=Math.atan2(t,e),(n=Math.round(180*i/Math.PI))<0&&(n=360-Math.abs(n)),n<=45&&n>=0||n<=360&&n>=315?!1===r.options.rtl?"left":"right":n>=135&&n<=225?!1===r.options.rtl?"right":"left":!0===r.options.verticalSwiping?n>=35&&n<=135?"down":"up":"vertical"},i.prototype.swipeEnd=function(e){var t,i,n=this;if(n.dragging=!1,n.swiping=!1,n.scrolling)return n.scrolling=!1,!1;if(n.interrupted=!1,n.shouldClick=!(n.touchObject.swipeLength>10),void 0===n.touchObject.curX)return!1;if(!0===n.touchObject.edgeHit&&n.$slider.trigger("edge",[n,n.swipeDirection()]),n.touchObject.swipeLength>=n.touchObject.minSwipe){switch(i=n.swipeDirection()){case"left":case"down":t=n.options.swipeToSlide?n.checkNavigable(n.currentSlide+n.getSlideCount()):n.currentSlide+n.getSlideCount(),n.currentDirection=0;break;case"right":case"up":t=n.options.swipeToSlide?n.checkNavigable(n.currentSlide-n.getSlideCount()):n.currentSlide-n.getSlideCount(),n.currentDirection=1}"vertical"!=i&&(n.slideHandler(t),n.touchObject={},n.$slider.trigger("swipe",[n,i]))}else n.touchObject.startX!==n.touchObject.curX&&(n.slideHandler(n.currentSlide),n.touchObject={})},i.prototype.swipeHandler=function(e){var t=this;if(!(!1===t.options.swipe||"ontouchend"in document&&!1===t.options.swipe||!1===t.options.draggable&&-1!==e.type.indexOf("mouse")))switch(t.touchObject.fingerCount=e.originalEvent&&void 0!==e.originalEvent.touches?e.originalEvent.touches.length:1,t.touchObject.minSwipe=t.listWidth/t.options.touchThreshold,!0===t.options.verticalSwiping&&(t.touchObject.minSwipe=t.listHeight/t.options.touchThreshold),e.data.action){case"start":t.swipeStart(e);break;case"move":t.swipeMove(e);break;case"end":t.swipeEnd(e)}},i.prototype.swipeMove=function(e){var t,i,n,r,s,o,a=this;return s=void 0!==e.originalEvent?e.originalEvent.touches:null,!(!a.dragging||a.scrolling||s&&1!==s.length)&&(t=a.getLeft(a.currentSlide),a.touchObject.curX=void 0!==s?s[0].pageX:e.clientX,a.touchObject.curY=void 0!==s?s[0].pageY:e.clientY,a.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(a.touchObject.curX-a.touchObject.startX,2))),o=Math.round(Math.sqrt(Math.pow(a.touchObject.curY-a.touchObject.startY,2))),!a.options.verticalSwiping&&!a.swiping&&o>4?(a.scrolling=!0,!1):(!0===a.options.verticalSwiping&&(a.touchObject.swipeLength=o),i=a.swipeDirection(),void 0!==e.originalEvent&&a.touchObject.swipeLength>4&&(a.swiping=!0,e.preventDefault()),r=(!1===a.options.rtl?1:-1)*(a.touchObject.curX>a.touchObject.startX?1:-1),!0===a.options.verticalSwiping&&(r=a.touchObject.curY>a.touchObject.startY?1:-1),n=a.touchObject.swipeLength,a.touchObject.edgeHit=!1,!1===a.options.infinite&&(0===a.currentSlide&&"right"===i||a.currentSlide>=a.getDotCount()&&"left"===i)&&(n=a.touchObject.swipeLength*a.options.edgeFriction,a.touchObject.edgeHit=!0),!1===a.options.vertical?a.swipeLeft=t+n*r:a.swipeLeft=t+n*(a.$list.height()/a.listWidth)*r,!0===a.options.verticalSwiping&&(a.swipeLeft=t+n*r),!0!==a.options.fade&&!1!==a.options.touchMove&&(!0===a.animating?(a.swipeLeft=null,!1):void a.setCSS(a.swipeLeft))))},i.prototype.swipeStart=function(e){var t,i=this;if(i.interrupted=!0,1!==i.touchObject.fingerCount||i.slideCount<=i.options.slidesToShow)return i.touchObject={},!1;void 0!==e.originalEvent&&void 0!==e.originalEvent.touches&&(t=e.originalEvent.touches[0]),i.touchObject.startX=i.touchObject.curX=void 0!==t?t.pageX:e.clientX,i.touchObject.startY=i.touchObject.curY=void 0!==t?t.pageY:e.clientY,i.dragging=!0},i.prototype.unfilterSlides=i.prototype.slickUnfilter=function(){var e=this;null!==e.$slidesCache&&(e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.appendTo(e.$slideTrack),e.reinit())},i.prototype.unload=function(){var t=this;e(".slick-cloned",t.$slider).remove(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove(),t.$nextArrow&&t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove(),t.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},i.prototype.unslick=function(e){var t=this;t.$slider.trigger("unslick",[t,e]),t.destroy()},i.prototype.updateArrows=function(){var e=this;Math.floor(e.options.slidesToShow/2),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&!e.options.infinite&&(e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===e.currentSlide?(e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):(e.currentSlide>=e.slideCount-e.options.slidesToShow&&!1===e.options.centerMode||e.currentSlide>=e.slideCount-1&&!0===e.options.centerMode)&&(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},i.prototype.updateDots=function(){var e=this;null!==e.$dots&&(e.$dots.find("li").removeClass("slick-active").end(),e.$dots.find("li").eq(Math.floor(e.currentSlide/e.options.slidesToScroll)).addClass("slick-active"))},i.prototype.visibility=function(){var e=this;e.options.autoplay&&(document[e.hidden]?e.interrupted=!0:e.interrupted=!1)},e.fn.slick=function(){var e,t,n=this,r=arguments[0],s=Array.prototype.slice.call(arguments,1),o=n.length;for(e=0;e<o;e++)if("object"==typeof r||void 0===r?n[e].slick=new i(n[e],r):t=n[e].slick[r].apply(n[e].slick,s),void 0!==t)return t;return n}},void 0===(s=n.apply(t,r))||(e.exports=s)}()},9661:(e,t,i)=>{"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v(n.key),n)}}function a(e,t,i){return t&&o(e.prototype,t),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=b(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){a=!0,s=e},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}function c(e){var t=f();return function(){var i,n=d(e);if(t){var s=d(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return r(e)}(this,i)}}function h(e,t,i){return(t=v(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function p(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function m(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?p(Object(i),!0).forEach(function(t){h(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):p(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function b(e,t){if(e){if("string"==typeof e)return n(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}i.d(t,{A:()=>dr});var w=function(){function e(){s(this,e)}return a(e,[{key:"shadeRGBColor",value:function(e,t){var i=t.split(","),n=e<0?0:255,r=e<0?-1*e:e,s=parseInt(i[0].slice(4),10),o=parseInt(i[1],10),a=parseInt(i[2],10);return"rgb("+(Math.round((n-s)*r)+s)+","+(Math.round((n-o)*r)+o)+","+(Math.round((n-a)*r)+a)+")"}},{key:"shadeHexColor",value:function(e,t){var i=parseInt(t.slice(1),16),n=e<0?0:255,r=e<0?-1*e:e,s=i>>16,o=i>>8&255,a=255&i;return"#"+(16777216+65536*(Math.round((n-s)*r)+s)+256*(Math.round((n-o)*r)+o)+(Math.round((n-a)*r)+a)).toString(16).slice(1)}},{key:"shadeColor",value:function(t,i){return e.isColorHex(i)?this.shadeHexColor(t,i):this.shadeRGBColor(t,i)}}],[{key:"bind",value:function(e,t){return function(){return e.apply(t,arguments)}}},{key:"isObject",value:function(e){return e&&"object"===x(e)&&!Array.isArray(e)&&null!=e}},{key:"is",value:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"}},{key:"isSafari",value:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:"listToArray",value:function(e){var t,i=[];for(t=0;t<e.length;t++)i[t]=e[t];return i}},{key:"extend",value:function(e,t){var i=this;"function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t});var n=Object.assign({},e);return this.isObject(e)&&this.isObject(t)&&Object.keys(t).forEach(function(r){i.isObject(t[r])&&r in e?n[r]=i.extend(e[r],t[r]):Object.assign(n,h({},r,t[r]))}),n}},{key:"extendArray",value:function(t,i){var n=[];return t.map(function(t){n.push(e.extend(i,t))}),n}},{key:"monthMod",value:function(e){return e%12}},{key:"clone",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(null===e||"object"!==x(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){t=[],i.set(e,t);for(var n=0;n<e.length;n++)t[n]=this.clone(e[n],i)}else if(e instanceof Date)t=new Date(e.getTime());else for(var r in t={},i.set(e,t),e)e.hasOwnProperty(r)&&(t[r]=this.clone(e[r],i));return t}},{key:"log10",value:function(e){return Math.log(e)/Math.LN10}},{key:"roundToBase10",value:function(e){return Math.pow(10,Math.floor(Math.log10(e)))}},{key:"roundToBase",value:function(e,t){return Math.pow(t,Math.floor(Math.log(e)/Math.log(t)))}},{key:"parseNumber",value:function(e){return"number"==typeof e||null===e?e:parseFloat(e)}},{key:"stripNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Number.isInteger(e)?e:parseFloat(e.toPrecision(t))}},{key:"randomId",value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:"noExponents",value:function(e){return e.toString().includes("e")?Math.round(e):e}},{key:"elementExists",value:function(e){return!(!e||!e.isConnected)}},{key:"getDimensions",value:function(e){var t=getComputedStyle(e,null),i=e.clientHeight,n=e.clientWidth;return i-=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),[n-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),i]}},{key:"getBoundingClientRect",value:function(e){var t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:e.clientWidth,height:e.clientHeight,x:t.left,y:t.top}}},{key:"getLargestStringFromArr",value:function(e){return e.reduce(function(e,t){return Array.isArray(t)&&(t=t.reduce(function(e,t){return e.length>t.length?e:t})),e.length>t.length?e:t},0)}},{key:"hexToRgba",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#999999",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.6;"#"!==e.substring(0,1)&&(e="#999999");var i=e.replace("#","");i=i.match(new RegExp("(.{"+i.length/3+"})","g"));for(var n=0;n<i.length;n++)i[n]=parseInt(1===i[n].length?i[n]+i[n]:i[n],16);return void 0!==t&&i.push(t),"rgba("+i.join(",")+")"}},{key:"getOpacityFromRGBA",value:function(e){return parseFloat(e.replace(/^.*,(.+)\)/,"$1"))}},{key:"rgb2hex",value:function(e){return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""}},{key:"isColorHex",value:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(e)}},{key:"getPolygonPos",value:function(e,t){for(var i=[],n=2*Math.PI/t,r=0;r<t;r++){var s={};s.x=e*Math.sin(r*n),s.y=-e*Math.cos(r*n),i.push(s)}return i}},{key:"polarToCartesian",value:function(e,t,i,n){var r=(n-90)*Math.PI/180;return{x:e+i*Math.cos(r),y:t+i*Math.sin(r)}}},{key:"escapeString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x";return e.toString().slice().replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,t)}},{key:"negToZero",value:function(e){return e<0?0:e}},{key:"moveIndexInArray",value:function(e,t,i){if(i>=e.length)for(var n=i-e.length+1;n--;)e.push(void 0);return e.splice(i,0,e.splice(t,1)[0]),e}},{key:"extractNumber",value:function(e){return parseFloat(e.replace(/[^\d.]*/g,""))}},{key:"findAncestor",value:function(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e}},{key:"setELstyles",value:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e.style.key=t[i])}},{key:"preciseAddition",value:function(e,t){var i=(String(e).split(".")[1]||"").length,n=(String(t).split(".")[1]||"").length,r=Math.pow(10,Math.max(i,n));return(Math.round(e*r)+Math.round(t*r))/r}},{key:"isNumber",value:function(e){return!isNaN(e)&&parseFloat(Number(e))===e&&!isNaN(parseInt(e,10))}},{key:"isFloat",value:function(e){return Number(e)===e&&e%1!=0}},{key:"isMsEdge",value:function(){var e=window.navigator.userAgent,t=e.indexOf("Edge/");return t>0&&parseInt(e.substring(t+5,e.indexOf(".",t)),10)}},{key:"getGCD",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:7,n=Math.pow(10,i-Math.floor(Math.log10(Math.max(e,t))));for(e=Math.round(Math.abs(e)*n),t=Math.round(Math.abs(t)*n);t;){var r=t;t=e%t,e=r}return e/n}},{key:"getPrimeFactors",value:function(e){for(var t=[],i=2;e>=2;)e%i==0?(t.push(i),e/=i):i++;return t}},{key:"mod",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:7,n=Math.pow(10,i-Math.floor(Math.log10(Math.max(e,t))));return(e=Math.round(Math.abs(e)*n))%(t=Math.round(Math.abs(t)*n))/n}}]),e}(),S=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"animateLine",value:function(e,t,i,n){e.attr(t).animate(n).attr(i)}},{key:"animateMarker",value:function(e,t,i,n){e.attr({opacity:0}).animate(t).attr({opacity:1}).after(function(){n()})}},{key:"animateRect",value:function(e,t,i,n,r){e.attr(t).animate(n).attr(i).after(function(){return r()})}},{key:"animatePathsGradually",value:function(e){var t=e.el,i=e.realIndex,n=e.j,r=e.fill,s=e.pathFrom,o=e.pathTo,a=e.speed,l=e.delay,c=this.w,h=0;c.config.chart.animations.animateGradually.enabled&&(h=c.config.chart.animations.animateGradually.delay),c.config.chart.animations.dynamicAnimation.enabled&&c.globals.dataChanged&&"bar"!==c.config.chart.type&&(h=0),this.morphSVG(t,i,n,"line"!==c.config.chart.type||c.globals.comboCharts?r:"stroke",s,o,a,l*h)}},{key:"showDelayedElements",value:function(){this.w.globals.delayedElements.forEach(function(e){var t=e.el;t.classList.remove("apexcharts-element-hidden"),t.classList.add("apexcharts-hidden-element-shown")})}},{key:"animationCompleted",value:function(e){var t=this.w;t.globals.animationEnded||(t.globals.animationEnded=!0,this.showDelayedElements(),"function"==typeof t.config.chart.events.animationEnd&&t.config.chart.events.animationEnd(this.ctx,{el:e,w:t}))}},{key:"morphSVG",value:function(e,t,i,n,r,s,o,a){var l=this,c=this.w;r||(r=e.attr("pathFrom")),s||(s=e.attr("pathTo"));var h=function(e){return"radar"===c.config.chart.type&&(o=1),"M 0 ".concat(c.globals.gridHeight)};(!r||r.indexOf("undefined")>-1||r.indexOf("NaN")>-1)&&(r=h()),(!s.trim()||s.indexOf("undefined")>-1||s.indexOf("NaN")>-1)&&(s=h()),c.globals.shouldAnimate||(o=1),e.plot(r).animate(1,a).plot(r).animate(o,a).plot(s).after(function(){w.isNumber(i)?i===c.globals.series[c.globals.maxValsInArrayIndex].length-2&&c.globals.shouldAnimate&&l.animationCompleted(e):"none"!==n&&c.globals.shouldAnimate&&(!c.globals.comboCharts&&t===c.globals.series.length-1||c.globals.comboCharts)&&l.animationCompleted(e),l.showDelayedElements()})}}]),e}();const T={},k=[];function M(e,t){if(Array.isArray(e))for(const i of e)M(i,t);else if("object"!=typeof e)C(Object.getOwnPropertyNames(t)),T[e]=Object.assign(T[e]||{},t);else for(const t in e)M(t,e[t])}function A(e){return T[e]||{}}function C(e){k.push(...e)}function D(e,t){let i;const n=e.length,r=[];for(i=0;i<n;i++)r.push(t(e[i]));return r}function L(e){return e%360*Math.PI/180}function E(e){return e.charAt(0).toUpperCase()+e.slice(1)}function I(e,t,i,n){return null!=t&&null!=i||(n=n||e.bbox(),null==t?t=n.width/n.height*i:null==i&&(i=n.height/n.width*t)),{width:t,height:i}}function P(e,t){const i=e.origin;let n=null!=e.ox?e.ox:null!=e.originX?e.originX:"center",r=null!=e.oy?e.oy:null!=e.originY?e.originY:"center";null!=i&&([n,r]=Array.isArray(i)?i:"object"==typeof i?[i.x,i.y]:[i,i]);const s="string"==typeof n,o="string"==typeof r;if(s||o){const{height:e,width:i,x:a,y:l}=t.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+i:a+i/2),o&&(r=r.includes("top")?l:r.includes("bottom")?l+e:l+e/2)}return[n,r]}const R=new Set(["desc","metadata","title"]),O=e=>R.has(e.nodeName),z=(e,t,i={})=>{const n={...t};for(const e in n)n[e].valueOf()===i[e]&&delete n[e];Object.keys(n).length?e.node.setAttribute("data-svgjs",JSON.stringify(n)):(e.node.removeAttribute("data-svgjs"),e.node.removeAttribute("svgjs:data"))},F="http://www.w3.org/2000/svg",N="http://www.w3.org/2000/xmlns/",Y="http://www.w3.org/1999/xlink",B={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};function H(){return B.window}let V=class{};const W={},U="___SYMBOL___ROOT___";function $(e,t=F){return B.document.createElementNS(t,e)}function G(e,t=!1){if(e instanceof V)return e;if("object"==typeof e)return Z(e);if(null==e)return new W[U];if("string"==typeof e&&"<"!==e.charAt(0))return Z(B.document.querySelector(e));const i=t?B.document.createElement("div"):$("svg");return i.innerHTML=e,e=Z(i.firstChild),i.removeChild(i.firstChild),e}function X(e,t){return t&&(t instanceof B.window.Node||t.ownerDocument&&t instanceof t.ownerDocument.defaultView.Node)?t:$(e)}function q(e){if(!e)return null;if(e.instance instanceof V)return e.instance;if("#document-fragment"===e.nodeName)return new W.Fragment(e);let t=E(e.nodeName||"Dom");return"LinearGradient"===t||"RadialGradient"===t?t="Gradient":W[t]||(t="Dom"),new W[t](e)}let Z=q;function J(e,t=e.name,i=!1){return W[t]=e,i&&(W[U]=e),C(Object.getOwnPropertyNames(e.prototype)),e}let K=1e3;function Q(e){return"Svgjs"+E(e)+K++}function ee(e){for(let t=e.children.length-1;t>=0;t--)ee(e.children[t]);return e.id?(e.id=Q(e.nodeName),e):e}function te(e,t){let i,n;for(n=(e=Array.isArray(e)?e:[e]).length-1;n>=0;n--)for(i in t)e[n].prototype[i]=t[i]}function ie(e){return function(...t){const i=t[t.length-1];return!i||i.constructor!==Object||i instanceof Array?e.apply(this,t):e.apply(this,t.slice(0,-1)).attr(i)}}M("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const e=this.position();return this.parent().add(this.remove(),e+1),this},backward:function(){const e=this.position();return this.parent().add(this.remove(),e?e-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(e){(e=G(e)).remove();const t=this.position();return this.parent().add(e,t),this},after:function(e){(e=G(e)).remove();const t=this.position();return this.parent().add(e,t+1),this},insertBefore:function(e){return(e=G(e)).before(this),this},insertAfter:function(e){return(e=G(e)).after(this),this}});const ne=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,re=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,se=/rgb\((\d+),(\d+),(\d+)\)/,oe=/(#[a-z_][a-z0-9\-_]*)/i,ae=/\)\s*,?\s*/,le=/\s/g,ce=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,he=/^rgb\(/,de=/^(\s+)?$/,ue=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,pe=/[\s,]+/,me=/[MLHVCSQTAZ]/i;function ge(e){const t=Math.round(e),i=Math.max(0,Math.min(255,t)).toString(16);return 1===i.length?"0"+i:i}function _e(e,t){for(let i=t.length;i--;)if(null==e[t[i]])return!1;return!0}function ye(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}M("Dom",{classes:function(){const e=this.attr("class");return null==e?[]:e.trim().split(pe)},hasClass:function(e){return-1!==this.classes().indexOf(e)},addClass:function(e){if(!this.hasClass(e)){const t=this.classes();t.push(e),this.attr("class",t.join(" "))}return this},removeClass:function(e){return this.hasClass(e)&&this.attr("class",this.classes().filter(function(t){return t!==e}).join(" ")),this},toggleClass:function(e){return this.hasClass(e)?this.removeClass(e):this.addClass(e)}}),M("Dom",{css:function(e,t){const i={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter(function(e){return!!e.length}).forEach(function(e){const t=e.split(/\s*:\s*/);i[t[0]]=t[1]}),i;if(arguments.length<2){if(Array.isArray(e)){for(const t of e){const e=t;i[t]=this.node.style.getPropertyValue(e)}return i}if("string"==typeof e)return this.node.style.getPropertyValue(e);if("object"==typeof e)for(const t in e)this.node.style.setProperty(t,null==e[t]||de.test(e[t])?"":e[t])}return 2===arguments.length&&this.node.style.setProperty(e,null==t||de.test(t)?"":t),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),M("Dom",{data:function(e,t,i){if(null==e)return this.data(D(function(e,t){let i;const n=e.length,r=[];for(i=0;i<n;i++)t(e[i])&&r.push(e[i]);return r}(this.node.attributes,e=>0===e.nodeName.indexOf("data-")),e=>e.nodeName.slice(5)));if(e instanceof Array){const t={};for(const i of e)t[i]=this.data(i);return t}if("object"==typeof e)for(t in e)this.data(t,e[t]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+e))}catch(t){return this.attr("data-"+e)}else this.attr("data-"+e,null===t?null:!0===i||"string"==typeof t||"number"==typeof t?t:JSON.stringify(t));return this}}),M("Dom",{remember:function(e,t){if("object"==typeof arguments[0])for(const t in e)this.remember(t,e[t]);else{if(1===arguments.length)return this.memory()[e];this.memory()[e]=t}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let e=arguments.length-1;e>=0;e--)delete this.memory()[arguments[e]];return this},memory:function(){return this._memory=this._memory||{}}});class ve{constructor(...e){this.init(...e)}static isColor(e){return e&&(e instanceof ve||this.isRgb(e)||this.test(e))}static isRgb(e){return e&&"number"==typeof e.r&&"number"==typeof e.g&&"number"==typeof e.b}static random(e="vibrant",t){const{random:i,round:n,sin:r,PI:s}=Math;if("vibrant"===e){const e=24*i()+57,t=38*i()+45,n=360*i();return new ve(e,t,n,"lch")}if("sine"===e){const e=n(80*r(2*s*(t=null==t?i():t)/.5+.01)+150),o=n(50*r(2*s*t/.5+4.6)+200),a=n(100*r(2*s*t/.5+2.3)+150);return new ve(e,o,a)}if("pastel"===e){const e=8*i()+86,t=17*i()+9,n=360*i();return new ve(e,t,n,"lch")}if("dark"===e){const e=10+10*i(),t=50*i()+86,n=360*i();return new ve(e,t,n,"lch")}if("rgb"===e){const e=255*i(),t=255*i(),n=255*i();return new ve(e,t,n)}if("lab"===e){const e=100*i(),t=256*i()-128,n=256*i()-128;return new ve(e,t,n,"lab")}if("grey"===e){const e=255*i();return new ve(e,e,e)}throw new Error("Unsupported random color mode")}static test(e){return"string"==typeof e&&(ce.test(e)||he.test(e))}cmyk(){const{_a:e,_b:t,_c:i}=this.rgb(),[n,r,s]=[e,t,i].map(e=>e/255),o=Math.min(1-n,1-r,1-s);return 1===o?new ve(0,0,0,1,"cmyk"):new ve((1-n-o)/(1-o),(1-r-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:e,_b:t,_c:i}=this.rgb(),[n,r,s]=[e,t,i].map(e=>e/255),o=Math.max(n,r,s),a=Math.min(n,r,s),l=(o+a)/2,c=o===a,h=o-a;return new ve(360*(c?0:o===n?((r-s)/h+(r<s?6:0))/6:o===r?((s-n)/h+2)/6:o===s?((n-r)/h+4)/6:0),100*(c?0:l>.5?h/(2-o-a):h/(o+a)),100*l,"hsl")}init(e=0,t=0,i=0,n=0,r="rgb"){if(e=e||0,this.space)for(const e in this.space)delete this[this.space[e]];if("number"==typeof e)r="string"==typeof n?n:r,n="string"==typeof n?0:n,Object.assign(this,{_a:e,_b:t,_c:i,_d:n,space:r});else if(e instanceof Array)this.space=t||("string"==typeof e[3]?e[3]:e[4])||"rgb",Object.assign(this,{_a:e[0],_b:e[1],_c:e[2],_d:e[3]||0});else if(e instanceof Object){const i=function(e,t){const i=_e(e,"rgb")?{_a:e.r,_b:e.g,_c:e.b,_d:0,space:"rgb"}:_e(e,"xyz")?{_a:e.x,_b:e.y,_c:e.z,_d:0,space:"xyz"}:_e(e,"hsl")?{_a:e.h,_b:e.s,_c:e.l,_d:0,space:"hsl"}:_e(e,"lab")?{_a:e.l,_b:e.a,_c:e.b,_d:0,space:"lab"}:_e(e,"lch")?{_a:e.l,_b:e.c,_c:e.h,_d:0,space:"lch"}:_e(e,"cmyk")?{_a:e.c,_b:e.m,_c:e.y,_d:e.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return i.space=t||i.space,i}(e,t);Object.assign(this,i)}else if("string"==typeof e)if(he.test(e)){const t=e.replace(le,""),[i,n,r]=se.exec(t).slice(1,4).map(e=>parseInt(e));Object.assign(this,{_a:i,_b:n,_c:r,_d:0,space:"rgb"})}else{if(!ce.test(e))throw Error("Unsupported string format, can't construct Color");{const t=e=>parseInt(e,16),[,i,n,r]=re.exec(function(e){return 4===e.length?["#",e.substring(1,2),e.substring(1,2),e.substring(2,3),e.substring(2,3),e.substring(3,4),e.substring(3,4)].join(""):e}(e)).map(t);Object.assign(this,{_a:i,_b:n,_c:r,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:l}=this,c="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:l}:{};Object.assign(this,c)}lab(){const{x:e,y:t,z:i}=this.xyz();return new ve(116*t-16,500*(e-t),200*(t-i),"lab")}lch(){const{l:e,a:t,b:i}=this.lab(),n=Math.sqrt(t**2+i**2);let r=180*Math.atan2(i,t)/Math.PI;return r<0&&(r*=-1,r=360-r),new ve(e,n,r,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(e=this.space)||"xyz"===e||"lch"===e){let{x:e,y:t,z:i}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:r,b:s}=this;if("lch"===this.space){const{c:e,h:t}=this,i=Math.PI/180;r=e*Math.cos(i*t),s=e*Math.sin(i*t)}const o=(n+16)/116,a=r/500+o,l=o-s/200,c=16/116,h=.008856,d=7.787;e=.95047*(a**3>h?a**3:(a-c)/d),t=1*(o**3>h?o**3:(o-c)/d),i=1.08883*(l**3>h?l**3:(l-c)/d)}const n=3.2406*e+-1.5372*t+-.4986*i,r=-.9689*e+1.8758*t+.0415*i,s=.0557*e+-.204*t+1.057*i,o=Math.pow,a=.0031308,l=n>a?1.055*o(n,1/2.4)-.055:12.92*n,c=r>a?1.055*o(r,1/2.4)-.055:12.92*r,h=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new ve(255*l,255*c,255*h)}if("hsl"===this.space){let{h:e,s:t,l:i}=this;if(e/=360,t/=100,i/=100,0===t)return i*=255,new ve(i,i,i);const n=i<.5?i*(1+t):i+t-i*t,r=2*i-n,s=255*ye(r,n,e+1/3),o=255*ye(r,n,e),a=255*ye(r,n,e-1/3);return new ve(s,o,a)}if("cmyk"===this.space){const{c:e,m:t,y:i,k:n}=this,r=255*(1-Math.min(1,e*(1-n)+n)),s=255*(1-Math.min(1,t*(1-n)+n)),o=255*(1-Math.min(1,i*(1-n)+n));return new ve(r,s,o)}return this;var e}toArray(){const{_a:e,_b:t,_c:i,_d:n,space:r}=this;return[e,t,i,n,r]}toHex(){const[e,t,i]=this._clamped().map(ge);return`#${e}${t}${i}`}toRgb(){const[e,t,i]=this._clamped();return`rgb(${e},${t},${i})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:t,_c:i}=this.rgb(),[n,r,s]=[e,t,i].map(e=>e/255),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,l=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,c=(.4124*o+.3576*a+.1805*l)/.95047,h=(.2126*o+.7152*a+.0722*l)/1,d=(.0193*o+.1192*a+.9505*l)/1.08883,u=c>.008856?Math.pow(c,1/3):7.787*c+16/116,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,p=d>.008856?Math.pow(d,1/3):7.787*d+16/116;return new ve(u,f,p,"xyz")}_clamped(){const{_a:e,_b:t,_c:i}=this.rgb(),{max:n,min:r,round:s}=Math;return[e,t,i].map(e=>n(0,r(s(e),255)))}}class xe{constructor(...e){this.init(...e)}clone(){return new xe(this)}init(e,t){const i=Array.isArray(e)?{x:e[0],y:e[1]}:"object"==typeof e?{x:e.x,y:e.y}:{x:e,y:t};return this.x=null==i.x?0:i.x,this.y=null==i.y?0:i.y,this}toArray(){return[this.x,this.y]}transform(e){return this.clone().transformO(e)}transformO(e){we.isMatrixLike(e)||(e=new we(e));const{x:t,y:i}=this;return this.x=e.a*t+e.c*i+e.e,this.y=e.b*t+e.d*i+e.f,this}}function be(e,t,i){return Math.abs(t-e)<(i||1e-6)}class we{constructor(...e){this.init(...e)}static formatTransforms(e){const t="both"===e.flip||!0===e.flip,i=e.flip&&(t||"x"===e.flip)?-1:1,n=e.flip&&(t||"y"===e.flip)?-1:1,r=e.skew&&e.skew.length?e.skew[0]:isFinite(e.skew)?e.skew:isFinite(e.skewX)?e.skewX:0,s=e.skew&&e.skew.length?e.skew[1]:isFinite(e.skew)?e.skew:isFinite(e.skewY)?e.skewY:0,o=e.scale&&e.scale.length?e.scale[0]*i:isFinite(e.scale)?e.scale*i:isFinite(e.scaleX)?e.scaleX*i:i,a=e.scale&&e.scale.length?e.scale[1]*n:isFinite(e.scale)?e.scale*n:isFinite(e.scaleY)?e.scaleY*n:n,l=e.shear||0,c=e.rotate||e.theta||0,h=new xe(e.origin||e.around||e.ox||e.originX,e.oy||e.originY),d=h.x,u=h.y,f=new xe(e.position||e.px||e.positionX||NaN,e.py||e.positionY||NaN),p=f.x,m=f.y,g=new xe(e.translate||e.tx||e.translateX,e.ty||e.translateY),_=g.x,y=g.y,v=new xe(e.relative||e.rx||e.relativeX,e.ry||e.relativeY);return{scaleX:o,scaleY:a,skewX:r,skewY:s,shear:l,theta:c,rx:v.x,ry:v.y,tx:_,ty:y,ox:d,oy:u,px:p,py:m}}static fromArray(e){return{a:e[0],b:e[1],c:e[2],d:e[3],e:e[4],f:e[5]}}static isMatrixLike(e){return null!=e.a||null!=e.b||null!=e.c||null!=e.d||null!=e.e||null!=e.f}static matrixMultiply(e,t,i){const n=e.a*t.a+e.c*t.b,r=e.b*t.a+e.d*t.b,s=e.a*t.c+e.c*t.d,o=e.b*t.c+e.d*t.d,a=e.e+e.a*t.e+e.c*t.f,l=e.f+e.b*t.e+e.d*t.f;return i.a=n,i.b=r,i.c=s,i.d=o,i.e=a,i.f=l,i}around(e,t,i){return this.clone().aroundO(e,t,i)}aroundO(e,t,i){const n=e||0,r=t||0;return this.translateO(-n,-r).lmultiplyO(i).translateO(n,r)}clone(){return new we(this)}decompose(e=0,t=0){const i=this.a,n=this.b,r=this.c,s=this.d,o=this.e,a=this.f,l=i*s-n*r,c=l>0?1:-1,h=c*Math.sqrt(i*i+n*n),d=Math.atan2(c*n,c*i),u=180/Math.PI*d,f=Math.cos(d),p=Math.sin(d),m=(i*r+n*s)/l,g=r*h/(m*i-n)||s*h/(m*n+i);return{scaleX:h,scaleY:g,shear:m,rotate:u,translateX:o-e+e*f*h+t*(m*f*h-p*g),translateY:a-t+e*p*h+t*(m*p*h+f*g),originX:e,originY:t,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const t=new we(e);return be(this.a,t.a)&&be(this.b,t.b)&&be(this.c,t.c)&&be(this.d,t.d)&&be(this.e,t.e)&&be(this.f,t.f)}flip(e,t){return this.clone().flipO(e,t)}flipO(e,t){return"x"===e?this.scaleO(-1,1,t,0):"y"===e?this.scaleO(1,-1,0,t):this.scaleO(-1,-1,e,t||e)}init(e){const t=we.fromArray([1,0,0,1,0,0]);return e=e instanceof We?e.matrixify():"string"==typeof e?we.fromArray(e.split(pe).map(parseFloat)):Array.isArray(e)?we.fromArray(e):"object"==typeof e&&we.isMatrixLike(e)?e:"object"==typeof e?(new we).transform(e):6===arguments.length?we.fromArray([].slice.call(arguments)):t,this.a=null!=e.a?e.a:t.a,this.b=null!=e.b?e.b:t.b,this.c=null!=e.c?e.c:t.c,this.d=null!=e.d?e.d:t.d,this.e=null!=e.e?e.e:t.e,this.f=null!=e.f?e.f:t.f,this}inverse(){return this.clone().inverseO()}inverseO(){const e=this.a,t=this.b,i=this.c,n=this.d,r=this.e,s=this.f,o=e*n-t*i;if(!o)throw new Error("Cannot invert "+this);const a=n/o,l=-t/o,c=-i/o,h=e/o,d=-(a*r+c*s),u=-(l*r+h*s);return this.a=a,this.b=l,this.c=c,this.d=h,this.e=d,this.f=u,this}lmultiply(e){return this.clone().lmultiplyO(e)}lmultiplyO(e){const t=e instanceof we?e:new we(e);return we.matrixMultiply(t,this,this)}multiply(e){return this.clone().multiplyO(e)}multiplyO(e){const t=e instanceof we?e:new we(e);return we.matrixMultiply(this,t,this)}rotate(e,t,i){return this.clone().rotateO(e,t,i)}rotateO(e,t=0,i=0){e=L(e);const n=Math.cos(e),r=Math.sin(e),{a:s,b:o,c:a,d:l,e:c,f:h}=this;return this.a=s*n-o*r,this.b=o*n+s*r,this.c=a*n-l*r,this.d=l*n+a*r,this.e=c*n-h*r+i*r-t*n+t,this.f=h*n+c*r-t*r-i*n+i,this}scale(){return this.clone().scaleO(...arguments)}scaleO(e,t=e,i=0,n=0){3===arguments.length&&(n=i,i=t,t=e);const{a:r,b:s,c:o,d:a,e:l,f:c}=this;return this.a=r*e,this.b=s*t,this.c=o*e,this.d=a*t,this.e=l*e-i*e+i,this.f=c*t-n*t+n,this}shear(e,t,i){return this.clone().shearO(e,t,i)}shearO(e,t=0,i=0){const{a:n,b:r,c:s,d:o,e:a,f:l}=this;return this.a=n+r*e,this.c=s+o*e,this.e=a+l*e-i*e,this}skew(){return this.clone().skewO(...arguments)}skewO(e,t=e,i=0,n=0){3===arguments.length&&(n=i,i=t,t=e),e=L(e),t=L(t);const r=Math.tan(e),s=Math.tan(t),{a:o,b:a,c:l,d:c,e:h,f:d}=this;return this.a=o+a*r,this.b=a+o*s,this.c=l+c*r,this.d=c+l*s,this.e=h+d*r-n*r,this.f=d+h*s-i*s,this}skewX(e,t,i){return this.skew(e,0,t,i)}skewY(e,t,i){return this.skew(0,e,t,i)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(e){if(we.isMatrixLike(e))return new we(e).multiplyO(this);const t=we.formatTransforms(e),{x:i,y:n}=new xe(t.ox,t.oy).transform(this),r=(new we).translateO(t.rx,t.ry).lmultiplyO(this).translateO(-i,-n).scaleO(t.scaleX,t.scaleY).skewO(t.skewX,t.skewY).shearO(t.shear).rotateO(t.theta).translateO(i,n);if(isFinite(t.px)||isFinite(t.py)){const e=new xe(i,n).transform(r),s=isFinite(t.px)?t.px-e.x:0,o=isFinite(t.py)?t.py-e.y:0;r.translateO(s,o)}return r.translateO(t.tx,t.ty),r}translate(e,t){return this.clone().translateO(e,t)}translateO(e,t){return this.e+=e||0,this.f+=t||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function Se(){if(!Se.nodes){const e=G().size(2,0);e.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),e.attr("focusable","false"),e.attr("aria-hidden","true");const t=e.path().node;Se.nodes={svg:e,path:t}}if(!Se.nodes.svg.node.parentNode){const e=B.document.body||B.document.documentElement;Se.nodes.svg.addTo(e)}return Se.nodes}function Te(e){return!(e.width||e.height||e.x||e.y)}J(we,"Matrix");class ke{constructor(...e){this.init(...e)}addOffset(){return this.x+=B.window.pageXOffset,this.y+=B.window.pageYOffset,new ke(this)}init(e){return e="string"==typeof e?e.split(pe).map(parseFloat):Array.isArray(e)?e:"object"==typeof e?[null!=e.left?e.left:e.x,null!=e.top?e.top:e.y,e.width,e.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=e[0]||0,this.y=e[1]||0,this.width=this.w=e[2]||0,this.height=this.h=e[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Te(this)}merge(e){const t=Math.min(this.x,e.x),i=Math.min(this.y,e.y),n=Math.max(this.x+this.width,e.x+e.width)-t,r=Math.max(this.y+this.height,e.y+e.height)-i;return new ke(t,i,n,r)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof we||(e=new we(e));let t=1/0,i=-1/0,n=1/0,r=-1/0;return[new xe(this.x,this.y),new xe(this.x2,this.y),new xe(this.x,this.y2),new xe(this.x2,this.y2)].forEach(function(s){s=s.transform(e),t=Math.min(t,s.x),i=Math.max(i,s.x),n=Math.min(n,s.y),r=Math.max(r,s.y)}),new ke(t,n,i-t,r-n)}}function Me(e,t,i){let n;try{if(n=t(e.node),Te(n)&&(r=e.node)!==B.document&&!(B.document.documentElement.contains||function(e){for(;e.parentNode;)e=e.parentNode;return e===B.document}).call(B.document.documentElement,r))throw new Error("Element not in the dom")}catch(t){n=i(e)}var r;return n}M({viewbox:{viewbox(e,t,i,n){return null==e?new ke(this.attr("viewBox")):this.attr("viewBox",new ke(e,t,i,n))},zoom(e,t){let{width:i,height:n}=this.attr(["width","height"]);if((i||n)&&"string"!=typeof i&&"string"!=typeof n||(i=this.node.clientWidth,n=this.node.clientHeight),!i||!n)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const r=this.viewbox(),s=i/r.width,o=n/r.height,a=Math.min(s,o);if(null==e)return a;let l=a/e;l===1/0&&(l=Number.MAX_SAFE_INTEGER/100),t=t||new xe(i/2/s+r.x,n/2/o+r.y);const c=new ke(r).transform(new we({scale:l,origin:t}));return this.viewbox(c)}}}),J(ke,"Box");class Ae extends Array{constructor(e=[],...t){if(super(e,...t),"number"==typeof e)return this;this.length=0,this.push(...e)}}te([Ae],{each(e,...t){return"function"==typeof e?this.map((t,i,n)=>e.call(t,t,i,n)):this.map(i=>i[e](...t))},toArray(){return Array.prototype.concat.apply([],this)}});const Ce=["toArray","constructor","each"];function De(e,t){return new Ae(D((t||B.document).querySelectorAll(e),function(e){return q(e)}))}Ae.extend=function(e){e=e.reduce((e,t)=>(Ce.includes(t)||"_"===t[0]||(t in Array.prototype&&(e["$"+t]=Array.prototype[t]),e[t]=function(...e){return this.each(t,...e)}),e),{}),te([Ae],e)};let Le=0;const Ee={};function Ie(e){let t=e.getEventHolder();return t===B.window&&(t=Ee),t.events||(t.events={}),t.events}function Pe(e){return e.getEventTarget()}function Re(e,t,i,n,r){const s=i.bind(n||e),o=G(e),a=Ie(o),l=Pe(o);t=Array.isArray(t)?t:t.split(pe),i._svgjsListenerId||(i._svgjsListenerId=++Le),t.forEach(function(e){const t=e.split(".")[0],n=e.split(".")[1]||"*";a[t]=a[t]||{},a[t][n]=a[t][n]||{},a[t][n][i._svgjsListenerId]=s,l.addEventListener(t,s,r||!1)})}function Oe(e,t,i,n){const r=G(e),s=Ie(r),o=Pe(r);("function"!=typeof i||(i=i._svgjsListenerId))&&(t=Array.isArray(t)?t:(t||"").split(pe)).forEach(function(e){const t=e&&e.split(".")[0],a=e&&e.split(".")[1];let l,c;if(i)s[t]&&s[t][a||"*"]&&(o.removeEventListener(t,s[t][a||"*"][i],n||!1),delete s[t][a||"*"][i]);else if(t&&a){if(s[t]&&s[t][a]){for(c in s[t][a])Oe(o,[t,a].join("."),c);delete s[t][a]}}else if(a)for(e in s)for(l in s[e])a===l&&Oe(o,[e,a].join("."));else if(t){if(s[t]){for(l in s[t])Oe(o,[t,l].join("."));delete s[t]}}else{for(e in s)Oe(o,e);!function(e){let t=e.getEventHolder();t===B.window&&(t=Ee),t.events&&(t.events={})}(r)}})}class ze extends V{addEventListener(){}dispatch(e,t,i){return function(e,t,i,n){const r=Pe(e);return t instanceof B.window.Event||(t=new B.window.CustomEvent(t,{detail:i,cancelable:!0,...n})),r.dispatchEvent(t),t}(this,e,t,i)}dispatchEvent(e){const t=this.getEventHolder().events;if(!t)return!0;const i=t[e.type];for(const t in i)for(const n in i[t])i[t][n](e);return!e.defaultPrevented}fire(e,t,i){return this.dispatch(e,t,i),this}getEventHolder(){return this}getEventTarget(){return this}off(e,t,i){return Oe(this,e,t,i),this}on(e,t,i,n){return Re(this,e,t,i,n),this}removeEventListener(){}}function Fe(){}J(ze,"EventTarget");const Ne={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class Ye extends Array{constructor(...e){super(...e),this.init(...e)}clone(){return new this.constructor(this)}init(e){return"number"==typeof e||(this.length=0,this.push(...this.parse(e))),this}parse(e=[]){return e instanceof Array?e:e.trim().split(pe).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const e=[];return e.push(...this),e}}class Be{constructor(...e){this.init(...e)}convert(e){return new Be(this.value,e)}divide(e){return e=new Be(e),new Be(this/e,this.unit||e.unit)}init(e,t){return t=Array.isArray(e)?e[1]:t,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=t||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(t=e.match(ne))&&(this.value=parseFloat(t[1]),"%"===t[5]?this.value/=100:"s"===t[5]&&(this.value*=1e3),this.unit=t[5]):e instanceof Be&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new Be(e),new Be(this-e,this.unit||e.unit)}plus(e){return e=new Be(e),new Be(this+e,this.unit||e.unit)}times(e){return e=new Be(e),new Be(this*e,this.unit||e.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const He=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),je=[];class Ve extends ze{constructor(e,t){super(),this.node=e,this.type=e.nodeName,t&&e!==t&&this.attr(t)}add(e,t){return(e=G(e)).removeNamespace&&this.node instanceof B.window.SVGElement&&e.removeNamespace(),null==t?this.node.appendChild(e.node):e.node!==this.node.childNodes[t]&&this.node.insertBefore(e.node,this.node.childNodes[t]),this}addTo(e,t){return G(e).put(this,t)}children(){return new Ae(D(this.node.children,function(e){return q(e)}))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(e=!0,t=!0){this.writeDataToDom();let i=this.node.cloneNode(e);return t&&(i=ee(i)),new this.constructor(i)}each(e,t){const i=this.children();let n,r;for(n=0,r=i.length;n<r;n++)e.apply(i[n],[n,i]),t&&i[n].each(e,t);return this}element(e,t){return this.put(new Ve($(e),t))}first(){return q(this.node.firstChild)}get(e){return q(this.node.childNodes[e])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(e){return this.index(e)>=0}html(e,t){return this.xml(e,t,"http://www.w3.org/1999/xhtml")}id(e){return void 0!==e||this.node.id||(this.node.id=Q(this.type)),this.attr("id",e)}index(e){return[].slice.call(this.node.childNodes).indexOf(e.node)}last(){return q(this.node.lastChild)}matches(e){const t=this.node,i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return i&&i.call(t,e)}parent(e){let t=this;if(!t.node.parentNode)return null;if(t=q(t.node.parentNode),!e)return t;do{if("string"==typeof e?t.matches(e):t instanceof e)return t}while(t=q(t.node.parentNode));return t}put(e,t){return e=G(e),this.add(e,t),e}putIn(e,t){return G(e).add(this,t)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(e){return this.node.removeChild(e.node),this}replace(e){return e=G(e),this.node.parentNode&&this.node.parentNode.replaceChild(e.node,this.node),e}round(e=2,t=null){const i=10**e,n=this.attr(t);for(const e in n)"number"==typeof n[e]&&(n[e]=Math.round(n[e]*i)/i);return this.attr(n),this}svg(e,t){return this.xml(e,t,F)}toString(){return this.id()}words(e){return this.node.textContent=e,this}wrap(e){const t=this.parent();if(!t)return this.addTo(e);const i=t.index(this);return t.put(e,i).put(this)}writeDataToDom(){return this.each(function(){this.writeDataToDom()}),this}xml(e,t,i){if("boolean"==typeof e&&(i=t,t=e,e=null),null==e||"function"==typeof e){t=null==t||t,this.writeDataToDom();let i=this;if(null!=e){if(i=q(i.node.cloneNode(!0)),t){const t=e(i);if(i=t||i,!1===t)return""}i.each(function(){const t=e(this),i=t||this;!1===t?this.remove():t&&this!==i&&this.replace(i)},!0)}return t?i.node.outerHTML:i.node.innerHTML}t=null!=t&&t;const n=$("wrapper",i),r=B.document.createDocumentFragment();n.innerHTML=e;for(let e=n.children.length;e--;)r.appendChild(n.firstElementChild);const s=this.parent();return t?this.replace(r)&&s:this.add(r)}}te(Ve,{attr:function(e,t,i){if(null==e){e={},t=this.node.attributes;for(const i of t)e[i.nodeName]=ue.test(i.nodeValue)?parseFloat(i.nodeValue):i.nodeValue;return e}if(e instanceof Array)return e.reduce((e,t)=>(e[t]=this.attr(t),e),{});if("object"==typeof e&&e.constructor===Object)for(t in e)this.attr(t,e[t]);else if(null===t)this.node.removeAttribute(e);else{if(null==t)return null==(t=this.node.getAttribute(e))?Ne[e]:ue.test(t)?parseFloat(t):t;"number"==typeof(t=je.reduce((t,i)=>i(e,t,this),t))?t=new Be(t):He.has(e)&&ve.isColor(t)?t=new ve(t):t.constructor===Array&&(t=new Ye(t)),"leading"===e?this.leading&&this.leading(t):"string"==typeof i?this.node.setAttributeNS(i,e,t.toString()):this.node.setAttribute(e,t.toString()),!this.rebuild||"font-size"!==e&&"x"!==e||this.rebuild()}return this},find:function(e){return De(e,this.node)},findOne:function(e){return q(this.node.querySelector(e))}}),J(Ve,"Dom");let We=class extends Ve{constructor(e,t){super(e,t),this.dom={},this.node.instance=this,(e.hasAttribute("data-svgjs")||e.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(e.getAttribute("data-svgjs"))??JSON.parse(e.getAttribute("svgjs:data"))??{})}center(e,t){return this.cx(e).cy(t)}cx(e){return null==e?this.x()+this.width()/2:this.x(e-this.width()/2)}cy(e){return null==e?this.y()+this.height()/2:this.y(e-this.height()/2)}defs(){const e=this.root();return e&&e.defs()}dmove(e,t){return this.dx(e).dy(t)}dx(e=0){return this.x(new Be(e).plus(this.x()))}dy(e=0){return this.y(new Be(e).plus(this.y()))}getEventHolder(){return this}height(e){return this.attr("height",e)}move(e,t){return this.x(e).y(t)}parents(e=this.root()){const t="string"==typeof e;t||(e=G(e));const i=new Ae;let n=this;for(;(n=n.parent())&&n.node!==B.document&&"#document-fragment"!==n.nodeName&&(i.push(n),t||n.node!==e.node)&&(!t||!n.matches(e));)if(n.node===this.root().node)return null;return i}reference(e){if(!(e=this.attr(e)))return null;const t=(e+"").match(oe);return t?G(t[1]):null}root(){const e=this.parent(function(e){return W[e]}(U));return e&&e.root()}setData(e){return this.dom=e,this}size(e,t){const i=I(this,e,t);return this.width(new Be(i.width)).height(new Be(i.height))}width(e){return this.attr("width",e)}writeDataToDom(){return z(this,this.dom),super.writeDataToDom()}x(e){return this.attr("x",e)}y(e){return this.attr("y",e)}};te(We,{bbox:function(){const e=Me(this,e=>e.getBBox(),e=>{try{const t=e.clone().addTo(Se().svg).show(),i=t.node.getBBox();return t.remove(),i}catch(t){throw new Error(`Getting bbox of element "${e.node.nodeName}" is not possible: ${t.toString()}`)}});return new ke(e)},rbox:function(e){const t=Me(this,e=>e.getBoundingClientRect(),e=>{throw new Error(`Getting rbox of element "${e.node.nodeName}" is not possible`)}),i=new ke(t);return e?i.transform(e.screenCTM().inverseO()):i.addOffset()},inside:function(e,t){const i=this.bbox();return e>i.x&&t>i.y&&e<i.x+i.width&&t<i.y+i.height},point:function(e,t){return new xe(e,t).transformO(this.screenCTM().inverseO())},ctm:function(){return new we(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const e=this.rect(1,1),t=e.node.getScreenCTM();return e.remove(),new we(t)}return new we(this.node.getScreenCTM())}catch(e){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new we}}}),J(We,"Element");const Ue={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(e,t){return"color"===t?e:e+"-"+t}};["fill","stroke"].forEach(function(e){const t={};let i;t[e]=function(t){if(void 0===t)return this.attr(e);if("string"==typeof t||t instanceof ve||ve.isRgb(t)||t instanceof We)this.attr(e,t);else for(i=Ue[e].length-1;i>=0;i--)null!=t[Ue[e][i]]&&this.attr(Ue.prefix(e,Ue[e][i]),t[Ue[e][i]]);return this},M(["Element","Runner"],t)}),M(["Element","Runner"],{matrix:function(e,t,i,n,r,s){return null==e?new we(this):this.attr("transform",new we(e,t,i,n,r,s))},rotate:function(e,t,i){return this.transform({rotate:e,ox:t,oy:i},!0)},skew:function(e,t,i,n){return 1===arguments.length||3===arguments.length?this.transform({skew:e,ox:t,oy:i},!0):this.transform({skew:[e,t],ox:i,oy:n},!0)},shear:function(e,t,i){return this.transform({shear:e,ox:t,oy:i},!0)},scale:function(e,t,i,n){return 1===arguments.length||3===arguments.length?this.transform({scale:e,ox:t,oy:i},!0):this.transform({scale:[e,t],ox:i,oy:n},!0)},translate:function(e,t){return this.transform({translate:[e,t]},!0)},relative:function(e,t){return this.transform({relative:[e,t]},!0)},flip:function(e="both",t="center"){return-1==="xybothtrue".indexOf(e)&&(t=e,e="both"),this.transform({flip:e,origin:t},!0)},opacity:function(e){return this.attr("opacity",e)}}),M("radius",{radius:function(e,t=e){return"radialGradient"===(this._element||this).type?this.attr("r",new Be(e)):this.rx(e).ry(t)}}),M("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(e){return new xe(this.node.getPointAtLength(e))}}),M(["Element","Runner"],{font:function(e,t){if("object"==typeof e){for(t in e)this.font(t,e[t]);return this}return"leading"===e?this.leading(t):"anchor"===e?this.attr("text-anchor",t):"size"===e||"family"===e||"weight"===e||"stretch"===e||"variant"===e||"style"===e?this.attr("font-"+e,t):this.attr(e,t)}}),M("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce(function(e,t){return e[t]=function(e){return null===e?this.off(t):this.on(t,e),this},e},{})),M("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){const e=(this.attr("transform")||"").split(ae).slice(0,-1).map(function(e){const t=e.trim().split("(");return[t[0],t[1].split(pe).map(function(e){return parseFloat(e)})]}).reverse().reduce(function(e,t){return"matrix"===t[0]?e.lmultiply(we.fromArray(t[1])):e[t[0]].apply(e,t[1])},new we);return e},toParent:function(e,t){if(this===e)return this;if(O(this.node))return this.addTo(e,t);const i=this.screenCTM(),n=e.screenCTM().inverse();return this.addTo(e,t).untransform().transform(n.multiply(i)),this},toRoot:function(e){return this.toParent(this.root(),e)},transform:function(e,t){if(null==e||"string"==typeof e){const t=new we(this).decompose();return null==e?t:t[e]}we.isMatrixLike(e)||(e={...e,origin:P(e,this)});const i=new we(!0===t?this:t||!1).transform(e);return this.attr("transform",i)}});class $e extends We{flatten(){return this.each(function(){if(this instanceof $e)return this.flatten().ungroup()}),this}ungroup(e=this.parent(),t=e.index(this)){return t=-1===t?e.children().length:t,this.each(function(i,n){return n[n.length-i-1].toParent(e,t)}),this.remove()}}J($e,"Container");class Ge extends $e{constructor(e,t=e){super(X("defs",e),t)}flatten(){return this}ungroup(){return this}}J(Ge,"Defs");class Xe extends We{}function qe(e){return this.attr("rx",e)}function Ze(e){return this.attr("ry",e)}function Je(e){return null==e?this.cx()-this.rx():this.cx(e+this.rx())}function Ke(e){return null==e?this.cy()-this.ry():this.cy(e+this.ry())}function Qe(e){return this.attr("cx",e)}function et(e){return this.attr("cy",e)}function tt(e){return null==e?2*this.rx():this.rx(new Be(e).divide(2))}function it(e){return null==e?2*this.ry():this.ry(new Be(e).divide(2))}J(Xe,"Shape");var nt=Object.freeze({__proto__:null,cx:Qe,cy:et,height:it,rx:qe,ry:Ze,width:tt,x:Je,y:Ke});class rt extends Xe{constructor(e,t=e){super(X("ellipse",e),t)}size(e,t){const i=I(this,e,t);return this.rx(new Be(i.width).divide(2)).ry(new Be(i.height).divide(2))}}te(rt,nt),M("Container",{ellipse:ie(function(e=0,t=e){return this.put(new rt).size(e,t).move(0,0)})}),J(rt,"Ellipse");class st extends Ve{constructor(e=B.document.createDocumentFragment()){super(e)}xml(e,t,i){if("boolean"==typeof e&&(i=t,t=e,e=null),null==e||"function"==typeof e){const e=new Ve($("wrapper",i));return e.add(this.node.cloneNode(!0)),e.xml(!1,i)}return super.xml(e,!1,i)}}function ot(e,t){return"radialGradient"===(this._element||this).type?this.attr({fx:new Be(e),fy:new Be(t)}):this.attr({x1:new Be(e),y1:new Be(t)})}function at(e,t){return"radialGradient"===(this._element||this).type?this.attr({cx:new Be(e),cy:new Be(t)}):this.attr({x2:new Be(e),y2:new Be(t)})}J(st,"Fragment");var lt=Object.freeze({__proto__:null,from:ot,to:at});class ct extends $e{constructor(e,t){super(X(e+"Gradient","string"==typeof e?null:e),t)}attr(e,t,i){return"transform"===e&&(e="gradientTransform"),super.attr(e,t,i)}bbox(){return new ke}targets(){return De("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(e){return this.clear(),"function"==typeof e&&e.call(this,this),this}url(){return"url(#"+this.id()+")"}}te(ct,lt),M({Container:{gradient(...e){return this.defs().gradient(...e)}},Defs:{gradient:ie(function(e,t){return this.put(new ct(e)).update(t)})}}),J(ct,"Gradient");class ht extends $e{constructor(e,t=e){super(X("pattern",e),t)}attr(e,t,i){return"transform"===e&&(e="patternTransform"),super.attr(e,t,i)}bbox(){return new ke}targets(){return De("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(e){return this.clear(),"function"==typeof e&&e.call(this,this),this}url(){return"url(#"+this.id()+")"}}M({Container:{pattern(...e){return this.defs().pattern(...e)}},Defs:{pattern:ie(function(e,t,i){return this.put(new ht).update(i).attr({x:0,y:0,width:e,height:t,patternUnits:"userSpaceOnUse"})})}}),J(ht,"Pattern");let dt=class extends Xe{constructor(e,t=e){super(X("image",e),t)}load(e,t){if(!e)return this;const i=new B.window.Image;return Re(i,"load",function(e){const n=this.parent(ht);0===this.width()&&0===this.height()&&this.size(i.width,i.height),n instanceof ht&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof t&&t.call(this,e)},this),Re(i,"load error",function(){Oe(i)}),this.attr("href",i.src=e,Y)}};var ut;ut=function(e,t,i){return"fill"!==e&&"stroke"!==e||fe.test(t)&&(t=i.root().defs().image(t)),t instanceof dt&&(t=i.root().defs().pattern(0,0,e=>{e.add(t)})),t},je.push(ut),M({Container:{image:ie(function(e,t){return this.put(new dt).size(0,0).load(e,t)})}}),J(dt,"Image");class ft extends Ye{bbox(){let e=-1/0,t=-1/0,i=1/0,n=1/0;return this.forEach(function(r){e=Math.max(r[0],e),t=Math.max(r[1],t),i=Math.min(r[0],i),n=Math.min(r[1],n)}),new ke(i,n,e-i,t-n)}move(e,t){const i=this.bbox();if(e-=i.x,t-=i.y,!isNaN(e)&&!isNaN(t))for(let i=this.length-1;i>=0;i--)this[i]=[this[i][0]+e,this[i][1]+t];return this}parse(e=[0,0]){const t=[];(e=e instanceof Array?Array.prototype.concat.apply([],e):e.trim().split(pe).map(parseFloat)).length%2!=0&&e.pop();for(let i=0,n=e.length;i<n;i+=2)t.push([e[i],e[i+1]]);return t}size(e,t){let i;const n=this.bbox();for(i=this.length-1;i>=0;i--)n.width&&(this[i][0]=(this[i][0]-n.x)*e/n.width+n.x),n.height&&(this[i][1]=(this[i][1]-n.y)*t/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const e=[];for(let t=0,i=this.length;t<i;t++)e.push(this[t].join(","));return e.join(" ")}transform(e){return this.clone().transformO(e)}transformO(e){we.isMatrixLike(e)||(e=new we(e));for(let t=this.length;t--;){const[i,n]=this[t];this[t][0]=e.a*i+e.c*n+e.e,this[t][1]=e.b*i+e.d*n+e.f}return this}}const pt=ft;var mt=Object.freeze({__proto__:null,MorphArray:pt,height:function(e){const t=this.bbox();return null==e?t.height:this.size(t.width,e)},width:function(e){const t=this.bbox();return null==e?t.width:this.size(e,t.height)},x:function(e){return null==e?this.bbox().x:this.move(e,this.bbox().y)},y:function(e){return null==e?this.bbox().y:this.move(this.bbox().x,e)}});let gt=class extends Xe{constructor(e,t=e){super(X("line",e),t)}array(){return new ft([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(e,t){return this.attr(this.array().move(e,t).toLine())}plot(e,t,i,n){return null==e?this.array():(e=void 0!==t?{x1:e,y1:t,x2:i,y2:n}:new ft(e).toLine(),this.attr(e))}size(e,t){const i=I(this,e,t);return this.attr(this.array().size(i.width,i.height).toLine())}};te(gt,mt),M({Container:{line:ie(function(...e){return gt.prototype.plot.apply(this.put(new gt),null!=e[0]?e:[0,0,0,0])})}}),J(gt,"Line");let _t=class extends $e{constructor(e,t=e){super(X("marker",e),t)}height(e){return this.attr("markerHeight",e)}orient(e){return this.attr("orient",e)}ref(e,t){return this.attr("refX",e).attr("refY",t)}toString(){return"url(#"+this.id()+")"}update(e){return this.clear(),"function"==typeof e&&e.call(this,this),this}width(e){return this.attr("markerWidth",e)}};function yt(e,t){return function(i){return null==i?this[e]:(this[e]=i,t&&t.call(this),this)}}M({Container:{marker(...e){return this.defs().marker(...e)}},Defs:{marker:ie(function(e,t,i){return this.put(new _t).size(e,t).ref(e/2,t/2).viewbox(0,0,e,t).attr("orient","auto").update(i)})},marker:{marker(e,t,i,n){let r=["marker"];return"all"!==e&&r.push(e),r=r.join("-"),e=arguments[1]instanceof _t?arguments[1]:this.defs().marker(t,i,n),this.attr(r,e)}}}),J(_t,"Marker");const vt={"-":function(e){return e},"<>":function(e){return-Math.cos(e*Math.PI)/2+.5},">":function(e){return Math.sin(e*Math.PI/2)},"<":function(e){return 1-Math.cos(e*Math.PI/2)},bezier:function(e,t,i,n){return function(r){return r<0?e>0?t/e*r:i>0?n/i*r:0:r>1?i<1?(1-n)/(1-i)*r+(n-i)/(1-i):e<1?(1-t)/(1-e)*r+(t-e)/(1-e):1:3*r*(1-r)**2*t+3*r**2*(1-r)*n+r**3}},steps:function(e,t="end"){t=t.split("-").reverse()[0];let i=e;return"none"===t?--i:"both"===t&&++i,(n,r=!1)=>{let s=Math.floor(n*e);const o=n*s%1==0;return"start"!==t&&"both"!==t||++s,r&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>i&&(s=i),s/i}}};class xt{done(){return!1}}class bt extends xt{constructor(e=">"){super(),this.ease=vt[e]||e}step(e,t,i){return"number"!=typeof e?i<1?e:t:e+(t-e)*this.ease(i)}}class wt extends xt{constructor(e){super(),this.stepper=e}done(e){return e.done}step(e,t,i,n){return this.stepper(e,t,i,n)}}function St(){const e=(this._duration||500)/1e3,t=this._overshoot||0,i=Math.PI,n=Math.log(t/100+1e-10),r=-n/Math.sqrt(i*i+n*n),s=3.9/(r*e);this.d=2*r*s,this.k=s*s}te(class extends wt{constructor(e=500,t=0){super(),this.duration(e).overshoot(t)}step(e,t,i,n){if("string"==typeof e)return e;if(n.done=i===1/0,i===1/0)return t;if(0===i)return e;i>100&&(i=16),i/=1e3;const r=n.velocity||0,s=-this.d*r-this.k*(e-t),o=e+r*i+s*i*i/2;return n.velocity=r+s*i,n.done=Math.abs(t-o)+Math.abs(r)<.002,n.done?t:o}},{duration:yt("_duration",St),overshoot:yt("_overshoot",St)}),te(class extends wt{constructor(e=.1,t=.01,i=0,n=1e3){super(),this.p(e).i(t).d(i).windup(n)}step(e,t,i,n){if("string"==typeof e)return e;if(n.done=i===1/0,i===1/0)return t;if(0===i)return e;const r=t-e;let s=(n.integral||0)+r*i;const o=(r-(n.error||0))/i,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=r,n.integral=s,n.done=Math.abs(r)<.001,n.done?t:e+(this.P*r+this.I*s+this.D*o)}},{windup:yt("_windup"),p:yt("P"),i:yt("I"),d:yt("D")});const Tt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},kt={M:function(e,t,i){return t.x=i.x=e[0],t.y=i.y=e[1],["M",t.x,t.y]},L:function(e,t){return t.x=e[0],t.y=e[1],["L",e[0],e[1]]},H:function(e,t){return t.x=e[0],["H",e[0]]},V:function(e,t){return t.y=e[0],["V",e[0]]},C:function(e,t){return t.x=e[4],t.y=e[5],["C",e[0],e[1],e[2],e[3],e[4],e[5]]},S:function(e,t){return t.x=e[2],t.y=e[3],["S",e[0],e[1],e[2],e[3]]},Q:function(e,t){return t.x=e[2],t.y=e[3],["Q",e[0],e[1],e[2],e[3]]},T:function(e,t){return t.x=e[0],t.y=e[1],["T",e[0],e[1]]},Z:function(e,t,i){return t.x=i.x,t.y=i.y,["Z"]},A:function(e,t){return t.x=e[5],t.y=e[6],["A",e[0],e[1],e[2],e[3],e[4],e[5],e[6]]}},Mt="mlhvqtcsaz".split("");for(let e=0,t=Mt.length;e<t;++e)kt[Mt[e]]=function(e){return function(t,i,n){if("H"===e)t[0]=t[0]+i.x;else if("V"===e)t[0]=t[0]+i.y;else if("A"===e)t[5]=t[5]+i.x,t[6]=t[6]+i.y;else for(let e=0,n=t.length;e<n;++e)t[e]=t[e]+(e%2?i.y:i.x);return kt[e](t,i,n)}}(Mt[e].toUpperCase());function At(e){return e.segment.length&&e.segment.length-1===Tt[e.segment[0].toUpperCase()]}function Ct(e,t){e.inNumber&&Dt(e,!1);const i=me.test(t);if(i)e.segment=[t];else{const t=e.lastCommand,i=t.toLowerCase(),n=t===i;e.segment=["m"===i?n?"l":"L":t]}return e.inSegment=!0,e.lastCommand=e.segment[0],i}function Dt(e,t){if(!e.inNumber)throw new Error("Parser Error");e.number&&e.segment.push(parseFloat(e.number)),e.inNumber=t,e.number="",e.pointSeen=!1,e.hasExponent=!1,At(e)&&Lt(e)}function Lt(e){e.inSegment=!1,e.absolute&&(e.segment=function(e){const t=e.segment[0];return kt[t](e.segment.slice(1),e.p,e.p0)}(e)),e.segments.push(e.segment)}function Et(e){if(!e.segment.length)return!1;const t="A"===e.segment[0].toUpperCase(),i=e.segment.length;return t&&(4===i||5===i)}function It(e){return"E"===e.lastToken.toUpperCase()}const Pt=new Set([" ",",","\t","\n","\r","\f"]);class Rt extends Ye{bbox(){return Se().path.setAttribute("d",this.toString()),new ke(Se.nodes.path.getBBox())}move(e,t){const i=this.bbox();if(e-=i.x,t-=i.y,!isNaN(e)&&!isNaN(t))for(let i,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]+=e,this[n][2]+=t):"H"===i?this[n][1]+=e:"V"===i?this[n][1]+=t:"C"===i||"S"===i||"Q"===i?(this[n][1]+=e,this[n][2]+=t,this[n][3]+=e,this[n][4]+=t,"C"===i&&(this[n][5]+=e,this[n][6]+=t)):"A"===i&&(this[n][6]+=e,this[n][7]+=t);return this}parse(e="M0 0"){return Array.isArray(e)&&(e=Array.prototype.concat.apply([],e).toString()),function(e,t=!0){let i=0,n="";const r={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:t,p0:new xe,p:new xe};for(;r.lastToken=n,n=e.charAt(i++);)if(r.inSegment||!Ct(r,n))if("."!==n)if(isNaN(parseInt(n)))if(Pt.has(n))r.inNumber&&Dt(r,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(me.test(n)){if(r.inNumber)Dt(r,!1);else{if(!At(r))throw new Error("parser Error");Lt(r)}--i}}else r.number+=n,r.hasExponent=!0;else{if(r.inNumber&&!It(r)){Dt(r,!1),--i;continue}r.number+=n,r.inNumber=!0}else{if("0"===r.number||Et(r)){r.inNumber=!0,r.number=n,Dt(r,!0);continue}r.inNumber=!0,r.number+=n}else{if(r.pointSeen||r.hasExponent){Dt(r,!1),--i;continue}r.inNumber=!0,r.pointSeen=!0,r.number+=n}return r.inNumber&&Dt(r,!1),r.inSegment&&At(r)&&Lt(r),r.segments}(e)}size(e,t){const i=this.bbox();let n,r;for(i.width=0===i.width?1:i.width,i.height=0===i.height?1:i.height,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]=(this[n][1]-i.x)*e/i.width+i.x,this[n][2]=(this[n][2]-i.y)*t/i.height+i.y):"H"===r?this[n][1]=(this[n][1]-i.x)*e/i.width+i.x:"V"===r?this[n][1]=(this[n][1]-i.y)*t/i.height+i.y:"C"===r||"S"===r||"Q"===r?(this[n][1]=(this[n][1]-i.x)*e/i.width+i.x,this[n][2]=(this[n][2]-i.y)*t/i.height+i.y,this[n][3]=(this[n][3]-i.x)*e/i.width+i.x,this[n][4]=(this[n][4]-i.y)*t/i.height+i.y,"C"===r&&(this[n][5]=(this[n][5]-i.x)*e/i.width+i.x,this[n][6]=(this[n][6]-i.y)*t/i.height+i.y)):"A"===r&&(this[n][1]=this[n][1]*e/i.width,this[n][2]=this[n][2]*t/i.height,this[n][6]=(this[n][6]-i.x)*e/i.width+i.x,this[n][7]=(this[n][7]-i.y)*t/i.height+i.y);return this}toString(){return function(e){let t="";for(let i=0,n=e.length;i<n;i++)t+=e[i][0],null!=e[i][1]&&(t+=e[i][1],null!=e[i][2]&&(t+=" ",t+=e[i][2],null!=e[i][3]&&(t+=" ",t+=e[i][3],t+=" ",t+=e[i][4],null!=e[i][5]&&(t+=" ",t+=e[i][5],t+=" ",t+=e[i][6],null!=e[i][7]&&(t+=" ",t+=e[i][7])))));return t+" "}(this)}}const Ot=e=>{const t=typeof e;return"number"===t?Be:"string"===t?ve.isColor(e)?ve:pe.test(e)?me.test(e)?Rt:Ye:ne.test(e)?Be:Ft:Ht.indexOf(e.constructor)>-1?e.constructor:Array.isArray(e)?Ye:"object"===t?Bt:Ft};class zt{constructor(e){this._stepper=e||new bt("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(e){return this._morphObj.morph(this._from,this._to,e,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce(function(e,t){return e&&t},!0)}from(e){return null==e?this._from:(this._from=this._set(e),this)}stepper(e){return null==e?this._stepper:(this._stepper=e,this)}to(e){return null==e?this._to:(this._to=this._set(e),this)}type(e){return null==e?this._type:(this._type=e,this)}_set(e){this._type||this.type(Ot(e));let t=new this._type(e);return this._type===ve&&(t=this._to?t[this._to[4]]():this._from?t[this._from[4]]():t),this._type===Bt&&(t=this._to?t.align(this._to):this._from?t.align(this._from):t),t=t.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(t.length)).map(Object).map(function(e){return e.done=!0,e}),t}}class Ft{constructor(...e){this.init(...e)}init(e){return e=Array.isArray(e)?e[0]:e,this.value=e,this}toArray(){return[this.value]}valueOf(){return this.value}}class Nt{constructor(...e){this.init(...e)}init(e){return Array.isArray(e)&&(e={scaleX:e[0],scaleY:e[1],shear:e[2],rotate:e[3],translateX:e[4],translateY:e[5],originX:e[6],originY:e[7]}),Object.assign(this,Nt.defaults,e),this}toArray(){const e=this;return[e.scaleX,e.scaleY,e.shear,e.rotate,e.translateX,e.translateY,e.originX,e.originY]}}Nt.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Yt=(e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0;class Bt{constructor(...e){this.init(...e)}align(e){const t=this.values;for(let i=0,n=t.length;i<n;++i){if(t[i+1]===e[i+1]){if(t[i+1]===ve&&e[i+7]!==t[i+7]){const t=e[i+7],n=new ve(this.values.splice(i+3,5))[t]().toArray();this.values.splice(i+3,0,...n)}i+=t[i+2]+2;continue}if(!e[i+1])return this;const n=(new e[i+1]).toArray(),r=t[i+2]+3;t.splice(i,r,e[i],e[i+1],e[i+2],...n),i+=t[i+2]+2}return this}init(e){if(this.values=[],Array.isArray(e))return void(this.values=e.slice());e=e||{};const t=[];for(const i in e){const n=Ot(e[i]),r=new n(e[i]).toArray();t.push([i,n,r.length,...r])}return t.sort(Yt),this.values=t.reduce((e,t)=>e.concat(t),[]),this}toArray(){return this.values}valueOf(){const e={},t=this.values;for(;t.length;){const i=t.shift(),n=t.shift(),r=t.shift(),s=t.splice(0,r);e[i]=new n(s)}return e}}const Ht=[Ft,Nt,Bt];class jt extends Xe{constructor(e,t=e){super(X("path",e),t)}array(){return this._array||(this._array=new Rt(this.attr("d")))}clear(){return delete this._array,this}height(e){return null==e?this.bbox().height:this.size(this.bbox().width,e)}move(e,t){return this.attr("d",this.array().move(e,t))}plot(e){return null==e?this.array():this.clear().attr("d","string"==typeof e?e:this._array=new Rt(e))}size(e,t){const i=I(this,e,t);return this.attr("d",this.array().size(i.width,i.height))}width(e){return null==e?this.bbox().width:this.size(e,this.bbox().height)}x(e){return null==e?this.bbox().x:this.move(e,this.bbox().y)}y(e){return null==e?this.bbox().y:this.move(this.bbox().x,e)}}jt.prototype.MorphArray=Rt,M({Container:{path:ie(function(e){return this.put(new jt).plot(e||new Rt)})}}),J(jt,"Path");var Vt=Object.freeze({__proto__:null,array:function(){return this._array||(this._array=new ft(this.attr("points")))},clear:function(){return delete this._array,this},move:function(e,t){return this.attr("points",this.array().move(e,t))},plot:function(e){return null==e?this.array():this.clear().attr("points","string"==typeof e?e:this._array=new ft(e))},size:function(e,t){const i=I(this,e,t);return this.attr("points",this.array().size(i.width,i.height))}});class Wt extends Xe{constructor(e,t=e){super(X("polygon",e),t)}}M({Container:{polygon:ie(function(e){return this.put(new Wt).plot(e||new ft)})}}),te(Wt,mt),te(Wt,Vt),J(Wt,"Polygon");class Ut extends Xe{constructor(e,t=e){super(X("polyline",e),t)}}M({Container:{polyline:ie(function(e){return this.put(new Ut).plot(e||new ft)})}}),te(Ut,mt),te(Ut,Vt),J(Ut,"Polyline");class $t extends Xe{constructor(e,t=e){super(X("rect",e),t)}}te($t,{rx:qe,ry:Ze}),M({Container:{rect:ie(function(e,t){return this.put(new $t).size(e,t)})}}),J($t,"Rect");class Gt{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(e){const t=void 0!==e.next?e:{value:e,next:null,prev:null};return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._last=t,this._first=t),t}remove(e){e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this._last&&(this._last=e.prev),e===this._first&&(this._first=e.next),e.prev=null,e.next=null}shift(){const e=this._first;return e?(this._first=e.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,e.value):null}}const Xt={nextDraw:null,frames:new Gt,timeouts:new Gt,immediates:new Gt,timer:()=>B.window.performance||B.window.Date,transforms:[],frame(e){const t=Xt.frames.push({run:e});return null===Xt.nextDraw&&(Xt.nextDraw=B.window.requestAnimationFrame(Xt._draw)),t},timeout(e,t){t=t||0;const i=Xt.timer().now()+t,n=Xt.timeouts.push({run:e,time:i});return null===Xt.nextDraw&&(Xt.nextDraw=B.window.requestAnimationFrame(Xt._draw)),n},immediate(e){const t=Xt.immediates.push(e);return null===Xt.nextDraw&&(Xt.nextDraw=B.window.requestAnimationFrame(Xt._draw)),t},cancelFrame(e){null!=e&&Xt.frames.remove(e)},clearTimeout(e){null!=e&&Xt.timeouts.remove(e)},cancelImmediate(e){null!=e&&Xt.immediates.remove(e)},_draw(e){let t=null;const i=Xt.timeouts.last();for(;(t=Xt.timeouts.shift())&&(e>=t.time?t.run():Xt.timeouts.push(t),t!==i););let n=null;const r=Xt.frames.last();for(;n!==r&&(n=Xt.frames.shift());)n.run(e);let s=null;for(;s=Xt.immediates.shift();)s();Xt.nextDraw=Xt.timeouts.first()||Xt.frames.first()?B.window.requestAnimationFrame(Xt._draw):null}},qt=function(e){const t=e.start,i=e.runner.duration();return{start:t,duration:i,end:t+i,runner:e.runner}},Zt=function(){const e=B.window;return(e.performance||e.Date).now()};class Jt extends ze{constructor(e=Zt){super(),this._timeSource=e,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const e=this.getLastRunnerInfo(),t=e?e.runner.duration():0;return(e?e.start:this._time)+t}getEndTimeOfTimeline(){const e=this._runners.map(e=>e.start+e.runner.duration());return Math.max(0,...e)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(e){return this._runners[this._runnerIds.indexOf(e)]||null}pause(){return this._paused=!0,this._continue()}persist(e){return null==e?this._persist:(this._persist=e,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(e){const t=this.speed();if(null==e)return this.speed(-t);const i=Math.abs(t);return this.speed(e?-i:i)}schedule(e,t,i){if(null==e)return this._runners.map(qt);let n=0;const r=this.getEndTime();if(t=t||0,null==i||"last"===i||"after"===i)n=r;else if("absolute"===i||"start"===i)n=t,t=0;else if("now"===i)n=this._time;else if("relative"===i){const i=this.getRunnerInfoById(e.id);i&&(n=i.start+t,t=0)}else{if("with-last"!==i)throw new Error('Invalid value for the "when" parameter');{const e=this.getLastRunnerInfo();n=e?e.start:this._time}}e.unschedule(),e.timeline(this);const s=e.persist(),o={persist:null===s?this._persist:s,start:n+t,runner:e};return this._lastRunnerId=e.id,this._runners.push(o),this._runners.sort((e,t)=>e.start-t.start),this._runnerIds=this._runners.map(e=>e.runner.id),this.updateTime()._continue(),this}seek(e){return this.time(this._time+e)}source(e){return null==e?this._timeSource:(this._timeSource=e,this)}speed(e){return null==e?this._speed:(this._speed=e,this)}stop(){return this.time(0),this.pause()}time(e){return null==e?this._time:(this._time=e,this._continue(!0))}unschedule(e){const t=this._runnerIds.indexOf(e.id);return t<0||(this._runners.splice(t,1),this._runnerIds.splice(t,1),e.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(e=!1){return Xt.cancelFrame(this._nextFrame),this._nextFrame=null,e?this._stepImmediate():(this._paused||(this._nextFrame=Xt.frame(this._step)),this)}_stepFn(e=!1){const t=this._timeSource();let i=t-this._lastSourceTime;e&&(i=0);const n=this._speed*i+(this._time-this._lastStepTime);this._lastSourceTime=t,e||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let e=this._runners.length;e--;){const t=this._runners[e],i=t.runner;this._time-t.start<=0&&i.reset()}let r=!1;for(let e=0,t=this._runners.length;e<t;e++){const i=this._runners[e],s=i.runner;let o=n;const a=this._time-i.start;a<=0?r=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==i.persist&&s.duration()-s.time()+this._time+i.persist<this._time&&(s.unschedule(),--e,--t):r=!0))}return r&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}M({Element:{timeline:function(e){return null==e?(this._timeline=this._timeline||new Jt,this._timeline):(this._timeline=e,this)}}});class Kt extends ze{constructor(e){super(),this.id=Kt.id++,e="function"==typeof(e=null==e?400:e)?new wt(e):e,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof e&&e,this._isDeclarative=e instanceof wt,this._stepper=this._isDeclarative?e:new bt,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new we,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(e,t,i){let n=1,r=!1,s=0;return t=t??0,i=i||"last","object"!=typeof(e=e??400)||e instanceof xt||(t=e.delay??t,i=e.when??i,r=e.swing||r,n=e.times??n,s=e.wait??s,e=e.duration??400),{duration:e,delay:t,swing:r,times:n,wait:s,when:i}}active(e){return null==e?this.enabled:(this.enabled=e,this)}addTransform(e){return this.transforms.lmultiplyO(e),this}after(e){return this.on("finished",e)}animate(e,t,i){const n=Kt.sanitise(e,t,i),r=new Kt(n.duration);return this._timeline&&r.timeline(this._timeline),this._element&&r.element(this._element),r.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new we,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter(e=>!e.isTransform))}delay(e){return this.animate(0,e)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(e){return this.queue(null,e)}ease(e){return this._stepper=new bt(e),this}element(e){return null==e?this._element:(this._element=e,e._prepareRunner(),this)}finish(){return this.step(1/0)}loop(e,t,i){return"object"==typeof e&&(t=e.swing,i=e.wait,e=e.times),this._times=e||1/0,this._swing=t||!1,this._wait=i||0,!0===this._times&&(this._times=1/0),this}loops(e){const t=this._duration+this._wait;if(null==e){const e=Math.floor(this._time/t),i=(this._time-e*t)/this._duration;return Math.min(e+i,this._times)}const i=e%1,n=t*Math.floor(e)+this._duration*i;return this.time(n)}persist(e){return null==e?this._persist:(this._persist=e,this)}position(e){const t=this._time,i=this._duration,n=this._wait,r=this._times,s=this._swing,o=this._reverse;let a;if(null==e){const e=function(e){const t=s*Math.floor(e%(2*(n+i))/(n+i)),r=t&&!o||!t&&o,a=Math.pow(-1,r)*(e%(n+i))/i+r;return Math.max(Math.min(a,1),0)},l=r*(n+i)-n;return a=t<=0?Math.round(e(1e-5)):t<l?e(t):Math.round(e(l-1e-5)),a}const l=Math.floor(this.loops()),c=s&&l%2==0;return a=l+(c&&!o||o&&c?e:1-e),this.loops(a)}progress(e){return null==e?Math.min(1,this._time/this.duration()):this.time(e*this.duration())}queue(e,t,i,n){return this._queue.push({initialiser:e||Fe,runner:t||Fe,retarget:i,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(e){return this._reverse=null==e?!this._reverse:e,this}schedule(e,t,i){if(e instanceof Jt||(i=t,t=e,e=this.timeline()),!e)throw Error("Runner cannot be scheduled without timeline");return e.schedule(this,t,i),this}step(e){if(!this.enabled)return this;e=null==e?16:e,this._time+=e;const t=this.position(),i=this._lastPosition!==t&&this._time>=0;this._lastPosition=t;const n=this.duration(),r=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,r&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(i||o)&&(this._initialise(i),this.transforms=new we,a=this._run(o?e:t),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(e){if(null==e)return this._time;const t=e-this._time;return this.step(t),this}timeline(e){return void 0===e?this._timeline:(this._timeline=e,this)}unschedule(){const e=this.timeline();return e&&e.unschedule(this),this}_initialise(e){if(e||this._isDeclarative)for(let t=0,i=this._queue.length;t<i;++t){const i=this._queue[t],n=this._isDeclarative||!i.initialised&&e;e=!i.finished,n&&e&&(i.initialiser.call(this),i.initialised=!0)}}_rememberMorpher(e,t){if(this._history[e]={morpher:t,caller:this._queue[this._queue.length-1]},this._isDeclarative){const e=this.timeline();e&&e.play()}}_run(e){let t=!0;for(let i=0,n=this._queue.length;i<n;++i){const n=this._queue[i],r=n.runner.call(this,e);n.finished=n.finished||!0===r,t=t&&n.finished}return t}_tryRetarget(e,t,i){if(this._history[e]){if(!this._history[e].caller.initialised){const t=this._queue.indexOf(this._history[e].caller);return this._queue.splice(t,1),!1}this._history[e].caller.retarget?this._history[e].caller.retarget.call(this,t,i):this._history[e].morpher.to(t),this._history[e].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Kt.id=0;class Qt{constructor(e=new we,t=-1,i=!0){this.transforms=e,this.id=t,this.done=i}clearTransformsFromQueue(){}}te([Kt,Qt],{mergeWith(e){return new Qt(e.transforms.lmultiply(this.transforms),e.id)}});const ei=(e,t)=>e.lmultiplyO(t),ti=e=>e.transforms;function ii(){const e=this._transformationRunners.runners.map(ti).reduce(ei,new we);this.transform(e),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class ni{constructor(){this.runners=[],this.ids=[]}add(e){if(this.runners.includes(e))return;const t=e.id+1;return this.runners.push(e),this.ids.push(t),this}clearBefore(e){const t=this.ids.indexOf(e+1)||1;return this.ids.splice(0,t,0),this.runners.splice(0,t,new Qt).forEach(e=>e.clearTransformsFromQueue()),this}edit(e,t){const i=this.ids.indexOf(e+1);return this.ids.splice(i,1,e+1),this.runners.splice(i,1,t),this}getByID(e){return this.runners[this.ids.indexOf(e+1)]}length(){return this.ids.length}merge(){let e=null;for(let t=0;t<this.runners.length;++t){const i=this.runners[t];if(!(e&&i.done&&e.done)||i._timeline&&i._timeline._runnerIds.includes(i.id)||e._timeline&&e._timeline._runnerIds.includes(e.id))e=i;else{this.remove(i.id);const n=i.mergeWith(e);this.edit(e.id,n),e=n,--t}}return this}remove(e){const t=this.ids.indexOf(e+1);return this.ids.splice(t,1),this.runners.splice(t,1),this}}M({Element:{animate(e,t,i){const n=Kt.sanitise(e,t,i),r=this.timeline();return new Kt(n.duration).loop(n).element(this).timeline(r.play()).schedule(n.delay,n.when)},delay(e,t){return this.animate(0,e,t)},_clearTransformRunnersBefore(e){this._transformationRunners.clearBefore(e.id)},_currentTransform(e){return this._transformationRunners.runners.filter(t=>t.id<=e.id).map(ti).reduce(ei,new we)},_addRunner(e){this._transformationRunners.add(e),Xt.cancelImmediate(this._frameId),this._frameId=Xt.immediate(ii.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new ni).add(new Qt(new we(this))))}}}),te(Kt,{attr(e,t){return this.styleAttr("attr",e,t)},css(e,t){return this.styleAttr("css",e,t)},styleAttr(e,t,i){if("string"==typeof t)return this.styleAttr(e,{[t]:i});let n=t;if(this._tryRetarget(e,n))return this;let r=new zt(this._stepper).to(n),s=Object.keys(n);return this.queue(function(){r=r.from(this.element()[e](s))},function(t){return this.element()[e](r.at(t).valueOf()),r.done()},function(t){const i=Object.keys(t),o=(a=s,i.filter(e=>!a.includes(e)));var a;if(o.length){const t=this.element()[e](o),i=new Bt(r.from()).valueOf();Object.assign(i,t),r.from(i)}const l=new Bt(r.to()).valueOf();Object.assign(l,t),r.to(l),s=i,n=t}),this._rememberMorpher(e,r),this},zoom(e,t){if(this._tryRetarget("zoom",e,t))return this;let i=new zt(this._stepper).to(new Be(e));return this.queue(function(){i=i.from(this.element().zoom())},function(e){return this.element().zoom(i.at(e),t),i.done()},function(e,n){t=n,i.to(e)}),this._rememberMorpher("zoom",i),this},transform(e,t,i){if(t=e.relative||t,this._isDeclarative&&!t&&this._tryRetarget("transform",e))return this;const n=we.isMatrixLike(e);i=null!=e.affine?e.affine:null!=i?i:!n;const r=new zt(this._stepper).type(i?Nt:we);let s,o,a,l,c;return this.queue(function(){o=o||this.element(),s=s||P(e,o),c=new we(t?void 0:o),o._addRunner(this),t||o._clearTransformRunnersBefore(this)},function(h){t||this.clearTransform();const{x:d,y:u}=new xe(s).transform(o._currentTransform(this));let f=new we({...e,origin:[d,u]}),p=this._isDeclarative&&a?a:c;if(i){f=f.decompose(d,u),p=p.decompose(d,u);const e=f.rotate,t=p.rotate,i=[e-360,e,e+360],n=i.map(e=>Math.abs(e-t)),r=Math.min(...n),s=n.indexOf(r);f.rotate=i[s]}t&&(n||(f.rotate=e.rotate||0),this._isDeclarative&&l&&(p.rotate=l)),r.from(p),r.to(f);const m=r.at(h);return l=m.rotate,a=new we(m),this.addTransform(a),o._addRunner(this),r.done()},function(t){(t.origin||"center").toString()!==(e.origin||"center").toString()&&(s=P(t,o)),e={...t,origin:s}},!0),this._isDeclarative&&this._rememberMorpher("transform",r),this},x(e){return this._queueNumber("x",e)},y(e){return this._queueNumber("y",e)},ax(e){return this._queueNumber("ax",e)},ay(e){return this._queueNumber("ay",e)},dx(e=0){return this._queueNumberDelta("x",e)},dy(e=0){return this._queueNumberDelta("y",e)},dmove(e,t){return this.dx(e).dy(t)},_queueNumberDelta(e,t){if(t=new Be(t),this._tryRetarget(e,t))return this;const i=new zt(this._stepper).to(t);let n=null;return this.queue(function(){n=this.element()[e](),i.from(n),i.to(n+t)},function(t){return this.element()[e](i.at(t)),i.done()},function(e){i.to(n+new Be(e))}),this._rememberMorpher(e,i),this},_queueObject(e,t){if(this._tryRetarget(e,t))return this;const i=new zt(this._stepper).to(t);return this.queue(function(){i.from(this.element()[e]())},function(t){return this.element()[e](i.at(t)),i.done()}),this._rememberMorpher(e,i),this},_queueNumber(e,t){return this._queueObject(e,new Be(t))},cx(e){return this._queueNumber("cx",e)},cy(e){return this._queueNumber("cy",e)},move(e,t){return this.x(e).y(t)},amove(e,t){return this.ax(e).ay(t)},center(e,t){return this.cx(e).cy(t)},size(e,t){let i;return e&&t||(i=this._element.bbox()),e||(e=i.width/i.height*t),t||(t=i.height/i.width*e),this.width(e).height(t)},width(e){return this._queueNumber("width",e)},height(e){return this._queueNumber("height",e)},plot(e,t,i,n){if(4===arguments.length)return this.plot([e,t,i,n]);if(this._tryRetarget("plot",e))return this;const r=new zt(this._stepper).type(this._element.MorphArray).to(e);return this.queue(function(){r.from(this._element.array())},function(e){return this._element.plot(r.at(e)),r.done()}),this._rememberMorpher("plot",r),this},leading(e){return this._queueNumber("leading",e)},viewbox(e,t,i,n){return this._queueObject("viewbox",new ke(e,t,i,n))},update(e){return"object"!=typeof e?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=e.opacity&&this.attr("stop-opacity",e.opacity),null!=e.color&&this.attr("stop-color",e.color),null!=e.offset&&this.attr("offset",e.offset),this)}}),te(Kt,{rx:qe,ry:Ze,from:ot,to:at}),J(Kt,"Runner");class ri extends $e{constructor(e,t=e){super(X("svg",e),t),this.namespace()}defs(){return this.isRoot()?q(this.node.querySelector("defs"))||this.put(new Ge):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof B.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:F,version:"1.1"}).attr("xmlns:xlink",Y,N):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,N).attr("xmlns:svgjs",null,N)}root(){return this.isRoot()?this:super.root()}}M({Container:{nested:ie(function(){return this.put(new ri)})}}),J(ri,"Svg",!0);let si=class extends $e{constructor(e,t=e){super(X("symbol",e),t)}};M({Container:{symbol:ie(function(){return this.put(new si)})}}),J(si,"Symbol");var oi=Object.freeze({__proto__:null,amove:function(e,t){return this.ax(e).ay(t)},ax:function(e){return this.attr("x",e)},ay:function(e){return this.attr("y",e)},build:function(e){return this._build=!!e,this},center:function(e,t,i=this.bbox()){return this.cx(e,i).cy(t,i)},cx:function(e,t=this.bbox()){return null==e?t.cx:this.attr("x",this.attr("x")+e-t.cx)},cy:function(e,t=this.bbox()){return null==e?t.cy:this.attr("y",this.attr("y")+e-t.cy)},length:function(){return this.node.getComputedTextLength()},move:function(e,t,i=this.bbox()){return this.x(e,i).y(t,i)},plain:function(e){return!1===this._build&&this.clear(),this.node.appendChild(B.document.createTextNode(e)),this},x:function(e,t=this.bbox()){return null==e?t.x:this.attr("x",this.attr("x")+e-t.x)},y:function(e,t=this.bbox()){return null==e?t.y:this.attr("y",this.attr("y")+e-t.y)}});class ai extends Xe{constructor(e,t=e){super(X("text",e),t),this.dom.leading=this.dom.leading??new Be(1.3),this._rebuild=!0,this._build=!1}leading(e){return null==e?this.dom.leading:(this.dom.leading=new Be(e),this.rebuild())}rebuild(e){if("boolean"==typeof e&&(this._rebuild=e),this._rebuild){const e=this;let t=0;const i=this.dom.leading;this.each(function(n){if(O(this.node))return;const r=B.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=i*new Be(r);this.dom.newLined&&(this.attr("x",e.attr("x")),"\n"===this.text()?t+=s:(this.attr("dy",n?s+t:0),t=0))}),this.fire("rebuild")}return this}setData(e){return this.dom=e,this.dom.leading=new Be(e.leading||1.3),this}writeDataToDom(){return z(this,this.dom,{leading:1.3}),this}text(e){if(void 0===e){const t=this.node.childNodes;let i=0;e="";for(let n=0,r=t.length;n<r;++n)"textPath"===t[n].nodeName||O(t[n])?0===n&&(i=n+1):(n!==i&&3!==t[n].nodeType&&!0===q(t[n]).dom.newLined&&(e+="\n"),e+=t[n].textContent);return e}if(this.clear().build(!0),"function"==typeof e)e.call(this,this);else for(let t=0,i=(e=(e+"").split("\n")).length;t<i;t++)this.newLine(e[t]);return this.build(!1).rebuild()}}te(ai,oi),M({Container:{text:ie(function(e=""){return this.put(new ai).text(e)}),plain:ie(function(e=""){return this.put(new ai).plain(e)})}}),J(ai,"Text");class li extends Xe{constructor(e,t=e){super(X("tspan",e),t),this._build=!1}dx(e){return this.attr("dx",e)}dy(e){return this.attr("dy",e)}newLine(){this.dom.newLined=!0;const e=this.parent();if(!(e instanceof ai))return this;const t=e.index(this),i=B.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=e.dom.leading*new Be(i);return this.dy(t?n:0).attr("x",e.x())}text(e){return null==e?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof e?(this.clear().build(!0),e.call(this,this),this.build(!1)):this.plain(e),this)}}te(li,oi),M({Tspan:{tspan:ie(function(e=""){const t=new li;return this._build||this.clear(),this.put(t).text(e)})},Text:{newLine:function(e=""){return this.tspan(e).newLine()}}}),J(li,"Tspan");class ci extends Xe{constructor(e,t=e){super(X("circle",e),t)}radius(e){return this.attr("r",e)}rx(e){return this.attr("r",e)}ry(e){return this.rx(e)}size(e){return this.radius(new Be(e).divide(2))}}te(ci,{x:Je,y:Ke,cx:Qe,cy:et,width:tt,height:it}),M({Container:{circle:ie(function(e=0){return this.put(new ci).size(e).move(0,0)})}}),J(ci,"Circle");class hi extends $e{constructor(e,t=e){super(X("clipPath",e),t)}remove(){return this.targets().forEach(function(e){e.unclip()}),super.remove()}targets(){return De("svg [clip-path*="+this.id()+"]")}}M({Container:{clip:ie(function(){return this.defs().put(new hi)})},Element:{clipper(){return this.reference("clip-path")},clipWith(e){const t=e instanceof hi?e:this.parent().clip().add(e);return this.attr("clip-path","url(#"+t.id()+")")},unclip(){return this.attr("clip-path",null)}}}),J(hi,"ClipPath");class di extends We{constructor(e,t=e){super(X("foreignObject",e),t)}}M({Container:{foreignObject:ie(function(e,t){return this.put(new di).size(e,t)})}}),J(di,"ForeignObject");var ui=Object.freeze({__proto__:null,dmove:function(e,t){return this.children().forEach(i=>{let n;try{n=i.node instanceof H().SVGSVGElement?new ke(i.attr(["x","y","width","height"])):i.bbox()}catch(e){return}const r=new we(i),s=r.translate(e,t).transform(r.inverse()),o=new xe(n.x,n.y).transform(s);i.move(o.x,o.y)}),this},dx:function(e){return this.dmove(e,0)},dy:function(e){return this.dmove(0,e)},height:function(e,t=this.bbox()){return null==e?t.height:this.size(t.width,e,t)},move:function(e=0,t=0,i=this.bbox()){const n=e-i.x,r=t-i.y;return this.dmove(n,r)},size:function(e,t,i=this.bbox()){const n=I(this,e,t,i),r=n.width/i.width,s=n.height/i.height;return this.children().forEach(e=>{const t=new xe(i).transform(new we(e).inverse());e.scale(r,s,t.x,t.y)}),this},width:function(e,t=this.bbox()){return null==e?t.width:this.size(e,t.height,t)},x:function(e,t=this.bbox()){return null==e?t.x:this.move(e,t.y,t)},y:function(e,t=this.bbox()){return null==e?t.y:this.move(t.x,e,t)}});class fi extends $e{constructor(e,t=e){super(X("g",e),t)}}te(fi,ui),M({Container:{group:ie(function(){return this.put(new fi)})}}),J(fi,"G");class pi extends $e{constructor(e,t=e){super(X("a",e),t)}target(e){return this.attr("target",e)}to(e){return this.attr("href",e,Y)}}te(pi,ui),M({Container:{link:ie(function(e){return this.put(new pi).to(e)})},Element:{unlink(){const e=this.linker();if(!e)return this;const t=e.parent();if(!t)return this.remove();const i=t.index(e);return t.add(this,i),e.remove(),this},linkTo(e){let t=this.linker();return t||(t=new pi,this.wrap(t)),"function"==typeof e?e.call(t,t):t.to(e),this},linker(){const e=this.parent();return e&&"a"===e.node.nodeName.toLowerCase()?e:null}}}),J(pi,"A");class mi extends $e{constructor(e,t=e){super(X("mask",e),t)}remove(){return this.targets().forEach(function(e){e.unmask()}),super.remove()}targets(){return De("svg [mask*="+this.id()+"]")}}M({Container:{mask:ie(function(){return this.defs().put(new mi)})},Element:{masker(){return this.reference("mask")},maskWith(e){const t=e instanceof mi?e:this.parent().mask().add(e);return this.attr("mask","url(#"+t.id()+")")},unmask(){return this.attr("mask",null)}}}),J(mi,"Mask");class gi extends We{constructor(e,t=e){super(X("stop",e),t)}update(e){return("number"==typeof e||e instanceof Be)&&(e={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=e.opacity&&this.attr("stop-opacity",e.opacity),null!=e.color&&this.attr("stop-color",e.color),null!=e.offset&&this.attr("offset",new Be(e.offset)),this}}M({Gradient:{stop:function(e,t,i){return this.put(new gi).update(e,t,i)}}}),J(gi,"Stop");class _i extends We{constructor(e,t=e){super(X("style",e),t)}addText(e=""){return this.node.textContent+=e,this}font(e,t,i={}){return this.rule("@font-face",{fontFamily:e,src:t,...i})}rule(e,t){return this.addText(function(e,t){if(!e)return"";if(!t)return e;let i=e+"{";for(const e in t)i+=e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()})+":"+t[e]+";";return i+="}",i}(e,t))}}M("Dom",{style(e,t){return this.put(new _i).rule(e,t)},fontface(e,t,i){return this.put(new _i).font(e,t,i)}}),J(_i,"Style");class yi extends ai{constructor(e,t=e){super(X("textPath",e),t)}array(){const e=this.track();return e?e.array():null}plot(e){const t=this.track();let i=null;return t&&(i=t.plot(e)),null==e?i:this}track(){return this.reference("href")}}M({Container:{textPath:ie(function(e,t){return e instanceof ai||(e=this.text(e)),e.path(t)})},Text:{path:ie(function(e,t=!0){const i=new yi;let n;if(e instanceof jt||(e=this.defs().path(e)),i.attr("href","#"+e,Y),t)for(;n=this.node.firstChild;)i.node.appendChild(n);return this.put(i)}),textPath(){return this.findOne("textPath")}},Path:{text:ie(function(e){return e instanceof ai||(e=(new ai).addTo(this.parent()).text(e)),e.path(this)}),targets(){return De("svg textPath").filter(e=>(e.attr("href")||"").includes(this.id()))}}}),yi.prototype.MorphArray=Rt,J(yi,"TextPath");class vi extends Xe{constructor(e,t=e){super(X("use",e),t)}use(e,t){return this.attr("href",(t||"")+"#"+e,Y)}}M({Container:{use:ie(function(e,t){return this.put(new vi).use(e,t)})}}),J(vi,"Use");const xi=G;te([ri,si,dt,ht,_t],A("viewbox")),te([gt,Ut,Wt,jt],A("marker")),te(ai,A("Text")),te(jt,A("Path")),te(Ge,A("Defs")),te([ai,li],A("Tspan")),te([$t,rt,ct,Kt],A("radius")),te(ze,A("EventTarget")),te(Ve,A("Dom")),te(We,A("Element")),te(Xe,A("Shape")),te([$e,st],A("Container")),te(ct,A("Gradient")),te(Kt,A("Runner")),Ae.extend([...new Set(k)]),function(e=[]){Ht.push(...[].concat(e))}([Be,ve,ke,we,Ye,ft,Rt,xe]),te(Ht,{to(e){return(new zt).type(this.constructor).from(this.toArray()).to(e)},fromArray(e){return this.init(e),this},toConsumable(){return this.toArray()},morph(e,t,i,n,r){return this.fromArray(e.map(function(e,s){return n.step(e,t[s],i,r[s],r)}))}});class bi extends We{constructor(e){super(X("filter",e),e),this.$source="SourceGraphic",this.$sourceAlpha="SourceAlpha",this.$background="BackgroundImage",this.$backgroundAlpha="BackgroundAlpha",this.$fill="FillPaint",this.$stroke="StrokePaint",this.$autoSetIn=!0}put(e,t){return!(e=super.put(e,t)).attr("in")&&this.$autoSetIn&&e.attr("in",this.$source),e.attr("result")||e.attr("result",e.id()),e}remove(){return this.targets().each("unfilter"),super.remove()}targets(){return De('svg [filter*="'+this.id()+'"]')}toString(){return"url(#"+this.id()+")"}}class wi extends We{constructor(e,t){super(e,t),this.result(this.id())}in(e){if(null==e){const e=this.attr("in");return this.parent()&&this.parent().find(`[result="${e}"]`)[0]||e}return this.attr("in",e)}result(e){return this.attr("result",e)}toString(){return this.result()}}const Si=e=>function(...t){for(let i=e.length;i--;)null!=t[i]&&this.attr(e[i],t[i])},Ti={blend:Si(["in","in2","mode"]),colorMatrix:Si(["type","values"]),composite:Si(["in","in2","operator"]),convolveMatrix:function(e){e=new Ye(e).toString(),this.attr({order:Math.sqrt(e.split(" ").length),kernelMatrix:e})},diffuseLighting:Si(["surfaceScale","lightingColor","diffuseConstant","kernelUnitLength"]),displacementMap:Si(["in","in2","scale","xChannelSelector","yChannelSelector"]),dropShadow:Si(["in","dx","dy","stdDeviation"]),flood:Si(["flood-color","flood-opacity"]),gaussianBlur:function(e=0,t=e){this.attr("stdDeviation",e+" "+t)},image:function(e){this.attr("href",e,Y)},morphology:Si(["operator","radius"]),offset:Si(["dx","dy"]),specularLighting:Si(["surfaceScale","lightingColor","diffuseConstant","specularExponent","kernelUnitLength"]),tile:Si([]),turbulence:Si(["baseFrequency","numOctaves","seed","stitchTiles","type"])};["blend","colorMatrix","componentTransfer","composite","convolveMatrix","diffuseLighting","displacementMap","dropShadow","flood","gaussianBlur","image","merge","morphology","offset","specularLighting","tile","turbulence"].forEach(e=>{const t=E(e),i=Ti[e];bi[t+"Effect"]=class extends wi{constructor(e){super(X("fe"+t,e),e)}update(e){return i.apply(this,e),this}},bi.prototype[e]=ie(function(e,...i){const n=new bi[t+"Effect"];return null==e?this.put(n):("function"==typeof e?e.call(n,n):i.unshift(e),this.put(n).update(i))})}),te(bi,{merge(e){const t=this.put(new bi.MergeEffect);return"function"==typeof e?(e.call(t,t),t):((e instanceof Array?e:[...arguments]).forEach(e=>{e instanceof bi.MergeNode?t.put(e):t.mergeNode(e)}),t)},componentTransfer(e={}){const t=this.put(new bi.ComponentTransferEffect);if("function"==typeof e)return e.call(t,t),t;e.r||e.g||e.b||e.a||(e={r:e,g:e,b:e,a:e});for(const i in e)t.add(new(bi["Func"+i.toUpperCase()])(e[i]));return t}}),["distantLight","pointLight","spotLight","mergeNode","FuncR","FuncG","FuncB","FuncA"].forEach(e=>{const t=E(e);bi[t]=class extends wi{constructor(e){super(X("fe"+t,e),e)}}}),["funcR","funcG","funcB","funcA"].forEach(function(e){const t=bi[E(e)],i=ie(function(){return this.put(new t)});bi.ComponentTransferEffect.prototype[e]=i}),["distantLight","pointLight","spotLight"].forEach(e=>{const t=bi[E(e)],i=ie(function(){return this.put(new t)});bi.DiffuseLightingEffect.prototype[e]=i,bi.SpecularLightingEffect.prototype[e]=i}),te(bi.MergeEffect,{mergeNode(e){return this.put(new bi.MergeNode).attr("in",e)}}),te(Ge,{filter:function(e){const t=this.put(new bi);return"function"==typeof e&&e.call(t,t),t}}),te($e,{filter:function(e){return this.defs().filter(e)}}),te(We,{filterWith:function(e){const t=e instanceof bi?e:this.defs().filter(e);return this.attr("filter",t)},unfilter:function(e){return this.attr("filter",null)},filterer(){return this.reference("filter")}});const ki={blend:function(e,t){return this.parent()&&this.parent().blend(this,e,t)},colorMatrix:function(e,t){return this.parent()&&this.parent().colorMatrix(e,t).in(this)},componentTransfer:function(e){return this.parent()&&this.parent().componentTransfer(e).in(this)},composite:function(e,t){return this.parent()&&this.parent().composite(this,e,t)},convolveMatrix:function(e){return this.parent()&&this.parent().convolveMatrix(e).in(this)},diffuseLighting:function(e,t,i,n){return this.parent()&&this.parent().diffuseLighting(e,i,n).in(this)},displacementMap:function(e,t,i,n){return this.parent()&&this.parent().displacementMap(this,e,t,i,n)},dropShadow:function(e,t,i){return this.parent()&&this.parent().dropShadow(this,e,t,i).in(this)},flood:function(e,t){return this.parent()&&this.parent().flood(e,t)},gaussianBlur:function(e,t){return this.parent()&&this.parent().gaussianBlur(e,t).in(this)},image:function(e){return this.parent()&&this.parent().image(e)},merge:function(e){return e=e instanceof Array?e:[...e],this.parent()&&this.parent().merge(this,...e)},morphology:function(e,t){return this.parent()&&this.parent().morphology(e,t).in(this)},offset:function(e,t){return this.parent()&&this.parent().offset(e,t).in(this)},specularLighting:function(e,t,i,n,r){return this.parent()&&this.parent().specularLighting(e,i,n,r).in(this)},tile:function(){return this.parent()&&this.parent().tile().in(this)},turbulence:function(e,t,i,n,r){return this.parent()&&this.parent().turbulence(e,t,i,n,r).in(this)}};te(wi,ki),te(bi.MergeEffect,{in:function(e){return e instanceof bi.MergeNode?this.add(e,0):this.add((new bi.MergeNode).in(e),0),this}}),te([bi.CompositeEffect,bi.BlendEffect,bi.DisplacementMapEffect],{in2:function(e){if(null==e){const e=this.attr("in2");return this.parent()&&this.parent().find(`[result="${e}"]`)[0]||e}return this.attr("in2",e)}}),bi.filter={sepiatone:[.343,.669,.119,0,0,.249,.626,.13,0,0,.172,.334,.111,0,0,0,0,0,1,0]};var Mi=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"getDefaultFilter",value:function(e,t){var i=this.w;e.unfilter(!0),(new bi).size("120%","180%","-5%","-40%"),i.config.chart.dropShadow.enabled&&this.dropShadow(e,i.config.chart.dropShadow,t)}},{key:"applyFilter",value:function(e,t,i){var n,r=this,s=this.w;if(e.unfilter(!0),"none"!==i){var o,a,l=s.config.chart.dropShadow,c="lighten"===i?2:.3;e.filterWith(function(e){e.colorMatrix({type:"matrix",values:"\n ".concat(c," 0 0 0 0\n 0 ").concat(c," 0 0 0\n 0 0 ").concat(c," 0 0\n 0 0 0 1 0\n "),in:"SourceGraphic",result:"brightness"}),l.enabled&&r.addShadow(e,t,l,"brightness")}),l.noUserSpaceOnUse||null===(o=e.filterer())||void 0===o||null===(a=o.node)||void 0===a||a.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null===(n=e.filterer())||void 0===n?void 0:n.node)}else this.getDefaultFilter(e,t)}},{key:"addShadow",value:function(e,t,i,n){var r,s=this.w,o=i.blur,a=i.top,l=i.left,c=i.color,h=i.opacity;if(c=Array.isArray(c)?c[t]:c,(null===(r=s.config.chart.dropShadow.enabledOnSeries)||void 0===r?void 0:r.length)>0&&-1===s.config.chart.dropShadow.enabledOnSeries.indexOf(t))return e;e.offset({in:n,dx:l,dy:a,result:"offset"}),e.gaussianBlur({in:"offset",stdDeviation:o,result:"blur"}),e.flood({"flood-color":c,"flood-opacity":h,result:"flood"}),e.composite({in:"flood",in2:"blur",operator:"in",result:"shadow"}),e.merge(["shadow",n])}},{key:"dropShadow",value:function(e,t){var i,n,r,s,o,a=this,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,c=this.w;return e.unfilter(!0),w.isMsEdge()&&"radialBar"===c.config.chart.type||(null===(i=c.config.chart.dropShadow.enabledOnSeries)||void 0===i?void 0:i.length)>0&&-1===(null===(r=c.config.chart.dropShadow.enabledOnSeries)||void 0===r?void 0:r.indexOf(l))||(e.filterWith(function(e){a.addShadow(e,l,t,"SourceGraphic")}),t.noUserSpaceOnUse||null===(s=e.filterer())||void 0===s||null===(o=s.node)||void 0===o||o.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null===(n=e.filterer())||void 0===n?void 0:n.node)),e}},{key:"setSelectionFilter",value:function(e,t,i){var n=this.w;if(void 0!==n.globals.selectedDataPoints[t]&&n.globals.selectedDataPoints[t].indexOf(i)>-1){e.node.setAttribute("selected",!0);var r=n.config.states.active.filter;"none"!==r&&this.applyFilter(e,t,r.type)}}},{key:"_scaleFilterSize",value:function(e){e&&function(t){for(var i in t)t.hasOwnProperty(i)&&e.setAttribute(i,t[i])}({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}]),e}(),Ai=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"roundPathCorners",value:function(e,t){function i(e,t,i){var r=t.x-e.x,s=t.y-e.y,o=Math.sqrt(r*r+s*s);return n(e,t,Math.min(1,i/o))}function n(e,t,i){return{x:e.x+(t.x-e.x)*i,y:e.y+(t.y-e.y)*i}}function r(e,t){e.length>2&&(e[e.length-2]=t.x,e[e.length-1]=t.y)}function s(e){return{x:parseFloat(e[e.length-2]),y:parseFloat(e[e.length-1])}}e.indexOf("NaN")>-1&&(e="");var o=e.split(/[,\s]/).reduce(function(e,t){var i=t.match(/^([a-zA-Z])(.+)/);return i?(e.push(i[1]),e.push(i[2])):e.push(t),e},[]).reduce(function(e,t){return parseFloat(t)==t&&e.length?e[e.length-1].push(t):e.push([t]),e},[]),a=[];if(o.length>1){var l=s(o[0]),c=null;"Z"==o[o.length-1][0]&&o[0].length>2&&(c=["L",l.x,l.y],o[o.length-1]=c),a.push(o[0]);for(var h=1;h<o.length;h++){var d=a[a.length-1],u=o[h],f=u==c?o[1]:o[h+1];if(f&&d&&d.length>2&&"L"==u[0]&&f.length>2&&"L"==f[0]){var p,m,g=s(d),_=s(u),y=s(f);p=i(_,g,t),m=i(_,y,t),r(u,p),u.origPoint=_,a.push(u);var v=n(p,_,.5),x=n(_,m,.5),b=["C",v.x,v.y,x.x,x.y,m.x,m.y];b.origPoint=_,a.push(b)}else a.push(u)}if(c){var w=s(a[a.length-1]);a.push(["Z"]),r(a[0],w)}}else a=o;return a.reduce(function(e,t){return e+t.join(" ")+" "},"")}},{key:"drawLine",value:function(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"#a8a8a8",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"butt";return this.w.globals.dom.Paper.line().attr({x1:e,y1:t,x2:i,y2:n,stroke:r,"stroke-dasharray":s,"stroke-width":o,"stroke-linecap":a})}},{key:"drawRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"#fefefe",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,h=this.w.globals.dom.Paper.rect();return h.attr({x:e,y:t,width:i>0?i:0,height:n>0?n:0,rx:r,ry:r,opacity:o,"stroke-width":null!==a?a:0,stroke:null!==l?l:"none","stroke-dasharray":c}),h.node.setAttribute("fill",s),h}},{key:"drawPolygon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#e1e1e1",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none";return this.w.globals.dom.Paper.polygon(e).attr({fill:n,stroke:t,"stroke-width":i})}},{key:"drawCircle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e<0&&(e=0);var i=this.w.globals.dom.Paper.circle(2*e);return null!==t&&i.attr(t),i}},{key:"drawPath",value:function(e){var t=e.d,i=void 0===t?"":t,n=e.stroke,r=void 0===n?"#a8a8a8":n,s=e.strokeWidth,o=void 0===s?1:s,a=e.fill,l=e.fillOpacity,c=void 0===l?1:l,h=e.strokeOpacity,d=void 0===h?1:h,u=e.classes,f=e.strokeLinecap,p=void 0===f?null:f,m=e.strokeDashArray,g=void 0===m?0:m,_=this.w;return null===p&&(p=_.config.stroke.lineCap),(i.indexOf("undefined")>-1||i.indexOf("NaN")>-1)&&(i="M 0 ".concat(_.globals.gridHeight)),_.globals.dom.Paper.path(i).attr({fill:a,"fill-opacity":c,stroke:r,"stroke-opacity":d,"stroke-linecap":p,"stroke-width":o,"stroke-dasharray":g,class:u})}},{key:"group",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.w.globals.dom.Paper.group();return null!==e&&t.attr(e),t}},{key:"move",value:function(e,t){return["M",e,t].join(" ")}},{key:"line",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=null;return null===i?n=[" L",e,t].join(" "):"H"===i?n=[" H",e].join(" "):"V"===i&&(n=[" V",t].join(" ")),n}},{key:"curve",value:function(e,t,i,n,r,s){return["C",e,t,i,n,r,s].join(" ")}},{key:"quadraticCurve",value:function(e,t,i,n){return["Q",e,t,i,n].join(" ")}},{key:"arc",value:function(e,t,i,n,r,s,o){var a="A";return arguments.length>7&&void 0!==arguments[7]&&arguments[7]&&(a="a"),[a,e,t,i,n,r,s,o].join(" ")}},{key:"renderPaths",value:function(e){var t,i=e.j,n=e.realIndex,r=e.pathFrom,s=e.pathTo,o=e.stroke,a=e.strokeWidth,l=e.strokeLinecap,c=e.fill,h=e.animationDelay,d=e.initialSpeed,u=e.dataChangeSpeed,f=e.className,p=e.chartType,g=e.shouldClipToGrid,_=void 0===g||g,y=e.bindEventsOnPaths,v=void 0===y||y,x=e.drawShadow,b=void 0===x||x,w=this.w,T=new Mi(this.ctx),k=new S(this.ctx),M=this.w.config.chart.animations.enabled,A=M&&this.w.config.chart.animations.dynamicAnimation.enabled;if(r&&r.startsWith("M 0 0")&&s){var C=s.match(/^M\s+[\d.-]+\s+[\d.-]+/);C&&(r=r.replace(/^M\s+0\s+0/,C[0]))}var D=!!(M&&!w.globals.resized||A&&w.globals.dataChanged&&w.globals.shouldAnimate);D?t=r:(t=s,w.globals.animationEnded=!0);var L,E=w.config.stroke.dashArray;L=Array.isArray(E)?E[n]:w.config.stroke.dashArray;var I=this.drawPath({d:t,stroke:o,strokeWidth:a,fill:c,fillOpacity:1,classes:f,strokeLinecap:l,strokeDashArray:L});I.attr("index",n),_&&("bar"===p&&!w.globals.isHorizontal||w.globals.comboCharts?I.attr({"clip-path":"url(#gridRectBarMask".concat(w.globals.cuid,")")}):I.attr({"clip-path":"url(#gridRectMask".concat(w.globals.cuid,")")})),w.config.chart.dropShadow.enabled&&b&&T.dropShadow(I,w.config.chart.dropShadow,n),v&&(I.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,I)),I.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,I)),I.node.addEventListener("mousedown",this.pathMouseDown.bind(this,I))),I.attr({pathTo:s,pathFrom:r});var P={el:I,j:i,realIndex:n,pathFrom:r,pathTo:s,fill:c,strokeWidth:a,delay:h};return!M||w.globals.resized||w.globals.dataChanged?!w.globals.resized&&w.globals.dataChanged||k.showDelayedElements():k.animatePathsGradually(m(m({},P),{},{speed:d})),w.globals.dataChanged&&A&&D&&k.animatePathsGradually(m(m({},P),{},{speed:u})),I}},{key:"drawPattern",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#a8a8a8",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return this.w.globals.dom.Paper.pattern(t,i,function(s){"horizontalLines"===e?s.line(0,0,i,0).stroke({color:n,width:r+1}):"verticalLines"===e?s.line(0,0,0,t).stroke({color:n,width:r+1}):"slantedLines"===e?s.line(0,0,t,i).stroke({color:n,width:r}):"squares"===e?s.rect(t,i).fill("none").stroke({color:n,width:r}):"circles"===e&&s.circle(t).fill("none").stroke({color:n,width:r})})}},{key:"drawGradient",value:function(e,t,i,n,r){var s,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,h=this.w;t.length<9&&0===t.indexOf("#")&&(t=w.hexToRgba(t,n)),i.length<9&&0===i.indexOf("#")&&(i=w.hexToRgba(i,r));var d=0,u=1,f=1,p=null;null!==a&&(d=void 0!==a[0]?a[0]/100:0,u=void 0!==a[1]?a[1]/100:1,f=void 0!==a[2]?a[2]/100:1,p=void 0!==a[3]?a[3]/100:null);var m=!("donut"!==h.config.chart.type&&"pie"!==h.config.chart.type&&"polarArea"!==h.config.chart.type&&"bubble"!==h.config.chart.type);if(s=l&&0!==l.length?h.globals.dom.Paper.gradient(m?"radial":"linear",function(e){(Array.isArray(l[c])?l[c]:l).forEach(function(t){e.stop(t.offset/100,t.color,t.opacity)})}):h.globals.dom.Paper.gradient(m?"radial":"linear",function(e){e.stop(d,t,n),e.stop(u,i,r),e.stop(f,i,r),null!==p&&e.stop(p,t,n)}),m){var g=h.globals.gridWidth/2,_=h.globals.gridHeight/2;"bubble"!==h.config.chart.type?s.attr({gradientUnits:"userSpaceOnUse",cx:g,cy:_,r:o}):s.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else"vertical"===e?s.from(0,0).to(0,1):"diagonal"===e?s.from(0,0).to(1,1):"horizontal"===e?s.from(0,1).to(1,1):"diagonal2"===e&&s.from(1,0).to(0,1);return s}},{key:"getTextBasedOnMaxWidth",value:function(e){var t=e.text,i=e.maxWidth,n=e.fontSize,r=e.fontFamily,s=this.getTextRects(t,n,r),o=s.width/t.length,a=Math.floor(i/o);return i<s.width?t.slice(0,a-3)+"...":t}},{key:"drawText",value:function(e){var t=this,i=e.x,n=e.y,r=e.text,s=e.textAnchor,o=e.fontSize,a=e.fontFamily,l=e.fontWeight,c=e.foreColor,h=e.opacity,d=e.maxWidth,u=e.cssClass,f=void 0===u?"":u,p=e.isPlainText,g=void 0===p||p,_=e.dominantBaseline,y=void 0===_?"auto":_,v=this.w;void 0===r&&(r="");var x=r;s||(s="start"),c&&c.length||(c=v.config.chart.foreColor),a=a||v.config.chart.fontFamily,l=l||"regular";var b,w={maxWidth:d,fontSize:o=o||"11px",fontFamily:a};return Array.isArray(r)?b=v.globals.dom.Paper.text(function(e){for(var i=0;i<r.length;i++)x=r[i],d&&(x=t.getTextBasedOnMaxWidth(m({text:r[i]},w))),0===i?e.tspan(x):e.tspan(x).newLine()}):(d&&(x=this.getTextBasedOnMaxWidth(m({text:r},w))),b=g?v.globals.dom.Paper.plain(r):v.globals.dom.Paper.text(function(e){return e.tspan(x)})),b.attr({x:i,y:n,"text-anchor":s,"dominant-baseline":y,"font-size":o,"font-family":a,"font-weight":l,fill:c,class:"apexcharts-text "+f}),b.node.style.fontFamily=a,b.node.style.opacity=h,b}},{key:"getMarkerPath",value:function(e,t,i,n){var r="";switch(i){case"cross":r="M ".concat(e-(n/=1.4)," ").concat(t-n," L ").concat(e+n," ").concat(t+n," M ").concat(e-n," ").concat(t+n," L ").concat(e+n," ").concat(t-n);break;case"plus":r="M ".concat(e-(n/=1.12)," ").concat(t," L ").concat(e+n," ").concat(t," M ").concat(e," ").concat(t-n," L ").concat(e," ").concat(t+n);break;case"star":case"sparkle":var s=5;n*=1.15,"sparkle"===i&&(n/=1.1,s=4);for(var o=Math.PI/s,a=0;a<=2*s;a++){var l=a*o,c=a%2==0?n:n/2;r+=(0===a?"M":"L")+(e+c*Math.sin(l))+","+(t-c*Math.cos(l))}r+="Z";break;case"triangle":r="M ".concat(e," ").concat(t-n," \n L ").concat(e+n," ").concat(t+n," \n L ").concat(e-n," ").concat(t+n," \n Z");break;case"square":case"rect":r="M ".concat(e-(n/=1.125)," ").concat(t-n," \n L ").concat(e+n," ").concat(t-n," \n L ").concat(e+n," ").concat(t+n," \n L ").concat(e-n," ").concat(t+n," \n Z");break;case"diamond":n*=1.05,r="M ".concat(e," ").concat(t-n," \n L ").concat(e+n," ").concat(t," \n L ").concat(e," ").concat(t+n," \n L ").concat(e-n," ").concat(t," \n Z");break;case"line":r="M ".concat(e-(n/=1.1)," ").concat(t," \n L ").concat(e+n," ").concat(t);break;default:n*=2,r="M ".concat(e,", ").concat(t," \n m -").concat(n/2,", 0 \n a ").concat(n/2,",").concat(n/2," 0 1,0 ").concat(n,",0 \n a ").concat(n/2,",").concat(n/2," 0 1,0 -").concat(n,",0")}return r}},{key:"drawMarkerShape",value:function(e,t,i,n,r){var s=this.drawPath({d:this.getMarkerPath(e,t,i,n,r),stroke:r.pointStrokeColor,strokeDashArray:r.pointStrokeDashArray,strokeWidth:r.pointStrokeWidth,fill:r.pointFillColor,fillOpacity:r.pointFillOpacity,strokeOpacity:r.pointStrokeOpacity});return s.attr({cx:e,cy:t,shape:r.shape,class:r.class?r.class:""}),s}},{key:"drawMarker",value:function(e,t,i){e=e||0;var n=i.pSize||0;return w.isNumber(t)||(n=0,t=0),this.drawMarkerShape(e,t,null==i?void 0:i.shape,n,m(m({},i),"line"===i.shape||"plus"===i.shape||"cross"===i.shape?{pointStrokeColor:i.pointFillColor,pointStrokeOpacity:i.pointFillOpacity}:{}))}},{key:"pathMouseEnter",value:function(e,t){var i=this.w,n=new Mi(this.ctx),r=parseInt(e.node.getAttribute("index"),10),s=parseInt(e.node.getAttribute("j"),10);if("function"==typeof i.config.chart.events.dataPointMouseEnter&&i.config.chart.events.dataPointMouseEnter(t,this.ctx,{seriesIndex:r,dataPointIndex:s,w:i}),this.ctx.events.fireEvent("dataPointMouseEnter",[t,this.ctx,{seriesIndex:r,dataPointIndex:s,w:i}]),("none"===i.config.states.active.filter.type||"true"!==e.node.getAttribute("selected"))&&"none"!==i.config.states.hover.filter.type&&!i.globals.isTouchDevice){var o=i.config.states.hover.filter;n.applyFilter(e,r,o.type)}}},{key:"pathMouseLeave",value:function(e,t){var i=this.w,n=new Mi(this.ctx),r=parseInt(e.node.getAttribute("index"),10),s=parseInt(e.node.getAttribute("j"),10);"function"==typeof i.config.chart.events.dataPointMouseLeave&&i.config.chart.events.dataPointMouseLeave(t,this.ctx,{seriesIndex:r,dataPointIndex:s,w:i}),this.ctx.events.fireEvent("dataPointMouseLeave",[t,this.ctx,{seriesIndex:r,dataPointIndex:s,w:i}]),"none"!==i.config.states.active.filter.type&&"true"===e.node.getAttribute("selected")||"none"!==i.config.states.hover.filter.type&&n.getDefaultFilter(e,r)}},{key:"pathMouseDown",value:function(e,t){var i=this.w,n=new Mi(this.ctx),r=parseInt(e.node.getAttribute("index"),10),s=parseInt(e.node.getAttribute("j"),10),o="false";if("true"===e.node.getAttribute("selected")){if(e.node.setAttribute("selected","false"),i.globals.selectedDataPoints[r].indexOf(s)>-1){var a=i.globals.selectedDataPoints[r].indexOf(s);i.globals.selectedDataPoints[r].splice(a,1)}}else{if(!i.config.states.active.allowMultipleDataPointsSelection&&i.globals.selectedDataPoints.length>0){i.globals.selectedDataPoints=[];var l=i.globals.dom.Paper.find(".apexcharts-series path:not(.apexcharts-decoration-element)"),c=i.globals.dom.Paper.find(".apexcharts-series circle:not(.apexcharts-decoration-element), .apexcharts-series rect:not(.apexcharts-decoration-element)"),h=function(e){Array.prototype.forEach.call(e,function(e){e.node.setAttribute("selected","false"),n.getDefaultFilter(e,r)})};h(l),h(c)}e.node.setAttribute("selected","true"),o="true",void 0===i.globals.selectedDataPoints[r]&&(i.globals.selectedDataPoints[r]=[]),i.globals.selectedDataPoints[r].push(s)}if("true"===o){var d=i.config.states.active.filter;if("none"!==d)n.applyFilter(e,r,d.type);else if("none"!==i.config.states.hover.filter&&!i.globals.isTouchDevice){var u=i.config.states.hover.filter;n.applyFilter(e,r,u.type)}}else"none"!==i.config.states.active.filter.type&&("none"===i.config.states.hover.filter.type||i.globals.isTouchDevice?n.getDefaultFilter(e,r):(u=i.config.states.hover.filter,n.applyFilter(e,r,u.type)));"function"==typeof i.config.chart.events.dataPointSelection&&i.config.chart.events.dataPointSelection(t,this.ctx,{selectedDataPoints:i.globals.selectedDataPoints,seriesIndex:r,dataPointIndex:s,w:i}),t&&this.ctx.events.fireEvent("dataPointSelection",[t,this.ctx,{selectedDataPoints:i.globals.selectedDataPoints,seriesIndex:r,dataPointIndex:s,w:i}])}},{key:"rotateAroundCenter",value:function(e){var t={};return e&&"function"==typeof e.getBBox&&(t=e.getBBox()),{x:t.x+t.width/2,y:t.y+t.height/2}}},{key:"getTextRects",value:function(e,t,i,n){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this.w,o=this.drawText({x:-200,y:-200,text:e,textAnchor:"start",fontSize:t,fontFamily:i,foreColor:"#fff",opacity:0});n&&o.attr("transform",n),s.globals.dom.Paper.add(o);var a=o.bbox();return r||(a=o.node.getBoundingClientRect()),o.remove(),{width:a.width,height:a.height}}},{key:"placeTextWithEllipsis",value:function(e,t,i){if("function"==typeof e.getComputedTextLength&&(e.textContent=t,t.length>0&&e.getComputedTextLength()>=i/1.1)){for(var n=t.length-3;n>0;n-=3)if(e.getSubStringLength(0,n)<=i/1.1)return void(e.textContent=t.substring(0,n)+"...");e.textContent="."}}}],[{key:"setAttrs",value:function(e,t){for(var i in t)t.hasOwnProperty(i)&&e.setAttribute(i,t[i])}}]),e}(),Ci=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"getStackedSeriesTotals",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.w,i=[];if(0===t.globals.series.length)return i;for(var n=0;n<t.globals.series[t.globals.maxValsInArrayIndex].length;n++){for(var r=0,s=0;s<t.globals.series.length;s++)void 0!==t.globals.series[s][n]&&-1===e.indexOf(s)&&(r+=t.globals.series[s][n]);i.push(r)}return i}},{key:"getSeriesTotalByIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===e?this.w.config.series.reduce(function(e,t){return e+t},0):this.w.globals.series[e].reduce(function(e,t){return e+t},0)}},{key:"getStackedSeriesTotalsByGroups",value:function(){var e=this,t=this.w,i=[];return t.globals.seriesGroups.forEach(function(n){var r=[];t.config.series.forEach(function(e,i){n.indexOf(t.globals.seriesNames[i])>-1&&r.push(i)});var s=t.globals.series.map(function(e,t){return-1===r.indexOf(t)?t:-1}).filter(function(e){return-1!==e});i.push(e.getStackedSeriesTotals(s))}),i}},{key:"setSeriesYAxisMappings",value:function(){var e=this.w.globals,t=this.w.config,i=[],n=[],r=[],s=e.series.length>t.yaxis.length||t.yaxis.some(function(e){return Array.isArray(e.seriesName)});t.series.forEach(function(e,t){r.push(t),n.push(null)}),t.yaxis.forEach(function(e,t){i[t]=[]});var o=[];t.yaxis.forEach(function(e,n){var a=!1;if(e.seriesName){var l=[];Array.isArray(e.seriesName)?l=e.seriesName:l.push(e.seriesName),l.forEach(function(e){t.series.forEach(function(t,o){if(t.name===e){var l=o;n===o||s?!s||r.indexOf(o)>-1?i[n].push([n,o]):console.warn("Series '"+t.name+"' referenced more than once in what looks like the new style. That is, when using either seriesName: [], or when there are more series than yaxes."):(i[o].push([o,n]),l=n),a=!0,-1!==(l=r.indexOf(l))&&r.splice(l,1)}})})}a||o.push(n)}),i=i.map(function(e,t){var i=[];return e.forEach(function(e){n[e[1]]=e[0],i.push(e[1])}),i});for(var a=t.yaxis.length-1,l=0;l<o.length&&(a=o[l],i[a]=[],r);l++){var c=r[0];r.shift(),i[a].push(c),n[c]=a}r.forEach(function(e){i[a].push(e),n[e]=a}),e.seriesYAxisMap=i.map(function(e){return e}),e.seriesYAxisReverseMap=n.map(function(e){return e}),e.seriesYAxisMap.forEach(function(e,i){e.forEach(function(e){t.series[e]&&void 0===t.series[e].group&&(t.series[e].__apexParsed?t.series[e].group="apexcharts-axis-".concat(e.toString()):t.series[e].group="apexcharts-axis-".concat(i.toString()))})})}},{key:"isSeriesNull",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return 0===(null===e?this.w.config.series.filter(function(e){return null!==e}):this.w.config.series[e].data.filter(function(e){return null!==e})).length}},{key:"seriesHaveSameValues",value:function(e){return this.w.globals.series[e].every(function(e,t,i){return e===i[0]})}},{key:"getCategoryLabels",value:function(e){var t=this.w,i=e.slice();return t.config.xaxis.convertedCatToNumeric&&(i=e.map(function(e,i){return t.config.xaxis.labels.formatter(e-t.globals.minX+1)})),i}},{key:"getLargestSeries",value:function(){var e=this.w;e.globals.maxValsInArrayIndex=e.globals.series.map(function(e){return e.length}).indexOf(Math.max.apply(Math,e.globals.series.map(function(e){return e.length})))}},{key:"getLargestMarkerSize",value:function(){var e=this.w,t=0;return e.globals.markers.size.forEach(function(e){t=Math.max(t,e)}),e.config.markers.discrete&&e.config.markers.discrete.length&&e.config.markers.discrete.forEach(function(e){t=Math.max(t,e.size)}),t>0&&(e.config.markers.hover.size>0?t=e.config.markers.hover.size:t+=e.config.markers.hover.sizeOffset),e.globals.markers.largestSize=t,t}},{key:"getSeriesTotals",value:function(){var e=this.w;e.globals.seriesTotals=e.globals.series.map(function(e,t){var i=0;if(Array.isArray(e))for(var n=0;n<e.length;n++)i+=e[n];else i+=e;return i})}},{key:"getSeriesTotalsXRange",value:function(e,t){var i=this.w;return i.globals.series.map(function(n,r){for(var s=0,o=0;o<n.length;o++)i.globals.seriesX[r][o]>e&&i.globals.seriesX[r][o]<t&&(s+=n[o]);return s})}},{key:"getPercentSeries",value:function(){var e=this.w;e.globals.seriesPercent=e.globals.series.map(function(t,i){var n=[];if(Array.isArray(t))for(var r=0;r<t.length;r++){var s=e.globals.stackedSeriesTotals[r],o=0;s&&(o=100*t[r]/s),n.push(o)}else{var a=100*t/e.globals.seriesTotals.reduce(function(e,t){return e+t},0);n.push(a)}return n})}},{key:"getCalculatedRatios",value:function(){var e,t,i,n=this,r=this.w,s=r.globals,o=[],a=0,l=[],c=.1,h=0;if(s.yRange=[],s.isMultipleYAxis)for(var d=0;d<s.minYArr.length;d++)s.yRange.push(Math.abs(s.minYArr[d]-s.maxYArr[d])),l.push(0);else s.yRange.push(Math.abs(s.minY-s.maxY));s.xRange=Math.abs(s.maxX-s.minX),s.zRange=Math.abs(s.maxZ-s.minZ);for(var u=0;u<s.yRange.length;u++)o.push(s.yRange[u]/s.gridHeight);if(t=s.xRange/s.gridWidth,e=s.yRange/s.gridWidth,i=s.xRange/s.gridHeight,(a=s.zRange/s.gridHeight*16)||(a=1),s.minY!==Number.MIN_VALUE&&0!==Math.abs(s.minY)&&(s.hasNegs=!0),r.globals.seriesYAxisReverseMap.length>0){var f=function(e,t){var i=r.config.yaxis[r.globals.seriesYAxisReverseMap[t]],s=e<0?-1:1;return e=Math.abs(e),i.logarithmic&&(e=n.getBaseLog(i.logBase,e)),-s*e/o[t]};if(s.isMultipleYAxis){l=[];for(var p=0;p<o.length;p++)l.push(f(s.minYArr[p],p))}else(l=[]).push(f(s.minY,0)),s.minY!==Number.MIN_VALUE&&0!==Math.abs(s.minY)&&(c=-s.minY/e,h=s.minX/t)}else(l=[]).push(0),c=0,h=0;return{yRatio:o,invertedYRatio:e,zRatio:a,xRatio:t,invertedXRatio:i,baseLineInvertedY:c,baseLineY:l,baseLineX:h}}},{key:"getLogSeries",value:function(e){var t=this,i=this.w;return i.globals.seriesLog=e.map(function(e,n){var r=i.globals.seriesYAxisReverseMap[n];return i.config.yaxis[r]&&i.config.yaxis[r].logarithmic?e.map(function(e){return null===e?null:t.getLogVal(i.config.yaxis[r].logBase,e,n)}):e}),i.globals.invalidLogScale?e:i.globals.seriesLog}},{key:"getLogValAtSeriesIndex",value:function(e,t){if(null===e)return null;var i=this.w,n=i.globals.seriesYAxisReverseMap[t];return i.config.yaxis[n]&&i.config.yaxis[n].logarithmic?this.getLogVal(i.config.yaxis[n].logBase,e,t):e}},{key:"getBaseLog",value:function(e,t){return Math.log(t)/Math.log(e)}},{key:"getLogVal",value:function(e,t,i){if(t<=0)return 0;var n=this.w,r=0===n.globals.minYArr[i]?-1:this.getBaseLog(e,n.globals.minYArr[i]),s=(0===n.globals.maxYArr[i]?0:this.getBaseLog(e,n.globals.maxYArr[i]))-r;return t<1?t/s:(this.getBaseLog(e,t)-r)/s}},{key:"getLogYRatios",value:function(e){var t=this,i=this.w,n=this.w.globals;return n.yLogRatio=e.slice(),n.logYRange=n.yRange.map(function(e,r){var s=i.globals.seriesYAxisReverseMap[r];if(i.config.yaxis[s]&&t.w.config.yaxis[s].logarithmic){var o,a=-Number.MAX_VALUE,l=Number.MIN_VALUE;return n.seriesLog.forEach(function(e,t){e.forEach(function(e){i.config.yaxis[t]&&i.config.yaxis[t].logarithmic&&(a=Math.max(e,a),l=Math.min(e,l))})}),o=Math.pow(n.yRange[r],Math.abs(l-a)/n.yRange[r]),n.yLogRatio[r]=o/n.gridHeight,o}}),n.invalidLogScale?e.slice():n.yLogRatio}},{key:"drawSeriesByGroup",value:function(e,t,i,n){var r=this.w,s=[];return e.series.length>0&&t.forEach(function(t){var o=[],a=[];e.i.forEach(function(i,n){r.config.series[i].group===t&&(o.push(e.series[n]),a.push(i))}),o.length>0&&s.push(n.draw(o,i,a))}),s}}],[{key:"checkComboSeries",value:function(e,t){var i=!1,n=0,r=0;return void 0===t&&(t="line"),e.length&&void 0!==e[0].type&&e.forEach(function(e){"bar"!==e.type&&"column"!==e.type&&"candlestick"!==e.type&&"boxPlot"!==e.type||n++,void 0!==e.type&&e.type!==t&&r++}),r>0&&(i=!0),{comboBarCount:n,comboCharts:i}}},{key:"extendArrayProps",value:function(e,t,i){var n,r,s,o,a,l;return null!==(n=t)&&void 0!==n&&n.yaxis&&(t=e.extendYAxis(t,i)),null!==(r=t)&&void 0!==r&&r.annotations&&(t.annotations.yaxis&&(t=e.extendYAxisAnnotations(t)),null!==(s=t)&&void 0!==s&&null!==(o=s.annotations)&&void 0!==o&&o.xaxis&&(t=e.extendXAxisAnnotations(t)),null!==(a=t)&&void 0!==a&&null!==(l=a.annotations)&&void 0!==l&&l.points&&(t=e.extendPointAnnotations(t))),t}}]),e}(),Di=function(){function e(t){s(this,e),this.w=t.w,this.annoCtx=t}return a(e,[{key:"setOrientations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.w;if("vertical"===e.label.orientation){var n=null!==t?t:0,r=i.globals.dom.baseEl.querySelector(".apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='".concat(n,"']"));if(null!==r){var s=r.getBoundingClientRect();r.setAttribute("x",parseFloat(r.getAttribute("x"))-s.height+4);var o="top"===e.label.position?s.width:-s.width;r.setAttribute("y",parseFloat(r.getAttribute("y"))+o);var a=this.annoCtx.graphics.rotateAroundCenter(r),l=a.x,c=a.y;r.setAttribute("transform","rotate(-90 ".concat(l," ").concat(c,")"))}}}},{key:"addBackgroundToAnno",value:function(e,t){var i=this.w;if(!e||!t.label.text||!String(t.label.text).trim())return null;var n=i.globals.dom.baseEl.querySelector(".apexcharts-grid").getBoundingClientRect(),r=e.getBoundingClientRect(),s=t.label.style.padding,o=s.left,a=s.right,l=s.top,c=s.bottom;if("vertical"===t.label.orientation){var h=[o,a,l,c];l=h[0],c=h[1],o=h[2],a=h[3]}var d=r.left-n.left-o,u=r.top-n.top-l,f=this.annoCtx.graphics.drawRect(d-i.globals.barPadForNumericAxis,u,r.width+o+a,r.height+l+c,t.label.borderRadius,t.label.style.background,1,t.label.borderWidth,t.label.borderColor,0);return t.id&&f.node.classList.add(t.id),f}},{key:"annotationsBackground",value:function(){var e=this,t=this.w,i=function(i,n,r){var s=t.globals.dom.baseEl.querySelector(".apexcharts-".concat(r,"-annotations .apexcharts-").concat(r,"-annotation-label[rel='").concat(n,"']"));if(s){var o=s.parentNode,a=e.addBackgroundToAnno(s,i);a&&(o.insertBefore(a.node,s),i.label.mouseEnter&&a.node.addEventListener("mouseenter",i.label.mouseEnter.bind(e,i)),i.label.mouseLeave&&a.node.addEventListener("mouseleave",i.label.mouseLeave.bind(e,i)),i.label.click&&a.node.addEventListener("click",i.label.click.bind(e,i)))}};t.config.annotations.xaxis.forEach(function(e,t){return i(e,t,"xaxis")}),t.config.annotations.yaxis.forEach(function(e,t){return i(e,t,"yaxis")}),t.config.annotations.points.forEach(function(e,t){return i(e,t,"point")})}},{key:"getY1Y2",value:function(e,t){var i,n=this.w,r="y1"===e?t.y:t.y2,s=!1;if(this.annoCtx.invertAxis){var o=n.config.xaxis.convertedCatToNumeric?n.globals.categoryLabels:n.globals.labels,a=o.indexOf(r),l=n.globals.dom.baseEl.querySelector(".apexcharts-yaxis-texts-g text:nth-child(".concat(a+1,")"));i=l?parseFloat(l.getAttribute("y")):(n.globals.gridHeight/o.length-1)*(a+1)-n.globals.barHeight,void 0!==t.seriesIndex&&n.globals.barHeight&&(i-=n.globals.barHeight/2*(n.globals.series.length-1)-n.globals.barHeight*t.seriesIndex)}else{var c,h=n.globals.seriesYAxisMap[t.yAxisIndex][0],d=n.config.yaxis[t.yAxisIndex].logarithmic?new Ci(this.annoCtx.ctx).getLogVal(n.config.yaxis[t.yAxisIndex].logBase,r,h)/n.globals.yLogRatio[h]:(r-n.globals.minYArr[h])/(n.globals.yRange[h]/n.globals.gridHeight);i=n.globals.gridHeight-Math.min(Math.max(d,0),n.globals.gridHeight),s=d>n.globals.gridHeight||d<0,!t.marker||void 0!==t.y&&null!==t.y||(i=0),null!==(c=n.config.yaxis[t.yAxisIndex])&&void 0!==c&&c.reversed&&(i=d)}return"string"==typeof r&&r.includes("px")&&(i=parseFloat(r)),{yP:i,clipped:s}}},{key:"getX1X2",value:function(e,t){var i=this.w,n="x1"===e?t.x:t.x2,r=this.annoCtx.invertAxis?i.globals.minY:i.globals.minX,s=this.annoCtx.invertAxis?i.globals.maxY:i.globals.maxX,o=this.annoCtx.invertAxis?i.globals.yRange[0]:i.globals.xRange,a=!1,l=this.annoCtx.inversedReversedAxis?(s-n)/(o/i.globals.gridWidth):(n-r)/(o/i.globals.gridWidth);return"category"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||i.globals.dataFormatXNumeric||i.config.chart.sparkline.enabled||(l=this.getStringX(n)),"string"==typeof n&&n.includes("px")&&(l=parseFloat(n)),null==n&&t.marker&&(l=i.globals.gridWidth),void 0!==t.seriesIndex&&i.globals.barWidth&&!this.annoCtx.invertAxis&&(l-=i.globals.barWidth/2*(i.globals.series.length-1)-i.globals.barWidth*t.seriesIndex),"number"!=typeof l&&(l=0,a=!0),parseFloat(l.toFixed(10))>parseFloat(i.globals.gridWidth.toFixed(10))?(l=i.globals.gridWidth,a=!0):l<0&&(l=0,a=!0),{x:l,clipped:a}}},{key:"getStringX",value:function(e){var t=this.w,i=e;t.config.xaxis.convertedCatToNumeric&&t.globals.categoryLabels.length&&(e=t.globals.categoryLabels.indexOf(e)+1);var n=t.globals.labels.map(function(e){return Array.isArray(e)?e.join(" "):e}).indexOf(e),r=t.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g text:nth-child(".concat(n+1,")"));return r&&(i=parseFloat(r.getAttribute("x"))),i}}]),e}(),Li=function(){function e(t){s(this,e),this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new Di(this.annoCtx)}return a(e,[{key:"addXaxisAnnotation",value:function(e,t,i){var n,r=this.w,s=this.helpers.getX1X2("x1",e),o=s.x,a=s.clipped,l=!0,c=e.label.text,h=e.strokeDashArray;if(w.isNumber(o)){if(null===e.x2||void 0===e.x2){if(!a){var d=this.annoCtx.graphics.drawLine(o+e.offsetX,0+e.offsetY,o+e.offsetX,r.globals.gridHeight+e.offsetY,e.borderColor,h,e.borderWidth);t.appendChild(d.node),e.id&&d.node.classList.add(e.id)}}else{var u=this.helpers.getX1X2("x2",e);if(n=u.x,l=u.clipped,n<o){var f=o;o=n,n=f}var p=this.annoCtx.graphics.drawRect(o+e.offsetX,0+e.offsetY,n-o,r.globals.gridHeight+e.offsetY,0,e.fillColor,e.opacity,1,e.borderColor,h);p.node.classList.add("apexcharts-annotation-rect"),p.attr("clip-path","url(#gridRectMask".concat(r.globals.cuid,")")),t.appendChild(p.node),e.id&&p.node.classList.add(e.id)}if(!a||!l){var m=this.annoCtx.graphics.getTextRects(c,parseFloat(e.label.style.fontSize)),g="top"===e.label.position?4:"center"===e.label.position?r.globals.gridHeight/2+("vertical"===e.label.orientation?m.width/2:0):r.globals.gridHeight,_=this.annoCtx.graphics.drawText({x:o+e.label.offsetX,y:g+e.label.offsetY-("vertical"===e.label.orientation?"top"===e.label.position?m.width/2-12:-m.width/2:0),text:c,textAnchor:e.label.textAnchor,fontSize:e.label.style.fontSize,fontFamily:e.label.style.fontFamily,fontWeight:e.label.style.fontWeight,foreColor:e.label.style.color,cssClass:"apexcharts-xaxis-annotation-label ".concat(e.label.style.cssClass," ").concat(e.id?e.id:"")});_.attr({rel:i}),t.appendChild(_.node),this.annoCtx.helpers.setOrientations(e,i)}}}},{key:"drawXAxisAnnotations",value:function(){var e=this,t=this.w,i=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map(function(t,n){e.addXaxisAnnotation(t,i.node,n)}),i}}]),e}(),Ei=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}return a(e,[{key:"isValidDate",value:function(e){return"number"!=typeof e&&!isNaN(this.parseDate(e))}},{key:"getTimeStamp",value:function(e){return Date.parse(e)?this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(e).toISOString().substr(0,25)).getTime():new Date(e).getTime():e}},{key:"getDate",value:function(e){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(e).toUTCString()):new Date(e)}},{key:"parseDate",value:function(e){var t=Date.parse(e);if(!isNaN(t))return this.getTimeStamp(e);var i=Date.parse(e.replace(/-/g,"/").replace(/[a-z]+/gi," "));return this.getTimeStamp(i)}},{key:"parseDateWithTimezone",value:function(e){return Date.parse(e.replace(/-/g,"/").replace(/[a-z]+/gi," "))}},{key:"formatDate",value:function(e,t){var i=this.w.globals.locale,n=this.w.config.xaxis.labels.datetimeUTC,r=["\0"].concat(y(i.months)),s=[""].concat(y(i.shortMonths)),o=[""].concat(y(i.days)),a=[""].concat(y(i.shortDays));function l(e,t){var i=e+"";for(t=t||2;i.length<t;)i="0"+i;return i}var c=n?e.getUTCFullYear():e.getFullYear();t=(t=(t=t.replace(/(^|[^\\])yyyy+/g,"$1"+c)).replace(/(^|[^\\])yy/g,"$1"+c.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+c);var h=(n?e.getUTCMonth():e.getMonth())+1;t=(t=(t=(t=t.replace(/(^|[^\\])MMMM+/g,"$1"+r[0])).replace(/(^|[^\\])MMM/g,"$1"+s[0])).replace(/(^|[^\\])MM/g,"$1"+l(h))).replace(/(^|[^\\])M/g,"$1"+h);var d=n?e.getUTCDate():e.getDate();t=(t=(t=(t=t.replace(/(^|[^\\])dddd+/g,"$1"+o[0])).replace(/(^|[^\\])ddd/g,"$1"+a[0])).replace(/(^|[^\\])dd/g,"$1"+l(d))).replace(/(^|[^\\])d/g,"$1"+d);var u=n?e.getUTCHours():e.getHours(),f=u>12?u-12:0===u?12:u;t=(t=(t=(t=t.replace(/(^|[^\\])HH+/g,"$1"+l(u))).replace(/(^|[^\\])H/g,"$1"+u)).replace(/(^|[^\\])hh+/g,"$1"+l(f))).replace(/(^|[^\\])h/g,"$1"+f);var p=n?e.getUTCMinutes():e.getMinutes();t=(t=t.replace(/(^|[^\\])mm+/g,"$1"+l(p))).replace(/(^|[^\\])m/g,"$1"+p);var m=n?e.getUTCSeconds():e.getSeconds();t=(t=t.replace(/(^|[^\\])ss+/g,"$1"+l(m))).replace(/(^|[^\\])s/g,"$1"+m);var g=n?e.getUTCMilliseconds():e.getMilliseconds();t=t.replace(/(^|[^\\])fff+/g,"$1"+l(g,3)),g=Math.round(g/10),t=t.replace(/(^|[^\\])ff/g,"$1"+l(g)),g=Math.round(g/10);var _=u<12?"AM":"PM";t=(t=(t=t.replace(/(^|[^\\])f/g,"$1"+g)).replace(/(^|[^\\])TT+/g,"$1"+_)).replace(/(^|[^\\])T/g,"$1"+_.charAt(0));var v=_.toLowerCase();t=(t=t.replace(/(^|[^\\])tt+/g,"$1"+v)).replace(/(^|[^\\])t/g,"$1"+v.charAt(0));var x=-e.getTimezoneOffset(),b=n||!x?"Z":x>0?"+":"-";if(!n){var w=(x=Math.abs(x))%60;b+=l(Math.floor(x/60))+":"+l(w)}t=t.replace(/(^|[^\\])K/g,"$1"+b);var S=(n?e.getUTCDay():e.getDay())+1;return(t=(t=(t=(t=t.replace(new RegExp(o[0],"g"),o[S])).replace(new RegExp(a[0],"g"),a[S])).replace(new RegExp(r[0],"g"),r[h])).replace(new RegExp(s[0],"g"),s[h])).replace(/\\(.)/g,"$1")}},{key:"getTimeUnitsfromTimestamp",value:function(e,t,i){var n=this.w;void 0!==n.config.xaxis.min&&(e=n.config.xaxis.min),void 0!==n.config.xaxis.max&&(t=n.config.xaxis.max);var r=this.getDate(e),s=this.getDate(t),o=this.formatDate(r,"yyyy MM dd HH mm ss fff").split(" "),a=this.formatDate(s,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(o[6],10),maxMillisecond:parseInt(a[6],10),minSecond:parseInt(o[5],10),maxSecond:parseInt(a[5],10),minMinute:parseInt(o[4],10),maxMinute:parseInt(a[4],10),minHour:parseInt(o[3],10),maxHour:parseInt(a[3],10),minDate:parseInt(o[2],10),maxDate:parseInt(a[2],10),minMonth:parseInt(o[1],10)-1,maxMonth:parseInt(a[1],10)-1,minYear:parseInt(o[0],10),maxYear:parseInt(a[0],10)}}},{key:"isLeapYear",value:function(e){return e%4==0&&e%100!=0||e%400==0}},{key:"calculcateLastDaysOfMonth",value:function(e,t,i){return this.determineDaysOfMonths(e,t)-i}},{key:"determineDaysOfYear",value:function(e){var t=365;return this.isLeapYear(e)&&(t=366),t}},{key:"determineRemainingDaysOfYear",value:function(e,t,i){var n=this.daysCntOfYear[t]+i;return t>1&&this.isLeapYear()&&n++,n}},{key:"determineDaysOfMonths",value:function(e,t){var i=30;switch(e=w.monthMod(e),!0){case this.months30.indexOf(e)>-1:2===e&&(i=this.isLeapYear(t)?29:28);break;case this.months31.indexOf(e)>-1:default:i=31}return i}}]),e}(),Ii=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.tooltipKeyFormat="dd MMM"}return a(e,[{key:"xLabelFormat",value:function(e,t,i,n){var r=this.w;if("datetime"===r.config.xaxis.type&&void 0===r.config.xaxis.labels.formatter&&void 0===r.config.tooltip.x.formatter){var s=new Ei(this.ctx);return s.formatDate(s.getDate(t),r.config.tooltip.x.format)}return e(t,i,n)}},{key:"defaultGeneralFormatter",value:function(e){return Array.isArray(e)?e.map(function(e){return e}):e}},{key:"defaultYFormatter",value:function(e,t,i){var n=this.w;if(w.isNumber(e))if(0!==n.globals.yValueDecimal)e=e.toFixed(void 0!==t.decimalsInFloat?t.decimalsInFloat:n.globals.yValueDecimal);else{var r=e.toFixed(0);e=e==r?r:e.toFixed(1)}return e}},{key:"setLabelFormatters",value:function(){var e=this,t=this.w;return t.globals.xaxisTooltipFormatter=function(t){return e.defaultGeneralFormatter(t)},t.globals.ttKeyFormatter=function(t){return e.defaultGeneralFormatter(t)},t.globals.ttZFormatter=function(e){return e},t.globals.legendFormatter=function(t){return e.defaultGeneralFormatter(t)},void 0!==t.config.xaxis.labels.formatter?t.globals.xLabelFormatter=t.config.xaxis.labels.formatter:t.globals.xLabelFormatter=function(e){if(w.isNumber(e)){if(!t.config.xaxis.convertedCatToNumeric&&"numeric"===t.config.xaxis.type){if(w.isNumber(t.config.xaxis.decimalsInFloat))return e.toFixed(t.config.xaxis.decimalsInFloat);var i=t.globals.maxX-t.globals.minX;return i>0&&i<100?e.toFixed(1):e.toFixed(0)}return t.globals.isBarHorizontal&&t.globals.maxY-t.globals.minYArr<4?e.toFixed(1):e.toFixed(0)}return e},"function"==typeof t.config.tooltip.x.formatter?t.globals.ttKeyFormatter=t.config.tooltip.x.formatter:t.globals.ttKeyFormatter=t.globals.xLabelFormatter,"function"==typeof t.config.xaxis.tooltip.formatter&&(t.globals.xaxisTooltipFormatter=t.config.xaxis.tooltip.formatter),(Array.isArray(t.config.tooltip.y)||void 0!==t.config.tooltip.y.formatter)&&(t.globals.ttVal=t.config.tooltip.y),void 0!==t.config.tooltip.z.formatter&&(t.globals.ttZFormatter=t.config.tooltip.z.formatter),void 0!==t.config.legend.formatter&&(t.globals.legendFormatter=t.config.legend.formatter),t.config.yaxis.forEach(function(i,n){void 0!==i.labels.formatter?t.globals.yLabelFormatters[n]=i.labels.formatter:t.globals.yLabelFormatters[n]=function(r){return t.globals.xyCharts?Array.isArray(r)?r.map(function(t){return e.defaultYFormatter(t,i,n)}):e.defaultYFormatter(r,i,n):r}}),t.globals}},{key:"heatmapLabelFormatters",value:function(){var e=this.w;if("heatmap"===e.config.chart.type){e.globals.yAxisScale[0].result=e.globals.seriesNames.slice();var t=e.globals.seriesNames.reduce(function(e,t){return e.length>t.length?e:t},0);e.globals.yAxisScale[0].niceMax=t,e.globals.yAxisScale[0].niceMin=t}}}]),e}(),Pi=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"getLabel",value:function(e,t,i,n){var r,s,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"12px",l=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],c=this.w,h=void 0===e[n]?"":e[n],d=h,u=c.globals.xLabelFormatter,f=c.config.xaxis.labels.formatter,p=!1,m=new Ii(this.ctx),g=h;l&&(d=m.xLabelFormat(u,h,g,{i:n,dateFormatter:new Ei(this.ctx).formatDate,w:c}),void 0!==f&&(d=f(h,e[n],{i:n,dateFormatter:new Ei(this.ctx).formatDate,w:c}))),t.length>0?(r=t[n].unit,s=null,t.forEach(function(e){"month"===e.unit?s="year":"day"===e.unit?s="month":"hour"===e.unit?s="day":"minute"===e.unit&&(s="hour")}),p=s===r,i=t[n].position,d=t[n].value):"datetime"===c.config.xaxis.type&&void 0===f&&(d=""),void 0===d&&(d=""),d=Array.isArray(d)?d:d.toString();var _,y=new Ai(this.ctx);_=c.globals.rotateXLabels&&l?y.getTextRects(d,parseInt(a,10),null,"rotate(".concat(c.config.xaxis.labels.rotate," 0 0)"),!1):y.getTextRects(d,parseInt(a,10));var v=!c.config.xaxis.labels.showDuplicates&&this.ctx.timeScale;return!Array.isArray(d)&&("NaN"===String(d)||o.indexOf(d)>=0&&v)&&(d=""),{x:i,text:d,textRect:_,isBold:p}}},{key:"checkLabelBasedOnTickamount",value:function(e,t,i){var n=this.w,r=n.config.xaxis.tickAmount;return"dataPoints"===r&&(r=Math.round(n.globals.gridWidth/120)),r>i||e%Math.round(i/(r+1))==0||(t.text=""),t}},{key:"checkForOverflowingLabels",value:function(e,t,i,n,r){var s=this.w;if(0===e&&s.globals.skipFirstTimelinelabel&&(t.text=""),e===i-1&&s.globals.skipLastTimelinelabel&&(t.text=""),s.config.xaxis.labels.hideOverlappingLabels&&n.length>0){var o=r[r.length-1];if(s.config.xaxis.labels.trim&&"datetime"!==s.config.xaxis.type)return t;t.x<o.textRect.width/(s.globals.rotateXLabels?Math.abs(s.config.xaxis.labels.rotate)/12:1.01)+o.x&&(t.text="")}return t}},{key:"checkForReversedLabels",value:function(e,t){var i=this.w;return i.config.yaxis[e]&&i.config.yaxis[e].reversed&&t.reverse(),t}},{key:"yAxisAllSeriesCollapsed",value:function(e){var t=this.w.globals;return!t.seriesYAxisMap[e].some(function(e){return-1===t.collapsedSeriesIndices.indexOf(e)})}},{key:"translateYAxisIndex",value:function(e){var t=this.w,i=t.globals,n=t.config.yaxis;return i.series.length>n.length||n.some(function(e){return Array.isArray(e.seriesName)})?e:i.seriesYAxisReverseMap[e]}},{key:"isYAxisHidden",value:function(e){var t=this.w,i=t.config.yaxis[e];if(!i.show||this.yAxisAllSeriesCollapsed(e))return!0;if(!i.showForNullSeries){var n=t.globals.seriesYAxisMap[e],r=new Ci(this.ctx);return n.every(function(e){return r.isSeriesNull(e)})}return!1}},{key:"getYAxisForeColor",value:function(e,t){var i=this.w;return Array.isArray(e)&&i.globals.yAxisScale[t]&&this.ctx.theme.pushExtraColors(e,i.globals.yAxisScale[t].result.length,!1),e}},{key:"drawYAxisTicks",value:function(e,t,i,n,r,s,o){var a=this.w,l=new Ai(this.ctx),c=a.globals.translateY+a.config.yaxis[r].labels.offsetY;if(a.globals.isBarHorizontal?c=0:"heatmap"===a.config.chart.type&&(c+=s/2),n.show&&t>0){!0===a.config.yaxis[r].opposite&&(e+=n.width);for(var h=t;h>=0;h--){var d=l.drawLine(e+i.offsetX-n.width+n.offsetX,c+n.offsetY,e+i.offsetX+n.offsetX,c+n.offsetY,n.color);o.add(d),c+=s}}}}]),e}(),Ri=function(){function e(t){s(this,e),this.w=t.w,this.annoCtx=t,this.helpers=new Di(this.annoCtx),this.axesUtils=new Pi(this.annoCtx)}return a(e,[{key:"addYaxisAnnotation",value:function(e,t,i){var n,r=this.w,s=e.strokeDashArray,o=this.helpers.getY1Y2("y1",e),a=o.yP,l=o.clipped,c=!0,h=!1,d=e.label.text;if(null===e.y2||void 0===e.y2){if(!l){h=!0;var u=this.annoCtx.graphics.drawLine(0+e.offsetX,a+e.offsetY,this._getYAxisAnnotationWidth(e),a+e.offsetY,e.borderColor,s,e.borderWidth);t.appendChild(u.node),e.id&&u.node.classList.add(e.id)}}else{if(n=(o=this.helpers.getY1Y2("y2",e)).yP,c=o.clipped,n>a){var f=a;a=n,n=f}if(!l||!c){h=!0;var p=this.annoCtx.graphics.drawRect(0+e.offsetX,n+e.offsetY,this._getYAxisAnnotationWidth(e),a-n,0,e.fillColor,e.opacity,1,e.borderColor,s);p.node.classList.add("apexcharts-annotation-rect"),p.attr("clip-path","url(#gridRectMask".concat(r.globals.cuid,")")),t.appendChild(p.node),e.id&&p.node.classList.add(e.id)}}if(h){var m="right"===e.label.position?r.globals.gridWidth:"center"===e.label.position?r.globals.gridWidth/2:0,g=this.annoCtx.graphics.drawText({x:m+e.label.offsetX,y:(null!=n?n:a)+e.label.offsetY-3,text:d,textAnchor:e.label.textAnchor,fontSize:e.label.style.fontSize,fontFamily:e.label.style.fontFamily,fontWeight:e.label.style.fontWeight,foreColor:e.label.style.color,cssClass:"apexcharts-yaxis-annotation-label ".concat(e.label.style.cssClass," ").concat(e.id?e.id:"")});g.attr({rel:i}),t.appendChild(g.node)}}},{key:"_getYAxisAnnotationWidth",value:function(e){var t=this.w;return t.globals.gridWidth,(e.width.indexOf("%")>-1?t.globals.gridWidth*parseInt(e.width,10)/100:parseInt(e.width,10))+e.offsetX}},{key:"drawYAxisAnnotations",value:function(){var e=this,t=this.w,i=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach(function(t,n){t.yAxisIndex=e.axesUtils.translateYAxisIndex(t.yAxisIndex),e.axesUtils.isYAxisHidden(t.yAxisIndex)&&e.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||e.addYaxisAnnotation(t,i.node,n)}),i}}]),e}(),Oi=function(){function e(t){s(this,e),this.w=t.w,this.annoCtx=t,this.helpers=new Di(this.annoCtx)}return a(e,[{key:"addPointAnnotation",value:function(e,t,i){if(!(this.w.globals.collapsedSeriesIndices.indexOf(e.seriesIndex)>-1)){var n=this.helpers.getX1X2("x1",e),r=n.x,s=n.clipped,o=(n=this.helpers.getY1Y2("y1",e)).yP,a=n.clipped;if(w.isNumber(r)&&!a&&!s){var l={pSize:e.marker.size,pointStrokeWidth:e.marker.strokeWidth,pointFillColor:e.marker.fillColor,pointStrokeColor:e.marker.strokeColor,shape:e.marker.shape,pRadius:e.marker.radius,class:"apexcharts-point-annotation-marker ".concat(e.marker.cssClass," ").concat(e.id?e.id:"")},c=this.annoCtx.graphics.drawMarker(r+e.marker.offsetX,o+e.marker.offsetY,l);t.appendChild(c.node);var h=e.label.text?e.label.text:"",d=this.annoCtx.graphics.drawText({x:r+e.label.offsetX,y:o+e.label.offsetY-e.marker.size-parseFloat(e.label.style.fontSize)/1.6,text:h,textAnchor:e.label.textAnchor,fontSize:e.label.style.fontSize,fontFamily:e.label.style.fontFamily,fontWeight:e.label.style.fontWeight,foreColor:e.label.style.color,cssClass:"apexcharts-point-annotation-label ".concat(e.label.style.cssClass," ").concat(e.id?e.id:"")});if(d.attr({rel:i}),t.appendChild(d.node),e.customSVG.SVG){var u=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+e.customSVG.cssClass});u.attr({transform:"translate(".concat(r+e.customSVG.offsetX,", ").concat(o+e.customSVG.offsetY,")")}),u.node.innerHTML=e.customSVG.SVG,t.appendChild(u.node)}if(e.image.path){var f=e.image.width?e.image.width:20,p=e.image.height?e.image.height:20;c=this.annoCtx.addImage({x:r+e.image.offsetX-f/2,y:o+e.image.offsetY-p/2,width:f,height:p,path:e.image.path,appendTo:".apexcharts-point-annotations"})}e.mouseEnter&&c.node.addEventListener("mouseenter",e.mouseEnter.bind(this,e)),e.mouseLeave&&c.node.addEventListener("mouseleave",e.mouseLeave.bind(this,e)),e.click&&c.node.addEventListener("click",e.click.bind(this,e))}}}},{key:"drawPointAnnotations",value:function(){var e=this,t=this.w,i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map(function(t,n){e.addPointAnnotation(t,i.node,n)}),i}}]),e}(),zi={name:"en",options:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom"}}},Fi=function(){function e(){s(this,e),this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,stepSize:void 0,forceNiceScale:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,showDuplicates:!1,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:void 0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:"100%",yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}return a(e,[{key:"init",value:function(){return{annotations:{yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"",locales:[zi],defaultLocale:"en",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.7},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,xAxisLabelClick:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,nonce:void 0,offsetX:0,offsetY:0,injectStyleSheet:!0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0,targets:void 0},stacked:!1,stackOnlyBar:!0,stackType:"normal",toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",categoryFormatter:void 0,valueFormatter:void 0},png:{filename:void 0},svg:{filename:void 0},scale:void 0,width:void 0},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,allowMouseWheelZoom:!0,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}}},parsing:{x:void 0,y:void 0},plotOptions:{line:{isSlopeChart:!1,colors:{threshold:0,colorAboveThreshold:void 0,colorBelowThreshold:void 0}},area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",borderRadiusWhenStacked:"last",rangeBarOverlap:!0,rangeBarGroupRows:!1,hideZeroBarsWhenGrouped:!1,isDumbbell:!1,dumbbellColors:void 0,isFunnel:!1,isFunnel3d:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal",total:{enabled:!1,formatter:void 0,offsetX:0,offsetY:0,style:{color:"#373d3f",fontSize:"12px",fontFamily:void 0,fontWeight:600}}}},bubble:{zScaling:!0,minBubbleRadius:void 0,maxBubbleRadius:void 0},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,borderRadius:4,dataLabels:{format:"scale"},colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0},seriesTitle:{show:!0,offsetY:1,offsetX:1,borderColor:"#000",borderWidth:1,borderRadius:2,style:{background:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"12px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:6,right:6,top:2,bottom:2}}}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:function(e){return e}},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:function(e){return e+"%"}},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:function(e){return e.globals.seriesTotals.reduce(function(e,t){return e+t},0)/e.globals.series.length+"%"}}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter:function(e){return e},onClick:void 0}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:function(e){return e}},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:function(e){return e}},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:function(e){return e.globals.seriesTotals.reduce(function(e,t){return e+t},0)}}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"},spokes:{strokeWidth:1,connectorColors:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:function(e){return null!==e?e:""},textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",backgroundColor:void 0,borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],clusterGroupedSeries:!0,clusterGroupedSeriesOrientation:"vertical",labels:{colors:void 0,useSeriesColors:!1},markers:{size:7,fillColors:void 0,strokeWidth:1,shape:void 0,offsetX:0,offsetY:0,customHTML:void 0,onClick:void 0},itemMargin:{horizontal:5,vertical:4},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",offsetX:0,offsetY:0,showNullDataPoints:!0,onClick:void 0,onDblClick:void 0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{hover:{filter:{type:"lighten"}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken"}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0,fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,hideEmptySeries:!1,followCursor:!1,intersect:!1,inverseOrder:!1,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:function(e){return e?e+": ":""}}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm",minute:"HH:mm:ss",second:"HH:mm:ss"}},group:{groups:[],style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},stepSize:void 0,tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.8}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65}}}}}]),e}(),Ni=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.graphics=new Ai(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new Di(this),this.xAxisAnnotations=new Li(this),this.yAxisAnnotations=new Ri(this),this.pointsAnnotations=new Oi(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.globals.gridWidth/this.w.globals.dataPoints}return a(e,[{key:"drawAxesAnnotations",value:function(){var e=this.w;if(e.globals.axisCharts&&e.globals.dataPoints){for(var t=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),n=this.pointsAnnotations.drawPointAnnotations(),r=e.config.chart.animations.enabled,s=[t,i,n],o=[i.node,t.node,n.node],a=0;a<3;a++)e.globals.dom.elGraphical.add(s[a]),!r||e.globals.resized||e.globals.dataChanged||"scatter"!==e.config.chart.type&&"bubble"!==e.config.chart.type&&e.globals.dataPoints>1&&o[a].classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:o[a],index:0});this.helpers.annotationsBackground()}}},{key:"drawImageAnnos",value:function(){var e=this;this.w.config.annotations.images.map(function(t,i){e.addImage(t,i)})}},{key:"drawTextAnnos",value:function(){var e=this;this.w.config.annotations.texts.map(function(t,i){e.addText(t,i)})}},{key:"addXaxisAnnotation",value:function(e,t,i){this.xAxisAnnotations.addXaxisAnnotation(e,t,i)}},{key:"addYaxisAnnotation",value:function(e,t,i){this.yAxisAnnotations.addYaxisAnnotation(e,t,i)}},{key:"addPointAnnotation",value:function(e,t,i){this.pointsAnnotations.addPointAnnotation(e,t,i)}},{key:"addText",value:function(e,t){var i=e.x,n=e.y,r=e.text,s=e.textAnchor,o=e.foreColor,a=e.fontSize,l=e.fontFamily,c=e.fontWeight,h=e.cssClass,d=e.backgroundColor,u=e.borderWidth,f=e.strokeDashArray,p=e.borderRadius,m=e.borderColor,g=e.appendTo,_=void 0===g?".apexcharts-svg":g,y=e.paddingLeft,v=void 0===y?4:y,x=e.paddingRight,b=void 0===x?4:x,w=e.paddingBottom,S=void 0===w?2:w,T=e.paddingTop,k=void 0===T?2:T,M=this.w,A=this.graphics.drawText({x:i,y:n,text:r,textAnchor:s||"start",fontSize:a||"12px",fontWeight:c||"regular",fontFamily:l||M.config.chart.fontFamily,foreColor:o||M.config.chart.foreColor,cssClass:h}),C=M.globals.dom.baseEl.querySelector(_);C&&C.appendChild(A.node);var D=A.bbox();if(r){var L=this.graphics.drawRect(D.x-v,D.y-k,D.width+v+b,D.height+S+k,p,d||"transparent",1,u,m,f);C.insertBefore(L.node,A.node)}}},{key:"addImage",value:function(e,t){var i=this.w,n=e.path,r=e.x,s=void 0===r?0:r,o=e.y,a=void 0===o?0:o,l=e.width,c=void 0===l?20:l,h=e.height,d=void 0===h?20:h,u=e.appendTo,f=void 0===u?".apexcharts-svg":u,p=i.globals.dom.Paper.image(n);p.size(c,d).move(s,a);var m=i.globals.dom.baseEl.querySelector(f);return m&&m.appendChild(p.node),p}},{key:"addXaxisAnnotationExternal",value:function(e,t,i){return this.addAnnotationExternal({params:e,pushToMemory:t,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}},{key:"addYaxisAnnotationExternal",value:function(e,t,i){return this.addAnnotationExternal({params:e,pushToMemory:t,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}},{key:"addPointAnnotationExternal",value:function(e,t,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:e,pushToMemory:t,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}},{key:"addAnnotationExternal",value:function(e){var t=e.params,i=e.pushToMemory,n=e.context,r=e.type,s=e.contextMethod,o=n,a=o.w,l=a.globals.dom.baseEl.querySelector(".apexcharts-".concat(r,"-annotations")),c=l.childNodes.length+1,h=new Fi,d=Object.assign({},"xaxis"===r?h.xAxisAnnotation:"yaxis"===r?h.yAxisAnnotation:h.pointAnnotation),u=w.extend(d,t);switch(r){case"xaxis":this.addXaxisAnnotation(u,l,c);break;case"yaxis":this.addYaxisAnnotation(u,l,c);break;case"point":this.addPointAnnotation(u,l,c)}var f=a.globals.dom.baseEl.querySelector(".apexcharts-".concat(r,"-annotations .apexcharts-").concat(r,"-annotation-label[rel='").concat(c,"']")),p=this.helpers.addBackgroundToAnno(f,u);return p&&l.insertBefore(p.node,f),i&&a.globals.memory.methodsToExec.push({context:o,id:u.id?u.id:w.randomId(),method:s,label:"addAnnotation",params:t}),n}},{key:"clearAnnotations",value:function(e){for(var t=e.w,i=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations"),n=t.globals.memory.methodsToExec.length-1;n>=0;n--)"addText"!==t.globals.memory.methodsToExec[n].label&&"addAnnotation"!==t.globals.memory.methodsToExec[n].label||t.globals.memory.methodsToExec.splice(n,1);i=w.listToArray(i),Array.prototype.forEach.call(i,function(e){for(;e.firstChild;)e.removeChild(e.firstChild)})}},{key:"removeAnnotation",value:function(e,t){var i=e.w,n=i.globals.dom.baseEl.querySelectorAll(".".concat(t));n&&(i.globals.memory.methodsToExec.map(function(e,n){e.id===t&&i.globals.memory.methodsToExec.splice(n,1)}),Object.keys(i.config.annotations).forEach(function(e){var n=i.config.annotations[e];Array.isArray(n)&&(i.config.annotations[e]=n.filter(function(e){return e.id!==t}))}),Array.prototype.forEach.call(n,function(e){e.parentElement.removeChild(e)}))}}]),e}(),Yi=function(e){var t,i=e.isTimeline,n=e.ctx,r=e.seriesIndex,s=e.dataPointIndex,o=e.y1,a=e.y2,l=e.w,c=l.globals.seriesRangeStart[r][s],h=l.globals.seriesRangeEnd[r][s],d=l.globals.labels[s],u=l.config.series[r].name?l.config.series[r].name:"",f=l.globals.ttKeyFormatter,p=l.config.tooltip.y.title.formatter,m={w:l,seriesIndex:r,dataPointIndex:s,start:c,end:h};"function"==typeof p&&(u=p(u,m)),null!==(t=l.config.series[r].data[s])&&void 0!==t&&t.x&&(d=l.config.series[r].data[s].x),i||"datetime"===l.config.xaxis.type&&(d=new Ii(n).xLabelFormat(l.globals.ttKeyFormatter,d,d,{i:void 0,dateFormatter:new Ei(n).formatDate,w:l})),"function"==typeof f&&(d=f(d,m)),Number.isFinite(o)&&Number.isFinite(a)&&(c=o,h=a);var g="",_="",y=l.globals.colors[r];if(void 0===l.config.tooltip.x.formatter)if("datetime"===l.config.xaxis.type){var v=new Ei(n);g=v.formatDate(v.getDate(c),l.config.tooltip.x.format),_=v.formatDate(v.getDate(h),l.config.tooltip.x.format)}else g=c,_=h;else g=l.config.tooltip.x.formatter(c),_=l.config.tooltip.x.formatter(h);return{start:c,end:h,startVal:g,endVal:_,ylabel:d,color:y,seriesName:u}},Bi=function(e){var t=e.color,i=e.seriesName,n=e.ylabel,r=e.start,s=e.end,o=e.seriesIndex,a=e.dataPointIndex,l=e.ctx.tooltip.tooltipLabels.getFormatters(o);r=l.yLbFormatter(r),s=l.yLbFormatter(s);var c=l.yLbFormatter(e.w.globals.series[o][a]),h='<span class="value start-value">\n '.concat(r,'\n </span> <span class="separator">-</span> <span class="value end-value">\n ').concat(s,"\n </span>");return'<div class="apexcharts-tooltip-rangebar"><div> <span class="series-name" style="color: '+t+'">'+(i||"")+'</span></div><div> <span class="category">'+n+": </span> "+(e.w.globals.comboCharts?"rangeArea"===e.w.config.series[o].type||"rangeBar"===e.w.config.series[o].type?h:"<span>".concat(c,"</span>"):h)+" </div></div>"},Hi=function(){function e(t){s(this,e),this.opts=t}return a(e,[{key:"hideYAxis",value:function(){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0}},{key:"line",value:function(){return{dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}},{key:"sparkline",value:function(e){return this.hideYAxis(),w.extend(e,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}},{key:"slope",value:function(){return this.hideYAxis(),{chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!0,formatter:function(e,t){var i=t.w.config.series[t.seriesIndex].name;return null!==e?i+": "+e:""},background:{enabled:!1},offsetX:-5},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{position:"top",labels:{style:{fontSize:14,fontWeight:900}},tooltip:{enabled:!1},crosshairs:{show:!1}},markers:{size:8,hover:{sizeOffset:1}},legend:{show:!1},tooltip:{shared:!1,intersect:!0,followCursor:!0},stroke:{width:5,curve:"straight"}}}},{key:"bar",value:function(){return{chart:{stacked:!1},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"square"},fill:{opacity:.85},legend:{markers:{shape:"square"}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}},{key:"funnel",value:function(){return this.hideYAxis(),m(m({},this.bar()),{},{chart:{animations:{speed:800,animateGradually:{enabled:!1}}},plotOptions:{bar:{horizontal:!0,borderRadiusApplication:"around",borderRadius:0,dataLabels:{position:"center"}}},grid:{show:!1,padding:{left:0,right:0}},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}}})}},{key:"candlestick",value:function(){var e=this;return{stroke:{width:1},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(t){var i=t.seriesIndex,n=t.dataPointIndex,r=t.w;return e._getBoxTooltip(r,i,n,["Open","High","","Low","Close"],"candlestick")}},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}},{key:"boxPlot",value:function(){var e=this;return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(t){var i=t.seriesIndex,n=t.dataPointIndex,r=t.w;return e._getBoxTooltip(r,i,n,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot")}},markers:{size:7,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}},{key:"rangeBar",value:function(){return{chart:{animations:{animateGradually:!1}},stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter:function(e,t){t.ctx;var i=t.seriesIndex,n=t.dataPointIndex,r=t.w,s=function(){var e=r.globals.seriesRangeStart[i][n];return r.globals.seriesRangeEnd[i][n]-e};return r.globals.comboCharts?"rangeBar"===r.config.series[i].type||"rangeArea"===r.config.series[i].type?s():e:s()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom:function(e){return e.w.config.plotOptions&&e.w.config.plotOptions.bar&&e.w.config.plotOptions.bar.horizontal?function(e){var t=Yi(m(m({},e),{},{isTimeline:!0})),i=t.color,n=t.seriesName,r=t.ylabel,s=t.startVal,o=t.endVal;return Bi(m(m({},e),{},{color:i,seriesName:n,ylabel:r,start:s,end:o}))}(e):function(e){var t=Yi(e),i=t.color,n=t.seriesName,r=t.ylabel,s=t.start,o=t.end;return Bi(m(m({},e),{},{color:i,seriesName:n,ylabel:r,start:s,end:o}))}(e)}},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:"dumbbell",value:function(e){var t,i;return null!==(t=e.plotOptions.bar)&&void 0!==t&&t.barHeight||(e.plotOptions.bar.barHeight=2),null!==(i=e.plotOptions.bar)&&void 0!==i&&i.columnWidth||(e.plotOptions.bar.columnWidth=2),e}},{key:"area",value:function(){return{stroke:{width:4,fill:{type:"solid",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}},{key:"rangeArea",value:function(){return{stroke:{curve:"straight",width:0},fill:{type:"solid",opacity:.6},markers:{size:0},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},tooltip:{intersect:!1,shared:!0,followCursor:!0,custom:function(e){return function(e){var t=Yi(e),i=t.color,n=t.seriesName,r=t.ylabel,s=t.start,o=t.end;return Bi(m(m({},e),{},{color:i,seriesName:n,ylabel:r,start:s,end:o}))}(e)}}}}},{key:"brush",value:function(e){return w.extend(e,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}},{key:"stacked100",value:function(e){e.dataLabels=e.dataLabels||{},e.dataLabels.formatter=e.dataLabels.formatter||void 0;var t=e.dataLabels.formatter;return e.yaxis.forEach(function(t,i){e.yaxis[i].min=0,e.yaxis[i].max=100}),"bar"===e.chart.type&&(e.dataLabels.formatter=t||function(e){return"number"==typeof e&&e?e.toFixed(0)+"%":e}),e}},{key:"stackedBars",value:function(){var e=this.bar();return m(m({},e),{},{plotOptions:m(m({},e.plotOptions),{},{bar:m(m({},e.plotOptions.bar),{},{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}},{key:"convertCatToNumeric",value:function(e){return e.xaxis.convertedCatToNumeric=!0,e}},{key:"convertCatToNumericXaxis",value:function(e,t,i){e.xaxis.type="numeric",e.xaxis.labels=e.xaxis.labels||{},e.xaxis.labels.formatter=e.xaxis.labels.formatter||function(e){return w.isNumber(e)?Math.floor(e):e};var n=e.xaxis.labels.formatter,r=e.xaxis.categories&&e.xaxis.categories.length?e.xaxis.categories:e.labels;return i&&i.length&&(r=i.map(function(e){return Array.isArray(e)?e:String(e)})),r&&r.length&&(e.xaxis.labels.formatter=function(e){return w.isNumber(e)?n(r[Math.floor(e)-1]):n(e)}),e.xaxis.categories=[],e.labels=[],e.xaxis.tickAmount=e.xaxis.tickAmount||"dataPoints",e}},{key:"bubble",value:function(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}},{key:"scatter",value:function(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}},{key:"heatmap",value:function(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square"}},grid:{padding:{right:20}}}}},{key:"treemap",value:function(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{opacity:1,gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}},{key:"pie",value:function(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:function(e){return e.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"donut",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(e){return e.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"polarArea",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(e){return e.toFixed(1)+"%"},enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"radar",value:function(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:5,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},xaxis:{labels:{formatter:function(e){return e},style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}},{key:"radialBar",value:function(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"_getBoxTooltip",value:function(e,t,i,n,r){var s=e.globals.seriesCandleO[t][i],o=e.globals.seriesCandleH[t][i],a=e.globals.seriesCandleM[t][i],l=e.globals.seriesCandleL[t][i],c=e.globals.seriesCandleC[t][i];return e.config.series[t].type&&e.config.series[t].type!==r?'<div class="apexcharts-custom-tooltip">\n '.concat(e.config.series[t].name?e.config.series[t].name:"series-"+(t+1),": <strong>").concat(e.globals.series[t][i],"</strong>\n </div>"):'<div class="apexcharts-tooltip-box apexcharts-tooltip-'.concat(e.config.chart.type,'">')+"<div>".concat(n[0],': <span class="value">')+s+"</span></div>"+"<div>".concat(n[1],': <span class="value">')+o+"</span></div>"+(a?"<div>".concat(n[2],': <span class="value">')+a+"</span></div>":"")+"<div>".concat(n[3],': <span class="value">')+l+"</span></div>"+"<div>".concat(n[4],': <span class="value">')+c+"</span></div></div>"}}]),e}(),ji=function(){function e(t){s(this,e),this.opts=t}return a(e,[{key:"init",value:function(e){var t=e.responsiveOverride,i=this.opts,n=new Fi,r=new Hi(i);this.chartType=i.chart.type,i=this.extendYAxis(i),i=this.extendAnnotations(i);var s=n.init(),o={};if(i&&"object"===x(i)){var a,l,c,h,d,u,f,p,m,g,_={};_=-1!==["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"].indexOf(i.chart.type)?r[i.chart.type]():r.line(),null!==(a=i.plotOptions)&&void 0!==a&&null!==(l=a.bar)&&void 0!==l&&l.isFunnel&&(_=r.funnel()),i.chart.stacked&&"bar"===i.chart.type&&(_=r.stackedBars()),null!==(c=i.chart.brush)&&void 0!==c&&c.enabled&&(_=r.brush(_)),null!==(h=i.plotOptions)&&void 0!==h&&null!==(d=h.line)&&void 0!==d&&d.isSlopeChart&&(_=r.slope()),i.chart.stacked&&"100%"===i.chart.stackType&&(i=r.stacked100(i)),null!==(u=i.plotOptions)&&void 0!==u&&null!==(f=u.bar)&&void 0!==f&&f.isDumbbell&&(i=r.dumbbell(i)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(i),i.xaxis=i.xaxis||window.Apex.xaxis||{},t||(i.xaxis.convertedCatToNumeric=!1),(null!==(p=(i=this.checkForCatToNumericXAxis(this.chartType,_,i)).chart.sparkline)&&void 0!==p&&p.enabled||null!==(m=window.Apex.chart)&&void 0!==m&&null!==(g=m.sparkline)&&void 0!==g&&g.enabled)&&(_=r.sparkline(_)),o=w.extend(s,_)}var y=w.extend(o,window.Apex);return s=w.extend(y,i),this.handleUserInputErrors(s)}},{key:"checkForCatToNumericXAxis",value:function(e,t,i){var n,r,s=new Hi(i),o=("bar"===e||"boxPlot"===e)&&(null===(n=i.plotOptions)||void 0===n||null===(r=n.bar)||void 0===r?void 0:r.horizontal),a="pie"===e||"polarArea"===e||"donut"===e||"radar"===e||"radialBar"===e||"heatmap"===e,l="datetime"!==i.xaxis.type&&"numeric"!==i.xaxis.type,c=i.xaxis.tickPlacement?i.xaxis.tickPlacement:t.xaxis&&t.xaxis.tickPlacement;return o||a||!l||"between"===c||(i=s.convertCatToNumeric(i)),i}},{key:"extendYAxis",value:function(e,t){var i=new Fi;(void 0===e.yaxis||!e.yaxis||Array.isArray(e.yaxis)&&0===e.yaxis.length)&&(e.yaxis={}),e.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(e.yaxis=w.extend(e.yaxis,window.Apex.yaxis)),e.yaxis.constructor!==Array?e.yaxis=[w.extend(i.yAxis,e.yaxis)]:e.yaxis=w.extendArray(e.yaxis,i.yAxis);var n=!1;e.yaxis.forEach(function(e){e.logarithmic&&(n=!0)});var r=e.series;return t&&!r&&(r=t.config.series),n&&r.length!==e.yaxis.length&&r.length&&(e.yaxis=r.map(function(t,n){if(t.name||(r[n].name="series-".concat(n+1)),e.yaxis[n])return e.yaxis[n].seriesName=r[n].name,e.yaxis[n];var s=w.extend(i.yAxis,e.yaxis[0]);return s.show=!1,s})),n&&r.length>1&&r.length!==e.yaxis.length&&console.warn("A multi-series logarithmic chart should have equal number of series and y-axes"),e}},{key:"extendAnnotations",value:function(e){return void 0===e.annotations&&(e.annotations={},e.annotations.yaxis=[],e.annotations.xaxis=[],e.annotations.points=[]),e=this.extendYAxisAnnotations(e),e=this.extendXAxisAnnotations(e),this.extendPointAnnotations(e)}},{key:"extendYAxisAnnotations",value:function(e){var t=new Fi;return e.annotations.yaxis=w.extendArray(void 0!==e.annotations.yaxis?e.annotations.yaxis:[],t.yAxisAnnotation),e}},{key:"extendXAxisAnnotations",value:function(e){var t=new Fi;return e.annotations.xaxis=w.extendArray(void 0!==e.annotations.xaxis?e.annotations.xaxis:[],t.xAxisAnnotation),e}},{key:"extendPointAnnotations",value:function(e){var t=new Fi;return e.annotations.points=w.extendArray(void 0!==e.annotations.points?e.annotations.points:[],t.pointAnnotation),e}},{key:"checkForDarkTheme",value:function(e){e.theme&&"dark"===e.theme.mode&&(e.tooltip||(e.tooltip={}),"light"!==e.tooltip.theme&&(e.tooltip.theme="dark"),e.chart.foreColor||(e.chart.foreColor="#f6f7f8"),e.theme.palette||(e.theme.palette="palette4"))}},{key:"handleUserInputErrors",value:function(e){var t=e;if(t.tooltip.shared&&t.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if("bar"===t.chart.type&&t.plotOptions.bar.horizontal){if(t.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");t.yaxis[0].reversed&&(t.yaxis[0].opposite=!0),t.xaxis.tooltip.enabled=!1,t.yaxis[0].tooltip.enabled=!1,t.chart.zoom.enabled=!1}return"bar"!==t.chart.type&&"rangeBar"!==t.chart.type||t.tooltip.shared&&"barWidth"===t.xaxis.crosshairs.width&&t.series.length>1&&(t.xaxis.crosshairs.width="tickWidth"),"candlestick"!==t.chart.type&&"boxPlot"!==t.chart.type||t.yaxis[0].reversed&&(console.warn("Reversed y-axis in ".concat(t.chart.type," chart is not supported.")),t.yaxis[0].reversed=!1),t}}]),e}(),Vi=function(){function e(){s(this,e)}return a(e,[{key:"initGlobalVars",value:function(e){e.series=[],e.seriesCandleO=[],e.seriesCandleH=[],e.seriesCandleM=[],e.seriesCandleL=[],e.seriesCandleC=[],e.seriesRangeStart=[],e.seriesRangeEnd=[],e.seriesRange=[],e.seriesPercent=[],e.seriesGoals=[],e.seriesX=[],e.seriesZ=[],e.seriesNames=[],e.seriesTotals=[],e.seriesLog=[],e.seriesColors=[],e.stackedSeriesTotals=[],e.seriesXvalues=[],e.seriesYvalues=[],e.dataWasParsed=!1,e.originalSeries=null,e.labels=[],e.hasXaxisGroups=!1,e.groups=[],e.barGroups=[],e.lineGroups=[],e.areaGroups=[],e.hasSeriesGroups=!1,e.seriesGroups=[],e.categoryLabels=[],e.timescaleLabels=[],e.noLabelsProvided=!1,e.resizeTimer=null,e.selectionResizeTimer=null,e.lastWheelExecution=0,e.delayedElements=[],e.pointsArray=[],e.dataLabelsRects=[],e.isXNumeric=!1,e.skipLastTimelinelabel=!1,e.skipFirstTimelinelabel=!1,e.isDataXYZ=!1,e.isMultiLineX=!1,e.isMultipleYAxis=!1,e.maxY=-Number.MAX_VALUE,e.minY=Number.MIN_VALUE,e.minYArr=[],e.maxYArr=[],e.maxX=-Number.MAX_VALUE,e.minX=Number.MAX_VALUE,e.initialMaxX=-Number.MAX_VALUE,e.initialMinX=Number.MAX_VALUE,e.maxDate=0,e.minDate=Number.MAX_VALUE,e.minZ=Number.MAX_VALUE,e.maxZ=-Number.MAX_VALUE,e.minXDiff=Number.MAX_VALUE,e.yAxisScale=[],e.xAxisScale=null,e.xAxisTicksPositions=[],e.yLabelsCoords=[],e.yTitleCoords=[],e.barPadForNumericAxis=0,e.padHorizontal=0,e.xRange=0,e.yRange=[],e.zRange=0,e.dataPoints=0,e.xTickAmount=0,e.multiAxisTickAmount=0}},{key:"globalVars",value:function(e){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],clientX:null,clientY:null,fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:e.markers.size,largestSize:0},animationEnded:!1,isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isDirty:!1,isExecCalled:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],columnSeries:null,labels:[],timescaleLabels:[],noLabelsProvided:!1,allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],dataFormatXNumeric:!1,capturedSeriesIndex:-1,capturedDataPointIndex:-1,selectedDataPoints:[],invalidLogScale:!1,ignoreYAxisIndexes:[],maxValsInArrayIndex:0,radialSize:0,selection:void 0,zoomEnabled:"zoom"===e.chart.toolbar.autoSelected&&e.chart.toolbar.tools.zoom&&e.chart.zoom.enabled,panEnabled:"pan"===e.chart.toolbar.autoSelected&&e.chart.toolbar.tools.pan,selectionEnabled:"selection"===e.chart.toolbar.autoSelected&&e.chart.toolbar.tools.selection,yaxis:null,mousedown:!1,lastClientPosition:{},visibleXRange:void 0,yValueDecimal:0,total:0,SVGNS:"http://www.w3.org/2000/svg",svgWidth:0,svgHeight:0,noData:!1,locale:{},dom:{},memory:{methodsToExec:[]},shouldAnimate:!0,skipLastTimelinelabel:!1,skipFirstTimelinelabel:!1,delayedElements:[],axisCharts:!0,isDataXYZ:!1,isSlopeChart:e.plotOptions.line.isSlopeChart,resized:!1,resizeTimer:null,comboCharts:!1,dataChanged:!1,previousPaths:[],allSeriesHasEqualX:!0,pointsArray:[],dataLabelsRects:[],lastDrawnDataLabelsIndexes:[],hasNullValues:!1,zoomed:!1,gridWidth:0,gridHeight:0,rotateXLabels:!1,defaultLabels:!1,xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,LINE_HEIGHT_RATIO:1.618,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateX:0,translateY:0,translateYAxisX:[],yAxisWidths:[],translateXAxisY:0,translateXAxisX:0,tooltip:null,niceScaleAllowedMagMsd:[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],niceScaleDefaultTicks:[1,2,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,24],seriesYAxisMap:[],seriesYAxisReverseMap:[]}}},{key:"init",value:function(e){var t=this.globalVars(e);return this.initGlobalVars(t),t.initialConfig=w.extend({},e),t.initialSeries=w.clone(e.series),t.lastXAxis=w.clone(t.initialConfig.xaxis),t.lastYAxis=w.clone(t.initialConfig.yaxis),t}}]),e}(),Wi=function(){function e(t){s(this,e),this.opts=t}return a(e,[{key:"init",value:function(){var e=new ji(this.opts).init({responsiveOverride:!1});return{config:e,globals:(new Vi).init(e)}}}]),e}(),Ui=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}return a(e,[{key:"clippedImgArea",value:function(e){var t=this.w,i=t.config,n=parseInt(t.globals.gridWidth,10),r=parseInt(t.globals.gridHeight,10),s=n>r?n:r,o=e.image,a=0,l=0;void 0===e.width&&void 0===e.height?void 0!==i.fill.image.width&&void 0!==i.fill.image.height?(a=i.fill.image.width+1,l=i.fill.image.height):(a=s+1,l=s):(a=e.width,l=e.height);var c=document.createElementNS(t.globals.SVGNS,"pattern");Ai.setAttrs(c,{id:e.patternID,patternUnits:e.patternUnits?e.patternUnits:"userSpaceOnUse",width:a+"px",height:l+"px"});var h=document.createElementNS(t.globals.SVGNS,"image");c.appendChild(h),h.setAttributeNS(window.SVG.xlink,"href",o),Ai.setAttrs(h,{x:0,y:0,preserveAspectRatio:"none",width:a+"px",height:l+"px"}),h.style.opacity=e.opacity,t.globals.dom.elDefs.node.appendChild(c)}},{key:"getSeriesIndex",value:function(e){var t=this.w,i=t.config.chart.type;return("bar"===i||"rangeBar"===i)&&t.config.plotOptions.bar.distributed||"heatmap"===i||"treemap"===i?this.seriesIndex=e.seriesNumber:this.seriesIndex=e.seriesNumber%t.globals.series.length,this.seriesIndex}},{key:"computeColorStops",value:function(e,t){var i,n=this.w,r=null,s=null,o=l(e);try{for(o.s();!(i=o.n()).done;){var a=i.value;a>=t.threshold?(null===r||a>r)&&(r=a):(null===s||a<s)&&(s=a)}}catch(e){o.e(e)}finally{o.f()}null===r&&(r=t.threshold),null===s&&(s=t.threshold);var c=r-t.threshold+(t.threshold-s);0===c&&(c=1);var h=100-(t.threshold-s)/c*100;return[{offset:h=Math.max(0,Math.min(h,100)),color:t.colorAboveThreshold,opacity:n.config.fill.opacity},{offset:0,color:t.colorBelowThreshold,opacity:n.config.fill.opacity}]}},{key:"fillPath",value:function(e){var t,i,n,r=this.w;this.opts=e;var s,o,a,l=this.w.config;this.seriesIndex=this.getSeriesIndex(e);var c=l.plotOptions.line.colors.colorAboveThreshold&&l.plotOptions.line.colors.colorBelowThreshold,h=this.getFillColors()[this.seriesIndex];void 0!==r.globals.seriesColors[this.seriesIndex]&&(h=r.globals.seriesColors[this.seriesIndex]),"function"==typeof h&&(h=h({seriesIndex:this.seriesIndex,dataPointIndex:e.dataPointIndex,value:e.value,w:r}));var d,u,f,p=e.fillType?e.fillType:this.getFillType(this.seriesIndex),m=Array.isArray(l.fill.opacity)?l.fill.opacity[this.seriesIndex]:l.fill.opacity,g="gradient"===p||c;e.color&&(h=e.color),null!==(t=r.config.series[this.seriesIndex])&&void 0!==t&&null!==(i=t.data)&&void 0!==i&&null!==(n=i[e.dataPointIndex])&&void 0!==n&&n.fillColor&&(h=null===(d=r.config.series[this.seriesIndex])||void 0===d||null===(u=d.data)||void 0===u||null===(f=u[e.dataPointIndex])||void 0===f?void 0:f.fillColor),h||(h="#fff",console.warn("undefined color - ApexCharts"));var _=h;if(-1===h.indexOf("rgb")?-1===h.indexOf("#")?_=h:h.length<9&&(_=w.hexToRgba(h,m)):h.indexOf("rgba")>-1?m=w.getOpacityFromRGBA(h):_=w.hexToRgba(w.rgb2hex(h),m),e.opacity&&(m=e.opacity),"pattern"===p&&(o=this.handlePatternFill({fillConfig:e.fillConfig,patternFill:o,fillColor:h,fillOpacity:m,defaultColor:_})),g){var v=y(l.fill.gradient.colorStops)||[],x=l.fill.gradient.type;c&&(v[this.seriesIndex]=this.computeColorStops(r.globals.series[this.seriesIndex],l.plotOptions.line.colors),x="vertical"),a=this.handleGradientFill({type:x,fillConfig:e.fillConfig,fillColor:h,fillOpacity:m,colorStops:v,i:this.seriesIndex})}if("image"===p){var b=l.fill.image.src,S=e.patternID?e.patternID:"",T="pattern".concat(r.globals.cuid).concat(e.seriesNumber+1).concat(S);-1===this.patternIDs.indexOf(T)&&(this.clippedImgArea({opacity:m,image:Array.isArray(b)?e.seriesNumber<b.length?b[e.seriesNumber]:b[0]:b,width:e.width?e.width:void 0,height:e.height?e.height:void 0,patternUnits:e.patternUnits,patternID:T}),this.patternIDs.push(T)),s="url(#".concat(T,")")}else s=g?a:"pattern"===p?o:_;return e.solid&&(s=_),s}},{key:"getFillType",value:function(e){var t=this.w;return Array.isArray(t.config.fill.type)?t.config.fill.type[e]:t.config.fill.type}},{key:"getFillColors",value:function(){var e=this.w,t=e.config,i=this.opts,n=[];return e.globals.comboCharts?"line"===e.config.series[this.seriesIndex].type?Array.isArray(e.globals.stroke.colors)?n=e.globals.stroke.colors:n.push(e.globals.stroke.colors):Array.isArray(e.globals.fill.colors)?n=e.globals.fill.colors:n.push(e.globals.fill.colors):"line"===t.chart.type?Array.isArray(e.globals.stroke.colors)?n=e.globals.stroke.colors:n.push(e.globals.stroke.colors):Array.isArray(e.globals.fill.colors)?n=e.globals.fill.colors:n.push(e.globals.fill.colors),void 0!==i.fillColors&&(n=[],Array.isArray(i.fillColors)?n=i.fillColors.slice():n.push(i.fillColors)),n}},{key:"handlePatternFill",value:function(e){var t=e.fillConfig,i=(e.patternFill,e.fillColor),n=e.fillOpacity,r=e.defaultColor,s=this.w.config.fill;t&&(s=t);var o=this.opts,a=new Ai(this.ctx),l=Array.isArray(s.pattern.strokeWidth)?s.pattern.strokeWidth[this.seriesIndex]:s.pattern.strokeWidth,c=i;return Array.isArray(s.pattern.style)?void 0!==s.pattern.style[o.seriesNumber]?a.drawPattern(s.pattern.style[o.seriesNumber],s.pattern.width,s.pattern.height,c,l,n):r:a.drawPattern(s.pattern.style,s.pattern.width,s.pattern.height,c,l,n)}},{key:"handleGradientFill",value:function(e){var t=e.type,i=e.fillColor,n=e.fillOpacity,r=e.fillConfig,s=e.colorStops,o=e.i,a=this.w.config.fill;r&&(a=m(m({},a),r));var l=this.opts,c=new Ai(this.ctx),h=new w;t=t||a.gradient.type;var d,u=i,f=void 0===a.gradient.opacityFrom?n:Array.isArray(a.gradient.opacityFrom)?a.gradient.opacityFrom[o]:a.gradient.opacityFrom;u.indexOf("rgba")>-1&&(f=w.getOpacityFromRGBA(u));var p=void 0===a.gradient.opacityTo?n:Array.isArray(a.gradient.opacityTo)?a.gradient.opacityTo[o]:a.gradient.opacityTo;if(void 0===a.gradient.gradientToColors||0===a.gradient.gradientToColors.length)d="dark"===a.gradient.shade?h.shadeColor(-1*parseFloat(a.gradient.shadeIntensity),i.indexOf("rgb")>-1?w.rgb2hex(i):i):h.shadeColor(parseFloat(a.gradient.shadeIntensity),i.indexOf("rgb")>-1?w.rgb2hex(i):i);else if(a.gradient.gradientToColors[l.seriesNumber]){var g=a.gradient.gradientToColors[l.seriesNumber];d=g,g.indexOf("rgba")>-1&&(p=w.getOpacityFromRGBA(g))}else d=i;if(a.gradient.gradientFrom&&(u=a.gradient.gradientFrom),a.gradient.gradientTo&&(d=a.gradient.gradientTo),a.gradient.inverseColors){var _=u;u=d,d=_}return u.indexOf("rgb")>-1&&(u=w.rgb2hex(u)),d.indexOf("rgb")>-1&&(d=w.rgb2hex(d)),c.drawGradient(t,u,d,f,p,l.size,a.gradient.stops,s,o)}}]),e}(),$i=function(){function e(t,i){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"setGlobalMarkerSize",value:function(){var e=this.w;if(e.globals.markers.size=Array.isArray(e.config.markers.size)?e.config.markers.size:[e.config.markers.size],e.globals.markers.size.length>0){if(e.globals.markers.size.length<e.globals.series.length+1)for(var t=0;t<=e.globals.series.length;t++)void 0===e.globals.markers.size[t]&&e.globals.markers.size.push(e.globals.markers.size[0])}else e.globals.markers.size=e.config.series.map(function(t){return e.config.markers.size})}},{key:"plotChartMarkers",value:function(e){var t=e.pointsPos,i=e.seriesIndex,n=e.j,r=e.pSize,s=e.alwaysDrawMarker,o=void 0!==s&&s,a=e.isVirtualPoint,l=void 0!==a&&a,c=this.w,h=i,d=t,u=null,f=new Ai(this.ctx),p=c.config.markers.discrete&&c.config.markers.discrete.length;if(Array.isArray(d.x))for(var m=0;m<d.x.length;m++){var g=void 0,_=n,y=!w.isNumber(d.y[m]);0===c.globals.markers.largestSize&&c.globals.hasNullValues&&null!==c.globals.series[h][n+1]&&!l&&(y=!0),1===n&&0===m&&(_=0),1===n&&1===m&&(_=1);var v="apexcharts-marker";if("line"!==c.config.chart.type&&"area"!==c.config.chart.type||c.globals.comboCharts||c.config.tooltip.intersect||(v+=" no-pointer-events"),(Array.isArray(c.config.markers.size)?c.globals.markers.size[i]>0:c.config.markers.size>0)||o||p){y||(v+=" w".concat(w.randomId()));var x=this.getMarkerConfig({cssClass:v,seriesIndex:i,dataPointIndex:_});c.config.series[h].data[_]&&(c.config.series[h].data[_].fillColor&&(x.pointFillColor=c.config.series[h].data[_].fillColor),c.config.series[h].data[_].strokeColor&&(x.pointStrokeColor=c.config.series[h].data[_].strokeColor)),void 0!==r&&(x.pSize=r),(d.x[m]<-c.globals.markers.largestSize||d.x[m]>c.globals.gridWidth+c.globals.markers.largestSize||d.y[m]<-c.globals.markers.largestSize||d.y[m]>c.globals.gridHeight+c.globals.markers.largestSize)&&(x.pSize=0),y||((c.globals.markers.size[i]>0||o||p)&&!u&&(u=f.group({class:o||p?"":"apexcharts-series-markers"})).attr("clip-path","url(#gridRectMarkerMask".concat(c.globals.cuid,")")),(g=f.drawMarker(d.x[m],d.y[m],x)).attr("rel",_),g.attr("j",_),g.attr("index",i),g.node.setAttribute("default-marker-size",x.pSize),new Mi(this.ctx).setSelectionFilter(g,i,_),this.addEvents(g),u&&u.add(g))}else void 0===c.globals.pointsArray[i]&&(c.globals.pointsArray[i]=[]),c.globals.pointsArray[i].push([d.x[m],d.y[m]])}return u}},{key:"getMarkerConfig",value:function(e){var t=e.cssClass,i=e.seriesIndex,n=e.dataPointIndex,r=void 0===n?null:n,s=e.radius,o=void 0===s?null:s,a=e.size,l=void 0===a?null:a,c=e.strokeWidth,h=void 0===c?null:c,d=this.w,u=this.getMarkerStyle(i),f=null===l?d.globals.markers.size[i]:l,p=d.config.markers;return null!==r&&p.discrete.length&&p.discrete.map(function(e){e.seriesIndex===i&&e.dataPointIndex===r&&(u.pointStrokeColor=e.strokeColor,u.pointFillColor=e.fillColor,f=e.size,u.pointShape=e.shape)}),{pSize:null===o?f:o,pRadius:null!==o?o:p.radius,pointStrokeWidth:null!==h?h:Array.isArray(p.strokeWidth)?p.strokeWidth[i]:p.strokeWidth,pointStrokeColor:u.pointStrokeColor,pointFillColor:u.pointFillColor,shape:u.pointShape||(Array.isArray(p.shape)?p.shape[i]:p.shape),class:t,pointStrokeOpacity:Array.isArray(p.strokeOpacity)?p.strokeOpacity[i]:p.strokeOpacity,pointStrokeDashArray:Array.isArray(p.strokeDashArray)?p.strokeDashArray[i]:p.strokeDashArray,pointFillOpacity:Array.isArray(p.fillOpacity)?p.fillOpacity[i]:p.fillOpacity,seriesIndex:i}}},{key:"addEvents",value:function(e){var t=this.w,i=new Ai(this.ctx);e.node.addEventListener("mouseenter",i.pathMouseEnter.bind(this.ctx,e)),e.node.addEventListener("mouseleave",i.pathMouseLeave.bind(this.ctx,e)),e.node.addEventListener("mousedown",i.pathMouseDown.bind(this.ctx,e)),e.node.addEventListener("click",t.config.markers.onClick),e.node.addEventListener("dblclick",t.config.markers.onDblClick),e.node.addEventListener("touchstart",i.pathMouseDown.bind(this.ctx,e),{passive:!0})}},{key:"getMarkerStyle",value:function(e){var t=this.w,i=t.globals.markers.colors,n=t.config.markers.strokeColor||t.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(n)?n[e]:n,pointFillColor:Array.isArray(i)?i[e]:i}}}]),e}(),Gi=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.initialAnim=this.w.config.chart.animations.enabled}return a(e,[{key:"draw",value:function(e,t,i){var n=this.w,r=new Ai(this.ctx),s=i.realIndex,o=i.pointsPos,a=i.zRatio,l=i.elParent,c=r.group({class:"apexcharts-series-markers apexcharts-series-".concat(n.config.chart.type)});if(c.attr("clip-path","url(#gridRectMarkerMask".concat(n.globals.cuid,")")),Array.isArray(o.x))for(var h=0;h<o.x.length;h++){var d=t+1,u=!0;0===t&&0===h&&(d=0),0===t&&1===h&&(d=1);var f=n.globals.markers.size[s];if(a!==1/0){var p=n.config.plotOptions.bubble;f=n.globals.seriesZ[s][d],p.zScaling&&(f/=a),p.minBubbleRadius&&f<p.minBubbleRadius&&(f=p.minBubbleRadius),p.maxBubbleRadius&&f>p.maxBubbleRadius&&(f=p.maxBubbleRadius)}var m=o.x[h],g=o.y[h];if(f=f||0,null!==g&&void 0!==n.globals.series[s][d]||(u=!1),u){var _=this.drawPoint(m,g,f,s,d,t);c.add(_)}l.add(c)}}},{key:"drawPoint",value:function(e,t,i,n,r,s){var o=this.w,a=n,l=new S(this.ctx),c=new Mi(this.ctx),h=new Ui(this.ctx),d=new $i(this.ctx),u=new Ai(this.ctx),f=d.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:a,dataPointIndex:r,radius:"bubble"===o.config.chart.type||o.globals.comboCharts&&o.config.series[n]&&"bubble"===o.config.series[n].type?i:null}),p=h.fillPath({seriesNumber:n,dataPointIndex:r,color:f.pointFillColor,patternUnits:"objectBoundingBox",value:o.globals.series[n][s]}),m=u.drawMarker(e,t,f);if(o.config.series[a].data[r]&&o.config.series[a].data[r].fillColor&&(p=o.config.series[a].data[r].fillColor),m.attr({fill:p}),o.config.chart.dropShadow.enabled){var g=o.config.chart.dropShadow;c.dropShadow(m,g,n)}if(!this.initialAnim||o.globals.dataChanged||o.globals.resized)o.globals.animationEnded=!0;else{var _=o.config.chart.animations.speed;l.animateMarker(m,_,o.globals.easing,function(){window.setTimeout(function(){l.animationCompleted(m)},100)})}return m.attr({rel:r,j:r,index:n,"default-marker-size":f.pSize}),c.setSelectionFilter(m,n,r),d.addEvents(m),m.node.classList.add("apexcharts-marker"),m}},{key:"centerTextInBubble",value:function(e){var t=this.w;return{y:e+=parseInt(t.config.dataLabels.style.fontSize,10)/4}}}]),e}(),Xi=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"dataLabelsCorrection",value:function(e,t,i,n,r,s,o){var a=this.w,l=!1,c=new Ai(this.ctx).getTextRects(i,o),h=c.width,d=c.height;t<0&&(t=0),t>a.globals.gridHeight+d&&(t=a.globals.gridHeight+d/2),void 0===a.globals.dataLabelsRects[n]&&(a.globals.dataLabelsRects[n]=[]),a.globals.dataLabelsRects[n].push({x:e,y:t,width:h,height:d});var u=a.globals.dataLabelsRects[n].length-2,f=void 0!==a.globals.lastDrawnDataLabelsIndexes[n]?a.globals.lastDrawnDataLabelsIndexes[n][a.globals.lastDrawnDataLabelsIndexes[n].length-1]:0;if(void 0!==a.globals.dataLabelsRects[n][u]){var p=a.globals.dataLabelsRects[n][f];(e>p.x+p.width||t>p.y+p.height||t+d<p.y||e+h<p.x)&&(l=!0)}return(0===r||s)&&(l=!0),{x:e,y:t,textRects:c,drawnextLabel:l}}},{key:"drawDataLabel",value:function(e){var t=this,i=e.type,n=e.pos,r=e.i,s=e.j,o=e.isRangeStart,a=e.strokeWidth,l=void 0===a?2:a,c=this.w,h=new Ai(this.ctx),d=c.config.dataLabels,u=0,f=0,p=s,m=null;if(-1!==c.globals.collapsedSeriesIndices.indexOf(r)||!d.enabled||!Array.isArray(n.x))return m;m=h.group({class:"apexcharts-data-labels"});for(var g=0;g<n.x.length;g++)if(u=n.x[g]+d.offsetX,f=n.y[g]+d.offsetY+l,!isNaN(u)){1===s&&0===g&&(p=0),1===s&&1===g&&(p=1);var _=c.globals.series[r][p];"rangeArea"===i&&(_=o?c.globals.seriesRangeStart[r][p]:c.globals.seriesRangeEnd[r][p]);var y="",v=function(e){return c.config.dataLabels.formatter(e,{ctx:t.ctx,seriesIndex:r,dataPointIndex:p,w:c})};"bubble"===c.config.chart.type?(y=v(_=c.globals.seriesZ[r][p]),f=n.y[g],f=new Gi(this.ctx).centerTextInBubble(f,r,p).y):void 0!==_&&(y=v(_));var x=c.config.dataLabels.textAnchor;c.globals.isSlopeChart&&(x=0===p?"end":p===c.config.series[r].data.length-1?"start":"middle"),this.plotDataLabelsText({x:u,y:f,text:y,i:r,j:p,parent:m,offsetCorrection:!0,dataLabelsConfig:c.config.dataLabels,textAnchor:x})}return m}},{key:"plotDataLabelsText",value:function(e){var t=this.w,i=new Ai(this.ctx),n=e.x,r=e.y,s=e.i,o=e.j,a=e.text,l=e.textAnchor,c=e.fontSize,h=e.parent,d=e.dataLabelsConfig,u=e.color,f=e.alwaysDrawDataLabel,p=e.offsetCorrection,m=e.className,g=null;if(Array.isArray(t.config.dataLabels.enabledOnSeries)&&t.config.dataLabels.enabledOnSeries.indexOf(s)<0)return g;var _={x:n,y:r,drawnextLabel:!0,textRects:null};p&&(_=this.dataLabelsCorrection(n,r,a,s,o,f,parseInt(d.style.fontSize,10))),t.globals.zoomed||(n=_.x,r=_.y),_.textRects&&(n<-20-_.textRects.width||n>t.globals.gridWidth+_.textRects.width+30)&&(a="");var y=t.globals.dataLabels.style.colors[s];(("bar"===t.config.chart.type||"rangeBar"===t.config.chart.type)&&t.config.plotOptions.bar.distributed||t.config.dataLabels.distributed)&&(y=t.globals.dataLabels.style.colors[o]),"function"==typeof y&&(y=y({series:t.globals.series,seriesIndex:s,dataPointIndex:o,w:t})),u&&(y=u);var v=d.offsetX,x=d.offsetY;if("bar"!==t.config.chart.type&&"rangeBar"!==t.config.chart.type||(v=0,x=0),t.globals.isSlopeChart&&(0!==o&&(v=-2*d.offsetX+5),0!==o&&o!==t.config.series[s].data.length-1&&(v=0)),_.drawnextLabel){if("middle"===l&&n===t.globals.gridWidth&&(l="end"),(g=i.drawText({width:100,height:parseInt(d.style.fontSize,10),x:n+v,y:r+x,foreColor:y,textAnchor:l||d.textAnchor,text:a,fontSize:c||d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight||"normal"})).attr({class:m||"apexcharts-datalabel",cx:n,cy:r}),d.dropShadow.enabled){var b=d.dropShadow;new Mi(this.ctx).dropShadow(g,b)}h.add(g),void 0===t.globals.lastDrawnDataLabelsIndexes[s]&&(t.globals.lastDrawnDataLabelsIndexes[s]=[]),t.globals.lastDrawnDataLabelsIndexes[s].push(o)}return g}},{key:"addBackgroundToDataLabel",value:function(e,t){var i=this.w,n=i.config.dataLabels.background,r=n.padding,s=n.padding/2,o=t.width,a=t.height,l=new Ai(this.ctx).drawRect(t.x-r,t.y-s/2,o+2*r,a+s,n.borderRadius,"transparent"!==i.config.chart.background&&i.config.chart.background?i.config.chart.background:"#fff",n.opacity,n.borderWidth,n.borderColor);return n.dropShadow.enabled&&new Mi(this.ctx).dropShadow(l,n.dropShadow),l}},{key:"dataLabelsBackground",value:function(){var e=this.w;if("bubble"!==e.config.chart.type)for(var t=e.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text"),i=0;i<t.length;i++){var n=t[i],r=n.getBBox(),s=null;if(r.width&&r.height&&(s=this.addBackgroundToDataLabel(n,r)),s){n.parentNode.insertBefore(s.node,n);var o=e.config.dataLabels.background.backgroundColor||n.getAttribute("fill");!e.config.chart.animations.enabled||e.globals.resized||e.globals.dataChanged?s.attr({fill:o}):s.animate().attr({fill:o}),n.setAttribute("fill",e.config.dataLabels.background.foreColor)}}}},{key:"bringForward",value:function(){for(var e=this.w,t=e.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),i=e.globals.dom.baseEl.querySelector(".apexcharts-plot-series:last-child"),n=0;n<t.length;n++)i&&i.insertBefore(t[n],i.nextSibling)}}]),e}(),qi=".apexcharts-flip-y {\n transform: scaleY(-1) translateY(-100%);\n transform-origin: top;\n transform-box: fill-box;\n}\n.apexcharts-flip-x {\n transform: scaleX(-1);\n transform-origin: center;\n transform-box: fill-box;\n}\n.apexcharts-legend {\n display: flex;\n overflow: auto;\n padding: 0 10px;\n}\n.apexcharts-legend.apexcharts-legend-group-horizontal {\n flex-direction: column;\n}\n.apexcharts-legend-group {\n display: flex;\n}\n.apexcharts-legend-group-vertical {\n flex-direction: column-reverse;\n}\n.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\n flex-wrap: wrap\n}\n.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n flex-direction: column;\n bottom: 0;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n justify-content: center;\n align-items: center;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.apexcharts-legend-series {\n cursor: pointer;\n line-height: normal;\n display: flex;\n align-items: center;\n}\n.apexcharts-legend-text {\n position: relative;\n font-size: 14px;\n}\n.apexcharts-legend-text *, .apexcharts-legend-marker * {\n pointer-events: none;\n}\n.apexcharts-legend-marker {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin-right: 1px;\n}\n\n.apexcharts-legend-series.apexcharts-no-click {\n cursor: auto;\n}\n.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n display: none !important;\n}\n.apexcharts-inactive-legend {\n opacity: 0.45;\n} ",Zi=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.legendInactiveClass="legend-mouseover-inactive"}return a(e,[{key:"getAllSeriesEls",value:function(){return this.w.globals.dom.baseEl.getElementsByClassName("apexcharts-series")}},{key:"getSeriesByName",value:function(e){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner .apexcharts-series[seriesName='".concat(w.escapeString(e),"']"))}},{key:"isSeriesHidden",value:function(e){var t=this.getSeriesByName(e),i=parseInt(t.getAttribute("data:realIndex"),10);return{isHidden:t.classList.contains("apexcharts-series-collapsed"),realIndex:i}}},{key:"addCollapsedClassToSeries",value:function(e,t){var i=this.w;function n(i){for(var n=0;n<i.length;n++)i[n].index===t&&e.node.classList.add("apexcharts-series-collapsed")}n(i.globals.collapsedSeries),n(i.globals.ancillaryCollapsedSeries)}},{key:"toggleSeries",value:function(e){var t=this.isSeriesHidden(e);return this.ctx.legend.legendHelpers.toggleDataSeries(t.realIndex,t.isHidden),t.isHidden}},{key:"showSeries",value:function(e){var t=this.isSeriesHidden(e);t.isHidden&&this.ctx.legend.legendHelpers.toggleDataSeries(t.realIndex,!0)}},{key:"hideSeries",value:function(e){var t=this.isSeriesHidden(e);t.isHidden||this.ctx.legend.legendHelpers.toggleDataSeries(t.realIndex,!1)}},{key:"resetSeries",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.w,r=w.clone(n.globals.initialSeries);n.globals.previousPaths=[],i?(n.globals.collapsedSeries=[],n.globals.ancillaryCollapsedSeries=[],n.globals.collapsedSeriesIndices=[],n.globals.ancillaryCollapsedSeriesIndices=[]):r=this.emptyCollapsedSeries(r),n.config.series=r,e&&(t&&(n.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(r,n.config.chart.animations.dynamicAnimation.enabled))}},{key:"emptyCollapsedSeries",value:function(e){for(var t=this.w,i=0;i<e.length;i++)t.globals.collapsedSeriesIndices.indexOf(i)>-1&&(e[i].data=[]);return e}},{key:"highlightSeries",value:function(e){var t=this.w,i=this.getSeriesByName(e),n=parseInt(null==i?void 0:i.getAttribute("data:realIndex"),10),r=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),s=null,o=null,a=null;if(t.globals.axisCharts||"radialBar"===t.config.chart.type)if(t.globals.axisCharts){s=t.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(n,"']")),o=t.globals.dom.baseEl.querySelector(".apexcharts-datalabels[data\\:realIndex='".concat(n,"']"));var l=t.globals.seriesYAxisReverseMap[n];a=t.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(l,"']"))}else s=t.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(n+1,"']"));else s=t.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(n+1,"'] path"));for(var c=0;c<r.length;c++)r[c].classList.add(this.legendInactiveClass);if(s)t.globals.axisCharts||s.parentNode.classList.remove(this.legendInactiveClass),s.classList.remove(this.legendInactiveClass),null!==o&&o.classList.remove(this.legendInactiveClass),null!==a&&a.classList.remove(this.legendInactiveClass);else for(var h=0;h<r.length;h++)r[h].classList.remove(this.legendInactiveClass)}},{key:"toggleSeriesOnHover",value:function(e,t){var i=this.w;t||(t=e.target);var n=i.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis");if("mousemove"===e.type){var r=parseInt(t.getAttribute("rel"),10)-1;this.highlightSeries(i.globals.seriesNames[r])}else if("mouseout"===e.type)for(var s=0;s<n.length;s++)n[s].classList.remove(this.legendInactiveClass)}},{key:"highlightRangeInSeries",value:function(e,t){var i=this,n=this.w,r=n.globals.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),s=function(e){for(var t=0;t<r.length;t++)r[t].classList[e](i.legendInactiveClass)};if("mousemove"===e.type){var o=parseInt(t.getAttribute("rel"),10)-1;s("add");var a=n.config.plotOptions.heatmap.colorScale.ranges;!function(e,t){for(var n=0;n<r.length;n++){var s=Number(r[n].getAttribute("val"));s>=e.from&&(s<e.to||e.to===t&&s===t)&&r[n].classList.remove(i.legendInactiveClass)}}(a[o],a.reduce(function(e,t){return Math.max(e,t.to)},0))}else"mouseout"===e.type&&s("remove")}},{key:"getActiveConfigSeriesIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"asc",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=this.w,n=0;if(i.config.series.length>1)for(var r=i.config.series.map(function(e,n){return e.data&&e.data.length>0&&-1===i.globals.collapsedSeriesIndices.indexOf(n)&&(!i.globals.comboCharts||0===t.length||t.length&&t.indexOf(i.config.series[n].type)>-1)?n:-1}),s="asc"===e?0:r.length-1;"asc"===e?s<r.length:s>=0;"asc"===e?s++:s--)if(-1!==r[s]){n=r[s];break}return n}},{key:"getBarSeriesIndices",value:function(){return this.w.globals.comboCharts?this.w.config.series.map(function(e,t){return"bar"===e.type||"column"===e.type?t:-1}).filter(function(e){return-1!==e}):this.w.config.series.map(function(e,t){return t})}},{key:"getPreviousPaths",value:function(){var e=this.w;function t(t,i,n){for(var r=t[i].childNodes,s={type:n,paths:[],realIndex:t[i].getAttribute("data:realIndex")},o=0;o<r.length;o++)if(r[o].hasAttribute("pathTo")){var a=r[o].getAttribute("pathTo");s.paths.push({d:a})}e.globals.previousPaths.push(s)}e.globals.previousPaths=[],["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(function(i){for(var n,r=(n=i,e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(n,"-series .apexcharts-series"))),s=0;s<r.length;s++)t(r,s,i)});var i=e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(e.config.chart.type," .apexcharts-series"));if(i.length>0)for(var n=function(t){for(var i=e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(e.config.chart.type," .apexcharts-series[data\\:realIndex='").concat(t,"'] rect")),n=[],r=function(e){var t=function(t){return i[e].getAttribute(t)},r={x:parseFloat(t("x")),y:parseFloat(t("y")),width:parseFloat(t("width")),height:parseFloat(t("height"))};n.push({rect:r,color:i[e].getAttribute("color")})},s=0;s<i.length;s++)r(s);e.globals.previousPaths.push(n)},r=0;r<i.length;r++)n(r);e.globals.axisCharts||(e.globals.previousPaths=e.globals.series)}},{key:"clearPreviousPaths",value:function(){var e=this.w;e.globals.previousPaths=[],e.globals.allSeriesCollapsed=!1}},{key:"handleNoData",value:function(){var e=this.w,t=e.config.noData,i=new Ai(this.ctx),n=e.globals.svgWidth/2,r=e.globals.svgHeight/2,s="middle";if(e.globals.noData=!0,e.globals.animationEnded=!0,"left"===t.align?(n=10,s="start"):"right"===t.align&&(n=e.globals.svgWidth-10,s="end"),"top"===t.verticalAlign?r=50:"bottom"===t.verticalAlign&&(r=e.globals.svgHeight-50),n+=t.offsetX,r=r+parseInt(t.style.fontSize,10)+2+t.offsetY,void 0!==t.text&&""!==t.text){var o=i.drawText({x:n,y:r,text:t.text,textAnchor:s,fontSize:t.style.fontSize,fontFamily:t.style.fontFamily,foreColor:t.style.color,opacity:1,class:"apexcharts-text-nodata"});e.globals.dom.Paper.add(o)}}},{key:"setNullSeriesToZeroValues",value:function(e){for(var t=this.w,i=0;i<e.length;i++)if(0===e[i].length)for(var n=0;n<e[t.globals.maxValsInArrayIndex].length;n++)e[i].push(0);return e}},{key:"hasAllSeriesEqualX",value:function(){for(var e=!0,t=this.w,i=this.filteredSeriesX(),n=0;n<i.length-1;n++)if(i[n][0]!==i[n+1][0]){e=!1;break}return t.globals.allSeriesHasEqualX=e,e}},{key:"filteredSeriesX",value:function(){return this.w.globals.seriesX.map(function(e){return e.length>0?e:[]})}}]),e}(),Ji=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new Ci(this.ctx)}return a(e,[{key:"isMultiFormat",value:function(){return this.isFormatXY()||this.isFormat2DArray()}},{key:"isFormatXY",value:function(){var e=this.w.config.series.slice(),t=new Zi(this.ctx);if(this.activeSeriesIndex=t.getActiveConfigSeriesIndex(),void 0!==e[this.activeSeriesIndex].data&&e[this.activeSeriesIndex].data.length>0&&null!==e[this.activeSeriesIndex].data[0]&&void 0!==e[this.activeSeriesIndex].data[0].x&&null!==e[this.activeSeriesIndex].data[0])return!0}},{key:"isFormat2DArray",value:function(){var e=this.w.config.series.slice(),t=new Zi(this.ctx);if(this.activeSeriesIndex=t.getActiveConfigSeriesIndex(),void 0!==e[this.activeSeriesIndex].data&&e[this.activeSeriesIndex].data.length>0&&void 0!==e[this.activeSeriesIndex].data[0]&&null!==e[this.activeSeriesIndex].data[0]&&e[this.activeSeriesIndex].data[0].constructor===Array)return!0}},{key:"handleFormat2DArray",value:function(e,t){for(var i=this.w.config,n=this.w.globals,r="boxPlot"===i.chart.type||"boxPlot"===i.series[t].type,s=0;s<e[t].data.length;s++)if(void 0!==e[t].data[s][1]&&(Array.isArray(e[t].data[s][1])&&4===e[t].data[s][1].length&&!r?this.twoDSeries.push(w.parseNumber(e[t].data[s][1][3])):e[t].data[s].length>=5?this.twoDSeries.push(w.parseNumber(e[t].data[s][4])):this.twoDSeries.push(w.parseNumber(e[t].data[s][1])),n.dataFormatXNumeric=!0),"datetime"===i.xaxis.type){var o=new Date(e[t].data[s][0]);o=new Date(o).getTime(),this.twoDSeriesX.push(o)}else this.twoDSeriesX.push(e[t].data[s][0]);for(var a=0;a<e[t].data.length;a++)void 0!==e[t].data[a][2]&&(this.threeDSeries.push(e[t].data[a][2]),n.isDataXYZ=!0)}},{key:"handleFormatXY",value:function(e,t){var i=this.w.config,n=this.w.globals,r=new Ei(this.ctx),s=t;n.collapsedSeriesIndices.indexOf(t)>-1&&(s=this.activeSeriesIndex);for(var o=0;o<e[t].data.length;o++)void 0!==e[t].data[o].y&&(Array.isArray(e[t].data[o].y)?this.twoDSeries.push(w.parseNumber(e[t].data[o].y[e[t].data[o].y.length-1])):this.twoDSeries.push(w.parseNumber(e[t].data[o].y))),void 0!==e[t].data[o].goals&&Array.isArray(e[t].data[o].goals)?(void 0===this.seriesGoals[t]&&(this.seriesGoals[t]=[]),this.seriesGoals[t].push(e[t].data[o].goals)):(void 0===this.seriesGoals[t]&&(this.seriesGoals[t]=[]),this.seriesGoals[t].push(null));for(var a=0;a<e[s].data.length;a++){var l="string"==typeof e[s].data[a].x,c=Array.isArray(e[s].data[a].x),h=!c&&!!r.isValidDate(e[s].data[a].x);if(l||h)if(l||i.xaxis.convertedCatToNumeric){var d=n.isBarHorizontal&&n.isRangeData;"datetime"!==i.xaxis.type||d?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e[s].data[a].x),isNaN(e[s].data[a].x)||"category"===this.w.config.xaxis.type||"string"==typeof e[s].data[a].x||(n.isXNumeric=!0)):this.twoDSeriesX.push(r.parseDate(e[s].data[a].x))}else"datetime"===i.xaxis.type?this.twoDSeriesX.push(r.parseDate(e[s].data[a].x.toString())):(n.dataFormatXNumeric=!0,n.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(e[s].data[a].x)));else c?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e[s].data[a].x)):(n.isXNumeric=!0,n.dataFormatXNumeric=!0,this.twoDSeriesX.push(e[s].data[a].x))}if(e[t].data[0]&&void 0!==e[t].data[0].z){for(var u=0;u<e[t].data.length;u++)this.threeDSeries.push(e[t].data[u].z);n.isDataXYZ=!0}}},{key:"handleRangeData",value:function(e,t){var i=this.w.globals,n={};return this.isFormat2DArray()?n=this.handleRangeDataFormat("array",e,t):this.isFormatXY()&&(n=this.handleRangeDataFormat("xy",e,t)),i.seriesRangeStart[t]=void 0===n.start?[]:n.start,i.seriesRangeEnd[t]=void 0===n.end?[]:n.end,i.seriesRange[t]=n.rangeUniques,i.seriesRange.forEach(function(e,t){e&&e.forEach(function(e,t){e.y.forEach(function(t,i){for(var n=0;n<e.y.length;n++)if(i!==n){var r=t.y1,s=t.y2,o=e.y[n].y1;r<=e.y[n].y2&&o<=s&&(e.overlaps.indexOf(t.rangeName)<0&&e.overlaps.push(t.rangeName),e.overlaps.indexOf(e.y[n].rangeName)<0&&e.overlaps.push(e.y[n].rangeName))}})})}),n}},{key:"handleCandleStickBoxData",value:function(e,t){var i=this.w.globals,n={};return this.isFormat2DArray()?n=this.handleCandleStickBoxDataFormat("array",e,t):this.isFormatXY()&&(n=this.handleCandleStickBoxDataFormat("xy",e,t)),i.seriesCandleO[t]=n.o,i.seriesCandleH[t]=n.h,i.seriesCandleM[t]=n.m,i.seriesCandleL[t]=n.l,i.seriesCandleC[t]=n.c,n}},{key:"handleRangeDataFormat",value:function(e,t,i){var n=[],r=[],s=t[i].data.filter(function(e,t,i){return t===i.findIndex(function(t){return t.x===e.x})}).map(function(e,t){return{x:e.x,overlaps:[],y:[]}});if("array"===e)for(var o=0;o<t[i].data.length;o++)Array.isArray(t[i].data[o])?(n.push(t[i].data[o][1][0]),r.push(t[i].data[o][1][1])):(n.push(t[i].data[o]),r.push(t[i].data[o]));else if("xy"===e)for(var a=function(e){var o=Array.isArray(t[i].data[e].y),a=w.randomId(),l=t[i].data[e].x,c={y1:o?t[i].data[e].y[0]:t[i].data[e].y,y2:o?t[i].data[e].y[1]:t[i].data[e].y,rangeName:a};t[i].data[e].rangeName=a;var h=s.findIndex(function(e){return e.x===l});s[h].y.push(c),n.push(c.y1),r.push(c.y2)},l=0;l<t[i].data.length;l++)a(l);return{start:n,end:r,rangeUniques:s}}},{key:"handleCandleStickBoxDataFormat",value:function(e,t,i){var n=this.w,r="boxPlot"===n.config.chart.type||"boxPlot"===n.config.series[i].type,s=[],o=[],a=[],l=[],c=[];if("array"===e)if(r&&6===t[i].data[0].length||!r&&5===t[i].data[0].length)for(var h=0;h<t[i].data.length;h++)s.push(t[i].data[h][1]),o.push(t[i].data[h][2]),r?(a.push(t[i].data[h][3]),l.push(t[i].data[h][4]),c.push(t[i].data[h][5])):(l.push(t[i].data[h][3]),c.push(t[i].data[h][4]));else for(var d=0;d<t[i].data.length;d++)Array.isArray(t[i].data[d][1])&&(s.push(t[i].data[d][1][0]),o.push(t[i].data[d][1][1]),r?(a.push(t[i].data[d][1][2]),l.push(t[i].data[d][1][3]),c.push(t[i].data[d][1][4])):(l.push(t[i].data[d][1][2]),c.push(t[i].data[d][1][3])));else if("xy"===e)for(var u=0;u<t[i].data.length;u++)Array.isArray(t[i].data[u].y)&&(s.push(t[i].data[u].y[0]),o.push(t[i].data[u].y[1]),r?(a.push(t[i].data[u].y[2]),l.push(t[i].data[u].y[3]),c.push(t[i].data[u].y[4])):(l.push(t[i].data[u].y[2]),c.push(t[i].data[u].y[3])));return{o:s,h:o,m:a,l,c}}},{key:"parseDataAxisCharts",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.ctx,n=this.w.config,r=this.w.globals,s=new Ei(i),o=n.labels.length>0?n.labels.slice():n.xaxis.categories.slice();r.isRangeBar="rangeBar"===n.chart.type&&r.isBarHorizontal,r.hasXaxisGroups="category"===n.xaxis.type&&n.xaxis.group.groups.length>0,r.hasXaxisGroups&&(r.groups=n.xaxis.group.groups),e.forEach(function(e,t){void 0!==e.name?r.seriesNames.push(e.name):r.seriesNames.push("series-"+parseInt(t+1,10))}),this.coreUtils.setSeriesYAxisMappings();var a=[],l=y(new Set(n.series.map(function(e){return e.group})));n.series.forEach(function(e,t){var i=l.indexOf(e.group);a[i]||(a[i]=[]),a[i].push(r.seriesNames[t])}),r.seriesGroups=a;for(var c=function(){for(var e=0;e<o.length;e++)if("string"==typeof o[e]){if(!s.isValidDate(o[e]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");t.twoDSeriesX.push(s.parseDate(o[e]))}else t.twoDSeriesX.push(o[e])},h=0;h<e.length;h++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],void 0===e[h].data)return void console.error("It is a possibility that you may have not included 'data' property in series.");if("rangeBar"!==n.chart.type&&"rangeArea"!==n.chart.type&&"rangeBar"!==e[h].type&&"rangeArea"!==e[h].type||(r.isRangeData=!0,this.handleRangeData(e,h)),this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(e,h):this.isFormatXY()&&this.handleFormatXY(e,h),"candlestick"!==n.chart.type&&"candlestick"!==e[h].type&&"boxPlot"!==n.chart.type&&"boxPlot"!==e[h].type||this.handleCandleStickBoxData(e,h),r.series.push(this.twoDSeries),r.labels.push(this.twoDSeriesX),r.seriesX.push(this.twoDSeriesX),r.seriesGoals=this.seriesGoals,h!==this.activeSeriesIndex||this.fallbackToCategory||(r.isXNumeric=!0);else{"datetime"===n.xaxis.type?(r.isXNumeric=!0,c(),r.seriesX.push(this.twoDSeriesX)):"numeric"===n.xaxis.type&&(r.isXNumeric=!0,o.length>0&&(this.twoDSeriesX=o,r.seriesX.push(this.twoDSeriesX))),r.labels.push(this.twoDSeriesX);var d=e[h].data.map(function(e){return w.parseNumber(e)});r.series.push(d)}r.seriesZ.push(this.threeDSeries),void 0!==e[h].color?r.seriesColors.push(e[h].color):r.seriesColors.push(void 0)}return this.w}},{key:"parseDataNonAxisCharts",value:function(e){var t=this.w.globals,i=this.w.config,n=Array.isArray(e)&&e.every(function(e){return"number"==typeof e})&&i.labels.length>0,r=Array.isArray(e)&&e.some(function(e){return e&&"object"===x(e)&&e.data||e&&"object"===x(e)&&e.parsing});if(n&&r&&console.warn("ApexCharts: Both old format (numeric series + labels) and new format (series objects with data/parsing) detected. Using old format for backward compatibility."),n){t.series=e.slice(),t.seriesNames=i.labels.slice();for(var s=0;s<t.series.length;s++)void 0===t.seriesNames[s]&&t.seriesNames.push("series-"+(s+1));return this.w}if(Array.isArray(e)&&e.every(function(e){return"number"==typeof e})){t.series=e.slice(),t.seriesNames=[];for(var o=0;o<t.series.length;o++)t.seriesNames.push(i.labels[o]||"series-".concat(o+1));return this.w}var a=this.extractPieDataFromSeries(e);t.series=a.values,t.seriesNames=a.labels,"radialBar"===i.chart.type&&(t.series=t.series.map(function(e){var t=w.parseNumber(e);return t>100&&console.warn("ApexCharts: RadialBar value ".concat(t," > 100, consider using percentage values (0-100)")),t}));for(var l=0;l<t.series.length;l++)void 0===t.seriesNames[l]&&t.seriesNames.push("series-"+(l+1));return this.w}},{key:"resetParsingFlags",value:function(){var e=this.w;e.globals.dataWasParsed=!1,e.globals.originalSeries=null,e.config.series&&e.config.series.forEach(function(e){e.__apexParsed&&delete e.__apexParsed})}},{key:"extractPieDataFromSeries",value:function(e){var t=[],i=[];if(!Array.isArray(e))return console.warn("ApexCharts: Expected array for series data"),{values:[],labels:[]};if(0===e.length)return console.warn("ApexCharts: Empty series array"),{values:[],labels:[]};var n=e[0];return"object"===x(n)&&null!==n&&n.data?(this.extractPieDataFromSeriesObjects(e,t,i),{values:t,labels:i}):(console.warn("ApexCharts: Unsupported series format for pie/donut/radialBar. Expected series objects with data property."),{values:[],labels:[]})}},{key:"extractPieDataFromSeriesObjects",value:function(e,t,i){e.forEach(function(e,n){e.data&&Array.isArray(e.data)?e.data.forEach(function(e){"object"===x(e)&&null!==e?void 0!==e.x&&void 0!==e.y?(i.push(String(e.x)),t.push(w.parseNumber(e.y))):console.warn("ApexCharts: Invalid data point format for pie chart. Expected {x, y} format:",e):console.warn("ApexCharts: Expected object data point, got:",x(e))}):console.warn("ApexCharts: Series ".concat(n," has no valid data array"))})}},{key:"handleExternalLabelsData",value:function(e){var t=this.w.config,i=this.w.globals;t.xaxis.categories.length>0?i.labels=t.xaxis.categories:t.labels.length>0?i.labels=t.labels.slice():this.fallbackToCategory?(i.labels=i.labels[0],i.seriesRange.length&&(i.seriesRange.map(function(e){e.forEach(function(e){i.labels.indexOf(e.x)<0&&e.x&&i.labels.push(e.x)})}),i.labels=Array.from(new Set(i.labels.map(JSON.stringify)),JSON.parse)),t.xaxis.convertedCatToNumeric&&(new Hi(t).convertCatToNumericXaxis(t,this.ctx,i.seriesX[0]),this._generateExternalLabels(e))):this._generateExternalLabels(e)}},{key:"_generateExternalLabels",value:function(e){var t=this.w.globals,i=this.w.config,n=[];if(t.axisCharts){if(t.series.length>0)if(this.isFormatXY())for(var r=i.series.map(function(e,t){return e.data.filter(function(e,t,i){return i.findIndex(function(t){return t.x===e.x})===t})}),s=r.reduce(function(e,t,i,n){return n[e].length>t.length?e:i},0),o=0;o<r[s].length;o++)n.push(o+1);else for(var a=0;a<t.series[t.maxValsInArrayIndex].length;a++)n.push(a+1);t.seriesX=[];for(var l=0;l<e.length;l++)t.seriesX.push(n);this.w.globals.isBarHorizontal||(t.isXNumeric=!0)}if(0===n.length){n=t.axisCharts?[]:t.series.map(function(e,t){return t+1});for(var c=0;c<e.length;c++)t.seriesX.push(n)}t.labels=n,i.xaxis.convertedCatToNumeric&&(t.categoryLabels=n.map(function(e){return i.xaxis.labels.formatter(e)})),t.noLabelsProvided=!0}},{key:"parseRawDataIfNeeded",value:function(e){var t=this,i=this.w.config,n=this.w.globals,r=i.parsing;if(n.dataWasParsed)return e;if(!r&&!e.some(function(e){return e.parsing}))return e;var s=e.map(function(e,i){var n,s,o;if(!e.data||!Array.isArray(e.data)||0===e.data.length)return e;var a={x:(null===(n=e.parsing)||void 0===n?void 0:n.x)||(null==r?void 0:r.x),y:(null===(s=e.parsing)||void 0===s?void 0:s.y)||(null==r?void 0:r.y),z:(null===(o=e.parsing)||void 0===o?void 0:o.z)||(null==r?void 0:r.z)};if(!a.x&&!a.y)return e;var l=e.data[0];if("object"===x(l)&&null!==l&&(l.hasOwnProperty("x")||l.hasOwnProperty("y"))||Array.isArray(l))return e;if(!a.x||!a.y||Array.isArray(a.y)&&0===a.y.length)return console.warn("ApexCharts: Series ".concat(i," has parsing config but missing x or y field specification")),e;var c=e.data.map(function(e,n){if("object"!==x(e)||null===e)return console.warn("ApexCharts: Series ".concat(i,", data point ").concat(n," is not an object, skipping parsing")),e;var r,s=t.getNestedValue(e,a.x),o=void 0;if(Array.isArray(a.y)){var l=a.y.map(function(i){return t.getNestedValue(e,i)});r="bubble"===t.w.config.chart.type&&2===l.length?l[0]:l}else r=t.getNestedValue(e,a.y);a.z&&(o=t.getNestedValue(e,a.z)),void 0===s&&console.warn("ApexCharts: Series ".concat(i,", data point ").concat(n," missing field '").concat(a.x,"'")),void 0===r&&console.warn("ApexCharts: Series ".concat(i,", data point ").concat(n," missing field '").concat(a.y,"'"));var c={x:s,y:r};if("bubble"===t.w.config.chart.type&&Array.isArray(a.y)&&2===a.y.length){var h=t.getNestedValue(e,a.y[1]);void 0!==h&&(c.z=h)}return void 0!==o&&(c.z=o),c});return m(m({},e),{},{data:c,__apexParsed:!0})});return n.dataWasParsed=!0,n.originalSeries||(n.originalSeries=w.clone(e)),s}},{key:"getNestedValue",value:function(e,t){if(e&&"object"===x(e)&&t){if(-1===t.indexOf("."))return e[t];for(var i=t.split("."),n=e,r=0;r<i.length;r++){if(null==n||"object"!==x(n))return;n=n[i[r]]}return n}}},{key:"parseData",value:function(e){var t=this.w,i=t.config,n=t.globals;if(e=this.parseRawDataIfNeeded(e),i.series=e,n.initialSeries=w.clone(e),this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.ctx.core.resetGlobals(),this.ctx.core.isMultipleY(),n.axisCharts?(this.parseDataAxisCharts(e),this.coreUtils.getLargestSeries()):this.parseDataNonAxisCharts(e),i.chart.stacked){var r=new Zi(this.ctx);n.series=r.setNullSeriesToZeroValues(n.series)}this.coreUtils.getSeriesTotals(),n.axisCharts&&(n.stackedSeriesTotals=this.coreUtils.getStackedSeriesTotals(),n.stackedSeriesTotalsByGroups=this.coreUtils.getStackedSeriesTotalsByGroups()),this.coreUtils.getPercentSeries(),n.dataFormatXNumeric||n.isXNumeric&&("numeric"!==i.xaxis.type||0!==i.labels.length||0!==i.xaxis.categories.length)||this.handleExternalLabelsData(e);for(var s=this.coreUtils.getCategoryLabels(n.labels),o=0;o<s.length;o++)if(Array.isArray(s[o])){n.isMultiLineX=!0;break}}},{key:"excludeCollapsedSeriesInYAxis",value:function(){var e=this.w,t=[];e.globals.seriesYAxisMap.forEach(function(i,n){var r=0;i.forEach(function(t){-1!==e.globals.collapsedSeriesIndices.indexOf(t)&&r++}),r>0&&r==i.length&&t.push(n)}),e.globals.ignoreYAxisIndexes=t.map(function(e){return e})}}]),e}(),Ki=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"svgStringToNode",value:function(e){return(new DOMParser).parseFromString(e,"image/svg+xml").documentElement}},{key:"scaleSvgNode",value:function(e,t){var i=parseFloat(e.getAttributeNS(null,"width")),n=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",i*t),e.setAttributeNS(null,"height",n*t),e.setAttributeNS(null,"viewBox","0 0 "+i+" "+n)}},{key:"getSvgString",value:function(e){var t=this;return new Promise(function(i){var n=t.w,r=e||n.config.chart.toolbar.export.scale||n.config.chart.toolbar.export.width/n.globals.svgWidth;r||(r=1);var s=n.globals.svgWidth*r,o=n.globals.svgHeight*r,a=n.globals.dom.elWrap.cloneNode(!0);a.style.width=s+"px",a.style.height=o+"px";var l=(new XMLSerializer).serializeToString(a),c="\n .apexcharts-tooltip, .apexcharts-toolbar, .apexcharts-xaxistooltip, .apexcharts-yaxistooltip, .apexcharts-xcrosshairs, .apexcharts-ycrosshairs, .apexcharts-zoom-rect, .apexcharts-selection-rect {\n display: none;\n }\n ";n.config.legend.show&&n.globals.dom.elLegendWrap&&n.globals.dom.elLegendWrap.children.length>0&&(c+=qi);var h='\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="'.concat(n.globals.svgWidth,'px" height="').concat(n.globals.svgHeight,'px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:').concat(s,"px; height:").concat(o,'px;">\n <style type="text/css">\n ').concat(c,"\n </style>\n ").concat(l,"\n </div>\n </foreignObject>\n </svg>\n "),d=t.svgStringToNode(h);1!==r&&t.scaleSvgNode(d,r),t.convertImagesToBase64(d).then(function(){h=(new XMLSerializer).serializeToString(d),i(h.replace(/ /g," "))})})}},{key:"convertImagesToBase64",value:function(e){var t=this,i=e.getElementsByTagName("image"),n=Array.from(i).map(function(e){var i=e.getAttributeNS("http://www.w3.org/1999/xlink","href");return i&&!i.startsWith("data:")?t.getBase64FromUrl(i).then(function(t){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t)}).catch(function(e){console.error("Error converting image to base64:",e)}):Promise.resolve()});return Promise.all(n)}},{key:"getBase64FromUrl",value:function(e){return new Promise(function(t,i){var n=new Image;n.crossOrigin="Anonymous",n.onload=function(){var e=document.createElement("canvas");e.width=n.width,e.height=n.height,e.getContext("2d").drawImage(n,0,0),t(e.toDataURL())},n.onerror=i,n.src=e})}},{key:"svgUrl",value:function(){var e=this;return new Promise(function(t){e.getSvgString().then(function(e){var i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}},{key:"dataURI",value:function(e){var t=this;return new Promise(function(i){var n=t.w,r=e?e.scale||e.width/n.globals.svgWidth:1,s=document.createElement("canvas");s.width=n.globals.svgWidth*r,s.height=parseInt(n.globals.dom.elWrap.style.height,10)*r;var o="transparent"!==n.config.chart.background&&n.config.chart.background?n.config.chart.background:"#fff",a=s.getContext("2d");a.fillStyle=o,a.fillRect(0,0,s.width*r,s.height*r),t.getSvgString(r).then(function(e){var t="data:image/svg+xml,"+encodeURIComponent(e),n=new Image;n.crossOrigin="anonymous",n.onload=function(){if(a.drawImage(n,0,0),s.msToBlob){var e=s.msToBlob();i({blob:e})}else{var t=s.toDataURL("image/png");i({imgURI:t})}},n.src=t})})}},{key:"exportToSVG",value:function(){var e=this;this.svgUrl().then(function(t){e.triggerDownload(t,e.w.config.chart.toolbar.export.svg.filename,".svg")})}},{key:"exportToPng",value:function(){var e=this,t=this.w.config.chart.toolbar.export.scale,i=this.w.config.chart.toolbar.export.width,n=t?{scale:t}:i?{width:i}:void 0;this.dataURI(n).then(function(t){var i=t.imgURI,n=t.blob;n?navigator.msSaveOrOpenBlob(n,e.w.globals.chartID+".png"):e.triggerDownload(i,e.w.config.chart.toolbar.export.png.filename,".png")})}},{key:"exportToCSV",value:function(e){var t=this,i=e.series,n=e.fileName,r=e.columnDelimiter,s=void 0===r?",":r,o=e.lineDelimiter,a=void 0===o?"\n":o,l=this.w;i||(i=l.config.series);var c=[],h=[],d="",u=l.globals.series.map(function(e,t){return-1===l.globals.collapsedSeriesIndices.indexOf(t)?e:[]}),f=function(e){return"function"==typeof l.config.chart.toolbar.export.csv.categoryFormatter?l.config.chart.toolbar.export.csv.categoryFormatter(e):"datetime"===l.config.xaxis.type&&String(e).length>=10?new Date(e).toDateString():w.isNumber(e)?e:e.split(s).join("")},p=function(e){return"function"==typeof l.config.chart.toolbar.export.csv.valueFormatter?l.config.chart.toolbar.export.csv.valueFormatter(e):e},m=Math.max.apply(Math,y(i.map(function(e){return e.data?e.data.length:0}))),g=new Ji(this.ctx),_=new Pi(this.ctx),v=function(e){var i="";if(l.globals.axisCharts){if("category"===l.config.xaxis.type||l.config.xaxis.convertedCatToNumeric)if(l.globals.isBarHorizontal){var n=l.globals.yLabelFormatters[0],r=new Zi(t.ctx).getActiveConfigSeriesIndex();i=n(l.globals.labels[e],{seriesIndex:r,dataPointIndex:e,w:l})}else i=_.getLabel(l.globals.labels,l.globals.timescaleLabels,0,e).text;"datetime"===l.config.xaxis.type&&(l.config.xaxis.categories.length?i=l.config.xaxis.categories[e]:l.config.labels.length&&(i=l.config.labels[e]))}else i=l.config.labels[e];return null===i?"nullvalue":(Array.isArray(i)&&(i=i.join(" ")),w.isNumber(i)?i:i.split(s).join(""))};c.push(l.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===l.config.chart.type?(c.push("minimum"),c.push("q1"),c.push("median"),c.push("q3"),c.push("maximum")):"candlestick"===l.config.chart.type?(c.push("open"),c.push("high"),c.push("low"),c.push("close")):"rangeBar"===l.config.chart.type?(c.push("minimum"),c.push("maximum")):i.map(function(e,t){var i=(e.name?e.name:"series-".concat(t))+"";l.globals.axisCharts&&c.push(i.split(s).join("")?i.split(s).join(""):"series-".concat(t))}),l.globals.axisCharts||(c.push(l.config.chart.toolbar.export.csv.headerValue),h.push(c.join(s))),l.globals.allSeriesHasEqualX||!l.globals.axisCharts||l.config.xaxis.categories.length||l.config.labels.length?i.map(function(e,t){l.globals.axisCharts?function(e,t){if(c.length&&0===t&&h.push(c.join(s)),e.data){e.data=e.data.length&&e.data||y(Array(m)).map(function(){return""});for(var n=0;n<e.data.length;n++){c=[];var r=v(n);if("nullvalue"!==r){if(r||(g.isFormatXY()?r=i[t].data[n].x:g.isFormat2DArray()&&(r=i[t].data[n]?i[t].data[n][0]:"")),0===t){c.push(f(r));for(var o=0;o<l.globals.series.length;o++){var a,d=g.isFormatXY()?null===(a=i[o].data[n])||void 0===a?void 0:a.y:u[o][n];c.push(p(d))}}("candlestick"===l.config.chart.type||e.type&&"candlestick"===e.type)&&(c.pop(),c.push(l.globals.seriesCandleO[t][n]),c.push(l.globals.seriesCandleH[t][n]),c.push(l.globals.seriesCandleL[t][n]),c.push(l.globals.seriesCandleC[t][n])),("boxPlot"===l.config.chart.type||e.type&&"boxPlot"===e.type)&&(c.pop(),c.push(l.globals.seriesCandleO[t][n]),c.push(l.globals.seriesCandleH[t][n]),c.push(l.globals.seriesCandleM[t][n]),c.push(l.globals.seriesCandleL[t][n]),c.push(l.globals.seriesCandleC[t][n])),"rangeBar"===l.config.chart.type&&(c.pop(),c.push(l.globals.seriesRangeStart[t][n]),c.push(l.globals.seriesRangeEnd[t][n])),c.length&&h.push(c.join(s))}}}}(e,t):((c=[]).push(f(l.globals.labels[t])),c.push(p(u[t])),h.push(c.join(s)))}):function(){var e=new Set,t={};i.forEach(function(n,r){null==n||n.data.forEach(function(n){var s,o;if(g.isFormatXY())s=n.x,o=n.y;else{if(!g.isFormat2DArray())return;s=n[0],o=n[1]}t[s]||(t[s]=Array(i.length).fill("")),t[s][r]=p(o),e.add(s)})}),c.length&&h.push(c.join(s)),Array.from(e).sort().forEach(function(e){h.push([f(e),t[e].join(s)])})}(),d+=h.join(a),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+d),n||l.config.chart.toolbar.export.csv.filename,".csv")}},{key:"triggerDownload",value:function(e,t,i){var n=document.createElement("a");n.href=e,n.download=(t||this.w.globals.chartID)+i,document.body.appendChild(n),n.click(),document.body.removeChild(n)}}]),e}(),Qi=function(){function e(t,i){s(this,e),this.ctx=t,this.elgrid=i,this.w=t.w;var n=this.w;this.axesUtils=new Pi(t),this.xaxisLabels=n.globals.labels.slice(),n.globals.timescaleLabels.length>0&&!n.globals.isBarHorizontal&&(this.xaxisLabels=n.globals.timescaleLabels.slice()),n.config.xaxis.overwriteCategories&&(this.xaxisLabels=n.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===n.config.xaxis.position?this.offY=0:this.offY=n.globals.gridHeight,this.offY=this.offY+n.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===n.config.chart.type&&n.config.plotOptions.bar.horizontal,this.xaxisFontSize=n.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=n.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=n.config.xaxis.labels.style.colors,this.xaxisBorderWidth=n.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=n.config.yaxis[0].axisBorder.width.toString()),String(this.xaxisBorderWidth).indexOf("%")>-1?this.xaxisBorderWidth=n.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=n.config.xaxis.axisBorder.height,this.yaxis=n.config.yaxis[0]}return a(e,[{key:"drawXaxis",value:function(){var e=this.w,t=new Ai(this.ctx),i=t.group({class:"apexcharts-xaxis",transform:"translate(".concat(e.config.xaxis.offsetX,", ").concat(e.config.xaxis.offsetY,")")}),n=t.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(e.globals.translateXAxisX,", ").concat(e.globals.translateXAxisY,")")});i.add(n);for(var r=[],s=0;s<this.xaxisLabels.length;s++)r.push(this.xaxisLabels[s]);if(this.drawXAxisLabelAndGroup(!0,t,n,r,e.globals.isXNumeric,function(e,t){return t}),e.globals.hasXaxisGroups){var o=e.globals.groups;r=[];for(var a=0;a<o.length;a++)r.push(o[a].title);var l={};e.config.xaxis.group.style&&(l.xaxisFontSize=e.config.xaxis.group.style.fontSize,l.xaxisFontFamily=e.config.xaxis.group.style.fontFamily,l.xaxisForeColors=e.config.xaxis.group.style.colors,l.fontWeight=e.config.xaxis.group.style.fontWeight,l.cssClass=e.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,t,n,r,!1,function(e,t){return o[e].cols*t},l)}if(void 0!==e.config.xaxis.title.text){var c=t.group({class:"apexcharts-xaxis-title"}),h=t.drawText({x:e.globals.gridWidth/2+e.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+("bottom"===e.config.xaxis.position?e.globals.xAxisLabelsHeight:-e.globals.xAxisLabelsHeight-10)+e.config.xaxis.title.offsetY,text:e.config.xaxis.title.text,textAnchor:"middle",fontSize:e.config.xaxis.title.style.fontSize,fontFamily:e.config.xaxis.title.style.fontFamily,fontWeight:e.config.xaxis.title.style.fontWeight,foreColor:e.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+e.config.xaxis.title.style.cssClass});c.add(h),i.add(c)}if(e.config.xaxis.axisBorder.show){var d=e.globals.barPadForNumericAxis,u=t.drawLine(e.globals.padHorizontal+e.config.xaxis.axisBorder.offsetX-d,this.offY,this.xaxisBorderWidth+d,this.offY,e.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(u):i.add(u)}return i}},{key:"drawXAxisLabelAndGroup",value:function(e,t,i,n,r,s){var o,a=this,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},c=[],h=[],d=this.w,u=l.xaxisFontSize||this.xaxisFontSize,f=l.xaxisFontFamily||this.xaxisFontFamily,p=l.xaxisForeColors||this.xaxisForeColors,m=l.fontWeight||d.config.xaxis.labels.style.fontWeight,g=l.cssClass||d.config.xaxis.labels.style.cssClass,_=d.globals.padHorizontal,y=n.length,v="category"===d.config.xaxis.type?d.globals.dataPoints:y;if(0===v&&y>v&&(v=y),r){var x=Math.max(Number(d.config.xaxis.tickAmount)||1,v>1?v-1:v);o=d.globals.gridWidth/Math.min(x,y-1),_=_+s(0,o)/2+d.config.xaxis.labels.offsetX}else o=d.globals.gridWidth/v,_=_+s(0,o)+d.config.xaxis.labels.offsetX;for(var b=function(r){var l=_-s(r,o)/2+d.config.xaxis.labels.offsetX;0===r&&1===y&&o/2===_&&1===v&&(l=d.globals.gridWidth/2);var x=a.axesUtils.getLabel(n,d.globals.timescaleLabels,l,r,c,u,e),b=28;if(d.globals.rotateXLabels&&e&&(b=22),d.config.xaxis.title.text&&"top"===d.config.xaxis.position&&(b+=parseFloat(d.config.xaxis.title.style.fontSize)+2),e||(b=b+parseFloat(u)+(d.globals.xAxisLabelsHeight-d.globals.xAxisGroupLabelsHeight)+(d.globals.rotateXLabels?10:0)),x=void 0!==d.config.xaxis.tickAmount&&"dataPoints"!==d.config.xaxis.tickAmount&&"datetime"!==d.config.xaxis.type?a.axesUtils.checkLabelBasedOnTickamount(r,x,y):a.axesUtils.checkForOverflowingLabels(r,x,y,c,h),d.config.xaxis.labels.show){var w=t.drawText({x:x.x,y:a.offY+d.config.xaxis.labels.offsetY+b-("top"===d.config.xaxis.position?d.globals.xAxisHeight+d.config.xaxis.axisTicks.height-2:0),text:x.text,textAnchor:"middle",fontWeight:x.isBold?600:m,fontSize:u,fontFamily:f,foreColor:Array.isArray(p)?e&&d.config.xaxis.convertedCatToNumeric?p[d.globals.minX+r-1]:p[r]:p,isPlainText:!1,cssClass:(e?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+g});if(i.add(w),w.on("click",function(e){if("function"==typeof d.config.chart.events.xAxisLabelClick){var t=Object.assign({},d,{labelIndex:r});d.config.chart.events.xAxisLabelClick(e,a.ctx,t)}}),e){var S=document.createElementNS(d.globals.SVGNS,"title");S.textContent=Array.isArray(x.text)?x.text.join(" "):x.text,w.node.appendChild(S),""!==x.text&&(c.push(x.text),h.push(x))}}r<y-1&&(_+=s(r+1,o))},w=0;w<=y-1;w++)b(w)}},{key:"drawXaxisInversed",value:function(e){var t,i,n=this,r=this.w,s=new Ai(this.ctx),o=r.config.yaxis[0].opposite?r.globals.translateYAxisX[e]:0,a=s.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:e}),l=s.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+o+", 0)"});a.add(l);var c=[];if(r.config.yaxis[e].show)for(var h=0;h<this.xaxisLabels.length;h++)c.push(this.xaxisLabels[h]);t=r.globals.gridHeight/c.length,i=-t/2.2;var d=r.globals.yLabelFormatters[0],u=r.config.yaxis[0].labels;if(u.show)for(var f=function(o){var a=void 0===c[o]?"":c[o];a=d(a,{seriesIndex:e,dataPointIndex:o,w:r});var h=n.axesUtils.getYAxisForeColor(u.style.colors,e),f=0;Array.isArray(a)&&(f=a.length/2*parseInt(u.style.fontSize,10));var p=u.offsetX-15,m="end";n.yaxis.opposite&&(m="start"),"left"===r.config.yaxis[0].labels.align?(p=u.offsetX,m="start"):"center"===r.config.yaxis[0].labels.align?(p=u.offsetX,m="middle"):"right"===r.config.yaxis[0].labels.align&&(m="end");var g=s.drawText({x:p,y:i+t+u.offsetY-f,text:a,textAnchor:m,foreColor:Array.isArray(h)?h[o]:h,fontSize:u.style.fontSize,fontFamily:u.style.fontFamily,fontWeight:u.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+u.style.cssClass,maxWidth:u.maxWidth});l.add(g),g.on("click",function(e){if("function"==typeof r.config.chart.events.xAxisLabelClick){var t=Object.assign({},r,{labelIndex:o});r.config.chart.events.xAxisLabelClick(e,n.ctx,t)}});var _=document.createElementNS(r.globals.SVGNS,"title");if(_.textContent=Array.isArray(a)?a.join(" "):a,g.node.appendChild(_),0!==r.config.yaxis[e].labels.rotate){var y=s.rotateAroundCenter(g.node);g.node.setAttribute("transform","rotate(".concat(r.config.yaxis[e].labels.rotate," 0 ").concat(y.y,")"))}i+=t},p=0;p<=c.length-1;p++)f(p);if(void 0!==r.config.yaxis[0].title.text){var m=s.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+o+", 0)"}),g=s.drawText({x:r.config.yaxis[0].title.offsetX,y:r.globals.gridHeight/2+r.config.yaxis[0].title.offsetY,text:r.config.yaxis[0].title.text,textAnchor:"middle",foreColor:r.config.yaxis[0].title.style.color,fontSize:r.config.yaxis[0].title.style.fontSize,fontWeight:r.config.yaxis[0].title.style.fontWeight,fontFamily:r.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+r.config.yaxis[0].title.style.cssClass});m.add(g),a.add(m)}var _=0;this.isCategoryBarHorizontal&&r.config.yaxis[0].opposite&&(_=r.globals.gridWidth);var y=r.config.xaxis.axisBorder;if(y.show){var v=s.drawLine(r.globals.padHorizontal+y.offsetX+_,1+y.offsetY,r.globals.padHorizontal+y.offsetX+_,r.globals.gridHeight+y.offsetY,y.color,0);this.elgrid&&this.elgrid.elGridBorders&&r.config.grid.show?this.elgrid.elGridBorders.add(v):a.add(v)}return r.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(_,c.length,r.config.yaxis[0].axisBorder,r.config.yaxis[0].axisTicks,0,t,a),a}},{key:"drawXaxisTicks",value:function(e,t,i){var n=this.w,r=e;if(!(e<0||e-2>n.globals.gridWidth)){var s=this.offY+n.config.xaxis.axisTicks.offsetY;if(t=t+s+n.config.xaxis.axisTicks.height,"top"===n.config.xaxis.position&&(t=s-n.config.xaxis.axisTicks.height),n.config.xaxis.axisTicks.show){var o=new Ai(this.ctx).drawLine(e+n.config.xaxis.axisTicks.offsetX,s+n.config.xaxis.offsetY,r+n.config.xaxis.axisTicks.offsetX,t+n.config.xaxis.offsetY,n.config.xaxis.axisTicks.color);i.add(o),o.node.classList.add("apexcharts-xaxis-tick")}}}},{key:"getXAxisTicksPositions",value:function(){var e=this.w,t=[],i=this.xaxisLabels.length,n=e.globals.padHorizontal;if(e.globals.timescaleLabels.length>0)for(var r=0;r<i;r++)n=this.xaxisLabels[r].position,t.push(n);else for(var s=i,o=0;o<s;o++){var a=s;e.globals.isXNumeric&&"bar"!==e.config.chart.type&&(a-=1),n+=e.globals.gridWidth/a,t.push(n)}return t}},{key:"xAxisLabelCorrections",value:function(){var e=this.w,t=new Ai(this.ctx),i=e.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),n=e.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"),r=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),s=e.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(e.globals.rotateXLabels||e.config.xaxis.labels.rotateAlways)for(var o=0;o<n.length;o++){var a=t.rotateAroundCenter(n[o]);a.y=a.y-1,a.x=a.x+1,n[o].setAttribute("transform","rotate(".concat(e.config.xaxis.labels.rotate," ").concat(a.x," ").concat(a.y,")")),n[o].setAttribute("text-anchor","end"),i.setAttribute("transform","translate(0, ".concat(-10,")"));var l=n[o].childNodes;e.config.xaxis.labels.trim&&Array.prototype.forEach.call(l,function(i){t.placeTextWithEllipsis(i,i.textContent,e.globals.xAxisLabelsHeight-("bottom"===e.config.legend.position?20:10))})}else!function(){for(var i=e.globals.gridWidth/(e.globals.labels.length+1),r=0;r<n.length;r++){var s=n[r].childNodes;e.config.xaxis.labels.trim&&"datetime"!==e.config.xaxis.type&&Array.prototype.forEach.call(s,function(e){t.placeTextWithEllipsis(e,e.textContent,i)})}}();if(r.length>0){var c=r[r.length-1].getBBox(),h=r[0].getBBox();c.x<-20&&r[r.length-1].parentNode.removeChild(r[r.length-1]),h.x+h.width>e.globals.gridWidth&&!e.globals.isBarHorizontal&&r[0].parentNode.removeChild(r[0]);for(var d=0;d<s.length;d++)t.placeTextWithEllipsis(s[d],s[d].textContent,e.config.yaxis[0].labels.maxWidth-(e.config.yaxis[0].title.text?2*parseFloat(e.config.yaxis[0].title.style.fontSize):0)-15)}}}]),e}(),en=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w;var i=this.w;this.xaxisLabels=i.globals.labels.slice(),this.axesUtils=new Pi(t),this.isRangeBar=i.globals.seriesRange.length&&i.globals.isBarHorizontal,i.globals.timescaleLabels.length>0&&(this.xaxisLabels=i.globals.timescaleLabels.slice())}return a(e,[{key:"drawGridArea",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.w,i=new Ai(this.ctx);e||(e=i.group({class:"apexcharts-grid"}));var n=i.drawLine(t.globals.padHorizontal,1,t.globals.padHorizontal,t.globals.gridHeight,"transparent"),r=i.drawLine(t.globals.padHorizontal,t.globals.gridHeight,t.globals.gridWidth,t.globals.gridHeight,"transparent");return e.add(r),e.add(n),e}},{key:"drawGrid",value:function(){if(this.w.globals.axisCharts){var e=this.renderGrid();return this.drawGridArea(e.el),e}return null}},{key:"createGridMask",value:function(){var e=this.w,t=e.globals,i=new Ai(this.ctx),n=Array.isArray(e.config.stroke.width)?Math.max.apply(Math,y(e.config.stroke.width)):e.config.stroke.width,r=function(e){var i=document.createElementNS(t.SVGNS,"clipPath");return i.setAttribute("id",e),i};t.dom.elGridRectMask=r("gridRectMask".concat(t.cuid)),t.dom.elGridRectBarMask=r("gridRectBarMask".concat(t.cuid)),t.dom.elGridRectMarkerMask=r("gridRectMarkerMask".concat(t.cuid)),t.dom.elForecastMask=r("forecastMask".concat(t.cuid)),t.dom.elNonForecastMask=r("nonForecastMask".concat(t.cuid));var s=0,o=0;(["bar","rangeBar","candlestick","boxPlot"].includes(e.config.chart.type)||e.globals.comboBarCount>0)&&e.globals.isXNumeric&&!e.globals.isBarHorizontal&&(s=Math.max(e.config.grid.padding.left,t.barPadForNumericAxis),o=Math.max(e.config.grid.padding.right,t.barPadForNumericAxis)),t.dom.elGridRect=i.drawRect(-n/2-2,-n/2-2,t.gridWidth+n+4,t.gridHeight+n+4,0,"#fff"),t.dom.elGridRectBar=i.drawRect(-n/2-s-2,-n/2-2,t.gridWidth+n+o+s+4,t.gridHeight+n+4,0,"#fff");var a=e.globals.markers.largestSize;t.dom.elGridRectMarker=i.drawRect(Math.min(-n/2-s-2,-a),-a,t.gridWidth+Math.max(n+o+s+4,2*a),t.gridHeight+2*a,0,"#fff"),t.dom.elGridRectMask.appendChild(t.dom.elGridRect.node),t.dom.elGridRectBarMask.appendChild(t.dom.elGridRectBar.node),t.dom.elGridRectMarkerMask.appendChild(t.dom.elGridRectMarker.node);var l=t.dom.baseEl.querySelector("defs");l.appendChild(t.dom.elGridRectMask),l.appendChild(t.dom.elGridRectBarMask),l.appendChild(t.dom.elGridRectMarkerMask),l.appendChild(t.dom.elForecastMask),l.appendChild(t.dom.elNonForecastMask)}},{key:"_drawGridLines",value:function(e){var t=e.i,i=e.x1,n=e.y1,r=e.x2,s=e.y2,o=e.xCount,a=e.parent,l=this.w;if(!(0===t&&l.globals.skipFirstTimelinelabel||t===o-1&&l.globals.skipLastTimelinelabel&&!l.config.xaxis.labels.formatter||"radar"===l.config.chart.type)){l.config.grid.xaxis.lines.show&&this._drawGridLine({i:t,x1:i,y1:n,x2:r,y2:s,xCount:o,parent:a});var c=0;if(l.globals.hasXaxisGroups&&"between"===l.config.xaxis.tickPlacement){var h=l.globals.groups;if(h){for(var d=0,u=0;d<t&&u<h.length;u++)d+=h[u].cols;d===t&&(c=.6*l.globals.xAxisLabelsHeight)}}new Qi(this.ctx).drawXaxisTicks(i,c,l.globals.dom.elGraphical)}}},{key:"_drawGridLine",value:function(e){var t=e.i,i=e.x1,n=e.y1,r=e.x2,s=e.y2,o=e.xCount,a=e.parent,l=this.w,c=a.node.classList.contains("apexcharts-gridlines-horizontal"),h=l.globals.barPadForNumericAxis,d=0===n&&0===s||0===i&&0===r||n===l.globals.gridHeight&&s===l.globals.gridHeight||l.globals.isBarHorizontal&&(0===t||t===o-1),u=new Ai(this).drawLine(i-(c?h:0),n,r+(c?h:0),s,l.config.grid.borderColor,l.config.grid.strokeDashArray);u.node.classList.add("apexcharts-gridline"),d&&l.config.grid.show?this.elGridBorders.add(u):a.add(u)}},{key:"_drawGridBandRect",value:function(e){var t=e.c,i=e.x1,n=e.y1,r=e.x2,s=e.y2,o=e.type,a=this.w,l=new Ai(this.ctx),c=a.globals.barPadForNumericAxis,h=a.config.grid[o].colors[t],d=l.drawRect(i-("row"===o?c:0),n,r+("row"===o?2*c:0),s,0,h,a.config.grid[o].opacity);this.elg.add(d),d.attr("clip-path","url(#gridRectMask".concat(a.globals.cuid,")")),d.node.classList.add("apexcharts-grid-".concat(o))}},{key:"_drawXYLines",value:function(e){var t=this,i=e.xCount,n=e.tickAmount,r=this.w;if(r.config.grid.xaxis.lines.show||r.config.xaxis.axisTicks.show){var s,o=r.globals.padHorizontal,a=r.globals.gridHeight;r.globals.timescaleLabels.length?function(e){for(var n=e.xC,r=e.x1,s=e.y1,o=e.x2,a=e.y2,l=0;l<n;l++)r=t.xaxisLabels[l].position,o=t.xaxisLabels[l].position,t._drawGridLines({i:l,x1:r,y1:s,x2:o,y2:a,xCount:i,parent:t.elgridLinesV})}({xC:i,x1:o,y1:0,x2:s,y2:a}):(r.globals.isXNumeric&&(i=r.globals.xAxisScale.result.length),function(e){for(var n=e.xC,s=e.x1,o=e.y1,a=e.x2,l=e.y2,c=0;c<n+(r.globals.isXNumeric?0:1);c++)0===c&&1===n&&1===r.globals.dataPoints&&(a=s=r.globals.gridWidth/2),t._drawGridLines({i:c,x1:s,y1:o,x2:a,y2:l,xCount:i,parent:t.elgridLinesV}),a=s+=r.globals.gridWidth/(r.globals.isXNumeric?n-1:n)}({xC:i,x1:o,y1:0,x2:s,y2:a}))}if(r.config.grid.yaxis.lines.show){var l=0,c=0,h=r.globals.gridWidth,d=n+1;this.isRangeBar&&(d=r.globals.labels.length);for(var u=0;u<d+(this.isRangeBar?1:0);u++)this._drawGridLine({i:u,xCount:d+(this.isRangeBar?1:0),x1:0,y1:l,x2:h,y2:c,parent:this.elgridLinesH}),c=l+=r.globals.gridHeight/(this.isRangeBar?d:n)}}},{key:"_drawInvertedXYLines",value:function(e){var t=e.xCount,i=this.w;if(i.config.grid.xaxis.lines.show||i.config.xaxis.axisTicks.show)for(var n,r=i.globals.padHorizontal,s=i.globals.gridHeight,o=0;o<t+1;o++)i.config.grid.xaxis.lines.show&&this._drawGridLine({i:o,xCount:t+1,x1:r,y1:0,x2:n,y2:s,parent:this.elgridLinesV}),new Qi(this.ctx).drawXaxisTicks(r,0,i.globals.dom.elGraphical),n=r+=i.globals.gridWidth/t;if(i.config.grid.yaxis.lines.show)for(var a=0,l=0,c=i.globals.gridWidth,h=0;h<i.globals.dataPoints+1;h++)this._drawGridLine({i:h,xCount:i.globals.dataPoints+1,x1:0,y1:a,x2:c,y2:l,parent:this.elgridLinesH}),l=a+=i.globals.gridHeight/i.globals.dataPoints}},{key:"renderGrid",value:function(){var e=this.w,t=e.globals,i=new Ai(this.ctx);this.elg=i.group({class:"apexcharts-grid"}),this.elgridLinesH=i.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=i.group({class:"apexcharts-gridlines-vertical"}),this.elGridBorders=i.group({class:"apexcharts-grid-borders"}),this.elg.add(this.elgridLinesH),this.elg.add(this.elgridLinesV),e.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide(),this.elGridBorders.hide());for(var n=0;n<t.seriesYAxisMap.length&&t.ignoreYAxisIndexes.includes(n);)n++;n===t.seriesYAxisMap.length&&(n=0);var r,s,o,a,l=t.yAxisScale[n].result.length-1;return!t.isBarHorizontal||this.isRangeBar?(r=this.xaxisLabels.length,this.isRangeBar&&(l=t.labels.length,e.config.xaxis.tickAmount&&e.config.xaxis.labels.formatter&&(r=e.config.xaxis.tickAmount),(null===(s=t.yAxisScale)||void 0===s||null===(o=s[n])||void 0===o||null===(a=o.result)||void 0===a?void 0:a.length)>0&&"datetime"!==e.config.xaxis.type&&(r=t.yAxisScale[n].result.length-1)),this._drawXYLines({xCount:r,tickAmount:l})):(r=l,l=t.xTickAmount,this._drawInvertedXYLines({xCount:r,tickAmount:l})),this.drawGridBands(r,l),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:t.gridWidth/r}}},{key:"drawGridBands",value:function(e,t){var i,n,r=this,s=this.w;if((null===(i=s.config.grid.row.colors)||void 0===i?void 0:i.length)>0&&function(e,i,n,o,a,l){for(var c=0,h=0;c<i;c++,h++)h>=s.config.grid.row.colors.length&&(h=0),r._drawGridBandRect({c:h,x1:0,y1:o,x2:a,y2:l,type:"row"}),o+=s.globals.gridHeight/t}(0,t,0,0,s.globals.gridWidth,s.globals.gridHeight/t),(null===(n=s.config.grid.column.colors)||void 0===n?void 0:n.length)>0){var o=s.globals.isBarHorizontal||"on"!==s.config.xaxis.tickPlacement||"category"!==s.config.xaxis.type&&!s.config.xaxis.convertedCatToNumeric?e:e-1;s.globals.isXNumeric&&(o=s.globals.xAxisScale.result.length-1);for(var a=s.globals.padHorizontal,l=s.globals.padHorizontal+s.globals.gridWidth/o,c=s.globals.gridHeight,h=0,d=0;h<e;h++,d++){var u;d>=s.config.grid.column.colors.length&&(d=0),"datetime"===s.config.xaxis.type&&(a=this.xaxisLabels[h].position,l=((null===(u=this.xaxisLabels[h+1])||void 0===u?void 0:u.position)||s.globals.gridWidth)-this.xaxisLabels[h].position),this._drawGridBandRect({c:d,x1:a,y1:0,x2:l,y2:c,type:"column"}),a+=s.globals.gridWidth/o}}}}]),e}(),tn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.coreUtils=new Ci(this.ctx)}return a(e,[{key:"niceScale",value:function(e,t){var i,n,r,s,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=1e-11,l=this.w,c=l.globals;c.isBarHorizontal?(i=l.config.xaxis,n=Math.max((c.svgWidth-100)/25,2)):(i=l.config.yaxis[o],n=Math.max((c.svgHeight-100)/15,2)),w.isNumber(n)||(n=10),r=void 0!==i.min&&null!==i.min,s=void 0!==i.max&&null!==i.min;var h=void 0!==i.stepSize&&null!==i.stepSize,d=void 0!==i.tickAmount&&null!==i.tickAmount,u=d?i.tickAmount:c.niceScaleDefaultTicks[Math.min(Math.round(n/2),c.niceScaleDefaultTicks.length-1)];if(c.isMultipleYAxis&&!d&&c.multiAxisTickAmount>0&&(u=c.multiAxisTickAmount,d=!0),u="dataPoints"===u?c.dataPoints-1:Math.abs(Math.round(u)),(e===Number.MIN_VALUE&&0===t||!w.isNumber(e)&&!w.isNumber(t)||e===Number.MIN_VALUE&&t===-Number.MAX_VALUE)&&(e=w.isNumber(i.min)?i.min:0,t=w.isNumber(i.max)?i.max:e+u,c.allSeriesCollapsed=!1),e>t){console.warn("axis.min cannot be greater than axis.max: swapping min and max");var f=t;t=e,e=f}else e===t&&(e=0===e?0:e-1,t=0===t?2:t+1);var p=[];u<1&&(u=1);var m=u,g=Math.abs(t-e);!r&&e>0&&e/g<.15&&(e=0,r=!0),!s&&t<0&&-t/g<.15&&(t=0,s=!0);var _=(g=Math.abs(t-e))/m,y=_,v=Math.floor(Math.log10(y)),x=Math.pow(10,v),b=Math.ceil(y/x);if(_=y=(b=c.niceScaleAllowedMagMsd[0===c.yValueDecimal?0:1][b])*x,c.isBarHorizontal&&i.stepSize&&"datetime"!==i.type?(_=i.stepSize,h=!0):h&&(_=i.stepSize),h&&i.forceNiceScale){var S=Math.floor(Math.log10(_));_*=Math.pow(10,v-S)}if(r&&s){var T=g/m;if(d)if(h)if(0!=w.mod(g,_)){var k=w.getGCD(_,T);_=T/k<10?k:T}else 0==w.mod(_,T)?_=T:(T=_,d=!1);else _=T;else if(h)0==w.mod(g,_)?T=_:_=T;else if(0==w.mod(g,_))T=_;else{T=g/(m=Math.ceil(g/_));var M=w.getGCD(g,_);g/M<n&&(T=M),_=T}m=Math.round(g/_)}else{if(r||s){if(s)if(d)e=t-_*m;else{var A=e;e=_*Math.floor(e/_),Math.abs(t-e)/w.getGCD(g,_)>n&&(e=t-_*u,e+=_*Math.floor((A-e)/_))}else if(r)if(d)t=e+_*m;else{var C=t;t=_*Math.ceil(t/_),Math.abs(t-e)/w.getGCD(g,_)>n&&(t=e+_*u,t+=_*Math.ceil((C-t)/_))}}else if(c.isMultipleYAxis&&d){var D=_*Math.floor(e/_),L=D+_*m;L<t&&(_*=2),L=t,t=(e=D)+_*m,g=Math.abs(t-e),e>0&&e<Math.abs(L-t)&&(e=0,t=_*m),t<0&&-t<Math.abs(D-e)&&(t=0,e=-_*m)}else e=_*Math.floor(e/_),t=_*Math.ceil(t/_);g=Math.abs(t-e),_=w.getGCD(g,_),m=Math.round(g/_)}if(d||r||s||(m=Math.ceil((g-a)/(_+a)))>16&&w.getPrimeFactors(m).length<2&&m++,!d&&i.forceNiceScale&&0===c.yValueDecimal&&m>g&&(m=g,_=Math.round(g/m)),m>n&&(!d&&!h||i.forceNiceScale)){var E=w.getPrimeFactors(m),I=E.length-1,P=m;e:for(var R=0;R<I;R++)for(var O=0;O<=I-R;O++){for(var z=Math.min(O+R,I),F=P,N=1,Y=O;Y<=z;Y++)N*=E[Y];if((F/=N)<n){P=F;break e}}_=P===m?g:g/P,m=Math.round(g/_)}c.isMultipleYAxis&&0==c.multiAxisTickAmount&&c.ignoreYAxisIndexes.indexOf(o)<0&&(c.multiAxisTickAmount=m);var B=e-_,H=_*a;do{B+=_,p.push(w.stripNumber(B,7))}while(t-B>H);return{result:p,niceMin:p[0],niceMax:p[p.length-1]}}},{key:"linearScale",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,s=Math.abs(t-e),o=[];if(e===t)return{result:o=[e],niceMin:o[0],niceMax:o[o.length-1]};"dataPoints"===(i=this._adjustTicksForSmallRange(i,n,s))&&(i=this.w.globals.dataPoints-1),r||(r=s/i),r=Math.round(100*(r+Number.EPSILON))/100,i===Number.MAX_VALUE&&(i=5,r=1);for(var a=e;i>=0;)o.push(a),a=w.preciseAddition(a,r),i-=1;return{result:o,niceMin:o[0],niceMax:o[o.length-1]}}},{key:"logarithmicScaleNice",value:function(e,t,i){t<=0&&(t=Math.max(e,i)),e<=0&&(e=Math.min(t,i));for(var n=[],r=Math.ceil(Math.log(t)/Math.log(i)+1),s=Math.floor(Math.log(e)/Math.log(i));s<r;s++)n.push(Math.pow(i,s));return{result:n,niceMin:n[0],niceMax:n[n.length-1]}}},{key:"logarithmicScale",value:function(e,t,i){t<=0&&(t=Math.max(e,i)),e<=0&&(e=Math.min(t,i));for(var n=[],r=Math.log(t)/Math.log(i),s=Math.log(e)/Math.log(i),o=r-s,a=Math.round(o),l=o/a,c=0,h=s;c<a;c++,h+=l)n.push(Math.pow(i,h));return n.push(Math.pow(i,r)),{result:n,niceMin:e,niceMax:t}}},{key:"_adjustTicksForSmallRange",value:function(e,t,i){var n=e;if(void 0!==t&&this.w.config.yaxis[t].labels.formatter&&void 0===this.w.config.yaxis[t].tickAmount){var r=Number(this.w.config.yaxis[t].labels.formatter(1));w.isNumber(r)&&0===this.w.globals.yValueDecimal&&(n=Math.ceil(i))}return n<e?n:e}},{key:"setYScaleForIndex",value:function(e,t,i){var n=this.w.globals,r=this.w.config,s=n.isBarHorizontal?r.xaxis:r.yaxis[e];void 0===n.yAxisScale[e]&&(n.yAxisScale[e]=[]);var o=Math.abs(i-t);s.logarithmic&&o<=5&&(n.invalidLogScale=!0),s.logarithmic&&o>5?(n.allSeriesCollapsed=!1,n.yAxisScale[e]=s.forceNiceScale?this.logarithmicScaleNice(t,i,s.logBase):this.logarithmicScale(t,i,s.logBase)):i!==-Number.MAX_VALUE&&w.isNumber(i)&&t!==Number.MAX_VALUE&&w.isNumber(t)?(n.allSeriesCollapsed=!1,n.yAxisScale[e]=this.niceScale(t,i,e)):n.yAxisScale[e]=this.niceScale(Number.MIN_VALUE,0,e)}},{key:"setXScale",value:function(e,t){var i=this.w,n=i.globals;if(t!==-Number.MAX_VALUE&&w.isNumber(t)){var r=n.xTickAmount;n.xAxisScale=this.linearScale(e,t,r,0,void 0===i.config.xaxis.max?i.config.xaxis.stepSize:void 0)}else n.xAxisScale=this.linearScale(0,10,10);return n.xAxisScale}},{key:"scaleMultipleYAxes",value:function(){var e=this,t=this.w.config,i=this.w.globals;this.coreUtils.setSeriesYAxisMappings();var n=i.seriesYAxisMap,r=i.minYArr,s=i.maxYArr;i.allSeriesCollapsed=!0,i.barGroups=[],n.forEach(function(n,o){var a=[];n.forEach(function(e){var i,n=null===(i=t.series[e])||void 0===i?void 0:i.group;a.indexOf(n)<0&&a.push(n)}),n.length>0?function(){var l,c,h=Number.MAX_VALUE,d=-Number.MAX_VALUE,u=h,f=d;if(t.chart.stacked)!function(){var e=new Array(i.dataPoints).fill(0),r=[],s=[],p=[];a.forEach(function(){r.push(e.map(function(){return Number.MIN_VALUE})),s.push(e.map(function(){return Number.MIN_VALUE})),p.push(e.map(function(){return Number.MIN_VALUE}))});for(var m=function(e){!l&&t.series[n[e]].type&&(l=t.series[n[e]].type);var h=n[e];c=t.series[h].group?t.series[h].group:"axis-".concat(o),!(i.collapsedSeriesIndices.indexOf(h)<0&&i.ancillaryCollapsedSeriesIndices.indexOf(h)<0)||(i.allSeriesCollapsed=!1,a.forEach(function(e,n){if(t.series[h].group===e)for(var o=0;o<i.series[h].length;o++){var a=i.series[h][o];a>=0?s[n][o]+=a:p[n][o]+=a,r[n][o]+=a,u=Math.min(u,a),f=Math.max(f,a)}})),"bar"!==l&&"column"!==l||i.barGroups.push(c)},g=0;g<n.length;g++)m(g);l||(l=t.chart.type),"bar"===l||"column"===l?a.forEach(function(e,t){h=Math.min(h,Math.min.apply(null,p[t])),d=Math.max(d,Math.max.apply(null,s[t]))}):(a.forEach(function(e,t){u=Math.min(u,Math.min.apply(null,r[t])),f=Math.max(f,Math.max.apply(null,r[t]))}),h=u,d=f),h===Number.MIN_VALUE&&d===Number.MIN_VALUE&&(d=-Number.MAX_VALUE)}();else for(var p=0;p<n.length;p++){var m=n[p];h=Math.min(h,r[m]),d=Math.max(d,s[m]),!(i.collapsedSeriesIndices.indexOf(m)<0&&i.ancillaryCollapsedSeriesIndices.indexOf(m)<0)||(i.allSeriesCollapsed=!1)}void 0!==t.yaxis[o].min&&(h="function"==typeof t.yaxis[o].min?t.yaxis[o].min(h):t.yaxis[o].min),void 0!==t.yaxis[o].max&&(d="function"==typeof t.yaxis[o].max?t.yaxis[o].max(d):t.yaxis[o].max),i.barGroups=i.barGroups.filter(function(e,t,i){return i.indexOf(e)===t}),e.setYScaleForIndex(o,h,d),n.forEach(function(e){r[e]=i.yAxisScale[o].niceMin,s[e]=i.yAxisScale[o].niceMax})}():e.setYScaleForIndex(o,0,-Number.MAX_VALUE)})}}]),e}(),nn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.scales=new tn(t)}return a(e,[{key:"init",value:function(){this.setYRange(),this.setXRange(),this.setZRange()}},{key:"getMinYMaxY",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-Number.MAX_VALUE,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=this.w.config,s=this.w.globals,o=-Number.MAX_VALUE,a=Number.MIN_VALUE;null===n&&(n=e+1);var l=s.series,c=l,h=l;"candlestick"===r.chart.type?(c=s.seriesCandleL,h=s.seriesCandleH):"boxPlot"===r.chart.type?(c=s.seriesCandleO,h=s.seriesCandleC):s.isRangeData&&(c=s.seriesRangeStart,h=s.seriesRangeEnd);var d=!1;if(s.seriesX.length>=n){var u,f=null===(u=s.brushSource)||void 0===u?void 0:u.w.config.chart.brush;(r.chart.zoom.enabled&&r.chart.zoom.autoScaleYaxis||null!=f&&f.enabled&&null!=f&&f.autoScaleYaxis)&&(d=!0)}for(var p=e;p<n;p++){s.dataPoints=Math.max(s.dataPoints,l[p].length);var m=r.series[p].type;s.categoryLabels.length&&(s.dataPoints=s.categoryLabels.filter(function(e){return void 0!==e}).length),s.labels.length&&"datetime"!==r.xaxis.type&&0!==s.series.reduce(function(e,t){return e+t.length},0)&&(s.dataPoints=Math.max(s.dataPoints,s.labels.length));var g=0,_=l[p].length-1;if(d){if(r.xaxis.min)for(;g<_&&s.seriesX[p][g]<r.xaxis.min;g++);if(r.xaxis.max)for(;_>g&&s.seriesX[p][_]>r.xaxis.max;_--);}for(var y=g;y<=_&&y<s.series[p].length;y++){var v=l[p][y];if(null!==v&&w.isNumber(v)){var x,b,S,T;switch(void 0!==(null===(x=h[p])||void 0===x?void 0:x[y])&&(o=Math.max(o,h[p][y]),t=Math.min(t,h[p][y])),void 0!==(null===(b=c[p])||void 0===b?void 0:b[y])&&(t=Math.min(t,c[p][y]),i=Math.max(i,c[p][y])),m){case"candlestick":void 0!==s.seriesCandleC[p][y]&&(o=Math.max(o,s.seriesCandleH[p][y]),t=Math.min(t,s.seriesCandleL[p][y]));break;case"boxPlot":void 0!==s.seriesCandleC[p][y]&&(o=Math.max(o,s.seriesCandleC[p][y]),t=Math.min(t,s.seriesCandleO[p][y]))}m&&"candlestick"!==m&&"boxPlot"!==m&&"rangeArea"!==m&&"rangeBar"!==m&&(o=Math.max(o,s.series[p][y]),t=Math.min(t,s.series[p][y])),s.seriesGoals[p]&&s.seriesGoals[p][y]&&Array.isArray(s.seriesGoals[p][y])&&s.seriesGoals[p][y].forEach(function(e){o=Math.max(o,e.value),t=Math.min(t,e.value)}),i=o,v=w.noExponents(v),w.isFloat(v)&&(s.yValueDecimal=Math.max(s.yValueDecimal,v.toString().split(".")[1].length)),a>(null===(S=c[p])||void 0===S?void 0:S[y])&&(null===(T=c[p])||void 0===T?void 0:T[y])<0&&(a=c[p][y])}else s.hasNullValues=!0}"bar"!==m&&"column"!==m||(a<0&&o<0&&(o=0,i=Math.max(i,0)),a===Number.MIN_VALUE&&(a=0,t=Math.min(t,0)))}return"rangeBar"===r.chart.type&&s.seriesRangeStart.length&&s.isBarHorizontal&&(a=t),"bar"===r.chart.type&&(a<0&&o<0&&(o=0),a===Number.MIN_VALUE&&(a=0)),{minY:a,maxY:o,lowestY:t,highestY:i}}},{key:"setYRange",value:function(){var e=this.w.globals,t=this.w.config;e.maxY=-Number.MAX_VALUE,e.minY=Number.MIN_VALUE;var i,n=Number.MAX_VALUE;if(e.isMultipleYAxis){n=Number.MAX_VALUE;for(var r=0;r<e.series.length;r++)i=this.getMinYMaxY(r),e.minYArr[r]=i.lowestY,e.maxYArr[r]=i.highestY,n=Math.min(n,i.lowestY)}return i=this.getMinYMaxY(0,n,null,e.series.length),"bar"===t.chart.type?(e.minY=i.minY,e.maxY=i.maxY):(e.minY=i.lowestY,e.maxY=i.highestY),n=i.lowestY,t.chart.stacked&&this._setStackedMinMax(),"line"===t.chart.type||"area"===t.chart.type||"scatter"===t.chart.type||"candlestick"===t.chart.type||"boxPlot"===t.chart.type||"rangeBar"===t.chart.type&&!e.isBarHorizontal?e.minY===Number.MIN_VALUE&&n!==-Number.MAX_VALUE&&n!==e.maxY&&(e.minY=n):e.minY=e.minY!==Number.MIN_VALUE?Math.min(i.minY,e.minY):i.minY,t.yaxis.forEach(function(t,i){void 0!==t.max&&("number"==typeof t.max?e.maxYArr[i]=t.max:"function"==typeof t.max&&(e.maxYArr[i]=t.max(e.isMultipleYAxis?e.maxYArr[i]:e.maxY)),e.maxY=e.maxYArr[i]),void 0!==t.min&&("number"==typeof t.min?e.minYArr[i]=t.min:"function"==typeof t.min&&(e.minYArr[i]=t.min(e.isMultipleYAxis?e.minYArr[i]===Number.MIN_VALUE?0:e.minYArr[i]:e.minY)),e.minY=e.minYArr[i])}),e.isBarHorizontal&&["min","max"].forEach(function(i){void 0!==t.xaxis[i]&&"number"==typeof t.xaxis[i]&&("min"===i?e.minY=t.xaxis[i]:e.maxY=t.xaxis[i])}),e.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),e.minY=n):(this.scales.setYScaleForIndex(0,e.minY,e.maxY),e.minY=e.yAxisScale[0].niceMin,e.maxY=e.yAxisScale[0].niceMax,e.minYArr[0]=e.minY,e.maxYArr[0]=e.maxY),e.barGroups=[],e.lineGroups=[],e.areaGroups=[],t.series.forEach(function(i){switch(i.type||t.chart.type){case"bar":case"column":e.barGroups.push(i.group);break;case"line":e.lineGroups.push(i.group);break;case"area":e.areaGroups.push(i.group)}}),e.barGroups=e.barGroups.filter(function(e,t,i){return i.indexOf(e)===t}),e.lineGroups=e.lineGroups.filter(function(e,t,i){return i.indexOf(e)===t}),e.areaGroups=e.areaGroups.filter(function(e,t,i){return i.indexOf(e)===t}),{minY:e.minY,maxY:e.maxY,minYArr:e.minYArr,maxYArr:e.maxYArr,yAxisScale:e.yAxisScale}}},{key:"setXRange",value:function(){var e=this.w.globals,t=this.w.config,i="numeric"===t.xaxis.type||"datetime"===t.xaxis.type||"category"===t.xaxis.type&&!e.noLabelsProvided||e.noLabelsProvided||e.isXNumeric;if(e.isXNumeric&&function(){for(var t=0;t<e.series.length;t++)if(e.labels[t])for(var i=0;i<e.labels[t].length;i++)null!==e.labels[t][i]&&w.isNumber(e.labels[t][i])&&(e.maxX=Math.max(e.maxX,e.labels[t][i]),e.initialMaxX=Math.max(e.maxX,e.labels[t][i]),e.minX=Math.min(e.minX,e.labels[t][i]),e.initialMinX=Math.min(e.minX,e.labels[t][i]))}(),e.noLabelsProvided&&0===t.xaxis.categories.length&&(e.maxX=e.labels[e.labels.length-1],e.initialMaxX=e.labels[e.labels.length-1],e.minX=1,e.initialMinX=1),e.isXNumeric||e.noLabelsProvided||e.dataFormatXNumeric){var n=10;if(void 0===t.xaxis.tickAmount)n=Math.round(e.svgWidth/150),"numeric"===t.xaxis.type&&e.dataPoints<30&&(n=e.dataPoints-1),n>e.dataPoints&&0!==e.dataPoints&&(n=e.dataPoints-1);else if("dataPoints"===t.xaxis.tickAmount){if(e.series.length>1&&(n=e.series[e.maxValsInArrayIndex].length-1),e.isXNumeric){var r=Math.round(e.maxX-e.minX);r<30&&(n=r)}}else n=t.xaxis.tickAmount;if(e.xTickAmount=n,void 0!==t.xaxis.max&&"number"==typeof t.xaxis.max&&(e.maxX=t.xaxis.max),void 0!==t.xaxis.min&&"number"==typeof t.xaxis.min&&(e.minX=t.xaxis.min),void 0!==t.xaxis.range&&(e.minX=e.maxX-t.xaxis.range),e.minX!==Number.MAX_VALUE&&e.maxX!==-Number.MAX_VALUE)if(t.xaxis.convertedCatToNumeric&&!e.dataFormatXNumeric){for(var s=[],o=e.minX-1;o<e.maxX;o++)s.push(o+1);e.xAxisScale={result:s,niceMin:s[0],niceMax:s[s.length-1]}}else e.xAxisScale=this.scales.setXScale(e.minX,e.maxX);else e.xAxisScale=this.scales.linearScale(0,n,n,0,t.xaxis.stepSize),e.noLabelsProvided&&e.labels.length>0&&(e.xAxisScale=this.scales.linearScale(1,e.labels.length,n-1,0,t.xaxis.stepSize),e.seriesX=e.labels.slice());i&&(e.labels=e.xAxisScale.result.slice())}return e.isBarHorizontal&&e.labels.length&&(e.xTickAmount=e.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:e.minX,maxX:e.maxX}}},{key:"setZRange",value:function(){var e=this.w.globals;if(e.isDataXYZ)for(var t=0;t<e.series.length;t++)if(void 0!==e.seriesZ[t])for(var i=0;i<e.seriesZ[t].length;i++)null!==e.seriesZ[t][i]&&w.isNumber(e.seriesZ[t][i])&&(e.maxZ=Math.max(e.maxZ,e.seriesZ[t][i]),e.minZ=Math.min(e.minZ,e.seriesZ[t][i]))}},{key:"_handleSingleDataPoint",value:function(){var e=this.w.globals,t=this.w.config;if(e.minX===e.maxX){var i=new Ei(this.ctx);if("datetime"===t.xaxis.type){var n=i.getDate(e.minX);t.xaxis.labels.datetimeUTC?n.setUTCDate(n.getUTCDate()-2):n.setDate(n.getDate()-2),e.minX=new Date(n).getTime();var r=i.getDate(e.maxX);t.xaxis.labels.datetimeUTC?r.setUTCDate(r.getUTCDate()+2):r.setDate(r.getDate()+2),e.maxX=new Date(r).getTime()}else("numeric"===t.xaxis.type||"category"===t.xaxis.type&&!e.noLabelsProvided)&&(e.minX=e.minX-2,e.initialMinX=e.minX,e.maxX=e.maxX+2,e.initialMaxX=e.maxX)}}},{key:"_getMinXDiff",value:function(){var e=this.w.globals;e.isXNumeric&&e.seriesX.forEach(function(t,i){if(t.length){1===t.length&&t.push(e.seriesX[e.maxValsInArrayIndex][e.seriesX[e.maxValsInArrayIndex].length-1]);var n=t.slice();n.sort(function(e,t){return e-t}),n.forEach(function(t,i){if(i>0){var r=t-n[i-1];r>0&&(e.minXDiff=Math.min(r,e.minXDiff))}}),1!==e.dataPoints&&e.minXDiff!==Number.MAX_VALUE||(e.minXDiff=.5)}})}},{key:"_setStackedMinMax",value:function(){var e=this,t=this.w.globals;if(t.series.length){var i=t.seriesGroups;i.length||(i=[this.w.globals.seriesNames.map(function(e){return e})]);var n={},r={};i.forEach(function(i){n[i]=[],r[i]=[],e.w.config.series.map(function(e,n){return i.indexOf(t.seriesNames[n])>-1?n:null}).filter(function(e){return null!==e}).forEach(function(s){for(var o=0;o<t.series[t.maxValsInArrayIndex].length;o++){var a,l,c,h;void 0===n[i][o]&&(n[i][o]=0,r[i][o]=0),(e.w.config.chart.stacked&&!t.comboCharts||e.w.config.chart.stacked&&t.comboCharts&&(!e.w.config.chart.stackOnlyBar||"bar"===(null===(a=e.w.config.series)||void 0===a||null===(l=a[s])||void 0===l?void 0:l.type)||"column"===(null===(c=e.w.config.series)||void 0===c||null===(h=c[s])||void 0===h?void 0:h.type)))&&null!==t.series[s][o]&&w.isNumber(t.series[s][o])&&(t.series[s][o]>0?n[i][o]+=parseFloat(t.series[s][o])+1e-4:r[i][o]+=parseFloat(t.series[s][o]))}})}),Object.entries(n).forEach(function(e){var i=_(e,1)[0];n[i].forEach(function(e,s){t.maxY=Math.max(t.maxY,n[i][s]),t.minY=Math.min(t.minY,r[i][s])})})}}}]),e}(),rn=function(){function e(t,i){s(this,e),this.ctx=t,this.elgrid=i,this.w=t.w;var n=this.w;this.xaxisFontSize=n.config.xaxis.labels.style.fontSize,this.axisFontFamily=n.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=n.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal="bar"===n.config.chart.type&&n.config.plotOptions.bar.horizontal,this.xAxisoffX="bottom"===n.config.xaxis.position?n.globals.gridHeight:0,this.drawnLabels=[],this.axesUtils=new Pi(t)}return a(e,[{key:"drawYaxis",value:function(e){var t=this.w,i=new Ai(this.ctx),n=t.config.yaxis[e].labels.style,r=n.fontSize,s=n.fontFamily,o=n.fontWeight,a=i.group({class:"apexcharts-yaxis",rel:e,transform:"translate(".concat(t.globals.translateYAxisX[e],", 0)")});if(this.axesUtils.isYAxisHidden(e))return a;var l=i.group({class:"apexcharts-yaxis-texts-g"});a.add(l);var c=t.globals.yAxisScale[e].result.length-1,h=t.globals.gridHeight/c,d=t.globals.yLabelFormatters[e],u=this.axesUtils.checkForReversedLabels(e,t.globals.yAxisScale[e].result.slice());if(t.config.yaxis[e].labels.show){var f=t.globals.translateY+t.config.yaxis[e].labels.offsetY;t.globals.isBarHorizontal?f=0:"heatmap"===t.config.chart.type&&(f-=h/2),f+=parseInt(r,10)/3;for(var p=c;p>=0;p--){var m=d(u[p],p,t),g=t.config.yaxis[e].labels.padding;t.config.yaxis[e].opposite&&0!==t.config.yaxis.length&&(g*=-1);var _=this.getTextAnchor(t.config.yaxis[e].labels.align,t.config.yaxis[e].opposite),y=this.axesUtils.getYAxisForeColor(n.colors,e),v=Array.isArray(y)?y[p]:y,x=w.listToArray(t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(e,"'] .apexcharts-yaxis-label tspan"))).map(function(e){return e.textContent}),b=i.drawText({x:g,y:f,text:x.includes(m)&&!t.config.yaxis[e].labels.showDuplicates?"":m,textAnchor:_,fontSize:r,fontFamily:s,fontWeight:o,maxWidth:t.config.yaxis[e].labels.maxWidth,foreColor:v,isPlainText:!1,cssClass:"apexcharts-yaxis-label ".concat(n.cssClass)});l.add(b),this.addTooltip(b,m),0!==t.config.yaxis[e].labels.rotate&&this.rotateLabel(i,b,firstLabel,t.config.yaxis[e].labels.rotate),f+=h}}return this.addYAxisTitle(i,a,e),this.addAxisBorder(i,a,e,c,h),a}},{key:"getTextAnchor",value:function(e,t){return"left"===e?"start":"center"===e?"middle":"right"===e?"end":t?"start":"end"}},{key:"addTooltip",value:function(e,t){var i=document.createElementNS(this.w.globals.SVGNS,"title");i.textContent=Array.isArray(t)?t.join(" "):t,e.node.appendChild(i)}},{key:"rotateLabel",value:function(e,t,i,n){var r=e.rotateAroundCenter(i.node),s=e.rotateAroundCenter(t.node);t.node.setAttribute("transform","rotate(".concat(n," ").concat(r.x," ").concat(s.y,")"))}},{key:"addYAxisTitle",value:function(e,t,i){var n=this.w;if(void 0!==n.config.yaxis[i].title.text){var r=e.group({class:"apexcharts-yaxis-title"}),s=n.config.yaxis[i].opposite?n.globals.translateYAxisX[i]:0,o=e.drawText({x:s,y:n.globals.gridHeight/2+n.globals.translateY+n.config.yaxis[i].title.offsetY,text:n.config.yaxis[i].title.text,textAnchor:"end",foreColor:n.config.yaxis[i].title.style.color,fontSize:n.config.yaxis[i].title.style.fontSize,fontWeight:n.config.yaxis[i].title.style.fontWeight,fontFamily:n.config.yaxis[i].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text ".concat(n.config.yaxis[i].title.style.cssClass)});r.add(o),t.add(r)}}},{key:"addAxisBorder",value:function(e,t,i,n,r){var s=this.w,o=s.config.yaxis[i].axisBorder,a=31+o.offsetX;if(s.config.yaxis[i].opposite&&(a=-31-o.offsetX),o.show){var l=e.drawLine(a,s.globals.translateY+o.offsetY-2,a,s.globals.gridHeight+s.globals.translateY+o.offsetY+2,o.color,0,o.width);t.add(l)}s.config.yaxis[i].axisTicks.show&&this.axesUtils.drawYAxisTicks(a,n,o,s.config.yaxis[i].axisTicks,i,r,t)}},{key:"drawYaxisInversed",value:function(e){var t=this.w,i=new Ai(this.ctx),n=i.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),r=i.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(t.globals.translateXAxisX,", ").concat(t.globals.translateXAxisY,")")});n.add(r);var s=t.globals.yAxisScale[e].result.length-1,o=t.globals.gridWidth/s+.1,a=o+t.config.xaxis.labels.offsetX,l=t.globals.xLabelFormatter,c=this.axesUtils.checkForReversedLabels(e,t.globals.yAxisScale[e].result.slice()),h=t.globals.timescaleLabels;if(h.length>0&&(this.xaxisLabels=h.slice(),s=(c=h.slice()).length),t.config.xaxis.labels.show)for(var d=h.length?0:s;h.length?d<h.length:d>=0;h.length?d++:d--){var u=l(c[d],d,t),f=t.globals.gridWidth+t.globals.padHorizontal-(a-o+t.config.xaxis.labels.offsetX);if(h.length){var p=this.axesUtils.getLabel(c,h,f,d,this.drawnLabels,this.xaxisFontSize);f=p.x,u=p.text,this.drawnLabels.push(p.text),0===d&&t.globals.skipFirstTimelinelabel&&(u=""),d===c.length-1&&t.globals.skipLastTimelinelabel&&(u="")}var m=i.drawText({x:f,y:this.xAxisoffX+t.config.xaxis.labels.offsetY+30-("top"===t.config.xaxis.position?t.globals.xAxisHeight+t.config.xaxis.axisTicks.height-2:0),text:u,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[e]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,fontWeight:t.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-xaxis-label ".concat(t.config.xaxis.labels.style.cssClass)});r.add(m),m.tspan(u),this.addTooltip(m,u),a+=o}return this.inversedYAxisTitleText(n),this.inversedYAxisBorder(n),n}},{key:"inversedYAxisBorder",value:function(e){var t=this.w,i=new Ai(this.ctx),n=t.config.xaxis.axisBorder;if(n.show){var r=0;"bar"===t.config.chart.type&&t.globals.isXNumeric&&(r-=15);var s=i.drawLine(t.globals.padHorizontal+r+n.offsetX,this.xAxisoffX,t.globals.gridWidth,this.xAxisoffX,n.color,0,n.height);this.elgrid&&this.elgrid.elGridBorders&&t.config.grid.show?this.elgrid.elGridBorders.add(s):e.add(s)}}},{key:"inversedYAxisTitleText",value:function(e){var t=this.w,i=new Ai(this.ctx);if(void 0!==t.config.xaxis.title.text){var n=i.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),r=i.drawText({x:t.globals.gridWidth/2+t.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(t.config.xaxis.title.style.fontSize)+t.config.xaxis.title.offsetY+20,text:t.config.xaxis.title.text,textAnchor:"middle",fontSize:t.config.xaxis.title.style.fontSize,fontFamily:t.config.xaxis.title.style.fontFamily,fontWeight:t.config.xaxis.title.style.fontWeight,foreColor:t.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text ".concat(t.config.xaxis.title.style.cssClass)});n.add(r),e.add(n)}}},{key:"yAxisTitleRotate",value:function(e,t){var i=this.w,n=new Ai(this.ctx),r=i.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(e,"'] .apexcharts-yaxis-texts-g")),s=r?r.getBoundingClientRect():{width:0,height:0},o=i.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(e,"'] .apexcharts-yaxis-title text")),a=o?o.getBoundingClientRect():{width:0,height:0};if(o){var l=this.xPaddingForYAxisTitle(e,s,a,t);o.setAttribute("x",l.xPos-(t?10:0));var c=n.rotateAroundCenter(o);o.setAttribute("transform","rotate(".concat(t?-1*i.config.yaxis[e].title.rotate:i.config.yaxis[e].title.rotate," ").concat(c.x," ").concat(c.y,")"))}}},{key:"xPaddingForYAxisTitle",value:function(e,t,i,n){var r=this.w,s=0,o=10;return void 0===r.config.yaxis[e].title.text||e<0?{xPos:s,padd:0}:(n?s=t.width+r.config.yaxis[e].title.offsetX+i.width/2+o/2:(s=-1*t.width+r.config.yaxis[e].title.offsetX+o/2+i.width/2,r.globals.isBarHorizontal&&(o=25,s=-1*t.width-r.config.yaxis[e].title.offsetX-o)),{xPos:s,padd:o})}},{key:"setYAxisXPosition",value:function(e,t){var i=this.w,n=0,r=0,s=18,o=1;i.config.yaxis.length>1&&(this.multipleYs=!0),i.config.yaxis.forEach(function(a,l){var c=i.globals.ignoreYAxisIndexes.includes(l)||!a.show||a.floating||0===e[l].width,h=e[l].width+t[l].width;a.opposite?i.globals.isBarHorizontal?(r=i.globals.gridWidth+i.globals.translateX-1,i.globals.translateYAxisX[l]=r-a.labels.offsetX):(r=i.globals.gridWidth+i.globals.translateX+o,c||(o+=h+20),i.globals.translateYAxisX[l]=r-a.labels.offsetX+20):(n=i.globals.translateX-s,c||(s+=h+20),i.globals.translateYAxisX[l]=n+a.labels.offsetX)})}},{key:"setYAxisTextAlignments",value:function(){var e=this.w;w.listToArray(e.globals.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach(function(t,i){var n=e.config.yaxis[i];if(n&&!n.floating&&void 0!==n.labels.align){var r=e.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(i,"'] .apexcharts-yaxis-texts-g")),s=w.listToArray(e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(i,"'] .apexcharts-yaxis-label"))),o=r.getBoundingClientRect();s.forEach(function(e){e.setAttribute("text-anchor",n.labels.align)}),"left"!==n.labels.align||n.opposite?"center"===n.labels.align?r.setAttribute("transform","translate(".concat(o.width/2*(n.opposite?1:-1),", 0)")):"right"===n.labels.align&&n.opposite&&r.setAttribute("transform","translate(".concat(o.width,", 0)")):r.setAttribute("transform","translate(-".concat(o.width,", 0)"))}})}}]),e}(),sn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.documentEvent=w.bind(this.documentEvent,this)}return a(e,[{key:"addEventListener",value:function(e,t){var i=this.w;i.globals.events.hasOwnProperty(e)?i.globals.events[e].push(t):i.globals.events[e]=[t]}},{key:"removeEventListener",value:function(e,t){var i=this.w;if(i.globals.events.hasOwnProperty(e)){var n=i.globals.events[e].indexOf(t);-1!==n&&i.globals.events[e].splice(n,1)}}},{key:"fireEvent",value:function(e,t){var i=this.w;if(i.globals.events.hasOwnProperty(e)){t&&t.length||(t=[]);for(var n=i.globals.events[e],r=n.length,s=0;s<r;s++)n[s].apply(null,t)}}},{key:"setupEventHandlers",value:function(){var e=this,t=this.w,i=this.ctx,n=t.globals.dom.baseEl.querySelector(t.globals.chartClass);this.ctx.eventList.forEach(function(e){n.addEventListener(e,function(e){var n=null===e.target.getAttribute("i")&&-1!==t.globals.capturedSeriesIndex?t.globals.capturedSeriesIndex:e.target.getAttribute("i"),r=null===e.target.getAttribute("j")&&-1!==t.globals.capturedDataPointIndex?t.globals.capturedDataPointIndex:e.target.getAttribute("j"),s=Object.assign({},t,{seriesIndex:t.globals.axisCharts?n:0,dataPointIndex:r});"mousemove"===e.type||"touchmove"===e.type?"function"==typeof t.config.chart.events.mouseMove&&t.config.chart.events.mouseMove(e,i,s):"mouseleave"===e.type||"touchleave"===e.type?"function"==typeof t.config.chart.events.mouseLeave&&t.config.chart.events.mouseLeave(e,i,s):("mouseup"===e.type&&1===e.which||"touchend"===e.type)&&("function"==typeof t.config.chart.events.click&&t.config.chart.events.click(e,i,s),i.ctx.events.fireEvent("click",[e,i,s]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(function(i){t.globals.dom.baseEl.addEventListener(i,e.documentEvent,{passive:!0})}),this.ctx.core.setupBrushHandler()}},{key:"documentEvent",value:function(e){var t=this.w,i=e.target.className;if("click"===e.type){var n=t.globals.dom.baseEl.querySelector(".apexcharts-menu");n&&n.classList.contains("apexcharts-menu-open")&&"apexcharts-menu-icon"!==i&&n.classList.remove("apexcharts-menu-open")}t.globals.clientX="touchmove"===e.type?e.touches[0].clientX:e.clientX,t.globals.clientY="touchmove"===e.type?e.touches[0].clientY:e.clientY}}]),e}(),on=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"setCurrentLocaleValues",value:function(e){var t=this.w.config.chart.locales;window.Apex.chart&&window.Apex.chart.locales&&window.Apex.chart.locales.length>0&&(t=this.w.config.chart.locales.concat(window.Apex.chart.locales));var i=t.filter(function(t){return t.name===e})[0];if(!i)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");var n=w.extend(zi,i);this.w.globals.locale=n.options}}]),e}(),an=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"drawAxis",value:function(e,t){var i,n,r=this,s=this.w.globals,o=this.w.config,a=new Qi(this.ctx,t),l=new rn(this.ctx,t);s.axisCharts&&"radar"!==e&&(s.isBarHorizontal?(n=l.drawYaxisInversed(0),i=a.drawXaxisInversed(0),s.dom.elGraphical.add(i),s.dom.elGraphical.add(n)):(i=a.drawXaxis(),s.dom.elGraphical.add(i),o.yaxis.map(function(e,t){if(-1===s.ignoreYAxisIndexes.indexOf(t)&&(n=l.drawYaxis(t),s.dom.Paper.add(n),"back"===r.w.config.grid.position)){var i=s.dom.Paper.children()[1];i.remove(),s.dom.Paper.add(i)}})))}}]),e}(),ln=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"drawXCrosshairs",value:function(){var e=this.w,t=new Ai(this.ctx),i=new Mi(this.ctx),n=e.config.xaxis.crosshairs.fill.gradient,r=e.config.xaxis.crosshairs.dropShadow,s=e.config.xaxis.crosshairs.fill.type,o=n.colorFrom,a=n.colorTo,l=n.opacityFrom,c=n.opacityTo,h=n.stops,d=r.enabled,u=r.left,f=r.top,p=r.blur,m=r.color,g=r.opacity,_=e.config.xaxis.crosshairs.fill.color;if(e.config.xaxis.crosshairs.show){"gradient"===s&&(_=t.drawGradient("vertical",o,a,l,c,null,h,null));var y=t.drawRect();1===e.config.xaxis.crosshairs.width&&(y=t.drawLine());var v=e.globals.gridHeight;(!w.isNumber(v)||v<0)&&(v=0);var x=e.config.xaxis.crosshairs.width;(!w.isNumber(x)||x<0)&&(x=0),y.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:v,width:x,height:v,fill:_,filter:"none","fill-opacity":e.config.xaxis.crosshairs.opacity,stroke:e.config.xaxis.crosshairs.stroke.color,"stroke-width":e.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":e.config.xaxis.crosshairs.stroke.dashArray}),d&&(y=i.dropShadow(y,{left:u,top:f,blur:p,color:m,opacity:g})),e.globals.dom.elGraphical.add(y)}}},{key:"drawYCrosshairs",value:function(){var e=this.w,t=new Ai(this.ctx),i=e.config.yaxis[0].crosshairs,n=e.globals.barPadForNumericAxis;if(e.config.yaxis[0].crosshairs.show){var r=t.drawLine(-n,0,e.globals.gridWidth+n,0,i.stroke.color,i.stroke.dashArray,i.stroke.width);r.attr({class:"apexcharts-ycrosshairs"}),e.globals.dom.elGraphical.add(r)}var s=t.drawLine(-n,0,e.globals.gridWidth+n,0,i.stroke.color,0,0);s.attr({class:"apexcharts-ycrosshairs-hidden"}),e.globals.dom.elGraphical.add(s)}}]),e}(),cn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"checkResponsiveConfig",value:function(e){var t=this,i=this.w,n=i.config;if(0!==n.responsive.length){var r=n.responsive.slice();r.sort(function(e,t){return e.breakpoint>t.breakpoint?1:t.breakpoint>e.breakpoint?-1:0}).reverse();var s=new ji({}),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r[0].breakpoint,o=window.innerWidth>0?window.innerWidth:screen.width;if(o>n){var a=w.clone(i.globals.initialConfig);a.series=w.clone(i.config.series);var l=Ci.extendArrayProps(s,a,i);e=w.extend(l,e),e=w.extend(i.config,e),t.overrideResponsiveOptions(e)}else for(var c=0;c<r.length;c++)o<r[c].breakpoint&&(e=Ci.extendArrayProps(s,r[c].options,i),e=w.extend(i.config,e),t.overrideResponsiveOptions(e))};if(e){var a=Ci.extendArrayProps(s,e,i);a=w.extend(i.config,a),o(a=w.extend(a,e))}else o({})}}},{key:"overrideResponsiveOptions",value:function(e){var t=new ji(e).init({responsiveOverride:!0});this.w.config=t}}]),e}(),hn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed()}return a(e,[{key:"checkHeatmapDistributed",value:function(){var e=this.w.config,t=e.chart,i=e.plotOptions;return"treemap"===t.type&&i.treemap&&i.treemap.distributed||"heatmap"===t.type&&i.heatmap&&i.heatmap.distributed}},{key:"checkBarDistributed",value:function(){var e=this.w.config,t=e.chart,i=e.plotOptions;return i.bar&&i.bar.distributed&&("bar"===t.type||"rangeBar"===t.type)}},{key:"init",value:function(){this.setDefaultColors()}},{key:"setDefaultColors",value:function(){var e=this.w,t=new w;e.globals.dom.elWrap.classList.add("apexcharts-theme-".concat(e.config.theme.mode||"light"));var i=y(e.config.colors||e.config.fill.colors||[]);e.globals.colors=this.getColors(i),this.applySeriesColors(e.globals.seriesColors,e.globals.colors),e.config.theme.monochrome.enabled&&(e.globals.colors=this.getMonochromeColors(e.config.theme.monochrome,e.globals.series,t));var n=e.globals.colors.slice();this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],n),this.applyDataLabelsColors(n),this.applyRadarPolygonsColors(),this.applyMarkersColors(n)}},{key:"getColors",value:function(e){var t=this,i=this.w;return e&&0!==e.length?Array.isArray(e)&&e.length>0&&"function"==typeof e[0]?(this.isColorFn=!0,i.config.series.map(function(n,r){var s=e[r]||e[0];return"function"==typeof s?s({value:i.globals.axisCharts?i.globals.series[r][0]||0:i.globals.series[r],seriesIndex:r,dataPointIndex:r,w:t.w}):s})):e:this.predefined()}},{key:"applySeriesColors",value:function(e,t){e.forEach(function(e,i){e&&(t[i]=e)})}},{key:"getMonochromeColors",value:function(e,t,i){var n=e.color,r=e.shadeIntensity,s=e.shadeTo,o=this.isBarDistributed||this.isHeatmapDistributed?t[0].length*t.length:t.length,a=1/(o/r),l=0;return Array.from({length:o},function(){var e="dark"===s?i.shadeColor(-1*l,n):i.shadeColor(l,n);return l+=a,e})}},{key:"applyColorTypes",value:function(e,t){var i=this,n=this.w;e.forEach(function(e){n.globals[e].colors=void 0===n.config[e].colors?i.isColorFn?n.config.colors:t:n.config[e].colors.slice(),i.pushExtraColors(n.globals[e].colors)})}},{key:"applyDataLabelsColors",value:function(e){var t=this.w;t.globals.dataLabels.style.colors=void 0===t.config.dataLabels.style.colors?e:t.config.dataLabels.style.colors.slice(),this.pushExtraColors(t.globals.dataLabels.style.colors,50)}},{key:"applyRadarPolygonsColors",value:function(){var e=this.w;e.globals.radarPolygons.fill.colors=void 0===e.config.plotOptions.radar.polygons.fill.colors?["dark"===e.config.theme.mode?"#343A3F":"none"]:e.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(e.globals.radarPolygons.fill.colors,20)}},{key:"applyMarkersColors",value:function(e){var t=this.w;t.globals.markers.colors=void 0===t.config.markers.colors?e:t.config.markers.colors.slice(),this.pushExtraColors(t.globals.markers.colors)}},{key:"pushExtraColors",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=this.w,r=t||n.globals.series.length;if(null===i&&(i=this.isBarDistributed||this.isHeatmapDistributed||"heatmap"===n.config.chart.type&&n.config.plotOptions.heatmap&&n.config.plotOptions.heatmap.colorScale.inverse),i&&n.globals.series.length&&(r=n.globals.series[n.globals.maxValsInArrayIndex].length*n.globals.series.length),e.length<r)for(var s=r-e.length,o=0;o<s;o++)e.push(e[o])}},{key:"updateThemeOptions",value:function(e){e.chart=e.chart||{},e.tooltip=e.tooltip||{};var t=e.theme.mode,i="dark"===t?"palette4":"light"===t?"palette1":e.theme.palette||"palette1",n="dark"===t?"#f6f7f8":"light"===t?"#373d3f":e.chart.foreColor||"#373d3f";return e.tooltip.theme=t||"light",e.chart.foreColor=n,e.theme.palette=i,e}},{key:"predefined",value:function(){var e=this.w.config.theme.palette,t=this.ctx.constructor.getThemePalettes();return t[e]||t.palette1}}]),e}(),dn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"draw",value:function(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}},{key:"drawTitleSubtitle",value:function(e){var t=this.w,i="title"===e?t.config.title:t.config.subtitle,n=t.globals.svgWidth/2,r=i.offsetY,s="middle";if("left"===i.align?(n=10,s="start"):"right"===i.align&&(n=t.globals.svgWidth-10,s="end"),n+=i.offsetX,r=r+parseInt(i.style.fontSize,10)+i.margin/2,void 0!==i.text){var o=new Ai(this.ctx).drawText({x:n,y:r,text:i.text,textAnchor:s,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,fontWeight:i.style.fontWeight,foreColor:i.style.color,opacity:1});o.node.setAttribute("class","apexcharts-".concat(e,"-text")),t.globals.dom.Paper.add(o)}}}]),e}(),un=function(){function e(t){s(this,e),this.w=t.w,this.dCtx=t}return a(e,[{key:"getTitleSubtitleCoords",value:function(e){var t=this.w,i=0,n=0,r="title"===e?t.config.title.floating:t.config.subtitle.floating,s=t.globals.dom.baseEl.querySelector(".apexcharts-".concat(e,"-text"));if(null!==s&&!r){var o=s.getBoundingClientRect();i=o.width,n=t.globals.axisCharts?o.height+5:o.height}return{width:i,height:n}}},{key:"getLegendsRect",value:function(){var e=this.w,t=e.globals.dom.elLegendWrap;e.config.legend.height||"top"!==e.config.legend.position&&"bottom"!==e.config.legend.position||(t.style.maxHeight=e.globals.svgHeight/2+"px");var i=Object.assign({},w.getBoundingClientRect(t));return null!==t&&!e.config.legend.floating&&e.config.legend.show?this.dCtx.lgRect={x:i.x,y:i.y,height:i.height,width:0===i.height?0:i.width}:this.dCtx.lgRect={x:0,y:0,height:0,width:0},"left"!==e.config.legend.position&&"right"!==e.config.legend.position||1.5*this.dCtx.lgRect.width>e.globals.svgWidth&&(this.dCtx.lgRect.width=e.globals.svgWidth/1.5),this.dCtx.lgRect}},{key:"getDatalabelsRect",value:function(){var e=this,t=this.w,i=[];t.config.series.forEach(function(r,s){r.data.forEach(function(r,o){var a;a=t.globals.series[s][o],n=t.config.dataLabels.formatter(a,{ctx:e.dCtx.ctx,seriesIndex:s,dataPointIndex:o,w:t}),i.push(n)})});var n=w.getLargestStringFromArr(i),r=new Ai(this.dCtx.ctx),s=t.config.dataLabels.style,o=r.getTextRects(n,parseInt(s.fontSize),s.fontFamily);return{width:1.05*o.width,height:o.height}}},{key:"getLargestStringFromMultiArr",value:function(e,t){var i=e;if(this.w.globals.isMultiLineX){var n=t.map(function(e,t){return Array.isArray(e)?e.length:1}),r=Math.max.apply(Math,y(n));i=t[n.indexOf(r)]}return i}}]),e}(),fn=function(){function e(t){s(this,e),this.w=t.w,this.dCtx=t}return a(e,[{key:"getxAxisLabelsCoords",value:function(){var e,t=this.w,i=t.globals.labels.slice();if(t.config.xaxis.convertedCatToNumeric&&0===i.length&&(i=t.globals.categoryLabels),t.globals.timescaleLabels.length>0){var n=this.getxAxisTimeScaleLabelsCoords();e={width:n.width,height:n.height},t.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends="left"!==t.config.legend.position&&"right"!==t.config.legend.position||t.config.legend.floating?0:this.dCtx.lgRect.width;var r=t.globals.xLabelFormatter,s=w.getLargestStringFromArr(i),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(s,i);t.globals.isBarHorizontal&&(o=s=t.globals.yAxisScale[0].result.reduce(function(e,t){return e.length>t.length?e:t},0));var a=new Ii(this.dCtx.ctx),l=s;s=a.xLabelFormat(r,s,l,{i:void 0,dateFormatter:new Ei(this.dCtx.ctx).formatDate,w:t}),o=a.xLabelFormat(r,o,l,{i:void 0,dateFormatter:new Ei(this.dCtx.ctx).formatDate,w:t}),(t.config.xaxis.convertedCatToNumeric&&void 0===s||""===String(s).trim())&&(o=s="1");var c=new Ai(this.dCtx.ctx),h=c.getTextRects(s,t.config.xaxis.labels.style.fontSize),d=h;if(s!==o&&(d=c.getTextRects(o,t.config.xaxis.labels.style.fontSize)),(e={width:h.width>=d.width?h.width:d.width,height:h.height>=d.height?h.height:d.height}).width*i.length>t.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==t.config.xaxis.labels.rotate||t.config.xaxis.labels.rotateAlways){if(!t.globals.isBarHorizontal){t.globals.rotateXLabels=!0;var u=function(e){return c.getTextRects(e,t.config.xaxis.labels.style.fontSize,t.config.xaxis.labels.style.fontFamily,"rotate(".concat(t.config.xaxis.labels.rotate," 0 0)"),!1)};h=u(s),s!==o&&(d=u(o)),e.height=(h.height>d.height?h.height:d.height)/1.5,e.width=h.width>d.width?h.width:d.width}}else t.globals.rotateXLabels=!1}return t.config.xaxis.labels.show||(e={width:0,height:0}),{width:e.width,height:e.height}}},{key:"getxAxisGroupLabelsCoords",value:function(){var e,t=this.w;if(!t.globals.hasXaxisGroups)return{width:0,height:0};var i,n=(null===(e=t.config.xaxis.group.style)||void 0===e?void 0:e.fontSize)||t.config.xaxis.labels.style.fontSize,r=t.globals.groups.map(function(e){return e.title}),s=w.getLargestStringFromArr(r),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(s,r),a=new Ai(this.dCtx.ctx),l=a.getTextRects(s,n),c=l;return s!==o&&(c=a.getTextRects(o,n)),i={width:l.width>=c.width?l.width:c.width,height:l.height>=c.height?l.height:c.height},t.config.xaxis.labels.show||(i={width:0,height:0}),{width:i.width,height:i.height}}},{key:"getxAxisTitleCoords",value:function(){var e=this.w,t=0,i=0;if(void 0!==e.config.xaxis.title.text){var n=new Ai(this.dCtx.ctx).getTextRects(e.config.xaxis.title.text,e.config.xaxis.title.style.fontSize);t=n.width,i=n.height}return{width:t,height:i}}},{key:"getxAxisTimeScaleLabelsCoords",value:function(){var e,t=this.w;this.dCtx.timescaleLabels=t.globals.timescaleLabels.slice();var i=this.dCtx.timescaleLabels.map(function(e){return e.value}),n=i.reduce(function(e,t){return void 0===e?(console.error("You have possibly supplied invalid Date format. Please supply a valid JavaScript Date"),0):e.length>t.length?e:t},0);return 1.05*(e=new Ai(this.dCtx.ctx).getTextRects(n,t.config.xaxis.labels.style.fontSize)).width*i.length>t.globals.gridWidth&&0!==t.config.xaxis.labels.rotate&&(t.globals.overlappingXLabels=!0),e}},{key:"additionalPaddingXLabels",value:function(e){var t=this,i=this.w,n=i.globals,r=i.config,s=r.xaxis.type,o=e.width;n.skipLastTimelinelabel=!1,n.skipFirstTimelinelabel=!1;var a=i.config.yaxis[0].opposite&&i.globals.isBarHorizontal,l=function(e,a){r.yaxis.length>1&&function(e){return-1!==n.collapsedSeriesIndices.indexOf(e)}(a)||function(e){if(t.dCtx.timescaleLabels&&t.dCtx.timescaleLabels.length){var a=t.dCtx.timescaleLabels[0],l=t.dCtx.timescaleLabels[t.dCtx.timescaleLabels.length-1].position+o/1.75-t.dCtx.yAxisWidthRight,c=a.position-o/1.75+t.dCtx.yAxisWidthLeft,h="right"===i.config.legend.position&&t.dCtx.lgRect.width>0?t.dCtx.lgRect.width:0;l>n.svgWidth-n.translateX-h&&(n.skipLastTimelinelabel=!0),c<-(e.show&&!e.floating||"bar"!==r.chart.type&&"candlestick"!==r.chart.type&&"rangeBar"!==r.chart.type&&"boxPlot"!==r.chart.type?10:o/1.75)&&(n.skipFirstTimelinelabel=!0)}else"datetime"===s?t.dCtx.gridPad.right<o&&!n.rotateXLabels&&(n.skipLastTimelinelabel=!0):"datetime"!==s&&t.dCtx.gridPad.right<o/2-t.dCtx.yAxisWidthRight&&!n.rotateXLabels&&!i.config.xaxis.labels.trim&&(t.dCtx.xPadRight=o/2+1)}(e)};r.yaxis.forEach(function(e,i){a?(t.dCtx.gridPad.left<o&&(t.dCtx.xPadLeft=o/2+1),t.dCtx.xPadRight=o/2+1):l(e,i)})}}]),e}(),pn=function(){function e(t){s(this,e),this.w=t.w,this.dCtx=t}return a(e,[{key:"getyAxisLabelsCoords",value:function(){var e=this,t=this.w,i=[],n=10,r=new Pi(this.dCtx.ctx);return t.config.yaxis.map(function(s,o){var a={seriesIndex:o,dataPointIndex:-1,w:t},l=t.globals.yAxisScale[o],c=0;if(!r.isYAxisHidden(o)&&s.labels.show&&void 0!==s.labels.minWidth&&(c=s.labels.minWidth),!r.isYAxisHidden(o)&&s.labels.show&&l.result.length){var h=t.globals.yLabelFormatters[o],d=l.niceMin===Number.MIN_VALUE?0:l.niceMin,u=l.result.reduce(function(e,t){var i,n;return(null===(i=String(h(e,a)))||void 0===i?void 0:i.length)>(null===(n=String(h(t,a)))||void 0===n?void 0:n.length)?e:t},d),f=u=h(u,a);if(void 0!==u&&0!==u.length||(u=l.niceMax),t.globals.isBarHorizontal){n=0;var p=t.globals.labels.slice();u=w.getLargestStringFromArr(p),u=h(u,{seriesIndex:o,dataPointIndex:-1,w:t}),f=e.dCtx.dimHelpers.getLargestStringFromMultiArr(u,p)}var m=new Ai(e.dCtx.ctx),g="rotate(".concat(s.labels.rotate," 0 0)"),_=m.getTextRects(u,s.labels.style.fontSize,s.labels.style.fontFamily,g,!1),y=_;u!==f&&(y=m.getTextRects(f,s.labels.style.fontSize,s.labels.style.fontFamily,g,!1)),i.push({width:(c>y.width||c>_.width?c:y.width>_.width?y.width:_.width)+n,height:y.height>_.height?y.height:_.height})}else i.push({width:0,height:0})}),i}},{key:"getyAxisTitleCoords",value:function(){var e=this,t=this.w,i=[];return t.config.yaxis.map(function(t,n){if(t.show&&void 0!==t.title.text){var r=new Ai(e.dCtx.ctx),s="rotate(".concat(t.title.rotate," 0 0)"),o=r.getTextRects(t.title.text,t.title.style.fontSize,t.title.style.fontFamily,s,!1);i.push({width:o.width,height:o.height})}else i.push({width:0,height:0})}),i}},{key:"getTotalYAxisWidth",value:function(){var e=this.w,t=0,i=0,n=0,r=e.globals.yAxisScale.length>1?10:0,s=new Pi(this.dCtx.ctx),o=function(o,a){var l=e.config.yaxis[a].floating,c=0;o.width>0&&!l?(c=o.width+r,function(t){return e.globals.ignoreYAxisIndexes.indexOf(t)>-1}(a)&&(c=c-o.width-r)):c=l||s.isYAxisHidden(a)?0:5,e.config.yaxis[a].opposite?n+=c:i+=c,t+=c};return e.globals.yLabelsCoords.map(function(e,t){o(e,t)}),e.globals.yTitleCoords.map(function(e,t){o(e,t)}),e.globals.isBarHorizontal&&!e.config.yaxis[0].floating&&(t=e.globals.yLabelsCoords[0].width+e.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=i,this.dCtx.yAxisWidthRight=n,t}}]),e}(),mn=function(){function e(t){s(this,e),this.w=t.w,this.dCtx=t}return a(e,[{key:"gridPadForColumnsInNumericAxis",value:function(e){var t=this.w,i=t.config,n=t.globals;if(n.noData||n.collapsedSeries.length+n.ancillaryCollapsedSeries.length===i.series.length)return 0;var r=function(e){return["bar","rangeBar","candlestick","boxPlot"].includes(e)},s=i.chart.type,o=0,a=r(s)?i.series.length:1;n.comboBarCount>0&&(a=n.comboBarCount),n.collapsedSeries.forEach(function(e){r(e.type)&&(a-=1)}),i.chart.stacked&&(a=1);var l=r(s)||n.comboBarCount>0,c=Math.abs(n.initialMaxX-n.initialMinX);if(l&&n.isXNumeric&&!n.isBarHorizontal&&a>0&&0!==c){c<=3&&(c=n.dataPoints);var h=c/e,d=n.minXDiff&&n.minXDiff/h>0?n.minXDiff/h:0;d>e/2&&(d/=2),(o=d*parseInt(i.plotOptions.bar.columnWidth,10)/100)<1&&(o=1),n.barPadForNumericAxis=o}return o}},{key:"gridPadFortitleSubtitle",value:function(){var e=this,t=this.w,i=t.globals,n=this.dCtx.isSparkline||!i.axisCharts?0:10;["title","subtitle"].forEach(function(r){void 0!==t.config[r].text?n+=t.config[r].margin:n+=e.dCtx.isSparkline||!i.axisCharts?0:5}),!t.config.legend.show||"bottom"!==t.config.legend.position||t.config.legend.floating||i.axisCharts||(n+=10);var r=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),s=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");i.gridHeight-=r.height+s.height+n,i.translateY+=r.height+s.height+n}},{key:"setGridXPosForDualYAxis",value:function(e,t){var i=this.w,n=new Pi(this.dCtx.ctx);i.config.yaxis.forEach(function(r,s){-1!==i.globals.ignoreYAxisIndexes.indexOf(s)||r.floating||n.isYAxisHidden(s)||(r.opposite&&(i.globals.translateX-=t[s].width+e[s].width+parseInt(r.labels.style.fontSize,10)/1.2+12),i.globals.translateX<2&&(i.globals.translateX=2))})}}]),e}(),gn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new un(this),this.dimYAxis=new pn(this),this.dimXAxis=new fn(this),this.dimGrid=new mn(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}return a(e,[{key:"plotCoords",value:function(){var e=this,t=this.w,i=t.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0};var n=Array.isArray(t.config.stroke.width)?Math.max.apply(Math,y(t.config.stroke.width)):t.config.stroke.width;this.isSparkline&&((t.config.markers.discrete.length>0||t.config.markers.size>0)&&Object.entries(this.gridPad).forEach(function(t){var i=_(t,2),n=i[0],r=i[1];e.gridPad[n]=Math.max(r,e.w.globals.markers.largestSize/1.5)}),this.gridPad.top=Math.max(n/2,this.gridPad.top),this.gridPad.bottom=Math.max(n/2,this.gridPad.bottom)),i.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),i.gridHeight=i.gridHeight-this.gridPad.top-this.gridPad.bottom,i.gridWidth=i.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;var r=this.dimGrid.gridPadForColumnsInNumericAxis(i.gridWidth);i.gridWidth=i.gridWidth-2*r,i.translateX=i.translateX+this.gridPad.left+this.xPadLeft+(r>0?r:0),i.translateY=i.translateY+this.gridPad.top}},{key:"setDimensionsForAxisCharts",value:function(){var e=this,t=this.w,i=t.globals,n=this.dimYAxis.getyAxisLabelsCoords(),r=this.dimYAxis.getyAxisTitleCoords();i.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),t.globals.yLabelsCoords=[],t.globals.yTitleCoords=[],t.config.yaxis.map(function(e,i){t.globals.yLabelsCoords.push({width:n[i].width,index:i}),t.globals.yTitleCoords.push({width:r[i].width,index:i})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();var s=this.dimXAxis.getxAxisLabelsCoords(),o=this.dimXAxis.getxAxisGroupLabelsCoords(),a=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(s,a,o),i.translateXAxisY=t.globals.rotateXLabels?this.xAxisHeight/8:-4,i.translateXAxisX=t.globals.rotateXLabels&&t.globals.isXNumeric&&t.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,t.globals.isBarHorizontal&&(i.rotateXLabels=!1,i.translateXAxisY=parseInt(t.config.xaxis.labels.style.fontSize,10)/1.5*-1),i.translateXAxisY=i.translateXAxisY+t.config.xaxis.labels.offsetY,i.translateXAxisX=i.translateXAxisX+t.config.xaxis.labels.offsetX;var l=this.yAxisWidth,c=this.xAxisHeight;i.xAxisLabelsHeight=this.xAxisHeight-a.height,i.xAxisGroupLabelsHeight=i.xAxisLabelsHeight-s.height,i.xAxisLabelsWidth=this.xAxisWidth,i.xAxisHeight=this.xAxisHeight;var h=10;("radar"===t.config.chart.type||this.isSparkline)&&(l=0,c=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||"treemap"===t.config.chart.type)&&(l=0,c=0,h=0),this.isSparkline||"treemap"===t.config.chart.type||this.dimXAxis.additionalPaddingXLabels(s);var d=function(){i.translateX=l+e.datalabelsCoords.width,i.gridHeight=i.svgHeight-e.lgRect.height-c-(e.isSparkline||"treemap"===t.config.chart.type?0:t.globals.rotateXLabels?10:15),i.gridWidth=i.svgWidth-l-2*e.datalabelsCoords.width};switch("top"===t.config.xaxis.position&&(h=i.xAxisHeight-t.config.xaxis.axisTicks.height-5),t.config.legend.position){case"bottom":i.translateY=h,d();break;case"top":i.translateY=this.lgRect.height+h,d();break;case"left":i.translateY=h,i.translateX=this.lgRect.width+l+this.datalabelsCoords.width,i.gridHeight=i.svgHeight-c-12,i.gridWidth=i.svgWidth-this.lgRect.width-l-2*this.datalabelsCoords.width;break;case"right":i.translateY=h,i.translateX=l+this.datalabelsCoords.width,i.gridHeight=i.svgHeight-c-12,i.gridWidth=i.svgWidth-this.lgRect.width-l-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(r,n),new rn(this.ctx).setYAxisXPosition(n,r)}},{key:"setDimensionsForNonAxisCharts",value:function(){var e=this.w,t=e.globals,i=e.config,n=0;e.config.legend.show&&!e.config.legend.floating&&(n=20);var r="pie"===i.chart.type||"polarArea"===i.chart.type||"donut"===i.chart.type?"pie":"radialBar",s=i.plotOptions[r].offsetY,o=i.plotOptions[r].offsetX;if(!i.legend.show||i.legend.floating){t.gridHeight=t.svgHeight;var a=t.dom.elWrap.getBoundingClientRect().width;return t.gridWidth=Math.min(a,t.gridHeight),t.translateY=s,void(t.translateX=o+(t.svgWidth-t.gridWidth)/2)}switch(i.legend.position){case"bottom":t.gridHeight=t.svgHeight-this.lgRect.height,t.gridWidth=t.svgWidth,t.translateY=s-10,t.translateX=o+(t.svgWidth-t.gridWidth)/2;break;case"top":t.gridHeight=t.svgHeight-this.lgRect.height,t.gridWidth=t.svgWidth,t.translateY=this.lgRect.height+s+10,t.translateX=o+(t.svgWidth-t.gridWidth)/2;break;case"left":t.gridWidth=t.svgWidth-this.lgRect.width-n,t.gridHeight="auto"!==i.chart.height?t.svgHeight:t.gridWidth,t.translateY=s,t.translateX=o+this.lgRect.width+n;break;case"right":t.gridWidth=t.svgWidth-this.lgRect.width-n-5,t.gridHeight="auto"!==i.chart.height?t.svgHeight:t.gridWidth,t.translateY=s,t.translateX=o+10;break;default:throw new Error("Legend position not supported")}}},{key:"conditionalChecksForAxisCoords",value:function(e,t,i){var n=this.w,r=n.globals.hasXaxisGroups?2:1,s=i.height+e.height+t.height,o=n.globals.isMultiLineX?1.2:n.globals.LINE_HEIGHT_RATIO,a=n.globals.rotateXLabels?22:10,l=n.globals.rotateXLabels&&"bottom"===n.config.legend.position?10:0;this.xAxisHeight=s*o+r*a+l,this.xAxisWidth=e.width,this.xAxisHeight-t.height>n.config.xaxis.labels.maxHeight&&(this.xAxisHeight=n.config.xaxis.labels.maxHeight),n.config.xaxis.labels.minHeight&&this.xAxisHeight<n.config.xaxis.labels.minHeight&&(this.xAxisHeight=n.config.xaxis.labels.minHeight),n.config.xaxis.floating&&(this.xAxisHeight=0);var c=0,h=0;n.config.yaxis.forEach(function(e){c+=e.labels.minWidth,h+=e.labels.maxWidth}),this.yAxisWidth<c&&(this.yAxisWidth=c),this.yAxisWidth>h&&(this.yAxisWidth=h)}}]),e}(),_n=function(){function e(t){s(this,e),this.w=t.w,this.lgCtx=t}return a(e,[{key:"getLegendStyles",value:function(){var e,t,i,n=document.createElement("style");n.setAttribute("type","text/css");var r=(null===(e=this.lgCtx.ctx)||void 0===e||null===(t=e.opts)||void 0===t||null===(i=t.chart)||void 0===i?void 0:i.nonce)||this.w.config.chart.nonce;r&&n.setAttribute("nonce",r);var s=document.createTextNode(qi);return n.appendChild(s),n}},{key:"getLegendDimensions",value:function(){var e=this.w.globals.dom.baseEl.querySelector(".apexcharts-legend").getBoundingClientRect(),t=e.width;return{clwh:e.height,clww:t}}},{key:"appendToForeignObject",value:function(){var e=this.w.globals;!1!==this.w.config.chart.injectStyleSheet&&e.dom.elLegendForeign.appendChild(this.getLegendStyles())}},{key:"toggleDataSeries",value:function(e,t){var i=this,n=this.w;if(n.globals.axisCharts||"radialBar"===n.config.chart.type){n.globals.resized=!0;var r=null,s=null;n.globals.risingSeries=[],n.globals.axisCharts?(r=n.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(e,"']")),s=parseInt(r.getAttribute("data:realIndex"),10)):(r=n.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(e+1,"']")),s=parseInt(r.getAttribute("rel"),10)-1),t?[{cs:n.globals.collapsedSeries,csi:n.globals.collapsedSeriesIndices},{cs:n.globals.ancillaryCollapsedSeries,csi:n.globals.ancillaryCollapsedSeriesIndices}].forEach(function(e){i.riseCollapsedSeries(e.cs,e.csi,s)}):this.hideSeries({seriesEl:r,realIndex:s})}else{var o=n.globals.dom.Paper.findOne(" .apexcharts-series[rel='".concat(e+1,"'] path")),a=n.config.chart.type;if("pie"===a||"polarArea"===a||"donut"===a){var l=n.config.plotOptions.pie.donut.labels;new Ai(this.lgCtx.ctx).pathMouseDown(o,null),this.lgCtx.ctx.pie.printDataLabelsInner(o.node,l)}o.fire("click")}}},{key:"getSeriesAfterCollapsing",value:function(e){var t=e.realIndex,i=this.w,n=i.globals,r=w.clone(i.config.series);if(n.axisCharts){var s=i.config.yaxis[n.seriesYAxisReverseMap[t]],o={index:t,data:r[t].data.slice(),type:r[t].type||i.config.chart.type};if(s&&s.show&&s.showAlways)n.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(n.ancillaryCollapsedSeries.push(o),n.ancillaryCollapsedSeriesIndices.push(t));else if(n.collapsedSeriesIndices.indexOf(t)<0){n.collapsedSeries.push(o),n.collapsedSeriesIndices.push(t);var a=n.risingSeries.indexOf(t);n.risingSeries.splice(a,1)}}else n.collapsedSeries.push({index:t,data:r[t]}),n.collapsedSeriesIndices.push(t);return n.allSeriesCollapsed=n.collapsedSeries.length+n.ancillaryCollapsedSeries.length===i.config.series.length,this._getSeriesBasedOnCollapsedState(r)}},{key:"hideSeries",value:function(e){for(var t=e.seriesEl,i=e.realIndex,n=this.w,r=this.getSeriesAfterCollapsing({realIndex:i}),s=t.childNodes,o=0;o<s.length;o++)s[o].classList.contains("apexcharts-series-markers-wrap")&&(s[o].classList.contains("apexcharts-hide")?s[o].classList.remove("apexcharts-hide"):s[o].classList.add("apexcharts-hide"));this.lgCtx.ctx.updateHelpers._updateSeries(r,n.config.chart.animations.dynamicAnimation.enabled)}},{key:"riseCollapsedSeries",value:function(e,t,i){var n=this.w,r=w.clone(n.config.series);if(e.length>0){for(var s=0;s<e.length;s++)e[s].index===i&&(n.globals.axisCharts?r[i].data=e[s].data.slice():r[i]=e[s].data,"number"!=typeof r[i]&&(r[i].hidden=!1),e.splice(s,1),t.splice(s,1),n.globals.risingSeries.push(i));r=this._getSeriesBasedOnCollapsedState(r),this.lgCtx.ctx.updateHelpers._updateSeries(r,n.config.chart.animations.dynamicAnimation.enabled)}}},{key:"_getSeriesBasedOnCollapsedState",value:function(e){var t=this.w,i=0;return t.globals.axisCharts?e.forEach(function(n,r){t.globals.collapsedSeriesIndices.indexOf(r)<0&&t.globals.ancillaryCollapsedSeriesIndices.indexOf(r)<0||(e[r].data=[],i++)}):e.forEach(function(n,r){!t.globals.collapsedSeriesIndices.indexOf(r)<0&&(e[r]=0,i++)}),t.globals.allSeriesCollapsed=i===e.length,e}}]),e}(),yn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new _n(this)}return a(e,[{key:"init",value:function(){var e=this.w,t=e.globals,i=e.config,n=i.legend.showForSingleSeries&&1===t.series.length||this.isBarsDistributed||t.series.length>1;if(this.legendHelpers.appendToForeignObject(),(n||!t.axisCharts)&&i.legend.show){for(;t.dom.elLegendWrap.firstChild;)t.dom.elLegendWrap.removeChild(t.dom.elLegendWrap.firstChild);this.drawLegends(),"bottom"===i.legend.position||"top"===i.legend.position?this.legendAlignHorizontal():"right"!==i.legend.position&&"left"!==i.legend.position||this.legendAlignVertical()}}},{key:"createLegendMarker",value:function(e){var t=e.i,i=e.fillcolor,n=this.w,r=document.createElement("span");r.classList.add("apexcharts-legend-marker");var s=n.config.legend.markers.shape||n.config.markers.shape,o=s;Array.isArray(s)&&(o=s[t]);var a=Array.isArray(n.config.legend.markers.size)?parseFloat(n.config.legend.markers.size[t]):parseFloat(n.config.legend.markers.size),l=Array.isArray(n.config.legend.markers.offsetX)?parseFloat(n.config.legend.markers.offsetX[t]):parseFloat(n.config.legend.markers.offsetX),c=Array.isArray(n.config.legend.markers.offsetY)?parseFloat(n.config.legend.markers.offsetY[t]):parseFloat(n.config.legend.markers.offsetY),h=Array.isArray(n.config.legend.markers.strokeWidth)?parseFloat(n.config.legend.markers.strokeWidth[t]):parseFloat(n.config.legend.markers.strokeWidth),d=r.style;if(d.height=2*(a+h)+"px",d.width=2*(a+h)+"px",d.left=l+"px",d.top=c+"px",n.config.legend.markers.customHTML)d.background="transparent",d.color=i[t],Array.isArray(n.config.legend.markers.customHTML)?n.config.legend.markers.customHTML[t]&&(r.innerHTML=n.config.legend.markers.customHTML[t]()):r.innerHTML=n.config.legend.markers.customHTML();else{var u=new $i(this.ctx).getMarkerConfig({cssClass:"apexcharts-legend-marker apexcharts-marker apexcharts-marker-".concat(o),seriesIndex:t,strokeWidth:h,size:a}),f=window.SVG().addTo(r).size("100%","100%"),p=new Ai(this.ctx).drawMarker(0,0,m(m({},u),{},{pointFillColor:Array.isArray(i)?i[t]:u.pointFillColor,shape:o}));n.globals.dom.Paper.find(".apexcharts-legend-marker.apexcharts-marker").forEach(function(e){e.node.classList.contains("apexcharts-marker-triangle")?e.node.style.transform="translate(50%, 45%)":e.node.style.transform="translate(50%, 50%)"}),f.add(p)}return r}},{key:"drawLegends",value:function(){var e=this,t=this,i=this.w,n=i.config.legend.fontFamily,r=i.globals.seriesNames,s=i.config.legend.markers.fillColors?i.config.legend.markers.fillColors.slice():i.globals.colors.slice();if("heatmap"===i.config.chart.type){var o=i.config.plotOptions.heatmap.colorScale.ranges;r=o.map(function(e){return e.name?e.name:e.from+" - "+e.to}),s=o.map(function(e){return e.color})}else this.isBarsDistributed&&(r=i.globals.labels.slice());i.config.legend.customLegendItems.length&&(r=i.config.legend.customLegendItems);var a=i.globals.legendFormatter,l=i.config.legend.inverseOrder,c=[];i.globals.seriesGroups.length>1&&i.config.legend.clusterGroupedSeries&&i.globals.seriesGroups.forEach(function(e,t){c[t]=document.createElement("div"),c[t].classList.add("apexcharts-legend-group","apexcharts-legend-group-".concat(t)),"horizontal"===i.config.legend.clusterGroupedSeriesOrientation?i.globals.dom.elLegendWrap.classList.add("apexcharts-legend-group-horizontal"):c[t].classList.add("apexcharts-legend-group-vertical")});for(var h=function(t){var o,l=a(r[t],{seriesIndex:t,w:i}),h=!1,d=!1;if(i.globals.collapsedSeries.length>0)for(var u=0;u<i.globals.collapsedSeries.length;u++)i.globals.collapsedSeries[u].index===t&&(h=!0);if(i.globals.ancillaryCollapsedSeriesIndices.length>0)for(var f=0;f<i.globals.ancillaryCollapsedSeriesIndices.length;f++)i.globals.ancillaryCollapsedSeriesIndices[f]===t&&(d=!0);var p=e.createLegendMarker({i:t,fillcolor:s});Ai.setAttrs(p,{rel:t+1,"data:collapsed":h||d}),(h||d)&&p.classList.add("apexcharts-inactive-legend");var m=document.createElement("div"),g=document.createElement("span");g.classList.add("apexcharts-legend-text"),g.innerHTML=Array.isArray(l)?l.join(" "):l;var _=i.config.legend.labels.useSeriesColors?i.globals.colors[t]:Array.isArray(i.config.legend.labels.colors)?null===(o=i.config.legend.labels.colors)||void 0===o?void 0:o[t]:i.config.legend.labels.colors;_||(_=i.config.chart.foreColor),g.style.color=_,g.style.fontSize=parseFloat(i.config.legend.fontSize)+"px",g.style.fontWeight=i.config.legend.fontWeight,g.style.fontFamily=n||i.config.chart.fontFamily,Ai.setAttrs(g,{rel:t+1,i:t,"data:default-text":encodeURIComponent(l),"data:collapsed":h||d}),m.appendChild(p),m.appendChild(g);var y=new Ci(e.ctx);i.config.legend.showForZeroSeries||0===y.getSeriesTotalByIndex(t)&&y.seriesHaveSameValues(t)&&!y.isSeriesNull(t)&&-1===i.globals.collapsedSeriesIndices.indexOf(t)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(t)&&m.classList.add("apexcharts-hidden-zero-series"),i.config.legend.showForNullSeries||y.isSeriesNull(t)&&-1===i.globals.collapsedSeriesIndices.indexOf(t)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(t)&&m.classList.add("apexcharts-hidden-null-series"),c.length?i.globals.seriesGroups.forEach(function(e,n){var r;e.includes(null===(r=i.config.series[t])||void 0===r?void 0:r.name)&&(i.globals.dom.elLegendWrap.appendChild(c[n]),c[n].appendChild(m))}):i.globals.dom.elLegendWrap.appendChild(m),i.globals.dom.elLegendWrap.classList.add("apexcharts-align-".concat(i.config.legend.horizontalAlign)),i.globals.dom.elLegendWrap.classList.add("apx-legend-position-"+i.config.legend.position),m.classList.add("apexcharts-legend-series"),m.style.margin="".concat(i.config.legend.itemMargin.vertical,"px ").concat(i.config.legend.itemMargin.horizontal,"px"),i.globals.dom.elLegendWrap.style.width=i.config.legend.width?i.config.legend.width+"px":"",i.globals.dom.elLegendWrap.style.height=i.config.legend.height?i.config.legend.height+"px":"",Ai.setAttrs(m,{rel:t+1,seriesName:w.escapeString(r[t]),"data:collapsed":h||d}),(h||d)&&m.classList.add("apexcharts-inactive-legend"),i.config.legend.onItemClick.toggleDataSeries||m.classList.add("apexcharts-no-click")},d=l?r.length-1:0;l?d>=0:d<=r.length-1;l?d--:d++)h(d);i.globals.dom.elWrap.addEventListener("click",t.onLegendClick,!0),i.config.legend.onItemHover.highlightDataSeries&&0===i.config.legend.customLegendItems.length&&(i.globals.dom.elWrap.addEventListener("mousemove",t.onLegendHovered,!0),i.globals.dom.elWrap.addEventListener("mouseout",t.onLegendHovered,!0))}},{key:"setLegendWrapXY",value:function(e,t){var i=this.w,n=i.globals.dom.elLegendWrap,r=n.clientHeight,s=0,o=0;if("bottom"===i.config.legend.position)o=i.globals.svgHeight-Math.min(r,i.globals.svgHeight/2)-5;else if("top"===i.config.legend.position){var a=new gn(this.ctx),l=a.dimHelpers.getTitleSubtitleCoords("title").height,c=a.dimHelpers.getTitleSubtitleCoords("subtitle").height;o=(l>0?l-10:0)+(c>0?c-10:0)}n.style.position="absolute",s=s+e+i.config.legend.offsetX,o=o+t+i.config.legend.offsetY,n.style.left=s+"px",n.style.top=o+"px","right"===i.config.legend.position&&(n.style.left="auto",n.style.right=25+i.config.legend.offsetX+"px"),["width","height"].forEach(function(e){n.style[e]&&(n.style[e]=parseInt(i.config.legend[e],10)+"px")})}},{key:"legendAlignHorizontal",value:function(){var e=this.w;e.globals.dom.elLegendWrap.style.right=0;var t=new gn(this.ctx),i=t.dimHelpers.getTitleSubtitleCoords("title"),n=t.dimHelpers.getTitleSubtitleCoords("subtitle"),r=0;"top"===e.config.legend.position&&(r=i.height+n.height+e.config.title.margin+e.config.subtitle.margin-10),this.setLegendWrapXY(20,r)}},{key:"legendAlignVertical",value:function(){var e=this.w,t=this.legendHelpers.getLegendDimensions(),i=0;"left"===e.config.legend.position&&(i=20),"right"===e.config.legend.position&&(i=e.globals.svgWidth-t.clww-10),this.setLegendWrapXY(i,20)}},{key:"onLegendHovered",value:function(e){var t=this.w,i=e.target.classList.contains("apexcharts-legend-series")||e.target.classList.contains("apexcharts-legend-text")||e.target.classList.contains("apexcharts-legend-marker");if("heatmap"===t.config.chart.type||this.isBarsDistributed){if(i){var n=parseInt(e.target.getAttribute("rel"),10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,n,this.w]),new Zi(this.ctx).highlightRangeInSeries(e,e.target)}}else!e.target.classList.contains("apexcharts-inactive-legend")&&i&&new Zi(this.ctx).toggleSeriesOnHover(e,e.target)}},{key:"onLegendClick",value:function(e){var t=this.w;if(!t.config.legend.customLegendItems.length&&(e.target.classList.contains("apexcharts-legend-series")||e.target.classList.contains("apexcharts-legend-text")||e.target.classList.contains("apexcharts-legend-marker"))){var i=parseInt(e.target.getAttribute("rel"),10)-1,n="true"===e.target.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,i,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,i,this.w]);var s=this.w.config.legend.markers.onClick;"function"==typeof s&&e.target.classList.contains("apexcharts-legend-marker")&&(s(this.ctx,i,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,i,this.w])),"treemap"!==t.config.chart.type&&"heatmap"!==t.config.chart.type&&!this.isBarsDistributed&&t.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(i,n)}}}]),e}(),vn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w;var i=this.w;this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=i.globals.minX,this.maxX=i.globals.maxX}return a(e,[{key:"createToolbar",value:function(){var e=this,t=this.w,i=function(){return document.createElement("div")},n=i();if(n.setAttribute("class","apexcharts-toolbar"),n.style.top=t.config.chart.toolbar.offsetY+"px",n.style.right=3-t.config.chart.toolbar.offsetX+"px",t.globals.dom.elWrap.appendChild(n),this.elZoom=i(),this.elZoomIn=i(),this.elZoomOut=i(),this.elPan=i(),this.elSelection=i(),this.elZoomReset=i(),this.elMenuIcon=i(),this.elMenu=i(),this.elCustomIcons=[],this.t=t.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(var r=0;r<this.t.customIcons.length;r++)this.elCustomIcons.push(i());var s=[],o=function(i,n,r){var o=i.toLowerCase();e.t[o]&&t.config.chart.zoom.enabled&&s.push({el:n,icon:"string"==typeof e.t[o]?e.t[o]:r,title:e.localeValues[i],class:"apexcharts-".concat(o,"-icon")})};o("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n'),o("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n');var a=function(i){e.t[i]&&t.config.chart[i].enabled&&s.push({el:"zoom"===i?e.elZoom:e.elSelection,icon:"string"==typeof e.t[i]?e.t[i]:"zoom"===i?'<svg xmlns="http://www.w3.org/2000/svg" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>\n <path d="M0 0h24v24H0V0z" fill="none"/>\n <path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>\n</svg>':'<svg fill="#6E8192" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2z"/>\n</svg>',title:e.localeValues["zoom"===i?"selectionZoom":"selection"],class:"apexcharts-".concat(i,"-icon")})};a("zoom"),a("selection"),this.t.pan&&t.config.chart.zoom.enabled&&s.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n <defs>\n <path d="M0 0h24v24H0z" id="a"/>\n </defs>\n <clipPath id="b">\n <use overflow="visible" xlink:href="#a"/>\n </clipPath>\n <path clip-path="url(#b)" d="M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"/>\n</svg>',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),o("reset",this.elZoomReset,'<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>\n <path d="M0 0h24v24H0z" fill="none"/>\n</svg>'),this.t.download&&s.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(var l=0;l<this.elCustomIcons.length;l++)s.push({el:this.elCustomIcons[l],icon:this.t.customIcons[l].icon,title:this.t.customIcons[l].title,index:this.t.customIcons[l].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[l].class});s.forEach(function(e,t){e.index&&w.moveIndexInArray(s,t,e.index)});for(var c=0;c<s.length;c++)Ai.setAttrs(s[c].el,{class:s[c].class,title:s[c].title}),s[c].el.innerHTML=s[c].icon,n.appendChild(s[c].el);this._createHamburgerMenu(n),t.globals.zoomEnabled?this.elZoom.classList.add(this.selectedClass):t.globals.panEnabled?this.elPan.classList.add(this.selectedClass):t.globals.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}},{key:"_createHamburgerMenu",value:function(e){this.elMenuItems=[],e.appendChild(this.elMenu),Ai.setAttrs(this.elMenu,{class:"apexcharts-menu"});for(var t=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}],i=0;i<t.length;i++)this.elMenuItems.push(document.createElement("div")),this.elMenuItems[i].innerHTML=t[i].title,Ai.setAttrs(this.elMenuItems[i],{class:"apexcharts-menu-item ".concat(t[i].name),title:t[i].title}),this.elMenu.appendChild(this.elMenuItems[i])}},{key:"addToolbarEventListeners",value:function(){var e=this;this.elZoomReset.addEventListener("click",this.handleZoomReset.bind(this)),this.elSelection.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),this.elZoom.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),this.elZoomIn.addEventListener("click",this.handleZoomIn.bind(this)),this.elZoomOut.addEventListener("click",this.handleZoomOut.bind(this)),this.elPan.addEventListener("click",this.togglePanning.bind(this)),this.elMenuIcon.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(function(t){t.classList.contains("exportSVG")?t.addEventListener("click",e.handleDownload.bind(e,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",e.handleDownload.bind(e,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",e.handleDownload.bind(e,"csv"))});for(var t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w))}},{key:"toggleZoomSelection",value:function(e){this.ctx.getSyncedCharts().forEach(function(t){t.ctx.toolbar.toggleOtherControls();var i="selection"===e?t.ctx.toolbar.elSelection:t.ctx.toolbar.elZoom,n="selection"===e?"selectionEnabled":"zoomEnabled";t.w.globals[n]=!t.w.globals[n],i.classList.contains(t.ctx.toolbar.selectedClass)?i.classList.remove(t.ctx.toolbar.selectedClass):i.classList.add(t.ctx.toolbar.selectedClass)})}},{key:"getToolbarIconsReference",value:function(){var e=this.w;this.elZoom||(this.elZoom=e.globals.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=e.globals.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=e.globals.dom.baseEl.querySelector(".apexcharts-selection-icon"))}},{key:"enableZoomPanFromToolbar",value:function(e){this.toggleOtherControls(),"pan"===e?this.w.globals.panEnabled=!0:this.w.globals.zoomEnabled=!0;var t="pan"===e?this.elPan:this.elZoom,i="pan"===e?this.elZoom:this.elPan;t&&t.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}},{key:"togglePanning",value:function(){this.ctx.getSyncedCharts().forEach(function(e){e.ctx.toolbar.toggleOtherControls(),e.w.globals.panEnabled=!e.w.globals.panEnabled,e.ctx.toolbar.elPan.classList.contains(e.ctx.toolbar.selectedClass)?e.ctx.toolbar.elPan.classList.remove(e.ctx.toolbar.selectedClass):e.ctx.toolbar.elPan.classList.add(e.ctx.toolbar.selectedClass)})}},{key:"toggleOtherControls",value:function(){var e=this,t=this.w;t.globals.panEnabled=!1,t.globals.zoomEnabled=!1,t.globals.selectionEnabled=!1,this.getToolbarIconsReference(),[this.elPan,this.elSelection,this.elZoom].forEach(function(t){t&&t.classList.remove(e.selectedClass)})}},{key:"handleZoomIn",value:function(){var e=this.w;e.globals.isRangeBar&&(this.minX=e.globals.minY,this.maxX=e.globals.maxY);var t=(this.minX+this.maxX)/2,i=(this.minX+t)/2,n=(this.maxX+t)/2,r=this._getNewMinXMaxX(i,n);e.globals.disableZoomIn||this.zoomUpdateOptions(r.minX,r.maxX)}},{key:"handleZoomOut",value:function(){var e=this.w;if(e.globals.isRangeBar&&(this.minX=e.globals.minY,this.maxX=e.globals.maxY),!("datetime"===e.config.xaxis.type&&new Date(this.minX).getUTCFullYear()<1e3)){var t=(this.minX+this.maxX)/2,i=this.minX-(t-this.minX),n=this.maxX-(t-this.maxX),r=this._getNewMinXMaxX(i,n);e.globals.disableZoomOut||this.zoomUpdateOptions(r.minX,r.maxX)}}},{key:"_getNewMinXMaxX",value:function(e,t){var i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(e):e,maxX:i?Math.floor(t):t}}},{key:"zoomUpdateOptions",value:function(e,t){var i=this.w;if(void 0!==e||void 0!==t){if(!(i.config.xaxis.convertedCatToNumeric&&(e<1&&(e=1,t=i.globals.dataPoints),t-e<2))){var n={min:e,max:t},r=this.getBeforeZoomRange(n);r&&(n=r.xaxis);var s={xaxis:n},o=w.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(s.yaxis=o),this.w.globals.zoomed=!0,this.ctx.updateHelpers._updateOptions(s,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(n,o)}}else this.handleZoomReset()}},{key:"zoomCallback",value:function(e,t){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:e,yaxis:t}),this.ctx.events.fireEvent("zoomed",{xaxis:e,yaxis:t}))}},{key:"getBeforeZoomRange",value:function(e,t){var i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:e,yaxis:t})),i}},{key:"toggleMenu",value:function(){var e=this;window.setTimeout(function(){e.elMenu.classList.contains("apexcharts-menu-open")?e.elMenu.classList.remove("apexcharts-menu-open"):e.elMenu.classList.add("apexcharts-menu-open")},0)}},{key:"handleDownload",value:function(e){var t=this.w,i=new Ki(this.ctx);switch(e){case"svg":i.exportToSVG(this.ctx);break;case"png":i.exportToPng(this.ctx);break;case"csv":i.exportToCSV({series:t.config.series,columnDelimiter:t.config.chart.toolbar.export.csv.columnDelimiter})}}},{key:"handleZoomReset",value:function(e){this.ctx.getSyncedCharts().forEach(function(e){var t=e.w;if(t.globals.lastXAxis.min=t.globals.initialConfig.xaxis.min,t.globals.lastXAxis.max=t.globals.initialConfig.xaxis.max,e.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof t.config.chart.events.beforeResetZoom){var i=t.config.chart.events.beforeResetZoom(e,t);i&&e.updateHelpers.revertDefaultAxisMinMax(i)}"function"==typeof t.config.chart.events.zoomed&&e.ctx.toolbar.zoomCallback({min:t.config.xaxis.min,max:t.config.xaxis.max}),t.globals.zoomed=!1;var n=e.ctx.series.emptyCollapsedSeries(w.clone(t.globals.initialSeries));e.updateHelpers._updateSeries(n,t.config.chart.animations.dynamicAnimation.enabled)})}},{key:"destroy",value:function(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}]),e}(),xn=function(){u(t,vn);var e=c(t);function t(i){var n;return s(this,t),(n=e.call(this,i)).ctx=i,n.w=i.w,n.dragged=!1,n.graphics=new Ai(n.ctx),n.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend","wheel"],n.clientX=0,n.clientY=0,n.startX=0,n.endX=0,n.dragX=0,n.startY=0,n.endY=0,n.dragY=0,n.moveDirection="none",n.debounceTimer=null,n.debounceDelay=100,n.wheelDelay=400,n}return a(t,[{key:"init",value:function(e){var t=this,i=e.xyRatios,n=this.w,r=this;this.xyRatios=i,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=n.globals.dom.baseEl.querySelector(".apexcharts-grid"),this.constraints=new ke(0,0,n.globals.gridWidth,n.globals.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),n.globals.dom.Paper.add(this.zoomRect),n.globals.dom.Paper.add(this.selectionRect),"x"===n.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:n.globals.gridWidth,maxY:n.globals.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===n.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:n.globals.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=n.globals.dom.baseEl.querySelector("".concat(n.globals.chartClass," .apexcharts-svg")),this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(function(e){t.hoverArea.addEventListener(e,r.svgMouseEvents.bind(r,i),{capture:!1,passive:!0})}),n.config.chart.zoom.enabled&&n.config.chart.zoom.allowMouseWheelZoom&&this.hoverArea.addEventListener("wheel",r.mouseWheelEvent.bind(r),{capture:!1,passive:!1})}},{key:"destroy",value:function(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}},{key:"svgMouseEvents",value:function(e,t){var i=this.w,n=this.ctx.toolbar,r=i.globals.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,s=i.config.chart.toolbar.autoSelected;if(t.shiftKey?(this.shiftWasPressed=!0,n.enableZoomPanFromToolbar("pan"===s?"zoom":"pan")):this.shiftWasPressed&&(n.enableZoomPanFromToolbar(s),this.shiftWasPressed=!1),t.target){var o,a=t.target.classList;if(t.target.parentNode&&null!==t.target.parentNode&&(o=t.target.parentNode.classList),!(a.contains("apexcharts-legend-marker")||a.contains("apexcharts-legend-text")||o&&o.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===t.type||"touchstart"===t.type?t.touches[0].clientX:"touchend"===t.type?t.changedTouches[0].clientX:t.clientX,this.clientY="touchmove"===t.type||"touchstart"===t.type?t.touches[0].clientY:"touchend"===t.type?t.changedTouches[0].clientY:t.clientY,"mousedown"===t.type&&1===t.which||"touchstart"===t.type){var l=this.gridRect.getBoundingClientRect();this.startX=this.clientX-l.left-i.globals.barPadForNumericAxis,this.startY=this.clientY-l.top,this.dragged=!1,this.w.globals.mousedown=!0}("mousemove"===t.type&&1===t.which||"touchmove"===t.type)&&(this.dragged=!0,i.globals.panEnabled?(i.globals.selection=null,this.w.globals.mousedown&&this.panDragging({context:this,zoomtype:r,xyRatios:e})):(this.w.globals.mousedown&&i.globals.zoomEnabled||this.w.globals.mousedown&&i.globals.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:r}))),"mouseup"!==t.type&&"touchend"!==t.type&&"mouseleave"!==t.type||this.handleMouseUp({zoomtype:r}),this.makeSelectionRectDraggable()}}}},{key:"handleMouseUp",value:function(e){var t,i=e.zoomtype,n=e.isResized,r=this.w,s=null===(t=this.gridRect)||void 0===t?void 0:t.getBoundingClientRect();s&&(this.w.globals.mousedown||n)&&(this.endX=this.clientX-s.left-r.globals.barPadForNumericAxis,this.endY=this.clientY-s.top,this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(r.globals.zoomEnabled||r.globals.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:i})),r.globals.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.globals.mousedown=!1}},{key:"mouseWheelEvent",value:function(e){var t=this,i=this.w;e.preventDefault();var n=Date.now();n-i.globals.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(e),i.globals.lastWheelExecution=n),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(function(){n-i.globals.lastWheelExecution>t.wheelDelay&&(t.executeMouseWheelZoom(e),i.globals.lastWheelExecution=n)},this.debounceDelay)}},{key:"executeMouseWheelZoom",value:function(e){var t,i=this.w;this.minX=i.globals.isRangeBar?i.globals.minY:i.globals.minX,this.maxX=i.globals.isRangeBar?i.globals.maxY:i.globals.maxX;var n=null===(t=this.gridRect)||void 0===t?void 0:t.getBoundingClientRect();if(n){var r,s,o,a=(e.clientX-n.left)/n.width,l=this.minX,c=this.maxX,h=c-l;if(e.deltaY<0){var d=l+a*h;s=d-(r=.5*h)/2,o=d+r/2}else s=l-(r=1.5*h)/2,o=c+r/2;if(!i.globals.isRangeBar){s=Math.max(s,i.globals.initialMinX),o=Math.min(o,i.globals.initialMaxX);var u=.01*(i.globals.initialMaxX-i.globals.initialMinX);if(o-s<u){var f=(s+o)/2;s=f-u/2,o=f+u/2}}var p=this._getNewMinXMaxX(s,o);isNaN(p.minX)||isNaN(p.maxX)||this.zoomUpdateOptions(p.minX,p.maxX)}}},{key:"makeSelectionRectDraggable",value:function(){var e=this,t=this.w;if(this.selectionRect){var i=this.selectionRect.node.getBoundingClientRect();i.width>0&&i.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:function(){},updateRot:function(){},createHandle:function(e,t,i,n,r){return"l"===r||"r"===r?e.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):e.circle(0)},updateHandle:function(e,t){return e.center(t[0],t[1])}}).resize().on("resize",function(){var i=t.globals.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;e.handleMouseUp({zoomtype:i,isResized:!0})}))}}},{key:"preselectedSelection",value:function(){var e=this.w,t=this.xyRatios;if(!e.globals.zoomEnabled)if(void 0!==e.globals.selection&&null!==e.globals.selection)this.drawSelectionRect(m(m({},e.globals.selection),{},{translateX:e.globals.translateX,translateY:e.globals.translateY}));else if(void 0!==e.config.chart.selection.xaxis.min&&void 0!==e.config.chart.selection.xaxis.max){var i=(e.config.chart.selection.xaxis.min-e.globals.minX)/t.xRatio,n=e.globals.gridWidth-(e.globals.maxX-e.config.chart.selection.xaxis.max)/t.xRatio-i;e.globals.isRangeBar&&(i=(e.config.chart.selection.xaxis.min-e.globals.yAxisScale[0].niceMin)/t.invertedYRatio,n=(e.config.chart.selection.xaxis.max-e.config.chart.selection.xaxis.min)/t.invertedYRatio);var r={x:i,y:0,width:n,height:e.globals.gridHeight,translateX:e.globals.translateX,translateY:e.globals.translateY,selectionEnabled:!0};this.drawSelectionRect(r),this.makeSelectionRectDraggable(),"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,{xaxis:{min:e.config.chart.selection.xaxis.min,max:e.config.chart.selection.xaxis.max},yaxis:{}})}}},{key:"drawSelectionRect",value:function(e){var t=e.x,i=e.y,n=e.width,r=e.height,s=e.translateX,o=void 0===s?0:s,a=e.translateY,l=void 0===a?0:a,c=this.w,h=this.zoomRect,d=this.selectionRect;if(this.dragged||null!==c.globals.selection){var u={transform:"translate("+o+", "+l+")"};c.globals.zoomEnabled&&this.dragged&&(n<0&&(n=1),h.attr({x:t,y:i,width:n,height:r,fill:c.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":c.config.chart.zoom.zoomedArea.fill.opacity,stroke:c.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":c.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":c.config.chart.zoom.zoomedArea.stroke.opacity}),Ai.setAttrs(h.node,u)),c.globals.selectionEnabled&&(d.attr({x:t,y:i,width:n>0?n:0,height:r>0?r:0,fill:c.config.chart.selection.fill.color,"fill-opacity":c.config.chart.selection.fill.opacity,stroke:c.config.chart.selection.stroke.color,"stroke-width":c.config.chart.selection.stroke.width,"stroke-dasharray":c.config.chart.selection.stroke.dashArray,"stroke-opacity":c.config.chart.selection.stroke.opacity}),Ai.setAttrs(d.node,u))}}},{key:"hideSelectionRect",value:function(e){e&&e.attr({x:0,y:0,width:0,height:0})}},{key:"selectionDrawing",value:function(e){var t=e.context,i=e.zoomtype,n=this.w,r=t,s=this.gridRect.getBoundingClientRect(),o=r.startX-1,a=r.startY,l=!1,c=!1,h=r.clientX-s.left-n.globals.barPadForNumericAxis,d=r.clientY-s.top,u=h-o,f=d-a,p={translateX:n.globals.translateX,translateY:n.globals.translateY};return Math.abs(u+o)>n.globals.gridWidth?u=n.globals.gridWidth-o:h<0&&(u=o),o>h&&(l=!0,u=Math.abs(u)),a>d&&(c=!0,f=Math.abs(f)),p=m(m({},p="x"===i?{x:l?o-u:o,y:0,width:u,height:n.globals.gridHeight}:"y"===i?{x:0,y:c?a-f:a,width:n.globals.gridWidth,height:f}:{x:l?o-u:o,y:c?a-f:a,width:u,height:f}),{},{translateX:n.globals.translateX,translateY:n.globals.translateY}),r.drawSelectionRect(p),r.selectionDragging("resizing"),p}},{key:"selectionDragging",value:function(e,t){var i=this,n=this.w;if(t){t.preventDefault();var r=t.detail,s=r.handler,o=r.box,a=o.x,l=o.y;a<this.constraints.x&&(a=this.constraints.x),l<this.constraints.y&&(l=this.constraints.y),o.x2>this.constraints.x2&&(a=this.constraints.x2-o.w),o.y2>this.constraints.y2&&(l=this.constraints.y2-o.h),s.move(a,l);var c=this.xyRatios,h=this.selectionRect,d=0;"resizing"===e&&(d=30);var u=function(e){return parseFloat(h.node.getAttribute(e))},f={x:u("x"),y:u("y"),width:u("width"),height:u("height")};n.globals.selection=f,"function"==typeof n.config.chart.events.selection&&n.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout(function(){var e,t,r,s,o=i.gridRect.getBoundingClientRect(),a=h.node.getBoundingClientRect();n.globals.isRangeBar?(e=n.globals.yAxisScale[0].niceMin+(a.left-o.left)*c.invertedYRatio,t=n.globals.yAxisScale[0].niceMin+(a.right-o.left)*c.invertedYRatio,r=0,s=1):(e=n.globals.xAxisScale.niceMin+(a.left-o.left)*c.xRatio,t=n.globals.xAxisScale.niceMin+(a.right-o.left)*c.xRatio,r=n.globals.yAxisScale[0].niceMin+(o.bottom-a.bottom)*c.yRatio[0],s=n.globals.yAxisScale[0].niceMax-(a.top-o.top)*c.yRatio[0]);var l={xaxis:{min:e,max:t},yaxis:{min:r,max:s}};n.config.chart.events.selection(i.ctx,l),n.config.chart.brush.enabled&&void 0!==n.config.chart.events.brushScrolled&&n.config.chart.events.brushScrolled(i.ctx,l)},d))}}},{key:"selectionDrawn",value:function(e){var t,i,n=e.context,r=e.zoomtype,s=this.w,o=n,a=this.xyRatios,l=this.ctx.toolbar,c=s.globals.zoomEnabled?o.zoomRect.node.getBoundingClientRect():o.selectionRect.node.getBoundingClientRect(),h=o.gridRect.getBoundingClientRect(),d=c.left-h.left-s.globals.barPadForNumericAxis,u=c.right-h.left-s.globals.barPadForNumericAxis,f=c.top-h.top,p=c.bottom-h.top;s.globals.isRangeBar?(t=s.globals.yAxisScale[0].niceMin+d*a.invertedYRatio,i=s.globals.yAxisScale[0].niceMin+u*a.invertedYRatio):(t=s.globals.xAxisScale.niceMin+d*a.xRatio,i=s.globals.xAxisScale.niceMin+u*a.xRatio);var m=[],g=[];if(s.config.yaxis.forEach(function(e,t){var i=s.globals.seriesYAxisMap[t][0],n=s.globals.yAxisScale[t].niceMax-a.yRatio[i]*f,r=s.globals.yAxisScale[t].niceMax-a.yRatio[i]*p;m.push(n),g.push(r)}),o.dragged&&(o.dragX>10||o.dragY>10)&&t!==i)if(s.globals.zoomEnabled){var _=w.clone(s.globals.initialConfig.yaxis),y=w.clone(s.globals.initialConfig.xaxis);if(s.globals.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),i=Math.floor(i),t<1&&(t=1,i=s.globals.dataPoints),i-t<2&&(i=t+1)),"xy"!==r&&"x"!==r||(y={min:t,max:i}),"xy"!==r&&"y"!==r||_.forEach(function(e,t){_[t].min=g[t],_[t].max=m[t]}),l){var v=l.getBeforeZoomRange(y,_);v&&(y=v.xaxis?v.xaxis:y,_=v.yaxis?v.yaxis:_)}var x={xaxis:y};s.config.chart.group||(x.yaxis=_),o.ctx.updateHelpers._updateOptions(x,!1,o.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof s.config.chart.events.zoomed&&l.zoomCallback(y,_)}else if(s.globals.selectionEnabled){var b,S=null;b={min:t,max:i},"xy"!==r&&"y"!==r||(S=w.clone(s.config.yaxis)).forEach(function(e,t){S[t].min=g[t],S[t].max=m[t]}),s.globals.selection=o.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(o.ctx,{xaxis:b,yaxis:S})}}},{key:"panDragging",value:function(e){var t=e.context,i=this.w,n=t;if(void 0!==i.globals.lastClientPosition.x){var r=i.globals.lastClientPosition.x-n.clientX,s=i.globals.lastClientPosition.y-n.clientY;Math.abs(r)>Math.abs(s)&&r>0?this.moveDirection="left":Math.abs(r)>Math.abs(s)&&r<0?this.moveDirection="right":Math.abs(s)>Math.abs(r)&&s>0?this.moveDirection="up":Math.abs(s)>Math.abs(r)&&s<0&&(this.moveDirection="down")}i.globals.lastClientPosition={x:n.clientX,y:n.clientY};var o=i.globals.isRangeBar?i.globals.minY:i.globals.minX,a=i.globals.isRangeBar?i.globals.maxY:i.globals.maxX;n.panScrolled(o,a)}},{key:"panScrolled",value:function(e,t){var i=this.w,n=this.xyRatios,r=w.clone(i.globals.initialConfig.yaxis),s=n.xRatio,o=i.globals.minX,a=i.globals.maxX;i.globals.isRangeBar&&(s=n.invertedYRatio,o=i.globals.minY,a=i.globals.maxY),"left"===this.moveDirection?(e=o+i.globals.gridWidth/15*s,t=a+i.globals.gridWidth/15*s):"right"===this.moveDirection&&(e=o-i.globals.gridWidth/15*s,t=a-i.globals.gridWidth/15*s),i.globals.isRangeBar||(e<i.globals.initialMinX||t>i.globals.initialMaxX)&&(e=o,t=a);var l={xaxis:{min:e,max:t}};i.config.chart.group||(l.yaxis=r),this.updateScrolledChart(l,e,t)}},{key:"updateScrolledChart",value:function(e,t,i){var n=this.w;if(this.ctx.updateHelpers._updateOptions(e,!1,!1),"function"==typeof n.config.chart.events.scrolled){var r={xaxis:{min:t,max:i}};n.config.chart.events.scrolled(this.ctx,r),this.ctx.events.fireEvent("scrolled",r)}}}]),t}(),bn=function(){function e(t){s(this,e),this.w=t.w,this.ttCtx=t,this.ctx=t.ctx}return a(e,[{key:"getNearestValues",value:function(e){var t=e.hoverArea,i=e.elGrid,n=e.clientX,r=e.clientY,s=this.w,o=i.getBoundingClientRect(),a=o.width,l=o.height,c=a/(s.globals.dataPoints-1),h=l/s.globals.dataPoints,d=this.hasBars();!s.globals.comboCharts&&!d||s.config.xaxis.convertedCatToNumeric||(c=a/s.globals.dataPoints);var u=n-o.left-s.globals.barPadForNumericAxis,f=r-o.top;u<0||f<0||u>a||f>l?(t.classList.remove("hovering-zoom"),t.classList.remove("hovering-pan")):s.globals.zoomEnabled?(t.classList.remove("hovering-pan"),t.classList.add("hovering-zoom")):s.globals.panEnabled&&(t.classList.remove("hovering-zoom"),t.classList.add("hovering-pan"));var p=Math.round(u/c),m=Math.floor(f/h);d&&!s.config.xaxis.convertedCatToNumeric&&(p=Math.ceil(u/c),p-=1);var g=null,_=null,y=s.globals.seriesXvalues.map(function(e){return e.filter(function(e){return w.isNumber(e)})}),v=s.globals.seriesYvalues.map(function(e){return e.filter(function(e){return w.isNumber(e)})});if(s.globals.isXNumeric){var x=this.ttCtx.getElGrid().getBoundingClientRect(),b=u*(x.width/a),S=f*(x.height/l);g=(_=this.closestInMultiArray(b,S,y,v)).index,p=_.j,null!==g&&s.globals.hasNullValues&&(y=s.globals.seriesXvalues[g],p=(_=this.closestInArray(b,y)).j)}return s.globals.capturedSeriesIndex=null===g?-1:g,(!p||p<1)&&(p=0),s.globals.isBarHorizontal?s.globals.capturedDataPointIndex=m:s.globals.capturedDataPointIndex=p,{capturedSeries:g,j:s.globals.isBarHorizontal?m:p,hoverX:u,hoverY:f}}},{key:"getFirstActiveXArray",value:function(e){for(var t=this.w,i=0,n=e.map(function(e,t){return e.length>0?t:-1}),r=0;r<n.length;r++)if(-1!==n[r]&&-1===t.globals.collapsedSeriesIndices.indexOf(r)&&-1===t.globals.ancillaryCollapsedSeriesIndices.indexOf(r)){i=n[r];break}return i}},{key:"closestInMultiArray",value:function(e,t,i,n){for(var r,s=this.w,o=1/0,a=null,l=null,c=0;c<i.length;c++)if(r=c,-1===s.globals.collapsedSeriesIndices.indexOf(r)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(r))for(var h=i[c],d=n[c],u=Math.min(h.length,d.length),f=0;f<u;f++){var p=e-h[f],m=Math.sqrt(p*p);if(!s.globals.allSeriesHasEqualX){var g=t-d[f];m=Math.sqrt(p*p+g*g)}m<o&&(o=m,a=c,l=f)}return{index:a,j:l}}},{key:"closestInArray",value:function(e,t){for(var i=t[0],n=null,r=Math.abs(e-i),s=0;s<t.length;s++){var o=Math.abs(e-t[s]);o<r&&(r=o,n=s)}return{j:n}}},{key:"isXoverlap",value:function(e){var t=[],i=this.w.globals.seriesX.filter(function(e){return void 0!==e[0]});if(i.length>0)for(var n=0;n<i.length-1;n++)void 0!==i[n][e]&&void 0!==i[n+1][e]&&i[n][e]!==i[n+1][e]&&t.push("unEqual");return 0===t.length}},{key:"isInitialSeriesSameLen",value:function(){for(var e=!0,t=this.w.globals.initialSeries,i=0;i<t.length-1;i++)if(t[i].data.length!==t[i+1].data.length){e=!1;break}return e}},{key:"getBarsHeight",value:function(e){return y(e).reduce(function(e,t){return e+t.getBBox().height},0)}},{key:"getElMarkers",value:function(e){return"number"==typeof e?this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:realIndex='".concat(e,"'] .apexcharts-series-markers-wrap > *")):this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}},{key:"getAllMarkers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap");i=y(i),t&&(i=i.filter(function(t){var i=Number(t.getAttribute("data:realIndex"));return-1===e.w.globals.collapsedSeriesIndices.indexOf(i)})),i.sort(function(e,t){var i=Number(e.getAttribute("data:realIndex")),n=Number(t.getAttribute("data:realIndex"));return n<i?1:n>i?-1:0});var n=[];return i.forEach(function(e){n.push(e.querySelector(".apexcharts-marker"))}),n}},{key:"hasMarkers",value:function(e){return this.getElMarkers(e).length>0}},{key:"getPathFromPoint",value:function(e,t){var i=Number(e.getAttribute("cx")),n=Number(e.getAttribute("cy")),r=e.getAttribute("shape");return new Ai(this.ctx).getMarkerPath(i,n,r,t)}},{key:"getElBars",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-rangebar-series")}},{key:"hasBars",value:function(){return this.getElBars().length>0}},{key:"getHoverMarkerSize",value:function(e){var t=this.w,i=t.config.markers.hover.size;return void 0===i&&(i=t.globals.markers.size[e]+t.config.markers.hover.sizeOffset),i}},{key:"toggleAllTooltipSeriesGroups",value:function(e){var t=this.w,i=this.ttCtx;0===i.allTooltipSeriesGroups.length&&(i.allTooltipSeriesGroups=t.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));for(var n=i.allTooltipSeriesGroups,r=0;r<n.length;r++)"enable"===e?(n[r].classList.add("apexcharts-active"),n[r].style.display=t.config.tooltip.items.display):(n[r].classList.remove("apexcharts-active"),n[r].style.display="none")}}]),e}(),wn=function(){function e(t){s(this,e),this.w=t.w,this.ctx=t.ctx,this.ttCtx=t,this.tooltipUtil=new bn(t)}return a(e,[{key:"drawSeriesTexts",value:function(e){var t=e.shared,i=void 0===t||t,n=e.ttItems,r=e.i,s=void 0===r?0:r,o=e.j,a=void 0===o?null:o,l=e.y1,c=e.y2,h=e.e,d=this.w;void 0!==d.config.tooltip.custom?this.handleCustomTooltip({i:s,j:a,y1:l,y2:c,w:d}):this.toggleActiveInactiveSeries(i,s);var u=this.getValuesToPrint({i:s,j:a});this.printLabels({i:s,j:a,values:u,ttItems:n,shared:i,e:h});var f=this.ttCtx.getElTooltip();this.ttCtx.tooltipRect.ttWidth=f.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=f.getBoundingClientRect().height}},{key:"printLabels",value:function(e){var t,i=this,n=e.i,r=e.j,s=e.values,o=e.ttItems,a=e.shared,l=e.e,c=this.w,h=[],d=function(e){return c.globals.seriesGoals[e]&&c.globals.seriesGoals[e][r]&&Array.isArray(c.globals.seriesGoals[e][r])},u=s.xVal,f=s.zVal,p=s.xAxisTTVal,g="",_=c.globals.colors[n];null!==r&&c.config.plotOptions.bar.distributed&&(_=c.globals.colors[r]);for(var y=function(e,s){var y=i.getFormatters(n);g=i.getSeriesName({fn:y.yLbTitleFormatter,index:n,seriesIndex:n,j:r}),"treemap"===c.config.chart.type&&(g=y.yLbTitleFormatter(String(c.config.series[n].data[r].x),{series:c.globals.series,seriesIndex:n,dataPointIndex:r,w:c}));var v=c.config.tooltip.inverseOrder?s:e;if(c.globals.axisCharts){var x=function(e){var t,i,n,s;return c.globals.isRangeData?y.yLbFormatter(null===(t=c.globals.seriesRangeStart)||void 0===t||null===(i=t[e])||void 0===i?void 0:i[r],{series:c.globals.seriesRangeStart,seriesIndex:e,dataPointIndex:r,w:c})+" - "+y.yLbFormatter(null===(n=c.globals.seriesRangeEnd)||void 0===n||null===(s=n[e])||void 0===s?void 0:s[r],{series:c.globals.seriesRangeEnd,seriesIndex:e,dataPointIndex:r,w:c}):y.yLbFormatter(c.globals.series[e][r],{series:c.globals.series,seriesIndex:e,dataPointIndex:r,w:c})};if(a)y=i.getFormatters(v),g=i.getSeriesName({fn:y.yLbTitleFormatter,index:v,seriesIndex:n,j:r}),_=c.globals.colors[v],t=x(v),d(v)&&(h=c.globals.seriesGoals[v][r].map(function(e){return{attrs:e,val:y.yLbFormatter(e.value,{seriesIndex:v,dataPointIndex:r,w:c})}}));else{var b,w=null==l||null===(b=l.target)||void 0===b?void 0:b.getAttribute("fill");w&&(-1!==w.indexOf("url")?-1!==w.indexOf("Pattern")&&(_=c.globals.dom.baseEl.querySelector(w.substr(4).slice(0,-1)).childNodes[0].getAttribute("stroke")):_=w),t=x(n),d(n)&&Array.isArray(c.globals.seriesGoals[n][r])&&(h=c.globals.seriesGoals[n][r].map(function(e){return{attrs:e,val:y.yLbFormatter(e.value,{seriesIndex:n,dataPointIndex:r,w:c})}}))}}null===r&&(t=y.yLbFormatter(c.globals.series[n],m(m({},c),{},{seriesIndex:n,dataPointIndex:n}))),i.DOMHandling({i:n,t:v,j:r,ttItems:o,values:{val:t,goalVals:h,xVal:u,xAxisTTVal:p,zVal:f},seriesName:g,shared:a,pColor:_})},v=0,x=c.globals.series.length-1;v<c.globals.series.length;v++,x--)y(v,x)}},{key:"getFormatters",value:function(e){var t,i=this.w,n=i.globals.yLabelFormatters[e];return void 0!==i.globals.ttVal?Array.isArray(i.globals.ttVal)?(n=i.globals.ttVal[e]&&i.globals.ttVal[e].formatter,t=i.globals.ttVal[e]&&i.globals.ttVal[e].title&&i.globals.ttVal[e].title.formatter):(n=i.globals.ttVal.formatter,"function"==typeof i.globals.ttVal.title.formatter&&(t=i.globals.ttVal.title.formatter)):t=i.config.tooltip.y.title.formatter,"function"!=typeof n&&(n=i.globals.yLabelFormatters[0]?i.globals.yLabelFormatters[0]:function(e){return e}),"function"!=typeof t&&(t=function(e){return e?e+": ":""}),{yLbFormatter:n,yLbTitleFormatter:t}}},{key:"getSeriesName",value:function(e){var t=e.fn,i=e.index,n=e.seriesIndex,r=e.j,s=this.w;return t(String(s.globals.seriesNames[i]),{series:s.globals.series,seriesIndex:n,dataPointIndex:r,w:s})}},{key:"DOMHandling",value:function(e){e.i;var t=e.t,i=e.j,n=e.ttItems,r=e.values,s=e.seriesName,o=e.shared,a=e.pColor,l=this.w,c=this.ttCtx,h=r.val,d=r.goalVals,u=r.xVal,f=r.xAxisTTVal,p=r.zVal,m=null;m=n[t].children,l.config.tooltip.fillSeriesColor&&(n[t].style.backgroundColor=a,m[0].style.display="none"),c.showTooltipTitle&&(null===c.tooltipTitle&&(c.tooltipTitle=l.globals.dom.baseEl.querySelector(".apexcharts-tooltip-title")),c.tooltipTitle.innerHTML=u),c.isXAxisTooltipEnabled&&(c.xaxisTooltipText.innerHTML=""!==f?f:u);var g=n[t].querySelector(".apexcharts-tooltip-text-y-label");g&&(g.innerHTML=s||"");var _=n[t].querySelector(".apexcharts-tooltip-text-y-value");_&&(_.innerHTML=void 0!==h?h:""),m[0]&&m[0].classList.contains("apexcharts-tooltip-marker")&&(l.config.tooltip.marker.fillColors&&Array.isArray(l.config.tooltip.marker.fillColors)&&(a=l.config.tooltip.marker.fillColors[t]),l.config.tooltip.fillSeriesColor?m[0].style.backgroundColor=a:m[0].style.color=a),l.config.tooltip.marker.show||(m[0].style.display="none");var y=n[t].querySelector(".apexcharts-tooltip-text-goals-label"),v=n[t].querySelector(".apexcharts-tooltip-text-goals-value");if(d.length&&l.globals.seriesGoals[t]){var x=function(){var e="<div>",t="<div>";d.forEach(function(i,n){e+=' <div style="display: flex"><span class="apexcharts-tooltip-marker" style="background-color: '.concat(i.attrs.strokeColor,'; height: 3px; border-radius: 0; top: 5px;"></span> ').concat(i.attrs.name,"</div>"),t+="<div>".concat(i.val,"</div>")}),y.innerHTML=e+"</div>",v.innerHTML=t+"</div>"};o?l.globals.seriesGoals[t][i]&&Array.isArray(l.globals.seriesGoals[t][i])?x():(y.innerHTML="",v.innerHTML=""):x()}else y.innerHTML="",v.innerHTML="";if(null!==p&&(n[t].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=l.config.tooltip.z.title,n[t].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=void 0!==p?p:""),o&&m[0]){if(l.config.tooltip.hideEmptySeries){var b=n[t].querySelector(".apexcharts-tooltip-marker"),w=n[t].querySelector(".apexcharts-tooltip-text");0==parseFloat(h)?(b.style.display="none",w.style.display="none"):(b.style.display="block",w.style.display="block")}null==h||l.globals.ancillaryCollapsedSeriesIndices.indexOf(t)>-1||l.globals.collapsedSeriesIndices.indexOf(t)>-1||Array.isArray(c.tConfig.enabledOnSeries)&&-1===c.tConfig.enabledOnSeries.indexOf(t)?m[0].parentNode.style.display="none":m[0].parentNode.style.display=l.config.tooltip.items.display}else Array.isArray(c.tConfig.enabledOnSeries)&&-1===c.tConfig.enabledOnSeries.indexOf(t)&&(m[0].parentNode.style.display="none")}},{key:"toggleActiveInactiveSeries",value:function(e,t){var i=this.w;if(e)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");var n=i.globals.dom.baseEl.querySelector(".apexcharts-tooltip-series-group-".concat(t));n&&(n.classList.add("apexcharts-active"),n.style.display=i.config.tooltip.items.display)}}},{key:"getValuesToPrint",value:function(e){var t=e.i,i=e.j,n=this.w,r=this.ctx.series.filteredSeriesX(),s="",o="",a=null,l=null,c={series:n.globals.series,seriesIndex:t,dataPointIndex:i,w:n},h=n.globals.ttZFormatter;null===i?l=n.globals.series[t]:n.globals.isXNumeric&&"treemap"!==n.config.chart.type?(s=r[t][i],0===r[t].length&&(s=r[this.tooltipUtil.getFirstActiveXArray(r)][i])):s=new Ji(this.ctx).isFormatXY()?void 0!==n.config.series[t].data[i]?n.config.series[t].data[i].x:"":void 0!==n.globals.labels[i]?n.globals.labels[i]:"";var d=s;return s=n.globals.isXNumeric&&"datetime"===n.config.xaxis.type?new Ii(this.ctx).xLabelFormat(n.globals.ttKeyFormatter,d,d,{i:void 0,dateFormatter:new Ei(this.ctx).formatDate,w:this.w}):n.globals.isBarHorizontal?n.globals.yLabelFormatters[0](d,c):n.globals.xLabelFormatter(d,c),void 0!==n.config.tooltip.x.formatter&&(s=n.globals.ttKeyFormatter(d,c)),n.globals.seriesZ.length>0&&n.globals.seriesZ[t].length>0&&(a=h(n.globals.seriesZ[t][i],n)),o="function"==typeof n.config.xaxis.tooltip.formatter?n.globals.xaxisTooltipFormatter(d,c):s,{val:Array.isArray(l)?l.join(" "):l,xVal:Array.isArray(s)?s.join(" "):s,xAxisTTVal:Array.isArray(o)?o.join(" "):o,zVal:a}}},{key:"handleCustomTooltip",value:function(e){var t=e.i,i=e.j,n=e.y1,r=e.y2,s=e.w,o=this.ttCtx.getElTooltip(),a=s.config.tooltip.custom;Array.isArray(a)&&a[t]&&(a=a[t]);var l=a({ctx:this.ctx,series:s.globals.series,seriesIndex:t,dataPointIndex:i,y1:n,y2:r,w:s});"string"==typeof l||"number"==typeof l?o.innerHTML=l:(l instanceof Element||"string"==typeof l.nodeName)&&(o.innerHTML="",o.appendChild(l.cloneNode(!0)))}}]),e}(),Sn=function(){function e(t){s(this,e),this.ttCtx=t,this.ctx=t.ctx,this.w=t.w}return a(e,[{key:"moveXCrosshairs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.ttCtx,n=this.w,r=i.getElXCrosshairs(),s=e-i.xcrosshairsWidth/2,o=n.globals.labels.slice().length;if(null!==t&&(s=n.globals.gridWidth/o*t),null===r||n.globals.isBarHorizontal||(r.setAttribute("x",s),r.setAttribute("x1",s),r.setAttribute("x2",s),r.setAttribute("y2",n.globals.gridHeight),r.classList.add("apexcharts-active")),s<0&&(s=0),s>n.globals.gridWidth&&(s=n.globals.gridWidth),i.isXAxisTooltipEnabled){var a=s;"tickWidth"!==n.config.xaxis.crosshairs.width&&"barWidth"!==n.config.xaxis.crosshairs.width||(a=s+i.xcrosshairsWidth/2),this.moveXAxisTooltip(a)}}},{key:"moveYCrosshairs",value:function(e){var t=this.ttCtx;null!==t.ycrosshairs&&Ai.setAttrs(t.ycrosshairs,{y1:e,y2:e}),null!==t.ycrosshairsHidden&&Ai.setAttrs(t.ycrosshairsHidden,{y1:e,y2:e})}},{key:"moveXAxisTooltip",value:function(e){var t=this.w,i=this.ttCtx;if(null!==i.xaxisTooltip&&0!==i.xcrosshairsWidth){i.xaxisTooltip.classList.add("apexcharts-active");var n,r=i.xaxisOffY+t.config.xaxis.tooltip.offsetY+t.globals.translateY+1+t.config.xaxis.offsetY;e-=i.xaxisTooltip.getBoundingClientRect().width/2,isNaN(e)||(e+=t.globals.translateX,n=new Ai(this.ctx).getTextRects(i.xaxisTooltipText.innerHTML),i.xaxisTooltipText.style.minWidth=n.width+"px",i.xaxisTooltip.style.left=e+"px",i.xaxisTooltip.style.top=r+"px")}}},{key:"moveYAxisTooltip",value:function(e){var t=this.w,i=this.ttCtx;null===i.yaxisTTEls&&(i.yaxisTTEls=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));var n=parseInt(i.ycrosshairsHidden.getAttribute("y1"),10),r=t.globals.translateY+n,s=i.yaxisTTEls[e].getBoundingClientRect(),o=s.height,a=t.globals.translateYAxisX[e]-2;t.config.yaxis[e].opposite&&(a-=s.width),r-=o/2,-1===t.globals.ignoreYAxisIndexes.indexOf(e)&&r>0&&r<t.globals.gridHeight?(i.yaxisTTEls[e].classList.add("apexcharts-active"),i.yaxisTTEls[e].style.top=r+"px",i.yaxisTTEls[e].style.left=a+t.config.yaxis[e].tooltip.offsetX+"px"):i.yaxisTTEls[e].classList.remove("apexcharts-active")}},{key:"moveTooltip",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=this.w,r=this.ttCtx,s=r.getElTooltip(),o=r.tooltipRect,a=null!==i?parseFloat(i):1,l=parseFloat(e)+a+5,c=parseFloat(t)+a/2;if(l>n.globals.gridWidth/2&&(l=l-o.ttWidth-a-10),l>n.globals.gridWidth-o.ttWidth-10&&(l=n.globals.gridWidth-o.ttWidth),l<-20&&(l=-20),n.config.tooltip.followCursor){var h=r.getElGrid().getBoundingClientRect();(l=r.e.clientX-h.left)>n.globals.gridWidth/2&&(l-=r.tooltipRect.ttWidth),(c=r.e.clientY+n.globals.translateY-h.top)>n.globals.gridHeight/2&&(c-=r.tooltipRect.ttHeight)}else n.globals.isBarHorizontal||o.ttHeight/2+c>n.globals.gridHeight&&(c=n.globals.gridHeight-o.ttHeight+n.globals.translateY);isNaN(l)||(l+=n.globals.translateX,s.style.left=l+"px",s.style.top=c+"px")}},{key:"moveMarkers",value:function(e,t){var i=this.w,n=this.ttCtx;if(i.globals.markers.size[e]>0)for(var r=i.globals.dom.baseEl.querySelectorAll(" .apexcharts-series[data\\:realIndex='".concat(e,"'] .apexcharts-marker")),s=0;s<r.length;s++)parseInt(r[s].getAttribute("rel"),10)===t&&(n.marker.resetPointsSize(),n.marker.enlargeCurrentPoint(t,r[s]));else n.marker.resetPointsSize(),this.moveDynamicPointOnHover(t,e)}},{key:"moveDynamicPointOnHover",value:function(e,t){var i,n,r,s,o=this.w,a=this.ttCtx,l=new Ai(this.ctx),c=o.globals.pointsArray,h=a.tooltipUtil.getHoverMarkerSize(t),d=o.config.series[t].type;if(!d||"column"!==d&&"candlestick"!==d&&"boxPlot"!==d){r=null===(i=c[t][e])||void 0===i?void 0:i[0],s=(null===(n=c[t][e])||void 0===n?void 0:n[1])||0;var u=o.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(t,"'] .apexcharts-series-markers path"));if(u&&s<o.globals.gridHeight&&s>0){var f=u.getAttribute("shape"),p=l.getMarkerPath(r,s,f,1.5*h);u.setAttribute("d",p)}this.moveXCrosshairs(r),a.fixedTooltip||this.moveTooltip(r,s,h)}}},{key:"moveDynamicPointsOnHover",value:function(e){var t,i=this.ttCtx,n=i.w,r=0,s=0,o=n.globals.pointsArray,a=new Zi(this.ctx),l=new Ai(this.ctx);t=a.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);var c=i.tooltipUtil.getHoverMarkerSize(t);if(o[t]&&(r=o[t][e][0],s=o[t][e][1]),!isNaN(r)){var h=i.tooltipUtil.getAllMarkers();if(h.length)for(var d=0;d<n.globals.series.length;d++){var u=o[d];if(n.globals.comboCharts&&void 0===u&&h.splice(d,0,null),u&&u.length){var f=o[d][e][1],p=void 0;h[d].setAttribute("cx",r);var m=h[d].getAttribute("shape");if("rangeArea"===n.config.chart.type&&!n.globals.comboCharts){var g=e+n.globals.series[d].length;p=o[d][g][1],f-=Math.abs(f-p)/2}if(null!==f&&!isNaN(f)&&f<n.globals.gridHeight+c&&f+c>0){var _=l.getMarkerPath(r,f,m,c);h[d].setAttribute("d",_)}else h[d].setAttribute("d","")}}this.moveXCrosshairs(r),i.fixedTooltip||this.moveTooltip(r,s||n.globals.gridHeight,c)}}},{key:"moveStickyTooltipOverBars",value:function(e,t){var i=this.w,n=this.ttCtx,r=i.globals.columnSeries?i.globals.columnSeries.length:i.globals.series.length;i.config.chart.stacked&&(r=i.globals.barGroups.length);var s=r>=2&&r%2==0?Math.floor(r/2):Math.floor(r/2)+1;i.globals.isBarHorizontal&&(s=new Zi(this.ctx).getActiveConfigSeriesIndex("desc")+1);var o=i.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[rel='".concat(s,"'] path[j='").concat(e,"'], .apexcharts-candlestick-series .apexcharts-series[rel='").concat(s,"'] path[j='").concat(e,"'], .apexcharts-boxPlot-series .apexcharts-series[rel='").concat(s,"'] path[j='").concat(e,"'], .apexcharts-rangebar-series .apexcharts-series[rel='").concat(s,"'] path[j='").concat(e,"']"));o||"number"!=typeof t||(o=i.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[data\\:realIndex='".concat(t,"'] path[j='").concat(e,"'],\n .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='").concat(t,"'] path[j='").concat(e,"'],\n .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='").concat(t,"'] path[j='").concat(e,"'],\n .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='").concat(t,"'] path[j='").concat(e,"']")));var a=o?parseFloat(o.getAttribute("cx")):0,l=o?parseFloat(o.getAttribute("cy")):0,c=o?parseFloat(o.getAttribute("barWidth")):0,h=n.getElGrid().getBoundingClientRect(),d=o&&(o.classList.contains("apexcharts-candlestick-area")||o.classList.contains("apexcharts-boxPlot-area"));i.globals.isXNumeric?(o&&!d&&(a-=r%2!=0?c/2:0),o&&d&&(a-=c/2)):i.globals.isBarHorizontal||(a=n.xAxisTicksPositions[e-1]+n.dataPointsDividedWidth/2,isNaN(a)&&(a=n.xAxisTicksPositions[e]-n.dataPointsDividedWidth/2)),i.globals.isBarHorizontal?l-=n.tooltipRect.ttHeight:i.config.tooltip.followCursor?l=n.e.clientY-h.top-n.tooltipRect.ttHeight/2:l+n.tooltipRect.ttHeight+15>i.globals.gridHeight&&(l=i.globals.gridHeight),i.globals.isBarHorizontal||this.moveXCrosshairs(a),n.fixedTooltip||this.moveTooltip(a,l||i.globals.gridHeight)}}]),e}(),Tn=function(){function e(t){s(this,e),this.w=t.w,this.ttCtx=t,this.ctx=t.ctx,this.tooltipPosition=new Sn(t)}return a(e,[{key:"drawDynamicPoints",value:function(){var e=this.w,t=new Ai(this.ctx),i=new $i(this.ctx),n=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series");n=y(n),e.config.chart.stacked&&n.sort(function(e,t){return parseFloat(e.getAttribute("data:realIndex"))-parseFloat(t.getAttribute("data:realIndex"))});for(var r=0;r<n.length;r++){var s=n[r].querySelector(".apexcharts-series-markers-wrap");if(null!==s){var o=void 0,a="apexcharts-marker w".concat((Math.random()+1).toString(36).substring(4));"line"!==e.config.chart.type&&"area"!==e.config.chart.type||e.globals.comboCharts||e.config.tooltip.intersect||(a+=" no-pointer-events");var l=i.getMarkerConfig({cssClass:a,seriesIndex:Number(s.getAttribute("data:realIndex"))});(o=t.drawMarker(0,0,l)).node.setAttribute("default-marker-size",0);var c=document.createElementNS(e.globals.SVGNS,"g");c.classList.add("apexcharts-series-markers"),c.appendChild(o.node),s.appendChild(c)}}}},{key:"enlargeCurrentPoint",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=this.w;"bubble"!==r.config.chart.type&&this.newPointSize(e,t);var s=t.getAttribute("cx"),o=t.getAttribute("cy");if(null!==i&&null!==n&&(s=i,o=n),this.tooltipPosition.moveXCrosshairs(s),!this.fixedTooltip){if("radar"===r.config.chart.type){var a=this.ttCtx.getElGrid().getBoundingClientRect();s=this.ttCtx.e.clientX-a.left}this.tooltipPosition.moveTooltip(s,o,r.config.markers.hover.size)}}},{key:"enlargePoints",value:function(e){for(var t=this.w,i=this,n=this.ttCtx,r=e,s=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),o=t.config.markers.hover.size,a=0;a<s.length;a++){var l=s[a].getAttribute("rel"),c=s[a].getAttribute("index");if(void 0===o&&(o=t.globals.markers.size[c]+t.config.markers.hover.sizeOffset),r===parseInt(l,10)){i.newPointSize(r,s[a]);var h=s[a].getAttribute("cx"),d=s[a].getAttribute("cy");i.tooltipPosition.moveXCrosshairs(h),n.fixedTooltip||i.tooltipPosition.moveTooltip(h,d,o)}else i.oldPointSize(s[a])}}},{key:"newPointSize",value:function(e,t){var i=this.w,n=i.config.markers.hover.size,r=0===e?t.parentNode.firstChild:t.parentNode.lastChild;if("0"!==r.getAttribute("default-marker-size")){var s=parseInt(r.getAttribute("index"),10);void 0===n&&(n=i.globals.markers.size[s]+i.config.markers.hover.sizeOffset),n<0&&(n=0);var o=this.ttCtx.tooltipUtil.getPathFromPoint(t,n);t.setAttribute("d",o)}}},{key:"oldPointSize",value:function(e){var t=parseFloat(e.getAttribute("default-marker-size")),i=this.ttCtx.tooltipUtil.getPathFromPoint(e,t);e.setAttribute("d",i)}},{key:"resetPointsSize",value:function(){for(var e=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),t=0;t<e.length;t++){var i=parseFloat(e[t].getAttribute("default-marker-size"));if(w.isNumber(i)&&i>0){var n=this.ttCtx.tooltipUtil.getPathFromPoint(e[t],i);e[t].setAttribute("d",n)}else e[t].setAttribute("d","M0,0")}}}]),e}(),kn=function(){function e(t){s(this,e),this.w=t.w;var i=this.w;this.ttCtx=t,this.isVerticalGroupedRangeBar=!i.globals.isBarHorizontal&&"rangeBar"===i.config.chart.type&&i.config.plotOptions.bar.rangeBarGroupRows}return a(e,[{key:"getAttr",value:function(e,t){return parseFloat(e.target.getAttribute(t))}},{key:"handleHeatTreeTooltip",value:function(e){var t=e.e,i=e.opt,n=e.x,r=e.y,s=e.type,o=this.ttCtx,a=this.w;if(t.target.classList.contains("apexcharts-".concat(s,"-rect"))){var l=this.getAttr(t,"i"),c=this.getAttr(t,"j"),h=this.getAttr(t,"cx"),d=this.getAttr(t,"cy"),u=this.getAttr(t,"width"),f=this.getAttr(t,"height");if(o.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:l,j:c,shared:!1,e:t}),a.globals.capturedSeriesIndex=l,a.globals.capturedDataPointIndex=c,n=h+o.tooltipRect.ttWidth/2+u,r=d+o.tooltipRect.ttHeight/2-f/2,o.tooltipPosition.moveXCrosshairs(h+u/2),n>a.globals.gridWidth/2&&(n=h-o.tooltipRect.ttWidth/2+u),o.w.config.tooltip.followCursor){var p=a.globals.dom.elWrap.getBoundingClientRect();n=a.globals.clientX-p.left-(n>a.globals.gridWidth/2?o.tooltipRect.ttWidth:0),r=a.globals.clientY-p.top-(r>a.globals.gridHeight/2?o.tooltipRect.ttHeight:0)}}return{x:n,y:r}}},{key:"handleMarkerTooltip",value:function(e){var t,i,n=e.e,r=e.opt,s=e.x,o=e.y,a=this.w,l=this.ttCtx;if(n.target.classList.contains("apexcharts-marker")){var c=parseInt(r.paths.getAttribute("cx"),10),h=parseInt(r.paths.getAttribute("cy"),10),d=parseFloat(r.paths.getAttribute("val"));if(i=parseInt(r.paths.getAttribute("rel"),10),t=parseInt(r.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,l.intersect){var u=w.findAncestor(r.paths,"apexcharts-series");u&&(t=parseInt(u.getAttribute("data:realIndex"),10))}if(l.tooltipLabels.drawSeriesTexts({ttItems:r.ttItems,i:t,j:i,shared:!l.showOnIntersect&&a.config.tooltip.shared,e:n}),"mouseup"===n.type&&l.markerClick(n,t,i),a.globals.capturedSeriesIndex=t,a.globals.capturedDataPointIndex=i,s=c,o=h+a.globals.translateY-1.4*l.tooltipRect.ttHeight,l.w.config.tooltip.followCursor){var f=l.getElGrid().getBoundingClientRect();o=l.e.clientY+a.globals.translateY-f.top}d<0&&(o=h),l.marker.enlargeCurrentPoint(i,r.paths,s,o)}return{x:s,y:o}}},{key:"handleBarTooltip",value:function(e){var t,i,n=e.e,r=e.opt,s=this.w,o=this.ttCtx,a=o.getElTooltip(),l=0,c=0,h=0,d=this.getBarTooltipXY({e:n,opt:r});if(null!==d.j||0!==d.barHeight||0!==d.barWidth){t=d.i;var u=d.j;if(s.globals.capturedSeriesIndex=t,s.globals.capturedDataPointIndex=u,s.globals.isBarHorizontal&&o.tooltipUtil.hasBars()||!s.config.tooltip.shared?(c=d.x,h=d.y,i=Array.isArray(s.config.stroke.width)?s.config.stroke.width[t]:s.config.stroke.width,l=c):s.globals.comboCharts||s.config.tooltip.shared||(l/=2),isNaN(h)&&(h=s.globals.svgHeight-o.tooltipRect.ttHeight),parseInt(r.paths.parentNode.getAttribute("data:realIndex"),10),c+o.tooltipRect.ttWidth>s.globals.gridWidth?c-=o.tooltipRect.ttWidth:c<0&&(c=0),o.w.config.tooltip.followCursor){var f=o.getElGrid().getBoundingClientRect();h=o.e.clientY-f.top}null===o.tooltip&&(o.tooltip=s.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),s.config.tooltip.shared||(s.globals.comboBarCount>0?o.tooltipPosition.moveXCrosshairs(l+i/2):o.tooltipPosition.moveXCrosshairs(l)),!o.fixedTooltip&&(!s.config.tooltip.shared||s.globals.isBarHorizontal&&o.tooltipUtil.hasBars())&&(h=h+s.globals.translateY-o.tooltipRect.ttHeight/2,a.style.left=c+s.globals.translateX+"px",a.style.top=h+"px")}}},{key:"getBarTooltipXY",value:function(e){var t=this,i=e.e,n=e.opt,r=this.w,s=null,o=this.ttCtx,a=0,l=0,c=0,h=0,d=0,u=i.target.classList;if(u.contains("apexcharts-bar-area")||u.contains("apexcharts-candlestick-area")||u.contains("apexcharts-boxPlot-area")||u.contains("apexcharts-rangebar-area")){var f=i.target,p=f.getBoundingClientRect(),m=n.elGrid.getBoundingClientRect(),g=p.height;d=p.height;var _=p.width,y=parseInt(f.getAttribute("cx"),10),v=parseInt(f.getAttribute("cy"),10);h=parseFloat(f.getAttribute("barWidth"));var x="touchmove"===i.type?i.touches[0].clientX:i.clientX;s=parseInt(f.getAttribute("j"),10),a=parseInt(f.parentNode.getAttribute("rel"),10)-1;var b=f.getAttribute("data-range-y1"),w=f.getAttribute("data-range-y2");r.globals.comboCharts&&(a=parseInt(f.parentNode.getAttribute("data:realIndex"),10));var S=function(e){return r.globals.isXNumeric?y-_/2:t.isVerticalGroupedRangeBar?y+_/2:y-o.dataPointsDividedWidth+_/2},T=function(){return v-o.dataPointsDividedHeight+g/2-o.tooltipRect.ttHeight/2};o.tooltipLabels.drawSeriesTexts({ttItems:n.ttItems,i:a,j:s,y1:b?parseInt(b,10):null,y2:w?parseInt(w,10):null,shared:!o.showOnIntersect&&r.config.tooltip.shared,e:i}),r.config.tooltip.followCursor?r.globals.isBarHorizontal?(l=x-m.left+15,c=T()):(l=S(),c=i.clientY-m.top-o.tooltipRect.ttHeight/2-15):r.globals.isBarHorizontal?((l=y)<o.xyRatios.baseLineInvertedY&&(l=y-o.tooltipRect.ttWidth),c=T()):(l=S(),c=v)}return{x:l,y:c,barHeight:d,barWidth:h,i:a,j:s}}}]),e}(),Mn=function(){function e(t){s(this,e),this.w=t.w,this.ttCtx=t}return a(e,[{key:"drawXaxisTooltip",value:function(){var e=this.w,t=this.ttCtx,i="bottom"===e.config.xaxis.position;t.xaxisOffY=i?e.globals.gridHeight+1:-e.globals.xAxisHeight-e.config.xaxis.axisTicks.height+3;var n=i?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top",r=e.globals.dom.elWrap;t.isXAxisTooltipEnabled&&null===e.globals.dom.baseEl.querySelector(".apexcharts-xaxistooltip")&&(t.xaxisTooltip=document.createElement("div"),t.xaxisTooltip.setAttribute("class",n+" apexcharts-theme-"+e.config.tooltip.theme),r.appendChild(t.xaxisTooltip),t.xaxisTooltipText=document.createElement("div"),t.xaxisTooltipText.classList.add("apexcharts-xaxistooltip-text"),t.xaxisTooltipText.style.fontFamily=e.config.xaxis.tooltip.style.fontFamily||e.config.chart.fontFamily,t.xaxisTooltipText.style.fontSize=e.config.xaxis.tooltip.style.fontSize,t.xaxisTooltip.appendChild(t.xaxisTooltipText))}},{key:"drawYaxisTooltip",value:function(){for(var e=this.w,t=this.ttCtx,i=0;i<e.config.yaxis.length;i++){var n=e.config.yaxis[i].opposite||e.config.yaxis[i].crosshairs.opposite;t.yaxisOffX=n?e.globals.gridWidth+1:1;var r="apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(i,n?" apexcharts-yaxistooltip-right":" apexcharts-yaxistooltip-left"),s=e.globals.dom.elWrap;null===e.globals.dom.baseEl.querySelector(".apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(i))&&(t.yaxisTooltip=document.createElement("div"),t.yaxisTooltip.setAttribute("class",r+" apexcharts-theme-"+e.config.tooltip.theme),s.appendChild(t.yaxisTooltip),0===i&&(t.yaxisTooltipText=[]),t.yaxisTooltipText[i]=document.createElement("div"),t.yaxisTooltipText[i].classList.add("apexcharts-yaxistooltip-text"),t.yaxisTooltip.appendChild(t.yaxisTooltipText[i]))}}},{key:"setXCrosshairWidth",value:function(){var e=this.w,t=this.ttCtx,i=t.getElXCrosshairs();if(t.xcrosshairsWidth=parseInt(e.config.xaxis.crosshairs.width,10),e.globals.comboCharts){var n=e.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==n&&"barWidth"===e.config.xaxis.crosshairs.width){var r=parseFloat(n.getAttribute("barWidth"));t.xcrosshairsWidth=r}else if("tickWidth"===e.config.xaxis.crosshairs.width){var s=e.globals.labels.length;t.xcrosshairsWidth=e.globals.gridWidth/s}}else if("tickWidth"===e.config.xaxis.crosshairs.width){var o=e.globals.labels.length;t.xcrosshairsWidth=e.globals.gridWidth/o}else if("barWidth"===e.config.xaxis.crosshairs.width){var a=e.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==a){var l=parseFloat(a.getAttribute("barWidth"));t.xcrosshairsWidth=l}else t.xcrosshairsWidth=1}e.globals.isBarHorizontal&&(t.xcrosshairsWidth=0),null!==i&&t.xcrosshairsWidth>0&&i.setAttribute("width",t.xcrosshairsWidth)}},{key:"handleYCrosshair",value:function(){var e=this.w,t=this.ttCtx;t.ycrosshairs=e.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),t.ycrosshairsHidden=e.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}},{key:"drawYaxisTooltipText",value:function(e,t,i){var n=this.ttCtx,r=this.w,s=r.globals,o=s.seriesYAxisMap[e];if(n.yaxisTooltips[e]&&o.length>0){var a=s.yLabelFormatters[e],l=n.getElGrid().getBoundingClientRect(),c=o[0],h=0;i.yRatio.length>1&&(h=c);var d=(t-l.top)*i.yRatio[h],u=s.maxYArr[c]-s.minYArr[c],f=s.minYArr[c]+(u-d);r.config.yaxis[e].reversed&&(f=s.maxYArr[c]-(u-d)),n.tooltipPosition.moveYCrosshairs(t-l.top),n.yaxisTooltipText[e].innerHTML=a(f),n.tooltipPosition.moveYAxisTooltip(e)}}}]),e}(),An=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w;var i=this.w;this.tConfig=i.config.tooltip,this.tooltipUtil=new bn(this),this.tooltipLabels=new wn(this),this.tooltipPosition=new Sn(this),this.marker=new Tn(this),this.intersect=new kn(this),this.axesTooltip=new Mn(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.yaxisTTEls=null,this.isBarShared=!i.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now()}return a(e,[{key:"getElTooltip",value:function(e){return e||(e=this),e.w.globals.dom.baseEl?e.w.globals.dom.baseEl.querySelector(".apexcharts-tooltip"):null}},{key:"getElXCrosshairs",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}},{key:"getElGrid",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-grid")}},{key:"drawTooltip",value:function(e){var t=this.w;this.xyRatios=e,this.isXAxisTooltipEnabled=t.config.xaxis.tooltip.enabled&&t.globals.axisCharts,this.yaxisTooltips=t.config.yaxis.map(function(e,i){return!!(e.show&&e.tooltip.enabled&&t.globals.axisCharts)}),this.allTooltipSeriesGroups=[],t.globals.axisCharts||(this.showTooltipTitle=!1);var i=document.createElement("div");if(i.classList.add("apexcharts-tooltip"),t.config.tooltip.cssClass&&i.classList.add(t.config.tooltip.cssClass),i.classList.add("apexcharts-theme-".concat(this.tConfig.theme||"light")),t.globals.dom.elWrap.appendChild(i),t.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();var n=new Qi(this.ctx);this.xAxisTicksPositions=n.getXAxisTicksPositions()}if(!t.globals.comboCharts&&!this.tConfig.intersect&&"rangeBar"!==t.config.chart.type||this.tConfig.shared||(this.showOnIntersect=!0),0!==t.config.markers.size&&0!==t.globals.markers.largestSize||this.marker.drawDynamicPoints(this),t.globals.collapsedSeries.length!==t.globals.series.length){this.dataPointsDividedHeight=t.globals.gridHeight/t.globals.dataPoints,this.dataPointsDividedWidth=t.globals.gridWidth/t.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||t.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,i.appendChild(this.tooltipTitle));var r=t.globals.series.length;(t.globals.xyCharts||t.globals.comboCharts)&&this.tConfig.shared&&(r=this.showOnIntersect?1:t.globals.series.length),this.legendLabels=t.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(r),this.addSVGEvents()}}},{key:"createTTElements",value:function(e){for(var t=this,i=this.w,n=[],r=this.getElTooltip(),s=function(s){var o=document.createElement("div");o.classList.add("apexcharts-tooltip-series-group","apexcharts-tooltip-series-group-".concat(s)),o.style.order=i.config.tooltip.inverseOrder?e-s:s+1;var a=document.createElement("span");a.classList.add("apexcharts-tooltip-marker"),i.config.tooltip.fillSeriesColor?a.style.backgroundColor=i.globals.colors[s]:a.style.color=i.globals.colors[s];var l=i.config.markers.shape,c=l;Array.isArray(l)&&(c=l[s]),a.setAttribute("shape",c),o.appendChild(a);var h=document.createElement("div");h.classList.add("apexcharts-tooltip-text"),h.style.fontFamily=t.tConfig.style.fontFamily||i.config.chart.fontFamily,h.style.fontSize=t.tConfig.style.fontSize,["y","goals","z"].forEach(function(e){var t=document.createElement("div");t.classList.add("apexcharts-tooltip-".concat(e,"-group"));var i=document.createElement("span");i.classList.add("apexcharts-tooltip-text-".concat(e,"-label")),t.appendChild(i);var n=document.createElement("span");n.classList.add("apexcharts-tooltip-text-".concat(e,"-value")),t.appendChild(n),h.appendChild(t)}),o.appendChild(h),r.appendChild(o),n.push(o)},o=0;o<e;o++)s(o);return n}},{key:"addSVGEvents",value:function(){var e=this.w,t=e.config.chart.type,i=this.getElTooltip(),n=!("bar"!==t&&"candlestick"!==t&&"boxPlot"!==t&&"rangeBar"!==t),r="area"===t||"line"===t||"scatter"===t||"bubble"===t||"radar"===t,s=e.globals.dom.Paper.node,o=this.getElGrid();o&&(this.seriesBound=o.getBoundingClientRect());var a,l=[],c=[],h={hoverArea:s,elGrid:o,tooltipEl:i,tooltipY:l,tooltipX:c,ttItems:this.ttItems};if(e.globals.axisCharts&&(r?a=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):n?a=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-rangebar-area"):"heatmap"!==t&&"treemap"!==t||(a=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),a&&a.length))for(var d=0;d<a.length;d++)l.push(a[d].getAttribute("cy")),c.push(a[d].getAttribute("cx"));if(e.globals.xyCharts&&!this.showOnIntersect||e.globals.comboCharts&&!this.showOnIntersect||n&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([s],h);else if(n&&!e.globals.comboCharts||r&&this.showOnIntersect)this.addDatapointEventsListeners(h);else if(!e.globals.axisCharts||"heatmap"===t||"treemap"===t){var u=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(u,h)}if(this.showOnIntersect){var f=e.globals.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");f.length>0&&this.addPathsEventListeners(f,h),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(h)}}},{key:"drawFixedTooltipRect",value:function(){var e=this.w,t=this.getElTooltip(),i=t.getBoundingClientRect(),n=i.width+10,r=i.height+10,s=this.tConfig.fixed.offsetX,o=this.tConfig.fixed.offsetY,a=this.tConfig.fixed.position.toLowerCase();return a.indexOf("right")>-1&&(s=s+e.globals.svgWidth-n+10),a.indexOf("bottom")>-1&&(o=o+e.globals.svgHeight-r-10),t.style.left=s+"px",t.style.top=o+"px",{x:s,y:o,ttWidth:n,ttHeight:r}}},{key:"addDatapointEventsListeners",value:function(e){var t=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-boxPlot-area, .apexcharts-rangebar-area");this.addPathsEventListeners(t,e)}},{key:"addPathsEventListeners",value:function(e,t){for(var i=this,n=function(n){var r={paths:e[n],tooltipEl:t.tooltipEl,tooltipY:t.tooltipY,tooltipX:t.tooltipX,elGrid:t.elGrid,hoverArea:t.hoverArea,ttItems:t.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map(function(t){return e[n].addEventListener(t,i.onSeriesHover.bind(i,r),{capture:!1,passive:!0})})},r=0;r<e.length;r++)n(r)}},{key:"onSeriesHover",value:function(e,t){var i=this,n=Date.now()-this.lastHoverTime;n>=20?this.seriesHover(e,t):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout(function(){i.seriesHover(e,t)},20-n))}},{key:"seriesHover",value:function(e,t){var i=this;this.lastHoverTime=Date.now();var n=[],r=this.w;r.config.chart.group&&(n=this.ctx.getGroupedCharts()),r.globals.axisCharts&&(r.globals.minX===-1/0&&r.globals.maxX===1/0||0===r.globals.dataPoints)||(n.length?n.forEach(function(n){var r=i.getElTooltip(n),s={paths:e.paths,tooltipEl:r,tooltipY:e.tooltipY,tooltipX:e.tooltipX,elGrid:e.elGrid,hoverArea:e.hoverArea,ttItems:n.w.globals.tooltip.ttItems};n.w.globals.minX===i.w.globals.minX&&n.w.globals.maxX===i.w.globals.maxX&&n.w.globals.tooltip.seriesHoverByContext({chartCtx:n,ttCtx:n.w.globals.tooltip,opt:s,e:t})}):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:e,e:t}))}},{key:"seriesHoverByContext",value:function(e){var t=e.chartCtx,i=e.ttCtx,n=e.opt,r=e.e,s=t.w,o=this.getElTooltip(t);o&&(i.tooltipRect={x:0,y:0,ttWidth:o.getBoundingClientRect().width,ttHeight:o.getBoundingClientRect().height},i.e=r,!i.tooltipUtil.hasBars()||s.globals.comboCharts||i.isBarShared||this.tConfig.onDatasetHover.highlightDataSeries&&new Zi(t).toggleSeriesOnHover(r,r.target.parentNode),s.globals.axisCharts?i.axisChartsTooltips({e:r,opt:n,tooltipRect:i.tooltipRect}):i.nonAxisChartsTooltips({e:r,opt:n,tooltipRect:i.tooltipRect}),i.fixedTooltip&&i.drawFixedTooltipRect())}},{key:"axisChartsTooltips",value:function(e){var t,i,n=e.e,r=e.opt,s=this.w,o=r.elGrid.getBoundingClientRect(),a="touchmove"===n.type?n.touches[0].clientX:n.clientX,l="touchmove"===n.type?n.touches[0].clientY:n.clientY;if(this.clientY=l,this.clientX=a,s.globals.capturedSeriesIndex=-1,s.globals.capturedDataPointIndex=-1,l<o.top||l>o.top+o.height)this.handleMouseOut(r);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!s.config.tooltip.shared){var c=parseInt(r.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(c)<0)return void this.handleMouseOut(r)}var h=this.getElTooltip(),d=this.getElXCrosshairs(),u=[];s.config.chart.group&&(u=this.ctx.getSyncedCharts());var f=s.globals.xyCharts||"bar"===s.config.chart.type&&!s.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||s.globals.comboCharts&&this.tooltipUtil.hasBars();if("mousemove"===n.type||"touchmove"===n.type||"mouseup"===n.type){if(s.globals.collapsedSeries.length+s.globals.ancillaryCollapsedSeries.length===s.globals.series.length)return;null!==d&&d.classList.add("apexcharts-active");var p=this.yaxisTooltips.filter(function(e){return!0===e});if(null!==this.ycrosshairs&&p.length&&this.ycrosshairs.classList.add("apexcharts-active"),f&&!this.showOnIntersect||u.length>1)this.handleStickyTooltip(n,a,l,r);else if("heatmap"===s.config.chart.type||"treemap"===s.config.chart.type){var m=this.intersect.handleHeatTreeTooltip({e:n,opt:r,x:t,y:i,type:s.config.chart.type});t=m.x,i=m.y,h.style.left=t+"px",h.style.top=i+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:n,opt:r}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:n,opt:r,x:t,y:i});if(this.yaxisTooltips.length)for(var g=0;g<s.config.yaxis.length;g++)this.axesTooltip.drawYaxisTooltipText(g,l,this.xyRatios);s.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.tooltipEl.classList.add("apexcharts-active")}else"mouseout"!==n.type&&"touchend"!==n.type||this.handleMouseOut(r)}}},{key:"nonAxisChartsTooltips",value:function(e){var t=e.e,i=e.opt,n=e.tooltipRect,r=this.w,s=i.paths.getAttribute("rel"),o=this.getElTooltip(),a=r.globals.dom.elWrap.getBoundingClientRect();if("mousemove"===t.type||"touchmove"===t.type){r.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),o.classList.add("apexcharts-active"),this.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:parseInt(s,10)-1,shared:!1});var l=r.globals.clientX-a.left-n.ttWidth/2,c=r.globals.clientY-a.top-n.ttHeight-10;if(o.style.left=l+"px",o.style.top=c+"px",r.config.legend.tooltipHoverFormatter){var h=s-1,d=(0,r.config.legend.tooltipHoverFormatter)(this.legendLabels[h].getAttribute("data:default-text"),{seriesIndex:h,dataPointIndex:h,w:r});this.legendLabels[h].innerHTML=d}}else"mouseout"!==t.type&&"touchend"!==t.type||(o.classList.remove("apexcharts-active"),r.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),r.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(e){var t=e.getAttribute("data:default-text");e.innerHTML=decodeURIComponent(t)}))}},{key:"handleStickyTooltip",value:function(e,t,i,n){var r=this.w,s=this.tooltipUtil.getNearestValues({context:this,hoverArea:n.hoverArea,elGrid:n.elGrid,clientX:t,clientY:i}),o=s.j,a=s.capturedSeries;r.globals.collapsedSeriesIndices.includes(a)&&(a=null);var l=n.elGrid.getBoundingClientRect();if(s.hoverX<0||s.hoverX>l.width)this.handleMouseOut(n);else if(null!==a)this.handleStickyCapturedSeries(e,a,n,o);else if(this.tooltipUtil.isXoverlap(o)||r.globals.isBarHorizontal){var c=r.globals.series.findIndex(function(e,t){return!r.globals.collapsedSeriesIndices.includes(t)});this.create(e,this,c,o,n.ttItems)}}},{key:"handleStickyCapturedSeries",value:function(e,t,i,n){var r=this.w;if(this.tConfig.shared||null!==r.globals.series[t][n]){if(void 0!==r.globals.series[t][n])this.tConfig.shared&&this.tooltipUtil.isXoverlap(n)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(e,this,t,n,i.ttItems):this.create(e,this,t,n,i.ttItems,!1);else if(this.tooltipUtil.isXoverlap(n)){var s=r.globals.series.findIndex(function(e,t){return!r.globals.collapsedSeriesIndices.includes(t)});this.create(e,this,s,n,i.ttItems)}}else this.handleMouseOut(i)}},{key:"deactivateHoverFilter",value:function(){for(var e=this.w,t=new Ai(this.ctx),i=e.globals.dom.Paper.find(".apexcharts-bar-area"),n=0;n<i.length;n++)t.pathMouseLeave(i[n])}},{key:"handleMouseOut",value:function(e){var t=this.w,i=this.getElXCrosshairs();if(t.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),e.tooltipEl.classList.remove("apexcharts-active"),this.deactivateHoverFilter(),"bubble"!==t.config.chart.type&&this.marker.resetPointsSize(),null!==i&&i.classList.remove("apexcharts-active"),null!==this.ycrosshairs&&this.ycrosshairs.classList.remove("apexcharts-active"),this.isXAxisTooltipEnabled&&this.xaxisTooltip.classList.remove("apexcharts-active"),this.yaxisTooltips.length){null===this.yaxisTTEls&&(this.yaxisTTEls=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));for(var n=0;n<this.yaxisTTEls.length;n++)this.yaxisTTEls[n].classList.remove("apexcharts-active")}t.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(e){var t=e.getAttribute("data:default-text");e.innerHTML=decodeURIComponent(t)})}},{key:"markerClick",value:function(e,t,i){var n=this.w;"function"==typeof n.config.chart.events.markerClick&&n.config.chart.events.markerClick(e,this.ctx,{seriesIndex:t,dataPointIndex:i,w:n}),this.ctx.events.fireEvent("markerClick",[e,this.ctx,{seriesIndex:t,dataPointIndex:i,w:n}])}},{key:"create",value:function(e,t,i,n,r){var s,o,a,l,c,h,d,u,f,p,g,_,y,v,x,b,w=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,S=this.w,T=t;"mouseup"===e.type&&this.markerClick(e,i,n),null===w&&(w=this.tConfig.shared);var k=this.tooltipUtil.hasMarkers(i),M=this.tooltipUtil.getElBars(),A=function(){S.globals.markers.largestSize>0?T.marker.enlargePoints(n):T.tooltipPosition.moveDynamicPointsOnHover(n)};if(S.config.legend.tooltipHoverFormatter){var C=S.config.legend.tooltipHoverFormatter,D=Array.from(this.legendLabels);D.forEach(function(e){var t=e.getAttribute("data:default-text");e.innerHTML=decodeURIComponent(t)});for(var L=0;L<D.length;L++){var E=D[L],I=parseInt(E.getAttribute("i"),10),P=decodeURIComponent(E.getAttribute("data:default-text")),R=C(P,{seriesIndex:w?I:i,dataPointIndex:n,w:S});if(w)E.innerHTML=S.globals.collapsedSeriesIndices.indexOf(I)<0?R:P;else if(E.innerHTML=I===i?R:P,i===I)break}}var O=m(m({ttItems:r,i,j:n},void 0!==(null===(s=S.globals.seriesRange)||void 0===s||null===(o=s[i])||void 0===o||null===(a=o[n])||void 0===a||null===(l=a.y[0])||void 0===l?void 0:l.y1)&&{y1:null===(c=S.globals.seriesRange)||void 0===c||null===(h=c[i])||void 0===h||null===(d=h[n])||void 0===d||null===(u=d.y[0])||void 0===u?void 0:u.y1}),void 0!==(null===(f=S.globals.seriesRange)||void 0===f||null===(p=f[i])||void 0===p||null===(g=p[n])||void 0===g||null===(_=g.y[0])||void 0===_?void 0:_.y2)&&{y2:null===(y=S.globals.seriesRange)||void 0===y||null===(v=y[i])||void 0===v||null===(x=v[n])||void 0===x||null===(b=x.y[0])||void 0===b?void 0:b.y2});if(w){if(T.tooltipLabels.drawSeriesTexts(m(m({},O),{},{shared:!this.showOnIntersect&&this.tConfig.shared})),k)A();else if(this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(M),this.barSeriesHeight>0)){var z=new Ai(this.ctx),F=S.globals.dom.Paper.find(".apexcharts-bar-area[j='".concat(n,"']"));this.deactivateHoverFilter(),T.tooltipUtil.getAllMarkers(!0).length&&!this.barSeriesHeight&&A(),T.tooltipPosition.moveStickyTooltipOverBars(n,i);for(var N=0;N<F.length;N++)z.pathMouseEnter(F[N])}}else T.tooltipLabels.drawSeriesTexts(m({shared:!1},O)),this.tooltipUtil.hasBars()&&T.tooltipPosition.moveStickyTooltipOverBars(n,i),k&&T.tooltipPosition.moveMarkers(i,n)}}]),e}(),Cn=function(){function e(t){s(this,e),this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}return a(e,[{key:"handleBarDataLabels",value:function(e){var t,i,n=e.x,r=e.y,s=e.y1,o=e.y2,a=e.i,l=e.j,c=e.realIndex,h=e.columnGroupIndex,d=e.series,u=e.barHeight,f=e.barWidth,p=e.barXPosition,g=e.barYPosition,_=e.visibleSeries,y=this.w,v=new Ai(this.barCtx.ctx),x=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[c]:this.barCtx.strokeWidth;y.globals.isXNumeric&&!y.globals.isBarHorizontal?(t=n+parseFloat(f*(_+1)),i=r+parseFloat(u*(_+1))-x):(t=n+parseFloat(f*_),i=r+parseFloat(u*_));var b,w,S=null,T=n,k=r,M=y.config.dataLabels,A=this.barCtx.barOptions.dataLabels,C=this.barCtx.barOptions.dataLabels.total;void 0!==g&&this.barCtx.isRangeBar&&(i=g,k=g),void 0!==p&&this.barCtx.isVerticalGroupedRangeBar&&(t=p,T=p);var D=M.offsetX,L=M.offsetY,E={width:0,height:0};if(y.config.dataLabels.enabled){var I=y.globals.series[a][l];E=v.getTextRects(y.config.dataLabels.formatter?y.config.dataLabels.formatter(I,m(m({},y),{},{seriesIndex:a,dataPointIndex:l,w:y})):y.globals.yLabelFormatters[0](I),parseFloat(M.style.fontSize))}var P={x:n,y:r,i:a,j:l,realIndex:c,columnGroupIndex:h,bcx:t,bcy:i,barHeight:u,barWidth:f,textRects:E,strokeWidth:x,dataLabelsX:T,dataLabelsY:k,dataLabelsConfig:M,barDataLabelsConfig:A,barTotalDataLabelsConfig:C,offX:D,offY:L};return w=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(P):this.calculateColumnsDataLabelsPosition(P),b=this.drawCalculatedDataLabels({x:w.dataLabelsX,y:w.dataLabelsY,val:this.barCtx.isRangeBar?[s,o]:"100%"===y.config.chart.stackType?d[c][l]:y.globals.series[c][l],i:c,j:l,barWidth:f,barHeight:u,textRects:E,dataLabelsConfig:M}),y.config.chart.stacked&&C.enabled&&(S=this.drawTotalDataLabels({x:w.totalDataLabelsX,y:w.totalDataLabelsY,barWidth:f,barHeight:u,realIndex:c,textAnchor:w.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:c,j:l}),dataLabelsConfig:M,barTotalDataLabelsConfig:C})),{dataLabelsPos:w,dataLabels:b,totalDataLabels:S}}},{key:"getStackedTotalDataLabel",value:function(e){var t=e.realIndex,i=e.j,n=this.w,r=this.barCtx.stackedSeriesTotals[i];return this.totalFormatter&&(r=this.totalFormatter(r,m(m({},n),{},{seriesIndex:t,dataPointIndex:i,w:n}))),r}},{key:"calculateColumnsDataLabelsPosition",value:function(e){var t=this,i=this.w,n=e.i,r=e.j,s=e.realIndex;e.columnGroupIndex;var o,a,l=e.y,c=e.bcx,h=e.barWidth,d=e.barHeight,u=e.textRects,f=e.dataLabelsX,p=e.dataLabelsY,m=e.dataLabelsConfig,g=e.barDataLabelsConfig,_=e.barTotalDataLabelsConfig,y=e.strokeWidth,v=e.offX,x=e.offY,b=c;d=Math.abs(d);var w="vertical"===i.config.plotOptions.bar.dataLabels.orientation,S=this.barCtx.barHelpers.getZeroValueEncounters({i:n,j:r}).zeroEncounters;c-=y/2;var T=i.globals.gridWidth/i.globals.dataPoints;this.barCtx.isVerticalGroupedRangeBar?f+=h/2:(f=i.globals.isXNumeric?c-h/2+v:c-T+h/2+v,!i.config.chart.stacked&&S>0&&i.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(f-=h*S)),w&&(f=f+u.height/2-y/2-2);var k=i.globals.series[n][r]<0,M=l;switch(this.barCtx.isReversed&&(M=l+(k?d:-d)),g.position){case"center":p=w?k?M-d/2+x:M+d/2-x:k?M-d/2+u.height/2+x:M+d/2+u.height/2-x;break;case"bottom":p=w?k?M-d+x:M+d-x:k?M-d+u.height+y+x:M+d-u.height/2+y-x;break;case"top":p=w?k?M+x:M-x:k?M-u.height/2-x:M+u.height+x}var A=M;if(i.globals.seriesGroups.forEach(function(e){var i;null===(i=t.barCtx[e.join(",")])||void 0===i||i.prevY.forEach(function(e){A=k?Math.max(e[r],A):Math.min(e[r],A)})}),this.barCtx.lastActiveBarSerieIndex===s&&_.enabled){var C=new Ai(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:s,j:r}),m.fontSize);o=k?A-C.height/2-x-_.offsetY+18:A+C.height+x+_.offsetY-18;var D=T;a=b+(i.globals.isXNumeric?-h*i.globals.barGroups.length/2:i.globals.barGroups.length*h/2-(i.globals.barGroups.length-1)*h-D)+_.offsetX}return i.config.chart.stacked||(p<0?p=0+y:p+u.height/3>i.globals.gridHeight&&(p=i.globals.gridHeight-y)),{bcx:c,bcy:l,dataLabelsX:f,dataLabelsY:p,totalDataLabelsX:a,totalDataLabelsY:o,totalDataLabelsAnchor:"middle"}}},{key:"calculateBarsDataLabelsPosition",value:function(e){var t=this,i=this.w,n=e.x,r=e.i,s=e.j,o=e.realIndex,a=e.bcy,l=e.barHeight,c=e.barWidth,h=e.textRects,d=e.dataLabelsX,u=e.strokeWidth,f=e.dataLabelsConfig,p=e.barDataLabelsConfig,m=e.barTotalDataLabelsConfig,g=e.offX,_=e.offY,y=i.globals.gridHeight/i.globals.dataPoints,v=this.barCtx.barHelpers.getZeroValueEncounters({i:r,j:s}).zeroEncounters;c=Math.abs(c);var x,b,w=a-(this.barCtx.isRangeBar?0:y)+l/2+h.height/2+_-3;!i.config.chart.stacked&&v>0&&i.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(w-=l*v);var S="start",T=i.globals.series[r][s]<0,k=n;switch(this.barCtx.isReversed&&(k=n+(T?-c:c),S=T?"start":"end"),p.position){case"center":d=T?k+c/2-g:Math.max(h.width/2,k-c/2)+g;break;case"bottom":d=T?k+c-u-g:k-c+u+g;break;case"top":d=T?k-u-g:k-u+g}var M=k;if(i.globals.seriesGroups.forEach(function(e){var i;null===(i=t.barCtx[e.join(",")])||void 0===i||i.prevX.forEach(function(e){M=T?Math.min(e[s],M):Math.max(e[s],M)})}),this.barCtx.lastActiveBarSerieIndex===o&&m.enabled){var A=new Ai(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:s}),f.fontSize);T?(x=M-u-g-m.offsetX,S="end"):x=M+g+m.offsetX+(this.barCtx.isReversed?-(c+u):u),b=w-h.height/2+A.height/2+m.offsetY+u,i.globals.barGroups.length>1&&(b-=i.globals.barGroups.length/2*(l/2))}return i.config.chart.stacked||("start"===f.textAnchor?d-h.width<0?d=T?h.width+u:u:d+h.width>i.globals.gridWidth&&(d=T?i.globals.gridWidth-u:i.globals.gridWidth-h.width-u):"middle"===f.textAnchor?d-h.width/2<0?d=h.width/2+u:d+h.width/2>i.globals.gridWidth&&(d=i.globals.gridWidth-h.width/2-u):"end"===f.textAnchor&&(d<1?d=h.width+u:d+1>i.globals.gridWidth&&(d=i.globals.gridWidth-h.width-u))),{bcx:n,bcy:a,dataLabelsX:d,dataLabelsY:w,totalDataLabelsX:x,totalDataLabelsY:b,totalDataLabelsAnchor:S}}},{key:"drawCalculatedDataLabels",value:function(e){var t=e.x,i=e.y,n=e.val,r=e.i,s=e.j,o=e.textRects,a=e.barHeight,l=e.barWidth,c=e.dataLabelsConfig,h=this.w,d="rotate(0)";"vertical"===h.config.plotOptions.bar.dataLabels.orientation&&(d="rotate(-90, ".concat(t,", ").concat(i,")"));var u=new Xi(this.barCtx.ctx),f=new Ai(this.barCtx.ctx),p=c.formatter,g=null,_=h.globals.collapsedSeriesIndices.indexOf(r)>-1;if(c.enabled&&!_){g=f.group({class:"apexcharts-data-labels",transform:d});var y="";void 0!==n&&(y=p(n,m(m({},h),{},{seriesIndex:r,dataPointIndex:s,w:h}))),!n&&h.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(y="");var v=h.globals.series[r][s]<0,x=h.config.plotOptions.bar.dataLabels.position;"vertical"===h.config.plotOptions.bar.dataLabels.orientation&&("top"===x&&(c.textAnchor=v?"end":"start"),"center"===x&&(c.textAnchor="middle"),"bottom"===x&&(c.textAnchor=v?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&l<f.getTextRects(y,parseFloat(c.style.fontSize)).width&&(y=""),h.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?o.width/1.6>Math.abs(l)&&(y=""):o.height/1.6>Math.abs(a)&&(y=""));var b=m({},c);this.barCtx.isHorizontal&&n<0&&("start"===c.textAnchor?b.textAnchor="end":"end"===c.textAnchor&&(b.textAnchor="start")),u.plotDataLabelsText({x:t,y:i,text:y,i:r,j:s,parent:g,dataLabelsConfig:b,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return g}},{key:"drawTotalDataLabels",value:function(e){var t=e.x,i=e.y,n=e.val,r=e.realIndex,s=e.textAnchor,o=e.barTotalDataLabelsConfig;this.w;var a,l=new Ai(this.barCtx.ctx);return o.enabled&&void 0!==t&&void 0!==i&&this.barCtx.lastActiveBarSerieIndex===r&&(a=l.drawText({x:t,y:i,foreColor:o.style.color,text:n,textAnchor:s,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize,fontWeight:o.style.fontWeight})),a}}]),e}(),Dn=function(){function e(t){s(this,e),this.w=t.w,this.barCtx=t}return a(e,[{key:"initVariables",value:function(e){var t=this.w;this.barCtx.series=e,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(var i=0;i<e.length;i++)if(e[i].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=e[i].length),t.globals.isXNumeric)for(var n=0;n<e[i].length;n++)t.globals.seriesX[i][n]>t.globals.minX&&t.globals.seriesX[i][n]<t.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=t.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(t.globals.series),w.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(function(e){return e.map(function(e){return"none"})})),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],t.globals.comboCharts||this.checkZeroSeries({series:e})}},{key:"initialPositions",value:function(e){var t,i,n,r,s,o,a,l,c=this.w,h=c.globals.dataPoints;this.barCtx.isRangeBar&&(h=c.globals.labels.length);var d=this.barCtx.seriesLen;if(c.config.plotOptions.bar.rangeBarGroupRows&&(d=1),this.barCtx.isHorizontal)s=(n=c.globals.gridHeight/h)/d,c.globals.isXNumeric&&(s=(n=c.globals.gridHeight/this.barCtx.totalItems)/this.barCtx.seriesLen),s=s*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(s=parseInt(this.barCtx.barOptions.barHeight,10)),l=this.barCtx.baseLineInvertedY+c.globals.padHorizontal+(this.barCtx.isReversed?c.globals.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(l=c.globals.gridWidth/2),i=(n-s*this.barCtx.seriesLen)/2;else{if(r=c.globals.gridWidth/this.barCtx.visibleItems,c.config.xaxis.convertedCatToNumeric&&(r=c.globals.gridWidth/c.globals.dataPoints),o=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,c.globals.isXNumeric){var u=this.barCtx.xRatio;c.globals.minXDiff&&.5!==c.globals.minXDiff&&c.globals.minXDiff/u>0&&(r=c.globals.minXDiff/u),(o=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100)<1&&(o=1)}-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.columnWidth,10)),a=c.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?c.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),t=c.globals.isXNumeric?this.barCtx.getBarXForNumericXAxis({x:t,j:0,realIndex:e,barWidth:o}).x:c.globals.padHorizontal+w.noExponents(r-o*this.barCtx.seriesLen)/2}return c.globals.barHeight=s,c.globals.barWidth=o,{x:t,y:i,yDivision:n,xDivision:r,barHeight:s,barWidth:o,zeroH:a,zeroW:l}}},{key:"initializeStackedPrevVars",value:function(e){e.w.globals.seriesGroups.forEach(function(t){e[t]||(e[t]={}),e[t].prevY=[],e[t].prevX=[],e[t].prevYF=[],e[t].prevXF=[],e[t].prevYVal=[],e[t].prevXVal=[]})}},{key:"initializeStackedXYVars",value:function(e){e.w.globals.seriesGroups.forEach(function(t){e[t]||(e[t]={}),e[t].xArrj=[],e[t].xArrjF=[],e[t].xArrjVal=[],e[t].yArrj=[],e[t].yArrjF=[],e[t].yArrjVal=[]})}},{key:"getPathFillColor",value:function(e,t,i,n){var r,s,o,a,l=this.w,c=this.barCtx.ctx.fill,h=null,d=this.barCtx.barOptions.distributed?i:t,u=!1;return this.barCtx.barOptions.colors.ranges.length>0&&this.barCtx.barOptions.colors.ranges.map(function(n){e[t][i]>=n.from&&e[t][i]<=n.to&&(h=n.color,u=!0)}),{color:c.fillPath({seriesNumber:this.barCtx.barOptions.distributed?d:n,dataPointIndex:i,color:h,value:e[t][i],fillConfig:null===(r=l.config.series[t].data[i])||void 0===r?void 0:r.fill,fillType:null!==(s=l.config.series[t].data[i])&&void 0!==s&&null!==(o=s.fill)&&void 0!==o&&o.type?null===(a=l.config.series[t].data[i])||void 0===a?void 0:a.fill.type:Array.isArray(l.config.fill.type)?l.config.fill.type[n]:l.config.fill.type}),useRangeColor:u}}},{key:"getStrokeWidth",value:function(e,t,i){var n=0,r=this.w;return void 0===this.barCtx.series[e][t]||null===this.barCtx.series[e][t]||"bar"===r.config.chart.type&&!this.barCtx.series[e][t]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,r.config.stroke.show&&(this.barCtx.isNullValue||(n=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[i]:this.barCtx.strokeWidth)),n}},{key:"createBorderRadiusArr",value:function(e){var t,i=this.w,n=!this.w.config.chart.stacked||i.config.plotOptions.bar.borderRadius<=0,r=e.length,s=0|(null===(t=e[0])||void 0===t?void 0:t.length),o=Array.from({length:r},function(){return Array(s).fill(n?"top":"none")});if(n)return o;for(var a=0;a<s;a++){for(var c=[],h=[],d=0,u=0;u<r;u++){var f=e[u][a];f>0?(c.push(u),d++):f<0&&(h.push(u),d++)}if(c.length>0&&0===h.length)if(1===c.length)o[c[0]][a]="both";else{var p,m=c[0],g=c[c.length-1],_=l(c);try{for(_.s();!(p=_.n()).done;){var y=p.value;o[y][a]=y===m?"bottom":y===g?"top":"none"}}catch(e){_.e(e)}finally{_.f()}}else if(h.length>0&&0===c.length)if(1===h.length)o[h[0]][a]="both";else{var v,x=Math.max.apply(Math,h),b=Math.min.apply(Math,h),w=l(h);try{for(w.s();!(v=w.n()).done;){var S=v.value;o[S][a]=S===x?"bottom":S===b?"top":"none"}}catch(e){w.e(e)}finally{w.f()}}else if(c.length>0&&h.length>0){var T,k=c[c.length-1],M=l(c);try{for(M.s();!(T=M.n()).done;){var A=T.value;o[A][a]=A===k?"top":"none"}}catch(e){M.e(e)}finally{M.f()}var C,D=Math.max.apply(Math,h),L=l(h);try{for(L.s();!(C=L.n()).done;){var E=C.value;o[E][a]=E===D?"bottom":"none"}}catch(e){L.e(e)}finally{L.f()}}else 1===d&&(o[c[0]||h[0]][a]="both")}return o}},{key:"barBackground",value:function(e){var t=e.j,i=e.i,n=e.x1,r=e.x2,s=e.y1,o=e.y2,a=e.elSeries,l=this.w,c=new Ai(this.barCtx.ctx),h=new Zi(this.barCtx.ctx).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===i){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);var d=this.barCtx.barOptions.colors.backgroundBarColors[t],u=c.drawRect(void 0!==n?n:0,void 0!==s?s:0,void 0!==r?r:l.globals.gridWidth,void 0!==o?o:l.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,d,this.barCtx.barOptions.colors.backgroundBarOpacity);a.add(u),u.node.classList.add("apexcharts-backgroundBar")}}},{key:"getColumnPaths",value:function(e){var t,i=e.barWidth,n=e.barXPosition,r=e.y1,s=e.y2,o=e.strokeWidth,a=e.isReversed,l=e.series,c=e.seriesGroup,h=e.realIndex,d=e.i,u=e.j,f=e.w,p=new Ai(this.barCtx.ctx);(o=Array.isArray(o)?o[h]:o)||(o=0);var m=i,g=n;null!==(t=f.config.series[h].data[u])&&void 0!==t&&t.columnWidthOffset&&(g=n-f.config.series[h].data[u].columnWidthOffset/2,m=i+f.config.series[h].data[u].columnWidthOffset);var _=o/2,y=g+_,v=g+m-_,x=(l[d][u]>=0?1:-1)*(a?-1:1);r+=.001-_*x,s+=.001+_*x;var b=p.move(y,r),w=p.move(y,r),S=p.line(v,r);if(f.globals.previousPaths.length>0&&(w=this.barCtx.getPreviousPath(h,u,!1)),b=b+p.line(y,s)+p.line(v,s)+S+("around"===f.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[h][u]?" Z":" z"),w=w+p.line(y,r)+S+S+S+S+S+p.line(y,r)+("around"===f.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[h][u]?" Z":" z"),"none"!==this.arrBorderRadius[h][u]&&(b=p.roundPathCorners(b,f.config.plotOptions.bar.borderRadius)),f.config.chart.stacked){var T=this.barCtx;(T=this.barCtx[c]).yArrj.push(s-_*x),T.yArrjF.push(Math.abs(r-s+o*x)),T.yArrjVal.push(this.barCtx.series[d][u])}return{pathTo:b,pathFrom:w}}},{key:"getBarpaths",value:function(e){var t,i=e.barYPosition,n=e.barHeight,r=e.x1,s=e.x2,o=e.strokeWidth,a=e.isReversed,l=e.series,c=e.seriesGroup,h=e.realIndex,d=e.i,u=e.j,f=e.w,p=new Ai(this.barCtx.ctx);(o=Array.isArray(o)?o[h]:o)||(o=0);var m=i,g=n;null!==(t=f.config.series[h].data[u])&&void 0!==t&&t.barHeightOffset&&(m=i-f.config.series[h].data[u].barHeightOffset/2,g=n+f.config.series[h].data[u].barHeightOffset);var _=o/2,y=m+_,v=m+g-_,x=(l[d][u]>=0?1:-1)*(a?-1:1);r+=.001+_*x,s+=.001-_*x;var b=p.move(r,y),w=p.move(r,y);f.globals.previousPaths.length>0&&(w=this.barCtx.getPreviousPath(h,u,!1));var S=p.line(r,v);if(b=b+p.line(s,y)+p.line(s,v)+S+("around"===f.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[h][u]?" Z":" z"),w=w+p.line(r,y)+S+S+S+S+S+p.line(r,y)+("around"===f.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[h][u]?" Z":" z"),"none"!==this.arrBorderRadius[h][u]&&(b=p.roundPathCorners(b,f.config.plotOptions.bar.borderRadius)),f.config.chart.stacked){var T=this.barCtx;(T=this.barCtx[c]).xArrj.push(s+_*x),T.xArrjF.push(Math.abs(r-s-o*x)),T.xArrjVal.push(this.barCtx.series[d][u])}return{pathTo:b,pathFrom:w}}},{key:"checkZeroSeries",value:function(e){for(var t=e.series,i=this.w,n=0;n<t.length;n++){for(var r=0,s=0;s<t[i.globals.maxValsInArrayIndex].length;s++)r+=t[n][s];0===r&&this.barCtx.zeroSerieses.push(n)}}},{key:"getXForValue",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&!arguments[2]?null:t;return null!=e&&(i=t+e/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?e/this.barCtx.invertedYRatio:0)),i}},{key:"getYForValue",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?null:t;return null!=e&&(n=t-e/this.barCtx.yRatio[i]+2*(this.barCtx.isReversed?e/this.barCtx.yRatio[i]:0)),n}},{key:"getGoalValues",value:function(e,t,i,n,r,s){var o=this,a=this.w,l=[],c=function(n,r){var a;l.push((h(a={},e,"x"===e?o.getXForValue(n,t,!1):o.getYForValue(n,i,s,!1)),h(a,"attrs",r),a))};if(a.globals.seriesGoals[n]&&a.globals.seriesGoals[n][r]&&Array.isArray(a.globals.seriesGoals[n][r])&&a.globals.seriesGoals[n][r].forEach(function(e){c(e.value,e)}),this.barCtx.barOptions.isDumbbell&&a.globals.seriesRange.length){var d=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:a.globals.colors,u={strokeHeight:"x"===e?0:a.globals.markers.size[n],strokeWidth:"x"===e?a.globals.markers.size[n]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(d[n])?d[n][0]:d[n]};c(a.globals.seriesRangeStart[n][r],u),c(a.globals.seriesRangeEnd[n][r],m(m({},u),{},{strokeColor:Array.isArray(d[n])?d[n][1]:d[n]}))}return l}},{key:"drawGoalLine",value:function(e){var t=e.barXPosition,i=e.barYPosition,n=e.goalX,r=e.goalY,s=e.barWidth,o=e.barHeight,a=new Ai(this.barCtx.ctx),l=a.group({className:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path","url(#gridRectMarkerMask".concat(this.barCtx.w.globals.cuid,")"));var c=null;return this.barCtx.isHorizontal?Array.isArray(n)&&n.forEach(function(e){if(e.x>=-1&&e.x<=a.w.globals.gridWidth+1){var t=void 0!==e.attrs.strokeHeight?e.attrs.strokeHeight:o/2,n=i+t+o/2;c=a.drawLine(e.x,n-2*t,e.x,n,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeWidth?e.attrs.strokeWidth:2,e.attrs.strokeLineCap),l.add(c)}}):Array.isArray(r)&&r.forEach(function(e){if(e.y>=-1&&e.y<=a.w.globals.gridHeight+1){var i=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:s/2,n=t+i+s/2;c=a.drawLine(n-2*i,e.y,n,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),l.add(c)}}),l}},{key:"drawBarShadow",value:function(e){var t=e.prevPaths,i=e.currPaths,n=e.color,r=this.w,s=t.x,o=t.x1,a=t.barYPosition,l=i.x,c=i.x1,h=i.barYPosition,d=a+i.barHeight,u=new Ai(this.barCtx.ctx),f=new w,p=u.move(o,d)+u.line(s,d)+u.line(l,h)+u.line(c,h)+u.line(o,d)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[realIndex][j]?" Z":" z");return u.drawPath({d:p,fill:f.shadeColor(.5,w.rgb2hex(n)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}},{key:"getZeroValueEncounters",value:function(e){var t,i=e.i,n=e.j,r=this.w,s=0,o=0;return(r.config.plotOptions.bar.horizontal?r.globals.series.map(function(e,t){return t}):(null===(t=r.globals.columnSeries)||void 0===t?void 0:t.i.map(function(e){return e}))||[]).forEach(function(e){var t=r.globals.seriesPercent[e][n];t&&s++,e<i&&0===t&&o++}),{nonZeroColumns:s,zeroEncounters:o}}},{key:"getGroupIndex",value:function(e){var t=this.w,i=t.globals.seriesGroups.findIndex(function(i){return i.indexOf(t.globals.seriesNames[e])>-1}),n=this.barCtx.columnGroupIndices,r=n.indexOf(i);return r<0&&(n.push(i),r=n.length-1),{groupIndex:i,columnGroupIndex:r}}}]),e}(),Ln=function(){function e(t,i){s(this,e),this.ctx=t,this.w=t.w;var n=this.w;this.barOptions=n.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=n.config.stroke.width,this.isNullValue=!1,this.isRangeBar=n.globals.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!n.globals.isBarHorizontal&&n.globals.seriesRange.length&&n.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.xyRatios=i,null!==this.xyRatios&&(this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.invertedXRatio=i.invertedXRatio,this.invertedYRatio=i.invertedYRatio,this.baseLineY=i.baseLineY,this.baseLineInvertedY=i.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[];var r=new Zi(this.ctx);this.lastActiveBarSerieIndex=r.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];var o=r.getBarSeriesIndices(),a=new Ci(this.ctx);this.stackedSeriesTotals=a.getStackedSeriesTotals(this.w.config.series.map(function(e,t){return-1===o.indexOf(t)?t:-1}).filter(function(e){return-1!==e})),this.barHelpers=new Dn(this)}return a(e,[{key:"draw",value:function(e,t){var i=this.w,n=new Ai(this.ctx),r=new Ci(this.ctx,i);e=r.getLogSeries(e),this.series=e,this.yRatio=r.getLogYRatios(this.yRatio),this.barHelpers.initVariables(e);var s=n.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(var o=0,a=0;o<e.length;o++,a++){var l,c,h,d,u=void 0,f=void 0,p=[],g=[],_=i.globals.comboCharts?t[o]:o,y=this.barHelpers.getGroupIndex(_).columnGroupIndex,v=n.group({class:"apexcharts-series",rel:o+1,seriesName:w.escapeString(i.globals.seriesNames[_]),"data:realIndex":_});this.ctx.series.addCollapsedClassToSeries(v,_),e[o].length>0&&(this.visibleI=this.visibleI+1);var x=0,b=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[_],this.translationsIndex=_);var S=this.translationsIndex;this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed;var T=this.barHelpers.initialPositions(_);f=T.y,x=T.barHeight,c=T.yDivision,d=T.zeroW,u=T.x,b=T.barWidth,l=T.xDivision,h=T.zeroH,this.isHorizontal||g.push(u+b/2);var k=n.group({class:"apexcharts-datalabels","data:realIndex":_});i.globals.delayedElements.push({el:k.node}),k.node.classList.add("apexcharts-element-hidden");var M=n.group({class:"apexcharts-bar-goals-markers"}),A=n.group({class:"apexcharts-bar-shadows"});i.globals.delayedElements.push({el:A.node}),A.node.classList.add("apexcharts-element-hidden");for(var C=0;C<e[o].length;C++){var D=this.barHelpers.getStrokeWidth(o,C,_),L=null,E={indexes:{i:o,j:C,realIndex:_,translationsIndex:S,bc:a},x:u,y:f,strokeWidth:D,elSeries:v};this.isHorizontal?(L=this.drawBarPaths(m(m({},E),{},{barHeight:x,zeroW:d,yDivision:c})),b=this.series[o][C]/this.invertedYRatio):(L=this.drawColumnPaths(m(m({},E),{},{xDivision:l,barWidth:b,zeroH:h})),x=this.series[o][C]/this.yRatio[S]);var I=this.barHelpers.getPathFillColor(e,o,C,_);if(this.isFunnel&&this.barOptions.isFunnel3d&&this.pathArr.length&&C>0){var P,R=this.barHelpers.drawBarShadow({color:"string"==typeof I.color&&-1===(null===(P=I.color)||void 0===P?void 0:P.indexOf("url"))?I.color:w.hexToRgba(i.globals.colors[o]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:L});A.add(R),i.config.chart.dropShadow.enabled&&new Mi(this.ctx).dropShadow(R,i.config.chart.dropShadow,_)}this.pathArr.push(L);var O=this.barHelpers.drawGoalLine({barXPosition:L.barXPosition,barYPosition:L.barYPosition,goalX:L.goalX,goalY:L.goalY,barHeight:x,barWidth:b});O&&M.add(O),f=L.y,u=L.x,C>0&&g.push(u+b/2),p.push(f),this.renderSeries(m(m({realIndex:_,pathFill:I.color},I.useRangeColor?{lineFill:I.color}:{}),{},{j:C,i:o,columnGroupIndex:y,pathFrom:L.pathFrom,pathTo:L.pathTo,strokeWidth:D,elSeries:v,x:u,y:f,series:e,barHeight:Math.abs(L.barHeight?L.barHeight:x),barWidth:Math.abs(L.barWidth?L.barWidth:b),elDataLabelsWrap:k,elGoalsMarkers:M,elBarShadows:A,visibleSeries:this.visibleI,type:"bar"}))}i.globals.seriesXvalues[_]=g,i.globals.seriesYvalues[_]=p,s.add(v)}return s}},{key:"renderSeries",value:function(e){var t=e.realIndex,i=e.pathFill,n=e.lineFill,r=e.j,s=e.i,o=e.columnGroupIndex,a=e.pathFrom,l=e.pathTo,c=e.strokeWidth,h=e.elSeries,d=e.x,u=e.y,f=e.y1,p=e.y2,m=e.series,g=e.barHeight,_=e.barWidth,y=e.barXPosition,v=e.barYPosition,x=e.elDataLabelsWrap,b=e.elGoalsMarkers,w=e.elBarShadows,S=e.visibleSeries,T=e.type,k=e.classes,M=this.w,A=new Ai(this.ctx),C=!1;if(!n){var D="function"==typeof M.globals.stroke.colors[t]?function(e){var t,i=M.config.stroke.colors;return Array.isArray(i)&&i.length>0&&((t=i[e])||(t=""),"function"==typeof t)?t({value:M.globals.series[e][r],dataPointIndex:r,w:M}):t}(t):M.globals.stroke.colors[t];n=this.barOptions.distributed?M.globals.stroke.colors[r]:D}var L=new Cn(this).handleBarDataLabels({x:d,y:u,y1:f,y2:p,i:s,j:r,series:m,realIndex:t,columnGroupIndex:o,barHeight:g,barWidth:_,barXPosition:y,barYPosition:v,visibleSeries:S});M.globals.isBarHorizontal||(L.dataLabelsPos.dataLabelsX+Math.max(_,M.globals.barPadForNumericAxis)<0||L.dataLabelsPos.dataLabelsX-Math.max(_,M.globals.barPadForNumericAxis)>M.globals.gridWidth)&&(C=!0),M.config.series[s].data[r]&&M.config.series[s].data[r].strokeColor&&(n=M.config.series[s].data[r].strokeColor),this.isNullValue&&(i="none");var E=r/M.config.chart.animations.animateGradually.delay*(M.config.chart.animations.speed/M.globals.dataPoints)/2.4;if(!C){var I=A.renderPaths({i:s,j:r,realIndex:t,pathFrom:a,pathTo:l,stroke:n,strokeWidth:c,strokeLineCap:M.config.stroke.lineCap,fill:i,animationDelay:E,initialSpeed:M.config.chart.animations.speed,dataChangeSpeed:M.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(T,"-area ").concat(k),chartType:T});I.attr("clip-path","url(#gridRectBarMask".concat(M.globals.cuid,")"));var P=M.config.forecastDataPoints;P.count>0&&r>=M.globals.dataPoints-P.count&&(I.node.setAttribute("stroke-dasharray",P.dashArray),I.node.setAttribute("stroke-width",P.strokeWidth),I.node.setAttribute("fill-opacity",P.fillOpacity)),void 0!==f&&void 0!==p&&(I.attr("data-range-y1",f),I.attr("data-range-y2",p)),new Mi(this.ctx).setSelectionFilter(I,t,r),h.add(I),I.attr({cy:L.dataLabelsPos.bcy,cx:L.dataLabelsPos.bcx,j:r,val:M.globals.series[s][r],barHeight:g,barWidth:_}),null!==L.dataLabels&&x.add(L.dataLabels),L.totalDataLabels&&x.add(L.totalDataLabels),h.add(x),b&&h.add(b),w&&h.add(w)}return h}},{key:"drawBarPaths",value:function(e){var t,i=e.indexes,n=e.barHeight,r=e.strokeWidth,s=e.zeroW,o=e.x,a=e.y,l=e.yDivision,c=e.elSeries,h=this.w,d=i.i,u=i.j;if(h.globals.isXNumeric)t=(a=(h.globals.seriesX[d][u]-h.globals.minX)/this.invertedXRatio-n)+n*this.visibleI;else if(h.config.plotOptions.bar.hideZeroBarsWhenGrouped){var f=this.barHelpers.getZeroValueEncounters({i:d,j:u}),p=f.nonZeroColumns,m=f.zeroEncounters;p>0&&(n=this.seriesLen*n/p),t=a+n*this.visibleI,t-=n*m}else t=a+n*this.visibleI;this.isFunnel&&(s-=(this.barHelpers.getXForValue(this.series[d][u],s)-s)/2),o=this.barHelpers.getXForValue(this.series[d][u],s);var g=this.barHelpers.getBarpaths({barYPosition:t,barHeight:n,x1:s,x2:o,strokeWidth:r,isReversed:this.isReversed,series:this.series,realIndex:i.realIndex,i:d,j:u,w:h});return h.globals.isXNumeric||(a+=l),this.barHelpers.barBackground({j:u,i:d,y1:t-n*this.visibleI,y2:n*this.seriesLen,elSeries:c}),{pathTo:g.pathTo,pathFrom:g.pathFrom,x1:s,x:o,y:a,goalX:this.barHelpers.getGoalValues("x",s,null,d,u),barYPosition:t,barHeight:n}}},{key:"drawColumnPaths",value:function(e){var t,i=e.indexes,n=e.x,r=e.y,s=e.xDivision,o=e.barWidth,a=e.zeroH,l=e.strokeWidth,c=e.elSeries,h=this.w,d=i.realIndex,u=i.translationsIndex,f=i.i,p=i.j,m=i.bc;if(h.globals.isXNumeric){var g=this.getBarXForNumericXAxis({x:n,j:p,realIndex:d,barWidth:o});n=g.x,t=g.barXPosition}else if(h.config.plotOptions.bar.hideZeroBarsWhenGrouped){var _=this.barHelpers.getZeroValueEncounters({i:f,j:p}),y=_.nonZeroColumns,v=_.zeroEncounters;y>0&&(o=this.seriesLen*o/y),t=n+o*this.visibleI,t-=o*v}else t=n+o*this.visibleI;r=this.barHelpers.getYForValue(this.series[f][p],a,u);var x=this.barHelpers.getColumnPaths({barXPosition:t,barWidth:o,y1:a,y2:r,strokeWidth:l,isReversed:this.isReversed,series:this.series,realIndex:d,i:f,j:p,w:h});return h.globals.isXNumeric||(n+=s),this.barHelpers.barBackground({bc:m,j:p,i:f,x1:t-l/2-o*this.visibleI,x2:o*this.seriesLen+l/2,elSeries:c}),{pathTo:x.pathTo,pathFrom:x.pathFrom,x:n,y:r,goalY:this.barHelpers.getGoalValues("y",null,a,f,p,u),barXPosition:t,barWidth:o}}},{key:"getBarXForNumericXAxis",value:function(e){var t=e.x,i=e.barWidth,n=e.realIndex,r=e.j,s=this.w,o=n;return s.globals.seriesX[n].length||(o=s.globals.maxValsInArrayIndex),w.isNumber(s.globals.seriesX[o][r])&&(t=(s.globals.seriesX[o][r]-s.globals.minX)/this.xRatio-i*this.seriesLen/2),{barXPosition:t+i*this.visibleI,x:t}}},{key:"getPreviousPath",value:function(e,t){for(var i=this.w,n="M 0 0",r=0;r<i.globals.previousPaths.length;r++){var s=i.globals.previousPaths[r];s.paths&&s.paths.length>0&&parseInt(s.realIndex,10)===parseInt(e,10)&&void 0!==i.globals.previousPaths[r].paths[t]&&(n=i.globals.previousPaths[r].paths[t].d)}return n}}]),e}(),En=function(){u(t,Ln);var e=c(t);function t(){return s(this,t),e.apply(this,arguments)}return a(t,[{key:"draw",value:function(e,t){var i=this,n=this.w;this.graphics=new Ai(this.ctx),this.bar=new Ln(this.ctx,this.xyRatios);var r=new Ci(this.ctx,n);e=r.getLogSeries(e),this.yRatio=r.getLogYRatios(this.yRatio),this.barHelpers.initVariables(e),"100%"===n.config.chart.stackType&&(e=n.globals.comboCharts?t.map(function(e){return n.globals.seriesPercent[e]}):n.globals.seriesPercent.slice()),this.series=e,this.barHelpers.initializeStackedPrevVars(this);for(var s=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),o=0,a=0,l=function(r,l){var c=void 0,h=void 0,d=void 0,u=void 0,f=n.globals.comboCharts?t[r]:r,p=i.barHelpers.getGroupIndex(f),g=p.groupIndex,_=p.columnGroupIndex;i.groupCtx=i[n.globals.seriesGroups[g]];var y=[],v=[],x=0;i.yRatio.length>1&&(i.yaxisIndex=n.globals.seriesYAxisReverseMap[f][0],x=f),i.isReversed=n.config.yaxis[i.yaxisIndex]&&n.config.yaxis[i.yaxisIndex].reversed;var b=i.graphics.group({class:"apexcharts-series",seriesName:w.escapeString(n.globals.seriesNames[f]),rel:r+1,"data:realIndex":f});i.ctx.series.addCollapsedClassToSeries(b,f);var S=i.graphics.group({class:"apexcharts-datalabels","data:realIndex":f}),T=i.graphics.group({class:"apexcharts-bar-goals-markers"}),k=0,M=0,A=i.initialPositions(o,a,c,h,d,u,x);a=A.y,k=A.barHeight,h=A.yDivision,u=A.zeroW,o=A.x,M=A.barWidth,c=A.xDivision,d=A.zeroH,n.globals.barHeight=k,n.globals.barWidth=M,i.barHelpers.initializeStackedXYVars(i),1===i.groupCtx.prevY.length&&i.groupCtx.prevY[0].every(function(e){return isNaN(e)})&&(i.groupCtx.prevY[0]=i.groupCtx.prevY[0].map(function(){return d}),i.groupCtx.prevYF[0]=i.groupCtx.prevYF[0].map(function(){return 0}));for(var C=0;C<n.globals.dataPoints;C++){var D=i.barHelpers.getStrokeWidth(r,C,f),L={indexes:{i:r,j:C,realIndex:f,translationsIndex:x,bc:l},strokeWidth:D,x:o,y:a,elSeries:b,columnGroupIndex:_,seriesGroup:n.globals.seriesGroups[g]},E=null;i.isHorizontal?(E=i.drawStackedBarPaths(m(m({},L),{},{zeroW:u,barHeight:k,yDivision:h})),M=i.series[r][C]/i.invertedYRatio):(E=i.drawStackedColumnPaths(m(m({},L),{},{xDivision:c,barWidth:M,zeroH:d})),k=i.series[r][C]/i.yRatio[x]);var I=i.barHelpers.drawGoalLine({barXPosition:E.barXPosition,barYPosition:E.barYPosition,goalX:E.goalX,goalY:E.goalY,barHeight:k,barWidth:M});I&&T.add(I),a=E.y,o=E.x,y.push(o),v.push(a);var P=i.barHelpers.getPathFillColor(e,r,C,f),R="",O=n.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y";("bottom"===i.barHelpers.arrBorderRadius[f][C]&&n.globals.series[f][C]>0||"top"===i.barHelpers.arrBorderRadius[f][C]&&n.globals.series[f][C]<0)&&(R=O),b=i.renderSeries(m(m({realIndex:f,pathFill:P.color},P.useRangeColor?{lineFill:P.color}:{}),{},{j:C,i:r,columnGroupIndex:_,pathFrom:E.pathFrom,pathTo:E.pathTo,strokeWidth:D,elSeries:b,x:o,y:a,series:e,barHeight:k,barWidth:M,elDataLabelsWrap:S,elGoalsMarkers:T,type:"bar",visibleSeries:_,classes:R}))}n.globals.seriesXvalues[f]=y,n.globals.seriesYvalues[f]=v,i.groupCtx.prevY.push(i.groupCtx.yArrj),i.groupCtx.prevYF.push(i.groupCtx.yArrjF),i.groupCtx.prevYVal.push(i.groupCtx.yArrjVal),i.groupCtx.prevX.push(i.groupCtx.xArrj),i.groupCtx.prevXF.push(i.groupCtx.xArrjF),i.groupCtx.prevXVal.push(i.groupCtx.xArrjVal),s.add(b)},c=0,h=0;c<e.length;c++,h++)l(c,h);return s}},{key:"initialPositions",value:function(e,t,i,n,r,s,o){var a,l,c=this.w;if(this.isHorizontal){n=c.globals.gridHeight/c.globals.dataPoints;var h=c.config.plotOptions.bar.barHeight;a=-1===String(h).indexOf("%")?parseInt(h,10):n*parseInt(h,10)/100,s=c.globals.padHorizontal+(this.isReversed?c.globals.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),t=(n-a)/2}else{l=i=c.globals.gridWidth/c.globals.dataPoints;var d=c.config.plotOptions.bar.columnWidth;c.globals.isXNumeric&&c.globals.dataPoints>1?l=(i=c.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:-1===String(d).indexOf("%")?l=parseInt(d,10):l*=parseInt(d,10)/100,r=this.isReversed?this.baseLineY[o]:c.globals.gridHeight-this.baseLineY[o],e=c.globals.padHorizontal+(i-l)/2}var u=c.globals.barGroups.length||1;return{x:e,y:t,yDivision:n,xDivision:i,barHeight:a/u,barWidth:l/u,zeroH:r,zeroW:s}}},{key:"drawStackedBarPaths",value:function(e){for(var t,i=e.indexes,n=e.barHeight,r=e.strokeWidth,s=e.zeroW,o=e.x,a=e.y,l=e.columnGroupIndex,c=e.seriesGroup,h=e.yDivision,d=e.elSeries,u=this.w,f=a+l*n,p=i.i,m=i.j,g=i.realIndex,_=i.translationsIndex,y=0,v=0;v<this.groupCtx.prevXF.length;v++)y+=this.groupCtx.prevXF[v][m];var x=p;if(u.config.series[g].name&&(x=c.indexOf(u.config.series[g].name)),x>0){var b=s;this.groupCtx.prevXVal[x-1][m]<0?b=this.series[p][m]>=0?this.groupCtx.prevX[x-1][m]+y-2*(this.isReversed?y:0):this.groupCtx.prevX[x-1][m]:this.groupCtx.prevXVal[x-1][m]>=0&&(b=this.series[p][m]>=0?this.groupCtx.prevX[x-1][m]:this.groupCtx.prevX[x-1][m]-y+2*(this.isReversed?y:0)),t=b}else t=s;o=null===this.series[p][m]?t:t+this.series[p][m]/this.invertedYRatio-2*(this.isReversed?this.series[p][m]/this.invertedYRatio:0);var w=this.barHelpers.getBarpaths({barYPosition:f,barHeight:n,x1:t,x2:o,strokeWidth:r,isReversed:this.isReversed,series:this.series,realIndex:i.realIndex,seriesGroup:c,i:p,j:m,w:u});return this.barHelpers.barBackground({j:m,i:p,y1:f,y2:n,elSeries:d}),a+=h,{pathTo:w.pathTo,pathFrom:w.pathFrom,goalX:this.barHelpers.getGoalValues("x",s,null,p,m,_),barXPosition:t,barYPosition:f,x:o,y:a}}},{key:"drawStackedColumnPaths",value:function(e){var t=e.indexes,i=e.x,n=e.y,r=e.xDivision,s=e.barWidth,o=e.zeroH,a=e.columnGroupIndex,l=e.seriesGroup,c=e.elSeries,h=this.w,d=t.i,u=t.j,f=t.bc,p=t.realIndex,m=t.translationsIndex;if(h.globals.isXNumeric){var g=h.globals.seriesX[p][u];g||(g=0),i=(g-h.globals.minX)/this.xRatio-s/2*h.globals.barGroups.length}for(var _,y=i+a*s,v=0,x=0;x<this.groupCtx.prevYF.length;x++)v+=isNaN(this.groupCtx.prevYF[x][u])?0:this.groupCtx.prevYF[x][u];var b=d;if(l&&(b=l.indexOf(h.globals.seriesNames[p])),b>0&&!h.globals.isXNumeric||b>0&&h.globals.isXNumeric&&h.globals.seriesX[p-1][u]===h.globals.seriesX[p][u]){var w,S,T,k=Math.min(this.yRatio.length+1,p+1);if(void 0!==this.groupCtx.prevY[b-1]&&this.groupCtx.prevY[b-1].length)for(var M=1;M<k;M++){var A;if(!isNaN(null===(A=this.groupCtx.prevY[b-M])||void 0===A?void 0:A[u])){T=this.groupCtx.prevY[b-M][u];break}}for(var C=1;C<k;C++){var D,L;if((null===(D=this.groupCtx.prevYVal[b-C])||void 0===D?void 0:D[u])<0){S=this.series[d][u]>=0?T-v+2*(this.isReversed?v:0):T;break}if((null===(L=this.groupCtx.prevYVal[b-C])||void 0===L?void 0:L[u])>=0){S=this.series[d][u]>=0?T:T+v-2*(this.isReversed?v:0);break}}void 0===S&&(S=h.globals.gridHeight),_=null!==(w=this.groupCtx.prevYF[0])&&void 0!==w&&w.every(function(e){return 0===e})&&this.groupCtx.prevYF.slice(1,b).every(function(e){return e.every(function(e){return isNaN(e)})})?o:S}else _=o;n=this.series[d][u]?_-this.series[d][u]/this.yRatio[m]+2*(this.isReversed?this.series[d][u]/this.yRatio[m]:0):_;var E=this.barHelpers.getColumnPaths({barXPosition:y,barWidth:s,y1:_,y2:n,yRatio:this.yRatio[m],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:l,realIndex:t.realIndex,i:d,j:u,w:h});return this.barHelpers.barBackground({bc:f,j:u,i:d,x1:y,x2:s,elSeries:c}),{pathTo:E.pathTo,pathFrom:E.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,o,d,u),barXPosition:y,x:h.globals.isXNumeric?i:i+r,y:n}}}]),t}(),In=function(){u(t,Ln);var e=c(t);function t(){return s(this,t),e.apply(this,arguments)}return a(t,[{key:"draw",value:function(e,t,i){var n=this,r=this.w,s=new Ai(this.ctx),o=r.globals.comboCharts?t:r.config.chart.type,a=new Ui(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=r.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type;var l=new Ci(this.ctx,r);e=l.getLogSeries(e),this.series=e,this.yRatio=l.getLogYRatios(this.yRatio),this.barHelpers.initVariables(e);for(var c=s.group({class:"apexcharts-".concat(o,"-series apexcharts-plot-series")}),h=function(t){n.isBoxPlot="boxPlot"===r.config.chart.type||"boxPlot"===r.config.series[t].type;var o,l,h,d,u=void 0,f=void 0,p=[],g=[],_=r.globals.comboCharts?i[t]:t,y=n.barHelpers.getGroupIndex(_).columnGroupIndex,v=s.group({class:"apexcharts-series",seriesName:w.escapeString(r.globals.seriesNames[_]),rel:t+1,"data:realIndex":_});n.ctx.series.addCollapsedClassToSeries(v,_),e[t].length>0&&(n.visibleI=n.visibleI+1);var x,b,S=0;n.yRatio.length>1&&(n.yaxisIndex=r.globals.seriesYAxisReverseMap[_][0],S=_);var T=n.barHelpers.initialPositions(_);f=T.y,x=T.barHeight,l=T.yDivision,d=T.zeroW,u=T.x,b=T.barWidth,o=T.xDivision,h=T.zeroH,g.push(u+b/2);for(var k=s.group({class:"apexcharts-datalabels","data:realIndex":_}),M=s.group({class:"apexcharts-bar-goals-markers"}),A=function(i){var s=n.barHelpers.getStrokeWidth(t,i,_),c=null,w={indexes:{i:t,j:i,realIndex:_,translationsIndex:S},x:u,y:f,strokeWidth:s,elSeries:v};c=n.isHorizontal?n.drawHorizontalBoxPaths(m(m({},w),{},{yDivision:l,barHeight:x,zeroW:d})):n.drawVerticalBoxPaths(m(m({},w),{},{xDivision:o,barWidth:b,zeroH:h})),f=c.y,u=c.x;var T=n.barHelpers.drawGoalLine({barXPosition:c.barXPosition,barYPosition:c.barYPosition,goalX:c.goalX,goalY:c.goalY,barHeight:x,barWidth:b});T&&M.add(T),i>0&&g.push(u+b/2),p.push(f),c.pathTo.forEach(function(o,l){var h=!n.isBoxPlot&&n.candlestickOptions.wick.useFillColor?c.color[l]:r.globals.stroke.colors[t],d=a.fillPath({seriesNumber:_,dataPointIndex:i,color:c.color[l],value:e[t][i]});n.renderSeries({realIndex:_,pathFill:d,lineFill:h,j:i,i:t,pathFrom:c.pathFrom,pathTo:o,strokeWidth:s,elSeries:v,x:u,y:f,series:e,columnGroupIndex:y,barHeight:x,barWidth:b,elDataLabelsWrap:k,elGoalsMarkers:M,visibleSeries:n.visibleI,type:r.config.chart.type})})},C=0;C<r.globals.dataPoints;C++)A(C);r.globals.seriesXvalues[_]=g,r.globals.seriesYvalues[_]=p,c.add(v)},d=0;d<e.length;d++)h(d);return c}},{key:"drawVerticalBoxPaths",value:function(e){var t=e.indexes,i=e.x;e.y;var n=e.xDivision,r=e.barWidth,s=e.zeroH,o=e.strokeWidth,a=this.w,l=new Ai(this.ctx),c=t.i,h=t.j,d=a.config.plotOptions.candlestick.colors,u=this.boxOptions.colors,f=t.realIndex,p=function(e){return Array.isArray(e)?e[f]:e},m=p(d.upward),g=p(d.downward),_=this.yRatio[t.translationsIndex],y=this.getOHLCValue(f,h),v=s,x=s,b=y.o<y.c?[m]:[g];this.isBoxPlot&&(b=[p(u.lower),p(u.upper)]);var w=Math.min(y.o,y.c),S=Math.max(y.o,y.c),T=y.m;a.globals.isXNumeric&&(i=(a.globals.seriesX[f][h]-a.globals.minX)/this.xRatio-r/2);var k=i+r*this.visibleI;void 0===this.series[c][h]||null===this.series[c][h]?(w=s,S=s):(w=s-w/_,S=s-S/_,v=s-y.h/_,x=s-y.l/_,T=s-y.m/_);var M=l.move(k,s),A=l.move(k+r/2,w);if(a.globals.previousPaths.length>0&&(A=this.getPreviousPath(f,h,!0)),this.isOHLC){var C=k+r/2,D=s-y.o/_,L=s-y.c/_;M=[l.move(C,v)+l.line(C,x)+l.move(C,D)+l.line(k,D)+l.move(C,L)+l.line(k+r,L)]}else M=this.isBoxPlot?[l.move(k,w)+l.line(k+r/2,w)+l.line(k+r/2,v)+l.line(k+r/4,v)+l.line(k+r-r/4,v)+l.line(k+r/2,v)+l.line(k+r/2,w)+l.line(k+r,w)+l.line(k+r,T)+l.line(k,T)+l.line(k,w+o/2),l.move(k,T)+l.line(k+r,T)+l.line(k+r,S)+l.line(k+r/2,S)+l.line(k+r/2,x)+l.line(k+r-r/4,x)+l.line(k+r/4,x)+l.line(k+r/2,x)+l.line(k+r/2,S)+l.line(k,S)+l.line(k,T)+"z"]:[l.move(k,S)+l.line(k+r/2,S)+l.line(k+r/2,v)+l.line(k+r/2,S)+l.line(k+r,S)+l.line(k+r,w)+l.line(k+r/2,w)+l.line(k+r/2,x)+l.line(k+r/2,w)+l.line(k,w)+l.line(k,S-o/2)];return A+=l.move(k,w),a.globals.isXNumeric||(i+=n),{pathTo:M,pathFrom:A,x:i,y:S,goalY:this.barHelpers.getGoalValues("y",null,s,c,h,t.translationsIndex),barXPosition:k,color:b}}},{key:"drawHorizontalBoxPaths",value:function(e){var t=e.indexes;e.x;var i=e.y,n=e.yDivision,r=e.barHeight,s=e.zeroW,o=e.strokeWidth,a=this.w,l=new Ai(this.ctx),c=t.i,h=t.j,d=this.boxOptions.colors.lower;this.isBoxPlot&&(d=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var u=this.invertedYRatio,f=t.realIndex,p=this.getOHLCValue(f,h),m=s,g=s,_=Math.min(p.o,p.c),y=Math.max(p.o,p.c),v=p.m;a.globals.isXNumeric&&(i=(a.globals.seriesX[f][h]-a.globals.minX)/this.invertedXRatio-r/2);var x=i+r*this.visibleI;void 0===this.series[c][h]||null===this.series[c][h]?(_=s,y=s):(_=s+_/u,y=s+y/u,m=s+p.h/u,g=s+p.l/u,v=s+p.m/u);var b=l.move(s,x),w=l.move(_,x+r/2);return a.globals.previousPaths.length>0&&(w=this.getPreviousPath(f,h,!0)),b=[l.move(_,x)+l.line(_,x+r/2)+l.line(m,x+r/2)+l.line(m,x+r/2-r/4)+l.line(m,x+r/2+r/4)+l.line(m,x+r/2)+l.line(_,x+r/2)+l.line(_,x+r)+l.line(v,x+r)+l.line(v,x)+l.line(_+o/2,x),l.move(v,x)+l.line(v,x+r)+l.line(y,x+r)+l.line(y,x+r/2)+l.line(g,x+r/2)+l.line(g,x+r-r/4)+l.line(g,x+r/4)+l.line(g,x+r/2)+l.line(y,x+r/2)+l.line(y,x)+l.line(v,x)+"z"],w+=l.move(_,x),a.globals.isXNumeric||(i+=n),{pathTo:b,pathFrom:w,x:y,y:i,goalX:this.barHelpers.getGoalValues("x",s,null,c,h),barYPosition:x,color:d}}},{key:"getOHLCValue",value:function(e,t){var i=this.w,n=new Ci(this.ctx,i),r=n.getLogValAtSeriesIndex(i.globals.seriesCandleH[e][t],e),s=n.getLogValAtSeriesIndex(i.globals.seriesCandleO[e][t],e),o=n.getLogValAtSeriesIndex(i.globals.seriesCandleM[e][t],e),a=n.getLogValAtSeriesIndex(i.globals.seriesCandleC[e][t],e),l=n.getLogValAtSeriesIndex(i.globals.seriesCandleL[e][t],e);return{o:this.isBoxPlot?r:s,h:this.isBoxPlot?s:r,m:o,l:this.isBoxPlot?a:l,c:this.isBoxPlot?l:a}}}]),t}(),Pn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"checkColorRange",value:function(){var e=this.w,t=!1,i=e.config.plotOptions[e.config.chart.type];return i.colorScale.ranges.length>0&&i.colorScale.ranges.map(function(e,i){e.from<=0&&(t=!0)}),t}},{key:"getShadeColor",value:function(e,t,i,n){var r=this.w,s=1,o=r.config.plotOptions[e].shadeIntensity,a=this.determineColor(e,t,i);r.globals.hasNegs||n?s=r.config.plotOptions[e].reverseNegativeShade?a.percent<0?a.percent/100*(1.25*o):(1-a.percent/100)*(1.25*o):a.percent<=0?1-(1+a.percent/100)*o:(1-a.percent/100)*o:(s=1-a.percent/100,"treemap"===e&&(s=(1-a.percent/100)*(1.25*o)));var l=a.color,c=new w;if(r.config.plotOptions[e].enableShades)if("dark"===this.w.config.theme.mode){var h=c.shadeColor(-1*s,a.color);l=w.hexToRgba(w.isColorHex(h)?h:w.rgb2hex(h),r.config.fill.opacity)}else{var d=c.shadeColor(s,a.color);l=w.hexToRgba(w.isColorHex(d)?d:w.rgb2hex(d),r.config.fill.opacity)}return{color:l,colorProps:a}}},{key:"determineColor",value:function(e,t,i){var n=this.w,r=n.globals.series[t][i],s=n.config.plotOptions[e],o=s.colorScale.inverse?i:t;s.distributed&&"treemap"===n.config.chart.type&&(o=i);var a=n.globals.colors[o],l=null,c=Math.min.apply(Math,y(n.globals.series[t])),h=Math.max.apply(Math,y(n.globals.series[t]));s.distributed||"heatmap"!==e||(c=n.globals.minY,h=n.globals.maxY),void 0!==s.colorScale.min&&(c=s.colorScale.min<n.globals.minY?s.colorScale.min:n.globals.minY,h=s.colorScale.max>n.globals.maxY?s.colorScale.max:n.globals.maxY);var d=Math.abs(h)+Math.abs(c),u=100*r/(0===d?d-1e-6:d);return s.colorScale.ranges.length>0&&s.colorScale.ranges.map(function(e,t){if(r>=e.from&&r<=e.to){a=e.color,l=e.foreColor?e.foreColor:null,c=e.from,h=e.to;var i=Math.abs(h)+Math.abs(c);u=100*r/(0===i?i-1e-6:i)}}),{color:a,foreColor:l,percent:u}}},{key:"calculateDataLabels",value:function(e){var t=e.text,i=e.x,n=e.y,r=e.i,s=e.j,o=e.colorProps,a=e.fontSize,l=this.w.config.dataLabels,c=new Ai(this.ctx),h=new Xi(this.ctx),d=null;if(l.enabled){d=c.group({class:"apexcharts-data-labels"});var u=l.offsetX,f=l.offsetY,p=i+u,m=n+parseFloat(l.style.fontSize)/3+f;h.plotDataLabelsText({x:p,y:m,text:t,i:r,j:s,color:o.foreColor,parent:d,fontSize:a,dataLabelsConfig:l})}return d}},{key:"addListeners",value:function(e){var t=new Ai(this.ctx);e.node.addEventListener("mouseenter",t.pathMouseEnter.bind(this,e)),e.node.addEventListener("mouseleave",t.pathMouseLeave.bind(this,e)),e.node.addEventListener("mousedown",t.pathMouseDown.bind(this,e))}}]),e}(),Rn=function(){function e(t,i){s(this,e),this.ctx=t,this.w=t.w,this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new Pn(t),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}return a(e,[{key:"draw",value:function(e){var t=this.w,i=new Ai(this.ctx),n=i.group({class:"apexcharts-heatmap"});n.attr("clip-path","url(#gridRectMask".concat(t.globals.cuid,")"));var r=t.globals.gridWidth/t.globals.dataPoints,s=t.globals.gridHeight/t.globals.series.length,o=0,a=!1;this.negRange=this.helpers.checkColorRange();var l=e.slice();t.config.yaxis[0].reversed&&(a=!0,l.reverse());for(var c=a?0:l.length-1;a?c<l.length:c>=0;a?c++:c--){var h=i.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:w.escapeString(t.globals.seriesNames[c]),rel:c+1,"data:realIndex":c});if(this.ctx.series.addCollapsedClassToSeries(h,c),t.config.chart.dropShadow.enabled){var d=t.config.chart.dropShadow;new Mi(this.ctx).dropShadow(h,d,c)}for(var u=0,f=t.config.plotOptions.heatmap.shadeIntensity,p=0,m=0;m<t.globals.dataPoints;m++)if(t.globals.seriesX.length&&!t.globals.allSeriesHasEqualX&&t.globals.minX+t.globals.minXDiff*m<t.globals.seriesX[c][p])u+=r;else{if(p>=l[c].length)break;var g=this.helpers.getShadeColor(t.config.chart.type,c,p,this.negRange),_=g.color,y=g.colorProps;"image"===t.config.fill.type&&(_=new Ui(this.ctx).fillPath({seriesNumber:c,dataPointIndex:p,opacity:t.globals.hasNegs?y.percent<0?1-(1+y.percent/100):f+y.percent/100:y.percent/100,patternID:w.randomId(),width:t.config.fill.image.width?t.config.fill.image.width:r,height:t.config.fill.image.height?t.config.fill.image.height:s}));var v=this.rectRadius,x=i.drawRect(u,o,r,s,v);if(x.attr({cx:u,cy:o}),x.node.classList.add("apexcharts-heatmap-rect"),h.add(x),x.attr({fill:_,i:c,index:c,j:p,val:e[c][p],"stroke-width":this.strokeWidth,stroke:t.config.plotOptions.heatmap.useFillColorAsStroke?_:t.globals.stroke.colors[0],color:_}),this.helpers.addListeners(x),t.config.chart.animations.enabled&&!t.globals.dataChanged){var b=1;t.globals.resized||(b=t.config.chart.animations.speed),this.animateHeatMap(x,u,o,r,s,b)}if(t.globals.dataChanged){var S=1;if(this.dynamicAnim.enabled&&t.globals.shouldAnimate){S=this.dynamicAnim.speed;var T=t.globals.previousPaths[c]&&t.globals.previousPaths[c][p]&&t.globals.previousPaths[c][p].color;T||(T="rgba(255, 255, 255, 0)"),this.animateHeatColor(x,w.isColorHex(T)?T:w.rgb2hex(T),w.isColorHex(_)?_:w.rgb2hex(_),S)}}var k=(0,t.config.dataLabels.formatter)(t.globals.series[c][p],{value:t.globals.series[c][p],seriesIndex:c,dataPointIndex:p,w:t}),M=this.helpers.calculateDataLabels({text:k,x:u+r/2,y:o+s/2,i:c,j:p,colorProps:y,series:l});null!==M&&h.add(M),u+=r,p++}o+=s,n.add(h)}var A=t.globals.yAxisScale[0].result.slice();return t.config.yaxis[0].reversed?A.unshift(""):A.push(""),t.globals.yAxisScale[0].result=A,n}},{key:"animateHeatMap",value:function(e,t,i,n,r,s){var o=new S(this.ctx);o.animateRect(e,{x:t+n/2,y:i+r/2,width:0,height:0},{x:t,y:i,width:n,height:r},s,function(){o.animationCompleted(e)})}},{key:"animateHeatColor",value:function(e,t,i,n){e.attr({fill:t}).animate(n).attr({fill:i})}}]),e}(),On=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"drawYAxisTexts",value:function(e,t,i,n){var r=this.w,s=r.config.yaxis[0],o=r.globals.yLabelFormatters[0];return new Ai(this.ctx).drawText({x:e+s.labels.offsetX,y:t+s.labels.offsetY,text:o(n,i),textAnchor:"middle",fontSize:s.labels.style.fontSize,fontFamily:s.labels.style.fontFamily,foreColor:Array.isArray(s.labels.style.colors)?s.labels.style.colors[i]:s.labels.style.colors})}}]),e}(),zn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w;var i=this.w;this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==i.globals.stroke.colors?i.globals.stroke.colors:i.globals.colors,this.defaultSize=Math.min(i.globals.gridWidth,i.globals.gridHeight),this.centerY=this.defaultSize/2,this.centerX=i.globals.gridWidth/2,"radialBar"===i.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(i.config.plotOptions.pie.endAngle-i.config.plotOptions.pie.startAngle),this.initialAngle=i.config.plotOptions.pie.startAngle%this.fullAngle,i.globals.radialSize=this.defaultSize/2.05-i.config.stroke.width-(i.config.chart.sparkline.enabled?0:i.config.chart.dropShadow.blur),this.donutSize=i.globals.radialSize*parseInt(i.config.plotOptions.pie.donut.size,10)/100;var n=i.config.plotOptions.pie.customScale,r=i.globals.gridWidth/2,o=i.globals.gridHeight/2;this.translateX=r-r*n,this.translateY=o-o*n,this.dataLabelsGroup=new Ai(this.ctx).group({class:"apexcharts-datalabels-group",transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(n,")")}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}return a(e,[{key:"draw",value:function(e){var t=this,i=this.w,n=new Ai(this.ctx),r=n.group({class:"apexcharts-pie"});if(i.globals.noData)return r;for(var s=0,o=0;o<e.length;o++)s+=w.negToZero(e[o]);var a=[],l=n.group();0===s&&(s=1e-5),e.forEach(function(e){t.maxY=Math.max(t.maxY,e)}),i.config.yaxis[0].max&&(this.maxY=i.config.yaxis[0].max),"back"===i.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(r);for(var c=0;c<e.length;c++){var h=this.fullAngle*w.negToZero(e[c])/s;a.push(h),"polarArea"===this.chartType?(a[c]=this.fullAngle/e.length,this.sliceSizes.push(i.globals.radialSize*e[c]/this.maxY)):this.sliceSizes.push(i.globals.radialSize)}if(i.globals.dataChanged){for(var d,u=0,f=0;f<i.globals.previousPaths.length;f++)u+=w.negToZero(i.globals.previousPaths[f]);for(var p=0;p<i.globals.previousPaths.length;p++)d=this.fullAngle*w.negToZero(i.globals.previousPaths[p])/u,this.prevSectorAngleArr.push(d)}if(this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){var m=n.drawCircle(this.donutSize);m.attr({cx:this.centerX,cy:this.centerY,fill:i.config.plotOptions.pie.donut.background?i.config.plotOptions.pie.donut.background:"transparent"}),l.add(m)}var g=this.drawArcs(a,e);if(this.sliceLabels.forEach(function(e){g.add(e)}),l.attr({transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(i.config.plotOptions.pie.customScale,")")}),l.add(g),r.add(l),this.donutDataLabels.show){var _=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});r.add(_)}return"front"===i.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(r),r}},{key:"drawArcs",value:function(e,t){var i=this.w,n=new Mi(this.ctx),r=new Ai(this.ctx),s=new Ui(this.ctx),o=r.group({class:"apexcharts-slices"}),a=this.initialAngle,l=this.initialAngle,c=this.initialAngle,h=this.initialAngle;this.strokeWidth=i.config.stroke.show?i.config.stroke.width:0;for(var d=0;d<e.length;d++){var u=r.group({class:"apexcharts-series apexcharts-pie-series",seriesName:w.escapeString(i.globals.seriesNames[d]),rel:d+1,"data:realIndex":d});o.add(u),l=h,c=(a=c)+e[d],h=l+this.prevSectorAngleArr[d];var f=c<a?this.fullAngle+c-a:c-a,p=s.fillPath({seriesNumber:d,size:this.sliceSizes[d],value:t[d]}),m=this.getChangedPath(l,h),g=r.drawPath({d:m,stroke:Array.isArray(this.lineColorArr)?this.lineColorArr[d]:this.lineColorArr,strokeWidth:0,fill:p,fillOpacity:i.config.fill.opacity,classes:"apexcharts-pie-area apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(d)});if(g.attr({index:0,j:d}),n.setSelectionFilter(g,0,d),i.config.chart.dropShadow.enabled){var _=i.config.chart.dropShadow;n.dropShadow(g,_,d)}this.addListeners(g,this.donutDataLabels),Ai.setAttrs(g.node,{"data:angle":f,"data:startAngle":a,"data:strokeWidth":this.strokeWidth,"data:value":t[d]});var y={x:0,y:0};"pie"===this.chartType||"polarArea"===this.chartType?y=w.polarToCartesian(this.centerX,this.centerY,i.globals.radialSize/1.25+i.config.plotOptions.pie.dataLabels.offset,(a+f/2)%this.fullAngle):"donut"===this.chartType&&(y=w.polarToCartesian(this.centerX,this.centerY,(i.globals.radialSize+this.donutSize)/2+i.config.plotOptions.pie.dataLabels.offset,(a+f/2)%this.fullAngle)),u.add(g);var v=0;if(!this.initialAnim||i.globals.resized||i.globals.dataChanged?this.animBeginArr.push(0):(0===(v=f/this.fullAngle*i.config.chart.animations.speed)&&(v=1),this.animDur=v+this.animDur,this.animBeginArr.push(this.animDur)),this.dynamicAnim&&i.globals.dataChanged?this.animatePaths(g,{size:this.sliceSizes[d],endAngle:c,startAngle:a,prevStartAngle:l,prevEndAngle:h,animateStartingPos:!0,i:d,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:i.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(g,{size:this.sliceSizes[d],endAngle:c,startAngle:a,i:d,totalItems:e.length-1,animBeginArr:this.animBeginArr,dur:v}),i.config.plotOptions.pie.expandOnClick&&"polarArea"!==this.chartType&&g.node.addEventListener("mouseup",this.pieClicked.bind(this,d)),void 0!==i.globals.selectedDataPoints[0]&&i.globals.selectedDataPoints[0].indexOf(d)>-1&&this.pieClicked(d),i.config.dataLabels.enabled){var x=y.x,b=y.y,S=100*f/this.fullAngle+"%";if(0!==f&&i.config.plotOptions.pie.dataLabels.minAngleToShowLabel<e[d]){var T=i.config.dataLabels.formatter;void 0!==T&&(S=T(i.globals.seriesPercent[d][0],{seriesIndex:d,w:i}));var k=i.globals.dataLabels.style.colors[d],M=r.group({class:"apexcharts-datalabels"}),A=r.drawText({x,y:b,text:S,textAnchor:"middle",fontSize:i.config.dataLabels.style.fontSize,fontFamily:i.config.dataLabels.style.fontFamily,fontWeight:i.config.dataLabels.style.fontWeight,foreColor:k});if(M.add(A),i.config.dataLabels.dropShadow.enabled){var C=i.config.dataLabels.dropShadow;n.dropShadow(A,C)}A.node.classList.add("apexcharts-pie-label"),i.config.chart.animations.animate&&!1===i.globals.resized&&(A.node.classList.add("apexcharts-pie-label-delay"),A.node.style.animationDelay=i.config.chart.animations.speed/940+"s"),this.sliceLabels.push(M)}}}return o}},{key:"addListeners",value:function(e,t){var i=new Ai(this.ctx);e.node.addEventListener("mouseenter",i.pathMouseEnter.bind(this,e)),e.node.addEventListener("mouseleave",i.pathMouseLeave.bind(this,e)),e.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this,e.node,t)),e.node.addEventListener("mousedown",i.pathMouseDown.bind(this,e)),this.donutDataLabels.total.showAlways||(e.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,e.node,t)),e.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,e.node,t)))}},{key:"animatePaths",value:function(e,t){var i=this.w,n=t.endAngle<t.startAngle?this.fullAngle+t.endAngle-t.startAngle:t.endAngle-t.startAngle,r=n,s=t.startAngle,o=t.startAngle;void 0!==t.prevStartAngle&&void 0!==t.prevEndAngle&&(s=t.prevEndAngle,r=t.prevEndAngle<t.prevStartAngle?this.fullAngle+t.prevEndAngle-t.prevStartAngle:t.prevEndAngle-t.prevStartAngle),t.i===i.config.series.length-1&&(n+o>this.fullAngle?t.endAngle=t.endAngle-(n+o):n+o<this.fullAngle&&(t.endAngle=t.endAngle+(this.fullAngle-(n+o)))),n===this.fullAngle&&(n=this.fullAngle-.01),this.animateArc(e,s,o,n,r,t)}},{key:"animateArc",value:function(e,t,i,n,r,s){var o,a=this,l=this.w,c=new S(this.ctx),h=s.size;(isNaN(t)||isNaN(r))&&(t=i,r=n,s.dur=0);var d=n,u=i,f=t<i?this.fullAngle+t-i:t-i;l.globals.dataChanged&&s.shouldSetPrevPaths&&s.prevEndAngle&&(o=a.getPiePath({me:a,startAngle:s.prevStartAngle,angle:s.prevEndAngle<s.prevStartAngle?this.fullAngle+s.prevEndAngle-s.prevStartAngle:s.prevEndAngle-s.prevStartAngle,size:h}),e.attr({d:o})),0!==s.dur?e.animate(s.dur,s.animBeginArr[s.i]).after(function(){"pie"!==a.chartType&&"donut"!==a.chartType&&"polarArea"!==a.chartType||this.animate(l.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":a.strokeWidth}),s.i===l.config.series.length-1&&c.animationCompleted(e)}).during(function(l){d=f+(n-f)*l,s.animateStartingPos&&(d=r+(n-r)*l,u=t-r+(i-(t-r))*l),o=a.getPiePath({me:a,startAngle:u,angle:d,size:h}),e.node.setAttribute("data:pathOrig",o),e.attr({d:o})}):(o=a.getPiePath({me:a,startAngle:u,angle:n,size:h}),s.isTrack||(l.globals.animationEnded=!0),e.node.setAttribute("data:pathOrig",o),e.attr({d:o,"stroke-width":a.strokeWidth}))}},{key:"pieClicked",value:function(e){var t,i=this.w,n=this,r=n.sliceSizes[e]+(i.config.plotOptions.pie.expandOnClick?4:0),s=i.globals.dom.Paper.findOne(".apexcharts-".concat(n.chartType.toLowerCase(),"-slice-").concat(e));if("true"!==s.attr("data:pieClicked")){var o=i.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(o,function(e){e.setAttribute("data:pieClicked","false");var t=e.getAttribute("data:pathOrig");t&&e.setAttribute("d",t)}),i.globals.capturedDataPointIndex=e,s.attr("data:pieClicked","true");var a=parseInt(s.attr("data:startAngle"),10),l=parseInt(s.attr("data:angle"),10);t=n.getPiePath({me:n,startAngle:a,angle:l,size:r}),360!==l&&s.plot(t)}else{s.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(s.node,this.donutDataLabels);var c=s.attr("data:pathOrig");s.attr({d:c})}}},{key:"getChangedPath",value:function(e,t){var i="";return this.dynamicAnim&&this.w.globals.dataChanged&&(i=this.getPiePath({me:this,startAngle:e,angle:t-e,size:this.size})),i}},{key:"getPiePath",value:function(e){var t,i=e.me,n=e.startAngle,r=e.angle,s=e.size,o=new Ai(this.ctx),a=n,l=Math.PI*(a-90)/180,c=r+n;Math.ceil(c)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(c=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(c)>this.fullAngle&&(c-=this.fullAngle);var h=Math.PI*(c-90)/180,d=i.centerX+s*Math.cos(l),u=i.centerY+s*Math.sin(l),f=i.centerX+s*Math.cos(h),p=i.centerY+s*Math.sin(h),m=w.polarToCartesian(i.centerX,i.centerY,i.donutSize,c),g=w.polarToCartesian(i.centerX,i.centerY,i.donutSize,a),_=r>180?1:0,y=["M",d,u,"A",s,s,0,_,1,f,p];return t="donut"===i.chartType?[].concat(y,["L",m.x,m.y,"A",i.donutSize,i.donutSize,0,_,0,g.x,g.y,"L",d,u,"z"]).join(" "):"pie"===i.chartType||"polarArea"===i.chartType?[].concat(y,["L",i.centerX,i.centerY,"L",d,u]).join(" "):[].concat(y).join(" "),o.roundPathCorners(t,2*this.strokeWidth)}},{key:"drawPolarElements",value:function(e){var t=this.w,i=new tn(this.ctx),n=new Ai(this.ctx),r=new On(this.ctx),s=n.group(),o=n.group(),a=i.niceScale(0,Math.ceil(this.maxY),0),l=a.result.reverse(),c=a.result.length;this.maxY=a.niceMax;for(var h=t.globals.radialSize,d=h/(c-1),u=0;u<c-1;u++){var f=n.drawCircle(h);if(f.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":t.config.plotOptions.polarArea.rings.strokeWidth,stroke:t.config.plotOptions.polarArea.rings.strokeColor}),t.config.yaxis[0].show){var p=r.drawYAxisTexts(this.centerX,this.centerY-h+parseInt(t.config.yaxis[0].labels.style.fontSize,10)/2,u,l[u]);o.add(p)}s.add(f),h-=d}this.drawSpokes(e),e.add(s),e.add(o)}},{key:"renderInnerDataLabels",value:function(e,t,i){var n=this.w,r=new Ai(this.ctx),s=t.total.show;e.node.innerHTML="",e.node.style.opacity=i.opacity;var o,a,l=i.centerX,c=this.donutDataLabels.total.label?i.centerY:i.centerY-i.centerY/6;o=void 0===t.name.color?n.globals.colors[0]:t.name.color;var h=t.name.fontSize,d=t.name.fontFamily,u=t.name.fontWeight;a=void 0===t.value.color?n.config.chart.foreColor:t.value.color;var f=t.value.formatter,p="",m="";if(s?(o=t.total.color,h=t.total.fontSize,d=t.total.fontFamily,u=t.total.fontWeight,m=this.donutDataLabels.total.label?t.total.label:"",p=t.total.formatter(n)):1===n.globals.series.length&&(p=f(n.globals.series[0],n),m=n.globals.seriesNames[0]),m&&(m=t.name.formatter(m,t.total.show,n)),t.name.show){var g=r.drawText({x:l,y:c+parseFloat(t.name.offsetY),text:m,textAnchor:"middle",foreColor:o,fontSize:h,fontWeight:u,fontFamily:d});g.node.classList.add("apexcharts-datalabel-label"),e.add(g)}if(t.value.show){var _=t.name.show?parseFloat(t.value.offsetY)+16:t.value.offsetY,y=r.drawText({x:l,y:c+_,text:p,textAnchor:"middle",foreColor:a,fontWeight:t.value.fontWeight,fontSize:t.value.fontSize,fontFamily:t.value.fontFamily});y.node.classList.add("apexcharts-datalabel-value"),e.add(y)}return e}},{key:"printInnerLabels",value:function(e,t,i,n){var r,s=this.w;n?r=void 0===e.name.color?s.globals.colors[parseInt(n.parentNode.getAttribute("rel"),10)-1]:e.name.color:s.globals.series.length>1&&e.total.show&&(r=e.total.color);var o=s.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),a=s.globals.dom.baseEl.querySelector(".apexcharts-datalabel-value");i=(0,e.value.formatter)(i,s),n||"function"!=typeof e.total.formatter||(i=e.total.formatter(s));var l=t===e.total.label;t=this.donutDataLabels.total.label?e.name.formatter(t,l,s):"",null!==o&&(o.textContent=t),null!==a&&(a.textContent=i),null!==o&&(o.style.fill=r)}},{key:"printDataLabelsInner",value:function(e,t){var i=this.w,n=e.getAttribute("data:value"),r=i.globals.seriesNames[parseInt(e.parentNode.getAttribute("rel"),10)-1];i.globals.series.length>1&&this.printInnerLabels(t,r,n,e);var s=i.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");null!==s&&(s.style.opacity=1)}},{key:"drawSpokes",value:function(e){var t=this,i=this.w,n=new Ai(this.ctx),r=i.config.plotOptions.polarArea.spokes;if(0!==r.strokeWidth){for(var s=[],o=360/i.globals.series.length,a=0;a<i.globals.series.length;a++)s.push(w.polarToCartesian(this.centerX,this.centerY,i.globals.radialSize,i.config.plotOptions.pie.startAngle+o*a));s.forEach(function(i,s){var o=n.drawLine(i.x,i.y,t.centerX,t.centerY,Array.isArray(r.connectorColors)?r.connectorColors[s]:r.connectorColors);e.add(o)})}}},{key:"revertDataLabelsInner",value:function(){var e=this.w;if(this.donutDataLabels.show){var t=e.globals.dom.Paper.findOne(".apexcharts-datalabels-group"),i=this.renderInnerDataLabels(t,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});e.globals.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(i)}}}]),e}(),Fn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0;var i=this.w;this.graphics=new Ai(this.ctx),this.lineColorArr=void 0!==i.globals.stroke.colors?i.globals.stroke.colors:i.globals.colors,this.defaultSize=i.globals.svgHeight<i.globals.svgWidth?i.globals.gridHeight:i.globals.gridWidth,this.isLog=i.config.yaxis[0].logarithmic,this.logBase=i.config.yaxis[0].logBase,this.coreUtils=new Ci(this.ctx),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,i.globals.maxY,0):i.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):i.globals.minY,this.polygons=i.config.plotOptions.radar.polygons,this.strokeWidth=i.config.stroke.show?i.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-i.config.chart.dropShadow.blur,i.config.xaxis.labels.show&&(this.size=this.size-i.globals.xAxisLabelsWidth/1.75),void 0!==i.config.plotOptions.radar.size&&(this.size=i.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.yaxisLabelsTextsPos=[]}return a(e,[{key:"draw",value:function(e){var t=this,i=this.w,n=new Ui(this.ctx),r=[],s=new Xi(this.ctx);e.length&&(this.dataPointsLen=e[i.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;var o=i.globals.gridWidth/2,a=i.globals.gridHeight/2,l=o+i.config.plotOptions.radar.offsetX,c=a+i.config.plotOptions.radar.offsetY,h=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:"translate(".concat(l||0,", ").concat(c||0,")")}),d=[],u=null,f=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),e.forEach(function(e,o){var a=e.length===i.globals.dataPoints,l=t.graphics.group().attr({class:"apexcharts-series","data:longestSeries":a,seriesName:w.escapeString(i.globals.seriesNames[o]),rel:o+1,"data:realIndex":o});t.dataRadiusOfPercent[o]=[],t.dataRadius[o]=[],t.angleArr[o]=[],e.forEach(function(e,i){var n=Math.abs(t.maxValue-t.minValue);e-=t.minValue,t.isLog&&(e=t.coreUtils.getLogVal(t.logBase,e,0)),t.dataRadiusOfPercent[o][i]=e/n,t.dataRadius[o][i]=t.dataRadiusOfPercent[o][i]*t.size,t.angleArr[o][i]=i*t.disAngle}),d=t.getDataPointsPos(t.dataRadius[o],t.angleArr[o]);var c=t.createPaths(d,{x:0,y:0});u=t.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),f=t.graphics.group({class:"apexcharts-datalabels","data:realIndex":o}),i.globals.delayedElements.push({el:u.node,index:o});var h={i:o,realIndex:o,animationDelay:o,initialSpeed:i.config.chart.animations.speed,dataChangeSpeed:i.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:i.globals.stroke.colors[o],strokeLineCap:i.config.stroke.lineCap},p=null;i.globals.previousPaths.length>0&&(p=t.getPreviousPath(o));for(var g=0;g<c.linePathsTo.length;g++){var _=t.graphics.renderPaths(m(m({},h),{},{pathFrom:null===p?c.linePathsFrom[g]:p,pathTo:c.linePathsTo[g],strokeWidth:Array.isArray(t.strokeWidth)?t.strokeWidth[o]:t.strokeWidth,fill:"none",drawShadow:!1}));l.add(_);var y=n.fillPath({seriesNumber:o}),v=t.graphics.renderPaths(m(m({},h),{},{pathFrom:null===p?c.areaPathsFrom[g]:p,pathTo:c.areaPathsTo[g],strokeWidth:0,fill:y,drawShadow:!1}));if(i.config.chart.dropShadow.enabled){var x=new Mi(t.ctx),b=i.config.chart.dropShadow;x.dropShadow(v,Object.assign({},b,{noUserSpaceOnUse:!0}),o)}l.add(v)}e.forEach(function(e,n){var r=new $i(t.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:o,dataPointIndex:n}),a=t.graphics.drawMarker(d[n].x,d[n].y,r);a.attr("rel",n),a.attr("j",n),a.attr("index",o),a.node.setAttribute("default-marker-size",r.pSize);var c=t.graphics.group({class:"apexcharts-series-markers"});c&&c.add(a),u.add(c),l.add(u);var h=i.config.dataLabels;if(h.enabled){var p=h.formatter(i.globals.series[o][n],{seriesIndex:o,dataPointIndex:n,w:i});s.plotDataLabelsText({x:d[n].x,y:d[n].y,text:p,textAnchor:"middle",i:o,j:o,parent:f,offsetCorrection:!1,dataLabelsConfig:m({},h)})}l.add(f)}),r.push(l)}),this.drawPolygons({parent:h}),i.config.xaxis.labels.show){var p=this.drawXAxisTexts();h.add(p)}return r.forEach(function(e){h.add(e)}),h.add(this.yaxisLabels),h}},{key:"drawPolygons",value:function(e){for(var t=this,i=this.w,n=e.parent,r=new On(this.ctx),s=i.globals.yAxisScale[0].result.reverse(),o=s.length,a=[],l=this.size/(o-1),c=0;c<o;c++)a[c]=l*c;a.reverse();var h=[],d=[];a.forEach(function(e,i){var n=w.getPolygonPos(e,t.dataPointsLen),r="";n.forEach(function(e,n){if(0===i){var s=t.graphics.drawLine(e.x,e.y,0,0,Array.isArray(t.polygons.connectorColors)?t.polygons.connectorColors[n]:t.polygons.connectorColors);d.push(s)}0===n&&t.yaxisLabelsTextsPos.push({x:e.x,y:e.y}),r+=e.x+","+e.y+" "}),h.push(r)}),h.forEach(function(e,r){var s=t.polygons.strokeColors,o=t.polygons.strokeWidth,a=t.graphics.drawPolygon(e,Array.isArray(s)?s[r]:s,Array.isArray(o)?o[r]:o,i.globals.radarPolygons.fill.colors[r]);n.add(a)}),d.forEach(function(e){n.add(e)}),i.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach(function(e,i){var n=r.drawYAxisTexts(e.x,e.y,i,s[i]);t.yaxisLabels.add(n)})}},{key:"drawXAxisTexts",value:function(){var e=this,t=this.w,i=t.config.xaxis.labels,n=this.graphics.group({class:"apexcharts-xaxis"}),r=w.getPolygonPos(this.size,this.dataPointsLen);return t.globals.labels.forEach(function(s,o){var a=t.config.xaxis.labels.formatter,l=new Xi(e.ctx);if(r[o]){var c=e.getTextPos(r[o],e.size),h=a(s,{seriesIndex:-1,dataPointIndex:o,w:t});l.plotDataLabelsText({x:c.newX,y:c.newY,text:h,textAnchor:c.textAnchor,i:o,j:o,parent:n,className:"apexcharts-xaxis-label",color:Array.isArray(i.style.colors)&&i.style.colors[o]?i.style.colors[o]:"#a8a8a8",dataLabelsConfig:m({textAnchor:c.textAnchor,dropShadow:{enabled:!1}},i),offsetCorrection:!1}).on("click",function(i){if("function"==typeof t.config.chart.events.xAxisLabelClick){var n=Object.assign({},t,{labelIndex:o});t.config.chart.events.xAxisLabelClick(i,e.ctx,n)}})}}),n}},{key:"createPaths",value:function(e,t){var i=this,n=[],r=[],s=[],o=[];if(e.length){r=[this.graphics.move(t.x,t.y)],o=[this.graphics.move(t.x,t.y)];var a=this.graphics.move(e[0].x,e[0].y),l=this.graphics.move(e[0].x,e[0].y);e.forEach(function(t,n){a+=i.graphics.line(t.x,t.y),l+=i.graphics.line(t.x,t.y),n===e.length-1&&(a+="Z",l+="Z")}),n.push(a),s.push(l)}return{linePathsFrom:r,linePathsTo:n,areaPathsFrom:o,areaPathsTo:s}}},{key:"getTextPos",value:function(e,t){var i="middle",n=e.x,r=e.y;return Math.abs(e.x)>=10?e.x>0?(i="start",n+=10):e.x<0&&(i="end",n-=10):i="middle",Math.abs(e.y)>=t-10&&(e.y<0?r-=10:e.y>0&&(r+=10)),{textAnchor:i,newX:n,newY:r}}},{key:"getPreviousPath",value:function(e){for(var t=this.w,i=null,n=0;n<t.globals.previousPaths.length;n++){var r=t.globals.previousPaths[n];r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(e,10)&&void 0!==t.globals.previousPaths[n].paths[0]&&(i=t.globals.previousPaths[n].paths[0].d)}return i}},{key:"getDataPointsPos",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dataPointsLen;e=e||[],t=t||[];for(var n=[],r=0;r<i;r++){var s={};s.x=e[r]*Math.sin(t[r]),s.y=-e[r]*Math.cos(t[r]),n.push(s)}return n}}]),e}(),Nn=function(){u(t,zn);var e=c(t);function t(i){var n;s(this,t),(n=e.call(this,i)).ctx=i,n.w=i.w,n.animBeginArr=[0],n.animDur=0;var o=n.w;return n.startAngle=o.config.plotOptions.radialBar.startAngle,n.endAngle=o.config.plotOptions.radialBar.endAngle,n.totalAngle=Math.abs(o.config.plotOptions.radialBar.endAngle-o.config.plotOptions.radialBar.startAngle),n.trackStartAngle=o.config.plotOptions.radialBar.track.startAngle,n.trackEndAngle=o.config.plotOptions.radialBar.track.endAngle,n.barLabels=n.w.config.plotOptions.radialBar.barLabels,n.donutDataLabels=n.w.config.plotOptions.radialBar.dataLabels,n.radialDataLabels=n.donutDataLabels,n.trackStartAngle||(n.trackStartAngle=n.startAngle),n.trackEndAngle||(n.trackEndAngle=n.endAngle),360===n.endAngle&&(n.endAngle=359.99),n.margin=parseInt(o.config.plotOptions.radialBar.track.margin,10),n.onBarLabelClick=n.onBarLabelClick.bind(r(n)),n}return a(t,[{key:"draw",value:function(e){var t=this.w,i=new Ai(this.ctx),n=i.group({class:"apexcharts-radialbar"});if(t.globals.noData)return n;var r=i.group(),s=this.defaultSize/2,o=t.globals.gridWidth/2,a=this.defaultSize/2.05;t.config.chart.sparkline.enabled||(a=a-t.config.stroke.width-t.config.chart.dropShadow.blur);var l=t.globals.fill.colors;if(t.config.plotOptions.radialBar.track.show){var c=this.drawTracks({size:a,centerX:o,centerY:s,colorArr:l,series:e});r.add(c)}var h=this.drawArcs({size:a,centerX:o,centerY:s,colorArr:l,series:e}),d=360;t.config.plotOptions.radialBar.startAngle<0&&(d=this.totalAngle);var u=(360-d)/360;if(t.globals.radialSize=a-a*u,this.radialDataLabels.value.show){var f=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);t.globals.radialSize+=f*u}return r.add(h.g),"front"===t.config.plotOptions.radialBar.hollow.position&&(h.g.add(h.elHollow),h.dataLabels&&h.g.add(h.dataLabels)),n.add(r),n}},{key:"drawTracks",value:function(e){var t=this.w,i=new Ai(this.ctx),n=i.group({class:"apexcharts-tracks"}),r=new Mi(this.ctx),s=new Ui(this.ctx),o=this.getStrokeWidth(e);e.size=e.size-o/2;for(var a=0;a<e.series.length;a++){var l=i.group({class:"apexcharts-radialbar-track apexcharts-track"});n.add(l),l.attr({rel:a+1}),e.size=e.size-o-this.margin;var c=t.config.plotOptions.radialBar.track,h=s.fillPath({seriesNumber:0,size:e.size,fillColors:Array.isArray(c.background)?c.background[a]:c.background,solid:!0}),d=this.trackStartAngle,u=this.trackEndAngle;Math.abs(u)+Math.abs(d)>=360&&(u=360-Math.abs(this.startAngle)-.1);var f=i.drawPath({d:"",stroke:h,strokeWidth:o*parseInt(c.strokeWidth,10)/100,fill:"none",strokeOpacity:c.opacity,classes:"apexcharts-radialbar-area"});if(c.dropShadow.enabled){var p=c.dropShadow;r.dropShadow(f,p)}l.add(f),f.attr("id","apexcharts-radialbarTrack-"+a),this.animatePaths(f,{centerX:e.centerX,centerY:e.centerY,endAngle:u,startAngle:d,size:e.size,i:a,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return n}},{key:"drawArcs",value:function(e){var t=this.w,i=new Ai(this.ctx),n=new Ui(this.ctx),r=new Mi(this.ctx),s=i.group(),o=this.getStrokeWidth(e);e.size=e.size-o/2;var a=t.config.plotOptions.radialBar.hollow.background,l=e.size-o*e.series.length-this.margin*e.series.length-o*parseInt(t.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,c=l-t.config.plotOptions.radialBar.hollow.margin;void 0!==t.config.plotOptions.radialBar.hollow.image&&(a=this.drawHollowImage(e,s,l,a));var h=this.drawHollow({size:c,centerX:e.centerX,centerY:e.centerY,fill:a||"transparent"});if(t.config.plotOptions.radialBar.hollow.dropShadow.enabled){var d=t.config.plotOptions.radialBar.hollow.dropShadow;r.dropShadow(h,d)}var u=1;!this.radialDataLabels.total.show&&t.globals.series.length>1&&(u=0);var f=null;if(this.radialDataLabels.show){var p=t.globals.dom.Paper.findOne(".apexcharts-datalabels-group");f=this.renderInnerDataLabels(p,this.radialDataLabels,{hollowSize:l,centerX:e.centerX,centerY:e.centerY,opacity:u})}"back"===t.config.plotOptions.radialBar.hollow.position&&(s.add(h),f&&s.add(f));var m=!1;t.config.plotOptions.radialBar.inverseOrder&&(m=!0);for(var g=m?e.series.length-1:0;m?g>=0:g<e.series.length;m?g--:g++){var _=i.group({class:"apexcharts-series apexcharts-radial-series",seriesName:w.escapeString(t.globals.seriesNames[g])});s.add(_),_.attr({rel:g+1,"data:realIndex":g}),this.ctx.series.addCollapsedClassToSeries(_,g),e.size=e.size-o-this.margin;var y=n.fillPath({seriesNumber:g,size:e.size,value:e.series[g]}),v=this.startAngle,x=void 0,b=w.negToZero(e.series[g]>100?100:e.series[g])/100,S=Math.round(this.totalAngle*b)+this.startAngle,T=void 0;t.globals.dataChanged&&(x=this.startAngle,T=Math.round(this.totalAngle*w.negToZero(t.globals.previousPaths[g])/100)+x),Math.abs(S)+Math.abs(v)>360&&(S-=.01),Math.abs(T)+Math.abs(x)>360&&(T-=.01);var k=S-v,M=Array.isArray(t.config.stroke.dashArray)?t.config.stroke.dashArray[g]:t.config.stroke.dashArray,A=i.drawPath({d:"",stroke:y,strokeWidth:o,fill:"none",fillOpacity:t.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+g,strokeDashArray:M});if(Ai.setAttrs(A.node,{"data:angle":k,"data:value":e.series[g]}),t.config.chart.dropShadow.enabled){var C=t.config.chart.dropShadow;r.dropShadow(A,C,g)}if(r.setSelectionFilter(A,0,g),this.addListeners(A,this.radialDataLabels),_.add(A),A.attr({index:0,j:g}),this.barLabels.enabled){var D=w.polarToCartesian(e.centerX,e.centerY,e.size,v),L=this.barLabels.formatter(t.globals.seriesNames[g],{seriesIndex:g,w:t}),E=["apexcharts-radialbar-label"];this.barLabels.onClick||E.push("apexcharts-no-click");var I=this.barLabels.useSeriesColors?t.globals.colors[g]:t.config.chart.foreColor;I||(I=t.config.chart.foreColor);var P=D.x+this.barLabels.offsetX,R=D.y+this.barLabels.offsetY,O=i.drawText({x:P,y:R,text:L,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:I,cssClass:E.join(" ")});O.on("click",this.onBarLabelClick),O.attr({rel:g+1}),0!==v&&O.attr({"transform-origin":"".concat(P," ").concat(R),transform:"rotate(".concat(v," 0 0)")}),_.add(O)}var z=0;!this.initialAnim||t.globals.resized||t.globals.dataChanged||(z=t.config.chart.animations.speed),t.globals.dataChanged&&(z=t.config.chart.animations.dynamicAnimation.speed),this.animDur=z/(1.2*e.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(A,{centerX:e.centerX,centerY:e.centerY,endAngle:S,startAngle:v,prevEndAngle:T,prevStartAngle:x,size:e.size,i:g,totalItems:2,animBeginArr:this.animBeginArr,dur:z,shouldSetPrevPaths:!0})}return{g:s,elHollow:h,dataLabels:f}}},{key:"drawHollow",value:function(e){var t=new Ai(this.ctx).drawCircle(2*e.size);return t.attr({class:"apexcharts-radialbar-hollow",cx:e.centerX,cy:e.centerY,r:e.size,fill:e.fill}),t}},{key:"drawHollowImage",value:function(e,t,i,n){var r=this.w,s=new Ui(this.ctx),o=w.randomId(),a=r.config.plotOptions.radialBar.hollow.image;if(r.config.plotOptions.radialBar.hollow.imageClipped)s.clippedImgArea({width:i,height:i,image:a,patternID:"pattern".concat(r.globals.cuid).concat(o)}),n="url(#pattern".concat(r.globals.cuid).concat(o,")");else{var l=r.config.plotOptions.radialBar.hollow.imageWidth,c=r.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===l&&void 0===c){var h=r.globals.dom.Paper.image(a,function(t){this.move(e.centerX-t.width/2+r.config.plotOptions.radialBar.hollow.imageOffsetX,e.centerY-t.height/2+r.config.plotOptions.radialBar.hollow.imageOffsetY)});t.add(h)}else{var d=r.globals.dom.Paper.image(a,function(t){this.move(e.centerX-l/2+r.config.plotOptions.radialBar.hollow.imageOffsetX,e.centerY-c/2+r.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(l,c)});t.add(d)}}return n}},{key:"getStrokeWidth",value:function(e){var t=this.w;return e.size*(100-parseInt(t.config.plotOptions.radialBar.hollow.size,10))/100/(e.series.length+1)-this.margin}},{key:"onBarLabelClick",value:function(e){var t=parseInt(e.target.getAttribute("rel"),10)-1,i=this.barLabels.onClick,n=this.w;i&&i(n.globals.seriesNames[t],{w:n,seriesIndex:t})}}]),t}(),Yn=function(){u(t,Ln);var e=c(t);function t(){return s(this,t),e.apply(this,arguments)}return a(t,[{key:"draw",value:function(e,t){var i=this.w,n=new Ai(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=e,this.seriesRangeStart=i.globals.seriesRangeStart,this.seriesRangeEnd=i.globals.seriesRangeEnd,this.barHelpers.initVariables(e);for(var r=n.group({class:"apexcharts-rangebar-series apexcharts-plot-series"}),s=0;s<e.length;s++){var o,a,l,c,h=void 0,d=void 0,u=i.globals.comboCharts?t[s]:s,f=this.barHelpers.getGroupIndex(u).columnGroupIndex,p=n.group({class:"apexcharts-series",seriesName:w.escapeString(i.globals.seriesNames[u]),rel:s+1,"data:realIndex":u});this.ctx.series.addCollapsedClassToSeries(p,u),e[s].length>0&&(this.visibleI=this.visibleI+1);var g=0,_=0,y=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[u][0],y=u);var v=this.barHelpers.initialPositions(u);d=v.y,c=v.zeroW,h=v.x,_=v.barWidth,g=v.barHeight,o=v.xDivision,a=v.yDivision,l=v.zeroH;for(var x=n.group({class:"apexcharts-datalabels","data:realIndex":u}),b=n.group({class:"apexcharts-rangebar-goals-markers"}),S=0;S<i.globals.dataPoints;S++){var T=this.barHelpers.getStrokeWidth(s,S,u),k=this.seriesRangeStart[s][S],M=this.seriesRangeEnd[s][S],A=null,C=null,D=null,L={x:h,y:d,strokeWidth:T,elSeries:p},E=this.seriesLen;if(i.config.plotOptions.bar.rangeBarGroupRows&&(E=1),void 0===i.config.series[s].data[S])break;if(this.isHorizontal){D=d+g*this.visibleI;var I=(a-g*E)/2;if(i.config.series[s].data[S].x){var P=this.detectOverlappingBars({i:s,j:S,barYPosition:D,srty:I,barHeight:g,yDivision:a,initPositions:v});g=P.barHeight,D=P.barYPosition}_=(A=this.drawRangeBarPaths(m({indexes:{i:s,j:S,realIndex:u},barHeight:g,barYPosition:D,zeroW:c,yDivision:a,y1:k,y2:M},L))).barWidth}else{i.globals.isXNumeric&&(h=(i.globals.seriesX[s][S]-i.globals.minX)/this.xRatio-_/2),C=h+_*this.visibleI;var R=(o-_*E)/2;if(i.config.series[s].data[S].x){var O=this.detectOverlappingBars({i:s,j:S,barXPosition:C,srtx:R,barWidth:_,xDivision:o,initPositions:v});_=O.barWidth,C=O.barXPosition}g=(A=this.drawRangeColumnPaths(m({indexes:{i:s,j:S,realIndex:u,translationsIndex:y},barWidth:_,barXPosition:C,zeroH:l,xDivision:o},L))).barHeight}var z=this.barHelpers.drawGoalLine({barXPosition:A.barXPosition,barYPosition:D,goalX:A.goalX,goalY:A.goalY,barHeight:g,barWidth:_});z&&b.add(z),d=A.y,h=A.x;var F=this.barHelpers.getPathFillColor(e,s,S,u);this.renderSeries({realIndex:u,pathFill:F.color,lineFill:F.useRangeColor?F.color:i.globals.stroke.colors[u],j:S,i:s,x:h,y:d,y1:k,y2:M,pathFrom:A.pathFrom,pathTo:A.pathTo,strokeWidth:T,elSeries:p,series:e,barHeight:g,barWidth:_,barXPosition:C,barYPosition:D,columnGroupIndex:f,elDataLabelsWrap:x,elGoalsMarkers:b,visibleSeries:this.visibleI,type:"rangebar"})}r.add(p)}return r}},{key:"detectOverlappingBars",value:function(e){var t=e.i,i=e.j,n=e.barYPosition,r=e.barXPosition,s=e.srty,o=e.srtx,a=e.barHeight,l=e.barWidth,c=e.yDivision,h=e.xDivision,d=e.initPositions,u=this.w,f=[],p=u.config.series[t].data[i].rangeName,m=u.config.series[t].data[i].x,g=Array.isArray(m)?m.join(" "):m,_=u.globals.labels.map(function(e){return Array.isArray(e)?e.join(" "):e}).indexOf(g),y=u.globals.seriesRange[t].findIndex(function(e){return e.x===g&&e.overlaps.length>0});return this.isHorizontal?(n=u.config.plotOptions.bar.rangeBarGroupRows?s+c*_:s+a*this.visibleI+c*_,y>-1&&!u.config.plotOptions.bar.rangeBarOverlap&&(f=u.globals.seriesRange[t][y].overlaps).indexOf(p)>-1&&(n=(a=d.barHeight/f.length)*this.visibleI+c*(100-parseInt(this.barOptions.barHeight,10))/100/2+a*(this.visibleI+f.indexOf(p))+c*_)):(_>-1&&!u.globals.timescaleLabels.length&&(r=u.config.plotOptions.bar.rangeBarGroupRows?o+h*_:o+l*this.visibleI+h*_),y>-1&&!u.config.plotOptions.bar.rangeBarOverlap&&(f=u.globals.seriesRange[t][y].overlaps).indexOf(p)>-1&&(r=(l=d.barWidth/f.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+l*(this.visibleI+f.indexOf(p))+h*_)),{barYPosition:n,barXPosition:r,barHeight:a,barWidth:l}}},{key:"drawRangeColumnPaths",value:function(e){var t=e.indexes,i=e.x,n=e.xDivision,r=e.barWidth,s=e.barXPosition,o=e.zeroH,a=this.w,l=t.i,c=t.j,h=t.realIndex,d=t.translationsIndex,u=this.yRatio[d],f=this.getRangeValue(h,c),p=Math.min(f.start,f.end),m=Math.max(f.start,f.end);void 0===this.series[l][c]||null===this.series[l][c]?p=o:(p=o-p/u,m=o-m/u);var g=Math.abs(m-p),_=this.barHelpers.getColumnPaths({barXPosition:s,barWidth:r,y1:p,y2:m,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:h,i:h,j:c,w:a});if(a.globals.isXNumeric){var y=this.getBarXForNumericXAxis({x:i,j:c,realIndex:h,barWidth:r});i=y.x,s=y.barXPosition}else i+=n;return{pathTo:_.pathTo,pathFrom:_.pathFrom,barHeight:g,x:i,y:f.start<0&&f.end<0?p:m,goalY:this.barHelpers.getGoalValues("y",null,o,l,c,d),barXPosition:s}}},{key:"preventBarOverflow",value:function(e){var t=this.w;return e<0&&(e=0),e>t.globals.gridWidth&&(e=t.globals.gridWidth),e}},{key:"drawRangeBarPaths",value:function(e){var t=e.indexes,i=e.y,n=e.y1,r=e.y2,s=e.yDivision,o=e.barHeight,a=e.barYPosition,l=e.zeroW,c=this.w,h=t.realIndex,d=t.j,u=this.preventBarOverflow(l+n/this.invertedYRatio),f=this.preventBarOverflow(l+r/this.invertedYRatio),p=this.getRangeValue(h,d),m=Math.abs(f-u),g=this.barHelpers.getBarpaths({barYPosition:a,barHeight:o,x1:u,x2:f,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:c});return c.globals.isXNumeric||(i+=s),{pathTo:g.pathTo,pathFrom:g.pathFrom,barWidth:m,x:p.start<0&&p.end<0?u:f,goalX:this.barHelpers.getGoalValues("x",l,null,h,d),y:i}}},{key:"getRangeValue",value:function(e,t){var i=this.w;return{start:i.globals.seriesRangeStart[e][t],end:i.globals.seriesRangeEnd[e][t]}}}]),t}(),Bn=function(){function e(t){s(this,e),this.w=t.w,this.lineCtx=t}return a(e,[{key:"sameValueSeriesFix",value:function(e,t){var i=this.w;if(("gradient"===i.config.fill.type||"gradient"===i.config.fill.type[e])&&new Ci(this.lineCtx.ctx,i).seriesHaveSameValues(e)){var n=t[e].slice();n[n.length-1]=n[n.length-1]+1e-6,t[e]=n}return t}},{key:"calculatePoints",value:function(e){var t=e.series,i=e.realIndex,n=e.x,r=e.y,s=e.i,o=e.j,a=e.prevY,l=this.w,c=[],h=[],d=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;return l.globals.isXNumeric&&(d=(l.globals.seriesX[i][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),0===o&&(c.push(d),h.push(w.isNumber(t[s][0])?a+l.config.markers.offsetY:null)),c.push(n+l.config.markers.offsetX),h.push(w.isNumber(t[s][o+1])?r+l.config.markers.offsetY:null),{x:c,y:h}}},{key:"checkPreviousPaths",value:function(e){for(var t=e.pathFromLine,i=e.pathFromArea,n=e.realIndex,r=this.w,s=0;s<r.globals.previousPaths.length;s++){var o=r.globals.previousPaths[s];("line"===o.type||"area"===o.type)&&o.paths.length>0&&parseInt(o.realIndex,10)===parseInt(n,10)&&("line"===o.type?(this.lineCtx.appendPathFrom=!1,t=r.globals.previousPaths[s].paths[0].d):"area"===o.type&&(this.lineCtx.appendPathFrom=!1,i=r.globals.previousPaths[s].paths[0].d,r.config.stroke.show&&r.globals.previousPaths[s].paths[1]&&(t=r.globals.previousPaths[s].paths[1].d)))}return{pathFromLine:t,pathFromArea:i}}},{key:"determineFirstPrevY",value:function(e){var t,i,n,r=e.i,s=e.realIndex,o=e.series,a=e.prevY,l=e.lineYPosition,c=e.translationsIndex,h=this.w,d=h.config.chart.stacked&&!h.globals.comboCharts||h.config.chart.stacked&&h.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null===(t=this.w.config.series[s])||void 0===t?void 0:t.type)||"column"===(null===(i=this.w.config.series[s])||void 0===i?void 0:i.type));if(void 0!==(null===(n=o[r])||void 0===n?void 0:n[0]))a=(l=d&&r>0?this.lineCtx.prevSeriesY[r-1][0]:this.lineCtx.zeroY)-o[r][0]/this.lineCtx.yRatio[c]+2*(this.lineCtx.isReversed?o[r][0]/this.lineCtx.yRatio[c]:0);else if(d&&r>0&&void 0===o[r][0])for(var u=r-1;u>=0;u--)if(null!==o[u][0]&&void 0!==o[u][0]){a=l=this.lineCtx.prevSeriesY[u][0];break}return{prevY:a,lineYPosition:l}}}]),e}(),Hn=function(e,t,i){var n=e.slice(t,i);if(t){if(i-t>1&&n[1].length<6){var r=n[0].length;n[1]=[2*n[0][r-2]-n[0][r-4],2*n[0][r-1]-n[0][r-3]].concat(n[1])}n[0]=n[0].slice(-2)}return n};function jn(e,t){return(t[1]-e[1])/(t[0]-e[0])}var Vn=function(){function e(t,i,n){s(this,e),this.ctx=t,this.w=t.w,this.xyRatios=i,this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||n,this.scatter=new Gi(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new Bn(this),this.markers=new $i(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}return a(e,[{key:"draw",value:function(e,t,i,n){var r,s=this.w,o=new Ai(this.ctx),a=s.globals.comboCharts?t:s.config.chart.type,l=o.group({class:"apexcharts-".concat(a,"-series apexcharts-plot-series")}),c=new Ci(this.ctx,s);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,e=c.getLogSeries(e),this.yRatio=c.getLogYRatios(this.yRatio),this.prevSeriesY=[];for(var h=[],d=0;d<e.length;d++){e=this.lineHelpers.sameValueSeriesFix(d,e);var u=s.globals.comboCharts?i[d]:d,f=this.yRatio.length>1?u:0;this._initSerieVariables(e,d,u);var p=[],g=[],_=[],y=s.globals.padHorizontal+this.categoryAxisCorrection;this.ctx.series.addCollapsedClassToSeries(this.elSeries,u),s.globals.isXNumeric&&s.globals.seriesX.length>0&&(y=(s.globals.seriesX[u][0]-s.globals.minX)/this.xRatio),_.push(y);var v,x=y,b=void 0,w=x,S=this.zeroY,T=this.zeroY;S=this.lineHelpers.determineFirstPrevY({i:d,realIndex:u,series:e,prevY:S,lineYPosition:0,translationsIndex:f}).prevY,"monotoneCubic"===s.config.stroke.curve&&null===e[d][0]?p.push(null):p.push(S),v=S,"rangeArea"===a&&(b=T=this.lineHelpers.determineFirstPrevY({i:d,realIndex:u,series:n,prevY:T,lineYPosition:0,translationsIndex:f}).prevY,g.push(null!==p[0]?T:null));var k=this._calculatePathsFrom({type:a,series:e,i:d,realIndex:u,translationsIndex:f,prevX:w,prevY:S,prevY2:T}),M=[p[0]],A=[g[0]],C={type:a,series:e,realIndex:u,translationsIndex:f,i:d,x:y,y:1,pX:x,pY:v,pathsFrom:k,linePaths:[],areaPaths:[],seriesIndex:i,lineYPosition:0,xArrj:_,yArrj:p,y2Arrj:g,seriesRangeEnd:n},D=this._iterateOverDataPoints(m(m({},C),{},{iterations:"rangeArea"===a?e[d].length-1:void 0,isRangeStart:!0}));if("rangeArea"===a){for(var L=this._calculatePathsFrom({series:n,i:d,realIndex:u,prevX:w,prevY:T}),E=this._iterateOverDataPoints(m(m({},C),{},{series:n,xArrj:[y],yArrj:M,y2Arrj:A,pY:b,areaPaths:D.areaPaths,pathsFrom:L,iterations:n[d].length-1,isRangeStart:!1})),I=D.linePaths.length/2,P=0;P<I;P++)D.linePaths[P]=E.linePaths[P+I]+D.linePaths[P];D.linePaths.splice(I),D.pathFromLine=E.pathFromLine+D.pathFromLine}else D.pathFromArea+="z";this._handlePaths({type:a,realIndex:u,i:d,paths:D}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),h.push(this.elSeries)}if(void 0!==(null===(r=s.config.series[0])||void 0===r?void 0:r.zIndex)&&h.sort(function(e,t){return Number(e.node.getAttribute("zIndex"))-Number(t.node.getAttribute("zIndex"))}),s.config.chart.stacked)for(var R=h.length-1;R>=0;R--)l.add(h[R]);else for(var O=0;O<h.length;O++)l.add(h[O]);return l}},{key:"_initSerieVariables",value:function(e,t,i){var n=this.w,r=new Ai(this.ctx);this.xDivision=n.globals.gridWidth/(n.globals.dataPoints-("on"===n.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(n.config.stroke.width)?n.config.stroke.width[i]:n.config.stroke.width;var s=0;if(this.yRatio.length>1&&(this.yaxisIndex=n.globals.seriesYAxisReverseMap[i],s=i),this.isReversed=n.config.yaxis[this.yaxisIndex]&&n.config.yaxis[this.yaxisIndex].reversed,this.zeroY=n.globals.gridHeight-this.baseLineY[s]-(this.isReversed?n.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[s]:0),this.areaBottomY=this.zeroY,(this.zeroY>n.globals.gridHeight||"end"===n.config.plotOptions.area.fillTo)&&(this.areaBottomY=n.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=r.group({class:"apexcharts-series",zIndex:void 0!==n.config.series[i].zIndex?n.config.series[i].zIndex:i,seriesName:w.escapeString(n.globals.seriesNames[i])}),this.elPointsMain=r.group({class:"apexcharts-series-markers-wrap","data:realIndex":i}),n.globals.hasNullValues){var o=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[n.globals.gridHeight+n.globals.markers.largestSize]},seriesIndex:t,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==o&&this.elPointsMain.add(o)}this.elDataLabelsWrap=r.group({class:"apexcharts-datalabels","data:realIndex":i});var a=e[t].length===n.globals.dataPoints;this.elSeries.attr({"data:longestSeries":a,rel:t+1,"data:realIndex":i}),this.appendPathFrom=!0}},{key:"_calculatePathsFrom",value:function(e){var t,i,n,r,s=e.type,o=e.series,a=e.i,l=e.realIndex,c=e.translationsIndex,h=e.prevX,d=e.prevY,u=e.prevY2,f=this.w,p=new Ai(this.ctx);if(null===o[a][0]){for(var m=0;m<o[a].length;m++)if(null!==o[a][m]){h=this.xDivision*m,d=this.zeroY-o[a][m]/this.yRatio[c],t=p.move(h,d),i=p.move(h,this.areaBottomY);break}}else t=p.move(h,d),"rangeArea"===s&&(t=p.move(h,u)+p.line(h,d)),i=p.move(h,this.areaBottomY)+p.line(h,d);if(n=p.move(0,this.areaBottomY)+p.line(0,this.areaBottomY),r=p.move(0,this.areaBottomY)+p.line(0,this.areaBottomY),f.globals.previousPaths.length>0){var g=this.lineHelpers.checkPreviousPaths({pathFromLine:n,pathFromArea:r,realIndex:l});n=g.pathFromLine,r=g.pathFromArea}return{prevX:h,prevY:d,linePath:t,areaPath:i,pathFromLine:n,pathFromArea:r}}},{key:"_handlePaths",value:function(e){var t=e.type,i=e.realIndex,n=e.i,r=e.paths,s=this.w,o=new Ai(this.ctx),a=new Ui(this.ctx);this.prevSeriesY.push(r.yArrj),s.globals.seriesXvalues[i]=r.xArrj,s.globals.seriesYvalues[i]=r.yArrj;var l=s.config.forecastDataPoints;if(l.count>0&&"rangeArea"!==t){var c=s.globals.seriesXvalues[i][s.globals.seriesXvalues[i].length-l.count-1],h=o.drawRect(c,0,s.globals.gridWidth,s.globals.gridHeight,0);s.globals.dom.elForecastMask.appendChild(h.node);var d=o.drawRect(0,0,c,s.globals.gridHeight,0);s.globals.dom.elNonForecastMask.appendChild(d.node)}this.pointsChart||s.globals.delayedElements.push({el:this.elPointsMain.node,index:i});var u={i:n,realIndex:i,animationDelay:n,initialSpeed:s.config.chart.animations.speed,dataChangeSpeed:s.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(t)};if("area"===t)for(var f=a.fillPath({seriesNumber:i}),p=0;p<r.areaPaths.length;p++){var g=o.renderPaths(m(m({},u),{},{pathFrom:r.pathFromArea,pathTo:r.areaPaths[p],stroke:"none",strokeWidth:0,strokeLineCap:null,fill:f}));this.elSeries.add(g)}if(s.config.stroke.show&&!this.pointsChart){var _=null;if("line"===t)_=a.fillPath({seriesNumber:i,i:n});else if("solid"===s.config.stroke.fill.type)_=s.globals.stroke.colors[i];else{var y=s.config.fill;s.config.fill=s.config.stroke.fill,_=a.fillPath({seriesNumber:i,i:n}),s.config.fill=y}for(var v=0;v<r.linePaths.length;v++){var x=_;"rangeArea"===t&&(x=a.fillPath({seriesNumber:i}));var b=m(m({},u),{},{pathFrom:r.pathFromLine,pathTo:r.linePaths[v],stroke:_,strokeWidth:this.strokeWidth,strokeLineCap:s.config.stroke.lineCap,fill:"rangeArea"===t?x:"none"}),w=o.renderPaths(b);if(this.elSeries.add(w),w.attr("fill-rule","evenodd"),l.count>0&&"rangeArea"!==t){var S=o.renderPaths(b);S.node.setAttribute("stroke-dasharray",l.dashArray),l.strokeWidth&&S.node.setAttribute("stroke-width",l.strokeWidth),this.elSeries.add(S),S.attr("clip-path","url(#forecastMask".concat(s.globals.cuid,")")),w.attr("clip-path","url(#nonForecastMask".concat(s.globals.cuid,")"))}}}}},{key:"_iterateOverDataPoints",value:function(e){var t,i,n=this,r=e.type,s=e.series,o=e.iterations,a=e.realIndex,l=e.translationsIndex,c=e.i,h=e.x,d=e.y,u=e.pX,f=e.pY,p=e.pathsFrom,m=e.linePaths,g=e.areaPaths,_=e.seriesIndex,y=e.lineYPosition,v=e.xArrj,x=e.yArrj,b=e.y2Arrj,S=e.isRangeStart,T=e.seriesRangeEnd,k=this.w,M=new Ai(this.ctx),A=this.yRatio,C=p.prevY,D=p.linePath,L=p.areaPath,E=p.pathFromLine,I=p.pathFromArea,P=w.isNumber(k.globals.minYArr[a])?k.globals.minYArr[a]:k.globals.minY;o||(o=k.globals.dataPoints>1?k.globals.dataPoints-1:k.globals.dataPoints);var R=function(e,t){return t-e/A[l]+2*(n.isReversed?e/A[l]:0)},O=d,z=k.config.chart.stacked&&!k.globals.comboCharts||k.config.chart.stacked&&k.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null===(t=this.w.config.series[a])||void 0===t?void 0:t.type)||"column"===(null===(i=this.w.config.series[a])||void 0===i?void 0:i.type)),F=k.config.stroke.curve;Array.isArray(F)&&(F=Array.isArray(_)?F[_[c]]:F[c]);for(var N,Y=0,B=0;B<o&&0!==s[c].length;B++){var H=void 0===s[c][B+1]||null===s[c][B+1];if(k.globals.isXNumeric){var j=k.globals.seriesX[a][B+1];void 0===k.globals.seriesX[a][B+1]&&(j=k.globals.seriesX[a][o-1]),h=(j-k.globals.minX)/this.xRatio}else h+=this.xDivision;y=z&&c>0&&k.globals.collapsedSeries.length<k.config.series.length-1?this.prevSeriesY[function(e){for(var t=e;t>0;t--){if(!(k.globals.collapsedSeriesIndices.indexOf((null==_?void 0:_[t])||t)>-1))return t;t--}return 0}(c-1)][B+1]:this.zeroY,H?d=R(P,y):(d=R(s[c][B+1],y),"rangeArea"===r&&(O=R(T[c][B+1],y))),v.push(null===s[c][B+1]?null:h),!H||"smooth"!==k.config.stroke.curve&&"monotoneCubic"!==k.config.stroke.curve?(x.push(d),b.push(O)):(x.push(null),b.push(null));var V=this.lineHelpers.calculatePoints({series:s,x:h,y:d,realIndex:a,i:c,j:B,prevY:C}),W=this._createPaths({type:r,series:s,i:c,realIndex:a,j:B,x:h,y:d,y2:O,xArrj:v,yArrj:x,y2Arrj:b,pX:u,pY:f,pathState:Y,segmentStartX:N,linePath:D,areaPath:L,linePaths:m,areaPaths:g,curve:F,isRangeStart:S});g=W.areaPaths,m=W.linePaths,u=W.pX,f=W.pY,Y=W.pathState,N=W.segmentStartX,L=W.areaPath,D=W.linePath,!this.appendPathFrom||k.globals.hasNullValues||"monotoneCubic"===F&&"rangeArea"===r||(E+=M.line(h,this.areaBottomY),I+=M.line(h,this.areaBottomY)),this.handleNullDataPoints(s,V,c,B,a),this._handleMarkersAndLabels({type:r,pointsPos:V,i:c,j:B,realIndex:a,isRangeStart:S})}return{yArrj:x,xArrj:v,pathFromArea:I,areaPaths:g,pathFromLine:E,linePaths:m,linePath:D,areaPath:L}}},{key:"_handleMarkersAndLabels",value:function(e){var t=e.type,i=e.pointsPos,n=e.isRangeStart,r=e.i,s=e.j,o=e.realIndex,a=this.w,l=new Xi(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,s,{realIndex:o,pointsPos:i,zRatio:this.zRatio,elParent:this.elPointsMain});else{a.globals.series[r].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");var c=this.markers.plotChartMarkers({pointsPos:i,seriesIndex:o,j:s+1});null!==c&&this.elPointsMain.add(c)}var h=l.drawDataLabel({type:t,isRangeStart:n,pos:i,i:o,j:s+1});null!==h&&this.elDataLabelsWrap.add(h)}},{key:"_createPaths",value:function(e){var t=e.type,i=e.series,n=e.i;e.realIndex;var r,s=e.j,o=e.x,a=e.y,l=e.xArrj,c=e.yArrj,h=e.y2,d=e.y2Arrj,u=e.pX,f=e.pY,p=e.pathState,m=e.segmentStartX,g=e.linePath,_=e.areaPath,y=e.linePaths,v=e.areaPaths,x=e.curve,b=e.isRangeStart,w=new Ai(this.ctx),S=this.areaBottomY,T="rangeArea"===t,k="rangeArea"===t&&b;switch(x){case"monotoneCubic":var M=b?c:d;switch(p){case 0:if(null===M[s+1])break;p=1;case 1:if(!(T?l.length===i[n].length:s===i[n].length-2))break;case 2:var A=b?l:l.slice().reverse(),C=b?M:M.slice().reverse(),D=(r=C,A.map(function(e,t){return[e,r[t]]}).filter(function(e){return null!==e[1]})),L=D.length>1?function(e){var t=function(e){for(var t,i,n,r,s=function(e){for(var t=[],i=e[0],n=e[1],r=t[0]=jn(i,n),s=1,o=e.length-1;s<o;s++)i=n,n=e[s+1],t[s]=.5*(r+(r=jn(i,n)));return t[s]=r,t}(e),o=e.length-1,a=[],l=0;l<o;l++)n=jn(e[l],e[l+1]),Math.abs(n)<1e-6?s[l]=s[l+1]=0:(r=(t=s[l]/n)*t+(i=s[l+1]/n)*i)>9&&(r=3*n/Math.sqrt(r),s[l]=r*t,s[l+1]=r*i);for(var c=0;c<=o;c++)r=(e[Math.min(o,c+1)][0]-e[Math.max(0,c-1)][0])/(6*(1+s[c]*s[c])),a.push([r||0,s[c]*r||0]);return a}(e),i=e[1],n=e[0],r=[],s=t[1],o=t[0];r.push(n,[n[0]+o[0],n[1]+o[1],i[0]-s[0],i[1]-s[1],i[0],i[1]]);for(var a=2,l=t.length;a<l;a++){var c=e[a],h=t[a];r.push([c[0]-h[0],c[1]-h[1],c[0],c[1]])}return r}(D):D,E=[];T&&(k?v=D:E=v.reverse());var I=0,P=0;if(function(e,t){for(var i=function(e){var t=[],i=0;return e.forEach(function(e){null!==e?i++:i>0&&(t.push(i),i=0)}),i>0&&t.push(i),t}(e),n=[],r=0,s=0;r<i.length;s+=i[r++])n[r]=Hn(t,s,s+i[r]);return n}(C,L).forEach(function(e){I++;var t=function(e){for(var t="",i=0;i<e.length;i++){var n=e[i],r=n.length;r>4?(t+="C".concat(n[0],", ").concat(n[1]),t+=", ".concat(n[2],", ").concat(n[3]),t+=", ".concat(n[4],", ").concat(n[5])):r>2&&(t+="S".concat(n[0],", ").concat(n[1]),t+=", ".concat(n[2],", ").concat(n[3]))}return t}(e),i=P,n=(P+=e.length)-1;k?g=w.move(D[i][0],D[i][1])+t:T?g=w.move(E[i][0],E[i][1])+w.line(D[i][0],D[i][1])+t+w.line(E[n][0],E[n][1]):(g=w.move(D[i][0],D[i][1])+t,_=g+w.line(D[n][0],S)+w.line(D[i][0],S)+"z",v.push(_)),y.push(g)}),T&&I>1&&!k){var R=y.slice(I).reverse();y.splice(I),R.forEach(function(e){return y.push(e)})}p=0}break;case"smooth":var O=.35*(o-u);if(null===i[n][s])p=0;else switch(p){case 0:if(m=u,g=k?w.move(u,d[s])+w.line(u,f):w.move(u,f),_=w.move(u,f),null===i[n][s+1]||void 0===i[n][s+1]){y.push(g),v.push(_);break}if(p=1,s<i[n].length-2){var z=w.curve(u+O,f,o-O,a,o,a);g+=z,_+=z;break}case 1:if(null===i[n][s+1])g+=k?w.line(u,h):w.move(u,f),_+=w.line(u,S)+w.line(m,S)+"z",y.push(g),v.push(_),p=-1;else{var F=w.curve(u+O,f,o-O,a,o,a);g+=F,_+=F,s>=i[n].length-2&&(k&&(g+=w.curve(o,a,o,a,o,h)+w.move(o,h)),_+=w.curve(o,a,o,a,o,S)+w.line(m,S)+"z",y.push(g),v.push(_),p=-1)}}u=o,f=a;break;default:var N=function(e,t,i){var n=[];switch(e){case"stepline":n=w.line(t,null,"H")+w.line(null,i,"V");break;case"linestep":n=w.line(null,i,"V")+w.line(t,null,"H");break;case"straight":n=w.line(t,i)}return n};if(null===i[n][s])p=0;else switch(p){case 0:if(m=u,g=k?w.move(u,d[s])+w.line(u,f):w.move(u,f),_=w.move(u,f),null===i[n][s+1]||void 0===i[n][s+1]){y.push(g),v.push(_);break}if(p=1,s<i[n].length-2){var Y=N(x,o,a);g+=Y,_+=Y;break}case 1:if(null===i[n][s+1])g+=k?w.line(u,h):w.move(u,f),_+=w.line(u,S)+w.line(m,S)+"z",y.push(g),v.push(_),p=-1;else{var B=N(x,o,a);g+=B,_+=B,s>=i[n].length-2&&(k&&(g+=w.line(o,h)),_+=w.line(o,S)+w.line(m,S)+"z",y.push(g),v.push(_),p=-1)}}u=o,f=a}return{linePaths:y,areaPaths:v,pX:u,pY:f,pathState:p,segmentStartX:m,linePath:g,areaPath:_}}},{key:"handleNullDataPoints",value:function(e,t,i,n,r){var s=this.w;if(null===e[i][n]&&s.config.markers.showNullDataPoints||1===e[i].length){var o=this.strokeWidth-s.config.markers.strokeWidth/2;o>0||(o=0);var a=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:r,j:n+1,pSize:o,alwaysDrawMarker:!0});null!==a&&this.elPointsMain.add(a)}}}]),e}();window.TreemapSquared={},window.TreemapSquared.generate=function(){function e(t,i,n,r){this.xoffset=t,this.yoffset=i,this.height=r,this.width=n,this.shortestEdge=function(){return Math.min(this.height,this.width)},this.getCoordinates=function(e){var t,i=[],n=this.xoffset,r=this.yoffset,o=s(e)/this.height,a=s(e)/this.width;if(this.width>=this.height)for(t=0;t<e.length;t++)i.push([n,r,n+o,r+e[t]/o]),r+=e[t]/o;else for(t=0;t<e.length;t++)i.push([n,r,n+e[t]/a,r+a]),n+=e[t]/a;return i},this.cutArea=function(t){var i;if(this.width>=this.height){var n=t/this.height,r=this.width-n;i=new e(this.xoffset+n,this.yoffset,r,this.height)}else{var s=t/this.width,o=this.height-s;i=new e(this.xoffset,this.yoffset+s,this.width,o)}return i}}function t(t,n,r,o,a){o=void 0===o?0:o,a=void 0===a?0:a;var l=i(function(e,t){var i,n=[],r=t/s(e);for(i=0;i<e.length;i++)n[i]=e[i]*r;return n}(t,n*r),[],new e(o,a,n,r),[]);return function(e){var t,i,n=[];for(t=0;t<e.length;t++)for(i=0;i<e[t].length;i++)n.push(e[t][i]);return n}(l)}function i(e,t,r,o){var a,l,c;if(0!==e.length)return a=r.shortestEdge(),function(e,t,i){var r;return 0===e.length||((r=e.slice()).push(t),n(e,i)>=n(r,i))}(t,l=e[0],a)?(t.push(l),i(e.slice(1),t,r,o)):(c=r.cutArea(s(t),o),o.push(r.getCoordinates(t)),i(e,[],c,o)),o;o.push(r.getCoordinates(t))}function n(e,t){var i=Math.min.apply(Math,e),n=Math.max.apply(Math,e),r=s(e);return Math.max(Math.pow(t,2)*n/Math.pow(r,2),Math.pow(r,2)/(Math.pow(t,2)*i))}function r(e){return e&&e.constructor===Array}function s(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t];return i}function o(e){var t,i=0;if(r(e[0]))for(t=0;t<e.length;t++)i+=o(e[t]);else i=s(e);return i}return function e(i,n,s,a,l){a=void 0===a?0:a,l=void 0===l?0:l;var c,h,d=[],u=[];if(r(i[0])){for(h=0;h<i.length;h++)d[h]=o(i[h]);for(c=t(d,n,s,a,l),h=0;h<i.length;h++)u.push(e(i[h],c[h][2]-c[h][0],c[h][3]-c[h][1],c[h][0],c[h][1]))}else u=t(i,n,s,a,l);return u}}();var Wn=function(){function e(t,i){s(this,e),this.ctx=t,this.w=t.w,this.strokeWidth=this.w.config.stroke.width,this.helpers=new Pn(t),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}return a(e,[{key:"draw",value:function(e){var t=this,i=this.w,n=new Ai(this.ctx),r=new Ui(this.ctx),s=n.group({class:"apexcharts-treemap"});if(i.globals.noData)return s;var o=[];return e.forEach(function(e){var t=e.map(function(e){return Math.abs(e)});o.push(t)}),this.negRange=this.helpers.checkColorRange(),i.config.series.forEach(function(e,i){e.data.forEach(function(e){Array.isArray(t.labels[i])||(t.labels[i]=[]),t.labels[i].push(e.x)})}),window.TreemapSquared.generate(o,i.globals.gridWidth,i.globals.gridHeight).forEach(function(o,a){var l=n.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:w.escapeString(i.globals.seriesNames[a]),rel:a+1,"data:realIndex":a});if(i.config.chart.dropShadow.enabled){var c=i.config.chart.dropShadow;new Mi(t.ctx).dropShadow(s,c,a)}var h=n.group({class:"apexcharts-data-labels"}),d={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};o.forEach(function(s,o){var c=s[0],h=s[1],u=s[2],f=s[3];d.xMin=Math.min(d.xMin,c),d.yMin=Math.min(d.yMin,h),d.xMax=Math.max(d.xMax,u),d.yMax=Math.max(d.yMax,f);var p=t.helpers.getShadeColor(i.config.chart.type,a,o,t.negRange),m=p.color,g=r.fillPath({color:m,seriesNumber:a,dataPointIndex:o}),_=n.drawRect(c,h,u-c,f-h,i.config.plotOptions.treemap.borderRadius,"#fff",1,t.strokeWidth,i.config.plotOptions.treemap.useFillColorAsStroke?m:i.globals.stroke.colors[a]);_.attr({cx:c,cy:h,index:a,i:a,j:o,width:u-c,height:f-h,fill:g}),_.node.classList.add("apexcharts-treemap-rect"),t.helpers.addListeners(_);var y={x:c+(u-c)/2,y:h+(f-h)/2,width:0,height:0},v={x:c,y:h,width:u-c,height:f-h};if(i.config.chart.animations.enabled&&!i.globals.dataChanged){var x=1;i.globals.resized||(x=i.config.chart.animations.speed),t.animateTreemap(_,y,v,x)}if(i.globals.dataChanged){var b=1;t.dynamicAnim.enabled&&i.globals.shouldAnimate&&(b=t.dynamicAnim.speed,i.globals.previousPaths[a]&&i.globals.previousPaths[a][o]&&i.globals.previousPaths[a][o].rect&&(y=i.globals.previousPaths[a][o].rect),t.animateTreemap(_,y,v,b))}var w=t.getFontSize(s),S=i.config.dataLabels.formatter(t.labels[a][o],{value:i.globals.series[a][o],seriesIndex:a,dataPointIndex:o,w:i});"truncate"===i.config.plotOptions.treemap.dataLabels.format&&(w=parseInt(i.config.dataLabels.style.fontSize,10),S=t.truncateLabels(S,w,c,h,u,f));var T=null;i.globals.series[a][o]&&(T=t.helpers.calculateDataLabels({text:S,x:(c+u)/2,y:(h+f)/2+t.strokeWidth/2+w/3,i:a,j:o,colorProps:p,fontSize:w,series:e})),i.config.dataLabels.enabled&&T&&t.rotateToFitLabel(T,w,S,c,h,u,f),l.add(_),null!==T&&l.add(T)});var u=i.config.plotOptions.treemap.seriesTitle;if(i.config.series.length>1&&u&&u.show){var f=i.config.series[a].name||"";if(f&&d.xMin<1/0&&d.yMin<1/0){var p=u.offsetX,m=u.offsetY,g=u.borderColor,_=u.borderWidth,y=u.borderRadius,v=u.style,x=v.color||i.config.chart.foreColor,b={left:v.padding.left,right:v.padding.right,top:v.padding.top,bottom:v.padding.bottom},S=n.getTextRects(f,v.fontSize,v.fontFamily),T=S.width+b.left+b.right,k=S.height+b.top+b.bottom,M=d.xMin+(p||0),A=d.yMin+(m||0),C=n.drawRect(M,A,T,k,y,v.background,1,_,g),D=n.drawText({x:M+b.left,y:A+b.top+.75*S.height,text:f,fontSize:v.fontSize,fontFamily:v.fontFamily,fontWeight:v.fontWeight,foreColor:x,cssClass:v.cssClass||""});l.add(C),l.add(D)}}l.add(h),s.add(l)}),s}},{key:"getFontSize",value:function(e){var t=this.w,i=function e(t){var i,n=0;if(Array.isArray(t[0]))for(i=0;i<t.length;i++)n+=e(t[i]);else for(i=0;i<t.length;i++)n+=t[i].length;return n}(this.labels)/function e(t){var i,n=0;if(Array.isArray(t[0]))for(i=0;i<t.length;i++)n+=e(t[i]);else for(i=0;i<t.length;i++)n+=1;return n}(this.labels);return function(e,n){var r=e*n,s=Math.pow(r,.5);return Math.min(s/i,parseInt(t.config.dataLabels.style.fontSize,10))}(e[2]-e[0],e[3]-e[1])}},{key:"rotateToFitLabel",value:function(e,t,i,n,r,s,o){var a=new Ai(this.ctx),l=a.getTextRects(i,t);if(l.width+this.w.config.stroke.width+5>s-n&&l.width<=o-r){var c=a.rotateAroundCenter(e.node);e.node.setAttribute("transform","rotate(-90 ".concat(c.x," ").concat(c.y,") translate(").concat(l.height/3,")"))}}},{key:"truncateLabels",value:function(e,t,i,n,r,s){var o=new Ai(this.ctx),a=o.getTextRects(e,t).width+this.w.config.stroke.width+5>r-i&&s-n>r-i?s-n:r-i,l=o.getTextBasedOnMaxWidth({text:e,maxWidth:a,fontSize:t});return e.length!==l.length&&a/t<5?"":l}},{key:"animateTreemap",value:function(e,t,i,n){var r=new S(this.ctx);r.animateRect(e,t,i,n,function(){r.animationCompleted(e)})}}]),e}(),Un=10/86400,$n=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}return a(e,[{key:"calculateTimeScaleTicks",value:function(e,t){var i=this,n=this.w;if(n.globals.allSeriesCollapsed)return n.globals.labels=[],n.globals.timescaleLabels=[],[];var r=new Ei(this.ctx),s=(t-e)/864e5;this.determineInterval(s),n.globals.disableZoomIn=!1,n.globals.disableZoomOut=!1,s<Un?n.globals.disableZoomIn=!0:s>5e4&&(n.globals.disableZoomOut=!0);var o=r.getTimeUnitsfromTimestamp(e,t,this.utc),a=n.globals.gridWidth/s,l=a/24,c=l/60,h=c/60,d=Math.floor(24*s),u=Math.floor(1440*s),f=Math.floor(86400*s),p=Math.floor(s),g=Math.floor(s/30),_=Math.floor(s/365),y={minMillisecond:o.minMillisecond,minSecond:o.minSecond,minMinute:o.minMinute,minHour:o.minHour,minDate:o.minDate,minMonth:o.minMonth,minYear:o.minYear},v={firstVal:y,currentMillisecond:y.minMillisecond,currentSecond:y.minSecond,currentMinute:y.minMinute,currentHour:y.minHour,currentMonthDate:y.minDate,currentDate:y.minDate,currentMonth:y.minMonth,currentYear:y.minYear,daysWidthOnXAxis:a,hoursWidthOnXAxis:l,minutesWidthOnXAxis:c,secondsWidthOnXAxis:h,numberOfSeconds:f,numberOfMinutes:u,numberOfHours:d,numberOfDays:p,numberOfMonths:g,numberOfYears:_};switch(this.tickInterval){case"years":this.generateYearScale(v);break;case"months":case"half_year":this.generateMonthScale(v);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(v);break;case"hours":this.generateHourScale(v);break;case"minutes_fives":case"minutes":this.generateMinuteScale(v);break;case"seconds_tens":case"seconds_fives":case"seconds":this.generateSecondScale(v)}var x=this.timeScaleArray.map(function(e){var t={position:e.position,unit:e.unit,year:e.year,day:e.day?e.day:1,hour:e.hour?e.hour:0,month:e.month+1};return"month"===e.unit?m(m({},t),{},{day:1,value:e.value+1}):"day"===e.unit||"hour"===e.unit?m(m({},t),{},{value:e.value}):"minute"===e.unit?m(m({},t),{},{value:e.value,minute:e.value}):"second"===e.unit?m(m({},t),{},{value:e.value,minute:e.minute,second:e.second}):e});return x.filter(function(e){var t=1,r=Math.ceil(n.globals.gridWidth/120),s=e.value;void 0!==n.config.xaxis.tickAmount&&(r=n.config.xaxis.tickAmount),x.length>r&&(t=Math.floor(x.length/r));var o=!1,a=!1;switch(i.tickInterval){case"years":"year"===e.unit&&(o=!0);break;case"half_year":t=7,"year"===e.unit&&(o=!0);break;case"months":t=1,"year"===e.unit&&(o=!0);break;case"months_fortnight":t=15,"year"!==e.unit&&"month"!==e.unit||(o=!0),30===s&&(a=!0);break;case"months_days":t=10,"month"===e.unit&&(o=!0),30===s&&(a=!0);break;case"week_days":t=8,"month"===e.unit&&(o=!0);break;case"days":t=1,"month"===e.unit&&(o=!0);break;case"hours":"day"===e.unit&&(o=!0);break;case"minutes_fives":case"seconds_fives":s%5!=0&&(a=!0);break;case"seconds_tens":s%10!=0&&(a=!0)}if("hours"===i.tickInterval||"minutes_fives"===i.tickInterval||"seconds_tens"===i.tickInterval||"seconds_fives"===i.tickInterval){if(!a)return!0}else if((s%t==0||o)&&!a)return!0})}},{key:"recalcDimensionsBasedOnFormat",value:function(e,t){var i=this.w,n=this.formatDates(e),r=this.removeOverlappingTS(n);i.globals.timescaleLabels=r.slice(),new gn(this.ctx).plotCoords()}},{key:"determineInterval",value:function(e){var t=24*e,i=60*t;switch(!0){case e/365>5:this.tickInterval="years";break;case e>800:this.tickInterval="half_year";break;case e>180:this.tickInterval="months";break;case e>90:this.tickInterval="months_fortnight";break;case e>60:this.tickInterval="months_days";break;case e>30:this.tickInterval="week_days";break;case e>2:this.tickInterval="days";break;case t>2.4:this.tickInterval="hours";break;case i>15:this.tickInterval="minutes_fives";break;case i>5:this.tickInterval="minutes";break;case i>1:this.tickInterval="seconds_tens";break;case 60*i>20:this.tickInterval="seconds_fives";break;default:this.tickInterval="seconds"}}},{key:"generateYearScale",value:function(e){var t=e.firstVal,i=e.currentMonth,n=e.currentYear,r=e.daysWidthOnXAxis,s=e.numberOfYears,o=t.minYear,a=0,l=new Ei(this.ctx),c="year";if(t.minDate>1||t.minMonth>0){var h=l.determineRemainingDaysOfYear(t.minYear,t.minMonth,t.minDate);a=(l.determineDaysOfYear(t.minYear)-h+1)*r,o=t.minYear+1,this.timeScaleArray.push({position:a,value:o,unit:c,year:o,month:w.monthMod(i+1)})}else 1===t.minDate&&0===t.minMonth&&this.timeScaleArray.push({position:a,value:o,unit:c,year:n,month:w.monthMod(i+1)});for(var d=o,u=a,f=0;f<s;f++)d++,u=l.determineDaysOfYear(d-1)*r+u,this.timeScaleArray.push({position:u,value:d,unit:c,year:d,month:1})}},{key:"generateMonthScale",value:function(e){var t=e.firstVal,i=e.currentMonthDate,n=e.currentMonth,r=e.currentYear,s=e.daysWidthOnXAxis,o=e.numberOfMonths,a=n,l=0,c=new Ei(this.ctx),h="month",d=0;if(t.minDate>1){l=(c.determineDaysOfMonths(n+1,t.minYear)-i+1)*s,a=w.monthMod(n+1);var u=r+d,f=w.monthMod(a),p=a;0===a&&(h="year",p=u,f=1,u+=d+=1),this.timeScaleArray.push({position:l,value:p,unit:h,year:u,month:f})}else this.timeScaleArray.push({position:l,value:a,unit:h,year:r,month:w.monthMod(n)});for(var m=a+1,g=l,_=0,y=1;_<o;_++,y++){0===(m=w.monthMod(m))?(h="year",d+=1):h="month";var v=this._getYear(r,m,d);g=c.determineDaysOfMonths(m,v)*s+g;var x=0===m?v:m;this.timeScaleArray.push({position:g,value:x,unit:h,year:v,month:0===m?1:m}),m++}}},{key:"generateDayScale",value:function(e){var t=e.firstVal,i=e.currentMonth,n=e.currentYear,r=e.hoursWidthOnXAxis,s=e.numberOfDays,o=new Ei(this.ctx),a="day",l=t.minDate+1,c=l,h=function(e,t,i){return e>o.determineDaysOfMonths(t+1,i)?(c=1,a="month",u=t+=1,t):t},d=(24-t.minHour)*r,u=l,f=h(c,i,n);0===t.minHour&&1===t.minDate?(d=0,u=w.monthMod(t.minMonth),a="month",c=t.minDate):1!==t.minDate&&0===t.minHour&&0===t.minMinute&&(d=0,l=t.minDate,u=l,f=h(c=l,i,n),1!==u&&(a="day")),this.timeScaleArray.push({position:d,value:u,unit:a,year:this._getYear(n,f,0),month:w.monthMod(f),day:c});for(var p=d,m=0;m<s;m++){a="day",f=h(c+=1,f,this._getYear(n,f,0));var g=this._getYear(n,f,0);p=24*r+p;var _=1===c?w.monthMod(f):c;this.timeScaleArray.push({position:p,value:_,unit:a,year:g,month:w.monthMod(f),day:_})}}},{key:"generateHourScale",value:function(e){var t=e.firstVal,i=e.currentDate,n=e.currentMonth,r=e.currentYear,s=e.minutesWidthOnXAxis,o=e.numberOfHours,a=new Ei(this.ctx),l="hour",c=function(e,t){return e>a.determineDaysOfMonths(t+1,r)&&(m=1,t+=1),{month:t,date:m}},h=function(e,t){return e>a.determineDaysOfMonths(t+1,r)?t+=1:t},d=60-(t.minMinute+t.minSecond/60),u=d*s,f=t.minHour+1,p=f;60===d&&(u=0,p=f=t.minHour);var m=i;p>=24&&(p=0,l="day",f=m+=1);var g=c(m,n).month;g=h(m,g),f>31&&(f=m=1),this.timeScaleArray.push({position:u,value:f,unit:l,day:m,hour:p,year:r,month:w.monthMod(g)}),p++;for(var _=u,y=0;y<o;y++){l="hour",p>=24&&(p=0,l="day",g=c(m+=1,g).month,g=h(m,g));var v=this._getYear(r,g,0);_=60*s+_;var x=0===p?m:p;this.timeScaleArray.push({position:_,value:x,unit:l,hour:p,day:m,year:v,month:w.monthMod(g)}),p++}}},{key:"generateMinuteScale",value:function(e){for(var t=e.currentMillisecond,i=e.currentSecond,n=e.currentMinute,r=e.currentHour,s=e.currentDate,o=e.currentMonth,a=e.currentYear,l=e.minutesWidthOnXAxis,c=e.secondsWidthOnXAxis,h=e.numberOfMinutes,d=n+1,u=s,f=o,p=a,m=r,g=(60-i-t/1e3)*c,_=0;_<h;_++)d>=60&&(d=0,24===(m+=1)&&(m=0)),this.timeScaleArray.push({position:g,value:d,unit:"minute",hour:m,minute:d,day:u,year:this._getYear(p,f,0),month:w.monthMod(f)}),g+=l,d++}},{key:"generateSecondScale",value:function(e){for(var t=e.currentMillisecond,i=e.currentSecond,n=e.currentMinute,r=e.currentHour,s=e.currentDate,o=e.currentMonth,a=e.currentYear,l=e.secondsWidthOnXAxis,c=e.numberOfSeconds,h=i+1,d=n,u=s,f=o,p=a,m=r,g=(1e3-t)/1e3*l,_=0;_<c;_++)h>=60&&(h=0,++d>=60&&(d=0,24===++m&&(m=0))),this.timeScaleArray.push({position:g,value:h,unit:"second",hour:m,minute:d,second:h,day:u,year:this._getYear(p,f,0),month:w.monthMod(f)}),g+=l,h++}},{key:"createRawDateString",value:function(e,t){var i=e.year;return 0===e.month&&(e.month=1),i+="-"+("0"+e.month.toString()).slice(-2),"day"===e.unit?i+="day"===e.unit?"-"+("0"+t).slice(-2):"-01":i+="-"+("0"+(e.day?e.day:"1")).slice(-2),"hour"===e.unit?i+="hour"===e.unit?"T"+("0"+t).slice(-2):"T00":i+="T"+("0"+(e.hour?e.hour:"0")).slice(-2),"minute"===e.unit?i+=":"+("0"+t).slice(-2):i+=":"+(e.minute?("0"+e.minute).slice(-2):"00"),"second"===e.unit?i+=":"+("0"+t).slice(-2):i+=":00",this.utc&&(i+=".000Z"),i}},{key:"formatDates",value:function(e){var t=this,i=this.w;return e.map(function(e){var n=e.value.toString(),r=new Ei(t.ctx),s=t.createRawDateString(e,n),o=r.getDate(r.parseDate(s));if(t.utc||(o=r.getDate(r.parseDateWithTimezone(s))),void 0===i.config.xaxis.labels.format){var a="dd MMM",l=i.config.xaxis.labels.datetimeFormatter;"year"===e.unit&&(a=l.year),"month"===e.unit&&(a=l.month),"day"===e.unit&&(a=l.day),"hour"===e.unit&&(a=l.hour),"minute"===e.unit&&(a=l.minute),"second"===e.unit&&(a=l.second),n=r.formatDate(o,a)}else n=r.formatDate(o,i.config.xaxis.labels.format);return{dateString:s,position:e.position,value:n,unit:e.unit,year:e.year,month:e.month}})}},{key:"removeOverlappingTS",value:function(e){var t,i=this,n=new Ai(this.ctx),r=!1;e.length>0&&e[0].value&&e.every(function(t){return t.value.length===e[0].value.length})&&(r=!0,t=n.getTextRects(e[0].value).width);var s=0,o=e.map(function(o,a){if(a>0&&i.w.config.xaxis.labels.hideOverlappingLabels){var l=r?t:n.getTextRects(e[s].value).width,c=e[s].position;return o.position>c+l+10?(s=a,o):null}return o});return o.filter(function(e){return null!==e})}},{key:"_getYear",value:function(e,t,i){return e+Math.floor(t/12)+i}}]),e}(),Gn=function(){function e(t,i){s(this,e),this.ctx=i,this.w=i.w,this.el=t}return a(e,[{key:"setupElements",value:function(){var e=this.w,t=e.globals,i=e.config,n=i.chart.type;t.axisCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble","radar","heatmap","treemap"].includes(n),t.xyCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"].includes(n),t.isBarHorizontal=["bar","rangeBar","boxPlot"].includes(n)&&i.plotOptions.bar.horizontal,t.chartClass=".apexcharts".concat(t.chartID),t.dom.baseEl=this.el,t.dom.elWrap=document.createElement("div"),Ai.setAttrs(t.dom.elWrap,{id:t.chartClass.substring(1),class:"apexcharts-canvas ".concat(t.chartClass.substring(1))}),this.el.appendChild(t.dom.elWrap),t.dom.Paper=window.SVG().addTo(t.dom.elWrap),t.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:"translate(".concat(i.chart.offsetX,", ").concat(i.chart.offsetY,")")}),t.dom.Paper.node.style.background="dark"!==i.theme.mode||i.chart.background?"light"!==i.theme.mode||i.chart.background?i.chart.background:"#fff":"#343A3F",this.setSVGDimensions(),t.dom.elLegendForeign=document.createElementNS(t.SVGNS,"foreignObject"),Ai.setAttrs(t.dom.elLegendForeign,{x:0,y:0,width:t.svgWidth,height:t.svgHeight}),t.dom.elLegendWrap=document.createElement("div"),t.dom.elLegendWrap.classList.add("apexcharts-legend"),t.dom.elWrap.appendChild(t.dom.elLegendWrap),t.dom.Paper.node.appendChild(t.dom.elLegendForeign),t.dom.elGraphical=t.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),t.dom.elDefs=t.dom.Paper.defs(),t.dom.Paper.add(t.dom.elGraphical),t.dom.elGraphical.add(t.dom.elDefs)}},{key:"plotChartType",value:function(e,t){var i=this.w,n=this.ctx,r=i.config,s=i.globals,o={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},bar:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},a=r.chart.type||"line",l=null,c=0;s.series.forEach(function(t,n){var r,h,d="column"===(null===(r=e[n])||void 0===r?void 0:r.type)?"bar":(null===(h=e[n])||void 0===h?void 0:h.type)||("column"===a?"bar":a);o[d]?("rangeArea"===d?(o[d].series.push(s.seriesRangeStart[n]),o[d].seriesRangeEnd.push(s.seriesRangeEnd[n])):o[d].series.push(t),o[d].i.push(n),"bar"===d&&(i.globals.columnSeries=o.bar)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(d)?l=d:console.warn("You have specified an unrecognized series type (".concat(d,").")),a!==d&&"scatter"!==d&&c++}),c>0&&(l&&console.warn("Chart or series type ".concat(l," cannot appear with other chart or series types.")),o.bar.series.length>0&&r.plotOptions.bar.horizontal&&(c-=o.bar.series.length,o.bar={series:[],i:[]},i.globals.columnSeries={series:[],i:[]},console.warn("Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`"))),s.comboCharts||(s.comboCharts=c>0);var h=new Vn(n,t),d=new In(n,t);n.pie=new zn(n);var u=new Nn(n);n.rangeBar=new Yn(n,t);var f=new Fn(n),p=[];if(s.comboCharts){var m,g,_=new Ci(n);if(o.area.series.length>0&&(m=p).push.apply(m,y(_.drawSeriesByGroup(o.area,s.areaGroups,"area",h))),o.bar.series.length>0)if(r.chart.stacked){var v=new En(n,t);p.push(v.draw(o.bar.series,o.bar.i))}else n.bar=new Ln(n,t),p.push(n.bar.draw(o.bar.series,o.bar.i));if(o.rangeArea.series.length>0&&p.push(h.draw(o.rangeArea.series,"rangeArea",o.rangeArea.i,o.rangeArea.seriesRangeEnd)),o.line.series.length>0&&(g=p).push.apply(g,y(_.drawSeriesByGroup(o.line,s.lineGroups,"line",h))),o.candlestick.series.length>0&&p.push(d.draw(o.candlestick.series,"candlestick",o.candlestick.i)),o.boxPlot.series.length>0&&p.push(d.draw(o.boxPlot.series,"boxPlot",o.boxPlot.i)),o.rangeBar.series.length>0&&p.push(n.rangeBar.draw(o.rangeBar.series,o.rangeBar.i)),o.scatter.series.length>0){var x=new Vn(n,t,!0);p.push(x.draw(o.scatter.series,"scatter",o.scatter.i))}if(o.bubble.series.length>0){var b=new Vn(n,t,!0);p.push(b.draw(o.bubble.series,"bubble",o.bubble.i))}}else switch(r.chart.type){case"line":p=h.draw(s.series,"line");break;case"area":p=h.draw(s.series,"area");break;case"bar":r.chart.stacked?p=new En(n,t).draw(s.series):(n.bar=new Ln(n,t),p=n.bar.draw(s.series));break;case"candlestick":p=new In(n,t).draw(s.series,"candlestick");break;case"boxPlot":p=new In(n,t).draw(s.series,r.chart.type);break;case"rangeBar":p=n.rangeBar.draw(s.series);break;case"rangeArea":p=h.draw(s.seriesRangeStart,"rangeArea",void 0,s.seriesRangeEnd);break;case"heatmap":p=new Rn(n,t).draw(s.series);break;case"treemap":p=new Wn(n,t).draw(s.series);break;case"pie":case"donut":case"polarArea":p=n.pie.draw(s.series);break;case"radialBar":p=u.draw(s.series);break;case"radar":p=f.draw(s.series);break;default:p=h.draw(s.series)}return p}},{key:"setSVGDimensions",value:function(){var e=this.w,t=e.globals,i=e.config;i.chart.width=i.chart.width||"100%",i.chart.height=i.chart.height||"auto",t.svgWidth=i.chart.width,t.svgHeight=i.chart.height;var n=w.getDimensions(this.el),r=i.chart.width.toString().split(/[0-9]+/g).pop();"%"===r?w.isNumber(n[0])&&(0===n[0].width&&(n=w.getDimensions(this.el.parentNode)),t.svgWidth=n[0]*parseInt(i.chart.width,10)/100):"px"!==r&&""!==r||(t.svgWidth=parseInt(i.chart.width,10));var s=String(i.chart.height).toString().split(/[0-9]+/g).pop();if("auto"!==t.svgHeight&&""!==t.svgHeight)if("%"===s){var o=w.getDimensions(this.el.parentNode);t.svgHeight=o[1]*parseInt(i.chart.height,10)/100}else t.svgHeight=parseInt(i.chart.height,10);else t.svgHeight=t.axisCharts?t.svgWidth/1.61:t.svgWidth/1.2;if(t.svgWidth=Math.max(t.svgWidth,0),t.svgHeight=Math.max(t.svgHeight,0),Ai.setAttrs(t.dom.Paper.node,{width:t.svgWidth,height:t.svgHeight}),"%"!==s){var a=i.chart.sparkline.enabled?0:t.axisCharts?i.chart.parentHeightOffset:0;t.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(t.svgHeight+a,"px")}t.dom.elWrap.style.width="".concat(t.svgWidth,"px"),t.dom.elWrap.style.height="".concat(t.svgHeight,"px")}},{key:"shiftGraphPosition",value:function(){var e=this.w.globals,t=e.translateY,i=e.translateX;Ai.setAttrs(e.dom.elGraphical.node,{transform:"translate(".concat(i,", ").concat(t,")")})}},{key:"resizeNonAxisCharts",value:function(){var e=this.w,t=e.globals,i=0,n=e.config.chart.sparkline.enabled?1:15;n+=e.config.grid.padding.bottom,["top","bottom"].includes(e.config.legend.position)&&e.config.legend.show&&!e.config.legend.floating&&(i=new yn(this.ctx).legendHelpers.getLegendDimensions().clwh+7);var r=e.globals.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"),s=2.05*e.globals.radialSize;if(r&&!e.config.chart.sparkline.enabled&&0!==e.config.plotOptions.radialBar.startAngle){var o=w.getBoundingClientRect(r);s=o.bottom;var a=o.bottom-o.top;s=Math.max(2.05*e.globals.radialSize,a)}var l=Math.ceil(s+t.translateY+i+n);t.dom.elLegendForeign&&t.dom.elLegendForeign.setAttribute("height",l),e.config.chart.height&&String(e.config.chart.height).includes("%")||(t.dom.elWrap.style.height="".concat(l,"px"),Ai.setAttrs(t.dom.Paper.node,{height:l}),t.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(l,"px"))}},{key:"coreCalculations",value:function(){new nn(this.ctx).init()}},{key:"resetGlobals",value:function(){var e=this,t=function(){return e.w.config.series.map(function(){return[]})},i=new Vi,n=this.w.globals,r={dataWasParsed:n.dataWasParsed,originalSeries:n.originalSeries};i.initGlobalVars(n),n.seriesXvalues=t(),n.seriesYvalues=t(),r.dataWasParsed&&(n.dataWasParsed=r.dataWasParsed,n.originalSeries=r.originalSeries)}},{key:"isMultipleY",value:function(){return!!(Array.isArray(this.w.config.yaxis)&&this.w.config.yaxis.length>1)&&(this.w.globals.isMultipleYAxis=!0,!0)}},{key:"xySettings",value:function(){var e=this.w,t=null;if(e.globals.axisCharts){if("back"===e.config.xaxis.crosshairs.position&&new ln(this.ctx).drawXCrosshairs(),"back"===e.config.yaxis[0].crosshairs.position&&new ln(this.ctx).drawYCrosshairs(),"datetime"===e.config.xaxis.type&&void 0===e.config.xaxis.labels.formatter){this.ctx.timeScale=new $n(this.ctx);var i=[];isFinite(e.globals.minX)&&isFinite(e.globals.maxX)&&!e.globals.isBarHorizontal?i=this.ctx.timeScale.calculateTimeScaleTicks(e.globals.minX,e.globals.maxX):e.globals.isBarHorizontal&&(i=this.ctx.timeScale.calculateTimeScaleTicks(e.globals.minY,e.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(i)}t=new Ci(this.ctx).getCalculatedRatios()}return t}},{key:"updateSourceChart",value:function(e){this.ctx.w.globals.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:e.w.globals.minX,max:e.w.globals.maxX}}}},!1,!1)}},{key:"setupBrushHandler",value:function(){var e=this,t=this.ctx,i=this.w;if(i.config.chart.brush.enabled&&"function"!=typeof i.config.chart.events.selection){var n=Array.isArray(i.config.chart.brush.targets)?i.config.chart.brush.targets:[i.config.chart.brush.target];n.forEach(function(i){var n=t.constructor.getChartByID(i);n.w.globals.brushSource=e.ctx,"function"!=typeof n.w.config.chart.events.zoomed&&(n.w.config.chart.events.zoomed=function(){return e.updateSourceChart(n)}),"function"!=typeof n.w.config.chart.events.scrolled&&(n.w.config.chart.events.scrolled=function(){return e.updateSourceChart(n)})}),i.config.chart.events.selection=function(e,i){n.forEach(function(e){t.constructor.getChartByID(e).ctx.updateHelpers._updateOptions({xaxis:{min:i.xaxis.min,max:i.xaxis.max}},!1,!1,!1,!1)})}}}}]),e}(),Xn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"_updateOptions",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise(function(o){var a=[t.ctx];r&&(a=t.ctx.getSyncedCharts()),t.ctx.w.globals.isExecCalled&&(a=[t.ctx],t.ctx.w.globals.isExecCalled=!1),a.forEach(function(r,l){var c=r.w;if(c.globals.shouldAnimate=n,i||(c.globals.resized=!0,c.globals.dataChanged=!0,n&&r.series.getPreviousPaths()),e&&"object"===x(e)&&(r.config=new ji(e),e=Ci.extendArrayProps(r.config,e,c),r.w.globals.chartID!==t.ctx.w.globals.chartID&&delete e.series,c.config=w.extend(c.config,e),s&&(c.globals.lastXAxis=e.xaxis?w.clone(e.xaxis):[],c.globals.lastYAxis=e.yaxis?w.clone(e.yaxis):[],c.globals.initialConfig=w.extend({},c.config),c.globals.initialSeries=w.clone(c.config.series),e.series))){for(var h=0;h<c.globals.collapsedSeriesIndices.length;h++){var d=c.config.series[c.globals.collapsedSeriesIndices[h]];c.globals.collapsedSeries[h].data=c.globals.axisCharts?d.data.slice():d}for(var u=0;u<c.globals.ancillaryCollapsedSeriesIndices.length;u++){var f=c.config.series[c.globals.ancillaryCollapsedSeriesIndices[u]];c.globals.ancillaryCollapsedSeries[u].data=c.globals.axisCharts?f.data.slice():f}r.series.emptyCollapsedSeries(c.config.series)}return r.update(e).then(function(){l===a.length-1&&o(r)})})})}},{key:"_updateSeries",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise(function(r){var s=i.w;return s.globals.shouldAnimate=t,s.globals.dataChanged=!0,t&&i.ctx.series.getPreviousPaths(),i.ctx.data.resetParsingFlags(),i.ctx.data.parseData(e),n&&(s.globals.initialConfig.series=w.clone(s.config.series),s.globals.initialSeries=w.clone(s.config.series)),i.ctx.update().then(function(){r(i.ctx)})})}},{key:"_extendSeries",value:function(e,t){var i=this.w,n=i.config.series[t];return m(m({},i.config.series[t]),{},{name:e.name?e.name:null==n?void 0:n.name,color:e.color?e.color:null==n?void 0:n.color,type:e.type?e.type:null==n?void 0:n.type,group:e.group?e.group:null==n?void 0:n.group,hidden:void 0!==e.hidden?e.hidden:null==n?void 0:n.hidden,data:e.data?e.data:null==n?void 0:n.data,zIndex:void 0!==e.zIndex?e.zIndex:t})}},{key:"toggleDataPointSelection",value:function(e,t){var i=this.w,n=null,r=".apexcharts-series[data\\:realIndex='".concat(e,"']");return i.globals.axisCharts?n=i.globals.dom.Paper.findOne("".concat(r," path[j='").concat(t,"'], ").concat(r," circle[j='").concat(t,"'], ").concat(r," rect[j='").concat(t,"']")):void 0===t&&(n=i.globals.dom.Paper.findOne("".concat(r," path[j='").concat(e,"']")),"pie"!==i.config.chart.type&&"polarArea"!==i.config.chart.type&&"donut"!==i.config.chart.type||this.ctx.pie.pieClicked(e)),n?(new Ai(this.ctx).pathMouseDown(n,null),n.node?n.node:null):(console.warn("toggleDataPointSelection: Element not found"),null)}},{key:"forceXAxisUpdate",value:function(e){var t=this.w;if(["min","max"].forEach(function(i){void 0!==e.xaxis[i]&&(t.config.xaxis[i]=e.xaxis[i],t.globals.lastXAxis[i]=e.xaxis[i])}),e.xaxis.categories&&e.xaxis.categories.length&&(t.config.xaxis.categories=e.xaxis.categories),t.config.xaxis.convertedCatToNumeric){var i=new Hi(e);e=i.convertCatToNumericXaxis(e,this.ctx)}return e}},{key:"forceYAxisUpdate",value:function(e){return e.chart&&e.chart.stacked&&"100%"===e.chart.stackType&&(Array.isArray(e.yaxis)?e.yaxis.forEach(function(t,i){e.yaxis[i].min=0,e.yaxis[i].max=100}):(e.yaxis.min=0,e.yaxis.max=100)),e}},{key:"revertDefaultAxisMinMax",value:function(e){var t=this,i=this.w,n=i.globals.lastXAxis,r=i.globals.lastYAxis;e&&e.xaxis&&(n=e.xaxis),e&&e.yaxis&&(r=e.yaxis),i.config.xaxis.min=n.min,i.config.xaxis.max=n.max,i.config.yaxis.map(function(e,n){i.globals.zoomed||void 0!==r[n]?function(e){void 0!==r[e]&&(i.config.yaxis[e].min=r[e].min,i.config.yaxis[e].max=r[e].max)}(n):void 0!==t.ctx.opts.yaxis[n]&&(e.min=t.ctx.opts.yaxis[n].min,e.max=t.ctx.opts.yaxis[n].max)})}}]),e}();!function(){function e(){for(var e=arguments.length>0&&arguments[0]!==c?arguments[0]:[],r=arguments.length>1?arguments[1]:c,s=arguments.length>2?arguments[2]:c,o=arguments.length>3?arguments[3]:c,a=arguments.length>4?arguments[4]:c,l=arguments.length>5?arguments[5]:c,c=arguments.length>6?arguments[6]:c,h=e.slice(r,s||c),d=o.slice(a,l||c),u=0,f={pos:[0,0],start:[0,0]},p={pos:[0,0],start:[0,0]};h[u]=t.call(f,h[u]),d[u]=t.call(p,d[u]),h[u][0]!=d[u][0]||"M"==h[u][0]||"A"==h[u][0]&&(h[u][4]!=d[u][4]||h[u][5]!=d[u][5])?(Array.prototype.splice.apply(h,[u,1].concat(n.call(f,h[u]))),Array.prototype.splice.apply(d,[u,1].concat(n.call(p,d[u])))):(h[u]=i.call(f,h[u]),d[u]=i.call(p,d[u])),++u!=h.length||u!=d.length;)u==h.length&&h.push(["C",f.pos[0],f.pos[1],f.pos[0],f.pos[1],f.pos[0],f.pos[1]]),u==d.length&&d.push(["C",p.pos[0],p.pos[1],p.pos[0],p.pos[1],p.pos[0],p.pos[1]]);return{start:h,dest:d}}function t(e){switch(e[0]){case"z":case"Z":e[0]="L",e[1]=this.start[0],e[2]=this.start[1];break;case"H":e[0]="L",e[2]=this.pos[1];break;case"V":e[0]="L",e[2]=e[1],e[1]=this.pos[0];break;case"T":e[0]="Q",e[3]=e[1],e[4]=e[2],e[1]=this.reflection[1],e[2]=this.reflection[0];break;case"S":e[0]="C",e[6]=e[4],e[5]=e[3],e[4]=e[2],e[3]=e[1],e[2]=this.reflection[1],e[1]=this.reflection[0]}return e}function i(e){var t=e.length;return this.pos=[e[t-2],e[t-1]],-1!="SCQT".indexOf(e[0])&&(this.reflection=[2*this.pos[0]-e[t-4],2*this.pos[1]-e[t-3]]),e}function n(e){var t=[e];switch(e[0]){case"M":return this.pos=this.start=[e[1],e[2]],t;case"L":e[5]=e[3]=e[1],e[6]=e[4]=e[2],e[1]=this.pos[0],e[2]=this.pos[1];break;case"Q":e[6]=e[4],e[5]=e[3],e[4]=1*e[4]/3+2*e[2]/3,e[3]=1*e[3]/3+2*e[1]/3,e[2]=1*this.pos[1]/3+2*e[2]/3,e[1]=1*this.pos[0]/3+2*e[1]/3;break;case"A":t=function(e,t){var i,n,r,s,o,a,l,c,h,d,u,f,p,m,g,_,y,v,x,b,w,S,T,k,M,A,C=Math.abs(t[1]),D=Math.abs(t[2]),L=t[3]%360,E=t[4],I=t[5],P=t[6],R=t[7],O=new xe(e),z=new xe(P,R),F=[];if(0===C||0===D||O.x===z.x&&O.y===z.y)return[["C",O.x,O.y,z.x,z.y,z.x,z.y]];for((n=(i=new xe((O.x-z.x)/2,(O.y-z.y)/2).transform((new we).rotate(L))).x*i.x/(C*C)+i.y*i.y/(D*D))>1&&(C*=n=Math.sqrt(n),D*=n),r=(new we).rotate(L).scale(1/C,1/D).rotate(-L),O=O.transform(r),a=(s=[(z=z.transform(r)).x-O.x,z.y-O.y])[0]*s[0]+s[1]*s[1],o=Math.sqrt(a),s[0]/=o,s[1]/=o,l=a<4?Math.sqrt(1-a/4):0,E===I&&(l*=-1),c=new xe((z.x+O.x)/2+l*-s[1],(z.y+O.y)/2+l*s[0]),h=new xe(O.x-c.x,O.y-c.y),d=new xe(z.x-c.x,z.y-c.y),u=Math.acos(h.x/Math.sqrt(h.x*h.x+h.y*h.y)),h.y<0&&(u*=-1),f=Math.acos(d.x/Math.sqrt(d.x*d.x+d.y*d.y)),d.y<0&&(f*=-1),I&&u>f&&(f+=2*Math.PI),!I&&u<f&&(f-=2*Math.PI),_=[],y=u,p=(f-u)/(m=Math.ceil(2*Math.abs(u-f)/Math.PI)),g=4*Math.tan(p/4)/3,w=0;w<=m;w++)x=Math.cos(y),v=Math.sin(y),b=new xe(c.x+x,c.y+v),_[w]=[new xe(b.x+g*v,b.y-g*x),b,new xe(b.x-g*v,b.y+g*x)],y+=p;for(_[0][0]=_[0][1].clone(),_[_.length-1][2]=_[_.length-1][1].clone(),r=(new we).rotate(L).scale(C,D).rotate(-L),w=0,S=_.length;w<S;w++)_[w][0]=_[w][0].transform(r),_[w][1]=_[w][1].transform(r),_[w][2]=_[w][2].transform(r);for(w=1,S=_.length;w<S;w++)T=(b=_[w-1][2]).x,k=b.y,M=(b=_[w][0]).x,A=b.y,P=(b=_[w][1]).x,R=b.y,F.push(["C",T,k,M,A,P,R]);return F}(this.pos,e),e=t[0]}return e[0]="C",this.pos=[e[5],e[6]],this.reflection=[2*e[5]-e[3],2*e[6]-e[4]],t}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(!1===t)return!1;for(var i=t,n=e.length;i<n;++i)if("M"==e[i][0])return i;return!1}te(Rt,{morph:function(t,i,n,s,o){for(var a=this.parse(t),l=this.parse(i),c=0,h=0,d=!1,u=!1;!1!==c||!1!==h;){var f;d=r(a,!1!==c&&c+1),u=r(l,!1!==h&&h+1),!1===c&&(c=0==(f=new Rt(p.start).bbox()).height||0==f.width?a.push(a[0])-1:a.push(["M",f.x+f.width/2,f.y+f.height/2])-1),!1===h&&(h=0==(f=new Rt(p.dest).bbox()).height||0==f.width?l.push(l[0])-1:l.push(["M",f.x+f.width/2,f.y+f.height/2])-1);var p=e(a,c,d,l,h,u);a=a.slice(0,c).concat(p.start,!1===d?[]:a.slice(d)),l=l.slice(0,h).concat(p.dest,!1===u?[]:l.slice(u)),c=!1!==d&&c+p.start.length,h=!1!==u&&h+p.dest.length}this._array=a,this.destination=new Rt,this.destination._array=l;var m=this.fromArray(a.map(function(e,t){var i=l[t].map(function(i,r){return 0===r?i:s.step(e[r],l[t][r],n,o[t],o)});return i}));return m}})}();const qn=e=>(e.changedTouches&&(e=e.changedTouches[0]),{x:e.clientX,y:e.clientY});class Zn{constructor(e){e.remember("_draggable",this),this.el=e,this.drag=this.drag.bind(this),this.startDrag=this.startDrag.bind(this),this.endDrag=this.endDrag.bind(this)}init(e){e?(this.el.on("mousedown.drag",this.startDrag),this.el.on("touchstart.drag",this.startDrag,{passive:!1})):(this.el.off("mousedown.drag"),this.el.off("touchstart.drag"))}startDrag(e){const t=!e.type.indexOf("mouse");if(t&&1!==e.which&&0!==e.buttons)return;if(this.el.dispatch("beforedrag",{event:e,handler:this}).defaultPrevented)return;e.preventDefault(),e.stopPropagation(),this.init(!1),this.box=this.el.bbox(),this.lastClick=this.el.point(qn(e));const i=(t?"mouseup":"touchend")+".drag";Re(window,(t?"mousemove":"touchmove")+".drag",this.drag,this,{passive:!1}),Re(window,i,this.endDrag,this,{passive:!1}),this.el.fire("dragstart",{event:e,handler:this,box:this.box})}drag(e){const{box:t,lastClick:i}=this,n=this.el.point(qn(e)),r=n.x-i.x,s=n.y-i.y;if(!r&&!s)return t;const o=t.x+r,a=t.y+s;this.box=new ke(o,a,t.w,t.h),this.lastClick=n,this.el.dispatch("dragmove",{event:e,handler:this,box:this.box}).defaultPrevented||this.move(o,a)}move(e,t){"svg"===this.el.type?fi.prototype.move.call(this.el,e,t):this.el.move(e,t)}endDrag(e){this.drag(e),this.el.fire("dragend",{event:e,handler:this,box:this.box}),Oe(window,"mousemove.drag"),Oe(window,"touchmove.drag"),Oe(window,"mouseup.drag"),Oe(window,"touchend.drag"),this.init(!0)}}function Jn(e,t,i,n=null){return function(r){r.preventDefault(),r.stopPropagation();var s=r.pageX||r.touches[0].pageX,o=r.pageY||r.touches[0].pageY;t.fire(e,{x:s,y:o,event:r,index:n,points:i})}}function Kn([e,t],{a:i,b:n,c:r,d:s,e:o,f:a}){return[e*i+t*r+o,e*n+t*s+a]}te(We,{draggable(e=!0){return(this.remember("_draggable")||new Zn(this)).init(e),this}});let Qn=class{constructor(e){this.el=e,e.remember("_selectHandler",this),this.selection=new fi,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const t=H();this.observer=new t.MutationObserver(this.mutationHandler)}init(e){this.createHandle=e.createHandle||this.createHandleFn,this.createRot=e.createRot||this.createRotFn,this.updateHandle=e.updateHandle||this.updateHandleFn,this.updateRot=e.updateRot||this.updateRotFn,this.el.root().put(this.selection),this.updatePoints(),this.createSelection(),this.createResizeHandles(),this.updateResizeHandles(),this.createRotationHandle(),this.updateRotationHandle(),this.observer.observe(this.el.node,{attributes:!0})}active(e,t){if(!e)return this.selection.clear().remove(),void this.observer.disconnect();this.init(t)}createSelection(){this.selection.polygon(this.handlePoints).addClass("svg_select_shape")}updateSelection(){this.selection.get(0).plot(this.handlePoints)}createResizeHandles(){this.handlePoints.forEach((e,t,i)=>{const n=this.order[t];this.createHandle.call(this,this.selection,e,t,i,n),this.selection.get(t+1).addClass("svg_select_handle svg_select_handle_"+n).on("mousedown.selection touchstart.selection",Jn(n,this.el,this.handlePoints,t))})}createHandleFn(e){e.polyline()}updateHandleFn(e,t,i,n){const r=n.at(i-1),s=n[(i+1)%n.length],o=t,a=[o[0]-r[0],o[1]-r[1]],l=[o[0]-s[0],o[1]-s[1]],c=Math.sqrt(a[0]*a[0]+a[1]*a[1]),h=Math.sqrt(l[0]*l[0]+l[1]*l[1]),d=[a[0]/c,a[1]/c],u=[l[0]/h,l[1]/h],f=[o[0]-10*d[0],o[1]-10*d[1]],p=[o[0]-10*u[0],o[1]-10*u[1]];e.plot([f,o,p])}updateResizeHandles(){this.handlePoints.forEach((e,t,i)=>{const n=this.order[t];this.updateHandle.call(this,this.selection.get(t+1),e,t,i,n)})}createRotFn(e){e.line(),e.circle(5)}getPoint(e){return this.handlePoints[this.order.indexOf(e)]}getPointHandle(e){return this.selection.get(this.order.indexOf(e)+1)}updateRotFn(e,t){const i=this.getPoint("t");e.get(0).plot(i[0],i[1],t[0],t[1]),e.get(1).center(t[0],t[1])}createRotationHandle(){const e=this.selection.group().addClass("svg_select_handle_rot").on("mousedown.selection touchstart.selection",Jn("rot",this.el,this.handlePoints));this.createRot.call(this,e)}updateRotationHandle(){const e=this.selection.findOne("g.svg_select_handle_rot");this.updateRot(e,this.rotationPoint,this.handlePoints)}updatePoints(){const e=this.el.bbox(),t=this.el.parent().screenCTM().inverseO().multiplyO(this.el.screenCTM());this.handlePoints=this.getHandlePoints(e).map(e=>Kn(e,t)),this.rotationPoint=Kn(this.getRotationPoint(e),t)}getHandlePoints({x:e,x2:t,y:i,y2:n,cx:r,cy:s}=this.el.bbox()){return[[e,i],[r,i],[t,i],[t,s],[t,n],[r,n],[e,n],[e,s]]}getRotationPoint({y:e,cx:t}=this.el.bbox()){return[t,e-20]}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updateResizeHandles(),this.updateRotationHandle()}};const er=e=>function(t=!0,i={}){"object"==typeof t&&(i=t,t=!0);let n=this.remember("_"+e.name);return n||(t.prototype instanceof Qn?(n=new t(this),t=!0):n=new e(this),this.remember("_"+e.name,n)),n.active(t,i),this};function tr(e,t,i,n=null){return function(r){r.preventDefault(),r.stopPropagation();var s=r.pageX||r.touches[0].pageX,o=r.pageY||r.touches[0].pageY;t.fire(e,{x:s,y:o,event:r,index:n,points:i})}}function ir([e,t],{a:i,b:n,c:r,d:s,e:o,f:a}){return[e*i+t*r+o,e*n+t*s+a]}te(We,{select:er(Qn)}),te([Wt,Ut,gt],{pointSelect:er(class{constructor(e){this.el=e,e.remember("_pointSelectHandler",this),this.selection=new fi,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const t=H();this.observer=new t.MutationObserver(this.mutationHandler)}init(e){this.createHandle=e.createHandle||this.createHandleFn,this.updateHandle=e.updateHandle||this.updateHandleFn,this.el.root().put(this.selection),this.updatePoints(),this.createSelection(),this.createPointHandles(),this.updatePointHandles(),this.observer.observe(this.el.node,{attributes:!0})}active(e,t){if(!e)return this.selection.clear().remove(),void this.observer.disconnect();this.init(t)}createSelection(){this.selection.polygon(this.points).addClass("svg_select_shape_pointSelect")}updateSelection(){this.selection.get(0).plot(this.points)}createPointHandles(){this.points.forEach((e,t,i)=>{this.createHandle.call(this,this.selection,e,t,i),this.selection.get(t+1).addClass("svg_select_handle_point").on("mousedown.selection touchstart.selection",Jn("point",this.el,this.points,t))})}createHandleFn(e){e.circle(5)}updateHandleFn(e,t){e.center(t[0],t[1])}updatePointHandles(){this.points.forEach((e,t,i)=>{this.updateHandle.call(this,this.selection.get(t+1),e,t,i)})}updatePoints(){const e=this.el.parent().screenCTM().inverseO().multiplyO(this.el.screenCTM());this.points=this.el.array().map(t=>Kn(t,e))}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updatePointHandles()}})});class nr{constructor(e){this.el=e,e.remember("_selectHandler",this),this.selection=new fi,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const t=H();this.observer=new t.MutationObserver(this.mutationHandler)}init(e){this.createHandle=e.createHandle||this.createHandleFn,this.createRot=e.createRot||this.createRotFn,this.updateHandle=e.updateHandle||this.updateHandleFn,this.updateRot=e.updateRot||this.updateRotFn,this.el.root().put(this.selection),this.updatePoints(),this.createSelection(),this.createResizeHandles(),this.updateResizeHandles(),this.createRotationHandle(),this.updateRotationHandle(),this.observer.observe(this.el.node,{attributes:!0})}active(e,t){if(!e)return this.selection.clear().remove(),void this.observer.disconnect();this.init(t)}createSelection(){this.selection.polygon(this.handlePoints).addClass("svg_select_shape")}updateSelection(){this.selection.get(0).plot(this.handlePoints)}createResizeHandles(){this.handlePoints.forEach((e,t,i)=>{const n=this.order[t];this.createHandle.call(this,this.selection,e,t,i,n),this.selection.get(t+1).addClass("svg_select_handle svg_select_handle_"+n).on("mousedown.selection touchstart.selection",tr(n,this.el,this.handlePoints,t))})}createHandleFn(e){e.polyline()}updateHandleFn(e,t,i,n){const r=n.at(i-1),s=n[(i+1)%n.length],o=t,a=[o[0]-r[0],o[1]-r[1]],l=[o[0]-s[0],o[1]-s[1]],c=Math.sqrt(a[0]*a[0]+a[1]*a[1]),h=Math.sqrt(l[0]*l[0]+l[1]*l[1]),d=[a[0]/c,a[1]/c],u=[l[0]/h,l[1]/h],f=[o[0]-10*d[0],o[1]-10*d[1]],p=[o[0]-10*u[0],o[1]-10*u[1]];e.plot([f,o,p])}updateResizeHandles(){this.handlePoints.forEach((e,t,i)=>{const n=this.order[t];this.updateHandle.call(this,this.selection.get(t+1),e,t,i,n)})}createRotFn(e){e.line(),e.circle(5)}getPoint(e){return this.handlePoints[this.order.indexOf(e)]}getPointHandle(e){return this.selection.get(this.order.indexOf(e)+1)}updateRotFn(e,t){const i=this.getPoint("t");e.get(0).plot(i[0],i[1],t[0],t[1]),e.get(1).center(t[0],t[1])}createRotationHandle(){const e=this.selection.group().addClass("svg_select_handle_rot").on("mousedown.selection touchstart.selection",tr("rot",this.el,this.handlePoints));this.createRot.call(this,e)}updateRotationHandle(){const e=this.selection.findOne("g.svg_select_handle_rot");this.updateRot(e,this.rotationPoint,this.handlePoints)}updatePoints(){const e=this.el.bbox(),t=this.el.parent().screenCTM().inverseO().multiplyO(this.el.screenCTM());this.handlePoints=this.getHandlePoints(e).map(e=>ir(e,t)),this.rotationPoint=ir(this.getRotationPoint(e),t)}getHandlePoints({x:e,x2:t,y:i,y2:n,cx:r,cy:s}=this.el.bbox()){return[[e,i],[r,i],[t,i],[t,s],[t,n],[r,n],[e,n],[e,s]]}getRotationPoint({y:e,cx:t}=this.el.bbox()){return[t,e-20]}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updateResizeHandles(),this.updateRotationHandle()}}const rr=e=>function(t=!0,i={}){"object"==typeof t&&(i=t,t=!0);let n=this.remember("_"+e.name);return n||(t.prototype instanceof nr?(n=new t(this),t=!0):n=new e(this),this.remember("_"+e.name,n)),n.active(t,i),this};te(We,{select:rr(nr)}),te([Wt,Ut,gt],{pointSelect:rr(class{constructor(e){this.el=e,e.remember("_pointSelectHandler",this),this.selection=new fi,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const t=H();this.observer=new t.MutationObserver(this.mutationHandler)}init(e){this.createHandle=e.createHandle||this.createHandleFn,this.updateHandle=e.updateHandle||this.updateHandleFn,this.el.root().put(this.selection),this.updatePoints(),this.createSelection(),this.createPointHandles(),this.updatePointHandles(),this.observer.observe(this.el.node,{attributes:!0})}active(e,t){if(!e)return this.selection.clear().remove(),void this.observer.disconnect();this.init(t)}createSelection(){this.selection.polygon(this.points).addClass("svg_select_shape_pointSelect")}updateSelection(){this.selection.get(0).plot(this.points)}createPointHandles(){this.points.forEach((e,t,i)=>{this.createHandle.call(this,this.selection,e,t,i),this.selection.get(t+1).addClass("svg_select_handle_point").on("mousedown.selection touchstart.selection",tr("point",this.el,this.points,t))})}createHandleFn(e){e.circle(5)}updateHandleFn(e,t){e.center(t[0],t[1])}updatePointHandles(){this.points.forEach((e,t,i)=>{this.updateHandle.call(this,this.selection.get(t+1),e,t,i)})}updatePoints(){const e=this.el.parent().screenCTM().inverseO().multiplyO(this.el.screenCTM());this.points=this.el.array().map(t=>ir(t,e))}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updatePointHandles()}})});const sr=e=>(e.changedTouches&&(e=e.changedTouches[0]),{x:e.clientX,y:e.clientY}),or=e=>{let t=1/0,i=1/0,n=-1/0,r=-1/0;for(let s=0;s<e.length;s++){const o=e[s];t=Math.min(t,o[0]),i=Math.min(i,o[1]),n=Math.max(n,o[0]),r=Math.max(r,o[1])}return new ke(t,i,n-t,r-i)};class ar{constructor(e){this.el=e,e.remember("_ResizeHandler",this),this.lastCoordinates=null,this.eventType="",this.lastEvent=null,this.handleResize=this.handleResize.bind(this),this.resize=this.resize.bind(this),this.endResize=this.endResize.bind(this),this.rotate=this.rotate.bind(this),this.movePoint=this.movePoint.bind(this)}active(e,t){this.preserveAspectRatio=t.preserveAspectRatio??!1,this.aroundCenter=t.aroundCenter??!1,this.grid=t.grid??0,this.degree=t.degree??0,this.el.off(".resize"),e&&(this.el.on(["lt.resize","rt.resize","rb.resize","lb.resize","t.resize","r.resize","b.resize","l.resize","rot.resize","point.resize"],this.handleResize),this.lastEvent&&("rot"===this.eventType?this.rotate(this.lastEvent):"point"===this.eventType?this.movePoint(this.lastEvent):this.resize(this.lastEvent)))}handleResize(e){this.eventType=e.type;const{event:t,index:i,points:n}=e.detail,r=!t.type.indexOf("mouse");if(r&&1!==(t.which||t.buttons))return;if(this.el.dispatch("beforeresize",{event:e,handler:this}).defaultPrevented)return;this.box=this.el.bbox(),this.startPoint=this.el.point(sr(t)),this.index=i,this.points=n.slice();const s=(r?"mousemove":"touchmove")+".resize",o=(r?"mouseup":"touchcancel.resize touchend")+".resize";"point"===e.type?Re(window,s,this.movePoint):"rot"===e.type?Re(window,s,this.rotate):Re(window,s,this.resize),Re(window,o,this.endResize)}resize(e){this.lastEvent=e;const t=this.snapToGrid(this.el.point(sr(e)));let i=t.x-this.startPoint.x,n=t.y-this.startPoint.y;this.preserveAspectRatio&&this.aroundCenter&&(i*=2,n*=2);const r=this.box.x+i,s=this.box.y+n,o=this.box.x2+i,a=this.box.y2+n;let l=new ke(this.box);if(this.eventType.includes("l")&&(l.x=Math.min(r,this.box.x2),l.x2=Math.max(r,this.box.x2)),this.eventType.includes("r")&&(l.x=Math.min(o,this.box.x),l.x2=Math.max(o,this.box.x)),this.eventType.includes("t")&&(l.y=Math.min(s,this.box.y2),l.y2=Math.max(s,this.box.y2)),this.eventType.includes("b")&&(l.y=Math.min(a,this.box.y),l.y2=Math.max(a,this.box.y)),l.width=l.x2-l.x,l.height=l.y2-l.y,this.preserveAspectRatio){const e=l.width/this.box.width,t=l.height/this.box.height,i=["lt","t","rt","r","rb","b","lb","l"],n=(i.indexOf(this.eventType)+4)%i.length,r=this.aroundCenter?[this.box.cx,this.box.cy]:this.points[n];let s=this.eventType.includes("t")||this.eventType.includes("b")?t:e;s=2===this.eventType.length?Math.max(e,t):s,l=function(e,t,i){const n=[[e.x,e.y],[e.x+e.width,e.y],[e.x+e.width,e.y+e.height],[e.x,e.y+e.height]].map(([e,n])=>{const r=e-t[0],s=(n-t[1])*i;return[r*i+t[0],s+t[1]]});return or(n)}(this.box,r,s)}this.el.dispatch("resize",{box:new ke(l),angle:0,eventType:this.eventType,event:e,handler:this}).defaultPrevented||this.el.size(l.width,l.height).move(l.x,l.y)}movePoint(e){this.lastEvent=e;const{x:t,y:i}=this.snapToGrid(this.el.point(sr(e))),n=this.el.array().slice();n[this.index]=[t,i],this.el.dispatch("resize",{box:or(n),angle:0,eventType:this.eventType,event:e,handler:this}).defaultPrevented||this.el.plot(n)}rotate(e){this.lastEvent=e;const t=this.startPoint,i=this.el.point(sr(e)),{cx:n,cy:r}=this.box,s=t.x-n,o=t.y-r,a=i.x-n,l=i.y-r,c=Math.sqrt(s*s+o*o)*Math.sqrt(a*a+l*l);if(0===c)return;let h=Math.acos((s*a+o*l)/c)/Math.PI*180;if(!h)return;i.x<t.x&&(h=-h);const d=new we(this.el),{x:u,y:f}=new xe(n,r).transformO(d),{rotate:p}=d.decompose(),m=this.snapToAngle(p+h)-p;this.el.dispatch("resize",{box:this.box,angle:m,eventType:this.eventType,event:e,handler:this}).defaultPrevented||this.el.transform(d.rotateO(m,u,f))}endResize(e){"rot"!==this.eventType&&"point"!==this.eventType&&this.resize(e),this.lastEvent=null,this.eventType="",Oe(window,"mousemove.resize touchmove.resize"),Oe(window,"mouseup.resize touchend.resize")}snapToGrid(e){return this.grid&&(e.x=Math.round(e.x/this.grid)*this.grid,e.y=Math.round(e.y/this.grid)*this.grid),e}snapToAngle(e){return this.degree&&(e=Math.round(e/this.degree)*this.degree),e}}te(We,{resize:function(e=!0,t={}){"object"==typeof e&&(t=e,e=!0);let i=this.remember("_ResizeHandler");return i||(e.prototype instanceof ar?(i=new e(this),e=!0):i=new ar(this),this.remember("_resizeHandler",i)),i.active(e,t),this}}),void 0===window.SVG&&(window.SVG=xi),void 0===window.Apex&&(window.Apex={});var lr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"initModules",value:function(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","isSeriesHidden","highlightSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","exportToCSV","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend"],this.ctx.animations=new S(this.ctx),this.ctx.axes=new an(this.ctx),this.ctx.core=new Gn(this.ctx.el,this.ctx),this.ctx.config=new ji({}),this.ctx.data=new Ji(this.ctx),this.ctx.grid=new en(this.ctx),this.ctx.graphics=new Ai(this.ctx),this.ctx.coreUtils=new Ci(this.ctx),this.ctx.crosshairs=new ln(this.ctx),this.ctx.events=new sn(this.ctx),this.ctx.exports=new Ki(this.ctx),this.ctx.fill=new Ui(this.ctx),this.ctx.localization=new on(this.ctx),this.ctx.options=new Fi,this.ctx.responsive=new cn(this.ctx),this.ctx.series=new Zi(this.ctx),this.ctx.theme=new hn(this.ctx),this.ctx.formatters=new Ii(this.ctx),this.ctx.titleSubtitle=new dn(this.ctx),this.ctx.legend=new yn(this.ctx),this.ctx.toolbar=new vn(this.ctx),this.ctx.tooltip=new An(this.ctx),this.ctx.dimensions=new gn(this.ctx),this.ctx.updateHelpers=new Xn(this.ctx),this.ctx.zoomPanSelection=new xn(this.ctx),this.ctx.w.globals.tooltip=new An(this.ctx)}}]),e}(),cr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return a(e,[{key:"clear",value:function(e){var t=e.isUpdating;this.ctx.zoomPanSelection&&this.ctx.zoomPanSelection.destroy(),this.ctx.toolbar&&this.ctx.toolbar.destroy(),this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx.zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx.toolbar=null,this.ctx.localization=null,this.ctx.w.globals.tooltip=null,this.clearDomElements({isUpdating:t})}},{key:"killSVG",value:function(e){e.each(function(){this.removeClass("*"),this.off()},!0),e.clear()}},{key:"clearDomElements",value:function(e){var t=this,i=e.isUpdating,n=this.w.globals.dom.Paper.node;n.parentNode&&n.parentNode.parentNode&&!i&&(n.parentNode.parentNode.style.minHeight="unset");var r=this.w.globals.dom.baseEl;r&&this.ctx.eventList.forEach(function(e){r.removeEventListener(e,t.ctx.events.documentEvent)});var s=this.w.globals.dom;if(null!==this.ctx.el)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(s.Paper),s.Paper.remove(),s.elWrap=null,s.elGraphical=null,s.elLegendWrap=null,s.elLegendForeign=null,s.baseEl=null,s.elGridRect=null,s.elGridRectMask=null,s.elGridRectBarMask=null,s.elGridRectMarkerMask=null,s.elForecastMask=null,s.elNonForecastMask=null,s.elDefs=null}}]),e}(),hr=new WeakMap,dr=function(){function e(t,i){s(this,e),this.opts=i,this.ctx=this,this.w=new Wi(i).init(),this.el=t,this.w.globals.cuid=w.randomId(),this.w.globals.chartID=this.w.config.chart.id?w.escapeString(this.w.config.chart.id):this.w.globals.cuid,new lr(this).initModules(),this.lastUpdateOptions=null,this.create=w.bind(this.create,this),this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this)}return a(e,[{key:"render",value:function(){var e=this;return new Promise(function(t,i){if(w.elementExists(e.el)){void 0===Apex._chartInstances&&(Apex._chartInstances=[]),e.w.config.chart.id&&Apex._chartInstances.push({id:e.w.globals.chartID,group:e.w.config.chart.group,chart:e}),e.setLocale(e.w.config.chart.defaultLocale);var n=e.w.config.chart.events.beforeMount;"function"==typeof n&&n(e,e.w),e.events.fireEvent("beforeMount",[e,e.w]),window.addEventListener("resize",e.windowResizeHandler),function(e,t){var i=!1;if(e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var n=e.getBoundingClientRect();"none"!==e.style.display&&0!==n.width||(i=!0)}var r=new ResizeObserver(function(n){i&&t.call(e,n),i=!0});e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(e.children).forEach(function(e){return r.observe(e)}):r.observe(e),hr.set(t,r)}(e.el.parentNode,e.parentResizeHandler);var r=e.el.getRootNode&&e.el.getRootNode(),s=w.is("ShadowRoot",r),o=e.el.ownerDocument,a=s?r.getElementById("apexcharts-css"):o.getElementById("apexcharts-css");if(!a){var l;(a=document.createElement("style")).id="apexcharts-css",a.textContent='@keyframes opaque {\n 0% {\n opacity: 0\n }\n\n to {\n opacity: 1\n }\n}\n\n@keyframes resizeanim {\n\n 0%,\n to {\n opacity: 0\n }\n}\n\n.apexcharts-canvas {\n position: relative;\n direction: ltr !important;\n user-select: none\n}\n\n.apexcharts-canvas ::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 6px\n}\n\n.apexcharts-canvas ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(0, 0, 0, .5);\n box-shadow: 0 0 1px rgba(255, 255, 255, .5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5)\n}\n\n.apexcharts-inner {\n position: relative\n}\n\n.apexcharts-text tspan {\n font-family: inherit\n}\n\nrect.legend-mouseover-inactive,\n.legend-mouseover-inactive rect,\n.legend-mouseover-inactive path,\n.legend-mouseover-inactive circle,\n.legend-mouseover-inactive line,\n.legend-mouseover-inactive text.apexcharts-yaxis-title-text,\n.legend-mouseover-inactive text.apexcharts-yaxis-label {\n transition: .15s ease all;\n opacity: .2\n}\n\n.apexcharts-legend-text {\n padding-left: 15px;\n margin-left: -15px;\n}\n\n.apexcharts-series-collapsed {\n opacity: 0\n}\n\n.apexcharts-tooltip {\n border-radius: 5px;\n box-shadow: 2px 2px 6px -4px #999;\n cursor: default;\n font-size: 14px;\n left: 62px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 20px;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n white-space: nowrap;\n z-index: 12;\n transition: .15s ease all\n}\n\n.apexcharts-tooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-tooltip.apexcharts-theme-light {\n border: 1px solid #e3e3e3;\n background: rgba(255, 255, 255, .96)\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark {\n color: #fff;\n background: rgba(30, 30, 30, .8)\n}\n\n.apexcharts-tooltip * {\n font-family: inherit\n}\n\n.apexcharts-tooltip-title {\n padding: 6px;\n font-size: 15px;\n margin-bottom: 4px\n}\n\n.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {\n background: #eceff1;\n border-bottom: 1px solid #ddd\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {\n background: rgba(0, 0, 0, .7);\n border-bottom: 1px solid #333\n}\n\n.apexcharts-tooltip-text-goals-value,\n.apexcharts-tooltip-text-y-value,\n.apexcharts-tooltip-text-z-value {\n display: inline-block;\n margin-left: 5px;\n font-weight: 600\n}\n\n.apexcharts-tooltip-text-goals-label:empty,\n.apexcharts-tooltip-text-goals-value:empty,\n.apexcharts-tooltip-text-y-label:empty,\n.apexcharts-tooltip-text-y-value:empty,\n.apexcharts-tooltip-text-z-value:empty,\n.apexcharts-tooltip-title:empty {\n display: none\n}\n\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n padding: 6px 0 5px\n}\n\n.apexcharts-tooltip-goals-group,\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n display: flex\n}\n\n.apexcharts-tooltip-text-goals-label:not(:empty),\n.apexcharts-tooltip-text-goals-value:not(:empty) {\n margin-top: -6px\n}\n\n.apexcharts-tooltip-marker {\n display: inline-block;\n position: relative;\n width: 16px;\n height: 16px;\n font-size: 16px;\n line-height: 16px;\n margin-right: 4px;\n text-align: center;\n vertical-align: middle;\n color: inherit;\n}\n\n.apexcharts-tooltip-marker::before {\n content: "";\n display: inline-block;\n width: 100%;\n text-align: center;\n color: currentcolor;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n font-size: 26px;\n font-family: Arial, Helvetica, sans-serif;\n line-height: 14px;\n font-weight: 900;\n}\n\n.apexcharts-tooltip-marker[shape="circle"]::before {\n content: "\\25CF";\n}\n\n.apexcharts-tooltip-marker[shape="square"]::before,\n.apexcharts-tooltip-marker[shape="rect"]::before {\n content: "\\25A0";\n transform: translate(-1px, -2px);\n}\n\n.apexcharts-tooltip-marker[shape="line"]::before {\n content: "\\2500";\n}\n\n.apexcharts-tooltip-marker[shape="diamond"]::before {\n content: "\\25C6";\n font-size: 28px;\n}\n\n.apexcharts-tooltip-marker[shape="triangle"]::before {\n content: "\\25B2";\n font-size: 22px;\n}\n\n.apexcharts-tooltip-marker[shape="cross"]::before {\n content: "\\2715";\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="plus"]::before {\n content: "\\2715";\n transform: rotate(45deg) translate(-1px, -1px);\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="star"]::before {\n content: "\\2605";\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="sparkle"]::before {\n content: "\\2726";\n font-size: 20px;\n}\n\n.apexcharts-tooltip-series-group {\n padding: 0 10px;\n display: none;\n text-align: left;\n justify-content: left;\n align-items: center\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {\n opacity: 1\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active,\n.apexcharts-tooltip-series-group:last-child {\n padding-bottom: 4px\n}\n\n.apexcharts-tooltip-y-group {\n padding: 6px 0 5px\n}\n\n.apexcharts-custom-tooltip,\n.apexcharts-tooltip-box {\n padding: 4px 8px\n}\n\n.apexcharts-tooltip-boxPlot {\n display: flex;\n flex-direction: column-reverse\n}\n\n.apexcharts-tooltip-box>div {\n margin: 4px 0\n}\n\n.apexcharts-tooltip-box span.value {\n font-weight: 700\n}\n\n.apexcharts-tooltip-rangebar {\n padding: 5px 8px\n}\n\n.apexcharts-tooltip-rangebar .category {\n font-weight: 600;\n color: #777\n}\n\n.apexcharts-tooltip-rangebar .series-name {\n font-weight: 700;\n display: block;\n margin-bottom: 5px\n}\n\n.apexcharts-xaxistooltip,\n.apexcharts-yaxistooltip {\n opacity: 0;\n pointer-events: none;\n color: #373d3f;\n font-size: 13px;\n text-align: center;\n border-radius: 2px;\n position: absolute;\n z-index: 10;\n background: #eceff1;\n border: 1px solid #90a4ae\n}\n\n.apexcharts-xaxistooltip {\n padding: 9px 10px;\n transition: .15s ease all\n}\n\n.apexcharts-xaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, .7);\n border: 1px solid rgba(0, 0, 0, .5);\n color: #fff\n}\n\n.apexcharts-xaxistooltip:after,\n.apexcharts-xaxistooltip:before {\n left: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none\n}\n\n.apexcharts-xaxistooltip:after {\n border-color: transparent;\n border-width: 6px;\n margin-left: -6px\n}\n\n.apexcharts-xaxistooltip:before {\n border-color: transparent;\n border-width: 7px;\n margin-left: -7px\n}\n\n.apexcharts-xaxistooltip-bottom:after,\n.apexcharts-xaxistooltip-bottom:before {\n bottom: 100%\n}\n\n.apexcharts-xaxistooltip-top:after,\n.apexcharts-xaxistooltip-top:before {\n top: 100%\n}\n\n.apexcharts-xaxistooltip-bottom:after {\n border-bottom-color: #eceff1\n}\n\n.apexcharts-xaxistooltip-bottom:before {\n border-bottom-color: #90a4ae\n}\n\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after,\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {\n border-bottom-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-xaxistooltip-top:after {\n border-top-color: #eceff1\n}\n\n.apexcharts-xaxistooltip-top:before {\n border-top-color: #90a4ae\n}\n\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after,\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {\n border-top-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-xaxistooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-yaxistooltip {\n padding: 4px 10px\n}\n\n.apexcharts-yaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, .7);\n border: 1px solid rgba(0, 0, 0, .5);\n color: #fff\n}\n\n.apexcharts-yaxistooltip:after,\n.apexcharts-yaxistooltip:before {\n top: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none\n}\n\n.apexcharts-yaxistooltip:after {\n border-color: transparent;\n border-width: 6px;\n margin-top: -6px\n}\n\n.apexcharts-yaxistooltip:before {\n border-color: transparent;\n border-width: 7px;\n margin-top: -7px\n}\n\n.apexcharts-yaxistooltip-left:after,\n.apexcharts-yaxistooltip-left:before {\n left: 100%\n}\n\n.apexcharts-yaxistooltip-right:after,\n.apexcharts-yaxistooltip-right:before {\n right: 100%\n}\n\n.apexcharts-yaxistooltip-left:after {\n border-left-color: #eceff1\n}\n\n.apexcharts-yaxistooltip-left:before {\n border-left-color: #90a4ae\n}\n\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after,\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {\n border-left-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-yaxistooltip-right:after {\n border-right-color: #eceff1\n}\n\n.apexcharts-yaxistooltip-right:before {\n border-right-color: #90a4ae\n}\n\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after,\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {\n border-right-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-yaxistooltip.apexcharts-active {\n opacity: 1\n}\n\n.apexcharts-yaxistooltip-hidden {\n display: none\n}\n\n.apexcharts-xcrosshairs,\n.apexcharts-ycrosshairs {\n pointer-events: none;\n opacity: 0;\n transition: .15s ease all\n}\n\n.apexcharts-xcrosshairs.apexcharts-active,\n.apexcharts-ycrosshairs.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-ycrosshairs-hidden {\n opacity: 0\n}\n\n.apexcharts-selection-rect {\n cursor: move\n}\n\n.svg_select_shape {\n stroke-width: 1;\n stroke-dasharray: 10 10;\n stroke: black;\n stroke-opacity: 0.1;\n pointer-events: none;\n fill: none;\n}\n\n.svg_select_handle {\n stroke-width: 3;\n stroke: black;\n fill: none;\n}\n\n.svg_select_handle_r {\n cursor: e-resize;\n}\n\n.svg_select_handle_l {\n cursor: w-resize;\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-zoom {\n cursor: crosshair\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-pan {\n cursor: move\n}\n\n.apexcharts-menu-icon,\n.apexcharts-pan-icon,\n.apexcharts-reset-icon,\n.apexcharts-selection-icon,\n.apexcharts-toolbar-custom-icon,\n.apexcharts-zoom-icon,\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n cursor: pointer;\n width: 20px;\n height: 20px;\n line-height: 24px;\n color: #6e8192;\n text-align: center\n}\n\n.apexcharts-menu-icon svg,\n.apexcharts-reset-icon svg,\n.apexcharts-zoom-icon svg,\n.apexcharts-zoomin-icon svg,\n.apexcharts-zoomout-icon svg {\n fill: #6e8192\n}\n\n.apexcharts-selection-icon svg {\n fill: #444;\n transform: scale(.76)\n}\n\n.apexcharts-theme-dark .apexcharts-menu-icon svg,\n.apexcharts-theme-dark .apexcharts-pan-icon svg,\n.apexcharts-theme-dark .apexcharts-reset-icon svg,\n.apexcharts-theme-dark .apexcharts-selection-icon svg,\n.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomin-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomout-icon svg {\n fill: #f3f4f5\n}\n\n.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg {\n fill: #008ffb\n}\n\n.apexcharts-theme-light .apexcharts-menu-icon:hover svg,\n.apexcharts-theme-light .apexcharts-reset-icon:hover svg,\n.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,\n.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg {\n fill: #333\n}\n\n.apexcharts-menu-icon,\n.apexcharts-selection-icon {\n position: relative\n}\n\n.apexcharts-reset-icon {\n margin-left: 5px\n}\n\n.apexcharts-menu-icon,\n.apexcharts-reset-icon,\n.apexcharts-zoom-icon {\n transform: scale(.85)\n}\n\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n transform: scale(.7)\n}\n\n.apexcharts-zoomout-icon {\n margin-right: 3px\n}\n\n.apexcharts-pan-icon {\n transform: scale(.62);\n position: relative;\n left: 1px;\n top: 0\n}\n\n.apexcharts-pan-icon svg {\n fill: #fff;\n stroke: #6e8192;\n stroke-width: 2\n}\n\n.apexcharts-pan-icon.apexcharts-selected svg {\n stroke: #008ffb\n}\n\n.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {\n stroke: #333\n}\n\n.apexcharts-toolbar {\n position: absolute;\n z-index: 11;\n max-width: 176px;\n text-align: right;\n border-radius: 3px;\n padding: 0 6px 2px;\n display: flex;\n justify-content: space-between;\n align-items: center\n}\n\n.apexcharts-menu {\n background: #fff;\n position: absolute;\n top: 100%;\n border: 1px solid #ddd;\n border-radius: 3px;\n padding: 3px;\n right: 10px;\n opacity: 0;\n min-width: 110px;\n transition: .15s ease all;\n pointer-events: none\n}\n\n.apexcharts-menu.apexcharts-menu-open {\n opacity: 1;\n pointer-events: all;\n transition: .15s ease all\n}\n\n.apexcharts-menu-item {\n padding: 6px 7px;\n font-size: 12px;\n cursor: pointer\n}\n\n.apexcharts-theme-light .apexcharts-menu-item:hover {\n background: #eee\n}\n\n.apexcharts-theme-dark .apexcharts-menu {\n background: rgba(0, 0, 0, .7);\n color: #fff\n}\n\n@media screen and (min-width:768px) {\n .apexcharts-canvas:hover .apexcharts-toolbar {\n opacity: 1\n }\n}\n\n.apexcharts-canvas .apexcharts-element-hidden,\n.apexcharts-datalabel.apexcharts-element-hidden,\n.apexcharts-hide .apexcharts-series-points {\n opacity: 0;\n}\n\n.apexcharts-hidden-element-shown {\n opacity: 1;\n transition: 0.25s ease all;\n}\n\n.apexcharts-datalabel,\n.apexcharts-datalabel-label,\n.apexcharts-datalabel-value,\n.apexcharts-datalabels,\n.apexcharts-pie-label {\n cursor: default;\n pointer-events: none\n}\n\n.apexcharts-pie-label-delay {\n opacity: 0;\n animation-name: opaque;\n animation-duration: .3s;\n animation-fill-mode: forwards;\n animation-timing-function: ease\n}\n\n.apexcharts-radialbar-label {\n cursor: pointer;\n}\n\n.apexcharts-annotation-rect,\n.apexcharts-area-series .apexcharts-area,\n.apexcharts-gridline,\n.apexcharts-line,\n.apexcharts-point-annotation-label,\n.apexcharts-radar-series path:not(.apexcharts-marker),\n.apexcharts-radar-series polygon,\n.apexcharts-toolbar svg,\n.apexcharts-tooltip .apexcharts-marker,\n.apexcharts-xaxis-annotation-label,\n.apexcharts-yaxis-annotation-label,\n.apexcharts-zoom-rect,\n.no-pointer-events {\n pointer-events: none\n}\n\n.apexcharts-tooltip-active .apexcharts-marker {\n transition: .15s ease all\n}\n\n.apexcharts-radar-series .apexcharts-yaxis {\n pointer-events: none;\n}\n\n.resize-triggers {\n animation: 1ms resizeanim;\n visibility: hidden;\n opacity: 0;\n height: 100%;\n width: 100%;\n overflow: hidden\n}\n\n.contract-trigger:before,\n.resize-triggers,\n.resize-triggers>div {\n content: " ";\n display: block;\n position: absolute;\n top: 0;\n left: 0\n}\n\n.resize-triggers>div {\n height: 100%;\n width: 100%;\n background: #eee;\n overflow: auto\n}\n\n.contract-trigger:before {\n overflow: hidden;\n width: 200%;\n height: 200%\n}\n\n.apexcharts-bar-goals-markers {\n pointer-events: none\n}\n\n.apexcharts-bar-shadows {\n pointer-events: none\n}\n\n.apexcharts-rangebar-goals-markers {\n pointer-events: none\n}\n\n.apexcharts-disable-transitions * {\n transition: none !important;\n}';var c=(null===(l=e.opts.chart)||void 0===l?void 0:l.nonce)||e.w.config.chart.nonce;c&&a.setAttribute("nonce",c),s?r.prepend(a):!1!==e.w.config.chart.injectStyleSheet&&o.head.appendChild(a)}var h=e.create(e.w.config.series,{});if(!h)return t(e);e.mount(h).then(function(){"function"==typeof e.w.config.chart.events.mounted&&e.w.config.chart.events.mounted(e,e.w),e.events.fireEvent("mounted",[e,e.w]),t(h)}).catch(function(e){i(e)})}else i(new Error("Element not found"))})}},{key:"create",value:function(e,t){var i=this,n=this.w;new lr(this).initModules();var r=this.w.globals;if(r.noData=!1,r.animationEnded=!1,!w.elementExists(this.el))return r.animationEnded=!0,null;if(this.responsive.checkResponsiveConfig(t),n.config.xaxis.convertedCatToNumeric&&new Hi(n.config).convertCatToNumericXaxis(n.config,this.ctx),this.core.setupElements(),"treemap"===n.config.chart.type&&(n.config.grid.show=!1,n.config.yaxis[0].show=!1),0===r.svgWidth)return r.animationEnded=!0,null;var s=e;e.forEach(function(e,t){e.hidden&&(s=i.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:t}))});var o=Ci.checkComboSeries(s,n.config.chart.type);r.comboCharts=o.comboCharts,r.comboBarCount=o.comboBarCount;var a=s.every(function(e){return e.data&&0===e.data.length});(0===s.length||a&&r.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(s),this.theme.init(),new $i(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),r.noData&&r.collapsedSeries.length!==r.series.length&&!n.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),r.axisCharts&&(this.core.coreCalculations(),"category"!==n.config.xaxis.type&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=n.globals.minX,this.ctx.toolbar.maxX=n.globals.maxX),this.formatters.heatmapLabelFormatters(),new Ci(this).getLargestMarkerSize(),this.dimensions.plotCoords();var l=this.core.xySettings();this.grid.createGridMask();var c=this.core.plotChartType(s,l),h=new Xi(this);return h.bringForward(),n.config.dataLabels.background.enabled&&h.dataLabelsBackground(),this.core.shiftGraphPosition(),n.globals.dataPoints>50&&n.globals.dom.elWrap.classList.add("apexcharts-disable-transitions"),{elGraph:c,xyRatios:l,dimensions:{plot:{left:n.globals.translateX,top:n.globals.translateY,width:n.globals.gridWidth,height:n.globals.gridHeight}}}}},{key:"mount",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=this,n=i.w;return new Promise(function(r,s){if(null===i.el)return s(new Error("Not enough data to display or target element not found"));(null===t||n.globals.allSeriesCollapsed)&&i.series.handleNoData(),i.grid=new en(i);var o,a,l=i.grid.drawGrid();if(i.annotations=new Ni(i),i.annotations.drawImageAnnos(),i.annotations.drawTextAnnos(),"back"===n.config.grid.position&&(l&&n.globals.dom.elGraphical.add(l.el),null!=l&&null!==(o=l.elGridBorders)&&void 0!==o&&o.node&&n.globals.dom.elGraphical.add(l.elGridBorders)),Array.isArray(t.elGraph))for(var c=0;c<t.elGraph.length;c++)n.globals.dom.elGraphical.add(t.elGraph[c]);else n.globals.dom.elGraphical.add(t.elGraph);"front"===n.config.grid.position&&(l&&n.globals.dom.elGraphical.add(l.el),null!=l&&null!==(a=l.elGridBorders)&&void 0!==a&&a.node&&n.globals.dom.elGraphical.add(l.elGridBorders)),"front"===n.config.xaxis.crosshairs.position&&i.crosshairs.drawXCrosshairs(),"front"===n.config.yaxis[0].crosshairs.position&&i.crosshairs.drawYCrosshairs(),"treemap"!==n.config.chart.type&&i.axes.drawAxis(n.config.chart.type,l);var h=new Qi(e.ctx,l),d=new rn(e.ctx,l);if(null!==l&&(h.xAxisLabelCorrections(l.xAxisTickWidth),d.setYAxisTextAlignments(),n.config.yaxis.map(function(e,t){-1===n.globals.ignoreYAxisIndexes.indexOf(t)&&d.yAxisTitleRotate(t,e.opposite)})),i.annotations.drawAxesAnnotations(),!n.globals.noData){if(n.config.tooltip.enabled&&!n.globals.noData&&i.w.globals.tooltip.drawTooltip(t.xyRatios),n.globals.axisCharts&&(n.globals.isXNumeric||n.config.xaxis.convertedCatToNumeric||n.globals.isRangeBar))(n.config.chart.zoom.enabled||n.config.chart.selection&&n.config.chart.selection.enabled||n.config.chart.pan&&n.config.chart.pan.enabled)&&i.zoomPanSelection.init({xyRatios:t.xyRatios});else{var u=n.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(function(e){u[e]=!1})}n.config.chart.toolbar.show&&!n.globals.allSeriesCollapsed&&i.toolbar.createToolbar()}n.globals.memory.methodsToExec.length>0&&n.globals.memory.methodsToExec.forEach(function(e){e.method(e.params,!1,e.context)}),n.globals.axisCharts||n.globals.noData||i.core.resizeNonAxisCharts(),r(i)})}},{key:"destroy",value:function(){window.removeEventListener("resize",this.windowResizeHandler),function(e,t){var i=hr.get(t);i&&(i.disconnect(),hr.delete(t))}(this.el.parentNode,this.parentResizeHandler);var e=this.w.config.chart.id;e&&Apex._chartInstances.forEach(function(t,i){t.id===w.escapeString(e)&&Apex._chartInstances.splice(i,1)}),new cr(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.w;return o.globals.selection=void 0,this.lastUpdateOptions&&JSON.stringify(this.lastUpdateOptions)===JSON.stringify(e)?this:(e.series&&(this.data.resetParsingFlags(),this.series.resetSeries(!1,!0,!1),e.series.length&&e.series[0].data&&(e.series=e.series.map(function(e,i){return t.updateHelpers._extendSeries(e,i)})),this.updateHelpers.revertDefaultAxisMinMax()),e.xaxis&&(e=this.updateHelpers.forceXAxisUpdate(e)),e.yaxis&&(e=this.updateHelpers.forceYAxisUpdate(e)),o.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),e.theme&&(e=this.theme.updateThemeOptions(e)),this.updateHelpers._updateOptions(e,i,n,r,s))}},{key:"updateSeries",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.data.resetParsingFlags(),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(e,t,i)}},{key:"appendSeries",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.data.resetParsingFlags();var n=this.w.config.series.slice();return n.push(e),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(n,t,i)}},{key:"appendData",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this;i.data.resetParsingFlags(),i.w.globals.dataChanged=!0,i.series.getPreviousPaths();for(var n=i.w.config.series.slice(),r=0;r<n.length;r++)if(null!==e[r]&&void 0!==e[r])for(var s=0;s<e[r].data.length;s++)n[r].data.push(e[r].data[s]);return i.w.config.series=n,t&&(i.w.globals.initialSeries=w.clone(i.w.config.series)),this.update()}},{key:"update",value:function(e){var t=this;return new Promise(function(i,n){if(t.lastUpdateOptions&&JSON.stringify(t.lastUpdateOptions)===JSON.stringify(e))return i(t);t.lastUpdateOptions=w.clone(e),new cr(t.ctx).clear({isUpdating:!0});var r=t.create(t.w.config.series,e);if(!r)return i(t);t.mount(r).then(function(){"function"==typeof t.w.config.chart.events.updated&&t.w.config.chart.events.updated(t,t.w),t.events.fireEvent("updated",[t,t.w]),t.w.globals.isDirty=!0,i(t)}).catch(function(e){n(e)})})}},{key:"getSyncedCharts",value:function(){var e=this.getGroupedCharts(),t=[this];return e.length&&(t=[],e.forEach(function(e){t.push(e)})),t}},{key:"getGroupedCharts",value:function(){var e=this;return Apex._chartInstances.filter(function(e){if(e.group)return!0}).map(function(t){return e.w.config.chart.group===t.group?t.chart:e})}},{key:"toggleSeries",value:function(e){return this.series.toggleSeries(e)}},{key:"highlightSeriesOnLegendHover",value:function(e,t){return this.series.toggleSeriesOnHover(e,t)}},{key:"showSeries",value:function(e){this.series.showSeries(e)}},{key:"hideSeries",value:function(e){this.series.hideSeries(e)}},{key:"highlightSeries",value:function(e){this.series.highlightSeries(e)}},{key:"isSeriesHidden",value:function(e){this.series.isSeriesHidden(e)}},{key:"resetSeries",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.series.resetSeries(e,t)}},{key:"addEventListener",value:function(e,t){this.events.addEventListener(e,t)}},{key:"removeEventListener",value:function(e,t){this.events.removeEventListener(e,t)}},{key:"addXaxisAnnotation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=this;i&&(n=i),n.annotations.addXaxisAnnotationExternal(e,t,n)}},{key:"addYaxisAnnotation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=this;i&&(n=i),n.annotations.addYaxisAnnotationExternal(e,t,n)}},{key:"addPointAnnotation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=this;i&&(n=i),n.annotations.addPointAnnotationExternal(e,t,n)}},{key:"clearAnnotations",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=this;e&&(t=e),t.annotations.clearAnnotations(t)}},{key:"removeAnnotation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=this;t&&(i=t),i.annotations.removeAnnotation(i,e)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(e,t){return this.coreUtils.getSeriesTotalsXRange(e,t)}},{key:"getHighestValueInSeries",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new nn(this.ctx).getMinYMaxY(e).highestY}},{key:"getLowestValueInSeries",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new nn(this.ctx).getMinYMaxY(e).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(e,t){return this.updateHelpers.toggleDataPointSelection(e,t)}},{key:"zoomX",value:function(e,t){this.ctx.toolbar.zoomUpdateOptions(e,t)}},{key:"setLocale",value:function(e){this.localization.setCurrentLocaleValues(e)}},{key:"dataURI",value:function(e){return new Ki(this.ctx).dataURI(e)}},{key:"getSvgString",value:function(e){return new Ki(this.ctx).getSvgString(e)}},{key:"exportToCSV",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Ki(this.ctx).exportToCSV(e)}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var e=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(function(){e.w.globals.resized=!0,e.w.globals.dataChanged=!1,e.ctx.update()},150)}},{key:"_windowResizeHandler",value:function(){var e=this.w.config.chart.redrawOnWindowResize;"function"==typeof e&&(e=e()),e&&this._windowResize()}}],[{key:"getChartByID",value:function(e){var t=w.escapeString(e);if(Apex._chartInstances){var i=Apex._chartInstances.filter(function(e){return e.id===t})[0];return i&&i.chart}}},{key:"initOnLoad",value:function(){for(var t=document.querySelectorAll("[data-apexcharts]"),i=0;i<t.length;i++)new e(t[i],JSON.parse(t[i].getAttribute("data-options"))).render()}},{key:"exec",value:function(e,t){var i=this.getChartByID(e);if(i){i.w.globals.isExecCalled=!0;var n=null;if(-1!==i.publicMethods.indexOf(t)){for(var r=arguments.length,s=new Array(r>2?r-2:0),o=2;o<r;o++)s[o-2]=arguments[o];n=i[t].apply(i,s)}return n}}},{key:"merge",value:function(e,t){return w.extend(e,t)}},{key:"getThemePalettes",value:function(){return{palette1:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"],palette2:["#3F51B5","#03A9F4","#4CAF50","#F9CE1D","#FF9800"],palette3:["#33B2DF","#546E7A","#D4526E","#13D8AA","#A5978B"],palette4:["#4ECDC4","#C7F464","#81D4FA","#FD6A6A","#546E7A"],palette5:["#2B908F","#F9A3A4","#90EE7E","#FA4443","#69D2E7"],palette6:["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"],palette7:["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"],palette8:["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"],palette9:["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"],palette10:["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"]}}}]),e}()},9680:function(e,t,i){!function(e){"use strict";function t(e,t,i,n){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[i][0]:r[i][1]}function i(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return i(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return i(e)}return i(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return i(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return i(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},9703:(e,t,i)=>{"use strict";function n(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}i.d(t,{A:()=>n})},9722:function(e,t,i){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,i){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(i(5093))},9756:function(e,t,i){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(i(5093))},9760:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>r}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(5581);function r(e){return(((0,n.vq)(e)?e.ownerDocument:e.document)||window.document).documentElement}},9765:(e,t,i)=>{"use strict";if(i.d(t,{Gc:()=>o.A,KC:()=>s.A,UE:()=>r.A,UU:()=>a.A,V7:()=>d.A,ZM:()=>n.A,Zo:()=>h.A,cY:()=>c.A,jD:()=>l.A}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(6607);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(8256);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(1262);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(9068);if(/^(7(06|92|96)|140)$/.test(i.j))var a=i(644);if(/^(7(06|92|96)|140)$/.test(i.j))var l=i(9081);if(/^(7(06|92|96)|140)$/.test(i.j))var c=i(8490);if(/^(7(06|92|96)|140)$/.test(i.j))var h=i(5059);if(/^(7(06|92|96)|140)$/.test(i.j))var d=i(192)},9834:function(e,t,i){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(i(5093))},9846:function(e,t,i){!function(e){"use strict";function t(e,t,i,n){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return n||t?r[i][0]:r[i][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,i){return e>11?i?"d'o":"D'O":i?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(i(5093))},9849:function(e,t,i){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},i={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(e){return i[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,i){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(i(5093))},9875:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Alert:()=>se,Button:()=>ae,Carousel:()=>He,Collapse:()=>tt,Dropdown:()=>Mt,Modal:()=>ai,Offcanvas:()=>ki,Popover:()=>Ji,ScrollSpy:()=>cn,Tab:()=>In,Toast:()=>Gn,Tooltip:()=>$i});var n={};i.r(n),i.d(n,{afterMain:()=>r.EP,afterRead:()=>r.v5,afterWrite:()=>r.SE,applyStyles:()=>s.ZM,arrow:()=>s.UE,auto:()=>r.qZ,basePlacements:()=>r.OM,beforeMain:()=>r.LG,beforeRead:()=>r.ci,beforeWrite:()=>r.pA,bottom:()=>r.sQ,clippingParents:()=>r.WY,computeStyles:()=>s.KC,createPopper:()=>l.n4,createPopperBase:()=>o.n4,createPopperLite:()=>c.n4,detectOverflow:()=>a.A,end:()=>r._N,eventListeners:()=>s.Gc,flip:()=>s.UU,hide:()=>s.jD,left:()=>r.kb,main:()=>r.iW,modifierPhases:()=>r.GM,offset:()=>s.cY,placements:()=>r.DD,popper:()=>r.xf,popperGenerator:()=>o.UD,popperOffsets:()=>s.Zo,preventOverflow:()=>s.V7,read:()=>r.LF,reference:()=>r.ir,right:()=>r.pG,start:()=>r.ni,top:()=>r.Mn,variationPlacements:()=>r.Ol,viewport:()=>r.R9,write:()=>r.M9});var r=i(4278),s=i(9765),o=i(3424),a=i(9913),l=i(1576),c=i(6465),h=i(4692);const d=new Map,u={set(e,t,i){d.has(e)||d.set(e,new Map);const n=d.get(e);n.has(t)||0===n.size?n.set(t,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(e,t)=>d.has(e)&&d.get(e).get(t)||null,remove(e,t){if(!d.has(e))return;const i=d.get(e);i.delete(t),0===i.size&&d.delete(e)}},f="transitionend",p=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),e),m=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),g=e=>{e.dispatchEvent(new Event(f))},_=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),y=e=>_(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(p(e)):null,v=e=>{if(!_(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),i=e.closest("details:not([open])");if(!i)return t;if(i!==e){const t=e.closest("summary");if(t&&t.parentNode!==i)return!1;if(null===t)return!1}return t},x=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),b=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?b(e.parentNode):null},w=()=>{},S=e=>{e.offsetHeight},T=()=>h&&!document.body.hasAttribute("data-bs-no-jquery")?h:null,k=[],M=()=>"rtl"===document.documentElement.dir,A=e=>{var t;t=()=>{const t=T();if(t){const i=e.NAME,n=t.fn[i];t.fn[i]=e.jQueryInterface,t.fn[i].Constructor=e,t.fn[i].noConflict=()=>(t.fn[i]=n,e.jQueryInterface)}},"loading"===document.readyState?(k.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of k)e()}),k.push(t)):t()},C=(e,t=[],i=e)=>"function"==typeof e?e.call(...t):i,D=(e,t,i=!0)=>{if(!i)return void C(e);const n=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:i}=window.getComputedStyle(e);const n=Number.parseFloat(t),r=Number.parseFloat(i);return n||r?(t=t.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(i))):0})(t)+5;let r=!1;const s=({target:i})=>{i===t&&(r=!0,t.removeEventListener(f,s),C(e))};t.addEventListener(f,s),setTimeout(()=>{r||g(t)},n)},L=(e,t,i,n)=>{const r=e.length;let s=e.indexOf(t);return-1===s?!i&&n?e[r-1]:e[0]:(s+=i?1:-1,n&&(s=(s+r)%r),e[Math.max(0,Math.min(s,r-1))])},E=/[^.]*(?=\..*)\.|.*/,I=/\..*/,P=/::\d+$/,R={};let O=1;const z={mouseenter:"mouseover",mouseleave:"mouseout"},F=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function N(e,t){return t&&`${t}::${O++}`||e.uidEvent||O++}function Y(e){const t=N(e);return e.uidEvent=t,R[t]=R[t]||{},R[t]}function B(e,t,i=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===i)}function H(e,t,i){const n="string"==typeof t,r=n?i:t||i;let s=U(e);return F.has(s)||(s=e),[n,r,s]}function j(e,t,i,n,r){if("string"!=typeof t||!e)return;let[s,o,a]=H(t,i,n);if(t in z){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};o=e(o)}const l=Y(e),c=l[a]||(l[a]={}),h=B(c,o,s?i:null);if(h)return void(h.oneOff=h.oneOff&&r);const d=N(o,t.replace(E,"")),u=s?function(e,t,i){return function n(r){const s=e.querySelectorAll(t);for(let{target:o}=r;o&&o!==this;o=o.parentNode)for(const a of s)if(a===o)return G(r,{delegateTarget:o}),n.oneOff&&$.off(e,r.type,t,i),i.apply(o,[r])}}(e,i,o):function(e,t){return function i(n){return G(n,{delegateTarget:e}),i.oneOff&&$.off(e,n.type,t),t.apply(e,[n])}}(e,o);u.delegationSelector=s?i:null,u.callable=o,u.oneOff=r,u.uidEvent=d,c[d]=u,e.addEventListener(a,u,s)}function V(e,t,i,n,r){const s=B(t[i],n,r);s&&(e.removeEventListener(i,s,Boolean(r)),delete t[i][s.uidEvent])}function W(e,t,i,n){const r=t[i]||{};for(const[s,o]of Object.entries(r))s.includes(n)&&V(e,t,i,o.callable,o.delegationSelector)}function U(e){return e=e.replace(I,""),z[e]||e}const $={on(e,t,i,n){j(e,t,i,n,!1)},one(e,t,i,n){j(e,t,i,n,!0)},off(e,t,i,n){if("string"!=typeof t||!e)return;const[r,s,o]=H(t,i,n),a=o!==t,l=Y(e),c=l[o]||{},h=t.startsWith(".");if(void 0===s){if(h)for(const i of Object.keys(l))W(e,l,i,t.slice(1));for(const[i,n]of Object.entries(c)){const r=i.replace(P,"");a&&!t.includes(r)||V(e,l,o,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;V(e,l,o,s,r?i:null)}},trigger(e,t,i){if("string"!=typeof t||!e)return null;const n=T();let r=null,s=!0,o=!0,a=!1;t!==U(t)&&n&&(r=n.Event(t,i),n(e).trigger(r),s=!r.isPropagationStopped(),o=!r.isImmediatePropagationStopped(),a=r.isDefaultPrevented());const l=G(new Event(t,{bubbles:s,cancelable:!0}),i);return a&&l.preventDefault(),o&&e.dispatchEvent(l),l.defaultPrevented&&r&&r.preventDefault(),l}};function G(e,t={}){for(const[i,n]of Object.entries(t))try{e[i]=n}catch(t){Object.defineProperty(e,i,{configurable:!0,get:()=>n})}return e}function X(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function q(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const Z={setDataAttribute(e,t,i){e.setAttribute(`data-bs-${q(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${q(t)}`)},getDataAttributes(e){if(!e)return{};const t={},i=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),t[i]=X(e.dataset[n])}return t},getDataAttribute:(e,t)=>X(e.getAttribute(`data-bs-${q(t)}`))};class J{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const i=_(t)?Z.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},..._(t)?Z.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,n]of Object.entries(t)){const t=e[i],r=_(t)?"element":m(t);if(!new RegExp(n).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${r}" but expected type "${n}".`)}}}class K extends J{constructor(e,t){super(),(e=y(e))&&(this._element=e,this._config=this._getConfig(t),u.set(this._element,this.constructor.DATA_KEY,this))}dispose(){u.remove(this._element,this.constructor.DATA_KEY),$.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){D(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return u.get(y(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.8"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const Q=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let i=e.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),t=i&&"#"!==i?i.trim():null}return t?t.split(",").map(e=>p(e)).join(","):null},ee={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter(e=>e.matches(t)),parents(e,t){const i=[];let n=e.parentNode.closest(t);for(;n;)i.push(n),n=n.parentNode.closest(t);return i},prev(e,t){let i=e.previousElementSibling;for(;i;){if(i.matches(t))return[i];i=i.previousElementSibling}return[]},next(e,t){let i=e.nextElementSibling;for(;i;){if(i.matches(t))return[i];i=i.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(e=>`${e}:not([tabindex^="-"])`).join(",");return this.find(t,e).filter(e=>!x(e)&&v(e))},getSelectorFromElement(e){const t=Q(e);return t&&ee.findOne(t)?t:null},getElementFromSelector(e){const t=Q(e);return t?ee.findOne(t):null},getMultipleElementsFromSelector(e){const t=Q(e);return t?ee.find(t):[]}},te=(e,t="hide")=>{const i=`click.dismiss${e.EVENT_KEY}`,n=e.NAME;$.on(document,i,`[data-bs-dismiss="${n}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),x(this))return;const r=ee.getElementFromSelector(this)||this.closest(`.${n}`);e.getOrCreateInstance(r)[t]()})},ie=".bs.alert",ne=`close${ie}`,re=`closed${ie}`;class se extends K{static get NAME(){return"alert"}close(){if($.trigger(this._element,ne).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),$.trigger(this._element,re),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=se.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}te(se,"close"),A(se);const oe='[data-bs-toggle="button"]';class ae extends K{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=ae.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}$.on(document,"click.bs.button.data-api",oe,e=>{e.preventDefault();const t=e.target.closest(oe);ae.getOrCreateInstance(t).toggle()}),A(ae);const le=".bs.swipe",ce=`touchstart${le}`,he=`touchmove${le}`,de=`touchend${le}`,ue=`pointerdown${le}`,fe=`pointerup${le}`,pe={endCallback:null,leftCallback:null,rightCallback:null},me={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ge extends J{constructor(e,t){super(),this._element=e,e&&ge.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return pe}static get DefaultType(){return me}static get NAME(){return"swipe"}dispose(){$.off(this._element,le)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),C(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&C(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?($.on(this._element,ue,e=>this._start(e)),$.on(this._element,fe,e=>this._end(e)),this._element.classList.add("pointer-event")):($.on(this._element,ce,e=>this._start(e)),$.on(this._element,he,e=>this._move(e)),$.on(this._element,de,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const _e=".bs.carousel",ye=".data-api",ve="ArrowLeft",xe="ArrowRight",be="next",we="prev",Se="left",Te="right",ke=`slide${_e}`,Me=`slid${_e}`,Ae=`keydown${_e}`,Ce=`mouseenter${_e}`,De=`mouseleave${_e}`,Le=`dragstart${_e}`,Ee=`load${_e}${ye}`,Ie=`click${_e}${ye}`,Pe="carousel",Re="active",Oe=".active",ze=".carousel-item",Fe=Oe+ze,Ne={[ve]:Te,[xe]:Se},Ye={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Be={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class He extends K{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=ee.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===Pe&&this.cycle()}static get Default(){return Ye}static get DefaultType(){return Be}static get NAME(){return"carousel"}next(){this._slide(be)}nextWhenVisible(){!document.hidden&&v(this._element)&&this.next()}prev(){this._slide(we)}pause(){this._isSliding&&g(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?$.one(this._element,Me,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void $.one(this._element,Me,()=>this.to(e));const i=this._getItemIndex(this._getActive());if(i===e)return;const n=e>i?be:we;this._slide(n,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&$.on(this._element,Ae,e=>this._keydown(e)),"hover"===this._config.pause&&($.on(this._element,Ce,()=>this.pause()),$.on(this._element,De,()=>this._maybeEnableCycle())),this._config.touch&&ge.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of ee.find(".carousel-item img",this._element))$.on(e,Le,e=>e.preventDefault());const e={leftCallback:()=>this._slide(this._directionToOrder(Se)),rightCallback:()=>this._slide(this._directionToOrder(Te)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new ge(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=Ne[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=ee.findOne(Oe,this._indicatorsElement);t.classList.remove(Re),t.removeAttribute("aria-current");const i=ee.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add(Re),i.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const i=this._getActive(),n=e===be,r=t||L(this._getItems(),i,n,this._config.wrap);if(r===i)return;const s=this._getItemIndex(r),o=t=>$.trigger(this._element,t,{relatedTarget:r,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:s});if(o(ke).defaultPrevented)return;if(!i||!r)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=r;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";r.classList.add(c),S(r),i.classList.add(l),r.classList.add(l),this._queueCallback(()=>{r.classList.remove(l,c),r.classList.add(Re),i.classList.remove(Re,c,l),this._isSliding=!1,o(Me)},i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return ee.findOne(Fe,this._element)}_getItems(){return ee.find(ze,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return M()?e===Se?we:be:e===Se?be:we}_orderToDirection(e){return M()?e===we?Se:Te:e===we?Te:Se}static jQueryInterface(e){return this.each(function(){const t=He.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)})}}$.on(document,Ie,"[data-bs-slide], [data-bs-slide-to]",function(e){const t=ee.getElementFromSelector(this);if(!t||!t.classList.contains(Pe))return;e.preventDefault();const i=He.getOrCreateInstance(t),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===Z.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())}),$.on(window,Ee,()=>{const e=ee.find('[data-bs-ride="carousel"]');for(const t of e)He.getOrCreateInstance(t)}),A(He);const je=".bs.collapse",Ve=`show${je}`,We=`shown${je}`,Ue=`hide${je}`,$e=`hidden${je}`,Ge=`click${je}.data-api`,Xe="show",qe="collapse",Ze="collapsing",Je=`:scope .${qe} .${qe}`,Ke='[data-bs-toggle="collapse"]',Qe={parent:null,toggle:!0},et={parent:"(null|element)",toggle:"boolean"};class tt extends K{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const i=ee.find(Ke);for(const e of i){const t=ee.getSelectorFromElement(e),i=ee.find(t).filter(e=>e===this._element);null!==t&&i.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Qe}static get DefaultType(){return et}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(e=>e!==this._element).map(e=>tt.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning)return;if($.trigger(this._element,Ve).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove(qe),this._element.classList.add(Ze),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Ze),this._element.classList.add(qe,Xe),this._element.style[t]="",$.trigger(this._element,We)},this._element,!0),this._element.style[t]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if($.trigger(this._element,Ue).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,S(this._element),this._element.classList.add(Ze),this._element.classList.remove(qe,Xe);for(const e of this._triggerArray){const t=ee.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0,this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Ze),this._element.classList.add(qe),$.trigger(this._element,$e)},this._element,!0)}_isShown(e=this._element){return e.classList.contains(Xe)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=y(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(Ke);for(const t of e){const e=ee.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=ee.find(Je,this._config.parent);return ee.find(e,this._config.parent).filter(e=>!t.includes(e))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const i of e)i.classList.toggle("collapsed",!t),i.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const i=tt.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e]()}})}}$.on(document,Ge,Ke,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of ee.getMultipleElementsFromSelector(this))tt.getOrCreateInstance(e,{toggle:!1}).toggle()}),A(tt);const it="dropdown",nt=".bs.dropdown",rt=".data-api",st="ArrowUp",ot="ArrowDown",at=`hide${nt}`,lt=`hidden${nt}`,ct=`show${nt}`,ht=`shown${nt}`,dt=`click${nt}${rt}`,ut=`keydown${nt}${rt}`,ft=`keyup${nt}${rt}`,pt="show",mt='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',gt=`${mt}.${pt}`,_t=".dropdown-menu",yt=M()?"top-end":"top-start",vt=M()?"top-start":"top-end",xt=M()?"bottom-end":"bottom-start",bt=M()?"bottom-start":"bottom-end",wt=M()?"left-start":"right-start",St=M()?"right-start":"left-start",Tt={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},kt={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Mt extends K{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=ee.next(this._element,_t)[0]||ee.prev(this._element,_t)[0]||ee.findOne(_t,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Tt}static get DefaultType(){return kt}static get NAME(){return it}toggle(){return this._isShown()?this.hide():this.show()}show(){if(x(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!$.trigger(this._element,ct,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))$.on(e,"mouseover",w);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(pt),this._element.classList.add(pt),$.trigger(this._element,ht,e)}}hide(){if(x(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!$.trigger(this._element,at,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))$.off(e,"mouseover",w);this._popper&&this._popper.destroy(),this._menu.classList.remove(pt),this._element.classList.remove(pt),this._element.setAttribute("aria-expanded","false"),Z.removeDataAttribute(this._menu,"popper"),$.trigger(this._element,lt,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!_(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${it.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){let e=this._element;"parent"===this._config.reference?e=this._parent:_(this._config.reference)?e=y(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=l.n4(e,this._menu,t)}_isShown(){return this._menu.classList.contains(pt)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return wt;if(e.classList.contains("dropstart"))return St;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?vt:yt:t?bt:xt}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(Z.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...C(this._config.popperConfig,[void 0,e])}}_selectMenuItem({key:e,target:t}){const i=ee.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(e=>v(e));i.length&&L(i,t,e===ot,!i.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=Mt.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=ee.find(gt);for(const i of t){const t=Mt.getInstance(i);if(!t||!1===t._config.autoClose)continue;const n=e.composedPath(),r=n.includes(t._menu);if(n.includes(t._element)||"inside"===t._config.autoClose&&!r||"outside"===t._config.autoClose&&r)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const s={relatedTarget:t._element};"click"===e.type&&(s.clickEvent=e),t._completeHide(s)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),i="Escape"===e.key,n=[st,ot].includes(e.key);if(!n&&!i)return;if(t&&!i)return;e.preventDefault();const r=this.matches(mt)?this:ee.prev(this,mt)[0]||ee.next(this,mt)[0]||ee.findOne(mt,e.delegateTarget.parentNode),s=Mt.getOrCreateInstance(r);if(n)return e.stopPropagation(),s.show(),void s._selectMenuItem(e);s._isShown()&&(e.stopPropagation(),s.hide(),r.focus())}}$.on(document,ut,mt,Mt.dataApiKeydownHandler),$.on(document,ut,_t,Mt.dataApiKeydownHandler),$.on(document,dt,Mt.clearMenus),$.on(document,ft,Mt.clearMenus),$.on(document,dt,mt,function(e){e.preventDefault(),Mt.getOrCreateInstance(this).toggle()}),A(Mt);const At="backdrop",Ct="show",Dt=`mousedown.bs.${At}`,Lt={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Et={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class It extends J{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return Lt}static get DefaultType(){return Et}static get NAME(){return At}show(e){if(!this._config.isVisible)return void C(e);this._append();const t=this._getElement();this._config.isAnimated&&S(t),t.classList.add(Ct),this._emulateAnimation(()=>{C(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(Ct),this._emulateAnimation(()=>{this.dispose(),C(e)})):C(e)}dispose(){this._isAppended&&($.off(this._element,Dt),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=y(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),$.on(e,Dt,()=>{C(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){D(e,this._getElement(),this._config.isAnimated)}}const Pt=".bs.focustrap",Rt=`focusin${Pt}`,Ot=`keydown.tab${Pt}`,zt="backward",Ft={autofocus:!0,trapElement:null},Nt={autofocus:"boolean",trapElement:"element"};class Yt extends J{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Ft}static get DefaultType(){return Nt}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),$.off(document,Pt),$.on(document,Rt,e=>this._handleFocusin(e)),$.on(document,Ot,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,$.off(document,Pt))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const i=ee.focusableChildren(t);0===i.length?t.focus():this._lastTabNavDirection===zt?i[i.length-1].focus():i[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?zt:"forward")}}const Bt=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Ht=".sticky-top",jt="padding-right",Vt="margin-right";class Wt{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,jt,t=>t+e),this._setElementAttributes(Bt,jt,t=>t+e),this._setElementAttributes(Ht,Vt,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,jt),this._resetElementAttributes(Bt,jt),this._resetElementAttributes(Ht,Vt)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,i){const n=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+n)return;this._saveInitialAttribute(e,t);const r=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${i(Number.parseFloat(r))}px`)})}_saveInitialAttribute(e,t){const i=e.style.getPropertyValue(t);i&&Z.setDataAttribute(e,t,i)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{const i=Z.getDataAttribute(e,t);null!==i?(Z.removeDataAttribute(e,t),e.style.setProperty(t,i)):e.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(_(e))t(e);else for(const i of ee.find(e,this._element))t(i)}}const Ut=".bs.modal",$t=`hide${Ut}`,Gt=`hidePrevented${Ut}`,Xt=`hidden${Ut}`,qt=`show${Ut}`,Zt=`shown${Ut}`,Jt=`resize${Ut}`,Kt=`click.dismiss${Ut}`,Qt=`mousedown.dismiss${Ut}`,ei=`keydown.dismiss${Ut}`,ti=`click${Ut}.data-api`,ii="modal-open",ni="show",ri="modal-static",si={backdrop:!0,focus:!0,keyboard:!0},oi={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class ai extends K{constructor(e,t){super(e,t),this._dialog=ee.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Wt,this._addEventListeners()}static get Default(){return si}static get DefaultType(){return oi}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||$.trigger(this._element,qt,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(ii),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){this._isShown&&!this._isTransitioning&&($.trigger(this._element,$t).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(ni),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){$.off(window,Ut),$.off(this._dialog,Ut),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new It({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Yt({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=ee.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),S(this._element),this._element.classList.add(ni),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,$.trigger(this._element,Zt,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){$.on(this._element,ei,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),$.on(window,Jt,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),$.on(this._element,Qt,e=>{$.one(this._element,Kt,t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(ii),this._resetAdjustments(),this._scrollBar.reset(),$.trigger(this._element,Xt)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if($.trigger(this._element,Gt).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(ri)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(ri),this._queueCallback(()=>{this._element.classList.remove(ri),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),i=t>0;if(i&&!e){const e=M()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!i&&e){const e=M()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const i=ai.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e](t)}})}}$.on(document,ti,'[data-bs-toggle="modal"]',function(e){const t=ee.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),$.one(t,qt,e=>{e.defaultPrevented||$.one(t,Xt,()=>{v(this)&&this.focus()})});const i=ee.findOne(".modal.show");i&&ai.getInstance(i).hide(),ai.getOrCreateInstance(t).toggle(this)}),te(ai),A(ai);const li=".bs.offcanvas",ci=".data-api",hi=`load${li}${ci}`,di="show",ui="showing",fi="hiding",pi=".offcanvas.show",mi=`show${li}`,gi=`shown${li}`,_i=`hide${li}`,yi=`hidePrevented${li}`,vi=`hidden${li}`,xi=`resize${li}`,bi=`click${li}${ci}`,wi=`keydown.dismiss${li}`,Si={backdrop:!0,keyboard:!0,scroll:!1},Ti={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class ki extends K{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Si}static get DefaultType(){return Ti}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||$.trigger(this._element,mi,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Wt).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(ui),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(di),this._element.classList.remove(ui),$.trigger(this._element,gi,{relatedTarget:e})},this._element,!0))}hide(){this._isShown&&($.trigger(this._element,_i).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(fi),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(di,fi),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Wt).reset(),$.trigger(this._element,vi)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new It({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():$.trigger(this._element,yi)}:null})}_initializeFocusTrap(){return new Yt({trapElement:this._element})}_addEventListeners(){$.on(this._element,wi,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():$.trigger(this._element,yi))})}static jQueryInterface(e){return this.each(function(){const t=ki.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}$.on(document,bi,'[data-bs-toggle="offcanvas"]',function(e){const t=ee.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),x(this))return;$.one(t,vi,()=>{v(this)&&this.focus()});const i=ee.findOne(pi);i&&i!==t&&ki.getInstance(i).hide(),ki.getOrCreateInstance(t).toggle(this)}),$.on(window,hi,()=>{for(const e of ee.find(pi))ki.getOrCreateInstance(e).show()}),$.on(window,xi,()=>{for(const e of ee.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&ki.getOrCreateInstance(e).hide()}),te(ki),A(ki);const Mi={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Ai=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Ci=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Di=(e,t)=>{const i=e.nodeName.toLowerCase();return t.includes(i)?!Ai.has(i)||Boolean(Ci.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(i))},Li={allowList:Mi,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Ei={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Ii={entry:"(string|element|function|null)",selector:"(string|element)"};class Pi extends J{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return Li}static get DefaultType(){return Ei}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,i]of Object.entries(this._config.content))this._setContent(e,i,t);const t=e.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&t.classList.add(...i.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,i]of Object.entries(e))super._typeCheckConfig({selector:t,entry:i},Ii)}_setContent(e,t,i){const n=ee.findOne(i,e);n&&((t=this._resolvePossibleFunction(t))?_(t)?this._putElementInTemplate(y(t),n):this._config.html?n.innerHTML=this._maybeSanitize(t):n.textContent=t:n.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,i){if(!e.length)return e;if(i&&"function"==typeof i)return i(e);const n=(new window.DOMParser).parseFromString(e,"text/html"),r=[].concat(...n.body.querySelectorAll("*"));for(const e of r){const i=e.nodeName.toLowerCase();if(!Object.keys(t).includes(i)){e.remove();continue}const n=[].concat(...e.attributes),r=[].concat(t["*"]||[],t[i]||[]);for(const t of n)Di(t,r)||e.removeAttribute(t.nodeName)}return n.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return C(e,[void 0,this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const Ri=new Set(["sanitize","allowList","sanitizeFn"]),Oi="fade",zi="show",Fi=".tooltip-inner",Ni=".modal",Yi="hide.bs.modal",Bi="hover",Hi="focus",ji="click",Vi={AUTO:"auto",TOP:"top",RIGHT:M()?"left":"right",BOTTOM:"bottom",LEFT:M()?"right":"left"},Wi={allowList:Mi,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},Ui={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class $i extends K{constructor(e,t){super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Wi}static get DefaultType(){return Ui}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),$.off(this._element.closest(Ni),Yi,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=$.trigger(this._element,this.constructor.eventName("show")),t=(b(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),$.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(zi),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))$.on(e,"mouseover",w);this._queueCallback(()=>{$.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!$.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(zi),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))$.off(e,"mouseover",w);this._activeTrigger[ji]=!1,this._activeTrigger[Hi]=!1,this._activeTrigger[Bi]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),$.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(Oi,zi),t.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",i),this._isAnimated()&&t.classList.add(Oi),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new Pi({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Fi]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Oi)}_isShown(){return this.tip&&this.tip.classList.contains(zi)}_createPopper(e){const t=C(this._config.placement,[this,e,this._element]),i=Vi[t.toUpperCase()];return l.n4(this._element,e,this._getPopperConfig(i))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return C(e,[this._element,this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...C(this._config.popperConfig,[void 0,t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)$.on(this._element,this.constructor.eventName("click"),this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger[ji]=!(t._isShown()&&t._activeTrigger[ji]),t.toggle()});else if("manual"!==t){const e=t===Bi?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=t===Bi?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");$.on(this._element,e,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?Hi:Bi]=!0,t._enter()}),$.on(this._element,i,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?Hi:Bi]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},$.on(this._element.closest(Ni),Yi,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=Z.getDataAttributes(this._element);for(const e of Object.keys(t))Ri.has(e)&&delete t[e];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:y(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,i]of Object.entries(this._config))this.constructor.Default[t]!==i&&(e[t]=i);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=$i.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}A($i);const Gi=".popover-header",Xi=".popover-body",qi={...$i.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},Zi={...$i.DefaultType,content:"(null|string|element|function)"};class Ji extends $i{static get Default(){return qi}static get DefaultType(){return Zi}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Gi]:this._getTitle(),[Xi]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=Ji.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}A(Ji);const Ki=".bs.scrollspy",Qi=`activate${Ki}`,en=`click${Ki}`,tn=`load${Ki}.data-api`,nn="active",rn="[href]",sn=".nav-link",on=`${sn}, .nav-item > ${sn}, .list-group-item`,an={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},ln={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class cn extends K{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return an}static get DefaultType(){return ln}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=y(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(e=>Number.parseFloat(e))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&($.off(this._config.target,en),$.on(this._config.target,en,rn,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const i=this._rootElement||window,n=t.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(e=>this._observerCallback(e),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),i=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},n=(this._rootElement||document.documentElement).scrollTop,r=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const s of e){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(s));continue}const e=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&e){if(i(s),!n)return}else r||e||i(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=ee.find(rn,this._config.target);for(const t of e){if(!t.hash||x(t))continue;const e=ee.findOne(decodeURI(t.hash),this._element);v(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(nn),this._activateParents(e),$.trigger(this._element,Qi,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))ee.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(nn);else for(const t of ee.parents(e,".nav, .list-group"))for(const e of ee.prev(t,on))e.classList.add(nn)}_clearActiveClass(e){e.classList.remove(nn);const t=ee.find(`${rn}.${nn}`,e);for(const e of t)e.classList.remove(nn)}static jQueryInterface(e){return this.each(function(){const t=cn.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}$.on(window,tn,()=>{for(const e of ee.find('[data-bs-spy="scroll"]'))cn.getOrCreateInstance(e)}),A(cn);const hn=".bs.tab",dn=`hide${hn}`,un=`hidden${hn}`,fn=`show${hn}`,pn=`shown${hn}`,mn=`click${hn}`,gn=`keydown${hn}`,_n=`load${hn}`,yn="ArrowLeft",vn="ArrowRight",xn="ArrowUp",bn="ArrowDown",wn="Home",Sn="End",Tn="active",kn="fade",Mn="show",An=".dropdown-toggle",Cn=`:not(${An})`,Dn='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Ln=`.nav-link${Cn}, .list-group-item${Cn}, [role="tab"]${Cn}, ${Dn}`,En=`.${Tn}[data-bs-toggle="tab"], .${Tn}[data-bs-toggle="pill"], .${Tn}[data-bs-toggle="list"]`;class In extends K{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),$.on(this._element,gn,e=>this._keydown(e)))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),i=t?$.trigger(t,dn,{relatedTarget:e}):null;$.trigger(e,fn,{relatedTarget:t}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){e&&(e.classList.add(Tn),this._activate(ee.getElementFromSelector(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),$.trigger(e,pn,{relatedTarget:t})):e.classList.add(Mn)},e,e.classList.contains(kn)))}_deactivate(e,t){e&&(e.classList.remove(Tn),e.blur(),this._deactivate(ee.getElementFromSelector(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),$.trigger(e,un,{relatedTarget:t})):e.classList.remove(Mn)},e,e.classList.contains(kn)))}_keydown(e){if(![yn,vn,xn,bn,wn,Sn].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(e=>!x(e));let i;if([wn,Sn].includes(e.key))i=t[e.key===wn?0:t.length-1];else{const n=[vn,bn].includes(e.key);i=L(t,e.target,n,!0)}i&&(i.focus({preventScroll:!0}),In.getOrCreateInstance(i).show())}_getChildren(){return ee.find(Ln,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),i=this._getOuterElement(e);e.setAttribute("aria-selected",t),i!==e&&this._setAttributeIfNotExists(i,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=ee.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const i=this._getOuterElement(e);if(!i.classList.contains("dropdown"))return;const n=(e,n)=>{const r=ee.findOne(e,i);r&&r.classList.toggle(n,t)};n(An,Tn),n(".dropdown-menu",Mn),i.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,i){e.hasAttribute(t)||e.setAttribute(t,i)}_elemIsActive(e){return e.classList.contains(Tn)}_getInnerElement(e){return e.matches(Ln)?e:ee.findOne(Ln,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each(function(){const t=In.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}$.on(document,mn,Dn,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),x(this)||In.getOrCreateInstance(this).show()}),$.on(window,_n,()=>{for(const e of ee.find(En))In.getOrCreateInstance(e)}),A(In);const Pn=".bs.toast",Rn=`mouseover${Pn}`,On=`mouseout${Pn}`,zn=`focusin${Pn}`,Fn=`focusout${Pn}`,Nn=`hide${Pn}`,Yn=`hidden${Pn}`,Bn=`show${Pn}`,Hn=`shown${Pn}`,jn="hide",Vn="show",Wn="showing",Un={animation:"boolean",autohide:"boolean",delay:"number"},$n={animation:!0,autohide:!0,delay:5e3};class Gn extends K{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return $n}static get DefaultType(){return Un}static get NAME(){return"toast"}show(){$.trigger(this._element,Bn).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(jn),S(this._element),this._element.classList.add(Vn,Wn),this._queueCallback(()=>{this._element.classList.remove(Wn),$.trigger(this._element,Hn),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&($.trigger(this._element,Nn).defaultPrevented||(this._element.classList.add(Wn),this._queueCallback(()=>{this._element.classList.add(jn),this._element.classList.remove(Wn,Vn),$.trigger(this._element,Yn)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Vn),super.dispose()}isShown(){return this._element.classList.contains(Vn)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const i=e.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){$.on(this._element,Rn,e=>this._onInteraction(e,!0)),$.on(this._element,On,e=>this._onInteraction(e,!1)),$.on(this._element,zn,e=>this._onInteraction(e,!0)),$.on(this._element,Fn,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Gn.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}})}}te(Gn),A(Gn)},9913:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>u}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(2883);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(9760);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(6354);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(1815);if(/^(7(06|92|96)|140)$/.test(i.j))var a=i(4426);if(/^(7(06|92|96)|140)$/.test(i.j))var l=i(4278);if(/^(7(06|92|96)|140)$/.test(i.j))var c=i(5581);if(/^(7(06|92|96)|140)$/.test(i.j))var h=i(4318);if(/^(7(06|92|96)|140)$/.test(i.j))var d=i(1007);function u(e,t){void 0===t&&(t={});var i=t,u=i.placement,f=void 0===u?e.placement:u,p=i.strategy,m=void 0===p?e.strategy:p,g=i.boundary,_=void 0===g?l.WY:g,y=i.rootBoundary,v=void 0===y?l.R9:y,x=i.elementContext,b=void 0===x?l.xf:x,w=i.altBoundary,S=void 0!==w&&w,T=i.padding,k=void 0===T?0:T,M=(0,h.A)("number"!=typeof k?k:(0,d.A)(k,l.OM)),A=b===l.xf?l.ir:l.xf,C=e.rects.popper,D=e.elements[S?A:b],L=(0,n.A)((0,c.vq)(D)?D:D.contextElement||(0,r.A)(e.elements.popper),_,v,m),E=(0,s.A)(e.elements.reference),I=(0,o.A)({reference:E,element:C,strategy:"absolute",placement:f}),P=(0,a.A)(Object.assign({},C,I)),R=b===l.xf?P:E,O={top:L.top-R.top+M.top,bottom:R.bottom-L.bottom+M.bottom,left:L.left-R.left+M.left,right:R.right-L.right+M.right},z=e.modifiersData.offset;if(b===l.xf&&z){var F=z[f];Object.keys(O).forEach(function(e){var t=[l.pG,l.sQ].indexOf(e)>=0?1:-1,i=[l.Mn,l.sQ].indexOf(e)>=0?"y":"x";O[e]+=F[i]*t})}return O}},9970:(e,t,i)=>{"use strict";if(i.d(t,{A:()=>a}),/^(7(06|92|96)|140)$/.test(i.j))var n=i(2083);if(/^(7(06|92|96)|140)$/.test(i.j))var r=i(134);if(/^(7(06|92|96)|140)$/.test(i.j))var s=i(7604);if(/^(7(06|92|96)|140)$/.test(i.j))var o=i(5581);function a(e){return["html","body","#document"].indexOf((0,s.A)(e))>=0?e.ownerDocument.body:(0,o.sb)(e)&&(0,r.A)(e)?e:a((0,n.A)(e))}}}]); |